@moonshot-ai/kimi-code 0.31.1 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/main.mjs +34956 -13771
  2. package/dist-web/assets/{CodeBlockNode-DxKllCdY.js → CodeBlockNode-pVrDnT5M.js} +2 -2
  3. package/dist-web/assets/DesignSystemView-B7NHKYWW.js +13 -0
  4. package/dist-web/assets/DesignSystemView-BOdJHjg1.css +1 -0
  5. package/dist-web/assets/NotoSansSC_wght_-BkPpiACN.woff2 +0 -0
  6. package/dist-web/assets/SchibstedGrotesk-Italic_wght_-DjkBGo1z.woff2 +0 -0
  7. package/dist-web/assets/SchibstedGrotesk_wght_-DIzGrWVg.woff2 +0 -0
  8. package/dist-web/assets/{Tooltip-CLzA0dLY.js → Tooltip-DP9j1yrm.js} +1 -1
  9. package/dist-web/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  10. package/dist-web/assets/abnfDiagram-VRR7QNED-BHRZ0kDP.js +1 -0
  11. package/dist-web/assets/abnfDiagram-VRR7QNED-CJZC9dED.js +1 -0
  12. package/dist-web/assets/arc-Bh_RIraT.js +1 -0
  13. package/dist-web/assets/arc-DC-qDOw3.js +1 -0
  14. package/dist-web/assets/architectureDiagram-ZJ3FMSHR-DMo1NOCy.js +36 -0
  15. package/dist-web/assets/architectureDiagram-ZJ3FMSHR-Dmu6U5j9.js +36 -0
  16. package/dist-web/assets/blockDiagram-677ZJIJ3-BB6RrvwG.js +132 -0
  17. package/dist-web/assets/blockDiagram-677ZJIJ3-COOJd_Qw.js +132 -0
  18. package/dist-web/assets/{c4Diagram-AAUBKEIU-DtzacMnD.js → c4Diagram-LMCZKHZV-BBbSgEmy.js} +1 -1
  19. package/dist-web/assets/{c4Diagram-AAUBKEIU-DtO_U08K.js → c4Diagram-LMCZKHZV-CTIN-u6u.js} +2 -2
  20. package/dist-web/assets/channel-CaU-3qXj.js +1 -0
  21. package/dist-web/assets/channel-DV0CaBk6.js +1 -0
  22. package/dist-web/assets/{chunk-QZHKN3VN-GMC4JHFn.js → chunk-2Q5K7J3B-BJB08iqf.js} +1 -1
  23. package/dist-web/assets/{chunk-QZHKN3VN-_Rz9_NuS.js → chunk-2Q5K7J3B-DzU6gBth.js} +1 -1
  24. package/dist-web/assets/{chunk-ND2GUHAM-C3emWcK-.js → chunk-32BRIVSS-D2R4swWR.js} +1 -1
  25. package/dist-web/assets/{chunk-ND2GUHAM-C4-rwdcv.js → chunk-32BRIVSS-Dvm33eUZ.js} +1 -1
  26. package/dist-web/assets/{chunk-FMBD7UC4-B7DtFL7B.js → chunk-5VM5RSS4-DNp0lB9r.js} +1 -1
  27. package/dist-web/assets/{chunk-FMBD7UC4-B2zs_Y-d.js → chunk-5VM5RSS4-D_-fS_fu.js} +1 -1
  28. package/dist-web/assets/chunk-EX3LRPZG-8FB3nzxX.js +231 -0
  29. package/dist-web/assets/chunk-EX3LRPZG-DTDAbra3.js +231 -0
  30. package/dist-web/assets/{chunk-4BX2VUAB-DTAOb1Kz.js → chunk-JWPE2WC7-BiIZjhuH.js} +1 -1
  31. package/dist-web/assets/{chunk-4BX2VUAB-WqrE2gaw.js → chunk-JWPE2WC7-K16PVern.js} +1 -1
  32. package/dist-web/assets/chunk-MOJQB5TN-CAYle-Q0.js +88 -0
  33. package/dist-web/assets/chunk-MOJQB5TN-Dk056XM2.js +88 -0
  34. package/dist-web/assets/chunk-RYQCIY6F-BQRhK4dT.js +1 -0
  35. package/dist-web/assets/chunk-RYQCIY6F-nfBZcgde.js +1 -0
  36. package/dist-web/assets/{chunk-727SXJPM-B_col3ZF.js → chunk-V7JOEXUC-DIDk-4Yh.js} +5 -5
  37. package/dist-web/assets/{chunk-727SXJPM-Dn5wkDO_.js → chunk-V7JOEXUC-Hvv4JzpK.js} +5 -5
  38. package/dist-web/assets/{chunk-2J33WTMH-Bmvll7Mb.js → chunk-VR4S4FIN-Cveor6Gg.js} +1 -1
  39. package/dist-web/assets/{chunk-2J33WTMH-w4sdiKFO.js → chunk-VR4S4FIN-DyQqumpX.js} +1 -1
  40. package/dist-web/assets/{chunk-55IACEB6-B-8C29Gy.js → chunk-XXDRQBXY-CcyRETTg.js} +1 -1
  41. package/dist-web/assets/{chunk-55IACEB6-B5dE1-Um.js → chunk-XXDRQBXY-DIG3diJW.js} +1 -1
  42. package/dist-web/assets/classDiagram-OUVF2IWQ-DSlPMBy0.js +1 -0
  43. package/dist-web/assets/classDiagram-OUVF2IWQ-M3sHTXov.js +1 -0
  44. package/dist-web/assets/classDiagram-v2-EOCWNBFH-DSlPMBy0.js +1 -0
  45. package/dist-web/assets/classDiagram-v2-EOCWNBFH-M3sHTXov.js +1 -0
  46. package/dist-web/assets/{cose-bilkent-S5V4N54A-Bi19n8m-.js → cose-bilkent-JH36ORCC-DtaWDLTi.js} +1 -1
  47. package/dist-web/assets/cose-bilkent-JH36ORCC-QGxEehq4.js +1 -0
  48. package/dist-web/assets/cynefin-VYW2F7L2-B2u2H2Wf.js +178 -0
  49. package/dist-web/assets/cynefin-VYW2F7L2-C-EfYT07.js +178 -0
  50. package/dist-web/assets/cynefinDiagram-TSTJHNR4-BQ71O6Hg.js +62 -0
  51. package/dist-web/assets/cynefinDiagram-TSTJHNR4-Dkif7MEa.js +62 -0
  52. package/dist-web/assets/cytoscape.esm-OyMbaexL.js +331 -0
  53. package/dist-web/assets/dagre-VKFMJZFB-BbS-B0nZ.js +4 -0
  54. package/dist-web/assets/dagre-VKFMJZFB-DkhizOKY.js +4 -0
  55. package/dist-web/assets/{diagram-KO2AKTUF-CFQs13i5.js → diagram-FQU43EPY-B-gwgIvJ.js} +3 -3
  56. package/dist-web/assets/{diagram-KO2AKTUF-E1kGutBk.js → diagram-FQU43EPY-BgGpYQg7.js} +3 -3
  57. package/dist-web/assets/diagram-G47NLZAW-CvD1s5f3.js +24 -0
  58. package/dist-web/assets/diagram-G47NLZAW-DLPxt9_R.js +24 -0
  59. package/dist-web/assets/{diagram-LMA3HP47-He5zlyMt.js → diagram-NH7WQ7WH-CDCGorvP.js} +2 -2
  60. package/dist-web/assets/diagram-NH7WQ7WH-CkFCAjqP.js +24 -0
  61. package/dist-web/assets/diagram-OA4YK3LP-BdAbVrin.js +30 -0
  62. package/dist-web/assets/diagram-OA4YK3LP-XuNp_Rrf.js +30 -0
  63. package/dist-web/assets/diagram-WEI45ONY-BxyPHaUz.js +41 -0
  64. package/dist-web/assets/diagram-WEI45ONY-fzoSDldI.js +41 -0
  65. package/dist-web/assets/ebnfDiagram-CCIWWBDH-COHiNk9f.js +1 -0
  66. package/dist-web/assets/ebnfDiagram-CCIWWBDH-um5jZ6Ya.js +1 -0
  67. package/dist-web/assets/erDiagram-Q63AITRT-BSjlDjqv.js +85 -0
  68. package/dist-web/assets/erDiagram-Q63AITRT-ClZyl3be.js +85 -0
  69. package/dist-web/assets/flowDiagram-23GEKE2U-Cda1-vDp.js +156 -0
  70. package/dist-web/assets/flowDiagram-23GEKE2U-DXiygPDp.js +156 -0
  71. package/dist-web/assets/ganttDiagram-NO4QXBWP-BIUgGX1M.js +292 -0
  72. package/dist-web/assets/ganttDiagram-NO4QXBWP-BRVPZvRL.js +292 -0
  73. package/dist-web/assets/gitGraphDiagram-IHSO6WYX-BfyW9kzv.js +106 -0
  74. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DMbTATyw.js → gitGraphDiagram-IHSO6WYX-CSxhzmKP.js} +3 -3
  75. package/dist-web/assets/{graph-BwjfAU3j.js → graph-CAUpWmoK.js} +1 -1
  76. package/dist-web/assets/{graph--OzhPTMs.js → graph-DOmOIIwC.js} +1 -1
  77. package/dist-web/assets/index-B-HzRssS.js +626 -0
  78. package/dist-web/assets/index-C6xpOIeW.css +1 -0
  79. package/dist-web/assets/{index-B2ou3JmJ.js → index-CALEJJyh.js} +2 -2
  80. package/dist-web/assets/index-DUhLXAkw.js +153 -0
  81. package/dist-web/assets/index-ZTpPpnYb.js +1428 -0
  82. package/dist-web/assets/{index10-pQAlOV_D.js → index10-BA5VPLT7.js} +1 -1
  83. package/dist-web/assets/{index11-Jj0EtwVs.js → index11-BTFBrOND.js} +1 -1
  84. package/dist-web/assets/{index5-DYtlr_77.js → index5-RZzprraT.js} +1 -1
  85. package/dist-web/assets/{index6-C3SLqmgw.js → index6-CHOJPToe.js} +1 -1
  86. package/dist-web/assets/{index7-CNIa1-2e.js → index7-BqOx7RWV.js} +1 -1
  87. package/dist-web/assets/{index8-B7--CG9b.js → index8-CNrUHH_V.js} +1 -1
  88. package/dist-web/assets/infoDiagram-FWYZ7A6U-BWKmR6mQ.js +2 -0
  89. package/dist-web/assets/{infoDiagram-5YYISTIA-2JF3XEdD.js → infoDiagram-FWYZ7A6U-CWo8K1xi.js} +1 -1
  90. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-C5OstRVV.js → ishikawaDiagram-FXEZZL3T-CDU07xJY.js} +5 -5
  91. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-D5eudraB.js → ishikawaDiagram-FXEZZL3T-Dxub-WlA.js} +5 -5
  92. package/dist-web/assets/{journeyDiagram-JHISSGLW-yctdo4bX.js → journeyDiagram-5HDEW3XC-3dD9Ti8S.js} +1 -1
  93. package/dist-web/assets/{journeyDiagram-JHISSGLW-KmL5ZWxl.js → journeyDiagram-5HDEW3XC-BbQqB9Jp.js} +2 -2
  94. package/dist-web/assets/k3_doodle1-27EZ2HSw.riv +0 -0
  95. package/dist-web/assets/{kanban-definition-UN3LZRKU-CxBCv27E.js → kanban-definition-HUTT4EX6-C6jIGqYx.js} +5 -5
  96. package/dist-web/assets/{kanban-definition-UN3LZRKU-Cw5DexaK.js → kanban-definition-HUTT4EX6-D9rO7JqK.js} +8 -8
  97. package/dist-web/assets/kimi_avatar_default-srYjF2HV.riv +0 -0
  98. package/dist-web/assets/layout-CvP6o9AK.js +1 -0
  99. package/dist-web/assets/layout-D-LzfAck.js +1 -0
  100. package/dist-web/assets/{linear-C63Cr2o_.js → linear-CmRMBRqQ.js} +1 -1
  101. package/dist-web/assets/{linear-3mB6q2-g.js → linear-XyiJKSm3.js} +1 -1
  102. package/dist-web/assets/map-CWKZqZjr.js +1 -0
  103. package/dist-web/assets/map-DxJ2ADlA.js +1 -0
  104. package/dist-web/assets/mermaid.core-BMAf1qng.js +314 -0
  105. package/dist-web/assets/mermaidParser.worker-BFSlSHEW.js +318 -0
  106. package/dist-web/assets/{mindmap-definition-RKZ34NQL-BmJZpjh6.js → mindmap-definition-LN4V7U3C-DTp1GWYE.js} +3 -3
  107. package/dist-web/assets/{mindmap-definition-RKZ34NQL-DQzkgNi9.js → mindmap-definition-LN4V7U3C-HVS3CO3N.js} +2 -2
  108. package/dist-web/assets/pegDiagram-2B236MQR-BCQiPTr1.js +1 -0
  109. package/dist-web/assets/pegDiagram-2B236MQR-CZ-v0hli.js +1 -0
  110. package/dist-web/assets/pieDiagram-ENE6RG2P-Cj4sb9K4.js +39 -0
  111. package/dist-web/assets/pieDiagram-ENE6RG2P-DQ4-sW9o.js +39 -0
  112. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CWHMWTB1.js → quadrantDiagram-ABIIQ3AL-BLnW7KuD.js} +3 -3
  113. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BmT_qM09.js → quadrantDiagram-ABIIQ3AL-DRVW4Sbs.js} +3 -3
  114. package/dist-web/assets/railroadDiagram-RFXS5EU6-BaaUURia.js +1 -0
  115. package/dist-web/assets/railroadDiagram-RFXS5EU6-BslILK0i.js +1 -0
  116. package/dist-web/assets/{requirementDiagram-4Y6WPE33-Dauq61O7.js → requirementDiagram-TGXJPOKE-CRL6Ek64.js} +2 -2
  117. package/dist-web/assets/{requirementDiagram-4Y6WPE33-CZrxH1Y2.js → requirementDiagram-TGXJPOKE-DJoTD0yz.js} +3 -3
  118. package/dist-web/assets/rive-BxcgqsjB.js +1 -0
  119. package/dist-web/assets/rive-CeXCFBdn.js +20 -0
  120. package/dist-web/assets/rive-CxG7kGQi.wasm +0 -0
  121. package/dist-web/assets/rive_fallback-ByshBW-N.js +1 -0
  122. package/dist-web/assets/rive_fallback-l90fUeAW.wasm +0 -0
  123. package/dist-web/assets/sankeyDiagram-HTMAVEWB-CnczhSio.js +40 -0
  124. package/dist-web/assets/sankeyDiagram-HTMAVEWB-DzUJ62wj.js +40 -0
  125. package/dist-web/assets/sequenceDiagram-DBY2YBRQ-mu76CmfO.js +162 -0
  126. package/dist-web/assets/sequenceDiagram-DBY2YBRQ-qM_aECMO.js +162 -0
  127. package/dist-web/assets/sizeCapture-X5ZJPWSS-CH_tSsWe.js +1 -0
  128. package/dist-web/assets/sizeCapture-X5ZJPWSS-CiMXtF_n.js +1 -0
  129. package/dist-web/assets/stateDiagram-2N3HPSRC-FiChRpmX.js +1 -0
  130. package/dist-web/assets/stateDiagram-2N3HPSRC-oSEYKuRN.js +1 -0
  131. package/dist-web/assets/stateDiagram-v2-6OUMAXLB-CDYO-PcE.js +1 -0
  132. package/dist-web/assets/stateDiagram-v2-6OUMAXLB-T_lEs_r7.js +1 -0
  133. package/dist-web/assets/swimlanes-5IMT3BWC-BbjMxBXe.js +1 -0
  134. package/dist-web/assets/swimlanes-5IMT3BWC-DnYOgNnC.js +2 -0
  135. package/dist-web/assets/swimlanesDiagram-G3AALYLV-D6x5uNZn.js +8 -0
  136. package/dist-web/assets/swimlanesDiagram-G3AALYLV-QS3_uIun.js +8 -0
  137. package/dist-web/assets/{timeline-definition-PNZ67QCA-DsVZdrZa.js → timeline-definition-FHXFAJF6-CHrctaTh.js} +4 -4
  138. package/dist-web/assets/{timeline-definition-PNZ67QCA-BXT88uZe.js → timeline-definition-FHXFAJF6-Dhsd8f4I.js} +5 -5
  139. package/dist-web/assets/vennDiagram-L72KCM5P-BOIhPKpV.js +34 -0
  140. package/dist-web/assets/vennDiagram-L72KCM5P-DnsTO62d.js +34 -0
  141. package/dist-web/assets/{vue.runtime.esm-bundler-CV6FAM7w.js → vue.runtime.esm-bundler-0N7BeFaa.js} +2 -2
  142. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DCiyDQNB.js → wardleyDiagram-EHGQE667-COTbmHpt.js} +3 -3
  143. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BMuhpvfE.js → wardleyDiagram-EHGQE667-DElAUW3r.js} +4 -4
  144. package/dist-web/assets/xychartDiagram-FW5EYKEG-Bwa99x6U.js +7 -0
  145. package/dist-web/assets/xychartDiagram-FW5EYKEG-DiJMaRBQ.js +7 -0
  146. package/dist-web/boot.js +21 -0
  147. package/dist-web/favicon.ico +0 -0
  148. package/dist-web/index.html +3 -3
  149. package/package.json +9 -8
  150. package/dist-web/assets/DesignSystemView-CuTwm3PV.css +0 -1
  151. package/dist-web/assets/DesignSystemView-Y1YvR64p.js +0 -13
  152. package/dist-web/assets/arc-Doj0wRZ0.js +0 -1
  153. package/dist-web/assets/arc-L6XgwaeB.js +0 -1
  154. package/dist-web/assets/architectureDiagram-3BPJPVTR-CQ09RrbH.js +0 -36
  155. package/dist-web/assets/architectureDiagram-3BPJPVTR-DEkKXknP.js +0 -36
  156. package/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js +0 -132
  157. package/dist-web/assets/blockDiagram-GPEHLZMM-CDbS9yI1.js +0 -132
  158. package/dist-web/assets/channel-BsxnfQ-Y.js +0 -1
  159. package/dist-web/assets/channel-DNkUo9e6.js +0 -1
  160. package/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js +0 -231
  161. package/dist-web/assets/chunk-AQP2D5EJ-TC4DTyYP.js +0 -231
  162. package/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js +0 -1
  163. package/dist-web/assets/classDiagram-4FO5ZUOK-DaUEhzAU.js +0 -1
  164. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js +0 -1
  165. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DaUEhzAU.js +0 -1
  166. package/dist-web/assets/cose-bilkent-S5V4N54A-CcDRV2Eg.js +0 -1
  167. package/dist-web/assets/cytoscape.esm-nFXppDBa.js +0 -331
  168. package/dist-web/assets/dagre-BM42HDAG-CAPDvTOf.js +0 -4
  169. package/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js +0 -4
  170. package/dist-web/assets/diagram-2AECGRRQ-BnpT8dB4.js +0 -43
  171. package/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js +0 -43
  172. package/dist-web/assets/diagram-5GNKFQAL-Cx0MS5ma.js +0 -10
  173. package/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js +0 -10
  174. package/dist-web/assets/diagram-LMA3HP47-BHRVZsCe.js +0 -24
  175. package/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js +0 -24
  176. package/dist-web/assets/diagram-OG6HWLK6-zaiP7eEP.js +0 -24
  177. package/dist-web/assets/erDiagram-TEJ5UH35-CxeNDv-0.js +0 -85
  178. package/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js +0 -85
  179. package/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js +0 -162
  180. package/dist-web/assets/flowDiagram-I6XJVG4X-DyteJsUl.js +0 -162
  181. package/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js +0 -292
  182. package/dist-web/assets/ganttDiagram-6RSMTGT7-DZqlcIzV.js +0 -292
  183. package/dist-web/assets/gitGraphDiagram-PVQCEYII-Dw9S_fYV.js +0 -106
  184. package/dist-web/assets/index-B9zmed_C.js +0 -1580
  185. package/dist-web/assets/index-DQ9K54ko.css +0 -1
  186. package/dist-web/assets/index-X66FNAUX.js +0 -342
  187. package/dist-web/assets/infoDiagram-5YYISTIA-DwStzHtD.js +0 -2
  188. package/dist-web/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2 +0 -0
  189. package/dist-web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  190. package/dist-web/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2 +0 -0
  191. package/dist-web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  192. package/dist-web/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2 +0 -0
  193. package/dist-web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  194. package/dist-web/assets/inter-greek-opsz-italic-mtaF_0H_.woff2 +0 -0
  195. package/dist-web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  196. package/dist-web/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2 +0 -0
  197. package/dist-web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  198. package/dist-web/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2 +0 -0
  199. package/dist-web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  200. package/dist-web/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2 +0 -0
  201. package/dist-web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  202. package/dist-web/assets/layout-C1ojF0zw.js +0 -1
  203. package/dist-web/assets/layout-SsrduOYp.js +0 -1
  204. package/dist-web/assets/mermaid.core-BwcskAQn.js +0 -309
  205. package/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js +0 -313
  206. package/dist-web/assets/pieDiagram-4H26LBE5-9iFPJO1g.js +0 -30
  207. package/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js +0 -30
  208. package/dist-web/assets/sankeyDiagram-5OEKKPKP-CgWplOyO.js +0 -40
  209. package/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js +0 -40
  210. package/dist-web/assets/sequenceDiagram-3UESZ5HK-COId1xtx.js +0 -162
  211. package/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js +0 -162
  212. package/dist-web/assets/stateDiagram-AJRCARHV-DoZHdBHI.js +0 -1
  213. package/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js +0 -1
  214. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js +0 -1
  215. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CjAW3D5i.js +0 -1
  216. package/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js +0 -34
  217. package/dist-web/assets/vennDiagram-CIIHVFJN-DqnH58Gz.js +0 -34
  218. package/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js +0 -173
  219. package/dist-web/assets/wardley-L42UT6IY-BoufZjwT.js +0 -173
  220. package/dist-web/assets/xychartDiagram-2RQKCTM6-BqWwNtNF.js +0 -7
  221. package/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js +0 -7
@@ -1,342 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Y1YvR64p.js","assets/DesignSystemView-CuTwm3PV.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-DxKllCdY.js","assets/safeRaf-DGuzXxDK.js","assets/index5-DYtlr_77.js","assets/index11-Jj0EtwVs.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
3
- * @vue/shared v3.5.35
4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
- * @license MIT
6
- **/function a1(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ln={},Xc=[],Ci=()=>{},lA=()=>!1,If=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c1=e=>e.startsWith("onUpdate:"),Fn=Object.assign,Mk=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},p9=Object.prototype.hasOwnProperty,_n=(e,t)=>p9.call(e,t),At=Array.isArray,Qc=e=>Su(e)==="[object Map]",Qa=e=>Su(e)==="[object Set]",rw=e=>Su(e)==="[object Date]",m9=e=>Su(e)==="[object RegExp]",Rt=e=>typeof e=="function",Pn=e=>typeof e=="string",ii=e=>typeof e=="symbol",Cn=e=>e!==null&&typeof e=="object",Ek=e=>(Cn(e)||Rt(e))&&Rt(e.then)&&Rt(e.catch),aA=Object.prototype.toString,Su=e=>aA.call(e),g9=e=>Su(e).slice(8,-1),u1=e=>Su(e)==="[object Object]",d1=e=>Pn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Fa=a1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),f1=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},v9=/-\w/g,Fo=f1(e=>e.replace(v9,t=>t.slice(1).toUpperCase())),y9=/\B([A-Z])/g,Bs=f1(e=>e.replace(y9,"-$1").toLowerCase()),h1=f1(e=>e.charAt(0).toUpperCase()+e.slice(1)),xp=f1(e=>e?`on${h1(e)}`:""),Zo=(e,t)=>!Object.is(e,t),Jc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},cA=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},p1=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Kp=e=>{const t=Pn(e)?Number(e):NaN;return isNaN(t)?e:t};let lw;const m1=()=>lw||(lw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),k9="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",b9=a1(k9);function on(e){if(At(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=Pn(o)?S9(o):on(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(Pn(e)||Cn(e))return e}const x9=/;(?![^(]*\))/g,w9=/:([^]+)/,_9=/\/\*[^]*?\*\//g;function S9(e){const t={};return e.replace(_9,"").split(x9).forEach(n=>{if(n){const o=n.split(w9);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Ue(e){let t="";if(Pn(e))t=e;else if(At(e))for(let n=0;n<e.length;n++){const o=Ue(e[n]);o&&(t+=o+" ")}else if(Cn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function C9(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Pn(t)&&(e.class=Ue(t)),n&&(e.style=on(n)),e}const A9="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",M9=a1(A9);function uA(e){return!!e||e===""}function E9(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=jr(e[o],t[o]);return n}function jr(e,t){if(e===t)return!0;let n=rw(e),o=rw(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=ii(e),o=ii(t),n||o)return e===t;if(n=At(e),o=At(t),n||o)return n&&o?E9(e,t):!1;if(n=Cn(e),o=Cn(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!jr(e[r],t[r]))return!1}}return String(e)===String(t)}function g1(e,t){return e.findIndex(n=>jr(n,t))}const dA=e=>!!(e&&e.__v_isRef===!0),R=e=>Pn(e)?e:e==null?"":At(e)||Cn(e)&&(e.toString===aA||!Rt(e.toString))?dA(e)?R(e.value):JSON.stringify(e,fA,2):String(e),fA=(e,t)=>dA(t)?fA(e,t.value):Qc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[lg(o,i)+" =>"]=s,n),{})}:Qa(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>lg(n))}:ii(t)?lg(t):Cn(t)&&!At(t)&&!u1(t)?String(t):t,lg=(e,t="")=>{var n;return ii(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function T9(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 Lo;class hA{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&&Lo&&(Lo.active?(this.parent=Lo,this.index=(Lo.scopes||(Lo.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=Lo;try{return Lo=this,t()}finally{Lo=n}}}on(){++this._on===1&&(this.prevScope=Lo,Lo=this)}off(){if(this._on>0&&--this._on===0){if(Lo===this)Lo=this.prevScope;else{let t=Lo;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,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function N9(e){return new hA(e)}function Tk(){return Lo}function Lf(e,t=!1){Lo&&Lo.cleanups.push(e)}let Yn;const ag=new WeakSet;class Gp{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,Lo&&(Lo.active?Lo.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ag.has(this)&&(ag.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||mA(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,aw(this),gA(this);const t=Yn,n=Ui;Yn=this,Ui=!0;try{return this.fn()}finally{vA(this),Yn=t,Ui=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Lk(t);this.deps=this.depsTail=void 0,aw(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ag.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){jv(this)&&this.run()}get dirty(){return jv(this)}}let pA=0,Ld,$d;function mA(e,t=!1){if(e.flags|=8,t){e.next=$d,$d=e;return}e.next=Ld,Ld=e}function Nk(){pA++}function Ik(){if(--pA>0)return;if($d){let t=$d;for($d=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ld;){let t=Ld;for(Ld=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function gA(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vA(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Lk(o),I9(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function jv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yA(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yA(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ef)||(e.globalVersion=ef,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!jv(e))))return;e.flags|=2;const t=e.dep,n=Yn,o=Ui;Yn=e,Ui=!0;try{gA(e);const s=e.fn(e._value);(t.version===0||Zo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Yn=n,Ui=o,vA(e),e.flags&=-3}}function Lk(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Lk(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function I9(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function YCe(e,t){e.effect instanceof Gp&&(e=e.effect.fn);const n=new Gp(e);t&&Fn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function ZCe(e){e.effect.stop()}let Ui=!0;const kA=[];function Vr(){kA.push(Ui),Ui=!1}function Kr(){const e=kA.pop();Ui=e===void 0?!0:e}function aw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Yn;Yn=void 0;try{t()}finally{Yn=n}}}let ef=0;class L9{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 v1{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(!Yn||!Ui||Yn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Yn)n=this.activeLink=new L9(Yn,this),Yn.deps?(n.prevDep=Yn.depsTail,Yn.depsTail.nextDep=n,Yn.depsTail=n):Yn.deps=Yn.depsTail=n,bA(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Yn.depsTail,n.nextDep=void 0,Yn.depsTail.nextDep=n,Yn.depsTail=n,Yn.deps===n&&(Yn.deps=o)}return n}trigger(t){this.version++,ef++,this.notify(t)}notify(t){Nk();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ik()}}}function bA(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)bA(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Yp=new WeakMap,Oa=Symbol(""),Vv=Symbol(""),tf=Symbol("");function rs(e,t,n){if(Ui&&Yn){let o=Yp.get(e);o||Yp.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new v1),s.map=o,s.key=n),s.track()}}function Dr(e,t,n,o,s,i){const r=Yp.get(e);if(!r){ef++;return}const l=a=>{a&&a.trigger()};if(Nk(),t==="clear")r.forEach(l);else{const a=At(e),c=a&&d1(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===tf||!ii(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(tf)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Oa)),Qc(e)&&l(r.get(Vv)));break;case"delete":a||(l(r.get(Oa)),Qc(e)&&l(r.get(Vv)));break;case"set":Qc(e)&&l(r.get(Oa));break}}Ik()}function $9(e,t){const n=Yp.get(e);return n&&n.get(t)}function wc(e){const t=fn(e);return t===e?t:(rs(t,"iterate",tf),ei(e)?t:t.map(Vi))}function y1(e){return rs(e=fn(e),"iterate",tf),e}function ar(e,t){return Gr(e)?gu(Il(e)?Vi(t):t):Vi(t)}const F9={__proto__:null,[Symbol.iterator](){return cg(this,Symbol.iterator,e=>ar(this,e))},concat(...e){return wc(this).concat(...e.map(t=>At(t)?wc(t):t))},entries(){return cg(this,"entries",e=>(e[1]=ar(this,e[1]),e))},every(e,t){return Cr(this,"every",e,t,void 0,arguments)},filter(e,t){return Cr(this,"filter",e,t,n=>n.map(o=>ar(this,o)),arguments)},find(e,t){return Cr(this,"find",e,t,n=>ar(this,n),arguments)},findIndex(e,t){return Cr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Cr(this,"findLast",e,t,n=>ar(this,n),arguments)},findLastIndex(e,t){return Cr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Cr(this,"forEach",e,t,void 0,arguments)},includes(...e){return ug(this,"includes",e)},indexOf(...e){return ug(this,"indexOf",e)},join(e){return wc(this).join(e)},lastIndexOf(...e){return ug(this,"lastIndexOf",e)},map(e,t){return Cr(this,"map",e,t,void 0,arguments)},pop(){return nd(this,"pop")},push(...e){return nd(this,"push",e)},reduce(e,...t){return cw(this,"reduce",e,t)},reduceRight(e,...t){return cw(this,"reduceRight",e,t)},shift(){return nd(this,"shift")},some(e,t){return Cr(this,"some",e,t,void 0,arguments)},splice(...e){return nd(this,"splice",e)},toReversed(){return wc(this).toReversed()},toSorted(e){return wc(this).toSorted(e)},toSpliced(...e){return wc(this).toSpliced(...e)},unshift(...e){return nd(this,"unshift",e)},values(){return cg(this,"values",e=>ar(this,e))}};function cg(e,t,n){const o=y1(e),s=o[t]();return o!==e&&!ei(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const O9=Array.prototype;function Cr(e,t,n,o,s,i){const r=y1(e),l=r!==e&&!ei(e),a=r[t];if(a!==O9[t]){const d=a.apply(e,i);return l?Vi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,ar(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function cw(e,t,n,o){const s=y1(e),i=s!==e&&!ei(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=ar(e,c)),n.call(this,c,ar(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?ar(e,a):a}function ug(e,t,n){const o=fn(e);rs(o,"iterate",tf);const s=o[t](...n);return(s===-1||s===!1)&&x1(n[0])?(n[0]=fn(n[0]),o[t](...n)):s}function nd(e,t,n=[]){Vr(),Nk();const o=fn(e)[t].apply(e,n);return Ik(),Kr(),o}const B9=a1("__proto__,__v_isRef,__isVue"),xA=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ii));function R9(e){ii(e)||(e=String(e));const t=fn(this);return rs(t,"has",e),t.hasOwnProperty(e)}class wA{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?EA:MA:i?AA:CA).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=At(t);if(!s){let a;if(r&&(a=F9[n]))return a;if(n==="hasOwnProperty")return R9}const l=Reflect.get(t,n,vo(t)?t:o);if((ii(n)?xA.has(n):B9(n))||(s||rs(t,"get",n),i))return l;if(vo(l)){const a=r&&d1(n)?l:l.value;return s&&Cn(a)?Gv(a):a}return Cn(l)?s?Gv(l):zo(l):l}}class _A extends wA{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=At(t)&&d1(n);if(!this._isShallow){const c=Gr(i);if(!ei(o)&&!Gr(o)&&(i=fn(i),o=fn(o)),!r&&vo(i)&&!vo(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:_n(t,n),a=Reflect.set(t,n,o,vo(t)?t:s);return t===fn(s)&&(l?Zo(o,i)&&Dr(t,"set",n,o):Dr(t,"add",n,o)),a}deleteProperty(t,n){const o=_n(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Dr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!ii(n)||!xA.has(n))&&rs(t,"has",n),o}ownKeys(t){return rs(t,"iterate",At(t)?"length":Oa),Reflect.ownKeys(t)}}class SA extends wA{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const D9=new _A,P9=new SA,H9=new _A(!0),W9=new SA(!0),Kv=e=>e,Th=e=>Reflect.getPrototypeOf(e);function z9(e,t,n){return function(...o){const s=this.__v_raw,i=fn(s),r=Qc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Kv:t?gu:Vi;return!t&&rs(i,"iterate",a?Vv:Oa),Fn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Nh(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function U9(e,t){const n={get(s){const i=this.__v_raw,r=fn(i),l=fn(s);e||(Zo(s,l)&&rs(r,"get",s),rs(r,"get",l));const{has:a}=Th(r),c=t?Kv:e?gu:Vi;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&rs(fn(s),"iterate",Oa),s.size},has(s){const i=this.__v_raw,r=fn(i),l=fn(s);return e||(Zo(s,l)&&rs(r,"has",s),rs(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=fn(l),c=t?Kv:e?gu:Vi;return!e&&rs(a,"iterate",Oa),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return Fn(n,e?{add:Nh("add"),set:Nh("set"),delete:Nh("delete"),clear:Nh("clear")}:{add(s){const i=fn(this),r=Th(i),l=fn(s),a=!t&&!ei(s)&&!Gr(s)?l:s;return r.has.call(i,a)||Zo(s,a)&&r.has.call(i,s)||Zo(l,a)&&r.has.call(i,l)||(i.add(a),Dr(i,"add",a,a)),this},set(s,i){!t&&!ei(i)&&!Gr(i)&&(i=fn(i));const r=fn(this),{has:l,get:a}=Th(r);let c=l.call(r,s);c||(s=fn(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Zo(i,u)&&Dr(r,"set",s,i):Dr(r,"add",s,i),this},delete(s){const i=fn(this),{has:r,get:l}=Th(i);let a=r.call(i,s);a||(s=fn(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Dr(i,"delete",s,void 0),c},clear(){const s=fn(this),i=s.size!==0,r=s.clear();return i&&Dr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=z9(s,e,t)}),n}function k1(e,t){const n=U9(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(_n(n,s)&&s in o?n:o,s,i)}const q9={get:k1(!1,!1)},j9={get:k1(!1,!0)},V9={get:k1(!0,!1)},K9={get:k1(!0,!0)},CA=new WeakMap,AA=new WeakMap,MA=new WeakMap,EA=new WeakMap;function G9(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function zo(e){return Gr(e)?e:b1(e,!1,D9,q9,CA)}function Y9(e){return b1(e,!1,H9,j9,AA)}function Gv(e){return b1(e,!0,P9,V9,MA)}function XCe(e){return b1(e,!0,W9,K9,EA)}function b1(e,t,n,o,s){if(!Cn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=G9(g9(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Il(e){return Gr(e)?Il(e.__v_raw):!!(e&&e.__v_isReactive)}function Gr(e){return!!(e&&e.__v_isReadonly)}function ei(e){return!!(e&&e.__v_isShallow)}function x1(e){return e?!!e.__v_raw:!1}function fn(e){const t=e&&e.__v_raw;return t?fn(t):e}function gt(e){return!_n(e,"__v_skip")&&Object.isExtensible(e)&&cA(e,"__v_skip",!0),e}const Vi=e=>Cn(e)?zo(e):e,gu=e=>Cn(e)?Gv(e):e;function vo(e){return e?e.__v_isRef===!0:!1}function oe(e){return TA(e,!1)}function gr(e){return TA(e,!0)}function TA(e,t){return vo(e)?e:new Z9(e,t)}class Z9{constructor(t,n){this.dep=new v1,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:fn(t),this._value=n?t:Vi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||ei(t)||Gr(t);t=o?t:fn(t),Zo(t,n)&&(this._rawValue=t,this._value=o?t:Vi(t),this.dep.trigger())}}function X9(e){e.dep&&e.dep.trigger()}function C(e){return vo(e)?e.value:e}function NA(e){return Rt(e)?e():C(e)}const Q9={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return vo(s)&&!vo(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function IA(e){return Il(e)?e:new Proxy(e,Q9)}class J9{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new v1,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function eI(e){return new J9(e)}function QCe(e){const t=At(e)?new Array(e.length):{};for(const n in e)t[n]=LA(e,n);return t}class tI{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=ii(n)?n:String(n),this._raw=fn(t);let s=!0,i=t;if(!At(t)||ii(this._key)||!d1(this._key))do s=!x1(i)||ei(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&vo(this._raw[this._key])){const n=this._object[this._key];if(vo(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return $9(this._raw,this._key)}}class nI{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 JCe(e,t,n){return vo(e)?e:Rt(e)?new nI(e):Cn(e)&&arguments.length>1?LA(e,t,n):oe(e)}function LA(e,t,n){return new tI(e,t,n)}class oI{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new v1(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ef-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Yn!==this)return mA(this,!0),!0}get value(){const t=this.dep.track();return yA(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function sI(e,t,n=!1){let o,s;return Rt(e)?o=e:(o=e.get,s=e.set),new oI(o,s,n)}const e4e={GET:"get",HAS:"has",ITERATE:"iterate"},t4e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Ih={},Zp=new WeakMap;let bl;function n4e(){return bl}function iI(e,t=!1,n=bl){if(n){let o=Zp.get(n);o||Zp.set(n,o=[]),o.push(e)}}function rI(e,t,n=ln){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=b=>s?b:ei(b)||s===!1||s===0?Pr(b,1):Pr(b);let u,d,f,h,p=!1,m=!1;if(vo(e)?(d=()=>e.value,p=ei(e)):Il(e)?(d=()=>c(e),p=!0):At(e)?(m=!0,p=e.some(b=>Il(b)||ei(b)),d=()=>e.map(b=>{if(vo(b))return b.value;if(Il(b))return c(b);if(Rt(b))return a?a(b,2):b()})):Rt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Vr();try{f()}finally{Kr()}}const b=bl;bl=u;try{return a?a(e,3,[h]):e(h)}finally{bl=b}}:d=Ci,t&&s){const b=d,A=s===!0?1/0:s;d=()=>Pr(b(),A)}const y=Tk(),k=()=>{u.stop(),y&&y.active&&Mk(y.effects,u)};if(i&&t){const b=t;t=(...A)=>{b(...A),k()}}let g=m?new Array(e.length).fill(Ih):Ih;const v=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(t){const A=u.run();if(s||p||(m?A.some((I,N)=>Zo(I,g[N])):Zo(A,g))){f&&f();const I=bl;bl=u;try{const N=[A,g===Ih?void 0:m&&g[0]===Ih?[]:g,h];g=A,a?a(t,3,N):t(...N)}finally{bl=I}}}else u.run()};return l&&l(v),u=new Gp(d),u.scheduler=r?()=>r(v,!1):v,h=b=>iI(b,!1,u),f=u.onStop=()=>{const b=Zp.get(u);if(b){if(a)a(b,4);else for(const A of b)A();Zp.delete(u)}},t?o?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function Pr(e,t=1/0,n){if(t<=0||!Cn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,vo(e))Pr(e.value,t,n);else if(At(e))for(let o=0;o<e.length;o++)Pr(e[o],t,n);else if(Qa(e)||Qc(e))e.forEach(o=>{Pr(o,t,n)});else if(u1(e)){for(const o in e)Pr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Pr(e[o],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 $A=[];function lI(e){$A.push(e)}function aI(){$A.pop()}function o4e(e,t){}const s4e={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"},cI={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 $f(e,t,n,o){try{return o?e(...o):e()}catch(s){Cu(s,t,n)}}function Ei(e,t,n,o){if(Rt(e)){const s=$f(e,t,n,o);return s&&Ek(s)&&s.catch(i=>{Cu(i,t,n)}),s}if(At(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Ei(e[i],t,n,o));return s}}function Cu(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||ln;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){Vr(),$f(i,null,10,[e,a,c]),Kr();return}}uI(e,n,s,o,r)}function uI(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ms=[];let ir=-1;const eu=[];let xl=null,Fc=0;const FA=Promise.resolve();let Xp=null;function yt(e){const t=Xp||FA;return e?t.then(this?e.bind(this):e):t}function dI(e){let t=ir+1,n=ms.length;for(;t<n;){const o=t+n>>>1,s=ms[o],i=nf(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function $k(e){if(!(e.flags&1)){const t=nf(e),n=ms[ms.length-1];!n||!(e.flags&2)&&t>=nf(n)?ms.push(e):ms.splice(dI(t),0,e),e.flags|=1,OA()}}function OA(){Xp||(Xp=FA.then(BA))}function Qp(e){At(e)?eu.push(...e):xl&&e.id===-1?xl.splice(Fc+1,0,e):e.flags&1||(eu.push(e),e.flags|=1),OA()}function uw(e,t,n=ir+1){for(;n<ms.length;n++){const o=ms[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ms.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Jp(e){if(eu.length){const t=[...new Set(eu)].sort((n,o)=>nf(n)-nf(o));if(eu.length=0,xl){xl.push(...t);return}for(xl=t,Fc=0;Fc<xl.length;Fc++){const n=xl[Fc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}xl=null,Fc=0}}const nf=e=>e.id==null?e.flags&2?-1:1/0:e.id;function BA(e){try{for(ir=0;ir<ms.length;ir++){const t=ms[ir];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),$f(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ir<ms.length;ir++){const t=ms[ir];t&&(t.flags&=-2)}ir=-1,ms.length=0,Jp(),Xp=null,(ms.length||eu.length)&&BA()}}let Oc,Lh=[];function RA(e,t){var n,o;Oc=e,Oc?(Oc.enabled=!0,Lh.forEach(({event:s,args:i})=>Oc.emit(s,...i)),Lh=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{RA(i,t)}),setTimeout(()=>{Oc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Lh=[])},3e3)):Lh=[]}let Qo=null,w1=null;function of(e){const t=Qo;return Qo=e,w1=e&&e.type.__scopeId||null,t}function i4e(e){w1=e}function r4e(){w1=null}const l4e=e=>Ie;function Ie(e,t=Qo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&sm(-1);const i=of(t);let r;try{r=e(...s)}finally{of(i),o._d&&sm(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function qn(e,t){if(Qo===null)return e;const n=Rf(Qo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=ln]=t[s];i&&(Rt(i)&&(i={mounted:i,updated:i}),i.deep&&Pr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function rr(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Vr(),Ei(a,n,8,[e.el,l,e,t]),Kr())}}function Ln(e,t){if(Xo){let n=Xo.provides;const o=Xo.parent&&Xo.parent.provides;o===n&&(n=Xo.provides=Object.create(o)),n[e]=t}}function Jt(e,t,n=!1){const o=Mo();if(o||Ba){let s=Ba?Ba._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Rt(t)?t.call(o&&o.proxy):t}}function a4e(){return!!(Mo()||Ba)}const fI=Symbol.for("v-scx"),hI=()=>Jt(fI);function DA(e,t){return Ff(e,null,t)}function c4e(e,t){return Ff(e,null,{flush:"post"})}function pI(e,t){return Ff(e,null,{flush:"sync"})}function et(e,t,n){return Ff(e,t,n)}function Ff(e,t,n=ln){const{immediate:o,deep:s,flush:i,once:r}=n,l=Fn({},n),a=t&&o||!t&&i!=="post";let c;if(za){if(i==="sync"){const h=hI();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Ci,h.resume=Ci,h.pause=Ci,h}}const u=Xo;l.call=(h,p,m)=>Ei(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{xo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():$k(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=rI(e,t,l);return za&&(c?c.push(f):a&&f()),f}function mI(e,t,n){const o=this.proxy,s=Pn(e)?e.includes(".")?PA(o,e):()=>o[e]:e.bind(o,o);let i;Rt(t)?i=t:(i=t.handler,n=t);const r=Au(this),l=Ff(s,i.bind(o),n);return r(),l}function PA(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const gl=new WeakMap,HA=Symbol("_vte"),WA=e=>e.__isTeleport,wa=e=>e&&(e.disabled||e.disabled===""),gI=e=>e&&(e.defer||e.defer===""),dw=e=>typeof SVGElement<"u"&&e instanceof SVGElement,fw=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Yv=(e,t)=>{const n=e&&e.to;return Pn(n)?t?t(n):null:n},vI={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:y,parentNode:k}}=c,g=wa(t.props);let{dynamicChildren:v}=t;const b=(N,M,$)=>{N.shapeFlag&16&&u(N.children,M,$,s,i,r,l,a)},A=(N=t)=>{const M=wa(N.props),$=N.target=Yv(N.props,p),T=Zv($,N,m,h);$&&(r!=="svg"&&dw($)?r="svg":r!=="mathml"&&fw($)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add($),M||(b(N,$,T),vd(N,!1)))},I=N=>{const M=()=>{if(gl.get(N)===M){if(gl.delete(N),wa(N.props)){const $=k(N.el)||n;b(N,$,N.anchor),vd(N,!0)}A(N)}};gl.set(N,M),xo(M,i)};if(e==null){const N=t.el=m(""),M=t.anchor=m("");if(h(N,n,o),h(M,n,o),gI(t.props)||i&&i.pendingBranch){I(t);return}g&&(b(t,n,M),vd(t,!0)),A()}else{t.el=e.el;const N=t.anchor=e.anchor,M=gl.get(e);if(M){M.flags|=8,gl.delete(e),I(t);return}t.targetStart=e.targetStart;const $=t.target=e.target,T=t.targetAnchor=e.targetAnchor,F=wa(e.props),S=F?n:$,B=F?N:T;if(r==="svg"||dw($)?r="svg":(r==="mathml"||fw($))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,s,i,r,l),Uk(e,t,!0)):a||d(e,t,S,B,s,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):$h(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const W=t.target=Yv(t.props,p);W&&$h(t,W,null,c,0)}else F&&$h(t,$,T,c,1);vd(t,g)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!wa(f),p=gl.get(e);if(p&&(p.flags|=8,gl.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let m=0;m<l.length;m++){const y=l[m];o(y,t,n,h,!!y.dynamicChildren)}},move:$h,hydrate:yI};function $h(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!gl.has(e)&&(!d||wa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function yI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(y,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,y._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(y,k){k.anchor=d(r(y),k,l(y),n,o,s,i)}const p=t.target=Yv(t.props,a),m=wa(t.props);if(p){const y=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,y),t.targetAnchor||Zv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,y),t.targetAnchor||Zv(p,t,u,c),d(y&&r(y),t,p,n,o,s,i))),vd(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const _1=vI;function vd(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Zv(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[HA]=r,e&&(o(i,e,s),o(r,e,s)),r}const ki=Symbol("_leaveCb"),od=Symbol("_enterCb");function zA(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return An(()=>{e.isMounted=!0}),ho(()=>{e.isUnmounting=!0}),e}const pi=[Function,Array],UA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:pi,onEnter:pi,onAfterEnter:pi,onEnterCancelled:pi,onBeforeLeave:pi,onLeave:pi,onAfterLeave:pi,onLeaveCancelled:pi,onBeforeAppear:pi,onAppear:pi,onAfterAppear:pi,onAppearCancelled:pi},qA=e=>{const t=e.subTree;return t.component?qA(t.component):t},kI={name:"BaseTransition",props:UA,setup(e,{slots:t}){const n=Mo(),o=zA();return()=>{const s=t.default&&Fk(t.default(),!0),i=s&&s.length?jA(s):n.subTree?ue():void 0;if(!i)return;const r=fn(e),{mode:l}=r;if(o.isLeaving)return dg(i);const a=hw(i);if(!a)return dg(i);let c=sf(a,r,o,n,d=>c=d);a.type!==So&&Rl(a,c);let u=n.subTree&&hw(n.subTree);if(u&&u.type!==So&&!Pi(u,a)&&qA(n).type!==So){let d=sf(u,r,o,n);if(Rl(u,d),l==="out-in"&&a.type!==So)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},dg(i);l==="in-out"&&a.type!==So?d.delayLeave=(f,h,p)=>{const m=VA(o,u);m[String(u.key)]=u,f[ki]=()=>{h(),f[ki]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function jA(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==So){t=n;break}}return t}const bI=kI;function VA(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function sf(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:y,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,b=String(e.key),A=VA(n,e),I=($,T)=>{$&&Ei($,o,9,T)},N=($,T)=>{const F=T[1];I($,T),At($)?$.every(S=>S.length<=1)&&F():$.length<=1&&F()},M={mode:r,persisted:l,beforeEnter($){let T=a;if(!n.isMounted)if(i)T=y||a;else return;$[ki]&&$[ki](!0);const F=A[b];F&&Pi(e,F)&&F.el[ki]&&F.el[ki](),I(T,[$])},enter($){if(A[b]===e)return;let T=c,F=u,S=d;if(!n.isMounted)if(i)T=k||c,F=g||u,S=v||d;else return;let B=!1;$[od]=z=>{B||(B=!0,z?I(S,[$]):I(F,[$]),M.delayedLeave&&M.delayedLeave(),$[od]=void 0)};const W=$[od].bind(null,!1);T?N(T,[$,W]):W()},leave($,T){const F=String(e.key);if($[od]&&$[od](!0),n.isUnmounting)return T();I(f,[$]);let S=!1;$[ki]=W=>{S||(S=!0,T(),W?I(m,[$]):I(p,[$]),$[ki]=void 0,A[F]===e&&delete A[F])};const B=$[ki].bind(null,!1);A[F]=e,h?N(h,[$,B]):B()},clone($){const T=sf($,t,n,o,s);return s&&s(T),T}};return M}function dg(e){if(Of(e))return e=Yr(e),e.children=null,e}function hw(e){if(!Of(e))return WA(e.type)&&e.children?jA(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&&Rt(n.default))return n.default()}}function Rl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Rl(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 Fk(e,t=!1,n){let o=[],s=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===We?(r.patchFlag&128&&s++,o=o.concat(Fk(r.children,t,l))):(t||r.type!==So)&&o.push(l!=null?Yr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Je(e,t){return Rt(e)?Fn({name:e.name},t,{setup:e}):e}function u4e(){const e=Mo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Ok(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function d4e(e){const t=Mo(),n=gr(null);if(t){const s=t.refs===ln?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function pw(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const em=new WeakMap;function tu(e,t,n,o,s=!1){if(At(e)){e.forEach((m,y)=>tu(m,t&&(At(t)?t[y]:t),n,o,s));return}if(qr(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&tu(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Rf(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===ln?l.refs={}:l.refs,d=l.setupState,f=fn(d),h=d===ln?lA:m=>pw(u,m)?!1:_n(f,m),p=(m,y)=>!(y&&pw(u,y));if(c!=null&&c!==a){if(mw(t),Pn(c))u[c]=null,h(c)&&(d[c]=null);else if(vo(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Rt(a))$f(a,l,12,[r,u]);else{const m=Pn(a),y=vo(a);if(m||y){const k=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)At(g)&&Mk(g,i);else if(At(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):y&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),em.delete(e)};g.id=-1,em.set(e,g),xo(g,n)}else mw(e),k()}}}function mw(e){const t=em.get(e);t&&(t.flags|=8,em.delete(e))}let gw=!1;const _c=()=>{gw||(console.error("Hydration completed but contains mismatches."),gw=!0)},xI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",wI=e=>e.namespaceURI.includes("MathML"),Fh=e=>{if(e.nodeType===1){if(xI(e))return"svg";if(wI(e))return"mathml"}},Uc=e=>e.nodeType===8;function _I(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,b)=>{if(!b.hasChildNodes()){n(null,v,b),Jp(),b._vnode=v;return}d(b.firstChild,v,null,null,null),Jp(),b._vnode=v},d=(v,b,A,I,N,M=!1)=>{M=M||!!b.dynamicChildren;const $=Uc(v)&&v.data==="[",T=()=>m(v,b,A,I,N,$),{type:F,ref:S,shapeFlag:B,patchFlag:W}=b;let z=v.nodeType;b.el=v,W===-2&&(M=!1,b.dynamicChildren=null);let L=null;switch(F){case Ll:z!==3?b.children===""?(a(b.el=s(""),r(v),v),L=v):L=T():(v.data!==b.children&&(_c(),v.data=b.children),L=i(v));break;case So:g(v)?(L=i(v),k(b.el=v.content.firstChild,v,A)):z!==8||$?L=T():L=i(v);break;case ou:if($&&(v=i(v),z=v.nodeType),z===1||z===3){L=v;const O=!b.children.length;for(let U=0;U<b.staticCount;U++)O&&(b.children+=L.nodeType===1?L.outerHTML:L.data),U===b.staticCount-1&&(b.anchor=L),L=i(L);return $?i(L):L}else T();break;case We:$?L=p(v,b,A,I,N,M):L=T();break;default:if(B&1)(z!==1||b.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?L=T():L=f(v,b,A,I,N,M);else if(B&6){b.slotScopeIds=N;const O=r(v);if($?L=y(v):Uc(v)&&v.data==="teleport start"?L=y(v,v.data,"teleport end"):L=i(v),t(b,O,null,A,I,Fh(O),M),qr(b)&&!b.type.__asyncResolved){let U;$?(U=ae(We),U.anchor=L?L.previousSibling:O.lastChild):U=v.nodeType===3?ot(""):ae("div"),U.el=v,b.component.subTree=U}}else B&64?z!==8?L=T():L=b.type.hydrate(v,b,A,I,N,M,e,h):B&128&&(L=b.type.hydrate(v,b,A,I,Fh(r(v)),N,M,e,d))}return S!=null&&tu(S,null,I,b),L},f=(v,b,A,I,N,M)=>{M=M||!!b.dynamicChildren;const{type:$,props:T,patchFlag:F,shapeFlag:S,dirs:B,transition:W}=b,z=$==="input"||$==="option";if(z||F!==-1){B&&rr(b,null,A,"created");let L=!1;if(g(v)){L=fM(null,W)&&A&&A.vnode.props&&A.vnode.props.appear;const U=v.content.firstChild;if(L){const Z=U.getAttribute("class");Z&&(U.$cls=Z),W.beforeEnter(U)}k(U,v,A),b.el=v=U}if(S&16&&!(T&&(T.innerHTML||T.textContent))){let U=h(v.firstChild,b,v,A,I,N,M);for(U&&!Oh(v,1)&&_c();U;){const Z=U;U=U.nextSibling,l(Z)}}else if(S&8){let U=b.children;U[0]===`
15
- `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Z}=v;Z!==U&&Z!==U.replace(/\r\n|\r/g,`
16
- `)&&(Oh(v,0)||_c(),v.textContent=b.children)}if(T){if(z||!M||F&48){const U=v.tagName.includes("-");for(const Z in T)(z&&(Z.endsWith("value")||Z==="indeterminate")||If(Z)&&!Fa(Z)||Z[0]==="."||U&&!Fa(Z))&&o(v,Z,null,T[Z],void 0,A)}else if(T.onClick)o(v,"onClick",null,T.onClick,void 0,A);else if(F&4&&Il(T.style))for(const U in T.style)T.style[U]}let O;(O=T&&T.onVnodeBeforeMount)&&Is(O,A,b),B&&rr(b,null,A,"beforeMount"),((O=T&&T.onVnodeMounted)||B||L)&&gM(()=>{O&&Is(O,A,b),L&&W.enter(v),B&&rr(b,null,A,"mounted")},I)}return v.nextSibling},h=(v,b,A,I,N,M,$)=>{$=$||!!b.dynamicChildren;const T=b.children,F=T.length;let S=!1;for(let B=0;B<F;B++){const W=$?T[B]:T[B]=Os(T[B]),z=W.type===Ll;v?(z&&!$&&B+1<F&&Os(T[B+1]).type===Ll&&(a(s(v.data.slice(W.children.length)),A,i(v)),v.data=W.children),v=d(v,W,I,N,M,$)):z&&!W.children?a(W.el=s(""),A):(S||(S=!0,Oh(A,1)||_c()),n(null,W,A,null,I,N,Fh(A),M))}return v},p=(v,b,A,I,N,M)=>{const{slotScopeIds:$}=b;$&&(N=N?N.concat($):$);const T=r(v),F=h(i(v),b,T,A,I,N,M);return F&&Uc(F)&&F.data==="]"?i(b.anchor=F):(_c(),a(b.anchor=c("]"),T,F),F)},m=(v,b,A,I,N,M)=>{if(Oh(v.parentElement,1)||_c(),b.el=null,M){const F=y(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const $=i(v),T=r(v);return l(v),n(null,b,T,$,A,I,Fh(T),N),A&&(A.vnode.el=b.el,A1(A,b.el)),$},y=(v,b="[",A="]")=>{let I=0;for(;v;)if(v=i(v),v&&Uc(v)&&(v.data===b&&I++,v.data===A)){if(I===0)return i(v);I--}return v},k=(v,b,A)=>{const I=b.parentNode;I&&I.replaceChild(v,b);let N=A;for(;N;)N.vnode.el===b&&(N.vnode.el=N.subTree.el=v),N=N.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const vw="data-allow-mismatch",SI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Oh(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(vw);)e=e.parentElement;const n=e&&e.getAttribute(vw);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(SI[t])}}const CI=m1().requestIdleCallback||(e=>setTimeout(e,1)),AI=m1().cancelIdleCallback||(e=>clearTimeout(e)),f4e=(e=1e4)=>t=>{const n=CI(t,{timeout:e});return()=>AI(n)};function MI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const h4e=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(MI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},p4e=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},m4e=(e=[])=>(t,n)=>{Pn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function EI(e,t){if(Uc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(Uc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const qr=e=>!!e.type.__asyncLoader;function Hi(e){Rt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((y,k)=>{a(m,()=>y(f()),()=>k(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Je({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,y){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||y()},v=i?()=>{const b=i(g,A=>EI(p,A));b&&(m.bum||(m.bum=[])).push(b)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Xo;if(Ok(p),u)return()=>Bh(u,p);const m=v=>{c=null,Cu(v,p,13,!o)};if(l&&p.suspense||za)return h().then(v=>()=>Bh(v,p)).catch(v=>(m(v),()=>o?ae(o,{error:v}):null));const y=oe(!1),k=oe(),g=oe(!!s);return s&&setTimeout(()=>{g.value=!1},s),r!=null&&setTimeout(()=>{if(!y.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),h().then(()=>{y.value=!0,p.parent&&Of(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(y.value&&u)return Bh(u,p);if(k.value&&o)return ae(o,{error:k.value});if(n&&!g.value)return Bh(n,p)}}})}function Bh(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=ae(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Of=e=>e.type.__isKeepAlive,TI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Mo(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(g,v,b,A,I)=>{const N=g.component;c(g,v,b,0,l),a(N.vnode,g,v,b,N,l,A,g.slotScopeIds,I),xo(()=>{N.isDeactivated=!1,N.a&&Jc(N.a);const M=g.props&&g.props.onVnodeMounted;M&&Is(M,N.parent,g)},l)},o.deactivate=g=>{const v=g.component;nm(v.m),nm(v.a),c(g,f,null,1,l),xo(()=>{v.da&&Jc(v.da);const b=g.props&&g.props.onVnodeUnmounted;b&&Is(b,v.parent,g),v.isDeactivated=!0},l)};function h(g){fg(g),u(g,n,l,!0)}function p(g){s.forEach((v,b)=>{const A=iy(qr(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(b)})}function m(g){const v=s.get(g);v&&(!r||!Pi(v,r))?h(v):r&&fg(r),s.delete(g),i.delete(g)}et(()=>[e.include,e.exclude],([g,v])=>{g&&p(b=>yd(g,b)),v&&p(b=>!yd(v,b))},{flush:"post",deep:!0});let y=null;const k=()=>{y!=null&&(om(n.subTree.type)?xo(()=>{s.set(y,Rh(n.subTree))},n.subTree.suspense):s.set(y,Rh(n.subTree)))};return An(k),Bk(k),ho(()=>{s.forEach(g=>{const{subTree:v,suspense:b}=n,A=Rh(v);if(g.type===A.type&&g.key===A.key){fg(A);const I=A.component.da;I&&xo(I,b);return}h(g)})}),()=>{if(y=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Dl(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let b=Rh(v);if(b.type===So)return r=null,b;const A=b.type,I=iy(qr(b)?b.type.__asyncResolved||{}:A),{include:N,exclude:M,max:$}=e;if(N&&(!I||!yd(N,I))||M&&I&&yd(M,I))return b.shapeFlag&=-257,r=b,v;const T=b.key==null?A:b.key,F=s.get(T);return b.el&&(b=Yr(b),v.shapeFlag&128&&(v.ssContent=b)),y=T,F?(b.el=F.el,b.component=F.component,b.transition&&Rl(b,b.transition),b.shapeFlag|=512,i.delete(T),i.add(T)):(i.add(T),$&&i.size>parseInt($,10)&&m(i.values().next().value)),b.shapeFlag|=256,r=b,om(v.type)?v:b}}},g4e=TI;function yd(e,t){return At(e)?e.some(n=>yd(n,t)):Pn(e)?e.split(",").includes(t):m9(e)?(e.lastIndex=0,e.test(t)):!1}function NI(e,t){KA(e,"a",t)}function II(e,t){KA(e,"da",t)}function KA(e,t,n=Xo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(S1(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Of(s.parent.vnode)&&LI(o,t,n,s),s=s.parent}}function LI(e,t,n,o){const s=S1(t,e,o,!0);On(()=>{Mk(o[t],s)},n)}function fg(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Rh(e){return e.shapeFlag&128?e.ssContent:e}function S1(e,t,n=Xo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Vr();const l=Au(n),a=Ei(t,n,e,r);return l(),Kr(),a});return o?s.unshift(i):s.push(i),i}}const Xr=e=>(t,n=Xo)=>{(!za||e==="sp")&&S1(e,(...o)=>t(...o),n)},$I=Xr("bm"),An=Xr("m"),GA=Xr("bu"),Bk=Xr("u"),ho=Xr("bum"),On=Xr("um"),FI=Xr("sp"),OI=Xr("rtg"),BI=Xr("rtc");function RI(e,t=Xo){S1("ec",e,t)}const Rk="components",DI="directives";function PI(e,t){return Dk(Rk,e,!0,t)||e}const YA=Symbol.for("v-ndc");function Ho(e){return Pn(e)?Dk(Rk,e,!1)||e:e||YA}function v4e(e){return Dk(DI,e)}function Dk(e,t,n=!0,o=!1){const s=Qo||Xo;if(s){const i=s.type;if(e===Rk){const l=iy(i,!1);if(l&&(l===t||l===Fo(t)||l===h1(Fo(t))))return i}const r=yw(s[e]||i[e],t)||yw(s.appContext[e],t);return!r&&o?i:r}}function yw(e,t){return e&&(e[t]||e[Fo(t)]||e[h1(Fo(t))])}function rt(e,t,n,o){let s;const i=n&&n[o],r=At(e);if(r||Pn(e)){const l=r&&Il(e);let a=!1,c=!1;l&&(a=!ei(e),c=Gr(e),e=y1(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?gu(Vi(e[u])):Vi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(Cn(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function ZA(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(At(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function jn(e,t,n={},o,s){if(Qo.ce||Qo.parent&&qr(Qo.parent)&&Qo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),Se(We,null,[ae("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&Pk(i(n)),l=n.key||r&&r.key,a=Se(We,{key:(l&&!ii(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Pk(e){return e.some(t=>Dl(t)?!(t.type===So||t.type===We&&!Pk(t.children)):!0)?e:null}function y4e(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:xp(o)]=e[o];return n}const Xv=e=>e?wM(e)?Rf(e):Xv(e.parent):null,Fd=Fn(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=>Xv(e.parent),$root:e=>Xv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Hk(e),$forceUpdate:e=>e.f||(e.f=()=>{$k(e.update)}),$nextTick:e=>e.n||(e.n=yt.bind(e.proxy)),$watch:e=>mI.bind(e)}),hg=(e,t)=>e!==ln&&!e.__isScriptSetup&&_n(e,t),Qv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(hg(o,t))return r[t]=1,o[t];if(s!==ln&&_n(s,t))return r[t]=2,s[t];if(_n(i,t))return r[t]=3,i[t];if(n!==ln&&_n(n,t))return r[t]=4,n[t];Jv&&(r[t]=0)}}const c=Fd[t];let u,d;if(c)return t==="$attrs"&&rs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==ln&&_n(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,_n(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return hg(s,t)?(s[t]=n,!0):o!==ln&&_n(o,t)?(o[t]=n,!0):_n(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==ln&&l[0]!=="$"&&_n(e,l)||hg(t,l)||_n(i,l)||_n(o,l)||_n(Fd,l)||_n(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:_n(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},HI=Fn({},Qv,{get(e,t){if(t!==Symbol.unscopables)return Qv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!b9(t)}});function k4e(){return null}function b4e(){return null}function x4e(e){}function w4e(e){}function _4e(){return null}function S4e(){}function C4e(e,t){return null}function A4e(){return XA().slots}function Bf(){return XA().attrs}function XA(e){const t=Mo();return t.setupContext||(t.setupContext=CM(t))}function rf(e){return At(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function M4e(e,t){const n=rf(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?At(s)||Rt(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function E4e(e,t){return!e||!t?e||t:At(e)&&At(t)?e.concat(t):Fn({},rf(e),rf(t))}function T4e(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function N4e(e){const t=Mo(),n=za;let o=e();af(),n&&su(!1);const s=()=>{Au(t),n&&su(!0)},i=()=>{Mo()!==t&&t.scope.off(),af(),n&&su(!1)};return Ek(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Jv=!0;function WI(e){const t=Hk(e),n=e.proxy,o=e.ctx;Jv=!1,t.beforeCreate&&kw(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:y,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:b,render:A,renderTracked:I,renderTriggered:N,errorCaptured:M,serverPrefetch:$,expose:T,inheritAttrs:F,components:S,directives:B,filters:W}=t;if(c&&zI(c,o,null),r)for(const O in r){const U=r[O];Rt(U)&&(o[O]=U.bind(n))}if(s){const O=s.call(n,n);Cn(O)&&(e.data=zo(O))}if(Jv=!0,i)for(const O in i){const U=i[O],Z=Rt(U)?U.bind(n,n):Rt(U.get)?U.get.bind(n,n):Ci,ie=!Rt(U)&&Rt(U.set)?U.set.bind(n):Ci,q=D({get:Z,set:ie});Object.defineProperty(o,O,{enumerable:!0,configurable:!0,get:()=>q.value,set:ee=>q.value=ee})}if(l)for(const O in l)QA(l[O],o,n,O);if(a){const O=Rt(a)?a.call(n):a;Reflect.ownKeys(O).forEach(U=>{Ln(U,O[U])})}u&&kw(u,e,"c");function L(O,U){At(U)?U.forEach(Z=>O(Z.bind(n))):U&&O(U.bind(n))}if(L($I,d),L(An,f),L(GA,h),L(Bk,p),L(NI,m),L(II,y),L(RI,M),L(BI,I),L(OI,N),L(ho,g),L(On,b),L(FI,$),At(T))if(T.length){const O=e.exposed||(e.exposed={});T.forEach(U=>{Object.defineProperty(O,U,{get:()=>n[U],set:Z=>n[U]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===Ci&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),B&&(e.directives=B),$&&Ok(e)}function zI(e,t,n=Ci){At(e)&&(e=ey(e));for(const o in e){const s=e[o];let i;Cn(s)?"default"in s?i=Jt(s.from||o,s.default,!0):i=Jt(s.from||o):i=Jt(s),vo(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function kw(e,t,n){Ei(At(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function QA(e,t,n,o){let s=o.includes(".")?PA(n,o):()=>n[o];if(Pn(e)){const i=t[e];Rt(i)&&et(s,i)}else if(Rt(e))et(s,e.bind(n));else if(Cn(e))if(At(e))e.forEach(i=>QA(i,t,n,o));else{const i=Rt(e.handler)?e.handler.bind(n):t[e.handler];Rt(i)&&et(s,i,e)}}function Hk(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>tm(a,c,r,!0)),tm(a,t,r)),Cn(t)&&i.set(t,a),a}function tm(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&tm(e,i,n,!0),s&&s.forEach(r=>tm(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=UI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const UI={data:bw,props:xw,emits:xw,methods:kd,computed:kd,beforeCreate:ds,created:ds,beforeMount:ds,mounted:ds,beforeUpdate:ds,updated:ds,beforeDestroy:ds,beforeUnmount:ds,destroyed:ds,unmounted:ds,activated:ds,deactivated:ds,errorCaptured:ds,serverPrefetch:ds,components:kd,directives:kd,watch:jI,provide:bw,inject:qI};function bw(e,t){return t?e?function(){return Fn(Rt(e)?e.call(this,this):e,Rt(t)?t.call(this,this):t)}:t:e}function qI(e,t){return kd(ey(e),ey(t))}function ey(e){if(At(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ds(e,t){return e?[...new Set([].concat(e,t))]:t}function kd(e,t){return e?Fn(Object.create(null),e,t):t}function xw(e,t){return e?At(e)&&At(t)?[...new Set([...e,...t])]:Fn(Object.create(null),rf(e),rf(t??{})):t}function jI(e,t){if(!e)return t;if(!t)return e;const n=Fn(Object.create(null),e);for(const o in t)n[o]=ds(e[o],t[o]);return n}function JA(){return{app:null,config:{isNativeTag:lA,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 VI=0;function KI(e,t){return function(o,s=null){Rt(o)||(o=Fn({},o)),s!=null&&!Cn(s)&&(s=null);const i=JA(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:VI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:w7,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Rt(u.install)?(r.add(u),u.install(c,...d)):Rt(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,f){if(!a){const h=c._ceVNode||ae(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Rf(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Ei(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=Ba;Ba=c;try{return u()}finally{Ba=d}}};return c}}let Ba=null;function I4e(e,t,n=ln){const o=Mo(),s=Fo(t),i=Bs(t),r=eM(e,s),l=eI((a,c)=>{let u,d=ln,f;return pI(()=>{const h=e[s];Zo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Zo(p,u)&&!(d!==ln&&Zo(h,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=h,c()),o.emit(`update:${t}`,p),Zo(h,p)&&Zo(h,d)&&!Zo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||ln:l,done:!1}:{done:!0}}}},l}const eM=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fo(t)}Modifiers`]||e[`${Bs(t)}Modifiers`];function GI(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||ln;let s=n;const i=t.startsWith("update:"),r=i&&eM(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Pn(u)?u.trim():u)),r.number&&(s=n.map(p1)));let l,a=o[l=xp(t)]||o[l=xp(Fo(t))];!a&&i&&(a=o[l=xp(Bs(t))]),a&&Ei(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ei(c,e,6,s)}}const YI=new WeakMap;function tM(e,t,n=!1){const o=n?YI:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!Rt(e)){const a=c=>{const u=tM(c,t,!0);u&&(l=!0,Fn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Cn(e)&&o.set(e,null),null):(At(i)?i.forEach(a=>r[a]=null):Fn(r,i),Cn(e)&&o.set(e,r),r)}function C1(e,t){return!e||!If(t)?!1:(t=t.slice(2).replace(/Once$/,""),_n(e,t[0].toLowerCase()+t.slice(1))||_n(e,Bs(t))||_n(e,t))}function wp(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,y=of(e);let k,g;try{if(n.shapeFlag&4){const b=s||o,A=b;k=Os(c.call(A,b,u,d,h,f,p)),g=l}else{const b=t;k=Os(b.length>1?b(d,{attrs:l,slots:r,emit:a}):b(d,null)),g=t.props?l:XI(l)}}catch(b){Od.length=0,Cu(b,e,1),k=ae(So)}let v=k;if(g&&m!==!1){const b=Object.keys(g),{shapeFlag:A}=v;b.length&&A&7&&(i&&b.some(c1)&&(g=QI(g,i)),v=Yr(v,g,!1,!0))}return n.dirs&&(v=Yr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Rl(v,n.transition),k=v,of(y),k}function ZI(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Dl(s)){if(s.type!==So||s.children==="v-if"){if(n)return;n=s}}else return}return n}const XI=e=>{let t;for(const n in e)(n==="class"||n==="style"||If(n))&&((t||(t={}))[n]=e[n]);return t},QI=(e,t)=>{const n={};for(const o in e)(!c1(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function JI(e,t,n){const{props:o,children:s,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 o?ww(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(nM(r,o,f)&&!C1(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?ww(o,r,c):!0:!!r;return!1}function ww(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(nM(t,e,i)&&!C1(n,i))return!0}return!1}function nM(e,t,n){const o=e[n],s=t[n];return n==="style"&&Cn(o)&&Cn(s)?!jr(o,s):o!==s}function A1({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const oM={},sM=()=>Object.create(oM),iM=e=>Object.getPrototypeOf(e)===oM;function e7(e,t,n,o=!1){const s={},i=sM();e.propsDefaults=Object.create(null),rM(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:Y9(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function t7(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=fn(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(C1(e.emitsOptions,f))continue;const h=t[f];if(a)if(_n(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=Fo(f);s[p]=ty(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{rM(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!_n(t,d)&&((u=Bs(d))===d||!_n(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=ty(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!_n(t,d))&&(delete i[d],c=!0)}c&&Dr(e.attrs,"set","")}function rM(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Fa(a))continue;const c=t[a];let u;s&&_n(s,u=Fo(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:C1(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=fn(n),c=l||ln;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ty(s,a,d,c[d],e,!_n(c,d))}}return r}function ty(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=_n(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Rt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=Au(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===Bs(n))&&(o=!0))}return o}const n7=new WeakMap;function lM(e,t,n=!1){const o=n?n7:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!Rt(e)){const u=d=>{a=!0;const[f,h]=lM(d,t,!0);Fn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Cn(e)&&o.set(e,Xc),Xc;if(At(i))for(let u=0;u<i.length;u++){const d=Fo(i[u]);_w(d)&&(r[d]=ln)}else if(i)for(const u in i){const d=Fo(u);if(_w(d)){const f=i[u],h=r[d]=At(f)||Rt(f)?{type:f}:Fn({},f),p=h.type;let m=!1,y=!0;if(At(p))for(let k=0;k<p.length;++k){const g=p[k],v=Rt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(y=!1)}else m=Rt(p)&&p.name==="Boolean";h[0]=m,h[1]=y,(m||_n(h,"default"))&&l.push(d)}}const c=[r,l];return Cn(e)&&o.set(e,c),c}function _w(e){return e[0]!=="$"&&!Fa(e)}const Wk=e=>e==="_"||e==="_ctx"||e==="$stable",zk=e=>At(e)?e.map(Os):[Os(e)],o7=(e,t,n)=>{if(t._n)return t;const o=Ie((...s)=>zk(t(...s)),n);return o._c=!1,o},aM=(e,t,n)=>{const o=e._ctx;for(const s in e){if(Wk(s))continue;const i=e[s];if(Rt(i))t[s]=o7(s,i,o);else if(i!=null){const r=zk(i);t[s]=()=>r}}},cM=(e,t)=>{const n=zk(t);e.slots.default=()=>n},uM=(e,t,n)=>{for(const o in t)(n||!Wk(o))&&(e[o]=t[o])},s7=(e,t,n)=>{const o=e.slots=sM();if(e.vnode.shapeFlag&32){const s=t._;s?(uM(o,t,n),n&&cA(o,"_",s,!0)):aM(t,o)}else t&&cM(e,t)},i7=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=ln;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:uM(s,t,n):(i=!t.$stable,aM(t,s)),r=t}else t&&(cM(e,t),r={default:1});if(i)for(const l in s)!Wk(l)&&r[l]==null&&delete s[l]},xo=gM;function r7(e){return dM(e)}function l7(e){return dM(e,_I)}function dM(e,t){const n=m1();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Ci,insertStaticContent:p}=e,m=(P,G,me,ye=null,de=null,V=null,se=void 0,pe=null,ke=!!G.dynamicChildren)=>{if(P===G)return;P&&!Pi(P,G)&&(ye=ve(P),ee(P,de,V,!0),P=null),G.patchFlag===-2&&(ke=!1,G.dynamicChildren=null);const{type:Ne,ref:qe,shapeFlag:be}=G;switch(Ne){case Ll:y(P,G,me,ye);break;case So:k(P,G,me,ye);break;case ou:P==null&&g(G,me,ye,se);break;case We:S(P,G,me,ye,de,V,se,pe,ke);break;default:be&1?A(P,G,me,ye,de,V,se,pe,ke):be&6?B(P,G,me,ye,de,V,se,pe,ke):(be&64||be&128)&&Ne.process(P,G,me,ye,de,V,se,pe,ke,re)}qe!=null&&de?tu(qe,P&&P.ref,V,G||P,!G):qe==null&&P&&P.ref!=null&&tu(P.ref,null,V,P,!0)},y=(P,G,me,ye)=>{if(P==null)o(G.el=l(G.children),me,ye);else{const de=G.el=P.el;G.children!==P.children&&c(de,G.children)}},k=(P,G,me,ye)=>{P==null?o(G.el=a(G.children||""),me,ye):G.el=P.el},g=(P,G,me,ye)=>{[P.el,P.anchor]=p(P.children,G,me,ye,P.el,P.anchor)},v=({el:P,anchor:G},me,ye)=>{let de;for(;P&&P!==G;)de=f(P),o(P,me,ye),P=de;o(G,me,ye)},b=({el:P,anchor:G})=>{let me;for(;P&&P!==G;)me=f(P),s(P),P=me;s(G)},A=(P,G,me,ye,de,V,se,pe,ke)=>{if(G.type==="svg"?se="svg":G.type==="math"&&(se="mathml"),P==null)I(G,me,ye,de,V,se,pe,ke);else{const Ne=P.el&&P.el._isVueCE?P.el:null;try{Ne&&Ne._beginPatch(),$(P,G,de,V,se,pe,ke)}finally{Ne&&Ne._endPatch()}}},I=(P,G,me,ye,de,V,se,pe)=>{let ke,Ne;const{props:qe,shapeFlag:be,transition:xe,dirs:Ze}=P;if(ke=P.el=r(P.type,V,qe&&qe.is,qe),be&8?u(ke,P.children):be&16&&M(P.children,ke,null,ye,de,pg(P,V),se,pe),Ze&&rr(P,null,ye,"created"),N(ke,P,P.scopeId,se,ye),qe){for(const lt in qe)lt!=="value"&&!Fa(lt)&&i(ke,lt,null,qe[lt],V,ye);"value"in qe&&i(ke,"value",null,qe.value,V),(Ne=qe.onVnodeBeforeMount)&&Is(Ne,ye,P)}Ze&&rr(P,null,ye,"beforeMount");const tt=fM(de,xe);tt&&xe.beforeEnter(ke),o(ke,G,me),((Ne=qe&&qe.onVnodeMounted)||tt||Ze)&&xo(()=>{try{Ne&&Is(Ne,ye,P),tt&&xe.enter(ke),Ze&&rr(P,null,ye,"mounted")}finally{}},de)},N=(P,G,me,ye,de)=>{if(me&&h(P,me),ye)for(let V=0;V<ye.length;V++)h(P,ye[V]);if(de){let V=de.subTree;if(G===V||om(V.type)&&(V.ssContent===G||V.ssFallback===G)){const se=de.vnode;N(P,se,se.scopeId,se.slotScopeIds,de.parent)}}},M=(P,G,me,ye,de,V,se,pe,ke=0)=>{for(let Ne=ke;Ne<P.length;Ne++){const qe=P[Ne]=pe?Br(P[Ne]):Os(P[Ne]);m(null,qe,G,me,ye,de,V,se,pe)}},$=(P,G,me,ye,de,V,se)=>{const pe=G.el=P.el;let{patchFlag:ke,dynamicChildren:Ne,dirs:qe}=G;ke|=P.patchFlag&16;const be=P.props||ln,xe=G.props||ln;let Ze;if(me&&ca(me,!1),(Ze=xe.onVnodeBeforeUpdate)&&Is(Ze,me,G,P),qe&&rr(G,P,me,"beforeUpdate"),me&&ca(me,!0),(be.innerHTML&&xe.innerHTML==null||be.textContent&&xe.textContent==null)&&u(pe,""),Ne?T(P.dynamicChildren,Ne,pe,me,ye,pg(G,de),V):se||U(P,G,pe,null,me,ye,pg(G,de),V,!1),ke>0){if(ke&16)F(pe,be,xe,me,de);else if(ke&2&&be.class!==xe.class&&i(pe,"class",null,xe.class,de),ke&4&&i(pe,"style",be.style,xe.style,de),ke&8){const tt=G.dynamicProps;for(let lt=0;lt<tt.length;lt++){const ut=tt[lt],mt=be[ut],Tt=xe[ut];(Tt!==mt||ut==="value")&&i(pe,ut,mt,Tt,de,me)}}ke&1&&P.children!==G.children&&u(pe,G.children)}else!se&&Ne==null&&F(pe,be,xe,me,de);((Ze=xe.onVnodeUpdated)||qe)&&xo(()=>{Ze&&Is(Ze,me,G,P),qe&&rr(G,P,me,"updated")},ye)},T=(P,G,me,ye,de,V,se)=>{for(let pe=0;pe<G.length;pe++){const ke=P[pe],Ne=G[pe],qe=ke.el&&(ke.type===We||!Pi(ke,Ne)||ke.shapeFlag&198)?d(ke.el):me;m(ke,Ne,qe,null,ye,de,V,se,!0)}},F=(P,G,me,ye,de)=>{if(G!==me){if(G!==ln)for(const V in G)!Fa(V)&&!(V in me)&&i(P,V,G[V],null,de,ye);for(const V in me){if(Fa(V))continue;const se=me[V],pe=G[V];se!==pe&&V!=="value"&&i(P,V,pe,se,de,ye)}"value"in me&&i(P,"value",G.value,me.value,de)}},S=(P,G,me,ye,de,V,se,pe,ke)=>{const Ne=G.el=P?P.el:l(""),qe=G.anchor=P?P.anchor:l("");let{patchFlag:be,dynamicChildren:xe,slotScopeIds:Ze}=G;Ze&&(pe=pe?pe.concat(Ze):Ze),P==null?(o(Ne,me,ye),o(qe,me,ye),M(G.children||[],me,qe,de,V,se,pe,ke)):be>0&&be&64&&xe&&P.dynamicChildren&&P.dynamicChildren.length===xe.length?(T(P.dynamicChildren,xe,me,de,V,se,pe),(G.key!=null||de&&G===de.subTree)&&Uk(P,G,!0)):U(P,G,me,qe,de,V,se,pe,ke)},B=(P,G,me,ye,de,V,se,pe,ke)=>{G.slotScopeIds=pe,P==null?G.shapeFlag&512?de.ctx.activate(G,me,ye,se,ke):W(G,me,ye,de,V,se,ke):z(P,G,ke)},W=(P,G,me,ye,de,V,se)=>{const pe=P.component=xM(P,ye,de);if(Of(P)&&(pe.ctx.renderer=re),_M(pe,!1,se),pe.asyncDep){if(de&&de.registerDep(pe,L,se),!P.el){const ke=pe.subTree=ae(So);k(null,ke,G,me),P.placeholder=ke.el}}else L(pe,P,G,me,de,V,se)},z=(P,G,me)=>{const ye=G.component=P.component;if(JI(P,G,me))if(ye.asyncDep&&!ye.asyncResolved){O(ye,G,me);return}else ye.next=G,ye.update();else G.el=P.el,ye.vnode=G},L=(P,G,me,ye,de,V,se)=>{const pe=()=>{if(P.isMounted){let{next:be,bu:xe,u:Ze,parent:tt,vnode:lt}=P;{const Ft=hM(P);if(Ft){be&&(be.el=lt.el,O(P,be,se)),Ft.asyncDep.then(()=>{xo(()=>{P.isUnmounted||Ne()},de)});return}}let ut=be,mt;ca(P,!1),be?(be.el=lt.el,O(P,be,se)):be=lt,xe&&Jc(xe),(mt=be.props&&be.props.onVnodeBeforeUpdate)&&Is(mt,tt,be,lt),ca(P,!0);const Tt=wp(P),wt=P.subTree;P.subTree=Tt,m(wt,Tt,d(wt.el),ve(wt),P,de,V),be.el=Tt.el,ut===null&&A1(P,Tt.el),Ze&&xo(Ze,de),(mt=be.props&&be.props.onVnodeUpdated)&&xo(()=>Is(mt,tt,be,lt),de)}else{let be;const{el:xe,props:Ze}=G,{bm:tt,m:lt,parent:ut,root:mt,type:Tt}=P,wt=qr(G);if(ca(P,!1),tt&&Jc(tt),!wt&&(be=Ze&&Ze.onVnodeBeforeMount)&&Is(be,ut,G),ca(P,!0),xe&&Q){const Ft=()=>{P.subTree=wp(P),Q(xe,P.subTree,P,de,null)};wt&&Tt.__asyncHydrate?Tt.__asyncHydrate(xe,P,Ft):Ft()}else{mt.ce&&mt.ce._hasShadowRoot()&&mt.ce._injectChildStyle(Tt,P.parent?P.parent.type:void 0);const Ft=P.subTree=wp(P);m(null,Ft,me,ye,P,de,V),G.el=Ft.el}if(lt&&xo(lt,de),!wt&&(be=Ze&&Ze.onVnodeMounted)){const Ft=G;xo(()=>Is(be,ut,Ft),de)}(G.shapeFlag&256||ut&&qr(ut.vnode)&&ut.vnode.shapeFlag&256)&&P.a&&xo(P.a,de),P.isMounted=!0,G=me=ye=null}};P.scope.on();const ke=P.effect=new Gp(pe);P.scope.off();const Ne=P.update=ke.run.bind(ke),qe=P.job=ke.runIfDirty.bind(ke);qe.i=P,qe.id=P.uid,ke.scheduler=()=>$k(qe),ca(P,!0),Ne()},O=(P,G,me)=>{G.component=P;const ye=P.vnode.props;P.vnode=G,P.next=null,t7(P,G.props,ye,me),i7(P,G.children,me),Vr(),uw(P),Kr()},U=(P,G,me,ye,de,V,se,pe,ke=!1)=>{const Ne=P&&P.children,qe=P?P.shapeFlag:0,be=G.children,{patchFlag:xe,shapeFlag:Ze}=G;if(xe>0){if(xe&128){ie(Ne,be,me,ye,de,V,se,pe,ke);return}else if(xe&256){Z(Ne,be,me,ye,de,V,se,pe,ke);return}}Ze&8?(qe&16&&K(Ne,de,V),be!==Ne&&u(me,be)):qe&16?Ze&16?ie(Ne,be,me,ye,de,V,se,pe,ke):K(Ne,de,V,!0):(qe&8&&u(me,""),Ze&16&&M(be,me,ye,de,V,se,pe,ke))},Z=(P,G,me,ye,de,V,se,pe,ke)=>{P=P||Xc,G=G||Xc;const Ne=P.length,qe=G.length,be=Math.min(Ne,qe);let xe;for(xe=0;xe<be;xe++){const Ze=G[xe]=ke?Br(G[xe]):Os(G[xe]);m(P[xe],Ze,me,null,de,V,se,pe,ke)}Ne>qe?K(P,de,V,!0,!1,be):M(G,me,ye,de,V,se,pe,ke,be)},ie=(P,G,me,ye,de,V,se,pe,ke)=>{let Ne=0;const qe=G.length;let be=P.length-1,xe=qe-1;for(;Ne<=be&&Ne<=xe;){const Ze=P[Ne],tt=G[Ne]=ke?Br(G[Ne]):Os(G[Ne]);if(Pi(Ze,tt))m(Ze,tt,me,null,de,V,se,pe,ke);else break;Ne++}for(;Ne<=be&&Ne<=xe;){const Ze=P[be],tt=G[xe]=ke?Br(G[xe]):Os(G[xe]);if(Pi(Ze,tt))m(Ze,tt,me,null,de,V,se,pe,ke);else break;be--,xe--}if(Ne>be){if(Ne<=xe){const Ze=xe+1,tt=Ze<qe?G[Ze].el:ye;for(;Ne<=xe;)m(null,G[Ne]=ke?Br(G[Ne]):Os(G[Ne]),me,tt,de,V,se,pe,ke),Ne++}}else if(Ne>xe)for(;Ne<=be;)ee(P[Ne],de,V,!0),Ne++;else{const Ze=Ne,tt=Ne,lt=new Map;for(Ne=tt;Ne<=xe;Ne++){const Pt=G[Ne]=ke?Br(G[Ne]):Os(G[Ne]);Pt.key!=null&&lt.set(Pt.key,Ne)}let ut,mt=0;const Tt=xe-tt+1;let wt=!1,Ft=0;const en=new Array(Tt);for(Ne=0;Ne<Tt;Ne++)en[Ne]=0;for(Ne=Ze;Ne<=be;Ne++){const Pt=P[Ne];if(mt>=Tt){ee(Pt,de,V,!0);continue}let bn;if(Pt.key!=null)bn=lt.get(Pt.key);else for(ut=tt;ut<=xe;ut++)if(en[ut-tt]===0&&Pi(Pt,G[ut])){bn=ut;break}bn===void 0?ee(Pt,de,V,!0):(en[bn-tt]=Ne+1,bn>=Ft?Ft=bn:wt=!0,m(Pt,G[bn],me,null,de,V,se,pe,ke),mt++)}const Hn=wt?a7(en):Xc;for(ut=Hn.length-1,Ne=Tt-1;Ne>=0;Ne--){const Pt=tt+Ne,bn=G[Pt],pn=G[Pt+1],Kt=Pt+1<qe?pn.el||pM(pn):ye;en[Ne]===0?m(null,bn,me,Kt,de,V,se,pe,ke):wt&&(ut<0||Ne!==Hn[ut]?q(bn,me,Kt,2):ut--)}}},q=(P,G,me,ye,de=null)=>{const{el:V,type:se,transition:pe,children:ke,shapeFlag:Ne}=P;if(Ne&6){q(P.component.subTree,G,me,ye);return}if(Ne&128){P.suspense.move(G,me,ye);return}if(Ne&64){se.move(P,G,me,re);return}if(se===We){o(V,G,me);for(let be=0;be<ke.length;be++)q(ke[be],G,me,ye);o(P.anchor,G,me);return}if(se===ou){v(P,G,me);return}if(ye!==2&&Ne&1&&pe)if(ye===0)pe.persisted&&!V[ki]?o(V,G,me):(pe.beforeEnter(V),o(V,G,me),xo(()=>pe.enter(V),de));else{const{leave:be,delayLeave:xe,afterLeave:Ze}=pe,tt=()=>{P.ctx.isUnmounted?s(V):o(V,G,me)},lt=()=>{const ut=V._isLeaving||!!V[ki];V._isLeaving&&V[ki](!0),pe.persisted&&!ut?tt():be(V,()=>{tt(),Ze&&Ze()})};xe?xe(V,tt,lt):lt()}else o(V,G,me)},ee=(P,G,me,ye=!1,de=!1)=>{const{type:V,props:se,ref:pe,children:ke,dynamicChildren:Ne,shapeFlag:qe,patchFlag:be,dirs:xe,cacheIndex:Ze,memo:tt}=P;if(be===-2&&(de=!1),pe!=null&&(Vr(),tu(pe,null,me,P,!0),Kr()),Ze!=null&&(G.renderCache[Ze]=void 0),qe&256){G.ctx.deactivate(P);return}const lt=qe&1&&xe,ut=!qr(P);let mt;if(ut&&(mt=se&&se.onVnodeBeforeUnmount)&&Is(mt,G,P),qe&6)j(P.component,me,ye);else{if(qe&128){P.suspense.unmount(me,ye);return}lt&&rr(P,null,G,"beforeUnmount"),qe&64?P.type.remove(P,G,me,re,ye):Ne&&!Ne.hasOnce&&(V!==We||be>0&&be&64)?K(Ne,G,me,!1,!0):(V===We&&be&384||!de&&qe&16)&&K(ke,G,me),ye&&fe(P)}const Tt=tt!=null&&Ze==null;(ut&&(mt=se&&se.onVnodeUnmounted)||lt||Tt)&&xo(()=>{mt&&Is(mt,G,P),lt&&rr(P,null,G,"unmounted"),Tt&&(P.el=null)},me)},fe=P=>{const{type:G,el:me,anchor:ye,transition:de}=P;if(G===We){ne(me,ye);return}if(G===ou){b(P);return}const V=()=>{s(me),de&&!de.persisted&&de.afterLeave&&de.afterLeave()};if(P.shapeFlag&1&&de&&!de.persisted){const{leave:se,delayLeave:pe}=de,ke=()=>se(me,V);pe?pe(P.el,V,ke):ke()}else V()},ne=(P,G)=>{let me;for(;P!==G;)me=f(P),s(P),P=me;s(G)},j=(P,G,me)=>{const{bum:ye,scope:de,job:V,subTree:se,um:pe,m:ke,a:Ne}=P;nm(ke),nm(Ne),ye&&Jc(ye),de.stop(),V&&(V.flags|=8,ee(se,P,G,me)),pe&&xo(pe,G),xo(()=>{P.isUnmounted=!0},G)},K=(P,G,me,ye=!1,de=!1,V=0)=>{for(let se=V;se<P.length;se++)ee(P[se],G,me,ye,de)},ve=P=>{if(P.shapeFlag&6)return ve(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const G=f(P.anchor||P.el),me=G&&G[HA];return me?f(me):G};let he=!1;const Ae=(P,G,me)=>{let ye;P==null?G._vnode&&(ee(G._vnode,null,null,!0),ye=G._vnode.component):m(G._vnode||null,P,G,null,null,null,me),G._vnode=P,he||(he=!0,uw(ye),Jp(),he=!1)},re={p:m,um:ee,m:q,r:fe,mt:W,mc:M,pc:U,pbc:T,n:ve,o:e};let Y,Q;return t&&([Y,Q]=t(re)),{render:Ae,hydrate:Y,createApp:KI(Ae,Y)}}function pg({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 ca({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function fM(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Uk(e,t,n=!1){const o=e.children,s=t.children;if(At(o)&&At(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Br(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Uk(r,l)),l.type===Ll&&(l.patchFlag===-1&&(l=s[i]=Br(l)),l.el=r.el),l.type===So&&!l.el&&(l.el=r.el)}}function a7(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);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[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function hM(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:hM(t)}function nm(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function pM(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?pM(t.subTree):null}const om=e=>e.__isSuspense;let ny=0;const c7={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)u7(t,n,o,s,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}d7(e,t,n,o,s,r,l,a,c)}},hydrate:f7,normalize:h7},L4e=c7;function lf(e,t){const n=e.props&&e.props[t];Rt(n)&&n()}function u7(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=mM(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(lf(e,"onPending"),lf(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),nu(f,e.ssFallback)):f.resolve(!1,!0)}function d7(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:y,isHydrating:k}=d;if(m)d.pendingBranch=f,Pi(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():y&&(k||(a(p,h,n,o,s,null,i,r,l),nu(d,h)))):(d.pendingId=ny++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),nu(d,h))):p&&Pi(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Pi(p,f))a(p,f,n,o,s,d,i,r,l),nu(d,f);else if(lf(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=ny++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function mM(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:y}}=c;let k;const g=p7(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?Kp(e.props.timeout):void 0,b=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:ny++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(I=!1,N=!1){const{vnode:M,activeBranch:$,pendingBranch:T,pendingId:F,effects:S,parentComponent:B,container:W,isInFallback:z}=A;let L=!1;if(A.isHydrating)A.isHydrating=!1;else if(!I){L=$&&T.transition&&T.transition.mode==="out-in";let Z=!1;L&&($.transition.afterLeave=()=>{F===A.pendingId&&(f(T,W,i===b&&!Z?p($):i,0),Qp(S),z&&M.ssFallback&&(M.ssFallback.el=null))}),$&&!A.isFallbackMountPending&&(m($.el)===W&&(i=p($),Z=!0),h($,B,A,!0),!L&&z&&M.ssFallback&&xo(()=>M.ssFallback.el=null,A)),L||f(T,W,i,0)}A.isFallbackMountPending=!1,nu(A,T),A.pendingBranch=null,A.isInFallback=!1;let O=A.parent,U=!1;for(;O;){if(O.pendingBranch){O.effects.push(...S),U=!0;break}O=O.parent}!U&&!L&&Qp(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),lf(M,"onResolve")},fallback(I){if(!A.pendingBranch)return;const{vnode:N,activeBranch:M,parentComponent:$,container:T,namespace:F}=A;lf(N,"onFallback");const S=p(M),B=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,I,T,S,$,null,F,l,a),nu(A,I))},W=I.transition&&I.transition.mode==="out-in";W&&(A.isFallbackMountPending=!0,M.transition.afterLeave=B),A.isInFallback=!0,h(M,$,null,!0),W||B()},move(I,N,M){A.activeBranch&&f(A.activeBranch,I,N,M),A.container=I},next(){return A.activeBranch&&p(A.activeBranch)},registerDep(I,N,M){const $=!!A.pendingBranch;$&&A.deps++;const T=I.vnode.el;I.asyncDep.catch(F=>{Cu(F,I,0)}).then(F=>{if(I.isUnmounted||A.isUnmounted||A.pendingId!==I.suspenseId)return;af(),I.asyncResolved=!0;const{vnode:S}=I;oy(I,F,!1),T&&(S.el=T);const B=!T&&I.subTree.el;N(I,S,m(T||I.subTree.el),T?null:p(I.subTree),A,r,M),B&&(S.placeholder=null,y(B)),A1(I,S.el),$&&--A.deps===0&&A.resolve()})},unmount(I,N){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,I,N),A.pendingBranch&&h(A.pendingBranch,n,I,N)}};return A}function f7(e,t,n,o,s,i,r,l,a){const c=t.suspense=mM(t,o,n,e.parentNode,document.createElement("div"),null,s,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 h7(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Sw(o?n.default:n),e.ssFallback=o?Sw(n.fallback):ae(So)}function Sw(e){let t;if(Rt(e)){const n=Wa&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=ls,vM())}return At(e)&&(e=ZI(e)),e=Os(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function gM(e,t){t&&t.pendingBranch?At(e)?t.effects.push(...e):t.effects.push(e):Qp(e)}function nu(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,A1(o,s))}function p7(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const We=Symbol.for("v-fgt"),Ll=Symbol.for("v-txt"),So=Symbol.for("v-cmt"),ou=Symbol.for("v-stc"),Od=[];let ls=null;function x(e=!1){Od.push(ls=e?null:[])}function vM(){Od.pop(),ls=Od[Od.length-1]||null}let Wa=1;function sm(e,t=!1){Wa+=e,e<0&&ls&&t&&(ls.hasOnce=!0)}function yM(e){return e.dynamicChildren=Wa>0?ls||Xc:null,vM(),Wa>0&&ls&&ls.push(e),e}function E(e,t,n,o,s,i){return yM(w(e,t,n,o,s,i,!0))}function Se(e,t,n,o,s){return yM(ae(e,t,n,o,s,!0))}function Dl(e){return e?e.__v_isVNode===!0:!1}function Pi(e,t){return e.type===t.type&&e.key===t.key}function $4e(e){}const kM=({key:e})=>e??null,_p=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Pn(e)||vo(e)||Rt(e)?{i:Qo,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,o=0,s=null,i=e===We?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&kM(t),ref:t&&_p(t),scopeId:w1,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:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Qo};return l?(jk(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Pn(n)?8:16),Wa>0&&!r&&ls&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&ls.push(a),a}const ae=m7;function m7(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===YA)&&(e=So),Dl(e)){const l=Yr(e,t,!0);return n&&jk(l,n),Wa>0&&!i&&ls&&(l.shapeFlag&6?ls[ls.indexOf(e)]=l:ls.push(l)),l.patchFlag=-2,l}if(b7(e)&&(e=e.__vccOpts),t){t=bM(t);let{class:l,style:a}=t;l&&!Pn(l)&&(t.class=Ue(l)),Cn(a)&&(x1(a)&&!At(a)&&(a=Fn({},a)),t.style=on(a))}const r=Pn(e)?1:om(e)?128:WA(e)?64:Cn(e)?4:Rt(e)?2:0;return w(e,t,n,o,s,r,i,!0)}function bM(e){return e?x1(e)||iM(e)?Fn({},e):e:null}function Yr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Sn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&kM(c),ref:t&&t.ref?n&&i?At(i)?i.concat(_p(t)):[i,_p(t)]:_p(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!==We?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&&Yr(e.ssContent),ssFallback:e.ssFallback&&Yr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Rl(u,a.clone(u)),u}function ot(e=" ",t=0){return ae(Ll,null,e,t)}function qk(e,t){const n=ae(ou,null,e);return n.staticCount=t,n}function ue(e="",t=!1){return t?(x(),Se(So,null,e)):ae(So,null,e)}function Os(e){return e==null||typeof e=="boolean"?ae(So):At(e)?ae(We,null,e.slice()):Dl(e)?Br(e):ae(Ll,null,String(e))}function Br(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yr(e)}function jk(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(At(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),jk(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!iM(t)?t._ctx=Qo:s===3&&Qo&&(Qo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Rt(t)?(t={default:t,_ctx:Qo},n=32):(t=String(t),o&64?(n=16,t=[ot(t)]):n=8);e.children=t,e.shapeFlag|=n}function Sn(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=Ue([t.class,o.class]));else if(s==="style")t.style=on([t.style,o.style]);else if(If(s)){const i=t[s],r=o[s];r&&i!==r&&!(At(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!c1(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Is(e,t,n,o=null){Ei(e,t,7,[n,o])}const g7=JA();let v7=0;function xM(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||g7,i={uid:v7++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new hA(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:lM(o,s),emitsOptions:tM(o,s),emit:null,emitted:null,propsDefaults:ln,inheritAttrs:o.inheritAttrs,ctx:ln,data:ln,props:ln,attrs:ln,slots:ln,refs:ln,setupState:ln,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=GI.bind(null,i),e.ce&&e.ce(i),i}let Xo=null;const Mo=()=>Xo||Qo;let im,su;{const e=m1(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};im=t("__VUE_INSTANCE_SETTERS__",n=>Xo=n),su=t("__VUE_SSR_SETTERS__",n=>za=n)}const Au=e=>{const t=Xo;return im(e),e.scope.on(),()=>{e.scope.off(),im(t)}},af=()=>{Xo&&Xo.scope.off(),im(null)};function wM(e){return e.vnode.shapeFlag&4}let za=!1;function _M(e,t=!1,n=!1){t&&su(t);const{props:o,children:s}=e.vnode,i=wM(e);e7(e,o,i,t),s7(e,s,n||t);const r=i?y7(e,t):void 0;return t&&su(!1),r}function y7(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Qv);const{setup:o}=n;if(o){Vr();const s=e.setupContext=o.length>1?CM(e):null,i=Au(e),r=$f(o,e,0,[e.props,s]),l=Ek(r);if(Kr(),i(),(l||e.sp)&&!qr(e)&&Ok(e),l){if(r.then(af,af),t)return r.then(a=>{oy(e,a,t)}).catch(a=>{Cu(a,e,0)});e.asyncDep=r}else oy(e,r,t)}else SM(e,t)}function oy(e,t,n){Rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Cn(t)&&(e.setupState=IA(t)),SM(e,n)}let rm,sy;function F4e(e){rm=e,sy=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,HI))}}const O4e=()=>!rm;function SM(e,t,n){const o=e.type;if(!e.render){if(!t&&rm&&!o.render){const s=o.template||Hk(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=Fn(Fn({isCustomElement:i,delimiters:l},r),a);o.render=rm(s,c)}}e.render=o.render||Ci,sy&&sy(e)}{const s=Au(e);Vr();try{WI(e)}finally{Kr(),s()}}}const k7={get(e,t){return rs(e,"get",""),e[t]}};function CM(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,k7),slots:e.slots,emit:e.emit,expose:t}}function Rf(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(IA(gt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fd)return Fd[n](e)},has(t,n){return n in t||n in Fd}})):e.proxy}function iy(e,t=!0){return Rt(e)?e.displayName||e.name:e.name||t&&e.__name}function b7(e){return Rt(e)&&"__vccOpts"in e}const D=(e,t)=>sI(e,t,za);function Lt(e,t,n){try{sm(-1);const o=arguments.length;return o===2?Cn(t)&&!At(t)?Dl(t)?ae(e,null,[t]):ae(e,t):ae(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Dl(n)&&(n=[n]),ae(e,t,n))}finally{sm(1)}}function B4e(){}function R4e(e,t,n,o){const s=n[o];if(s&&x7(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function x7(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Zo(n[o],t[o]))return!1;return Wa>0&&ls&&ls.push(e),!0}const w7="3.5.35",D4e=Ci,P4e=cI,H4e=Oc,W4e=RA,_7={createComponentInstance:xM,setupComponent:_M,renderComponentRoot:wp,setCurrentRenderingInstance:of,isVNode:Dl,normalizeVNode:Os,getComponentPublicInstance:Rf,ensureValidVNode:Pk,pushWarningContext:lI,popWarningContext:aI},z4e=_7,U4e=null,q4e=null,j4e=null;/**
17
- * @vue/runtime-dom v3.5.35
18
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
- * @license MIT
20
- **/let ry;const Cw=typeof window<"u"&&window.trustedTypes;if(Cw)try{ry=Cw.createPolicy("vue",{createHTML:e=>e})}catch{}const AM=ry?e=>ry.createHTML(e):e=>e,S7="http://www.w3.org/2000/svg",C7="http://www.w3.org/1998/Math/MathML",Ir=typeof document<"u"?document:null,Aw=Ir&&Ir.createElement("template"),A7={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Ir.createElementNS(S7,e):t==="mathml"?Ir.createElementNS(C7,e):n?Ir.createElement(e,{is:n}):Ir.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Ir.createTextNode(e),createComment:e=>Ir.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ir.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Aw.innerHTML=AM(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Aw.content;if(o==="svg"||o==="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]}},ll="transition",sd="animation",vu=Symbol("_vtc"),MM={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},EM=Fn({},UA,MM),M7=e=>(e.displayName="Transition",e.props=EM,e),Ua=M7((e,{slots:t})=>Lt(bI,TM(e),t)),ua=(e,t=[])=>{At(e)?e.forEach(n=>n(...t)):e&&e(...t)},Mw=e=>e?At(e)?e.some(t=>t.length>1):e.length>1:!1;function TM(e){const t={};for(const S in e)S in MM||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,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:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=E7(s),m=p&&p[0],y=p&&p[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:b,onLeaveCancelled:A,onBeforeAppear:I=k,onAppear:N=g,onAppearCancelled:M=v}=t,$=(S,B,W,z)=>{S._enterCancelled=z,vl(S,B?u:l),vl(S,B?c:r),W&&W()},T=(S,B)=>{S._isLeaving=!1,vl(S,d),vl(S,h),vl(S,f),B&&B()},F=S=>(B,W)=>{const z=S?N:g,L=()=>$(B,S,W);ua(z,[B,L]),Ew(()=>{vl(B,S?a:i),sr(B,S?u:l),Mw(z)||Tw(B,o,m,L)})};return Fn(t,{onBeforeEnter(S){ua(k,[S]),sr(S,i),sr(S,r)},onBeforeAppear(S){ua(I,[S]),sr(S,a),sr(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,B){S._isLeaving=!0;const W=()=>T(S,B);sr(S,d),S._enterCancelled?(sr(S,f),ly(S)):(ly(S),sr(S,f)),Ew(()=>{S._isLeaving&&(vl(S,d),sr(S,h),Mw(b)||Tw(S,o,y,W))}),ua(b,[S,W])},onEnterCancelled(S){$(S,!1,void 0,!0),ua(v,[S])},onAppearCancelled(S){$(S,!0,void 0,!0),ua(M,[S])},onLeaveCancelled(S){T(S),ua(A,[S])}})}function E7(e){if(e==null)return null;if(Cn(e))return[mg(e.enter),mg(e.leave)];{const t=mg(e);return[t,t]}}function mg(e){return Kp(e)}function sr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[vu]||(e[vu]=new Set)).add(t)}function vl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[vu];n&&(n.delete(t),n.size||(e[vu]=void 0))}function Ew(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let T7=0;function Tw(e,t,n,o){const s=e._endId=++T7,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=NM(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function NM(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${ll}Delay`),i=o(`${ll}Duration`),r=Nw(s,i),l=o(`${sd}Delay`),a=o(`${sd}Duration`),c=Nw(l,a);let u=null,d=0,f=0;t===ll?r>0&&(u=ll,d=r,f=i.length):t===sd?c>0&&(u=sd,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?ll:sd:null,f=u?u===ll?i.length:a.length:0);const h=u===ll&&/\b(?:transform|all)(?:,|$)/.test(o(`${ll}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Nw(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Iw(n)+Iw(e[o])))}function Iw(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ly(e){return(e?e.ownerDocument:document).body.offsetHeight}function N7(e,t,n){const o=e[vu];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const lm=Symbol("_vod"),IM=Symbol("_vsh"),xi={name:"show",beforeMount(e,{value:t},{transition:n}){e[lm]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):id(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),id(e,!0),o.enter(e)):o.leave(e,()=>{id(e,!1)}):id(e,t))},beforeUnmount(e,{value:t}){id(e,t)}};function id(e,t){e.style.display=t?e[lm]:"none",e[IM]=!t}function I7(){xi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const LM=Symbol("");function V4e(e){const t=Mo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>am(i,s))},o=()=>{const s=e(t.proxy);t.ce?am(t.ce,s):ay(t.subTree,s),n(s)};GA(()=>{Qp(o)}),An(()=>{et(o,Ci,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),On(()=>s.disconnect())})}function ay(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{ay(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)am(e.el,t);else if(e.type===We)e.children.forEach(n=>ay(n,t));else if(e.type===ou){let{el:n,anchor:o}=e;for(;n&&(am(n,t),n!==o);)n=n.nextSibling}}function am(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=T9(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[LM]=o}}const L7=/(?:^|;)\s*display\s*:/;function $7(e,t,n){const o=e.style,s=Pn(n);let i=!1;if(n&&!s){if(t)if(Pn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&bd(o,l,"")}else for(const r in t)n[r]==null&&bd(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?O7(e,r,!Pn(t)&&t?t[r]:void 0,l)||bd(o,r,l):bd(o,r,"")}}else if(s){if(t!==n){const r=o[LM];r&&(n+=";"+r),o.cssText=n,i=L7.test(n)}}else t&&e.removeAttribute("style");lm in e&&(e[lm]=i?o.display:"",e[IM]&&(o.display="none"))}const Lw=/\s*!important$/;function bd(e,t,n){if(At(n))n.forEach(o=>bd(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=F7(e,t);Lw.test(n)?e.setProperty(Bs(o),n.replace(Lw,""),"important"):e[o]=n}}const $w=["Webkit","Moz","ms"],gg={};function F7(e,t){const n=gg[t];if(n)return n;let o=Fo(t);if(o!=="filter"&&o in e)return gg[t]=o;o=h1(o);for(let s=0;s<$w.length;s++){const i=$w[s]+o;if(i in e)return gg[t]=i}return t}function O7(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Pn(o)&&n===o}const Fw="http://www.w3.org/1999/xlink";function Ow(e,t,n,o,s,i=M9(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Fw,t.slice(6,t.length)):e.setAttributeNS(Fw,t,n):n==null||i&&!uA(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ii(n)?String(n):n)}function Bw(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?AM(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=uA(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Hr(e,t,n,o){e.addEventListener(t,n,o)}function B7(e,t,n,o){e.removeEventListener(t,n,o)}const Rw=Symbol("_vei");function R7(e,t,n,o,s=null){const i=e[Rw]||(e[Rw]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=D7(t);if(o){const c=i[t]=W7(o,s);Hr(e,l,c,a)}else r&&(B7(e,l,r,a),i[t]=void 0)}}const Dw=/(?:Once|Passive|Capture)$/;function D7(e){let t;if(Dw.test(e)){t={};let o;for(;o=e.match(Dw);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Bs(e.slice(2)),t]}let vg=0;const P7=Promise.resolve(),H7=()=>vg||(P7.then(()=>vg=0),vg=Date.now());function W7(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(At(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&Ei(c,t,5,l)}}else Ei(s,t,5,[o])};return n.value=e,n.attached=H7(),n}const Pw=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,z7=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?N7(e,o,r):t==="style"?$7(e,n,o):If(t)?c1(t)||R7(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):U7(e,t,o,r))?(Bw(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ow(e,t,o,r,i,t!=="value")):e._isVueCE&&(q7(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Pn(o)))?Bw(e,Fo(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Ow(e,t,o,r))};function U7(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Pw(t)&&Rt(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 s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Pw(t)&&Pn(n)?!1:t in e}function q7(e,t){const n=e._def.props;if(!n)return!1;const o=Fo(t);return Array.isArray(n)?n.some(s=>Fo(s)===o):Object.keys(n).some(s=>Fo(s)===o)}const Hw={};function j7(e,t,n){let o=Je(e,t);u1(o)&&(o=Fn({},o,t));class s extends Vk{constructor(r){super(o,r,n)}}return s.def=o,s}const K4e=((e,t)=>j7(e,t,aL)),V7=typeof HTMLElement<"u"?HTMLElement:class{};class Vk extends V7{constructor(t,n={},o=dm){super(),this._def=t,this._props=n,this._createApp=o,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&&o!==dm?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Fn({},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 Vk){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,yt(()=>{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 o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!At(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Kp(this._props[a])),(l||(l=Object.create(null)))[Fo(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!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 o in n)_n(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=At(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Fo))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Hw;const s=Fo(t);n&&this._numberProps&&this._numberProps[s]&&(o=Kp(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Hw?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Bs(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Bs(t),n+""):n||this.removeAttribute(Bs(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),lL(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ae(this._def,Fn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,u1(r[0])?Fn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Bs(i)!==i&&s(Bs(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||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 o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.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,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[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 K7(e){const t=Mo(),n=t&&t.ce;return n||null}function G4e(){const e=K7();return e&&e.shadowRoot}function Y4e(e="$style"){{const t=Mo();if(!t)return ln;const n=t.type.__cssModules;if(!n)return ln;const o=n[e];return o||ln}}const $M=new WeakMap,FM=new WeakMap,cm=Symbol("_moveCb"),Ww=Symbol("_enterCb"),G7=e=>(delete e.props.mode,e),Y7=G7({name:"TransitionGroup",props:Fn({},EM,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Mo(),o=zA();let s,i;return Bk(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!eL(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(X7),s.forEach(Q7);const l=s.filter(J7);ly(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;sr(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[cm]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[cm]=null,vl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=fn(e),l=TM(r);let a=r.tag||We;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Rl(u,sf(u,l,o,n)),$M.set(u,OM(u.el)))}i=t.default?Fk(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Rl(u,sf(u,l,o,n))}return ae(a,null,i)}}}),Z7=Y7;function X7(e){const t=e.el;t[cm]&&t[cm](),t[Ww]&&t[Ww]()}function Q7(e){FM.set(e,OM(e.el))}function J7(e){const t=$M.get(e),n=FM.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){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(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function OM(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function eL(e,t,n){const o=e.cloneNode(),s=e[vu];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=NM(o);return i.removeChild(o),r}const Pl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return At(t)?n=>Jc(t,n):t};function tL(e){e.target.composing=!0}function zw(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ai=Symbol("_assign");function Uw(e,t,n){return t&&(e=e.trim()),n&&(e=p1(e)),e}const Cs={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Ai]=Pl(s);const i=o||s.props&&s.props.type==="number";Hr(e,t?"change":"input",r=>{r.target.composing||e[Ai](Uw(e.value,n,i))}),(n||i)&&Hr(e,"change",()=>{e.value=Uw(e.value,n,i)}),t||(Hr(e,"compositionstart",tL),Hr(e,"compositionend",zw),Hr(e,"change",zw))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Ai]=Pl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?p1(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"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},um={deep:!0,created(e,t,n){e[Ai]=Pl(n),Hr(e,"change",()=>{const o=e._modelValue,s=yu(e),i=e.checked,r=e[Ai];if(At(o)){const l=g1(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Qa(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(RM(e,i))})},mounted:qw,beforeUpdate(e,t,n){e[Ai]=Pl(n),qw(e,t,n)}};function qw(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(At(t))s=g1(t,o.props.value)>-1;else if(Qa(t))s=t.has(o.props.value);else{if(t===n)return;s=jr(t,RM(e,!0))}e.checked!==s&&(e.checked=s)}const BM={created(e,{value:t},n){e.checked=jr(t,n.props.value),e[Ai]=Pl(n),Hr(e,"change",()=>{e[Ai](yu(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Ai]=Pl(o),t!==n&&(e.checked=jr(t,o.props.value))}},cy={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Qa(t);Hr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?p1(yu(r)):yu(r));e[Ai](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,yt(()=>{e._assigning=!1})}),e[Ai]=Pl(o)},mounted(e,{value:t}){jw(e,t)},beforeUpdate(e,t,n){e[Ai]=Pl(n)},updated(e,{value:t}){e._assigning||jw(e,t)}};function jw(e,t){const n=e.multiple,o=At(t);if(!(n&&!o&&!Qa(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=yu(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=g1(t,l)>-1}else r.selected=t.has(l);else if(jr(yu(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function yu(e){return"_value"in e?e._value:e.value}function RM(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const nL={created(e,t,n){Dh(e,t,n,null,"created")},mounted(e,t,n){Dh(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Dh(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Dh(e,t,n,o,"updated")}};function DM(e,t){switch(e){case"SELECT":return cy;case"TEXTAREA":return Cs;default:switch(t){case"checkbox":return um;case"radio":return BM;default:return Cs}}}function Dh(e,t,n,o,s){const r=DM(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function oL(){Cs.getSSRProps=({value:e})=>({value:e}),BM.getSSRProps=({value:e},t)=>{if(t.props&&jr(t.props.value,e))return{checked:!0}},um.getSSRProps=({value:e},t)=>{if(At(e)){if(t.props&&g1(e,t.props.value)>-1)return{checked:!0}}else if(Qa(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},nL.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=DM(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const sL=["ctrl","shift","alt","meta"],iL={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)=>sL.some(n=>e[`${n}Key`]&&!t.includes(n))},St=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=iL[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},rL={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ur=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Bs(s.key);if(t.some(r=>r===i||rL[r]===i))return e(s)}))},PM=Fn({patchProp:z7},A7);let Bd,Vw=!1;function HM(){return Bd||(Bd=r7(PM))}function WM(){return Bd=Vw?Bd:l7(PM),Vw=!0,Bd}const lL=((...e)=>{HM().render(...e)}),Z4e=((...e)=>{WM().hydrate(...e)}),dm=((...e)=>{const t=HM().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=UM(o);if(!s)return;const i=t._component;!Rt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,zM(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),aL=((...e)=>{const t=WM().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=UM(o);if(s)return n(s,!0,zM(s))},t});function zM(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function UM(e){return Pn(e)?document.querySelector(e):e}let Kw=!1;const X4e=()=>{Kw||(Kw=!0,oL(),I7())};/*!
21
- * shared v11.4.5
22
- * (c) 2026 kazuya kawaguchi
23
- * Released under the MIT License.
24
- */function cL(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const fm=typeof window<"u",Vl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),uL=(e,t,n)=>dL({l:e,k:t,s:n}),dL=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Co=e=>typeof e=="number"&&isFinite(e),qM=e=>Gk(e)==="[object Date]",ku=e=>Gk(e)==="[object RegExp]",M1=e=>un(e)&&Object.keys(e).length===0,Ao=Object.assign,fL=Object.create,Dn=(e=null)=>fL(e);let Gw;const Ea=()=>Gw||(Gw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Dn());function Yw(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 hL(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 pL=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,mL=/^(?:href|src|action|formaction)$/i;function Kk(e){return pL.test(e)}function gL(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(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(o,i),n+=Kk(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Zw(e,t){if(mL.test(e)&&Kk(t))return"about:blank";const n=e.toLowerCase()==="style"?gL(t):t;return hL(n)}function vL(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Zw(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Zw(o,s)}'`),/\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,o,s)=>Kk(s)?`${o}about:blank`:n),e}const yL=Object.prototype.hasOwnProperty;function _i(e,t){return yL.call(e,t)}const fo=Array.isArray,oo=e=>typeof e=="function",xt=e=>typeof e=="string",yn=e=>typeof e=="boolean",kn=e=>e!==null&&typeof e=="object",kL=e=>kn(e)&&oo(e.then)&&oo(e.catch),jM=Object.prototype.toString,Gk=e=>jM.call(e),un=e=>Gk(e)==="[object Object]",bL=e=>e==null?"":fo(e)||un(e)&&e.toString===jM?JSON.stringify(e,null,2):String(e);function Yk(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Ph=e=>!kn(e)||fo(e);function Sp(e,t){if(Ph(e)||Ph(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(kn(o[i])&&!kn(s[i])&&(s[i]=Array.isArray(o[i])?[]:Dn()),Ph(s[i])||Ph(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
25
- * message-compiler v11.4.5
26
- * (c) 2026 kazuya kawaguchi
27
- * Released under the MIT License.
28
- */function xL(e,t,n){return{line:e,column:t,offset:n}}function uy(e,t,n){return{start:e,end:t}}const En={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},wL=17;function E1(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function _L(e){throw e}const er=" ",SL="\r",ss=`
29
- `,CL="\u2028",AL="\u2029";function ML(e){const t=e;let n=0,o=1,s=1,i=0;const r=N=>t[N]===SL&&t[N+1]===ss,l=N=>t[N]===ss,a=N=>t[N]===AL,c=N=>t[N]===CL,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,f=()=>o,h=()=>s,p=()=>i,m=N=>r(N)||a(N)||c(N)?ss:t[N],y=()=>m(n),k=()=>m(n+i);function g(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function b(){n=0,o=1,s=1,i=0}function A(N=0){i=N}function I(){const N=n+i;for(;N!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:y,currentPeek:k,next:g,peek:v,reset:b,resetPeek:A,skipToPeek:I}}const Ar=void 0,EL=".",Xw="'",TL="tokenizer";function NL(e,t={}){const n=t.location!==!1,o=ML(e),s=()=>o.index(),i=()=>xL(o.line(),o.column(),o.index()),r=i(),l=s(),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(V,se,pe,...ke){const Ne=c();if(se.column+=pe,se.offset+=pe,u){const qe=n?uy(Ne.startLoc,se):null,be=E1(V,qe,{domain:TL,args:ke});u(be)}}function f(V,se,pe){V.endLoc=i(),V.currentType=se;const ke={type:se};return n&&(ke.loc=uy(V.startLoc,V.endLoc)),pe!=null&&(ke.value=pe),ke}const h=V=>f(V,13);function p(V,se){return V.currentChar()===se?(V.next(),se):(d(En.EXPECTED_TOKEN,i(),0,se),"")}function m(V){let se="";for(;V.currentPeek()===er||V.currentPeek()===ss;)se+=V.currentPeek(),V.peek();return se}function y(V){const se=m(V);return V.skipToPeek(),se}function k(V){if(V===Ar)return!1;const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se===95}function g(V){if(V===Ar)return!1;const se=V.charCodeAt(0);return se>=48&&se<=57}function v(V,se){const{currentType:pe}=se;if(pe!==2)return!1;m(V);const ke=k(V.currentPeek());return V.resetPeek(),ke}function b(V,se){const{currentType:pe}=se;if(pe!==2)return!1;m(V);const ke=V.currentPeek()==="-"?V.peek():V.currentPeek(),Ne=g(ke);return V.resetPeek(),Ne}function A(V,se){const{currentType:pe}=se;if(pe!==2)return!1;m(V);const ke=V.currentPeek()===Xw;return V.resetPeek(),ke}function I(V,se){const{currentType:pe}=se;if(pe!==7)return!1;m(V);const ke=V.currentPeek()===".";return V.resetPeek(),ke}function N(V,se){const{currentType:pe}=se;if(pe!==8)return!1;m(V);const ke=k(V.currentPeek());return V.resetPeek(),ke}function M(V,se){const{currentType:pe}=se;if(!(pe===7||pe===11))return!1;m(V);const ke=V.currentPeek()===":";return V.resetPeek(),ke}function $(V,se){const{currentType:pe}=se;if(pe!==9)return!1;const ke=()=>{const qe=V.currentPeek();return qe==="{"?k(V.peek()):qe==="@"||qe==="|"||qe===":"||qe==="."||qe===er||!qe?!1:qe===ss?(V.peek(),ke()):F(V,!1)},Ne=ke();return V.resetPeek(),Ne}function T(V){m(V);const se=V.currentPeek()==="|";return V.resetPeek(),se}function F(V,se=!0){const pe=(Ne=!1,qe="")=>{const be=V.currentPeek();return be==="{"||be==="@"||!be?Ne:be==="|"?!(qe===er||qe===ss):be===er?(V.peek(),pe(!0,er)):be===ss?(V.peek(),pe(!0,ss)):!0},ke=pe();return se&&V.resetPeek(),ke}function S(V,se){const pe=V.currentChar();return pe===Ar?Ar:se(pe)?(V.next(),pe):null}function B(V){const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36}function W(V){return S(V,B)}function z(V){const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36||se===45}function L(V){return S(V,z)}function O(V){const se=V.charCodeAt(0);return se>=48&&se<=57}function U(V){return S(V,O)}function Z(V){const se=V.charCodeAt(0);return se>=48&&se<=57||se>=65&&se<=70||se>=97&&se<=102}function ie(V){return S(V,Z)}function q(V){let se="",pe="";for(;se=U(V);)pe+=se;return pe}function ee(V){let se="";for(;;){const pe=V.currentChar();if(pe==="\\"){const ke=V.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(se+=pe+ke,V.next(),V.next()):(V.resetPeek(),se+=pe,V.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===er||pe===ss)if(F(V))se+=pe,V.next();else{if(T(V))break;se+=pe,V.next()}else se+=pe,V.next()}}return se}function fe(V){y(V);let se="",pe="";for(;se=L(V);)pe+=se;const ke=V.currentChar();if(ke&&ke!=="}"&&ke!==Ar&&ke!==er&&ke!==ss&&ke!==" "){const Ne=re(V);return d(En.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+Ne),pe+Ne}return V.currentChar()===Ar&&d(En.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function ne(V){y(V);let se="";return V.currentChar()==="-"?(V.next(),se+=`-${q(V)}`):se+=q(V),V.currentChar()===Ar&&d(En.UNTERMINATED_CLOSING_BRACE,i(),0),se}function j(V){return V!==Xw&&V!==ss}function K(V){y(V),p(V,"'");let se="",pe="";for(;se=S(V,j);)se==="\\"?pe+=ve(V):pe+=se;const ke=V.currentChar();return ke===ss||ke===Ar?(d(En.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===ss&&(V.next(),p(V,"'")),pe):(p(V,"'"),pe)}function ve(V){const se=V.currentChar();switch(se){case"\\":case"'":return V.next(),`\\${se}`;case"u":return he(V,se,4);case"U":return he(V,se,6);default:return d(En.UNKNOWN_ESCAPE_SEQUENCE,i(),0,se),""}}function he(V,se,pe){p(V,se);let ke="";for(let Ne=0;Ne<pe;Ne++){const qe=ie(V);if(!qe){d(En.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${se}${ke}${V.currentChar()}`);break}ke+=qe}return`\\${se}${ke}`}function Ae(V){return V!=="{"&&V!=="}"&&V!==er&&V!==ss}function re(V){y(V);let se="",pe="";for(;se=S(V,Ae);)pe+=se;return pe}function Y(V){let se="",pe="";for(;se=W(V);)pe+=se;return pe}function Q(V){const se=pe=>{const ke=V.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===er?pe:(pe+=ke,V.next(),se(pe))};return se("")}function P(V){y(V);const se=p(V,"|");return y(V),se}function G(V,se){let pe=null;switch(V.currentChar()){case"{":return se.braceNest>=1&&d(En.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),V.next(),pe=f(se,2,"{"),y(V),se.braceNest++,pe;case"}":return se.braceNest>0&&se.currentType===2&&d(En.EMPTY_PLACEHOLDER,i(),0),V.next(),pe=f(se,3,"}"),se.braceNest--,se.braceNest>0&&y(V),se.inLinked&&se.braceNest===0&&(se.inLinked=!1),pe;case"@":return se.braceNest>0&&d(En.UNTERMINATED_CLOSING_BRACE,i(),0),pe=me(V,se)||h(se),se.braceNest=0,pe;default:{let Ne=!0,qe=!0,be=!0;if(T(V))return se.braceNest>0&&d(En.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,pe;if(se.braceNest>0&&(se.currentType===4||se.currentType===5||se.currentType===6))return d(En.UNTERMINATED_CLOSING_BRACE,i(),0),se.braceNest=0,ye(V,se);if(Ne=v(V,se))return pe=f(se,4,fe(V)),y(V),pe;if(qe=b(V,se))return pe=f(se,5,ne(V)),y(V),pe;if(be=A(V,se))return pe=f(se,6,K(V)),y(V),pe;if(!Ne&&!qe&&!be)return pe=f(se,12,re(V)),d(En.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),y(V),pe;break}}return pe}function me(V,se){const{currentType:pe}=se;let ke=null;const Ne=V.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&(Ne===ss||Ne===er)&&d(En.INVALID_LINKED_FORMAT,i(),0),Ne){case"@":return V.next(),ke=f(se,7,"@"),se.inLinked=!0,ke;case".":return y(V),V.next(),f(se,8,".");case":":return y(V),V.next(),f(se,9,":");default:return T(V)?(ke=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,ke):I(V,se)||M(V,se)?(y(V),me(V,se)):N(V,se)?(y(V),f(se,11,Y(V))):$(V,se)?(y(V),Ne==="{"?G(V,se)||ke:f(se,10,Q(V))):(pe===7&&d(En.INVALID_LINKED_FORMAT,i(),0),se.braceNest=0,se.inLinked=!1,ye(V,se))}}function ye(V,se){let pe={type:13};if(se.braceNest>0)return G(V,se)||h(se);if(se.inLinked)return me(V,se)||h(se);switch(V.currentChar()){case"{":return G(V,se)||h(se);case"}":return d(En.UNBALANCED_CLOSING_BRACE,i(),0),V.next(),f(se,3,"}");case"@":return me(V,se)||h(se);default:{if(T(V))return pe=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,pe;if(F(V))return f(se,0,ee(V));break}}return pe}function de(){const{currentType:V,offset:se,startLoc:pe,endLoc:ke}=a;return a.lastType=V,a.lastOffset=se,a.lastStartLoc=pe,a.lastEndLoc=ke,a.offset=s(),a.startLoc=i(),o.currentChar()===Ar?f(a,13):ye(o,a)}return{nextToken:de,currentOffset:s,currentPosition:i,context:c}}const IL="parser",LL=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,$L=/\\([\\@{}|])/g;function FL(e,t){return t}function OL(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function BL(e={}){const t=e.location!==!1,{onError:n}=e;function o(k,g,v,b,...A){const I=k.currentPosition();if(I.offset+=b,I.column+=b,n){const N=t?uy(v,I):null,M=E1(g,N,{domain:IL,args:A});n(M)}}function s(k,g,v){const b={type:k};return t&&(b.start=g,b.end=g,b.loc={start:v,end:v}),b}function i(k,g,v,b){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),b=s(3,v.offset,v.startLoc);return b.value=g.replace($L,FL),i(b,k.currentOffset(),k.currentPosition()),b}function l(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(5,b,A);return I.index=parseInt(g,10),k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function a(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(4,b,A);return I.key=g,k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function c(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(9,b,A);return I.value=g.replace(LL,OL),k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(8,b,A);return g.type!==11?(o(k,En.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),I.value="",i(I,b,A),{nextConsumeToken:g,node:I}):(g.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,tr(g)),I.value=g.value||"",i(I,k.currentOffset(),k.currentPosition()),{node:I})}function d(k,g){const v=k.context(),b=s(7,v.offset,v.startLoc);return b.value=g,i(b,k.currentOffset(),k.currentPosition()),b}function f(k){const g=k.context(),v=s(6,g.offset,g.startLoc);let b=k.nextToken();if(b.type===8){const A=u(k);v.modifier=A.node,b=A.nextConsumeToken||k.nextToken()}switch(b.type!==9&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),b=k.nextToken(),b.type===2&&(b=k.nextToken()),b.type){case 10:b.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=d(k,b.value||"");break;case 4:b.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=a(k,b.value||"");break;case 5:b.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=l(k,b.value||"");break;case 6:b.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=c(k,b.value||"");break;default:{o(k,En.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=k.context(),I=s(7,A.offset,A.startLoc);return I.value="",i(I,A.offset,A.startLoc),v.key=I,i(v,A.offset,A.startLoc),{nextConsumeToken:b,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function h(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,b=g.currentType===1?g.endLoc:g.startLoc,A=s(2,v,b);A.items=[];let I=null;do{const $=I||k.nextToken();switch(I=null,$.type){case 0:$.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(r(k,$.value||""));break;case 5:$.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(l(k,$.value||""));break;case 4:$.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(a(k,$.value||""));break;case 6:$.value==null&&o(k,En.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(c(k,$.value||""));break;case 7:{const T=f(k);A.items.push(T.node),I=T.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const N=g.currentType===1?g.lastOffset:k.currentOffset(),M=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(A,N,M),A}function p(k,g,v,b){const A=k.context();let I=b.items.length===0;const N=s(1,g,v);N.cases=[],N.cases.push(b);do{const M=h(k);I||(I=M.items.length===0),N.cases.push(M)}while(A.currentType!==13);return I&&o(k,En.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(N,k.currentOffset(),k.currentPosition()),N}function m(k){const g=k.context(),{offset:v,startLoc:b}=g,A=h(k);return g.currentType===13?A:p(k,v,b,A)}function y(k){const g=NL(k,Ao({},e)),v=g.context(),b=s(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=k),b.body=m(g),e.onCacheKey&&(b.cacheKey=e.onCacheKey(k)),v.currentType!==13&&o(g,En.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(b,g.currentOffset(),g.currentPosition()),b}return{parse:y}}function tr(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 RL(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Qw(e,t){for(let n=0;n<e.length;n++)Zk(e[n],t)}function Zk(e,t){switch(e.type){case 1:Qw(e.cases,t),t.helper("plural");break;case 2:Qw(e.items,t);break;case 6:{Zk(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 DL(e,t={}){const n=RL(e);n.helper("normalize"),e.body&&Zk(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function PL(e){const t=e.body;return t.type===2?Jw(t):t.cases.forEach(n=>Jw(n)),e}function Jw(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 o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=Yk(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function Bc(e){switch(e.t=e.type,e.type){case 0:{const t=e;Bc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)Bc(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)Bc(n[o]);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;Bc(t.key),t.k=t.key,delete t.key,t.modifier&&(Bc(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 HL(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,y){r.code+=m}function c(m,y=!0){const k=y?o:"";a(s?k+" ".repeat(m):k)}function u(m=!0){const y=++r.indentLevel;m&&c(y)}function d(m=!0){const y=--r.indentLevel;m&&c(y)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function WL(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),bu(e,t.key),t.modifier?(e.push(", "),bu(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function zL(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(bu(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function UL(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(bu(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function qL(e,t){t.body?bu(e,t.body):e.push("null")}function bu(e,t){const{helper:n}=e;switch(t.type){case 0:qL(e,t);break;case 1:UL(e,t);break;case 2:zL(e,t);break;case 6:WL(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 jL=(e,t={})=>{const n=xt(t.mode)?t.mode:"normal",o=xt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
30
- `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=HL(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Yk(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),bu(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 VL(e,t={}){const n=Ao({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=BL(n).parse(e);return o?(i&&PL(l),s&&Bc(l),{ast:l,code:""}):(DL(l,n),jL(l,n))}/*!
31
- * core-base v11.4.5
32
- * (c) 2026 kazuya kawaguchi
33
- * Released under the MIT License.
34
- */function KL(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ea().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ea().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function hr(e){return kn(e)&&Xk(e)===0&&(_i(e,"b")||_i(e,"body"))}const VM=["b","body"];function GL(e){return Kl(e,VM)}const KM=["c","cases"];function YL(e){return Kl(e,KM,[])}const GM=["s","static"];function ZL(e){return Kl(e,GM)}const YM=["i","items"];function XL(e){return Kl(e,YM,[])}const ZM=["t","type"];function Xk(e){return Kl(e,ZM)}const XM=["v","value"];function Hh(e,t){const n=Kl(e,XM);if(n!=null)return n;throw cf(t)}const QM=["m","modifier"];function QL(e){return Kl(e,QM)}const JM=["k","key"];function JL(e){const t=Kl(e,JM);if(t)return t;throw cf(6)}function Kl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(_i(e,s)&&e[s]!=null)return e[s]}return n}const e6=[...VM,...KM,...GM,...YM,...JM,...QM,...XM,...ZM];function cf(e){return new Error(`unhandled node type: ${e}`)}function yg(e){return n=>e$(n,e)}function e$(e,t){const n=GL(t);if(n==null)throw cf(0);if(Xk(n)===1){const i=YL(n);return e.plural(i.reduce((r,l)=>[...r,e_(e,l)],[]))}else return e_(e,n)}function e_(e,t){const n=ZL(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=XL(t).reduce((s,i)=>[...s,dy(e,i)],[]);return e.normalize(o)}}function dy(e,t){const n=Xk(t);switch(n){case 3:return Hh(t,n);case 9:return Hh(t,n);case 4:{const o=t;if(_i(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(_i(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw cf(n)}case 5:{const o=t;if(_i(o,"i")&&Co(o.i))return e.interpolate(e.list(o.i));if(_i(o,"index")&&Co(o.index))return e.interpolate(e.list(o.index));throw cf(n)}case 6:{const o=t,s=QL(o),i=JL(o);return e.linked(dy(e,i),s?dy(e,s):void 0,e.type)}case 7:return Hh(t,n);case 8:return Hh(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const t$=e=>e;let Wh=Dn();function n$(e,t={}){let n=!1;const o=t.onError||_L;return t.onError=s=>{n=!0,o(s)},{...VL(e,t),detectError:n}}function o$(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&xt(e)){yn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||t$)(e),s=Wh[o];if(s)return s;const{ast:i,detectError:r}=n$(e,{...t,location:!1,jit:!0}),l=yg(i);return r?l:Wh[o]=l}else{const n=e.cacheKey;if(n){const o=Wh[n];return o||(Wh[n]=yg(e))}else return yg(e)}}let uf=null;function s$(e){uf=e}function i$(e,t,n){uf&&uf.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const r$=l$("function:translate");function l$(e){return t=>uf&&uf.emit(e,t)}const Wr={INVALID_ARGUMENT:wL,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},a$=24;function zr(e){return E1(e,null,void 0)}function Qk(e,t){return t.locale!=null?t_(t.locale):t_(e.locale)}let kg;function t_(e){if(xt(e))return e;if(oo(e)){if(e.resolvedOnce&&kg!=null)return kg;if(e.constructor.name==="Function"){const t=e();if(kL(t))throw zr(Wr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return kg=t}else throw zr(Wr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw zr(Wr.NOT_SUPPORT_LOCALE_TYPE)}function c$(e,t,n){return[...new Set([n,...fo(t)?t:kn(t)?Object.keys(t):xt(t)?[t]:[n]])]}function fy(e,t,n){const o=xt(n)?n:df,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;fo(r);)r=n_(i,r,t);const l=fo(t)||!un(t)?t:t.default?t.default:null;r=xt(l)?[l]:l,fo(r)&&n_(i,r,!1),s.__localeChainCache.set(o,i)}return i}function n_(e,t,n){let o=!0;for(let s=0;s<t.length&&yn(o);s++){const i=t[s];xt(i)&&(o=u$(e,t[s],n))}return o}function u$(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=d$(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function d$(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(fo(n)||un(n))&&n[s]&&(o=n[s])}return o}const Gl=[];Gl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Gl[1]={w:[1],".":[2],"[":[4],o:[7]};Gl[2]={w:[2],i:[3,0],0:[3,0]};Gl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Gl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Gl[5]={"'":[4,0],o:8,l:[5,0]};Gl[6]={'"':[4,0],o:8,l:[6,0]};const f$=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function h$(e){return f$.test(e)}function p$(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 m$(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 g$(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:h$(t)?p$(t):"*"+t}function v$(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=g$(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=m$(i),d=Gl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const o_=new Map;function y$(e,t){return kn(e)?e[t]:null}function k$(e,t){if(!kn(e))return null;let n=o_.get(t);if(n||(n=v$(t),n&&o_.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(e6.includes(r)&&hr(s)||!kn(s)||!_i(s,r))return null;const l=s[r];if(l===void 0||oo(s))return null;s=l,i++}return s}const b$="11.4.5",T1=-1,df="en-US",hm="",s_=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function x$(){return{upper:(e,t)=>t==="text"&&xt(e)?e.toUpperCase():t==="vnode"&&kn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&xt(e)?e.toLowerCase():t==="vnode"&&kn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&xt(e)?s_(e):t==="vnode"&&kn(e)&&"__v_isVNode"in e?s_(e.children):e}}let t6;function w$(e){t6=e}let n6;function _$(e){n6=e}let o6;function S$(e){o6=e}let s6=null;const C$=e=>{s6=e},A$=()=>s6;let i6=null;const i_=e=>{i6=e},M$=()=>i6;let r_=0;function E$(e={}){const t=oo(e.onWarn)?e.onWarn:cL,n=xt(e.version)?e.version:b$,o=xt(e.locale)||oo(e.locale)?e.locale:df,s=oo(o)?df:o,i=fo(e.fallbackLocale)||un(e.fallbackLocale)||xt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=un(e.messages)?e.messages:bg(s),l=un(e.datetimeFormats)?e.datetimeFormats:bg(s),a=un(e.numberFormats)?e.numberFormats:bg(s),c=Ao(Dn(),e.modifiers,x$()),u=e.pluralRules||Dn(),d=oo(e.missing)?e.missing:null,f=yn(e.missingWarn)||ku(e.missingWarn)?e.missingWarn:!0,h=yn(e.fallbackWarn)||ku(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,y=oo(e.postTranslation)?e.postTranslation:null,k=un(e.processor)?e.processor:null,g=yn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,b=oo(e.messageCompiler)?e.messageCompiler:t6,A=oo(e.messageResolver)?e.messageResolver:n6||y$,I=oo(e.localeFallbacker)?e.localeFallbacker:o6||c$,N=kn(e.fallbackContext)?e.fallbackContext:void 0,M=e,$=kn(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,T=kn(M.__numberFormatters)?M.__numberFormatters:new Map,F=kn(M.__meta)?M.__meta:{};r_++;const S={version:n,cid:r_,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:y,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:b,messageResolver:A,localeFallbacker:I,fallbackContext:N,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=$,S.__numberFormatters=T,__INTLIFY_PROD_DEVTOOLS__&&i$(S,n,F),S}const bg=e=>({[e]:Dn()});function Jk(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return xt(l)?l:t}else return t}function rd(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function T$(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function N$(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(T$(e,t[o]))return!0;return!1}function l_(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!xt(t[0])&&!qM(t[0])&&!Co(t[0]))return hm;const[a,c,u,d]=hy(...t),f=yn(u.missingWarn)?u.missingWarn:e.missingWarn;yn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Qk(e,u),m=r(e,s,p);if(!xt(a)||a===""){const I=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let y={},k,g=null;const v="datetime format";for(let I=0;I<m.length&&(k=m[I],y=n[k]||{},g=y[a],!un(g));I++)Jk(e,a,k,f,v);if(!un(g)||!xt(k))return o?T1:a;let b=`${k}__${a}`;M1(d)||(b=`${b}__${JSON.stringify(d)}`);let A=l.get(b);return A||(A=new Intl.DateTimeFormat(k,Ao({},g,d)),l.set(b,A)),h?A.formatToParts(c):A.format(c)}const r6=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function hy(...e){const[t,n,o,s]=e,i=Dn();let r=Dn(),l;if(xt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw zr(Wr.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 zr(Wr.INVALID_ISO_DATE_ARGUMENT)}}else if(qM(t)){if(isNaN(t.getTime()))throw zr(Wr.INVALID_DATE_ARGUMENT);l=t}else if(Co(t))l=t;else throw zr(Wr.INVALID_ARGUMENT);return xt(n)?i.key=n:un(n)&&Object.keys(n).forEach(a=>{r6.includes(a)?r[a]=n[a]:i[a]=n[a]}),xt(o)?i.locale=o:un(o)&&(r=o),un(s)&&(r=s),[i.key||"",l,i,r]}function a_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function c_(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Co(t[0]))return hm;const[a,c,u,d]=py(...t),f=yn(u.missingWarn)?u.missingWarn:e.missingWarn;yn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Qk(e,u),m=r(e,s,p);if(!xt(a)||a===""){const I=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let y={},k,g=null;const v="number format";for(let I=0;I<m.length&&(k=m[I],y=n[k]||{},g=y[a],!un(g));I++)Jk(e,a,k,f,v);if(!un(g)||!xt(k))return o?T1:a;let b=`${k}__${a}`;M1(d)||(b=`${b}__${JSON.stringify(d)}`);let A=l.get(b);return A||(A=new Intl.NumberFormat(k,Ao({},g,d)),l.set(b,A)),h?A.formatToParts(c):A.format(c)}const l6=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function py(...e){const[t,n,o,s]=e,i=Dn();let r=Dn();if(!Co(t))throw zr(Wr.INVALID_ARGUMENT);const l=t;return xt(n)?i.key=n:un(n)&&Object.keys(n).forEach(a=>{l6.includes(a)?r[a]=n[a]:i[a]=n[a]}),xt(o)?i.locale=o:un(o)&&(r=o),un(s)&&(r=s),[i.key||"",l,i,r]}function u_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const I$=e=>e,L$=e=>"",$$="text",F$=e=>e.length===0?"":Yk(e),O$=bL;function xg(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function B$(e){const t=Co(e.pluralIndex)?e.pluralIndex:-1;return Co(e.named?.count)?e.named.count:Co(e.named?.n)?e.named.n:t}function R$(e={}){const t=e.locale,n=B$(e),o=xt(t)&&oo(e.pluralRules?.[t])?e.pluralRules[t]:xg,s=o===xg?void 0:xg,i=k=>k[o(n,k.length,s)],r=e.list||[],l=k=>r[k],a=e.named||Dn();Co(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=oo(e.messages)?e.messages(k,!!g):kn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):L$)}const d=k=>e.modifiers?e.modifiers[k]:I$,f=oo(e.processor?.normalize)?e.processor.normalize:F$,h=oo(e.processor?.interpolate)?e.processor.interpolate:O$,p=xt(e.processor?.type)?e.processor.type:$$,y={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,b]=g;let A="text",I="";g.length===1?kn(v)?(I=v.modifier||I,A=v.type||A):xt(v)&&(I=v||I):g.length===2&&(xt(v)&&(I=v||I),xt(b)&&(A=b||A));const N=u(k,!0)(y),M=N===""||N===void 0?k:N,$=A==="vnode"&&fo(M)&&I?M[0]:M;return I?d(I)($,A):$},message:u,type:p,interpolate:h,normalize:f,values:Ao(Dn(),r,a)};return y}const d_=()=>"",bi=e=>oo(e);function f_(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=my(...t),u=yn(c.missingWarn)?c.missingWarn:e.missingWarn,d=yn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=yn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=xt(c.default)||yn(c.default)?yn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(xt(p)||oo(p)),y=Qk(e,c);f&&D$(c);let[k,g,v]=h?[a,y,l[y]||Dn()]:a6(e,a,y,r,d,u),b=k,A=a;if(!h&&!(xt(b)||hr(b)||bi(b))&&m&&(b=p,A=b),!h&&(!(xt(b)||hr(b)||bi(b))||!xt(g)))return s?T1:a;let I=!1;const N=()=>{I=!0},M=bi(b)?b:c6(e,a,g,b,A,N);if(I)return b;const $=W$(e,g,v,c),T=R$($),F=P$(e,M,T);let S=o?o(F,a):F;if(f&&xt(S)&&(S=vL(S)),__INTLIFY_PROD_DEVTOOLS__){const B={timestamp:Date.now(),key:xt(a)?a:bi(b)?b.key:"",locale:g||(bi(b)?b.locale:""),format:xt(b)?b:bi(b)?b.source:"",message:S};B.meta=Ao({},e.__meta,A$()||{}),r$(B)}return S}function D$(e){fo(e.list)?e.list=e.list.map(t=>xt(t)?Yw(t):t):kn(e.named)&&Object.keys(e.named).forEach(t=>{xt(e.named[t])&&(e.named[t]=Yw(e.named[t]))})}function a6(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Dn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Dn(),(h=a(d,t))===null&&(h=d[t]),!(xt(h)||hr(h)||bi(h)));m++)if(!N$(f,u)){const y=Jk(e,t,f,i,p);y!==t&&(h=y)}return[h,f,d]}function c6(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(bi(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,H$(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function P$(e,t,n){return t(n)}function my(...e){const[t,n,o]=e,s=Dn();if(!xt(t)&&!Co(t)&&!bi(t)&&!hr(t))throw zr(Wr.INVALID_ARGUMENT);const i=Co(t)?String(t):(bi(t),t);return Co(n)?s.plural=n:xt(n)?s.default=n:un(n)&&!M1(n)?s.named=n:fo(n)&&(s.list=n),Co(o)?s.plural=o:xt(o)?s.default=o:un(o)&&Ao(s,o),[i,s]}function H$(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>uL(t,n,r)}}function W$(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[y,,k]=a6(u||e,h,t,l,a,c);m=y??r(k,h)}if(xt(m)||hr(m)){let y=!1;const g=c6(e,h,t,m,h,()=>{y=!0});return y?d_:g}else return bi(m)?m:d_}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),Co(o.plural)&&(f.pluralIndex=o.plural),f}KL();/*!
35
- * vue-i18n v11.4.5
36
- * (c) 2026 kazuya kawaguchi
37
- * Released under the MIT License.
38
- */const z$="11.4.5";function U$(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ea().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ea().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ea().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ea().__INTLIFY_PROD_DEVTOOLS__=!1)}const ks={UNEXPECTED_RETURN_TYPE:a$,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 Rs(e,...t){return E1(e,null,void 0)}const gy=Vl("__translateVNode"),vy=Vl("__datetimeParts"),yy=Vl("__numberParts"),u6=Vl("__setPluralRules"),d6=Vl("__injectWithOption"),qc=Vl("__dispose");function ff(e){if(!kn(e)||hr(e))return e;for(const t in e)if(_i(e,t))if(!t.includes("."))kn(e[t])&&ff(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=Dn()),!kn(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(hr(s)?e6.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!hr(s)){const r=s[n[o]];kn(r)&&ff(r)}}return e}function e2(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=un(n)?n:fo(o)?Dn():{[e]:Dn()};if(fo(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Dn(),Sp(c,r[a])):Sp(c,r)}else xt(l)&&Sp(JSON.parse(l),r)}),s==null&&i)for(const l in r)_i(r,l)&&ff(r[l]);return r}function f6(e){return e.type}function h6(e,t,n){let o=kn(t.messages)?t.messages:Dn();"__i18nGlobal"in n&&(o=e2(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(kn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(kn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function h_(e){return ae(Ll,null,e,0)}function hf(){return Mo()}const p_="__INTLIFY_META__",m_=()=>[],q$=()=>!1;let g_=0;function v_(e){return((t,n,o,s)=>e(n,o,hf()||void 0,s))}const j$=()=>{const e=hf();let t=null;return e&&(t=f6(e)[p_])?{[p_]:t}:null};function pm(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=fm?oe:gr;let r=yn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:xt(e.locale)?e.locale:df),a=i(t&&r?t.fallbackLocale.value:xt(e.fallbackLocale)||fo(e.fallbackLocale)||un(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(e2(l.value,e)),u=i(un(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(un(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:yn(e.missingWarn)||ku(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:yn(e.fallbackWarn)||ku(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:yn(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,y=oo(e.missing)?e.missing:null,k=oo(e.missing)?v_(e.missing):null,g=oo(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:yn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter;const A=t?t.modifiers:un(e.modifiers)?e.modifiers:{};let I=e.pluralRules||t&&t.pluralRules,N;N=(()=>{o&&i_(null);const be={version:z$,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:I,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};be.datetimeFormats=u.value,be.numberFormats=d.value,be.__datetimeFormatters=un(N)?N.__datetimeFormatters:void 0,be.__numberFormatters=un(N)?N.__numberFormatters:void 0;const xe=E$(be);return o&&i_(xe),xe})(),rd(N,l.value,a.value);function $(){return[l.value,a.value,c.value,u.value,d.value]}const T=D({get:()=>l.value,set:be=>{N.locale=be,l.value=be}}),F=D({get:()=>a.value,set:be=>{N.fallbackLocale=be,a.value=be,rd(N,l.value,be)}}),S=D(()=>c.value),B=D(()=>u.value),W=D(()=>d.value);function z(){return oo(g)?g:null}function L(be){g=be,N.postTranslation=be}function O(){return y}function U(be){be!==null&&(k=v_(be)),y=be,N.missing=k}const Z=(be,xe,Ze,tt,lt,ut)=>{$();let mt;try{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=t?M$():void 0),mt=be(N)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=void 0)}if(Ze!=="translate exists"&&Co(mt)&&mt===T1||Ze==="translate exists"&&!mt){const[Tt,wt]=xe();return t&&p?tt(t):lt(Tt)}else{if(ut(mt))return mt;throw Rs(ks.UNEXPECTED_RETURN_TYPE)}};function ie(...be){return Z(xe=>Reflect.apply(f_,null,[xe,...be]),()=>my(...be),"translate",xe=>Reflect.apply(xe.t,xe,[...be]),xe=>xe,xe=>xt(xe))}function q(...be){const[xe,Ze,tt]=be;if(tt&&!kn(tt))throw Rs(ks.INVALID_ARGUMENT);return ie(xe,Ze,Ao({resolvedMessage:!0},tt||{}))}function ee(...be){return Z(xe=>Reflect.apply(l_,null,[xe,...be]),()=>hy(...be),"datetime format",xe=>Reflect.apply(xe.d,xe,[...be]),()=>hm,xe=>xt(xe)||fo(xe))}function fe(...be){return Z(xe=>Reflect.apply(c_,null,[xe,...be]),()=>py(...be),"number format",xe=>Reflect.apply(xe.n,xe,[...be]),()=>hm,xe=>xt(xe)||fo(xe))}function ne(be){return be.map(xe=>xt(xe)||Co(xe)||yn(xe)?h_(String(xe)):xe)}const K={normalize:ne,interpolate:be=>be,type:"vnode"};function ve(...be){return Z(xe=>{let Ze;const tt=xe;try{tt.processor=K,Ze=Reflect.apply(f_,null,[tt,...be])}finally{tt.processor=null}return Ze},()=>my(...be),"translate",xe=>xe[gy](...be),xe=>[h_(xe)],xe=>fo(xe))}function he(...be){return Z(xe=>Reflect.apply(c_,null,[xe,...be]),()=>py(...be),"number format",xe=>xe[yy](...be),m_,xe=>xt(xe)||fo(xe))}function Ae(...be){return Z(xe=>Reflect.apply(l_,null,[xe,...be]),()=>hy(...be),"datetime format",xe=>xe[vy](...be),m_,xe=>xt(xe)||fo(xe))}function re(be){I=be,N.pluralRules=I}function Y(be,xe){return Z(()=>{if(!be)return!1;const Ze=xt(xe)?xe:l.value,tt=xt(xe)?[Ze]:fy(N,a.value,Ze);for(let lt=0;lt<tt.length;lt++){const ut=G(tt[lt]);let mt=N.messageResolver(ut,be);if(mt===null&&(mt=ut[be]),hr(mt)||bi(mt)||xt(mt))return!0}return!1},()=>[be],"translate exists",Ze=>Reflect.apply(Ze.te,Ze,[be,xe]),q$,Ze=>yn(Ze))}function Q(be){let xe=null;const Ze=fy(N,a.value,l.value);for(let tt=0;tt<Ze.length;tt++){const lt=c.value[Ze[tt]]||{},ut=N.messageResolver(lt,be);if(ut!=null){xe=ut;break}}return xe}function P(be){const xe=Q(be);return xe??(t?t.tm(be)||{}:{})}function G(be){return c.value[be]||{}}function me(be,xe){if(s){const Ze={[be]:xe};for(const tt in Ze)_i(Ze,tt)&&ff(Ze[tt]);xe=Ze[be]}c.value[be]=xe,N.messages=c.value}function ye(be,xe){c.value[be]=c.value[be]||{};const Ze={[be]:xe};if(s)for(const tt in Ze)_i(Ze,tt)&&ff(Ze[tt]);xe=Ze[be],Sp(xe,c.value[be]),N.messages=c.value}function de(be){return u.value[be]||{}}function V(be,xe){u.value[be]=xe,N.datetimeFormats=u.value,a_(N,be,xe)}function se(be,xe){u.value[be]=Ao(u.value[be]||{},xe),N.datetimeFormats=u.value,a_(N,be,xe)}function pe(be){return d.value[be]||{}}function ke(be,xe){d.value[be]=xe,N.numberFormats=d.value,u_(N,be,xe)}function Ne(be,xe){d.value[be]=Ao(d.value[be]||{},xe),N.numberFormats=d.value,u_(N,be,xe)}g_++,t&&fm&&(et(t.locale,be=>{r&&(l.value=be,N.locale=be,rd(N,l.value,a.value))}),et(t.fallbackLocale,be=>{r&&(a.value=be,N.fallbackLocale=be,rd(N,l.value,a.value))}));const qe={id:g_,locale:T,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(be){r=be,be&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,rd(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return I||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(be){f=be,N.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(be){h=be,N.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(be){p=be},get fallbackFormat(){return m},set fallbackFormat(be){m=be,N.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(be){v=be,N.warnHtmlMessage=be},get escapeParameter(){return b},set escapeParameter(be){b=be,N.escapeParameter=be},t:ie,getLocaleMessage:G,setLocaleMessage:me,mergeLocaleMessage:ye,getPostTranslationHandler:z,setPostTranslationHandler:L,getMissingHandler:O,setMissingHandler:U,[u6]:re};return qe.datetimeFormats=B,qe.numberFormats=W,qe.rt=q,qe.te=Y,qe.tm=P,qe.d=ee,qe.n=fe,qe.getDateTimeFormat=de,qe.setDateTimeFormat=V,qe.mergeDateTimeFormat=se,qe.getNumberFormat=pe,qe.setNumberFormat=ke,qe.mergeNumberFormat=Ne,qe[d6]=n,qe[gy]=ve,qe[vy]=Ae,qe[yy]=he,qe}function V$(e){const t=xt(e.locale)?e.locale:df,n=xt(e.fallbackLocale)||fo(e.fallbackLocale)||un(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=oo(e.missing)?e.missing:void 0,s=yn(e.silentTranslationWarn)||ku(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=yn(e.silentFallbackWarn)||ku(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=yn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=un(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=oo(e.postTranslation)?e.postTranslation:void 0,d=xt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=yn(e.sync)?e.sync:!0;let p=e.messages;if(un(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((N,M)=>{const $=N[M]||(N[M]={});return Ao($,A[M]),N},p||{})}const{__i18n:m,__root:y,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,b=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:b,datetimeFormats:g,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:y,__injectWithOption:k}}function ky(e={}){const t=pm(V$(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},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(s){t.setMissingHandler(s)},get silentTranslationWarn(){return yn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=yn(s)?!s:s},get silentFallbackWarn(){return yn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=yn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function K$(e,t,n){return{beforeCreate(){const o=hf();if(!o)throw Rs(ks.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=y_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=ky(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=y_(e,s);else{this.$i18n=ky({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&h6(t,s,s),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(o,this.$i18n)},mounted(){},unmounted(){const o=hf();if(!o)throw Rs(ks.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function y_(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[u6](t.pluralizationRules||e.pluralizationRules);const n=e2(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const t2={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function G$({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===We?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Dn())}function p6(){return We}const Y$=Je({name:"i18n-t",props:Ao({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Co(e)||!isNaN(e)}},t2),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||$t({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Dn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=xt(e.plural)?+e.plural:e.plural);const u=G$(t,a);return s[gy](e.keypath,u,c)},r=Ao(Dn(),o),l=xt(e.tag)||kn(e.tag)?e.tag:p6();return kn(l)?Lt(l,r,{default:i}):Lt(l,r,i())}}}),k_=Y$;function Z$(e){return fo(e)&&!xt(e[0])}function m6(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Dn();e.locale&&(c.locale=e.locale),xt(e.format)?c.key=e.format:kn(e.format)&&(xt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?Ao(Dn(),h,{[p]:e.format[p]}):h,Dn()));const d=o(e.value,c,u);let f=[c.key];return fo(d)?f=d.map((h,p)=>{const m=s[h.type],y=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return Z$(y)&&(y[0].key=`${h.type}-${p}`),y}):xt(d)&&(f=[d]),f},l=Ao(Dn(),i),a=xt(e.tag)||kn(e.tag)?e.tag:p6();return kn(a)?Lt(a,l,{default:r}):Lt(a,l,r())}}const X$=Je({name:"i18n-n",props:Ao({value:{type:Number,required:!0},format:{type:[String,Object]}},t2),setup(e,t){const n=e.i18n||$t({useScope:e.scope,__useComponent:!0});return m6(e,t,l6,(...o)=>n[yy](...o))}}),b_=X$;function Q$(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function J$(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Rs(ks.UNEXPECTED_ERROR);const c=Q$(e,l.$),u=x_(a);return[Reflect.apply(c.t,c,[...w_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);fm&&(r.__i18nWatcher=et(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{fm&&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=x_(l);r.textContent=Reflect.apply(a.t,a,[...w_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function x_(e){if(xt(e))return{path:e};if(un(e)){if(!("path"in e))throw Rs(ks.REQUIRED_VALUE,"path");return e}else throw Rs(ks.INVALID_VALUE)}function w_(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return xt(n)&&(r.locale=n),Co(s)&&(r.plural=s),Co(i)&&(r.plural=i),[t,l,r]}function eF(e,t,...n){const o=un(n[0])?n[0]:{};(yn(o.globalInstall)?o.globalInstall:!0)&&([k_.name,"I18nT"].forEach(i=>e.component(i,k_)),[b_.name,"I18nN"].forEach(i=>e.component(i,b_)),[C_.name,"I18nD"].forEach(i=>e.component(i,C_))),e.directive("t",J$(t))}const tF=Vl("global-vue-i18n");function nF(e={}){const t=__VUE_I18N_LEGACY_API__&&yn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=yn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=oF(e,t),r=Vl("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),un(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=uF(d,u.global)),__VUE_I18N_FULL_INSTALL__&&eF(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(K$(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function $t(e={}){const t=hf();if(t==null)throw Rs(ks.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Rs(ks.NOT_INSTALLED);const n=sF(t),o=rF(n),s=f6(t),i=iF(e,s);if(i==="global")return h6(o,e,s),o;if(i==="parent"){let a=__(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Rs(ks.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Ao({},e),u=__(n,t);c.__root=u||o;const d=pm(c);return a.__composerExtend&&(d[qc]=a.__composerExtend(d)),Tk()&&Lf(()=>{const h=d[qc];h&&(h(),delete d[qc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Ao({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=pm(a),r.__composerExtend&&(l[qc]=r.__composerExtend(l)),aF(r,t,l),r.__setInstance(t,l)}return l}function oF(e,t){const n=N9(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>ky(e)):n.run(()=>pm(e));if(o==null)throw Rs(ks.UNEXPECTED_ERROR);return[n,o]}function sF(e){const t=Jt(e.isCE?tF:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Rs(e.isCE?ks.NOT_INSTALLED_WITH_PROVIDE:ks.UNEXPECTED_ERROR);return t}function iF(e,t){return M1(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function rF(e){return e.mode==="composition"?e.global:e.global.__composer}function __(e,t,n=!1){let o=null;const s=t.root;let i=lF(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[d6]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function lF(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function aF(e,t,n){An(()=>{},t),On(()=>{const o=n;e.__deleteInstance(t);const s=o[qc];s&&(s(),delete o[qc])},t)}const cF=["locale","fallbackLocale","availableLocales"],S_=["t","rt","d","n","tm","te"];function uF(e,t){const n=Object.create(null);return cF.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Rs(ks.UNEXPECTED_ERROR);const r=vo(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,S_.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Rs(ks.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,S_.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const dF=Je({name:"i18n-d",props:Ao({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},t2),setup(e,t){const n=e.i18n||$t({useScope:e.scope,__useComponent:!0});return m6(e,t,r6,(...o)=>n[vy](...o))}}),C_=dF;U$();w$(o$);_$(k$);S$(fy);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ea();e.__INTLIFY__=!0,s$(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const fF="modulepreload",hF=function(e){return"/"+e},A_={},vs=function(t,n,o){let s=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");s=r(n.map(c=>{if(c=hF(c),c in A_)return;A_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":fF,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(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 s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Dt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking"};function M_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function yo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Eo(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function qa(e){try{globalThis.localStorage.removeItem(e)}catch{}}function N1(e){const t=yo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Df(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function n2(){const e=yo(Dt.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function o2(e){const n={...n2()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];Eo(Dt.unread,JSON.stringify(n))}function pF(){const e=N1(Dt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function wg(e){Df(Dt.collapsedWorkspaces,Array.from(e))}function mF(){const e=N1(Dt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function g6(e){Df(Dt.workspaceOrder,Array.from(e))}function zh(){const e=N1(Dt.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function E_(e){Df(Dt.workspaceNameOverrides,e)}function gF(){return yo(Dt.workspaceSort)}function v6(e){Eo(Dt.workspaceSort,e)}const T_=Dt.clientId,vF="kimi-code-web",yF="web";function kF(){return{serverHttpUrl:xF(),clientId:CF(),clientName:vF,clientVersion:AF(),clientUiMode:yF}}function bF(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function xF(e){const t=bF(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function wF(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function _F(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return wF(e)}function jc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function SF(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 CF(){const e=yo(T_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return Eo(T_,t),t}function AF(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function MF(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function EF(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Jo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return NF(e)}function TF(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||Jo(e)}function NF(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function IF(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function LF(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function $F(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function FF(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const OF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function N_(e){return e.replace(/[&<>"']/g,t=>OF[t]??t)}function BF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function RF(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return I_(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return I_(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function I_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function _g(e,t){const n=N_(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(BF(N_(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const Rc=oe(0),DF=["type","disabled","aria-label"],PF=Je({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=oe();return t({el:n}),(o,s)=>(x(),E("button",{ref_key:"el",ref:n,class:Ue(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[jn(o.$slots,"default",{},void 0,!0)],10,DF))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Xn=dt(PF,[["__scopeId","data-v-c9e67023"]]),HF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WF(e,t){return x(),E("svg",HF,[...t[0]||(t[0]=[w("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const zF=gt({name:"kimi-add-conversation",render:WF}),UF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qF(e,t){return x(),E("svg",UF,[...t[0]||(t[0]=[w("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const jF=gt({name:"kimi-folder",render:qF}),VF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KF=["clip-path"],GF=["id"];function YF(e,t){return x(),E("svg",VF,[w("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[w("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,KF),w("defs",null,[w("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[w("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,GF)])])}const ZF=gt({name:"kimi-folder-open",render:YF,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),XF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function QF(e,t){return x(),E("svg",XF,[...t[0]||(t[0]=[w("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),w("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),w("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const JF=gt({name:"kimi-more",render:QF}),eO={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tO(e,t){return x(),E("svg",eO,[...t[0]||(t[0]=[w("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const nO=gt({name:"kimi-search",render:tO}),oO={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sO(e,t){return x(),E("svg",oO,[...t[0]||(t[0]=[w("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),w("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const iO=gt({name:"kimi-setting",render:sO}),rO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lO(e,t){return x(),E("svg",rO,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const aO=gt({name:"tabler-layout-sidebar-left-collapse",render:lO}),cO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uO(e,t){return x(),E("svg",cO,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const dO=gt({name:"tabler-layout-sidebar-left-expand",render:uO}),fO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hO(e,t){return x(),E("svg",fO,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const pO=gt({name:"tabler-paperclip",render:hO}),mO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gO(e,t){return x(),E("svg",mO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const vO=gt({name:"ri-add-line",render:gO}),yO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kO(e,t){return x(),E("svg",yO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const bO=gt({name:"ri-alert-line",render:kO}),xO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wO(e,t){return x(),E("svg",xO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const _O=gt({name:"ri-archive-line",render:wO}),SO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CO(e,t){return x(),E("svg",SO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const AO=gt({name:"ri-arrow-down-line",render:CO}),MO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EO(e,t){return x(),E("svg",MO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const TO=gt({name:"ri-arrow-down-s-line",render:EO}),NO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IO(e,t){return x(),E("svg",NO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const LO=gt({name:"ri-arrow-go-back-line",render:IO}),$O={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FO(e,t){return x(),E("svg",$O,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const OO=gt({name:"ri-arrow-right-line",render:FO}),BO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RO(e,t){return x(),E("svg",BO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const DO=gt({name:"ri-arrow-right-s-line",render:RO}),PO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HO(e,t){return x(),E("svg",PO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const L_=gt({name:"ri-arrow-up-line",render:HO}),WO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zO(e,t){return x(),E("svg",WO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const UO=gt({name:"ri-arrow-up-s-line",render:zO}),qO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jO(e,t){return x(),E("svg",qO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const VO=gt({name:"ri-braces-line",render:jO}),KO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GO(e,t){return x(),E("svg",KO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const YO=gt({name:"ri-calendar-close-line",render:GO}),ZO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XO(e,t){return x(),E("svg",ZO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const QO=gt({name:"ri-calendar-schedule-line",render:XO}),JO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eB(e,t){return x(),E("svg",JO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const tB=gt({name:"ri-calendar-todo-line",render:eB}),nB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oB(e,t){return x(),E("svg",nB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const sB=gt({name:"ri-check-line",render:oB}),iB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rB(e,t){return x(),E("svg",iB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const lB=gt({name:"ri-close-line",render:rB}),aB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cB(e,t){return x(),E("svg",aB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const uB=gt({name:"ri-code-line",render:cB}),dB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fB(e,t){return x(),E("svg",dB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const hB=gt({name:"ri-collapse-diagonal-line",render:fB}),pB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mB(e,t){return x(),E("svg",pB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const gB=gt({name:"ri-download-line",render:mB}),vB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yB(e,t){return x(),E("svg",vB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const kB=gt({name:"ri-draggable",render:yB}),bB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xB(e,t){return x(),E("svg",bB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const wB=gt({name:"ri-equalizer-line",render:xB}),_B={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SB(e,t){return x(),E("svg",_B,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const CB=gt({name:"ri-expand-diagonal-line",render:SB}),AB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MB(e,t){return x(),E("svg",AB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const EB=gt({name:"ri-external-link-line",render:MB}),TB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NB(e,t){return x(),E("svg",TB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const IB=gt({name:"ri-file-add-line",render:NB}),LB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $B(e,t){return x(),E("svg",LB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const FB=gt({name:"ri-file-copy-line",render:$B}),OB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BB(e,t){return x(),E("svg",OB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const RB=gt({name:"ri-file-edit-line",render:BB}),DB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PB(e,t){return x(),E("svg",DB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const $_=gt({name:"ri-file-line",render:PB}),HB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WB(e,t){return x(),E("svg",HB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const zB=gt({name:"ri-file-text-line",render:WB}),UB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qB(e,t){return x(),E("svg",UB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const jB=gt({name:"ri-flashlight-line",render:qB}),VB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KB(e,t){return x(),E("svg",VB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const GB=gt({name:"ri-folder-add-line",render:KB}),YB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZB(e,t){return x(),E("svg",YB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const XB=gt({name:"ri-folder-fill",render:ZB}),QB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JB(e,t){return x(),E("svg",QB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const eR=gt({name:"ri-git-fork-line",render:JB}),tR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nR(e,t){return x(),E("svg",tR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const oR=gt({name:"ri-git-pull-request-line",render:nR}),sR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iR(e,t){return x(),E("svg",sR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const rR=gt({name:"ri-global-line",render:iR}),lR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aR(e,t){return x(),E("svg",lR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const F_=gt({name:"ri-image-line",render:aR}),cR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uR(e,t){return x(),E("svg",cR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const dR=gt({name:"ri-information-line",render:uR}),fR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hR(e,t){return x(),E("svg",fR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const pR=gt({name:"ri-links-line",render:hR}),mR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gR(e,t){return x(),E("svg",mR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const vR=gt({name:"ri-list-check",render:gR}),yR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kR(e,t){return x(),E("svg",yR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const bR=gt({name:"ri-list-unordered",render:kR}),xR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wR(e,t){return x(),E("svg",xR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const _R=gt({name:"ri-login-box-line",render:wR}),SR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CR(e,t){return x(),E("svg",SR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const AR=gt({name:"ri-mail-line",render:CR}),MR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ER(e,t){return x(),E("svg",MR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const TR=gt({name:"ri-message-line",render:ER}),NR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IR(e,t){return x(),E("svg",NR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const LR=gt({name:"ri-pause-fill",render:IR}),$R={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FR(e,t){return x(),E("svg",$R,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const OR=gt({name:"ri-pencil-line",render:FR}),BR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RR(e,t){return x(),E("svg",BR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const DR=gt({name:"ri-play-fill",render:RR}),PR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HR(e,t){return x(),E("svg",PR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const WR=gt({name:"ri-question-line",render:HR}),zR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UR(e,t){return x(),E("svg",zR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const qR=gt({name:"ri-sort-desc",render:UR}),jR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VR(e,t){return x(),E("svg",jR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const KR=gt({name:"ri-sparkling-line",render:VR}),GR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YR(e,t){return x(),E("svg",GR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const ZR=gt({name:"ri-star-fill",render:YR}),XR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QR(e,t){return x(),E("svg",XR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const JR=gt({name:"ri-star-line",render:QR}),eD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tD(e,t){return x(),E("svg",eD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const nD=gt({name:"ri-stop-fill",render:tD}),oD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sD(e,t){return x(),E("svg",oD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const iD=gt({name:"ri-subtract-line",render:sD}),rD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lD(e,t){return x(),E("svg",rD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const aD=gt({name:"ri-target-line",render:lD}),cD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uD(e,t){return x(),E("svg",cD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const dD=gt({name:"ri-terminal-box-line",render:uD}),fD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hD(e,t){return x(),E("svg",fD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const pD=gt({name:"ri-time-line",render:hD}),mD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gD(e,t){return x(),E("svg",mD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const vD=gt({name:"ri-tools-line",render:gD}),yD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kD(e,t){return x(),E("svg",yD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const bD=gt({name:"ri-user-line",render:kD}),xD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
39
- <path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
40
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
41
- </svg>
42
- `,wD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
- <path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
44
- </svg>
45
- `,_D=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
- <g clip-path="url(#clip0_4626_2033)">
47
- <path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
48
- </g>
49
- <defs>
50
- <clipPath id="clip0_4626_2033">
51
- <rect width="24" height="24" fill="white"/>
52
- </clipPath>
53
- </defs>
54
- </svg>
55
- `,SD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
56
- <path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
57
- <path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
58
- <path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
59
- </svg>
60
- `,CD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
- <path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
62
- </svg>
63
- `,AD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64
- <path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
65
- <path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
66
- </svg>
67
- `,MD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',ED='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',TD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',ND='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',ID='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',LD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',$D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',FD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',OD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',BD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',RD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',O_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',DD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',PD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',HD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',WD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',zD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',UD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',qD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',jD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',VD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',KD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',GD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',YD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',ZD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',XD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',QD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',JD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',eP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',B_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',tP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',nP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',oP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',sP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',iP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',rP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',lP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',R_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',aP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',cP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',uP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',dP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',fP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',hP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',pP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',mP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',gP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',vP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',yP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',kP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',bP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',xP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',wP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',_P='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',SP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',CP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',AP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',MP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',EP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',TP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',y6={sm:14,md:16,lg:20};function bt(e,t){return{component:e,svg:t}}const k6={plus:bt(vO,ND),"chat-new":bt(zF,xD),"calendar-close":bt(YO,HD),"calendar-schedule":bt(QO,WD),"calendar-todo":bt(tB,zD),close:bt(lB,qD),check:bt(sB,UD),archive:bt(_O,LD),search:bt(nO,CD),copy:bt(FB,JD),link:bt(pR,cP),"external-link":bt(EB,XD),download:bt(gB,KD),undo:bt(LO,OD),send:bt(L_,O_),image:bt(F_,R_),settings:bt(iO,AD),sliders:bt(wB,YD),"log-in":bt(_R,fP),"chevron-down":bt(TO,FD),"chevron-right":bt(DO,RD),"chevron-up":bt(UO,DD),"arrow-up":bt(L_,O_),"arrow-down":bt(AO,$D),"arrow-right":bt(OO,BD),minus:bt(iD,SP),"panel-collapse":bt(aO,MD),"panel-expand":bt(dO,ED),expand:bt(CB,ZD),collapse:bt(hB,VD),list:bt(bR,dP),sort:bt(qR,kP),grip:bt(kB,GD),folder:bt(ZF,_D),"folder-closed":bt(jF,wD),"folder-plus":bt(GB,oP),"folder-solid":bt(XB,sP),file:bt($_,B_),"file-text":bt(zB,tP),"file-edit":bt(RB,eP),"file-plus":bt(IB,QD),"file-off":bt($_,B_),attachment:bt(pO,TD),"image-off":bt(F_,R_),code:bt(uB,jD),terminal:bt(dD,AP),pencil:bt(OR,gP),tool:bt(vD,EP),glob:bt(VO,PD),globe:bt(rR,lP),"check-list":bt(vR,uP),bolt:bt(jB,nP),"git-fork":bt(eR,iP),"git-pull-request":bt(oR,rP),message:bt(TR,pP),mail:bt(AR,hP),user:bt(bD,TP),info:bt(dR,aP),"help-circle":bt(WR,yP),"alert-triangle":bt(bO,ID),clock:bt(pD,MP),sparkles:bt(KR,bP),target:bt(aD,CP),pause:bt(LR,mP),play:bt(DR,vP),stop:bt(nD,_P),star:bt(ZR,xP),"star-outline":bt(JR,wP),"dots-horizontal":bt(JF,SD)};function NP(e){return k6[e]}function IP(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Dc(e,t="md"){const n=k6[e];return n?IP(n.svg,y6[t]):""}const Q4e=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ge=Je({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>NP(t.name)),o=D(()=>y6[t.size]);return(s,i)=>n.value?(x(),Se(Ho(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ue("",!0)}}),LP={key:0,class:"ui-dialog__head"},$P={class:"ui-dialog__titles"},FP={key:0,class:"ui-dialog__title"},OP={key:1,class:"ui-dialog__desc"},BP={class:"ui-dialog__body"},RP={key:1,class:"ui-dialog__foot"},DP='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',PP=Je({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=oe(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(DP)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return et(()=>n.open,async d=>{if(d){Rc.value+=1,i=document.activeElement,await yt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else Rc.value=Math.max(0,Rc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ho(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Rc.value=Math.max(0,Rc.value-1))}),(d,f)=>(x(),Se(_1,{to:"body"},[e.open?(x(),E("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:s,class:Ue(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),E("div",LP,[jn(d.$slots,"head",{},()=>[w("div",$P,[e.title?(x(),E("div",FP,R(e.title),1)):ue("",!0),e.description?(x(),E("div",OP,R(e.description),1)):ue("",!0)])],!0),ae(Xn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ie(()=>[ae(Ge,{name:"close",size:"md"})]),_:1})])):ue("",!0),w("div",BP,[jn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),E("div",RP,[jn(d.$slots,"foot",{},void 0,!0)])):ue("",!0)],2)],32)):ue("",!0)]))}}),Qr=dt(PP,[["__scopeId","data-v-3dce23a4"]]),HP={class:"sd-head"},WP=["placeholder","aria-label"],zP=["aria-selected","onClick","onMousemove"],UP={class:"sd-meta"},qP=["innerHTML"],jP={class:"sd-time"},VP=["innerHTML"],KP=["innerHTML"],GP={key:1,class:"sd-empty"},YP={class:"sd-hint"},ZP=200,XP=Je({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe(!0),r=oe(""),l=oe(null),a=oe(null),c=D(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of o.sessions){const b=v.title??"",A=v.lastPrompt??"",I=v.workspaceName??"",N=k.length>0&&b.toLowerCase().includes(k),M=k.length>0&&A.toLowerCase().includes(k),$=k.length>0&&I.toLowerCase().includes(k);if(!(k.length>0&&!N&&!M&&!$)&&(g.push({session:v,inTitle:N,inWorkspace:$,snippetText:A?RF(A,r.value):""}),g.length>=ZP))break}return g}),u=oe(0);et(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await yt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(k){u.value=d(u.value+k),f()}function p(k){s("select",k),s("close")}function m(){const k=c.value[u.value];k&&p(k.session.id)}function y(k){k.key==="ArrowDown"?(k.preventDefault(),h(1)):k.key==="ArrowUp"?(k.preventDefault(),h(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return An(()=>{l.value?.focus()}),(k,g)=>(x(),Se(Qr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>s("close"))},{head:Ie(()=>[w("div",HP,[ae(Ge,{class:"sd-search-icon",name:"search",size:"md"}),qn(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:y},null,40,WP),[[Cs,r.value]])])]),foot:Ie(()=>[w("span",YP,R(C(n)("sidebar.searchHint")),1)]),default:Ie(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),E(We,{key:0},rt(c.value,(v,b)=>(x(),E("button",{key:v.session.id,class:Ue(["sd-row",{on:b===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":b===u.value,onClick:A=>p(v.session.id),onMousemove:A=>u.value=b},[w("span",UP,[ae(Ge,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(_g)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,qP),w("span",jP,R(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(_g)(v.session.title,v.inTitle?r.value:"")},null,8,VP),v.snippetText?(x(),E("span",{key:0,class:"sd-snippet",innerHTML:C(_g)(v.snippetText,r.value)},null,8,KP)):ue("",!0)],42,zP))),128)):(x(),E("div",GP,R(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),QP=dt(XP,[["__scopeId","data-v-a678f802"]]),JP=["aria-label"],eH=Je({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),E("span",{class:Ue(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,JP))}}),Us=dt(eH,[["__scopeId","data-v-e5c5b17d"]]),tH={key:0,class:"ui-badge__dot","aria-hidden":"true"},nH=Je({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),E("span",{class:Ue(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),E("span",tH)):ue("",!0),jn(t.$slots,"default",{},void 0,!0)],2))}}),qi=dt(nH,[["__scopeId","data-v-5bc5cd6d"]]),oH=Je({__name:"Menu",setup(e,{expose:t}){const n=oe();return t({el:n}),(o,s)=>(x(),E("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[jn(o.$slots,"default",{},void 0,!0)],512))}}),Ml=dt(oH,[["__scopeId","data-v-60e6cd8d"]]),sH={key:0,class:"ui-menu-sep",role:"separator"},iH=["disabled"],rH=Je({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),E("div",sH)):(x(),E("button",{key:1,class:Ue(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[jn(t.$slots,"default",{},void 0,!0)],10,iH))}}),Tn=dt(rH,[["__scopeId","data-v-f940771a"]]),al=6,cl=8,lH=150,aH=Je({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=oe(),o=oe(),s=oe(!1),i=oe(!1),r=oe({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=o.value;if(!a||!m)return;const y=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,b=window.innerHeight;let A=t.placement;A==="top"&&y.top-al-g<cl?A="bottom":A==="bottom"&&y.bottom+al+g>b-cl?A="top":A==="left"&&y.left-al-k<cl?A="right":A==="right"&&y.right+al+k>v-cl&&(A="left");let I=0,N=0;A==="top"?(I=y.top-al-g,N=y.left+y.width/2-k/2):A==="bottom"?(I=y.bottom+al,N=y.left+y.width/2-k/2):A==="left"?(I=y.top+y.height/2-g/2,N=y.left-al-k):(I=y.top+y.height/2-g/2,N=y.right+al),N=Math.min(Math.max(N,cl),v-cl-k),I=Math.min(Math.max(I,cl),b-cl-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(I)}px`,left:`${Math.round(N)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,yt(()=>{u(),i.value=!0})},lH))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return An(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const y=m.firstElementChild??null;y!==a&&(f(),p(y??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ho(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,y)=>(x(),E(We,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[jn(m.$slots,"default",{},void 0,!0)],512),(x(),Se(_1,{to:"body"},[qn(w("div",{ref_key:"bubble",ref:o,class:Ue(["ui-tip__bubble",{positioned:i.value}]),style:on([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[xi,s.value]])]))],64))}}),an=dt(aH,[["__scopeId","data-v-4c261eb6"]]),cH={class:"row"},uH={class:"lead","aria-hidden":"true"},dH={key:1,class:"unread-dot"},fH={class:"left"},hH=["onKeydown"],pH={class:"act"},mH={class:"ts"},gH={class:"menu-time"},vH=Je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=$t(),s=e,i=n;function r(S){const B=new Date(S);if(Number.isNaN(B.getTime()))return S;const W=z=>String(z).padStart(2,"0");return`${B.getFullYear()}-${W(B.getMonth()+1)}-${W(B.getDate())} ${W(B.getHours())}:${W(B.getMinutes())}`}const l=D(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=oe(!1),c=oe(null),u=oe(null),d=oe({});function f(S){const B=S.target;u.value?.el?.contains(B)||c.value?.el?.contains(B)||m()}function h(){const S=c.value?.el;if(!S)return;const B=u.value?.el,W=S.getBoundingClientRect(),z=4,L=8,O=B?.offsetHeight??0,U=B?.offsetWidth??0;let Z=W.bottom+z;Z+O>window.innerHeight-L&&(Z=Math.max(L,W.top-O-z));let ie=W.right-U;ie<L&&(ie=L),d.value={top:`${Math.round(Z)}px`,left:`${Math.round(ie)}px`}}async function p(S){if(S.stopPropagation(),a.value){m();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",m),await yt(),h()}function m(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)}On(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)});const y=oe(!1),k=oe(""),g=oe(null);async function v(){m(),y.value=!0,k.value=s.session.title,await yt();try{g.value?.focus(),g.value?.select()}catch{}}function b(){const S=k.value.trim();S&&i("rename",s.session.id,S),y.value=!1}function A(){y.value=!1}const I=oe(!1),N=oe(!1);async function M(){const S=await Jo(s.session.id);I.value=S,N.value=!S,setTimeout(()=>{I.value=!1,N.value=!1,m()},1500)}function $(){m(),i("fork",s.session.id)}function T(){m(),i("export",s.session.id)}function F(){m(),i("archive",s.session.id)}return t({closeMenu:m}),(S,B)=>(x(),E("div",{class:Ue(["se",{on:e.active}]),onClick:B[4]||(B[4]=W=>i("select",e.session.id))},[w("div",cH,[w("span",uH,[e.session.busy?(x(),Se(Us,{key:0,size:"sm"})):e.unread?(x(),E("span",dH)):ue("",!0)]),w("div",fH,[y.value?qn((x(),E("input",{key:0,ref_key:"renameInputRef",ref:g,"onUpdate:modelValue":B[0]||(B[0]=W=>k.value=W),class:"rename-input",onClick:B[1]||(B[1]=St(()=>{},["stop"])),onKeydown:[ur(St(b,["stop"]),["enter"]),ur(St(A,["stop"]),["esc"])],onBlur:b},null,40,hH)),[[Cs,k.value]]):(x(),E("span",{key:1,class:"t",onDblclick:St(v,["stop"])},R(e.session.title),33))]),ae(an,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ie(()=>[!y.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(x(),Se(qi,{key:0,variant:"info",size:"sm"},{default:Ie(()=>[ot(R(C(o)("workspace.awaitingAnswer")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),ae(an,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ie(()=>[!y.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(x(),Se(qi,{key:0,variant:"warning",size:"sm"},{default:Ie(()=>[ot(R(C(o)("workspace.awaitingPermission")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),ae(an,{text:C(o)("workspace.abortedTitle")},{default:Ie(()=>[!y.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(x(),Se(qi,{key:0,variant:"danger",size:"sm"},{default:Ie(()=>[ot(R(C(o)("workspace.aborted")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),w("span",pH,[w("span",mH,R(e.session.time),1),y.value?ue("",!0):(x(),Se(Xn,{key:0,ref_key:"kebabRef",ref:c,class:Ue(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:B[2]||(B[2]=St(W=>p(W),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),Se(_1,{to:"body"},[a.value?(x(),Se(Ml,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:on(d.value),onClick:B[3]||(B[3]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{danger:N.value,onClick:M},{default:Ie(()=>[ae(Ge,{name:I.value?"check":"copy",size:"sm"},null,8,["name"]),ot(" "+R(N.value?C(o)("sidebar.copyFailed"):I.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ae(Tn,{separator:""}),ae(Tn,{onClick:v},{default:Ie(()=>[ae(Ge,{name:"pencil",size:"sm"}),ot(" "+R(C(o)("sidebar.rename")),1)]),_:1}),ae(Tn,{onClick:$},{default:Ie(()=>[ae(Ge,{name:"git-fork",size:"sm"}),ot(" "+R(C(o)("sidebar.fork")),1)]),_:1}),ae(Tn,{onClick:T},{default:Ie(()=>[ae(Ge,{name:"download",size:"sm"}),ot(" "+R(C(o)("sidebar.export")),1)]),_:1}),ae(Tn,{danger:"",onClick:F},{default:Ie(()=>[ae(Ge,{name:"archive",size:"sm"}),ot(" "+R(C(o)("sidebar.archive")),1)]),_:1}),ae(Tn,{separator:""}),w("div",gH,R(l.value),1)]),_:1},8,["style"])):ue("",!0)]))],2))}}),yH=dt(vH,[["__scopeId","data-v-c1a3c877"]]),kH={class:"gh-top"},bH={class:"gh-name"},xH=["inert"],wH=["disabled"],_H={class:"show-more-label"},SH={class:"show-more-label"},CH={key:2,class:"group-empty"},AH=Je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=D(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=D(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(x(),E("div",{class:Ue(["group",{dragging:e.dragging}])},[w("div",{class:Ue(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=St(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[w("div",kH,[e.isCollapsed(e.group.workspace.id)?(x(),Se(Ge,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),Se(Ge,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),Se(an,{key:2,text:e.group.workspace.root},{default:Ie(()=>[w("span",bH,R(e.group.workspace.name),1)]),_:1},8,["text"])):qn((x(),E("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=ur(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=ur(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=St(()=>{},["stop"]))},null,544)),[[Cs,i.value]]),e.renamingId!==e.group.workspace.id?(x(),E("div",{key:4,class:Ue(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ae(Xn,{class:Ue(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=St(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ae(Xn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=St(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"chat-new"})]),_:1},8,["label"])],2)):ue("",!0)])],34),w("div",{class:Ue(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),E(We,null,rt(r.value,p=>(x(),Se(yH,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=m=>s("selectSession",m)),onRename:h[11]||(h[11]=(m,y)=>s("renameSession",m,y)),onArchive:h[12]||(h[12]=m=>s("archiveSession",m)),onFork:h[13]||(h[13]=m=>s("forkSession",m)),onExport:h[14]||(h[14]=m=>s("exportSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),E("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=St(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",_H,R(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,wH)):ue("",!0),l.value?(x(),E("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=St(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",SH,R(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):ue("",!0),e.group.sessions.length===0?(x(),E("div",CH,R(C(n)("sidebar.noSessions")),1)):ue("",!0)],10,xH)],2))}}),MH=dt(AH,[["__scopeId","data-v-cdac739a"]]),EH="kimi_desktop",TH="platform",D_="kimi-desktop",P_="kimi-desktop-platform";function NH(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(EH)?(sessionStorage.setItem(D_,"1"),e=!0):e=e||sessionStorage.getItem(D_)==="1";const o=n.get(TH);o?(sessionStorage.setItem(P_,o),t=o):t=sessionStorage.getItem(P_)}catch{}return{isDesktop:e,platform:t}}const by=NH(),IH=by.isDesktop,iu=by.isDesktop&&by.platform==="darwin",LH={class:"ui-kbd"},$H=Je({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),E("span",LH,[(x(!0),E(We,null,rt(e.keys,o=>(x(),E("kbd",{key:o,class:"ui-kbd__key"},R(o),1))),128))]))}}),Er=dt($H,[["__scopeId","data-v-32292ed8"]]),FH=["disabled","aria-pressed"],OH=Je({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),E("button",{key:0,class:Ue(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[jn(t.$slots,"default",{},void 0,!0)],10,FH)):(x(),E("span",{key:1,class:Ue(["ui-pill",{"is-active":e.active}])},[jn(t.$slots,"default",{},void 0,!0)],2))}}),Cp=dt(OH,[["__scopeId","data-v-317ace1a"]]),BH={class:"ch"},RH={class:"ch-brand"},DH={class:"ch-backend-ep"},PH={class:"btn-wrap"},HH={class:"search-input"},WH={key:0,class:"empty"},zH={class:"side-section-label"},UH={class:"side-section-title"},qH={class:"side-section-actions"},jH=["onDragover","onDrop"],VH={class:"side-footer"},KH={class:"section-menu-check"},GH={class:"section-menu-check"},YH={class:"section-menu-check"},ZH={class:"backend-menu-name"},XH={class:"backend-menu-url"},QH=1e3,JH=Je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=$t(),o=!1,s=oe(null),i=D(()=>""),r=["default","multi"];function l(nt){const Be=s.value?.presets[nt]??"";return Be?EF(Be):""}function a(nt){const Be=s.value;return Be!==null&&Be.current===Be.presets[nt]}const c=e,u=t,d=oe(!1),f=m()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(nt){(nt.metaKey||nt.ctrlKey)&&nt.key.toLowerCase()==="k"&&(nt.preventDefault(),h())}An(()=>window.addEventListener("keydown",p)),ho(()=>window.removeEventListener("keydown",p));function m(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const nt=navigator.userAgentData;return nt?.platform==="macOS"||nt?.platform==="iOS"}const y=oe(!1);function k(nt){y.value=nt.target.scrollTop>0}const g=oe(new Set(pF()));function v(nt){return g.value.has(nt)}function b(nt){const Be=new Set(g.value);Be.has(nt)?Be.delete(nt):Be.add(nt),g.value=Be,wg(Be)}function A(){const nt=new Set(c.groups.map(Be=>Be.workspace.id));g.value=nt,wg(nt)}function I(){const nt=new Set;g.value=nt,wg(nt)}const N=D(()=>c.groups.length>0&&c.groups.every(nt=>g.value.has(nt.workspace.id))),M=oe(new Set);function $(nt){return M.value.has(nt)}function T(nt){const Be=new Set(M.value);Be.has(nt)?Be.delete(nt):Be.add(nt),M.value=Be}function F(nt){if(!M.value.has(nt)){const Be=new Set(M.value);Be.add(nt),M.value=Be}u("loadMoreSessions",nt)}const S=oe(null),B=oe(null);function W(nt){S.value=nt}function z(){S.value=null,B.value=null}function L(nt){const Be=nt.currentTarget.getBoundingClientRect();return nt.clientY<Be.top+Be.height/2?"before":"after"}function O(nt,Be){S.value===null||S.value===Be||(nt.preventDefault(),nt.dataTransfer&&(nt.dataTransfer.dropEffect="move"),B.value={id:Be,position:L(nt)})}function U(nt){const Be=S.value,Bt=B.value?.id===nt?B.value.position:"before";if(B.value=null,S.value=null,!Be||Be===nt)return;const Yt=$F(c.groups.map(vn=>vn.workspace.id),Be,nt,Bt);u("reorderWorkspaces",Yt)}function Z(nt,Be){Be.target.closest(".gh-more, .gh-add")||b(nt)}function ie(nt){u("select",nt)}const q=oe(null),ee=oe(""),fe=oe(null);function ne(){return fe}function j(nt,Be){q.value=nt,ee.value=Be,yt().then(()=>fe.value?.focus())}function K(){const nt=q.value,Be=ee.value.trim();nt&&Be&&u("renameWorkspace",nt,Be),q.value=null}function ve(){q.value=null}function he(nt){ee.value=nt}const Ae=oe(!1),re=oe(null),Y=oe({}),Q=oe(null);function P(nt){Q.value?.el&&!Q.value.el.contains(nt.target)&&me()}function G(nt,Be){Be.preventDefault(),Be.stopPropagation(),re.value=nt,Y.value={top:`${Be.clientY}px`,left:`${Be.clientX}px`},Ae.value=!0,document.addEventListener("mousedown",P,!0)}function me(){Ae.value=!1,document.removeEventListener("mousedown",P,!0),re.value=null}function ye(){re.value&&Jo(re.value.root),me()}function de(){re.value&&j(re.value.id,re.value.name),me()}function V(){const nt=re.value;nt&&(me(),u("deleteWorkspace",nt.id))}const se=oe(null),pe=oe(null),ke=oe({}),Ne=oe(null);function qe(nt){const Be=nt.target;Be.closest(".gh-more")||Be.closest(".ws-menu")||xe()}async function be(nt,Be){if(se.value===nt.id){xe();return}const Bt=Be.currentTarget;pe.value=nt,se.value=nt.id,document.addEventListener("mousedown",qe),window.addEventListener("resize",xe),await yt();const Yt=Ne.value?.el,vn=Bt.getBoundingClientRect(),xn=4,nn=8,Vn=Yt?.offsetHeight??0,Kn=Yt?.offsetWidth??0;let Jn=vn.bottom+xn;Jn+Vn>window.innerHeight-nn&&(Jn=Math.max(nn,vn.top-Vn-xn));let Oo=vn.right-Kn;Oo<nn&&(Oo=nn),ke.value={top:`${Math.round(Jn)}px`,left:`${Math.round(Oo)}px`}}function xe(){se.value=null,pe.value=null,document.removeEventListener("mousedown",qe),window.removeEventListener("resize",xe)}function Ze(nt){Jo(nt.root),xe()}function tt(nt){j(nt.id,nt.name),xe()}function lt(nt){xe(),u("deleteWorkspace",nt.id)}const ut=oe(!1),mt=oe({}),Tt=oe(null);function wt(nt){const Be=nt.target;Be.closest(".side-section-kebab")||Be.closest(".section-menu")||en()}async function Ft(nt){if(ut.value){en();return}const Be=nt.currentTarget;ut.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",en),await yt();const Bt=Tt.value?.el,Yt=Be.getBoundingClientRect(),vn=4,xn=8,nn=Bt?.offsetHeight??0,Vn=Bt?.offsetWidth??0;let Kn=Yt.bottom+vn;Kn+nn>window.innerHeight-xn&&(Kn=Math.max(xn,Yt.top-nn-vn));let Jn=Yt.right-Vn;Jn<xn&&(Jn=xn),mt.value={top:`${Math.round(Kn)}px`,left:`${Math.round(Jn)}px`}}function en(){ut.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",en)}function Hn(nt){u("setWorkspaceSortMode",nt),en()}const Pt=oe(!1),bn=oe({}),pn=oe(null);function Kt(nt){const Be=nt.target;Be.closest(".ch-backend")||Be.closest(".backend-menu")||Gt()}async function Nn(nt){if(s.value===null)return;if(Pt.value){Gt();return}const Be=nt.currentTarget;Pt.value=!0,document.addEventListener("mousedown",Kt),window.addEventListener("resize",Gt),await yt();const Bt=pn.value?.el,Yt=Be.getBoundingClientRect(),vn=4,xn=8,nn=Bt?.offsetHeight??0;let Vn=Yt.bottom+vn;Vn+nn>window.innerHeight-xn&&(Vn=Math.max(xn,Yt.top-nn-vn)),bn.value={top:`${Math.round(Vn)}px`,left:`${Math.round(Math.max(xn,Yt.left))}px`}}function Gt(){Pt.value=!1,document.removeEventListener("mousedown",Kt),window.removeEventListener("resize",Gt)}async function Wt(nt){if(a(nt)){Gt();return}if(await MF(nt)===null){console.warn("[kimi-web] dev backend switch failed:",nt),Gt();return}window.location.reload()}ho(()=>{document.removeEventListener("mousedown",P,!0),document.removeEventListener("mousedown",qe),document.removeEventListener("mousedown",wt),document.removeEventListener("mousedown",Kt),window.removeEventListener("resize",xe),window.removeEventListener("resize",en),window.removeEventListener("resize",Gt)});const mn=oe(null);let so;function gn(){const nt=mn.value;nt&&(nt.classList.remove("blink-now"),nt.getBoundingClientRect(),nt.classList.add("blink-now"),clearTimeout(so),so=setTimeout(()=>nt.classList.remove("blink-now"),300))}const to=Hi(()=>vs(()=>import("./DesignSystemView-Y1YvR64p.js"),__vite__mapDeps([0,1]))),vt=oe(!1);let Wn,Bn=!1;function Qn(nt){Bn=!1,clearTimeout(Wn),nt.currentTarget.setPointerCapture?.(nt.pointerId),Wn=setTimeout(()=>{Bn=!0,vt.value=!0},QH)}function sn(nt){clearTimeout(Wn);const Be=nt.currentTarget;Be.hasPointerCapture?.(nt.pointerId)&&Be.releasePointerCapture(nt.pointerId)}function es(){if(Bn){Bn=!1;return}gn()}return ho(()=>{clearTimeout(Wn)}),(nt,Be)=>(x(),E("aside",{class:Ue(["side",{"macos-desktop":C(iu),collapsed:e.collapsed,"no-anim":e.dragging}]),style:on({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:on({width:e.colWidth+"px"})},[w("div",BH,[w("div",RH,[C(iu)?ue("",!0):(x(),E(We,{key:0},[(x(),E("svg",{ref_key:"logoRef",ref:mn,class:Ue(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:es,onPointerdown:Qn,onPointerup:sn,onPointercancel:sn},[...Be[22]||(Be[22]=[qk('<defs data-v-1b04ce05><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-1b04ce05><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b04ce05></rect><g class="ch-eyes" fill="#000" data-v-1b04ce05><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-1b04ce05></rect>',2)])],34)),Be[23]||(Be[23]=w("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(x(),Se(Cp,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:Nn},{default:Ie(()=>[w("span",{class:Ue(["ch-backend-kind",`is-${e.backend}`])},R(e.backend),3),w("span",DH," · "+R(i.value),1),s.value!==null?(x(),Se(Ge,{key:0,name:"chevron-down",size:"sm"})):ue("",!0)]),_:1},8,["clickable","title"])):ue("",!0)],64))]),C(iu)?ue("",!0):(x(),Se(Xn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Be[0]||(Be[0]=St(Bt=>u("collapse"),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",PH,[w("button",{class:"btn-new-chat",type:"button",onClick:Be[1]||(Be[1]=St(Bt=>u("create"),["stop"]))},[ae(Ge,{name:"chat-new"}),w("span",null,R(C(n)("sidebar.newChat")),1)]),ue("",!0)]),w("div",{class:Ue(["search-wrap",{"search-wrap--scrolled":y.value}])},[w("button",{class:"search",type:"button",onClick:h},[ae(Ge,{class:"search-icon",name:"search"}),w("span",HH,R(C(n)("sidebar.search")),1),ae(Er,{keys:C(f)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:k},[e.groups.length===0?(x(),E("div",WH,R(C(n)("workspace.noWorkspace")),1)):(x(),E(We,{key:1},[w("div",zH,[w("span",UH,R(C(n)("sidebar.workspaces")),1),w("div",qH,[ae(Xn,{class:"side-section-toggle",size:"sm",label:N.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Be[3]||(Be[3]=St(Bt=>N.value?I():A(),["stop"]))},{default:Ie(()=>[N.value?(x(),Se(Ge,{key:0,name:"expand"})):(x(),Se(Ge,{key:1,name:"collapse"}))]),_:1},8,["label"]),ae(Xn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":ut.value,onClick:Be[4]||(Be[4]=St(Bt=>Ft(Bt),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),E(We,null,rt(e.groups,Bt=>(x(),E("div",{key:Bt.workspace.id,class:Ue(["ws-drop-target",{"drop-before":B.value?.id===Bt.workspace.id&&B.value.position==="before","drop-after":B.value?.id===Bt.workspace.id&&B.value.position==="after"}]),onDragover:Yt=>O(Yt,Bt.workspace.id),onDrop:Yt=>U(Bt.workspace.id)},[ae(MH,{group:Bt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":ee.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":se.value,dragging:S.value===Bt.workspace.id,"is-collapsed":v,"is-expanded":$,onGroupClick:Z,onGroupContextmenu:G,onToggleWsMenu:be,onCreateInWorkspace:Be[5]||(Be[5]=Yt=>u("createInWorkspace",Yt)),onSelectSession:ie,onRenameSession:Be[6]||(Be[6]=(Yt,vn)=>u("rename",Yt,vn)),onArchiveSession:Be[7]||(Be[7]=Yt=>u("archive",Yt)),onForkSession:Be[8]||(Be[8]=Yt=>u("fork",Yt)),onExportSession:Be[9]||(Be[9]=Yt=>u("export",Yt)),onLoadMore:F,onToggleExpand:T,onConfirmRename:K,onCancelRename:ve,onUpdateRenameValue:he,onWsDragstart:W,onWsDragend:z},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,jH))),128))],64))],32),w("div",VH,[w("button",{class:"btn-settings",type:"button",onClick:Be[10]||(Be[10]=St(Bt=>u("openSettings"),["stop"]))},[ae(Ge,{name:"settings"}),w("span",null,R(C(n)("settings.title")),1)])])],4),Ae.value?(x(),Se(Ml,{key:0,ref_key:"ghMenuRef",ref:Q,class:"gh-menu",style:on(Y.value),onClick:Be[11]||(Be[11]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{onClick:ye},{default:Ie(()=>[ot(R(C(n)("sidebar.copyPath")),1)]),_:1}),ae(Tn,{onClick:de},{default:Ie(()=>[ot(R(C(n)("sidebar.rename")),1)]),_:1}),ae(Tn,{danger:"",onClick:V},{default:Ie(()=>[ot(R(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),se.value!==null&&pe.value?(x(),Se(Ml,{key:1,ref_key:"wsMenuRef",ref:Ne,class:"ws-menu",style:on(ke.value),onClick:Be[15]||(Be[15]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{onClick:Be[12]||(Be[12]=Bt=>Ze(pe.value))},{default:Ie(()=>[ot(R(C(n)("sidebar.copyPath")),1)]),_:1}),ae(Tn,{separator:""}),ae(Tn,{onClick:Be[13]||(Be[13]=Bt=>tt(pe.value))},{default:Ie(()=>[ot(R(C(n)("sidebar.rename")),1)]),_:1}),ae(Tn,{separator:""}),ae(Tn,{danger:"",onClick:Be[14]||(Be[14]=Bt=>lt(pe.value))},{default:Ie(()=>[ot(R(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),ut.value?(x(),Se(Ml,{key:2,ref_key:"sectionMenuRef",ref:Tt,class:"section-menu",style:on(mt.value),onClick:Be[18]||(Be[18]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{onClick:Be[16]||(Be[16]=Bt=>Hn("manual"))},{default:Ie(()=>[w("span",KH,[e.workspaceSortMode==="manual"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),ot(" "+R(C(n)("sidebar.sortManual")),1)]),_:1}),ae(Tn,{onClick:Be[17]||(Be[17]=Bt=>Hn("recent"))},{default:Ie(()=>[w("span",GH,[e.workspaceSortMode==="recent"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),ot(" "+R(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),Pt.value?(x(),Se(Ml,{key:3,ref_key:"backendMenuRef",ref:pn,class:"backend-menu",style:on(bn.value),onClick:Be[19]||(Be[19]=St(()=>{},["stop"]))},{default:Ie(()=>[(x(),E(We,null,rt(r,Bt=>ae(Tn,{key:Bt,onClick:Yt=>Wt(Bt)},{default:Ie(()=>[w("span",YH,[a(Bt)?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",ZH,R(Bt),1),w("span",XH,R(l(Bt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):ue("",!0),d.value?(x(),Se(QP,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:ie,onClose:Be[20]||(Be[20]=Bt=>d.value=!1)},null,8,["sessions","active-id"])):ue("",!0),(x(),Se(_1,{to:"body"},[vt.value?(x(),Se(C(to),{key:0,onClose:Be[21]||(Be[21]=Bt=>vt.value=!1)})):ue("",!0)]))],6))}}),eW=dt(JH,[["__scopeId","data-v-1b04ce05"]]);function tW(e){try{const t=yo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function nW(e,t){try{Eo(e,String(t))}catch{}}function oW(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(NA(s),Math.max(o,Math.round(k))):n}const l=oe(r(tW(t)??n)),a=oe(!1);function c(k){const g=r(k);l.value=g,nW(t,g)}let u=0,d=0,f=null,h=-1;function p(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function y(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,h=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return ho(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:y}}const sW=["aria-label"],iW=Je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),{width:i,dragging:r,onPointerDown:l}=oW({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),et(i,a=>o("update:width",a)),et(r,a=>o("update:dragging",a)),(a,c)=>(x(),E("div",{class:Ue(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,sW))}}),H_=dt(iW,[["__scopeId","data-v-48fd0a6d"]]),rW={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},lW={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},aW={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},cW={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",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",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"},uW={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",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?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},dW={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",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",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",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"},fW={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},hW={title:"Sign in to Kimi Code",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 kimi-code and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},pW={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?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",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"},mW={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} 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"},gW={justNow:"just now"},vW={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",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",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},yW={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},kW={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",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",openDetail:"Open",collapse:"Collapse",expand:"Expand"},bW={panelTitle:"Thinking",close:"Close"},xW={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"},wW={},_W={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",videoNoPreview:"Video file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",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"}},SW={searching:"Searching…",noMatch:"No matches"},CW={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi 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 Kimi 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."}},AW={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},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 tool actions; the agent may still ask questions"},auto:{desc:"Fully autonomous — the agent never asks questions"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},MW={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},EW={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},TW={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"fully autonomous, never asks",permYoloSub:"auto-approve tools, may still ask",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},NW={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},IW={preview:"预览",confirm:"确认",cancel:"取消"},LW={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},$W={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},FW={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},OW={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},BW={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建对话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},RW={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},DW={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},PW={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},HW={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},WW={justNow:"刚刚"},zW={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},UW={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},qW={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},jW={panelTitle:"思考过程",close:"关闭"},VW={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},KW={},GW={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} · 暂不预览",videoNoPreview:"视频文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},YW={searching:"搜索中…",noMatch:"无匹配"},ZW={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},XW={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准工具操作,Agent 仍可能提问"},auto:{desc:"完全自主,Agent 不再提问"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},QW={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},JW={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},ez={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},tz={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},nz={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},oz={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},sz={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",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:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",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",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},iz={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},rz={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",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},lz={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},az={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"},cz={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},uz={en:{common:rW,app:lW,sidebar:aW,workspace:cW,conversation:uW,status:dW,composer:fW,login:hW,providers:pW,model:mW,sessions:gW,approval:vW,question:yW,tasks:kW,thinking:bW,diff:xW,fileTree:wW,filePreview:_W,mention:SW,warnings:CW,commands:AW,tools:MW,layout:EW,mobile:TW,theme:NW,onboarding:nz,settings:sz,header:rz,sideChat:az},zh:{common:IW,app:LW,sidebar:$W,workspace:FW,conversation:OW,status:BW,composer:RW,login:DW,providers:PW,model:HW,sessions:WW,approval:zW,question:UW,tasks:qW,thinking:jW,diff:VW,fileTree:KW,filePreview:GW,mention:YW,warnings:ZW,commands:XW,tools:QW,layout:JW,mobile:ez,theme:tz,onboarding:oz,settings:iz,header:lz,sideChat:cz}},b6=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function dz(){const e=yo(Dt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Rn=nF({legacy:!1,locale:dz(),fallbackLocale:"en",messages:uz});function x6(e){Rn.global.locale.value=e,Eo(Dt.locale,e)}const is=Rn.global.t,fz={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",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},hz={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",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function Ja(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return hz[t]??t}function ec(e){const t=fz[Ja(e)];return t?is(t):e}const pz={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function I1(e){const t=Ja(e);let n=pz[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Dc(n,"sm")}const w6=80;function mz(e,t=w6){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function gz(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function vz(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 rn(e){return typeof e=="string"&&e.length>0?e:void 0}function yl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function yz(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 Sg(e){return rn(e.path)??rn(e.file_path)??rn(e.filePath)??rn(e.filename)}const kz={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function bz(e){const t=rn(e);if(!t)return;const n=kz[t];return n?is(n):t}function xz(e){const t=yl(e.value),n=rn(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return is("tools.goal.turns",{value:t});case"tokens":return is("tools.goal.tokens",{value:t});case"milliseconds":return is("tools.goal.milliseconds",{value:t});case"seconds":return is("tools.goal.seconds",{value:t});case"minutes":return is("tools.goal.minutes",{value:t});case"hours":return is("tools.goal.hours",{value:t});default:return is("tools.goal.budget",{value:t,unit:n})}}const wz=64;function pf(e,t,n=!1){const o=(s,i=w6)=>n?s.trim():mz(s,i);try{const s=vz(t);if(!n&&gz(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Ja(e)){case"read":{const r=Sg(s);if(!r)return i();const l=yl(s.offset)??yl(s.line_start)??yl(s.start_line),a=yl(s.limit)??yl(s.length),c=yl(s.line_end)??yl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=Sg(s);return r?o(`${r} ${is("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=Sg(s);return r?o(r):i()}case"bash":{const r=rn(s.command)??rn(s.cmd)??rn(s.script);return r?o(r,wz):i()}case"grep":case"search":{const r=rn(s.pattern)??rn(s.query)??rn(s.regex),l=rn(s.path)??rn(s.glob)??rn(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=rn(s.pattern)??rn(s.glob)??rn(s.query),l=rn(s.path)??rn(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):rn(s.path)?o(rn(s.path)):i()}case"ls":{const r=rn(s.path)??rn(s.dir)??rn(s.directory)??rn(s.cwd);return r?o(r):i()}case"web_fetch":{const r=rn(s.url)??rn(s.uri);return r?o(yz(r)):i()}case"todo":case"task":{const r=rn(s.description)??rn(s.title)??rn(s.prompt)??rn(s.name)??rn(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(is("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=rn(s.objective),l=rn(s.completionCriterion);return r&&l?o(is("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=xz(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=bz(s.status);return r?o(is("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function _z(e){try{switch(Ja(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return is("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return is("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?is("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const Sz=Je({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=D(()=>n(t.status));return(s,i)=>(x(),E("span",{class:Ue(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),mf=dt(Sz,[["__scopeId","data-v-e36198e5"]]),Cz=["innerHTML"],Az={class:"bh-text"},Mz={class:"a"},Ez={key:0,class:"p"},Tz={class:"rt"},Nz=["aria-label"],Iz={key:0,class:"tm"},Lz=["inert"],$z={class:"bb-pad"},Fz=Je({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=Jt("pinScroll",()=>{}),s=oe(null);function i(){n("toggle");const r=s.value;r&&yt(()=>o(r))}return(r,l)=>(x(),E("div",{class:Ue(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[w("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(x(),E("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,Cz)):ue("",!0),w("span",Az,[w("span",Mz,R(e.name),1),ae(an,{text:e.arg},{default:Ie(()=>[e.arg?(x(),E("span",Ez,R(e.arg),1)):ue("",!0)]),_:1},8,["text"])]),w("span",Tz,[w("span",{class:Ue(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),Se(Ge,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),Se(mf,{key:2,status:"suspended"})):(x(),Se(mf,{key:3,status:"running"}))],10,Nz),jn(r.$slots,"trailing"),e.time?(x(),E("span",Iz,R(e.time),1)):ue("",!0)]),e.expandable?(x(),Se(Ge,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ue("",!0)],512),w("div",{class:Ue(["bb",{open:e.open}]),inert:!e.open},[w("div",$z,[jn(r.$slots,"default")])],10,Lz)],2))}}),L1=dt(Fz,[["__scopeId","data-v-fef8aad2"]]),Oz={key:0,class:"at-type"},Bz={key:1,class:"at-task"},Rz={key:2,class:"bb-code"},Dz=Je({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=D(()=>i(o.tool.arg)),l=D(()=>!!o.tool.output&&o.tool.output.length>0),a=D(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=oe(o.tool.defaultExpanded===!0&&a.value),u=D(()=>o.tool.status),d=D(()=>ec(o.tool.name)),f=D(()=>I1(o.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=Jt("resolveAgentTaskId"),m=D(()=>p?p(o.tool.id)!==void 0:!0);function y(){a.value&&(c.value=!c.value)}return et(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(x(),Se(L1,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:y},{trailing:Ie(()=>[m.value?(x(),E("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=St(v=>s("openAgent",e.tool.id),["stop"]))},R(C(n)("tasks.openDetail")),1)):ue("",!0)]),default:Ie(()=>[r.value.subagentType?(x(),E("div",Oz,R(r.value.subagentType),1)):ue("",!0),r.value.prompt?(x(),E("div",Bz,R(r.value.prompt),1)):ue("",!0),l.value?(x(),E("div",Rz,[(x(!0),E(We,null,rt(e.tool.output??[],(v,b)=>(x(),E("div",{key:b},R(v),1))),128))])):ue("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),Pz=dt(Dz,[["__scopeId","data-v-14ef8750"]]);function Hz(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const Uh={recognized:!1,answers:{},note:""};function Wz(e){const t=e?.[0];if(!t)return Uh;let n;try{n=JSON.parse(t)}catch{return Uh}if(!n||typeof n!="object"||Array.isArray(n))return Uh;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Uh;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function zz(e,t,n){return e[t]??e[`q_${n}`]}const Uz=/^opt_\d+_(\d+)$/;function qz(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const c=Uz.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const jz={key:0,class:"chip"},Vz={key:0,class:"au-dismissed"},Kz={key:1,class:"au-list"},Gz={class:"au-q"},Yz={key:0,class:"au-hdr"},Zz={class:"au-qtext"},Xz={class:"au-opts"},Qz={class:"au-glyph"},Jz={class:"au-label"},eU={key:0,class:"au-desc"},tU={key:0,class:"au-opt sel"},nU={class:"au-glyph"},oU={class:"au-label"},sU={key:1,class:"au-opt sel"},iU={class:"au-label"},rU={key:2,class:"au-raw"},lU=80,aU=Je({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=$t();function o(N,M=lU){const $=N.trim();return $.length>M?$.slice(0,M-1)+"…":$}const s=D(()=>Hz(t.tool.arg)),i=D(()=>Wz(t.tool.output)),r=D(()=>i.value.recognized),l=D(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=D(()=>s.value.map((N,M)=>qz(zz(i.value.answers,N.question,M),N.options))),c=D(()=>Object.keys(i.value.answers).length);function u(N,M){return a.value[N]?.selected.has(M)??!1}function d(N){return a.value[N]?.otherText??""}function f(N){return a.value[N]?.indeterminate??!1}function h(N,M){return N?M?"■":"□":M?"●":"○"}const p=D(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const N=s.value[0]?.question??"",M=o(N);return s.value.length<=1?M:`${M} ${n("tools.ask.more",{count:s.value.length-1})}`}),m=D(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),y=D(()=>!!t.tool.output&&t.tool.output.length>0),k=D(()=>r.value&&(s.value.length>0||l.value)||y.value),g=oe(t.tool.defaultExpanded===!0&&k.value),v=D(()=>t.tool.status),b=D(()=>ec(t.tool.name)),A=D(()=>I1(t.tool.name));function I(){k.value&&(g.value=!g.value)}return et(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),(N,M)=>(x(),Se(L1,{status:v.value,icon:A.value,name:b.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:I},{trailing:Ie(()=>[m.value?(x(),E("span",jz,R(m.value),1)):ue("",!0)]),default:Ie(()=>[l.value?(x(),E("div",Vz,R(i.value.note),1)):r.value?(x(),E("div",Kz,[(x(!0),E(We,null,rt(s.value,($,T)=>(x(),E("div",{key:T,class:"au-block"},[w("div",Gz,[$.header?(x(),E("span",Yz,R($.header),1)):ue("",!0),w("span",Zz,R($.question),1)]),w("div",Xz,[(x(!0),E(We,null,rt($.options,(F,S)=>(x(),E("div",{key:S,class:Ue(["au-opt",{sel:u(T,S)}])},[w("span",Qz,R(h($.multiSelect,u(T,S))),1),w("span",Jz,R(F.label),1),F.description?(x(),E("span",eU,R(F.description),1)):ue("",!0)],2))),128)),d(T)?(x(),E("div",tU,[w("span",nU,R(h($.multiSelect,!0)),1),w("span",oU,R(d(T)),1)])):ue("",!0),f(T)?(x(),E("div",sU,[M[0]||(M[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",iU,R(C(n)("tools.ask.answered")),1)])):ue("",!0)])]))),128))])):(x(),E("div",rU,[(x(!0),E(We,null,rt(e.tool.output??[],($,T)=>(x(),E("div",{key:T},R($),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),cU=dt(aU,[["__scopeId","data-v-a9a0f259"]]),uU=1e6,W_=5e3;function z_(e){if(e==="")return[];const t=e.split(`
68
- `);return t.at(-1)===""&&t.pop(),t}function dU(e,t){const n=z_(e),o=z_(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>W_||i>W_||(s+1)*(i+1)>uU)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function fU(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function _6(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 S6(e){const t=Ja(e.name);if(t!=="edit"&&t!=="write")return null;const n=_6(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:dU(o,s)}return null}function hU(e){const t=_6(e);return t&&typeof t.path=="string"?t.path:void 0}function pU(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const mU={key:0,class:"bb-empty"},U_=50,gU=Je({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),o=D(()=>n.value.length>U_),s={"--tool-output-visible-lines":String(U_)};return(i,r)=>(x(),E("div",{class:Ue(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(x(),E("div",mU,R(e.emptyText),1)):ue("",!0),(x(!0),E(We,null,rt(n.value,(l,a)=>(x(),E("div",{key:a},R(l),1))),128))],2))}}),C6=dt(gU,[["__scopeId","data-v-262bbea0"]]),vU={key:0,class:"chip"},yU={key:0,class:"bb-summary"},kU=Je({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.tool.status),i=D(()=>ec(n.tool.name)),r=D(()=>I1(n.tool.name)),l=D(()=>pf(n.tool.name,n.tool.arg)),a=D(()=>pf(n.tool.name,n.tool.arg,!0)),c=D(()=>S6(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:y,removed:k}=fU(m);if(y||k)return`+${y} −${k}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=oe(!1),h=D(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,y)=>(x(),Se(L1,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ie(()=>[u.value?(x(),E("span",vU,R(u.value),1)):ue("",!0)]),default:Ie(()=>[a.value?(x(),E("div",yU,R(a.value),1)):ue("",!0),ae(C6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),bU=dt(kU,[["__scopeId","data-v-74e1da99"]]),xU={key:0,class:"chip"},wU={key:0,class:"bb-summary"},_U=Je({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=D(()=>!!t.tool.output&&t.tool.output.length>0),s=D(()=>o.value||n.value),i=oe(t.tool.defaultExpanded===!0&&s.value),r=D(()=>t.tool.status),l=D(()=>ec(t.tool.name)),a=D(()=>I1(t.tool.name)),c=D(()=>pf(t.tool.name,t.tool.arg)),u=D(()=>pf(t.tool.name,t.tool.arg,!0)),d=D(()=>_z({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return et(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(x(),Se(L1,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ie(()=>[d.value?(x(),E("span",xU,R(d.value),1)):ue("",!0)]),default:Ie(()=>[u.value?(x(),E("div",wU,R(u.value),1)):ue("",!0),ae(C6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),SU=dt(_U,[["__scopeId","data-v-aa4edcb0"]]),CU={class:"media-title"},AU=["src","alt"],MU=["src"],EU=["src"],TU=Je({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(x(),E("div",{key:0,class:Ue(["media-tool",{mob:e.mobile}])},[ae(an,{text:s.value.path||l.value},{default:Ie(()=>[w("div",CU,R(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(x(),Se(an,{key:0,text:s.value.path||l.value},{default:Ie(()=>[w("button",{type:"button",class:"media-image-button",onClick:a},[w("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,AU)])]),_:1},8,["text"])):s.value.kind==="video"?(x(),E("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,MU)):(x(),E("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,EU))],2)):ue("",!0)}}),NU=dt(TU,[["__scopeId","data-v-c05c114a"]]),IU=/<summary>([\s\S]*?)<\/summary>/,LU=/<resume_hint>([\s\S]*?)<\/resume_hint>/,Cg=/<subagent\b([^>]*)>|<\/subagent>/g,$U="</subagent>",q_=/(completed|failed|aborted):\s*(\d+)/g,j_=/([a-z_]+)="([^"]*)"/g;function FU(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function OU(e){const t={};j_.lastIndex=0;let n;for(;(n=j_.exec(e))!==null;)t[n[1]]=FU(n[2]);return t}function BU(e){const t={completed:0,failed:0,aborted:0};q_.lastIndex=0;let n;for(;(n=q_.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function RU(e,t){const n=OU(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function DU(e){const t=[],n=[];Cg.lastIndex=0;let o;for(;(o=Cg.exec(e))!==null;)if(o[0]===$U){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(RU(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:Cg.lastIndex}):n.push(null);return t}function PU(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
69
- `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=IU.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=BU(n),r=LU.exec(t)?.[1]?.trim(),l=DU(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function V_(e){return e?e.split(`
70
- `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function HU(e){return e.suspendedReason||V_(e.text)||V_(e.outputLines?.join(`
71
- `))||e.summary||""}function WU(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
72
- `):e.summary??""}function zU(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function K_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
73
- `)[0]??"",phase:zU(e.outcome),body:e.body}}function UU(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function qU(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:HU(s),phase:s.phase,body:WU(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>UU(i,s))).map((s,i)=>K_(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>K_(s,i))}const jU=["aria-expanded"],VU={class:"title"},KU={key:0,class:"meta"},GU={key:1,class:"sum-txt"},YU={class:"rt"},ZU={class:"status"},XU={key:0,class:"chip"},QU={key:1,class:"tm"},JU={class:"body"},eq={class:"overview"},tq={class:"overview-line"},nq={class:"big"},oq={key:0,class:"lbl"},sq={key:1,class:"lbl"},iq={key:2,class:"lbl"},rq={key:0,class:"seg","aria-hidden":"true"},lq={key:1,class:"legend"},aq=["aria-expanded","onClick"],cq={class:"mname"},uq={class:"mact"},dq={class:"mphase"},fq={key:1,class:"fallback-output"},hq={key:2,class:"waiting"},pq=Je({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=$t(),n=e;function o(T){if(!T)return{};try{const F=JSON.parse(T),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Jt("resolveSwarmMembers"),i=D(()=>o(n.tool.arg)),r=D(()=>ec(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>s?.(n.tool.id)??[]),c=D(()=>PU(n.tool.output)),u=D(()=>n.tool.status),d=D(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=D(()=>qU(a.value,c.value)),h=D(()=>{const T={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)T[F.phase]++;return T}),p=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>h.value.completed+h.value.failed),y=D(()=>h.value.working+h.value.suspended+h.value.queued),k=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=D(()=>k.map(({phase:T,cls:F})=>({phase:T,count:h.value[T],cls:F})).filter(T=>T.count>0)),v=oe(u.value==="running"||y.value>0);function b(){v.value=!v.value}const A=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
74
- `).trim()),I=oe(new Set);function N(T){const F=new Set(I.value);F.has(T)?F.delete(T):F.add(T),I.value=F}function M(T){return I.value.has(T)}function $(T){return t(`tools.swarm.phase${T[0].toUpperCase()}${T.slice(1)}`)}return(T,F)=>(x(),E("div",{class:Ue(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[w("button",{class:"head",type:"button","aria-expanded":v.value,onClick:b},[ae(Ge,{class:"ic",name:"git-pull-request",size:"sm"}),w("span",VU,R(r.value),1),l.value?(x(),E("span",KU,"·")):ue("",!0),l.value?(x(),E("span",GU,R(l.value),1)):ue("",!0),w("span",YU,[w("span",ZU,[d.value==="ok"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),Se(Ge,{key:1,name:"close",size:"sm"})):(x(),Se(mf,{key:2,status:"running"}))]),m.value>0||p.value>0?(x(),E("span",XU,R(m.value)+" / "+R(p.value),1)):ue("",!0),e.tool.timing?(x(),E("span",QU,R(e.tool.timing),1)):ue("",!0)]),ae(Ge,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,jU),qn(w("div",JU,[w("div",eq,[w("div",tq,[w("span",nq,R(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),E("span",oq,R(C(t)("tools.swarm.runningSub",{count:y.value})),1)):c.value?(x(),E("span",sq,R(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),E("span",iq,R(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(x(),E("div",rq,[(x(!0),E(We,null,rt(g.value,S=>(x(),E("span",{key:S.phase,class:Ue(S.cls),style:on({flex:S.count})},null,6))),128))])):ue("",!0),g.value.length>1?(x(),E("div",lq,[(x(!0),E(We,null,rt(g.value,S=>(x(),E("span",{key:S.phase},[w("i",{class:Ue(["lg-dot",S.cls])},null,2),ot(R($(S.phase))+" "+R(S.count),1)]))),128))])):ue("",!0)]),f.value.length>0?(x(!0),E(We,{key:0},rt(f.value,S=>(x(),E("div",{key:S.id,class:Ue(["member",[`phase-${S.phase}`,{open:M(S.id)}]])},[w("button",{class:"member-head",type:"button","aria-expanded":M(S.id),onClick:B=>N(S.id)},[ae(mf,{class:"row-dot",status:S.phase},null,8,["status"]),ae(an,{text:S.name},{default:Ie(()=>[w("span",cq,R(S.name),1)]),_:2},1032,["text"]),S.activity?(x(),Se(an,{key:0,text:S.activity},{default:Ie(()=>[w("span",uq,R(S.activity),1)]),_:2},1032,["text"])):ue("",!0),w("span",dq,R($(S.phase)),1),ae(Ge,{class:"mcar",name:M(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,aq),qn(w("div",{class:"member-body"},R(S.body),513),[[xi,M(S.id)]])],2))),128)):A.value?(x(),E("div",fq,R(A.value),1)):(x(),E("div",hq,R(C(t)("tools.swarm.waiting")),1))],512),[[xi,v.value]])],2))}}),mq=dt(pq,[["__scopeId","data-v-4b58e128"]]);function gq(e){if(e.media&&e.status==="ok")return NU;const t=Ja(e.name);return t==="edit"||t==="write"||t==="multi_edit"?bU:t==="task"?Pz:t==="agentswarm"?mq:t==="askuserquestion"?cU:SU}const A6=Je({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>gq(n.tool));return(i,r)=>(x(),Se(Ho(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function pr(e){if(e>=1024*1024)return`${G_(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):G_(t)}k`}return String(e)}function G_(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function vq(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function $1(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function yq(e){return!(e.tool.status==="ok"&&e.tool.media)}function kq(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function bq(e){const t=$1(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(yq(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function xq(e){return $1(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
75
-
76
- `)}function wq(e){const t=[];for(const n of $1(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
77
- > ${n.thinking.split(`
78
- `).join(`
79
- > `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
80
- `);t.push(`\`\`\`
81
- [${n.tool.name}]
82
- ${o}
83
- \`\`\``)}return t.join(`
84
-
85
- `)}function M6(e){return e.tool.id||`tool-${e.sourceIndex}`}function _q(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?M6({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const Sq=["aria-expanded"],Cq={class:"tg-title"},Aq={class:"tg-meta"},Mq=["inert"],Eq={class:"tool-group-body-inner"},Tq=Je({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=oe(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=$t(),a=D(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Jt("pinScroll",()=>{}),d=oe(null);function f(){c();const h=d.value;h&&yt(()=>u(h))}return(h,p)=>(x(),E("div",{class:Ue(["tool-group",{open:s.value}])},[w("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[ae(mf,{status:r.value},null,8,["status"]),ae(Ge,{class:"tg-ic",name:"list",size:"sm"}),w("span",Cq,R(C(l)("tools.group.title",i.value)),1),w("span",Aq,"· "+R(a.value),1),ae(Ge,{class:"tg-car",name:"chevron-right",size:"sm"})],8,Sq),w("div",{class:Ue(["tool-group-body",{open:s.value}]),inert:!s.value},[w("div",Eq,[(x(!0),E(We,null,rt(e.tools,(m,y)=>(x(),Se(A6,{key:C(M6)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(kq)(y,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=k=>o("openMedia",k)),onOpenFile:p[1]||(p[1]=k=>o("openFile",k)),onOpenToolDiff:p[2]||(p[2]=k=>o("openToolDiff",k)),onOpenAgent:p[3]||(p[3]=k=>o("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,Mq)],2))}}),Nq=dt(Tq,[["__scopeId","data-v-37eb334f"]]);var Iq=Object.create,s2=Object.defineProperty,Lq=Object.getOwnPropertyDescriptor,E6=Object.getOwnPropertyNames,$q=Object.getPrototypeOf,Fq=Object.prototype.hasOwnProperty,T6=(e,t)=>function(){return t||(0,e[E6(e)[0]])((t={exports:{}}).exports,t),t.exports},N6=e=>{let t={};for(var n in e)s2(t,n,{get:e[n],enumerable:!0});return t},Oq=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=E6(t),i=0,r=s.length,l;i<r;i++)l=s[i],!Fq.call(e,l)&&l!==n&&s2(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=Lq(t,l))||o.enumerable});return e},I6=(e,t,n)=>(n=e!=null?Iq($q(e)):{},Oq(s2(n,"default",{value:e,enumerable:!0}),e));function Bq(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function Rq(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Dq(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);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 Pq(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
86
- `:`<hr class="footnotes-sep">
87
- `)+`<section class="footnotes">
88
- <ol class="footnotes-list">
89
- `}function Hq(){return`</ol>
90
- </section>
91
- `}function Wq(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function zq(){return`</li>
92
- `}function Uq(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function qq(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Dq,e.renderer.rules.footnote_block_open=Pq,e.renderer.rules.footnote_block_close=Hq,e.renderer.rules.footnote_open=Wq,e.renderer.rules.footnote_close=zq,e.renderer.rules.footnote_anchor=Uq,e.renderer.rules.footnote_caption=Rq,e.renderer.rules.footnote_anchor_name=Bq;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const y=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,b=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let I=A;for(;h<f;){const M=l.src.charCodeAt(h);if(n(M))M===9?I+=4-I%4:I++;else break;h++}l.tShift[a]=h-b,l.sCount[a]=I-A,l.bMarks[a]=b,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=v,l.blkIndent-=4,l.tShift[a]=k,l.sCount[a]=g,l.bMarks[a]=y;const N=new l.Token("footnote_reference_close","",-1);return N.level=--l.level,l.tokens.push(N),!0}function s(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,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+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 f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const y=new l.Token("footnote_open","",1);if(y.meta={id:p,label:h[p].label},l.tokens.push(y),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const b=new l.Token("inline","",0);b.children=h[p].tokens,b.content=h[p].content,a.push(b);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const b=new l.Token("footnote_anchor","",0);b.meta={id:p,subId:v,label:h[p].label},l.tokens.push(b)}k&&l.tokens.push(k),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",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function jq(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function Vq(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const Kq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Gq(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(Kq,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function Yq(e){e.inline.ruler.after("emphasis","sub",Gq)}const Zq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Xq(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(Zq,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function Qq(e){e.inline.ruler.after("emphasis","sup",Xq)}var Jq=T6({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,b=2;b<g.length;b++)s(g,b)&&(i(g[b],v,y,k.Token),v+=1,n(g[b-2],"class",y.liClass),n(g[o(g,b-2)],"class",y.ulClass))})};function n(m,y,k){var g=m.attrIndex(y),v=[y,k];g<0?m.attrPush(v):m.attrs[g]=v}function o(m,y){for(var k=m[y].level-1,g=y-1;g>=0;g--)if(m[g].level===k)return g;return-1}function s(m,y){return d(m[y])&&f(m[y-1])&&h(m[y-2])&&p(m[y])}function i(m,y,k,g){var v=k.idPrefix+y;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,y,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,y){var k=new y("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,y){var k=new y("checkbox_open","div",0);return k.attrs=[["class",m.divClass]],k}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),ej=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))),tj=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),Ag;const nj=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]]),oj=(Ag=String.fromCodePoint)!==null&&Ag!==void 0?Ag: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 sj(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=nj.get(e))!==null&&t!==void 0?t:e}var Wo;(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"})(Wo||(Wo={}));const ij=32;var El;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(El||(El={}));function xy(e){return e>=Wo.ZERO&&e<=Wo.NINE}function rj(e){return e>=Wo.UPPER_A&&e<=Wo.UPPER_F||e>=Wo.LOWER_A&&e<=Wo.LOWER_F}function lj(e){return e>=Wo.UPPER_A&&e<=Wo.UPPER_Z||e>=Wo.LOWER_A&&e<=Wo.LOWER_Z||xy(e)}function aj(e){return e===Wo.EQUALS||lj(e)}var Po;(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"})(Po||(Po={}));var Sl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Sl||(Sl={}));var cj=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Po.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Sl.Strict}startEntity(e){this.decodeMode=e,this.state=Po.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Po.EntityStart:return e.charCodeAt(t)===Wo.NUM?(this.state=Po.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Po.NamedEntity,this.stateNamedEntity(e,t));case Po.NumericStart:return this.stateNumericStart(e,t);case Po.NumericDecimal:return this.stateNumericDecimal(e,t);case Po.NumericHex:return this.stateNumericHex(e,t);case Po.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|ij)===Wo.LOWER_X?(this.state=Po.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Po.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(xy(o)||rj(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(xy(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,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===Wo.SEMI)this.consumed+=1;else if(this.decodeMode===Sl.Strict)return 0;return this.emitCodePoint(sj(this.result),this.consumed),this.errors&&(e!==Wo.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&El.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=uj(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Sl.Attribute&&(s===0||aj(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&El.VALUE_LENGTH)>>14,s!==0){if(i===Wo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Sl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&El.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~El.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Po.NamedEntity:return this.result!==0&&(this.decodeMode!==Sl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Po.NumericDecimal:return this.emitNumericEntity(0,2);case Po.NumericHex:return this.emitNumericEntity(0,3);case Po.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Po.EntityStart:return 0}}};function L6(e){let t="";const n=new cj(e,o=>t+=oj(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function uj(e,t,n,o){const s=(t&El.BRANCH_LENGTH)>>7,i=t&El.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const dj=L6(ej);L6(tj);function i2(e,t=Sl.Legacy){return dj(e,t)}var fj=I6(Jq());const Y_={};function hj(e){let t=Y_[e];if(t)return t;t=Y_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function F1(e,t){typeof t!="string"&&(t=F1.defaultChars);const n=hj(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.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?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.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?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}F1.defaultChars=";/?:@&=+$,#";F1.componentChars="";var wy=F1;const Z_={};function pj(e){let t=Z_[e];if(t)return t;t=Z_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):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 O1(e,t,n){typeof t!="string"&&(n=t,t=O1.defaultChars),typeof n>"u"&&(n=!0);const o=pj(t);let s="";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))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[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){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}O1.defaultChars=";/?:@&=+$,-_.!~*'()#";O1.componentChars="-_.!~*'()";var $6=O1;function r2(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 mm(){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 mj=/^([a-z0-9.+-]+:)/i,gj=/:[0-9]*$/,vj=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,yj=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
93
- `," "]),kj=["'"].concat(yj),X_=["%","/","?",";","#"].concat(kj),Q_=["/","?","#"],bj=255,J_=/^[+a-z0-9A-Z_-]{0,63}$/,xj=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,eS={javascript:!0,"javascript:":!0},tS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wj(e,t){if(e&&e instanceof mm)return e;const n=new mm;return n.parse(e,t),n}mm.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=vj.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=mj.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&eS[r])&&(i=i.substr(2),this.slashes=!0)),!eS[r]&&(s||r&&!tS[r])){let c=-1;for(let p=0;p<Q_.length;p++)o=i.indexOf(Q_[p]),o!==-1&&(c===-1||o<c)&&(c=o);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 p=0;p<X_.length;p++)o=i.indexOf(X_[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,y=p.length;m<y;m++){const k=p[m];if(k&&!k.match(J_)){let g="";for(let v=0,b=k.length;v<b;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(J_)){const v=p.slice(0,m),b=p.slice(m+1),A=k.match(xj);A&&(v.push(A[1]),b.unshift(A[2])),b.length&&(i=b.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>bj&&(this.hostname=""),h&&(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),tS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};mm.prototype.parseHost=function(e){let t=gj.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 l2=wj,F6=N6({decode:()=>wy,encode:()=>$6,format:()=>r2,parse:()=>l2}),O6=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,B6=/[\0-\x1F\x7F-\x9F]/,_j=/[\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]/,R6=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Sj=/[\$\+<->\^`\|~\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]/,D6=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Cj=N6({Any:()=>O6,Cc:()=>B6,Cf:()=>_j,P:()=>R6,S:()=>Sj,Z:()=>D6}),Aj=Object.defineProperty,P6=e=>{let t={};for(var n in e)Aj(t,n,{get:e[n],enumerable:!0});return t},$o=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,o=t.length;n<o;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),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}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}`}},Mj=P6({arrayReplaceAt:()=>Fj,assign:()=>Lj,countLines:()=>uo,escapeHtml:()=>Uj,escapeRE:()=>jj,fromCodePoint:()=>vf,has:()=>Ij,isMdAsciiPunct:()=>ym,isPunctChar:()=>vm,isPunctCode:()=>_y,isSpace:()=>$j,isString:()=>Tj,isValidEntityCode:()=>R1,isWhiteSpace:()=>gf,lib:()=>Vj,mdurl:()=>F6,normalizeReference:()=>B1,ucmicro:()=>gm,unescapeAll:()=>yf,unescapeMd:()=>Dj});const gm=Cj;function Ej(e){return Object.prototype.toString.call(e)}function Tj(e){return Ej(e)==="[object String]"}const Nj=Object.prototype.hasOwnProperty;function Ij(e,t){return Nj.call(e,t)}function Lj(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function $j(e){return e===9||e===32}function gf(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 vm(e){return gm.P.test(e)||gm.S.test(e)}const nS=new Map;function _y(e){if(ym(e))return!0;if(e>=0&&e<128)return!1;const t=nS.get(e);if(t!==void 0)return t;const n=vm(String.fromCharCode(e));return nS.set(e,n),n}function ym(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 B1(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Fj(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function R1(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 vf(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 H6=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Oj=new RegExp(`${H6.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Bj=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Rj(e,t){if(t.charCodeAt(0)===35&&Bj.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return R1(o)?vf(o):e}const n=i2(e);return n!==e?n:e}function Dj(e){return e.includes("\\")?e.replace(H6,"$1"):e}function yf(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Oj,(t,n,o)=>n||Rj(t,o))}const Pj=/[&<>"]/,Hj=/[&<>"]/g,Wj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function zj(e){return Wj[e]}function Uj(e){return Pj.test(e)?e.replace(Hj,zj):e}const qj=/[.?*+^$[\]\\(){}|-]/g;function jj(e){return e.replace(qj,"\\$&")}const Vj={mdurl:F6,ucmicro:gm};function uo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
94
- `,n+1))!==-1;)t++;return t}const Kj=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Gj=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Yj=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,a2=["references","footnotes","abbreviations","abbr","abbrs"],c2=Symbol.for("markdown-it-ts.global-state"),u2=Object.prototype.hasOwnProperty;function oS(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Wi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function $l(e){if(Array.isArray(e))return e.map(t=>$l(t));if(Wi(e)){const t={};for(const n of Object.keys(e))t[n]=$l(e[n]);return t}return e}function km(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Wi(e)?Object.keys(e):[]}function Sy(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(!Sy(e[n],t[n]))return!1;return!0}if(Wi(e)||Wi(t)){if(!Wi(e)||!Wi(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!u2.call(t,s)||!Sy(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function W6(e,t){if(Array.isArray(e))return e[Number(t)];if(Wi(e))return e[t]}function Zj(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=$l(t[n]);return e}if(Wi(e)&&Wi(t)){for(const n of Object.keys(e))u2.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=$l(t[n]);return e}return $l(t)}function Xj(e,t,n){const o=n.ownedKeys??[],s=e[t];if(Wi(s)||Array.isArray(s)){const i=new Set(km(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=$l(W6(n.value,r)):delete s[r];!n.existed&&km(s).length===0&&delete e[t];return}n.existed?e[t]=$l(n.value):delete e[t]}function d2(e){const t=e[c2];return oS(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&oS(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function Qj(e,t){Object.defineProperty(e,c2,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ls(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Kj.test(e)?"footnote-definition":Gj.test(e)?"abbreviation-definition":Yj.test(e)?"reference-definition":null}function Pf(e){return d2(e)?.reason??null}function ru(e,t,n){if(Pf(e)&&Zr(e),!t)return n();f2(e,t);try{const o=n();return h2(e),o}catch(o){throw Zr(e),o}}function f2(e,t){try{Zr(e);const n={};for(const o of a2)n[o]=u2.call(e,o)?{existed:!0,value:$l(e[o])}:{existed:!1};Qj(e,{reason:t,snapshot:n})}catch{}}function h2(e){const t=d2(e);if(t)for(const n of a2){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!Wi(s)&&!Array.isArray(s))continue;const i=new Set(km(o.existed?o.value:void 0));o.ownedKeys=km(s).filter(r=>i.has(r)?!Sy(s[r],W6(o.value,r)):!0)}}function Zr(e){const t=d2(e);if(t){for(const n of a2){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){Xj(e,n,o);continue}o.existed?e[n]=Zj(e[n],o.value):delete e[n]}delete e[c2]}}function Mg(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const Cy=Symbol.for("markdown-it-ts.diagnostics");function Hf(e,t){if(e)try{const n=e[Cy];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[Cy]=o,o}catch{return}}function Lr(e){return Hf(e,!1)}function Jj(e){if(e)try{const t=e[Cy];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function fs(e){Jj(e)}function ld(e,t){const n=Hf(e,!0);n&&(n.stockFast=t)}function wo(e,t){const n=Hf(e,!0);n&&(n.strategy=t)}function Eg(e,t){const n=Hf(e,!0);n&&(n.chunk=t)}function z6(e,t){const n=Hf(e,!0);n&&(n.unbounded=t)}function eV(e){const t={};e=e||{},t.src_Any=O6.source,t.src_Cc=B6.source,t.src_Z=D6.source,t.src_P=R6.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}|[@/\\[\\]()]).){1,50}@)?`,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}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${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_]{0,63}',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 Ay(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function D1(e){return Object.prototype.toString.call(e)}function tV(e){return D1(e)==="[object String]"}function nV(e){return D1(e)==="[object Object]"}function oV(e){return D1(e)==="[object RegExp]"}function sS(e){return D1(e)==="[object Function]"}function sV(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const U6={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function iV(e){return Object.keys(e||{}).reduce(function(t,n){return t||U6.hasOwnProperty(n)},!1)}const rV={"http:":{validate:function(e,t,n){const o=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(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=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(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=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(o)?o.match(n.re.mailto)[0].length:0}}},lV="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]",aV="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function cV(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function iS(){return function(e,t){t.normalize(e)}}function bm(e){const t=e.re=eV(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(lV),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];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,nV(a)){oV(a.validate)?c.validate=cV(a.validate):sS(a.validate)?c.validate=a.validate:i(l,a),sS(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=iS();return}if(tV(a)){s.push(l);return}i(l,a)}),s.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:iS()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(sV).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")}function q6(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ri(e,t){if(!(this instanceof ri))return new ri(e,t);t||iV(e)&&(t=e,e={}),this.__opts__=Ay({},U6,t),this.__schemas__=Ay({},rV,e),this.__compiled__={},this.__tlds__=aV,this.__tlds_replaced__=!1,this.re={},bm(this)}ri.prototype.add=function(t,n){return this.__schemas__[t]=n,bm(this),this};ri.prototype.set=function(t){return this.__opts__=Ay(this.__opts__,t),this};ri.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ri.prototype.pretest=function(t){return this.re.pretest.test(t)};ri.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ri.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new q6(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};ri.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new q6(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ri.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),bm(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,bm(this),this)};ri.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url=`mailto:${t.url}`)};ri.prototype.onCompile=function(){};var j6=ri,uV=T6({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,y=Math.floor,k=String.fromCharCode;function g(z){throw new RangeError(p[z])}function v(z,L){const O=[];let U=z.length;for(;U--;)O[U]=L(z[U]);return O}function b(z,L){const O=z.split("@");let U="";O.length>1&&(U=O[0]+"@",z=O[1]),z=z.replace(h,".");const Z=v(z.split("."),L).join(".");return U+Z}function A(z){const L=[];let O=0;const U=z.length;for(;O<U;){const Z=z.charCodeAt(O++);if(Z>=55296&&Z<=56319&&O<U){const ie=z.charCodeAt(O++);(ie&64512)==56320?L.push(((Z&1023)<<10)+(ie&1023)+65536):(L.push(Z),O--)}else L.push(Z)}return L}const I=z=>String.fromCodePoint(...z),N=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},M=function(z,L){return z+22+75*(z<26)-((L!=0)<<5)},$=function(z,L,O){let U=0;for(z=O?y(z/700):z>>1,z+=y(z/L);z>m*26>>1;U+=36)z=y(z/m);return y(U+(m+1)*z/(z+38))},T=function(z){const L=[],O=z.length;let U=0,Z=128,ie=72,q=z.lastIndexOf("-");q<0&&(q=0);for(let ee=0;ee<q;++ee)z.charCodeAt(ee)>=128&&g("not-basic"),L.push(z.charCodeAt(ee));for(let ee=q>0?q+1:0;ee<O;){const fe=U;for(let j=1,K=36;;K+=36){ee>=O&&g("invalid-input");const ve=N(z.charCodeAt(ee++));ve>=36&&g("invalid-input"),ve>y((2147483647-U)/j)&&g("overflow"),U+=ve*j;const he=K<=ie?1:K>=ie+26?26:K-ie;if(ve<he)break;const Ae=36-he;j>y(2147483647/Ae)&&g("overflow"),j*=Ae}const ne=L.length+1;ie=$(U-fe,ne,fe==0),y(U/ne)>2147483647-Z&&g("overflow"),Z+=y(U/ne),U%=ne,L.splice(U++,0,Z)}return String.fromCodePoint(...L)},F=function(z){const L=[];z=A(z);const O=z.length;let U=128,Z=0,ie=72;for(const fe of z)fe<128&&L.push(k(fe));const q=L.length;let ee=q;for(q&&L.push("-");ee<O;){let fe=2147483647;for(const j of z)j>=U&&j<fe&&(fe=j);const ne=ee+1;fe-U>y((2147483647-Z)/ne)&&g("overflow"),Z+=(fe-U)*ne,U=fe;for(const j of z)if(j<U&&++Z>2147483647&&g("overflow"),j===U){let K=Z;for(let ve=36;;ve+=36){const he=ve<=ie?1:ve>=ie+26?26:ve-ie;if(K<he)break;const Ae=K-he,re=36-he;L.push(k(M(he+Ae%re,0))),K=y(Ae/re)}L.push(k(M(K,0))),ie=$(Z,ne,ee===q),Z=0,++ee}++Z,++U}return L.join("")},W={version:"2.3.1",ucs2:{decode:A,encode:I},decode:T,encode:F,toASCII:function(z){return b(z,function(L){return f.test(L)?"xn--"+F(L):L})},toUnicode:function(z){return b(z,function(L){return d.test(L)?T(L.slice(4).toLowerCase()):L})}};t.exports=W})}),V6=I6(uV());function p2(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=yf(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=yf(e.slice(t,s)),i.pos=s,i.ok=!0),i}var K6=p2;const Ap=-2;function dV(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return Ap}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Ap;if(r===91){s++,i++;continue}i++}return-1}function m2(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=dV(l,t,a,n);if(f!==Ap)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var xm=m2;function g2(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.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(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=yf(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=yf(e.slice(t,i)),r}var G6=g2;function P1(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 v2(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function fV(e,t,n){const o=P1(e,t),s=[t,n];o<0?v2(e,s):e.attrs[o]=s}function hV(e,t){const n=P1(e,t);return n>=0?e.attrs[n][1]:null}function pV(e,t,n){const o=P1(e,t);o<0?v2(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var mV=P6({attrGet:()=>hV,attrIndex:()=>P1,attrJoin:()=>pV,attrPush:()=>v2,attrSet:()=>fV,parseLinkDestination:()=>p2,parseLinkLabel:()=>m2,parseLinkTitle:()=>g2});function gV(e){return e.includes("\r")||e.includes("\0")}function Y6(e){return typeof e=="string"?e:e.toString()}function vV(e){if(e.inlineMode){const t=new $o("inline","",0);t.content=Y6(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 yV=/^([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])?)*)$/,kV=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function bV(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(kV.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(yV.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 Z6=bV;function xV(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,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 f=n.slice(o,c);f.includes(`
95
- `)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var X6=xV;function rS(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=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=o-i[o]-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 f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function wV(e){const t=e.tokens_meta,n=e.tokens_meta.length;rS(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&rS(t[o].delimiters)}var _V=wV;const Q6="*",J6="_";function SV(e,t){if(t)return!1;const n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;const o=e.scanDelims(e.pos,n===42);if(!o||o.length===0)return!1;const s=n===42?Q6:J6,i=o.length,r=o.can_open,l=o.can_close,a=e.tokens,c=e.delimiters;for(let u=0;u<i;u++){const d=e.push("text","",0);d.content=s,c.push({marker:n,length:i,token:a.length-1,end:-1,open:r,close:l})}return e.pos+=i,!0}function lS(e,t){const n=t.length,o=e.tokens;for(let s=n-1;s>=0;s--){const i=t[s],r=i.marker;if(r!==95&&r!==42||i.end===-1)continue;const l=t[i.end],a=i.token,c=l.token,u=s>0&&t[s-1].end===i.end+1&&t[s-1].marker===r&&t[s-1].token===a-1&&t[i.end+1].token===c+1,d=r===42?Q6:J6,f=o[a];u?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=o[c];u?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),u&&(o[t[s-1].token].content="",o[t[i.end+1].token].content="",s--)}}function CV(e){const t=e.tokens_meta,n=e.tokens_meta.length;lS(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&lS(e,t[o].delimiters)}const My={tokenize:SV,postProcess:CV};function e5(e){return i2(e)}function y2(e){return e>=48&&e<=57}function AV(e){const t=e|32;return y2(e)||t>=97&&t<=102}function t5(e){const t=e|32;return t>=97&&t<=122}function MV(e){return t5(e)||y2(e)}function EV(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?AV(l):y2(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function TV(e,t,n){let o=t+1;if(o>=n||!t5(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&MV(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return e5(s)!==s?s:null}function NV(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=EV(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=R1(i)?vf(i):vf(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=TV(e.src,n,o);if(s){const i=e5(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var n5=NV;const o5=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Ey=new Array(128),s5=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Ey[e]=`\\${t}`,s5[e]=o5[e]?t:Ey[e]}function aS(e,t,n){e.pending&&e.pushPending();const o=new $o("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function IV(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(aS(e,s5[i],Ey[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return aS(e,i<256&&o5[i]?r:l,l),e.pos=n+1,!0}var i5=IV;function LV(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var $V=LV;const r5=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,l5="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",FV=new RegExp(`^(?:${r5}|${l5}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),OV=new RegExp(`^(?:${r5}|${l5})`);function a5(e){return e===32||e===9||e===10||e===12||e===13}function BV(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||a5(t)}function RV(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(!a5(n))return!1}return!1}function DV(e){const t=e|32;return t>=97&&t<=122}function PV(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!DV(i))return!1;const r=s.slice(o).match(FV);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,BV(l)&&e.linkLevel++,RV(l)&&e.linkLevel--}return e.pos+=l.length,!0}var c5=PV;function HV(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=xm(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=K6(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<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=G6(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=xm(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[B1(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const m=[];e.md.inline.parse(o,e.md,e.env,m);const y=e.push("image","img",0);y.attrs=[["src",u],["alt",""]],y.children=m,y.content=o,a&&y.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var u5=HV;function Tg(e,t,n){for(;t<n;){const o=e.charCodeAt(t);if(o!==32&&o!==10)break;t++}return t}function WV(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;const n=e.src,o=e.pos,s=e.posMax,i=e.pos+1,r=xm(e,e.pos,!0);if(r<0)return!1;let l=r+1,a="",c="",u=!0;if(l<s&&n.charCodeAt(l)===40){l=Tg(n,l+1,s);const d=K6(n,l,s);if(d.ok){const f=e.md.normalizeLink(d.str);e.md.validateLink(f)&&(a=f,l=d.pos,u=!1)}else l<s&&n.charCodeAt(l)===41&&(a="",u=!1);if(!u){if(l=Tg(n,l,s),l<s&&n.charCodeAt(l)!==41){const f=G6(n,l,s);f.ok&&(c=f.str,l=Tg(n,f.pos,s))}l<s&&n.charCodeAt(l)===41?l++:u=!0}}if(u){if(typeof e.env.references>"u")return!1;let d;if(l=r+1,l<s&&n.charCodeAt(l)===91){const h=l+1,p=xm(e,l);p>=0?(d=n.slice(h,p),d||(d=n.slice(i,r)),l=p+1):d=n.slice(i,r)}else d=n.slice(i,r);const f=e.env.references[B1(d)];if(!f)return e.pos=o,!1;a=f.href,c=f.title}if(!t){e.pos=i,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=c?[["href",a],["title",c]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=s,!0}var d5=WV;function f5(e){const t=e|32;return t>=97&&t<=122}function zV(e){return e>=48&&e<=57}function UV(e){return f5(e)||zV(e)||e===43||e===45||e===46}function qV(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&UV(e.charCodeAt(t));)t--;return t++,t>=e.length||!f5(e.charCodeAt(t))?null:e.slice(t)}function jV(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function h5(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=qV(e.pending);if(!s)return!1;const i=jV(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.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,-s.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 f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function VV(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-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<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var p5=VV;function KV(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);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:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function cS(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;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==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.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 GV(e){const t=e.delimiters;cS(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&cS(e,n[o].delimiters)}const Ty={tokenize:KV,postProcess:GV};function uS(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 YV(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||uS(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!uS(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var m5=YV;function k2(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function ZV(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function XV(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 g5(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,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:k2(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function lu(e,t,n,o,s,i){const r=g5(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=XV(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=k2()}function QV(e){const t=g5(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=ZV(s.samples)}return t.completedAt=k2(),t}var dS=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<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(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<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(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,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 o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},v5=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.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.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new $o("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 $o(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 o=new $o(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=gf(l),u=gf(a),d=_y(l),f=_y(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};v5.prototype.Token=$o;const JV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function fS(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return p5(e,t);case 33:return u5(e,t);case 38:return n5(e,t);case 42:case 95:return My.tokenize(e,t);case 58:return e.md.options.linkify&&h5(e,t);case 60:return Z6(e,t)||c5(e,t);case 91:return d5(e,t);case 92:return i5(e,t);case 96:return X6(e,t);case 126:return Ty.tokenize(e,t);default:return m5(e,t)}}function y5(e){return!JV.test(e)}var eK=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new dS,this.ruler2=new dS,this.ruler.push("text",m5),this.ruler.push("linkify",h5),this.ruler.push("newline",p5),this.ruler.push("escape",i5),this.ruler.push("backticks",X6),this.ruler.push("strikethrough",Ty.tokenize),this.ruler.push("emphasis",My.tokenize),this.ruler.push("link",d5),this.ruler.push("image",u5),this.ruler.push("autolink",Z6),this.ruler.push("html_inline",c5),this.ruler.push("entity",n5),this.ruler2.push("balance_pairs",_V),this.ruler2.push("strikethrough",Ty.postProcess),this.ruler2.push("emphasis",My.postProcess),this.ruler2.push("fragments_join",$V),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[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<o;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(lu(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 if(this.isDefaultRuleset()){if(e.level++,l=fS(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a<o;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++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const i=this.isDefaultRuleset();for(;e.pos<o;){const r=e.pos;let l=!1;if(e.level<e.maxNesting){if(i)l=fS(e,!1);else for(let a=0;a<n&&(l=t[a](e,!1),!l);a++);if(l&&r>=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){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=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(lu(e.env,"inline",s[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>=o)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,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&y5(e)){const a=new $o("text","",0);a.content=e,o.push(a);return}const s=new v5(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!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(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();lu(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}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 tK(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&y5(i.content)){const r=new $o("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const nK=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,oK=/[0-9a-z]/i;function sK(e){return/^<a[>\s]/i.test(e)}function iK(e){return/^<\/a\s*>/i.test(e)}function rK(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!nK.test(o)||!oK.test(s))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 lK(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(sK(l.content)&&i>0&&i--,iK(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(h=>rK(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let y=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText(`mailto:${y}`).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText(`http://${y}`).replace(/^http:\/\//,"");const k=p.index;if(k>f){const A=new $o("text","",0);A.content=a.slice(f,k),A.level=d,u.push(A)}const g=new $o("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new $o("text","",0);v.content=y,v.level=d,u.push(v);const b=new $o("link_close","a",-1);b.level=--d,b.markup="linkify",b.info="auto",u.push(b),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new $o("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const aK=/\r\n?|\n/g,cK=/\0/g;function uK(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(aK,`
96
- `)),o&&(s=s.replace(cK,"�")),e.src=s}const k5=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,dK=/\((?:c|tm|r)\)/i,fK=/\((c|tm|r)\)/gi,hK={c:"©",r:"®",tm:"™"};function pK(e,t){return hK[t.toLowerCase()]}function mK(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(fK,pK)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function gK(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&k5.test(o.content)&&(o.content=o.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–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function vK(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 o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");dK.test(o)&&mK(n.children||[]),k5.test(o)&&gK(n.children||[])}}var yK=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(o=>o.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(o=>o.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 o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,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 kK=/['"]/,hS=/['"]/g,pS="’";function qh(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function bK(e,t){let n;const o=[],s=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=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){hS.lastIndex=c;const d=hS.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=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){m=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(c<u)y=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const k=ym(m)||vm(String.fromCharCode(m)),g=ym(y)||vm(String.fromCharCode(y)),v=gf(m),b=gf(y);if(b?f=!1:g&&(v||k||(f=!1)),v?h=!1:k&&(b||g||(h=!1)),y===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=k,h=g),!f&&!h){p&&(r.content=qh(r.content,d.index,pS));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let I,N;p?(I=s[2]||"‘",N=s[3]||"’"):(I=s[0]||"“",N=s[1]||"”"),r.content=qh(r.content,d.index,N),e[A.token].content=qh(e[A.token].content,A.pos,I),c+=N.length-1,A.token===i&&(c+=I.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=qh(r.content,d.index,pS))}}}function xK(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 o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!kK.test(o)||!n.children||bK(n.children,e)}}function wK(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.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 _K=/^(?:vbscript|javascript|file|data):/,SK=/^data:image\/(?:gif|png|jpeg|webp);/,b5=["http:","https:","mailto:"];function x5(e){const t=e.trim().toLowerCase();return _K.test(t)?SK.test(t):!0}function w5(e){const t=l2(e,!0);if(t.hostname&&(!t.protocol||b5.includes(t.protocol)))try{t.hostname=V6.default.toASCII(t.hostname)}catch{}return $6(r2(t))}function _5(e){const t=l2(e,!0);if(t.hostname&&(!t.protocol||b5.includes(t.protocol)))try{t.hostname=V6.default.toUnicode(t.hostname)}catch{}return wy(r2(t),`${wy.defaultChars}%`)}function CK(e){switch(e){case 9:case 32:return!0}return!1}function AK(e,t,n,o){const s=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 f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],m=[],y=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,b;for(b=t;b<n;b++){const $=a[b]<e.blkIndent;if(u=i[b]+l[b],d=r[b],u>=d)break;if(s.charCodeAt(u++)===62&&!$){let F=a[b]+1,S,B;s.charCodeAt(u)===32?(u++,F++,B=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[b]+F)%4===3?(u++,F++,B=!1):B=!0):S=!1;let W=F;for(h.push(i[b]),i[b]=u;u<d;){const z=s.charCodeAt(u);if(CK(z))z===9?W+=4-(W+c[b]+(B?1:0))%4:W++;else break;u++}v=u>=d,p.push(c[b]),c[b]=a[b]+1+(S?1:0),m.push(a[b]),a[b]=W-F,y.push(l[b]),l[b]=u-i[b];continue}if(v)break;let T=!1;for(let F=0,S=k.length;F<S;F++)if(k[F](e,b,n,!0)){T=!0;break}if(T){e.lineMax=b,e.blkIndent!==0&&(h.push(i[b]),p.push(c[b]),y.push(l[b]),m.push(a[b]),a[b]-=e.blkIndent);break}h.push(i[b]),p.push(c[b]),y.push(l[b]),m.push(a[b]),a[b]=-1}const A=e.blkIndent;e.blkIndent=0;const I=e.push("blockquote_open","blockquote",1);I.markup=">";const N=[t,0];I.map=N,e.md.block.tokenize(e,t,b);const M=e.push("blockquote_close","blockquote",-1);M.markup=">",e.lineMax=f,e.parentType=g,N[1]=e.line;for(let $=0;$<y.length;$++)i[$+t]=h[$],l[$+t]=y[$],a[$+t]=m[$],c[$+t]=p[$];return e.blkIndent=A,!0}function MK(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
97
- `,i.map=[t,e.line],!0}function EK(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const mS=["","h1","h2","h3","h4","h5","h6"],gS=["","#","##","###","####","#####","######"];function vS(e){switch(e){case 9:case 32:return!0}return!1}function TK(e,t,n,o){const s=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=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!vS(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&vS(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",mS[d],1);h.markup=gS[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",mS[d],-1);return m.markup=gS[d],!0}function NK(e){switch(e){case 9:case 32:return!0}return!1}function IK(e,t,n,o){const s=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<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!NK(c))return!1;c===r&&l++}if(l<3)return!1;if(o)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 Sc=[[/^<(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(`${OV.source}\\s*$`),/^$/,!1]];function LK(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<Sc.length&&!Sc[l][0].test(r);l++);if(l===Sc.length)return!1;if(o)return Sc[l][2];let a=t+1;if(!Sc[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),Sc[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 yS(e){switch(e){case 9:case 32:return!0}return!1}const Rd={Pipe:1,ParagraphTerminator:2};function $K(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var S5=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=Rd.Pipe|Rd.ParagraphTerminator),!a)if(yS(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,$K(f)&&(c|=Rd.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new $o(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new $o(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,y=this.bsCount,k=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+y[u])%4:p++;else if(f-d<k[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const s=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 f=0;const h=r[d];let p=h,m;for(d+1<t||o?m=l[d]+1:m=l[d];p<m&&f<n;){const y=i.charCodeAt(p);if(yS(y))y===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,m):s[u]=i.slice(p,m)}return s.join("")}};S5.prototype.Token=$o;function FK(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function C5(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function A5(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Rd.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:FK(n,o,s)}const kS=["","h1","h2"];function OK(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=C5(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const b=i[p]+r[p],A=l[p];if(b>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(b),h===45||h===61)){let N=b+1,M=N;for(;N<A&&s.charCodeAt(N)===h;)N++;for(M=N;N<A;){const $=s.charCodeAt(N);if($!==9&&$!==32)break;N++}if(N>=A){f=h===61?1:2;break}if(M-b>1)continue}if(a[p]<0||u&&!A5(e,p,s,b,A))continue;let I=!1;for(let N=0,M=o.length;N<M;N++)if(o[N](e,p,n,!0)){I=!0;break}if(I)break}if(!f)return!1;let m;if(p===t+1){const b=i[t]+r[t];let A=l[t];for(;A>b;){const I=s.charCodeAt(A-1);if(I!==9&&I!==32)break;A--}m=s.slice(b,A)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const y=h===61?"=":"-",k=e.push("heading_open",kS[f],1);k.markup=y,k.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",kS[f],-1);return v.markup=y,e.parentType=d,!0}function M5(e){switch(e){case 9:case 32:return!0}return!1}function bS(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!M5(i.charCodeAt(l))?-1:l}function xS(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[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),!M5(c))?-1:a}function BK(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const RK=["0","1","2","3","4","5","6","7","8","9"];function DK(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function PK(e,t,n,o){let s,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;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,y=e.eMarks,k=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=y[l])return!1;const b=h.charCodeAt(v);if(b>=48&&b<=57){if(f=xS(e,l),f<0||(u=!0,r=v,d=BK(e,l,f),c&&d!==1))return!1}else if(b===42||b===45||b===43){if(f=bS(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=y[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),I=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const N=[l,0];e.tokens[e.tokens.length-1].map=N,e.tokens[e.tokens.length-1].markup=I;let M=!1;const $=e.tokens.length-1,T=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=y[l];const S=k[l]+f-(p[l]+m[l]);let B=S;for(;i<s;){const ne=h.charCodeAt(i);if(ne===9)B+=4-(B+g[l])%4;else if(ne===32)B++;else break;i++}const W=i;let z;W>=s?z=1:z=B-S,z>4&&(z=1);const L=S+z,O=e.push("list_item_open","li",1);O.markup=I;const U=[l,0];O.map=U,u&&(O.info=f-r-1===1?RK[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,ie=e.tShift[l],q=e.sCount[l],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=L,e.tight=!0,e.tShift[l]=W-p[l],e.sCount[l]=B,W>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||M)&&(a=!1),M=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ee,e.tShift[l]=ie,e.sCount[l]=q,e.tight=Z,e.push("list_item_close","li",-1).markup=I,l=e.line,U[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let fe=!1;for(let ne=0,j=T.length;ne<j;ne++)if(T[ne](e,l,n,!0)){fe=!0;break}if(fe)break;if(u){if(f=xS(e,l),f<0)break;r=p[l]+m[l]}else if(f=bS(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=I:e.push("bullet_list_close","ul",-1).markup=I,N[1]=l,e.line=l,e.parentType=F,a&&DK(e,$),!0}function wS(e){return e===9||e===32}function HK(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=C5(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const v=r[f]+l[f],b=a[f];if(v<b){const A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=b||wS(i.charCodeAt(v+1)))break}else if(A>=48&&A<=57&&v+1<b){let I=v+1;for(;;){if(I>=b){I=-1;break}const N=i.charCodeAt(I++);if(N>=48&&N<=57){if(I-v>=10){I=-1;break}continue}if((N===41||N===46)&&(I>=b||wS(i.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const y=r[f]+l[f],k=a[f];if(d&&!A5(e,f,i,y,k))continue;let g=!1;for(let v=0,b=o.length;v<b;v++)if(o[v](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function jh(e){switch(e){case 9:case 32:return!0}return!1}function WK(e,t,n,o){let s=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(s)!==91)return!1;function a(v){const b=e.lineMax;if(v>=b||e.isEmpty(v))return null;let A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const M=e.parentType;e.parentType="reference";let $=!1;for(let T=0,F=l.length;T<F;T++)if(l[T](e,v,b,!0)){$=!0;break}if(e.parentType=M,$)return null}const I=e.bMarks[v]+e.tShift[v],N=e.eMarks[v];return e.src.slice(I,N+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const v=c.charCodeAt(s);if(v===91)return!1;if(v===93){u=s;break}else if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(v===92&&(s++,s<i&&c.charCodeAt(s)===10)){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const v=c.charCodeAt(s);if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!jh(v))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,m=s;for(;s<i;s++){const v=c.charCodeAt(s);if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!jh(v))break}let y=e.md.helpers.parseLinkTitle(c,s,i);for(;y.can_continue;){const v=a(r);if(v===null)break;c+=v,s=i,i=c.length,r++,y=e.md.helpers.parseLinkTitle(c,s,i,y)}let k;for(s<i&&m!==s&&y.ok?(k=y.str,s=y.pos):(k="",s=h,r=p);s<i&&jh(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&k)for(k="",s=h,r=p;s<i&&jh(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const g=B1(c.slice(1,u));return g?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:k,href:f}),e.line=r),!0):!1}function Ng(e){switch(e){case 9:case 32:return!0}return!1}const zK=65536;function Ig(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function UK(e,t){if(e.lineFlags)return(e.lineFlags[t]&Rd.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function _S(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function qK(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!Ng(l)||r===45&&Ng(l)||!UK(e,t))return!1;for(;i<e.eMarks[s];){const b=e.src.charCodeAt(i);if(b!==124&&b!==45&&b!==58&&!Ng(b))return!1;i++}let a=Ig(e,t+1),c=a.split("|");const u=[];for(let b=0;b<c.length;b++){const A=c[b].trim();if(!A){if(b===0||b===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=Ig(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=_S(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(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let b=0;b<c.length;b++){const A=e.push("th_open","th",1);u[b]&&(A.attrs=[["style",`text-align:${u[b]}`]]);const I=e.push("inline","",0);I.content=c[b].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let b=!1;for(let I=0,N=h.length;I<N;I++)if(h[I](e,s,n,!0)){b=!0;break}if(b||(a=Ig(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=_S(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>zK))break;if(s===t+2){const I=e.push("tbody_open","tbody",1);I.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let I=0;I<d;I++){const N=e.push("td_open","td",1);u[I]&&(N.attrs=[["style",`text-align:${u[I]}`]]);const M=e.push("inline","",0);M.content=c[I]?c[I].trim():"",M.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var jK=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,o){const s=this._rules.findIndex(r=>r.name===e);if(s<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(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<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(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.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:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return lu(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Vh=[["table",qK,["paragraph","reference"]],["code",MK],["fence",EK,["paragraph","reference","blockquote","list"]],["blockquote",AK,["paragraph","reference","blockquote","list"]],["hr",IK,["paragraph","reference","blockquote","list"]],["list",PK,["paragraph","reference","blockquote"]],["reference",WK],["html_block",LK,["paragraph","reference","blockquote"]],["heading",TK,["paragraph","reference","blockquote"]],["lheading",OK],["paragraph",HK]];var VK=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new jK;for(let e=0;e<Vh.length;e++)this.ruler.push(Vh[e][0],Vh[e][1],{alt:(Vh[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.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 h=e.line;let p=!1;for(let m=0;m<s;m++)if(p=o[m](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)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 f=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 h=e.line;let p=!1;for(let m=0;m<s;m++){const y=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(lu(e.env,"block",f[m].name,k-y,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)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,o){if(!e||e.length===0)return;const s=new S5(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},E5=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}};E5.prototype.Token=$o;const SS=[["normalize",uK],["block",vV],["inline",tK],["linkify",lK],["replacements",vK],["smartquotes",xK],["text_join",wK]],KK={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},GK={parseLinkLabel:m2,parseLinkDestination:p2,parseLinkTitle:g2};function YK(){return{...KK}}function ZK(){return{...GK}}var XK=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new VK,this.inline=new eK,this.ruler=new yK;for(let e=0;e<SS.length;e++){const[t,n]=SS[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:YK(),helpers:ZK(),normalizeLink:w5,normalizeLinkText:_5,validateLink:x5,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new j6),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 E5(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 o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();lu(e.env,"core",t[n].name,s-o,!0,!1)}QV(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&gV(e))return this.parse(Y6(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}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 QK=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function wm(e){return!QK.test(e)}function xd(e,t){const n=e.indexOf(`
98
- `,t);return n===-1?e.length:n}function Mp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function CS(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Lg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function JK(e){if(e.length>3)return wm(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){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!1}return!0}const eG=["","h1","h2","h3","h4","h5","h6"],tG=["","#","##","###","####","#####","######"],AS=0,$g=1,Fg=2;function Si(e,t,n,o){const s=new $o(e,t,n);return s.level=o,s.block=!0,s}function b2(e,t,n){const o=Si("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new $o("text","",0);return s.content=e,o.children=[s],o}function nG(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!wm(u))return!1;const d=eG[i],f=tG[i],h=Si("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(b2(u,s,1));const p=Si("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function oG(e,t,n){const o=Si("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(b2(t,n,1)),e.push(Si("paragraph_close","p",-1,0))}function sG(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Og(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function iG(e,t){const n=Si("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function rG(e,t,n){const o=Si("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Si("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s),e.push(b2(t,n,3));const i=Si("paragraph_close","p",-1,2);i.hidden=!0,e.push(i);const r=Si("list_item_close","li",-1,1);return r.markup="-",e.push(r),o}function lG(e){const t=Si("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function aG(e,t,n,o){if(!CS(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=xd(e,l);if(CS(e,l,c)&&Mp(e,l+3,c)){const u=Si("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function cG(e,t){if(e.length===0)return t&&(t.matched=!0),[];if(e.includes("\r")||e.includes("\0"))return null;const n=[];let o=e.length>=1e5?AS:Fg,s="",i=!1,r=!1,l=0,a=0;for(;l<e.length;){const c=xd(e,l);if(l===c){l=c<e.length?c+1:c,a++;continue}const u=e.charCodeAt(l);if(u===32||u===9){if(!Mp(e,l,c))return null;l=c<e.length?c+1:c,a++;continue}if(u===35){if(!nG(n,e,l,c,a))return null;t&&(t.blocks++,t.headings++);const p=c<e.length?c+1:c;l=Og(e,p),a+=1+l-p;continue}if(u===45){if(!Lg(e,l,c))return null;const p=a;let m=l,y=a,k=null,g=null;for(;m<e.length;){const A=xd(e,m);if(!Lg(e,m,A))break;const I=m+2,N=A===I+1?e[I]:e.slice(I,A);if(!JK(N))return null;k===null&&(k=iG(n,p)),g=rG(n,N,y),m=A<e.length?A+1:A,y++}if(k===null||g===null)return null;let v=m,b=y;for(;v<e.length;){if(e.charCodeAt(v)===10){v++,b++;continue}const A=xd(e,v);if(!Mp(e,v,A)){if(Lg(e,v,A))return null;break}v=A<e.length?A+1:A,b++}k.map[1]=b,g.map[1]=b,lG(n),t&&(t.blocks++,t.lists++),l=v,a=b;continue}if(u===96){const p=aG(e,l,c,a);if(!p)return null;n.push(p.token),t&&(t.blocks++,t.fences++),l=Og(e,p.nextPos),a=p.nextLine+l-p.nextPos;continue}const d=sG(e,l,c);let f;if(o===Fg?(t&&t.paragraphCacheBypasses++,f=wm(d)):o===$g&&d===s?(t&&t.paragraphCacheHits++,f=i):(t&&t.paragraphCacheMisses++,f=wm(d),o===AS?(r&&(o=d===s?$g:Fg),s=d,i=f,r=!0):o===$g&&(s=d,i=f)),!f)return null;const h=c<e.length?c+1:c;if(h<e.length&&e.charCodeAt(h)!==10&&!Mp(e,h,xd(e,h)))return null;oG(n,d,a),t&&(t.blocks++,t.paragraphs++),l=Og(e,h),a+=1+l-h}return t&&(t.matched=!0),n}const uG=/[&<>"]/,MS=/[&<>"]/g,dG=/&/g,fG=/[<>"]/g,hG={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Bg(e){return hG[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return uG.test(e)?e.replace(MS,Bg):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(dG,"&amp;"):t?e.replace(MS,Bg):e.replace(fG,Bg)}const pG=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),mG=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function T5(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(pG,(t,n,o)=>{if(n)return n;if(mG.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return R1(i)?vf(i):"�"}const s=i2(t);return s!==t?s:t})}const gG=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,vG=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,yG=/"/g;function Vc(e,t){const n=e.indexOf(`
99
- `,t);return n===-1?e.length:n}function _m(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Kh(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function kG(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!_m(e,t,Vc(e,t))}function ES(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function bG(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function x2(e){return vG.test(e)?gG.test(e)?null:e.replace(yG,"&quot;"):e}function xG(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=x2(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
100
- `}function TS(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function wG(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
101
- `;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 null}return`<li>${e[t]}</li>
102
- `}function _G(e,t,n){const o=t+2;if(n===o+1)return wG(e,o);const s=x2(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
103
- `}function SG(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function CG(e,t,n,o,s){if(!ES(e,t,n))return null;const i=SG(e,t+3,n);if(i===null)return null;const r=n<e.length?n+1:n;let l=r,a=r;for(;a<e.length;){const c=Vc(e,a);if(ES(e,a,c)&&_m(e,a+3,c)){const u=e.slice(r,l);let d;return i===o.lang?(s&&s.fenceCacheHits++,d=o.open):(s&&s.fenceCacheMisses++,d=i?`<pre><code class="language-${$n(i)}">`:"<pre><code>",o.lang=i,o.open=d),{html:`${d}${$n(u)}</code></pre>
104
- `,nextPos:c<e.length?c+1:c}}a=c<e.length?c+1:c,l=a}return null}function N5(e,t){if(e.length===0)return t&&(t.matched=!0),"";if(e.includes("\r")||e.includes("\0"))return null;let n=0,o="";const s=e.length>=25e4,i=[],r={lang:null,open:""};let l="",a="",c="",u="";for(;n<e.length;){const d=Vc(e,n);if(n===d){n=d<e.length?d+1:d;continue}const f=e.charCodeAt(n);if(f===32||f===9){if(!_m(e,n,d))return null;n=d<e.length?d+1:d;continue}if(f===35){const y=xG(e,n,d);if(y===null)return null;t&&(t.blocks++,t.headings++),s?i.push(y):o+=y,n=Kh(e,d<e.length?d+1:d);continue}if(f===45){let y=n;for(;y<e.length;){const b=Vc(e,y);if(!TS(e,y,b))break;y=b<e.length?b+1:b}if(y===n)return null;const k=e.slice(n,y);let g;if(k===l)t&&t.listCacheHits++,g=a;else{t&&t.listCacheMisses++;let b=n;for(g=`<ul>
105
- `;b<y;){const A=Vc(e,b),I=_G(e,b,A);if(I===null)return null;g+=I,b=A<e.length?A+1:A}g+=`</ul>
106
- `,l=k,a=g}let v=Kh(e,y);for(;v<e.length;){if(e.charCodeAt(v)===10){v++;continue}const b=Vc(e,v);if(!_m(e,v,b)){if(TS(e,v,b))return null;break}v=b<e.length?b+1:b}t&&(t.blocks++,t.lists++),s?i.push(g):o+=g,n=v;continue}if(f===96){const y=CG(e,n,d,r,t);if(!y)return null;t&&(t.blocks++,t.fences++),s?i.push(y.html):o+=y.html,n=Kh(e,y.nextPos);continue}const h=bG(e,n,d);let p;if(h===c)t&&t.paragraphCacheHits++,p=u;else{t&&t.paragraphCacheMisses++;const y=x2(h);if(y===null)return null;p=`<p>${y}</p>
107
- `,c=h,u=p}const m=d<e.length?d+1:d;if(m<e.length&&e.charCodeAt(m)!==10&&kG(e,m))return null;t&&(t.blocks++,t.paragraphs++),s?i.push(p):o+=p,n=Kh(e,m)}return t&&(t.matched=!0),s?i.join(""):o}function NS(e){return N5(e)}function IS(e,t){return N5(e,t)}const AG={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Sm(e,t,n={},o){fs(n);const s={...AG,...o||{}},i=Ls(t);if(s.fallbackOnGlobalState!==!1&&i)return Eg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),ru(n,i,()=>e.core.parse(t,n,e).tokens);let r=Ep(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=NG(r,s.maxChunks)),Tp(t,r))return Eg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),ru(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return Eg(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),ru(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&EG(f,l),TG(a,f),l+=u.lineCount}return a})}function Ep(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
108
- `,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=IG(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const b=e.charCodeAt(g);if(b===32||b===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let b=g;for(;b<h&&e[b]===v;)b++;const A=b-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const y=p-f;s+=y,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=y);const k=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),o}function Tp(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!MG(e,t[s].end))return!0;return!1}function MG(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 o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function EG(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function TG(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function NG(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+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}),o+=l}return n}function IG(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const I5=4e6,L5=8e4,LG=1e4,$G=200,FG=1e4,OG=200;function $5(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function BG(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function ul(e){return e.length===0?0:uo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function RG(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function DG(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
109
- `,o);s===-1&&(s=e.length);let i=o;for(;i<s;){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<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function PG(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 RG(e,n+1,e.length-1)?!DG(e,t):!1}function HG(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??FG:e.options.fullChunkSizeChars??LG),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??OG:e.options.fullChunkSizeLines??$G);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="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 Wf=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=ul(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Ep(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Tp(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,ul(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!PG(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,ul(this.pending)),null;const n=Ep(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,ul(this.pending)),null;const o=Tp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:ul(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=Ep(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Tp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:ul(this.pending)}]:n;this.commitRanges(o,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:ul(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+ul(this.pending);return HG(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Pf(e)&&Zr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ls(t);n&&(f2(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&BG(r,a),this.options.retainTokens!==!1&&$5(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&h2(t),n}catch(o){throw this.markedGlobalStateReason&&(Zr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){z6(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 WG(e,t,n={},o={}){fs(n);const s=new Wf(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function zG(e,t,n={},o={}){fs(n);const s=new Wf(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function UG(e,t,n,o={},s={}){fs(o);const i=new Wf(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function qG(e,t,n,o={},s={}){fs(o);const i=new Wf(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function F5(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??I5,s=e.options.autoUnboundedThresholdLines??L5;return t>=o||n>=s}function O5(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??I5))return"yes";const o=e.options.autoUnboundedThresholdLines??L5;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Dd(e,t,n={},o={}){fs(n);const s=Ls(t);if(Pf(n)&&Zr(n),o.fallbackOnGlobalState!==!1&&s)return z6(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:uo(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),ru(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Wf(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){$5(i,l)}});if(s&&f2(n,s),r.feed(t),r.flushForce(n),s&&(h2(n),o.fallbackOnGlobalState===!1)){const l=Lr(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const au=(e,t,n)=>e<t?t:e>n?n:e;function B5(e){return e.experimental?{...e,...e.experimental}:e}const LS=[{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"}],$S=[{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 R5(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function jG(e,t=Math.max(0,e/40|0),n={}){const o=B5(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<LS.length;l++){const a=LS[l];if(e<=a.max){if(a.strategy!=="adaptive")return R5(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:au(Math.ceil(e/i),8e3,64e3),maxChunkLines:au(Math.ceil(t/i),150,700),maxChunks:au(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function FS(e,t=Math.max(0,e/40|0),n={}){const o=B5(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<$S.length;l++){const a=$S[l];if(e<=a.max){if(a.strategy!=="adaptive")return R5(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:au(Math.ceil(e/i),8e3,64e3),maxChunkLines:au(Math.ceil(t/i),150,700),maxChunks:au(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var VG={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"]}}},KG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},GG={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"]}}};function H1(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Np(e,t){if(H1(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const OS=e=>H1(e)?e:Promise.resolve(e);function Pd(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 $n(e)}}function Hl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Pd(t[0])}="${$n(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Pd(s[0])}="${$n(s[1])}"`}return n}function D5(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Hd(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
110
- `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${$n(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
111
- `;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Hl(r)}>${t}</code></pre>
112
- `}return`<pre><code${Hl(e.attrs)}>${t}</code></pre>
113
- `}function kf(e){return!e.attrs||e.attrs.length===0?`<code>${$n(e.content)}</code>`:`<code${Hl(e.attrs)}>${$n(e.content)}</code>`}function Ny(e){const t=$n(e.content);return e.attrs?`<pre${Hl(e.attrs)}><code>${t}</code></pre>
114
- `:`<pre><code>${t}</code></pre>
115
- `}function YG(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="${$n(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${$n(n[0][1])}">`}return null}function BS(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Pd(t[0][0])}="${$n(t[0][1])}">`:t.length===2?`<a ${Pd(t[0][0])}="${$n(t[0][1])}" ${Pd(t[1][0])}="${$n(t[1][1])}">`:`<a${Hl(t)}>`}function ZG(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 RS(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 Cm(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Hl(n);return o===0&&t&&(i+=" /"),`${i}>`}const XG={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Gh=Object.prototype.hasOwnProperty,dn={code_inline(e,t){return kf(e[t])},code_block(e,t){return Ny(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?T5(i.info).trim():"",{langName:l,langAttrs:a}=D5(r),c=n.highlight,u=$n(i.content);if(!c)return Hd(i,u,r,l,n);const d=c(i.content,l,a);return H1(d)?d.then(f=>Hd(i,f||u,r,l,n)):Hd(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),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]],Cm(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
116
- `:`<br>
117
- `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
118
- `:`<br>
119
- `:`
120
- `},text(e,t){return $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function DS(e,t,n){const o=e.info?T5(e.info).trim():"",{langName:s,langAttrs:i}=D5(o),r=t.highlight,l=$n(e.content);if(!r)return Hd(e,l,o,s,t);const a=r(e.content,s,i);if(H1(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Hd(e,a||l,o,s,t)}function Rg(e,t,n,o){switch(e.type){case"text":return t.text===dn.text?e.content.length===0?"":$n(e.content):null;case"text_special":return t.text_special===dn.text_special?e.content.length===0?"":$n(e.content):null;case"softbreak":return t.softbreak===dn.softbreak?o:null;case"hardbreak":return t.hardbreak===dn.hardbreak?n:null;case"html_inline":return t.html_inline===dn.html_inline?e.content:null;case"code_inline":return t.code_inline===dn.code_inline?kf(e):null;default:return null}}function QG(e,t,n,o,s){const i=e[0];switch(i.type){case"text":if(s.text===dn.text)return i.content.length===0?"":$n(i.content);break;case"text_special":if(s.text_special===dn.text_special)return i.content.length===0?"":$n(i.content);break;case"softbreak":if(s.softbreak===dn.softbreak)return t.breaks?t.xhtmlOut?`<br />
121
- `:`<br>
122
- `:`
123
- `;break;case"hardbreak":if(s.hardbreak===dn.hardbreak)return t.xhtmlOut?`<br />
124
- `:`<br>
125
- `;break;case"html_inline":if(s.html_inline===dn.html_inline)return i.content;break;case"code_inline":if(s.code_inline===dn.code_inline)return kf(i);break}const r=s[i.type];if(!r)return Cm(i,t.xhtmlOut===!0);const l=r(e,0,t,n,o);return typeof l=="string"?l:Np(l,i.type)}var JG=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...dn}}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 o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,y="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,b=k>0&&e[k-1].hidden?`
126
- `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const N=e[k+1],M=e[k+2],$=e[k+3];if(N.type==="paragraph_open"&&N.hidden&&M.type==="inline"&&$.type==="paragraph_close"&&$.hidden){y+=`${b}<li>${this.renderInlineTokens(M.children||[],o,s)}`,k+=3;continue}}if(k+2<e.length){const N=e[k+1],M=e[k+2];if(N.type==="inline"&&M.nesting===-1&&M.tag===g.tag&&!M.hidden){const $=YG(g,b);if($!==null){y+=`${$+this.renderInlineTokens(N.children||[],o,s)}</${g.tag}>
127
- `,k+=2;continue}}}if(v==="inline"){const N=g.children||[];if(N.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
128
- `:`<br>
129
- `,p=o.breaks?h:`
130
- `,m=!0);const M=N[0];switch(M.type){case"text":if(l===dn.text){y+=$n(M.content);continue}break;case"text_special":if(a===dn.text_special){y+=$n(M.content);continue}break;case"softbreak":if(c===dn.softbreak){y+=p;continue}break;case"hardbreak":if(u===dn.hardbreak){y+=h;continue}break;case"html_inline":if(d===dn.html_inline){y+=M.content;continue}break;case"code_inline":if(f===dn.code_inline){y+=kf(M);continue}break}}y+=this.renderInlineTokens(N,o,s);continue}const A=i[v];if(!A){const N=g.attrs;if(!g.hidden){if(!N||N.length===0)switch(v){case"hr":y+=r?`<hr />
131
- `:`<hr>
132
- `;continue;case"heading_open":y+=`<${g.tag}>`;continue;case"heading_close":y+=`</${g.tag}>
133
- `;continue;case"paragraph_open":y+=`${b}<p>`;continue;case"paragraph_close":y+=`</p>
134
- `;continue;case"list_item_open":{const M=e[k+1];y+=b+(M&&(M.type==="inline"||M.hidden||M.nesting===-1&&M.tag==="li")?"<li>":`<li>
135
- `);continue}case"list_item_close":y+=`</li>
136
- `;continue;case"bullet_list_open":y+=`${b}<ul>
137
- `;continue;case"bullet_list_close":y+=`</ul>
138
- `;continue;case"blockquote_open":y+=b+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
139
- `);continue;case"blockquote_close":y+=`</blockquote>
140
- `;continue;case"ordered_list_open":y+=`${b}<ol>
141
- `;continue;case"ordered_list_close":y+=`</ol>
142
- `;continue;case"table_open":y+=`${b}<table>
143
- `;continue;case"table_close":y+=`</table>
144
- `;continue;case"thead_open":y+=`${b}<thead>
145
- `;continue;case"thead_close":y+=`</thead>
146
- `;continue;case"tbody_open":y+=`${b}<tbody>
147
- `;continue;case"tbody_close":y+=`</tbody>
148
- `;continue;case"tr_open":y+=`${b}<tr>
149
- `;continue;case"tr_close":y+=`</tr>
150
- `;continue;case"td_open":y+=`${b}<td>`;continue;case"td_close":y+=`</td>
151
- `;continue;case"th_open":y+=`${b}<th>`;continue;case"th_close":y+=`</th>
152
- `;continue}else if(N.length===1){const M=N[0];if(v==="ordered_list_open"&&M[0]==="start"){y+=`${b}<ol start="${$n(M[1])}">
153
- `;continue}if(v==="td_open"&&M[0]==="style"){y+=`${b}<td style="${$n(M[1])}">`;continue}if(v==="th_open"&&M[0]==="style"){y+=`${b}<th style="${$n(M[1])}">`;continue}}}y+=this.renderToken(e,k,o);continue}if(v==="code_block"&&A===dn.code_block){y+=Ny(g);continue}if(v==="fence"&&A===dn.fence){y+=DS(g,o);continue}if(v==="html_block"&&A===dn.html_block){y+=g.content;continue}const I=A(e,k,o,s,this);typeof I=="string"?y+=I:y+=Np(I,g.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=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||[],o,s);continue}const c=i[a.type];c?r+=await OS(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Hl(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
154
- `:"",u=a?`>
155
- `:">";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+Hl(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 o=()=>(n||(n={...t}),n);if(Gh.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Gh.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Gh.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Gh.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...XG,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===dn.code_block)return Ny(t);if(i==="html_block"&&s.html_block===dn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):Cm(t,r.xhtmlOut===!0);if(i==="fence"&&a===dn.fence)return DS(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Np(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules;if(e.length===1)return QG(e,t,n,this,o);const s=t.xhtmlOut===!0,i=s?`<br />
156
- `:`<br>
157
- `,r=t.breaks?i:`
158
- `,l=o.text,a=o.text_special,c=o.softbreak,u=o.hardbreak,d=o.html_inline,f=o.code_inline,h=o.link_open,p=o.link_close,m=o.em_open,y=o.em_close,k=o.strong_open,g=o.strong_close;let v="";for(let b=0;b<e.length;b++){const A=e[b];if(A.type==="link_open"&&!h&&!p&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="link_close"&&ZG(M)){const $=Rg(M,o,i,r);if($!==null){const T=`${BS(A)+$}</a>`;if(c===dn.softbreak&&b+3<e.length&&e[b+3].type==="softbreak"){v+=T+r,b+=3;continue}v+=T,b+=2;continue}}}if(A.type==="link_open"&&!h&&!p&&b+1<e.length&&e[b+1].type==="link_close"){v+=`${BS(A)}</a>`,b+=1;continue}if(A.type==="em_open"&&!m&&!y&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="em_close"&&RS(M)){const $=Rg(M,o,i,r);if($!==null){v+=`<em>${$}</em>`,b+=2;continue}}}if(A.type==="strong_open"&&!k&&!g&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="strong_close"&&RS(M)){const $=Rg(M,o,i,r);if($!==null){v+=`<strong>${$}</strong>`,b+=2;continue}}}switch(A.type){case"text":if(l===dn.text){const M=A.content.length===0?"":$n(A.content);if(d===dn.html_inline&&b+1<e.length&&e[b+1].type==="html_inline"){for(v+=M+e[++b].content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}v+=M;continue}break;case"text_special":if(a===dn.text_special){A.content.length!==0&&(v+=$n(A.content));continue}break;case"softbreak":if(c===dn.softbreak){v+=r;continue}break;case"hardbreak":if(u===dn.hardbreak){v+=i;continue}break;case"html_inline":if(d===dn.html_inline){for(v+=A.content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}break;case"code_inline":if(f===dn.code_inline){v+=kf(A);continue}break}const I=o[A.type];if(!I){v+=A.block?this.renderToken(e,b,t):Cm(A,s);continue}const N=I(e,b,t,n,this);typeof N=="string"?v+=N:v+=Np(N,A.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await OS(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
159
- `;break}}return o}},eY=JG;const tY=[],Dg=4096;function nY(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
160
- `,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function oY(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function sY(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!P5(e[n],t[n]))return!1;return!0}function P5(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!oY(e.attrs,t.attrs)||!sY(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function PS(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var iY=class{core;cache=null;stats=PS();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=PS(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(fs(o??s?.env),!s||o&&o!==s.env){const B=o??{},W=!!n.__explicitStreamChunkFallbackSetting,z=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,L=!!n.options?.streamChunkedFallback,O=!W&&z,U=L||O,Z=n.options?.streamChunkAdaptive!==!1,ie=n.options?.streamChunkTargetChunks??8,q=n.options?.streamChunkSizeChars,ee=n.options?.streamChunkSizeLines,fe=n.options?.streamChunkMaxChunks,ne=!!n.__explicitStreamChunkConfig,j=n.options?.autoTuneChunks!==!1,K=n.options?.streamChunkFenceAware??!0,ve=n.options?.streamLargeCachePolicy??"retain",he=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Ae=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let re,Y=!1;if(ve==="skip"&&(Y=e.length>=he,!Y&&Ae!==void 0&&(re=uo(e),Y=re>=Ae)),Y){const P=this.parseFullDocument(e,B,n,re,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(B,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Lr(B)?.unbounded}),P.tokens}else if(U){const P=(pe,ke,Ne)=>pe<ke?ke:pe>Ne?Ne:pe;re===void 0&&(re=uo(e));const G=j&&!ne?FS(e.length,re,n.options):null,me=G?.maxChunkChars??(Z?P(Math.ceil(e.length/ie),8e3,64e3):q??1e4),ye=G?.maxChunkLines??(Z?P(Math.ceil(re/ie),150,700):ee??200),de=G?.maxChunks??(Z?P(Math.ceil(e.length/64e3),ie,32):fe),V=e.length>0&&e.charCodeAt(e.length-1)===10,se=O&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&G?.strategy!=="plain";if((L||se)&&(e.length>=me*2||re>=ye*2)&&V){const pe=Sm(n,e,B,{maxChunkChars:me,maxChunkLines:ye,fenceAware:G?.fenceAware??K,maxChunks:de});return this.cache={src:e,tokens:pe,env:B,lineCount:re,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,re),this.recordChunkedParseResult(B,L?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const Q=this.parseFullDocument(e,B,n,re);return re=Q.lineCount,this.cache={src:e,tokens:Q.tokens,env:B,lineCount:re,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,re),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(B,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Lr(B)?.unbounded}),Q.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",wo(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Ls(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ls(e),a=r||l;if(a){const B=o??s.env;Zr(B);const W=Ls(e),z=this.parseFullDocument(e,B,n),L=z.tokens,O=z.lineCount;return this.cache={src:e,tokens:L,env:B,lineCount:O,lastSegment:void 0,globalStateReason:W},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(B,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Lr(B)?.unbounded}),L}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const B=o??s.env,W=this.parseFullDocument(e,B,n),z=W.tokens,L=W.lineCount;return this.cache={src:e,tokens:z,env:B,lineCount:L,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,L),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(B,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Lr(B)?.unbounded}),z}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const B=s.lineCount??uo(s.src);let W=3;u.length>5e3?W=8:u.length>1e3?W=6:u.length>200&&(W=4),W=Math.min(W,B);let z=null;const L=n.options?.streamContextParseStrategy??"chars",O=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Z;const ie=()=>(Z===void 0&&(Z=uo(u)),Z),q=this.canDirectlyParseAppend(s),ee=q&&this.shouldUseUnboundedAppend(e,s,u);let fe=!1;if(!q)switch(L){case"lines":fe=ie()>=U;break;case"constructs":if(u.length>=O){fe=!0;break}if(nY(u)){fe=!0;break}fe=ie()>=U;break;case"chars":default:fe=u.length>=O}if(W>0&&fe){const K=this.getTailLines(s.src,W)+u;try{const ve=this.core.parse(K,s.env,n).tokens,he=ve.findIndex(Ae=>Ae.map&&typeof Ae.map[1]=="number"&&Ae.map[1]>W);if(he!==-1){const Ae=ve.slice(he),re=B-W;re!==0&&this.shiftTokenLines(Ae,re),z={tokens:Ae}}}catch{z=null}}else z=null;if(!z){const K=B;if(ee)z={tokens:Dd(n,u,s.env,{mode:"stream"})},K>0&&this.shiftTokenLines(z.tokens,K);else{const ve=this.core.parse(u,s.env,n);K>0&&this.shiftTokenLines(ve.tokens,K),z=ve}}let ne=0;if(s.tokens.length>0&&z.tokens.length>0){const K=s.tokens[s.tokens.length-1],ve=z.tokens[0];try{K.type==="inline"&&ve.type==="inline"&&(ve.children&&ve.children.length>0&&(K.children||(K.children=[]),this.appendTokens(K.children,ve.children)),K.content=(K.content||"")+(ve.content||""),ne=1)}catch{ne=0}}const j=s.tokens.length;if(z.tokens.length>ne){const K=s.tokens,ve=z.tokens,he=Math.min(K.length,ve.length-ne);let Ae=0;for(let re=he;re>0;re--){let Y=!0;for(let Q=0;Q<re;Q++){const P=K[K.length-re+Q],G=ve[ne+Q];if(!P5(P,G)){Y=!1;break}}if(Y){Ae=re;break}}Ae>0&&(ne+=Ae),ve.length>ne&&this.appendTokens(s.tokens,ve,ne)}if(s.src=e,s.globalStateReason=null,s.lineCount=B+(Z??ie()),s.tokens.length>j){const K=this.getLastSegment(s.tokens,e,j,s.tokens.length,e.length-u.length,B);K?s.lastSegment=K:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ee&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",wo(s.env,{area:"stream",path:ee?"stream-unbounded-append":"stream-append",reason:ee?"large-delta":"safe-append",unbounded:ee}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",wo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,y=!h&&!u&&p,k=m||y,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,I=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,M=n.options?.autoTuneChunks!==!1,$=n.options?.streamChunkFenceAware??!0;let T=u&&s.lineCount!==void 0?s.lineCount+uo(u):void 0;if(k){T===void 0&&(T=uo(e));const B=(ie,q,ee)=>ie<q?q:ie>ee?ee:ie,W=M&&!N?FS(e.length,T,n.options):null,z=W?.maxChunkChars??(g?B(Math.ceil(e.length/v),8e3,64e3):b??1e4),L=W?.maxChunkLines??(g?B(Math.ceil(T/v),150,700):A??200),O=W?.maxChunks??(g?B(Math.ceil(e.length/64e3),v,32):I),U=e.length>0&&e.charCodeAt(e.length-1)===10,Z=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&W?.strategy!=="plain";if((m||Z)&&(e.length>=z*2||T>=L*2)&&U){const ie=Sm(n,e,d,{maxChunkChars:z,maxChunkLines:L,fenceAware:W?.fenceAware??$,maxChunks:O});return this.cache={src:e,tokens:ie,env:d,lineCount:T,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),ie}}const F=this.parseFullDocument(e,d,n,T),S=F.tokens;return T=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:T,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Lr(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=Lr(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",wo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!Lr(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",wo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ls(e);Pf(t)&&Zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?O5(n,e.length,o):"no";if(r==="yes"){const a=Dd(n,e,t);return wo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?uo(e):0)}}let l=o;if(r==="need-lines"&&(l=uo(e),F5(n,e.length,l))){const a=Dd(n,e,t);return wo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?uo(e):0),{tokens:ru(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:uo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
161
- `))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
162
- `);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.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,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+uo(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
163
- `,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.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===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??tY}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??uo(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-Dg))+t,o=Ls(n);return e.globalStateCarry=n.length>Dg?n.slice(n.length-Dg):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
164
- `,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
165
- `,s+1),s===-1)return e.length;o--}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,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.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,o).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 f=t.lineCount??uo(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.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=null;const m=f+uo(i);t.lineCount=m;const y=this.getDocLineCount(e,m);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.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(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??uo(t.src);t.tokens.splice(y,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=k+uo(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const b=t.tokens[h.tbodyOpenIndex];b?.map&&(b.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
166
- `);if(t<0)return null;const n=e.indexOf(`
167
- `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)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,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+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=s)}}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 o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=uo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const HS={default:KG,zero:GG,commonmark:VG};function rY(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function lY(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 WS(e){return e.experimental?{...e,...e.experimental}:e}function yi(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 zS(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(yi(t,s)||yi(e,s))return!0}return!1}function US(e,t,n){return yi(t,n)||yi(e,n)}function qS(e,t){const n=Lr(e)?.chunk;if(n?.fallback){wo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}wo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function Cc(){return typeof performance<"u"?performance.now():Date.now()}function aY(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,streamLargeCachePolicy:"retain",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},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=HS[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=WS(n),typeof n.quotes=="string"){const M=n.quotes;M.length>=4?n.quotes=[M[0],M[1],M[2],M[3]]:n.quotes=["“","”","‘","’"]}let r=zS(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=zS(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=US(i?.options,s,"fullChunkedFallback"),c=US(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new XK;let p=null;const m=()=>(p||(p=new eY(n)),p);let y=null;const k=()=>(y||(y=new iY(h)),y);let g=null;const v=()=>(g||(g=new j6),g),b=M=>!u&&!!d&&!lY(M,d),A=(M,$)=>o==="default"&&!u&&p===null&&f!==null&&M.parse===f&&b(M)&&!M.stream.enabled&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.xhtmlOut===!1&&M.options.breaks===!1&&M.options.langPrefix==="language-"&&M.options.linkify===!1&&M.options.typographer===!1&&M.options.highlight===null,I=(M,$)=>o==="default"&&!u&&b(M)&&!M.stream.enabled&&!M.options.fullChunkedFallback&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.linkify===!1&&M.options.typographer===!1,N={core:h,block:h.block,inline:h.inline,get linkify(){const M=v();return Object.defineProperty(this,"linkify",{value:M,writable:!0,configurable:!0}),M},get renderer(){const M=m();return Object.defineProperty(this,"renderer",{value:M,writable:!0,configurable:!0}),M},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set(M){const $=WS(M);return this.options={...this.options,...$},(yi(M,"fullChunkSizeChars")||yi(M,"fullChunkSizeLines")||yi(M,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(yi(M,"streamChunkSizeChars")||yi(M,"streamChunkSizeLines")||yi(M,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),yi(M,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),yi(M,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set($),typeof $.stream=="boolean"&&(this.stream.enabled=$.stream,y&&(y.reset(),y.resetStats())),this},configure(M){const $=typeof M=="string"?HS[M]:M;if(!$)throw new Error("Wrong `markdown-it` preset, can't be empty");if($.options&&this.set($.options),$.components){const T=$.components;T.core?.rules&&this.core.ruler.enableOnly(T.core.rules),T.block?.rules&&this.block.ruler.enableOnly(T.block.rules),T.inline?.rules&&this.inline.ruler.enableOnly(T.inline.rules),T.inline2?.rules&&this.inline.ruler2.enableOnly(T.inline2.rules)}return this},enable(M,$){const T=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const B of F){if(!B)continue;const W=B.enable(T,!0);for(let z=0;z<W.length;z++)S.add(W[z])}if(!$){const B=T.filter(W=>!S.has(W));if(B.length)throw new Error(`Rules manager: invalid rule name ${B.join(", ")}`)}return this},disable(M,$){const T=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const B of F){if(!B)continue;const W=B.disable(T,!0);for(let z=0;z<W.length;z++)S.add(W[z])}if(!$){const B=T.filter(W=>!S.has(W));if(B.length)throw new Error(`Rules manager: invalid rule name ${B.join(", ")}`)}return this},use(M,...$){const T=typeof M=="function"?M:M&&typeof M.default=="function"?M.default:void 0;if(!T)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...$],S=M;return u=!0,T.apply(S,F),this},render(M,$){let T;if(A(this,M.length)){$!==void 0&&(fs($),T=Mg("render"));const B=T?Cc():0,W=T?IS(M,T):NS(M);if(T&&(T.attemptMs=Cc()-B,W===null&&(T.fallbackReason="unsupported-stock-subset"),ld($,T)),W!==null)return $!==void 0&&wo($,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const F=$??{},S=this.parse(M,F);return T&&ld(F,T),m().render(S,this.options,F)},async renderAsync(M,$){let T;if(A(this,M.length)){$!==void 0&&(fs($),T=Mg("render"));const B=T?Cc():0,W=T?IS(M,T):NS(M);if(T&&(T.attemptMs=Cc()-B,W===null&&(T.fallbackReason="unsupported-stock-subset"),ld($,T)),W!==null)return $!==void 0&&wo($,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const F=$??{},S=this.parse(M,F);return T&&ld(F,T),m().renderAsync(S,this.options,F)},renderIterable(M,$={}){const T=this.parseIterable(M,$);return m().render(T,this.options,$)},async renderAsyncIterable(M,$={}){const T=await this.parseAsyncIterable(M,$);return m().renderAsync(T,this.options,$)},renderInline(M,$={}){const T=this.parseInline(M,$);return m().render(T,this.options,$)},validateLink:x5,normalizeLink:w5,normalizeLinkText:_5,utils:Mj,helpers:{...mV},parse(M,$){if(typeof M!="string")throw new TypeError("Input data should be a String");if($!==void 0&&fs($),I(this,M.length)){const B=$===void 0?void 0:Mg("parse"),W=B?Cc():0,z=cG(M,B);if(B&&(B.attemptMs=Cc()-W,z===null&&(B.fallbackReason="unsupported-stock-subset"),ld($,B)),z!==null)return $!==void 0&&wo($,{area:"parse",path:"stock-fast",reason:"stock-subset"}),z}const T=$??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const B=O5(this,M.length);if(B==="yes"){const W=Dd(this,M,T);return wo($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),W}B==="need-lines"&&(F=uo(M))}if(!this.stream.enabled){const B=M.length,W=this.options.autoTuneChunks!==!1,z=r,L=!a&&b(this),O=!!this.options.fullChunkedFallback,U=L&&B>=2e5;let Z;(O||U||F!==void 0)&&(Z=F??uo(M));const ie=(O||U)&&W&&!z?jG(B,Z,this.options):null;if(O||U){const q=Z??0;if(O?B>=(this.options.fullChunkThresholdChars??2e4)||q>=(this.options.fullChunkThresholdLines??400):U){if(ie&&ie.strategy!=="plain"){const ee=Sm(this,M,T,{maxChunkChars:ie.maxChunkChars,maxChunkLines:ie.maxChunkLines,fenceAware:ie.fenceAware,maxChunks:ie.maxChunks});return $&&qS($,O?"explicit-full-chunk":"default-large-string"),ee}if(O){const ee=(Y,Q,P)=>Y<Q?Q:Y>P?P:Y,fe=this.options.fullChunkAdaptive!==!1,ne=this.options.fullChunkTargetChunks??8,j=ee(Math.ceil(B/ne),8e3,64e3),K=ee(Math.ceil(q/ne),150,700),ve=fe?j:this.options.fullChunkSizeChars??1e4,he=fe?K:this.options.fullChunkSizeLines??200,Ae=fe?ee(Math.ceil(B/64e3),ne,32):this.options.fullChunkMaxChunks,re=Sm(this,M,T,{maxChunkChars:ve,maxChunkLines:he,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ae});return $&&qS($,"explicit-full-chunk"),re}}}if(F!==void 0&&b(this)&&F5(this,B,Z??F)){const q=Dd(this,M,T);return wo($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),q}}const S=Ls(M);return wo($,{area:"parse",path:"plain",reason:"default-plain"}),ru(T,S,()=>h.parse(M,T,this).tokens)},parseIterable(M,$={}){return fs($),WG(this,M,$)},parseAsyncIterable(M,$={}){return fs($),zG(this,M,$)},parseIterableToSink(M,$,T={}){return fs(T),UG(this,M,$,T)},parseAsyncIterableToSink(M,$,T={}){return fs(T),qG(this,M,$,T)},parseInline(M,$={}){if(typeof M!="string")throw new TypeError("Input data should be a String");fs($),Pf($)&&Zr($);const T=h.createState(M,$,this);return T.inlineMode=!0,h.process(T),T.tokens}};if(N.stream={enabled:!!n.stream,parse(M,$){return N.stream.enabled?k().parse(M,$,N):N.parse(M,$??{})},reset(){k().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},i?.components){const M=i.components;M.core?.rules&&N.core.ruler.enableOnly(M.core.rules),M.block?.rules&&N.block.ruler.enableOnly(M.block.rules),M.inline?.rules&&N.inline.ruler.enableOnly(M.inline.rules),M.inline2?.rules&&N.inline.ruler2.enableOnly(M.inline2.rules)}return d=rY(N),f=N.parse,N}var cY=aY;const H5=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],uY=["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"],W5=["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"],dY=["svg","g","path"],fY=["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"],hY=["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","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],pY=["action","data","href","src","srcset","poster","xlink:href","formaction"],mY=["script"],gY=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Wl=new Set(H5),z5=new Set(W5),bf=new Set([...H5,...uY,...W5,...dY]),U5=new Set([...bf,...fY]),vY=new Set(hY),yY=new Set(pY),zf=new Set(mY),q5=new Set(gY);function j5(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const kY={amp:"&",bsol:"\\",colon:":",newline:`
168
- `,sol:"/",tab:" "};function V5(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return kY[String(s??"").toLowerCase()]??t})}const Yh=new Set(["http","https","mailto","tel"]),bY=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),da=new Set(["http","https"]);function K5(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const xY=/^https?:\/\//i;function wY(e){if(!xY.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function _Y(e,t,n){if(!Wd(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Wd(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function SY(e,t){return t==="href"||t==="xlink:href"?Wd(e,t)?Yh:da:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?da:(Wd(e,t),Yh)}function Ra(e,t={}){if(wY(e))return!1;const n=j5(V5(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=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 o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=K5(n);return i?i==="file"?!_Y(n,o,s):Wd(o,s)?bY.has(i):!SY(o,s).has(i):!1}function CY(e){const t=V5(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=K5(j5(t).toLowerCase());return n==="http"||n==="https"}function AY(e,t={}){const n=String(e??"").trim();return n?Ra(n,t)?"":n:""}function jS(e){return AY(e,{tagName:"img",attrName:"src"})}function MY(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,m,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,p,m,y)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,m){let y,k=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(y=g+1;y<=v&&r[(y-g)%a]===f.src[y];y++);const b=Math.floor((y-g)/a);if(b<i)return!1;y-=(y-g)%a;const A=f.src.slice(g,y),I=f.src.slice(y,v);if(!c(I,A))return!1;if(m)return!0;let N=h;for(;N++,!(N>=p||(g=f.bMarks[N]+f.tShift[N],v=f.eMarks[N],g<v&&f.sCount[N]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[N]-f.blkIndent>=4)){for(y=g+1;y<=v&&r[(y-g)%a]===f.src[y];y++);if(!(Math.floor((y-g)/a)<b)&&(y-=(y-g)%a,y=f.skipSpaces(y),!(y<v))){k=!0;break}}const M=f.parentType,$=f.lineMax;f.parentType="container",f.lineMax=N;const T=f.push("container_"+t+"_open","div",1);T.markup=A,T.block=!0,T.info=I,T.map=[h,N],f.md.block.tokenize(f,h+1,N);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,y),F.block=!0,f.parentType=M,f.lineMax=$,f.line=N+(k?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 EY(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 o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let y=0;y<a.length;y++){const k=a[y];if(k==="\\"){y++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=y;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function G5(e,t,n){for(const o of e){const s=o,i=s.map;if(Array.isArray(i)&&i.length>=2){const r=Number(i[0]),l=Number(i[1]);Number.isFinite(r)&&Number.isFinite(l)&&(s.map=[r+t,Math.min(l+t,n)])}Array.isArray(s.children)&&G5(s.children,t,n)}}function TY(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(MY,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
169
- `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{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 f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let I=0,N=-1;for(let M=0;M<m.length;M++)if(m[M]==="{"?I++:m[M]==="}"&&I--,I===0){N=M+1;break}N>0&&(h=m.slice(0,N))}h||(f=d||void 0)}if(s)return!0;const y=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=o;){const I=i.bMarks[k]+i.tShift[k],N=i.eMarks[k];if(i.src.slice(I,N).trim()===":::"){g=!0;break}k++}g||(k=o);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.map=[n,g?k:o],v.meta={...v.meta??{},unclosed:!g&&!y},f&&v.attrSet("data-args",f),h)try{const I=JSON.parse(h);for(const[N,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${N}`,$?JSON.stringify(M):String(M))}}catch{const I=EY(h);if(I)for(const[N,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${N}`,$?JSON.stringify(M):String(M))}else v.attrSet("data-attrs",h)}const b=[];for(let I=n+1;I<k;I++){const N=i.bMarks[I]+i.tShift[I],M=i.eMarks[I];b.push(i.src.slice(N,M))}if(b.some(I=>I.trim().length>0)){let I=b.join(`
170
- `);I.endsWith(`
171
- `)||(I+=`
172
- `),I.endsWith(`
173
-
174
- `)||(I+=`
175
- `);const N=i.tokens[i.tokens.length-1];N&&(N.raw=I);const M=[];i.md.block.parse(I,i.md,i.env,M),G5(M,n+1,n+1+b.length),i.tokens.push(...M)}const A=i.push("vmr_container_close","div",-1);return g||(A.hidden=!0,A.map=[o,o]),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ki(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function po(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function W1(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const NY=/^[a-z][a-z0-9_-]*$/;function VS(e){return NY.test(String(e??"").trim().toLowerCase())}function Ti(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return VS(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 o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":VS(s)?s:""}function tc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Ti(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function IY(...e){const t=new Set,n=[];for(const o of e)for(const s of tc(o))t.has(s)||(t.add(s),n.push(s));return n}function LY(e){const t=tc(e);return{key:t.join(","),tags:t}}function Y5(e){return Ti(e)}function $Y(e,t){const n=String(e??""),o=Ti(t);if(!o)return!1;const s=Ki(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function Z5(e,t){const n=Ti(t);return!!n&&!bf.has(n)&&!$Y(e,n)}function FY(e,t){const n=String(e??""),o=Ti(t);if(!o)return n;const s=Ki(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const X5=Wl,OY=bf,Q5=new Set(z5);Q5.delete("details");const BY=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,RY=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Iy=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,DY=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Am(e){return(e.match(Iy)?.[1]??"").toLowerCase()}function w2(e){return/^\s*<\s*\//.test(e)}function _2(e,t){return X5.has(t)||/\/\s*>\s*$/.test(e)}function PY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=Am(i);if(r===t){if(w2(i)){if(n===0)return o;n--;continue}_2(i,r)||n++}}return-1}function HY(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=Am(s);if(i===t){if(w2(s)){n>0&&n--;continue}_2(s,i)||n++}}return n}function KS(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function WY(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function Mm(e){const t=e;return String(t.raw??t.content??t.markup??"")}function zY(e){const t=e;return t.meta||(t.meta={}),t.meta}function Pg(e,t,n){const o=zY(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function UY(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ki(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
176
- `),s=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<o.length;m++)o[m].raw+=h,m<o.length-1&&(o[m].inner+=h);const p=o.pop();Pg(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Ki(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const y=m??(h.type==="html_inline"?Am(p):"");if(!(y&&t.has(y))){r(p);return}const k=w2(p),g=!k&&_2(p,y);if(k){if(!o.length||o[o.length-1].tag!==y){r(p);return}c(p);return}if(r(p),g){Pg(h,p,"");return}o.push({tag:y,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let m=0,y=!0;for(const k of h.children){const g=Mm(k),v=k.type==="html_inline"?Am(g):"",b=v&&t.has(v);let A=g;if(y&&p&&g&&(o.length||b)){const I=p.indexOf(g,m);if(I!==-1)a(p.slice(m,I)),A=p.slice(I,I+g.length),m=I+g.length;else{if(o.length&&!b)continue;y=!1}}f(k,A,v)}y&&p&&m<p.length&&o.length&&a(p.slice(m)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=Mm(h),m=h.type==="html_block"?u(p):null;if(m){c(`${s?`
177
- `:""}${m}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)Pg(h.token,h.raw,h.inner)}function qY(e){return/^\s*<\s*[!?]/.test(e)}function jY(e){const t=new Set(OY);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function GS(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function VY(e,t){let n=null;for(const i of e.matchAll(BY)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();GS(l,t)&&po(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(RY)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();GS(l,t)&&po(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function KY(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function GY(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(KY(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 f=a.slice(d),h=f.match(Iy);if(!h){i("<",c),u=d+1;continue}const p=po(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),y=(h[1]??"").toLowerCase();t.has(y)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=VY(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=Mm(a),s=o.buffer;const c=po(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Mm(a),u=(c.match(Iy)?.[1]??"").toLowerCase();if(u&&t.has(u)&&po(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.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:s??void 0}}const YY=["a","span","strong","em","b","i","u"];function ZY(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Ti(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const b=Ti(String(v??""));b&&p.add(b)}const y=jY(Array.from(p)),k=new Set(YY);for(const v of p)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:y,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!y.has(v)||Q5.has(v)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const y={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[y]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=o(f);for(const y of h){const k=y;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const b=GY(v,p);if(k.children=b.children,b.pendingBuffer){const A=g.lastIndexOf(b.pendingBuffer);if(A!==-1){const I=g.slice(0,A);k.content=I,typeof k.raw=="string"&&(k.raw=I)}}}catch(b){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",b)}}UY(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:y}=o(f),k=[];for(let g=0;g<h.length;g++){const v=h[g];if(k.length>0){const[A,I]=k[k.length-1];if(g!==I){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const N=String(v.content??v.raw??"");if(N){const M=h[I],$=`${String(M.content||"")}
178
- ${N}`,T=po($),F=T===-1?null:KS($,A,T+1);if(F){const S=$.slice(0,F.end),B=$.slice(F.end);M.content=S,M.loading=!1,h.splice(g,1),k.pop();const W=d(M,B)?[]:c(B,u(h,g,"paragraph"));W.length&&h.splice(g,0,...W),g--;continue}M.content=$,M.loading!==!1&&(M.loading=!0)}h.splice(g,1),g--;continue}}const b=s(v);if(b){if(qY(b))continue;const A=(b.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(b);if(!A||!y(A))continue;if(i(v,b),!I)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(b)&&WY(b,A)>0&&k.push([A,g]);else if(k.length>0&&A&&k[k.length-1][0]===A){const[,N]=k[k.length-1],M=h[N];M.content=`${String(M.content||"")}
179
- ${b}`,M.loading=!1,k.pop(),h.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const A=v.content||"",I=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(A);if(A){const[,N]=k[k.length-1],M=h[N];M.content=`${M.content||""}
180
- ${A}`,M.loading!==!1&&(M.loading=!I)}I&&k.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,b=N=>{let M=g.get(N);return M||(M=new RegExp(`<\\s*${N}\\b`,"i"),g.set(N,M)),M},A=N=>{let M=v.get(N);return M||(M=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),v.set(N,M)),M},I=[];for(let N=0;N<h.length;N++){const M=h[N],$=String(M.content??"");if(I.length>0){const F=I[I.length-1],S=h[F.index],B=M.type==="html_block"?A(F.tag).exec($):null;if(B){const L=B.index+B[0].length,O=$.slice(0,L),U=$.slice(L);S.content=`${String(S.content??"")}
181
- ${O}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),I.pop();const Z=d(S,U)?[]:c(U,u(h,N,"paragraph"));Z.length?h.splice(N,1,...Z):(h.splice(N,1),N--);continue}if(M.type!=="inline")continue;const W=Array.isArray(M.children)?M.children:[],z=PY(W,F.tag);if(z!==-1){const L=W.slice(0,z+1),O=W.slice(z+1),U=L.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
182
- ${U}`,Array.isArray(S.children)&&S.children.push(...L),O.length){const Z=O.map(ie=>String(ie.content??ie.raw??"")).join("");if(Z.trim()){const ie=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(N,1),N--;else if(ie.startsWith("<"))h.splice(N,1,{type:"html_block",content:ie});else{const q=c(Z,u(h,N,"paragraph"));h.splice(N,1,...q)}}else h.splice(N,1),N--}else h.splice(N,1),N--;I.pop();continue}S.content=`${String(S.content??"")}
183
- ${$}`,Array.isArray(S.children)&&S.children.push(...W),h.splice(N,1),N--;continue}if(M.type!=="inline")continue;const T=Array.isArray(M.children)?M.children:[];for(const F of m)if((T.length?HY(T,F):b(F).test($)&&!A(F).test($)?1:0)>0){I.push({tag:F,index:N});break}}}{let g=0;for(let v=0;v<h.length;v++){const b=h[v];if(b.type==="paragraph_open"){g++;continue}b.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const M=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(M.startsWith("!")||M.startsWith("?")){v.loading=!1;continue}if(m.has(M)){const z=String(v.content??""),L=po(z),O=L===-1?null:KS(z,M,L+1);v.loading=O?!1:v.loading!==void 0?v.loading:!0;const U=O?.start??-1,Z=O?O.end-O.start:0;if(U!==-1){const ie=z.slice(0,U+Z);let q="";L!==-1&&L<U&&(q=z.slice(L+1,U)),v.children=[{type:M,content:q,raw:ie,attrs:[],tag:M,loading:!1}],v.content=ie,v.raw=ie;const ee=c(z.slice(U+Z)||"","text");ee.length&&h.splice(g+1,0,...ee)}else v.children=[{type:M,content:"",raw:z,attrs:[],tag:M,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(M))continue;v.type="inline";const $=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let T;for(;(T=$.exec(v.content||""))!==null;)T[1],T[2]||T[3]||T[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${M}\\s*>`,"i").exec(F),B=S?S.index:-1,W=S?S[0].length:0;if(B!==-1){const z=F.slice(0,B+W),L=(F.slice(B+W)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:z,tag:M,loading:!1}],v.content=z,v.raw=z,L&&h.splice(g+1,0,L.startsWith("<")?{type:"html_block",content:L}:{type:"text",content:L,raw:L})}else v.children=[{type:"html_block",content:v.content,tag:M,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),$=v.children[1],T=String($?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if($?.type==="html_inline"&&T===M)continue;p.has(M)?(v.children[0].loading=!0,v.children[0].tag=M,v.children.push({type:"html_inline",tag:M,loading:!0,content:`</${M}>`})):v.children=[{type:"html_block",loading:!0,tag:M,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(M))continue;v.children=[{type:"html_block",loading:!1,tag:M,content:v.children.map($=>$.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const b=String(v.content),A=v,I=A.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(b)&&(A.children.length=0);continue}const N=String(I.content??b).match(DY)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(b)||X5.has(N)){A.children=[{type:"html_inline",content:b}];continue}A.children.length=0}}})}function XY(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 QY(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];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&&!XY(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,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}),s+=2}}})}const J5=/\.([a-z0-9]{1,15})$/i,JY=/[_()[\]{}<>]/u,eZ=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,tZ=/[?#@]/u,nZ=/[\\/]/u,oZ=/^[\p{L}\p{N}./\\-]+$/u,sZ=/^[A-Za-z0-9-]{1,63}$/u,iZ=/^xn--[a-z0-9-]{2,59}$/i,rZ=/^(?:[A-Z]{1,6}|\d{1,8})$/u,lZ=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,aZ=/文件名\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,cZ=/文件名\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,uZ=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,dZ=2e3,fZ=512,hZ={},pZ=new Set(["ai","md","py","rs","sh","zip"]),e8=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),mZ=new Set([...e8,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),gZ=new Set(["com","dev","io","page","site"]),vZ=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),yZ=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"]),Ta=new Map;function YS(e,t){if(!e||e.length>fZ)return t;for(Ta.set(e,t);Ta.size>dZ;){const n=Ta.keys().next().value;if(!n)break;Ta.delete(n)}return t}function xf(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Hg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return xf(n)?n:void 0}function ZS(e,t){if(!xf(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 XS(e){const t=Uf(e);return xf(t)?t:void 0}function kZ(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function QS(e,t){if(!xf(t))return;const n=String(e??"").trim().split(/\s+/u).map(kZ).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Em(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Em(s,{marketTicker:!0}))&&(o.marketTicker=!0),xf(o)?o:void 0}function Yl(e,t=!1){let n;return{options(o){return t||o==null?ZS(e,n):ZS(e,Hg(XS(o),QS(o,n)))},remember(o){const s=XS(o);n=t?Hg(n,s):Hg(s,QS(o,n))},reset(){n=void 0}}}function JS(e){return sZ.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function bZ(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return JS(n)||iZ.test(n)?t.every(JS):!1}function t8(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function xZ(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function wZ(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function n8(e,t,n){const o=xZ(t);return t8(e)&&wZ(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function _Z(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Uf(e){const t=String(e??""),n=Ta.get(t);return n?(Ta.delete(t),Ta.set(t,n),n):_Z(t)?YS(t,{explicitFilename:aZ.test(t),filename:cZ.test(t),marketTicker:uZ.test(t)}):YS(t,hZ)}function SZ(e){return bZ(e.split(/[\\/]/)[0]??"")}function CZ(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function AZ(e){if(JY.test(e)||!oZ.test(e))return!0;if(nZ.test(e))return!SZ(e);const t=e.replace(J5,"");return t8(t)?!0:t.split(".").filter(Boolean).some(CZ)}function MZ(e,t,n){if(!(n?mZ:e8).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?lZ:rZ).test(o)}function Em(e,t={}){if(!e||eZ.test(e)||tZ.test(e))return!1;const n=e.match(J5);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return MZ(e,o,t.marketTicker===!0)?!0:yZ.has(o)?!pZ.has(o)||t.filename?!0:AZ(e):!!(t.explicitFilename&&gZ.has(o)||t.filename&&vZ.has(o))}const eC=["!"];function Ns(e){return{type:"text",content:e,raw:e}}function fa(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 ha(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 dl(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function EZ(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(Ns(t))}}function tC(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function TZ(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function NZ(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function nC(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function oC(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];if(o==="(")t++;else if(o===")"){if(t===0)return n;t--}}return-1}function IZ(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=LZ(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function LZ(e,t){if(e.length<3)return e;const n=e.some(r=>r.type==="code_inline"),o=new Map;let s=0;for(let r=0;r<e.length;r++){const l=e[r];if(l.type==="link_open"){let a=-1;for(let c=r+1;c<e.length;c++)if(e[c]?.type==="link_close"){a=c;break}if(a!==-1&&l.markup==="linkify"){o.set(l,s);const c=nC(e,r,a),u=s>0&&c?oC(c):-1;if(u!==-1&&c)for(const d of c.slice(u))d==="("?s++:d===")"&&s>0&&s--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?s++:a===")"&&s>0&&s--}const i=Uf(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let c=r+1;c<e.length;c++)if(e[c]?.type==="link_close"){a=c;break}if(a!==-1){const c=nC(e,r,a),u=TZ(l);if(!n&&l.markup==="linkify"&&c&&!n8(c,u,t)&&Em(c,i)){e.splice(r,a-r+1,Ns(c));continue}let d=tC(c??"",eC);if(l.markup==="linkify"&&c?.includes(")")&&(o.get(l)??0)>0){const p=oC(c);p!==-1&&(d===-1||p<d)&&(d=p)}const f=tC(u,eC);let h=d;for(let p=r+1;p<a;p++){const m=e[p];if(m?.type!=="text"||typeof m.content!="string")continue;if(h>=m.content.length){h-=m.content.length;continue}if(h<0)break;const y=m.content[h],k=m.content.slice(0,h);let g=m.content.slice(h);for(let A=p+1;A<a;A++){const I=e[A];I?.type==="text"&&typeof I.content=="string"&&(g+=I.content)}m.content=k,m.raw=k;const v=a-(p+1);v>0&&(e.splice(p+1,v),a=p+1);let b=u;if(y==="!"&&f!==-1)b=u.slice(0,f);else if(g){const A=encodeURI(g);if(A&&u.endsWith(A))b=u.slice(0,u.length-A.length);else{const I=y?encodeURI(y):"",N=I?u.indexOf(I):-1;N!==-1&&(b=u.slice(0,N))}}b!==u&&NZ(l,b),g&&e.splice(a+1,0,Ns(g));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let c=r+1;c<e.length;c++)if(e[c]?.type==="em_close"){e[c].type="strong_close",e[c].tag="strong",e[c].markup="**";break}}else if(l?.type==="text"&&l.content?.endsWith("(")&&e[r+1]?.type==="link_open"){const a=l.content.match(/\[([^\]]+)\]/);if(a){let c=l.content.slice(0,a.index);const u=c.match(/(\*+)$/),d=[];if(u){c=c.slice(0,u.index),c&&d.push(Ns(c));const f=a[1],h=u[1].length;fa(d,h);let p=e[r+2]?.content||"";if(e[r+4]?.type==="text"&&!e[r+4].content?.startsWith(")")&&(p+=e[r+4]?.content||"",e[r+4].content=""),d.push(dl(f,p,!e[r+4]?.content?.startsWith(")"))),ha(d,h),e[r+4]?.type==="text"){const m=e[r+4].content?.replace(/^\)\**/,"");m&&d.push(Ns(m)),e.splice(r,5,...d)}else e.splice(r,4,...d)}else{c&&d.push(Ns(c));let f=a[1];const h=f.match(/^\*+/);if(h){const m=h[0].length;f=f.replace(/^\*+/,"").replace(/\*+$/,"");let y=e[r+2]?.content||"";if(e[r+4]?.type==="text"&&!e[r+4].content?.startsWith(")")&&(y+=e[r+4]?.content||"",e[r+4].content=""),fa(d,m),d.push(dl(f,y,!e[r+4]?.content?.startsWith(")"))),ha(d,m),e[r+4]?.type==="text"){const k=e[r+4].content?.replace(/^\)/,"");k&&d.push(Ns(k)),e.splice(r,5,...d)}else e.splice(r,4,...d);r===0?r=d.length-1:r-=d.length+1;continue}let p=e[r+2]?.content||"";if(e[r+4]?.type==="text"&&!e[r+4].content?.startsWith(")")&&(p+=e[r+4]?.content||"",e[r+4].content=""),d.push(dl(f,p,!e[r+4]?.content?.startsWith(")"))),e[r+4]?.type==="text"){const m=e[r+4].content?.replace(/^\)/,"");m&&d.push(Ns(m)),e.splice(r,5,...d)}else e.splice(r,4,...d)}r-=d.length+1;continue}}else if(l.type==="link_open"&&l.markup==="linkify"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("(")){if(e[r-2]?.type==="link_close"){const a=[],c=e[r-3].content||"";let u=l.attrs?.find(d=>d[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(u+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(dl(c,u,f));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(Ns(h)),e.splice(r-4,8,...a)}else a.push({type:"link",loading:!0,href:u,title:"",text:c,children:[{type:"text",content:u,raw:u}],raw:`[${c}](${u})`}),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,c]=e[r-3].content?.split("[**")||[];e[r+1].content=c||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,c]=e[r-3].content?.split("[*")||[];e[r+1].content=c||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,c]=e[r-3].content?.split("[")||[];e[r+1].content=c||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",c=e[r-2].attrs||[],u=c.find(k=>k[0]==="href")?.[1]||"",d=c.find(k=>k[0]==="title")?.[1]||"";let f=3,h=2;const p=(e[r-3]?.content||"").match(/^(\*+)$/),m=[];if(p){h+=1;const k=p[1].length;fa(m,k)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let k=r+1;k<e.length;k++){const g=p?p[1].length:e[r-3].markup.length,v=e[k];if(g===1&&v.type==="em_close")break;if(g===2&&v.type==="strong_close")break;if(g===3&&(v.type==="em_close"||v.type==="strong_close"))break;f+=1}}const y={type:"link",loading:!1,href:u,title:d,text:a,children:[{type:"text",content:a,raw:a}],raw:`[${a}](${u})`};if(m.push(y),p){const k=p[1].length;ha(m,k)}e.splice(r-h,f,...m),r-=m.length+1;continue}else if(l.content?.startsWith("](")&&e[r-1].markup?.includes("*")&&e[r-4]?.type==="text"&&e[r-4].content?.endsWith("[")){const a=e[r-1].markup.length,c=[],u=e[r-4].content.slice(0,e[r-4].content.length-a);u&&c.push(Ns(u)),fa(c,a);const d=e[r-2].content||"";let f=l.content.slice(2),h=!0;if(e[r+1]?.type==="text"){const p=(e[r+1]?.content??"").indexOf(")");h=p===-1,p===-1&&(f+=e[r+1]?.content?.slice(0,p)||"",e[r+1].content="")}if(c.push(dl(d,f,h)),ha(c,a),e[r+1]?.type==="text"){const p=e[r+1].content?.replace(/^\)\**/,"");p&&c.push(Ns(p)),e.splice(r-4,8,...c)}else e[r+1]?.type==="link_open"?e.splice(r-4,10,...c):e.splice(r-4,7,...c);r-=c.length+1;continue}else if(l.content?.startsWith("](")&&e[r-1].type==="strong_close"&&e[r-4]?.type==="text"&&e[r-4]?.content?.includes("**[")){const a=[],c=e[r-4].content.split("**[")[0];c&&a.push(Ns(c)),fa(a,2);const u=e[r-2].content||"";let d=l.content.slice(2),f=!0;if(e[r+1]?.type==="text"){const h=(e[r+1]?.content??"").indexOf(")");f=h===-1,h===-1&&(d+=e[r+1]?.content?.slice(0,h)||"",e[r+1].content="")}if(a.push(dl(u,d,f)),ha(a,2),e[r+1]?.type==="text"){const h=e[r+1].content?.replace(/^\)\**/,"");h&&a.push(Ns(h)),e.splice(r-4,8,...a)}else e[r+1]?.type==="link_open"?e.splice(r-4,10,...a):e.splice(r-4,7,...a);r-=a.length+1;continue}else if(l.type==="strong_close"&&e[r+1]?.type==="text"&&e[r+1].content?.includes("](")&&e[r-1].type==="text"&&/\[.*$/.test(e[r-1].content||"")){const a=[],[c,u]=e[r-1].content?.split("[")||["",""];c&&a.push(Ns(c)),fa(a,2);let[d,f]=e[r+1].content.split("](");d=u+d;let h=4;if(e[r+2]?.type==="link_open"){const m=e[r+2].attrs?.find(y=>y[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(m||f)+e[r+5].content,e[r+5].content=""):f=m||f,h+=3}let p=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const m=(e[r+2]?.content??"").indexOf(")");p=m===-1,m===-1&&(f+=e[r+2]?.content?.slice(0,m)||"",e[r+2].content="")}a.push(dl(d,f,p)),ha(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const c=(a[2]||"")+a[1];let u=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!u&&e[r+4]?.type==="text"&&(u=e[r+4].content||"");const d=[];fa(d,2),d.push(dl(c,u,!1)),ha(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r<e.length-1;r++){const l=e[r],a=e[r+1];if(l?.type!=="link"||a?.type!=="text"||typeof a.content!="string"||!a.content.startsWith("!"))continue;const c=String(l.href??"");if(String(l.text??"")!==c||!c.endsWith("=")&&!c.endsWith("#"))continue;EZ(l,"!");const u=a.content.slice(1);u?(a.content=u,a.raw=u):e.splice(r+1,1)}return e}function $Z(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=FZ(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function FZ(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 OZ(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=BZ(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function BZ(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let y=u+1;for(;y<e.length&&e[y].type==="text"&&e[y].content==="";)y++;const k=e[y];h==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="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(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let y=u+1;for(;y<e.length&&e[y].type==="text"&&e[y].content==="";)y++;const k=e[y];h==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&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),s--,s<0&&(s=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,f=[{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:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=RZ(l),l}function RZ(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.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 f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=DZ(e,n+6);if(u){t.push(o),t.push(s),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(o)}return t}function DZ(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function PZ(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=jZ(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function sC(){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 iC(){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 rC(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 o8(e,t){if(!e.startsWith("|")||e.includes(`
184
- `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function Wg(e){return o8(e)!==null}function s8(e){return/^:?-+:?$/.test(e.trim())}function HZ(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(s8)}function WZ(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function zZ(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(s8)&&WZ(n)}function UZ(e){return e==="|"||e==="|:"}function qZ(e){const t=o8(e);return t!==null&&t.every(n=>!n.includes(":"))}function jZ(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
185
- `)[0]??"",[a="",c="",...u]=r.split(`
186
- `),d=!t&&!r.includes(`
187
- `)&&/\r?\n$/.test(n)&&Wg(r);if(!t&&(r.includes(`
188
- `)&&u.length===0&&Wg(a)&&zZ(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>rC(p)),h=[...sC(),...f,...iC()];o.splice(s-1,3,...h)}else if(r.includes(`
189
- `)&&u.length===0&&Wg(a)&&HZ(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>rC(p)),h=[...sC(),...f,...iC()];o.splice(s-1,3,...h)}else r.includes(`
190
- `)&&u.length===0&&qZ(a)&&UZ(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function VZ(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-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=o;let l=0,a=t;for(;a<s;){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 KZ=VZ;const GZ=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Tm=GZ.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),YZ=/\\[a-z]+/i,i8="(?:\\\\|\\u0008)",ZZ=new RegExp(String.raw`${i8}(?:${Tm})\s*\{[^}]+\}`,"i"),XZ=new RegExp(String.raw`(?:${i8})?(?:${Tm})\s*\{`,"i"),QZ=/\\(?:text|frac|left|right|times)/,JZ=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,eX=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,tX=/[A-Z]+\s*\([^)]+\)/i,nX=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,oX=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,sX=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,iX={"\b":"\\b","\v":"\\v","\f":"\\f"};function rX(e){let t="";for(const n of e)t+=iX[n]??n;return t}function Cl(e){if(!e)return!1;const t=rX(e),n=t.trim();if(sX.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=YZ.test(t),s=ZZ.test(t),i=XZ.test(t),r=QZ.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=JZ.test(t)&&!eX.test(t),c=tX.test(t),u=nX.test(n),d=oX.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const r8="__markstreamMathPluginApplied",Ly=80,l8=2e4,lC=l8+4096;function S2(e){return!!e[r8]}function lX(e){e[r8]=!0}const a8=["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"],aX=["cdot","mathbf{","partial","mu_{"],c8=a8.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),u8="[ \r\b\f\v]",cX=new RegExp(`([^\\\\])(${aX.map(e=>e).join("|")})+`,"g"),uX=/span\{([^}]+)\}/,dX=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,fX=/(^|[^\\])\\\r?\n/g,hX=/(^|[^\\])\\$/g,pX=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,mX=new RegExp(`(${u8})|(${c8})\\b`,"g"),aC=new Map,cC=new Map;function gX(e){if(!e)return mX;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=aC.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${u8})|(${s})\\b`,"g");return aC.set(n,i),i}function vX(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=cC.get(o);if(s)return s;const i=e?[Tm,c8].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Tm].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return cC.set(o,r),r}const uC={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function dC(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function yX(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&pX.test(n))return t;const o=n?t.slice(n.length):t;return`${n}${"\\!".repeat(o.length)}`})}function fC(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function fl(e,t){const n=t?.commands??a8,o=t?.escapeExclamation??!0,s=t?.commands==null,i=gX(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&uC[u]!==void 0)return`\\${uC[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=yX(r));let l=r;const a=vX(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(uX,"span\\{$1\\}").replace(dX,"\\operatorname{span}\\{$1\\}"),l=l.replace(fX,`$1\\\\
191
- `),l=l.replace(hX,"$1\\\\"),l=l.replace(cX,"$1\\$2"),l}function hC(e){const t=e.trim();return!(!Cl(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 d8(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,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===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Nm(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function kX(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+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([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function qf(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function $y(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(qf(e,o)){n=o+1;continue}return o}return-1}function zg(e,t){let n=t;for(;n<e.length;){const o=$y(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Pc(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!qf(e,s))return s;o=s+Math.max(1,t.length)}return-1}function pC(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Nm(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}qf(e,a)||i++,r=a+Math.max(1,t.length)}return i}function C2(e,t,n){const o=_f(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!_f(o.slice(0,s)).trim()||qf(o,s))return-1;const i=d8(o);if(Nm(i,s))return-1;const r=pC(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>pC(o,n,0,s,i))return-1;return s}function wf(e){return e===" "||e===" "}function _f(e){let t=e.length;for(;t>0&&wf(e[t-1]);)t--;return e.slice(0,t)}function mC(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
192
- `&&t++;return t}function gC(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function bX(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!wf(s))return!1}return n>=3}function xX(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function wX(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(xX)}function _X(e){let t=0;if(!gC(e[t]))return!1;for(;gC(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:wf(e[t+1])}function f8(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&wf(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&wf(t[1])||_X(t)||bX(t)||wX(t))}function vC(e,t){return e?t?`${e}
193
- ${t}`:e:t}function Fy(e){const t=String(e??"").trim();return t?Cl(t):!1}function yC(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function h8(e){if(e.length<=lC)return{source:e,lineOffset:0};let t=e.length-lC;const n=e.indexOf(`
194
- `,t);return n===-1?{source:"",lineOffset:mC(e)}:(t=n+1,{source:e.slice(t),lineOffset:mC(e.slice(0,t))})}function p8(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=h8(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-Ly-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=_f(o[r]);if(l&&!f8(l)){for(const[a,c]of i)if(C2(l,a,c)!==-1)return!0}}return!1}function SX(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=h8(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-Ly-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=_f(s[l]);for(const[c,u]of r){const d=C2(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>Ly){h=!0;break}const m=s[p],y=Pc(m,u);if(y!==-1){const k=vC(f,m.slice(0,y));if(!Fy(k)){h=!0;break}const g=m.slice(y+u.length),v=g.trim()?`suffix:${yC(g)}`:"nosuffix";return["closed",c,o+l,d,o+p,y,yC(k),v].join(":")}if(f8(m)){h=!0;break}if(f=vC(f,m),f.length>l8){h=!0;break}}if(!h&&Fy(f))return["pending",c,o+l,d].join(":")}}return null}function Ug(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function CX(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function qg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function AX(e,t){lX(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let b=v;for(;b<g.length&&(g[b]===" "||g[b]===" ");)b++;if(b===v||!(g[b]===`
195
- `||g[b]==="\r"&&g[b+1]===`
196
- `))return v;const A=g.slice(v,b),I=a.push("text","",0);return I.content=A,b};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,b=a.src[g];if(v>=3&&(!b||/\s/.test(b))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,y=p;const k=p;for(const[g,v]of f){const b=a.src,A=d8(b),I=kX(b,u);let N=!1;g==="$$"&&m!==k&&(m=k);let M=-1,$=-1,T=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const z=a.push("text_special","",0);z.content=S==="\\)"?")":"(",z.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let z=0;for(;z<S.length;){const L=$y(S,z);if(L===-1){const K=S.slice(z);if(K){const ve=a.push("text","",0);ve.content=K,a.pos=a.pos+K.length,m=a.pos}break}if(L>0&&S[L-1]==="$"||L+1<S.length&&S[L+1]==="$"){const K=S.slice(z,L+1);if(K){const ve=a.push("text","",0);ve.content=K,a.pos=a.pos+K.length,m=a.pos}z=L+1;continue}const O=S.slice(z,L);if(O){const K=a.push("text","",0);K.content=O,a.pos=a.pos+O.length,m=a.pos}const U=zg(S,L+1);if(U===-1){const K=S.slice(L),ve=a.push("text","",0);ve.content=K,a.pos=a.pos+K.length,m=a.pos;break}const Z=S.slice(L+1,U),ie=Z.includes("`"),q=!Z||!Z.trim(),ee=S[U+1],fe=Ug(Z,ee),ne=qg(Z);if(!ie&&!q&&!fe&&!ne){const K=a.push("math_inline","math",0);K.content=fl(Z,t),K.markup="$",K.raw=`$${Z}$`,K.loading=!1,a.pos=a.pos+(U-L+1),m=a.pos,z=U+1;continue}const j=a.push("text","",0);j.content="$",a.pos=a.pos+1,m=a.pos,z=L+1}return}const B=S.indexOf("![");if(B!==-1){if(B>0){const O=S.slice(0,B),U=a.push("text","",0);U.content=O,a.pos=a.pos+O.length,m=a.pos}const z=S.slice(B).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,O,U]=z,Z=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),ie=Z?Z[1]:U,q=Z&&Z[2]?Z[2]:null,ee=a.push("image","img",0);ee.attrs=[["src",ie],["alt",O]],q&&ee.attrs.push(["title",q]),ee.content=O,ee.children=[{type:"text",content:O,tag:""}],a.pos=a.pos+z[0].length,m=a.pos;const fe=S.slice(B+z[0].length);fe&&F(fe);return}const L=a.push("text","",0);L.content=S,a.pos=a.pos+S.length,m=a.pos;return}const W=a.push("text","",0);W.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=b.length);){const S=b.indexOf(g,m);if(S===-1)break;if(qf(b,S)){m=S+Math.max(1,g.length);continue}const B=Nm(A,S);if(B){m=B[1];continue}const W=Nm(I,S);if(W){m=W[1];continue}if(S===M&&m===$){if(T++,T>2){m=S+Math.max(1,g.length);continue}}else T=0,M=S,$=m;if(g==="("&&S>0){let fe=S-1;for(;fe>=0&&b[fe]===" ";)fe--;if(fe>=0&&b[fe]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&b[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<b.length-1&&b[S+1]==="$"){m=S+2;continue}const z=g==="$"?zg(b,S+g.length):KZ(b,S+g.length,g,v);if(z===-1){const fe=b.slice(S+g.length);if(fe.includes(g)){m=b.indexOf(g,S+g.length);continue}if(z===-1){const ne=g==="$"&&CX(fe);if(u&&!c&&!ne&&Cl(fe)&&!fe.includes("`")){if(m=S+g.length,N=!0,!l){a.pending="";const j=y?b.slice(y,m):b.slice(0,m),K=dC(j)%2===1;if(y)F(b.slice(y,m));else{let ve=b.slice(0,m);ve.endsWith(g)&&(ve=ve.slice(0,ve.length-g.length)),F(ve)}if(K){const ve=fC(j)?.marker??"**",he=a.push("strong_open","",0);he.markup=ve;const Ae=a.push("math_inline","math",0);Ae.content=fl(fe,t),Ae.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ae.raw=`${g}${fe}${v}`,Ae.loading=!0,he.content=fe,a.push("strong_close","",0)}else{const ve=a.push("math_inline","math",0);ve.content=fl(fe,t),ve.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ve.raw=`${g}${fe}${v}`,ve.loading=!0}a.pos=b.length}m=b.length,y=m}break}}const L=b.slice(S+g.length,z),O=L.includes("`"),U=!L||!L.trim(),Z=g==="$",ie=b[z+v.length],q=Z&&Ug(L,ie),ee=Z&&qg(L);if(c?O||U||q||ee:O||U||q||ee||!Z&&!Cl(L)){m=z+v.length;const fe=b.slice(a.pos,m);a.pending||(F(fe),y=m);continue}if(N=!0,!l){const fe=b.slice(a.pos-(a.pending??"").length,S);let ne=b.slice(0,m)?b.slice(y,S):fe;const j=dC(ne)%2===1;S!==a.pos&&j&&(ne=a.pending+b.slice(a.pos,S));const K=j?fC(ne):null,ve=K?.marker??"**";if(a.pending!==ne)if(a.pending="",j)if(K){const he=ne.slice(K.index+ve.length);F(ne.slice(0,K.index));const Ae=a.push("strong_open","",0);Ae.markup=ve;const re=a.push("text","",0);re.content=he,a.push("strong_close","",0)}else F(ne);else F(ne);if(j){const he=a.push("strong_open","",0);he.markup=ve;const Ae=a.push("math_inline","math",0);Ae.content=fl(L,t),Ae.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ae.raw=`${g}${L}${v}`,Ae.loading=!1;const re=b.slice(z+v.length).startsWith(ve);return re&&a.push("strong_close","",0),a.pos=d(b,z+v.length),m=a.pos,y=m,re||a.push("strong_close","",0),!0}else{const he=a.push("math_inline","math",0);he.content=fl(L,t),he.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",he.raw=`${g}${L}${v}`,he.loading=!1}}return m=d(b,z+v.length),y=m,a.pos=m,!0}if(N){if(l)a.pos=m;else{if(g==="$$"&&m<b.length&&b.slice(m).includes("$")){let S=m;for(;!(S>=b.length);){const B=$y(b,S);if(B===-1)break;if(B+1<b.length&&b[B+1]==="$"){S=B+2;continue}if(B>0&&b[B-1]==="$"){S=B+1;continue}const W=zg(b,B+1);if(W===-1)break;const z=b.slice(B+1,W),L=z.includes("`"),O=!z||!z.trim(),U=b[W+1],Z=Ug(z,U),ie=qg(z);if(!L&&!O&&!Z&&!ie){const q=b.slice(m,B);q&&F(q);const ee=a.push("math_inline","math",0);ee.content=fl(z,t),ee.markup="$",ee.raw=`$${z}$`,ee.loading=!1,m=W+1,S=W+1}else F("$"),S=B+1}S<b.length&&F(b.slice(S))}else m<b.length&&F(b.slice(m));a.pos=b.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),y=!1,k="",g="",v=!1,b="",A=!1;for(const[q,ee]of h)if(m.startsWith(q))if(q.includes("[")){const fe=q==="\\["?m.slice(q.length):"";if(q==="\\["&&Pc(fe,ee)===-1&&!/^\s*!\[/.test(fe)&&!fe.includes("`")&&Cl(fe)){y=!0,k=q,g=ee;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){y=!0,k=q,g=ee;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){y=!0,k=q,g=ee;break}continue}else{const ne=u.tokens[u.tokens.length-1];if(ne&&ne.type==="list_item_open"&&ne.mark==="-"&&m.slice(q.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const j=m.indexOf("]");if(m.slice(j).trim()!=="]")continue;const K=m.slice(q.length,j);if(q==="["?hC(K):Cl(K)){y=!0,k=q,g=ee;break}continue}}}else{y=!0,k=q,g=ee;break}else if((q==="$$"||q==="\\[")&&m.endsWith(q)&&l+1<a){const fe=C2(m,q,ee);if(fe===-1)continue;b=_f(m.slice(0,fe)),A=!0;const ne=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(ne,u.eMarks[l+1]).trim(),v=!0,y=!0,k=q,g=ee;break}if(!y)return!1;if(c&&!A)return!0;const I=m.indexOf(k),N=I+k.length,M=!f&&k==="["?m.indexOf("\\]",N):-1,$=M>=0?"\\]":g,T=M>=0?M:Pc(m,g,N);if(!v&&T>k.length){const q=m.slice(I+k.length,T),ee=u.push("math_block","math",0);ee.content=fl(q),ee.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ee.map=[l,l+1],ee.raw=`${k}${q}${$}`,ee.block=!0,ee.loading=!1,u.line=l+1;const fe=m.slice(T+$.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",B=!1,W="",z=l;const L=v?m:m===k?"":m.slice(k.length),O=!f&&k==="\\["?"]":"",U=Pc(L,g);if(U!==-1){const q=U;S=L.slice(0,q),W=L.slice(q+g.length),z=v?l+1:l,B=!0,F=z}else for(L&&!v&&(S=L),F=l+1;F<a;F++){const q=u.bMarks[F]+u.tShift[F],ee=u.eMarks[F],fe=u.src.slice(q,ee),ne=fe.trim();if(!f&&k==="["&&ne==="\\]"){g="\\]",B=!0;break}if(O&&fe.trim()===O){g=O,B=!0;break}if(ne===g){B=!0;break}else if(!f&&k==="["&&fe.includes("\\]")){B=!0;const j=fe.indexOf("\\]");g="\\]";const K=fe.slice(0,j);K&&(S+=(S?`
197
- `:"")+K),W=fe.slice(j+g.length),z=F;break}else if(Pc(fe,g)!==-1){B=!0;const j=Pc(fe,g),K=fe.slice(0,j);K&&(S+=(S?`
198
- `:"")+K),W=fe.slice(j+g.length),z=F;break}S+=(S?`
199
- `:"")+fe}if((!d||f)&&!B)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&Fy(S):k==="$$"?!Z:k==="["?hC(S):Cl(S)))return!1;if(c)return!0;b&&n(u,b,l);const ie=u.push("math_block","math",0);return ie.content=fl(S),ie.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ie.raw=`${k}${S}${S.startsWith(`
200
- `)?`
201
- `:""}${g}`,ie.map=[l,F+1],ie.block=!0,ie.loading=!B,u.line=F+1,W.trim()&&n(u,W,z),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function MX(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}const EX=/^<a[>\s]/i,TX=/^<\/a\s*>/i;function NX(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.pretest(String(e.content??""));let o=0;for(let s=n.length-1;s>=0;s--){const i=n[s];if(i?.type==="link_close"){for(s--;s>=0&&n[s]?.level!==i.level&&n[s]?.type!=="link_open";)s--;continue}if(i?.type==="html_inline"){const r=String(i.content??"");EX.test(r)&&o>0&&o--,TX.test(r)&&o++}if(!(o>0)&&i?.type==="text"&&t.pretest(String(i.content??"")))return!0}return!1}function IX(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(o=>o.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",o=>{if(!o.md?.options?.linkify)return;const s=Array.isArray(o.tokens)?o.tokens:[],i=o.md.linkify;if(!i)return;const r=s.filter(l=>NX(l,i));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(o)),o,{tokens:r}))})}function LX(e){const t=e.inline.ruler,n=t.getNamedRules?.(),o=n?.find(l=>l.name==="link")?.fn,s=n?.find(l=>l.name==="image")?.fn;if(typeof o!="function"||typeof s!="function")return;const i=e.validateLink,r=e;r.__markstreamOriginalValidateLink=i,t.at("link",(...l)=>{const a=l[0].md,c=a?.validateLink===i?a.options?.validateLink:a?.validateLink;if(!a||typeof c!="function")return o(...l);const u=a.validateLink;a.validateLink=c;try{return o(...l)}finally{a.validateLink=u}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return s(...l);const c=a.validateLink;a.validateLink=i;try{return s(...l)}finally{a.validateLink=c}})}function $X(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new cY({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ra(r,{tagName:"a",attrName:"href"})}),LX(i),IX(i),(e.enableMath??!0)&&AX(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&TY(i),e.enableFixIndentedCodeBlock!==!1&&QY(i),IZ(i),OZ(i),$Z(i),PZ(i),MX(i),ZY(i,{customHtmlTags:e.customHtmlTags}),i}function Da(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=>Da(n))),t}function FX(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function OX(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function BX(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Zh(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...ao(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const kC=/\r?\n[ \t]*`+\s*$/,m8=["diff ","index ","--- ","+++ ","@@ "],RX=/\r?\n/;function DX(e){const t=String(e??"");return t?m8.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function bC(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function xC(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function PX(e,t){const n=[],o=[],s=[],i=[],r=e.split(RX),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!m8.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);s.push(xC(m,a))}else if(p.startsWith("+")){const m=p.slice(1);i.push(xC(m,a))}else{bC(n,o,s,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&DX(p)||c(p)}(t||s.length>0||i.length>0)&&bC(n,o,s,i);const d=n.join(`
202
- `),f=o.join(`
203
- `);return{original:t&&l&&d?`${d}
204
- `:d,updated:t&&l&&f?`${f}
205
- `:f}}function A2(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!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(kC.test(a)&&(a=a.replace(kC,"")),r){const{original:c,updated:u}=PX(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function HX(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function WX(){return{type:"hardbreak",raw:`\\
206
- `}}function zX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let jg=null;const Vg=new WeakMap;function wC(){return jg||(jg={customTagSet:null,allowedTagSet:j1()}),jg}function g8(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function v8(e){return/^<\s*\//.test(e)}function y8(e,t){return/\/\s*>\s*$/.test(t)||Wl.has(e)}function UX(e){if(!e||e.length===0)return wC();const t=Vg.get(e);if(t)return t;const n=e.map(Ti).filter(Boolean);if(!n.length){const s=wC();return Vg.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:j1({customHtmlTags:e})};return Vg.set(e,o),o}function k8(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function qX(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Im(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function jX(e,t,n){const o=e.slice();return Im(o,"href")||o.push(["href",t]),n!=null&&!Im(o,"title")&&o.push(["title",n]),o}function Oy(e){return e.map(k8).join("")}function Ip(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Ip(o.children)});continue}t.push(o)}return t}function VX(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=g8(r),a=v8(r),c=y8(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function Kg(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?VX(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:Oy(o),innerTokens:s,nextIndex:i}}function KX(e,t,n,o,s,i,r){const l=String(e.content??""),a=g8(l),{customTagSet:c,allowedTagSet:u}=UX(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Kg(t,n,a).closed){const A=k8(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=v8(l),f=y8(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=Kg(t,n,a),I=W1(l),N=A.innerTokens,M=String(Im(I,"href")??""),$=Im(I,"title"),T=$==null?null:String($),F=jX(I,M,T),S=Ip(N.length?o(N,s,i,r):[]),B=N.length?Oy(N):M||"";return!S.length&&B&&S.push({type:"text",content:B,raw:B}),[{type:"link",href:M,title:T,text:B,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=Kg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Ip(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Ip(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let m=h.html||l,y=!h.closed,k=!1;if(!h.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),k=!0,y=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=v.exec(l))!==null;){const A=b[1],I=b[2]||b[3]||b[4]||"";g.push([A,I])}if(c?.has(a)){const A=qX(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:h.innerTokens.length?Oy(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??m,loading:e.loading||y,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:y,autoClosed:k},h.nextIndex]}function b8(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=>b8(t)).join(""):String(e.content??"")}function GX(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>b8(t)).join("")}function _C(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=GX(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.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:s,alt:l,title:c,raw:u,loading:t}}function YX(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function ZX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function XX(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Lm(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function QX(e,t,n){const o=e.slice();return Lm(o,"href")||o.push(["href",t]),n!=null&&!Lm(o,"title")&&o.push(["title",n]),o}function Xh(e,t,n){const o=e[t],s=XX(o.attrs),i=String(Lm(s,"href")??""),r=Lm(s,"title"),l=r==null?null:String(r),a=QX(s,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 f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(y=>y.type==="strong_open")){const y=String(h.content??""),k=String(h.raw??y),g=Da(h);g.content=y.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=ao(f,void 0,void 0,n),m=p.map(y=>{const k=y;return"content"in y?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function SC(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 JX(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function CC(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const eQ=/\\([\\()[\]`$|*_\-!])/g;function tQ(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(eQ,"$1")===t))return n}function ad(e,t,n,o){const s=[];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={...o,__insideStrong:!0};return s.push(...ao(l,tQ(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function nQ(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...ao(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function oQ(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function sQ(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const iQ=/[^~]*~{2,}[^~]+/,rQ=/\*\*/,lQ=/[[_*^~]/,aQ=/\\([\\()[\]`$|*_\-!])/g,M2=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),cQ=/\s/u,uQ=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,dQ=/\p{P}/u,fQ=/^[《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,hQ=/^[》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,pQ=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,mQ=/:\/\//,By=1,x8=2,gQ=4,vQ=8,w8=16,kl=32,Lp=64,wd=128,_8=256,yQ=512,_d=1024,kQ=1982;function Qh(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=wd;break;case 36:t|=_8;break;case 40:t|=_d;break;case 42:t|=x8;break;case 91:t|=kl;break;case 92:t|=By;break;case 93:t|=Lp;break;case 95:t|=gQ;break;case 96:t|=w8;break;case 124:t|=yQ;break;case 126:t|=vQ;break}return t}function bQ(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 S8(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&M2.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function zl(e){return!!e&&cQ.test(e)}function Ul(e){return!!e&&(uQ.test(e)||dQ.test(e))}function C8(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&fQ.test(e)}function A8(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&hQ.test(e)}function xQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||zl(o)?!1:!(Ul(o)&&!C8(o,n)&&n&&!zl(n)&&!Ul(n))}function wQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||zl(n)?!1:!(Ul(n)&&!A8(n,o)&&o&&!zl(o)&&!Ul(o))}function _Q(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?S8(e,o):t.indexOf("*",o);if(i===-1)break;if(wQ(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function SQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||zl(o)?!1:!(Ul(o)&&!C8(o,n)&&n&&!zl(n)&&!Ul(n))}function CQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||zl(n)?!1:!(Ul(n)&&!A8(n,o)&&o&&!zl(o)&&!Ul(o))}function AQ(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(CQ(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function MQ(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&M2.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function EQ(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&M2.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function TQ(e,t,n){const o=EQ(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const NQ=/[\p{L}\p{N}]/u,IQ=/^[\p{L}\p{N}]+$/u;function Ry(e){return e?NQ.test(e):!1}function M8(e){return e?IQ.test(e):!1}function zd(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:Ry(o)&&Ry(s)}}function LQ(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=zd(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!M8(e.slice(o.end,s.start)))return s.end}return-1}function $Q(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function FQ(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=zd(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function OQ(e){return e?pQ.test(e)||mQ.test(e):!1}function BQ(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function ao(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Uf(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(Y,Q){const P=e.length===1?t:String(Q.content??""),G=[],me=LQ(Y);if(me!==-1){A(Y.slice(0,me),Y.slice(0,me));const de=Y.slice(me);return de&&(F({type:"text",content:de,raw:de}),u--),u++,!0}if(iQ.test(Y)){const de=Y.indexOf("~~");de!==-1&&G.push({type:"strikethrough",index:de})}if(rQ.test(Y)){const de=Y.indexOf("**");de!==-1&&G.push({type:"strong",index:de})}if(/[^*]*\*[^*]+/.test(Y)){const de=P?S8(P,0):Y.indexOf("*");if(P&&de===-1)return!1;de!==-1&&G.push({type:"emphasis",index:de})}G.sort((de,V)=>de.index!==V.index?de.index-V.index:de.type===V.type?0:de.type==="strong"?-1:V.type==="strong"?1:0);const ye=G[0];if(!ye)return!1;if(ye.type==="strikethrough"){const de=ye.index,V=de>-1?Y.slice(0,de):"";if(V&&A(V,V),de===-1)return u++,!0;const se=Y.indexOf("~~",de+2),pe=se===-1?Y.slice(de+2):Y.slice(de+2,se),ke=se===-1?"":Y.slice(se+2),{node:Ne}=CC([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),b(Ne),ke&&(F({type:"text",content:ke,raw:ke}),u--),u++,!0}if(ye.type==="strong"){const de=ye.index,V=de>-1?Y.slice(0,de):"";if(V&&A(V,V),de===-1)return u++,!0;if(t&&de===0){let be=!1,xe=0;for(;xe<Y.length&&Y[xe]==="*";)xe++;if(t.startsWith("\\*")&&(be=!0),be){let Ze=0,tt=0;for(;tt<t.length&&Ze<xe;)if(t[tt]==="\\"&&tt+1<t.length&&t[tt+1]==="*")Ze+=1,tt+=2;else{if(t[tt]==="*")break;tt++}if(Ze>=2)return A(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>bQ(t))return A(Y.slice(V.length),Y.slice(V.length)),u++,!0;const se=zd(Y,de);if(se.len>=3){const be=FQ(Y,de+se.len);if(be!==-1){const xe=Y.slice(de+se.len,be);if($Q(xe)){const{node:Ze}=ad([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:xe,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,o);p(),b(Ze);const tt=Y.slice(be+3);return tt&&(F({type:"text",content:tt,raw:tt}),u--),u++,!0}}}if(!SQ(Y,de)){const be=Y.slice(de,de+se.len);A(be,be);const xe=Y.slice(de+se.len);return xe&&(F({type:"text",content:xe,raw:xe}),u--),u++,!0}const pe=AQ(Y,de+2);let ke="",Ne="";if(pe.index!==-1){ke=Y.slice(de+2,pe.index),Ne=Y.slice(pe.index+2);const be=pe.index,xe=zd(Y,be);if(se.intraword&&xe.intraword&&!M8(ke)||!ke&&se.len>=4&&se.intraword)return A(Y.slice(V.length),Y.slice(V.length)),u++,!0}else{if(d||pe.sawInvalidClose||se.intraword)return A(Y.slice(V.length),Y.slice(V.length)),u++,!0;ke=Y.slice(de+2),Ne=""}if(!ke&&/^\*+$/.test(Ne))return A(Y,Y),u++,!0;const{node:qe}=ad([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ke,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),b(qe),Ne&&(F({type:"text",content:Ne,raw:Ne}),u--),u++,!0}if(ye.type==="emphasis"){let de=ye.index;de===-1&&(de=0);const V=Y.slice(0,de);if(V&&A(V,V),!xQ(Y,de)){A(Y[de],Y[de]);const be=Y.slice(de+1);return be&&(F({type:"text",content:be,raw:be}),u--),u++,!0}const se=zd(Y,de),pe=_Q(P,Y,de+1),ke=pe.index,Ne=e[u+1];if(o?.final&&Ne?.type==="em_open"&&ke!==-1&&Y.slice(de+1,ke).trim()!==Y.slice(de+1,ke)||ke===-1&&(pe.sawInvalidClose||o?.final||se.intraword||!Ry(Y[de+1])))return A(Y.slice(de),Y.slice(de)),u++,!0;const{node:qe}=Zh([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ke>-1?Y.slice(de+1,ke):Y.slice(de+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),b(qe),ke!==-1&&ke<Y.length-1){const be=Y.slice(ke+1);be&&(F({type:"text",content:be,raw:be}),u--)}return u++,!0}return!1}function y(Y,Q){if(!Y.includes("`"))return!1;const G=(Ne=>{for(let qe=0;qe<Ne.length;qe++){if(Ne[qe]!=="`")continue;let be=0;for(let xe=qe-1;xe>=0&&Ne[xe]==="\\";xe--)be++;if(be%2===0)return qe}return-1})(Y);if(G===-1)return!1;let me=1;for(let Ne=G+1;Ne<Y.length&&Y[Ne]==="`";Ne++)me++;const ye="`".repeat(me),de=G+me,V=Y.indexOf(ye,de);if(V===-1){if(me===1){const qe=Y.slice(0,G),be=Y.slice(G+1);return qe&&(m(qe,Q)?u--:A(qe,qe)),g({type:"inline_code",code:be,raw:String(be)}),u++,!0}let Ne=Y;for(let qe=u+1;qe<e.length;qe++)Ne+=String((e[qe].content??"")+(e[qe].markup??""));return u=e.length-1,A(Ne,Ne),u++,!0}p();const se=Y.slice(0,G),pe=Y.slice(G+me,V),ke=Y.slice(V+me);return se&&(m(se,Q)?u--:A(se,se)),g({type:"inline_code",code:pe,raw:String(pe??"")}),ke&&(F({type:"text",content:ke,raw:ke}),u--),u++,!0}function k(Y){const Q=l?.__markdownIt;if(!Q||e.length<=1||!e.some(ye=>ye?.type==="math_inline")||!lQ.test(Y))return null;const P=Q.parseInline(Y,{__markstreamFinal:!!o?.final});if(!Array.isArray(P)||P.length===0)return null;const G=(P.find(ye=>ye?.type==="inline")?.children??[]).filter(ye=>!(ye?.type==="text"&&String(ye.content??"")===""));if(!G.length||!G.some(ye=>ye?.type!=="text")||G.length===1&&G[0]?.type==="text"&&String(G[0].content??"")===Y)return null;const me=ao(G,Y,n,o);return me.length?me:null}function g(Y){p(),a.push(Y)}function v(Y){p();const Q=Da(Y);a.push(Q)}function b(Y){g(Y)}function A(Y,Q){c?(c.content+=Y,c.raw+=Q??Y):(c={type:"text",content:String(Y??""),raw:String(Q??Y??"")},a.push(c))}function I(Y,Q){if(!Y)return;const P=ao([{...Q,type:"text",content:Y,raw:Y}],Y,n,o);if(P.length===1&&P[0]?.type==="text"){const G=P[0];A(String(G.content??""),String(G.raw??G.content??""));return}for(const G of P)b(G)}function N(Y,Q){return String(Y.markup??"").startsWith(Q)}function M(Y){if(!c||Y.loading!==!0||Y.markup!=="\\(\\)")return;const Q=e[u-1];!Q||Q.type!=="text"||!N(Q,"\\(")||c.content.endsWith("(")&&(c.content=c.content.slice(0,-1),c.raw.endsWith("(")&&(c.raw=c.raw.slice(0,-1)),!c.content&&a[a.length-1]===c&&(a.pop(),c=null))}function $(Y){return Y.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(Y,Q,P=Qh(Y)){let G=Y;const me=String(Q.content??"");return(P&By)!==0&&G.endsWith("\\")&&!N(Q,"\\\\")&&!me.endsWith("\\\\")&&(G=G.slice(0,-1)),(P&_d)!==0&&G.endsWith("(")&&!N(Q,"\\(")&&!me.endsWith("\\(")&&(G=G.slice(0,-1)),(P&x8)!==0&&/\*+$/.test(G)&&!N(Q,"\\*")&&!me.endsWith("\\*")&&(G=G.replace(/\*+$/,"")),G}for(;u<e.length;){const Y=e[u];F(Y)}function F(Y){switch(Y.type){case"text":B(Y);break;case"softbreak":c?(c.content+=`
207
- `,c.raw+=`
208
- `):(c={type:"text",content:`
209
- `,raw:`
210
- `},a.push(c)),u++;break;case"code_inline":b(YX(Y)),u++;break;case"html_inline":{const[Q,P]=KX(Y,e,u,ao,t,n,o);b(Q),u=P;break}case"link_open":W(Y);break;case"image":ne(Y)||(p(),b(_C(Y)),u++);break;case"strong_open":{p();const{node:Q,nextIndex:P}=ad(e,u,Y.content,o);b(Q),u=P;break}case"em_open":{p();const{node:Q,nextIndex:P}=Zh(e,u,o);b(Q),u=P;break}case"s_open":{p();const{node:Q,nextIndex:P}=CC(e,u,o);b(Q),u=P;break}case"mark_open":{p();const{node:Q,nextIndex:P}=zX(e,u,o);b(Q),u=P;break}case"ins_open":{p();const{node:Q,nextIndex:P}=ZX(e,u,o);b(Q),u=P;break}case"sub_open":{p();const{node:Q,nextIndex:P}=nQ(e,u,o);b(Q),u=P;break}case"sup_open":{p();const{node:Q,nextIndex:P}=oQ(e,u,o);b(Q),u=P;break}case"sub":p(),b({type:"subscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`~${String(Y.content??"")}~`}),u++;break;case"sup":p(),b({type:"superscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`^${String(Y.content??"")}^`}),u++;break;case"emoji":{p();const Q=e[u-1];Q?.type==="text"&&/\|:-+/.test(String(Q.content??""))?A("",""):b(BX(Y)),u++;break}case"checkbox":p(),b(FX(Y)),u++;break;case"checkbox_input":p(),b(OX(Y)),u++;break;case"footnote_ref":p(),b(HX(Y)),u++;break;case"footnote_anchor":{p();const Q=Y.meta??{};g({type:"footnote_anchor",id:String(Q.label??Y.content??""),raw:String(Y.content??"")}),u++;break}case"hardbreak":p(),b(WX()),u++;break;case"fence":p(),b(A2(e[u])),u++;break;case"math_inline":M(Y),p(),!Y.content&&Y.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(b(SC({...Y,content:e[u+1].content})),u+=2):b(SC(Y)),u++;break;case"reference":L(Y);break;case"text_special":A(String(Y.content??""),String(Y.content??"")),u++;break;default:{const Q=Y;if(Y.type==="link"&&Q.href!=null&&o?.validateLink&&!o.validateLink(String(Q.href))){p();const P=String(Q.text??"");A(P,P),u++}else j(Y)||U(Y)||ie(Y)||O(Y)||v(Y),u++;break}}}function S(Y,Q,P,G,me=Qh(Y)){const ye=sQ({...Q,content:Y});if(c){c.content+=T(ye.content,Q,me),c.raw+=ye.raw;return}const de=P?.tag==="br"&&e[u-2]?.content==="[";G||(ye.content=T(ye.content,Q,me)),c=ye,c.center=de,a.push(c)}function B(Y){const Q=String(Y.content??""),P=Qh(Q),G=(P&By)!==0,me=e.length===1&&G&&typeof t=="string"?String(t):"";let ye=me?MQ(me):G?Q.replace(aQ,"$1"):Q;const de=ye===Q?P:Qh(ye);if(Y.content==="<"||ye==="1"&&e[u-1]?.tag==="br"){u++;return}const V=(de&_8)!==0?ye.indexOf("$"):-1;V!==-1&&V===ye.lastIndexOf("$")&&ye.endsWith("$")&&(ye=ye.slice(0,-1)),ye.endsWith("undefined")&&!t?.endsWith("undefined")&&(ye=ye.slice(0,-9));let se=a.length,pe="";for(let be=a.length-1;be>=0;be--){const xe=a[be];if(xe.type!=="text")break;se=be,pe=String(xe.content??"")+pe}se<a.length&&(ye.startsWith(pe)?(c=null,a.length=se):c=a[a.length-1]);const ke=e[u+1];if((ye==="`"||ye==="|"||ye==="$")&&!N(Y,`\\${ye}`)||/^\*+$/.test(ye)&&!N(Y,"\\*")){u++;return}if(!ke&&(de&_d)!==0&&/[^\]]\s*\(\s*$/.test(ye)&&(ye=ye.replace(/\(\s*$/,"")),!ye){u++;return}if((de&(kl|wd))===(kl|wd)&&fe(ye)||(de&(Lp|_d))===(Lp|_d)&&K(ye))return;if((de&kQ)===0){S(ye,Y,e[u-1],ke,de),u++;return}if((de&kl)!==0&&re(ye))return;const Ne=e[u-1];if((de&kl)!==0&&ye==="["&&!ke?.markup?.includes("*")&&!N(Y,"\\[")||(de&Lp)!==0&&ye==="]"&&!Ne?.markup?.includes("*")&&!N(Y,"\\]")){u++;return}if((de&w8)!==0&&y(Q,Y)||(de&(wd|kl))===(wd|kl)&&Ae(ye)||(de&kl)!==0&&(e[u+1]?.type!=="link_open"||$(ye))&&he(ye,Y))return;const qe=k(Q);if(qe){p();for(const be of qe)b(be);u++;return}m(ye,Y)||(S(ye,Y,Ne,ke,de),u++)}function W(Y){if(z(Y))return;if(ve()){const{node:V,nextIndex:se}=Xh(e,u,o),pe=String(V.text||V.href||"");A(pe,pe),u=se;return}p();const{node:Q,nextIndex:P}=Xh(e,u,o);u=P;const G=Q.text||Q.href||"";if(Y.markup==="linkify"&&!n8(G,Q.href,t)&&Em(G,l?.__linkifyDemotionContext)){A(G,G);return}const me=Q.children.length===1&&Q.children[0]?.type==="text";if(Q.loading&&t&&Q.text===Q.href&&me){const V=BQ(t,Q.href);V&&(Q.text=V,Q.children=[{type:"text",content:V,raw:V}],Q.raw=`[${V}](${Q.href}${Q.title?` "${Q.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(Q.href)){A(Q.text,Q.text);return}const ye=Y.attrs?.find(([V])=>V==="href")?.[1],de=String(ye??"");if(t&&de){const V=t.indexOf("](");if(V!==-1){const se=t.indexOf(")",V+2);se===-1?Q.loading=!0:Q.loading&&t.slice(V+2,se).includes(de)&&(Q.loading=!1)}}O(Q)||g(Q)}function z(Y){if(Y.markup!=="linkify")return!1;const{node:Q,nextIndex:P}=Xh(e,u,o);return Z(Q,P)?(u=P,!0):!1}function L(Y){p(),b(JX(Y)),u++}function O(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1];if(!Q||Q.type!=="text")return!1;const P=String(Q.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!P)return!1;const G=Y,me=String(G.href??""),ye=String(G.text??""),de=String(P[2]??""),V=me.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!me||!(ye===me||ye===V||OQ(ye)))return!1;const se=String(P[1]??"");return se?(Q.content=se,Q.raw=se):a.pop(),g({...Y,text:de,children:[{type:"text",content:de,raw:de}],raw:`[${de}](${me}${G.title?` "${G.title}"`:""})`}),!0}function U(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.href??"");return P?Z({href:P,title:Q.title==null||Q.title===""?null:String(Q.title),loading:!!Q.loading},u+1):!1}function Z(Y,Q){const P=a[a.length-1];if(P?.type!=="image"||P.src||!P.loading||!String(P.raw??"").endsWith("]("))return!1;const G=e[Q],me=String(G?.content??"");if(G?.type!=="text"||!me.startsWith(")"))return!1;a.pop(),c=null;const ye=String(P.alt??"");g({type:"image",src:Y.href,alt:ye,title:Y.title,raw:`![${ye}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const de=me.slice(1),V=Da(G);return V.content=de,V.raw=de,h()[Q]=V,!0}function ie(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1],P=e[u-1];if(!Q||Q.type!=="text"||P?.type!=="text")return!1;const G=String(Q.content??""),me=String(P.content??"");if(!G.endsWith("!")||!me.endsWith("!")||N(P,"\\!"))return!1;const ye=G.slice(0,-1);ye?(Q.content=ye,Q.raw=ye,c=Q):(a.pop(),c=null);const de=Y,V=String(de.text??de.children?.map(ke=>String(ke?.content??ke?.raw??"")).join("")??""),se=String(de.href??""),pe=de.title==null||de.title===""?null:String(de.title);return g({type:"image",src:se,alt:V,title:pe,raw:`![${V}](${se}${pe?` "${pe}"`:""})`,loading:!!de.loading}),!0}function q(Y,Q="",P=null){const G=String(Y.alt??Y.raw??"");return{type:"link",href:Q,title:P,text:G,children:[Y],raw:`[${G}](${Q}${P?` "${P}"`:""})`,loading:!0}}function ee(Y){const Q=Y.startsWith("![")?Y:`![${Y}`,P=Q.slice(2),G=P.indexOf("](");return{type:"image",src:"",alt:G===-1?P.replace(/\]$/,""):P.slice(0,G),title:null,raw:Q,loading:!0}}function fe(Y){const Q=Y.indexOf("[![");if(Q===-1||typeof t=="string"&&e.length===1&&TQ(t,Q,"["))return!1;const P=Y.slice(0,Q);return P&&A(P,P),g(q(ee(Y.slice(Q+1)))),u++,!0}function ne(Y){if(o?.final)return!1;const Q=e[u-1];if(Q?.type!=="text"||!String(Q.content??"").endsWith("[")||N(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type==="text"&&P.content.endsWith("[")){const G=P.content.slice(0,-1);G?(P.content=G,P.raw=G,c=P):(a.pop(),c=null)}return g(q(_C(Y))),u++,!0}function j(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.raw??""),G=String(Q.text??"");if(!P.startsWith("[![")&&!G.startsWith("!["))return!1;const me=Q.title==null||Q.title===""?null:String(Q.title);return g(q({type:"image",src:String(Q.href??""),alt:G.replace(/^!\[/,"").replace(/\]$/,""),title:me,raw:P.startsWith("[![")?P.slice(1):P,loading:!0})),!0}function K(Y){if(!Y.startsWith("]("))return!1;const Q=e[u-2];if(Q?.type==="text"&&String(Q.content??"").endsWith("[")&&N(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type!=="image"&&P?.type!=="link")return!1;const G=P,me=P?.type==="link"&&Array.isArray(G.children)&&G.children.length===1&&G.children[0]?.type==="image"?a.pop():null,ye=me?me.children[0]:a.pop();if(!ye||ye.type!=="image")return!1;const de=e[u+1];let V=String(me?.href??""),se=me?.title==null?null:String(me.title),pe=!0;if(de?.type==="link_open"){const{node:Ne,nextIndex:qe}=Xh(e,u+1,o);V=Ne.href,se=Ne.title,pe=!0,u=qe}else{if(V=Y.slice(2),V.includes('"')){const Ne=V.split('"');V=String(Ne[0]??"").trim(),se=Ne[1]==null?null:String(Ne[1]).trim()}u++}const ke=q(ye,V,se);return ke.loading=pe,g(ke),!0}function ve(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&N(Y,"\\[")}function he(Y,Q){const P=Y.indexOf("[");if(P===-1)return!1;let G=Y.slice(0,P);const me=Y.indexOf("](",P);if(me!==-1){const ye=e[u+2];let de=Y.slice(P+1,me);if(de.includes("[")){const be=de.indexOf("[");G+=Y.slice(0,P+be+1);const xe=P+be+1;de=Y.slice(xe+1,me)}const V=e[u+1];if(Y.endsWith("](")&&V?.type==="link_open"&&ye){const be=e[u+4];let xe=4,Ze=!0;if(be?.type==="text"){const lt=String(be.content??"");if(lt.startsWith(")")){Ze=!1;const ut=lt.slice(1);if(ut){const mt=Da(be);mt.content=ut,mt.raw=ut,h()[u+4]=mt}else xe++}else lt==="."&&xe++}I(G,Q);const tt=String(ye.content??"");return o?.validateLink&&!o.validateLink(tt)?A(de,de):g({type:"link",href:tt,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:Ze}),u+=xe,!0}const se=Y.indexOf(")",me),pe=se!==-1?Y.slice(me+2,se):"",ke=se===-1;let Ne=G.match(/\*+$/);if(Ne&&(G=G.replace(/\*+$/,"")),I(G,Q),Ne||(Ne=de.match(/^\*+/)),!d&&Ne){const be=Ne[0].length;de=de.replace(/^\*+/,"").replace(/\*+$/,"");const xe=[];if(be===1?xe.push({type:"em_open",tag:"em",nesting:1}):be===2?xe.push({type:"strong_open",tag:"strong",nesting:1}):be===3&&(xe.push({type:"strong_open",tag:"strong",nesting:1}),xe.push({type:"em_open",tag:"em",nesting:1})),xe.push({type:"link",href:pe,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ke}),be===1){xe.push({type:"em_close",tag:"em",nesting:-1});const{node:Ze}=Zh(xe,0,o);b(Ze)}else if(be===2){xe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ze}=ad(xe,0,void 0,o);b(Ze)}else if(be===3){xe.push({type:"em_close",tag:"em",nesting:-1}),xe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ze}=ad(xe,0,void 0,o);b(Ze)}else{const{node:Ze}=Zh(xe,0,o);b(Ze)}}else o?.validateLink&&!o.validateLink(pe)?A(de,de):g({type:"link",href:pe,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ke});const qe=se!==-1?Y.slice(se+1):"";return qe&&(F({type:"text",content:qe,raw:qe}),u--),u++,!0}return!1}function Ae(Y){const Q=Y.indexOf("![");if(Q===-1)return!1;const P=Y.slice(0,Q);return P&&!c?c={type:"text",content:P,raw:P}:P&&c&&(c.content+=P),c&&(a.push(c),c=null),g(ee(Y.slice(Q))),u++,!0}function re(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Q=Y.slice(1).match(/[^\s\]]/);if(Q===null)return u++,!0;if(Q&&/x/i.test(Q[0])){const P=Q[0]==="x"||Q[0]==="X";return g({type:"checkbox_input",checked:P,raw:P?"[x]":"[ ]"}),u++,!0}return!1}return a}function E2(e,t,n){const o=n?.__sourceLineMapper;if(!o)return{startLine:e,endLine:t};const s=o(e),i=t>e?o(t-1).endLine:o(t).startLine;return{startLine:s.startLine,endLine:Math.max(s.startLine,i)}}function AC(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let o=0;for(let s=0;s<n;s++)e[s]===`
211
- `&&o++;return o}function RQ(e,t,n){const o=Math.max(0,Math.min(e.length,Math.trunc(t))),s=Math.max(o,Math.min(e.length,Math.trunc(n))),i=AC(e,o);let r=AC(e,s);return s>o&&e[s-1]!==`
212
- `&&r++,{startLine:i,endLine:r}}function Sf(e,t,n,o){const s=RQ(e,t,n);return E2(s.startLine,s.endLine,o)}function DQ(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const o=Number(n[0]),s=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(s)?null:E2(o,s,t)}function hn(e,t,n){if(!n?.includeSourceMap)return e;const o=DQ(t,n);if(!o)return e;if(e.sourceMap=o,e.type==="code_block"){const s=e;s.startLine=o.startLine,s.endLine=o.endLine}return e}function PQ(e,t,n,o){if(!o?.includeSourceMap)return e;const s=t?.map;if(!Array.isArray(s)||s.length<2)return e;const i=Number(s[0]),r=Number(s[1]),l=Number(n);return!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=E2(i,Math.max(r,l),o)),e}function HQ(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function WQ(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 o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function zQ(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Mu(e,t,n){const o=e[t],s=[],i=Yl(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 a=[];let c=r+1;for(;c<e.length&&e[c].type!=="list_item_close";)if(e[c].type==="paragraph_open"){const d=e[c+1],f=zQ(d)?Da(d):d,h=e[c-1];f!==d&&(WQ(f),HQ(f));const p=String(f.content??""),m={type:"paragraph",children:ao(f.children||[],p,h,i.options()),raw:p};n?.includeSourceMap&&hn(m,e[c],n),a.push(m),i.remember(p),c+=3}else if(e[c].type==="blockquote_open"){const[d,f]=Eu(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Mu(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else{const d=N2(e,c,i.options(),T2);d?(a.push(d[0]),i.remember(d[0].raw),c=d[1]):c+=1}const u={type:"list_item",children:a,raw:a.map(d=>d.raw).join("")};n?.includeSourceMap&&hn(u,e[r],n),s.push(u),r=c+1}else r+=1;const l={type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const a=o.attrs.find(c=>c[0]==="start");if(a){const c=Number(a[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:s,raw:s.map(a=>a.raw).join(`
213
- `)};return n?.includeSourceMap&&hn(l,o,n),[l,r+1]}function UQ(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Yl(o,!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:ao(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};o?.includeSourceMap&&hn(u,e[a],o),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]=Mu(e,a,l.options());o?.includeSourceMap&&hn(c,e[a],o),r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Eu(e,a,l.options());o?.includeSourceMap&&hn(c,e[a],o),r.push(c),l.remember(c.raw),a=u}else{const c=z1(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
214
- ${r.map(c=>c.raw).join(`
215
- `)}
216
- :::`},a+1]}const qQ=new Set(["warning","info","note","tip","danger","caution"]);function jQ(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 o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return qQ.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function VQ(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=jQ(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Yl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_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 f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const y=f[m];if(y.type==="text"&&/:+/.test(y.content)){h=m;break}}const p={type:"paragraph",children:ao((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&hn(p,e[c],n),l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Mu(e,c,a.options());n?.includeSourceMap&&hn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Eu(e,c,a.options());n?.includeSourceMap&&hn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else{const d=z1(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
217
- ${l.map(d=>d.raw).join(`
218
- `)}
219
- :::`},c+1]}const KQ=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function GQ(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=KQ.exec(String(o.info??""));return s?UQ(e,t,s,n):null}const T2={parseContainer:(e,t,n)=>VQ(e,t,n),matchAdmonition:GQ};function Eu(e,t,n){const o=[],s=Yl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";){const l=e[i];switch(l.type){case"paragraph_open":{const a=e[i+1],c={type:"paragraph",children:ao(a.children||[],String(a.content??""),void 0,s.options()),raw:String(a.content??"")};n?.includeSourceMap&&hn(c,l,n),o.push(c),s.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=Mu(e,i,s.options());o.push(a),s.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=Eu(e,i,s.options());o.push(a),s.remember(a.raw),i=c;break}default:{const a=N2(e,i,s.options(),T2);a?(o.push(a[0]),s.remember(a[0].raw),i=a[1]):i++;break}}}const r={type:"blockquote",children:o,raw:o.map(l=>l.raw).join(`
220
- `)};return n?.includeSourceMap&&hn(r,e[t],n),[r,i+1]}function YQ(e){if(e.info?.startsWith("diff"))return A2(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function ZQ(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Yl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=ao(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+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:ao(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&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
221
- `)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
222
- `)},s+1]}function XQ(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Yl(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:ao(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:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
223
- `)}`},l+1]}function QQ(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.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(o.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:ao(a.children||[],c,void 0,n),raw:c}}function JQ(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\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=po(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=po(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 E8(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 o=po(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Wl.has(n),l=W1(s),a=(o===-1?-1:JQ(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
224
- </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function eJ(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 tJ(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function T8(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function N8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return T8(n)?n:void 0}function nJ(e,t,n){const o=N8(Uf(t),n);if(!T8(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function oJ(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),m=tJ(e[c].attrs),y=a.length,k=!f&&!r,g=k?s?.cells[y]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:ao(h.children||[],p,void 0,nJ(n,g,k?u:void 0)),raw:p,align:m}),k&&(u=N8(u,Uf(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
225
- `)},o+1]}function sJ(){return{type:"thematic_break",raw:"---"}}let Gg=null;const Yg=new WeakMap;function MC(){return Gg||(Gg={allowedTagSet:j1(),customTagSet:null}),Gg}function iJ(e){if(!e||e.length===0)return MC();const t=Yg.get(e);if(t)return t;const n=e.map(Ti).filter(Boolean);if(!n.length){const s=MC();return Yg.set(e,s),s}const o={allowedTagSet:j1({customHtmlTags:e}),customTagSet:new Set(n)};return Yg.set(e,o),o}function rJ(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=Yl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:ao(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};n?.includeSourceMap&&hn(p,e[c],n),l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=Mu(e,c,a.options());n?.includeSourceMap&&hn(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=Eu(e,c,a.options());n?.includeSourceMap&&hn(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else{const h=z1(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u&&o.meta?.unclosed!==!0||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
226
- `,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
227
- `),f+=`
228
- `),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function Zg(e,t,n,o){if(n?.type.endsWith("_close")){let s=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(s)||(s=Array.isArray(t.map)?Number(t.map[1])+1:NaN),PQ(e,t,s,o)}return hn(e,t,o)}function lJ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function aJ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function cJ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Ki(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ki(o)}(?=\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=po(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=po(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 uJ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=po(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),start:r,end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const y=m+1;return{raw:e.slice(r,y),start:r,end:y}}d=m+1;continue}if(f(p)){const m=po(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length}}function Dy(e){return Number.isFinite(e)&&e>0?e:0}function dJ(e,t){const n=Dy(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
229
- `&&(o++,o===n))return s+1;return e.length}function z1(e,t,n){const o=e[t],s=n?.includeSourceMap===!0;switch(o.type){case"heading_open":{const i=QQ(e,t,n);return s&&hn(i,o,n),[i,t+3]}case"code_block":{const i=YQ(o);return s&&hn(i,o,n),[i,t+1]}case"fence":{const i=A2(o);return s&&hn(i,o,n),[i,t+1]}case"math_block":{const i=eJ(o);return s&&hn(i,o,n),[i,t+1]}case"html_block":{const i=E8(o),r=i.tag?iJ(n?.customHtmlTags):null;if(i.tag&&i.loading&&r&&!r.allowedTagSet.has(i.tag)){const l=String(o.content??"").replace(/\n+$/,""),a={type:"paragraph",children:l?[{type:"text",content:l,raw:l}]:[],raw:l};return s&&hn(a,o,n),[a,t+1]}if(i.tag&&r?.customTagSet?.has(i.tag)){const l=i.tag,a=String(n?.__sourceMarkdown??""),c=Number(n?.__customHtmlBlockCursor??0),u=Array.isArray(o.map)?dJ(a,Number(o.map?.[0]??0)):0,d=uJ(a,l,Math.max(Dy(c),Dy(u)));d&&n&&(n.__customHtmlBlockCursor=d.end);const f=String(d?.raw??i.raw??""),h=po(f),p=h!==-1?f.slice(0,h+1):f,m=h!==-1&&/\/\s*>\s*$/.test(p),y=h===-1?null:cJ(f,l,h+1),k=y?.start??-1;let g="";h!==-1&&(k!==-1&&h<k?g=f.slice(h+1,k):g=f.slice(h+1)),k===-1&&(g=aJ(g,l));const v=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=b.exec(p))!==null;){const M=A[1];if(!M||M.toLowerCase()===l)continue;const $=A[2]||A[3]||A[4]||"";v.push([M,$])}const I=!n?.final&&!m&&y==null,N={type:l,tag:l,content:lJ(g),raw:String(d?.raw??i.raw??f),loading:I,attrs:v.length?v:void 0};return s&&(d?N.sourceMap=Sf(a,d.start,d.end,n):hn(N,o,n)),[N,t+1]}return s&&hn(i,o,n),[i,t+1]}case"table_open":{const[i,r]=oJ(e,t,n);return s&&hn(i,o,n),[i,r]}case"dl_open":{const[i,r]=ZQ(e,t,n);return s&&hn(i,o,n),[i,r]}case"footnote_open":{const[i,r]=XQ(e,t,n);return s&&hn(i,o,n),[i,r]}case"hr":{const i=sJ();return s&&hn(i,o,n),[i,t+1]}}return null}function N2(e,t,n,o){const s=z1(e,t,n);if(s)return s;const i=e[t],r=n?.includeSourceMap===!0;switch(i.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(o?.parseContainer){const l=o.parseContainer(e,t,n);return r&&Zg(l[0],i,e[l[1]-1],n),l}break;case"container_open":if(o?.matchAdmonition){const l=o.matchAdmonition(e,t,n);if(l)return r&&Zg(l[0],i,e[l[1]-1],n),l}break;case"vmr_container_open":{const l=rJ(e,t,n);return r&&Zg(l[0],i,e[l[1]-1],n),l}}return null}function fJ(){return{type:"hardbreak",raw:`\\
230
- `}}function hJ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:ao(o.children||[],s,void 0,n),raw:s}}const EC=new WeakMap,I8=new WeakMap,TC=new WeakMap,NC=new WeakMap;function nr(e,t,n){const o=t?.map,s=n?.__sourceMarkdown;if(!Array.isArray(o)||o.length<2||typeof s!="string"||!n)return;const i=Number(o[0]),r=Number(o[1]);if(!Number.isFinite(i)||!Number.isFinite(r))return;let l=TC.get(n);if(!l){l=[0];for(let a=0;a<s.length;a++)s[a]===`
231
- `&&l.push(a+1);TC.set(n,l)}I8.set(e,{start:l[Math.max(0,Math.trunc(i))]??s.length,end:l[Math.max(0,Math.trunc(r))]??s.length})}const U1=new WeakMap,IC=new WeakMap,pJ=["$$","\\["],mJ=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/,$m=new WeakMap,Sd=new WeakMap,gJ=new Set(["code_inline","em_close","em_open","emoji","hardbreak","ins_close","ins_open","mark_close","mark_open","s_close","s_open","softbreak","strong_close","strong_open","sub","sup","text"]),vJ=new Map([["paragraph_open","paragraph_close"],["heading_open","heading_close"],["bullet_list_open","bullet_list_close"],["ordered_list_open","ordered_list_close"],["blockquote_open","blockquote_close"],["table_open","table_close"]]),yJ=new Set(["code_block","fence","hr","math_block"]);function xu(){return typeof performance<"u"?performance.now():Date.now()}function Cf(e,t,n){e&&(e[t]=(e[t]??0)+n)}function L8(e){return e.__timing}function $8(e,t,n){return t&&Cf(t,"parseMarkdownToStructureTotalMs",xu()-n),e}function F8(e,t){const n=t.postTransformNodes;if(typeof n!="function")return e;const o=n(e);return Array.isArray(o)?o:e}function LC(e,t,n,o){return $8(F8(e,t),n,o)}function $p(e,t,n){if(!n)return qC(e,t);Cf(n,"processTokensInputTokens",e.length);const o=xu(),s=qC(e,t);return Cf(n,"processTokensMs",xu()-o),s}function O8(e){return e.every(t=>{if(!gJ.has(t.type))return!1;const n=t.children;return!Array.isArray(n)||O8(n)})}function kJ(e){const t=[];let n=!1,o=0;for(;o<e.length;){const s=e[o];if(!s||s.level!==0)return null;const i=vJ.get(s.type);let r=o+1;if(i){if(s.nesting!==1)return null;for(;r<e.length;){const l=e[r];if(l.level===0){if(l.type!==i||l.nesting!==-1)return null;r++;break}r++}if(e[r-1]?.type!==i)return null;if(s.type==="paragraph_open"||s.type==="heading_open"){if(r!==o+3||e[o+1]?.type!=="inline")return null}else n=!0}else if(yJ.has(s.type)){if(s.nesting!==0)return null;n=!0}else return null;for(let l=o;l<r;l++){const a=e[l];if(a.type!=="inline")continue;const c=a.children;if(!Array.isArray(c)||!O8(c))return null}t.push(o),o=r}return{mixed:n,starts:t}}function bJ(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function xJ(e){return e.__reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!e.customHtmlTags?.length&&e.includeSourceMap!==!0}function $C(e,t,n,o,s,i){const r=o.starts;if(r.length===0||s.length!==r.length){$m.delete(e);return}const l=r.map((a,c)=>{const u=r[c+1]??n.length;return{firstToken:n[a],lastToken:n[u-1],tokenCount:u-a}});$m.set(e,{groupBoundaries:l,source:t,nodes:s,stableGroupCount:o.mixed?Math.max(0,r.length-1):bJ(t)?r.length:Math.max(0,r.length-1),requireClosingStrong:i.requireClosingStrong})}function wJ(e,t,n,o){for(let s=0;s<o;s++){const i=n[s],r=n[s+1]??t.length,l=e.groupBoundaries[s];if(!l||l.firstToken!==t[i]||l.lastToken!==t[r-1]||l.tokenCount!==r-i)return!1}return!0}function _J(e,t,n,o,s){const i=e,r=kJ(n);if(!(I2(e,o)&&xJ(o)&&r!==null))return $m.delete(i),$p(n,o,s);const l=r.starts,a=$m.get(i),c=Sd.get(i),u=a&&r.mixed?Math.min(a.stableGroupCount,Math.max(0,a.groupBoundaries.length-1)):a?.stableGroupCount??0;if(a&&u>0&&a.requireClosingStrong===o.requireClosingStrong&&t.startsWith(a.source)&&l.length>=u&&(c==="append"||c==="tail")&&wJ(a,n,l,u)){const f=l[u]??n.length,h=$p(n.slice(f),o,s),p=l.length-u;if(h.length===p){const m=a.nodes.slice(0,u).concat(h);return Cf(s,"processTokensReusedTopLevelNodes",u),$C(e,t,n,r,m,o),m}}const d=$p(n,o,s);return $C(e,t,n,r,d,o),d}function SJ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=tc(t);return n.length?new Set(n):null}function CJ(e,t){const n=e;let o=EC.get(n);o||(o=new Map,EC.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function AJ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Jh(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=_a(s.value,n))}}function _a(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(_a(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(_a(l,t),_a(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(_a(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),Jh(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Jh(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),Jh(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!AJ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Jh(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=_a(i[r],t);return s}function B8(e,t=!0){if(!t)return Da(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>B8(a,t)):t&&r&&typeof r=="object"&&(l=_a(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function FC(e,t=!0){return e.map(n=>B8(n,t))}function I2(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function MJ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function EJ(e){U1.delete(e)}function TJ(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function Ud(e){return{...e}}function NJ(e,t,n,o=q1(t).state){U1.set(e,{explicitBracketMath:o,source:t,key:n,pendingCandidate:n===null&&p8(t)})}function IJ(e){return e.endsWith("$")||e.endsWith("\\")}function LJ(e){const t=Math.max(e.lastIndexOf(`
232
- `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return pJ.some(o=>n.endsWith(o))}function $J(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||LJ(e)&&/[\r\n]/.test(t)):!1}function cd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function Py(e){return e===" "||e===" "}function R8(e,t){return t===" "?e+1:e+4-e%4}function L2(e){let t=0,n=0;for(;t<e.length&&Py(e[t]);)n=R8(n,e[t]),t++;return{index:t,column:n}}function Tu(e){const t=L2(e);return t.column>3?null:t}function Xg(e){const t=Tu(e);if(!t)return null;const n=t.index,o=e[n];if(o!=="`"&&o!=="~")return null;let s=n;for(;s<e.length&&e[s]===o;)s++;const i=s-n;if(i<3)return null;const r=e.slice(s);return o==="`"&&r.includes("`")?null:{markerChar:o,markerLen:i,rest:r}}function $2(e){const t=Tu(e);if(!t)return null;const n=e.slice(t.index),o=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n)?.[0];if(!o)return null;let s=t.index+o.length,i=t.column+o.length;if(!Py(e[s]))return null;for(;s<e.length&&Py(e[s]);)i=R8(i,e[s]),s++;return{content:e.slice(s),contentIndent:i}}function F2(e){let t=e,n=!1;for(;;){const o=Tu(t);if(!o)return n?t:null;let s=o.index;if(t[s]!==">")return n?t:null;n=!0,s++,(t[s]===" "||t[s]===" ")&&s++,t=t.slice(s)}}function D8(e){const t=Xg(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=F2(e),o=n==null?null:Xg(n);if(o)return{...o,inBlockquote:!0,inList:!1,listIndent:0};const s=$2(e);if(!s)return null;const i=Xg(s.content);return i==null?null:{...i,inBlockquote:!1,inList:!0,listIndent:s.contentIndent}}function FJ(e,t){let n=!1,o="",s=0,i=!1,r=!1,l=0,a=null,c=0;for(;c<t;){const u=e.indexOf(`
233
- `,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=L2(h),m=$2(h);n&&i&&h.trim()&&F2(h)==null&&(n=!1,o="",s=0,i=!1,r=!1,l=0),n&&r&&h.trim()&&p.column<l&&!m&&(n=!1,o="",s=0,i=!1,r=!1,l=0),m?a=m.contentIndent:h.trim()&&a!=null&&p.column<a&&!n&&(a=null);const y=D8(h);if(y&&(n?y.markerChar===o&&y.markerLen>=s&&/^\s*$/.test(y.rest)&&(n=!1,o="",s=0,i=!1,r=!1,l=0):(n=!0,o=y.markerChar,s=y.markerLen,i=y.inBlockquote,r=y.inList||a!=null&&!y.inBlockquote&&p.column>=a,l=y.listIndent||a||0)),u===-1||u>=t)break;c=u+1}return n}function OJ(e,t){const n=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"||d===":"},s=d=>{if(d[0]!=="<")return null;let f=1;for(;f<d.length&&n(d[f]);)f++;const h=d[f]==="/";if(h)for(f++;f<d.length&&n(d[f]);)f++;const p=f;for(;f<d.length&&o(d[f]);)f++;if(f===p)return null;const m=d.slice(p,f).toLowerCase();if(!z5.has(m))return null;const y=d[f];if(y&&y!==" "&&y!==" "&&y!==">"&&y!=="/")return null;const k=po(d);if(k===-1)return null;let g=k-1;for(;g>=0&&n(d[g]);)g--;return{closing:h,tag:m,selfClosing:!h&&d[g]==="/",after:d.slice(k+1)}},i=(d,f)=>{const h=d.toLowerCase();let p=0;for(;p<h.length;){const m=h.indexOf("</",p);if(m===-1)return!1;for(p=m+2;p<h.length&&n(h[p]);)p++;if(h.startsWith(f,p)){const y=h[p+f.length];if(!y||y===" "||y===" "||y===">")return!0}}return!1},r=[];let l=!1,a=!1,c=!1,u=0;for(;u<t;){const d=e.indexOf(`
234
- `,u),f=d===-1||d>=t?t:d,h=e.slice(u,f),p=h.endsWith("\r")?h.slice(0,-1):h,m=Tu(p);if(m){const y=p.slice(m.index);if(l)l=!y.includes("-->");else if(a)a=!y.includes(">");else if(c)c=!y.includes("?>");else if(y.startsWith("<!--"))l=!y.includes("-->");else if(y.startsWith("<?"))c=!y.includes("?>");else if(y.startsWith("<!"))a=!y.includes(">");else{const k=s(y);if(k)if(k.closing){for(let g=r.length-1;g>=0;g--)if(r[g]===k.tag){r.length=g;break}}else k.selfClosing||i(k.after,k.tag)||r.push(k.tag)}}if(d===-1||d>=t)break;u=d+1}return l||a||c||r.length>0}function BJ(e,t,n){if(!n?.length)return!1;const o=new Set(tc(n));if(!o.size)return!1;const s=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"||u===":"},i=u=>u===" "||u===" ",r=u=>{if(u[0]!=="<")return null;let d=1;for(;d<u.length&&i(u[d]);)d++;const f=u[d]==="/";if(f)for(d++;d<u.length&&i(u[d]);)d++;const h=d;for(;d<u.length&&s(u[d]);)d++;if(d===h)return null;const p=u.slice(h,d).toLowerCase();if(!o.has(p))return null;const m=u[d];if(m&&m!==" "&&m!==" "&&m!==">"&&m!=="/")return null;const y=u.indexOf(">",d);if(y===-1)return null;let k=y-1;for(;k>=0&&i(u[k]);)k--;return{closing:f,tag:p,selfClosing:!f&&u[k]==="/",after:u.slice(y+1)}},l=(u,d)=>{const f=u.toLowerCase();let h=0;for(;h<f.length;){const p=f.indexOf("</",h);if(p===-1)return!1;for(h=p+2;h<f.length&&i(f[h]);)h++;if(f.startsWith(d,h)){const m=f[h+d.length];if(!m||m===" "||m===" "||m===">")return!0}}return!1},a=[];let c=0;for(;c<t;){const u=e.indexOf(`
235
- `,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=Tu(h);if(p){const m=r(h.slice(p.index));if(m)if(m.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===m.tag){a.length=y;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(u===-1||u>=t)break;c=u+1}return a.length>0}function RJ(e,t){const n=mJ.exec(e);if(!n)return null;const o=n[1]??"",s=n.index+o.length,i=e.indexOf(`
236
- `,s),r=e.slice(s,i===-1?e.length:i);return!Tu(r.endsWith("\r")?r.slice(0,-1):r)||FJ(e,s)||OJ(e,s)||BJ(e,s,t)?null:`${e.slice(0,n.index)}${o}`}function P8(e,t,n){let o=t;for(;o<e.length&&e[o]===n;)o++;return o-t}function DJ(e,t,n){let o=t;for(;o<e.length;){const s=e.indexOf("`",o);if(s===-1)return-1;const i=P8(e,s,"`");if(i===n)return s;o=s+i}return-1}function Qg(e){e.inFence=!1,e.fenceChar="",e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function OC(e,t,n,o,s){let i=0,r=!1;for(;i<e.length;){const l=i;if(t.inMath){if(e.startsWith("\\]",i)&&!cd(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,i+=2;continue}i++;continue}if(t.inDollarMath){if(e.startsWith("$$",i)&&!cd(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,i+=2;continue}i++;continue}if(e[i]==="`"&&!cd(e,l)){const a=P8(e,i,"`"),c=DJ(e,i+a,a);if(c===-1)break;i=c+a;continue}if(e.startsWith("\\[",i)&&!cd(e,l)){t.inMath=!0,t.mathOpenOffset=n+i,i+=2;continue}if(e.startsWith("$$",i)&&!cd(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+i,i+=2;continue}i++}return r}function PJ(e,t){if(!S2(t))return e;const n=t,o=IC.get(n),s=o?.source===e?o.state:o&&e.startsWith(o.source)?H8(o.state,e.slice(o.source.length),o.source.length-o.state.lineBuffer.length).state:q1(e).state;IC.set(n,{source:e,state:s});const{context:i}=s,r=i.inMath?i.mathOpenOffset:i.inDollarMath?i.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(`
237
- `,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const c=l.trim(),u=/^(?:[a-z]|pi)$/i.test(c);return Cl(l)&&!u?e:e.slice(0,r)}function HJ(e,t,n,o,s){const i=L2(e),r=$2(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&F2(e)==null&&Qg(t),t.inFence&&t.fenceInList&&e.trim()&&i.column<t.fenceListIndent&&!r&&Qg(t),r?t.listContentIndent=r.contentIndent:e.trim()&&t.listContentIndent!=null&&i.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){const l=D8(e);if(l)t.inFence?l.markerChar===t.fenceChar&&l.markerLen>=t.fenceLen&&/^\s*$/.test(l.rest)&&Qg(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&i.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return OC(e,t,n,o,s)}else return OC(e,t,n,o,s);return!1}function q1(e,t=TJ(),n=null,o=!1,s=0){const i=Ud(t);let r=Ud(t),l="",a=!1,c=0;for(;c<e.length;){const u=e.indexOf(`
238
- `,c),d=u!==-1,f=d&&u>c&&e[u-1]==="\r"?u-1:d?u:e.length,h=e.slice(c,f);HJ(h,i,s+c,n,o)&&(a=!0),d?(r=Ud(i),l=""):l=h,c=d?u+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:i,lineBuffer:l}}}function H8(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:Ud(e.committedContext),context:Ud(e.context),lineBuffer:e.lineBuffer+t}}:q1(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function WJ(e,t){if(!S2(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=U1.get(o);if(s?.source===t)return;const i=s?t.startsWith(s.source):!1,r=i&&s?t.slice(s.source.length):"",l=i&&s?H8(s.explicitBracketMath,r,s.source.length-s.explicitBracketMath.lineBuffer.length):q1(t),a=l.state,c=i&&s?l.closedOpenMath:!1;if(s&&i&&s.key===null&&s.pendingCandidate===!1&&!c&&!$J(s.source,r)&&!IJ(t)){s.source=t,s.explicitBracketMath=a;return}const u=SX(t);(s&&(s&&!i||s.key!==u||c)||!s&&u)&&n.reset(),NJ(e,t,u,a)}function zJ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function UJ(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Jg(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&UJ(e,t)}function BC(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function qJ(e){for(let t=0;t+5<e.length;t++)if(BC(e,t)&&BC(e,t+3)&&Jg(e[t],e[t+3])&&Jg(e[t+1],e[t+4])&&Jg(e[t+2],e[t+5]))return!0;return!1}function jJ(e,t,n){return S2(e)&&p8(t)&&qJ(n)}function VJ(e){const t=U1.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function RC(e,t,n,o){const s=e;if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!I2(e,o)||(WJ(e,t),VJ(e)))return Sd.set(s,"sync"),e.parse(t,n);const i=e.stream.parse(t,CJ(e,n));if(jJ(e,t,i))return e.stream?.reset?.(),Sd.set(s,"sync"),e.parse(t,n);const r=e.stream?.stats?.();if(Sd.set(s,r?.lastMode??"stream"),!zJ(o))return i;const l=L8(o);if(!l)return FC(i,!0);const a=xu(),c=FC(i,!0);return Cf(l,"tokenCloneMs",xu()-a),c}function j1(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return bf;const n=new Set(bf);for(const o of tc(t))o&&n.add(o);return n}function KJ(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 DC(e){return{type:"paragraph",children:e,raw:e.map(KJ).join("")}}function PC(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function HC(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=SJ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(DC(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(DC(c)),a}function GJ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function qd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function YJ(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*${Ki(t)}\s*>\s*$`,"i").test(n)}const ev=new Set(["iframe","script","style","textarea","title"]);function jf(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=f=>{if(e.startsWith("<!--",f)){const v=e.indexOf("-->",f+4);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}if(e.startsWith("<![CDATA[",f)){const v=e.indexOf("]]>",f+9);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}const h=po(e.slice(f));if(h===-1)return null;const p=f+h+1,m=e.slice(f,p);if(/^<\s*[!?]/.test(m))return{closing:!1,end:p,selfClosing:!1,tag:""};let y=m.slice(1).trimStart();const k=y.startsWith("/");k&&(y=y.slice(1).trimStart());const g=y.match(/^([A-Z][\w:-]*)/i);return g?.[1]?{closing:k,end:p,selfClosing:/\/\s*>$/.test(m),tag:g[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},i=(f,h)=>{const p=new RegExp(String.raw`<\s*\/\s*${Ki(f)}(?=\s|>)`,"gi");p.lastIndex=h;const m=p.exec(e);if(!m||m.index==null)return null;const y=s(m.index);return y?{start:m.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a<e.length;){const f=e.indexOf("<",a);if(f===-1)return null;const h=s(f);if(!h)return null;if(!h.closing&&h.tag===o){r=f,l=h.end-1;break}if(!h.closing&&ev.has(h.tag)){a=i(h.tag,h.end)?.end??e.length;continue}a=h.end}if(r===-1||l===-1)return null;const c=e.slice(r,l+1);if(Wl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:l+1,closed:!0};if(ev.has(o)){const f=i(o,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let u=1,d=l+1;for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};const h=s(f);if(!h)return null;if(h.closing&&h.tag===o){u--;const p=h.end;if(u===0)return{raw:e.slice(r,p),start:r,end:p,closeStart:f,closed:!0};d=p;continue}if(!h.closing&&h.tag===o){!h.selfClosing&&!Wl.has(h.tag)&&u++,d=h.end;continue}if(!h.closing&&ev.has(h.tag)){d=i(h.tag,h.end)?.end??e.length;continue}d=h.end}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function ZJ(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
239
- `){n++;continue}return-1}return o===t.length?n:-1}function XJ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
240
- </${t}>`}function WC(e){return e.replace(/\r\n/g,`
241
- `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function QJ(e,t,n){return n?e.includes(n,t)?!0:WC(e.slice(Math.max(0,t))).includes(WC(n)):!1}function JJ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
242
- `&&n++,n):e[n]===`
243
- `?n+1:t}function zC(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 eee(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function W8(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ki(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function z8(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const tee=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),nee=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function oee(e){return/\n\s*\n/.test(e)||nee.test(e)}function see(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>tee.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!oee(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function iee(e){const t=[];let n=0;for(;n<e.length;){for(;/\s/.test(e[n]??"");)n++;if(n>=e.length)break;const o=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!o?.[1])return null;const s=jf(e,o[1],n);if(!s||s.start!==n)return null;t.push(s.raw),n=s.end}return t.length>1?t:null}function ree(e,t,n,o){const s=n.customHtmlTags?.join("\0")??"",i=t,r=NC.get(i),l=r&&r.final===o&&r.customHtmlTags===s&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((c,u)=>l&&r.blocks[u]===c?r.children[u]:cu(c,t,n));return NC.set(i,{blocks:e,children:a,customHtmlTags:s,final:o,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function lee(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||q5.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=po(l);if(a===-1)return s;const c=jf(l,r,0),u=c?.closeStart??-1,d=c?.closed===!0&&u>=a+1,f=d?l.slice(a+1,u):l.slice(a+1);if(!f.trim())return s;const h=z8(n,o),p=d?null:iee(f),m=p?ree(p,t,h,o):cu(f,t,h);return see(f,m)?{...s,children:m}:s})}function aee(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function cu(e,t,n){return e.trim()?q8(e,t,{...n,__disableStreamParse:!0}):[]}function cee(e,t,n){const o=cu(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function uee(e,t,n){const o=E8({content:e}),s=po(e),i=W8(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=cee(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function dee(e,t,n){const o=po(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=jf(s,"summary",0);if(!i)return cu(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...cu(r,t,n),uee(i.raw,t,n),...cu(l,t,n)]}function U8(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=qd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!zC(c)){r.push(c);continue}const f=String(c.raw??qd(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let ie=a+1;ie<e.length;ie++){const q=e[ie];if(zC(q)){p++;continue}if(eee(q)&&(p--,p===0)){m=ie;break}}const y=jf(t,"details",h),k=m===-1&&y?.closed===!0,g=k?(()=>{const ie=W8(f,"details");return ie!==-1?f.slice(0,ie):f})():f,[v]=U8(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,h+f.length),b=dee(g,n,z8(o,s)),A=m===-1?"</details>":String(e[m].raw??qd(e[m])??"</details>"),I=k||m!==-1&&y?.closed===!0,N=A.replace(/[\t\r\n ]+$/,""),M=I?(()=>{const ie=(y?.raw??"").lastIndexOf(N);return ie===-1?t.length:h+ie})():t.length,$=po(f),T=k&&$!==-1?h+$+1:h+f.length,F=t.slice(T,M===-1?t.length:M),S=n.parse(F,{__markstreamFinal:s}),B=n.renderer.render(S,n.options,{__markstreamFinal:s}),W=M+N.length,z=I?Math.max(M+A.length,JJ(t,W)):t.length,L=I?t.slice(M,z):A,O=I?t.slice(h,z):t.slice(h),U=k&&$!==-1?f.slice(0,$+1):f,Z={...c,tag:"details",attrs:W1(f.slice(0,$+1)),raw:O,content:`${U}${B}${L}`,children:[...b,...v],loading:!s&&!I};if(o.includeSourceMap&&(Z.sourceMap=Sf(t,h,I?z:t.length,o)),r.push(Z),l=I?z:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function fee(e,t,n,o){if(!n)return e;const s=e.slice();let i=0;for(let r=0;r<s.length;r++){const l=s[r],a=qd(l),c=a?n.indexOf(a,i):-1;if(l?.type!=="html_block"){c!==-1&&(i=c+a.length);continue}const u=String(l.tag??"").toLowerCase();if(!u)continue;if(u==="details"){c!==-1&&(i=c+a.length);continue}const d=jf(n,u,c!==-1?c:i);if(!d)continue;i=d.end;const f=String(l.content??a),h=String(l.raw??f),p=c+h.length;if(c!==-1&&d.end<p&&n.slice(c,p)===h){i=p,o?.includeSourceMap&&(l.sourceMap=Sf(n,c,p,o));continue}const m=XJ(d.raw,u,d.closed),y=!t&&!d.closed,k=f!==m||h!==d.raw||!!l.loading!==y,g=po(d.raw),v=g===-1?"":d.raw.slice(0,g+1),b=v?W1(v):[];if(l.content=m,l.raw=d.raw,l.loading=y,l.attrs=b.length?b:void 0,o?.includeSourceMap&&(l.sourceMap=Sf(n,d.start,d.end,o)),!k)continue;let A=ZJ(d.raw,h);A===-1&&(A=0);const I=r+1;for(;I<s.length;){if(d.closed&&YJ(s[I],u)){s.splice(I,1);continue}const N=qd(s[I]);if(!N)break;const M=d.raw.indexOf(N,A);if(M===-1){if(QJ(n,d.end,N))break;const $=I8.get(s[I]);if(!$)break;if($.start>=d.start&&$.end<=d.end){s.splice(I,1);continue}break}A=M+N.length,s.splice(I,1)}}return s}function hee(e){const t=l=>l===" "||l===" "||l===`
244
- `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l.startsWith("<!--")||l.startsWith("<?")||l.startsWith("<!")||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const y=m.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},u=m=>{const y=m.charCodeAt(0);return y>=48&&y<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(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(!h(l[a]))return!1;for(a++;a<l.length&&p(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 m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const y=l[a];if(t(y)||y==="<"||y===">"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const b=g[v];if(b!=="`"&&b!=="~")return null;let A=v;for(;A<g.length&&g[A]===b;)A++;const I=A-v;return I<3?null:{markerChar:b,markerLen:I,rest:g.slice(A)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let b=!1;for(;v<g.length&&g[v]===">";)for(b=!0,v++;v<g.length&&f(g[v]);)v++;return b?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const b=p(g);return b==null?null:h(b)};let y=0;const k=l.split(/\r?\n/);for(const g of k){const v=y,b=y+g.length;if(a<v)break;const A=m(g);if(A){const I=A.markerChar,N=A.markerLen;c?I===u&&N>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=I,d=N)}if(a<=b)break;y=b+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
245
- `||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
246
- `||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function UC(e,t){if(e===t)return;const n=e.split(/\r?\n/),o=t.split(/\r?\n/),s=[];let i=0;for(let r=0;r<o.length;r++){const l=o[r]??"";if(n[i]===l){s[r]={startLine:i,endLine:i+1},i++;continue}const a=n[i]??"";if(l!==""&&a!==l&&a.startsWith(l)){let h=l,p=-1;for(let m=r+1;m<o.length;m++){if(h+=o[m]??"",h===a){p=m;break}if(!a.startsWith(h))break}if(p!==-1){for(let m=r;m<=p;m++)s[m]={startLine:i,endLine:i+1};i++,r=p;continue}s[r]={startLine:i,endLine:i+1};continue}let c=n[i]??"",u=-1;for(let h=i+1;h<n.length;h++){if(c+=`\\n${n[h]??""}`,c===l){u=h+1;break}if(!l.startsWith(c))break}if(u!==-1){s[r]={startLine:i,endLine:u},i=u;continue}let d=-1;if(l!==""){const h=Math.min(n.length,i+80);for(let p=i;p<h;p++)if(n[p]===l){d=p;break}}if(d!==-1){s[r]={startLine:d,endLine:d+1},i=d+1;continue}const f=Math.min(Math.max(0,n.length-1),Math.max(0,i-1));s[r]={startLine:f,endLine:f+1}}return r=>{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(l<s.length)return s[l]??{startLine:0,endLine:0};const a=s[s.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},c=Math.min(n.length,a.endLine+l-s.length);return{startLine:c,endLine:Math.min(n.length,c+1)}}}function pee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let y=0;y<p.length;y++){const k=p[y];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=p=>{let m=!1,y=!1;for(let k=0;k<p.length;k++){const g=p[k];if(g==="\\"){k++;continue}if(!y&&g==="'"){m=!m;continue}if(!m&&g==='"'){y=!y;continue}if(!m&&!y&&g===">")return k}return-1},l=p=>{let m=0;for(;m<p.length&&o(p[m]);)m++;const y=p[m];if(y!=="`"&&y!=="~")return null;let k=m;for(;k<p.length&&p[k]===y;)k++;const g=k-m;return g<3?null:{markerChar:y,markerLen:g,rest:p.slice(k)}},a=(p,m)=>{if(i(p))return-1;const y=p.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let k=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){o(v)||(k=!0),g++;continue}const b=r(p.slice(g));if(b===-1){k=!0,g++;continue}const A=p.slice(g,g+b+1);let I=1;for(;I<A.length&&o(A[I]);)I++;if(I>=A.length){k=!0,g++;continue}const N=A[I];if(N==="!"||N==="?"){k=!0,g+=b+1;continue}if(N==="/"){k=!0,g+=b+1;continue}const M=I;for(;I<A.length&&s(A[I]);)I++;if(I===M){k=!0,g++;continue}const $=A.slice(M,I).toLowerCase(),T=A[I];if(T&&T!==" "&&T!==" "&&T!==">"&&T!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${$}\s*>`,"i"),S=/\/\s*>$/.test(A),B=F.test(p.slice(g+b+1)),W=F.test(e.slice(m+g+b+1)),z=/[\r\n]/.test(e.slice(m+g+b+1));if(k&&n.has($)&&!S&&!B&&(W||z))return g;k=!0,g+=b+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
247
- `,h),m=p!==-1,y=m&&p>h&&e[p-1]==="\r",k=m?y?p-1:p:e.length,g=e.slice(h,k),v=m?y?`\r
248
- `:`
249
- `:"",b=l(g);let A=g;if(!c&&!b){const I=a(g,h);if(I!==-1){const N=v||`
250
- `;A=`${g.slice(0,I).replace(/[ \t]+$/,"")}${N}${N}${g.slice(I).replace(/^[ \t]+/,"")}`}}f+=A,f+=v,b&&(c?b.markerChar===u&&b.markerLen>=d&&/^\s*$/.test(b.rest)&&(c=!1,u="",d=0):(c=!0,u=b.markerChar,d=b.markerLen)),h=m?p+1:e.length}return f}function mee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let y=m+1;for(;y<d.length&&o(d[y]);)y++;if(y>=d.length||d[y]!=="/"){m=d.indexOf("<",m+1);continue}for(y++;y<d.length&&o(d[y]);)y++;if(y+p.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<p.length;v++){const b=d[y+v];if((b>="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==p[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=y+p.length;if(g<d.length&&s(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&o(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const y=f+m;if(l(d,y+1,p))return d;const k=i(d.slice(y+1));return k?`${d.slice(0,y+1)}
251
- ${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
252
- `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
253
- `:`
254
- `,u=d+1}return c}function gee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const y=m-h;return y<3?null:{markerChar:p,markerLen:y,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\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 f=e.indexOf(`
255
- `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,y=e.slice(d,m),k=h?p?`\r
256
- `:`
257
- `:"",g=s(y),v=g?.prefix??"",b=g?.content??y,A=i(b);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let I=b;if(!l&&I.includes("</"))for(const N of r)I=I.replace(N,(M,$,T,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return M;const S=F.slice(0,T).replace(/^[\t ]+/,"");if(S.length>0){const B=$.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",W=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!B||!W||B!==W)return M}return`${$}
258
-
259
- `});if(v){const N=v+I.split(`
260
- `).join(`
261
- ${v}`);u+=N}else u+=I;u+=k,d=h?f+1:e.length}return u}function vee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let B=0;for(let W=0;W<S.length;W++){const z=S[W];if(z===" "){if(B++,B>=4)return!0;continue}if(z===" ")return!0;break}return!1},i=S=>{const B=S.charCodeAt(0);return B>=65&&B<=90||B>=97&&B<=122||B>=48&&B<=57||S==="_"||S==="-"||S===":"},r=S=>{let B=0;for(;B<S.length&&o(S[B]);)B++;return S.slice(B)},l=S=>{let B=0,W=!1,z=0;for(;B<S.length;){for(;B<S.length&&o(S[B]);)B++;if(B>=S.length||S[B]!==">")break;for(W=!0,B++;B<S.length&&o(S[B]);)B++;z=B}if(!W)return null;const L=S.slice(0,z);return{prefix:L,key:L.replace(/[ \t]+$/,""),content:S.slice(z)}},a=S=>r(S).startsWith("<"),c=S=>{for(let B=0;B<S.length;B++){const W=S[B];if(W!==" "&&W!==" ")return!1}return!0},u=S=>{if(s(S))return"";const B=r(S);if(!B.startsWith("<"))return"";let W=1;for(;W<B.length&&o(B[W]);)W++;if(W>=B.length||B[W]==="/"||B[W]==="!"||B[W]==="?")return"";const z=W;for(;W<B.length&&i(B[W]);)W++;if(W===z)return"";const L=B.slice(z,W).toLowerCase();if(!n.has(L))return"";const O=B[W];return O&&O!==" "&&O!==" "&&O!==">"&&O!=="/"?"":L},d=S=>{if(s(S))return null;const B=r(S);if(!B.startsWith("<"))return null;let W=1;for(;W<B.length&&o(B[W]);)W++;if(W>=B.length)return null;const z=B[W]==="/";if(z)for(W++;W<B.length&&o(B[W]);)W++;const L=B[W];if(!L||L==="!"||L==="?")return null;const O=W;for(;W<B.length&&i(B[W]);)W++;if(W===O)return null;const U=B.slice(O,W).toLowerCase();if(!n.has(U))return null;const Z=B[W];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(z)return{type:"close",name:U};if(/\/\s*>\s*$/.test(B))return{type:"open",name:U,complete:!0};const ie=B.indexOf(">",W);if(ie!==-1){const q=B.slice(ie+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(q))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,complete:!1}},f=S=>{if(s(S))return null;const B=r(S).replace(/[ \t]+$/,"");if(!B.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(B))return null;const W=B.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(W?.[1])return W[1].toLowerCase();const z=B.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const L=z[1].toLowerCase();return L===z[2].toLowerCase()?L:null};let h=!1,p="",m=0;const y=S=>{let B=0;for(;B<S.length&&o(S[B]);)B++;const W=S[B];if(W!=="`"&&W!=="~")return null;let z=B;for(;z<S.length&&S[z]===W;)z++;const L=z-B;return L<3?null:{markerChar:W,markerLen:L,rest:S.slice(z)}},k=S=>y(S),g=S=>{const B=r(S);return B?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(B):!1},v=(S,B,W)=>{let z=S,L=0;for(;z<e.length;){const O=e.indexOf(`
262
- `,z),U=O!==-1,Z=U&&O>z&&e[O-1]==="\r",ie=U?Z?O-1:O:e.length,q=e.slice(z,ie),ee=l(q),fe=ee?.key??"";if(L>0&&B&&fe!==B)break;const ne=ee?.content??q,j=d(ne);if(j?.name===W){if(j.type==="open")j.complete||L++;else if(L>0&&(L--,L===0))return!1}else if(L>0&&(c(ne)||g(ne)))return!0;if(U)z=O+1;else break}return!1};let b="",A=0,I=!0,N=!1,M=!1,$=`
263
- `;const T=[];let F="";for(;A<e.length;){const S=e.indexOf(`
264
- `,A),B=S!==-1,W=B&&S>A&&e[S-1]==="\r",z=B?W?S-1:S:e.length,L=e.slice(A,z),O=B?W?`\r
265
- `:`
266
- `:"",U=l(L),Z=U?.key??"",ie=U?.content??L,q=k(ie);q&&(h?q.markerChar===p&&q.markerLen>=m&&/^\s*$/.test(q.rest)&&(h=!1,p="",m=0):(h=!0,p=q.markerChar,m=q.markerLen));const ee=T.length>0;if(!h&&!ee){const ne=u(ie),j=!!ne&&!I&&N&&M&&v(A,Z,ne);ne&&!I&&(!N||j)&&(Z&&F&&Z===F?b+=`${Z}${$}`:Z||(b+=$))}if(b+=L,b+=O,O&&($=O),!h){const ne=d(ie);if(ne){if(ne.type==="open")ne.complete||T.push(ne.name);else for(let j=T.length-1;j>=0;j--)if(T[j]===ne.name){T.length=j;break}}}const fe=c(ie);I=fe,N=!fe&&a(ie),M=!fe&&!!f(ie),F=Z,A=B?S+1:e.length}return b}function q8(e,t,n={}){const o=L8(n),s=o?xu():0,i=!!n.final,r=(e??"").toString();let l=r.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,"$1\\n$2");if(MJ(t,n)&&(t.stream.reset(),EJ(t)),i||(l.endsWith("- *")&&(l=l.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*-\s*$/,g=>g.startsWith(`
267
- `)?`
268
- `:""):/(?:^|\n)\s*--\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*--\s*$/,g=>g.startsWith(`
269
- `)?`
270
- `:""):/(?:^|\n)\s*>\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*>\s*$/,g=>g.startsWith(`
271
- `)?`
272
- `:""):/\n\s*[*+]\s*$/.test(l)?l=l.replace(/\n\s*[*+]\s*$/,`
273
- `):/(?:^|\n)\s*\d+\s*$/.test(l)?/^\d+$/.test(l.trim())||(l=l.replace(/(?:^|\n)\s*\d+\s*$/,g=>g.startsWith(`
274
- `)?`
275
- `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(l)?l=l.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(g,v,b)=>`${v}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*\d+[.)]\s*$/,g=>g.startsWith(`
276
- `)?`
277
- `:""):/\n[[(]\n*$/.test(l)&&(l=l.replace(/(\n\[|\n\()+\n*$/g,`
278
- `)),l=PJ(l,t),l=RJ(l,n.customHtmlTags)??l),n.customHtmlTags?.length&&l.includes("<")){const g=tc(n.customHtmlTags);if(g.length&&(l=pee(l,g),l=mee(l,g),l=vee(l,g),l=gee(l,g),l.includes("</")))for(const v of g){const b=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");l=l.replace(b,"$1$2$2")}}i||(l=hee(l));const a=GJ(l);if(a){if(n.includeSourceMap){const b={...n,__sourceLineMapper:UC(r,l)};a[0].sourceMap=Sf(l,0,l.length,b)}const g=n.preTransformTokens,v=n.postTransformTokens;if(I2(t,n)||typeof g=="function"||typeof v=="function"){const b=RC(t,l,{__markstreamFinal:i},n),A=typeof g=="function"&&g(b)||b;typeof v=="function"&&v(A)}return LC(a,n,o,s)}const c=RC(t,l,{__markstreamFinal:i},n);if(!c||!Array.isArray(c))return LC([],n,o,s);const u=n.preTransformTokens,d=n.postTransformTokens;let f=c;u&&typeof u=="function"&&(f=u(f)||f);const h=t,p=typeof h.validateLink=="function"&&h.__markstreamOriginalValidateLink&&h.validateLink!==h.__markstreamOriginalValidateLink?h.validateLink:void 0,m=n.validateLink??p??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),y={...n,validateLink:m,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?UC(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let k=_J(t,l,f,y,o);if(d&&typeof d=="function"){const g=d(f);if(Array.isArray(g)){const v=g[0],b=v?.type;v&&typeof b=="string"?k=$p(g,{...y,__customHtmlBlockCursor:0},o):k=g}}if(aee(k)&&(k=fee(k,i,l,y),k=U8(k,l,t,y,i)[0],k=lee(k,t,y,i)),i){const g=new WeakSet,v=b=>{if(!b||typeof b!="object"||g.has(b))return;if(g.add(b),Array.isArray(b)){for(const I of b)v(I);return}const A=b;A.type==="html_block"&&A.loading===!0&&(A.loading=!1);for(const I of Object.values(A))v(I)};v(k)}return k=F8(k,n),n.debug&&console.log("Parsed Markdown Tree Structure:",k),$8(k,o,s)}function qC(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Yl(t),s=t?.includeSourceMap===!0;let i=0;for(;i<e.length;){const r=N2(e,i,o.options(),T2);if(r){nr(r[0],e[i],t),n.push(r[0]),o.remember(r[0].raw),i=r[1];continue}const l=e[i];switch(l.type){case"paragraph_open":{const a=String(e[i+1]?.content??""),c=hJ(e,i,o.options(a));s&&hn(c,l,t);const u=HC(c,t);if(u){s&&PC(u,c);for(const d of u)nr(d,l,t);n.push(...u)}else nr(c,l,t),n.push(c);o.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=Mu(e,i,o.options());s&&hn(a,l,t),nr(a,l,t),n.push(a),o.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=Eu(e,i,o.options());s&&hn(a,l,t),nr(a,l,t),n.push(a),o.remember(a.raw),i=c;break}case"footnote_anchor":{const a=l.meta??{},c={type:"footnote_anchor",id:String(a.label??l.content??""),raw:String(l.content??"")};s&&hn(c,l,t),nr(c,l,t),n.push(c),o.remember(String(l.content??"")),i++;break}case"hardbreak":n.push(fJ()),o.reset(),i++;break;case"text":{const a=String(l.content??""),c={type:"paragraph",raw:a,children:a?[{type:"text",content:a,raw:a}]:[]};s&&hn(c,l,t),nr(c,l,t),n.push(c),o.remember(a),i++;break}case"inline":{const a=String(l.content??""),c=ao(l.children||[],a,void 0,o.options(a));if(c.length!==0)if(c.every(u=>u.type==="html_block")){if(s)for(const u of c)hn(u,l,t);for(const u of c)nr(u,l,t);n.push(...c)}else{const u={type:"paragraph",raw:a,children:c};s&&hn(u,l,t);const d=HC(u,t);if(d){s&&PC(d,u);for(const f of d)nr(f,l,t);n.push(...d)}else nr(u,l,t),n.push(u)}o.remember(a)}i+=1;break;default:i+=1;break}}return n}const yee=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,kee=new Set([...zf,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),bee=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","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function jC(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xee(e){return typeof e=="string"?e:e==null?"":String(e)}function j8(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Al(e){return xee(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function V8(e){return Al(e).replace(/`/g,"&#96;")}function V1(e){return String(e??"").trim().toLowerCase()}function O2(e,t="safe"){const n=V1(e);return n?t==="escape"?!0:t==="trusted"?zf.has(n):!bee.has(n):!1}function K8(e,t="safe"){const n=V1(e);return n?t==="escape"?!0:t==="trusted"?zf.has(n):kee.has(n):!1}function VC(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${V8(o)}"`).join("")}function G8(e){const t=e.startsWith("/"),n=t?e.slice(1):e,o=n.match(yee);return o?{attrsStr:t?"":n.slice(o[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:o[1]}:null}function wee(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||Ra(s,{tagName:t,attrName:"srcset"})})}function Y8(e,t,n,o){return vY.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?wee(t,o):!!(yY.has(e)&&t&&Ra(t,{tagName:o,attrName:e}))}function Sa(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function Z8(e,t,n,o=!1){if(t!=="safe"||V1(n)!=="a")return e;const s=Sa(e,"href");if(o&&(!s||!e[s])){const a=Sa(e,"target"),c=Sa(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Sa(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Sa(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 KC(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!j8(r)||Y8(l,i,t,n)||(o[r]=i)}return Z8(o,t,n,!!Sa(e,"href"))}function X8(e,t){const n=e.toLowerCase();return U5.has(n)?!1:jC(t,n)||jC(t,e)}function B2(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!j8(r)||Y8(l,i,t,n)||(o[r]=i)}return Z8(o,t,n,!!Sa(e,"href"))}function jd(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function Fp(e,t="safe",n){const o=B2(jd(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function _ee(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 o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function See(e){const t={};for(const[n,o]of Object.entries(e))t[n]=_ee(o,n);return t}function tv(e){return e.trim().length>0}function Q8(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const r=e.indexOf("-->",n);if(r!==-1){n=r+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const r=e.slice(n);tv(r)&&t.push({type:"text",content:r})}break}if(o>n){const r=e.slice(n,o);tv(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",o+1)){const r=e.indexOf("]]>",o);if(r!==-1){t.push({type:"text",content:e.slice(o,r+3)}),n=r+3;continue}break}if(e.startsWith("!",o+1)){const r=e.indexOf(">",o);if(r!==-1){n=r+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=G8(e.slice(o+1,s));if(!i){const r=e.slice(o,s+1);tv(r)&&t.push({type:"text",content:r}),n=s+1;continue}if(i.isClosing)t.push({type:"tag_close",tagName:i.tagName});else{const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Wl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r})}n=s+1}return t}function Cee(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const l=e.indexOf("-->",n);if(l!==-1){n=l+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const l=e.indexOf("]]>",o);if(l!==-1){t.push({type:"text",content:e.slice(o,l+3)}),n=l+3;continue}break}if(e.startsWith("!",o+1)){const l=e.indexOf(">",o);if(l!==-1){n=l+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=G8(e.slice(o+1,s));if(!i){t.push({type:"text",content:e.slice(o,s+1)}),n=s+1;continue}if(i.isClosing){t.push({type:"tag_close",tagName:i.tagName}),n=s+1;continue}const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Wl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r}),n=s+1}return t}function Aee(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${Al(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Al(o)}`:` ${Al(o)}="${V8(s)}"`).join("");return e.type==="self_closing"?`&lt;${Al(t)}${n} /&gt;`:`&lt;${Al(t)}${n}&gt;`}function Mee(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of Q8(e))if((n.type==="tag_open"||n.type==="self_closing")&&X8(n.tagName??"",t))return!0;return!1}function uu(e,t="safe"){if(!e)return"";if(t==="escape")return Al(e);const n=Cee(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Al(r.content??""));continue}const l=V1(r.tagName);if(!l)continue;if(K8(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"&&O2(l,t)){s.push(Aee(r));continue}if(r.type==="self_closing"){s.push(`<${l}${VC(KC(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${VC(KC(r.attrs??{},t,l))}>`),Wl.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const Eee=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],GC="http://www.w3.org/2000/svg",Tee=new Set(["script","style","iframe","object","embed","link","meta"]),Nee=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"]),Iee=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Lee=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),$ee=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Fee(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Oee(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Bee(e){const t=e.nodeName.toLowerCase();return t==="use"?Fee(e):t==="image"?Oee(e):t==="text"||t==="tspan"?!!e.textContent?.trim():$ee.has(t)}function Ree(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 Dee(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?Ra(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ra(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ra(i,{tagName:o,attrName:s})?"":i:""}function Pee(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,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 s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function J8(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function eE(e){const t=J8(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=Pee(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function YC(e){const t=J8(e);return Eee.some(n=>n.test(t))||eE(t)}function Hee(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 ep(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function tE(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!Tee.has(o)){if(o==="br"){t.push(`
279
- `);return}for(const s of Array.from(n.childNodes))tE(s,t)}}function Wee(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];tE(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=ep(t.getAttribute("width")),i=ep(t.getAttribute("height")),r=ep(t.getAttribute("x")),l=ep(t.getAttribute("y")),a=e.ownerDocument.createElementNS(GC,"text");a.setAttribute("x",String(r+s/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")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(GC,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function zee(e){Wee(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!Nee.has(o)){n.remove();continue}if(o==="style"&&YC(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&YC(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(Iee.has(r)&&i.value){const l=Dee(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(Lee.has(r)&&i.value&&eE(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=Ree(i.value);l!==i.value&&n.setAttribute(i.name,l)}}Hee(n)}}function J4e(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 zee(n),Uee(n)?null:n}catch{return null}}function Uee(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){Bee(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const tp=[];function nv(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function qee(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function jee(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function ZC(e=`editor-${Date.now()}`,t={}){const n=$X(t),o=n;o.__markstreamRegisteredPluginCount=tp.length,o.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||tp.length);const s={"common.copy":"Copy"};let i;if(typeof t.i18n=="function")i=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;i=m=>p[m]??s[m]??m}else i=p=>s[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[y,...k]=m;typeof y=="function"&&n.use(y,...k)}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(tp.length)for(const p of tp)if(Array.isArray(p)){const[m,...y]=p;typeof m=="function"&&n.use(m,...y)}else typeof p=="function"&&n.use(p);n.use(Yq),n.use(Qq),n.use(Vq);const r=fj,l=r.default??r;n.use(l),n.use(jq),n.use(qq),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,y=m.src,k=!!m.env?.__markstreamFinal,g=y.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const b=v.map[0],A=v.map[1],I=v.markup,N=I[0],M=I.length,$=g[Math.max(0,A-1)]??"";let T=0;for(;T<$.length&&($[T]===" "||$[T]===" ");)T++;let F=0;for(;T+F<$.length&&$[T+F]===N;)F++;let S=T+F;for(;S<$.length&&($[S]===" "||$[S]===" ");)S++;const B=k?!0:A>b+1&&F>=M&&S===$.length,W=v;W.meta=W.meta??{},W.meta.unclosed=!B,W.meta.closed=!!B}});const a=(p,m)=>{const y=p,k=y.pos;if(y.src[k]!=="~")return!1;const g=y.src[k-1],v=y.src[k+1];if(/\d/.test(g)&&/\d/.test(v)){if(!m){const b=y.push("text","",0);b.content="~"}return y.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",a),n.renderer.rules.fence=(p,m)=>{const y=p[m],k=String(y.info??"").trim(),g=String(y.content??""),v=btoa(unescape(encodeURIComponent(g))),b=qee(k),A=nv(b),I=jee(`editor-${e}-${m}-${b}`),N=nv(i("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${A}" id="${I}">
280
- <div class="code-header">
281
- <span class="code-lang">${nv(b.toUpperCase())}</span>
282
- <button class="copy-button" data-code="${v}">${N}</button>
283
- </div>
284
- <div class="code-editor"></div>
285
- </div>`};const c=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,d=p=>{if(!p.startsWith("["))return!1;const m=u.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const y=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(y)},f=(p,m)=>{const y=p;if(y.src[y.pos]!=="[")return!1;const k=c.exec(y.src.slice(y.pos));if(!k)return!1;const g=y.src.slice(Math.max(0,y.pos-120),y.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(g))return!1;const v=y.src.slice(y.pos+k[0].length);if(v.startsWith("](")||v.startsWith("(")||d(v))return!1;if(!m){const b=k[1],A=y.push("reference","span",0);A.content=b,A.markup=k[0],A.raw=k[0]}return y.pos+=k[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(p,m)=>{const k=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${k}" role="button" tabindex="0" title="Click to view reference">${k}</span>`};const h=n.use.bind(n);return n.use=((...p)=>(o.__markstreamHasCustomParserExtensions=!0,h(...p))),n}function Vee({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 nE({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Vee({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Kee={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Gee(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function oE(e){const t=Gee(e);return Kee[t]??t}function Yee(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>oE(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Zee(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function Xee(e){return Zee(e)?.join("\0")??""}function Qee(e,t){return`${Xee(e)}\0\0${Yee(t)?.join("\0")??""}`}function Ac(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function XC(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Jee=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 f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=QC();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,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=QC();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 f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=ote(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=nte(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Ac(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Ac(o,1e3,1)),this.normalizedTargetLatencyMs=Ac(s,900,1),this.normalizedCatchUpLatencyMs=Ac(i,350,1),this.normalizedCatchUpThreshold=XC(r,600),this.normalizedStartDelayMs=XC(a,80),this.maxCommitFps=Math.trunc(Ac(l,30,1)),this.maxCharsPerCommit=Math.trunc(Ac(c,80,1)),this.flushOnFinish=u,this.segmenter=tte(),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 ete(e={},t){const n=new Jee(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 tte(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function nte(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 o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function QC(){return typeof performance<"u"?performance.now():Date.now()}function ote(e,t,n){return Math.min(n,Math.max(t,e))}var ste=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Hy=Symbol.for("markstream-vue:node-lifecycle");function e3e(){}const R2=new Map;let sE="material";const Kc=new Map,JC=new Map;let Wy=null;function ite(e){R2.set(e.id,e)}function rte(e){const t=R2.get(sE);if(!t)return;const n=t.core[e];if(n)return n;const o=Kc.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!Kc.has(t.id)&&ate(t)}function lte(){var e,t;return(t=(e=R2.get(sE))==null?void 0:e.fallback)!=null?t:""}function ate(e){return ste(this,null,function*(){var t,n,o;if(Kc.has(e.id))return(t=Kc.get(e.id))!=null?t:null;let s=JC.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Kc.set(e.id,i),Wy?.(),i)).catch(()=>(Kc.set(e.id,null),null)),JC.set(e.id,s)),s})}const e4='<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>',t4='<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>',cte={id:"material",core:{"":t4,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:t4,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:e4,csharp:e4,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:()=>vs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},ute=gr(0);Wy=()=>{ute.value++},ite(cte);const dte={"":"",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",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function K1(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=dte[n])!=null?t:n}function t3e(e){const t=K1(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function n3e(e){return rte(K1(e))||lte()}const n4={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#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var G1=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let gs=null,Na=!1,Ia=null,Y1=P2;function Vf(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function D2(){try{const e=globalThis;return Vf(e?.katex)}catch{return null}}function P2(){return G1(null,null,function*(){const e=D2();if(e)return e;const t=yield vs(()=>import("./katex-DnlPpQZa.js"),[]);try{yield vs(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Vf(t)})}function iE(e){const t=Promise.resolve(e).then(n=>{var o;return Ia===t&&n?(gs=(o=Vf(n))!=null?o:n,gs):null}).catch(()=>null).finally(()=>{Ia===t&&(Ia=null)});return Ia=t,Na=!0,t}function fte(e){Y1=e,gs=null,Na=!1,Ia=null}function hte(e){fte(P2)}function rE(){return typeof Y1=="function"}function o3e(){var e;const t=Y1;if(!t||t===P2)return null;if(gs)return gs;const n=D2();if(n)return gs=n,gs;if(Na)return null;try{const o=t();return o?typeof o?.then=="function"?(iE(o),null):(gs=(e=Vf(o))!=null?e:o,gs):null}catch{return null}}function lE(){return G1(this,null,function*(){var e;const t=D2();if(t)return gs=t,gs;if(gs)return gs;if(Ia)return Ia;if(Na)return null;const n=Y1;if(!n)return Na=!0,null;try{const o=n();if(typeof o?.then=="function")return iE(o);if(o)return gs=(e=Vf(o))!=null?e:o,Na=!0,gs}catch{}return Na=!0,null})}function aE(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Tl=null,wl=null;const Yo=new Map,Ur=new Map;let Af=5;const Pa=new Set;function Vd(){if(Yo.size<Af&&Pa.size){let e=Af-Yo.size;for(const t of Array.from(Pa)){if(e<=0)break;Pa.delete(t),e--;try{t()}catch{}}}}function cE(){for(const e of Array.from(Pa)){Pa.delete(e);try{e()}catch{}}}function pte(e){Tl=e,wl=null,Tl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Yo.get(n);if(i)if(Yo.delete(n),clearTimeout(i.timeoutId),i.cleanup(),Vd(),s)i.aborted||i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Ur.set(a,o),Ur.size>200){const c=Ur.keys().next().value;Ur.delete(c)}}i.aborted||i.resolve(o)}},Tl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Yo.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));Yo.clear(),cE()}}function mte(){var e;for(const t of Yo.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Yo.clear(),cE(),Tl&&((e=Tl.terminate)==null||e.call(Tl)),Tl=null,wl=null}function gte(e,t=!0,n=2e3,o){return G1(this,null,function*(){performance.now();const s=aE(e);if(!rE()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(wl)return Promise.reject(wl);const i=`${t?"d":"i"}:${s}`,r=Ur.get(i);if(r)return Vd(),Promise.resolve(r);const l=Tl||(wl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),wl.name="WorkerInitError",wl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(wl);if(Yo.size>=Af){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Yo.size,a.max=Af,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const m=new Error("Aborted");return m.name="AbortError",void c(m)}const u=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=Yo.get(u);if(!m)return;Yo.delete(u),m.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",m.aborted||m.reject(y),Vd()},n);d=()=>{const m=Yo.get(u);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const y=new Error("Aborted");y.name="AbortError",c(y)},o&&o.addEventListener("abort",d,{once:!0});const h=a,p=c;Yo.set(u,{resolve:m=>{h(m)},reject:m=>{p(m)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:u,content:s,displayMode:t})}catch(m){const y=Yo.get(u);Yo.delete(u),clearTimeout(f),y?.cleanup(),y?.reject(m),Vd()}})})}function s3e(e,t=!0,n){const o=`${t?"d":"i"}:${aE(e)}`;if(Ur.set(o,n),Ur.size>200){const s=Ur.keys().next().value;Ur.delete(s)}}const vte="WORKER_BUSY";function yte(e=2e3,t){return Yo.size<Af?Promise.resolve():new Promise((n,o)=>{let s,i=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),Pa.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},Pa.add(l),s=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const c=new Error("Wait for worker slot timed out");c.name="WorkerBusyTimeout",c.code="WORKER_BUSY_TIMEOUT",o(c)},e),queueMicrotask(()=>Vd()),t&&(r=()=>{if(i)return;i=!0,a();const c=new Error("Aborted");c.name="AbortError",o(c)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const ud={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function i3e(e){return G1(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!rE()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:ud.timeout,c=(i=o.waitTimeout)!=null?i:ud.waitTimeout,u=(r=o.backoffMs)!=null?r:ud.backoffMs,d=(l=o.maxRetries)!=null?l:ud.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ud.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield gte(t,n,a,h)}catch(m){if(m?.code!==vte||p>=f)throw m;if(p++,yield yte(c,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}u>0&&(yield new Promise(y=>globalThis.setTimeout(y,u*p)))}}})}function Gc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function kte(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function Fm(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=kte(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function Om(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 uE(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Bm(e,t=360,n=500){return uE(e,t,n)}function Rm(e,t=360,n=500){return uE(e,t,n)}var bte=Object.defineProperty,xte=Object.defineProperties,wte=Object.getOwnPropertyDescriptors,o4=Object.getOwnPropertySymbols,_te=Object.prototype.hasOwnProperty,Ste=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?bte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dE=(e,t)=>{for(var n in t||(t={}))_te.call(t,n)&&s4(e,n,t[n]);if(o4)for(var n of o4(t))Ste.call(t,n)&&s4(e,n,t[n]);return e},i4=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Dm=()=>vs(()=>import("./mermaid.core-BwcskAQn.js").then(e=>e.bn),[]);let Tr=null,Yc=Dm,Cd=null,zy=!1,Uy=!1,Ad=0;function Cte(e){Yc=e,Ad++,Tr=null,Cd=null,zy=!1,Uy=!1}function Ate(e){Cte(Dm)}function r4(){return typeof Yc=="function"}function l4(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=dE({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},xte(n,wte(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function a4(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=dE({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function r3e(){return i4(this,null,function*(){if(Tr)return Tr;const e=(function(){try{const o=globalThis;return l4(o?.mermaid)}catch{return null}})();if(e)return Tr=e,a4(Tr),Tr;const t=Yc,n=Ad;return t?t===Dm&&zy?null:Cd||(Cd=i4(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===Dm)return n===Ad&&t===Yc&&(zy=!0,(function(i){Uy||(Uy=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(s)),null;throw s}finally{n===Ad&&t===Yc&&(Cd=null)}return n!==Ad||t!==Yc?null:o?(Tr=l4(o),a4(Tr),Tr):null}),Cd):null})}let $s=null,_l=null;const Di=new Map,ka=new Map;function Op(e){for(const t of Di.values())t.reject(e);Di.clear(),ka.clear()}let c4=5,u4=!1;const Mte="WORKER_BUSY",d4="MERMAID_DISABLED";function Ete(e){if($s&&$s!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",Op(n)}$s=e,_l=null;const t=e;$s.onmessage=n=>{if($s!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Di.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},$s.onerror=n=>{var o,s;if($s===t)if(Di.size!==0){try{u4?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}Op(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},$s.onmessageerror=n=>{var o,s;if($s===t)if(Di.size!==0){try{u4?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}Op(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function Tte(){var e;if($s)try{Op(new Error("Worker cleared")),(e=$s.terminate)==null||e.call($s)}catch{}$s=null,_l=null}function fE(e,t,n,o){if(!r4()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=d4,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=ka.get(s);return i||(i=(function(r,l,a=1400){if(!r4()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=d4,Promise.reject(u)}if(_l)return Promise.reject(_l);const c=$s||(_l=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),_l.name="WorkerInitError",_l.code="WORKER_INIT_ERROR",null);if(!c)return Promise.reject(_l);if(Di.size>=c4){const u=new Error("Worker busy");return u.name="WorkerBusy",u.code=Mte,u.inFlight=Di.size,u.max=c4,Promise.reject(u)}return new Promise((u,d)=>{const f=Math.random().toString(36).slice(2);let h,p=!1;const m=()=>{p||(p=!0,h!=null&&globalThis.clearTimeout(h),Di.delete(f))},y={resolve:k=>{m(),u(k)},reject:k=>{m(),d(k)}};Di.set(f,y);try{c.postMessage({id:f,action:r,payload:l})}catch(k){return Di.delete(f),void d(k)}h=globalThis.setTimeout(()=>{const k=new Error("Worker call timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT";const g=Di.get(f);g&&g.reject(k)},a)})})(e,t,n),ka.set(s,i),i.then(()=>{ka.get(s)===i&&ka.delete(s)},()=>{ka.get(s)===i&&ka.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,c)=>{let u=()=>{};const d=()=>l.removeEventListener("abort",u);u=()=>{d();const f=new Error("Aborted");f.name="AbortError",c(f)},l.addEventListener("abort",u,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),c(f)})})})(i,o)}function l3e(e,t,n=1400,o){return fE("canParse",{code:e,theme:t},n,o)}function a3e(e,t,n=1400,o){return fE("findPrefix",{code:e,theme:t},n,o)}var Nte=Object.defineProperty,Ite=Object.defineProperties,Lte=Object.getOwnPropertyDescriptors,f4=Object.getOwnPropertySymbols,$te=Object.prototype.hasOwnProperty,Fte=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?Nte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))$te.call(t,n)&&h4(e,n,t[n]);if(f4)for(var n of f4(t))Fte.call(t,n)&&h4(e,n,t[n]);return e},Ot=(e,t)=>Ite(e,Lte(t)),Zn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Ote="__global__",ov="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",qy=(()=>{const e=globalThis;if(e[ov])return e[ov];const t={scopedCustomComponents:{},revision:gr(0)};return e[ov]=t,t})(),p4=qy.revision,Bte=Symbol("markstreamCustomComponents"),Rte=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 Kf(e){return Rte.has(String(e).trim().toLowerCase())}function Dte(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function sv(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Ti(n),Ti(Dte(n))]))!s||Kf(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function To(e){const t=Jt(Bte,null);return D(()=>{var n;return p4.value,(function(o,s={}){return p4.value,it(it(it({},sv(qy.scopedCustomComponents[Ote]||{})),sv(s)),sv((function(i){return i&&qy.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const Pte=["aria-label"],Hte={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"},Wte={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"},Mn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},ti=Mn(Je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),E("svg",Wte,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),E("svg",Hte,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,Pte))}),[["__scopeId","data-v-be21ab83"]]);ti.install=e=>{e.component(ti.__name,ti)};const zte={class:"emoji-node"},Ds=Mn(Je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",zte,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Ds.install=e=>{e.component(Ds.__name,Ds)};const Ute=["id"],qte=["title"],ni=Mn(Je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(x(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,qte)],8,Ute))}}),[["__scopeId","data-v-c1463a29"]]);ni.install=e=>{e.component(ni.__name,ni)};const hE=(()=>{try{return!1}catch{}return!1})();function iv(e){hE&&console.warn(e)}function m4(e,t="safe",n){return B2(e,t,n)}function pE(e){return See(e)}function rv(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function H2(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=Fp((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),rv(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),rv(r.value)]):Object.entries(s).map(([r,l])=>[r,rv(l)]):null,t,n);var s;if(!o)return;const i=pE(jd(o));return Object.keys(i).length>0?i:void 0}function g4(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function dd(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function lv(e,t,n,o,s,i,r=!1){const l=(function(d,f){return X8(d,f)})(e,o);if(zf.has(e.toLowerCase())||!l&&K8(e,i))return null;if(!l&&O2(e,i))return r?[g4(e,t,!0)]:[g4(e,t),...n,`</${e}>`];const a=B2(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=pE(a);return Lt(d,Ot(it({},f),{key:u}),n.length>0?n:void 0)}return Lt(e,Ot(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function mE(e,t){return Mee(e,t)}function Pm(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 f=lv(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);dd(c.length>0?c[c.length-1].children:u,f)}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 f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=lv(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?dd(c[c.length-1].children,m):dd(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&iv(`Auto-closing unclosed tag: <${p.tagName}>`)}else iv(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=lv(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?dd(c[c.length-1].children,f):dd(u,f),iv(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(Q8(e),t,n)}catch(s){return o=s,hE&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const jte=["innerHTML"],oi=Mn(Je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),o=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=To(()=>t.customId),i=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:uu(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Pm(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!mE(l,s.value))return{mode:"html",content:uu(l,o.value)};const a=Pm(l,s.value,o.value);return a===null?{mode:"html",content:uu(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),E("span",{key:0,class:Ue(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ae(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),E("span",{key:1,class:Ue(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(x(),E("span",{key:2,class:Ue(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,jte))}}),[["__scopeId","data-v-d17f12b0"]]);oi.install=e=>{e.component(oi.__name,oi)};const Vte={class:"inline-code"},Kte={key:0},as=Mn(Je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Bf(),o=Jt("markstreamFade",void 0),s=Jt("markstreamTextStreamState",void 0),i=Jt("markstreamStreamVersion",void 0),r=D(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=D(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=D(()=>!l.value),u=D(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=oe(t.node.code),f=oe(""),h=oe(0);let p;function m(){p?.(),p=void 0}function y(){m(),f.value&&(d.value=d.value+f.value,f.value="")}et([()=>t.node.code,u,l],([g])=>{const v=String(g??""),b=u.value,A=nE({nextContent:v,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=A.settledContent,f.value=A.streamedDelta,A.appended?(h.value+=1,(function(){if(!f.value||p||!i)return;const I=i.value;p=et(()=>i.value,N=>{N!==I&&y()},{flush:"sync"})})()):f.value||m(),b&&s?.set(b,v)},{immediate:!0}),Lf(m);const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(x(),E("code",Vte,[c.value?(x(),E(We,{key:0},[ot(R(a.value),1)],64)):(x(),E(We,{key:1},[d.value?(x(),E("span",Kte,R(d.value),1)):ue("",!0),f.value?(x(),E("span",{key:1,class:Ue(["inline-code-stream-delta",[k.value]]),onAnimationend:y},R(f.value),35)):ue("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);as.install=e=>{e.component(as.__name,as)};const jy=oe(!1),v4=oe(""),y4=oe("top"),Kd=oe(null),Gd=oe(null),Vy=oe(null),Ky=oe(null),k4=oe(null);let Bp=null,Rp=null,Gy=0;function gE(){Bp&&(clearTimeout(Bp),Bp=null),Rp&&(clearTimeout(Rp),Rp=null)}let np=!1,op=null,b4=!1;function Gte(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Gy;gE();const l=()=>Zn(null,null,function*(){var a,c;if(yield(function(){return Zn(this,null,function*(){if(!np&&!b4&&typeof document<"u"){op!=null||(op=Zn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([vs(()=>import("./vue.runtime.esm-bundler-CV6FAM7w.js"),[]),vs(()=>import("./Tooltip-CLzA0dLY.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:jy.value,"anchor-el":Kd.value,content:v4.value,placement:y4.value,id:Gd.value,originX:Vy.value,originY:Ky.value,isDark:(p=k4.value)!=null?p:void 0})}}).mount(h),np=!0}));try{yield op}catch(u){np=!1,op=null,b4=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),np&&r===Gy){Gd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Kd.value=e,v4.value=t,y4.value=n,Vy.value=(a=s?.x)!=null?a:null,Ky.value=(c=s?.y)!=null?c:null,k4.value=typeof i=="boolean"?i:null,jy.value=!0;try{e.setAttribute("aria-describedby",Gd.value)}catch{}}});o?l():Bp=setTimeout(l,80)}function Yte(e=!1){Gy+=1,gE();const t=()=>{if(Kd.value&&Gd.value)try{Kd.value.removeAttribute("aria-describedby")}catch{}jy.value=!1,Kd.value=null,Gd.value=null,Vy.value=null,Ky.value=null};e?t():Rp=setTimeout(t,120)}const Zte={"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..."},Xte=Symbol("markstreamI18nFallback");function vE(e,t){var n;return(n=t?.[e])!=null?n:Zte[e]}const Yy=(e,t)=>{var n;return(n=vE(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function x4(e,t){return{t(n){const o=vE(n,t);if(e.te&&o!=null&&!e.te(n))return Yy(n,t);const s=e.t(n);return s===n&&o!=null?Yy(n,t):s}}}function Qte(){const e=(function(){var n,o,s;try{const i=Mo(),r=Xte,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(s=(o=l?.[r])!=null?o:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=Mo(),i=s?.proxy,r=i?.$t;if(typeof r=="function"){const c=i?.$te;return{t:r.bind(i),te:typeof c=="function"?c.bind(i):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const c=l?.$te;return{t:a.bind(l),te:typeof c=="function"?c.bind(l):void 0}}}catch{}return null})();if(t)return x4(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return x4({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>Yy(n,e)}}const yE=Symbol("ViewportPriority"),kE=Symbol("ViewportPriorityOptions"),bE=Symbol("OffscreenHeavyNodeDeferral"),Jte=D(()=>!1),ja="400px";function W2(){return Jt(kE,void 0)}function z2(){return Jt(bE,Jte)}function ene(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?oe(t):t,r=s?(n=window.requestIdleCallback)!=null?n:N=>window.setTimeout(()=>N({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:N=>window.clearTimeout(N):null,a=new WeakMap;let c=1;const u=new Map,d=new Map,f=new Set;let h=null,p=null;function m(N){if(!N)return"viewport";let M=a.get(N);return M||(M=c++,a.set(N,M)),String(M)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function k(N){if(N){const M=u.get(N);if(M&&!M.targets.size){try{M.io.disconnect()}catch{}u.delete(N)}}d.size||f.size||y()}function g(N){const M=d.get(N);if(!M)return;const $=u.get(M.bucketKey);if(!M.visible.value){M.visible.value=!0;try{M.resolve()}catch{}}try{$?.io.unobserve(N)}catch{}$?.targets.delete(N),d.delete(N),f.delete(N),k(M.bucketKey)}function v(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const N=f.values().next().value;N&&(f.delete(N),g(N),f.size&&v())},{timeout:1200}))}function b(N,M){if(!s||typeof IntersectionObserver>"u")return null;const $=(function(z,L){var O,U,Z;return{root:(O=e?.(z??null))!=null?O:null,rootMargin:(U=L?.rootMargin)!=null?U:ja,threshold:(Z=L?.threshold)!=null?Z:0}})(N,M),T=[m((F=$).root),F.rootMargin,F.threshold].join("\0");var F;const S=u.get(T);if(S)return{key:T,bucket:S};let B;try{B=new IntersectionObserver(z=>{for(const L of z)(L.isIntersecting||L.intersectionRatio>0)&&g(L.target)},{root:$.root,rootMargin:$.rootMargin,threshold:$.threshold})}catch{return null}const W={io:B,targets:new Map};return u.set(T,W),{key:T,bucket:W}}function A(){if(s&&i.value)for(const[N,M]of Array.from(d.entries())){const $=b(N,M.opts);if(!$){g(N);continue}if($.key===M.bucketKey)continue;const T=M.bucketKey,F=u.get(T);try{F?.io.unobserve(N)}catch{}F?.targets.delete(N),M.bucketKey=$.key,$.bucket.targets.set(N,M),$.bucket.io.observe(N),k(T)}}et(i,N=>{if(!N){for(const M of Array.from(d.keys()))g(M);y()}},{flush:"sync"});const I=(N,M)=>{const $=oe(!1);let T,F=!1;const S=new Promise(L=>{T=()=>{F||(F=!0,L())}}),B=()=>{const L=d.get(N);if(!L)return f.delete(N),void k();const O=u.get(L.bucketKey);try{O?.io.unobserve(N)}catch{}O?.targets.delete(N),d.delete(N),f.delete(N),k(L.bucketKey)};if(!s||!i.value)return $.value=!0,T(),{isVisible:$,whenVisible:S,destroy:B};const W=b(N,M);if(!W)return $.value=!0,T(),{isVisible:$,whenVisible:S,destroy:B};const z={resolve:T,visible:$,bucketKey:W.key,opts:M};return d.set(N,z),W.bucket.targets.set(N,z),W.bucket.io.observe(N),s&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,A()})),M?.allowIdle!==!1&&(f.add(N),v()),{isVisible:$,whenVisible:S,destroy:B}};return I.refresh=A,Ln(yE,I),I}function U2(){var e,t;const n=Jt(yE,void 0);if(n)return n;const o=new WeakMap,s=new Map,i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=h=>{if(!h)return;const p=s.get(h);if(p&&!p.targets.size){try{p.io.disconnect()}catch{}s.delete(h)}},d=h=>{const p=o.get(h);if(!p)return;const m=s.get(p.bucketKey);if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{m?.io.unobserve(h)}catch{}o.delete(h),m?.targets.delete(h),i.delete(h),u(p.bucketKey),i.size||c()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),d(h),i.size&&f())},{timeout:1200}))};return(h,p)=>{const m=oe(!1);let y,k=!1;const g=new Promise(A=>{y=()=>{k||(k=!0,A())}}),v=()=>{const A=o.get(h);if(!A)return i.delete(h),void(i.size||c());const I=s.get(A.bucketKey);try{I?.io.unobserve(h)}catch{}o.delete(h),I?.targets.delete(h),i.delete(h),u(A.bucketKey),i.size||c()},b=(A=>{var I,N;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const M=(B=>{var W,z;return[(W=B?.rootMargin)!=null?W:ja,(z=B?.threshold)!=null?z:0].join("\0")})(A),$=s.get(M);if($)return{key:M,bucket:$};const T=(I=A?.rootMargin)!=null?I:ja;let F;try{F=new IntersectionObserver(B=>{for(const W of B)(W.isIntersecting||W.intersectionRatio>0)&&d(W.target)},{root:null,rootMargin:T,threshold:(N=A?.threshold)!=null?N:0})}catch{return null}const S={io:F,targets:new Set};return s.set(M,S),{key:M,bucket:S}})(p);return b?(o.set(h,{resolve:y,visible:m,bucketKey:b.key}),b.bucket.targets.add(h),b.bucket.io.observe(h),p?.allowIdle!==!1&&(i.add(h),f()),{isVisible:m,whenVisible:g,destroy:v}):(m.value=!0,y(),{isVisible:m,whenVisible:g,destroy:v})}}function tne(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const nne=["data-markstream-viewport-pending"],one=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],sne={key:1,class:"image-placeholder"},ine={key:1,class:"image-node__raw-text"},rne={key:2,class:"image-shimmer-overlay"},lne={key:1,class:"image-node__raw-text"},ane={key:3,class:"image-error"},Fl=Mn(Je({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const i=e,r=t,l=oe(!1),a=oe(!1),c=oe(""),u=oe("primary"),d=oe(null),f=Bf(),h=Jt(Hy,null),p=U2(),m=W2(),y=z2(),k=D(()=>jS(i.node.src)),g=D(()=>jS(i.fallbackSrc)),v=(s=(o=(n=Mo())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),b=typeof window<"u"&&v?.getAttribute("src")===(k.value||g.value),A=oe(typeof window>"u"||b||!y.value),I=gr(null);let N="",M=null;const $=D(()=>c.value),T=D(()=>!i.lazy),F=D(()=>typeof window<"u"&&y.value&&!b),S=D(()=>!F.value||A.value),B=D(()=>S.value?$.value:""),W=D(()=>{var he,Ae;return(Ae=(he=m?.value.heavyBlockMargin)!=null?he:m?.value.rootMargin)!=null?Ae:ja}),z=D(()=>!i.node.loading&&u.value!=="failed"&&c.value.length>0),L=D(()=>u.value==="failed"),O=D(()=>(!T.value||F.value&&!A.value)&&!l.value&&!a.value&&u.value!=="failed"&&c.value.length>0),U=D(()=>tne(i,f));function Z(he=U.value){he&&d.value&&h?.reportHeight(he,d.value.offsetHeight)}function ie(he=U.value){he&&yt(()=>{Z(he)})}function q(){M&&(clearTimeout(M),M=null)}function ee(){const he=U.value;he&&N!==he&&(N&&h?.markSettled(N),q(),N=he,h?.markPending(he),typeof window<"u"&&(M=window.setTimeout(()=>{N===he&&(ie(he),fe())},8e3)))}function fe(){return Zn(this,null,function*(){const he=N;he&&(q(),N="",yield yt(),Z(he),h?.markSettled(he))})}function ne(){if(u.value==="primary"&&g.value&&g.value!==c.value)return u.value="fallback",c.value=g.value,l.value=!1,a.value=!1,void ie();u.value="failed",a.value=!0,r("error",c.value),ie()}function j(){l.value=!0,a.value=!1,r("load",$.value),ie()}function K(he){he.preventDefault(),l.value&&!a.value&&r("click",[he,$.value])}const{t:ve}=Qte();return et([k,g,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||k.value?(c.value=k.value,void(u.value="primary")):g.value?(c.value=g.value,void(u.value="fallback")):(c.value="",u.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&et([d,F],([he,Ae],re,Y)=>{var Q;if((Q=I.value)==null||Q.destroy(),I.value=null,!Ae||A.value)return void(A.value=!0);if(!he)return void(A.value=!1);let P=!0;const G=p(he,{rootMargin:W.value,allowIdle:!1});I.value=G,A.value=G.isVisible.value,G.whenVisible.then(()=>{P&&I.value===G&&(A.value=!0)}),Y(()=>{P=!1,G.destroy(),I.value===G&&(I.value=null)})},{immediate:!0}),et([z,l,a,$,()=>i.lazy,S],([he,Ae,re,Y,Q,P])=>he&&Y&&!re&&P?Ae?(fe(),void ie()):Q?(ee(),void ie()):void(Ae||re||ee()):(fe(),void ie()),{flush:"post",immediate:!0}),ho(()=>{var he;(he=I.value)==null||he.destroy(),I.value=null,(function(){const Ae=N;Ae&&(q(),N="",h?.markSettled(Ae))})()}),(he,Ae)=>{var re,Y,Q,P,G;return x(),E("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":F.value&&!A.value?"true":void 0},[z.value?(x(),E("img",{key:0,src:B.value||void 0,alt:String((Y=(re=i.node.alt)!=null?re:i.node.title)!=null?Y:""),title:String((P=(Q=i.node.title)!=null?Q:i.node.alt)!=null?P:""),class:Ue(["image-node__img",{"is-loading":!T.value&&!l.value,"is-loaded":T.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:T.value?"high":void 0,decoding:T.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(G=i.node.alt)!=null?G:C(ve)("image.preview"),onError:ne,onLoad:j,onClick:K},null,42,one)):ue("",!0),e.node.loading&&!a.value?(x(),E("span",sne,[i.usePlaceholder?jn(he.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ae[0]||(Ae[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",ine,R(e.node.raw),1))])):ue("",!0),O.value&&!e.node.loading?(x(),E("span",rne,[i.usePlaceholder?jn(he.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ae[1]||(Ae[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",lne,R(e.node.raw),1))])):ue("",!0),L.value?(x(),E("span",ane,[jn(he.$slots,"error",{node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ae[2]||(Ae[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("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)),w("span",null,R(C(ve)("image.loadError")),1)],!0)])):ue("",!0)],8,nne)}}}),[["__scopeId","data-v-046e82ac"]]);Fl.install=e=>{e.component(Fl.__name,Fl)};const cne={key:2},vr=Je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=To(()=>t.customId),o=Jt("markstreamHtmlPolicy",void 0),s=Jt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const y=(p=s?.value)!=null?p:{};return Ot(it({},y),{customId:(m=t.customId)!=null?m:y.customId,htmlPolicy:i.value})}),l=Hi({loader:()=>Promise.resolve().then(()=>eb),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Kf(String(t.node.type)))),u=D(()=>c.value?H2(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=D(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(x(),Se(Ho(a.value),Sn({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:Ie(()=>[d.value?(x(),Se(C(l),Sn({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"])):f.value?(x(),Se(C(l),Sn({key:1},r.value,{content:f.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"])):ue("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),Se(Ho(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),E("span",cne,R(h.value),1)):ue("",!0)}}),w4=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function une(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Ot(it(it({},w4),n),{enabled:(t=n.enabled)==null||t})}return it({},w4)}function q2(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function xE(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let i=3;for(;o[i]===s;)i+=1;return o.slice(i).trim()}function _4(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function dne(e){var t;return e.diff===!0||_4(e.language)||_4(xE(String((t=e.raw)!=null?t:"")))}function fne(e,t,n){const o=(function(s){const i=xE(s);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const c=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(c&&/[./\\-]/.test(c))return c}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const hne=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],pne={key:0,translate:"no",class:"markstream-pre__diff-code"},mne={class:"markstream-pre__diff-pane-content"},gne={class:"markstream-pre__diff-number","aria-hidden":"true"},vne={class:"markstream-pre__diff-content"},yne={class:"markstream-pre__diff-content-inner"},kne={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},bne=["textContent"],xne=["textContent"],Fs=Je({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(j,K){const ve=String(j??"");return K?ve:ve.replace(/\r\n$|\n$|\r$/,"")}const o=D(()=>{var j,K,ve;const he=String((K=(j=t.node)==null?void 0:j.language)!=null?K:"");return String((ve=String(he).split(/\s+/g)[0])!=null?ve:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${o.value}`),i=D(()=>{var j;return t.loading===!0||((j=t.node)==null?void 0:j.loading)===!0}),r=D(()=>{var j;return n((j=t.node)==null?void 0:j.code,i.value)});let l="",a=1;const c=D(()=>(function(j){let K=0,ve=1;j.startsWith(l)&&(K=l.length,ve=a,K>0&&j[K-1]==="\r"&&j[K]===`
286
- `&&K++);for(let he=K;he<j.length;he++)j[he]===`
287
- `?ve++:j[he]==="\r"&&(ve++,j[he+1]===`
288
- `&&he++);return l=j,a=ve,ve})(r.value)),u=D(()=>r.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const j=c.value;j<d&&(d=0,f="");for(let K=d+1;K<=j;K++)f+=`${f?`
289
- `:""}${K}`;return d=j,f}),p=D(()=>{var j;return t.showLineNumbers===!0&&((j=t.node)==null?void 0:j.diff)===!0}),m=D(()=>p.value&&t.diffInline===!0),y=D(()=>{const j=Number(t.reservedHeightPx);if(!Number.isFinite(j)||j<=0)return;const K=`${Math.ceil(j)}px`;return i.value?{maxHeight:K,overflow:"auto"}:{height:K,minHeight:K,maxHeight:K,overflow:"auto"}}),k=["diff ","index ","--- ","+++ ","@@ "];function g(j){return String(j??"").trim().length===0}function v(j,K="context",ve={}){const he=g(j);return{code:j,kind:he&&K!=="hunk"&&K!=="spacer"&&!ve.preserveBlankKind?"context":K,empty:he}}function b(j){const K=n(j,i.value);return K?K.split(/\r\n|\n|\r/):[]}function A(j,K){return!g(j[K])||K<j.length-1}function I(j){return j.startsWith("-")&&!j.startsWith("---")}function N(j){return j.startsWith("+")&&!j.startsWith("+++")}function M(j){return j.some(K=>k.some(ve=>K.startsWith(ve)))}function $(j,K){return K||!j.startsWith(" ")||j.startsWith(" ")?j:` ${j}`}function T(j,K){const ve=j.length,he=K.length,Ae=[];let re=0;for(;re<ve&&re<he&&j[re]===K[re];)Ae.push({originalIndex:re,modifiedIndex:re}),re++;const Y=[];let Q=ve-1,P=he-1;for(;Q>=re&&P>=re&&j[Q]===K[P];)Y.unshift({originalIndex:Q,modifiedIndex:P}),Q--,P--;const G=Q-re+1,me=P-re+1;if(G<=0||me<=0||i.value||(G+1)*(me+1)>15e5)return Ae.concat(Y);const ye=me+1,de=new Uint32Array((G+1)*(me+1));for(let ke=G-1;ke>=0;ke--)for(let Ne=me-1;Ne>=0;Ne--){const qe=ke*ye+Ne;if(j[re+ke]===K[re+Ne])de[qe]=de[(ke+1)*ye+Ne+1]+1;else{const be=de[(ke+1)*ye+Ne],xe=de[ke*ye+Ne+1];de[qe]=be>=xe?be:xe}}const V=[];let se=0,pe=0;for(;se<G&&pe<me;)j[re+se]===K[re+pe]?(V.push({originalIndex:re+se,modifiedIndex:re+pe}),se++,pe++):de[(se+1)*ye+pe]>=de[se*ye+pe+1]?se++:pe++;return Ae.concat(V,Y)}function F(j){var K;const ve=(function(){var P,G;const me=t.diffHideUnchangedRegions;if(me==null||me===!1)return null;const ye=me===!0?{}:me;return ye.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((P=ye.contextLineCount)!=null?P:2)),minimumLineCount:Math.max(1,Math.floor((G=ye.minimumLineCount)!=null?G:4))}})();if(!ve||j.length<1||j.length>2||j.length===2&&j[0].lines.length!==j[1].lines.length)return j;const he=j[0].lines,Ae=(K=j[1])==null?void 0:K.lines,re=P=>he[P].kind==="context"&&(Ae===void 0||Ae[P].kind==="context"&&he[P].code===Ae[P].code),Y=[];let Q=0;for(;Q<he.length;){const P=Q;for(;Q<he.length&&re(Q);)Q++;const G=Q;if(G-P>=ve.minimumLineCount){const me=P+(P===0?0:ve.contextLineCount),ye=G-(G===he.length?0:ve.contextLineCount);ye-me>=ve.minimumLineCount&&Y.push({start:me,end:ye})}Q===P&&Q++}return Y.length?j.map((P,G)=>{const me=[];let ye=0;for(const de of Y)me.push(...P.lines.slice(ye,de.start)),me.push({code:G===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${P.key}-collapsed-${de.start}-${de.end}`,number:""}),ye=de.end;return me.push(...P.lines.slice(ye)),Ot(it({},P),{lines:me})}):j}const S=D(()=>{var j,K,ve,he;if(!p.value)return[];const Ae=(function(G){const me=G.some(de=>I(de)),ye=G.some(de=>N(de));return me&&ye||(function(){var de,V,se,pe;if(o.value==="diff")return!0;const ke=(pe=(se=String((V=(de=t.node)==null?void 0:de.raw)!=null?V:"").split(/\r?\n/,1)[0])==null?void 0:se.trim())!=null?pe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ke)})()&&(me||ye)})(u.value),re=(function(){var G,me;return((G=t.node)==null?void 0:G.originalCode)!=null||((me=t.node)==null?void 0:me.updatedCode)!=null})();if(m.value){const G=re?(function(me,ye){const de=b(me),V=b(ye),se=T(de,V);if(se.length>0){const xe=[];let Ze=0,tt=0;for(const lt of se){for(;Ze<lt.originalIndex;)xe.push(Ot(it({},v(de[Ze],"removed",{preserveBlankKind:A(de,Ze)})),{key:`inline-removed-source-${Ze}`,number:Ze+1})),Ze++;for(;tt<lt.modifiedIndex;)xe.push(Ot(it({},v(V[tt],"added",{preserveBlankKind:A(V,tt)})),{key:`inline-added-source-${tt}`,number:tt+1})),tt++;xe.push(Ot(it({},v(V[lt.modifiedIndex])),{key:`inline-context-source-${lt.originalIndex}-${lt.modifiedIndex}`,number:lt.modifiedIndex+1})),Ze=lt.originalIndex+1,tt=lt.modifiedIndex+1}for(;Ze<de.length;)xe.push(Ot(it({},v(de[Ze],"removed",{preserveBlankKind:A(de,Ze)})),{key:`inline-removed-source-${Ze}`,number:Ze+1})),Ze++;for(;tt<V.length;)xe.push(Ot(it({},v(V[tt],"added",{preserveBlankKind:A(V,tt)})),{key:`inline-added-source-${tt}`,number:tt+1})),tt++;return xe}const pe=[];let ke=0,Ne=de.length-1,qe=V.length-1;for(;ke<=Ne&&ke<=qe&&de[ke]===V[ke];)pe.push(Ot(it({},v(V[ke])),{key:`inline-prefix-${ke}`,number:ke+1})),ke++;const be=[];for(;Ne>=ke&&qe>=ke&&de[Ne]===V[qe];)be.unshift(Ot(it({},v(V[qe])),{key:`inline-suffix-${qe}`,number:qe+1})),Ne--,qe--;for(let xe=ke;xe<=Ne;xe++)pe.push(Ot(it({},v(de[xe],"removed",{preserveBlankKind:A(de,xe)})),{key:`inline-removed-source-${xe}`,number:xe+1}));for(let xe=ke;xe<=qe;xe++)pe.push(Ot(it({},v(V[xe],"added",{preserveBlankKind:A(V,xe)})),{key:`inline-added-source-${xe}`,number:xe+1}));return pe.concat(be)})((j=t.node)==null?void 0:j.originalCode,(K=t.node)==null?void 0:K.updatedCode):(function(me){const ye=[];let de=1,V=1;const se=M(me);for(const[pe,ke]of me.entries())if(ke.startsWith("@@")){const Ne=ke.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Ne&&(de=Number(Ne[1]),V=Number(Ne[2])),ye.push(Ot(it({},v(ke,"hunk")),{key:`inline-hunk-${pe}`,number:""}))}else if(I(ke))ye.push(Ot(it({},v($(ke.slice(1),se),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${pe}`,number:de++}));else if(N(ke))ye.push(Ot(it({},v($(ke.slice(1),se),"added",{preserveBlankKind:!0})),{key:`inline-added-${pe}`,number:V++}));else{const Ne=se&&ke.startsWith(" ")?ke.slice(1):ke;ye.push(Ot(it({},v(Ne)),{key:`inline-context-${pe}`,number:V})),de++,V++}return ye})(u.value);return F([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:G}])}if(!Ae&&re)return(function(G,me){const ye=b(G),de=b(me),V=T(ye,de),se=[],pe=[];let ke=0,Ne=0,qe=0;const be=(xe,Ze)=>{const tt=Math.max(xe-ke,Ze-Ne);for(let lt=0;lt<tt;lt++){const ut=ke+lt,mt=Ne+lt;se.push(ut<xe?Ot(it({},v(ye[ut],"removed",{preserveBlankKind:A(ye,ut)})),{key:`original-changed-${qe}-${ut}`,number:ut+1}):Ot(it({},v("","spacer")),{key:`original-spacer-${qe}-${lt}`,number:""})),pe.push(mt<Ze?Ot(it({},v(de[mt],"added",{preserveBlankKind:A(de,mt)})),{key:`modified-changed-${qe}-${mt}`,number:mt+1}):Ot(it({},v("","spacer")),{key:`modified-spacer-${qe}-${lt}`,number:""}))}ke=xe,Ne=Ze,qe++};for(const xe of V)be(xe.originalIndex,xe.modifiedIndex),se.push(Ot(it({},v(ye[xe.originalIndex])),{key:`original-context-${xe.originalIndex}-${xe.modifiedIndex}`,number:xe.originalIndex+1})),pe.push(Ot(it({},v(de[xe.modifiedIndex])),{key:`modified-context-${xe.originalIndex}-${xe.modifiedIndex}`,number:xe.modifiedIndex+1})),ke=xe.originalIndex+1,Ne=xe.modifiedIndex+1;return be(ye.length,de.length),F([{key:"original",className:"markstream-pre__diff-pane--original",lines:se},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:pe}])})((ve=t.node)==null?void 0:ve.originalCode,(he=t.node)==null?void 0:he.updatedCode);const Y=[],Q=[],P=M(u.value);for(const G of u.value)if(G.startsWith("@@"))Y.push(v(G,"hunk")),Q.push(v(G,"hunk"));else if(G.startsWith("-")&&!G.startsWith("---"))Y.push(v($(G.slice(1),P),"removed",{preserveBlankKind:!0}));else if(G.startsWith("+")&&!G.startsWith("+++"))Q.push(v($(G.slice(1),P),"added",{preserveBlankKind:!0}));else{const me=P&&G.startsWith(" ")?G.slice(1):G;Y.push(v(me)),Q.push(v(me))}return F([{key:"original",className:"markstream-pre__diff-pane--original",lines:Y.map((G,me)=>Ot(it({},G),{key:`original-${me}`,number:me+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((G,me)=>Ot(it({},G),{key:`modified-${me}`,number:me+1}))}])}),B=D(()=>S.value.some(j=>j.lines.some(K=>K.kind==="collapsed"))),W=D(()=>{const j=o.value;return j?`Code block: ${j}`:"Code block"}),z=oe(null),L=oe([]);let O=null,U=!1,Z=null;function ie(j){const K=Number.parseFloat(String(j??""));return Number.isFinite(K)&&K>0?K:0}function q(j,K){var ve;if(!j)return K;if(j.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const he=j.querySelector(".markstream-pre__diff-content"),Ae=he?.getBoundingClientRect(),re=(ve=Ae?.height)!=null?ve:0;return Math.max(K,Math.ceil(re))}function ee(){U||typeof window>"u"||(O!=null&&window.cancelAnimationFrame(O),O=window.requestAnimationFrame(()=>{O=null,U||(function(){var j,K;O=null;const ve=z.value;if(!ve||!p.value||m.value||!ve.classList.contains("is-wrap"))return void(L.value.length&&(L.value=[]));const he=(function(me){const ye=window.getComputedStyle(me),de=ie(ye.getPropertyValue("--markstream-pre-diff-line-height"));if(de>0)return de;const V=ie(ye.lineHeight);return V>0?V:18})(ve),Ae=Array.from(ve.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),re=Array.from(ve.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Y=Math.max(Ae.length,re.length),Q=[];for(let me=0;me<Y;me++){const ye=q((j=Ae[me])!=null?j:null,he),de=q((K=re[me])!=null?K:null,he),V=Math.max(he,ye,de);Q.push({rowHeight:V,originalHeight:ye,modifiedHeight:de})}var P,G;P=L.value,G=Q,P.length===G.length&&P.every((me,ye)=>{const de=G[ye];return de&&Math.abs(me.rowHeight-de.rowHeight)<=.5&&Math.abs(me.originalHeight-de.originalHeight)<=.5&&Math.abs(me.modifiedHeight-de.modifiedHeight)<=.5})||(L.value=Q)})()}))}function fe(j){Z?.disconnect(),Z=null,j&&p.value&&!m.value&&typeof ResizeObserver<"u"&&(Z=new ResizeObserver(()=>{ee()}),Z.observe(j))}function ne(j,K){const ve=L.value[j];if(!ve)return;const he=K==="original"?ve.originalHeight:ve.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ve.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(he)}px`}}return et(z,j=>{fe(j),yt(()=>ee())},{flush:"post"}),et([p,m,S],()=>{fe(z.value),yt(()=>ee())},{flush:"post",immediate:!0}),ho(()=>{U=!0,O!=null&&(window.cancelAnimationFrame(O),O=null),Z?.disconnect(),Z=null}),(j,K)=>(x(),E("pre",{ref_key:"preRef",ref:z,style:on(y.value),class:Ue([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":p.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":B.value}]),"aria-busy":i.value,"aria-label":W.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[p.value?(x(),E("code",pne,[(x(!0),E(We,null,rt(S.value,ve=>(x(),E("span",{key:ve.key,class:Ue(["markstream-pre__diff-pane",ve.className])},[w("span",mne,[(x(!0),E(We,null,rt(ve.lines,(he,Ae)=>(x(),E("span",{key:he.key,class:Ue(["markstream-pre__diff-line",[`markstream-pre__diff-line--${he.kind}`,{"markstream-pre__diff-line--empty":he.empty}]]),style:on(ne(Ae,ve.key))},[K[0]||(K[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",gne,R(he.number),1),w("span",vne,[w("span",yne,R(he.code),1)])],6))),128))])],2))),128))])):(x(),E(We,{key:1},[t.showLineNumbers?(x(),E("span",kne,[w("span",{class:"markstream-pre__line-numbers-text",textContent:R(h.value)},null,8,bne)])):ue("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:R(r.value)},null,8,xne)],64))],14,hne))}});Fs.install=e=>{e.component(Fs.__name,Fs)};const wne={key:0},mo=Mn(Je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Bf(),o=Jt("markstreamFade",void 0),s=Jt("markstreamTextStreamState",void 0),i=Jt("markstreamStreamVersion",void 0),r=D(()=>{const y=n.fade;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=D(()=>{var y;const k=(y=n["index-key"])!=null?y:n.indexKey;return k==null||k===""?"":String(k)}),c=oe(t.node.content),u=oe(""),d=oe(0);let f;function h(){f?.(),f=void 0}function p(){h(),u.value&&(c.value=c.value+u.value,u.value="")}et([()=>t.node.content,a,l],([y])=>{const k=String(y??""),g=a.value,v=nE({nextContent:k,persistedContent:g?s?.get(g):void 0,currentState:{settledContent:c.value,streamedDelta:u.value},typewriterEnabled:l.value});c.value=v.settledContent,u.value=v.streamedDelta,v.appended?(d.value+=1,(function(){if(!u.value||f||!i)return;const b=i.value;f=et(()=>i.value,A=>{A!==b&&p()},{flush:"sync"})})()):u.value||h(),g&&s?.set(g,k)},{immediate:!0}),Lf(h);const m=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(y,k)=>(x(),E("span",{class:Ue([[e.node.center?"text-node-center":""],"text-node"])},[c.value?(x(),E("span",wne,R(c.value),1)):ue("",!0),u.value?(x(),E("span",{key:1,class:Ue(["text-node-stream-delta",[m.value]]),onAnimationend:p},R(u.value),35)):ue("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function Md(e,t,n){return Je({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:i}){var r,l;const a=U2(),c=W2(),u=z2(),d=typeof window<"u"&&((l=(r=Mo())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=oe(typeof window>"u"||d||!u.value),h=gr(null);let p=null;function m(y){const k=y&&"$el"in y?y.$el:y;h.value=k instanceof HTMLElement?k:null}return typeof window<"u"&&et([h,u],([y,k],g,v)=>{if(p?.destroy(),p=null,!k||f.value)return void(f.value=!0);if(!y)return;let b=!0;const A=a(y,{rootMargin:c?.value.heavyBlockMargin,allowIdle:!1});p=A,f.value=A.isVisible.value,A.whenVisible.then(()=>{b&&p===A&&(f.value=!0)}),v(()=>{b=!1,A.destroy(),p===A&&(p=null)})},{immediate:!0}),ho(()=>{p?.destroy(),p=null}),()=>Lt(f.value?t:n,Ot(it({},s),{ref:m}),i)}})}mo.install=e=>{e.component(mo.__name,mo)};const Hm=Je({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,i,r,l,a,c;const u=K1(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=n4[u]||(u?u.charAt(0).toUpperCase()+u.slice(1):n4[""]),f=dne(n.node),h=fne(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),p=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:q2(p??{},typeof window>"u"?0:window.innerWidth)),y=p?.diffAppearance,k=y==="dark"||y!=="light"&&n.isDark===!0,g=typeof p?.fontSize=="number"&&Number.isFinite(p.fontSize)&&p.fontSize>0?p.fontSize:12,v=typeof p?.lineHeight=="number"&&Number.isFinite(p.lineHeight)&&p.lineHeight>0?p.lineHeight:g===12?18:Math.max(12,Math.round(1.5*g)),b=typeof p?.tabSize=="number"&&Number.isFinite(p.tabSize)&&p.tabSize>0?p.tabSize:4,A=f?0:8,I=typeof((a=p?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(p.padding.top)&&p.padding.top>=0?p.padding.top:A,N=typeof((c=p?.padding)==null?void 0:c.bottom)=="number"&&Number.isFinite(p.padding.bottom)&&p.padding.bottom>=0?p.padding.bottom:A,M=typeof p?.fontFamily=="string"?p.fontFamily.trim():"",$=it(it({fontSize:`${g}px`,lineHeight:`${v}px`,tabSize:b,paddingTop:`${I}px`,paddingBottom:`${N}px`,"--markstream-pre-line-number-top":`${I}px`},f?{"--markstream-pre-diff-line-height":`${v}px`}:{}),M?{"--markstream-code-font-family":M}:{}),T=()=>Lt("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Lt("svg",{class:"action-icon"})]),F=n.isShowPreview!==!1&&(u==="html"||u==="svg"),S=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||F&&n.showPreviewButton!==!1,B=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},W=it(it(it({"--markstream-code-layout-character-width":"1ch"},B(n.minWidth)?{minWidth:B(n.minWidth)}:{}),B(n.maxWidth)?{maxWidth:B(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Lt("div",Ot(it({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":k,"is-diff":f,"is-plain-text":u===""||u==="plaintext"||u==="text"},t.class],style:[W,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Lt("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Lt("div",{class:"code-header-main"},[Lt("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),Lt("div",{class:"code-header-copy"},[Lt("div",{class:"code-header-title"},h.title),h.caption?Lt("div",{class:"code-header-caption"},h.caption):null])]),Lt("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Lt("div",{class:"code-diff-stats","aria-hidden":"true"},[Lt("span",{class:"code-diff-stat removed"},"-0"),Lt("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:T(),n.showCollapseButton===!1?null:T(),S?Lt("div",{class:"relative"},[T()]):null])]),Lt("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Lt(Fs,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?une(p?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:$,"data-markstream-code-loading":"1"})]),Lt("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Lt("div",{class:"loading-skeleton"},[Lt("div",{class:"skeleton-line"}),Lt("div",{class:"skeleton-line"}),Lt("div",{class:"skeleton-line short"})])]),Lt("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),av=Md("ViewportDeferredCodeBlockNode",Hi({loader:()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./CodeBlockNode-DxKllCdY.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Fs}}),loadingComponent:Hm,delay:0,suspensible:!1}),Hm),Gi=Hi(()=>Zn(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,o,s,i;return Lt(mo,Ot(it({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield lE(),(yield vs(()=>import("./index7-CNIa1-2e.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,o,s,i;return Lt(mo,Ot(it({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),wE=Hi(()=>Zn(null,null,function*(){try{return yield lE(),(yield vs(()=>import("./index6-C3SLqmgw.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,o,s;return Lt(mo,Ot(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),bs=Mn(Je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),E("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]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);bs.install=e=>{e.component(bs.__name,bs)};const _ne={class:"superscript-node"},Ps=Mn(Je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,strong:xs,emphasis:Ss,footnote_reference:ni,strikethrough:ws,highlight:si,insert:Ws,subscript:Hs,emoji:Ds,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("sup",_ne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"superscript"}-${l}`,components:o.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"]]);Ps.install=e=>{e.component(Ps.__name,Ps)};const Sne={class:"subscript-node"},Hs=Mn(Je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,strong:xs,emphasis:Ss,footnote_reference:ni,strikethrough:ws,highlight:si,insert:Ws,superscript:Ps,emoji:Ds,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("sub",Sne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"subscript"}-${l}`,components:o.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"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const Cne={class:"strong-node"},xs=Mn(Je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,emphasis:Ss,strikethrough:ws,highlight:si,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:ni,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("strong",Cne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"strong"}-${l}`,components:o.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"]]);xs.install=e=>{e.component(xs.__name,xs)};const Ane={class:"strikethrough-node"},ws=Mn(Je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,strong:xs,emphasis:Ss,highlight:si,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:ni,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("del",Ane,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.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"]]);ws.install=e=>{e.component(ws.__name,ws)};const Mne=["href","title","aria-label","aria-hidden","target","rel"],Ene=["aria-hidden"],Tne={class:"link-text-wrapper relative inline-flex"},Nne={class:"leading-[normal] link-text"},_s=Mn(Je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Jt("markstreamShowTooltips",void 0),o=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),s=D(()=>{var k,g,v,b,A;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(k=t.animationOpacity)!=null?k:.35,M=Math.max(.12,Math.min(.5*N,N)),$={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":I,"--underline-opacity":String(N),"--underline-rest-opacity":String(M),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&($["--link-color"]=t.color),$}),i=To(()=>t.customId),r=D(()=>it({text:mo,strong:xs,strikethrough:ws,emphasis:Ss,image:Fl,html_inline:oi,inline_code:as},i.value)),l=Bf(),a=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const b={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(b[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,I]of Object.entries(v))A&&I!=null&&I!==!1&&(b[A]=I===!0?"":String(I));return m4(b,"safe","a")}),c=D(()=>it(it({},l),a.value)),u=D(()=>{var k,g;return m4({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=D(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(CY(u.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(b=>b.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=D(()=>{const k=it({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){o.value&&Yte()}const y=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,b;return e.node.loading?(x(),E("span",Sn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[w("span",Tne,[w("span",Nne,[ae(C(mo),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Ene)):(x(),E("a",Sn({key:0,class:"link-node",href:u.value,title:o.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:g[0]||(g[0]=A=>(function(I){var N,M,$,T;if(!o.value)return;const F=I,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,B=((N=t.node)==null?void 0:N.title)||((M=u.value)!=null&&M.includes("xn--")&&((T=($=t.node)==null?void 0:$.text)!=null&&T.includes("://"))?t.node.text:u.value)||"";Gte(I.currentTarget,B,"top",!1,S)})(A)),onMouseleave:m}),[(x(!0),E(We,null,rt(e.node.children,(A,I)=>(x(),Se(C(vr),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Mne))}}}),[["__scopeId","data-v-367e6ca4"]]);_s.install=e=>{e.component(_s.__name,_s)};const Ine={class:"insert-node"},Ws=Mn(Je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,strong:xs,emphasis:Ss,strikethrough:ws,highlight:si,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:ni,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("ins",Ine,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"insert"}-${l}`,components:o.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"]]);Ws.install=e=>{e.component(Ws.__name,Ws)};const Lne={class:"highlight-node"},si=Mn(Je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,strong:xs,emphasis:Ss,strikethrough:ws,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:ni,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("mark",Lne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"highlight"}-${l}`,components:o.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"]]);si.install=e=>{e.component(si.__name,si)};const $ne={class:"emphasis-node"},Ss=Mn(Je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:oi,strong:xs,strikethrough:ws,highlight:si,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:ni,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("em",$ne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.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"]]);Ss.install=e=>{e.component(Ss.__name,Ss)};const Fne={class:"hard-break"},Ol=Mn(Je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("br",Fne))}),[["__scopeId","data-v-50c58f70"]]);Ol.install=e=>{e.component(Ol.__name,Ol)};const Mf=Je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=gt({checkbox:ti,checkbox_input:ti,emoji:Ds,emphasis:Ss,hardbreak:Ol,highlight:si,inline_code:as,insert:Ws,link:_s,reference:bs,strikethrough:ws,strong:xs,subscript:Hs,superscript:Ps,text:mo}),o=To(()=>t.customId),s=D(()=>{const i=o.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(x(!0),E(We,null,rt(e.nodes,(l,a)=>(x(),Se(C(vr),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Zy(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(Zy)}function Wm(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Zy))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(Zy)?s:null}function Va(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const One=["cite"],Bne={key:0,dir:"auto",class:"paragraph-node"},Rne=["custom-id"],Dp=Mn(Je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=To(()=>t.customId),o=D(()=>!!n.value.paragraph),s=D(()=>!!n.value.text),i=D(()=>Wm(t.node.children,!o.value)),r=D(()=>t.fade!==!1||s.value?null:Va(i.value));return Ln("markstreamShowTooltips",D(()=>t.showTooltips)),Ln("markstreamFade",D(()=>t.fade)),(l,a)=>(x(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),E("p",Bne,[r.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,Rne)):(x(),Se(C(Mf),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),Se(C(zs),{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,One))}}),[["__scopeId","data-v-abfecebc"]]);Dp.install=e=>{e.component(Dp.__name,Dp)};const Dne={class:"definition-list"},Pne={class:"definition-term"},Hne={class:"definition-desc"},Pp=Mn(Je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),E("dl",Dne,[(x(!0),E(We,null,rt(t.node.items,(s,i)=>(x(),E(We,{key:i},[w("dt",Pne,[ae(C(zs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),w("dd",Hne,[ae(C(zs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Pp.install=e=>{e.component(Pp.__name,Pp)};const Wne=["href","title"],Yd=Mn(Je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(x(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Wne))}}),[["__scopeId","data-v-e1eb37b6"]]);Yd.install=e=>{e.component(Yd.__name,Yd)};const zne=["id"],Une={class:"flex-1"},Hp=Je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",Une,[ae(C(zs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,zne))}});Hp.install=e=>{e.component(Hp.__name,Hp)};const qne=["custom-id"],Xy=Mn(Je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=To(()=>t.customId),o=Jt("markstreamFade",void 0),s=D(()=>o?.value!==!1||n.value.text?null:Va(t.node.children)),i=D(()=>it({text:mo,inline_code:as,link:_s,image:Fl,strong:xs,emphasis:Ss,strikethrough:ws,highlight:si,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,checkbox:ti,checkbox_input:ti,footnote_reference:ni,hardbreak:Ol,math_inline:Gi,reference:bs},n.value));return(r,l)=>(x(),Se(Ho(`h${e.node.level}`),Sn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ie(()=>[s.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(s.value),9,qne)):(x(!0),E(We,{key:1},rt(e.node.children,(a,c)=>(x(),Se(C(vr),{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"]]),Z1=Xy;Z1.install=e=>{e.component(Xy.__name,Xy)};const jne={key:0,dir:"auto",class:"paragraph-node"},Vne=["custom-id"],Kne={dir:"auto",class:"paragraph-node"},Gne=["custom-id"],du=Mn(Je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),o=To(()=>t.customId),s=D(()=>!!o.value.paragraph),i=D(()=>!!o.value.text),r=D(()=>{var h;return Wm((h=n.value)==null?void 0:h.children,!s.value)}),l=D(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const y=p.slice(1);if(!y.every(g=>g?.type==="list"))return null;const k=Wm([m]);return k?{paragraphChildren:k,nestedLists:y}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Va(r.value):null),u=D(()=>{var h;return a()?Va((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",D(()=>t.showTooltips)),Ln("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,y;return x(),E("li",Sn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),E("p",jne,[c.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,Vne)):(x(),Se(C(Mf),{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?(x(),E(We,{key:1},[w("p",Kne,[u.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,Gne)):(x(),Se(C(Mf),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),E(We,null,rt(l.value.nestedLists,(k,g)=>(x(),Se(C(zs),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),Se(C(zs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(m=n.value)==null?void 0:m.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);du.install=e=>{e.component(du.__name,du)};const fu=Mn(Je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=To(()=>e.customId),n=D(()=>t.value.list_item||du);return(o,s)=>(x(),Se(Ho(e.node.ordered?"ol":"ul"),{class:Ue(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ie(()=>[(x(!0),E(We,null,rt(e.node.items,(i,r)=>{var l;return x(),Se(Ho(n.value),Sn({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,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);fu.install=e=>{e.component(fu.__name,fu)};const Yne={key:2,class:"html-block-node__raw"},Zne=["innerHTML"],Xne={key:1,class:"html-block-node__placeholder"},Zd=Mn(Je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamNestedRendererProps",void 0),s=D(()=>{var S,B;return(B=(S=t.htmlPolicy)!=null?S:n?.value)!=null?B:"safe"}),i=D(()=>{var S,B;const W=(S=o?.value)!=null?S:{};return Ot(it({},W),{customId:(B=t.customId)!=null?B:W.customId,htmlPolicy:s.value})}),r=Hi({loader:()=>Promise.resolve().then(()=>eb),suspensible:!1}),l=D(()=>{const S=Fp(t.node.attrs,s.value);if(!S)return;const B=jd(S);return Object.keys(B).length>0?B:void 0}),a=D(()=>{const S=String(t.node.tag||"").trim(),B=Fp(t.node.attrs,s.value,S);if(!B)return;const W=jd(B);return Object.keys(W).length>0?W:void 0}),c=To(()=>t.customId),u=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=oe(null),f=oe(typeof window>"u"),h=oe(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),y=D(()=>{var S;if(m.value.trim().toLowerCase()!=="details"||(S=t.node.attrs)!=null&&S.some(([W])=>String(W).toLowerCase()==="open"))return null;const B=p.value[0];return B?.type==="html_block"&&String(B.tag||"").toLowerCase()==="summary"?B:null}),k=D(()=>{var S;return Va((S=y.value)==null?void 0:S.children)}),g=D(()=>{const S=y.value;if(!S)return;const B=Fp(S.attrs,s.value,"summary");if(!B)return;const W=jd(B);return Object.keys(W).length>0?W:void 0}),v=D(()=>k.value==null?p.value:p.value.slice(1)),b=D(()=>{const S=m.value.trim().toLowerCase();return q5.has(S)||O2(S,s.value)}),A=D(()=>p.value.length>0&&!!t.node.tag&&!b.value),I=D(()=>{var S,B,W;if(A.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(S=h.value)!=null?S:""};const z=(B=h.value)!=null?B:t.node.content;if(!z)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:uu(z,s.value)};if(t.node.loading){const O=Pm(z,c.value,s.value);return O===null?{mode:"text",content:(W=t.node.raw)!=null?W:z}:{mode:"dynamic",nodes:O}}if(!mE(z,c.value))return{mode:"html",content:uu(z,s.value)};const L=Pm(z,c.value,s.value);return L===null?{mode:"html",content:uu(z,s.value)}:{mode:"dynamic",nodes:L}}),N=U2(),M=W2(),$=z2(),T=gr(null),F=!!t.node.loading;return typeof window<"u"?(et([()=>d.value,()=>M?.value.heavyBlockMargin,()=>M?.value.rootMargin],([S],B,W)=>{var z,L,O,U;if((L=(z=T.value)==null?void 0:z.destroy)==null||L.call(z),T.value=null,!F)return f.value=!0,void(h.value=t.node.content);if(!S)return void(f.value=!1);let Z=!0;const ie=(U=(O=M?.value.heavyBlockMargin)!=null?O:M?.value.rootMargin)!=null?U:ja,q=N(S,{rootMargin:ie,allowIdle:!$.value});T.value=q,f.value=f.value||q.isVisible.value,q.whenVisible.then(()=>{Z&&T.value===q&&(f.value=!0)}),W(()=>{Z=!1,q.destroy(),T.value===q&&(T.value=null)})},{immediate:!0}),et(()=>t.node.content,S=>{F&&!f.value||(h.value=S)})):f.value=!0,ho(()=>{var S,B;(B=(S=T.value)==null?void 0:S.destroy)==null||B.call(S),T.value=null}),(S,B)=>(x(),Se(Ho(A.value?m.value:"div"),Sn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":C($)&&!f.value?"true":void 0},A.value?a.value:void 0),{default:Ie(()=>[f.value?(x(),E(We,{key:0},[I.value.mode==="structured"?(x(),E(We,{key:0},[k.value!==null?(x(),E(We,{key:0},[w("summary",C9(bM(g.value)),R(k.value),17),v.value.length?(x(),Se(C(r),Sn({key:0},i.value,{nodes:v.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ue("",!0)],64)):(x(),Se(C(r),Sn({key:1},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):I.value.mode==="dynamic"?(x(),Se(C(u),{key:1,nodes:I.value.nodes},null,8,["nodes"])):I.value.mode==="text"?(x(),E("pre",Yne,R(I.value.content),1)):(x(),E("div",Sn({key:3},l.value,{innerHTML:I.value.content}),null,16,Zne))],64)):(x(),E("div",Xne,[jn(S.$slots,"placeholder",{node:e.node},()=>[B[0]||(B[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),B[1]||(B[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),B[2]||(B[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Zd.install=e=>{e.component(Zd.__name,Zd)};const Qne={dir:"auto",class:"paragraph-node"},Jne=["custom-id"],Ha=Mn(Je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=To(()=>t.customId),o=Jt("markstreamHtmlPolicy",void 0),s=Jt("markstreamFade",void 0),i=Jt("markstreamParseOptions",void 0),r=Jt("markstreamCustomMarkdownIt",void 0),l=Jt("markstreamNestedRendererProps",void 0),a=D(()=>{var M;return(M=o?.value)!=null?M:"safe"}),c=D(()=>{var M;return(M=t.parseOptions)!=null?M:i?.value}),u=D(()=>{var M;return(M=t.customMarkdownIt)!=null?M:r?.value}),d=D(()=>{var M,$;return($=t.customHtmlTags)!=null?$:(M=l?.value)==null?void 0:M.customHtmlTags}),f=D(()=>{var M,$;const T=(M=l?.value)!=null?M:{};return Ot(it({},T),{customId:($=t.customId)!=null?$:T.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Hi({loader:()=>Promise.resolve().then(()=>eb),suspensible:!1});function p(M){var $;return M.type==="text"&&String(($=M.content)!=null?$:"").trim()===""}const m=D(()=>t.node.children.filter(M=>!p(M))),y=D(()=>m.value.length>0&&m.value.every(M=>M.type==="image"||(function($){var T;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(B=>!p(B)):[]})($);return F.length===1&&((T=F[0])==null?void 0:T.type)==="image"})(M))),k=D(()=>new Set(tc(d.value))),g=D(()=>{if(!y.value||m.value.length<=1)return t.node.children;const M=[];for(let $=0;$<t.node.children.length;$++){const T=t.node.children[$];if(!p(T)){M.push(T);continue}const F=M.length>0,S=t.node.children.slice($+1).some(B=>!p(B));F&&S&&M.push(Ot(it({},T),{content:" ",raw:" "}))}return M}),v=D(()=>s?.value===!1&&!n.value.text),b=D(()=>v.value?Va(g.value):null);function A(M,$){return{node:M,"index-key":`${t.indexKey}-${$}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=D(()=>it({inline_code:as,image:Fl,link:_s,hardbreak:Ol,emphasis:Ss,strong:xs,strikethrough:ws,highlight:si,insert:Ws,subscript:Hs,superscript:Ps,html_inline:oi,html_block:Zd,emoji:Ds,checkbox:ti,math_inline:Gi,checkbox_input:ti,reference:bs,footnote_anchor:Yd,footnote_reference:ni,text:mo},n.value)),N=D(()=>g.value.map((M,$)=>{var T;const F=(function(S){var B,W,z,L;if(S.type==="html_block"||S.type==="html_inline"){const O=String((B=S.tag)!=null?B:"").trim().toLowerCase()||Y5(S.content);if(O&&!k.value.has(O)&&Z5((W=S.content)!=null?W:S.raw,O)){const U=String((L=(z=S.content)!=null?z:S.raw)!=null?L:"");return{child:{type:"text",content:U,raw:U},component:mo,isCustomComponent:!1}}}return{child:S,component:I.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Kf(String(S.type)))}})(M);return Ot(it({},F),{index:$,key:`${t.indexKey||"paragraph"}-${$}`,customAttrs:F.isCustomComponent?H2(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((T=F.child.content)!=null?T:""),originalChild:M})}));return(M,$)=>(x(),E("p",Qne,[b.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(b.value),9,Jne)):(x(!0),E(We,{key:1},rt(N.value,T=>{return x(),E(We,{key:T.key},[y.value&&p(T.originalChild)?(x(),E(We,{key:0},[ot(R((F=T.originalChild,String((S=F.content)!=null?S:""))),1)],64)):T.isCustomComponent?(x(),Se(Ho(T.component),Sn({key:1,ref_for:!0},T.customAttrs,{node:T.child,loading:T.child.loading,"index-key":T.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ie(()=>[T.hasSlotChildren?(x(),Se(C(h),Sn({key:0,ref_for:!0},f.value,{nodes:T.child.children,"index-key":T.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):T.slotContent?(x(),Se(C(h),Sn({key:1,ref_for:!0},f.value,{content:T.slotContent,final:!T.child.loading,"index-key":`${T.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),Se(Ho(T.component),Sn({key:2,ref_for:!0},A(T.child,T.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ha.install=e=>{e.component(Ha.__name,Ha)};const eoe={class:"table-node-wrapper"},toe=["aria-busy"],noe={key:0},ooe=["custom-id"],soe=["aria-label","onPointerdown"],ioe=["custom-id"],roe={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Xd=Mn(Je({__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=D(()=>{var k;return(k=t.node.loading)!=null&&k}),o=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),s=oe(null),i=oe([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=D(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);Ln("markstreamShowTooltips",D(()=>t.showTooltips)),Ln("markstreamFade",D(()=>t.fade));const u=To(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),h=new WeakMap;function p(k){const g=t.fade===!1&&!d.value,v=!f.value,b=h.get(k);if(b?.children===k.children&&b.textFastPath===g&&b.paragraphFastPath===v)return b.info;const A=Wm(k.children,v,!0),I={simpleChildren:A,plainText:A&&g?Va(A):null};return h.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:I}),I}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),b=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),A=[...r.widths];A[r.index]=b,A[r.index+1]=g-b,i.value=A}function y(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return et(l,()=>{y(),i.value=[]}),ho(y),(k,g)=>(x(),E("div",eoe,[w("table",{ref_key:"tableRef",ref:s,class:Ue(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),E("colgroup",noe,[(x(!0),E(We,null,rt(e.node.header.cells,(v,b)=>(x(),E("col",{key:b,style:on(c.value[b])},null,4))),128))])):ue("",!0),w("thead",null,[w("tr",null,[(x(!0),E(We,null,rt(e.node.header.cells,(v,b)=>(x(),E("th",{key:b,dir:"auto",class:Ue([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(p(v).plainText),9,ooe)):p(v).simpleChildren?(x(),Se(C(Mf),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(x(),Se(C(zs),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b<e.node.header.cells.length-1?(x(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${b+1} and ${b+2}`,onPointerdown:A=>(function(I,N){if(N.button!==0)return;const M=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],B=>Math.round(B.getBoundingClientRect().width))})(),$=M[I],T=M[I+1];$&&T&&(N.preventDefault(),r={index:I,startX:N.clientX,startWidth:$,nextStartWidth:T,widths:M},i.value=M,window.addEventListener("pointermove",m),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(b,A)},null,40,soe)):ue("",!0)],2))),128))])]),w("tbody",null,[(x(!0),E(We,null,rt(o.value,(v,b)=>(x(),E("tr",{key:b},[(x(!0),E(We,null,rt(v.cells,(A,I)=>(x(),E("td",{key:I,class:Ue([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(p(A).plainText),9,ioe)):p(A).simpleChildren?(x(),Se(C(Mf),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${I}`},null,8,["nodes","custom-id","index-key"])):(x(),Se(C(zs),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=N=>k.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,toe),ae(Ua,{name:"table-node-fade"},{default:Ie(()=>[n.value?(x(),E("div",roe,[jn(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):ue("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Xd.install=e=>{e.component(Xd.__name,Xd)};const loe={class:"hr-node"},Wp=Mn({},[["render",function(e,t){return x(),E("hr",loe)}],["__scopeId","data-v-39b2349c"]]);Wp.install=e=>{e.component(Wp.__name,Wp)};const aoe={class:"unknown-node"},Qy=Je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),E("div",aoe,R(e.node.raw),1))}),zp=Mn(Je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),o=To(()=>t.customId),s=D(()=>it({text:mo,paragraph:Ha,heading:Z1,inline_code:as,link:_s,image:Fl,strong:xs,emphasis:Ss,strikethrough:ws,insert:Ws,subscript:Hs,superscript:Ps,checkbox:ti,checkbox_input:ti,hardbreak:Ol,math_inline:Gi,reference:bs,list:fu,math_block:wE,table:Xd},o.value));return(i,r)=>(x(),E("div",Sn({class:n.value},e.node.attrs),[(x(!0),E(We,null,rt(e.node.children,(l,a)=>{return x(),Se(Ho((c=l.type,s.value[c]||Qy)),{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"]]);zp.install=e=>{e.component(zp.__name,zp)};const coe=["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"],S4=[[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 uoe(e){if(e<=255)return coe[e];let t=0,n=S4.length-1;for(;t<=n;){const o=t+n>>1,s=S4[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const doe=/[ \t\n\r\f]+/g,foe=/[\t\n\r\f]| {2,}|^ | $/;let cv=null;const hoe=new RegExp("\\p{Script=Arabic}","u"),ql=new RegExp("\\p{M}","u"),j2=new RegExp("\\p{Nd}","u");function C4(e){return hoe.test(e)}function A4(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>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function dr(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 o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(A4(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(A4(n))return!0}}return!1}const poe=new Set([" "," ","⁠","\uFEFF"]),moe=new Set(["-","‐","–","—"]);function _E(e,t){return!((function(n){const o=Qd(n);return o!==null&&poe.has(o)})(e)||t&&((function(n){const o=Qd(n);return o!==null&&(V2.has(o)||Ka.has(o))})(e)||(function(n){const o=Qd(n);return o!==null&&moe.has(o)})(e)))}const V2=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),X1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),K2=new Set(["'","’"]),Ka=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),goe=new Set([":",".","،","؛"]),voe=new Set(["၏"]),yoe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function koe(e){if(G2(e))return!0;let t=!1;for(const n of e)if(Ka.has(n)||Um(n))t=!0;else if(!t||!ql.test(n))return!1;return t}function boe(e){for(const t of e)if(!V2.has(t)&&!Ka.has(t))return!1;return e.length>0}function xoe(e){if(G2(e))return!0;for(const t of e)if(!(X1.has(t)||K2.has(t)||ql.test(t)||Um(t)))return!1;return e.length>0}function G2(e){let t=!1;for(const n of e)if(n!=="\\"&&!ql.test(n)){if(!(X1.has(n)||Ka.has(n)||K2.has(n)))return!1;t=!0}return t}function zm(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Qd(e){if(e.length===0)return null;const t=zm(e,e.length);return e.slice(t)}const woe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Um(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s<o.length;s+=2)if(n>=o[s]&&n<=o[s+1])return!0;return!1})(t,woe)}function _oe(e){const t=(function(n){for(const o of n)if(!ql.test(o))return o;return null})(e);return t!==null&&j2.test(t)}function Soe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(ql.test(o))n--;else{if(!X1.has(o)&&!K2.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Coe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function M4(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function E4(e,t){return e&&t!==null&&goe.has(t)}function Aoe(e){const t=Qd(e);return t!==null&&voe.has(t)}function Moe(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 Jy(e){let t=e.length;for(;t>0;){const n=zm(e,t),o=e.slice(n,t);if(yoe.has(o))return!0;if(!Ka.has(o))return!1;t=n}return!1}function Eoe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
290
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Toe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ri(e){return e.length===1?e[0]:e.join("")}function Noe(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ri(n)}function Ioe(e,t,n,o){if(!Toe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Eoe(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Ri(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Ri(r),isWordLike:a,kind:i,start:l}),s}function uv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Loe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function $oe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Loe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Foe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Ooe=new Set([":","-","/","×",",",".","+","–","—"]),Boe=/[\p{P}\p{S}\p{Co}]/u,Roe=new RegExp("\\p{Emoji_Presentation}","u"),Doe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function SE(e){const t=e.charCodeAt(0);return t<128?(function(n){return n>=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Doe.has(e)&&!Roe.test(e)&&Boe.test(e)}function T4(e){let t=!1;for(const n of e)if(!ql.test(n)){if(!SE(n))return!1;t=!0}return t}function Poe(e,t,n,o){const s=!t&&T4(e),i=!o&&T4(n),r=(function(a){const c=(function(u){for(let d=u.length;d>0;){const f=zm(u,d),h=u.slice(f,d);if(!ql.test(h))return h;d=f}return null})(a);return c!==null&&Um(c)})(e),l=(t||r)&&(function(a){for(let c=a.length;c>0;){const u=zm(a,c),d=a.slice(u,c);if(!ql.test(d))return SE(d)||Um(d);c=u}return!1})(e);return!!(s||i||l)&&!dr(e)&&!dr(n)&&(t||s||r)&&(o||i)}function N4(e){for(const t of e)if(j2.test(t))return!0;return!1}function Up(e){if(e.length===0)return!1;for(const t of e)if(!j2.test(t)&&!Ooe.has(t))return!1;return!0}function Hoe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Woe(e,t,n="normal",o="normal"){const s=(function(a){const c=a??"normal";return c==="pre-wrap"?{mode:c,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:c,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(n),i=s.mode==="pre-wrap"?(function(a){return/[\r\f]/.test(a)?a.replace(/\r\n/g,`
291
- `).replace(/[\r\f]/g,`
292
- `):a})(e):(function(a){if(!foe.test(a))return a;let c=a.replace(doe," ");return c.charCodeAt(0)===32&&(c=c.slice(1)),c.length>0&&c.charCodeAt(c.length-1)===32&&(c=c.slice(0,-1)),c})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,c,u){var d,f,h;const p=(cv===null&&(cv=new Intl.Segmenter(void 0,{granularity:"word"})),cv);let m=0;const y=[],k=[],g=[],v=[],b=[],A=[],I=[],N=[],M=[],$=[],T=[],F=[];for(const L of p.segment(a))for(const O of Ioe(L.segment,(d=L.isWordLike)!=null&&d,L.index,u)){let U=function(){A[K]!==null&&(k[K]=[M4(y,A,I,K)],A[K]=null),k[K].push(O.text),g[K]=g[K]||O.isWordLike,N[K]=N[K]||q,M[K]=M[K]||ee,$[K]=ne,T[K]=j,F[K]=E4(M[K],fe)};const Z=O.kind==="text",ie=Coe(O.text,O.isWordLike,O.kind),q=dr(O.text),ee=C4(O.text),fe=Qd(O.text),ne=Jy(O.text),j=Aoe(O.text),K=m-1;c.carryCJKAfterClosingQuote&&Z&&m>0&&v[K]==="text"&&q&&N[K]&&$[K]||Z&&m>0&&v[K]==="text"&&boe(O.text)&&N[K]||Z&&m>0&&v[K]==="text"&&T[K]?U():Z&&m>0&&v[K]==="text"&&O.isWordLike&&ee&&F[K]?(U(),g[K]=!0):ie!==null&&m>0&&v[K]==="text"&&A[K]===ie?I[K]=((f=I[K])!=null?f:1)+1:Z&&!O.isWordLike&&m>0&&v[K]==="text"&&!N[K]&&(koe(O.text)||O.text==="-"&&g[K])?U():(y[m]=O.text,k[m]=[O.text],g[m]=O.isWordLike,v[m]=O.kind,b[m]=O.start,A[m]=ie,I[m]=ie===null?0:1,N[m]=q,M[m]=ee,$[m]=ne,T[m]=j,F[m]=E4(ee,fe),m++)}for(let L=0;L<m;L++)A[L]===null?y[L]=Ri(k[L]):y[L]=M4(y,A,I,L);for(let L=1;L<m;L++)v[L]!=="text"||g[L]||!G2(y[L])||v[L-1]!=="text"||N[L-1]||(y[L-1]+=y[L],g[L-1]=g[L-1]||g[L],y[L]="");const S=Array.from({length:m},()=>null);let B=-1;for(let L=m-1;L>=0;L--){const O=y[L];if(O.length!==0){if(v[L]==="text"&&!g[L]&&B>=0&&v[B]==="text"&&(xoe(O)||O==="-"&&_oe(y[B]))){const U=(h=S[B])!=null?h:[];U.push(O),S[B]=U,b[B]=b[L],y[L]="";continue}B=L}}for(let L=0;L<m;L++){const O=S[L];O!=null&&(y[L]=Noe(O,y[L]))}let W=0;for(let L=0;L<m;L++){const O=y[L];O.length!==0&&(W!==L&&(y[W]=O,g[W]=g[L],v[W]=v[L],b[W]=b[L]),W++)}y.length=W,g.length=W,v.length=W,b.length=W;const z=(function(L){const O=L.texts.slice(),U=L.isWordLike.slice(),Z=L.kinds.slice(),ie=L.starts.slice();for(let q=0;q<O.length-1;q++){if(Z[q]!=="text"||Z[q+1]!=="text"||!dr(O[q])||!dr(O[q+1]))continue;const ee=Soe(O[q]);ee!==null&&(O[q]=ee.head,O[q+1]=ee.tail+O[q+1],ie[q+1]=ie[q]+ee.head.length)}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];let q=0;for(;q<L.len;){const ee=L.texts[q],fe=L.kinds[q],ne=L.isWordLike[q];if(fe==="text"){const j=[ee];let K=q+1,ve=ne;for(;K<L.len&&L.kinds[K]==="text"&&Poe(L.texts[K-1],L.isWordLike[K-1],L.texts[K],L.isWordLike[K]);){const he=L.texts[K];j.push(he),ve=ve||L.isWordLike[K],K++}if(K>q+1){O.push(Ri(j)),U.push(ve),Z.push("text"),ie.push(L.starts[q]),q=K;continue}}O.push(ee),U.push(ne),Z.push(fe),ie.push(L.starts[q]),q++}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];for(let q=0;q<L.len;q++){const ee=L.texts[q];if(L.kinds[q]==="text"&&ee.includes("-")){const fe=ee.split("-");let ne=fe.length>1;for(let j=0;j<fe.length;j++){const K=fe[j];if(!ne)break;K.length!==0&&N4(K)&&Up(K)||(ne=!1)}if(ne){let j=0;for(let K=0;K<fe.length;K++){const ve=fe[K],he=K<fe.length-1?`${ve}-`:ve;O.push(he),U.push(!0),Z.push("text"),ie.push(L.starts[q]+j),j+=he.length}continue}}O.push(ee),U.push(L.isWordLike[q]),Z.push(L.kinds[q]),ie.push(L.starts[q])}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];for(let q=0;q<L.len;q++){const ee=L.texts[q],fe=L.kinds[q];if(fe==="text"&&Up(ee)&&N4(ee)){const ne=[ee];let j=q+1;for(;j<L.len&&L.kinds[j]==="text"&&Up(L.texts[j]);)ne.push(L.texts[j]),j++;O.push(Ri(ne)),U.push(!0),Z.push("text"),ie.push(L.starts[q]),q=j-1;continue}O.push(ee),U.push(L.isWordLike[q]),Z.push(fe),ie.push(L.starts[q])}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];for(let q=0;q<L.len;q++){const ee=L.texts[q];if(O.push(ee),U.push(L.isWordLike[q]),Z.push(L.kinds[q]),ie.push(L.starts[q]),!Foe(ee))continue;const fe=q+1;if(fe>=L.len||uv(L.kinds[fe]))continue;const ne=[],j=L.starts[fe];let K=fe;for(;K<L.len&&!uv(L.kinds[K]);)ne.push(L.texts[K]),K++;ne.length>0&&(O.push(Ri(ne)),U.push(!0),Z.push("text"),ie.push(j),q=K-1)}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=L.texts.slice(),U=L.isWordLike.slice(),Z=L.kinds.slice(),ie=L.starts.slice();for(let ee=0;ee<L.len;ee++){if(Z[ee]!=="text"||!$oe(L,ee))continue;const fe=[O[ee]];let ne=ee+1;for(;ne<L.len&&!uv(Z[ne]);){fe.push(O[ne]),U[ee]=!0;const j=O[ne].includes("?");if(Z[ne]="text",O[ne]="",ne++,j)break}O[ee]=Ri(fe)}let q=0;for(let ee=0;ee<O.length;ee++){const fe=O[ee];fe.length!==0&&(q!==ee&&(O[q]=fe,U[q]=U[ee],Z[q]=Z[ee],ie[q]=ie[ee]),q++)}return O.length=q,U.length=q,Z.length=q,ie.length=q,{len:q,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];let q=0;for(;q<L.len;){const ee=[L.texts[q]];let fe=L.isWordLike[q],ne=L.kinds[q],j=L.starts[q];if(ne==="glue"){const K=[ee[0]],ve=j;for(q++;q<L.len&&L.kinds[q]==="glue";)K.push(L.texts[q]),q++;const he=Ri(K);if(!(q<L.len&&L.kinds[q]==="text")){O.push(he),U.push(!1),Z.push("glue"),ie.push(ve);continue}ee[0]=he,ee.push(L.texts[q]),fe=L.isWordLike[q],ne="text",j=ve,q++}else q++;if(ne==="text")for(;q<L.len&&L.kinds[q]==="glue";){const K=[];for(;q<L.len&&L.kinds[q]==="glue";)K.push(L.texts[q]),q++;const ve=Ri(K);q<L.len&&L.kinds[q]==="text"?(ee.push(ve,L.texts[q]),fe=fe||L.isWordLike[q],q++):ee.push(ve)}O.push(Ri(ee)),U.push(fe),Z.push(ne),ie.push(j)}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})({len:W,texts:y,isWordLike:g,kinds:v,starts:b})))))));for(let L=0;L<z.len-1;L++){const O=Moe(z.texts[L]);O!==null&&(z.kinds[L]!=="space"&&z.kinds[L]!=="preserved-space"||z.kinds[L+1]!=="text"||!C4(z.texts[L+1])||(z.texts[L]=O.space,z.isWordLike[L]=!1,z.kinds[L]=z.kinds[L]==="preserved-space"?"preserved-space":"space",z.texts[L+1]=O.marks+z.texts[L+1],z.starts[L+1]=z.starts[L]+O.space.length))}return z})(i,t,s),l=o==="keep-all"?(function(a,c,u){if(c.len<=1)return c;const d=[],f=[],h=[],p=[];let m=-1,y=!1;function k(v){d.push(c.texts[v]),f.push(c.isWordLike[v]),h.push("text"),p.push(c.starts[v])}function g(v){if(!(m<0)){if(y)m+1===v?k(m):(function(b,A){let I=!1;for(let $=b;$<A;$++)I=I||c.isWordLike[$];const N=c.starts[b],M=A<c.len?c.starts[A]:a.length;d.push(a.slice(N,M)),f.push(I),h.push("text"),p.push(N)})(m,v);else for(let b=m;b<v;b++)k(b);m=-1,y=!1}}for(let v=0;v<c.len;v++){const b=c.texts[v],A=c.kinds[v];A!=="text"?(g(v),d.push(b),f.push(c.isWordLike[v]),h.push(A),p.push(c.starts[v])):(m>=0&&!_E(c.texts[v-1],u)&&g(v),m<0&&(m=v),y=y||dr(b))}return g(c.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:p}})(i,r,t.breakKeepAllAfterPunctuation):r;return it({normalized:i,chunks:Hoe(l,s)},l)}let Mc=null;const I4=new Map;let Ec=null;const zoe=new RegExp("\\p{Emoji_Presentation}","u"),Uoe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let dv=null;const L4=new Map;function ek(){if(Mc!==null)return Mc;if(typeof OffscreenCanvas<"u")return Mc=new OffscreenCanvas(1,1).getContext("2d"),Mc;if(typeof document<"u")return Mc=document.createElement("canvas").getContext("2d"),Mc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function hl(e,t){let n=t.get(e);return n===void 0&&(n={width:ek().measureText(e).width,containsCJK:dr(e)},t.set(e,n)),n}function qm(){if(Ec!==null)return Ec;if(typeof navigator>"u")return Ec={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ec;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 Ec={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ec}function CE(){return dv===null&&(dv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),dv}function qoe(e){return zoe.test(e)||e.includes("️")}function pa(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=CE();for(const a of l.segment(i))qoe(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function joe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function $4(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function F4(e,t,n=e.widths.length){for(;t<n&&joe(e.kinds[t]);)t++;return t}function Voe(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Koe(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Y2(e,t){return t===0?0:e+t}function Goe(e,t,n,o,s){return Y2(o,t==="tab"?s+(function(i,r){return i.letterSpacing!==0&&i.spacingGraphemeCounts[r]>0?i.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function O4(e,t,n,o){return Y2(o,t==="tab"?0:e.lineEndFitAdvances[n])}function B4(e,t,n,o,s){return Y2(o,t==="tab"?s:e.lineEndPaintAdvances[n])}function Yoe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Zoe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function sp(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Xoe(e,t){return(function(n,o){if(n.simpleLineWalkFastPath)return(function(S,B){const{widths:W,kinds:z,breakableFitAdvances:L,breakablePreferredBreaks:O}=S;if(W.length===0)return 0;const U=B+qm().lineFitEpsilon;let Z=0,ie=0,q=!1,ee=0,fe=0,ne=-1,j=0;function K(Q=ee,P=fe,G=ie){Z++,ie=0,q=!1,ne=-1,j=0}function ve(Q,P){q=!0,ee=Q+1,fe=0,ie=P}function he(Q,P,G){q=!0,ee=Q,fe=P+1,ie=G}function Ae(Q,P){q?(ie+=P,ee=Q+1,fe=0):ve(Q,P)}function re(Q,P){var G;const me=L[Q],ye=(G=O[Q])!=null?G:null;let de=ye===null?-1:sp(ye,0,P+1),V=-1,se=0,pe=P;for(;pe<me.length;){const ke=me[pe];if(q)if(ie+ke>U){if(ye!==null&&V>P){K(Q,V,se),pe=V,de=sp(ye,de,pe+1),V=-1,se=0;continue}K(),he(Q,pe,ke)}else ie+=ke,ee=Q,fe=pe+1;else he(Q,pe,ke);const Ne=pe+1;ye!==null&&ye[de]===Ne&&(V=Ne,se=ie,de++),pe++}q&&ee===Q&&fe===me.length&&(ee=Q+1,fe=0)}let Y=0;for(;Y<W.length&&(q||(Y=F4(S,Y),!(Y>=W.length)));){const Q=W[Y],P=$4(z[Y]);if(q)if(ie+Q>U){if(P){Ae(Y,Q),K(Y+1,0,ie-Q),Y++;continue}if(ne>=0){if(ee>ne||ee===ne&&fe>0){K();continue}K(ne,0,j);continue}if(Q>U&&L[Y]!==null){K(),re(Y,0),Y++;continue}K()}else Ae(Y,Q),P&&(ne=Y+1,j=ie-Q),Y++;else Q>U&&L[Y]!==null?re(Y,0):ve(Y,Q),P&&(ne=Y+1,j=ie-Q),Y++}return q&&K(),Z})(n,o);const{widths:s,kinds:i,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:c}=n;if(s.length===0||c.length===0)return 0;const u=qm(),d=o+u.lineFitEpsilon;let f=0,h=0,p=!1,m=0,y=0,k=-1,g=0,v=null;function b(){k=-1,g=0,v=null}function A(S=m,B=y,W){f++,h=0,p=!1,b()}function I(S,B){p=!0,m=S+1,y=0,h=B}function N(S,B,W){p=!0,m=S,y=B+1,h=W}function M(S,B){p?(h+=B,m=S+1,y=0):I(S,B)}function $(S,B,W,z,L,O){if(!B)return;const U=O4(n,S,W,L);B4(n,S,W,L,z),k=W+1,g=h-O+U,v=S}function T(S,B){var W;const z=r[S],L=(W=l[S])!=null?W:null;let O=L===null?-1:sp(L,0,B+1),U=-1,Z=B;for(;Z<z.length;){const ie=z[Z];if(p){const ee=Yoe(n,!0,ie),fe=h+ee;if(Zoe(n,fe)>d){if(L!==null&&U>B){A(S,U),Z=U,O=sp(L,O,Z+1),U=-1;continue}A(),N(S,Z,ie)}else h=fe,m=S,y=Z+1}else N(S,Z,ie);const q=Z+1;L!==null&&L[O]===q&&(U=q,O++),Z++}p&&m===S&&y===z.length&&(m=S+1,y=0)}function F(S){f++,b()}for(let S=0;S<c.length;S++){const B=c[S];if(B.startSegmentIndex===B.endSegmentIndex){F();continue}p=!1,h=0,B.startSegmentIndex,m=B.startSegmentIndex,y=0,b();let W=B.startSegmentIndex;for(;W<B.endSegmentIndex&&(p||(W=F4(n,W,B.endSegmentIndex),!(W>=B.endSegmentIndex)));){const z=i[W],L=$4(z),O=Koe(n,p,W),U=z==="tab"?Voe(h+O,n.tabStopAdvance):s[W],Z=O+U,ie=Goe(n,z,W,O,U);if(z!=="soft-hyphen")if(p){if(h+ie>d){const q=h+O4(n,z,W,O);if(B4(n,z,W,O,U),v==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&g<=d){A(k,0);continue}if(L&&q<=d){M(W,Z),A(W+1,0),W++;continue}if(k>=0&&g<=d){if(m>k||m===k&&y>0){A();continue}const ee=k;A(ee,0),W=ee;continue}if(ie>d&&r[W]!==null){A(),T(W,0),W++;continue}A();continue}M(W,Z),$(z,L,W,U,O,Z),W++}else ie>d&&r[W]!==null?T(W,0):I(W,U),$(z,L,W,U,O,Z),W++;else p&&(m=W+1,y=0,k=W+1,g=h+a,v=z),W++}p&&(B.consumedEndSegmentIndex,A(B.consumedEndSegmentIndex,0))}return f})(e,t)}let fv=null;function Z2(){return fv===null&&(fv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fv}function Qoe(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Jy(d),l=X1.has(d)}function u(d,f){o.push(d),i=i||f;const h=Jy(d);r=d.length===1&&Ka.has(d)&&r||h,l=!1}for(const d of Z2().segment(e)){const f=d.segment,h=dr(f);o.length!==0?l||V2.has(f)||Ka.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function Joe(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(l){if(!(s<0)){if(i)s+1===l?o.push(t[s]):(function(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})})(s,l);else for(let a=s;a<l;a++)o.push(t[a]);s=-1,i=!1}}for(let l=0;l<t.length;l++){const a=t[l];s>=0&&!_E(t[l-1].text,n)&&r(l),s<0&&(s=l),i=i||dr(a.text)}return r(t.length),o}function R4(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=Z2();for(const s of o.segment(e))n++;return n}function ese(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function tse(e,t,n,o,s){const i=qm(),{cache:r,emojiCorrection:l}=(function(F,S){ek().font=F;const B=(function(L){let O=I4.get(L);return O||(O=new Map,I4.set(L,O)),O})(F),W=(function(L){const O=L.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(F),z=S?(function(L,O){let U=L4.get(L);if(U!==void 0)return U;const Z=ek();Z.font=L;const ie=Z.measureText("😀").width;if(U=0,ie>O+.5&&typeof document<"u"&&document.body!==null){const q=document.createElement("span");q.style.font=L,q.style.display="inline-block",q.style.visibility="hidden",q.style.position="absolute",q.textContent="😀",document.body.appendChild(q);const ee=q.getBoundingClientRect().width;document.body.removeChild(q),ie-ee>.5&&(U=ie-ee)}return L4.set(L,U),U})(F,W):0;return{cache:B,fontSize:W,emojiCorrection:z}})(t,(a=e.normalized,Uoe.test(a)));var a;const c=pa("-",hl("-",r),l)+(s===0?0:2*s),u=8*pa(" ",hl(" ",r),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],p=[],m=[];let y=e.chunks.length<=1&&!d;const k=null,g=[],v=[],b=[],A=null,I=Array.from({length:e.len});function N(F,S,B,W,z,L,O,U,Z){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(y=!1),f.push(S),h.push(B),p.push(W),m.push(z),g.push(O),v.push(U),d&&b.push(Z)}function M(F,S,B,W,z){const L=hl(F,r),O=d?R4(F,S):0,U=(function(ee,fe,ne){return fe>1?ee+(fe-1)*ne:ee})(pa(F,L,l),O,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,ie=Z===0?0:Z+(O>0?s:0),q=S==="space"||S==="zero-width-break"?0:U;if(z&&W&&F.length>1){let ee="sum-graphemes";s!==0?ee="segment-prefixes":Up(F)?ee="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ee="segment-prefixes");const fe=(function(j,K,ve,he,Ae){if(K.breakableFitAdvances!==void 0&&K.breakableFitMode===Ae)return K.breakableFitAdvances;K.breakableFitMode=Ae;const re=CE(),Y=[];for(const me of re.segment(j))Y.push(me.segment);if(Y.length<=1)return K.breakableFitAdvances=null,K.breakableFitAdvances;if(Ae==="sum-graphemes"){const me=[];for(const ye of Y){const de=hl(ye,ve);me.push(pa(ye,de,he))}return K.breakableFitAdvances=me,K.breakableFitAdvances}if(Ae==="pair-context"||Y.length>96){const me=[];let ye=null,de=0;for(const V of Y){const se=pa(V,hl(V,ve),he);if(ye===null)me.push(se);else{const pe=ye+V,ke=hl(pe,ve);me.push(pa(pe,ke,he)-de)}ye=V,de=se}return K.breakableFitAdvances=me,K.breakableFitAdvances}const Q=[];let P="",G=0;for(const me of Y){P+=me;const ye=pa(P,hl(P,ve),he);Q.push(ye-G),G=ye}return K.breakableFitAdvances=Q,K.breakableFitAdvances})(F,L,r,l,ee),ne=fe===null||o==="keep-all"?null:(function(j){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(j))return null;const K=[];let ve=0;for(const he of Z2().segment(j))ve++,ese(he.segment)&&K.push(ve);return K.length===0?null:K})(F);return void N(F,U,ie,q,S,B,fe,ne,O)}N(F,U,ie,q,S,B,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const S=e.texts[F],B=e.isWordLike[F],W=e.kinds[F],z=e.starts[F];if(W==="soft-hyphen"){N(S,0,c,c,W,z,null,null,0);continue}if(W==="hard-break"){N(S,0,0,0,W,z,null,null,0);continue}if(W==="tab"){N(S,0,0,0,W,z,null,null,d?R4(S,W):0);continue}const L=hl(S,r);if(W==="text"&&L.containsCJK){const O=Qoe(S,i),U=o==="keep-all"?Joe(S,O,i.breakKeepAllAfterPunctuation):O;for(let Z=0;Z<U.length;Z++){const ie=U[Z];M(ie.text,"text",z+ie.start,B,o==="keep-all"||!dr(ie.text))}continue}M(S,W,z,B,!0)}const $=(function(F,S,B){const W=[];for(let z=0;z<F.length;z++){const L=F[z],O=L.startSegmentIndex<S.length?S[L.startSegmentIndex]:B,U=L.endSegmentIndex<S.length?S[L.endSegmentIndex]:B,Z=L.consumedEndSegmentIndex<S.length?S[L.consumedEndSegmentIndex]:B;W.push({startSegmentIndex:O,endSegmentIndex:U,consumedEndSegmentIndex:Z})}return W})(e.chunks,I,f.length),T=k===null?null:(function(F,S){const B=(function(z){const L=z.length;if(L===0)return null;const O=new Array(L);let U=!1;for(let ne=0;ne<L;){const j=z.charCodeAt(ne);let K=j,ve=1;if(j>=55296&&j<=56319&&ne+1<L){const Ae=z.charCodeAt(ne+1);Ae>=56320&&Ae<=57343&&(K=Ae-56320+(j-55296<<10)+65536,ve=2)}const he=uoe(K);he!=="R"&&he!=="AL"&&he!=="AN"||(U=!0);for(let Ae=0;Ae<ve;Ae++)O[ne+Ae]=he;ne+=ve}if(!U)return null;let Z=0;for(let ne=0;ne<L;ne++){const j=O[ne];if(j==="L"){Z=0;break}if(j==="R"||j==="AL"){Z=1;break}}const ie=new Int8Array(L);for(let ne=0;ne<L;ne++)ie[ne]=Z;const q=1&Z?"R":"L",ee=q;let fe=ee;for(let ne=0;ne<L;ne++)O[ne]==="NSM"?O[ne]=fe:fe=O[ne];fe=ee;for(let ne=0;ne<L;ne++){const j=O[ne];j==="EN"?O[ne]=fe==="AL"?"AN":"EN":j!=="R"&&j!=="L"&&j!=="AL"||(fe=j)}for(let ne=0;ne<L;ne++)O[ne]==="AL"&&(O[ne]="R");for(let ne=1;ne<L-1;ne++)O[ne]==="ES"&&O[ne-1]==="EN"&&O[ne+1]==="EN"&&(O[ne]="EN"),O[ne]!=="CS"||O[ne-1]!=="EN"&&O[ne-1]!=="AN"||O[ne+1]!==O[ne-1]||(O[ne]=O[ne-1]);for(let ne=0;ne<L;ne++){if(O[ne]!=="EN")continue;let j;for(j=ne-1;j>=0&&O[j]==="ET";j--)O[j]="EN";for(j=ne+1;j<L&&O[j]==="ET";j++)O[j]="EN"}for(let ne=0;ne<L;ne++){const j=O[ne];j!=="WS"&&j!=="ES"&&j!=="ET"&&j!=="CS"||(O[ne]="ON")}fe=ee;for(let ne=0;ne<L;ne++){const j=O[ne];j==="EN"?O[ne]=fe==="L"?"L":"EN":j!=="R"&&j!=="L"||(fe=j)}for(let ne=0;ne<L;ne++){if(O[ne]!=="ON")continue;let j=ne+1;for(;j<L&&O[j]==="ON";)j++;const K=(ne>0?O[ne-1]:ee)!=="L"?"R":"L";if(K===((j<L?O[j]:ee)!=="L"?"R":"L"))for(let ve=ne;ve<j;ve++)O[ve]=K;ne=j-1}for(let ne=0;ne<L;ne++)O[ne]==="ON"&&(O[ne]=q);for(let ne=0;ne<L;ne++){const j=O[ne];1&ie[ne]?j!=="L"&&j!=="AN"&&j!=="EN"||ie[ne]++:j==="R"?ie[ne]++:j!=="AN"&&j!=="EN"||(ie[ne]+=2)}return ie})(F);if(B===null)return null;const W=new Int8Array(S.length);for(let z=0;z<S.length;z++)W[z]=B[S[z]];return W})(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:T,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:T,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$}}const hv="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",nse=["diff ","index ","--- ","+++ ","@@ "],Io=(()=>{const e=globalThis;if(e[hv])return e[hv];const t={configs:{},controllers:{},revision:gr(0),preparedCache:new Map,blockEstimateCache:new Map};return e[hv]=t,t})();let fd=null;const pv=Io.revision;function D4(e){var t;return e&&(t=Io.configs[e])!=null?t:null}function P4(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function ose(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function mv(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!ose(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
293
- `)}return s.length>0?s:null}function gv(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(fd!=null)return fd;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return fd=!!((i=r.getContext)!=null&&i.call(r,"2d")),fd}catch{return fd=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Io.blockEstimateCache.get(r);if(l)return Io.blockEstimateCache.delete(r),Io.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,m){const y=`${m}\0${p}\0${h}`,k=Io.preparedCache.get(y);if(k)return Io.preparedCache.delete(y),Io.preparedCache.set(y,k),k.prepared;const g=(function(v,b,A){return(function(I,N,M,$){var T,F;const S=(T=$?.wordBreak)!=null?T:"normal",B=(F=$?.letterSpacing)!=null?F:0;return tse(Woe(I,qm(),$?.whiteSpace,S),N,!1,S,B)})(v,b,0,A)})(h,p,{whiteSpace:m});for(Io.preparedCache.set(y,{prepared:g});Io.preparedCache.size>240;){const v=Io.preparedCache.keys().next().value;if(!v)break;Io.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const y=Xoe(h,p);return{lineCount:y,height:y*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Io.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Io.blockEstimateCache.size>4e3;){const h=Io.blockEstimateCache.keys().next().value;if(!h)break;Io.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function AE(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=mv(e.children);return i&&n.paragraph?gv(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=mv(e.children),l=n.headings[i];return r&&l?gv(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=mv((s=i[0])==null?void 0:s.children);return r?gv(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=AE(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 ma(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function vv(e,t,n=0){return e.diff?q2(t??{},n)?(function(o){const s=ma(o.raw);if(s){const i=s.split(/\r?\n/);return o.originalCode!=null||o.updatedCode!=null?Math.max(1,i.filter(r=>!nse.some(l=>r.startsWith(l))).length):Math.max(1,i.length)}return hd(ma(o.originalCode))+hd(ma(o.updatedCode))})(e):(function(o){const s=o.originalCode,i=o.updatedCode;if(s!=null||i!=null)return Math.max(hd(ma(s)),hd(ma(i)));const r=ma(o.code).split(/\r?\n/);let l=0,a=0;for(const c of r)c.startsWith("+")&&!c.startsWith("+++")?a++:c.startsWith("-")&&!c.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):hd(ma(e.code,e.loading===!0))}function sse(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function yv(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=P4(o.lineHeight,1.5*P4(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:sse(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const ise=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function H4(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))ise.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}function W4(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.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 f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}function z4(e,t){let n=0,o=null,s=null;const i=()=>{const r=s;s=null,o=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);s=r,a<=0?(o&&(clearTimeout(o),o=null),n=l,s=null,e(...r)):o||(o=setTimeout(i,a))}}function U4(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const ME=Symbol("MarkstreamMathBlockMinHeightCache");function c3e(){return Jt(ME,null)}const rse=new Set(["text","inline_code","emoji","footnote_reference"]),lse=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function pd(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function ga(e,t,n,o=22){const s=String(e??"");if(!s)return n;const i=Math.max(18,Math.floor(Math.max(320,t)/8)),r=s.split(/\r?\n/).length,l=Math.ceil(s.length/i),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*o+12))}function EE(e){var t;if(!e||typeof e!="object")return!1;const n=e,o=String((t=n.type)!=null?t:"");if(rse.has(o))return!0;if(!lse.has(o))return!1;const s=n.children;return!Array.isArray(s)||!s.length||s.every(EE)}function tk(e){var t,n,o,s,i,r,l,a;if(!e||typeof e!="object")return"";const c=e,u=String((t=c.type)!=null?t:"");if(u==="text")return String((o=(n=c.content)!=null?n:c.raw)!=null?o:"");if(u==="inline_code")return String((r=(i=(s=c.code)!=null?s:c.content)!=null?i:c.raw)!=null?r:"");if(u==="emoji")return String((a=(l=c.name)!=null?l:c.raw)!=null?a:"");if(typeof c.text=="string")return c.text;const d=[];for(const f of["children","items","cells","rows"]){const h=c[f];if(Array.isArray(h)){const p=h.map(tk).filter(Boolean).join(" ");p&&d.push(p)}}return d.join(" ").replace(/\s+/g," ").trim()}function TE(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const o=t[n];return Array.isArray(o)&&o.some(TE)})}function ase(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),o=e.split(/\r?\n/).length,s=Math.ceil(e.length/n),i=Math.max(1,o,s);return 30+26*Math.max(0,i-1)}function cse(e,t){var n,o,s,i,r,l,a,c,u,d,f,h,p,m;if(!e||typeof e!="object")return 32;const y=e,k=String((n=y.type)!=null?n:""),g=Number.isFinite(t)&&t>0?t:640;switch(k){case"heading":return(function(v){var b;const A=Number((b=v.level)!=null?b:v.depth);return A>=4?20:A===3?30:A===2?32:44})(y);case"paragraph":return(function(v,b){const A=String(v??"");if(!A)return 28;const I=Math.max(18,Math.floor(Math.max(320,b)/8)),N=A.split(/\r?\n/).length,M=Math.ceil(A.length/I);return Math.max(1,N,M)<=1?28:ga(A,b,34)})(String((s=(o=y.raw)!=null?o:y.content)!=null?s:""),g);case"list":return(function(v,b){var A;const I=Array.isArray(v.items)?v.items:[];if(!I.length)return 48;const N=Math.max(48,30*I.length+12);let M=12;for(const F of I)M+=ase(tk(F)||String((A=F.raw)!=null?A:""),b);const $=Math.max(0,M-N);if(I.length>20){const F=Math.round(2.4*I.length);return Math.round(N+Math.max(F,Math.min($,3*I.length)))}if($<=0)return N;const T=I.length>8?8*I.length:$;return Math.round(N+Math.min($,T))})(y,g);case"list_item":return ga(String((r=(i=y.raw)!=null?i:y.content)!=null?r:""),g,34);case"blockquote":return ga(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),g,56);case"table":return(function(v,b){const A=[...v.header?[v.header]:[],...Array.isArray(v.rows)?v.rows:[]];if(!A.length){const I=Array.isArray(v.children)?v.children.length:3;return Math.max(120,38*I+48)}return Math.max(120,Math.round(4+A.reduce((I,N)=>I+(function(M,$){const T=Math.max(1,M.length),F=Math.max(80,($-32)/T),S=Math.max(10,Math.floor(F/8)),B=Math.max(1,...M.map(W=>{var z;const L=tk(W)||String((z=W?.raw)!=null?z:"");return Math.ceil(L.length/S)||1}));return 54+34*Math.max(0,B-1)+(T<=3&&M.some(TE)?14:0)})((function(M){var $;return Array.isArray(M?.cells)&&($=M.cells)!=null?$:[]})(N),b),0)))})(y,g);case"code_block":{const v=String((c=y.language)!=null?c:"").trim().toLowerCase(),b=String((d=(u=y.code)!=null?u:y.raw)!=null?d:"");return v==="mermaid"?Bm(Fm(b)):v==="infographic"?Rm(Om(b)):ga(b,g,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(v,b){var A,I,N;const M=v.match(/^\s*<details\b([^>]*)>/i);return M&&!/(?:^|\s)open(?:\s|=|$)/i.test((A=M[1])!=null?A:"")?ga(((N=(I=v.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i))==null?void 0:I[1])==null?void 0:N.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):ga(v,b,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),g);case"thematic_break":return 24;default:return ga(String((m=(p=y.raw)!=null?p:y.content)!=null?m:""),g,40)}}function q4(e,t,n){return Math.min(Math.max(e,t),n)}const use=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],dse=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","parseMarkdownToStructureTotalMs"],fse=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),NE=["raw","content","code","originalCode","updatedCode"],j4=new WeakMap,V4=new WeakMap;let hse=1;function Oi(){return typeof performance<"u"?performance.now():Date.now()}function K4(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Js(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=j4.get(t);return n||(n=hse++,j4.set(t,n)),String(n)}function G4(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:Js(t),customMarkdownIt:Js(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Js(e.validateLink),preTransformTokens:Js(e.preTransformTokens),postTransformTokens:Js(e.postTransformTokens),postTransformNodes:Js(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function Y4(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
294
- `,t-1)+1;return e.slice(n,t).trim()}function Z4(e){const t=IE(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function IE(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function LE(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 X2(e){const t=String(e??"");return`${t.length}:${LE(t)}`}function nk(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?X2(r):`${r.length}:${LE(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Js(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${Js(o)}`;const i=Js(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>nk(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}:${nk(r[c],t,n+1)}`).join(";")}`}return typeof e}function jm(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function $E(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>jm(o)?jl(o,t,n+1):$E(o,t,n+1)).join(",")}`:jm(e)?jl(e,t,n):nk(e,t,n)}function pse(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!NE.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${X2(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${Js(s)}`:fse.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${$E(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${Js(s)}`:""}).filter(Boolean).join(";")}function mse(e){return NE.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${X2(n)}`:""}).filter(Boolean).join(";")}function jl(e,t=new WeakMap,n=0){const o=V4.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Js(s)}`;const r=Js(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>jl(p,c,u+1)).join("|"):"";return[a.type,mse(d),pse(d,c,u),f.length,h].join(":")})(e,t,n);return V4.set(s,l),l}function FE(e,t){return jl(e)===jl(t)}function Q2(e,t,n){const o=Oi(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Oi()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function X4(e,t,n){return Q2(t,n,()=>jl(e))}function OE(e,t,n){return X4(e,n,"stabilizeSignatureMs")===X4(t,n,"stabilizeSignatureMs")}function ip(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Q4(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function J4(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function gse(e,t){return e.length===t.length&&e===t}function J2(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).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 f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!gse(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.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],f=c[u];if(!jm(d)||!jm(f))return null;const h=J2(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function vse(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=J2(e,t);return n??FE(e,t)}function yse(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return Q2(n,"stabilizeSignatureMs",()=>{o=J2(e,t)}),o??OE(e,t,n)}function kse(e,t){const n={};for(const o of use){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function bse(e,t){var n;const o=ZC(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=oe(t.renderContent.value);let l=[],a="",c="",u="",d=!1;const f=(function(){let W="",z=0,L=!1,O=!1,U=!1,Z=!1;function ie(){W="",z=0,L=!1,O=!1,U=!1,Z=!1}function q(ee){let fe=!1;for(let ne=0;ne<ee.length;ne++){const j=ee.charCodeAt(ne);if(j===10||j===13){const ve=j===10&&Z;Z=j===13,L=!1,ve||(U||(O=!1,z=0),U=!1);continue}Z=!1;const K=j===9||j===32;if(K||(U=!0,O&&(fe=!0)),z)if(z!==1)K||(j!==58?z=j===91?1:0:(fe=!0,O=!0));else{if(L){L=!1;continue}if(j===92){L=!0;continue}j===93&&(z=2)}else j===91&&(z=1)}return fe}return(ee,fe)=>{if(!ee||!fe.startsWith(ee)||fe.length<=ee.length)return ie(),[!0,0];let ne=0;W!==ee&&(ie(),q(ee),ne=ee.length);const j=fe.slice(ee.length),K=q(j);return W=fe,[K,ne+j.length]}})();let h,p=0,m=0,y=Oi(),k=-1,g=0;function v(W){k=Number.isInteger(W)?W:0,g+=1}function b(){h&&(clearTimeout(h),h=void 0)}function A(){b();const W=t.renderContent.value;r.value!==W&&(r.value=W),y=Oi()}et([t.renderContent,t.effectiveFinal,i],([W,z,L])=>{r.value!==W&&(!L||z||(function(O,U){if(!O&&U||U.length<=80||U.length<O.length||!U.startsWith(O))return!0;const Z=U.slice(O.length);return!!Z&&(!!Z4(Y4(U))||!(!Z.includes(`
295
-
296
- `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(Z))||Z.endsWith(`
297
- `)&&!(function(ie){const q=Y4(ie);if(Z4(q))return!1;const ee=IE(q);return ee.length>=2&&ee.some(fe=>fe.trim())})(U))})(r.value,W)?A():(function(){if(m+=1,h)return;const O=Math.max(0,(function(U){const Z=U.parseCoalesceMs;return typeof Z=="number"&&Number.isFinite(Z)&&Z>=0?Z:80})(e)-(Oi()-y));O<=0?A():h=setTimeout(A,O)})())},{flush:"sync",immediate:!0}),Lf(b);const I=D(()=>{var W,z,L,O;return IY(e.customHtmlTags,(W=e.parseOptions)==null?void 0:W.customHtmlTags,(O=(L=(z=t.customComponentsMap)==null?void 0:z.value)!=null?L:{},Object.entries(O).map(([U,Z])=>{const ie=Ti(U);return Z==null||!ie||Kf(ie)||U5.has(ie)||zf.has(ie)?"":ie}).filter(Boolean)))}),N=D(()=>{const{key:W,tags:z}=LY(I.value);if(!W)return o;const L=s.get(W);if(L)return L;const O=ZC(t.instanceMsgId,{customHtmlTags:z});return s.set(W,O),O}),M=D(()=>{const W=N.value;if(!e.customMarkdownIt)return W;const z=e.customMarkdownIt(W);return W.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),$=D(()=>{var W,z;const L=(W=e.parseOptions)!=null?W:{},O=t.effectiveFinal.value,U=I.value,Z=O!=null,ie=U.length>0;return Z||ie||L.streamParse==null?it(it(Ot(it({},L),{streamParse:(z=L.streamParse)==null||z}),Z?{final:O}:{}),ie?{customHtmlTags:U}:{}):L}),T=D(()=>{var W;return new Set(((W=$.value.customHtmlTags)!=null?W:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),F=D(()=>G4($.value,M.value,e.customMarkdownIt,{includeFinal:!0})),S=D(()=>G4($.value,M.value,e.customMarkdownIt,{includeFinal:!1}));et([F,S],([W,z],[L,O])=>{L&&(W===L&&z===O||(A(),z!==O&&(l=[],u="")))},{flush:"sync"});const B=D(()=>{var W,z,L,O,U,Z,ie,q,ee,fe,ne;if((W=e.nodes)!=null&&W.length)return l=[],u="",v(0),gt(e.nodes.slice());const j=r.value;if(!j)return l=[],u="",v(-1),[];const K=t.debugPerformanceEnabled.value,ve=K?Oi():0,he=M.value,Ae=F.value,re=S.value;a&&Ae!==a&&(function(tt){var lt,ut;(ut=(lt=tt.stream)==null?void 0:lt.reset)==null||ut.call(lt)})(he),c&&re!==c&&(l=[],u="");const Y=Object.keys((L=(z=t.customComponentsMap)==null?void 0:z.value)!=null?L:{}).length>0||typeof $.value.postTransformNodes=="function";Y!==d&&(l=[],u="");const Q=!Y&&l.length>0&&j.startsWith(u)&&re===c,P=K?K4(he):null,G=K?{}:void 0,me=J4(he),ye=!me&&!Y,de=it(it(Ot(it({},$.value),{__reuseStableTopLevelNodes:ye}),me?{__disableStreamParse:!0}:{}),G?{__timing:G}:{}),V=q8(j,he,de),se=K?Oi():0,pe=K?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ke,Ne=K?ip(V.length):void 0,qe=0,be=0,xe=0;if(Q){const tt=K?Oi():0,[lt,ut]=(function(Tt){var wt,Ft;const[en,Hn]=Tt.scanGlobalReferenceAppend(Tt.previousContent,Tt.content),Pt=Tt.parseOptions;return[Tt.previousDirtyStartIndex>0&&Pt.final!==!0&&!Tt.customMarkdownIt&&!J4(Tt.md)&&!en&&typeof Pt.preTransformTokens!="function"&&typeof Pt.postTransformTokens!="function"&&typeof Pt.postTransformNodes!="function"&&((Ft=(wt=Pt.customHtmlTags)==null?void 0:wt.length)!=null?Ft:0)===0?Tt.previousDirtyStartIndex:0,Hn]})({content:j,previousContent:u,previousDirtyStartIndex:k,parseOptions:$.value,customMarkdownIt:e.customMarkdownIt,md:he,scanGlobalReferenceAppend:f});xe=ut;const mt=lt<=0;if(pe){const Tt=(function(wt,Ft,en,Hn={}){var Pt;if(!Ft.length)return{nodes:wt,metrics:ip(wt.length)};const bn=(Pt=Hn.scanStartIndex)!=null?Pt:0,pn=Hn.reuseDirtyTail!==!1,Kt=(function(Wt,mn,so,gn=0){const to=Math.min(Wt.length,mn.length);for(let vt=Math.min(to,Math.max(0,gn));vt<to;vt++)if(!yse(mn[vt],Wt[vt],so))return vt;return Wt.length===mn.length?-1:to})(wt,Ft,en,bn);if(Kt<0)return{nodes:Ft,metrics:{reusedNodeCount:wt.length,dirtyStartIndex:Kt,stablePrefixNodeCount:wt.length,dirtyTailNodeCount:0}};const Nn=wt.slice();let Gt=Kt;for(let Wt=0;Wt<Kt;Wt++)Nn[Wt]=Ft[Wt];if(pn)for(let Wt=Kt;Wt<wt.length;Wt++){const mn=Ft[Wt],so=wt[Wt];mn&&OE(mn,so,en)&&(Nn[Wt]=mn,Gt+=1)}return{nodes:Nn,metrics:{reusedNodeCount:Gt,dirtyStartIndex:Kt,stablePrefixNodeCount:Kt,dirtyTailNodeCount:Q4(Kt,wt,Ft)}}})(V,l,pe,{reuseDirtyTail:mt,scanStartIndex:lt});ke=Tt.nodes,Ne=Tt.metrics}else{const Tt=(function(wt,Ft,en={}){var Hn;if(!Ft.length)return{nodes:wt,metrics:ip(wt.length)};const Pt=(Hn=en.scanStartIndex)!=null?Hn:0,bn=en.reuseDirtyTail!==!1,pn=(function(Gt,Wt,mn=0){const so=Math.min(Gt.length,Wt.length);for(let gn=Math.min(so,Math.max(0,mn));gn<so;gn++)if(!vse(Wt[gn],Gt[gn]))return gn;return Gt.length===Wt.length?-1:so})(wt,Ft,Pt);if(pn<0)return{nodes:Ft,metrics:{reusedNodeCount:wt.length,dirtyStartIndex:pn,stablePrefixNodeCount:wt.length,dirtyTailNodeCount:0}};const Kt=wt.slice();let Nn=pn;for(let Gt=0;Gt<pn;Gt++)Kt[Gt]=Ft[Gt];if(bn)for(let Gt=pn;Gt<wt.length;Gt++){const Wt=Ft[Gt],mn=wt[Gt];Wt&&FE(Wt,mn)&&(Kt[Gt]=Wt,Nn+=1)}return{nodes:Kt,metrics:{reusedNodeCount:Nn,dirtyStartIndex:pn,stablePrefixNodeCount:pn,dirtyTailNodeCount:Q4(pn,wt,Ft)}}})(V,l,{reuseDirtyTail:mt,scanStartIndex:lt});ke=Tt.nodes,Ne=Tt.metrics}qe=K?Oi()-tt:0,be=mt?Ne?.dirtyStartIndex==null||Ne.dirtyStartIndex<0?ke.length:Ne.dirtyStartIndex:ke.length}else ke=V,Ne=ip(ke.length);t.effectiveFinal.value!==!0&&(pe?(function(tt,lt,ut=0){for(let mt=Math.max(0,ut);mt<tt.length;mt++)Q2(lt,"primeSignatureMs",()=>jl(tt[mt]))})(ke,pe,be):(function(tt,lt=0){for(let ut=Math.max(0,lt);ut<tt.length;ut++)jl(tt[ut])})(ke,be));const Ze=K?Oi()-se:0;if(p+=1,u=j,a=Ae,c=re,d=Y,l=ke,v((O=Ne?.dirtyStartIndex)!=null?O:0),K){const tt=K4(he),lt=typeof tt?.total=="number"&&tt.total>((U=P?.total)!=null?U:0);t.logPerf(lt?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(Oi()-ve),nodes:ke.length,contentLength:j.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:Ze,referenceDefinitionScanChars:xe,signatureMs:(Z=pe?.signatureMs)!=null?Z:0,stabilizeSignatureMs:(ie=pe?.stabilizeSignatureMs)!=null?ie:0,primeSignatureMs:(q=pe?.primeSignatureMs)!=null?q:0,signatureCallCount:(ee=pe?.signatureCallCount)!=null?ee:0,stabilizeSignatureCallCount:(fe=pe?.stabilizeSignatureCallCount)!=null?fe:0,primeSignatureCallCount:(ne=pe?.primeSignatureCallCount)!=null?ne:0,stabilizeMs:qe},Ne??{}),G?Object.fromEntries(dse.map(ut=>{var mt;return[ut,(mt=G[ut])!=null?mt:0]})):{}),tt?{streamMode:tt.lastMode,streamDelta:kse(tt,P),streamStats:tt}:{}))}return gt(ke)});return{effectiveCustomHtmlTags:I,effectiveCustomHtmlTagsSet:T,mdBase:N,mdInstance:M,mergedParseOptions:$,getParsedNodesDirtyStartIndex:()=>k,getParsedNodesRevision:()=>g,parsedNodes:B}}function xse(e){const{isClient:t}=e,n=oe(new Set),o=new Map,s=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:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const y=n.value,k=y.has(f);if(h){if(k)return;const v=new Set(y);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(y);g.delete(f),n.value=g})(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[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function wse(e={}){const t=oe(""),n=oe(""),o=oe(!1),s=ete(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),c=D(()=>o.value&&a.value);return Tk()&&Lf(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const _se={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},e3=/auto|scroll|overlay/i;function Sse(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return e3.test(t)||e3.test(n)}function Cse(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 Ase={class:"m-0 p-0"},Mse=["data-probe"],Ese=Mn(Je(Ot(it({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,i;return(i=(s=t.headingNodes)==null?void 0:s[o])!=null?i:null}return(o,s)=>(x(),E("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[w("div",{ref:i=>e.setParagraphWrapper(i),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[ae(C(Ha),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),w("div",{ref:i=>e.setListItemWrapper(i),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[w("ul",Ase,[ae(C(du),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),w("div",{ref:i=>e.setListWrapper(i),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[ae(C(fu),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(x(),E(We,null,rt(6,i=>w("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[ae(C(Z1),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,Mse)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),t3=Je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,o;return Rm((o=Gc(e.estimatedPreviewHeightPx))!=null?o:Om(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Lt("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?Lt("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)"}},[Lt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Lt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Lt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Lt("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},()=>Lt("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,Lt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Lt("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Lt("div",{class:"absolute inset-0"},[Lt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),n3=Je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,o;return Bm((o=Gc(e.estimatedPreviewHeightPx))!=null?o:Fm(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Lt("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?Lt("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)"}},[Lt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Lt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Lt("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},()=>Lt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Lt("span",{class:"action-icon block"})])))]):null,Lt("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)"}},[Lt("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Lt("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"}})])])}}}),Tse={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Do(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const Nse=["data-custom-id"],Ise=["data-node-index","data-node-type"],o3="typewriter-simple-cursor-target",BE=Mn(Je(Ot(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},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:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],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","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function i(_){if(!(typeof Event<"u"&&_ instanceof Event))return typeof _=="string"&&s("copy-code",_),void s("copy",_)}const r=Mo(),l=Jt("markstreamNestedRendererProps",void 0);function a(_){const H=r?.vnode.props;return!!H&&(Object.prototype.hasOwnProperty.call(H,_)||Object.prototype.hasOwnProperty.call(H,String(_).replace(/[A-Z]/g,X=>`-${X.toLowerCase()}`)))}function c(_){var H,X;const J=o[_];return a(_)?J:(X=(H=l?.value)==null?void 0:H[_])!=null?X:J}const u=D(()=>{return(_=c("mode"))==="chat"||_==="minimal"||_==="docs"?_:"docs";var _}),d=D(()=>U4(c("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>c("domMode")==="minimal"?"minimal":"full"),p=D(()=>{return(_={mode:u.value,codeRenderer:c("codeRenderer"),renderCodeBlocksAsPre:c("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":_.codeRenderer==="pre"||_.codeRenderer==="shiki"||_.codeRenderer==="monaco"?_.codeRenderer:_.renderCodeBlocksAsPre===!1||_.mode==="docs"?"monaco":"pre";var _}),m=D(()=>Tse[u.value]),y=D(()=>{var _;return(_=c("showTooltips"))!=null?_:m.value.showTooltips}),k=D(()=>{var _;return(_=c("fade"))!=null?_:m.value.fade}),g=D(()=>{var _;return(_=c("batchRendering"))!=null?_:m.value.batchRendering}),v=D(()=>{var _;return(_=c("initialRenderBatchSize"))!=null?_:m.value.initialRenderBatchSize}),b=D(()=>{var _;return(_=c("renderBatchSize"))!=null?_:m.value.renderBatchSize}),A=D(()=>{var _;return(_=c("renderBatchDelay"))!=null?_:m.value.renderBatchDelay}),I=D(()=>{var _;return(_=c("renderBatchBudgetMs"))!=null?_:m.value.renderBatchBudgetMs}),N=D(()=>{var _;return(_=c("renderBatchIdleTimeoutMs"))!=null?_:m.value.renderBatchIdleTimeoutMs}),M=D(()=>{var _;return(_=c("deferNodesUntilVisible"))!=null?_:m.value.deferNodesUntilVisible}),$=D(()=>{var _;return(_=c("maxLiveNodes"))!=null?_:m.value.maxLiveNodes}),T=D(()=>{var _;return(_=c("liveNodeBuffer"))!=null?_:m.value.liveNodeBuffer}),F=D(()=>{var _;return(_=c("nodeVirtual"))!=null?_:m.value.nodeVirtual}),S={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return c("parseOptions")},get customMarkdownIt(){return c("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return c("customHtmlTags")},get mode(){return c("mode")},get domMode(){return h.value},get htmlPolicy(){return c("htmlPolicy")},get viewportPriority(){return c("viewportPriority")},get viewportPriorityOptions(){return c("viewportPriorityOptions")},get codeBlockStream(){return c("codeBlockStream")},get codeBlockDarkTheme(){return c("codeBlockDarkTheme")},get codeBlockLightTheme(){return c("codeBlockLightTheme")},get codeBlockMonacoOptions(){return c("codeBlockMonacoOptions")},get codeRenderer(){return c("codeRenderer")},get renderCodeBlocksAsPre(){return c("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return c("codeBlockMinWidth")},get codeBlockMaxWidth(){return c("codeBlockMaxWidth")},get codeBlockProps(){return c("codeBlockProps")},get mermaidProps(){return c("mermaidProps")},get d2Props(){return c("d2Props")},get infographicProps(){return c("infographicProps")},get showTooltips(){return y.value},get themes(){return c("themes")},get langs(){return c("langs")},get isDark(){return c("isDark")},get customId(){return c("customId")},get indexKey(){return o.indexKey},get typewriter(){return c("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return c("smoothStreamingOptions")},get parseCoalesceMs(){return c("parseCoalesceMs")},get fade(){return k.value},get batchRendering(){return g.value},get initialRenderBatchSize(){return v.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return A.value},get renderBatchBudgetMs(){return I.value},get renderBatchIdleTimeoutMs(){return N.value},get deferNodesUntilVisible(){return M.value},get maxLiveNodes(){return $.value},get liveNodeBuffer(){return T.value},get nodeVirtual(){return F.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function B(_){s("height-change",_)}function W(_){s("virtual-state-change",_)}function z(_){s("anchor-change",_)}const L=oe(),O=oe(null),U=oe(null),Z=oe(null),ie=zo({1:null,2:null,3:null,4:null,5:null,6:null}),q=oe(!1),ee=new Map,fe=oe(0),ne=oe(0),j=oe({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function K(_,H){return typeof _!="string"?H:_.trim()||H}function ve(_){const H=Number(_);return Number.isFinite(H)&&H>0?Math.max(1,Math.trunc(H)):640}const he=D(()=>{var _;const H=(_=S.viewportPriorityOptions)!=null?_:{},X=K(H.rootMargin,ja);return{rootMargin:X,heavyBlockMargin:K(H.heavyBlockMargin,X),maxTargets:ve(H.maxTargets)}}),Ae=D(()=>{var _;return(_=he.value.rootMargin)!=null?_:ja}),re=D(()=>{var _;return(_=he.value.maxTargets)!=null?_:640});function Y(){var _,H;if(((_=o.virtualScroll)==null?void 0:_.enabled)!==!0)return null;const X=(H=o.virtualScroll)==null?void 0:H.scrollRoot;return Q(typeof X=="function"?X():X)}function Q(_){return _?typeof HTMLElement<"u"&&_ instanceof HTMLElement?_:typeof _=="object"&&"value"in _?Q(_.value):typeof _=="object"&&"$el"in _?Q(_.$el):null:null}Ln(kE,he);const{isClient:P,renderAsFragment:G,debugPerformanceEnabled:me,resolvedShowTooltips:ye,resolvedHtmlPolicy:de,inheritedSmoothStreaming:V,ownsTypewriterCursor:se}=(function(_){const H=typeof window<"u",X=Bf(),J=Jt("markstreamHtmlPolicy",void 0),ce=Jt("markstreamTypewriterCursor",void 0),we=Jt("markstreamSmoothStreaming",void 0),Le=D(()=>_.renderAsFragment===!0),Fe=D(()=>!!(_.debugPerformance&&H&&typeof console<"u")),Ve=D(()=>{var je;if(typeof _.showTooltips=="boolean")return _.showTooltips;const $e=(je=X.showTooltips)!=null?je:X["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Oe=D(()=>{var je,$e;return($e=(je=_.htmlPolicy)!=null?je:J?.value)!=null?$e:"safe"}),Pe=D(()=>ce?.value!==!0);return{isClient:H,renderAsFragment:Le,debugPerformanceEnabled:Fe,resolvedShowTooltips:Ve,resolvedHtmlPolicy:Oe,inheritedSmoothStreaming:we,inheritedTypewriterCursor:ce,ownsTypewriterCursor:Pe}})(S),{resolveViewportRoot:pe,resolveScrollContainer:ke,isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:qe,getOffsetTopWithinRoot:be}=(function(_,H){function X(){var Fe,Ve;return(Ve=(Fe=H.scrollRoot)==null?void 0:Fe.call(H))!=null?Ve:null}function J(Fe){if(typeof window>"u")return null;const Ve=X();if(Ve)return Ve;const Oe=Fe??_.value;if(!Oe)return null;const Pe=Oe.ownerDocument||document,je=Pe.scrollingElement||Pe.documentElement;let $e=Oe;for(;$e&&$e!==Pe.body&&$e!==je;){if(Sse(window.getComputedStyle($e))&&Cse($e))return $e;$e=$e.parentElement}return null}function ce(Fe){if(!H.isClient)return!1;try{const Ve=window.getComputedStyle(Fe);return!!(Ve.display||"").toLowerCase().includes("flex")&&(Ve.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function we(Fe,Ve,Oe){var Pe,je;if(Oe)return Le(Ve);const $e=Fe.scrollTop;if(!ce(Fe))return $e;const He=$e<0?-$e:$e;return Math.max(0,((Pe=Fe.scrollHeight)!=null?Pe:0)-((je=Fe.clientHeight)!=null?je:0))-He}function Le(Fe){var Ve,Oe,Pe,je,$e;const He=Number((Ve=Fe.scrollingElement)==null?void 0:Ve.scrollTop),Xe=Number((Pe=(Oe=Fe.documentElement)==null?void 0:Oe.scrollTop)!=null?Pe:0),Ye=Number(($e=(je=Fe.body)==null?void 0:je.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Xe)?Xe:0,Number.isFinite(Ye)?Ye:0)}return{resolveViewportRoot:J,resolveScrollContainer:function(Fe){var Ve,Oe,Pe,je;const $e=X();if($e)return $e;const He=J((Ve=Fe??_.value)!=null?Ve:null);if(He)return He;const Xe=(je=(Pe=Fe?.ownerDocument)!=null?Pe:(Oe=_.value)==null?void 0:Oe.ownerDocument)!=null?je:typeof document<"u"?document:null;return Xe?.scrollingElement||Xe?.documentElement||null},isReverseFlexScrollRoot:ce,getNormalizedScrollTop:we,getOffsetTopWithinRoot:function(Fe,Ve){const Oe=Ve.ownerDocument||Fe.ownerDocument||document;if((function(He,Xe){return He===Xe.documentElement||He===Xe.body||He===Xe.scrollingElement})(Ve,Oe))return Fe.getBoundingClientRect().top+Le(Oe);const Pe=Ve.getBoundingClientRect(),je=Fe.getBoundingClientRect(),$e=we(Ve,Oe,!1);return je.top-Pe.top+$e}}})(L,{isClient:P,scrollRoot:Y});Ln("markstreamShowTooltips",ye),Ln("markstreamHtmlPolicy",de),Ln("markstreamTypewriter",f),Ln("markstreamFade",D(()=>S.fade!==!1)),Ln("markstreamTypewriterCursor",D(()=>!0)),Ln("markstreamTextStreamState",ee),Ln("markstreamStreamVersion",fe),Ln("markstreamParseOptions",D(()=>S.parseOptions)),Ln("markstreamCustomMarkdownIt",D(()=>S.customMarkdownIt));const{smoothStreamingEnabled:xe,renderContent:Ze,requestedFinal:tt,effectiveFinal:lt}=(function(_,H){const X=wse(it(it({},_se),_.smoothStreamingOptions)),J=D(()=>{var $e,He,Xe;return _.smoothStreaming!==!1&&!(($e=_.nodes)!=null&&$e.length)&&(_.smoothStreaming===!0||!((He=H.inheritedSmoothStreaming)!=null&&He.value))&&(_.smoothStreaming===!0||U4(_.typewriter)!=="off"||((Xe=_.maxLiveNodes)!=null?Xe:0)<=0)}),ce=oe(!H.isClient||_.smoothStreaming===!0);An(()=>{ce.value=!0});const we=D(()=>ce.value&&J.value),Le=D(()=>{var $e;return we.value?X.visible.value:($e=_.content)!=null?$e:""}),Fe=D(()=>{var $e,He;const Xe=($e=_.parseOptions)!=null?$e:{};return(He=_.final)!=null?He:Xe.final}),Ve=D(()=>{const $e=Fe.value;return we.value&&$e!=null?!!$e&&X.caughtUp.value:$e});let Oe=0,Pe=!1;function je(){Oe=0,Pe=!1}return et([()=>_.content,()=>_.nodes,we,Fe],([$e,He,Xe,Ye])=>{if(He?.length)return je(),void X.reset("");const ct=$e??"";if(!Xe)return je(),X.reset(ct),void(Ye&&X.finish({flush:!0}));const st=X.source.value;if(ct){if(ct!==st)if(ct.startsWith(st)){const pt=ct.slice(st.length),kt=X.pendingChars.value;pt.length<=8?(Oe++,Pe||Oe>=2&&kt<=8?(Pe=!0,X.reset(ct)):X.enqueue(pt)):(je(),X.enqueue(pt))}else je(),X.reset(ct)}else je(),X.reset("");Ye&&X.finish()},{immediate:!0}),{smoothStream:X,smoothStreamingEligible:J,smoothStreamingEnabled:we,renderContent:Le,requestedFinal:Fe,effectiveFinal:Ve}})(S,{isClient:P,inheritedSmoothStreaming:V}),ut=tt.value===!0;Ln("markstreamSmoothStreaming",xe);const mt=oe(!1),Tt=oe(!1),wt=oe(!1);let Ft="",en=!1,Hn=null;function Pt(){P&&Hn!=null&&(window.clearTimeout(Hn),Hn=null)}function bn(){mt.value=!1,Pt()}function pn(_,H){if(!me.value)return;const X=(function(){if(!me.value)return null;const J=mn(Kt),ce=mn(Nn),we=Math.max(Wt,ce);if(J<=0&&we<=0)return null;const Le={total:J,maxPerFrame:we,byLabel:(Fe=Kt,Object.fromEntries(Array.from(Fe.entries()).sort((Ve,Oe)=>Oe[1]-Ve[1]||Ve[0].localeCompare(Oe[0]))))};var Fe;return Kt.clear(),Nn.clear(),Wt=0,Le})();console.info(`[markstream-vue][perf] ${_}`,X?Ot(it({},H),{layoutReads:X}):H)}et([()=>S.indexKey,()=>S.customId],()=>{var _,H;bn(),Tt.value=!1,wt.value=!((_=o.nodes)!=null&&_.length)&&tt.value!==!0&&!!o.content,Ft=(H=Ze.value)!=null?H:"",en=Ft.length>0},{flush:"sync"}),et([()=>o.content,()=>o.nodes,tt],([_,H,X])=>{!H?.length&&X!==!0&&_&&(wt.value=!0)},{flush:"sync",immediate:!0}),et([Ze,()=>o.nodes,tt],([_,H,X])=>{const J=_??"";return H?.length||X===!0?(bn(),Tt.value=!1,Ft=J,void(en=!0)):(J.length>0&&(wt.value=!0),en?(Ft&&J.length>Ft.length&&J.startsWith(Ft)?(mt.value=!0,Tt.value=!0,P&&(Pt(),Hn=window.setTimeout(()=>{var ce;Hn=null,lt.value===!0||(ce=o.nodes)!=null&&ce.length||(gc(),mt.value=!1,xr())},1200))):(J.length<Ft.length||!J.startsWith(Ft))&&(bn(),Tt.value=!1),void(Ft=J)):(Ft=J,void(en=!0)))},{flush:"sync",immediate:!0});const Kt=new Map,Nn=new Map;let Gt=!1,Wt=0;function mn(_){let H=0;for(const X of _.values())H+=X;return H}function so(){Wt=Math.max(Wt,mn(Nn)),Nn.clear(),Gt=!1}function gn(_){_.maxPerFrame=Math.max(Number(_.maxPerFrame||0),Number(_.currentFrameTotal||0)),_.currentFrameTotal=0,_.frameScheduled=!1}function to(_){var H,X;me.value&&(Kt.set(_,((H=Kt.get(_))!=null?H:0)+1),Nn.set(_,((X=Nn.get(_))!=null?X:0)+1),(function(J){const ce=(function(){if(!P||typeof window>"u")return null;const we=window;if(we.__markstreamLayoutReadPerformance)return we.__markstreamLayoutReadPerformance;const Le={total:0,maxPerFrame:0,byLabel:{}};return we.__markstreamLayoutReadPerformance=Le,Le})();ce&&(ce.total=Number(ce.total||0)+1,ce.byLabel[J]=Number(ce.byLabel[J]||0)+1,ce.currentFrameTotal=Number(ce.currentFrameTotal||0)+1,ce.frameScheduled||(ce.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>gn(ce),0):queueMicrotask(()=>gn(ce)):window.requestAnimationFrame(()=>gn(ce))))})(_),Gt||(Gt=!0,P&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(so):typeof queueMicrotask!="function"?setTimeout(so,0):queueMicrotask(so)))}function vt(_,H){return to(_),H()}const Wn=S.customId?`renderer-${S.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Bn=(function(_){const H=new Map;return{scope:_,cache:H,clear:()=>H.clear()}})(Wn),Qn=Wn;Ln(ME,Bn);const sn=To(()=>S.customId),{effectiveCustomHtmlTagsSet:es,mergedParseOptions:nt,parsedNodes:Be,getParsedNodesDirtyStartIndex:Bt,getParsedNodesRevision:Yt}=bse(S,{instanceMsgId:Wn,renderContent:Ze,effectiveFinal:lt,smoothStreamingEnabled:xe,debugPerformanceEnabled:me,customComponentsMap:sn,logPerf:pn});et(Be,()=>{mt.value||Bn.clear(),fe.value+=1},{immediate:!0});const vn=D(()=>({customId:S.customId,customHtmlTags:nt.value.customHtmlTags,parseOptions:S.parseOptions,customMarkdownIt:S.customMarkdownIt,htmlPolicy:de.value,viewportPriority:S.viewportPriority,viewportPriorityOptions:he.value,mode:u.value,domMode:S.domMode,codeRenderer:p.value,codeBlockStream:S.codeBlockStream,codeBlockDarkTheme:S.codeBlockDarkTheme,codeBlockLightTheme:S.codeBlockLightTheme,codeBlockMonacoOptions:S.codeBlockMonacoOptions,renderCodeBlocksAsPre:S.renderCodeBlocksAsPre,codeBlockMinWidth:S.codeBlockMinWidth,codeBlockMaxWidth:S.codeBlockMaxWidth,codeBlockProps:S.codeBlockProps,mermaidProps:S.mermaidProps,d2Props:S.d2Props,infographicProps:S.infographicProps,showTooltips:ye.value,themes:S.themes,langs:S.langs,isDark:S.isDark,typewriter:f.value,smoothStreamingOptions:S.smoothStreamingOptions,parseCoalesceMs:S.parseCoalesceMs,fade:S.fade}));Ln("markstreamNestedRendererProps",vn);const xn=D(()=>Be.value),nn=D(()=>Be.value.length),Vn=oe(null),Kn=oe(null),Jn=oe(null),Oo=oe(null),ko=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),li=!ko&&S.customId?D4(S.customId):null,Uo=D(()=>li?(pv.value,D4(S.customId)):null),As=D(()=>{var _;return!!(!G.value&&S.customId&&!ko&&((_=Uo.value)!=null&&_.enabled))}),cs=D(()=>!!(P&&As.value)),qo=D(()=>{var _;return!!(!G.value&&((_=o.virtualScroll)!=null&&_.enabled))}),Bo=D(()=>qo.value),ai=oe(!1);An(()=>{ai.value=!0});const tn=D(()=>!!(P&&qo.value));Ln("markstreamHostScrollManaged",tn);const qs=D(()=>!!(ai.value&&tn.value)),io=D(()=>cs.value||tn.value),js=D(()=>cs.value||qs.value),ci=D(()=>{var _;return io.value&&((_=Uo.value)==null?void 0:_.textEstimation)!==!1});function Ni(){const _=ne.value||vt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=L.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(_)&&_>0?_:0}const ui=D(()=>{const _=Ni();return _>0?Math.max(1,Math.round(_)):640}),Vs=D(()=>{var _,H;return!(lt.value!==!0||qo.value||u.value!=="chat"&&u.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(_=o.nodes)!=null&&_.length||wt.value||!(((H=S.maxLiveNodes)!=null?H:0)<=0))}),ts=D(()=>{var _;return Vs.value?50:Math.max(1,(_=S.maxLiveNodes)!=null?_:320)}),ns=D(()=>{var _;return Vs.value?16:Math.max(0,(_=S.liveNodeBuffer)!=null?_:60)}),zt=D(()=>{var _;return!G.value&&S.nodeVirtual!==!1&&!(((_=S.maxLiveNodes)!=null?_:0)<=0&&!Vs.value)&&(S.nodeVirtual===!0?Be.value.length>0:Be.value.length>ts.value)}),Ms=D(()=>zt.value||cs.value||tn.value),No=D(()=>S.viewportPriority!==!1),di=D(()=>!!No.value&&!q.value);var Ke;Ke=D(()=>No.value),Ln(bE,Ke);const Re=D(()=>{var _;return!(G.value||S.deferNodesUntilVisible===!1||((_=S.maxLiveNodes)!=null?_:0)<=0||zt.value||Be.value.length>900||S.viewportPriority===!1)}),le=ene(_=>{var H;return pe((H=_??L.value)!=null?H:null)},No),{requestFrame:Te,cancelFrame:ge,hasIdleCallback:Ee,isTestEnv:ze}=(function(_){const H=_.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,X=_.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,J=_.isClient&&typeof window.requestIdleCallback=="function",ce=(function(){var we;if(typeof globalThis>"u"||!("process"in globalThis))return;const Le=(we=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:we.value;return Le?.env})();return{requestFrame:H,cancelFrame:X,hasIdleCallback:J,isTestEnv:ce?.NODE_ENV==="test"}})({isClient:P}),Ht=D(()=>lt.value===!0&&!qo.value),{resolvedBatchSize:Ut,resolvedInitialBatch:wn,batchingEnabled:go,incrementalRenderingActive:us,renderedCount:te,previousRenderContext:Ce,adaptiveBatchSize:Me,previousBatchConfig:De}=(function(_,H){var X;const J=D(()=>{var je;const $e=Math.trunc((je=_.renderBatchSize)!=null?je:80);return Number.isFinite($e)?Math.max(0,$e):0}),ce=D(()=>{var je;const $e=Math.trunc((je=_.initialRenderBatchSize)!=null?je:J.value);return Number.isFinite($e)?Math.max(0,$e):J.value}),we=D(()=>!H.renderAsFragment.value&&_.batchRendering!==!1&&J.value>0&&H.isClient&&!H.isTestEnv),Le=oe(0),Fe=oe({key:_.indexKey,total:0}),Ve=oe(Math.max(1,J.value||1)),Oe=D(()=>{var je,$e,He;return we.value&&!((je=H.continuousStreaming)!=null&&je.value)&&!(($e=H.forceFullRenderFinalContent)!=null&&$e.value)&&((He=_.maxLiveNodes)!=null?He:0)<=0}),Pe=oe({batchSize:J.value,initial:ce.value,delay:(X=_.renderBatchDelay)!=null?X:16,enabled:Oe.value});return{resolvedBatchSize:J,resolvedInitialBatch:ce,batchingEnabled:we,incrementalRenderingActive:Oe,renderedCount:Le,previousRenderContext:Fe,adaptiveBatchSize:Ve,previousBatchConfig:Pe}})(S,{isClient:P,isTestEnv:ze,renderAsFragment:G,forceFullRenderFinalContent:Ht,continuousStreaming:D(()=>Tt.value&&lt.value!==!0)}),Qe=D(()=>{var _;return!G.value&&S.batchRendering!==!1&&Ut.value>0&&!ze&&((_=S.maxLiveNodes)!=null?_:0)<=0&&!Ht.value}),at=D(()=>Qe.value),It=D(()=>io.value||at.value),Qt=D(()=>{var _;return It.value&&((_=Uo.value)==null?void 0:_.codeBlockEstimation)!==!1}),cn=new Map,Vt=new Map,zn=new WeakMap;let co=null;const Nt=new WeakMap,_t=new Map,Zt=[];let eo=[],ro=[],Ks=-1;const Ii=gr(Zt),Gs=new Set,Jf=oe(0);let eh=0;const Hb=oe(0),cN=D(()=>(Hb.value,Array.from(cn.entries()).sort((_,H)=>_[0]-H[0]))),Iu=oe(null),Ys=oe(null);let el,Ql=null,d0=0,Lu=null;function fi(){el.markFallbackHeightPrefixDirty()}function f0(_){return el.getFallbackNodeHeight(_)}function nc(_,H){return el.estimateHeightRange(_,H)}function h0(_){return el.estimateIndexForOffset(_)}const{activeRestoreAnchor:oc,getRelativeScrollTopWithinContainer:uN,setRelativeScrollTopWithinContainer:dN,resolveAnchorOffset:fN,clearRestoreReconcile:th,scheduleRestoreReconcile:$u,captureRestoreAnchor:Wb,restoreAnchor:zb,getAnchorDrift:hN}=(function(_){const{isClient:H,containerRef:X,parsedNodeCount:J,requestFrame:ce,cancelFrame:we,resolveScrollContainer:Le,getNormalizedScrollTop:Fe,getOffsetTopWithinRoot:Ve,isReverseFlexScrollRoot:Oe,estimateIndexForOffset:Pe,estimateHeightRange:je,getFallbackNodeHeight:$e,clamp:He}=_,Xe=oe(null);let Ye=null,ct=[];function st(){const Et=Le(),qt=X.value;if(!Et||!qt)return null;const Xt=Et.ownerDocument||qt.ownerDocument||document;if(Et===Xt.documentElement||Et===Xt.body||Et===Xt.scrollingElement){const In=qt.getBoundingClientRect();return Math.max(0,-In.top)}return Math.max(0,Fe(Et,Xt,!1)-Ve(qt,Et))}function pt(Et){var qt;const Xt=Le(),In=X.value;if(!Xt||!In)return;const Ko=Math.max(0,Et),Ro=Xt.ownerDocument||In.ownerDocument||document,$i=Ro.defaultView||(typeof window<"u"?window:null);if(Xt===Ro.documentElement||Xt===Ro.body||Xt===Ro.scrollingElement){const Ji=Fe(Xt,Ro,!0)+In.getBoundingClientRect().top;return void((qt=$i?.scrollTo)==null||qt.call($i,0,Math.max(0,Ji+Ko)))}W4(Xt,Ro,Ve(In,Xt)+Ko,{isReverseFlexScrollRoot:Ji=>{var ed;return(ed=Oe?.(Ji))!=null&&ed},getNormalizedScrollTop:Fe})}function kt(Et){const qt=J.value,Xt=He(Et.nodeIndex,0,Math.max(0,qt-1));return je(0,Xt)+Math.max(0,Et.offsetWithinNodePx)}function Mt(){if(Ye!=null&&(we?.(Ye),Ye=null),H)for(const Et of ct)window.clearTimeout(Et);ct=[]}function Ct(Et){const qt=kt(Et),Xt=st();Xt!=null&&Math.abs(Xt-qt)<=.5||pt(qt)}return{activeRestoreAnchor:Xe,getRelativeScrollTopWithinContainer:st,setRelativeScrollTopWithinContainer:pt,resolveAnchorOffset:kt,clearRestoreReconcile:Mt,applyRestoreAnchor:Ct,scheduleRestoreReconcile:function(){Xe.value&&H&&Ye==null&&(Ye=ce?ce(()=>{Ye=null,Xe.value&&Ct(Xe.value)}):null,Ye==null&&Xe.value&&Ct(Xe.value))},captureRestoreAnchor:function(){const Et=st(),qt=J.value;if(Et==null||qt<=0)return null;const Xt=He(Pe(Et+1),0,qt-1),In=je(0,Xt),Ko=$e(Xt);return{nodeIndex:Xt,offsetWithinNodePx:He(Et-In,0,Math.max(0,Ko-1))}},restoreAnchor:function(Et){const qt=J.value;if(Xe.value={nodeIndex:He(Et.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Et.offsetWithinNodePx)},Mt(),Ct(Xe.value),H)for(const Xt of[0,120,280,480])ct.push(window.setTimeout(()=>{Xe.value&&Ct(Xe.value)},Xt))},getAnchorDrift:function(Et){const qt=st();return qt==null?null:qt-kt(Et)}}})({isClient:P,containerRef:L,parsedNodeCount:nn,requestFrame:Te,cancelFrame:ge,resolveScrollContainer:()=>Iu.value||ke(),getNormalizedScrollTop:qe,getOffsetTopWithinRoot:be,isReverseFlexScrollRoot:Ne,estimateIndexForOffset:h0,estimateHeightRange:nc,getFallbackNodeHeight:f0,clamp:Vo}),{nodeHeights:sc,heightStats:hi,heightTreeSize:p0,heightSumTree:pN,heightKnownTree:mN,averageNodeHeight:Ub,resetHeightMeasurements:gN,pruneHeightMeasurements:vN,rebuildHeightTrees:nh,recordNodeHeight:yN,removeNodeHeights:kN,exportHeightCache:bN,importHeightCache:xN,fenwickRangeSum:wN}=(function(_={}){const H=zo({}),X=zo({total:0,count:0}),J=oe(0),ce=oe([]),we=oe([]);function Le(){for(const $e of Object.keys(H))delete H[Number($e)];X.total=0,X.count=0,J.value=0,ce.value=[],we.value=[]}function Fe($e,He,Xe){for(let Ye=He+1;Ye<$e.length;Ye+=Ye&-Ye)$e[Ye]+=Xe}function Ve($e,He){let Xe=0;for(let Ye=He+1;Ye>0;Ye-=Ye&-Ye)Xe+=$e[Ye];return Xe}function Oe($e){J.value=$e;const He=new Array($e+1).fill(0),Xe=new Array($e+1).fill(0);for(const[Ye,ct]of Object.entries(H)){const st=Number(Ye),pt=Number(ct);!Number.isFinite(st)||st<0||st>=$e||!Number.isFinite(pt)||pt<=0||(Fe(He,st,pt),Fe(Xe,st,1))}ce.value=He,we.value=Xe}function Pe($e){if(!Number.isInteger($e)||$e<0)return!1;const He=H[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete H[$e],X.total=Math.max(0,X.total-He),X.count=Math.max(0,X.count-1),J.value>$e){const Xe=ce.value,Ye=we.value;Xe.length&&Ye.length&&(Fe(Xe,$e,-He),Fe(Ye,$e,-1))}return!0}const je=D(()=>X.count>0?Math.max(12,X.total/X.count):32);return{nodeHeights:H,heightStats:X,heightTreeSize:J,heightSumTree:ce,heightKnownTree:we,averageNodeHeight:je,resetHeightMeasurements:Le,pruneHeightMeasurements:function($e){if($e<=0)return void Le();let He=0,Xe=0;for(const[Ye,ct]of Object.entries(H)){const st=Number(Ye),pt=Number(ct);!Number.isFinite(st)||st<0||st>=$e||!Number.isFinite(pt)||pt<=0?delete H[st]:(He+=pt,Xe++)}X.total=He,X.count=Xe},rebuildHeightTrees:Oe,recordNodeHeight:function($e,He,Xe={}){(function(Ye,ct,st={}){var pt;if(!Number.isFinite(ct)||ct<=0)return!1;const kt=H[Ye];if(kt&&(st.allowShrink===!1&&ct<kt||Math.abs(ct-kt)<=1))return!1;if(H[Ye]=ct,kt?X.total+=ct-kt:(X.total+=ct,X.count++),J.value>Ye){const Mt=ce.value,Ct=we.value;if(Mt.length&&Ct.length)if(kt){const Et=ct-kt;Et!==0&&Fe(Mt,Ye,Et)}else Fe(Mt,Ye,ct),Fe(Ct,Ye,1)}st.notify!==!1&&((pt=_.onHeightRecorded)==null||pt.call(_))})($e,He,Ot(it({},Xe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Xe;const Ye=Pe($e);return Ye&&He.notify!==!1&&((Xe=_.onHeightRecorded)==null||Xe.call(_)),Ye},removeNodeHeights:function($e,He={}){var Xe;let Ye=0;for(const ct of $e)Pe(Number(ct))&&Ye++;return Ye>0&&He.notify!==!1&&((Xe=_.onHeightRecorded)==null||Xe.call(_)),Ye},exportHeightCache:function(){return Object.entries(H).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Xe;if(!Array.isArray($e))return;const Ye=J.value;let ct=!1;if(He.mode!=="merge"){const st=Object.keys(H);if(st.length>0){for(const pt of st)delete H[Number(pt)];ct=!0}}for(const st of $e){const pt=Number(st.index),kt=Number(st.height);if(!Number.isInteger(pt)||pt<0||Ye>0&&pt>=Ye||!Number.isFinite(kt)||kt<=0)continue;const Mt=H[pt];Mt&&Math.abs(Mt-kt)<=1||(H[pt]=kt,ct=!0)}ct&&((function(){let st=0,pt=0;const kt=J.value;for(const[Mt,Ct]of Object.entries(H)){const Et=Number(Mt),qt=Number(Ct);!Number.isFinite(Et)||Et<0||kt>0&&Et>=kt||!Number.isFinite(qt)||qt<=0?delete H[Et]:(st+=qt,pt++)}X.total=st,X.count=pt})(),Ye>0&&Oe(Ye),(Xe=_.onHeightRecorded)==null||Xe.call(_))},fenwickRangeSum:function($e,He,Xe){if(Xe<=He)return 0;const Ye=Ve($e,Xe-1);return He<=0?Ye:Ye-Ve($e,He-1)}}})({onHeightRecorded:()=>{fi(),tn.value&&Gu(),oc.value&&$u(),Ys.value&&hc(),Gn("node-resize")}});function qb(_){Number.isInteger(_)&&_>=0&&Gs.add(_)}function jb(_){for(const H of _)qb(Number(H))}function ic(_){eh++;let H=!0;try{const X=_();return H=X!==!1,X}finally{eh--,eh===0&&H&&Jf.value++}}function m0(){eo=[],ro=[],Ks=-1,Gs.clear(),Ii.value=Zt}function oh(){m0(),ic(()=>gN()),_t.clear()}function Vb(_){!Number.isInteger(_)||_<0||_>=Be.value.length||_t.set(_,Ru(_))}function Kb(_,H,X={}){const J=sc[_];qb(_),yN(_,H,X);const ce=sc[_];return Object.is(J,ce)?(Gs.delete(_),!1):(ce&&ce>0?Vb(_):J&&_t.delete(_),!0)}function Gb(_,H){const X=vt("getNodeLayoutHeight.slot.offsetHeight",()=>{var J,ce;return(ce=(J=cn.get(_))==null?void 0:J.offsetHeight)!=null?ce:0});return X>0?X:vt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Yb(_,H={}){H.mode!=="merge"?m0():jb(_.map(X=>X.index)),ic(()=>xN(_,H)),U0()}const Zi=D(()=>Re.value&&di.value),_N=D(()=>{var _;return!G.value&&S.batchRendering!==!1&&Ut.value>0&&((_=S.maxLiveNodes)!=null?_:0)<=0}),SN=D(()=>!G.value&&ut&&lt.value===!0&&!zt.value&&!qo.value&&!As.value&&!Zi.value&&!_N.value),Zb=D(()=>!!le&&Zi.value),Xb=D(()=>zt.value||tn.value),{focusIndex:yr,liveRange:jo,updateLiveRange:Fu}=(function(_,H){const{parsedNodeCount:X,virtualizationEnabled:J,maxLiveNodesResolved:ce,liveNodeBufferResolved:we,clamp:Le}=H,Fe=we??D(()=>{var Pe;return Math.max(0,(Pe=_.liveNodeBuffer)!=null?Pe:60)}),Ve=oe(0),Oe=zo({start:0,end:0});return{liveNodeBufferResolved:Fe,focusIndex:Ve,liveRange:Oe,updateLiveRange:function(){const Pe=X.value;if(!J.value||Pe===0)return Oe.start=0,void(Oe.end=Pe);const je=Math.min(ce.value,Pe),$e=Fe.value,He=Le(Ve.value-$e,0,Math.max(0,Pe-je));Oe.start=He,Oe.end=Math.min(Pe,He+je)}}})(S,{parsedNodeCount:nn,virtualizationEnabled:zt,maxLiveNodesResolved:ts,liveNodeBufferResolved:ns,clamp:Vo}),Xi=new Map,Jl=new Map,tl=new Map,sh=[],kr=new Map,nl=new Set,Qb=oe(0);let g0=!1;const Jb=D(()=>(Qb.value,nl.size)),Zs=new Map,Qi=new Map,ex=oe(0),v0=D(()=>{ex.value;let _=0;for(const H of Zs.values())_+=Math.max(0,H);return _});let Xs=null;const ih=D(()=>{if(!zt.value)return Be.value.length;const _=ns.value,H=Math.max(jo.end+_,wn.value),X=Math.min(Be.value.length,H);return Math.max(te.value,X)});function rh(){g0||(g0=!0,queueMicrotask(()=>{g0=!1,Qb.value+=1}))}function tx(_,H,X="node-resize"){if(!P||typeof window>"u")return null;const J=window.setTimeout(()=>{nl.delete(J)&&rh();try{H()}finally{Gn(X)}},Math.max(0,_));return nl.add(J),rh(),J}function lh(_){P&&_!=null&&(nl.delete(_)&&rh(),window.clearTimeout(_))}function nx(){if(P&&typeof window<"u")for(const _ of nl)window.clearTimeout(_);nl.size&&(nl.clear(),rh()),sh.length=0,tl.clear()}function CN(_){O.value=_}function AN(_){U.value=_}function MN(_){Z.value=_}const{cancelScheduledFocusSync:y0,scheduleFocusSync:Li}=(function(_){const{isClient:H,containerRef:X,virtualizationEnabled:J,requestFrame:ce,cancelFrame:we,syncFocusToScroll:Le}=_;let Fe=null;function Ve(){var Pe,je,$e;return($e=(je=(Pe=X.value)==null?void 0:Pe.ownerDocument)==null?void 0:je.defaultView)!=null?$e:typeof window<"u"?window:null}function Oe(){if(!Fe)return;const Pe=Ve();Fe.viaTimeout?Pe?Pe.clearTimeout(Fe.id):clearTimeout(Fe.id):we?.(Fe.id),Fe=null}return{cancelScheduledFocusSync:Oe,scheduleFocusSync:function(Pe={}){if(!J.value)return;if(!H)return void Le(!0);if(Pe.immediate)return Oe(),void Le(!0);if(Fe)return;const je=()=>{Fe=null,Le()};if(ce)return void(Fe={id:ce(je),viaTimeout:!1});const $e=Ve();Fe={id:$e?$e.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:P,containerRef:L,virtualizationEnabled:zt,requestFrame:Te,cancelFrame:ge,syncFocusToScroll:function(_=!1){var H;if(!zt.value)return;const X=Iu.value||ke();if(!X)return;const J=X.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,ce=J?.defaultView||(typeof window<"u"?window:null),we=X===J?.documentElement||X===J?.body,Le=Be.value.length;if(Le<=0)return;if(!we&&Le>0&&Ne(X)){const Ye=vt("syncFocusToScroll.clientHeight",()=>X.clientHeight||0),ct=vt("syncFocusToScroll.scrollTop",()=>X.scrollTop),st=ct<0?-ct:ct;return void uh(Vo((Fe=Math.max(0,st)+.5*Math.max(0,Ye),el.estimateIndexForOffsetFromEnd(Fe)),0,Math.max(0,Le-1)),_)}var Fe;const Ve=(function(Ye,ct,st,pt){const kt=L.value;if(!kt)return null;const Mt=pt?0:vt("syncFocusToScroll.model.root.getBoundingClientRect",()=>Ye.getBoundingClientRect().top),Ct=vt("syncFocusToScroll.model.container.getBoundingClientRect",()=>kt.getBoundingClientRect().top),Et=Math.max(0,Mt-Ct),qt=pt?vt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Xt,In,Ko,Ro;return(Ro=(Ko=(In=st?.innerHeight)!=null?In:(Xt=ct.documentElement)==null?void 0:Xt.clientHeight)!=null?Ko:Ye.clientHeight)!=null?Ro:0}):vt("syncFocusToScroll.model.root.clientHeight",()=>Ye.clientHeight);return Vo(h0(Et+.5*Math.max(0,qt)),0,Math.max(0,Be.value.length-1))})(X,J,ce,we);if(Ve!=null)return void uh(Ve,_);const Oe=we?null:vt("syncFocusToScroll.root.getBoundingClientRect",()=>X.getBoundingClientRect()),Pe=we?0:Oe.top,je=we?vt("syncFocusToScroll.viewport.clientHeight",()=>{var Ye,ct;return(ct=(Ye=ce?.innerHeight)!=null?Ye:X.clientHeight)!=null?ct:0}):Oe.bottom,$e=cN.value;let He=null,Xe=null;for(const[Ye,ct]of $e){if(!ct)continue;const st=vt("syncFocusToScroll.slot.getBoundingClientRect",()=>ct.getBoundingClientRect());st.bottom<=Pe||st.top>=je||(He==null&&(He=Ye),Xe=Ye)}if(He==null||Xe==null){const Ye=L.value;if(!Ye)return;const ct=we?{top:0}:vt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>X.getBoundingClientRect()),st=vt("syncFocusToScroll.fallback.scrollTop",()=>qe(X,J,we)),pt=we?(()=>{const Mt=vt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ye.getBoundingClientRect()),Ct=(we?0:ct.top)-Mt.top;return Math.max(0,Ct)})():(()=>{const Mt=be(Ye,X);return Math.max(0,st-Mt)})(),kt=we?vt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Mt,Ct,Et,qt;return(qt=(Et=(Ct=ce?.innerHeight)!=null?Ct:(Mt=J?.documentElement)==null?void 0:Mt.clientHeight)!=null?Et:X.clientHeight)!=null?qt:0}):vt("syncFocusToScroll.fallback.root.clientHeight",()=>X.clientHeight);return void uh(Vo(h0(pt+.5*Math.max(0,kt)),0,Math.max(0,Be.value.length-1)),!0)}uh(Math.round((He+Xe)/2),_)}}),{visibleNodeIndices:k0,nodeVisibilityHandles:rc,nodeVisibilityWatchStops:ah,nodeVisibilityFallbackTimers:ox,clearVisibilityFallback:ch,markNodeVisible:ol,cleanupNodeVisibility:EN,destroyNodeVisibilityState:b0}=xse({isClient:P,shouldTrackVisibleNodeIndices:()=>Zi.value,shouldCleanupNodeVisibility:()=>zt.value,onNodeMarkedVisible:_=>{zt.value?Li():yr.value=Vo(_,0,Math.max(0,Be.value.length-1))},onNodeVisibilityCleaned:_=>{cn.delete(_)&&Ix()}}),{cleanupScrollListener:sx,setupScrollListener:TN}=(function(_){const{isClient:H,virtualizationEnabled:X,listenerEnabled:J,scrollRootElement:ce,resolveScrollContainer:we,scheduleFocusSync:Le,onScroll:Fe}=_;let Ve=null,Oe=null;function Pe(){Ve&&(Ve(),Ve=null),Oe=null,ce.value=null}function je($e){const He=_.getScrollTop?_.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:Pe,setupScrollListener:function(){if(!H)return;if(!(($e=J?.value)!=null?$e:X.value))return void Pe();var $e;const He=we();if(!He)return void Pe();if(ce.value===He&&Ve)return;Pe(),Oe=je(He);const Xe=()=>{if(Fe?.(),X.value){const Ye=(function(ct){const st=je(ct),pt=Oe;Oe=st;const kt=Math.max(480,.75*(ct.clientHeight||0));return pt==null?st>kt?{immediate:!0}:void 0:Math.abs(st-pt)>kt?{immediate:!0}:void 0})(He);Ye?Le(Ye):Le()}};He.addEventListener("scroll",Xe,{passive:!0}),ce.value=He,Ve=()=>{He.removeEventListener("scroll",Xe)}}}})({isClient:P,virtualizationEnabled:zt,listenerEnabled:Xb,scrollRootElement:Iu,resolveScrollContainer:ke,scheduleFocusSync:Li,onScroll:function(){const _=Ys.value;if(!_)return;const H=Bu();if(!H||(function(J){if(zu()>=d0)return Lu=null,!1;const ce=Lu;if(ce==null)return!0;const we=Math.abs(J.scrollTop-ce)<=2;return we||(Lu=null),we})(H))return;const X=kx(H);X!=null?(X<-32||Math.abs(Math.max(0,X)-Math.max(0,_.distanceFromBottomPx))>32)&&fc("restore"):fc("restore")},getScrollTop:_=>{var H;const X=_.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,J=_===X.documentElement||_===X.body||_===X.scrollingElement;return vt("scrollListener.getScrollTop",()=>qe(_,X,J))}});function uh(_,H=!1){const X=Vo(_,0,Math.max(0,Be.value.length-1));!H&&Math.abs(X-yr.value)<=1||(yr.value=X,Fu())}function Vo(_,H,X){return Math.min(Math.max(_,H),X)}function x0(_=Be.value.length){const H=Bt();return!Number.isInteger(H)||H<0?_:Vo(H,0,_)}function w0(_){return _?.firstElementChild}function ix(_,H){var X;return _?(X=_.matches)!=null&&X.call(_,H)?_:_.querySelector(H):null}function NN(_,H){_<1||_>6||(ie[_]=H)}function rx(){if(!io.value)return void(ne.value=0);const _=vt("updateExperimentContainerWidth.clientWidth",()=>{var H,X;return(X=(H=L.value)==null?void 0:H.clientWidth)!=null?X:0});ne.value=_>0?_:0}let Ou=null;function _0(){Ou?.disconnect(),Ou=null}const lx=Md("ViewportDeferredMarkdownCodeBlockNode",Hi({loader:()=>Zn(null,null,function*(){return(yield vs(()=>import("./index5-DYtlr_77.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Hm,delay:0,suspensible:!1}),Hm);function ax(_){return _===lx}const cx=D(()=>p.value==="pre"?Fs:p.value==="shiki"?lx:av);function ux(){var _;return((_=S.codeBlockProps)==null?void 0:_.showHeader)!==!1}function dx(_,H,X){const J=sc[H],ce=typeof J=="number"&&J>0;if(ci.value&&!ce&&!(function(we){return!!sn.value.paragraph&&(we.type==="paragraph"||we.type==="list_item"||we.type==="list")})(_)){const we=AE(_,X,j.value);if(we)return we}if(Qt.value&&_.type==="code_block"){const we=(function(Le){if(Le.type!=="code_block")return null;const Fe=Ux(Le,bh(Le));return ax(Fe)?"markdown":Fe===Fs?"pre":Fe===cx.value||Fe===av?"monaco":null})(_);if(we==="monaco"||we==="markdown"||we==="pre")return(function(Le,Fe){var Ve,Oe,Pe;if(!Le||Le.type!=="code_block")return null;const je=Fe.rendererKind,$e=je!=="pre"&&Fe.showHeader!==!1,He=!!Le.diff;let Xe=0,Ye=500;if(je==="monaco"){const st=(Ve=Fe.monacoOptions)!=null?Ve:{},pt=vv(Le,st,Fe.width),kt=(function(Ct){const Et=typeof Ct?.fontSize=="number"&&Ct.fontSize>0?Ct.fontSize:12;return typeof Ct?.lineHeight=="number"&&Ct.lineHeight>0?Ct.lineHeight:Math.round(1.5*Et)})(st),Mt=(function(Ct,Et){var qt,Xt;const In=typeof((qt=Ct?.padding)==null?void 0:qt.top)=="number"?Ct.padding.top:Et?0:8,Ko=typeof((Xt=Ct?.padding)==null?void 0:Xt.bottom)=="number"?Ct.padding.bottom:Et?0:8;return Math.max(0,In)+Math.max(0,Ko)})(st,He);Ye=typeof st.MAX_HEIGHT=="number"&&st.MAX_HEIGHT>0?st.MAX_HEIGHT:500,Xe=Math.round(pt*kt+Mt)}else if(je==="markdown"){const st=vv(Le);Xe=Math.round(21*st+32)}else{const st=vv(Le);Xe=Math.round(28*st),Ye=Number.POSITIVE_INFINITY}const ct=Math.max(1,Math.min(Xe,Ye));return it({kind:"code-block",height:Math.round(ct+($e?40:0)),contentHeight:ct,rendererKind:je},He&&je==="monaco"?{diffInline:q2((Oe=Fe.monacoOptions)!=null?Oe:{},(Pe=Fe.width)!=null?Pe:0)}:{})})(_,{rendererKind:we,monacoOptions:S.codeBlockMonacoOptions,showHeader:ux(),width:X})}return null}DA(()=>{if(Jf.value,eh>0)return;const _=Be.value,H=Yt();if(!_.length||!It.value)return eo=[],ro=[],Ks=-1,Gs.clear(),void(Ii.value=Zt);const X=ne.value||vt("estimatedNodeHeights.clientWidth",()=>{var Oe;return((Oe=L.value)==null?void 0:Oe.clientWidth)||0});if(!Number.isFinite(X)||X<=0)return eo=[],ro=[],Ks=-1,Gs.clear(),void(Ii.value=Zt);const J=(function(Oe){return[Math.round(Oe),ci.value,Qt.value,j.value,S.codeBlockMonacoOptions,ux(),p.value,sn.value,pv.value]})(X),ce=eo.length<=_.length&&(Le=J,(we=ro).length===Le.length&&we.every((Oe,Pe)=>Object.is(Oe,Le[Pe])));var we,Le;const Fe=ce&&Ks===H?_.length:ce?x0(_.length):0,Ve=ce?Array.from(Gs):[];eo.length=_.length;for(let Oe=Fe;Oe<_.length;Oe++)eo[Oe]=dx(_[Oe],Oe,X);for(const Oe of Ve)Oe>=0&&Oe<_.length&&Oe<Fe&&(eo[Oe]=dx(_[Oe],Oe,X));Gs.clear(),ro=J,Ks=H,Ii.value=eo,X9(Ii)},{flush:"sync"});const lc=D(()=>Ii.value);el=(function(_){let H=!0,X=[0],J="";function ce(Pe){var je;const $e=_.nodeHeights[Pe];if(Number.isFinite($e)&&$e>0)return $e;const He=_.parsedNodes.value[Pe],Xe=He?.type,Ye=!!((je=_.hasCustomParagraphComponent)!=null&&je.call(_)),ct=_.estimatedNodeHeights.value[Pe],st=ct?.height;if(!(function(kt,Mt,Ct){return!!(Ct&&Mt?.kind==="simple-text"&&(kt==="paragraph"||kt==="list_item"||kt==="list"))})(Xe,ct,Ye)&&Number.isFinite(st)&&st>0)return st;const pt=cse(He,_.getContainerWidth()||640);return Xe==="heading"||Xe==="paragraph"&&pt<=28&&(function(kt,Mt){if(Mt)return!1;const Ct=kt.children;return!Array.isArray(Ct)||!Ct.length||Ct.every(EE)})(He,Ye)?pt:Math.max(_.averageNodeHeight.value,pt)}function we(){var Pe;const je=_.parsedNodes.value.length,$e=_.getPrefixCacheKeyParts().join(":");if(!H&&J===$e)return X;const He=new Array(je+1);He[0]=0;for(let Xe=0;Xe<je;Xe++)He[Xe+1]=He[Xe]+(_.heightEstimationActive.value?ce(Xe):(Pe=_.nodeHeights[Xe])!=null?Pe:_.averageNodeHeight.value);return X=He,J=$e,H=!1,He}function Le(Pe){var je,$e;const He=_.parsedNodes.value.length;if(He<=0||Pe<=0)return 0;const Xe=we();if(Pe>=((je=Xe[He])!=null?je:0))return He-1;let Ye=0,ct=He-1,st=He-1;for(;Ye<=ct;){const pt=Ye+ct>>1;(($e=Xe[pt+1])!=null?$e:0)>=Pe?(st=pt,ct=pt-1):Ye=pt+1}return st}function Fe(Pe,je){var $e,He;if(Pe>=je)return 0;if(_.heightEstimationActive.value)return(function(ct,st){var pt,kt;const Mt=_.parsedNodes.value.length,Ct=q4(Math.trunc(ct),0,Mt),Et=q4(Math.trunc(st),Ct,Mt);if(Ct>=Et)return 0;const qt=we();return((pt=qt[Et])!=null?pt:0)-((kt=qt[Ct])!=null?kt:0)})(Pe,je);if(_.heightTreeSize.value!==_.parsedNodes.value.length){let ct=0;for(let st=Pe;st<je;st++)ct+=($e=_.nodeHeights[st])!=null?$e:_.averageNodeHeight.value;return ct}const Xe=_.heightSumTree.value,Ye=_.heightKnownTree.value;if(!Xe.length||!Ye.length){let ct=0;for(let st=Pe;st<je;st++)ct+=(He=_.nodeHeights[st])!=null?He:_.averageNodeHeight.value;return ct}return _.fenwickRangeSum(Xe,Pe,je)+(je-Pe-_.fenwickRangeSum(Ye,Pe,je))*_.averageNodeHeight.value}function Ve(Pe){var je;if(Pe<=0)return 0;const $e=_.parsedNodes.value;if(_.heightEstimationActive.value)return Le(Pe);if(_.heightTreeSize.value===$e.length&&_.heightSumTree.value.length&&_.heightKnownTree.value.length){const Xe=_.averageNodeHeight.value,Ye=_.heightSumTree.value,ct=_.heightKnownTree.value,st=Ct=>Ct<=0?0:_.fenwickRangeSum(Ye,0,Ct)+(Ct-_.fenwickRangeSum(ct,0,Ct))*Xe;let pt=0,kt=$e.length-1,Mt=$e.length-1;for(;pt<=kt;){const Ct=pt+kt>>1;st(Ct+1)>=Pe?(Mt=Ct,kt=Ct-1):pt=Ct+1}return Mt}let He=Pe;for(let Xe=0;Xe<$e.length;Xe++){const Ye=(je=_.nodeHeights[Xe])!=null?je:_.averageNodeHeight.value;if(He<=Ye)return Xe;He-=Ye}return Math.max(0,$e.length-1)}function Oe(){if(!_.heightEstimationActive.value)return 0;let Pe=0;const je=_.estimatedNodeHeights.value;for(let $e=0;$e<je.length;$e++){if(!je[$e])continue;const He=_.nodeHeights[$e];Number.isFinite(He)&&He>0||Pe++}return Pe}return{markFallbackHeightPrefixDirty:function(){H=!0},getFallbackNodeHeight:ce,estimateHeightRange:Fe,estimateIndexForOffset:Ve,estimateIndexForOffsetFromEnd:function(Pe){var je,$e;const He=_.parsedNodes.value;if(!He.length)return 0;if(Pe<=0)return Math.max(0,He.length-1);if(_.heightEstimationActive.value){const Ye=(je=we()[He.length])!=null?je:0;return Le(Math.max(0,Ye-Pe))}if(_.heightTreeSize.value===He.length){const Ye=Fe(0,He.length);return Ve(Math.max(0,Ye-Pe))}let Xe=Pe;for(let Ye=He.length-1;Ye>=0;Ye--){const ct=($e=_.nodeHeights[Ye])!=null?$e:_.averageNodeHeight.value;if(Xe<=ct)return Ye;Xe-=ct}return 0},getEstimatedNodeHeightCount:Oe,buildVirtualHeightSummary:function(Pe){var je;const $e=_.parsedNodes.value.length;return{totalNodes:$e,measuredCount:_.heightStats.count,estimatedCount:Oe(),averageNodeHeight:_.averageNodeHeight.value,topSpacerHeight:Pe.topSpacerHeight,bottomSpacerHeight:Pe.bottomSpacerHeight,estimatedTotalHeight:Fe(0,$e),width:(je=Pe.width)!=null?je:_.getContainerWidth()}}}})({parsedNodes:Be,nodeHeights:sc,heightStats:hi,heightTreeSize:p0,heightSumTree:pN,heightKnownTree:mN,averageNodeHeight:Ub,heightEstimationActive:io,estimatedNodeHeights:lc,getContainerWidth:Ni,hasCustomParagraphComponent:()=>!!sn.value.paragraph,getPrefixCacheKeyParts:()=>{var _;const H=pd(ne.value||vt("getFallbackHeightPrefix.clientWidth",()=>{var J;return((J=L.value)==null?void 0:J.clientWidth)||0})),X=((_=o.virtualScroll)==null?void 0:_.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[Be.value.length,hi.count,Math.round(hi.total),Math.round(100*Ub.value),X,H,io.value?1:0,pv.value,fe.value,sn.value.paragraph?1:0]},fenwickRangeSum:wN}),et(()=>Be.value.length,_=>{var H;fi(),_<=0?oh():(_<p0.value&&(H=_,m0(),ic(()=>vN(H))),_!==p0.value&&nh(_))},{immediate:!0});const IN=D(()=>{if(!zt.value)return Be.value.map((J,ce)=>({node:J,index:ce}));const _=Be.value.length,H=Vo(jo.start,0,_),X=Vo(jo.end,H,_);return Be.value.slice(H,X).map((J,ce)=>({node:J,index:H+ce}))}),S0=D(()=>zt.value?nc(0,Math.min(jo.start,Be.value.length)):0),C0=D(()=>{if(!zt.value)return 0;const _=Be.value.length;return nc(Math.min(jo.end,_),_)});function fx(){return el.buildVirtualHeightSummary({topSpacerHeight:S0.value,bottomSpacerHeight:C0.value,width:ea()})}function LN(){const _=Be.value,H=fx();return Ot(it({},H),{probe:{paragraphReady:!!j.value.paragraph,listItemReady:!!j.value.listItem,listWrapperOverhead:j.value.listWrapperOverhead,headingReadyLevels:Object.entries(j.value.headings).filter(([,X])=>!!X).map(([X])=>Number(X))},nodes:_.map((X,J)=>{var ce,we,Le,Fe,Ve,Oe,Pe,je,$e;return{index:J,type:X.type,estimateKind:(we=(ce=lc.value[J])==null?void 0:ce.kind)!=null?we:null,rendererKind:(Fe=(Le=lc.value[J])==null?void 0:Le.rendererKind)!=null?Fe:null,estimatedHeight:(Oe=(Ve=lc.value[J])==null?void 0:Ve.height)!=null?Oe:null,estimatedContentHeight:(je=(Pe=lc.value[J])==null?void 0:Pe.contentHeight)!=null?je:null,measuredHeight:($e=sc[J])!=null?$e:null}})})}function A0(){return o.indexKey!=null?String(o.indexKey):qo.value?`virtual-${no()}`:"markdown-renderer"}function hx(_){const H=String(_),X=`${A0()}-`;if(!H.startsWith(X))return null;const J=H.slice(X.length).match(/^(\d+)(?:$|-)/);if(!J)return null;const ce=Number(J[1]);return!Number.isInteger(ce)||ce<0||ce>=Be.value.length?null:ce}function no(){var _,H,X;const J=(_=o.virtualScroll)==null?void 0:_.sessionKey;return String(J!=null&&J!==""?J:(X=(H=o.indexKey)!=null?H:S.customId)!=null?X:Wn)}function bo(){var _;const H=(_=o.virtualScroll)==null?void 0:_.threadKey;return H==null||H===""?void 0:String(H)}const $N=D(()=>{var _,H,X;return(X=bo())!=null?X:String((H=(_=o.indexKey)!=null?_:S.customId)!=null?H:Wn)});function M0(_){var H;return(_??"")===((H=bo())!=null?H:"")}function br(){var _,H,X;return H=(_=o.virtualScroll)==null?void 0:_.measurementKey,X=(function(){const J=p.value;return(function(ce){var we,Le;const Fe=ce.renderer,Ve=Fe==="monaco"?ce.codeBlockMonacoOptions:void 0,Oe=ce.codeBlockProps,Pe=Fe==="shiki";return[ce.isDark?"dark":"light",Fe==="monaco"?"code-rich":Fe==="pre"?"code-pre":"code-shiki",ce.codeBlockStream===!1?"code-static":"code-stream",Do(ce.codeBlockMinWidth),Do(ce.codeBlockMaxWidth),...Pe?[Qee((we=Oe?.themes)!=null?we:ce.themes,(Le=Oe?.langs)!=null?Le:ce.langs)]:[],Do(Ve?.fontSize),Do(Ve?.lineHeight),Do(Ve?.fontFamily),Do(Ve?.tabSize),Do(Ve?.MAX_HEIGHT),Do(Ve?.wordWrap),Do(Ve?.wrappingIndent),Do(Ve?.padding),Do(Oe?.showHeader),Do(Oe?.showCopyButton),Do(Oe?.showExpandButton),Do(Oe?.showPreviewButton),Do(Oe?.showCollapseButton),Do(Oe?.showFontSizeButtons)].join("\0")})({renderer:J,isDark:S.isDark,codeBlockStream:S.codeBlockStream,codeBlockMinWidth:S.codeBlockMinWidth,codeBlockMaxWidth:S.codeBlockMaxWidth,codeBlockMonacoOptions:J==="monaco"?S.codeBlockMonacoOptions:void 0,codeBlockProps:S.codeBlockProps,themes:J==="shiki"?S.themes:void 0,langs:J==="shiki"?S.langs:void 0})})(),[H==null?"":String(H),X].join("\0")}function ea(){return Ni()}const dh=D(()=>pd(ea())),Qs=D(()=>[br(),dh.value].join("\0")),FN=D(()=>{var _;return qo.value?["virtual",(_=bo())!=null?_:"",no(),Qs.value].join("\0"):o.indexKey});function ac(){ex.value+=1}function E0(_){return!(!_||!Number.isInteger(_.index)||_.index<0||_.index>=Be.value.length||_.sessionKey!==no()||_.threadKey!==bo()||_.layoutEpochKey!==Qs.value)}function px(_){const H=String(_),X=Qi.get(H);return X?E0(X)?X.index:null:hx(H)}function mx(_="async-node"){(Zs.size||Qi.size)&&(Zs.clear(),Qi.clear(),ac(),Gn(_))}const cc=Jt(Hy,null),T0={reportHeight(_,H){if(!tn.value)return;const X=px(_);if(X==null)return;const J=Xi.get(X);if(!J)return;const ce=Number(H),we=Gb(X,J);(function(Le,Fe,Ve={}){ic(()=>Kb(Le,Fe,Ve))})(X,Number.isFinite(ce)&&ce>0?Math.max(ce,we||0):we)},markPending(_){if(!tn.value)return;const H=hx(_);H!=null&&(function(X,J){var ce;const we=Qi.get(X);if(we&&E0(we))return Zs.set(X,Math.max(0,(ce=Zs.get(X))!=null?ce:0)+1),ac(),void Gn("async-node");Zs.set(X,1),Qi.set(X,(function(Le){return{index:Le,sessionKey:no(),threadKey:bo(),layoutEpochKey:Qs.value}})(J)),ac(),Gn("async-node")})(String(_),H)},markSettled(_){if(!tn.value)return;const H=String(_),X=px(_);(X!=null||(function(J){return Zs.has(String(J))})(H))&&(function(J){var ce;const we=(ce=Zs.get(J))!=null?ce:0;return!(we<=0||(we<=1?(Zs.delete(J),Qi.delete(J)):Zs.set(J,we-1),ac(),we===1&&Gn("async-node"),0))})(H)&&X!=null&&xr()}};function ON(){let _=0;for(const H of Xi.values())_+=vt("getVisibleDomHeight.offsetHeight",()=>{var X;return(X=H?.offsetHeight)!=null?X:0});return Math.ceil(Math.max(0,_))}Ln(Hy,{reportHeight(_,H){T0.reportHeight(_,H),cc?.reportHeight(_,H)},markPending(_){T0.markPending(_),cc?.markPending(_)},markSettled(_){T0.markSettled(_),cc?.markSettled(_)}});let N0,I0=null,uc=null;function fh(_){return _!==!1&&_!=null&&_!==""}function gx(){return zt.value?(function(){if(!zt.value)return!0;const _=Be.value.length,H=Vo(jo.start,0,_),X=Vo(jo.end,H,_);if(H>=X)return!0;for(let J=H;J<X;J++)if(!cn.has(J)||gh(J)&&!Xi.has(J))return!1;return!0})():te.value>=ih.value}function L0(){return lt.value===!0&&!mt.value&&v0.value===0&&nl.size===0&&kr.size===0&&Xs==null&&gx()}function vx(){var _,H;if(((_=o.virtualScroll)==null?void 0:_.settleMode)!=="manual"||I0===no()&&N0===bo())return!0;const X=(H=o.virtualScroll)==null?void 0:H.settledToken;return!!fh(X)&&uc===Yu(X)}function $0(){return L0()&&vx()}function BN(_,H){return H.totalNodes<=0?_==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?_==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function ta(_="manual",H){const X=fx(),J=(function(ce){return ce||(lt.value!==!0?Be.value.length>0?"streaming":"estimating":!gx()||kr.size>0||Xs!=null?"measuring":$0()?"settled":"settling")})(H);return{sessionKey:no(),threadKey:bo(),phase:J,nodeCount:X.totalNodes,liveRange:{start:jo.start,end:jo.end},renderedCount:te.value,measuredCount:X.measuredCount,estimatedCount:X.estimatedCount,averageNodeHeight:X.averageNodeHeight,topSpacerHeight:X.topSpacerHeight,bottomSpacerHeight:X.bottomSpacerHeight,visibleDomHeight:ON(),totalHeight:yx(),width:X.width,final:lt.value===!0,stable:$0(),confidence:BN(J,X),reason:_}}function Bu(){const _=Iu.value||ke(),H=L.value;if(!_||!H)return null;const X=_.ownerDocument||H.ownerDocument||document,J=_===X.documentElement||_===X.body||_===X.scrollingElement,ce=vt("getScrollBox.scrollTop",()=>qe(_,X,J)),we=vt("getScrollBox.scrollHeight",()=>{var Fe,Ve,Oe,Pe,je;return J?Math.max((Ve=(Fe=X.documentElement)==null?void 0:Fe.scrollHeight)!=null?Ve:0,(Pe=(Oe=X.body)==null?void 0:Oe.scrollHeight)!=null?Pe:0,(je=_.scrollHeight)!=null?je:0):_.scrollHeight}),Le=vt("getScrollBox.clientHeight",()=>{var Fe;return J?((Fe=X.documentElement)==null?void 0:Fe.clientHeight)||_.clientHeight||0:_.clientHeight});return{root:_,doc:X,isViewportRoot:J,scrollTop:ce,scrollHeight:we,clientHeight:Le}}function yx(){const _=Be.value.length,H=Math.max(0,nc(0,_)),X=vt("getRendererLogicalHeight.offsetHeight",()=>{var ce,we;return(we=(ce=L.value)==null?void 0:ce.offsetHeight)!=null?we:0}),J=Math.max(0,X>0?X:vt("getRendererLogicalHeight.scrollHeight",()=>{var ce,we;return(we=(ce=L.value)==null?void 0:ce.scrollHeight)!=null?we:0}));return _<=0?Math.ceil(X):zt.value?H>0?Math.max(1,Math.ceil(H),(function(){let ce=S0.value+C0.value;for(const we of cn.values())we&&(ce+=Math.max(0,vt("getVirtualizedDomLogicalHeight.offsetHeight",()=>we.offsetHeight||0)));return Math.ceil(Math.max(0,ce))})(),(function(ce,we){return ce<=0||we<=0?0:we<=ce+Math.max(512,.05*ce)?Math.ceil(we):0})(H,J)):Math.max(1,Math.ceil(J)):tn.value?H>0||hi.count>0||el.getEstimatedNodeHeightCount()>0?(us.value&&te.value,Math.max(1,Math.ceil(J),Math.ceil(H))):Math.ceil(J):Math.max(1,Math.ceil(J),Math.ceil(H))}function kx(_){const H=L.value;if(!H)return null;const X=vt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(ce){return ce.isViewportRoot?ce.clientHeight:vt("getViewportBottomInRoot.getBoundingClientRect",()=>ce.root.getBoundingClientRect().bottom)})(_)-X.bottom}function RN(_={}){const H=_.requireViewport!==!1,X=(function(we=64){const Le=Bu(),Fe=L.value;if(!Le||!Fe)return!1;const Ve=(function(Pe){if(Pe.isViewportRoot)return{top:0,bottom:Pe.clientHeight};const je=vt("getVirtualViewportRect.getBoundingClientRect",()=>Pe.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Le),Oe=vt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Fe.getBoundingClientRect());return Oe.bottom>=Ve.top-we&&Oe.top<=Ve.bottom+we})();if(H&&!X)return null;const J=(function(){const we=Bu(),Le=L.value;if(!we||!Le||Math.max(0,we.scrollHeight-we.scrollTop-we.clientHeight)>64)return null;const Fe=kx(we);return Fe==null?null:Fe>=-8&&Fe<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Fe)}:null})();if(J)return{anchor:J,captured:!0};const ce=Wb();if(ce)return{anchor:{type:"node",nodeIndex:ce.nodeIndex,offsetWithinNodePx:ce.offsetWithinNodePx},captured:X};if(_.allowFallback===!0){const we=(function(){const Le=Be.value.length;return Le<=0?null:{type:"node",nodeIndex:Vo(yr.value,0,Math.max(0,Le-1)),offsetWithinNodePx:0}})();return we?{anchor:we,captured:!1}:null}return null}function F0(_){let H=2166136261;for(let X=0;X<_.length;X++)H^=_.charCodeAt(X),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function DN(_,H){let X=_;for(let J=0;J<H.length;J++)X^=H.charCodeAt(J),X=Math.imul(X,16777619);return X^=31,X=Math.imul(X,16777619),X}const PN=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function hh(_,H=new WeakSet,X=0){if(_==null||typeof _=="number"||typeof _=="boolean")return String(_);if(typeof _=="string")return`s:${(function(J){const ce=J.length>8192?`${J.slice(0,8192)}...${J.length}`:J;return`${J.length}:${F0(ce)}`})(_)}`;if(typeof _=="function")return"fn";if(typeof _!="object")return typeof _;if(H.has(_))return"cycle";if(X>=6)return"max-depth";H.add(_);try{if(Array.isArray(_)){if(_.length<=160){const Oe=[];for(let Pe=0;Pe<_.length;Pe++)Oe.push(hh(_[Pe],H,X+1));return`a:${_.length}:${Oe.join(",")}`}const we=[],Le=[],Fe=Math.max(0,_.length-32);let Ve=2166136261;for(let Oe=0;Oe<_.length;Oe++){const Pe=hh(_[Oe],H,X+1);Ve=DN(Ve,Pe),Oe<32&&we.push(Pe),Oe>=Fe&&Le.push(Pe)}return[`a:${_.length}`,`h=${we.join(",")}`,`t=${Le.join(",")}`,`all=${(Ve>>>0).toString(36)}`].join(":")}const J=_,ce=Object.keys(J).filter(we=>{const Le=J[we];return we!=="parent"&&we!=="el"&&we!=="component"&&(Le==null||typeof Le=="string"||typeof Le=="number"||typeof Le=="boolean"||PN.has(we))}).sort();return`o:${ce.length}:${ce.map(we=>`${we}=${hh(J[we],H,X+1)}`).join(";")}`}finally{H.delete(_)}}let O0=-1,B0="",na=[2166136261];function Ru(_){const H=Be.value[_];return H?F0(hh(H)):""}function HN(_,H){let X=_;for(let J=0;J<H.length;J++)X^=H.charCodeAt(J),X=Math.imul(X,16777619);return X>>>0}function R0(){var _,H;const X=fe.value;if(O0===X)return B0;const J=Be.value.length;let ce=x0(J);(O0!==X-1||ce>J||na.length<ce+1)&&(ce=0),ce===0?na=[2166136261]:na.length=ce+1;for(let we=ce;we<J;we++){const Le=Ru(we);na[we+1]=HN((_=na[we])!=null?_:2166136261,Le)}return na.length=J+1,B0=(((H=na[J])!=null?H:2166136261)>>>0).toString(36),O0=X,B0}function dc(_,H={}){var X;const J=H.includeHeightCache===!0,ce=(X=H.includeContentHash)!=null?X:J,we=J?(function(Fe){const Ve=(function(){var Ye,ct;const st=Number((ct=(Ye=o.virtualScroll)==null?void 0:Ye.heightCacheLimit)!=null?ct:5e3);return!Number.isFinite(st)||st<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(st))})();if(!Number.isFinite(Ve)||Fe.length<=Ve)return Fe;const Oe=new Map,Pe=Ye=>{!Ye||Oe.size>=Ve||Oe.set(Ye.index,Ye)},je=Be.value.length,$e=Vo(jo.start-2*ns.value,0,je),He=Vo(jo.end+2*ns.value,$e,je);for(const Ye of Fe)Ye.index>=$e&&Ye.index<He&&Pe(Ye);const Xe=Math.max(1,Math.ceil(Fe.length/Ve));for(let Ye=0;Ye<Fe.length&&Oe.size<Ve;Ye+=Xe)Pe(Fe[Ye]);for(let Ye=Fe.length-1;Ye>=0&&Oe.size<Ve;Ye-=Xe)Pe(Fe[Ye]);return Array.from(Oe.values()).sort((Ye,ct)=>Ye.index-ct.index).slice(0,Ve)})(bN().map(Fe=>{var Ve;const Oe=Be.value[Fe.index];return Oe?Ot(it({},Fe),{nodeType:String((Ve=Oe.type)!=null?Ve:""),signature:Ru(Fe.index)}):null}).filter(Fe=>!!Fe)):[],Le=RN({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Le||we.length||H.includeEmptyState===!0?Ot(it({sessionKey:_.sessionKey,threadKey:_.threadKey},Le?{anchor:Le.anchor,anchorCaptured:Le.captured}:{anchorCaptured:!1}),{metrics:_,width:_.width,contentHash:ce?R0():void 0,measurementKey:br()||void 0,heightCache:we.length?we:void 0}):null}function D0(_){var H,X;const J=Bu();if(!J)return;const ce=(function(Fe){const Ve=L.value;if(!Ve)return null;const Oe=be(Ve,Fe.root),Pe=Be.value.length,je=vt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Ve.offsetHeight||0),$e=Math.max(0,je>0?je:Pe>0?vt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Ve.scrollHeight||0):0),He=yx();return Oe+Math.max($e,He)})(J);if(ce==null)return;const we=Math.max(0,_.distanceFromBottomPx),Le=Math.max(0,ce-J.clientHeight-we);(function(Fe){d0=zu()+120,Lu=Fe})(Le),J.isViewportRoot?(X=(H=J.doc.defaultView)==null?void 0:H.scrollTo)==null||X.call(H,0,Le):W4(J.root,J.doc,Le,{isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:qe})}const P0=[];function bx(){if(P)for(Ql!=null&&(ge?.(Ql),Ql=null);P0.length;){const _=P0.pop();_!=null&&window.clearTimeout(_)}}function fc(_){const H=!!Ys.value;Ys.value=null,d0=0,Lu=null,bx(),H&&_&&Gn(_)}function hc(){if(!Ys.value||!P||Ql!=null)return;const _=()=>{Ql=null;const H=Ys.value;H&&D0(H)};Ql=Te?Te(_):null,Ql==null&&_()}function xx(_,H={}){const X=Be.value.length;return X<=0?[]:_.filter(J=>!(!Number.isInteger(J.index)||J.index<0||J.index>=X)&&!(!Number.isFinite(J.height)||J.height<=0)&&!(H.requireSignature&&!J.signature)&&!(H.requireCompatibilityMetadata&&!J.nodeType&&!J.signature)&&(function(ce){var we;const Le=Be.value[ce.index];return!(!Le||ce.nodeType&&ce.nodeType!==String((we=Le.type)!=null?we:"")||ce.signature&&ce.signature!==Ru(ce.index))})(J))}function wx(_){const H=pd(ea()),X=pd(_);return H!==-1&&X!==-1&&H===X}function H0(_){var H;const X=Number(_?.width);if(Number.isFinite(X)&&X>0)return X;const J=Number((H=_?.metrics)==null?void 0:H.width);return Number.isFinite(J)&&J>0?J:null}function _x(_){var H;return _.sessionKey===no()&&!!M0(_.threadKey)&&((H=_.measurementKey)!=null?H:"")===br()&&!!wx(H0(_))&&!!(function(X){const J=X.heightCache;return!!J?.length&&(Sx(X)?J.some(ce=>!!(ce.nodeType||ce.signature)):J.some(ce=>!!ce.signature))})(_)}function Sx(_){return!!(_.contentHash&&_.contentHash===R0())}function WN(_){return!Sx(_)}let oa=null,sa=null,ph=null,Du=null,Pu=null;function W0(_){var H;const X=_.map(ce=>{var we,Le;return[ce.index,Math.round(10*ce.height),(we=ce.nodeType)!=null?we:"",(Le=ce.signature)!=null?Le:""].join("")}).join(""),J=pd(ea());return[(H=bo())!=null?H:"",no(),br(),Be.value.length,J,_.length,F0(X)].join(":")}function Cx(_=(H=>(H=o.virtualScroll)==null?void 0:H.heightCache)()){if(!tn.value||!_?.length||Be.value.length<=0||!wx((H=o.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const X=xx(_,{requireSignature:!0});if(!X.length)return!1;const J=W0(X);return J===oa?(sa="standalone",!0):(Yb(X,{mode:"merge"}),fi(),oa=J,sa="standalone",qu(),Gn("restore"),!0)}function z0(_,H={}){var X,J,ce;if(!tn.value||!_||_.sessionKey!==no()||!M0(_.threadKey)||Be.value.length<=0)return!1;const we=!!((X=_.heightCache)!=null&&X.length)&&!mh(),Le=!_.anchor||_.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:_.anchor,Fe=H.restoreAnchor===!0&&!!Le&&!mh()&&Number(H0(_))>0;let Ve=!1;if((J=_.heightCache)!=null&&J.length&&_x(_)){const Pe=xx(_.heightCache,{requireCompatibilityMetadata:!_.contentHash,requireSignature:WN(_)});Pe.length&&(Yb(Pe,{mode:"merge"}),fi(),oa=W0(Pe),sa="restore",qu(),Ve=!0)}if(we||Fe)return!1;if(!H.restoreAnchor||!Le)return Ve&&Gn("restore"),!0;const Oe=(function(Pe,je){var $e;const He=Pe.anchor,Xe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=bo())!=null?$e:"",no(),br(),dh.value,je,Xe].join(":")})(_,(ce=H.restoreToken)!=null?ce:"imperative");return ph===Oe?(Ve&&Gn("restore"),!0):(ph=Oe,(function(Pe){const je=()=>{if(Pe.type==="node")return fc(),void zb({nodeIndex:Pe.nodeIndex,offsetWithinNodePx:Pe.offsetWithinNodePx});if(th(),oc.value=null,Ys.value=Pe,bx(),D0(Pe),P)for(const $e of[0,120,280,480])P0.push(window.setTimeout(()=>{const He=Ys.value;He&&D0(He)},$e))};(function($e){if(!zt.value)return!1;const He=Be.value.length;return!(He<=0||(yr.value=$e.type==="node"?Vo($e.nodeIndex,0,He-1):He-1,Fu(),0))})(Pe)?yt(je):je()})(Le),Gn("restore"),!0)}function mh(){const _=ea();return Number.isFinite(_)&&_>0}function Ax(_){var H;return _.sessionKey===no()&&!!M0(_.threadKey)&&(Be.value.length<=0||!(!((H=_.heightCache)!=null&&H.length)||mh())||!(!(_.anchor&&Number(H0(_))>0)||mh()))}function U0(){_t.clear();for(const _ of Object.keys(sc)){const H=Number(_);Number.isInteger(H)&&H>=0&&H<Be.value.length&&Vb(H)}}function Hu(){Xs!=null&&(ge?.(Xs),Xs=null),Q0()}function Mx(){return!P||ze?Promise.resolve():new Promise(_=>{let H=!1,X=null;const J=()=>{H||(H=!0,X!=null&&window.clearTimeout(X),_())};if(Te)return Te(J),void(X=window.setTimeout(J,50));X=window.setTimeout(J,0)})}function q0(_,H=bo(),X=Qs.value){return no()===_&&bo()===H&&Qs.value===X}function j0(){return Zn(this,arguments,function*(_={}){var H,X,J,ce,we;const Le=no(),Fe=bo(),Ve=Qs.value,Oe=(H=_.frames)!=null?H:2,Pe=(X=_.timeoutMs)!=null?X:120,je=(J=_.reason)!=null?J:"manual",$e=_.expectedSettledTokenKey,He=_.flushPendingTimers===!0,Xe=ta(je),Ye=()=>Ot(it({},Xe),{phase:Xe.final?"settling":Xe.phase,stable:!1,confidence:Xe.confidence==="final"?"mixed":Xe.confidence,reason:je}),ct=()=>q0(Le,Fe,Ve)&&($e==null||Uu()===$e);for(let Mt=0;Mt<Oe;Mt++){if(yield yt(),!ct()||(yield Mx(),!ct()))return Ye();xr(),Hu()}if(yield(function(Mt){return!P||Mt<=0?Promise.resolve():new Promise(Ct=>window.setTimeout(Ct,Mt))})(Pe),!ct()||(He&&nx(),xr(),Hu(),!ct()))return Ye();const st=L0();st&&(I0=Le,N0=Fe,((ce=o.virtualScroll)==null?void 0:ce.settleMode)==="manual"&&$e!=null&&fh((we=o.virtualScroll)==null?void 0:we.settledToken)&&Uu()===$e&&(uc=Yu(o.virtualScroll.settledToken)));const pt=ct()&&st&&vx(),kt=ta(je,pt?"final":void 0);return Z0(kt,!0),kt})}let V0="content",ia=null,ra=null,K0=0,Wu=null,pc=null,G0=null,Y0=null;function zu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Ex(_){var H,X;const J=Wu;if(!J)return!0;const ce=(X=(H=o.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?X:1;return Math.abs(_.totalHeight-J.totalHeight)>ce||_.sessionKey!==J.sessionKey||_.phase!==J.phase||_.stable!==J.stable||_.final!==J.final||_.threadKey!==J.threadKey||_.nodeCount!==J.nodeCount||_.measuredCount!==J.measuredCount||_.width!==J.width}function Uu(_=(H=>(H=o.virtualScroll)==null?void 0:H.settledToken)()){return Do(_)}function Tx(_,H){var X,J;return[_,H.sessionKey,(X=H.threadKey)!=null?X:"",br(),R0(),Do((J=o.virtualScroll)==null?void 0:J.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function qu(){G0=null,Y0=null,pc=null}function zN(_){const H=_.heightCache;return H?.length?W0(H):""}function ju(_){var H,X,J;const ce=_.metrics,we=_.anchor?(Le=_.anchor).type==="bottom"?`bottom:${Math.round(Le.distanceFromBottomPx)}`:`node:${Le.nodeIndex}:${Math.round(Le.offsetWithinNodePx)}`:"none";var Le;return[_.sessionKey,(H=_.threadKey)!=null?H:"",(X=_.measurementKey)!=null?X:br(),(J=_.contentHash)!=null?J:"",zN(_),we,_.anchorCaptured?1:0,ce.liveRange.start,ce.liveRange.end,ce.renderedCount,ce.nodeCount,Math.round(ce.totalHeight),Math.round(ce.width),ce.phase,ce.stable?1:0].join("\0")}function Z0(_,H=!1){if(!tn.value||(function(Le=!1){return!Le&&qo.value&&!qs.value})(H))return;const X=H||Ex(_),J=(function(Le,Fe=!1){return Fe||Le.stable||Le.phase==="final"?{state:dc(Le,{includeHeightCache:!0})}:{state:dc(Le)}})(_,H),ce=J.state,we=!!(ce&&(X||(function(Le,Fe=!1){return!!Fe||ju(Le)!==pc})(ce,H)));if(X&&(B(_),Wu=_,K0=zu()),ce&&we&&(W(ce),ce.anchor&&z(ce.anchor),pc=ju(ce)),_.stable){const Le=Tx("settled",_);if(Le!==G0){G0=Le;const Fe=dc(_,{includeHeightCache:!0});Fe&&(W(Fe),pc=ju(Fe)),(function(Ve){s("render-settled",Ve)})(_)}}if(_.phase==="final"){const Le=Tx("final",_);if(Le!==Y0){Y0=Le;const Fe=dc(_,{includeHeightCache:!0});Fe&&(W(Fe),pc=ju(Fe)),(function(Ve){s("render-final",Ve)})(_)}}}function X0(){ia!=null&&(ge?.(ia),ia=null),ra!=null&&P&&(window.clearTimeout(ra),ra=null)}function Nx(){ia=null,ra=null,(function(_){if(kr.size>0||Xs!=null)return!0;switch(_){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(V0)&&(xr(),Hu()),Z0(ta(V0))}function Gn(_){var H,X;if(!tn.value||(V0=_,ia!=null||ra!=null))return;const J=Math.max(0,(X=(H=o.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?X:32),ce=Math.max(0,J-(zu()-K0)),we=()=>{ra=null,ia=Te?Te(Nx):null,ia==null&&Nx()};P&&ce>0?ra=window.setTimeout(we,ce):we()}function Ix(){Hb.value+=1}function gh(_){if(us.value&&_>=te.value){const H=Be.value[_],X=tt.value===!0&&lt.value!==!0&&_>=Be.value.length-2,J=H?.type==="code_block"||H?.type==="image"||H?.type==="mermaid"||H?.type==="infographic";if(!X||J)return!1}return!Zi.value||_<wn.value||k0.value.has(_)}function mc(_){const H=ah.get(_);H&&(H(),ah.delete(_));const X=rc.get(_);X&&(X.destroy(),rc.delete(_)),ch(_)}function vh(_,H){let X=!1;if(H){const we=cn.get(_);cn.set(_,H),we!==H&&(X=!0)}else cn.delete(_)&&(X=!0);if(X&&Ix(),H||ch(_),!Zb.value||!le)return mc(_),void(H&&Zi.value&&ol(_,!0));if(!zt.value&&Zi.value&&!q.value&&rc.size>=re.value&&(q.value||(q.value=!0,b0()),!Zb.value||!le))return mc(_),void(H&&ol(_,!0));if(_<wn.value&&!zt.value||k0.value.has(_))return mc(_),void ol(_,!0);if(!H)return void mc(_);mc(_);const J=le(H,{rootMargin:Ae.value});if(!J)return;rc.set(_,J),ol(_,J.isVisible.value),Zi.value&&(function(we){if(!P||!Zi.value)return;ch(we);const Le=we%17*23,Fe=window.setTimeout(()=>{if(ox.delete(we),!Zi.value||k0.value.has(we))return;const Ve=cn.get(we);if(!Ve)return;const Oe=ke(Ve),Pe=Ve.ownerDocument||document,je=Pe.defaultView||window,$e=!Oe||Oe===Pe.documentElement||Oe===Pe.body,He=!$e&&Oe?vt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Oe.getBoundingClientRect()):null,Xe=$e?0:He.top,Ye=$e?vt("nodeVisibilityFallback.clientHeight",()=>{var st,pt;return(pt=(st=je.innerHeight)!=null?st:Oe?.clientHeight)!=null?pt:0}):He.bottom,ct=vt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Ve.getBoundingClientRect());ct.bottom>=Xe-500&&ct.top<=Ye+500&&ol(we,!0)},1800+Le);ox.set(we,Fe)})(_);let ce=null;ce=et(()=>J.isVisible.value,we=>{if(we){ch(_),ol(_,!0),ce?.(),ah.delete(_),rc.get(_)===J&&rc.delete(_);try{J.destroy()}catch{}}},{immediate:!0}),ah.set(_,ce),zt.value&&Li()}function Q0(){Xs=null,ic(()=>{let _=!1;for(const[H,X]of kr)kr.delete(H),Xi.get(H)===X.el&&Jl.get(H)===X.version&&(_=Kb(H,X.height,{allowShrink:X.allowShrink})||_);return _})}function gc(){Xs!=null&&(ge?.(Xs),Xs=null),kr.clear()}function yh(_,H){(function(X,J,ce){var we;if(!Number.isFinite(ce)||ce<=0||Xi.get(X)!==J)return;const Le=Jl.get(X);if(Le==null)return;const Fe=Be.value[X],Ve=mt.value&&lt.value!==!0&&!((we=o.nodes)!=null&&we.length)&&X>=Be.value.length-2,Oe=!(Fe?.loading===!0||Ve),Pe=kr.get(X),je=Pe?Pe.allowShrink&&Oe:Oe,$e=Pe&&!je?Math.max(Pe.height,ce):ce;kr.set(X,{height:$e,allowShrink:je,version:Le,el:J}),Xs==null&&(Xs=Te?Te(Q0):null,Xs==null&&Q0())})(_,H,Gb(_,H))}function xr(){for(const[_,H]of Xi)H&&yh(_,H)}function Lx(){co?.disconnect(),co=null,Vt.clear()}function J0(){for(;sh.length;)lh(sh.pop())}et(qs,_=>{_&&Gn("content")},{flush:"post"}),t({getVirtualMetrics:ta,captureVirtualState:function(_={}){var H;return dc(ta("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:_.allowFallbackAnchor===!0,requireViewport:_.requireViewport===!0,includeEmptyState:(H=_.includeEmptyState)==null||H})},restoreVirtualState:function(_,H={}){const X=H.restoreAnchor===!0,J=H.restoreToken==null?"imperative":String(H.restoreToken);Du=_,Pu={restoreAnchor:X,restoreToken:J,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!z0(_,{restoreAnchor:X,restoreToken:J,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&Ax(_)||(Du=null,Pu=null)},forceMeasure:function(_="manual"){return Zn(this,null,function*(){yield yt(),yield Mx(),xr(),Hu(),yield yt();const H=ta(_);return Z0(H,!0),H})},settle:j0,scrollToNode:function(_,H="start"){fc(),th();const X=Be.value.length;if(X<=0)return;const J=Vo(_,0,X-1),ce=()=>{var we;const Le=fN({nodeIndex:J,offsetWithinNodePx:0}),Fe=f0(J),Ve=Bu(),Oe=(we=Ve?.clientHeight)!=null?we:0,Pe=uN();let je=Le;if(H==="center")je=Le-Oe/2+Fe/2;else if(H==="end")je=Le-Oe+Fe;else if(H==="nearest"&&Pe!=null){if(Le>=Pe&&Le+Fe<=Pe+Oe)return;je=Le<Pe?Le:Le-Oe+Fe}dN(Math.max(0,je)),Li({immediate:!0}),zt.value&&(yr.value=J,Fu())};if(zt.value)return yr.value=J,Fu(),void yt(ce);ce()}}),et(()=>Ms.value,_=>{if(!_){Lx();for(const H of tl.values())for(const X of H)lh(X);tl.clear(),Jl.clear(),J0(),gc()}},{immediate:!0}),et(lt,_=>{_&&(function(){if(P&&lt.value&&Xi.size){J0();for(const H of[80,240,640]){const X=tx(H,()=>{for(const[J,ce]of Xi)ce&&yh(J,ce)},"final");X!=null&&sh.push(X)}}})(),Gn(_?"final":"content")});const UN=z4(()=>Gn("content"),16),qN=z4(()=>Gn("batch"),16);et([()=>Be.value.length,()=>te.value],()=>{Ys.value&&hc(),UN()},{flush:"post",immediate:!0}),et([()=>jo.start,()=>jo.end],()=>{qN()},{flush:"post"});const{cleanupBatchScheduler:jN}=(function(_){const{props:H,isClient:X,isTestEnv:J,parsedNodesIdentity:ce,parsedNodeCount:we,desiredRenderedCount:Le,datasetKey:Fe,batchingEnabled:Ve,incrementalRenderingActive:Oe,resolvedBatchSize:Pe,resolvedInitialBatch:je,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Xe,previousBatchConfig:Ye,requestFrame:ct,cancelFrame:st,hasIdleCallback:pt,cleanupNodeVisibility:kt,onDatasetKeyChanged:Mt,onDatasetChanged:Ct}=_;let Et=null,qt="raf",Xt=null,In=0,Ko=!1,Ro=!1;const $i=new Set,Ji=new Set;function ed(){if(X){Et!=null&&(qt==="raf"&&st?st(Et):qt==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Et):qt==="timeout"&&window.clearTimeout(Et),Et=null),In+=1;for(const os of $i)st&&st(os);for(const os of Ji)window.clearTimeout(os);$i.clear(),Ji.clear(),Xt=null,Ko=!1,Ro=!1}}function Mh(){return typeof performance<"u"?performance.now():Date.now()}function Zx(os){(function(wr){var il;if(!Oe.value)return;const _r=Math.max(2,(il=H.renderBatchBudgetMs)!=null?il:6),Sr=Math.max(1,Pe.value||1),Fi=Math.max(1,Math.floor(Sr/4));wr>1.5*_r?He.value=Math.max(Fi,Math.floor(.8*He.value)):wr<.6*_r&&He.value<Sr&&(He.value=Math.min(Sr,Math.ceil(1.2*He.value)))})(os),Ko=!1;const Ts=Ro||$e.value<Le.value;Ro=!1,Ts&&Jx()}function Xx(os,Ts={}){var wr,il;if(!Oe.value)return;const _r=Le.value;if($e.value>=_r)return;const Sr=Math.max(1,os),Fi=()=>{const kc=Mh();Et=null;const td=Xt??Sr;Xt=null;const bc=Mh();$e.value=Math.min(_r,$e.value+td),kt($e.value),(function(rg,Eh){if(!X)return void Zx(Eh);Ko=!0;const ew=++In;yt().then(()=>{var tw;if(ew!==In)return;const f9=Mh(),h9=Math.max(Eh,f9-rg),nw=()=>{ew===In&&Zx(h9)};if(ct){let aa=null,xc=null,sw=!1;const iw=()=>{sw||(sw=!0,aa!==null&&($i.delete(aa),aa=null),xc!==null&&(Ji.delete(xc),window.clearTimeout(xc),xc=null),nw())};return aa=ct(()=>{iw()}),$i.add(aa),xc=window.setTimeout(()=>{aa!==null&&st&&st(aa),iw()},Math.max(32,(tw=H.renderBatchIdleTimeoutMs)!=null?tw:120)),void Ji.add(xc)}const ow=window.setTimeout(()=>{Ji.delete(ow),nw()},0);Ji.add(ow)})})(kc,Mh()-bc)};if(!X||Ts.immediate)return void Fi();const rl=Math.max(0,(wr=H.renderBatchDelay)!=null?wr:16);if(Xt=Xt!=null?Math.max(Xt,Sr):Sr,Et==null){if(!J&&pt&&window.requestIdleCallback){const kc=Math.max(0,(il=H.renderBatchIdleTimeoutMs)!=null?il:120);return qt="idle",void(Et=window.requestIdleCallback(()=>Fi(),{timeout:kc}))}if(ct&&!J)return qt="raf",void(Et=ct(()=>{rl===0?Fi():(qt="timeout",Et=window.setTimeout(()=>Fi(),rl))}));qt="timeout",Et=window.setTimeout(()=>Fi(),rl)}}function Qx(os,Ts={}){Ko?Ro=!0:os==null?Jx():Xx(os,Ts)}function Jx(){Oe.value&&Xx(Ve.value?Math.max(1,Math.round(He.value)):Math.max(1,Pe.value))}return et([ce,we,Fe,Oe,Pe,je,()=>H.renderBatchDelay],()=>{var os;const Ts=we.value,wr=Xe.value,il=Fe.value,_r=!Object.is(il,wr.key),Sr=Ts!==wr.total,Fi=_r||Sr;Xe.value={key:il,total:Ts};const rl=Ye.value,kc=(os=H.renderBatchDelay)!=null?os:16,td=rl.batchSize!==Pe.value||rl.initial!==je.value||rl.delay!==kc||rl.enabled!==Oe.value;Ye.value={batchSize:Pe.value,initial:je.value,delay:kc,enabled:Oe.value},_r&&Mt(Ts),(Fi||td||!Oe.value)&&ed(),(Fi||td)&&(He.value=Math.max(1,Pe.value||1)),Fi&&Ct();const bc=Le.value;if(!Ts)return $e.value=0,void kt(0);if(!Oe.value)return $e.value=bc,void kt($e.value);const rg=_r||wr.total===0;$e.value=rg||td?Math.min(bc,je.value):Math.min($e.value,bc);const Eh=Math.max(1,je.value||Pe.value||Ts);$e.value<bc?Qx(Eh,{immediate:!X}):kt($e.value)},{immediate:!0}),et(Le,(os,Ts)=>{Oe.value&&(typeof Ts=="number"&&os<=Ts||os>$e.value&&Qx())}),{cleanupBatchScheduler:ed}})({props:S,isClient:P,isTestEnv:ze,parsedNodesIdentity:xn,parsedNodeCount:nn,desiredRenderedCount:ih,datasetKey:FN,batchingEnabled:go,incrementalRenderingActive:us,resolvedBatchSize:Ut,resolvedInitialBatch:wn,renderedCount:te,adaptiveBatchSize:Me,previousRenderContext:Ce,previousBatchConfig:De,requestFrame:Te,cancelFrame:ge,hasIdleCallback:Ee,cleanupNodeVisibility:EN,onDatasetKeyChanged:_=>{gc(),oh(),fi(),qu(),_>0&&nh(_)},onDatasetChanged:()=>{zt.value&&Li({immediate:!0})}});et([Xb,zt,()=>L.value,()=>Y()],([_,H])=>{if(!_)return sx(),void y0();TN(),H?Li({immediate:!0}):y0()},{flush:"post",immediate:!0}),et([()=>Be.value.length,()=>zt.value],_=>Zn(null,[_],function*([H,X]){X&&H&&P&&(yield yt(),Li({immediate:!0}))}),{flush:"post"}),et(io,_=>{_&&(function(){var H;if(Vn.value&&Kn.value&&Jn.value&&((H=Oo.value)!=null&&H[1]))return;const X=gt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),J=gt({type:"list_item",children:[X],raw:"- Probe paragraph text"}),ce=gt({type:"list",ordered:!1,items:[J],raw:"- Probe paragraph text"});Vn.value=X,Kn.value=J,Jn.value=ce;const we={1:null,2:null,3:null,4:null,5:null,6:null};for(let Le=1;Le<=6;Le++)we[Le]=gt({type:"heading",level:Le,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Le)} Probe heading`});Oo.value=we})()},{immediate:!0}),et([()=>L.value,io],()=>{if(!io.value)return _0(),void(ne.value=0);rx(),_0(),io.value&&L.value&&typeof ResizeObserver<"u"&&(Ou=new ResizeObserver(()=>{rx(),oc.value&&$u(),Ys.value&&hc(),Gn("resize")}),Ou.observe(L.value))},{immediate:!0}),et([io,ui,Qs],()=>Zn(null,null,function*(){if(!io.value)return j.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void fi();yield yt(),(function(){if(!io.value||typeof window>"u")return j.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void fi();const _={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=ix(w0(O.value),".paragraph-node");_.paragraph=yv(O.value,H,"pre-wrap");const X=w0(U.value),J=X?.querySelector(".paragraph-node");_.listItem=yv(U.value,J,"pre-wrap");const ce=vt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Le,Fe;return(Fe=(Le=Z.value)==null?void 0:Le.offsetHeight)!=null?Fe:0}),we=vt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Le,Fe;return(Fe=(Le=U.value)==null?void 0:Le.offsetHeight)!=null?Fe:0});_.listWrapperOverhead=Math.max(0,ce-we);for(let Le=1;Le<=6;Le++){const Fe=ix(w0(ie[Le]),`h${Le}`);_.headings[Le]=yv(ie[Le],Fe,"pre-wrap")}j.value=_,fi()})()}),{flush:"post",immediate:!0}),et(()=>Be.value.length,()=>{zt.value&&Li({immediate:!0})}),et([io,ne],()=>{fi(),zt.value&&Li({immediate:!0}),oc.value&&$u(),Ys.value&&hc(),Gn("resize")},{immediate:!1}),et(()=>Zi.value,_=>{if(_)for(const[H,X]of cn)vh(H,X);else if(b0(),zt.value)Li({immediate:!0});else for(const[H,X]of cn)X&&ol(H,!0)},{immediate:!1}),et([Ae,re,()=>Y()],()=>{var _;(_=le.refresh)==null||_.call(le);for(const[H,X]of cn)vh(H,X)},{immediate:!1}),et([()=>S.viewportPriority,()=>Be.value.length,re],([_,H,X])=>{if(_!==!1){if(q.value&&(H<=200||H<=X)){q.value=!1;for(const[J,ce]of cn)vh(J,ce)}}else q.value=!1}),et(()=>te.value,()=>{zt.value&&Li({immediate:!0})}),et([yr,ts,ns,()=>Be.value.length,zt],()=>{Fu()},{immediate:!0});let Vu=null,Ku=!1,vc=null;function Gu(){Vu=null,I0=null,N0=void 0,uc=null,qu()}function eg(){gc(),oh(),fi(),_t.clear();const _=Be.value.length;_>0&&nh(_),U0()}function tg(){X0(),nx(),Wu=null,oa=null,sa=null,ph=null,Du=null,Pu=null,Ku=!1,Gu(),mx("restore"),th(),fc()}function Yu(_){var H;return[(H=bo())!=null?H:"",no(),br(),dh.value,Uu(_),Be.value.length,Math.round(nc(0,Be.value.length)),Math.round(ea()),hi.count,Math.round(hi.total)].join(":")}function $x(){return Zn(this,null,function*(){var _,H,X,J;const ce=(_=o.virtualScroll)==null?void 0:_.settledToken,we=Uu(ce),Le=no(),Fe=bo(),Ve=Qs.value;if(tn.value&&((H=o.virtualScroll)==null?void 0:H.settleMode)==="manual"&&fh(ce))if(L0()){if(Yu(ce)!==uc&&!Ku){Ku=!0;try{const Oe=yield j0({reason:"manual",expectedSettledTokenKey:we}),Pe=Uu()===we;q0(Le,Fe,Ve)&&Oe.sessionKey===Le&&Oe.threadKey===Fe&&Pe&&Oe.stable&&Oe.phase==="final"&&(uc=Yu((X=o.virtualScroll)==null?void 0:X.settledToken))}finally{Ku=!1,yield yt();const Oe=(J=o.virtualScroll)==null?void 0:J.settledToken,Pe=fh(Oe)?Yu(Oe):"";q0(Le,Fe,Ve)&&Pe&&uc!==Pe&&$x()}}}else Gn("manual")})}et(tn,(_,H)=>{if(_!==H){if(!_)return tg(),void X0();tg(),eg(),vc=Qs.value,Gn("content")}},{flush:"post"}),et([tn,Qs],([_,H])=>{_?vc!=null?vc!==H&&(vc=H,(function(X="resize"){gc(),oh(),fi(),_t.clear();const J=Be.value.length;J>0&&nh(J),U0(),oa=null,sa=null,ph=null,Wu=null,Ku=!1,Gu(),Cx(),yt(()=>{xr(),oc.value&&$u(),Ys.value&&hc(),Gn(X)})})("resize")):vc=H:vc=null},{flush:"post",immediate:!0}),et([tn,()=>no(),()=>bo()],([_])=>{_&&(tg(),eg(),mx("content"),Gn("content"))}),et([tn,()=>no(),()=>bo(),Qs,()=>Be.value.length],([_])=>{_&&(function(H="async-node"){let X=!1;for(const[J,ce]of Array.from(Qi.entries()))E0(ce)||(Qi.delete(J),Zs.delete(J),X=!0);X&&(ac(),Gn(H))})("async-node")},{flush:"post"}),et([tn,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.sessionKey},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey},()=>o.indexKey,()=>fe.value],([_])=>{_&&(qu(),(function(H="content"){if(!tn.value)return;const X=[],J=Be.value.length,ce=x0(J);for(const we of Array.from(_t.keys())){if(we>=J){X.push(we);continue}if(we<ce)continue;const Le=Ru(we),Fe=_t.get(we);Fe!=null&&Fe!==Le&&X.push(we),_t.set(we,Le)}for(const we of Array.from(_t.keys()))we>=J&&_t.delete(we);X.length&&((function(we,Le={}){const Fe=Array.from(we,Number);jb(Fe);let Ve=0;if(ic(()=>(Ve=kN(Fe,Le),Ve>0)),Ve>0)(function(Oe){for(const Pe of Oe)_t.delete(Pe)})(Fe);else for(const Oe of Fe)Gs.delete(Oe)})(X,{notify:!1}),fi(),Gu(),oc.value&&$u(),Ys.value&&hc(),Gn(H))})("content"))},{flush:"post",immediate:!0}),et([tn,()=>Be.value.length,()=>no(),()=>bo()],([_,H,X,J],[ce,we,Le,Fe])=>{_&&ce&&X===Le&&J===Fe&&H!==we&&Gu()},{flush:"post"}),et([tn,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.heightCache},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.heightCacheWidth},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreState},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey},()=>Be.value.length,()=>no(),ne],()=>{Cx()},{flush:"post",immediate:!0}),et([tn,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreState},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreAnchor},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey},()=>Be.value.length,()=>no(),ne],_=>Zn(null,[_],function*([H,X]){if(!H||!X)return;yield yt();const J=(function(){var ce;const we=(ce=o.virtualScroll)==null?void 0:ce.restoreAnchor;return we==null||we===!1?null:we===!0?"true":String(we)})();z0(X,{restoreAnchor:J!=null,restoreToken:J??void 0})}),{flush:"post",immediate:!0}),et([tn,ne,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreState},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey}],([_])=>{var H;if(!_)return;const X=(H=o.virtualScroll)==null?void 0:H.restoreState;X&&oa&&sa==="restore"&&(_x(X)||(eg(),oa=null,sa=null,Gn("resize")))},{flush:"post"}),et([tn,()=>Be.value.length,()=>no(),ne],_=>Zn(null,[_],function*([H]){var X;const J=Du,ce=Pu;H&&J&&(yield yt(),!z0(J,{restoreAnchor:ce?.restoreAnchor===!0,restoreToken:(X=ce?.restoreToken)!=null?X:"imperative",allowUncapturedAnchor:ce?.allowUncapturedAnchor===!0})&&Ax(J)||(Du=null,Pu=null))}),{flush:"post",immediate:!0}),et([tn,lt,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.settleMode},()=>no(),()=>bo(),Qs,v0,Jb,()=>te.value,ih,()=>hi.count,()=>hi.total],([_,H,X])=>{if(!_||H!==!0||X==="manual"||!$0())return;const J=(function(){var ce;const we=Be.value.length;return[(ce=bo())!=null?ce:"",no(),br(),dh.value,we,Math.round(nc(0,we)),Math.round(ea()),hi.count,Math.round(hi.total)].join(":")})();Vu!==J&&(Vu=J,j0({reason:"final"}).then(ce=>{ce.stable||Vu!==J||(Vu=null)}))},{flush:"post",immediate:!0}),et([tn,lt,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.settleMode},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.settledToken},()=>no(),()=>bo(),Qs,v0,Jb,()=>te.value,ih,()=>Be.value.length,()=>hi.count,()=>hi.total],()=>{$x()},{flush:"post",immediate:!0}),et([()=>Be.value.length,zt,ts,ns,()=>jo.start,()=>jo.end],([_,H,X,J,ce,we])=>{me.value&&pn("virtualization",{nodes:_,virtualization:H,maxLiveNodes:X,buffer:J,focusIndex:yr.value,scroll:H?(()=>{const Le=Iu.value||ke();return Le?{reverse:Ne(Le),scrollTop:Math.round(Le.scrollTop),scrollTopAbs:Math.round(Math.abs(Le.scrollTop)),scrollHeight:Math.round(Le.scrollHeight),clientHeight:Math.round(Le.clientHeight)}:null})():null,liveRange:{start:ce,end:we},rendered:te.value})}),et([()=>S.customId],([_],H,X)=>{if(!_||ko)return;const J=(function(ce,we){return ce?(Io.controllers[ce]=we,()=>{Io.controllers[ce]===we&&delete Io.controllers[ce]}):()=>{}})(_,{captureRestoreAnchor:Wb,restoreAnchor:zb,getAnchorDrift:hN,getReport:LN});X(()=>{J()})},{immediate:!0}),ho(()=>{(function(){if(tn.value)try{xr(),Hu();const _=ta("manual");Ex(_)&&(B(_),Wu=_,K0=zu());const H=dc(_,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(W(H),H.anchor&&z(H.anchor),pc=ju(H))}catch{}})(),jN(),b0(),Pt(),Lx();for(const _ of tl.values())for(const H of _)lh(H);tl.clear(),Jl.clear(),_t.clear(),J0(),gc(),_0(),th(),fc(),X0(),sx(),y0()});const VN=Md("ViewportDeferredMermaidBlockNode",Hi({loader:()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./index11-Jj0EtwVs.js"),__vite__mapDeps([7,5]))).default}catch(_){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".',_),Fs}}),loadingComponent:n3,delay:0}),n3),KN=Md("ViewportDeferredInfographicBlockNode",Hi({loader:()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./index10-pQAlOV_D.js"),[])).default}catch(_){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.',_),Fs}}),loadingComponent:t3,delay:0}),t3),GN=Md("ViewportDeferredD2BlockNode",Hi(()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./index8-B7--CG9b.js"),[])).default}catch(_){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".',_),Fs}})),Fs),Fx={text:mo,paragraph:Ha,heading:Z1,code_block:av,list:fu,list_item:du,blockquote:Dp,table:Xd,definition_list:Pp,footnote:Hp,footnote_reference:ni,footnote_anchor:Yd,admonition:qp,vmr_container:zp,hardbreak:Ol,link:_s,image:Fl,thematic_break:Wp,math_inline:Gi,math_block:wE,strong:xs,emphasis:Ss,strikethrough:ws,highlight:si,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,checkbox:ti,checkbox_input:ti,inline_code:as,html_inline:oi,reference:bs,html_block:Zd},YN=D(()=>A0()),Ox=D(()=>H4(S.codeBlockProps)),ZN=D(()=>H4(S.codeBlockProps,{omit:["langs"]})),Bx=D(()=>it(it({stream:S.codeBlockStream,darkTheme:S.codeBlockDarkTheme,lightTheme:S.codeBlockLightTheme,monacoOptions:S.codeBlockMonacoOptions,themes:S.themes,langs:p.value==="shiki"?S.langs:void 0,minWidth:S.codeBlockMinWidth,maxWidth:S.codeBlockMaxWidth},typeof ye.value=="boolean"?{showTooltips:ye.value}:{}),ZN.value)),Rx=D(()=>it(Ot(it({},Bx.value),{langs:S.langs}),Ox.value));function Dx(_){return typeof _=="boolean"?_:void 0}const XN=D(()=>{const _=S.codeBlockProps||{},H={},X=Dx(_.showLineNumbers);X!==void 0&&(H.showLineNumbers=X);const J=Dx(_.diffInline);J!==void 0&&(H.diffInline=J);const ce=(function(we){const Le=Number(we);return Number.isFinite(Le)&&Le>0?Le:void 0})(_.reservedHeightPx);return ce!==void 0&&(H.reservedHeightPx=ce),H}),QN=D(()=>it(it({stream:S.codeBlockStream,darkTheme:S.codeBlockDarkTheme,lightTheme:S.codeBlockLightTheme,themes:S.themes,langs:S.langs,minWidth:S.codeBlockMinWidth,maxWidth:S.codeBlockMaxWidth},typeof ye.value=="boolean"?{showTooltips:ye.value}:{}),Ox.value)),JN=D(()=>it({},S.mermaidProps||{})),Px=D(()=>it({},S.d2Props||{})),e9=D(()=>it({},S.infographicProps||{})),Zu=D(()=>({typewriter:f.value,fade:S.fade,customHtmlTags:nt.value.customHtmlTags})),t9=D(()=>it(it({},Zu.value),typeof ye.value=="boolean"?{showTooltip:ye.value}:{})),n9=D(()=>it(it({},Zu.value),typeof ye.value=="boolean"?{showTooltips:ye.value}:{})),o9=D(()=>it(it({},Zu.value),typeof ye.value=="boolean"?{showTooltips:ye.value}:{})),s9=D(()=>it(it({},Zu.value),typeof ye.value=="boolean"?{showTooltips:ye.value}:{}));function i9(_){return Array.isArray(_.children)&&_.children.length>0}const kh=D(()=>IN.value.map(_=>{var H,X,J,ce,we,Le,Fe,Ve;let Oe=(function(st){var pt,kt,Mt,Ct,Et,qt,Xt;if(st.type!=="code_block")return st;const In=st,Ko=[String((pt=In.language)!=null?pt:""),String((kt=In.loading)!=null?kt:""),String((Mt=In.diff)!=null?Mt:""),String((Ct=In.code)!=null?Ct:""),String((Et=In.originalCode)!=null?Et:""),String((qt=In.updatedCode)!=null?qt:""),String((Xt=In.raw)!=null?Xt:"")].join("\0"),Ro=Nt.get(In);if(Ro&&Ro.signature===Ko)return Ro.node;const $i=it({},In);return Nt.set(In,{signature:Ko,node:$i}),$i})(_.node);const Pe=bh(Oe);let je=Ux(Oe,Pe);if((Oe.type==="html_block"||Oe.type==="html_inline")&&je===Fx[Oe.type]){const st=Oe,pt=String((H=st.tag)!=null?H:"").trim().toLowerCase()||Y5(st.content);if(pt){const kt=sn.value[pt];if(es.value.has(pt)&&kt)je=kt,Oe=Ot(it({},st),{type:pt,tag:pt,content:FY(st.content,pt)});else if(Z5((X=st.content)!=null?X:st.raw,pt)){const Mt=String((ce=(J=st.content)!=null?J:st.raw)!=null?ce:"");Oe.type==="html_inline"?(je=mo,Oe={type:"text",content:Mt,raw:Mt}):(je=Ha,Oe={type:"paragraph",children:[{type:"text",content:Mt,raw:Mt}],raw:Mt})}}}const $e=Oe.type==="code_block"&&p.value==="pre"&&je===Fs&&!ng(sn.value,Pe);let He=it({},(function(st,pt,kt){const Mt=pt??bh(st);if(st.type==="code_block"){const Ct=Mt?ng(sn.value,Mt):void 0;if(kt&&p.value==="pre"&&!Ct&&kt===Fs)return XN.value;if(kt&&Mt&&kt===Ct)return Mt==="mermaid"?Wx(st):Mt==="infographic"?zx(st):Mt==="d2"||Mt==="d2lang"?Px.value:Rx.value;if(kt&&kt===sn.value.code_block)return Rx.value;if(ax(kt))return QN.value}return Mt==="mermaid"?Wx(st):Mt==="infographic"?zx(st):Mt==="d2"||Mt==="d2lang"?Px.value:st.type==="link"?t9.value:st.type==="list"?n9.value:st.type==="blockquote"?o9.value:st.type==="table"?s9.value:st.type==="code_block"?Bx.value:Zu.value})(Oe,Pe,je));const Xe=io.value?lc.value[_.index]:null;Oe.type==="code_block"&&Xe?.kind==="code-block"&&(He=Ot(it({},He),$e?{reservedHeightPx:(we=Xe.height)!=null?we:Xe.contentHeight}:{estimatedHeightPx:Xe.height,estimatedContentHeightPx:Xe.contentHeight,estimatedDiffInline:Xe.diffInline})),$e||Oe.type!=="code_block"||Pe!=="mermaid"||Gc(He.estimatedPreviewHeightPx)!=null||(He=Ot(it({},He),{estimatedPreviewHeightPx:Bm(Fm(String((Le=Oe.code)!=null?Le:"")))})),$e||Oe.type!=="code_block"||Pe!=="infographic"||Gc(He.estimatedPreviewHeightPx)!=null||(He=Ot(it({},He),{estimatedPreviewHeightPx:Rm(Om(String((Fe=Oe.code)!=null?Fe:"")))})),Oe.type==="math_block"&&(He=Ot(it({},He),{cacheScope:Qn}));const Ye=(function(st,pt){const kt=String(st.type);return!Kf(kt)&&sn.value[kt]===pt})(Oe,je),ct=Ye?H2(Oe,de.value):void 0;return Ot(it({},_),{node:Oe,component:je,bindings:He,customBindings:it(it({},ct??{}),He),rendersCustomNode:Ye,hasSlotChildren:i9(Oe),slotContent:String((Ve=Oe.content)!=null?Ve:""),isCodeBlock:Oe.type==="code_block",indexKey:`${YN.value}-${_.index}`,vnodeKey:`${$N.value}\0${_.index}\0${Oe.type}`})}));function bh(_){var H;return _?.type==="code_block"?String((H=_.language)!=null?H:"").trim().toLowerCase():""}function ng(_,H){const X=H.trim().toLowerCase();if(X)for(const J of[X,K1(X),oE(X)]){const ce=J&&_[J];if(ce)return ce}}function Hx(_,H,X,J){var ce,we;const Le=it({},_.value);return Gc(Le.estimatedPreviewHeightPx)==null&&(Le.estimatedPreviewHeightPx=J(X(String((ce=H?.code)!=null?ce:"")),void 0,Le.maxHeight==="none"?null:(we=Gc(Le.maxHeight))!=null?we:void 0)),Le}function Wx(_){return Hx(JN,_,Fm,Bm)}function zx(_){return Hx(e9,_,Om,Rm)}function Ux(_,H){if(!_)return Qy;const X=sn.value,J=X[String(_.type)];if(_.type==="code_block"){const ce=H??bh(_),we=ce?ng(X,ce):void 0;return we||(p.value==="pre"?X.code_block||Fs:ce==="mermaid"?X.mermaid||VN:ce==="infographic"?X.infographic||KN:ce==="d2"||ce==="d2lang"?X.d2||GN:J||X.code_block||cx.value)}return J||Fx[String(_.type)]||Qy}function og(_){s("click",_)}function r9(_){var H;(H=_.target)!=null&&H.closest("[data-node-index]")&&s("mouseover",_)}function l9(_){var H;(H=_.target)!=null&&H.closest("[data-node-index]")&&s("mouseout",_)}function qx(_){s("mouseover",_)}function jx(_){s("mouseout",_)}const la=oe(null),Es=oe(!1),Xu=oe(null),a9=D(()=>!(S.domMode!=="minimal"||G.value||S.fade!==!1||f.value||Es.value||Qe.value||zt.value||Bo.value||As.value||Re.value||Object.keys(sn.value).length!==0));let Qu,yc=null,sg=0,xh=0,wh=0;const Vx=["code_block","admonition","table","math_block","html_block","image","thematic_break"],c9=new Set(Vx),Kx=[".typewriter-cursor",".height-estimation-probes",...Vx.map(_=>`[data-node-type="${_}"]`),"script","style"].join(",");function Gx(_){if(!_||typeof _!="object")return!1;const H=_.type;return typeof H=="string"&&c9.has(H)}function _h(_){var H,X;if(!_||typeof _!="object")return 0;const J=_,ce=(X=(H=J.raw)!=null?H:J.content)!=null?X:J.code;if(typeof ce=="string")return ce.length;const we=J.children;if(Array.isArray(we))return we.reduce((Fe,Ve)=>Fe+_h(Ve),0);const Le=J.items;return Array.isArray(Le)?Le.reduce((Fe,Ve)=>Fe+_h(Ve),0):0}function Sh(){Qu&&(clearTimeout(Qu),Qu=void 0)}function ig(){sg+=1,yc!=null&&(ge?.(yc),yc=null)}function Ju(){ig(),sl(),la.value&&(la.value.style.visibility="hidden")}function u9(_){var H;if(_.nodeType!==Node.TEXT_NODE||!((H=_.textContent)!=null?H:"").trim())return!1;const X=_.parentElement;return!!X&&!X.closest(Kx)}function d9(_){let H=_.lastChild;for(;H;){if(u9(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const X=H;if(!X.matches(Kx)&&X.lastChild){H=X.lastChild;continue}}for(;H&&H!==_&&!H.previousSibling;)H=H.parentNode;if(!H||H===_)break;H=H.previousSibling}return null}function Yx(){const _=kh.value;for(let H=_.length-1;H>=0;H--){const X=_[H];if(!X||Gx(X.node)||!gh(X.index))continue;const J=cn.get(X.index);if(!J)continue;const ce=d9(J);if(ce)return ce}return null}function sl(){Xu.value&&(Xu.value.classList.remove(o3),Xu.value=null)}function Ch(){if(d.value!=="simple"||!P||!Es.value||!L.value)return void sl();const _=Yx(),H=_?(function(X){var J;const ce=(J=X.parentElement)==null?void 0:J.closest(".text-node");return ce instanceof HTMLElement?ce:X.parentElement})(_):null;H!==Xu.value&&(sl(),H&&(H.classList.add(o3),Xu.value=H))}function Ah(){if(d.value!=="precise"||!P||!Es.value||yc!=null)return;const _=sg,H=()=>{yc=null,_===sg&&(function(){var X,J;if(d.value!=="precise"||!(P&&Es.value&&L.value&&la.value))return;const ce=L.value,we=la.value;we.style.visibility="hidden";const Le=Yx();if(!Le)return;let Fe=0,Ve=0,Oe=20,Pe=!1;if(Le?.textContent){const je=Le.textContent.length,$e=document.createRange();$e.setStart(Le,Math.max(0,je-1)),$e.setEnd(Le,je);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Xe=(J=He?.[He.length-1])!=null?J:(X=Le.parentElement)==null?void 0:X.getBoundingClientRect();if(Xe){const Ye=vt("typewriterCursor.root.getBoundingClientRect",()=>ce.getBoundingClientRect());Fe=Xe.right-Ye.left+ce.scrollLeft,Ve=Xe.top-Ye.top+ce.scrollTop,Oe=Xe.height||Oe,Pe=!0}$e.detach()}Pe&&(we.style.transform=`translate(${Math.max(0,Fe)}px, ${Math.max(0,Ve)}px)`,we.style.height=`${Oe}px`,we.style.visibility="visible")})()};Te?yc=Te(H):H()}return et([Ze,()=>o.content,()=>o.nodes,()=>S.typewriter,lt],()=>Zn(null,null,function*(){var _,H;if(!P||G.value||!se.value)return;if(lt.value)return Es.value=!1,Sh(),void Ju();if((_=o.nodes)!=null&&_.length)return Es.value=!1,Sh(),Ju(),xh=((H=o.content)!=null?H:"").length,void(wh=Ze.value.length);const X=(function(){var Fe,Ve;return(Fe=o.nodes)!=null&&Fe.length?o.nodes.reduce((Oe,Pe)=>Oe+_h(Pe),0):((Ve=o.content)!=null?Ve:"").length})(),J=(function(){var Fe;return(Fe=o.nodes)!=null&&Fe.length?o.nodes.reduce((Ve,Oe)=>Ve+_h(Oe),0):Ze.value.length})(),ce=!Gx(Be.value[Be.value.length-1]),we=X>xh,Le=J>wh;if(!f.value||!ce||!we&&!Le)return f.value&&ce||(Es.value=!1,Ju()),xh=X,void(wh=J);xh=X,wh=J,Es.value=!0,d.value==="precise"&&la.value&&(la.value.style.visibility="hidden"),Sh(),yield yt(),d.value==="simple"?Ch():(sl(),Ah()),Qu=setTimeout(()=>{Qu=void 0,Es.value=!1},3e3)}),{flush:"post",immediate:!0}),et(Es,_=>Zn(null,null,function*(){_?(yield yt(),d.value!=="simple"?(sl(),d.value==="precise"&&Ah()):Ch()):Ju()}),{flush:"post"}),et(d,()=>Zn(null,null,function*(){if(P&&!G.value&&se.value&&Es.value){if(yield yt(),d.value==="simple")return ig(),void Ch();sl(),d.value!=="precise"?Ju():Ah()}}),{flush:"post"}),et([()=>te.value,()=>jo.start,()=>jo.end],()=>Zn(null,null,function*(){P&&!G.value&&se.value&&Es.value&&(yield yt(),d.value!=="simple"?(sl(),d.value==="precise"&&Ah()):Ch())}),{flush:"post"}),ho(()=>{Sh(),ig(),sl(),Bn.clear()}),(_,H)=>{const X=PI("NodeRenderer",!0);return C(G)?(x(!0),E(We,{key:0},rt(kh.value,J=>(x(),E(We,{key:J.vnodeKey},[J.rendersCustomNode?(x(),Se(Ho(J.component),Sn({key:0,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onClick:og,onMouseover:qx,onMouseout:jx,onCopy:H[0]||(H[0]=ce=>i(ce)),onHandleArtifactClick:H[1]||(H[1]=ce=>s("handleArtifactClick",ce))}),{default:Ie(()=>[J.hasSlotChildren?(x(),Se(X,Sn({key:0,ref_for:!0},vn.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Se(X,Sn({key:1,ref_for:!0},vn.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ho(J.component),Sn({key:1,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onClick:og,onMouseover:qx,onMouseout:jx,onCopy:H[2]||(H[2]=ce=>i(ce)),onHandleArtifactClick:H[3]||(H[3]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),E("div",{key:1,ref_key:"containerRef",ref:L,class:Ue(["markstream-vue markdown-renderer",[{dark:S.isDark},{virtualized:zt.value},{"virtual-scroll-coordinated":qs.value},{"stable-layout":SN.value},{"typewriter-simple-cursor":Es.value&&d.value==="simple"}]]),"data-custom-id":S.customId,onClick:og,onMouseover:r9,onMouseout:l9},[js.value||zt.value?(x(),E(We,{key:0},[js.value?(x(),Se(Ese,{key:0,width:ui.value,"flow-root":zt.value||qs.value,"paragraph-node":Vn.value,"list-item-node":Kn.value,"list-node":Jn.value,"heading-nodes":Oo.value,"set-paragraph-wrapper":CN,"set-list-item-wrapper":AN,"set-list-wrapper":MN,"set-heading-wrapper":NN},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ue("",!0),zt.value?(x(),E("div",{key:1,class:"node-spacer",style:on({height:`${S0.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],64)):ue("",!0),a9.value?(x(!0),E(We,{key:1},rt(kh.value,J=>(x(),E(We,{key:J.vnodeKey},[gh(J.index)?(x(),Se(Ho(J.component),Sn({key:0,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onMouseover:H[4]||(H[4]=ce=>s("mouseover",ce)),onMouseout:H[5]||(H[5]=ce=>s("mouseout",ce)),onCopy:H[6]||(H[6]=ce=>i(ce)),onHandleArtifactClick:H[7]||(H[7]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ue("",!0)],64))),128)):(x(!0),E(We,{key:2},rt(kh.value,J=>(x(),E("div",{key:J.vnodeKey,ref_for:!0,ref:ce=>vh(J.index,ce),class:"node-slot","data-node-index":J.index,"data-node-type":J.node.type},[gh(J.index)?(x(),E("div",{key:0,ref_for:!0,ref:ce=>(function(we,Le){var Fe;Le||(function(je){const $e=`${A0()}-${je}`;let He=!1;for(const Xe of Array.from(Zs.keys())){const Ye=Qi.get(Xe);(Ye?.index===je||Xe===$e||Xe.startsWith(`${$e}-`))&&(Zs.delete(Xe),Qi.delete(Xe),He=!0)}He&&(ac(),Gn("async-node"))})(we),kr.delete(we),(function(je){var $e;const He=(($e=Jl.get(je))!=null?$e:0)+1;Jl.set(je,He)})(we);const Ve=tl.get(we);if(Ve){for(const je of Ve)lh(je);tl.delete(we)}if((function(je){const $e=Vt.get(je);$e&&(co?.unobserve($e),zn.delete($e),Vt.delete(je))})(we),!Le||!Ms.value)return Xi.delete(we),void Jl.delete(we);Xi.set(we,Le);const Oe=()=>{yh(we,Le)};queueMicrotask(Oe);const Pe=(co||typeof ResizeObserver>"u"||(co=new ResizeObserver(je=>{if(je.length)for(const $e of je){const He=zn.get($e.target),Xe=Vt.get(He??-1);He!=null&&Xe&&yh(He,Xe)}else xr()})),co);if(Pe&&(Vt.set(we,Le),zn.set(Le,we),Pe.observe(Le)),typeof window<"u"){const je=((Fe=Be.value[we])==null?void 0:Fe.type)==="code_block"?[16,80,240,800]:lt.value?[80]:[];if(je.length){const $e=je.map(He=>tx(He,Oe,"node-resize")).filter(He=>He!=null);$e.length&&tl.set(we,$e)}}})(J.index,ce),class:"node-content"},[J.isCodeBlock?J.rendersCustomNode?(x(),Se(Ho(J.component),Sn({key:1,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[12]||(H[12]=ce=>i(ce)),onHandleArtifactClick:H[13]||(H[13]=ce=>s("handleArtifactClick",ce))}),{default:Ie(()=>[J.hasSlotChildren?(x(),Se(X,Sn({key:0,ref_for:!0},vn.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Se(X,Sn({key:1,ref_for:!0},vn.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ho(J.component),Sn({key:2,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[14]||(H[14]=ce=>i(ce)),onHandleArtifactClick:H[15]||(H[15]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ua,{key:0,name:"fade",css:S.fade!==!1,appear:S.fade!==!1},{default:Ie(()=>[J.rendersCustomNode?(x(),Se(Ho(J.component),Sn({key:0,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[8]||(H[8]=ce=>i(ce)),onHandleArtifactClick:H[9]||(H[9]=ce=>s("handleArtifactClick",ce))}),{default:Ie(()=>[J.hasSlotChildren?(x(),Se(X,Sn({key:0,ref_for:!0},vn.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Se(X,Sn({key:1,ref_for:!0},vn.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ho(J.component),Sn({key:1,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[10]||(H[10]=ce=>i(ce)),onHandleArtifactClick:H[11]||(H[11]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),E("div",{key:1,class:"node-placeholder",style:on({height:`${f0(J.index)}px`})},null,4))],8,Ise))),128)),Es.value&&d.value==="precise"?(x(),E("span",{key:3,ref_key:"typewriterCursorRef",ref:la,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ue("",!0),zt.value?(x(),E("div",{key:4,class:"node-spacer",style:on({height:`${C0.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],42,Nse))}}})),[["__scopeId","data-v-a9489508"]]),zs=BE;zs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",zs.__name,zs.name].filter(n=>!!n));for(const n of t)e.component(n,BE)};const eb=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"})),Lse={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"},$se={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"},Fse={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"},Ose={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"},Bse={class:"admonition-title"},Rse=["aria-expanded","aria-controls"],Dse=["id"],qp=Mn(Je({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=D(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=oe(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),E("div",{class:Ue(["admonition",[`admonition-${o.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(x(),E("svg",Lse,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(x(),E("svg",$se,[...u[2]||(u[2]=[w("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),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(x(),E("svg",Fse,[...u[3]||(u[3]=[w("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),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(x(),E("svg",Ose,[...u[4]||(u[4]=[w("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),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):ue("",!0),w("span",Bse,R(i.value),1),o.node.collapsible?(x(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),E("svg",{style:on({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]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Rse)):ue("",!0)]),qn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ae(C(zs),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Dse),[[xi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);qp.install=e=>{e.component(qp.__name,qp)};const ok=()=>vs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let rp=null,lp=ok,ap=null,s3=!1,i3=!1;function u3e(){return Zn(this,null,function*(){if(rp)return rp;const e=lp;return e?e===ok&&s3?null:ap||(ap=Zn(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===ok)return e===lp&&(s3=!0,(function(o){i3||(i3=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===lp&&(ap=null)}return e!==lp?null:t?(rp=(function(n){var o;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 s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),rp):null}),ap):null})}let cp=null,RE=null,up=null;function d3e(){return typeof RE=="function"}function f3e(){return Zn(this,null,function*(){if(cp)return cp;const e=RE;return e?up||(up=Zn(null,null,function*(){const t=yield e(),n=(function(o){var s,i,r;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=o.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(cp=n,cp):null}).finally(()=>{up=null}),up):null})}const h3e=Symbol("markstreamLanguageIconResolver"),dp=oe(!1);let r3=!1;function kv(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Pse(){return!r3&&typeof window<"u"&&typeof document<"u"&&(r3=!0,dp.value=kv(),new MutationObserver(()=>{dp.value=kv()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{dp.value=kv()})),dp}const DE=["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"],Hse=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),sk=[...DE].sort((e,t)=>t.length-e.length).join("|"),bv=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${sk}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${sk})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),PE=/[),.;!?,。;!?)]+$/;function Wse(e){const t=e.toLowerCase();return DE.some(n=>t.endsWith(`.${n}`))}function zse(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${sk}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function Use(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(PE,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Hse.has(i),a=Wse(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function qse(e,t={}){const n=[];bv.lastIndex=0;let o;for(;(o=bv.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(PE,""),u=a.length-c.length;a=c;const d=Use(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(bv.lastIndex-=u)}return n}const jse=12e4,Vse=6e4,Kse=32,Gse=3e4,l3=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Yse(e){let t=0,n=0,o=0;l3.lastIndex=0;let s;for(;(s=l3.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=jse||n>=Vse||t>=Kse||o>=Gse?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Zse(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Xse(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Qse={key:1,class:"diff-wrap"},Jse={class:"diff-bar"},eie=["aria-label","onClick"],tie={class:"diff-pre"},nie={key:0,class:"diff-sign"},oie={class:"diff-text"},sie="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",a3="github-light",c3="github-dark",iie=Je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){hte(),Ate(),mte(),Tte(),pte(new Zse),Ete(new Xse);function t(W){return W.inline.ruler.disable("math"),W}const{t:n}=$t(),o=Jt("resolveImage"),s=oe(null),i=e,r=D(()=>!i.streaming),l=D(()=>zse(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Yse(i.text??"")),c=Pse(),u=D(()=>!i.streaming),d=zo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(W){return!/^(https?:|data:|blob:)/i.test(W)}function y(W){if(!o)return;const z=[];for(const L of[h,p]){L.lastIndex=0;let O;for(;(O=L.exec(W))!==null;)z.push(O[2]??"")}for(const L of z)!L||!m(L)||d.has(L)||f.has(L)||(f.add(L),o(L).then(O=>{d.set(L,O!==L?O:"")}).catch(()=>{d.set(L,"")}).finally(()=>{f.delete(L)}))}function k(W){if(!o)return W;const z=L=>{if(!m(L))return null;const O=d.get(L);return O===void 0?sie:O===""?null:O};return W.replace(h,(L,O,U,Z)=>{const ie=z(U);return ie===null?L:`${O}${ie}${Z}`}).replace(p,(L,O,U,Z)=>{const ie=z(U);return ie===null?L:`${O}${ie}${Z}`})}et(()=>i.text,W=>y(W??""),{immediate:!0});function g(){if(!s.value||!i.openFile||i.streaming)return;const W=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),z=[];let L=W.nextNode();for(;L;){const O=L,U=O.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&O.data.trim().length>0&&z.push(O),L=W.nextNode()}for(const O of z){const U=qse(O.data,{aliases:l.value});if(U.length===0||!O.parentNode)continue;const Z=document.createDocumentFragment();let ie=0;for(const q of U){q.start>ie&&Z.append(document.createTextNode(O.data.slice(ie,q.start)));const ee=document.createElement("button");ee.type="button",ee.className="md-file-link",ee.textContent=q.text,ee.title=q.line?`${q.path}:${q.line}`:q.path,ee.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation(),i.openFile?.({path:q.path,line:q.line})}),Z.append(ee),ie=q.end}ie<O.data.length&&Z.append(document.createTextNode(O.data.slice(ie))),O.parentNode.replaceChild(Z,O)}}function v(W){return!(!W||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(W))}function b(W){let z=W.length;for(const L of["#","?"]){const O=W.indexOf(L);O!==-1&&O<z&&(z=O)}return W.slice(0,z)}function A(){if(!s.value||!i.openFile||i.streaming)return;const W=s.value.querySelectorAll("a[href]");for(const z of W){if(z.dataset.mdLinkHandled==="true"||z.closest("svg"))continue;const L=z.getAttribute("href")??"";v(L)&&(z.dataset.mdLinkHandled="true",z.addEventListener("click",O=>{O.preventDefault(),O.stopPropagation(),i.openFile?.({path:b(L)})}))}}function I(){yt().then(()=>{g(),A()})}et(()=>i.text,I),et(()=>i.streaming,I);let N=null;An(()=>{I(),s.value&&(N=new MutationObserver(I),N.observe(s.value,{childList:!0,subtree:!0}))}),On(()=>{N?.disconnect()});const M={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1,monacoOptions:{lineNumbers:!1,fontSize:13,fontFamily:"var(--font-mono)",padding:{top:12,bottom:12}}},$=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,T=D(()=>{const W=k(i.text??""),z=[];let L=0;$.lastIndex=0;let O;for(;(O=$.exec(W))!==null;){const Z=O[1]??"",ie=W.slice(L,O.index)+(Z||"");ie.trim()&&z.push({kind:"md",text:ie}),z.push({kind:"diff",code:O[2]??""}),L=$.lastIndex}const U=W.slice(L);return(U.trim()||z.length===0)&&z.push({kind:"md",text:U}),z});function F(W){return W.split(`
298
- `).map(z=>z.startsWith("@@")?{type:"hunk",sign:"",text:z}:/^\+(?!\+\+)/.test(z)?{type:"add",sign:"+",text:z.slice(1)}:/^-(?!--)/.test(z)?{type:"del",sign:"-",text:z.slice(1)}:z.startsWith(" ")?{type:"ctx",sign:"",text:z.slice(1)}:{type:"ctx",sign:"",text:z})}const S=oe(null);function B(W,z){Jo(W).then(L=>{L&&(S.value=z,setTimeout(()=>{S.value=null},1400))})}return(W,z)=>(x(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(x(!0),E(We,null,rt(T.value,(L,O)=>(x(),E(We,{key:O},[L.kind==="md"?(x(),Se(C(zs),{key:0,content:L.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":a3,"code-block-dark-theme":c3,themes:[a3,c3],"code-block-props":M,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:C(TF)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(x(),E("div",Qse,[w("div",Jse,[z[0]||(z[0]=w("span",{class:"diff-lang"},"diff",-1)),ae(an,{text:C(n)("filePreview.copyCode")},{default:Ie(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:U=>B(L.code,O)},[ae(Ge,{name:S.value===O?"check":"copy",size:"sm"},null,8,["name"])],8,eie)]),_:2},1032,["text"])]),w("pre",tie,[w("code",null,[(x(!0),E(We,null,rt(F(L.code),(U,Z)=>(x(),E("span",{key:Z,class:Ue(["diff-line",`diff-${U.type}`])},[U.type!=="hunk"?(x(),E("span",nie,R(U.sign),1)):ue("",!0),w("span",oie,R(U.text),1)],2))),128))])])]))],64))),128))],512))}}),Q1=dt(iie,[["__scopeId","data-v-76651151"]]),rie={class:"tc-anim"},lie={class:"prev-anim"},aie={class:"prev"},cie=Je({__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,o=t,s=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&s.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>s.value.at(-1)??""),a=oe(null);return An(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),et(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||yt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),E("div",{class:Ue(["think",{mob:e.mobile}])},[i.value?(x(),E("div",{key:0,class:Ue(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[w("div",rie,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),w("div",lie,[w("span",aie,R(l.value),1)])],2)):(x(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),uie=dt(cie,[["__scopeId","data-v-fdc551ea"]]),die={class:"activity-notice",role:"status"},fie={"aria-hidden":"true"},hie={class:"an-label"},pie=Je({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),E("div",die,[w("span",fie,[ae(Us,{size:"sm"})]),w("span",hie,R(e.label),1)]))}}),mie=dt(pie,[["__scopeId","data-v-0d497074"]]);function gie(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const vie=Je({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=$t(),o=oe(!1),s=D(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=D(()=>o.value?s.value:gie(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(x(),E("button",{type:"button",class:"msg-time",onClick:St(r,["stop"])},R(i.value),1))}}),HE=dt(vie,[["__scopeId","data-v-9672fbd5"]]);function yie(e){return e.length===1?`0${e}`:e}function kie(e,t){return`${String(Number(e))}:${yie(t)}`}const u3=e=>/^\d+$/.test(e);function bie(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(u3(o)&&u3(s)&&c){const f=kie(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const xie=["data-turn-id"],wie={class:"cn-bubble"},_ie={class:"cn-title"},Sie={key:0,class:"cn-prompt"},Cie={class:"cn-meta"},Aie={key:0,class:"cn-meta-item"},Mie={key:1,class:"cn-meta-item"},Eie=["aria-label"],Tie=["title"],Nie=Je({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=$t(),o=D(()=>t.cron),s=D(()=>o.value?.missedCount!==void 0),i=D(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const u=o.value?.cron;return u?bie(u,n):""}),l=D(()=>s.value?"error":"ok"),a=D(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=D(()=>t.text??"");return(u,d)=>(x(),E("div",{class:Ue(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",wie,[w("span",_ie,R(i.value),1),c.value?(x(),E("span",Sie,R(c.value),1)):ue("",!0)]),w("div",Cie,[ae(Ge,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),E("span",Aie,R(r.value),1)):ue("",!0),a.value?(x(),E("span",Mie,R(a.value),1)):ue("",!0),w("span",{class:Ue(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):(x(),Se(Ge,{key:1,name:"close",size:"sm"}))],10,Eie),o.value?.jobId?(x(),E("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},R(o.value.jobId),9,Tie)):ue("",!0),e.createdAt?(x(),Se(HE,{key:3,time:e.createdAt},null,8,["time"])):ue("",!0)])],10,xie))}}),Iie=dt(Nie,[["__scopeId","data-v-a62a6587"]]),Lie=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],WE=500,Vm=256*1024,d3=200,xv=16384,wv=500,_v=50,Sv=50,$ie=6,Fie=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Oie=/^[A-Za-z0-9+/=_-]{200,}$/;let Cv=null;function Yi(){if(Cv!==null)return Cv;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=yo(Dt.debug)==="1"),Cv=e,e}const Bl=[],Zc=[];let Ed=0;const Ca=[];let Td=0,Bie=1;const Km=new TextEncoder,Rie=new Set(Lie),tb=oe(0),Nd=gr(!1);function Die(){return Bl}function Pie(){Bl.length=0,Zc.length=0,Ed=0,Ca.length=0,Td=0,tb.value++}function Jr(e){if(!Nd.value){try{const t={id:Bie++,ts:Date.now(),source:e.source,kind:String(hu(e.kind)),label:String(hu(e.label)),sessionId:e.sessionId===void 0?void 0:String(hu(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Zl(e.detail)},n=JSON.stringify(t),o=Km.encode(n).byteLength;if(o>Vm)return;for(Bl.push(t),Zc.push(n),Ed+=o+(Zc.length>1?1:0);Bl.length>WE||Ed>Vm;){const s=Zc.shift();Bl.shift(),s!==void 0&&(Ed-=Km.encode(s).byteLength,Zc.length>0&&(Ed-=1))}}catch{return}tb.value++}}function va(e){if(typeof e=="string")return e.length<=d3?e:e.slice(0,d3)}function mi(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Hie(e,t){if(Rie.has(e))try{const n={ts:Date.now(),event:e,sessionId:va(t?.sessionId),status:va(t?.status),operation:va(t?.operation),seq:mi(t?.seq),durationMs:mi(t?.durationMs),messageCount:mi(t?.messageCount),contentCount:mi(t?.contentCount),mediaCount:mi(t?.mediaCount),sessionCount:mi(t?.sessionCount),workspaceCount:mi(t?.workspaceCount),promptId:va(t?.promptId),zipBytes:mi(t?.zipBytes),errorName:va(t?.errorName),errorCode:mi(t?.errorCode),requestId:va(t?.requestId),phase:va(t?.phase),httpStatus:mi(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:mi(t?.line),col:mi(t?.col)},o=JSON.stringify(n),s=Km.encode(o).byteLength;if(s>Vm)return;for(Ca.push(o),Td+=s+(Ca.length>1?1:0);Ca.length>WE||Td>Vm;){const i=Ca.shift();i!==void 0&&(Td-=Km.encode(i).byteLength,Ca.length>0&&(Td-=1))}}catch{return}}function hu(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return Oie.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>wv?`${i.slice(0,wv)}… [+${i.length-wv} chars]`:i}if(n!=="object")return String(e);if(t>=$ie)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,_v).map(r=>hu(r,t+1));return e.length>_v&&i.push(`[+${e.length-_v} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,Sv))o[i]=Fie.test(i)?"[redacted]":hu(r,t+1);return s.length>Sv&&(o._truncatedKeys=s.length-Sv),o}function Zl(e){if(e===void 0)return;const t=hu(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>xv)return{_truncated:`detail JSON was ${n.length} chars; first ${xv} kept`,preview:n.slice(0,xv)}}catch{return"[unserializable detail]"}return t}function fp(e){Yi()&&Jr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Zl(e.body)}})}function Tc(e){if(!Yi())return;const t=e.code!==0;Jr({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:Zl(e.data)}})}function pl(e){Yi()&&Jr({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 Nc(e,t){Yi()&&Jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Zl(t)})}function Wie(e){if(!Yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;Jr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Zl(e)})}function zie(e){if(!Yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Jr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Zl(t.payload)})}const Uie={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function qie(e,t,n){Yi()&&Jr({source:"client",kind:`client:${e}`,label:`${Uie[e]} ${t}`,detail:Zl(n)})}function Rr(e,t){Yi()&&Jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Zl(t)})}function _o(e,t){Hie(e,t),Jr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let Av=!1,hp=null;function jie(){if(Av)return()=>hp?.();Av=!0;const e=[];try{if(typeof window<"u"){const n=s=>{_o("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;_o("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Yi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{qie(n,i.map(Vie).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(hp===t){for(const n of e.toReversed())n();hp=null,Av=!1}};return hp=t,t}function Vie(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 zE(e=Bl){if(typeof document>"u")return;const t=new Blob([Kie(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Kie(e=Bl){return e===Bl?Zc.join(`
299
- `):e.map(t=>JSON.stringify(t)).join(`
300
- `)}function Gie(){return Ca.join(`
301
- `)}function UE(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 ik(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Bi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:UE(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 Jd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function f3(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,id:e.id}}function nb(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:f3(e.source)};case"video":return{type:"video",source:f3(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 rk(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(nb),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Yie(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,id:t.id},{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 Zie(e){return{content:e.content.map(Yie),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 Xie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function qE(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 Qie(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Jie(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Qie),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function jE(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Jie),createdAt:e.created_at}}function ere(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 tre(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=ere(o);return{answers:t,method:e.method,note:e.note}}function jp(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,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function h3(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 ml(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ic(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function gi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function VE(e){if(!e||typeof e!="object")return null;const t=e,n=ml(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:ml(t,"goalId")??ml(t,"goal_id")??"goal",objective:ml(t,"objective")??"",completionCriterion:ml(t,"completionCriterion")??ml(t,"completion_criterion"),status:n,turnsUsed:Ic(t,"turnsUsed")??Ic(t,"turns_used")??0,tokensUsed:Ic(t,"tokensUsed")??Ic(t,"tokens_used")??0,wallClockMs:Ic(t,"wallClockMs")??Ic(t,"wall_clock_ms")??0,terminalReason:ml(t,"terminalReason")??ml(t,"terminal_reason"),budget:{tokenBudget:gi(s,"tokenBudget")??gi(s,"token_budget"),remainingTokens:gi(s,"remainingTokens")??gi(s,"remaining_tokens"),turnBudget:gi(s,"turnBudget")??gi(s,"turn_budget"),remainingTurns:gi(s,"remainingTurns")??gi(s,"remaining_turns"),wallClockBudgetMs:gi(s,"wallClockBudgetMs")??gi(s,"wall_clock_budget_ms"),remainingWallClockMs:gi(s,"remainingWallClockMs")??gi(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function nre(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Bi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Bi(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:Jd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Jd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:UE(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=VE(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:rk(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(nb),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:qE(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:jE(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.task.created":return{type:"taskCreated",sessionId:t.session_id,task:jp(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:lk(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function ore(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function p3(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 lk(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.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,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 sre(e){return e.session_id}function ire(e){return e.seq}const rre="main",lre=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","prompt.aborted","error"]);function $r(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 are(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 m3(){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,retryReuseMsgId:void 0}}function hs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ba(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function vi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function cre(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=hs(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=hs(t,"goalId")??hs(t,"goal_id")??"goal",r=hs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:hs(t,"completionCriterion")??hs(t,"completion_criterion"),status:s,turnsUsed:ba(t,"turnsUsed")??ba(t,"turns_used")??0,tokensUsed:ba(t,"tokensUsed")??ba(t,"tokens_used")??0,wallClockMs:ba(t,"wallClockMs")??ba(t,"wall_clock_ms")??0,terminalReason:hs(t,"terminalReason")??hs(t,"terminal_reason"),budget:{tokenBudget:vi(o,"tokenBudget")??vi(o,"token_budget"),remainingTokens:vi(o,"remainingTokens")??vi(o,"remaining_tokens"),turnBudget:vi(o,"turnBudget")??vi(o,"turn_budget"),remainingTurns:vi(o,"remainingTurns")??vi(o,"remaining_turns"),wallClockBudgetMs:vi(o,"wallClockBudgetMs")??vi(o,"wall_clock_budget_ms"),remainingWallClockMs:vi(o,"remainingWallClockMs")??vi(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Aa(e,t,n,o){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"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function ure(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=hs(t,"name")??hs(t,"toolName")??"tool",o=ec(dre(n)),s=fre(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=hs(n,"text");if(s)return Mv(s);const i=hs(n,"message");if(i)return Mv(i)}const o=hs(t,"message");if(o)return Mv(o)}return null}function dre(e){return e.replace(/_\d+$/,"")}const g3=2e3;function Mv(e){return e.length>g3?`${e.slice(0,g3)}…`:e}function fre(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return pf(e,n)}function hre(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=hs(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Aa(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=ure(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Aa(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 md(e){return{...e,content:e.content.map(t=>({...t}))}}function v3(e,t,n){const o={id:$r("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function pre(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function mre(e){return Array.isArray(e)?e.map(t=>nb(t)):[]}function y3(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function gre(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function vre(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(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:s}:null}function k3(e,t){e.messages.find(n=>n.id===t)}function yre(e,t,n,o,s,i){const r={id:$r("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function gd(e,t){return e.messages.find(n=>n.id===t)}function b3(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 kre(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=m3(),e.set(u,d)),d}function o(u){e.set(u,m3())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??$r("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=v3(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const y=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:y}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:md(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),m=d,y=[],k=m?.agentId;if(typeof k=="string"&&k!==rre){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(lre.has(u))return hre(p,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,b={};typeof g=="string"&&g.length>0&&(b.title=g),typeof v=="string"&&(b.lastPrompt=v),(b.title!==void 0||b.lastPrompt!==void 0)&&y.push({type:"sessionMetaUpdated",sessionId:f,...b});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const b=mre(m?.content);if(b.length===0)break;p.currentPromptId=g;const A=pre(p,f,g,v,b,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());y.push({type:"messageCreated",message:md(A)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??$r("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,y.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;if(v||(v=$r("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,gd(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const b=v3(p,f,v);p.currentAssistantMsgId=b.id,y.push({type:"messageCreated",message:md(b)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const b=a(p.turnThinkLen,h?.offset);if(b==="skip")break;if(b==="gap"){y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=y3(p,g,"thinking",v);if(A<0)break;p.turnThinkLen+=v.length,y.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const b=a(p.turnTextLen,h?.offset);if(b==="skip")break;if(b==="gap"){y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=y3(p,g,"text",v);if(A<0)break;p.turnTextLen+=v.length,y.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,b=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!b)break;const A=m?.toolCallId,I=m?.name??m?.toolName??"",N=m?.args??m?.input??{};gre(p,g,A,I,N);const M=gd(p,g);M&&M.content.length-1,p.toolStartTimes.set(A,Date.now()),M&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:M.content.map($=>({...$})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=vre(m??{});g&&v&&y.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=$r("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const b=m?.toolCallId,A=m?.output,I=m?.isError??!1;p.toolStartTimes.get(b)??Date.now(),p.toolStartTimes.delete(b);const N=yre(p,f,b,A,I,v);y.push({type:"messageCreated",message:md(N)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=are(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){k3(p,g);const b=gd(p,g);b&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:b.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),y.push({type:"sessionUsageUpdated",sessionId:f,usage:b3(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0,thinking:typeof m?.thinkingEffort=="string"&&m.thinkingEffort.length>0?m.thinkingEffort:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",b=ba(m??{},"durationMs");if(y.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:m?.reason}),g){k3(p,g);const I=gd(p,g);I&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:I.content.map(N=>({...N})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:b})}p.turnCount++;const A=b3(p);y.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const g=m?.promptId;typeof g=="string"&&g.length>0&&y.push({type:"promptCompleted",sessionId:f,promptId:g,reason:m?.reason??"completed"});break}case"prompt.aborted":{const g=m?.promptId;typeof g=="string"&&g.length>0&&y.push({type:"promptAborted",sessionId:f,promptId:g});break}case"turn.step.retrying":{const g=p.currentAssistantMsgId;if(g!==void 0){const v=gd(p,g);v!==void 0&&(v.content=v.content.filter(b=>b.type!=="text"&&b.type!=="thinking"&&b.type!=="toolUse"),y.push({type:"messageUpdated",sessionId:f,messageId:g,content:v.content.map(b=>({...b})),status:"pending"}),p.retryReuseMsgId=g)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:$r("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(v.id,v),y.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Aa(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&y.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Aa(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&y.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Aa(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&y.push({type:"taskCreated",sessionId:f,task:v}),y.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Aa(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&y.push({type:"taskCreated",sessionId:f,task:v}),y.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{y.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message,name:m?.name,details:m?.details,retryable:m?.retryable}});break}case"warning":{y.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,b=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):$r("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Rn.global.t("tasks.defaultDescription");if(g.kind==="agent"){const N=typeof g.agentId=="string"&&g.agentId.length>0?g.agentId:void 0;if(N!==void 0){const M=Aa(p,f,N,{description:A,backgroundTaskId:b,runInBackground:!0});M&&y.push({type:"taskCreated",sessionId:f,task:M})}else y.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,subagentPhase:"queued",runInBackground:!0}});break}const I=typeof g.command=="string"?g.command:void 0;y.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"bash",description:A,command:I,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:I!==void 0?`$ ${I}`:void 0}});break}case"task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;y.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};y.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{y.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{y.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=cre(m?.snapshot??null);y.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=hs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const b={id:$r("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(b),y.push({type:"messageCreated",message:md(b)})}break}}return y}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const bre=new Set(["server_hello","ack","ping","resync_required","error","pong"]),x3=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","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),xre=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","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"]),wre=new Set(["assistant.delta","thinking.delta"]);function _re(e,t){if(bre.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return wre.has(o)?Sre(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?xre.has(o)?{route:"protocol"}:x3.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:x3.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function Sre(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 Id extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class Nr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;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,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function wi(e){return e instanceof Id||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function ob(e){return e instanceof Nr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Go="kimi-web.server-credential",Cre="token",Are=10080*60*1e3;let fr;const ak=new Set;function Mre(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Cre);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function ck(e){return{version:1,credential:e,expiresAt:Date.now()+Are}}function Ere(e){return JSON.stringify(e)}function sb(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function uk(e){globalThis.localStorage?.setItem(Go,Ere(e))}function Tre(){try{const e=globalThis.localStorage?.getItem(Go);if(e){const n=sb(e);if(n===void 0){const o=ck(e);let s=!1;try{uk(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Go)===e&&globalThis.localStorage?.removeItem(Go),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Go)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Go),globalThis.localStorage?.getItem(Go)===e&&globalThis.localStorage?.removeItem(Go);return}const t=globalThis.sessionStorage?.getItem(Go);if(t){const n=ck(t);let o=!1;try{uk(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Go),o=!0}catch{}return o?n:void 0}return}catch{return}}function Nre(){const e=Mre();return e?(GE(e),!0):(fr=Tre(),fr!==void 0)}function KE(){if(fr!==void 0){if(fr.expiresAt<=Date.now()){Ire(fr);return}return fr.credential}}function Ire(e){fr=void 0;try{globalThis.sessionStorage?.removeItem(Go);const t=globalThis.localStorage?.getItem(Go),n=t==null?void 0:sb(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Go)}catch{}}function GE(e){const t=ck(e);fr=t;try{uk(t)}catch{}try{globalThis.sessionStorage?.removeItem(Go)}catch{}}function Lre(){const e=fr;fr=void 0;try{const t=globalThis.localStorage?.getItem(Go),o=(t==null?void 0:sb(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Go),globalThis.sessionStorage?.removeItem(Go)}catch{}}function $re(e){return ak.add(e),()=>{ak.delete(e)}}function Fre(){Lre();for(const e of ak)try{e()}catch{}}const Hc=3e4,pp=5*6e4,YE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",w3=500,ZE=40101;function mp(e=Hc){try{return AbortSignal.timeout(e)}catch{return}}function Ore(e,t){let n="",o=e;for(let s=0;s<t;s++)n=YE[o%32]+n,o=Math.floor(o/32);return n}function Bre(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=>YE[n%32]).join("")}function gp(){return`${Ore(Date.now(),10)}${Bre(16)}`}function Rre(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Ev(e){try{const t=await e.text();return t?t.length>w3?`${t.slice(0,w3)}...`:t:void 0}catch{return}}class Dre{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=jc(this.origin,t),o=gp(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();fp({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:mp()})}catch(a){throw pl({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new Nr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:Hc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return Tc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),Tc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Id({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=jc(this.origin,t),r=gp(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();fp({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:mp(pp)})}catch(h){throw pl({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new Nr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:pp,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const y=h?.code??c.status,k=h?.msg??c.statusText;throw Tc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:y,msg:k,envelopeRequestId:h?.request_id}),new Id({code:y,msg:k,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw pl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new Nr({message:`Invalid ZIP response from ${s} ${t}`,cause:m,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:pp,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await Ev(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw pl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new Nr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:pp,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return Tc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=jc(this.origin,t),s=gp(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();fp({method:"POST",path:t,url:o,requestId:s,body:Rre(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:mp()})}catch(u){throw pl({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new Nr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Hc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw pl({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Nr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Hc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Ev(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(Tc({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Id({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});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,o,s,i=[]){let r=jc(this.origin,n);if(s){const h=new URLSearchParams;for(const[m,y]of Object.entries(s))y!==void 0&&h.set(m,String(y));const p=h.toString();p&&(r=`${r}?${p}`)}const l=gp(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();fp({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:mp()})}catch(h){throw pl({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new Nr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Hc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw pl({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new Nr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Hc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Ev(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(Tc({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}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new Id({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=KE();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===ZE)&&Fre()}}const Pre="kimi-code.bearer.",Hre=3e4;class Wre{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),Nc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=KE(),n=t!==void 0?[`${Pre}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{Nc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));zie(i),this.handleFrame(i)}catch(i){Nc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{Nc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{Nc("close",s?{code:s.code,reason:s.reason,wasClean:s.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,Nc("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 o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),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,o){const s=vp(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(vp(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(vp(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)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Hre),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,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 o=n.session_id,s=n.terminal_id,i=n.seq,r=vp(o,s),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?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=_re(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.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 o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Wie(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function vp(e,t){return`${e}\0${t}`}function zre(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function _3(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function Tv(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 S3(e){return e==="auto_compact"||e==="manual_compact"}class Ure{http;config;constructor(t){this.config=t,this.http=new Dre(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:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Bi),hasMore:o.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 o=await this.http.post("/sessions",n);return Bi(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Bi(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Bi(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,thinkingEffort: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 getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return VE(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Bi(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(rk),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();_o("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Bi(o.session),messages:o.messages.items.map(rk),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(qE),pendingQuestions:o.pending_questions.map(jE),subagents:(o.subagents??[]).map(jp)};return _o("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw _o("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,..._3(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
302
- `).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:zre(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();_o("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Zie(n));return _o("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw _o("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,..._3(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.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 o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Bi(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Bi(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Bi)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Xie(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,tre(o));return{resolved:s.resolved,resolvedAt:s.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 o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(jp)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return jp(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(Tv)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return Tv(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Tv(o)}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(o=>({name:o.name,description:o.description,source:o.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(h3)])):void 0;return{items:s.items.map(h3),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return jc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Jd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return Jd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Jd(o)}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(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}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(ore)}async listProviders(){return(await this.http.get("/providers")).items.map(p3)}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 o=await this.http.post("/providers",n);return p3(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Nv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return Nv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return Nv(t)}async getConfig(){const t=await this.http.get("/config");return lk(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",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=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return lk(s)}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 t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,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 o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return jc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=SF(this.config.serverHttpUrl,this.config.clientId),o=kre(),s=new Wre(n,this.config.clientId,{onWireEvent:i=>{const r=sre(i),l=ire(i),a=nre(i);a.type==="historyCompacted"&&!S3(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=o.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!S3(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{o.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 s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function Nv(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let C3;function ht(){return C3??=new Ure(kF()),C3}const qre=["src","controls","muted"],jre=["src","alt"],XE=Je({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=oe(t.fileId?"":t.url),o=oe(null),s=oe(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await ht().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return et(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),An(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),ho(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),E("video",{key:0,ref_key:"mediaEl",ref:o,class:Ue(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,qre)):(x(),E("img",{key:1,ref_key:"mediaEl",ref:o,class:Ue(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,jre))}}),Vre=["title","data-kind"],Kre=["aria-label"],Gre={class:"att-tile"},Yre={class:"att-name"},Zre={key:1,class:"att-err"},Xre=["aria-label"],Qre=Je({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=D(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=D(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=D(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(x(),E("span",{class:Ue(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[w("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[w("span",Gre,[e.kind==="image"&&e.url?(x(),Se(XE,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(x(),Se(Ge,{key:1,name:"play",size:"sm"})):e.kind==="image"?(x(),Se(Ge,{key:2,name:"image",size:"sm"})):(x(),Se(Ge,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),w("span",Yre,R(l.value),1),e.uploading?(x(),Se(Us,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(x(),E("span",Zre,[ae(Ge,{name:"info",size:"sm"})])):ue("",!0)],8,Kre),e.removable?(x(),Se(an,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ie(()=>[w("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[ae(Ge,{name:"close",size:"sm"})],8,Xre)]),_:1},8,["text"])):ue("",!0)],10,Vre))}}),QE=dt(Qre,[["__scopeId","data-v-12ec975b"]]),Jre=["aria-label"],ele=120,tle=60,nle=Je({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*ele}ms`,"--moon-frame-fast-delay":`${o*tle}ms`}}return(o,s)=>(x(),E("span",{class:Ue(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),E(We,null,rt(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:on(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,Jre))}}),JE=dt(nle,[["__scopeId","data-v-a6b7ec07"]]),cr=oe(null),pu=oe(!1);function ib(e){const t=cr.value;!t||pu.value||(cr.value=null,t.resolve(e))}async function ole(){const e=cr.value;if(!(!e||pu.value)){if(!e.action){ib(!0);return}pu.value=!0;try{await e.action(),cr.value===e&&(cr.value=null),e.resolve(!0)}catch(t){cr.value===e&&(cr.value=null),e.reject(t)}finally{pu.value=!1}}}function sle(e){return pu.value?Promise.resolve(!1):(cr.value&&ib(!1),new Promise((t,n)=>{cr.value={...e,resolve:t,reject:n}}))}function Gf(){return{current:cr,busy:pu,confirm:sle,settle:ib,runAction:ole}}const ile=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,rle=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,lle=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,A3="text/plain;charset=utf-8";function ale(e,t){const n=(t??"").toLowerCase();if(ile.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:A3;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:rle.test(o)?A3:lle.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function eT(e,t,n){const o=ale(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await ht().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const cle={class:"chat"},ule={key:0,class:"chat-loading"},dle={class:"chat-loading-text"},fle={key:1,class:"chat-empty"},hle={key:1,class:"top-sentinel-text"},ple={key:0,class:"u-turn"},mle=["data-turn-id"],gle={key:0,class:"u-atts"},vle={key:1,class:"skill-act"},yle={class:"skill-act-head"},kle={key:0,class:"skill-act-args"},ble={key:2,class:"skill-act"},xle={class:"skill-act-head"},wle={key:0,class:"skill-act-args"},_le={key:3,class:"u-text"},Sle={key:0,class:"u-meta"},Cle=["aria-label","onClick"],Ale=["aria-label","onClick"],Mle=["data-turn-id"],Ele=["onClick"],Tle={class:"cd-view"},Nle={key:1,class:"cd-label"},Ile=["data-turn-id"],Lle={key:1,class:"msg"},$le={key:0,class:"a-msg-ft"},Fle={key:0,class:"a-duration"},Ole=["aria-label","onClick"],Ble={key:4,class:"sending-placeholder"},Rle={key:5,class:"q-stack"},Dle={class:"q-head"},Ple={class:"q-title"},Hle={class:"q-hint"},Wle=["onDragover","onDrop"],zle={class:"u-bub q-bub"},Ule=["title","onDragstart"],qle=["title","onClick"],jle={key:0,class:"u-text q-text"},Vle={key:1,class:"q-text q-text-placeholder"},Kle={key:0,class:"q-imgs"},Gle={key:0,class:"q-file"},Yle={key:1,class:"q-tag q-tag-next"},Zle={key:2,class:"q-tag q-tag-idx"},Xle=["aria-label","onClick"],Qle={key:0,class:"open-unsupported",role:"status"},Jle=2500,eae=Je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{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},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=$t(),{confirm:s}=Gf();On(()=>{ie!==null&&(clearTimeout(ie),ie=null),B!==null&&(clearTimeout(B),B=null),$!==null&&(clearTimeout($),$=null),j!==null&&(clearTimeout(j),j=null)});const i=e,r=oe(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(he=>{he[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}An(a),On(()=>{l?.disconnect(),l=null}),et(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{yt().then(a)});const c=D(()=>{if(!i.turnActive||i.turns.length===0)return null;const he=i.turns.at(-1);return he.role==="assistant"?he.id:null}),u=D(()=>i.working),d=n,f=oe(null),h=oe(null);function p(he){return(he.attachments?.length??0)>0}function m(he){d("editQueued",he)}function y(he,Ae){if(f.value=he,!Ae.dataTransfer)return;Ae.dataTransfer.effectAllowed="move",Ae.dataTransfer.setData("text/plain",String(he));const re=Ae.currentTarget?.closest(".q-turn");re&&Ae.dataTransfer.setDragImage(re,24,24)}function k(he,Ae){if(f.value===null)return;Ae.preventDefault(),Ae.dataTransfer&&(Ae.dataTransfer.dropEffect="move");const re=Ae.currentTarget.getBoundingClientRect(),Y=Ae.clientY<re.top+re.height/2?"before":"after";h.value={index:he,position:Y}}function g(he,Ae){Ae.preventDefault();const re=f.value,Y=h.value?.position??"before";if(f.value=null,h.value=null,re===null)return;let Q=Y==="before"?he:he+1;re<Q&&(Q-=1),re!==Q&&d("reorderQueue",{from:re,to:Q})}function v(){f.value=null,h.value=null}const b=D(()=>{for(let he=i.turns.length-1;he>=0;he--)if(i.turns[he].role==="user")return i.turns[he].id;return null});function A(he){return he.role==="user"&&he.id===b.value&&!i.working&&!he.skillActivation&&!he.pluginCommand}function I(he){const Ae=he.compaction,re=Ae?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof Ae?.tokensBefore=="number"&&typeof Ae?.tokensAfter=="number"?re+o("conversation.compactedTokens",{before:pr(Ae.tokensBefore),after:pr(Ae.tokensAfter)}):re}const N=oe(null),M=oe(null);let $=null;async function T(he){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(he)}function F(he){M.value===null&&(M.value=he.id,d("editMessage",{text:he.text,attachments:he.attachments}),$=setTimeout(()=>{$=null,M.value=null},Jle))}et(()=>i.turns,he=>{M.value!==null&&(he.some(Ae=>Ae.id===M.value)||(M.value=null,$!==null&&(clearTimeout($),$=null)))},{flush:"post"});const S=oe(!1);let B=null;function W(){if(i.turns.length===0)return;const he=[];for(const re of i.turns){if(re.role==="compaction"||re.role==="cron")continue;const Y=re.role==="user"?"User":"Assistant",Q=wq(re);Q.trim()&&he.push(`**${Y}**
303
-
304
- ${Q}`)}const Ae=he.join(`
305
-
306
- ---
307
-
308
- `);Jo(Ae).then(re=>{re&&(S.value=!0,d("copyConversationCopied"),B!==null&&clearTimeout(B),B=setTimeout(()=>{B=null,S.value=!1},2e3))}).catch(()=>{})}function z(he){const Ae=[];for(let re=he;re>=0;re--){const Y=i.turns[re];if(!Y||Y.role!=="assistant")break;Ae.unshift(Y)}return Ae}function L(he){return z(he).map(Ae=>xq(Ae)).filter(Boolean).join(`
309
-
310
- `)}function O(){for(let he=i.turns.length-1;he>=0;he-=1)if(i.turns[he]?.role==="assistant")return L(he);return""}function U(){const he=O();he.trim()&&Jo(he).then(Ae=>{Ae&&(S.value=!0,d("copyConversationCopied"),B!==null&&clearTimeout(B),B=setTimeout(()=>{B=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:W,copyFinalSummary:U});function Z(he){const Ae=i.turns[he];if(!Ae||Ae.role!=="assistant")return!1;const re=i.turns[he+1];return!re||re.role!=="assistant"}let ie=null;function q(he){const Ae=i.turns[he];if(!Ae)return;const re=L(he);re.trim()&&Jo(re).then(Y=>{Y&&(N.value=Ae.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,N.value=null},1400))}).catch(()=>{})}function ee(he){const Ae=he.text;Ae.trim()&&Jo(Ae).then(re=>{re&&(N.value=he.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,N.value=null},1400))}).catch(()=>{})}function fe(he){return{kind:he.kind==="video"?"video":"image",url:he.url,path:he.name,fileId:he.fileId}}const ne=oe(null);let j=null;function K(he){if(he.kind==="image"||he.kind==="video"){d("openMedia",fe(he));return}he.fileId!==void 0&&eT(he.fileId,he.name,he.mediaType).then(Ae=>{Ae==="unsupported"&&(ne.value=he.name??he.fileId??"",j!==null&&clearTimeout(j),j=setTimeout(()=>{j=null,ne.value=null},2400))})}function ve(he,Ae){return he.id!==c.value?!1:Ae.sourceIndex===$1(he).length-1}return(he,Ae)=>(x(),E(We,null,[w("div",cle,[e.sessionLoading?(x(),E("div",ule,[ae(Us,{size:"sm"}),w("span",dle,R(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),E("div",fle)):ue("",!0),e.hasMoreMessages||e.loadingMore?(x(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Ue(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),E("span",hle,[ae(Us,{size:"sm"}),ot(" "+R(C(o)("conversation.loadingOlder")),1)])):(x(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ae[0]||(Ae[0]=re=>d("loadOlderMessages"))},R(C(o)("conversation.loadOlder")),1))],2)):ue("",!0),(x(!0),E(We,null,rt(e.turns,(re,Y)=>(x(),E(We,{key:re.id},[re.role==="user"?(x(),E("div",ple,[w("div",{class:Ue(["u-bub turn-anchor",{undoing:M.value===re.id}]),"data-turn-id":re.id},[re.attachments&&re.attachments.length>0?(x(),E("div",gle,[(x(!0),E(We,null,rt(re.attachments,(Q,P)=>(x(),Se(QE,{key:P,kind:Q.kind,name:Q.name,url:Q.url,"file-id":Q.fileId,"media-type":Q.mediaType,size:Q.size,onActivate:G=>K(Q)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ue("",!0),re.skillActivation?(x(),E("div",vle,[w("div",yle,[Ae[9]||(Ae[9]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,R(C(o)("conversation.activatedSkill",{name:re.skillActivation.name})),1)]),re.skillActivation.args?(x(),E("div",kle,R(re.skillActivation.args),1)):ue("",!0)])):re.pluginCommand?(x(),E("div",ble,[w("div",xle,[Ae[10]||(Ae[10]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,"/"+R(re.pluginCommand.pluginId)+":"+R(re.pluginCommand.commandName),1)]),re.pluginCommand.args?(x(),E("div",wle,R(re.pluginCommand.args),1)):ue("",!0)])):(x(),E("div",_le,R(re.text),1))],10,mle),re.createdAt||A(re)?(x(),E("div",Sle,[A(re)?(x(),E("div",{key:0,class:Ue(["u-edit-wrap",{undoing:M.value===re.id}])},[w("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:Q=>T(re)},[ae(Ge,{name:"undo",size:"sm"})],8,Cle)],2)):ue("",!0),re.text.trim().length>0?(x(),E("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:St(Q=>ee(re),["stop"])},[N.value!==re.id?(x(),Se(Ge,{key:0,name:"copy",size:"sm"})):(x(),Se(Ge,{key:1,name:"check",size:"sm"}))],8,Ale)):ue("",!0),re.createdAt?(x(),Se(HE,{key:2,time:re.createdAt},null,8,["time"])):ue("",!0)])):ue("",!0)])):re.role==="compaction"?(x(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":re.id,role:"separator"},[Ae[11]||(Ae[11]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1)),re.text?(x(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:Q=>d("openCompaction",{turnId:re.id})},[w("span",null,R(I(re)),1),w("span",Tle,R(C(o)("conversation.viewSummary")),1)],8,Ele)):(x(),E("span",Nle,R(I(re)),1)),Ae[12]||(Ae[12]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Mle)):re.role==="cron"?(x(),Se(Iie,{key:2,text:re.text,cron:re.cron,"turn-id":re.id,"created-at":re.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),E("div",{key:3,class:"a-msg turn-anchor","data-turn-id":re.id},[(x(!0),E(We,null,rt(C(bq)(re),(Q,P)=>(x(),E(We,{key:C(_q)(Q,P)},[Q.kind==="thinking"?(x(),Se(uie,{key:0,text:Q.thinking,mobile:"",streaming:ve(re,Q),onOpen:G=>d("openThinking",{turnId:re.id,blockIndex:Q.sourceIndex})},null,8,["text","streaming","onOpen"])):Q.kind==="text"&&Q.text?(x(),E("div",Lle,[ae(Q1,{text:Q.text,streaming:ve(re,Q),"open-file":G=>d("openFile",G)},null,8,["text","streaming","open-file"])])):Q.kind==="tool-stack"?(x(),Se(Nq,{key:2,tools:Q.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[1]||(Ae[1]=G=>d("openMedia",G)),onOpenFile:Ae[2]||(Ae[2]=G=>d("openFile",G)),onOpenToolDiff:Ae[3]||(Ae[3]=G=>d("openToolDiff",G)),onOpenAgent:Ae[4]||(Ae[4]=G=>d("openAgent",G))},null,8,["tools","tool-diff-panel"])):Q.kind==="tool"?(x(),Se(A6,{key:3,tool:Q.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[5]||(Ae[5]=G=>d("openMedia",G)),onOpenFile:Ae[6]||(Ae[6]=G=>d("openFile",G)),onOpenToolDiff:Ae[7]||(Ae[7]=G=>d("openToolDiff",G)),onOpenAgent:Ae[8]||(Ae[8]=G=>d("openAgent",G))},null,8,["tool","tool-diff-panel"])):ue("",!0)],64))),128)),re.id!==c.value&&Z(Y)&&(L(Y).trim().length>0||re.durationMs!==void 0)?(x(),E("div",$le,[ae(an,{text:`${re.durationMs} ms`},{default:Ie(()=>[re.durationMs!==void 0?(x(),E("span",Fle,R(C(vq)(re.durationMs)),1)):ue("",!0)]),_:2},1032,["text"]),L(Y).trim().length>0?(x(),E("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:Q=>q(Y)},[N.value!==re.id?(x(),Se(Ge,{key:0,name:"copy",size:"sm"})):(x(),Se(Ge,{key:1,name:"check",size:"sm"}))],8,Ole)):ue("",!0)])):ue("",!0)],8,Ile))],64))),128)),e.compaction?(x(),Se(mie,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ue("",!0),u.value?(x(),E("div",Ble,[ae(JE,{fast:e.fastMoon},null,8,["fast"])])):ue("",!0),e.queued.length>0?(x(),E("div",Rle,[w("div",Dle,[w("span",Ple,[ae(Ge,{name:"mail",size:"sm"}),ot(" "+R(C(o)("composer.queueLabel"))+" · ",1),w("b",null,R(e.queued.length),1)]),w("span",Hle,R(C(o)("composer.queueAutoDrain")),1)]),(x(!0),E(We,null,rt(e.queued,(re,Y)=>(x(),E("div",{key:Y,class:Ue(["u-turn q-turn",{"q-dragging":f.value===Y,"drop-before":h.value?.index===Y&&h.value.position==="before","drop-after":h.value?.index===Y&&h.value.position==="after"}]),onDragover:Q=>k(Y,Q),onDrop:Q=>g(Y,Q)},[w("div",zle,[w("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:Q=>y(Y,Q),onDragend:v},[ae(Ge,{name:"grip",size:"sm"})],40,Ule),w("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:Q=>m(Y)},[re.text?(x(),E("span",jle,R(re.text),1)):(x(),E("span",Vle,[ae(Ge,{name:"file",size:"sm"}),ot(" "+R(C(o)("composer.queuedAttachments",{n:re.attachments?.length??0})),1)]))],8,qle),p(re)?(x(),E("div",Kle,[(x(!0),E(We,null,rt(re.attachments,(Q,P)=>(x(),E(We,{key:P},[Q.kind==="file"?(x(),E("span",Gle,[ae(Ge,{name:"file",size:"sm"}),ot(" "+R(Q.name??Q.fileId),1)])):(x(),Se(XE,{key:1,url:Q.url,kind:Q.kind,"file-id":Q.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ue("",!0),Y===0?(x(),E("span",Yle,R(C(o)("composer.queueNext")),1)):(x(),E("span",Zle,"#"+R(Y+1),1)),w("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:St(Q=>d("unqueue",Y),["stop"])},[ae(Ge,{name:"close",size:"sm"})],8,Xle)])],42,Wle))),128))])):ue("",!0)]),ne.value!==null?(x(),E("div",Qle,R(C(o)("composer.attachmentOpenUnsupported",{name:ne.value})),1)):ue("",!0)],64))}}),tT=dt(eae,[["__scopeId","data-v-d2cc4eff"]]),tae={class:"ch-id"},nae={key:0,class:"ch-ws"},oae={key:1,class:"ch-sep"},sae=["onKeydown"],iae={class:"ch-ses"},rae={key:0,class:"ch-pill ch-sync-pill"},lae={key:0,class:"ch-ahead"},aae={key:1,class:"ch-behind"},cae={key:1,class:"ch-pill ch-diff-pill"},uae={key:0,class:"ch-add"},dae={key:1,class:"ch-del"},fae=Je({__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","exportSession"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D(()=>o.ahead??0),r=D(()=>o.behind??0),l=D(()=>o.gitDiffStats?.totalAdditions??0),a=D(()=>o.gitDiffStats?.totalDeletions??0),c=D(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function f(Z){const ie=d(Z);return u[ie]?`pr-${ie}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=oe(!1),m=oe(null),y=oe(null),k=oe({});function g(Z){const ie=Z.target;y.value?.el?.contains(ie)||m.value?.el?.contains(ie)||A()}function v(){A()}async function b(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",g),window.addEventListener("resize",v),await yt();const ie=m.value?.el,q=y.value?.el;if(!ie||!q)return;const ee=ie.getBoundingClientRect(),fe=4,ne=8,j=q.offsetWidth,K=q.offsetHeight;let ve=ee.bottom+fe;ve+K>window.innerHeight-ne&&(ve=Math.max(ne,ee.top-K-fe));let he=ee.left;he+j>window.innerWidth-ne&&(he=Math.max(ne,ee.right-j)),k.value={top:`${Math.round(ve)}px`,left:`${Math.round(he)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)}On(()=>{document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)});function I(){s("copyAll"),A()}function N(){s("copyFinalSummary"),A()}const M=oe(!1);function $(){o.sessionId&&Jo(o.sessionId).then(Z=>{Z&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const T=oe(!1),F=oe(""),S=oe(null);async function B(){if(A(),!!o.sessionId){T.value=!0,F.value=o.sessionTitle??"",await yt();try{S.value?.focus(),S.value?.select()}catch{}}}function W(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),T.value=!1}function z(){T.value=!1}function L(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function O(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function U(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,ie)=>(x(),E("header",{class:Ue(["chat-header",{"macos-desktop":C(iu)}])},[w("div",tae,[e.workspaceName?(x(),E("span",nae,R(e.workspaceName),1)):ue("",!0),e.workspaceName&&e.sessionTitle?(x(),E("span",oae,"/")):ue("",!0),T.value?qn((x(),E("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":ie[0]||(ie[0]=q=>F.value=q),class:"ch-rename",type:"text",onKeydown:[ur(St(W,["stop"]),["enter"]),ur(St(z,["stop"]),["esc"])],onBlur:W,onClick:ie[1]||(ie[1]=St(()=>{},["stop"]))},null,40,sae)),[[Cs,F.value]]):e.sessionTitle?(x(),Se(an,{key:3,text:e.sessionTitle},{default:Ie(()=>[w("span",iae,R(e.sessionTitle),1)]),_:1},8,["text"])):ue("",!0)]),ae(Xn,{ref_key:"kebabRef",ref:m,class:Ue(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:ie[2]||(ie[2]=St(q=>b(q),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(x(),Se(Ml,{key:0,ref_key:"menuRef",ref:y,class:"ch-menu",style:on(k.value),onClick:ie[3]||(ie[3]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{onClick:I},{default:Ie(()=>[ae(Ge,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),ot(" "+R(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ae(Tn,{onClick:N},{default:Ie(()=>[ae(Ge,{name:"file-text",size:"sm"}),ot(" "+R(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),E(We,{key:0},[ae(Tn,{separator:""}),ae(Tn,{onClick:$},{default:Ie(()=>[ae(Ge,{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),ot(" "+R(M.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ae(Tn,{onClick:B},{default:Ie(()=>[ae(Ge,{name:"pencil",size:"sm"}),ot(" "+R(C(n)("header.renameSession")),1)]),_:1}),ae(Tn,{onClick:L},{default:Ie(()=>[ae(Ge,{name:"git-fork",size:"sm"}),ot(" "+R(C(n)("header.forkSession")),1)]),_:1}),ae(Tn,{onClick:O},{default:Ie(()=>[ae(Ge,{name:"download",size:"sm"}),ot(" "+R(C(n)("header.exportSession")),1)]),_:1}),ae(Tn,{danger:"",onClick:U},{default:Ie(()=>[ae(Ge,{name:"archive",size:"sm"}),ot(" "+R(C(n)("header.archiveSession")),1)]),_:1})],64)):ue("",!0)]),_:1},8,["style"])):ue("",!0),ie[6]||(ie[6]=w("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),E("button",{key:1,type:"button",class:"ch-git",onClick:ie[4]||(ie[4]=q=>s("openChanges"))},[w("span",{class:Ue(["ch-branch",{"ch-detached":!e.branch}])},R(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(x(),E("span",rae,[i.value>0?(x(),E("span",lae,"↑"+R(i.value),1)):ue("",!0),r.value>0?(x(),E("span",aae,"↓"+R(r.value),1)):ue("",!0)])):ue("",!0),c.value?(x(),E("span",cae,[l.value>0?(x(),E("span",uae,"+"+R(l.value),1)):ue("",!0),a.value>0?(x(),E("span",dae,"-"+R(a.value),1)):ue("",!0)])):ue("",!0)])):ue("",!0),e.pr?(x(),E("button",{key:2,type:"button",class:Ue(["ch-pill ch-pr",f(e.pr.state)]),onClick:ie[5]||(ie[5]=q=>e.pr&&s("openPr",e.pr.url))},[ae(Ge,{name:"git-pull-request",size:"sm"}),w("span",null,"PR #"+R(e.pr.number)+" · "+R(h(e.pr.state)),1)],2)):ue("",!0)],2))}}),hae=dt(fae,[["__scopeId","data-v-fa4451d4"]]),pae=["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"],M3=[[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 mae(e){if(e<=255)return pae[e];let t=0,n=M3.length-1;for(;t<=n;){const o=t+n>>1,s=M3[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function gae(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=mae(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function vae(e,t){const n=gae(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const yae=/[ \t\n\r\f]+/g,kae=/[\t\n\r\f]| {2,}|^ | $/;function bae(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function xae(e){if(!kae.test(e))return e;let t=e.replace(yae," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function wae(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
311
- `).replace(/[\r\f]/g,`
312
- `):e}let Iv=null,_ae;function Sae(){return Iv===null&&(Iv=new Intl.Segmenter(_ae,{granularity:"word"})),Iv}const Cae=/\p{Script=Arabic}/u,Xl=/\p{M}/u,rb=/\p{Nd}/u;function E3(e){return Cae.test(e)}function T3(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>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function mr(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 o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(T3(s))return!0;t++;continue}}if(T3(n))return!0}}return!1}function Aae(e){const t=Yf(e);return t!==null&&(lb.has(t)||Ga.has(t))}const Mae=new Set([" "," ","⁠","\uFEFF"]),Eae=new Set(["-","‐","–","—"]);function Tae(e){const t=Yf(e);return t!==null&&Mae.has(t)}function Nae(e){const t=Yf(e);return t!==null&&Eae.has(t)}function nT(e,t){return Tae(e)?!1:t?!(Aae(e)||Nae(e)):!0}const lb=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),J1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),ab=new Set(["'","’"]),Ga=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Iae=new Set([":",".","،","؛"]),Lae=new Set(["၏"]),$ae=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Fae(e){if(cb(e))return!0;let t=!1;for(const n of e){if(Ga.has(n)||t0(n)){t=!0;continue}if(!(t&&Xl.test(n)))return!1}return t}function Oae(e){for(const t of e)if(!lb.has(t)&&!Ga.has(t))return!1;return e.length>0}function Bae(e){if(cb(e))return!0;for(const t of e)if(!J1.has(t)&&!ab.has(t)&&!Xl.test(t)&&!t0(t))return!1;return e.length>0}function cb(e){let t=!1;for(const n of e)if(!(n==="\\"||Xl.test(n))){if(J1.has(n)||Ga.has(n)||ab.has(n)){t=!0;continue}return!1}return t}function e0(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Yf(e){if(e.length===0)return null;const t=e0(e,e.length);return e.slice(t)}function Rae(e){for(const t of e)if(!Xl.test(t))return t;return null}function Dae(e){for(let t=e.length;t>0;){const n=e0(e,t),o=e.slice(n,t);if(!Xl.test(o))return o;t=n}return null}const Pae=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Hae(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function t0(e){const t=e.codePointAt(0);return t!==void 0&&Hae(t,Pae)}function Wae(e){const t=Dae(e);return t!==null&&t0(t)}function zae(e){const t=Rae(e);return t!==null&&rb.test(t)}function Uae(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Xl.test(o)){n--;continue}if(J1.has(o)||ab.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function qae(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function N3(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function I3(e,t){return e&&t!==null&&Iae.has(t)}function jae(e){const t=Yf(e);return t!==null&&Lae.has(t)}function Vae(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function dk(e){let t=e.length;for(;t>0;){const n=e0(e,t),o=e.slice(n,t);if($ae.has(o))return!0;if(!Ga.has(o))return!1;t=n}return!1}function Kae(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
313
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Gae=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ji(e){return e.length===1?e[0]:e.join("")}function Yae(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),ji(n)}function Zae(e,t,n,o){if(!Gae.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Kae(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:ji(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:ji(r),isWordLike:a,kind:i,start:l}),s}function fk(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Xae=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Qae(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Xae.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Jae(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function ece(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!Qae(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!fk(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=ji(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function tce(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!Jae(r))continue;const l=i+1;if(l>=e.len||fk(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!fk(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(ji(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const nce=new Set([":","-","/","×",",",".","+","–","—"]),oce=/[\p{P}\p{S}\p{Co}]/u,sce=/\p{Emoji_Presentation}/u,ice=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function rce(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function oT(e){const t=e.charCodeAt(0);return t<128?rce(t):!ice.has(e)&&!sce.test(e)&&oce.test(e)}function L3(e){let t=!1;for(const n of e)if(!Xl.test(n)){if(!oT(n))return!1;t=!0}return t}function lce(e){for(let t=e.length;t>0;){const n=e0(e,t),o=e.slice(n,t);if(Xl.test(o)){t=n;continue}return oT(o)||t0(o)}return!1}function ace(e,t,n,o){const s=!t&&L3(e),i=!o&&L3(n),r=Wae(e),l=(t||r)&&lce(e);return!s&&!i&&!l||mr(e)||mr(n)?!1:(t||s||r)&&(o||i)}function sT(e){for(const t of e)if(rb.test(t))return!0;return!1}function Gm(e){if(e.length===0)return!1;for(const t of e)if(!(rb.test(t)||nce.has(t)))return!1;return!0}function cce(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Gm(r)&&sT(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Gm(e.texts[c]);)a.push(e.texts[c]),c++;t.push(ji(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function uce(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&ace(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(ji(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function dce(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!sT(u)||!Gm(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function fce(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=ji(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=ji(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(ji(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function hce(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!mr(t[i])||!mr(t[i+1]))continue;const r=Uae(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function pce(e,t,n){const o=Sae();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],y=[];for(const I of o.segment(e))for(const N of Zae(I.segment,I.isWordLike??!1,I.index,n)){let L=function(){u[z]!==null&&(r[z]=[N3(i,u,d,z)],u[z]=null),r[z].push(N.text),l[z]=l[z]||N.isWordLike,f[z]=f[z]||T,h[z]=h[z]||F,p[z]=B,m[z]=W,y[z]=I3(h[z],S)};const M=N.kind==="text",$=qae(N.text,N.isWordLike,N.kind),T=mr(N.text),F=E3(N.text),S=Yf(N.text),B=dk(N.text),W=jae(N.text),z=s-1;t.carryCJKAfterClosingQuote&&M&&s>0&&a[z]==="text"&&T&&f[z]&&p[z]||M&&s>0&&a[z]==="text"&&Oae(N.text)&&f[z]||M&&s>0&&a[z]==="text"&&m[z]?L():M&&s>0&&a[z]==="text"&&N.isWordLike&&F&&y[z]?(L(),l[z]=!0):$!==null&&s>0&&a[z]==="text"&&u[z]===$?d[z]=(d[z]??1)+1:M&&!N.isWordLike&&s>0&&a[z]==="text"&&!f[z]&&(Fae(N.text)||N.text==="-"&&l[z])?L():(i[s]=N.text,r[s]=[N.text],l[s]=N.isWordLike,a[s]=N.kind,c[s]=N.start,u[s]=$,d[s]=$===null?0:1,f[s]=T,h[s]=F,p[s]=B,m[s]=W,y[s]=I3(F,S),s++)}for(let I=0;I<s;I++){if(u[I]!==null){i[I]=N3(i,u,d,I);continue}i[I]=ji(r[I])}for(let I=1;I<s;I++)a[I]==="text"&&!l[I]&&cb(i[I])&&a[I-1]==="text"&&!f[I-1]&&(i[I-1]+=i[I],l[I-1]=l[I-1]||l[I],i[I]="");const k=Array.from({length:s},()=>null);let g=-1;for(let I=s-1;I>=0;I--){const N=i[I];if(N.length!==0){if(a[I]==="text"&&!l[I]&&g>=0&&a[g]==="text"&&(Bae(N)||N==="-"&&zae(i[g]))){const M=k[g]??[];M.push(N),k[g]=M,c[g]=c[I],i[I]="";continue}g=I}}for(let I=0;I<s;I++){const N=k[I];N!=null&&(i[I]=Yae(N,i[I]))}let v=0;for(let I=0;I<s;I++){const N=i[I];N.length!==0&&(v!==I&&(i[v]=N,l[v]=l[I],a[v]=a[I],c[v]=c[I]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const b=fce({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=hce(uce(dce(cce(tce(ece(b))))));for(let I=0;I<A.len-1;I++){const N=Vae(A.texts[I]);N!==null&&(A.kinds[I]!=="space"&&A.kinds[I]!=="preserved-space"||A.kinds[I+1]!=="text"||!E3(A.texts[I+1])||(A.texts[I]=N.space,A.isWordLike[I]=!1,A.kinds[I]=A.kinds[I]==="preserved-space"?"preserved-space":"space",A.texts[I+1]=N.marks+A.texts[I+1],A.starts[I+1]=A.starts[I]+N.space.length))}return A}function mce(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function gce(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let k=f;k<h;k++)p=p||t.isWordLike[k];const m=t.starts[f],y=h<t.len?t.starts[h]:e.length;o.push(e.slice(m,y)),s.push(p),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!nT(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||mr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function vce(e,t,n="normal",o="normal"){const s=bae(n),i=s.mode==="pre-wrap"?wae(e):xae(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=pce(i,t,s),l=o==="keep-all"?gce(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:mce(l,s),...l}}let Lc=null;const $3=new Map;let $c=null;const yce=96,kce=/\p{Emoji_Presentation}/u,bce=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Lv=null;const F3=new Map;function ub(){if(Lc!==null)return Lc;if(typeof OffscreenCanvas<"u")return Lc=new OffscreenCanvas(1,1).getContext("2d"),Lc;if(typeof document<"u")return Lc=document.createElement("canvas").getContext("2d"),Lc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function xce(e){let t=$3.get(e);return t||(t=new Map,$3.set(e,t)),t}function Nl(e,t){let n=t.get(e);return n===void 0&&(n={width:ub().measureText(e).width,containsCJK:mr(e)},t.set(e,n)),n}function n0(){if($c!==null)return $c;if(typeof navigator>"u")return $c={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},$c;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return $c={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},$c}function wce(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function iT(){return Lv===null&&(Lv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Lv}function _ce(e){return kce.test(e)||e.includes("️")}function Sce(e){return bce.test(e)}function Cce(e,t){let n=F3.get(e);if(n!==void 0)return n;const o=ub();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return F3.set(e,n),n}function Ace(e){let t=0;const n=iT();for(const o of n.segment(e))_ce(o.segment)&&t++;return t}function Mce(e,t){return t.emojiCount===void 0&&(t.emojiCount=Ace(e)),t.emojiCount}function La(e,t,n){return n===0?t.width:t.width-Mce(e,t)*n}function Ece(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=iT(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=Nl(d,n);u.push(La(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>yce){const u=[];let d=null,f=0;for(const h of r){const p=Nl(h,n),m=La(h,p,o);if(d===null)u.push(m);else{const y=d+h,k=Nl(y,n);u.push(La(y,k,o)-f)}d=h,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=Nl(a,n),f=La(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Tce(e,t){const n=ub();n.font=e;const o=xce(e),s=wce(e),i=t?Cce(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function Nce(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function rT(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function lT(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!Nce(o))break;t++}return t}function Ice(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Lce(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function db(e,t){return t===0?0:e+t}function $ce(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Fce(e,t,n,o,s){const i=t==="tab"?s+$ce(e,n):e.lineEndFitAdvances[n];return db(o,i)}function O3(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return db(o,s)}function B3(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return db(o,i)}function Oce(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Bce(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ym(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Rce(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Dce(e,t,n,o,s,i){return t+Rce(e,n,o,s,i)}function Pce(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=n0().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,y=0,k=-1,g=0;function v(){k=-1,g=0}function b(T=m,F=y,S=d){u++,n?.(S,h,p,T,F),d=0,f=!1,v()}function A(T,F){f=!0,h=T,p=0,m=T+1,y=0,d=F}function I(T,F,S){f=!0,h=T,p=F,m=T,y=F+1,d=S}function N(T,F){if(!f){A(T,F);return}d+=F,m=T+1,y=0}function M(T,F){const S=i[T],B=r[T]??null;let W=B===null?-1:Ym(B,0,F+1),z=-1,L=0,O=F;for(;O<S.length;){const U=S[O];if(!f)I(T,O,U);else if(d+U>c){if(B!==null&&z>F){b(T,z,L),O=z,W=Ym(B,W,O+1),z=-1,L=0;continue}b(),I(T,O,U)}else d+=U,m=T,y=O+1;const Z=O+1;B!==null&&B[W]===Z&&(z=Z,L=d,W++),O++}f&&m===T&&y===S.length&&(m=T+1,y=0)}let $=0;for(;$<o.length&&!(!f&&($=lT(e,$),$>=o.length));){const T=o[$],F=s[$],S=rT(F);if(!f){T>c&&i[$]!==null?M($,0):A($,T),S&&(k=$+1,g=d-T),$++;continue}if(d+T>c){if(S){N($,T),b($+1,0,d-T),$++;continue}if(k>=0){if(m>k||m===k&&y>0){b();continue}b(k,0,g);continue}if(T>c&&i[$]!==null){b(),M($,0),$++;continue}b();continue}N($,T),S&&(k=$+1,g=d-T),$++}return f&&b(),u}function Hce(e,t,n){if(e.simpleLineWalkFastPath)return Pce(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=n0(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,y=0,k=0,g=0,v=-1,b=0,A=0,I=null;function N(){v=-1,b=0,A=0,I=null}function M(){return I==="soft-hyphen"&&v===k&&g===0?A:h}function $(L=k,O=g,U){f++,n!==void 0&&n(Dce(e,U??M(),m,y,L,O),m,y,L,O),h=0,p=!1,N()}function T(L,O){p=!0,m=L,y=0,k=L+1,g=0,h=O}function F(L,O,U){p=!0,m=L,y=O,k=L,g=O+1,h=U}function S(L,O){if(!p){T(L,O);return}h+=O,k=L+1,g=0}function B(L,O,U,Z,ie,q){if(!O)return;const ee=O3(e,L,U,ie),fe=B3(e,L,U,ie,Z);v=U+1,b=h-q+ee,A=h-q+fe,I=L}function W(L,O){const U=i[L],Z=r[L]??null;let ie=Z===null?-1:Ym(Z,0,O+1),q=-1,ee=0,fe=O;for(;fe<U.length;){const ne=U[fe];if(!p)F(L,fe,ne);else{const K=Oce(e,!0,ne),ve=h+K;if(Bce(e,ve)>d){if(Z!==null&&q>O){$(L,q,ee),fe=q,ie=Ym(Z,ie,fe+1),q=-1,ee=0;continue}$(),F(L,fe,ne)}else h=ve,k=L,g=fe+1}const j=fe+1;Z!==null&&Z[ie]===j&&(q=j,ee=h,ie++),fe++}p&&k===L&&g===U.length&&(k=L+1,g=0)}function z(L){f++,n?.(0,L.startSegmentIndex,0,L.consumedEndSegmentIndex,0),N()}for(let L=0;L<a.length;L++){const O=a[L];if(O.startSegmentIndex===O.endSegmentIndex){z(O);continue}p=!1,h=0,m=O.startSegmentIndex,y=0,k=O.startSegmentIndex,g=0,N();let U=O.startSegmentIndex;for(;U<O.endSegmentIndex&&!(!p&&(U=lT(e,U,O.endSegmentIndex),U>=O.endSegmentIndex));){const Z=s[U],ie=rT(Z),q=Lce(e,p,U),ee=Z==="tab"?Ice(h+q,e.tabStopAdvance):o[U],fe=q+ee,ne=Fce(e,Z,U,q,ee);if(Z==="soft-hyphen"){p&&(k=U+1,g=0,v=U+1,b=h+l,A=h+l,I=Z),U++;continue}if(!p){ne>d&&i[U]!==null?W(U,0):T(U,ee),B(Z,ie,U,ee,q,fe),U++;continue}if(h+ne>d){const K=h+O3(e,Z,U,q),ve=h+B3(e,Z,U,q,ee);if(I==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){$(v,0,A);continue}if(ie&&K<=d){S(U,fe),$(U+1,0,ve),U++;continue}if(v>=0&&b<=d){if(k>v||k===v&&g>0){$();continue}const he=v;$(he,0,A),U=he;continue}if(ne>d&&i[U]!==null){$(),W(U,0),U++;continue}$();continue}S(U,fe),B(Z,ie,U,ee,q,fe),U++}if(p){const Z=v===O.consumedEndSegmentIndex?A:h;$(O.consumedEndSegmentIndex,0,Z)}}return f}let $v=null;function fb(){return $v===null&&($v=new Intl.Segmenter(void 0,{granularity:"grapheme"})),$v}function Wce(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function zce(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=dk(d),l=J1.has(d)}function u(d,f){o.push(d),i=i||f;const h=dk(d);d.length===1&&Ga.has(d)?r=r||h:r=h,l=!1}for(const d of fb().segment(e)){const f=d.segment,h=mr(f);if(o.length===0){c(f,d.index,h);continue}if(l||lb.has(f)||Ga.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function Uce(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!nT(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||mr(c.text)}return l(t.length),o}function R3(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=fb();for(const s of o.segment(e))n++;return n}function qce(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function jce(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of fb().segment(e))n++,qce(o.segment)&&t.push(n);return t.length===0?null:t}function Vce(e,t,n){return t>1?e+(t-1)*n:e}function Kce(e,t,n,o,s){const i=n0(),{cache:r,emojiCorrection:l}=Tce(t,Sce(e.normalized)),a=La("-",Nl("-",r),l)+(s===0?0:s*2),u=La(" ",Nl(" ",r),l)*8,d=s!==0;if(e.len===0)return Wce();const f=[],h=[],p=[],m=[];let y=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],b=[],A=n?[]:null,I=Array.from({length:e.len});function N(F,S,B,W,z,L,O,U,Z){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(y=!1),f.push(S),h.push(B),p.push(W),m.push(z),k?.push(L),g.push(O),v.push(U),d&&b.push(Z),A!==null&&A.push(F)}function M(F,S,B,W,z){const L=Nl(F,r),O=d?R3(F,S):0,U=Vce(La(F,L,l),O,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,ie=Z===0?0:Z+(O>0?s:0),q=S==="space"||S==="zero-width-break"?0:U;if(z&&W&&F.length>1){let ee="sum-graphemes";s!==0?ee="segment-prefixes":Gm(F)?ee="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ee="segment-prefixes");const fe=Ece(F,L,r,l,ee),ne=fe===null||o==="keep-all"?null:jce(F);N(F,U,ie,q,S,B,fe,ne,O);return}N(F,U,ie,q,S,B,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const S=e.texts[F],B=e.isWordLike[F],W=e.kinds[F],z=e.starts[F];if(W==="soft-hyphen"){N(S,0,a,a,W,z,null,null,0);continue}if(W==="hard-break"){N(S,0,0,0,W,z,null,null,0);continue}if(W==="tab"){N(S,0,0,0,W,z,null,null,d?R3(S,W):0);continue}const L=Nl(S,r);if(W==="text"&&L.containsCJK){const O=zce(S,i),U=o==="keep-all"?Uce(S,O,i.breakKeepAllAfterPunctuation):O;for(let Z=0;Z<U.length;Z++){const ie=U[Z];M(ie.text,"text",z+ie.start,B,o==="keep-all"||!mr(ie.text))}continue}M(S,W,z,B,!0)}const $=Gce(e.chunks,I,f.length),T=k===null?null:vae(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:T,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:T,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$}}function Gce(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function Yce(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=vce(e,n0(),o?.whiteSpace,s);return Kce(r,t,n,s,i)}function Zce(e,t,n){return Yce(e,t,!0,n)}function Xce(e){let t=0;return Hce(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const Qce={key:0,class:"slash-menu",role:"listbox"},Jce=["aria-selected","onMouseenter","onMousedown"],eue={class:"slash-name"},tue={class:"slash-desc"},nue=Je({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe([]);return et(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),E("div",Qce,[(x(!0),E(We,null,rt(e.items,(a,c)=>(x(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Ue(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:St(u=>s("select",a),["prevent"])},[w("span",eue,R(a.name),1),w("span",tue,R(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Jce))),128))])):ue("",!0)}}),oue=dt(nue,[["__scopeId","data-v-f60b70d9"]]),sue={class:"mention-menu",role:"listbox"},iue={key:0,class:"mention-state dim"},rue={key:1,class:"mention-state dim"},lue=["aria-selected","onMouseenter","onMousedown"],aue=["innerHTML"],cue={class:"mention-name"},uue={class:"mention-path"},due=Je({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=Dc("folder","sm"),r=Dc("code","sm"),l=Dc("file-text","sm"),a=Dc("image","sm"),c=Dc("file","sm"),u=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"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const y=p.name||m.split("/").pop()||m,k=y.lastIndexOf("."),g=k>0?y.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(x(),E("div",sue,[n.loading?(x(),E("div",iue,R(C(s)("mention.searching")),1)):n.items.length===0?(x(),E("div",rue,R(C(s)("mention.noMatch")),1)):(x(!0),E(We,{key:2},rt(n.items,(y,k)=>(x(),E("div",{key:y.path,class:Ue(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>o("hover",k),onMousedown:St(g=>o("select",y),["prevent"])},[w("span",{class:"mention-icon",innerHTML:h(y),"aria-hidden":"true"},null,8,aue),w("span",cue,R(y.name),1),w("span",uue,R(y.path),1)],42,lue))),128))]))}}),fue=dt(due,[["__scopeId","data-v-f4d6b958"]]),aT=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.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:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function hue(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)}}const Zm="skill:";function pue(e){return e.startsWith(Zm)?e.slice(Zm.length):e}function cT(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Zm}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...aT,...t]}function mue(e,t=aT){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function o0(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 uT(e){return e?.supportEfforts??[]}function gue(e){return e[Math.floor(e.length/2)]}function Ef(e){if(o0(e)==="unsupported")return"off";const t=uT(e);return t.length>0?e?.defaultEffort??gue(t):"on"}function s0(e){const t=uT(e),n=o0(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function hk(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function vue(e){return e!=="off"}function yue(e,t){return s0(e).includes(t)}function hb(e,t){return t==="off"?"off":t==="on"?Ef(e):t}function Xm(e,t){return t??Ef(e)}function kue(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function bue(e,t,n){return!n||e===void 0?t:Ef(e)}const Qm=100;function xue(e){const t=N1(Dt.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Qm?n.slice(-Qm):n,s={[e]:o};return Df(Dt.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function wue(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=oe(xue(s())),r=D(()=>i.value[s()??""]??[]);let l=-1,a="";function c(k){const g=s();if(l=-1,!g)return;const v=k.trim();if(!v)return;const b=i.value[g]??[];if(b.at(-1)===v)return;const A=[...b,v],I=A.length>Qm?A.slice(-Qm):A;i.value={...i.value,[g]:I},Df(Dt.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,yt(()=>{const g=n.value;if(!g)return;o();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function h(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function y(){return r.value.length>0}return et(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:y}}function _ue(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=oe(!1),c=oe([]),u=oe(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=mue(h,cT(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,yt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function Sue(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=oe(!1),r=oe([]),l=oe(0),a=oe(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const y=h.slice(m,p);return y.startsWith("@")?{token:y.slice(1),start:m,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,yt(()=>{const y=n.value;if(!y)return;const k=p.start+h.path.length;y.setSelectionRange(k,k),y.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Cue(e){const{sessionId:t}=e;function n(c){return yo(M_(c))??""}function o(c,u){const d=M_(c);u?Eo(d,u):qa(d)}const s=oe(n(t())),i=oe(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}et(s,c=>{yt(r),o(t(),c)}),et(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),yt(r))});function l(c){s.value=c,yt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Aue(e){const{uploadImage:t,sessionId:n}=e,o=oe({}),s=D(()=>o.value[n()??""]??[]),i=oe(null),r=oe(null),l=oe(!1);let a=0;function c(){return`att_${++a}`}function u(O,U){o.value={...o.value,[O]:U}}function d(O){if(O.previewUrl!==void 0)try{URL.revokeObjectURL(O.previewUrl)}catch{}}function f(O){return O.startsWith("image/")?"image":O.startsWith("video/")?"video":"file"}async function h(O){const U=t();if(!U)return;const Z=n()??"";if(O.length!==0)for(const ie of O){const q=f(ie.type),ee=c(),fe=q==="file"?void 0:URL.createObjectURL(ie),ne={localId:ee,name:ie.name,kind:q,previewUrl:fe,mediaType:ie.type||"application/octet-stream",size:ie.size,uploading:!0};u(Z,[...o.value[Z]??[],ne]),U(ie,ie.name).then(j=>{const K=o.value[Z]??[];u(Z,K.map(ve=>ve.localId===ee?{...ve,uploading:!1,fileId:j?.fileId,mediaType:j?.mediaType??ve.mediaType,error:j===null}:ve))}).catch(()=>{const j=o.value[Z]??[];u(Z,j.map(K=>K.localId===ee?{...K,uploading:!1,error:!0}:K))})}}function p(O){const U=n()??"",Z=o.value[U]??[],ie=Z.find(q=>q.localId===O);i.value?.localId===O&&(i.value=null),ie&&d(ie),u(U,Z.filter(q=>q.localId!==O))}function m(O){i.value=O}function y(){i.value=null}function k(){r.value?.click()}function g(O){const U=O.target,Z=Array.from(U.files??[]);h(Z),U.value=""}function v(O){if(!t())return;const U=O.clipboardData;if(!U)return;const Z=[],ie=new Set,q=(ee,fe)=>{const ne=`${ee.size}:${ee.type}:${fe}`;if(ie.has(ne))return;ie.add(ne);const j=ee.type.split("/")[1]??"png",K=fe.includes(".")?fe:`paste-${Date.now()}.${j}`;Z.push(ee instanceof File?ee:new File([ee],K,{type:ee.type}))};for(const ee of Array.from(U.items))if(ee.kind==="file"){const fe=ee.getAsFile();fe&&q(fe,fe.name||`paste-${Date.now()}.${ee.type.split("/")[1]??"png"}`)}for(const ee of Array.from(U.files))q(ee,ee.name);Z.length!==0&&(O.preventDefault(),h(Z))}let b=0;function A(O){!t()||!Array.from(O.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(O.preventDefault(),O.stopPropagation(),l.value=!0)}function I(){l.value=!1}function N(O){if(b=0,l.value=!1,!t())return;O.preventDefault(),O.stopPropagation();const U=Array.from(O.dataTransfer?.files??[]);h(U)}function M(O){return Array.from(O.dataTransfer?.items??[]).some(U=>U.kind==="file")}function $(O){!t()||!M(O)||(O.preventDefault(),b+=1,l.value=!0)}function T(O){!t()||!M(O)||O.preventDefault()}function F(O){!t()||!M(O)||(b=Math.max(0,b-1),b===0&&(l.value=!1))}function S(O){if(b=0,l.value=!1,!t())return;O.preventDefault();const U=Array.from(O.dataTransfer?.files??[]);h(U)}function B(){const O=n()??"";for(const U of o.value[O]??[])d(U);u(O,[])}function W(O,U,Z){const ie=o.value[O]??[];ie.some(q=>q.localId===U)&&u(O,ie.map(q=>q.localId===U?{...q,...Z}:q))}function z(O){return fetch(O).then(U=>{if(!U.ok)throw new Error(`fetch failed: ${U.status}`);return U.blob()})}function L(O){const U=n()??"";for(const Z of o.value[U]??[])d(Z);u(U,[]);for(const Z of O){const ie=c(),q=/^data:/i.test(Z.url),ee=/^blob:/i.test(Z.url),fe=Z.name??Z.kind;if(Z.fileId){const ne={localId:ie,name:fe,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(U,[...o.value[U]??[],ne]),Z.kind!=="file"&&!q&&!ee&&ht().getFileBlob(Z.fileId).then(j=>{const K=URL.createObjectURL(j);if(!(o.value[U]??[]).some(he=>he.localId===ie)){URL.revokeObjectURL(K);return}W(U,ie,{previewUrl:K})}).catch(()=>{})}else{if(!Z.url)continue;const ne=t();if(!ne)continue;const j={localId:ie,name:fe,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(U,[...o.value[U]??[],j]),z(Z.url).then(K=>{const ve=fe.includes(".")?fe:`${fe}.${K.type.split("/")[1]??"bin"}`;return ne(K,ve)}).then(K=>{if(K===null){const ve=o.value[U]??[];u(U,ve.filter(he=>he.localId!==ie));return}W(U,ie,{uploading:!1,fileId:K.fileId})}).catch(()=>{const K=o.value[U]??[];u(U,K.filter(ve=>ve.localId!==ie))})}}}return et(n,()=>{i.value=null}),An(()=>{document.addEventListener("paste",v),document.addEventListener("dragenter",$),document.addEventListener("dragover",T),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),On(()=>{document.removeEventListener("paste",v),document.removeEventListener("dragenter",$),document.removeEventListener("dragover",T),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const O of Object.values(o.value))for(const U of O)d(U);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:y,openFilePicker:k,handleFileInputChange:g,handleDragOver:A,handleDragLeave:I,handleDrop:N,clearAfterSubmit:B,loadAttachments:L}}const Mue=["type","disabled"],Eue={class:"ui-button__content"},Tue=Je({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),E("button",{class:Ue(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),Se(Us,{key:0,size:"sm",class:"ui-button__spinner"})):ue("",!0),w("span",Eue,[jn(t.$slots,"default",{},void 0,!0)])],10,Mue))}}),jt=dt(Tue,[["__scopeId","data-v-e58393a8"]]),Nue={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Iue=["stroke-dasharray","stroke-dashoffset"],Fv=7,Lue=Je({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*Fv;return(o,s)=>(x(),E("svg",Nue,[w("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:Fv,fill:"none","stroke-width":"2.5"}),w("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:Fv,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Iue)]))}}),$ue=dt(Lue,[["__scopeId","data-v-a364f1f1"]]),Fue={key:0,class:"att-strip"},Oue={class:"att-lightbox-card"},Bue=["src"],Rue=["src","alt"],Due={class:"att-lightbox-name"},Pue={class:"composer-card"},Hue={class:"cin-wrap"},Wue={class:"input-row"},zue=["placeholder","disabled"],Uue=["aria-label"],que={class:"toolbar-left"},jue=["onKeydown"],Vue=["onClick"],Kue={class:"pd-check"},Gue={class:"pd-info"},Yue={class:"pd-desc"},Zue={class:"mode-label"},Xue={key:0,class:"mode-tag"},Que={key:1,class:"mode-tag"},Jue={key:2,class:"mode-tag"},ede={class:"mode-row-icon"},tde={class:"mode-row-info"},nde={class:"mode-row-name"},ode={class:"mode-row-desc"},sde={class:"mode-row-icon"},ide={class:"mode-row-info"},rde={class:"mode-row-name"},lde={class:"mode-row-desc"},ade={class:"mode-row-icon"},cde={class:"mode-row-info"},ude={class:"mode-row-name"},dde={class:"mode-row-desc"},fde={key:0,class:"mode-row-actions"},hde={class:"toolbar-right"},pde=["aria-label"],mde=["onKeydown"],gde={key:0,class:"think-suffix"},vde=["aria-label"],yde=["aria-label","disabled"],kde={key:0,class:"md-section"},bde=["onClick"],xde={class:"md-check"},wde={class:"md-name"},_de={class:"md-provider"},Sde={key:1,class:"md-divider"},Cde={key:2,class:"md-section"},Ade=["onClick"],Mde={class:"md-check"},Ede={class:"md-name"},Tde={key:3,class:"md-divider"},Nde={class:"md-name"},Ide={key:0,class:"md-note"},Lde=["aria-label"],$de=["disabled","onClick"],Fde={class:"md-cache-note"},Ode={class:"md-name"},Bde={class:"drop-card"},D3=36,Rde=Je({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{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},goal:{},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 o=e,s=D(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=$t(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Cue({sessionId:()=>o.sessionId}),h=oe(!1);function p(){h.value=!h.value,yt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,yt(u))}function y(Ke){if(typeof getComputedStyle>"u")return D3;const Re=Number.parseFloat(getComputedStyle(Ke).minHeight);return Number.isFinite(Re)&&Re>0?Re:D3}const k=oe(!1);function g(){const Ke=c.value;k.value=!!Ke&&Ke.scrollHeight>y(Ke)}et(a,()=>{yt(g)}),et(()=>o.sessionId,()=>{h.value=!1});const v=wue({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:b,items:A,active:I,update:N,select:M}=_ue({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ke=>i("command",Ke),historyPush:Ke=>v.push(Ke),clearDraft:f}),{open:$,items:T,active:F,loading:S,update:B,select:W}=Sue({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function z(){v.resetBrowsing(),N(),B()}const{attachments:L,previewAttachment:O,fileInputRef:U,isDragOver:Z,removeAttachment:ie,openAttachmentPreview:q,closeAttachmentPreview:ee,openFilePicker:fe,handleFileInputChange:ne,handleDragOver:j,handleDragLeave:K,handleDrop:ve,clearAfterSubmit:he,loadAttachments:Ae}=Aue({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});An(()=>{a.value&&yt(()=>{u(),g()})}),On(()=>{document.removeEventListener("mousedown",nn),V()});function re(){c.value?.focus({preventScroll:!0})}function Y(Ke){Ae(Ke)}t({loadForEdit:d,loadAttachmentsForEdit:Y,focus:re});function Q(Ke){return{fileId:Ke.fileId,kind:Ke.kind,name:Ke.name,mediaType:Ke.mediaType,size:Ke.size}}function P(Ke){if(Ke.kind==="file"){Ke.fileId!==void 0&&eT(Ke.fileId,Ke.name,Ke.mediaType);return}q(Ke)}function G(){const Ke=a.value.trim();if(L.value.some(Te=>Te.uploading))return;const Re=L.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ke&&Re.length===0)return;if(v.push(Ke),Ke){const Te=hue(Ke),ge=Te?cT(o.skills).some(Ee=>Ee.name===Te.cmd||Ee.name===`/${Zm}${Te.cmd.slice(1)}`):!1;if(Te&&ge){a.value="",f(),b.value=!1,m(),i("command",Te.arg?`${Te.cmd} ${Te.arg}`:Te.cmd);return}}const le={text:Ke,attachments:Re.map(Te=>Q(Te))};O.value=null,he(),a.value="",f(),b.value=!1,$.value=!1,m(),i("submit",le)}function me(){if(!o.running||L.value.some(Te=>Te.uploading))return;const Ke=a.value.trim(),Re=L.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ke&&Re.length===0&&o.queued.length===0)return;const le={text:Ke,attachments:Re.map(Te=>Q(Te))};he(),v.push(Ke),a.value="",f(),b.value=!1,$.value=!1,m(),i("steer",le)}let ye=!1,de=null;function V(){de!==null&&(clearTimeout(de),de=null)}function se(){V(),ye=!0}function pe(){V(),de=setTimeout(()=>{de=null,ye=!1},0)}function ke(Ke){return ye||Ke.isComposing||Ke.keyCode===229}function Ne(Ke){if(!ke(Ke)){if(Ke.key==="Escape"){if(xe.value){Ke.preventDefault(),ut();return}if(Ze.value){Ke.preventDefault(),Tt();return}}if(b.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),I.value=(I.value+1)%A.value.length;return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),I.value=(I.value-1+A.value.length)%A.value.length;return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const Re=A.value[I.value];Re&&M(Re);return}if(Ke.key==="Escape"){Ke.preventDefault(),b.value=!1;return}}if($.value&&!S.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),F.value=(F.value+1)%Math.max(1,T.value.length);return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),F.value=(F.value-1+Math.max(1,T.value.length))%Math.max(1,T.value.length);return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const Re=T.value[F.value];Re&&W(Re);return}if(Ke.key==="Escape"){Ke.preventDefault(),$.value=!1;return}}if(Ke.key==="s"&&(Ke.ctrlKey||Ke.metaKey)&&!Ke.shiftKey&&!Ke.altKey){o.running&&(Ke.preventDefault(),me());return}if(!h.value&&!b.value&&!$.value&&!Ke.shiftKey&&!Ke.altKey&&!Ke.metaKey&&!Ke.ctrlKey){const Re=v.isBrowsing();if(Ke.key==="ArrowUp"&&v.hasHistory()&&(Re||v.caretAtTextStart())){Ke.preventDefault(),v.recallOlder();return}if(Ke.key==="ArrowDown"&&Re){Ke.preventDefault(),v.recallNewer();return}}if(Ke.key==="Enter"&&!Ke.shiftKey){if(h.value&&!(Ke.metaKey||Ke.ctrlKey))return;Ke.preventDefault(),G()}}}const qe=D(()=>r("composer.send")),be=D(()=>!!o.uploadImage),xe=oe(!1),Ze=oe(!1),tt=oe(null);function lt(){xe.value=!xe.value,xe.value?(Ze.value=!1,xn(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function ut(){xe.value=!1,Ze.value||document.removeEventListener("click",wt,!0)}function mt(){Ze.value=!Ze.value,Ze.value?(xe.value=!1,xn(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function Tt(){Ze.value=!1,xe.value||document.removeEventListener("click",wt,!0)}function wt(Ke){tt.value&&!tt.value.contains(Ke.target)&&(ut(),Tt())}On(()=>{document.removeEventListener("click",wt,!0)});const Ft=D(()=>{const Ke=o.status?.ctxMax??0;return Ke<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ke*100)))}),en=D(()=>{const Ke=pr(o.status?.ctxUsed??0),Re=pr(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ke,max:Re,pct:Ft.value})}),Hn=D(()=>Ft.value>=80),Pt=D(()=>o.models?.find(Ke=>Ke.id===o.status?.modelId)),bn=D(()=>o0(Pt.value)),pn=D(()=>s0(Pt.value)),Kt=D(()=>Xm(Pt.value,o.thinking)),Nn=D(()=>pn.value.includes(Kt.value)?Kt.value:""),Gt=D(()=>vue(Kt.value)),Wt=D(()=>bn.value==="unsupported"||pn.value.length<=1),mn=D(()=>{if(!Gt.value)return"";const Ke=(Pt.value?.supportEfforts?.length??0)>0,Re=Kt.value;return Ke&&Re!=="on"?r("composer.thinkingSuffixEffort",{level:Re}):r("composer.thinkingSuffix")});function so(Ke){Wt.value||i("setThinking",hb(Pt.value,Ke))}function gn(Ke){return Ke==="on"?r("status.thinkingOn"):Ke==="off"?r("status.thinkingOff"):hk(Ke)}const to=D(()=>o.planMode===!0),vt=D(()=>o.swarmMode===!0),Wn=D(()=>o.goal?.status??o.activationBadges?.goal?.status??null),Bn=D(()=>Wn.value!==null&&Wn.value!=="complete"),Qn=D(()=>Bn.value||o.goalMode===!0),sn=D(()=>Wn.value==="active"),es=D(()=>Wn.value==="paused"||Wn.value==="blocked"),nt=oe(!1),Be=oe(null),Bt=oe(null),Yt=oe({}),vn=D(()=>to.value||vt.value||Qn.value);function xn(){nt.value=!1,document.removeEventListener("mousedown",nn)}function nn(Ke){const Re=Ke.target;Be.value?.contains(Re)||Bt.value?.contains(Re)||xn()}function Vn(){if(nt.value){xn();return}ut(),Tt();const Ke=Be.value?.getBoundingClientRect();Ke&&(Yt.value={left:`${Math.round(Ke.left)}px`,bottom:`${Math.round(window.innerHeight-Ke.top+8)}px`}),nt.value=!0,setTimeout(()=>document.addEventListener("mousedown",nn),0)}const Kn=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Jn=["status.planDesc","status.swarmDesc","status.goalDesc"],Oo=oe(null),ko=oe(""),li=oe("");function Uo(Ke){const Re={};return Ke&&(Re["--composer-menu-desc-width"]=Ke),Re}const As=D(()=>Uo(ko.value)),cs=D(()=>Uo(li.value)),qo=D(()=>({...Yt.value,...cs.value}));let Bo=null;function ai(Ke){const Re=Number.parseFloat(Ke);return Number.isFinite(Re)?Re:0}function tn(Ke){return`${Ke.fontStyle||"normal"} ${Ke.fontWeight||"400"} ${Ke.fontSize} ${Ke.fontFamily}`}function qs(Ke){return Ke.letterSpacing==="normal"?0:ai(Ke.letterSpacing)}function io(Ke,Re){if(!Ke)return 0;const le=Zce(Ke,tn(Re),{letterSpacing:qs(Re)});return Xce(le)}function js(){const Ke=Oo.value?.querySelector(".pd-desc");if(!Ke)return;const Re=getComputedStyle(Ke),le=Math.max(0,...Kn.map(ge=>io(r(ge.descKey),Re))),Te=Math.max(0,...Jn.map(ge=>io(r(ge),Re)));ko.value=le>0?`${Math.ceil(le)}px`:"",li.value=Te>0?`${Math.ceil(Te)}px`:""}function ci(){typeof window>"u"||(Bo!==null&&window.cancelAnimationFrame(Bo),yt(()=>{Bo=window.requestAnimationFrame(()=>{Bo=null,js()})}))}et(l,ci,{immediate:!0}),An(()=>{ci(),document.fonts?.ready.then(ci)}),On(()=>{Bo!==null&&(window.cancelAnimationFrame(Bo),Bo=null)});function Ni(Ke){i("setPermission",Ke),Tt()}const ui=D(()=>Kn.find(Ke=>Ke.mode===o.status?.permission)),Vs=D(()=>ui.value?r(ui.value.labelKey):""),ts=D(()=>Pt.value?.provider??""),ns=D(()=>!ts.value||!o.models?.length?[]:o.models.filter(Ke=>Ke.provider===ts.value)),zt=D(()=>new Set(o.starredIds??[]));function Ms(Ke){return zt.value.has(Ke)}const No=D(()=>o.models?.length?o.models.filter(Ke=>Ms(Ke.id)&&Ke.provider!==ts.value):[]);function di(Ke){i("selectModel",Ke),ut()}return(Ke,Re)=>(x(),E("div",{class:Ue(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:Re[18]||(Re[18]=(...le)=>C(j)&&C(j)(...le)),onDragleave:Re[19]||(Re[19]=(...le)=>C(K)&&C(K)(...le)),onDrop:Re[20]||(Re[20]=(...le)=>C(ve)&&C(ve)(...le))},[C(L).length>0?(x(),E("div",Fue,[(x(!0),E(We,null,rt(C(L),le=>(x(),Se(QE,{key:le.localId,kind:le.kind,name:le.name,url:le.previewUrl,"file-id":le.fileId,"media-type":le.mediaType,size:le.size,uploading:le.uploading,error:le.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:le.name}),onActivate:Te=>P(le),onRemove:Te=>C(ie)(le.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ue("",!0),C(O)?(x(),E("div",{key:1,class:"att-lightbox",onClick:Re[1]||(Re[1]=St((...le)=>C(ee)&&C(ee)(...le),["self"]))},[w("div",Oue,[ae(an,{text:C(r)("model.close")},{default:Ie(()=>[w("button",{type:"button",class:"att-lightbox-close",onClick:Re[0]||(Re[0]=(...le)=>C(ee)&&C(ee)(...le))},"✕")]),_:1},8,["text"]),C(O).kind==="video"?(x(),E("video",{key:0,class:"att-lightbox-media",src:C(O).previewUrl,controls:"",playsinline:""},null,8,Bue)):(x(),E("img",{key:1,class:"att-lightbox-media",src:C(O).previewUrl,alt:C(O).name},null,8,Rue)),w("div",Due,R(C(O).name),1)])])):ue("",!0),w("div",Pue,[w("div",Hue,[C(b)?(x(),Se(oue,{key:0,items:C(A),"active-index":C(I),onSelect:C(M),onHover:Re[2]||(Re[2]=le=>I.value=le)},null,8,["items","active-index","onSelect"])):ue("",!0),C($)?(x(),Se(fue,{key:1,items:C(T),"active-index":C(F),loading:C(S),onSelect:C(W),onHover:Re[3]||(Re[3]=le=>F.value=le)},null,8,["items","active-index","loading","onSelect"])):ue("",!0),w("div",Wue,[qn(w("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Re[4]||(Re[4]=le=>vo(a)?a.value=le:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:Ne,onCompositionstart:se,onCompositionend:pe,onInput:z},null,40,zue),[[Cs,C(a)]]),h.value||k.value?(x(),E("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(x(),Se(Ge,{key:0,name:"collapse",size:"sm"})):(x(),Se(Ge,{key:1,name:"expand",size:"sm"}))],8,Uue)):ue("",!0)])]),be.value?(x(),E("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",multiple:"",class:"file-input-hidden",onChange:Re[5]||(Re[5]=(...le)=>C(ne)&&C(ne)(...le))},null,544)):ue("",!0),w("div",{ref_key:"toolbarRef",ref:tt,class:"toolbar"},[w("div",{ref_key:"menuMeasureRef",ref:Oo,class:"menu-measure","aria-hidden":"true"},[...Re[21]||(Re[21]=[w("span",{class:"pd-desc"},null,-1)])],512),w("div",que,[be.value?(x(),Se(Xn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(fe)},{default:Ie(()=>[ae(Ge,{name:"attachment"})]),_:1},8,["label","onClick"])):ue("",!0),e.status?(x(),E("span",{key:1,class:Ue(["perm-pill",["perm-"+e.status.permission,{open:Ze.value}]]),role:"button",tabindex:"0",onClick:St(mt,["stop"]),onKeydown:[ur(mt,["enter"]),ur(St(mt,["prevent"]),["space"])]},R(Vs.value),43,jue)):ue("",!0),Ze.value&&e.status?(x(),E("div",{key:2,class:"perm-dropdown",style:on(As.value),role:"menu",onClick:Re[6]||(Re[6]=St(()=>{},["stop"]))},[(x(),E(We,null,rt(Kn,le=>w("button",{key:le.mode,class:Ue(["pd-row",{"is-current":le.mode===e.status.permission}]),role:"menuitem",onClick:Te=>Ni(le.mode)},[w("span",Kue,[le.mode===e.status.permission?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",Gue,[w("span",{class:"pd-name",style:on({color:le.color})},R(C(r)(le.labelKey)),5),w("span",Yue,R(C(r)(le.descKey)),1)])],10,Vue)),64))],4)):ue("",!0),e.status?(x(),E("div",{key:3,ref_key:"modesRef",ref:Be,class:"modes"},[w("button",{type:"button",class:Ue(["mode-pill",{on:vn.value,open:nt.value}]),onClick:St(Vn,["stop"])},[w("span",Zue,R(C(r)("status.modesLabel")),1),to.value?(x(),E("span",Xue,R(C(r)("status.planLabel")),1)):ue("",!0),vt.value?(x(),E("span",Que,R(C(r)("status.swarmLabel")),1)):ue("",!0),Qn.value?(x(),E("span",Jue,R(C(r)("status.goalLabel")),1)):ue("",!0)],2),nt.value?(x(),E("div",{key:0,ref_key:"modesMenuRef",ref:Bt,class:"modes-menu",style:on(qo.value),role:"menu"},[w("button",{type:"button",class:Ue(["mode-row",{on:to.value}]),role:"menuitem",onClick:Re[7]||(Re[7]=le=>i("togglePlan"))},[w("span",ede,[ae(Ge,{name:"file-edit",size:"sm"})]),w("span",tde,[w("span",nde,R(C(r)("status.planLabel")),1),w("span",ode,R(C(r)("status.planDesc")),1)]),w("span",{class:Ue(["mode-switch",{on:to.value}])},[...Re[22]||(Re[22]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("button",{type:"button",class:Ue(["mode-row",{on:vt.value}]),role:"menuitem",onClick:Re[8]||(Re[8]=le=>i("toggleSwarm"))},[w("span",sde,[ae(Ge,{name:"sparkles",size:"sm"})]),w("span",ide,[w("span",rde,R(C(r)("status.swarmLabel")),1),w("span",lde,R(C(r)("status.swarmDesc")),1)]),w("span",{class:Ue(["mode-switch",{on:vt.value}])},[...Re[23]||(Re[23]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("div",{class:Ue(["mode-row mode-row-goal",{on:Bn.value||o.goalMode}])},[w("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Re[9]||(Re[9]=le=>Bn.value?i("focusGoal"):i("toggleGoal"))},[w("span",ade,[ae(Ge,{name:"target",size:"sm"})]),w("span",cde,[w("span",ude,R(C(r)("status.goalLabel")),1),w("span",dde,R(C(r)("status.goalDesc")),1)]),Bn.value?ue("",!0):(x(),E("span",{key:0,class:Ue(["mode-switch",{on:o.goalMode}])},[...Re[24]||(Re[24]=[w("span",{class:"mode-knob"},null,-1)])],2))]),Bn.value?(x(),E("div",fde,[sn.value?(x(),Se(jt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Re[10]||(Re[10]=le=>i("controlGoal","pause"))},{default:Ie(()=>[ae(Ge,{name:"pause",size:"sm"}),w("span",null,R(C(r)("status.goalPause")),1)]),_:1})):ue("",!0),es.value?(x(),Se(jt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Re[11]||(Re[11]=le=>i("controlGoal","resume"))},{default:Ie(()=>[ae(Ge,{name:"play",size:"sm"}),w("span",null,R(C(r)("status.goalResume")),1)]),_:1})):ue("",!0),ae(jt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Re[12]||(Re[12]=le=>i("controlGoal","cancel"))},{default:Ie(()=>[ae(Ge,{name:"close",size:"sm"}),w("span",null,R(C(r)("status.goalCancel")),1)]),_:1})])):ue("",!0)],2)],4)):ue("",!0)],512)):ue("",!0)]),w("div",hde,[Hn.value?(x(),E("button",{key:0,class:"compact-chip",onClick:Re[13]||(Re[13]=St(le=>i("compact"),["stop"]))},"/compact")):ue("",!0),ae(an,{text:en.value},{default:Ie(()=>[e.status&&!e.hideContext?(x(),E("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":en.value},[ae($ue,{pct:Ft.value},null,8,["pct"])],8,pde)):ue("",!0)]),_:1},8,["text"]),e.status?(x(),E("span",{key:1,class:Ue(["model-pill",{open:xe.value}]),role:"button",tabindex:"0",onClick:St(lt,["stop"]),onKeydown:[ur(lt,["enter"]),ur(St(lt,["prevent"]),["space"])]},[w("b",null,R(e.status.model),1),mn.value?(x(),E("span",gde,R(mn.value),1)):ue("",!0),ae(Ge,{class:"cv",name:"chevron-down",size:"sm"})],42,mde)):ue("",!0),e.running?(x(),Se(an,{key:2,text:C(r)("composer.interruptTitle")},{default:Ie(()=>[w("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Re[14]||(Re[14]=le=>i("interrupt"))},[ae(Ge,{name:"stop",size:"sm"})],8,vde)]),_:1},8,["text"])):ue("",!0),w("button",{class:Ue(["send",{"is-starting":e.starting}]),"aria-label":qe.value,disabled:e.starting,onClick:Re[15]||(Re[15]=le=>G())},[e.starting?(x(),Se(Us,{key:0,size:"sm"})):(x(),Se(Ge,{key:1,name:"send",size:"sm"}))],10,yde)]),xe.value&&e.status?(x(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:Re[17]||(Re[17]=St(()=>{},["stop"]))},[No.value.length>0?(x(),E("div",kde,R(C(r)("status.starredModels")),1)):ue("",!0),(x(!0),E(We,null,rt(No.value,le=>(x(),E("button",{key:le.id,class:Ue(["md-row",{"is-current":le.id===e.status.modelId}]),role:"menuitem",onClick:Te=>di(le.id)},[w("span",xde,[le.id===e.status.modelId?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",wde,R(le.displayName??le.model),1),w("span",_de,R(le.provider),1),ae(Ge,{class:"md-star",name:"star",size:"sm"})],10,bde))),128)),No.value.length>0?(x(),E("div",Sde)):ue("",!0),ns.value.length>0?(x(),E("div",Cde,R(ts.value),1)):ue("",!0),(x(!0),E(We,null,rt(ns.value,le=>(x(),E("button",{key:le.id,class:Ue(["md-row",{"is-current":le.id===e.status.modelId}]),role:"menuitem",onClick:Te=>di(le.id)},[w("span",Mde,[le.id===e.status.modelId?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",Ede,R(le.displayName??le.model),1),Ms(le.id)?(x(),Se(Ge,{key:0,class:"md-star",name:"star",size:"sm"})):ue("",!0)],10,Ade))),128)),ns.value.length>0?(x(),E("div",Tde)):ue("",!0),w("div",{class:Ue(["md-thinking",{"is-readonly":Wt.value}])},[w("span",Nde,R(C(r)("status.thinkingLabel")),1),bn.value==="unsupported"?(x(),E("span",Ide,R(C(r)("status.modeNotSupported")),1)):(x(),E("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(x(!0),E(We,null,rt(pn.value,le=>(x(),E("button",{key:le,type:"button",class:Ue(["effort-seg",{"is-active":le===Nn.value}]),disabled:Wt.value,onClick:Te=>so(le)},R(gn(le)),11,$de))),128))],8,Lde))],2),Re[25]||(Re[25]=w("div",{class:"md-divider"},null,-1)),w("div",Fde,R(C(r)("status.cacheNote")),1),Re[26]||(Re[26]=w("div",{class:"md-divider"},null,-1)),w("button",{class:"md-row md-row-more",role:"menuitem",onClick:Re[16]||(Re[16]=le=>{ut(),i("pickModel")})},[w("span",Ode,R(C(r)("status.moreModels")),1)])])):ue("",!0)],512)]),w("div",{class:Ue(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[w("div",Bde,[ae(Ge,{name:"file-plus",size:"lg"}),w("span",null,R(C(r)("composer.dropToAttach")),1)])],2)],34))}}),dT=dt(Rde,[["__scopeId","data-v-a89f6a49"]]),Dde={key:0,class:"ui-card__head"},Pde={class:"ui-card__body"},Hde={key:1,class:"ui-card__foot"},Wde=Je({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),E("div",Dde,[jn(t.$slots,"head",{},void 0,!0)])):ue("",!0),w("div",Pde,[jn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),E("div",Hde,[jn(t.$slots,"foot",{},void 0,!0)])):ue("",!0)],2))}}),pb=dt(Wde,[["__scopeId","data-v-9c9f9a9a"]]),zde={class:"goal-kicker"},Ude={key:0,class:"goal-progress","aria-hidden":"true"},qde={class:"goal-full"},jde={key:0,class:"goal-criterion"},Vde=["inert","aria-hidden"],Kde={class:"goal-meta"},Gde={key:0},Yde={class:"goal-actions"},Zde=Je({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),{confirm:i}=Gf(),r=oe(!1);et(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=D(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(x(),Se(pb,{class:Ue(["goal-strip",{expanded:r.value}])},{head:Ie(()=>[w("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[ae(Ge,{class:"goal-icon",name:"target",size:"md"}),w("span",zde,R(C(s)("status.goalLabel")),1),w("span",{class:Ue(["goal-objective",{"expanded-hidden":r.value}])},R(e.goal.objective),3),ae(qi,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ie(()=>[ot(R(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(x(),E("span",Ude,[w("span",{class:"goal-progress-fill",style:on({width:`${l.value}%`})},null,4)])):ue("",!0),ae(Ge,{class:Ue(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ie(()=>[w("div",qde,R(e.goal.objective),1),e.goal.completionCriterion?(x(),E("div",jde,[f[3]||(f[3]=w("span",null,"Done when",-1)),w("p",null,R(e.goal.completionCriterion),1)])):ue("",!0)]),foot:Ie(()=>[w("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[w("div",Kde,[w("span",null,R(e.goal.turnsUsed)+" turns",1),w("span",null,R(C(pr)(e.goal.tokensUsed))+" tokens",1),w("span",null,R(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),E("span",Gde,R(l.value)+"% token budget",1)):ue("",!0)]),w("div",Yde,[e.goal.status==="active"?(x(),Se(jt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=St(h=>o("controlGoal","pause"),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"pause",size:"md"}),w("span",null,R(C(s)("status.goalPause")),1)]),_:1})):ue("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(x(),Se(jt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=St(h=>o("controlGoal","resume"),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"play",size:"md"}),w("span",null,R(C(s)("status.goalResume")),1)]),_:1})):ue("",!0),ae(jt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:St(u,["stop"])},{default:Ie(()=>[ae(Ge,{name:"close",size:"md"}),w("span",null,R(C(s)("status.goalCancel")),1)]),_:1})])],8,Vde)]),_:1},8,["class"]))}}),Xde=dt(Zde,[["__scopeId","data-v-44bef30f"]]),Qde={class:"qh"},Jde={class:"qtitle"},efe={key:0,class:"qstep"},tfe={key:1,class:"qmin-peek"},nfe={class:"qbody"},ofe=["aria-label"],sfe=["aria-selected","aria-label","onClick"],ife={class:"qstep-num"},rfe={key:1,class:"qheader-chip"},lfe={class:"qtext"},afe={class:"qopts"},cfe=["onClick"],ufe={class:"qopt-key"},dfe={class:"qopt-glyph"},ffe={key:0,class:"chk"},hfe={key:1,class:"rad"},pfe={class:"qopt-text"},mfe={class:"qopt-label"},gfe={key:0,class:"qopt-desc"},vfe={class:"qopt-glyph"},yfe={key:0,class:"chk"},kfe={key:1,class:"rad"},bfe={class:"qopt-label"},xfe=["placeholder"],wfe={class:"qfoot"},_fe=Je({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=$t(),s=t,i=oe(0),r=oe(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(L){L>=0&&L<a.value&&(i.value=L)}function f(L){const O=p.value[L];return O?O.kind==="multi"?O.optionIds.length>0:O.kind==="multiWithOther"?O.optionIds.length>0||O.otherText.trim().length>0:O.kind==="other"?O.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=oe({});function m(L){return L.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${L.label} ${L.description??""}`.toLowerCase())}function y(){const L={...p.value};let O=!1;for(const U of n.question.questions){if(L[U.id])continue;const Z=U.options.filter(m);Z.length!==0&&(L[U.id]=U.multiSelect?{kind:"multi",optionIds:Z.map(ie=>ie.id)}:{kind:"single",optionId:Z[0].id},O=!0)}O&&(p.value=L)}et(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),et(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),y()},{immediate:!0,deep:!0});function k(L,O){const U=p.value[L];if(U&&U.kind==="single"&&U.optionId===O){const Z={...p.value};delete Z[L],p.value=Z}else p.value={...p.value,[L]:{kind:"single",optionId:O}}}function g(L,O){const U=p.value[L],Z=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],ie=Z.indexOf(O);ie>=0?Z.splice(ie,1):Z.push(O);const q=p.value[L],ee=q&&q.kind==="multiWithOther"?q.otherText:"";ee?p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:Z,otherText:ee}}:p.value={...p.value,[L]:{kind:"multi",optionIds:Z}}}const v=oe({}),b=oe(null);function A(L){const O=n.question.questions.find(Z=>Z.id===L),U=v.value[L]??"";if(O.multiSelect){const Z=p.value[L],ie=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:ie,otherText:U}}}else p.value={...p.value,[L]:{kind:"other",text:U}}}function I(L){A(L),yt(()=>b.value?.focus())}function N(L,O){const U=p.value[L];return U?U.kind==="single"?U.optionId===O:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(O):!1:!1}function M(L){const O=p.value[L];return!!(O&&(O.kind==="other"||O.kind==="multiWithOther"))}function $(){return n.question.questions.every(L=>f(L.id))}const T=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function B(){if(S.value||!$())return;const L={answers:p.value,method:"click"};s("answer",n.question.questionId,L)}function W(){S.value||s("dismiss",n.question.questionId)}function z(L){const O=(document.activeElement?.tagName??"").toLowerCase(),U=O==="input"||O==="textarea";if(S.value)return;if(L.key==="Enter"){if(L.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():$()&&B();return}if(U)return;if(L.key==="Escape"){L.preventDefault(),W();return}if(r.value)return;const Z=parseInt(L.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){L.preventDefault();const ie=l.value,q=Z-1,ee=ie.options[q];ee&&(ie.multiSelect?g(ie.id,ee.id):k(ie.id,ee.id))}}return An(()=>document.addEventListener("keydown",z)),On(()=>document.removeEventListener("keydown",z)),(L,O)=>(x(),Se(pb,{class:Ue(["qcard",{minimized:r.value}])},ZA({head:Ie(()=>[w("div",Qde,[O[5]||(O[5]=w("span",{class:"qh-ic"},"?",-1)),w("span",Jde,R(C(o)("question.title")),1),a.value>1&&!r.value?(x(),E("span",efe,R(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ue("",!0),r.value?(x(),E("span",tfe,R(l.value.question),1)):ue("",!0),ae(Xn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:O[0]||(O[0]=U=>r.value=!r.value)},{default:Ie(()=>[r.value?(x(),Se(Ge,{key:0,name:"chevron-up",size:"md"})):(x(),Se(Ge,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ie(()=>[w("div",nfe,[a.value>1?(x(),E("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(x(!0),E(We,null,rt(n.question.questions,(U,Z)=>(x(),E("button",{key:U.id,type:"button",class:Ue(["qstep-dot",{active:Z===i.value,answered:f(U.id)}]),"aria-selected":Z===i.value,"aria-label":C(o)("question.step",{current:Z+1,total:a.value}),onClick:ie=>d(Z)},[w("span",ife,R(Z+1),1)],10,sfe))),128))],8,ofe)):ue("",!0),l.value.header?(x(),E("div",rfe,[ae(qi,{variant:"neutral",size:"sm"},{default:Ie(()=>[ot(R(l.value.header),1)]),_:1})])):ue("",!0),w("div",lfe,R(l.value.question),1),l.value.body?(x(),Se(Q1,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ue("",!0),w("div",afe,[(x(!0),E(We,null,rt(l.value.options,(U,Z)=>(x(),E("label",{key:U.id,class:Ue(["qopt",{selected:N(l.value.id,U.id)}]),onClick:St(ie=>l.value.multiSelect?g(l.value.id,U.id):k(l.value.id,U.id),["prevent"])},[w("span",ufe,R(Z+1),1),w("span",dfe,[l.value.multiSelect?(x(),E("span",ffe,R(N(l.value.id,U.id)?"■":"□"),1)):(x(),E("span",hfe,R(N(l.value.id,U.id)?"●":"○"),1))]),w("span",pfe,[w("span",mfe,R(U.label),1),U.description?(x(),E("span",gfe,R(U.description),1)):ue("",!0)])],10,cfe))),128)),l.value.allowOther?(x(),E("label",{key:0,class:Ue(["qopt",{selected:M(l.value.id)}]),onClick:O[4]||(O[4]=St(U=>I(l.value.id),["prevent"]))},[O[6]||(O[6]=w("span",{class:"qopt-key"},null,-1)),w("span",vfe,[l.value.multiSelect?(x(),E("span",yfe,R(M(l.value.id)?"■":"□"),1)):(x(),E("span",kfe,R(M(l.value.id)?"●":"○"),1))]),w("span",bfe,R(l.value.otherLabel??C(o)("question.otherDefault")),1),qn(w("input",{ref_key:"otherInputEl",ref:b,"onUpdate:modelValue":O[1]||(O[1]=U=>v.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:O[2]||(O[2]=U=>A(l.value.id)),onFocus:O[3]||(O[3]=U=>A(l.value.id))},null,40,xfe),[[Cs,v.value[l.value.id]]])],2)):ue("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ie(()=>[w("div",wfe,[i.value<a.value-1?(x(),Se(jt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ie(()=>[ot(R(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),Se(jt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!$(),loading:T.value,onClick:B},{default:Ie(()=>[ot(R(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),Se(jt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ie(()=>[ot(R(C(o)("question.back")),1)]),_:1},8,["disabled"])):ue("",!0),ae(jt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:W},{default:Ie(()=>[ot(R(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Sfe=dt(_fe,[["__scopeId","data-v-14c58ac1"]]),Cfe={class:"ah"},Afe={class:"akind"},Mfe={class:"apath"},Efe={class:"ah-path"},Tfe={key:1,class:"diff"},Nfe={class:"dg"},Ife={class:"dc"},Lfe={key:2,class:"body-shell"},$fe={class:"shell-cmd"},Ffe={key:0,class:"shell-cwd"},Ofe={key:1,class:"shell-danger"},Bfe={key:3,class:"body-file"},Rfe={class:"file-bar"},Dfe={class:"file-lang"},Pfe={class:"file-content"},Hfe={class:"file-ln"},Wfe={class:"file-text"},zfe={key:4,class:"body-chip"},Ufe={class:"chip-label"},qfe={class:"chip-value"},jfe={key:0,class:"chip-detail"},Vfe={key:5,class:"body-chip"},Kfe={key:0,class:"chip-label"},Gfe={class:"chip-value"},Yfe={key:6,class:"body-chip"},Zfe={class:"chip-label"},Xfe={class:"chip-value"},Qfe={key:0,class:"chip-detail"},Jfe={key:7,class:"body-chip"},ehe={class:"chip-label"},the={class:"chip-value"},nhe={key:0,class:"chip-detail"},ohe={key:8,class:"body-todo"},she={class:"todo-glyph"},ihe={key:9,class:"body-plan"},rhe={key:10,class:"body-generic"},lhe={class:"gen-text"},ahe={key:11,class:"feedback-wrap"},che=["placeholder"],uhe={class:"feedback-hint"},dhe={key:0,class:"plan-actions"},fhe={key:1,class:"abtn"},hhe=Je({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>{const T=n.block;return T.kind!=="plan_review"?null:{plan:T.plan,path:T.path,options:T.options??[]}}),r=oe(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const T=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${T}`)}const c=oe(!1),u=oe(""),d=oe(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const T=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:T||void 0}):k("feedback",{decision:"rejected",feedback:T||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(T){T.key==="Enter"&&!T.shiftKey?(T.preventDefault(),h()):T.key==="Escape"&&(T.preventDefault(),p())}const y=oe(null);et(()=>n.busy,T=>{T||(y.value=null)});function k(T,F){n.busy||(y.value=T,o("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function b(){k("reject",{decision:"rejected"})}function A(){k("approvePlan",{decision:"approved"})}function I(T){k(`option:${T}`,{decision:"approved",selectedLabel:T})}function N(){n.busy||f()}function M(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function $(T){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){T.key==="1"?(T.preventDefault(),A()):T.key==="2"?(T.preventDefault(),N()):T.key==="3"&&(T.preventDefault(),M());return}T.key==="1"&&S.options[0]?(T.preventDefault(),I(S.options[0].label)):T.key==="2"&&S.options[1]?(T.preventDefault(),I(S.options[1].label)):T.key==="3"&&S.options[2]&&(T.preventDefault(),I(S.options[2].label));return}T.key==="1"?(T.preventDefault(),g()):T.key==="2"?(T.preventDefault(),v()):T.key==="3"?(T.preventDefault(),b()):T.key==="4"&&(T.preventDefault(),f())}return An(()=>document.addEventListener("keydown",$)),On(()=>document.removeEventListener("keydown",$)),(T,F)=>(x(),Se(pb,{class:Ue(["appr",{minimized:r.value}])},ZA({head:Ie(()=>[w("div",Cfe,[F[2]||(F[2]=w("span",{class:"ah-ic"},"!",-1)),w("span",Afe,R(a()),1),w("span",Mfe,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),E(We,{key:0},[ot(R(e.block.path),1)],64)):e.block.kind==="shell"?(x(),E(We,{key:1},[ot(R(e.block.command),1)],64)):e.block.kind==="url"?(x(),E(We,{key:2},[ot(R(e.block.url),1)],64)):e.block.kind==="search"?(x(),E(We,{key:3},[ot(R(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),E(We,{key:4},[ot(R(e.block.name),1)],64)):e.block.kind==="generic"?(x(),E(We,{key:5},[ot(R(e.block.summary),1)],64)):ue("",!0)]),e.agentName&&!r.value?(x(),Se(qi,{key:0,variant:"neutral",size:"sm"},{default:Ie(()=>[ot(R(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ue("",!0),r.value?ue("",!0):(x(),Se(qi,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ie(()=>[ot(R(C(s)("approval.required")),1)]),_:1})),ae(Xn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ie(()=>[r.value?(x(),Se(Ge,{key:0,name:"chevron-up",size:"md"})):(x(),Se(Ge,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ie(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),Se(an,{key:0,text:e.block.path},{default:Ie(()=>[w("div",Efe,R(e.block.path),1)]),_:1},8,["text"])):ue("",!0),e.block.kind==="diff"?(x(),E("div",Tfe,[(x(!0),E(We,null,rt(e.block.diff,(S,B)=>(x(),E("div",{key:B,class:Ue(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[w("span",Nfe,R(S.gutter),1),w("span",Ife,R(S.text),1)],2))),128))])):e.block.kind==="shell"?(x(),E("div",Lfe,[w("div",$fe,[F[3]||(F[3]=w("span",{class:"shell-dollar"},"$",-1)),ot(" "+R(e.block.command),1)]),e.block.cwd?(x(),E("div",Ffe,"cwd: "+R(e.block.cwd),1)):ue("",!0),e.block.danger?(x(),E("div",Ofe,R(C(s)("approval.danger",{detail:e.block.danger})),1)):ue("",!0)])):e.block.kind==="file"?(x(),E("div",Bfe,[w("div",Rfe,[w("span",Dfe,R(e.block.language??""),1)]),w("div",Pfe,[(x(!0),E(We,null,rt(e.block.content.split(`
314
- `),(S,B)=>(x(),E("div",{key:B,class:"file-line"},[w("span",Hfe,R(B+1),1),w("span",Wfe,R(S),1)]))),128))])])):e.block.kind==="fileop"?(x(),E("div",zfe,[w("span",Ufe,R(e.block.op),1),w("span",qfe,R(e.block.path),1),e.block.detail?(x(),E("span",jfe,R(e.block.detail),1)):ue("",!0)])):e.block.kind==="url"?(x(),E("div",Vfe,[e.block.method?(x(),E("span",Kfe,R(e.block.method),1)):ue("",!0),w("span",Gfe,R(e.block.url),1)])):e.block.kind==="search"?(x(),E("div",Yfe,[w("span",Zfe,R(C(s)("approval.searchQueryLabel")),1),w("span",Xfe,R(e.block.query),1),e.block.scope?(x(),E("span",Qfe,R(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ue("",!0)])):e.block.kind==="invocation"?(x(),E("div",Jfe,[w("span",ehe,R(e.block.kind2),1),w("span",the,R(e.block.name),1),e.block.description?(x(),E("span",nhe,R(e.block.description),1)):ue("",!0)])):e.block.kind==="todo"?(x(),E("div",ohe,[(x(!0),E(We,null,rt(e.block.items,(S,B)=>(x(),E("div",{key:B,class:"todo-item"},[w("span",she,R(S.status==="done"||S.status==="completed"?"✓":"○"),1),w("span",{class:Ue(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},R(S.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),E("div",ihe,[ae(Q1,{text:e.block.plan},null,8,["text"])])):(x(),E("div",rhe,[w("span",lhe,R(e.block.summary),1)])),c.value?(x(),E("div",ahe,[qn(w("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,che),[[Cs,u.value]]),w("div",uhe,R(C(s)("approval.feedbackHint")),1)])):ue("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ie(()=>[i.value?(x(),E("div",dhe,[i.value.options.length>0?(x(!0),E(We,{key:0},rt(i.value.options,(S,B)=>(x(),Se(an,{key:B,text:S.description},{default:Ie(()=>[ae(jt,{class:"kbtn",size:"sm",variant:"primary",loading:y.value===`option:${S.label}`,disabled:e.busy,onClick:W=>I(S.label)},{default:Ie(()=>[ot(R(S.label),1),ae(Er,{class:"k",keys:[String(B+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),Se(jt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:y.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ie(()=>[ot(R(C(s)("approval.approvePlan")),1),ae(Er,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:N},{default:Ie(()=>[ot(R(C(s)("approval.revise")),1),i.value.options.length===0?(x(),Se(Er,{key:0,class:"k",keys:["2"]})):ue("",!0)]),_:1},8,["disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:y.value==="rejectAndExit",disabled:e.busy,onClick:M},{default:Ie(()=>[ot(R(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),Se(Er,{key:0,class:"k",keys:["3"]})):ue("",!0)]),_:1},8,["loading","disabled"])])):(x(),E("div",fhe,[ae(jt,{class:"kbtn",size:"sm",variant:"primary",loading:y.value==="approve",disabled:e.busy,onClick:g},{default:Ie(()=>[ot(R(C(s)("approval.approve")),1),ae(Er,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",loading:y.value==="approveSession",disabled:e.busy,onClick:v},{default:Ie(()=>[ot(R(C(s)("approval.approveSession")),1),ae(Er,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",loading:y.value==="reject",disabled:e.busy,onClick:b},{default:Ie(()=>[ot(R(C(s)("approval.reject")),1),ae(Er,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ie(()=>[ot(R(C(s)("approval.feedback")),1),ae(Er,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),phe=dt(hhe,[["__scopeId","data-v-458a9d7d"]]),mhe=Je({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(x(),E("span",{class:Ue(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},R(n[t.status]),3))}}),fT=dt(mhe,[["__scopeId","data-v-f595d935"]]),ghe={class:"taskspane"},vhe={class:"tp-head"},yhe={class:"tp-title"},khe={class:"tp-count"},bhe={class:"tp-list"},xhe={key:0,class:"tp-empty"},whe=["role","onClick"],_he={class:"tp-name"},She={class:"tp-time"},Che=["onClick"],Ahe={key:0,class:"tp-detail"},Mhe={key:0,class:"tp-codebox"},Ehe=["onClick"],The={class:"tp-pre"},Nhe={class:"tp-cmd"},Ihe={key:1,class:"tp-codebox"},Lhe=["onClick"],$he={class:"tp-pre"},Fhe=Je({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=$t(),s=zo(new Set),i=zo(new Set),r=zo(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,m,y){await Jo(p)&&(y.add(m),setTimeout(()=>y.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
315
- `)??"";m&&await d(m,p.id,r)}return(p,m)=>(x(),E("div",ghe,[w("div",vhe,[w("span",yhe,R(C(o)("tasks.tag")),1),w("span",khe,R(e.tasks.length),1)]),w("div",bhe,[e.tasks.length===0?(x(),E("div",xhe,R(C(o)("tasks.emptyTasks")),1)):(x(!0),E(We,{key:1},rt(e.tasks,y=>(x(),E("div",{key:y.id,class:Ue(["tp-row",{done:y.state==="done",fail:y.state==="fail",expandable:c(y)}])},[w("div",{class:"tp-main",role:c(y)?"button":void 0,onClick:k=>a(y)},[ae(fT,{status:u(y.state)},null,8,["status"]),w("span",_he,R(y.name),1),ae(qi,{variant:"neutral",size:"sm"},{default:Ie(()=>[ot(R(y.kind),1)]),_:2},1024),w("span",She,R(y.timing),1),y.state==="run"?(x(),E("button",{key:0,class:"tp-stop",onClick:St(k=>n("cancel",y.id),["stop"])},R(C(o)("tasks.stop")),9,Che)):ue("",!0),y.kind==="subagent"?(x(),Se(Ge,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(y)?(x(),Se(Ge,{key:2,class:Ue(["tp-chevron",{open:s.has(y.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ue("",!0)],8,whe),s.has(y.id)&&l(y)?(x(),E("div",Ahe,[y.meta?(x(),E("div",Mhe,[w("button",{class:Ue(["tp-copy",{copied:i.has(y.id)}]),onClick:St(k=>f(y),["stop"])},R(i.has(y.id)?"已复制":"复制"),11,Ehe),w("pre",The,[w("code",null,[w("span",Nhe,R(y.meta),1)])])])):ue("",!0),y.output&&y.output.length>0?(x(),E("div",Ihe,[w("button",{class:Ue(["tp-copy",{copied:r.has(y.id)}]),onClick:St(k=>h(y),["stop"])},R(r.has(y.id)?"已复制":"复制"),11,Lhe),w("pre",$he,[w("code",null,[m[0]||(m[0]=ot(`
316
- `,-1)),(x(!0),E(We,null,rt(y.output,(k,g)=>(x(),E("span",{key:g,class:"tp-line"},R(k),1))),128)),m[1]||(m[1]=ot(`
317
- `,-1))])])])):ue("",!0)])):ue("",!0)],2))),128))])]))}}),P3=dt(Fhe,[["__scopeId","data-v-28fd5fc0"]]),Ohe={class:"todo-card"},Bhe={key:0,class:"tc-empty"},Rhe={class:"tc-name"},Dhe=Je({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=$t();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(x(),E("div",Ohe,[t.todos.length===0?(x(),E("div",Bhe,[i[0]||(i[0]=w("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[w("path",{d:"M9 11l2 2 4-4"}),w("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),w("span",null,R(C(n)("tasks.emptyTodo")),1)])):ue("",!0),(x(!0),E(We,null,rt(t.todos,(r,l)=>(x(),E("div",{key:l,class:Ue(["tc-row",`s-${r.status}`])},[ae(fT,{status:o(r.status)},null,8,["status"]),w("span",Rhe,R(r.title),1)],2))),128))]))}}),Phe=dt(Dhe,[["__scopeId","data-v-01c65735"]]),Hhe={class:"dock-work-head"},Whe={key:0,class:"dock-work-tab static"},zhe={key:1,class:"dock-work-tab static"},Uhe={key:2,class:"dock-work-tab static"},qhe={class:"dock-work-body"},jhe={class:"dw-count"},Vhe={class:"dw-count"},Khe={class:"dw-count"},Ghe=Je({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{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:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=$t(),r=oe(null),l=oe(null),a=oe(null),c=oe(null);function u(y){return r.value?(r.value.loadForEdit(y),!0):!1}function d(y){r.value?.loadAttachmentsForEdit(y)}function f(){r.value?.focus()}function h(y){if(!o.dockPanel)return;const k=y.target;k&&(l.value?.contains(k)||a.value?.contains(k)||s("close-dock-panel"))}et(()=>o.dockPanel,y=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),y&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function m(){const y=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${y}px`)}return An(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(m),p.observe(c.value),m())}),On(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(y,k)=>(x(),E("div",{ref_key:"dockRef",ref:c,class:Ue(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:k[28]||(k[28]=St(()=>{},["stop"]))},[ae(Ua,{name:"dock-panel"},{default:Ie(()=>[e.dockPanel?(x(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:k[3]||(k[3]=St(()=>{},["stop"]))},[w("div",Hhe,[e.dockPanel==="bash"?(x(),E("span",Whe,R(C(i)("tasks.dockBash"))+" · "+R(e.bashRunning)+" "+R(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),E("span",zhe,R(C(i)("tasks.dockSubagent"))+" · "+R(e.subagentRunning)+" "+R(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),E("span",Uhe,R(C(i)("tasks.dockTodos"))+" · "+R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1)):ue("",!0)]),w("div",qhe,[e.dockPanel==="bash"?(x(),Se(P3,{key:0,tasks:e.bashTasks,onCancel:k[0]||(k[0]=g=>s("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),Se(P3,{key:1,tasks:e.subagentTasks,onCancel:k[1]||(k[1]=g=>s("cancelTask",g)),onOpen:k[2]||(k[2]=g=>s("openAgent",g))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),Se(Phe,{key:2,todos:e.todos??[]},null,8,["todos"])):ue("",!0)])],512)):ue("",!0)]),_:1}),e.goal?(x(),Se(Xde,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:k[4]||(k[4]=g=>s("controlGoal",g))},null,8,["goal","force-expanded"])):ue("",!0),e.hasDockWork?(x(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),Se(Cp,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:k[5]||(k[5]=g=>s("toggle-dock-panel","bash"))},{default:Ie(()=>[ae(Ge,{name:"clock",size:"md"}),w("span",null,R(C(i)("tasks.dockBash")),1),w("span",jhe,[k[29]||(k[29]=ot("(",-1)),w("b",null,R(e.bashTasks.length),1),k[30]||(k[30]=ot(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0),e.subagentTasks.length>0?(x(),Se(Cp,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:k[6]||(k[6]=g=>s("toggle-dock-panel","subagent"))},{default:Ie(()=>[ae(Ge,{name:"sparkles",size:"md"}),w("span",null,R(C(i)("tasks.dockSubagent")),1),w("span",Vhe,[k[31]||(k[31]=ot("(",-1)),w("b",null,R(e.subagentTasks.length),1),k[32]||(k[32]=ot(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0),(e.todos?.length??0)>0?(x(),Se(Cp,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:k[7]||(k[7]=g=>s("toggle-dock-panel","todos"))},{default:Ie(()=>[ae(Ge,{name:"check-list",size:"md"}),w("span",null,R(C(i)("tasks.dockTodos")),1),w("span",Khe,[k[33]||(k[33]=ot("(",-1)),w("b",null,R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1),k[34]||(k[34]=ot(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0)],512)):ue("",!0),e.pendingQuestion?(x(),Se(Sfe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:k[8]||(k[8]=(g,v)=>s("answer",g,v)),onDismiss:k[9]||(k[9]=g=>s("dismiss",g))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),Se(phe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:k[10]||(k[10]=g=>s("approval",e.pendingApproval.approvalId,g))},null,8,["block","agent-name","busy"])):(x(),Se(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,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:k[11]||(k[11]=g=>s("submit",g)),onSteer:k[12]||(k[12]=g=>s("steer",g)),onCommand:k[13]||(k[13]=g=>s("command",g)),onInterrupt:k[14]||(k[14]=g=>s("interrupt")),onSetPermission:k[15]||(k[15]=g=>s("setPermission",g)),onSetThinking:k[16]||(k[16]=g=>s("setThinking",g)),onTogglePlan:k[17]||(k[17]=g=>s("togglePlan")),onToggleSwarm:k[18]||(k[18]=g=>s("toggleSwarm")),onToggleGoal:k[19]||(k[19]=g=>s("toggleGoal")),onOpenBtw:k[20]||(k[20]=g=>s("openBtw")),onCreateGoal:k[21]||(k[21]=g=>s("createGoal",g)),onControlGoal:k[22]||(k[22]=g=>s("controlGoal",g)),onFocusGoal:k[23]||(k[23]=g=>s("focusGoal")),onFocusSwarm:k[24]||(k[24]=g=>s("focusSwarm")),onCompact:k[25]||(k[25]=g=>s("compact")),onPickModel:k[26]||(k[26]=g=>s("pickModel")),onSelectModel:k[27]||(k[27]=g=>s("selectModel",g))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Yhe=dt(Ghe,[["__scopeId","data-v-9e5ec0f2"]]),Zhe=["aria-label","aria-hidden"],Xhe={class:"toc-scroll"},Qhe=["onClick"],Jhe={class:"toc-label"},epe=240,tpe=Je({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=oe(null),r=oe(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=epe}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return et(c,u=>{l?.disconnect(),l=null,u&&yt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ho(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),E("nav",{key:0,ref_key:"navRef",ref:i,class:Ue(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[w("div",Xhe,[(x(!0),E(We,null,rt(e.items,f=>(x(),E("button",{key:f.id,type:"button",class:Ue(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",Jhe,R(f.title),1)],10,Qhe))),128))])],10,Zhe)):ue("",!0)}}),npe=dt(tpe,[["__scopeId","data-v-3f1c1f66"]]),ope=5;function spe(e,t,n,o=ope){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const ipe={class:"chat-layout"},rpe={class:"empty-hint"},lpe={key:0,class:"empty-hint-text"},ape={key:1,class:"ws-pick"},cpe={class:"ws-pick-name"},upe={key:1,class:"ws-pick-menu"},dpe=["onClick"],fpe={class:"ws-pick-item-name"},hpe={class:"ws-pick-item-path"},ppe=["aria-label"],mpe={key:0,class:"abort-toast",role:"status","aria-live":"polite"},gpe={class:"abort-toast-text"},Ov=80,H3=1e3,vpe=420,ype=3e3,kpe=Je({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{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:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=$t(),s=e,i=n,r=oe(!1),l=oe(!1),a=D(()=>s.workspaces?.find(Ee=>Ee.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=D(()=>(s.workspaces?.length??0)>0),u=D(()=>spe(s.workspaces??[],s.activeWorkspaceId,l.value)),d=D(()=>(s.workspaces?.length??0)-u.value.length);et(r,ge=>{ge||(l.value=!1)});function f(ge){r.value=!1,ge!==s.activeWorkspaceId&&i("selectWorkspace",ge)}qa(Dt.contentAlign);const h=oe(null),p=oe(null),m=oe(null),y=oe(!1),k=oe(0);let g=null;function v(ge,Ee){const ze=m.value??p.value;return!ze||ze.loadForEdit(ge)===!1?!1:(ze.loadAttachmentsForEdit(Ee??[]),!0)}function b(){y.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,y.value=!1},2e3)}function A(){k.value++}const I=D(()=>s.tasks.filter(ge=>ge.kind!=="subagent")),N=D(()=>s.tasks.filter(ge=>ge.kind==="subagent"&&ge.runInBackground)),M=D(()=>I.value.filter(ge=>ge.state==="run").length),$=D(()=>N.value.filter(ge=>ge.state==="run").length);function T(ge){const Ee=s.tasks,ze=Ee.find(Ut=>Ut.id===ge)??Ee.find(Ut=>Ut.parentToolCallId===ge);if(ze)return ze.id;const Ht=Ee.filter(Ut=>Ut.kind==="subagent"&&!Ut.parentToolCallId);if(Ht.length===1)return Ht[0].id}Ln("resolveAgentTaskId",T),Ln("pinScroll",to);const F=D(()=>(s.todos??[]).filter(ge=>ge.status==="done").length),S=D(()=>I.value.length>0||N.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),B=oe(null),W=D(()=>s.gitInfo?s.changes?.length??0:0);function z(ge){B.value=B.value===ge?null:ge}function L(){B.value=null}et(S,ge=>{ge||L()});function O(ge){if(ge.role==="compaction")return o("conversation.compactedPlain");if(ge.role==="user"){if(ge.skillActivation)return`/${ge.skillActivation.name}`;if(ge.pluginCommand)return`/${ge.pluginCommand.pluginId}:${ge.pluginCommand.commandName}`;const ze=ge.text.trim().replaceAll(/\s+/g," ");return ze.length>0?ze:"user"}const Ee=(ge.text||ge.thinking||"").trim().replaceAll(/\s+/g," ");return Ee.length>0?Ee:(ge.tools?.length??0)>0?`${ge.tools.length} tools`:"kimi"}const U=D(()=>s.turns.filter(ge=>ge.role==="user").map((ge,Ee)=>({id:ge.id,role:ge.role,no:Ee+1,title:O(ge)}))),Z=oe(null);function ie(){const ge=Ae.value;if(!ge)return;const Ee=ge.querySelectorAll(".turn-anchor[data-turn-id]");if(Ee.length===0)return;const ze=U.value;if(ze.length===0)return;const Ht=new Set(ze.map(us=>us.id));if(pe()<=Ov){Z.value=ze[ze.length-1].id;return}const Ut=ge.getBoundingClientRect(),wn=Ut.height/2;let go=null;Ee.forEach(us=>{const te=us.dataset.turnId;if(!te||!Ht.has(te))return;us.getBoundingClientRect().top-Ut.top<=wn&&(go=te)}),Z.value=go??ze[0].id}const q=oe(!1);let ee=0;function fe(){ee||(ee=Kt(()=>{ee=0,ne()}))}function ne(){const ge=Ae.value,Ee=!s.mobile&&s.conversationToc&&ge?ge.closest(".con")?.querySelector(".conversation-toc"):null,ze=Ee?.querySelector(".toc-bar");let Ht=!1;if(ge&&Ee&&ze){const Ut=ze.getBoundingClientRect(),wn=Ee.getBoundingClientRect(),go=Ut.left+Ut.width/2;Ht=Array.from(ge.querySelectorAll(".table-node-wrapper")).some(us=>{const te=us.getBoundingClientRect();return te.left<=go&&go<=te.right&&te.top<wn.bottom&&te.bottom>wn.top})}q.value!==Ht&&(q.value=Ht)}const j=D(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),K=D(()=>{const ge=j.value;if(ge)return s.pendingQuestionActions?.[ge.questionId]}),ve=D(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),he=D(()=>{const ge=ve.value;return ge?!!s.pendingApprovalActions?.[ge.approvalId]:!1}),Ae=oe(null),re=oe(null),Y=oe(0),Q=oe(0),P=D(()=>({"--panes-scrollbar-width":`${Y.value}px`}));function G(ge){return ge instanceof HTMLElement?ge:ge&&"$el"in ge&&ge.$el instanceof HTMLElement?ge.$el:null}function me(){const ge=Ae.value;Y.value=ge?Math.max(0,ge.offsetWidth-ge.clientWidth):0,Q.value=re.value?.offsetHeight??0}function ye(ge){const Ee=G(ge);Ae.value=Ee,Ee&&ts()}function de(ge){const Ee=G(ge);re.value=Ee??null,ge&&"loadForEdit"in ge&&typeof ge.loadForEdit=="function"&&"focus"in ge&&typeof ge.focus=="function"?m.value={loadForEdit:ge.loadForEdit.bind(ge),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ge&&typeof ge.loadAttachmentsForEdit=="function"?ge.loadAttachmentsForEdit.bind(ge):()=>{},focus:ge.focus.bind(ge)}:m.value=null,Vs()}const V=oe(!0),se=oe(!1);function pe(){const ge=Ae.value;return ge?ge.scrollHeight-ge.scrollTop-ge.clientHeight:0}let ke=0,Ne=0,qe=0,be=0,xe=0,Ze=0;function tt(){return Date.now()<Ne}function lt(){fe();const ge=Ae.value;if(!ge)return;const Ee=ge.scrollTop;if(gn()){ke=Ee;return}if(performance.now()-qe<100){ke=Ee;return}const ze=pe();if(tt()){V.value=!0,se.value=!1,ke=Ee;return}Ee<ke-1&&ze>1?(V.value=!1,se.value=!0):ze<=Ov&&Ee>ke+1&&(V.value=!0,se.value=!1),ke=Ee,ie()}function ut(ge=!1){const Ee=Ae.value;V.value=!0,se.value=!1,Ee&&(!ge&&performance.now()<be||(ge&&typeof Ee.scrollTo=="function"?(qe=performance.now(),be=performance.now()+vpe,Ee.scrollTo({top:Ee.scrollHeight,behavior:"smooth"})):Ee.scrollTop=Ee.scrollHeight,ke=Ee.scrollTop))}function mt(ge,Ee){return(Ee.closest("[inert]")?.closest(".tool-group")??Ee).getBoundingClientRect().top-ge.getBoundingClientRect().top+ge.scrollTop}function Tt(ge,Ee){const ze=Array.from(ge.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(wn=>({node:wn,top:mt(ge,wn)})),Ht=ze.findIndex(wn=>wn.top>=Ee),Ut=Ht<0?Math.max(0,ze.length-1):Ht;return ze.slice(Ut,Ut+2).flatMap(wn=>{const go=wn.node.dataset.scrollAnchorId,us=go??wn.node.dataset.turnId;return us?[{kind:go?"tool":"turn",id:us,top:wn.top}]:[]})}const wt=new Map;function Ft(ge,Ee){for(const ze of Ee.anchors){const Ht=ze.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Ut=ge.querySelector(`[${Ht}="${Pt(ze.id)}"]`);if(Ut)return mt(ge,Ut)-ze.top}return ge.scrollHeight-Ee.oldHeight}function en(ge,Ee,ze=ge.scrollTop){return ge.scrollTop=ze+Ft(ge,Ee),ke=ge.scrollTop,ge.scrollTop}async function Hn(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Uo.value||!s.hasMoreMessages)return;const ge=s.sessionId,Ee=Ae.value,ze=Ee?.scrollTop??0,Ht={anchors:Ee?Tt(Ee,ze):[],oldHeight:Ee?.scrollHeight??0};As(ge,!0),qo();try{if(await yt(),await s.loadOlderMessages(ge),await yt(),s.sessionId!==ge){wt.set(ge,Ht);return}const Ut=Ae.value;if(!Ut)return;en(Ut,Ht),wt.delete(ge)}finally{As(ge,!1)}}function Pt(ge){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ge):ge.replaceAll(/["\\]/g,"\\$&")}function bn(ge){const Ee=Ae.value;if(!Ee)return;const ze=Ee.querySelector(`.turn-anchor[data-turn-id="${Pt(ge)}"]`);ze&&(Bo(),V.value=!1,se.value=pe()>Ov,ze.scrollIntoView({behavior:"smooth",block:"center"}))}function pn(){const ge=Ae.value;if(!ge)return"none";const Ee=ge.firstElementChild,ze=Ee instanceof HTMLElement?Ee.offsetHeight:0,Ht=re.value?.offsetHeight??0;return`${ge.scrollHeight}:${ge.clientHeight}:${ze}:${Ht}`}function Kt(ge){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ge):setTimeout(ge,16)}function Nn(ge){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ge):clearTimeout(ge)}let Gt=0,Wt=0,mn=null,so=0;function gn(){return performance.now()<Gt}function to(ge,Ee=260){const ze=Ae.value;if(!ze||(mn=ge,so=ge.getBoundingClientRect().top,Gt=performance.now()+Ee,Wt))return;const Ht=()=>{if(Wt=0,performance.now()>=Gt||!mn){mn=null;return}const Ut=mn.getBoundingClientRect().top-so;Ut&&(ze.scrollTop+=Ut),Wt=Kt(Ht)};Wt=Kt(Ht)}function vt(ge=36){if(!V.value&&!tt())return;const Ee=++Ze;let ze="",Ht=0,Ut=0;xe&&(Nn(xe),xe=0);const wn=()=>{if(xe=0,Ee!==Ze||!V.value&&!tt())return;ut(!1);const go=pn();Ht=go===ze?Ht+1:0,ze=go,Ut++,Ht<3&&Ut<ge&&(xe=Kt(wn))};xe=Kt(wn)}function Wn(ge,Ee){return ge!==void 0&&ge.length>0&&Ee.length>=ge.length&&ge.firstId!==Ee.firstId&&ge.lastId===Ee.lastId&&ge.lastTextLen===Ee.lastTextLen&&ge.lastThinkingLen===Ee.lastThinkingLen&&ge.lastToolsLen===Ee.lastToolsLen&&ge.approvalIds===Ee.approvalIds}const Bn=D(()=>{const ge=(s.approvals??[]).map(wn=>wn.approvalId).join(","),Ee=s.turns,ze=Ee.at(-1),Ht=ze?.thinking?.length??0,Ut=ze?.tools?.reduce((wn,go)=>wn+go.name.length+(go.arg?.length??0)+(go.output?.join("").length??0),0)??0;return{length:Ee.length,firstId:Ee[0]?.id??"",lastId:ze?.id??"",lastTextLen:ze?.text.length??0,lastThinkingLen:Ht,lastToolsLen:Ut,approvalIds:ge}});et(Bn,async(ge,Ee)=>{if(Uo.value&&Wn(Ee,ge)){ie();return}await yt(),V.value||tt()?ut(ge.length<Ee.length):se.value=!0,ie()}),et(re,()=>{Vs()}),et(()=>s.mobile,async()=>{await yt(),me()});const Qn=new Map;et(()=>s.fileReloadKey,async(ge,Ee)=>{const ze=Ae.value;Ee&&ze&&Qn.set(String(Ee),{top:ze.scrollTop,following:V.value}),Bo(),await yt();const Ht=Ae.value,Ut=ge?Qn.get(String(ge)):void 0;if(Ut&&Ht){const wn=wt.get(String(ge)),go=wn?en(Ht,wn,Ut.top):Ut.top;wn&&wt.delete(String(ge)),V.value=Ut.following,Ht.scrollTop=go,ke=Ht.scrollTop,se.value=!Ut.following&&pe()>1,Ut.following&&vt()}else V.value=!0,ke=0,ut(!1),vt();ie()}),et(()=>s.sessionLoading,async(ge,Ee)=>{ge||!Ee||(V.value=!0,await yt(),vt(),ie())}),et(()=>s.turnActive,async(ge,Ee)=>{ge||!Ee||!V.value&&!tt()||(await yt(),vt(48),ie())});function sn(){V.value=!0,se.value=!1,Ne=Date.now()+H3,yt(()=>{ut(!0),vt(16)})}function es(ge){sn(),i("submit",ge)}function nt(ge){V.value=!0,se.value=!1,Ne=Date.now()+H3,i("editMessage",ge)}function Be(ge){const Ee=s.queued?.[ge],ze=Ee?.text??"";v(ze,Ee?.attachments)&&i("editQueued",ge)}function Bt(ge){i("reorderQueue",ge)}function Yt(ge,Ee){sn(),i("answer",ge,Ee)}function vn(ge,Ee){!ge||!Ee||i("approval",ge,Ee)}let xn=null,nn=null,Vn=null,Kn=null,Jn=0,Oo=0,ko=0;const li=oe(new Set),Uo=D(()=>!!s.sessionId&&li.value.has(s.sessionId));function As(ge,Ee){const ze=new Set(li.value);Ee?ze.add(ge):ze.delete(ge),li.value=ze}function cs(){Uo.value||ko||(ko=Kt(()=>{ko=0,!Uo.value&&(gn()||(V.value||tt())&&ut(!1))}))}function qo(){Ze++,xe&&(Nn(xe),xe=0),ko&&(Nn(ko),ko=0)}function Bo(){const ge=Ae.value;if(Ne=0,qo(),Gt=0,mn=null,ge){const Ee=ge.scrollTop;typeof ge.scrollTo=="function"?ge.scrollTo({top:Ee,behavior:"auto"}):ge.scrollTop=Ee}be=0,qe=Number.NEGATIVE_INFINITY,ge&&(ke=ge.scrollTop)}function ai(){const ge=Ae.value;!ge||ge.scrollHeight-ge.clientHeight<=1&&!s.hasMoreMessages||(V.value=!1,Bo(),ge.scrollHeight-ge.clientHeight>1&&(se.value=!0))}function tn(ge){const Ee=Ae.value;if(!Ee)return!1;for(const ze of ge.composedPath()){if(ze===Ee)return!1;if(ze instanceof HTMLElement&&ze.scrollHeight>ze.clientHeight+1&&ze.scrollTop>1)return!0}return!1}function qs(ge){ge.defaultPrevented||ge.ctrlKey||ge.shiftKey||ge.deltaY>=0||tn(ge)||ai()}function io(ge){const Ee=Ae.value;if(!Ee||ge.defaultPrevented||ge.button!==0||ge.pointerType==="touch")return;const ze=Ee.getBoundingClientRect(),Ht=Ee.offsetWidth-Ee.clientWidth,Ut=Ht>0?Ht:12;ge.target===Ee&&ge.clientX>=ze.right-Ut&&ai()}let js=null;function ci(ge){js=ge.touches.length===1?ge.touches[0].clientY:null}function Ni(ge){const Ee=ge.touches.length===1?ge.touches[0].clientY:null;Ee!==null&&js!==null&&Ee>js+2&&!tn(ge)&&ai(),js=Ee}function ui(){if(!nn)return;const ge=Ae.value?.firstElementChild??null;ge!==Vn&&(Vn&&nn.unobserve(Vn),Vn=ge,ge&&nn.observe(ge))}function Vs(){if(!nn)return;const ge=re.value;ge!==Kn&&(Kn&&nn.unobserve(Kn),Kn=ge,ge&&nn.observe(ge))}function ts(){const ge=Ae.value;me(),xn&&(xn.disconnect(),ge&&xn.observe(ge,{childList:!0,subtree:!0,characterData:!0})),nn&&(nn.disconnect(),Vn=null,Kn=null,ge&&nn.observe(ge),ui(),Vs()),Jn=ge?.scrollHeight??0,Oo=ge?.clientHeight??0,fe()}function ns(){ui(),cs(),fe()}function zt(){typeof document>"u"||document.visibilityState==="visible"&&V.value&&vt()}const Ms=oe(!1);let No=null;function di(){Ms.value=!0,No!==null&&clearTimeout(No),No=setTimeout(()=>{Ms.value=!1},ype)}function Ke(){di(),i("interrupt")}function Re(ge){ge.key==="Escape"&&(s.running||s.working)&&(ge.preventDefault(),Ke())}function le(){V.value&&cs()}An(()=>{yt(()=>{typeof MutationObserver=="function"&&(xn=new MutationObserver(ns)),typeof ResizeObserver=="function"&&(nn=new ResizeObserver(()=>{fe(),me();const ge=Ae.value;if(!ge)return;const{scrollHeight:Ee,clientHeight:ze}=ge,Ht=Ee>Jn+1,Ut=ze<Oo-1;Jn=Ee,Oo=ze,!gn()&&(Ht||Ut)&&cs()})),ts(),vt(48),ie(),typeof document<"u"&&(document.addEventListener("visibilitychange",zt),document.addEventListener("keydown",Re)),window.visualViewport?.addEventListener("resize",le)})}),On(()=>{xn&&xn.disconnect(),nn&&nn.disconnect(),ko&&Nn(ko),xe&&Nn(xe),Wt&&Nn(Wt),ee&&Nn(ee),No!==null&&clearTimeout(No),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",zt),document.removeEventListener("keydown",Re)),window.visualViewport?.removeEventListener("resize",le)});function Te(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Te}),(ge,Ee)=>(x(),E("section",{class:Ue(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),Se(hae,{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":W.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:y.value,onOpenChanges:Ee[0]||(Ee[0]=ze=>i("openChanges")),onCopyAll:Ee[1]||(Ee[1]=ze=>h.value?.copyConversation()),onCopyFinalSummary:Ee[2]||(Ee[2]=ze=>h.value?.copyFinalSummary()),onOpenPr:Ee[3]||(Ee[3]=ze=>e.pr&&i("openPr",e.pr.url)),onRenameSession:Ee[4]||(Ee[4]=(ze,Ht)=>i("renameSession",ze,Ht)),onForkSession:Ee[5]||(Ee[5]=ze=>i("forkSession",ze)),onArchiveSession:Ee[6]||(Ee[6]=ze=>i("archiveSession",ze)),onExportSession:Ee[7]||(Ee[7]=ze=>i("exportSession",ze))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ue("",!0),e.conversationToc?(x(),Se(npe,{key:1,items:U.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:q.value,onSelect:bn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ue("",!0),w("div",ipe,[w("div",{ref:ye,class:Ue(["panes chat-scroll",{"is-following":V.value,"history-prepending":Uo.value}]),onScrollPassive:lt,onWheelPassive:qs,onPointerdownPassive:io,onTouchstartPassive:ci,onTouchmovePassive:Ni},[w("div",{class:Ue(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),E(We,{key:0},[Ee[55]||(Ee[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",rpe,[w("span",{class:Ue(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),Se(Us,{key:0,size:"sm"})):ue("",!0),w("span",null,R(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ue("",!0):(x(),E("span",lpe,R(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),E("div",ape,[ae(an,{text:C(o)("conversation.switchWorkspace")},{default:Ie(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:Ee[8]||(Ee[8]=St(ze=>r.value=!r.value,["stop"]))},[ae(Ge,{name:"folder",size:"sm"}),w("span",cpe,R(a.value),1),ae(Ge,{class:Ue(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),E("div",{key:0,class:"ws-pick-backdrop",onClick:Ee[9]||(Ee[9]=ze=>r.value=!1)})):ue("",!0),r.value?(x(),E("div",upe,[(x(!0),E(We,null,rt(u.value,ze=>(x(),E("button",{key:ze.id,type:"button",class:Ue(["ws-pick-item",{on:ze.id===e.activeWorkspaceId}]),onClick:St(Ht=>f(ze.id),["stop"])},[w("span",fpe,R(ze.name),1),w("span",hpe,R(ze.shortPath),1)],10,dpe))),128)),d.value>0?(x(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Ee[10]||(Ee[10]=St(ze=>l.value=!l.value,["stop"]))},[w("span",null,R(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ue("",!0),Ee[54]||(Ee[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:Ee[11]||(Ee[11]=St(ze=>{r.value=!1,i("addWorkspace")},["stop"]))},[ae(Ge,{name:"plus",size:"sm"}),w("span",null,R(C(o)("conversation.addWorkspace")),1)])])):ue("",!0)])):e.starting?ue("",!0):(x(),E("button",{key:2,type:"button",class:"empty-add-workspace",onClick:Ee[12]||(Ee[12]=ze=>i("addWorkspace"))},[ae(Ge,{name:"folder-plus",size:"sm"}),w("span",null,R(C(o)("conversation.addWorkspace")),1)]))]),ae(dT,{ref_key:"emptyComposerRef",ref:p,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,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:es,onSteer:Ee[13]||(Ee[13]=ze=>i("steer",ze)),onCommand:Ee[14]||(Ee[14]=ze=>i("command",ze)),onInterrupt:Ke,onUnqueue:Ee[15]||(Ee[15]=ze=>i("unqueue",ze)),onEditQueued:Ee[16]||(Ee[16]=ze=>i("editQueued",ze)),onSetPermission:Ee[17]||(Ee[17]=ze=>i("setPermission",ze)),onSetThinking:Ee[18]||(Ee[18]=ze=>i("setThinking",ze)),onTogglePlan:Ee[19]||(Ee[19]=ze=>i("togglePlan")),onToggleSwarm:Ee[20]||(Ee[20]=ze=>i("toggleSwarm")),onToggleGoal:Ee[21]||(Ee[21]=ze=>i("toggleGoal")),onOpenBtw:Ee[22]||(Ee[22]=ze=>i("command","/btw")),onCreateGoal:Ee[23]||(Ee[23]=ze=>i("createGoal",ze)),onControlGoal:Ee[24]||(Ee[24]=ze=>i("controlGoal",ze)),onFocusGoal:A,onCompact:Ee[25]||(Ee[25]=ze=>i("compact")),onPickModel:Ee[26]||(Ee[26]=ze=>i("pickModel")),onSelectModel:Ee[27]||(Ee[27]=ze=>i("selectModel",ze))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),Ee[56]||(Ee[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(x(),Se(tT,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"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":V.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:Ee[28]||(Ee[28]=ze=>i("openFile",ze)),onOpenMedia:Ee[29]||(Ee[29]=ze=>i("openMedia",ze)),onCopyConversationCopied:b,onOpenThinking:Ee[30]||(Ee[30]=ze=>i("openThinking",ze)),onOpenCompaction:Ee[31]||(Ee[31]=ze=>i("openCompaction",ze)),onOpenAgent:Ee[32]||(Ee[32]=ze=>i("openAgent",ze)),onOpenToolDiff:Ee[33]||(Ee[33]=ze=>i("openToolDiff",ze)),onEditMessage:nt,onLoadOlderMessages:Hn,onUnqueue:Ee[34]||(Ee[34]=ze=>i("unqueue",ze)),onEditQueued:Be,onReorderQueue:Bt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ue("",!0):(x(),Se(Yhe,{key:0,ref:de,style:on(P.value),"session-id":e.sessionId,running:e.running,starting:e.starting,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":k.value,"dock-panel":B.value,"bash-tasks":I.value,"subagent-tasks":N.value,"bash-running":M.value,"subagent-running":$.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":j.value,"question-busy-kind":K.value,"pending-approval":ve.value,"approval-busy":he.value,mobile:e.mobile,onToggleDockPanel:Ee[35]||(Ee[35]=ze=>z(ze)),onCloseDockPanel:Ee[36]||(Ee[36]=ze=>L()),onOpenAgent:Ee[37]||(Ee[37]=ze=>i("openAgent",ze)),onAnswer:Yt,onDismiss:Ee[38]||(Ee[38]=ze=>i("dismiss",ze)),onApproval:vn,onCancelTask:Ee[39]||(Ee[39]=ze=>i("cancelTask",ze)),onControlGoal:Ee[40]||(Ee[40]=ze=>i("controlGoal",ze)),onSubmit:es,onSteer:Ee[41]||(Ee[41]=ze=>i("steer",ze)),onCommand:Ee[42]||(Ee[42]=ze=>i("command",ze)),onInterrupt:Ke,onSetPermission:Ee[43]||(Ee[43]=ze=>i("setPermission",ze)),onSetThinking:Ee[44]||(Ee[44]=ze=>i("setThinking",ze)),onTogglePlan:Ee[45]||(Ee[45]=ze=>i("togglePlan")),onToggleSwarm:Ee[46]||(Ee[46]=ze=>i("toggleSwarm")),onToggleGoal:Ee[47]||(Ee[47]=ze=>i("toggleGoal")),onOpenBtw:Ee[48]||(Ee[48]=ze=>i("command","/btw")),onCreateGoal:Ee[49]||(Ee[49]=ze=>i("createGoal",ze)),onFocusGoal:A,onCompact:Ee[50]||(Ee[50]=ze=>i("compact")),onPickModel:Ee[51]||(Ee[51]=ze=>i("pickModel")),onSelectModel:Ee[52]||(Ee[52]=ze=>i("selectModel",ze))},null,8,["style","session-id","running","starting","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","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ae(Ua,{name:"pill"},{default:Ie(()=>[se.value?(x(),E("button",{key:0,class:"newmsg-pill",style:on({bottom:`${Q.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:Ee[53]||(Ee[53]=ze=>ut(!0))},[ae(Ge,{class:"pill-chevron",name:"chevron-down",size:"md"}),ot(" "+R(C(o)("conversation.newMessages")),1)],12,ppe)):ue("",!0)]),_:1}),ae(Ua,{name:"abort-toast"},{default:Ie(()=>[Ms.value?(x(),E("div",mpe,[w("span",gpe,R(C(o)("conversation.manuallyAborted")),1)])):ue("",!0)]),_:1})],2))}}),bpe=dt(kpe,[["__scopeId","data-v-68f9dafd"]]),xpe=["aria-selected","onClick"],wpe=Je({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),E("div",{class:Ue(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),E(We,null,rt(e.options,i=>(x(),E("button",{key:i.value,class:Ue(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},R(i.label),11,xpe))),128))],2))}}),ys=dt(wpe,[["__scopeId","data-v-d1aaccd7"]]),_pe={class:"ui-panel-header__title"},Spe={key:0,class:"ui-panel-header__sub"},Cpe=Je({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-panel-header",{wrap:e.wrap}])},[w("span",_pe,R(e.title),1),ae(an,{text:e.subtitle},{default:Ie(()=>[e.subtitle?(x(),E("span",Spe,R(e.subtitle),1)):ue("",!0)]),_:1},8,["text"]),jn(t.$slots,"default",{},void 0,!0),e.closable?(x(),Se(Xn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ie(()=>[ae(Ge,{name:"close",size:"sm"})]),_:1},8,["label"])):ue("",!0)],2))}}),Ya=dt(Cpe,[["__scopeId","data-v-c47879ad"]]),Ape={key:0,class:"fp-empty fp-error"},Mpe={key:1,class:"fp-empty"},Epe={key:2,class:"fp-loading"},Tpe={class:"fp-path"},Npe={class:"fp-meta"},Ipe={key:0,class:"fp-lines"},Lpe={class:"fp-size"},$pe={key:3,class:"fp-search"},Fpe=["placeholder"],Ope={key:0,class:"fp-search-count"},Bpe=["href","aria-label"],Rpe={key:1,class:"fp-code"},Dpe={class:"fp-line-table"},Ppe=["data-line"],Hpe={class:"fp-gutter"},Wpe=["innerHTML"],zpe={key:1,class:"fp-body fp-code"},Upe={class:"fp-line-table"},qpe=["data-line"],jpe={class:"fp-gutter"},Vpe=["innerHTML"],Kpe={key:2,class:"fp-body"},Gpe=["srcdoc","title"],Ype={key:1,class:"fp-code"},Zpe={class:"fp-line-table"},Xpe=["data-line"],Qpe={class:"fp-gutter"},Jpe=["innerHTML"],eme={key:3,class:"fp-body fp-pdf-wrap"},tme=["src","title"],nme={key:1,class:"fp-binary-card"},ome={class:"fp-binary-label"},sme={key:4,class:"fp-body fp-table-wrap"},ime={class:"fp-table"},rme=["data-line"],lme={key:5,class:"fp-body fp-image-wrap"},ame=["src","alt"],cme={key:1,class:"fp-binary-card"},ume={class:"fp-binary-icon"},dme={class:"fp-binary-label"},fme={key:6,class:"fp-body fp-image-wrap"},hme=["src"],pme={key:1,class:"fp-binary-card"},mme={class:"fp-binary-icon"},gme={class:"fp-binary-label"},vme={key:7,class:"fp-body fp-code"},yme={class:"fp-line-table"},kme=["data-line"],bme={class:"fp-gutter"},xme=["innerHTML"],wme={key:8,class:"fp-body fp-binary-wrap"},_me={class:"fp-binary-card"},Sme={class:"fp-binary-icon"},Cme={class:"fp-binary-label"},Ame=Je({__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}=$t();function o(re,Y){const Q=Y?Y.split("/").filter(Boolean):[];for(const P of re.split("/"))P===""||P==="."||(P===".."?Q.pop():Q.push(P));return Q.join("/")}const s=Jt("resolveImage",async re=>re),i=D(()=>{const re=c.file?.path??"",Y=re.lastIndexOf("/");return Y>0?re.slice(0,Y):""});function r(re){if(/^(https?:|data:|blob:)/i.test(re)||re.startsWith("/"))return re;const Y=i.value;return Y?o(re,Y):re}async function l(re){const Y=r(re);return s?s(Y):Y}Ln("resolveImage",l);function a(re){let Y=re.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(Y)||Y.startsWith("/"))return re;for(const P of["#","?"]){const G=Y.indexOf(P);G!==-1&&(Y=Y.slice(0,G))}const Q=i.value;return{...re,path:o(Y,Q)}}const c=e,u=t;function d(re){c.openFile?.(a(re))}const f=oe(null),h=D(()=>{const re=c.file;if(!re)return"binary";const Y=re.mime??"",Q=re.languageId??"",P=re.path.toLowerCase();return Y==="text/markdown"||Q==="markdown"||Q==="md"||P.endsWith(".mdx")?"markdown":Y==="application/json"||Q==="json"?"json":Y==="text/html"||Q==="html"||P.endsWith(".html")||P.endsWith(".htm")?"html":Y==="application/pdf"||P.endsWith(".pdf")?"pdf":Y==="text/csv"||Q==="csv"||P.endsWith(".csv")?"csv":Y.startsWith("image/")?"image":Y.startsWith("video/")?"video":re.isBinary?"binary":Y.startsWith("text/")||Q!==""?"text":"binary"});function p(re){const Y=atob(re),Q=Uint8Array.from(Y,P=>P.charCodeAt(0));return new TextDecoder().decode(Q)}const m=D(()=>{const re=c.file;if(!re)return"";if(re.encoding==="base64")try{return p(re.content)}catch{return re.content}return re.content}),y=D(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=D(()=>c.file?(h.value==="json"?y.value:m.value).split(`
318
- `):[]),g=D(()=>c.file?h.value==="json"?y.value:m.value:""),v=oe(""),b=oe(0),A=D(()=>{const re=v.value.trim().toLowerCase();if(!re)return[];const Y=[];return k.value.forEach((Q,P)=>{Q.toLowerCase().includes(re)&&Y.push(P+1)}),Y});et(v,()=>{b.value=0});function I(re,Y=!1){re&&yt(()=>{const Q=f.value?.querySelector(".fp-body"),P=Q?.querySelector(`[data-line="${re}"]`);if(!Q||!P)return;Y&&(Q.scrollTop=0);const G=Q.getBoundingClientRect(),me=P.getBoundingClientRect(),ye=me.top-G.top+Q.scrollTop;Q.scrollTop=ye-Q.clientHeight/2+me.height/2})}et(()=>[c.file?.path,c.line],()=>I(c.line,!0),{immediate:!0});function N(re){const Y=A.value;Y.length!==0&&(b.value=(b.value+re+Y.length)%Y.length,I(Y[b.value]))}function M(re){const Y=A.value;return{target:c.line===re,hit:Y.includes(re),active:Y[b.value]===re}}function $(re){return re<1024?`${re} B`:re<1024*1024?`${(re/1024).toFixed(1)} KB`:`${(re/(1024*1024)).toFixed(1)} MB`}const T=oe(!1),F=oe(!1);function S(){c.file&&Jo(g.value).then(re=>{re&&(T.value=!0,setTimeout(()=>{T.value=!1},1400))})}function B(){c.file&&Jo(c.file.path).then(re=>{re&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const W=oe("preview"),z=oe("preview"),L=oe("fit");function O(re){W.value=re}function U(re){z.value=re}function Z(re){L.value=re}et(h,re=>{W.value=re==="html"?"preview":"source",z.value="preview",L.value="fit"});const ie=D(()=>{const re=c.file;return!re||h.value!=="image"?null:re.sourceUrl?re.sourceUrl:re.encoding==="base64"?`data:${re.mime};base64,${re.content}`:re.mime==="image/svg+xml"?`data:${re.mime};charset=utf-8,${encodeURIComponent(re.content)}`:null}),q=D(()=>{const re=c.file;return!re||h.value!=="video"?null:re.sourceUrl?re.sourceUrl:re.encoding==="base64"?`data:${re.mime};base64,${re.content}`:null}),ee=D(()=>{const re=c.file;return!re||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:re.encoding==="base64"?`data:${re.mime};base64,${re.content}`:null}),fe=D(()=>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:;">`,m.value].join(""):"");function ne(re){const Y=[];let Q="",P=!1;for(let G=0;G<re.length;G++){const me=re[G];me==='"'&&re[G+1]==='"'?(Q+='"',G++):me==='"'?P=!P:me===","&&!P?(Y.push(Q),Q=""):Q+=me}return Y.push(Q),Y}const j=D(()=>k.value.slice(0,200).map(ne));function K(re){return re.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ve(){const re=c.file;if(!re)return"";const Y=re.languageId?.toLowerCase();return Y||(re.path.split(".").pop()?.toLowerCase()??"")}function he(re){const Y=ve();let Q=K(re);return h.value==="json"||Y==="json"||Y==="jsonc"?(Q=Q.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),Q=Q.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),Q=Q.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Q=Q.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Q):h.value==="html"||Y==="html"||Y==="xml"||Y==="svg"?(Q=Q.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Q=Q.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Q):(Q=Q.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>'),Q=Q.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Q)}function Ae(re,Y=55){return!re||re.length<=Y?re:"…"+re.slice(re.length-Y+1)}return(re,Y)=>(x(),E("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),E("div",Ape,[w("span",null,R(e.error),1),e.closable?(x(),Se(jt,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=Q=>u("close"))},{default:Ie(()=>[ot(R(C(n)("filePreview.close")),1)]),_:1})):ue("",!0)])):!e.file&&!e.loading?(x(),E("div",Mpe,R(C(n)("filePreview.empty")),1)):e.loading?(x(),E("div",Epe,[Y[7]||(Y[7]=w("span",{class:"spinner"},null,-1)),w("span",null,R(C(n)("filePreview.loading")),1)])):e.file?(x(),E(We,{key:3},[ae(Ya,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:Y[6]||(Y[6]=Q=>u("close"))},{default:Ie(()=>[ae(an,{text:e.file.path},{default:Ie(()=>[w("span",Tpe,R(Ae(e.file.path)),1)]),_:1},8,["text"]),w("span",Npe,[e.file.lineCount?(x(),E("span",Ipe,R(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ue("",!0),w("span",Lpe,R($(e.file.size)),1)]),h.value==="html"?(x(),Se(ys,{key:0,"model-value":W.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":O},null,8,["model-value","options"])):ue("",!0),h.value==="markdown"?(x(),Se(ys,{key:1,"model-value":z.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):ue("",!0),h.value==="image"?(x(),Se(ys,{key:2,"model-value":L.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ue("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),E("div",$pe,[qn(w("input",{"onUpdate:modelValue":Y[1]||(Y[1]=Q=>v.value=Q),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Fpe),[[Cs,v.value]]),v.value.trim()?(x(),E("span",Ope,R(A.value.length),1)):ue("",!0),ae(Xn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=Q=>N(-1))},{default:Ie(()=>[ae(Ge,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ae(Xn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=Q=>N(1))},{default:Ie(()=>[ae(Ge,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ue("",!0),ae(Xn,{size:"sm",class:Ue({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:B},{default:Ie(()=>[F.value?(x(),Se(Ge,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Se(Ge,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),Se(Xn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=Q=>u("openExternal"))},{default:Ie(()=>[ae(Ge,{name:"external-link",size:"md"})]),_:1},8,["label"])):ue("",!0),e.externalActions?(x(),Se(Xn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=Q=>u("reveal"))},{default:Ie(()=>[ae(Ge,{name:"folder",size:"md"})]),_:1},8,["label"])):ue("",!0),e.downloadUrl?(x(),E("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ae(Ge,{name:"download",size:"md"})],8,Bpe)):ue("",!0),!e.file.isBinary&&h.value!=="image"?(x(),Se(Xn,{key:7,size:"sm",class:Ue({copied:T.value}),label:T.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ie(()=>[T.value?(x(),Se(Ge,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Se(Ge,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ue("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),E("div",{key:0,class:Ue(["fp-body",{"fp-markdown":z.value==="preview"}])},[z.value==="preview"?(x(),Se(Q1,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),E("div",Rpe,[w("div",Dpe,[(x(!0),E(We,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",Hpe,R(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,Wpe)],10,Ppe))),128))])]))],2)):h.value==="json"?(x(),E("div",zpe,[w("div",Upe,[(x(!0),E(We,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",jpe,R(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,Vpe)],10,qpe))),128))])])):h.value==="html"?(x(),E("div",Kpe,[W.value==="preview"?(x(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:fe.value,title:e.file.path},null,8,Gpe)):(x(),E("div",Ype,[w("div",Zpe,[(x(!0),E(We,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",Qpe,R(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,Jpe)],10,Xpe))),128))])]))])):h.value==="pdf"?(x(),E("div",eme,[ee.value?(x(),E("iframe",{key:0,class:"fp-pdf-frame",src:ee.value,title:e.file.path},null,8,tme)):(x(),E("div",nme,[w("span",ome,R(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),E("div",sme,[w("table",ime,[w("tbody",null,[(x(!0),E(We,null,rt(j.value,(Q,P)=>(x(),E("tr",{key:P,class:Ue(M(P+1)),"data-line":P+1},[w("th",null,R(P+1),1),(x(!0),E(We,null,rt(Q,(G,me)=>(x(),E("td",{key:me},R(G),1))),128))],10,rme))),128))])])])):h.value==="image"?(x(),E("div",lme,[ie.value?(x(),E("img",{key:0,src:ie.value,alt:e.file.path,class:Ue(["fp-image",{actual:L.value==="actual"}])},null,10,ame)):(x(),E("div",cme,[w("span",ume,[ae(Ge,{name:"image-off",size:"lg"})]),w("span",dme,R(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="video"?(x(),E("div",fme,[q.value?(x(),E("video",{key:0,src:q.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,hme)):(x(),E("div",pme,[w("span",mme,[ae(Ge,{name:"image-off",size:"lg"})]),w("span",gme,R(C(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="text"?(x(),E("div",vme,[w("div",yme,[(x(!0),E(We,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",bme,R(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,xme)],10,kme))),128))])])):(x(),E("div",wme,[w("div",_me,[w("span",Sme,[ae(Ge,{name:"file-off",size:"lg"})]),w("span",Cme,R(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:$(e.file.size)})),1)])]))],64)):ue("",!0)],512))}}),Mme=dt(Ame,[["__scopeId","data-v-ded222d2"]]),Eme={class:"tp"},Tme=Je({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=oe(null);return et(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||yt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),E("div",Eme,[ae(Ya,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},R(e.text),513)]))}}),W3=dt(Tme,[["__scopeId","data-v-cf9c560b"]]),Nme={class:"ap"},Ime={key:0,class:"ap-type"},Lme={key:1,class:"ap-reason"},$me={key:2,class:"ap-field"},Fme={class:"ap-field-body"},Ome={key:3,class:"ap-field"},Bme={class:"ap-field-body ap-live"},Rme={key:4,class:"ap-field"},Dme={class:"ap-field-body ap-progress"},Pme={key:0,class:"ap-call"},Hme={key:1,class:"ap-output"},Wme=["onClick"],zme={key:5,class:"ap-field"},Ume={class:"ap-field-body"},qme=8,z3=5,U3=2,jme=Je({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const y=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},y.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},y.push(k));return y}const a=D(()=>l(i.value)),c=oe(new Set);function u(m){return c.value.has(m)}function d(m){const y=new Set(c.value);y.has(m)?y.delete(m):y.add(m),c.value=y}function f(m){return m.output.length-z3-U3}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=oe(null);return et(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||yt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,y)=>(x(),E("div",Nme,[ae(Ya,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:y[0]||(y[0]=k=>o("close"))},{default:Ie(()=>[ae(qi,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ie(()=>[ot(R(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),E("div",Ime,R(e.member.subagentType),1)):ue("",!0),e.member.suspendedReason?(x(),E("div",Lme,R(e.member.suspendedReason),1)):ue("",!0),e.member.prompt?(x(),E("div",$me,[y[1]||(y[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",Fme,R(e.member.prompt),1)])):ue("",!0),r.value?(x(),E("div",Ome,[y[2]||(y[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",Bme,R(r.value),1)])):ue("",!0),a.value.length>0?(x(),E("div",Rme,[y[4]||(y[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",Dme,[(x(!0),E(We,null,rt(a.value,k=>(x(),E("div",{key:k.key,class:"ap-group"},[k.call?(x(),E("div",Pme,[y[3]||(y[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),ot(" "+R(k.call),1)])):ue("",!0),k.output.length>0?(x(),E("div",Hme,[k.output.length<=qme||u(k.key)?(x(!0),E(We,{key:0},rt(k.output,(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},R(g),1))),128)):(x(),E(We,{key:1},[(x(!0),E(We,null,rt(k.output.slice(0,z3),(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},R(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+R(f(k))+" more) ",9,Wme),(x(!0),E(We,null,rt(k.output.slice(-U3),(g,v)=>(x(),E("div",{key:"t"+v,class:"ap-out-line"},R(g),1))),128))],64))])):ue("",!0)]))),128))])])):ue("",!0),e.member.summary?(x(),E("div",zme,[y[5]||(y[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",Ume,R(e.member.summary),1)])):ue("",!0)],512)]))}}),Vme=dt(jme,[["__scopeId","data-v-715bd93e"]]),Kme={class:"diff-lines"},Gme={key:0,class:"hunk-text"},Yme={class:"dl-gutter old"},Zme={class:"dl-gutter new"},Xme={class:"dl-sign"},Qme={class:"dl-text"},Jme=Je({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(x(),E("div",Kme,[(x(!0),E(We,null,rt(e.lines,(r,l)=>(x(),E("div",{key:l,class:Ue(["dl",o(r)])},[r.type==="hunk"?(x(),E("span",Gme,R(r.text),1)):(x(),E(We,{key:1},[w("span",Yme,R(t(r)),1),w("span",Zme,R(n(r)),1),w("span",Xme,R(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",Qme,R(r.text),1)],64))],2))),128))]))}}),hT=dt(Jme,[["__scopeId","data-v-2f6bc1cc"]]),e1e={class:"tdp"},t1e={class:"tdp-body"},n1e={key:1,class:"tdp-output"},o1e={key:2,class:"tdp-empty"},s1e=Je({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=$t();return(s,i)=>(x(),E("div",e1e,[ae(Ya,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",t1e,[e.target.lines&&e.target.lines.length>0?(x(),Se(hT,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),E("div",n1e,[(x(!0),E(We,null,rt(e.target.output,(r,l)=>(x(),E("div",{key:l},R(r),1))),128))])):(x(),E("div",o1e,R(C(o)("diff.noDiff")),1))])]))}}),i1e=dt(s1e,[["__scopeId","data-v-76f2fbca"]]),r1e={class:"sc"},l1e={key:0,class:"sc-empty"},a1e={key:2,class:"sc-loading","aria-hidden":"true"},c1e={class:"sc-composer"},u1e=["placeholder"],d1e=["disabled"],f1e=Je({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=D(()=>n.title?.trim()||s("sideChat.title")),l=D(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=oe(""),c=oe(null),u=oe(null);function d(){const k=a.value.trim();k&&(o("send",k),a.value="",yt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const h=D(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,b=g.tools?.reduce((A,I)=>A+I.name.length+(I.arg?.length??0)+(I.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${b}`});et(h,async()=>{!n.running&&!n.sending||(await yt(),f())});const p=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function y(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(x(),E("div",r1e,[ae(Ya,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:g[0]||(g[0]=v=>o("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),E("div",l1e,R(C(s)("sideChat.empty")),1)):(x(),Se(tT,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(x(),E("div",a1e,[ae(JE)])):ue("",!0)],512),w("div",c1e,[qn(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:y,onKeydown:m},null,40,u1e),[[Cs,a.value]]),ae(an,{text:C(s)("sideChat.send")},{default:Ie(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ae(Ge,{name:"arrow-right",size:"sm"})],8,d1e)]),_:1},8,["text"])])]))}}),h1e=dt(f1e,[["__scopeId","data-v-f973798f"]]),p1e={class:"changes-pane"},m1e={class:"dv-path"},g1e={class:"diff-head"},v1e={class:"back-label"},y1e={key:0,class:"empty-state"},k1e={key:1,class:"dv-lines-wrap"},b1e={key:2,class:"empty-state"},x1e={class:"dv-change-count"},w1e={class:"ch-head"},_1e={class:"br-label"},S1e={class:"br-name"},C1e={key:0,class:"sync-info"},A1e={key:0,class:"ahead"},M1e={key:0,class:"behind"},E1e={key:1,class:"empty-head"},T1e={key:0,class:"ch-list"},N1e=["onClick"],I1e={class:"fpath"},L1e={key:1,class:"ch-list ch-tree"},$1e={class:"tree-list"},F1e=["onClick"],O1e={class:"tree-name"},B1e=["onClick"],R1e={class:"tree-name"},D1e={key:2,class:"empty-state"},P1e={key:3,class:"empty-state"},H1e=Je({__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}=$t(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=D(()=>o.gitInfo!==null),u=D(()=>o.changes.length>0),d=D(()=>(o.selectedDiffPath??null)!==null),f=D(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=D(()=>o.fileDiff??[]),p=D(()=>o.fileDiffLoading===!0);function m(F){s("open",F)}function y(){s("back")}function k(){s("close")}const g=oe("list");function v(F){g.value=F}function b(F){const S={children:[]},B=[...F].sort((W,z)=>W.path.localeCompare(z.path));for(const W of B){const z=W.path.split("/");let L=S;for(let O=0;O<z.length;O++){const U=z[O],Z=O===z.length-1,ie=z.slice(0,O+1).join("/");let q=L.children.find(ee=>ee.name===U&&ee.kind===(Z?"file":"folder"));q||(q={name:U,path:ie,kind:Z?"file":"folder",status:Z?W.status:void 0,children:[]},L.children.push(q)),L=q}}return S.children}const A=D(()=>b(o.changes)),I=oe(new Set);function N(F){return!I.value.has(F)}const M=D(()=>{const F=[];function S(B,W){for(const z of B)F.push({node:z,depth:W}),z.kind==="folder"&&N(z.path)&&S(z.children,W+1)}return S(A.value,0),F});function $(F){const S=new Set(I.value);S.has(F.path)?S.delete(F.path):S.add(F.path),I.value=S}function T(F){return`${16+F*16}px`}return(F,S)=>(x(),E("div",p1e,[f.value?(x(),E(We,{key:0},[ae(Ya,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ie(()=>[ae(an,{text:e.selectedDiffPath??""},{default:Ie(()=>[w("span",m1e,R(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",g1e,[e.hideBack?ue("",!0):(x(),Se(jt,{key:0,variant:"ghost",size:"sm",onClick:y},{default:Ie(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",v1e,R(C(n)("diff.back")),1)]),_:1}))]),p.value?(x(),E("div",y1e,R(C(n)("diff.loading")),1)):h.value.length>0?(x(),E("div",k1e,[ae(hT,{lines:h.value},null,8,["lines"])])):(x(),E("div",b1e,R(C(n)("diff.noDiff")),1))],64)):(x(),E(We,{key:1},[ae(Ya,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ie(()=>[w("span",x1e,R(C(n)("diff.changeCount",{count:e.changes.length})),1),ae(ys,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",w1e,[c.value?(x(),E(We,{key:0},[w("span",_1e,R(C(n)("diff.branch")),1),w("span",S1e,R(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),E("span",C1e,[ae(an,{text:C(n)("diff.aheadTitle")},{default:Ie(()=>[e.gitInfo.ahead>0?(x(),E("span",A1e,"↑"+R(e.gitInfo.ahead),1)):ue("",!0)]),_:1},8,["text"]),ae(an,{text:C(n)("diff.behindTitle")},{default:Ie(()=>[e.gitInfo.behind>0?(x(),E("span",M1e,"↓"+R(e.gitInfo.behind),1)):ue("",!0)]),_:1},8,["text"])])):ue("",!0)],64)):(x(),E("span",E1e,R(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(x(),E("div",T1e,[(x(!0),E(We,null,rt(e.changes,B=>(x(),Se(an,{key:B.path,text:B.path},{default:Ie(()=>[w("button",{type:"button",class:"ch-row",onClick:W=>m(B.path)},[w("span",{class:Ue(["badge",i(B.status)])},R(l(B.status)),3),w("span",I1e,R(a(B.path)),1)],8,N1e)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(x(),E("div",L1e,[w("ul",$1e,[(x(!0),E(We,null,rt(M.value,({node:B,depth:W})=>(x(),E("li",{key:B.path,class:"tree-node"},[B.kind==="folder"?(x(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:on({paddingLeft:T(W)}),onClick:z=>$(B)},[ae(Ge,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",O1e,R(B.name),1)],12,F1e)):(x(),Se(an,{key:1,text:B.path},{default:Ie(()=>[w("button",{type:"button",class:"tree-row tree-file",style:on({paddingLeft:T(W)}),onClick:z=>m(B.path)},[w("span",{class:Ue(["badge",i(B.status)])},R(l(B.status)),3),w("span",R1e,R(B.name),1)],12,B1e)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),E("div",D1e,R(C(n)("diff.clean")),1)):(x(),E("div",P1e,R(C(n)("diff.empty")),1))],64))]))}}),W1e=dt(H1e,[["__scopeId","data-v-7778610a"]]);function mb(e,t){let n=null;An(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,yt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),ho(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const z1e=["type","value","placeholder","disabled","readonly"],U1e=Je({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=oe();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(x(),E("input",{ref_key:"el",ref:s,class:Ue(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,z1e))}}),mu=dt(U1e,[["__scopeId","data-v-340f0da2"]]),q1e={class:"search-wrap"},j1e={key:0,class:"tab-strip"},V1e={key:1,class:"state-row"},K1e={key:2,class:"state-row unavail"},G1e={key:3,class:"model-list"},Y1e=["aria-selected","onClick","onMouseenter"],Z1e={class:"check"},X1e={class:"model-main"},Q1e={class:"model-name"},J1e={class:"model-id"},e0e={key:0,class:"caps"},t0e={class:"model-provider"},n0e={class:"model-ctx"},o0e={key:0,class:"empty"},s0e={class:"footer-hint"},i0e=Je({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D(()=>new Set(o.starredIds??[]));function r(v){return i.value.has(v)}const l=oe(""),a=oe(null),c=oe(null),u=oe("all");mb(c,a);const d=D(()=>{const v=new Set,b=[{id:"all",label:n("model.allTab")}];for(const A of o.models)v.has(A.provider)||(v.add(A.provider),b.push({id:A.provider,label:A.provider}));return b}),f=D(()=>{const v=l.value.toLowerCase().trim(),b=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const I=(A.displayName??A.model).toLowerCase().includes(v),N=A.provider.toLowerCase().includes(v),M=A.id.toLowerCase().includes(v);return!v||I||N||M});return u.value!=="all"?b:b.sort((A,I)=>{const N=r(A.id)?1:0;return(r(I.id)?1:0)-N})}),h=D(()=>f.value),p=oe(0);et([l,u],()=>{p.value=0}),et(d,v=>{v.some(b=>b.id===u.value)||(u.value="all")}),et(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){s("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const b=h.value[p.value];b&&s("select",b.id)}}An(()=>{document.addEventListener("keydown",m)}),On(()=>{document.removeEventListener("keydown",m)});function y(v){s("select",v)}function k(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,b)=>(x(),Se(Qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:b[1]||(b[1]=A=>s("close"))},{default:Ie(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",q1e,[ae(mu,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),E("div",j1e,[(x(!0),E(We,null,rt(d.value,A=>(x(),Se(jt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:I=>g(A.id)},{default:Ie(()=>[ot(R(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ue("",!0),e.loading?(x(),E("div",V1e,[ae(Us,{size:"sm"}),w("span",null,R(C(n)("model.loading")),1)])):e.unavailable?(x(),E("div",K1e,[ae(Ge,{name:"alert-triangle",size:"lg"}),w("span",null,R(C(n)("model.unavailable")),1)])):(x(),E("div",G1e,[(x(!0),E(We,null,rt(h.value,A=>(x(),E("div",{key:A.id,class:Ue(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:I=>y(A.id),onMouseenter:I=>p.value=k(A)},[w("span",Z1e,[A.id===e.current?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",X1e,[w("span",Q1e,R(A.displayName??A.model),1),w("span",J1e,R(A.id),1),A.capabilities&&A.capabilities.length>0?(x(),E("span",e0e,[(x(!0),E(We,null,rt(A.capabilities,I=>(x(),Se(qi,{key:I,variant:"info",size:"sm"},{default:Ie(()=>[ot(R(I),1)]),_:2},1024))),128))])):ue("",!0)]),w("span",t0e,R(A.provider),1),w("span",n0e,R(C(n)("model.contextSuffix",{size:C(pr)(A.maxContextSize)})),1),ae(Xn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:St(I=>s("toggle-star",A.id),["stop"])},{default:Ie(()=>[r(A.id)?(x(),Se(Ge,{key:0,name:"star",size:"md"})):(x(),Se(Ge,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Y1e))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),E("div",o0e,R(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ue("",!0)])),w("div",s0e,R(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),r0e=dt(i0e,[["__scopeId","data-v-56cefe51"]]),l0e={key:0,class:"ui-field__label"},a0e={key:1,class:"ui-field__error"},c0e={key:2,class:"ui-field__hint"},u0e=Je({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),E("label",l0e,R(e.label),1)):ue("",!0),jn(t.$slots,"default",{},void 0,!0),e.error?(x(),E("span",a0e,R(e.error),1)):e.hint?(x(),E("span",c0e,R(e.hint),1)):ue("",!0)],2))}}),yp=dt(u0e,[["__scopeId","data-v-49bce958"]]),d0e=["value","disabled"],f0e=Je({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(x(),E("select",{class:Ue(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[jn(s.$slots,"default",{},void 0,!0)],42,d0e))}}),pk=dt(f0e,[["__scopeId","data-v-92a040fd"]]),h0e={class:"prov-list"},p0e={key:0,class:"state-row"},m0e={key:1,class:"state-row unavail"},g0e={key:2,class:"empty"},v0e={class:"prov-info"},y0e={class:"prov-type"},k0e={key:0,class:"prov-url"},b0e={class:"prov-meta"},x0e={key:0},w0e={class:"prov-actions"},_0e={key:0,class:"add-section"},S0e={key:0,class:"add-btns"},C0e={key:1,class:"add-form"},A0e=["value"],M0e={key:0,class:"add-error"},E0e={class:"form-btns"},T0e={class:"footer-hint"},N0e=Je({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=$t(),o=oe(null);mb(o);const s=t;function i(y){s("delete",y)}const r=oe(!1),l=zo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=oe(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(y){if(y.key==="Escape"){if(r.value){d();return}s("close")}}An(()=>document.addEventListener("keydown",h)),On(()=>document.removeEventListener("keydown",h));function p(y){return y==="connected"?"var(--color-success)":y==="error"?"var(--color-danger)":"var(--color-text-faint)"}function m(y){return n(y==="connected"?"providers.status.connected":y==="error"?"providers.status.error":"providers.status.unconfigured")}return(y,k)=>(x(),Se(Qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:k[6]||(k[6]=g=>s("close"))},{default:Ie(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",h0e,[e.loading?(x(),E("div",p0e,[ae(Us,{size:"sm"}),w("span",null,R(C(n)("providers.loading")),1)])):e.unavailable?(x(),E("div",m0e,[ae(Ge,{name:"alert-triangle",size:"md"}),w("span",null,R(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),E("div",g0e,R(C(n)("providers.empty")),1)):(x(!0),E(We,{key:3},rt(e.providers,g=>(x(),E("div",{key:g.id,class:"prov-row"},[ae(an,{text:m(g.status)},{default:Ie(()=>[w("span",{class:Ue(["status-dot",{"status-dot--empty":g.status!=="connected"&&g.status!=="error"}]),style:on(g.status==="connected"||g.status==="error"?{background:p(g.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",v0e,[w("span",y0e,R(g.type),1),g.baseUrl?(x(),E("span",k0e,R(g.baseUrl),1)):ue("",!0),w("span",b0e,[ae(qi,{variant:g.hasApiKey?"success":"neutral",size:"sm"},{default:Ie(()=>[ot(R(g.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),g.models&&g.models.length>0?(x(),E("span",x0e," · "+R(C(n)("providers.modelCount",{count:g.models.length})),1)):ue("",!0)])]),w("div",w0e,[ae(an,{text:C(n)("providers.refreshTitle",{type:g.type})},{default:Ie(()=>[ae(jt,{variant:"secondary",size:"sm",onClick:v=>s("refresh",g.id)},{default:Ie(()=>[ot(R(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ae(an,{text:C(n)("providers.deleteTitle",{type:g.type})},{default:Ie(()=>[ae(jt,{variant:"danger-soft",size:"sm",onClick:v=>i(g.id)},{default:Ie(()=>[ot(R(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ue("",!0):(x(),E("div",_0e,[r.value?(x(),E("div",C0e,[ae(yp,{label:C(n)("providers.fieldType")},{default:Ie(()=>[ae(pk,{modelValue:l.type,"onUpdate:modelValue":k[2]||(k[2]=g=>l.type=g)},{default:Ie(()=>[(x(),E(We,null,rt(c,g=>w("option",{key:g,value:g},R(g),9,A0e)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ae(yp,{label:C(n)("providers.fieldApiKey")},{default:Ie(()=>[ae(mu,{modelValue:l.apiKey,"onUpdate:modelValue":k[3]||(k[3]=g=>l.apiKey=g),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ae(yp,{label:C(n)("providers.fieldBaseUrl")},{default:Ie(()=>[ae(mu,{modelValue:l.baseUrl,"onUpdate:modelValue":k[4]||(k[4]=g=>l.baseUrl=g),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ae(yp,{label:C(n)("providers.fieldDefaultModel")},{default:Ie(()=>[ae(mu,{modelValue:l.defaultModel,"onUpdate:modelValue":k[5]||(k[5]=g=>l.defaultModel=g),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(x(),E("div",M0e,R(a.value),1)):ue("",!0),w("div",E0e,[ae(jt,{variant:"primary",size:"sm",onClick:f},{default:Ie(()=>[ot(R(C(n)("providers.add")),1)]),_:1}),ae(jt,{variant:"secondary",size:"sm",onClick:d},{default:Ie(()=>[ot(R(C(n)("common.cancel")),1)]),_:1})])])):(x(),E("div",S0e,[ae(jt,{variant:"secondary",size:"sm",onClick:k[0]||(k[0]=g=>s("openLogin","moonshot"))},{default:Ie(()=>[ae(Ge,{name:"user",size:"sm"}),ot(" "+R(C(n)("providers.loginKimi")),1)]),_:1}),ae(jt,{variant:"secondary",size:"sm",onClick:k[1]||(k[1]=g=>s("openLogin","anthropic"))},{default:Ie(()=>[ae(Ge,{name:"user",size:"sm"}),ot(" "+R(C(n)("providers.loginAnthropic")),1)]),_:1}),ae(jt,{variant:"primary",size:"sm",onClick:u},{default:Ie(()=>[ae(Ge,{name:"plus",size:"sm"}),ot(" "+R(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",T0e,R(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),I0e=dt(N0e,[["__scopeId","data-v-cf73278e"]]),L0e={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},$0e={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},F0e={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Bv=Je({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),E("svg",L0e,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),E("svg",$0e,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),E("svg",F0e,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),O0e={key:0,class:"center-body"},B0e={class:"center-text"},R0e={key:1,class:"nb"},D0e={class:"nb-lead"},P0e=["href"],H0e={class:"nb-or"},W0e={class:"nb-fallback"},z0e={class:"nb-fb-text"},U0e=["href"],q0e={class:"nb-code-row"},j0e={class:"nb-code"},V0e={class:"nb-status"},K0e={class:"nb-status-text"},G0e={class:"nb-countdown"},Y0e={key:2,class:"center-body"},Z0e={class:"center-text success-text"},X0e={class:"center-hint"},Q0e={class:"center-body"},J0e={class:"center-text err-text"},ege={class:"center-hint"},tge={class:"actions"},nge={class:"center-body"},oge={class:"center-text warn-text"},sge={class:"center-hint"},ige={class:"actions"},rge=3,lge=Je({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=$t(),o=oe(!0),s=t,i=e,r=oe("starting"),l=oe(!1),a=oe(null),c=oe(0),u=oe(!1);let d=null,f=null,h=0;An(async()=>{await p()}),On(()=>{k()});async function p(){k(),a.value=null,l.value=!1,h=0,r.value="starting";const I=await i.onStartOAuthLogin();if(!I){r.value="error";return}if(I.status==="authenticated"){k(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:I.flowId,verificationUri:I.verificationUri,verificationUriComplete:I.verificationUriComplete,userCode:I.userCode,expiresIn:I.expiresIn,interval:I.interval},c.value=I.expiresIn,r.value="device-code",m(),y(I.interval)}function m(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function y(I){d&&clearTimeout(d),d=setTimeout(async()=>{const N=await i.onPollOAuthLogin();if(N===null){if(h+=1,h>=rge){k(),l.value=!0,r.value="error";return}y(I);return}h=0,N.status==="authenticated"?(k(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):N.status==="expired"||N.status==="cancelled"?(k(),r.value="expired"):y(I)},I*1e3)}function k(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function g(){await p()}async function v(){!a.value||!await Jo(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function b(){k(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A(I){const N=Math.floor(I/60),M=I%60;return`${N}:${String(M).padStart(2,"0")}`}return(I,N)=>(x(),Se(Qr,{open:o.value,"onUpdate:open":N[0]||(N[0]=M=>o.value=M),title:C(n)("login.title"),"close-on-overlay":!1,onClose:b},{default:Ie(()=>[r.value==="starting"?(x(),E("div",O0e,[ae(Us,{size:"md"}),w("span",B0e,R(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),E("div",R0e,[w("div",D0e,R(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[ot(R(C(n)("login.authorizeInBrowser"))+" ",1),ae(Ge,{name:"external-link",size:"sm"})],8,P0e),w("div",H0e,R(C(n)("login.orDivider")),1),w("div",W0e,[w("div",z0e,[ot(R(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},R(a.value.verificationUri),9,U0e),ot(R(C(n)("login.fallbackSuffix")),1)]),w("div",q0e,[w("span",j0e,R(a.value.userCode),1),ae(jt,{class:Ue(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:v},{default:Ie(()=>[u.value?(x(),E(We,{key:0},[ae(Ge,{name:"check",size:"sm"}),ot(" "+R(C(n)("login.copied")),1)],64)):(x(),E(We,{key:1},[ae(Ge,{name:"copy",size:"sm"}),ot(" "+R(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",V0e,[ae(Us,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",K0e,R(C(n)("login.waitingAutoClose")),1),w("span",G0e,R(A(c.value)),1)])])):r.value==="success"?(x(),E("div",Y0e,[ae(Bv,{kind:"success"}),w("span",Z0e,R(C(n)("login.success")),1),w("span",X0e,R(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),E(We,{key:3},[w("div",Q0e,[ae(Bv,{kind:"expired"}),w("span",J0e,R(C(n)("login.expiredTitle")),1),w("span",ege,R(C(n)("login.expiredHint")),1)]),w("div",tge,[ae(jt,{variant:"primary",onClick:g},{default:Ie(()=>[ot(R(C(n)("login.retry")),1)]),_:1}),ae(jt,{variant:"secondary",onClick:b},{default:Ie(()=>[ot(R(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),E(We,{key:4},[w("div",nge,[ae(Bv,{kind:"error"}),w("span",oge,R(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),w("span",sge,R(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),w("div",ige,[ae(jt,{variant:"primary",onClick:g},{default:Ie(()=>[ot(R(C(n)("login.retry")),1)]),_:1}),ae(jt,{variant:"secondary",onClick:b},{default:Ie(()=>[ot(R(C(n)("login.closeBtn")),1)]),_:1})])],64)):ue("",!0)]),_:1},8,["open","title"]))}}),age=dt(lge,[["__scopeId","data-v-8308a28f"]]);function cge(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const uge=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function zi(e){const t=e.replaceAll("\\","/"),n=uge.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function dge(e,t){const n=zi(t.cwd);return e.find(o=>zi(o.root)===n)?.id??t.workspaceId??t.cwd}function fge(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(zi)),r=new Map;for(const d of t){const f=zi(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const h=zi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:cge(f),sessionCount:0})}const l=new Map;for(const d of n){const f=dge(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=zi(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),h=l.get(f.id)??l.get(f.root)??0,p=s[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function hge(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function q3(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function pge(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function mge(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const gge=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function vge(e){return gge.has(e.type)}const yge=50,kge=100,mk=32*1024,bge={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,yge)},cancelTask(e){clearTimeout(e)}};function xge(e,t,n={}){const o=n.scheduler??bge,s=Math.max(1,Math.floor(n.maxItemsPerSlice??kge)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const k=++c,g=()=>{k===c&&p()};l=o.requestFrame(g),a=o.requestTask(g)};p=()=>{f();let k=0;for(;!u&&k<s&&r<i.length;){const g=i[r++];e(g),k+=1}h(),m()};const y=(k=>{if(!u){if(t(k)){const g=i.length>r?i.at(-1):void 0,v=g===void 0?void 0:n.coalesce?.(g,k);v===void 0?i.push(k):i[i.length-1]=v,m();return}if(d()===0){e(k);return}i.push(k),p()}});return y.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},y.discard=k=>{if(u||d()===0)return;let g=r;for(let v=r;v<i.length;v+=1){const b=i[v];k(b)||(i[g++]=b)}i.length=g,h(),d()===0?f():m()},y.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},y}function gk(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function wge(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=gk(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=mk)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+mk,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function _ge(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=gk(e.appEvent),i=gk(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>mk)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const pT=["blue","mono"],mT=["light","dark","system"],gT=14,Sge=12,Cge=20;function Age(){const e=yo(Dt.accent);return e&&pT.includes(e)?e:"blue"}function Mge(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Ege(){const e=yo(Dt.colorScheme);return e&&mT.includes(e)?e:"system"}function Tge(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(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function gb(e){return Number.isFinite(e)?Math.min(Cge,Math.max(Sge,Math.round(e))):gT}function Nge(){const e=yo(Dt.uiFontSize);return e===null?gT:gb(Number(e))}function Ige(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${gb(e)}px`)}const vb=oe(Ege()),yb=oe(Age()),kb=oe(Nge());et(vb,Tge,{immediate:!0});et(yb,Mge,{immediate:!0});et(kb,Ige,{immediate:!0});function Lge(e){mT.includes(e)&&(vb.value=e,Eo(Dt.colorScheme,e))}function $ge(e){pT.includes(e)&&(yb.value=e,Eo(Dt.accent,e))}function Fge(e){const t=gb(e);kb.value=t,Eo(Dt.uiFontSize,String(t))}const Oge=600,Bge=250,i0=250,Rge=1e3,Dge=160,Jm=oe(!1);let Ma=[],$a=null,e1=-i0;function Pge(){Ma=[],e1=-i0,Jm.value=!1,$a!==null&&(clearTimeout($a),$a=null)}function Hge(){Jm.value=!0,$a!==null&&clearTimeout($a),$a=setTimeout(()=>{$a=null,Ma=[],e1=-i0,Jm.value=!1},Rge)}function Wge(e){if(e<=0)return;const t=Date.now();Ma.push({time:t,chars:e});const n=t-Oge;if(Ma=Ma.filter(l=>l.time>=n),t-e1<i0)return;e1=t;const o=Ma[0]?.time??t,s=Math.max(t-o,Bge);Ma.reduce((l,a)=>l+a.chars,0)/s*1e3>=Dge&&Hge()}function vT(){return{colorScheme:vb,accent:yb,uiFontSize:kb,fastMoon:Jm,setColorScheme:Lge,setAccent:$ge,setUiFontSize:Fge,resetFastMoon:Pge,recordMoonDelta:Wge}}function zge(e,t,n){return e==="idle"&&!t&&!n}function bb(e,t){const n=yo(e);return n===null?t:n==="1"}const xb=oe(bb(Dt.notifyOnComplete,!0)),wb=oe(bb(Dt.notifyOnQuestion,!1)),_b=oe(bb(Dt.notifyOnApproval,!1)),Sb=oe(typeof Notification<"u"?Notification.permission:"denied"),Uge="/favicon.ico";async function Cb(e,t,n){if(!n){e.value=!1,Eo(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}Sb.value=o,o==="granted"&&(e.value=!0,Eo(t,"1"))}function qge(e){return Cb(xb,Dt.notifyOnComplete,e)}function jge(e){return Cb(wb,Dt.notifyOnQuestion,e)}function Vge(e){return Cb(_b,Dt.notifyOnApproval,e)}function Ab(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Kge(e){return{title:Rn.global.t("settings.notifyTitle"),body:Ab(e,Rn.global.t("settings.notifyFallback"))}}function Gge(e,t){return{title:Rn.global.t("settings.notifyQuestionTitle"),body:Ab(t,e,Rn.global.t("settings.notifyQuestionFallback"))}}function Yge(e,t){return{title:Rn.global.t("settings.notifyApprovalTitle"),body:Ab(t,e,Rn.global.t("settings.notifyApprovalFallback"))}}function Mb(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{Sb.value=i,i==="granted"&&j3(t,n,o)});return}j3(t,n,o)}}function j3(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Uge});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Zge(e,t){Mb(xb.value,t,Kge(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function Xge(e){Mb(wb.value,e,Gge(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Qge(e){Mb(_b.value,e,Yge(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function Jge(){return{notifyOnComplete:xb,notifyOnQuestion:wb,notifyOnApproval:_b,notifyPermission:Sb,setNotifyOnComplete:qge,setNotifyOnQuestion:jge,setNotifyOnApproval:Vge,maybeNotifyCompletion:Zge,maybeNotifyQuestion:Xge,maybeNotifyApproval:Qge}}function eve(){return yo(Dt.soundOnComplete)==="1"}const Nu=oe(eve());function tve(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let Rv=null;function yT(){const e=tve();if(!e)return null;if(Rv===null)try{Rv=new e}catch{return null}return Rv}function kT(){if(!Nu.value)return;const e=yT();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Rr("sound: audio context resumed",{state:e.state})},t=>{Rr("sound: audio context resume rejected",{error:String(t)})})}let V3=!1;function nve(){if(V3||typeof window>"u")return;V3=!0;const e=()=>{kT()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}nve();function ove(e){Nu.value=e,Eo(Dt.soundOnComplete,e?"1":"0"),e&&kT()}function K3(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function Eb(){const e=yT();if(e===null){Rr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Rr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Rr("sound: context resumed for next time",{state:e.state})},t=>{Rr("sound: resume rejected",{error:String(t)})});return}try{K3(e,880,0,.16,.18),K3(e,1320,.1,.22,.16),Rr("sound: chime scheduled",{state:e.state})}catch(t){Rr("sound: failed to play",{error:String(t)})}}function sve(){Nu.value&&Eb()}function ive(){Nu.value&&Eb()}function rve(){Nu.value&&Eb()}function lve(){return{soundOnComplete:Nu,setSoundOnComplete:ove,maybePlayCompletionSound:sve,maybePlayQuestionSound:ive,maybePlayApprovalSound:rve}}const ave=1e3,cve=4096,G3=32*1024;function uve(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await ht().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:q3(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=ht(),y=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!s.has(g.id)&&!((g.outputLines?.length??0)>0))try{const b=await m.getTask(f,g.id,{withOutput:!0,outputBytes:G3});b.outputPreview!==void 0&&y.set(g.id,{preview:b.outputPreview,bytes:b.outputBytes}),s.add(g.id)}catch{}})),y.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=y.get(g.id)??(g.backgroundTaskId!==void 0?y.get(g.backgroundTaskId):void 0);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=ht();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const b=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!b&&!A)&&!(A&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const I=await h.getTask(f,v.id,{withOutput:!0,outputBytes:b?cve:G3});I.outputPreview!==void 0&&m.set(v.id,{preview:I.outputPreview,bytes:I.outputBytes}),A&&s.add(v.id)}catch{}}));const y=e.tasksBySession[f]??[],k=new Map(y.map(v=>[v.id,v])),g=p.map(v=>{const b=k.get(v.id),A=m.get(v.id);return{...v,outputLines:b?.outputLines,text:b?.text,outputPreview:A?.preview??b?.outputPreview,outputBytes:A?.bytes??b?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:q3(g,y)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},ave))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=oe(0);let d=null;return et(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),et(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let y;h&&f!==void 0?a(f):f!==void 0?y=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{y!==void 0&&clearTimeout(y)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function dve(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 fve(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
319
- `)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&dve(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const vk="/sessions/";function Y3(e){const{pathname:t}=e;if(!t.startsWith(vk))return;const n=t.slice(vk.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function hve(e){return e===void 0||e.length===0?"/":`${vk}${encodeURIComponent(e)}`}const pve=50,yk=5,mve=40402,gve=40410,vve=40902,yve=2e3;function Dv(e){return wi(e)&&e.code===vve}const kve=40904;function bve(e){return wi(e)&&e.code===kve}const ya=zo({}),kp=zo({}),Pv=zo({}),or=zo(new Set),r0=new Map,Za=new Map,t1=new Map;let xve=0;const xa=new Map,wve=3;let Z3=0;function _ve(){return Z3+=1,`${Date.now().toString(36)}-${Z3}`}function Sve(e){return{generation:r0.get(e)??0,pending:(Za.get(e)?.size??0)>0}}function kk(e){const t=++xve;r0.set(e,t);const n=Za.get(e)??new Set;return n.add(t),Za.set(e,n),t}function bk(e,t){const n=Za.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Za.delete(e);const o=t1.get(e);t1.delete(e),o?.()}function Cve(e){r0.delete(e),Za.delete(e),t1.delete(e),xa.delete(e)}function Ave(e,t){return!t.pending&&t.generation===(r0.get(e)??0)}function Mve(e,t){if((Za.get(e)?.size??0)===0){t();return}t1.set(e,t)}function Eve(e,t){const{t:n}=Rn.global,{confirm:o}=Gf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:m,updateSessionMessages:y,nextOptimisticMsgId:k,getEventConn:g,syncSessionFromSnapshot:v,reopenSession:b,hasLoadedMessages:A,refreshSessionStatus:I,refreshSessionGoal:N,persistSessionProfile:M,mergedWorkspaces:$,workspacesView:T,status:F,workspaceIdForSession:S,savePermissionToStorage:B,savePlanModeToStorage:W,saveSwarmModeToStorage:z,saveGoalModeToStorage:L,draftModes:O,saveUnread:U,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:ie,goalErrorMessage:q,resetFastMoon:ee,initialized:fe,connectIssue:ne,selectedDiffPath:j,fileDiffLines:K,fileDiffLoading:ve}=t;let he=!1;async function Ae(te){if(e.messagesLoadingMoreBySession[te])return;const Ce=e.messagesBySession[te];if(!Ce||Ce.length===0)return;const Me=Ce[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!1};try{const De=await ht().listMessages(te,{beforeId:Me,pageSize:pve}),Qe=[...De.items].reverse();y(te,at=>[...Qe,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[te]:De.hasMore}}catch(De){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!0},l("loadOlderMessages",De,{sessionId:te})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!1}}}function re(te){s.loadTasksForSession(te),P(te),I(te),N(te),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,te)||r.loadSkillsForSession(te)}async function Y(te){const Ce=e.activeSessionId;if(Ce){j.value=te,K.value=[],ve.value=!0;try{const De=await ht().getFileDiff(Ce,te);if(j.value!==te)return;K.value=fve(De.diff)}catch(Me){j.value===te&&(K.value=[]),console.warn("[loadFileDiff] diff unavailable for",te,Me)}finally{j.value===te&&(ve.value=!1)}}}function Q(){j.value=null,K.value=[],ve.value=!1}async function P(te){try{const Me=await ht().getGitStatus(te);e.gitStatusBySession={...e.gitStatusBySession,[te]:Me}}catch{}}async function G(){try{const Ce=await ht().getAuth();return e.authReady=Ce.ready,e.defaultModel=Ce.defaultModel,e.managedProviderStatus=Ce.managedProvider?.status??null,ne.value=null,"proceed"}catch(te){return wi(te)&&(te.code===401||te.code===ZE)?(ne.value=null,"server-auth-required"):(ne.value=(te instanceof Error?te.message:String(te)).slice(0,140),"retry")}}async function me(){let te=!0;for(;;){const Ce=await G();if(Ce!=="retry")return Ce;te&&(ne.value=null,te=!1),await new Promise(Me=>{setTimeout(Me,yve)})}}async function ye(){try{const te=ht();e.config=await te.getConfig()}catch{}}async function de(te){try{const Me=await ht().setConfig(te);return e.config=Me,e.defaultModel=Me.defaultModel??null,!0}catch(Ce){return l("setConfig",Ce),!1}}const V=100,se=30,pe=720*60*1e3;async function ke(){const te=ht(),Ce=[];let Me,De;for(;;){let Qe;try{Qe=await te.listSessions({pageSize:V,beforeId:Me,excludeEmpty:!0})}catch(at){if(Ce.length===0)throw at;De=at;break}if(Ce.push(...Qe.items),!Qe.hasMore||Qe.items.length===0)break;Me=Qe.items[Qe.items.length-1].id}return{sessions:Ce,error:De}}function Ne(te){const Ce=new Map(e.sessions.map(Me=>[Me.id,Me.usage]));u(te.map(Me=>{const De=Ce.get(Me.id);return De!==void 0&&ik(Me.usage)&&!ik(De)?{...Me,usage:De}:Me}))}function qe(te){const Ce=[...te],Me=new Set(Ce.map(De=>De.id));for(const De of e.sessions)Me.has(De.id)||(Ce.push(De),Me.add(De.id));return Ce.sort((De,Qe)=>new Date(Qe.updatedAt).getTime()-new Date(De.updatedAt).getTime()),Ce}async function be(te){const Ce=ht(),Me=[],De=Date.now(),Qe=Vt=>De-new Date(Vt.updatedAt).getTime();let at,It=!1,Qt=!0,cn;for(;;){let Vt;try{Vt=await Ce.listSessions({workspaceId:te,pageSize:yk,beforeId:at,excludeEmpty:!0})}catch(Nt){if(Qt)throw Nt;cn=Nt,It=!0;break}if(It=Vt.hasMore,Vt.items.length===0)break;const zn=Vt.items[Vt.items.length-1],co=Qe(zn)>=pe;if(!Qt&&co){const Nt=Vt.items.findIndex(Zt=>Qe(Zt)>=pe),_t=Nt>=0?Nt+1:Vt.items.length;Me.push(...Vt.items.slice(0,_t)),It=Vt.hasMore||_t<Vt.items.length;break}if(Me.push(...Vt.items),Qt=!1,!Vt.hasMore||co)break;at=zn.id}return{workspaceId:te,page:{items:Me,hasMore:It},error:cn}}async function xe(){const te=e.workspaces;if(te.length===0){const Nt=await ke(),_t=Nt.error===void 0?Nt.sessions:qe(Nt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Nt.error===void 0,Nt.error!==void 0&&l("load",Nt.error),_t}const Ce=await Promise.allSettled(te.map(Nt=>be(Nt.id))),Me=[],De=new Set,Qe=new Map,at=new Set;let It;for(let Nt=0;Nt<Ce.length;Nt++){const _t=Ce[Nt];if(_t.status==="fulfilled"){Qe.set(_t.value.workspaceId,_t.value.page),_t.value.error!==void 0&&(at.size===0&&(It=_t.value.error),at.add(_t.value.workspaceId));for(const Zt of _t.value.page.items)De.has(Zt.id)||(Me.push(Zt),De.add(Zt.id));continue}at.size===0&&(It=_t.reason),at.add(te[Nt].id)}if(Qe.size===0){l("load",It);return}const Qt=new Set(te.filter(Nt=>at.has(Nt.id)).map(Nt=>Nt.root)),cn=new Set(te.map(Nt=>Nt.id));for(const Nt of e.sessions)!(Nt.workspaceId!==void 0&&cn.has(Nt.workspaceId)?at.has(Nt.workspaceId):Qt.has(Nt.cwd)||at.has(S(Nt)))||De.has(Nt.id)||(Me.push(Nt),De.add(Nt.id));const Vt={},zn={},co={};for(const{id:Nt}of te){const _t=Qe.get(Nt);if(_t===void 0){const Zt=e.sessionsHasMoreByWorkspace[Nt],eo=e.sessionsCursorByWorkspace[Nt],ro=e.sessionsInitialCountByWorkspace[Nt];Zt!==void 0&&(Vt[Nt]=Zt),eo!==void 0&&(zn[Nt]=eo),ro!==void 0&&(co[Nt]=ro);continue}Vt[Nt]=_t.hasMore,zn[Nt]=_t.items.length>0?_t.items[_t.items.length-1].id:void 0,co[Nt]=Math.max(_t.items.length,yk)}return e.sessionsHasMoreByWorkspace=Vt,e.sessionsCursorByWorkspace=zn,e.sessionsInitialCountByWorkspace=co,e.sessionsFullyLoaded=!1,Me.sort((Nt,_t)=>new Date(_t.updatedAt).getTime()-new Date(Nt.updatedAt).getTime()),at.size>0&&l("load",It),Me}async function Ze(te){if(e.sessionsLoadingMoreByWorkspace[te]||e.sessionsHasMoreByWorkspace[te]===!1)return;const Ce=e.sessionsCursorByWorkspace[te];if(Ce!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!0};try{const Me=await ht().listSessions({workspaceId:te,pageSize:se,beforeId:Ce,excludeEmpty:!0}),De=new Set(e.sessions.map(at=>at.id)),Qe=Me.items.filter(at=>!De.has(at.id));Qe.length>0&&u([...e.sessions,...Qe]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[te]:Me.items.length>0?Me.items[Me.items.length-1].id:Ce},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[te]:Me.hasMore}}catch(Me){l("loadMoreSessions",Me)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!1}}}}async function tt(){if(e.sessionsFullyLoaded)return;const te=await ke().catch(De=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",De),null));if(te===null)return;const Ce=te.error===void 0?te.sessions:qe(te.sessions);if(Ne(Ce),e.sessionsFullyLoaded=te.error===void 0,te.error!==void 0)return;const Me={};for(const De of e.workspaces)Me[De.id]=!1;e.sessionsHasMoreByWorkspace=Me}async function lt(){const te=await ht().getMeta().catch(()=>null);te!==null&&(e.serverVersion=te.serverVersion,e.availableOpenInApps=te.openInApps,e.dangerousBypassAuth=te.dangerousBypassAuth,e.backend=te.backend)}async function ut(){const te=Date.now();let Ce="accepted";_o("app:load:start"),e.loading=!0;const Me=!fe.value;let De=!0;try{if(Me&&await me()==="server-auth-required"){De=!1,Ce="auth-required";return}const Qe=ht();await Promise.all([Qe.getHealth().catch(()=>null),lt(),r.loadModels()]),Me||await G(),await ye(),await mt();const at=await xe(),It=at??e.sessions;at!==void 0&&Ne(at);const Qt=It[0],cn=e.activeWorkspaceId;!(cn!==null&&$.value.some(co=>co.id===cn))&&Qt&&wt(S(Qt)),Bn();const zn=typeof window<"u"?Y3(window.location):void 0;!e.activeSessionId&&zn!==void 0&&(e.sessions.some(Nt=>Nt.id===zn)||await to(zn))&&await Qn(zn,{urlMode:"replace"}),!e.activeSessionId&&It.length>0&&await Qn(It[0].id,{urlMode:"replace"})}catch(Qe){Ce="failed",l("load",Qe)}finally{e.loading=!1,De&&(fe.value=!0),_o("app:load:complete",{status:Ce,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-te})}}async function mt(){try{const te=ht(),[Ce,Me]=await Promise.all([te.listWorkspaces().catch(()=>[]),te.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Tt(Ce),e.fsHome=Me.home||null,e.recentRoots=Me.recentRoots}catch{}}function Tt(te){const Ce=zh();return Object.keys(Ce).length===0?te:te.map(Me=>{const De=Ce[Me.root];return De!==void 0?{...Me,name:De}:Me})}function wt(te){e.activeWorkspaceId=te,Z(te)}function Ft(te){wt(te);const Ce=e.sessions.filter(Me=>S(Me)===te);if(Ce.length>0){const Me=Ce[0];Me&&Me.id!==e.activeSessionId&&Qn(Me.id)}else m(void 0),gn(void 0,"push")}function en(te){const Ce=zh()[te.root],Me=Ce!==void 0?{...te,name:Ce}:te,De=zi(Me.root);e.hiddenWorkspaceRoots.some(It=>zi(It)===De)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(It=>zi(It)!==De),ie(e.hiddenWorkspaceRoots));const Qe=e.workspaces.findIndex(It=>It.id===Me.id||It.root===Me.root);if(Qe===-1){e.workspaces=[Me,...e.workspaces];return}const at=[...e.workspaces];at[Qe]=Me,e.workspaces=at}function Hn(te){if(te.type==="workspaceCreated"||te.type==="workspaceUpdated"){en(te.workspace);return}const Ce=e.workspaces.find(De=>De.id===te.workspaceId)?.root??te.root;if(Ce&&!e.hiddenWorkspaceRoots.includes(Ce)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Ce],ie(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(De=>De.id!==te.workspaceId&&De.root!==Ce),e.activeWorkspaceId===te.workspaceId||e.activeWorkspaceId===Ce){const De=T.value[0]?.id??null;if(e.activeWorkspaceId=De,De)Z(De);else try{qa(Dt.activeWorkspace)}catch{}m(void 0),e.sessionLoading=!1,Q(),gn(void 0,"replace")}}function Pt(){m(void 0),gn(void 0,"push")}function bn(te){wt(te),Pt(),Q()}async function pn(te){const Ce=$.value.find(zn=>zn.id===te);if(!Ce)return null;const Me=e.thinking,De=ht();let Qe,at=Ce.root;try{const zn=await De.addWorkspace({root:Ce.root});Qe=zn.id,at=zn.root,en(zn)}catch{}const It=r.draftModel.value??void 0,Qt=await De.createSession({workspaceId:Qe,cwd:at,model:It});r.draftModel.value=null;const cn=It!==void 0&&(!Qt.model||Qt.model.length===0)?{...Qt,model:It}:Qt;f(cn),wt(Qt.workspaceId??Qe??te),await Qn(Qt.id);const Vt=Qt.id;return Me!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[Vt]:Me}),O.planMode&&(e.planModeBySession={...e.planModeBySession,[Vt]:!0},W()),O.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Vt]:!0},z()),O.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Vt]:!0},L()),O.planMode=!1,O.swarmMode=!1,O.goalMode=!1,Vt}async function Kt(te,Ce,Me){if(!or.has(te)){or.add(te);try{const De=await pn(te);if(!De)return;await sn(De,Ce,Me)}catch(De){l("startSessionAndSendPrompt",De)}finally{or.delete(te)}}}async function Nn(te,Ce,Me){if(!or.has(te)){or.add(te);try{const De=await pn(te);if(!De)return;const Qe=e.planModeBySession[De]??!1,at=e.swarmModeBySession[De]??!1,It=e.sessions.find(Vt=>Vt.id===De),Qt=(It?.model&&It.model.length>0?It.model:e.defaultModel)??void 0;if(!await M({model:Qt,planMode:Qe,swarmMode:at,permissionMode:e.permission},De))return;await r.activateSkill(Ce,Me,De)}catch(De){l("startSessionAndActivateSkill",De)}finally{or.delete(te)}}}async function Gt(te,Ce){if(!or.has(te)){or.add(te);try{const Me=await pn(te);if(!Me)return;await i.openSideChatOn(Me,Ce)}catch(Me){l("startSessionAndOpenSideChat",Me)}finally{or.delete(te)}}}async function Wt(te){const Ce=te.trim();if(!Ce)return!1;const Me=ht();try{const De=await Me.addWorkspace({root:Ce});return en(De),bn(De.id),!0}catch(De){return console.warn("[kimi-web] addWorkspaceByPath failed for",Ce,De),!1}}async function mn(te){try{return await ht().browseFs(te)}catch{return{path:"",parent:null,entries:[]}}}async function so(){try{return await ht().getFsHome()}catch{return{home:"",recentRoots:[]}}}function gn(te,Ce){if(Ce==="none"||typeof window>"u"||!window.history)return;const Me=hve(te);if(window.location.pathname!==Me)try{Ce==="push"?window.history.pushState(null,"",Me):window.history.replaceState(null,"",Me)}catch{}}async function to(te){try{const Ce=await ht().getSession(te);return e.sessions.some(Me=>Me.id===Ce.id)||h(Ce),!0}catch{return!1}}function vt(){const te=Y3(window.location);if(te===void 0){m(void 0);return}if(te!==e.activeSessionId){if(e.sessions.some(Ce=>Ce.id===te)){Qn(te,{urlMode:"none"});return}(async()=>{if(await to(te)){await Qn(te,{urlMode:"none"});return}const Ce=e.sessions[0];Ce?await Qn(Ce.id,{urlMode:"replace"}):(m(void 0),gn(void 0,"replace"))})()}}let Wn=!1;function Bn(){Wn||typeof window>"u"||(Wn=!0,window.addEventListener("popstate",vt))}async function Qn(te,Ce){const Me=A(te),De=!Me&&c.has(te);c.delete(te);try{gn(te,Ce?.urlMode??"push"),e.sessionLoading=!Me&&!De,m(te),ee(),e.unreadBySession[te]&&(e.unreadBySession={...e.unreadBySession,[te]:!1},U({[te]:!1})),Q();const Qe=e.sessions.find(at=>at.id===te);if(Qe){const at=S(Qe);e.activeWorkspaceId!==at&&wt(at)}if(Me){if(await b(te)==="not-found")return}else if(await v(te)==="not-found")return;re(te)}catch(Qe){l("selectSession",Qe,{sessionId:te})}finally{e.activeSessionId===te&&(e.sessionLoading=!1)}}async function sn(te,Ce,Me){const De=kk(te);e.inFlightBySession={...e.inFlightBySession,[te]:!0};const Qe=k();try{const at=ht(),It=[];Ce&&It.push({type:"text",text:Ce});for(const Zt of Me??[])Zt.kind==="video"?It.push({type:"video",source:{kind:"file",fileId:Zt.fileId}}):Zt.kind==="file"?It.push({type:"file",fileId:Zt.fileId,name:Zt.name??"",mediaType:Zt.mediaType||"application/octet-stream",size:Zt.size??0}):It.push({type:"image",source:{kind:"file",fileId:Zt.fileId}});if(It.length===0)return e.inFlightBySession={...e.inFlightBySession,[te]:!1},"rejected";const Qt={id:Qe,sessionId:te,role:"user",content:It,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};y(te,Zt=>[...Zt,Qt]);const cn=e.sessions.find(Zt=>Zt.id===te),Vt=(cn?.model&&cn.model.length>0?cn.model:e.defaultModel)??void 0,zn=e.planModeBySession[te]??!1,co=e.swarmModeBySession[te]??!1,Nt=e.goalModeBySession[te]??!1;if(Nt&&Ce)try{await at.updateSession(te,{goalObjective:Ce.trim()})}catch(Zt){return l("createGoal",Zt,{sessionId:te}),e.inFlightBySession={...e.inFlightBySession,[te]:!1},y(te,eo=>eo.some(ro=>ro.id===Qe)?eo.filter(ro=>ro.id!==Qe):eo),"rejected"}const _t=await at.submitPrompt(te,{content:It,model:Vt,thinking:await r.resolveThinkingForPrompt(te,Vt)??e.thinking,permissionMode:e.permission,planMode:zn,swarmMode:co});return Nt&&(e.goalModeBySession={...e.goalModeBySession,[te]:!1},L()),e.promptIdBySession={...e.promptIdBySession,[te]:_t.promptId},y(te,Zt=>{const eo=Zt.findIndex(Ks=>Ks.id===Qe);if(eo===-1)return Zt;const ro=[...Zt];return ro[eo]={...ro[eo],promptId:ro[eo].promptId??_t.promptId},ro}),g()?.bindNextPromptId(te,_t.promptId),"ok"}catch(at){return e.inFlightBySession={...e.inFlightBySession,[te]:!1},y(te,It=>It.some(Qt=>Qt.id===Qe)?It.filter(Qt=>Qt.id!==Qe):It),l("sendPrompt",at,{sessionId:te}),wi(at)?"rejected":"uncertain"}finally{bk(te,De)}}async function es(te,Ce){const Me=e.activeSessionId;if(Me){if(a.value!=="idle"||e.inFlightBySession[Me]){Bt(te,Ce);return}if((e.queuedBySession[Me]?.length??0)>0){Bt(te,Ce),Yt(Me);return}await sn(Me,te,Ce)}}async function nt(te,Ce){const Me=e.activeSessionId;if(!Me)return;const De=e.queuedBySession[Me]??[],Qe=[],at=[];for(const _t of De){const Zt=_t.text.trim();Zt&&Qe.push(Zt),_t.attachments?.length&&at.push(..._t.attachments)}const It=te.trim();if(It&&Qe.push(It),Ce?.length&&at.push(...Ce),Qe.length===0&&at.length===0)return;De.length>0&&(e.queuedBySession={...e.queuedBySession,[Me]:[]});const Qt=Qe.join(`
320
-
321
- `),cn=()=>{if(De.length===0)return;const _t=e.queuedBySession[Me]??[];e.queuedBySession={...e.queuedBySession,[Me]:[...De,..._t]}};if(a.value==="idle"&&!e.inFlightBySession[Me]){await sn(Me,Qt,at)==="rejected"&&cn();return}const Vt=[];Qt&&Vt.push({type:"text",text:Qt});for(const _t of at)_t.kind==="video"?Vt.push({type:"video",source:{kind:"file",fileId:_t.fileId}}):_t.kind==="file"?Vt.push({type:"file",fileId:_t.fileId,name:_t.name??"",mediaType:_t.mediaType||"application/octet-stream",size:_t.size??0}):Vt.push({type:"image",source:{kind:"file",fileId:_t.fileId}});const zn=k(),co={id:zn,sessionId:Me,role:"user",content:Vt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};y(Me,_t=>[..._t,co]);const Nt=kk(Me);try{const _t=ht(),Zt=e.sessions.find(Ks=>Ks.id===Me),eo=(Zt?.model&&Zt.model.length>0?Zt.model:e.defaultModel)??void 0,ro=await _t.submitPrompt(Me,{content:Vt,model:eo,thinking:await r.resolveThinkingForPrompt(Me,eo)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Me]??!1,swarmMode:e.swarmModeBySession[Me]??!1});if(y(Me,Ks=>{const Ii=Ks.findIndex(Jf=>Jf.id===zn);if(Ii===-1)return Ks;const Gs=[...Ks];return Gs[Ii]={...Gs[Ii],promptId:Gs[Ii].promptId??ro.promptId},Gs}),ro.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Me]:ro.promptId},g()?.bindNextPromptId(Me,ro.promptId);return}try{await _t.steerPrompts(Me,[ro.promptId])}catch{}}catch(_t){y(Me,Zt=>Zt.filter(eo=>eo.id!==zn)),wi(_t)&&cn(),l("steer",_t,{sessionId:Me})}finally{bk(Me,Nt)}}async function Be(te,Ce){try{const De=await ht().uploadFile({file:te,name:Ce});return{fileId:De.id,name:De.name,mediaType:De.mediaType}}catch(Me){return l("uploadImage",Me),null}}function Bt(te,Ce){const Me=e.activeSessionId;if(!Me)return;const De=e.queuedBySession[Me]??[],Qe={text:te,attachments:Ce,id:_ve()};e.queuedBySession={...e.queuedBySession,[Me]:[...De,Qe]}}function Yt(te){const[Ce,...Me]=e.queuedBySession[te]??[];Ce!==void 0&&(e.queuedBySession={...e.queuedBySession,[te]:Me},sn(te,Ce.text,Ce.attachments).then(De=>{if(De==="ok"){xa.delete(te);return}if(De==="uncertain"){xa.delete(te);return}if(!e.sessions.some(cn=>cn.id===te)){xa.delete(te);return}const Qe=Ce.id??Ce.text,at=xa.get(te),It=at!==void 0&&at.key===Qe?at.count+1:1;if(It>=wve){xa.delete(te),(e.queuedBySession[te]?.length??0)>0&&Yt(te);return}xa.set(te,{key:Qe,count:It});const Qt=e.queuedBySession[te]??[];e.queuedBySession={...e.queuedBySession,[te]:[Ce,...Qt]}}))}function vn(te,Ce){const Me=e.inFlightBySession[te]===!0;if(e.inFlightBySession={...e.inFlightBySession,[te]:!1},e.promptIdBySession[te]!==void 0){const Qe={...e.promptIdBySession};delete Qe[te],e.promptIdBySession=Qe}return te===e.activeSessionId&&ee(),(Me||Ce?.turnWasActive===!0||(e.turnActiveBySession[te]??!1))&&Yt(te),Me}function xn(te,Ce){Ce.inFlightTurn!==null&&Ce.busy||vn(te)}async function nn(){const te=e.activeSessionId;if(!te)return;const Ce=e.sessions.find(Qe=>Qe.id===te);let Me=e.promptIdBySession[te];if(Me===void 0){const Qe=Ce?.currentPromptId;Qe!==void 0&&Qe.length>0&&!Qe.startsWith("pr_")&&(Me=Qe)}const De=ht();if(Me!==void 0)try{if((await De.abortPrompt(te,Me)).aborted)return;const at={...e.promptIdBySession};delete at[te],e.promptIdBySession=at}catch(Qe){if(wi(Qe)&&Qe.code===mve){const at={...e.promptIdBySession};delete at[te],e.promptIdBySession=at}else{l("abortCurrentPrompt",Qe,{sessionId:te});return}}try{await De.abortSession(te)}catch(Qe){l("abortCurrentPrompt",Qe,{sessionId:te})}}function Vn(te,Ce){const Me=e.approvalsBySession[te]??[];e.approvalsBySession={...e.approvalsBySession,[te]:Me.filter(De=>De.approvalId!==Ce)}}function Kn(te,Ce){const Me=e.questionsBySession[te]??[];e.questionsBySession={...e.questionsBySession,[te]:Me.filter(De=>De.questionId!==Ce)}}async function Jn(te,Ce){const Me=e.activeSessionId;if(Me&&!kp[te]){kp[te]=!0;try{const De=ht(),Qe={decision:Ce.decision,scope:Ce.scope,feedback:Ce.feedback,selectedLabel:Ce.selectedLabel};await De.respondApproval(Me,te,Qe),Vn(Me,te)}catch(De){Dv(De)?Vn(Me,te):l("respondApproval",De,{sessionId:Me})}finally{delete kp[te]}}}async function Oo(te,Ce){const Me=e.activeSessionId;if(Me&&!ya[te]){ya[te]="answer";try{await ht().respondQuestion(Me,te,Ce),Kn(Me,te)}catch(De){Dv(De)?Kn(Me,te):l("respondQuestion",De,{sessionId:Me})}finally{delete ya[te]}}}async function ko(te){const Ce=e.activeSessionId;if(Ce&&!ya[te]){ya[te]="dismiss";try{await ht().dismissQuestion(Ce,te),Kn(Ce,te)}catch(Me){Dv(Me)?Kn(Ce,te):l("dismissQuestion",Me,{sessionId:Ce})}finally{delete ya[te]}}}async function li(te){const Ce=e.activeSessionId;if(Ce&&!Pv[te]){Pv[te]=!0;try{const Me=ht(),De=(e.tasksBySession[Ce]??[]).find(at=>at.id===te)?.backgroundTaskId;await Me.cancelTask(Ce,De??te);const Qe=e.tasksBySession[Ce]??[];e.tasksBySession={...e.tasksBySession,[Ce]:Qe.map(at=>at.id===te?{...at,status:"cancelled"}:at)}}catch(Me){bve(Me)||l("cancelTask",Me,{sessionId:Ce})}finally{delete Pv[te]}}}function Uo(te){const Ce=e.activeSessionId;Ce?(e.planModeBySession={...e.planModeBySession,[Ce]:te},W(),M({planMode:te})):O.planMode=te}function As(){const te=e.activeSessionId,Ce=te?e.planModeBySession[te]??!1:O.planMode;Uo(!Ce)}function cs(te){const Ce=e.activeSessionId;Ce?(e.swarmModeBySession={...e.swarmModeBySession,[Ce]:te},z(),M({swarmMode:te})):O.swarmMode=te}async function qo(){const te=e.activeSessionId,Me=!(te?e.swarmModeBySession[te]??!1:O.swarmMode);Me&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||cs(Me)}function Bo(te){const Ce=e.activeSessionId;Ce?(e.goalModeBySession={...e.goalModeBySession,[Ce]:te},L()):O.goalMode=te}function ai(){const te=e.activeSessionId,Ce=te?e.goalModeBySession[te]??!1:O.goalMode;Bo(!Ce)}async function tn(te){const Ce=te.trim();if(!Ce||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:Ce}),variant:"primary"}))return;let Me=e.activeSessionId;if(!Me){const De=e.activeWorkspaceId,Qe=De&&T.value.some(at=>at.id===De)?De:T.value[0]?.id??null;if(!Qe)return;try{Me=await pn(Qe)??void 0}catch(at){l("createGoal",at);return}if(!Me)return}try{await ht().updateSession(Me,{goalObjective:Ce})}catch(De){l("createGoal",De,{sessionId:Me,message:q(De)});return}e.goalModeBySession[Me]&&(e.goalModeBySession={...e.goalModeBySession,[Me]:!1},L()),e.activeSessionId===Me?await es(Ce):await sn(Me,Ce)}function qs(te){const Ce=e.activeSessionId;Ce&&Promise.resolve(ht().updateSession(Ce,{goalControl:te})).catch(Me=>{l("controlGoal",Me,{sessionId:Ce,message:q(Me)})})}function io(te){e.permission=te,B(te),M({permissionMode:te})}function js(te){const Ce=[...e.warnings];Ce.splice(te,1),e.warnings=Ce}async function ci(te,Ce){try{await ht().updateSession(te,{title:Ce}),d(te,De=>({...De,title:Ce}))}catch(Me){l("renameSession",Me,{sessionId:te})}}async function Ni(te,Ce){const Me=e.workspaces.find(Qe=>Qe.id===te)?.root,De=()=>{e.workspaces=e.workspaces.map(Qe=>Qe.id===te?{...Qe,name:Ce}:Qe)};try{if(await ht().updateWorkspace(te,{name:Ce}),Me!==void 0){const Qe=zh();Me in Qe&&(delete Qe[Me],E_(Qe))}De()}catch(Qe){if(Me!==void 0&&wi(Qe)&&Qe.code===gve){E_({...zh(),[Me]:Ce}),De();return}l("renameWorkspace",Qe)}}async function ui(te){const Ce=e.workspaces.find(at=>at.id===te)?.root??$.value.find(at=>at.id===te)?.root??te,Me=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,De=e.activeWorkspaceId===te||e.activeWorkspaceId===Ce,Qe=!!(Me&&(Me.cwd===Ce||Me.workspaceId===te||S(Me)===te));Ce&&!e.hiddenWorkspaceRoots.includes(Ce)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Ce],ie(e.hiddenWorkspaceRoots));try{await ht().deleteWorkspace(te)}catch(at){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",te,at)}if(e.workspaces=e.workspaces.filter(at=>at.id!==te&&at.root!==Ce),De||Qe){const at=T.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Z(at);else try{qa(Dt.activeWorkspace)}catch{}}(De||Qe)&&(m(void 0),e.sessionLoading=!1,Q(),gn(void 0,"replace"))}async function Vs(te){try{await ht().archiveSession(te),p(te),i.clearSideChatForSession(te);const{[te]:Me,...De}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=De,e.activeSessionId===te){const Qe=e.sessions[0];Qe?await Qn(Qe.id,{urlMode:"replace"}):(m(void 0),gn(void 0,"replace"))}}catch(Ce){l("archiveSession",Ce,{sessionId:te})}}async function ts(te){if(he)return;const Ce=te??e.activeSessionId;if(!Ce){const De=n("commands.export.noSession");_o("export:failed",{status:"no-session"}),l("exportSession",new Error(De),{message:De});return}he=!0;const Me=Date.now();_o("export:start",{sessionId:Ce});try{const De=Gie(),{blob:Qe,fileName:at}=await ht().exportSession(Ce,De);if(typeof document>"u")throw new Error("Document is unavailable");const It=URL.createObjectURL(Qe);let Qt;try{Qt=document.createElement("a"),Qt.href=It,Qt.download=at,document.body.append(Qt),Qt.click()}finally{Qt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(It)}catch{}},0)}_o("export:accepted",{sessionId:Ce,status:"accepted",zipBytes:Qe.size,durationMs:Date.now()-Me})}catch(De){const Qe=typeof De=="object"&&De!==null?De:void 0;_o("export:failed",{sessionId:Ce,status:"failed",durationMs:Date.now()-Me,errorName:typeof Qe?.name=="string"?Qe.name:typeof De,errorCode:typeof Qe?.code=="number"?Qe.code:void 0,requestId:typeof Qe?.requestId=="string"?Qe.requestId:void 0,phase:typeof Qe?.phase=="string"?Qe.phase:void 0,httpStatus:typeof Qe?.status=="number"?Qe.status:void 0}),l("exportSession",De,{sessionId:Ce})}finally{he=!1}}async function ns(te){try{const Ce=await ht().restoreSession(te);return f(Ce),!0}catch(Ce){return l("restoreSession",Ce,{sessionId:te}),!1}}function zt(te){return ht().listSessions({archivedOnly:!0,beforeId:te?.beforeId,pageSize:te?.pageSize??50})}async function Ms(){try{await ht().logout(),await G(),await ut()}catch(te){l("logout",te)}}function No(te){const Ce=e.activeSessionId;Ce&&ht().compactSession(Ce,te).catch(Me=>{l("compact",Me,{sessionId:Ce})})}async function di(te){const Ce=te??e.activeSessionId;if(Ce)try{const Me=await ht().forkSession(Ce);f(Me),await Qn(Me.id)}catch(Me){l("fork",Me,{sessionId:Ce})}}async function Ke(te=1){const Ce=e.activeSessionId;if(!Ce)return null;const Me=(()=>{const De=e.messagesBySession[Ce]??[];for(let Qe=De.length-1;Qe>=0;Qe--){const at=De[Qe];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(It=>It.type==="text").map(It=>It.text).join(`
322
- `)}return null})();try{return await ht().undoSession(Ce,te),await v(Ce),Me}catch(De){return l("undo",De,{sessionId:Ce}),null}}function Re(te){const Ce=e.activeSessionId;if(!Ce)return;const Me=e.queuedBySession[Ce]??[];if(te<0||te>=Me.length)return;const De=[...Me];De.splice(te,1),e.queuedBySession={...e.queuedBySession,[Ce]:De}}function le(te,Ce){const Me=e.activeSessionId;if(!Me)return;const De=e.queuedBySession[Me]??[];if(te===Ce||te<0||te>=De.length||Ce<0||Ce>=De.length)return;const Qe=[...De],[at]=Qe.splice(te,1);at!==void 0&&(Qe.splice(Ce,0,at),e.queuedBySession={...e.queuedBySession,[Me]:Qe})}async function Te(te){const Ce=e.activeSessionId;if(!Ce)return[];try{return(await ht().listDirectory(Ce,{path:te,includeGitStatus:!0})).items}catch{return[]}}async function ge(te){const Ce=e.activeSessionId;if(!Ce)return null;try{const De=await ht().readFile(Ce,{path:te});return{path:De.path,content:De.content,encoding:De.encoding,mime:De.mime,languageId:De.languageId,isBinary:De.isBinary,size:De.size,lineCount:De.lineCount}}catch(Me){return console.warn("[kimi-web] readFileContent failed for",te,Me),null}}const Ee=10485760;function ze(te){const Ce=e.activeSessionId;return Ce?ht().getFileDownloadUrl(Ce,te):null}async function Ht(te,Ce){const Me=e.activeSessionId;if(!Me)return!1;try{return await ht().openFile(Me,{path:te,line:Ce}),!0}catch(De){return l("openFile",De,{sessionId:Me}),!1}}async function Ut(te){const Ce=e.activeSessionId;if(!Ce)return;const Me=F.value.cwd||".";try{await ht().openInApp(Ce,te,Me)}catch(De){l("openInApp",De,{sessionId:Ce})}}async function wn(te){const Ce=e.activeSessionId;if(!Ce)return!1;try{return await ht().revealFile(Ce,{path:te}),!0}catch(Me){return l("revealFile",Me,{sessionId:Ce}),!1}}async function go(te){if(/^(https?:|data:|blob:)/i.test(te))return te;const Ce=e.activeSessionId;if(!Ce)return te;let Me=te;if(Me.startsWith("/")){const De=e.sessions.find(Qe=>Qe.id===Ce)?.cwd;if(De&&(Me===De||Me.startsWith(De.endsWith("/")?De:`${De}/`))){if(Me=Me.slice(De.length).replace(/^\//,""),!Me)return te}else return te}try{const Qe=await ht().readFile(Ce,{path:Me,length:Ee});return!Qe.isBinary||Qe.encoding!=="base64"||Qe.truncated?te:`data:${Qe.mime};base64,${Qe.content}`}catch{return te}}async function us(te){const Ce=e.sessions.find(De=>De.id===e.activeSessionId),Me=Ce===void 0?e.activeWorkspaceId:S(Ce);if(!Me)return[];try{return(await ht().searchFiles(Me,{query:te,limit:20})).items.map(at=>({path:at.path,name:at.name}))}catch{return[]}}return{loadFileDiff:Y,clearFileDiff:Q,loadGitStatus:P,checkAuth:G,loadConfig:ye,updateConfig:de,listAllSessionsGlobal:ke,load:ut,refreshServerMeta:lt,loadWorkspaces:mt,loadMoreSessions:Ze,loadAllSessions:tt,selectWorkspace:wt,openWorkspace:Ft,upsertWorkspacePreserveOrder:en,applyWorkspaceEvent:Hn,clearActiveSession:Pt,openWorkspaceDraft:bn,startSessionAndSendPrompt:Kt,startSessionAndActivateSkill:Nn,startSessionAndOpenSideChat:Gt,addWorkspaceByPath:Wt,browseFs:mn,getFsHome:so,writeSessionUrl:gn,fetchSessionIntoList:to,onSessionRoutePopState:vt,bindSessionRoute:Bn,selectSession:Qn,submitPromptInternal:sn,finishPromptLocal:vn,localTurnStartState:Sve,isLocalTurnSnapshotCurrent:Ave,afterLocalTurnStartsSettle:Mve,handleSessionSnapshot:xn,sendPrompt:es,steerPrompt:nt,uploadImage:Be,enqueue:Bt,unqueue:Re,reorderQueue:le,abortCurrentPrompt:nn,respondApproval:Jn,respondQuestion:Oo,dismissQuestion:ko,pendingQuestionActions:ya,pendingApprovalActions:kp,cancelTask:li,setPlanMode:Uo,togglePlanMode:As,setSwarmMode:cs,toggleSwarmMode:qo,setGoalMode:Bo,toggleGoalMode:ai,createGoal:tn,controlGoal:qs,setPermission:io,dismissWarning:js,renameSession:ci,renameWorkspace:Ni,deleteWorkspace:ui,archiveSession:Vs,exportSession:ts,restoreSession:ns,loadArchivedSessions:zt,logout:Ms,compact:No,forkSession:di,undo:Ke,listDir:Te,readFileContent:ge,getFileDownloadUrl:ze,openWorkspaceFile:Ht,openInApp:Ut,revealWorkspaceFile:wn,resolveImageUrl:go,searchFiles:us,loadOlderMessages:Ae,refreshSessionSidecars:re,isStartingFirstPrompt:()=>or.size>0}}const bT=Dt.starredModels,X3=new Error("profile persist failed");function Tve(){try{const e=yo(bT);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Nve(e){try{Eo(bT,JSON.stringify(e))}catch{}}function Ive(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=oe([]),c=oe(Tve()),u=oe({}),d=oe({}),f=oe([]),h=oe(null);function p(q){if(!(q==null||q.length===0))return a.value.find(ee=>ee.id===q)??a.value.find(ee=>ee.model===q)}function m(){const q=e.activeSessionId?e.sessions.find(fe=>fe.id===e.activeSessionId):void 0,ee=q===void 0?h.value??e.defaultModel:q.model||e.defaultModel;return p(ee)?.id??ee??void 0}function y(q){if(q===void 0)return;const ee=p(q);return ee===void 0?void 0:Ef(ee)}function k(q,ee){const fe=q==null?void 0:e.thinkingBySession[q];return fe!==void 0&&yue(ee,fe)?fe:Ef(ee)}function g(q,ee){if(ee===void 0)return;const fe=p(ee);return fe===void 0?void 0:k(q,fe)}async function v(q,ee){return q!=null&&e.thinkingBySession[q]===void 0&&await o(q),g(q,ee)}function b(q){e.thinking=q;const ee=e.activeSessionId;return q!==void 0&&ee!==null&&ee!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ee]:q}),q}et([()=>e.activeSessionId,()=>m(),()=>{const q=e.activeSessionId;return q==null?void 0:e.thinkingBySession[q]}],()=>{const q=p(m());q!==void 0&&(e.thinking=k(e.activeSessionId,q))});function A(q){ht().setConfig({thinking:kue(q,p(m())?.supportEfforts)}).catch(ee=>n("setConfig",ee))}async function I(q){try{const fe=await ht().listSkills(q);u.value={...u.value,[q]:fe}}catch{}}async function N(q){try{const fe=await ht().listSkillsForWorkspace(q);d.value={...d.value,[q]:fe}}catch{}}async function M(){try{const q=ht();a.value=await q.listModels();const ee=p(m());ee!==void 0&&(e.thinking=k(e.activeSessionId,ee))}catch(q){n("loadModels",q)}}async function $(){try{const q=ht();f.value=await q.listProviders()}catch(q){n("loadProviders",q)}}async function T(q){const ee=e.activeSessionId,fe=p(q),ne=e.thinking,j=ee?e.sessions.find(he=>he.id===ee)?.model:void 0,K=m()!==(fe?.id??q),ve=bue(fe,ne,K);if(!ee)return h.value=q,e.thinking=ve,ve!==ne&&ve!==void 0&&A(ve),!0;r(ee,he=>({...he,model:q})),ve!==ne&&(e.thinking=ve,ve!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ee]:ve}));try{await ht().updateSession(ee,{model:q,thinking:ve!==ne?ve:void 0})}catch(he){return r(ee,Ae=>({...Ae,model:j??Ae.model})),ve!==ne&&(e.thinking=ne,ne!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ee]:ne})),n("setModel",he,{sessionId:ee}),!1}return ve!==ne&&ve!==void 0&&A(ve),await o(ee),!0}function F(q){const ee=new Set(c.value);ee.has(q)?ee.delete(q):ee.add(q),c.value=Array.from(ee),Nve(c.value)}async function S(q,ee,fe){const ne=fe??e.activeSessionId;if(!ne)return;const j=i.value==="idle"&&!e.inFlightBySession[ne],K=`msg_skill_opt_${Date.now().toString(36)}`,ve=j?kk(ne):void 0;if(j){e.inFlightBySession={...e.inFlightBySession,[ne]:!0};const he={id:K,sessionId:ne,role:"user",content:[{type:"text",text:`/${q}${ee?` ${ee}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:q,skillArgs:ee}}};l(ne,Ae=>[...Ae,he])}try{const he=e.sessions.find(Y=>Y.id===ne)?.model,Ae=(he&&he.length>0?he:e.defaultModel)??void 0;if(!await s({thinking:await v(ne,Ae)??e.thinking},ne))throw X3;await ht().activateSkill(ne,q,ee)}catch(he){j&&(e.inFlightBySession={...e.inFlightBySession,[ne]:!1},l(ne,Ae=>Ae.filter(re=>re.id!==K))),he!==X3&&n("activateSkill",he,{sessionId:ne})}finally{ve!==void 0&&bk(ne,ve)}}async function B(q){try{await ht().addProvider(q),await Promise.all([$(),M()])}catch(ee){n("addProvider",ee)}}async function W(q){try{await ht().deleteProvider(q),await Promise.all([$(),M()])}catch(ee){n("deleteProvider",ee)}}async function z(q){try{const ee=await ht().refreshProvider(q);for(const fe of ee.failed)n("refreshProvider",new Error(fe.reason),{message:fe.provider});await Promise.all([$(),M()])}catch(ee){n("refreshProvider",ee)}}async function L(){try{const q=await ht().refreshAllProviders();for(const ee of q.failed)n("refreshAllProviders",new Error(ee.reason),{message:ee.provider});await Promise.all([$(),M()])}catch(q){n("refreshAllProviders",q)}}async function O(){try{return await ht().startOAuthLogin()}catch{return null}}async function U(){try{return await ht().pollOAuthLogin()}catch(q){return console.warn("[kimi-web] pollOAuthLogin failed",q),null}}async function Z(){try{await ht().cancelOAuthLogin()}catch{}}function ie(q){const ee=b(q);s({thinking:ee}),ee!==void 0&&A(ee)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:I,loadSkillsForWorkspace:N,loadModels:M,loadProviders:$,setModel:T,thinkingLevelForModelId:y,thinkingLevelForSessionId:g,resolveThinkingForPrompt:v,toggleStarModel:F,activateSkill:S,addProvider:B,deleteProvider:W,refreshProvider:z,refreshAllProviders:L,startOAuthLogin:O,pollOAuthLogin:U,cancelOAuthLogin:Z,setThinking:ie}}const xT="kimiWeb.compaction",Lve=/^read[_-]?media(?:file)?$/i,$ve=/^data:([^;]+);base64,(.*)$/s,Fve=/^<(image|video|audio)\s+path="([^"]+)">$/,Ove=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Bve=/Mime type:\s*([^.\s]+)/i,Rve=/Size:\s*(\d+)\s*bytes/i,Dve=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Pve="<system>Image compressed to fit model limits:",Hve=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Wve(e){return e.includes(Pve)?e.replace(Hve,""):e}function zve(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Uve(e){const t=Ove.exec(e.trim());return t?{kind:t[1],path:zve(t[2])}:null}const wT=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,qve=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function jve(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return wT.test(o)?o:void 0}const Vve=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Kve(e){const t=Vve.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=qve.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&wT.test(o)?o:void 0}}function Gve(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 Yve(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 Zve(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 s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Xve(e,t){if(!Lve.test(e))return;const n=Yve(t);if(n===null)return;let o,s,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 h=d.text,p=Fve.exec(h);p&&(s=p[1],o=p[2]);const m=Bve.exec(h);m?.[1]&&(i=m[1]);const y=Rve.exec(h);y?.[1]&&(r=Number(y[1]));const k=Dve.exec(h);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Zve(d);f&&(a=f)}if(a===null)return;const c=$ve.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Gve(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Qve(e){if(e!=null){if(typeof e=="string")return e.split(`
323
- `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
324
- `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
325
- `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
326
- `)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Jve(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,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function eye(e,t){const n=e.split(`
327
- `),o=t.split(`
328
- `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function tye(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:eye(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{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};if(n==="file_content"||n==="file")return{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};if(n==="file_op"||n==="fileop")return{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};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{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};if(n==="todo"||n==="todo_list")return{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"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function nye(e){const t=`<prompt>
329
- `,n=`
330
- </prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):oye(e)}function oye(e){const t=e.split(`
331
- `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
332
- `):e}function sye(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function iye(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
333
- `);return nye(t)}function rye(e,t){const n=e.metadata?.origin??{},o=iye(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function lye(e,t,n){const{text:o,cron:s}=rye(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function aye(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function cye(e){return e.metadata?.origin?.kind==="compaction_summary"}function uye(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function dye(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function fye(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function hye(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function _T(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let m=0;m<p.tools.length;m++){const y=p.tools[m];if(y.status!=="running")continue;const k={...y,status:"ok"};p.tools[m]=k;const g=p.blocks.find(v=>v.kind==="tool"&&v.tool.id===k.id);g&&g.kind==="tool"&&(g.tool=k)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
334
- `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
335
- `):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const y=h.blocks.at(-1);y&&y.kind==="text"?y.text+=`
336
- `+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const y=h.blocks.at(-1);y&&y.kind==="thinking"?y.thinking+=`
337
- `+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const y=l.get(m.toolCallId),k={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?s[m.toolCallId]?.path:void 0};h.tools.push(k),h.blocks.push({kind:"tool",tool:k}),y&&(h.approval=tye(y),h.approvalId=y.approvalId)}else if(m.type==="toolResult"){const y=h.tools.findIndex(k=>k.id===m.toolCallId);if(y!==-1){const k=h.tools[y],g={...k,status:m.isError?"error":"ok",output:Qve(m.output),media:m.isError?void 0:Xve(k.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=dye(g.output)),h.tools[y]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}}function d(h,p){for(const m of p){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const y=h.tools.findIndex(b=>b.id===m.toolCallId);if(y===-1)continue;const k=h.tools[y];if(k.output!==void 0)continue;const g={...k,output:m.outputLines};h.tools[y]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,m=h.source;if(m.kind==="url")return{url:m.url,kind:p};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:p};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:p,fileId:m.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(cye(h)){c();const g=h.metadata?.[xT];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(v=>v.type==="text").map(v=>v.text).join(`
338
- `),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=sye(h);if(c(),g!==void 0){i.push(lye(h,r++,g));continue}if(!aye(h))continue;const v=h.metadata?.origin,b=v?.kind==="skill_activation"&&v?.trigger==="user-slash",A=v?.kind==="plugin_command"&&v?.trigger==="user-slash",I=[],N=[];for(const M of h.content){if(M.type==="text")if(b)I.push(v.skillArgs??"");else if(A)I.push(v.commandArgs??"");else{const T=Uve(M.text);if(T&&(T.kind==="video"||T.kind==="image")&&n){const B=jve(T.path);if(B){N.push({url:n(B),kind:T.kind,fileId:B});continue}}const F=Kve(M.text);if(F){N.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=Wve(M.text);if(S!==M.text&&S.trim().length===0)continue;I.push(S)}const $=f(M);if($){N.push({url:$.url,kind:$.kind,name:M.type==="file"?M.name:void 0,fileId:$.fileId});continue}M.type==="file"&&n&&N.push({kind:"file",url:n(M.fileId),fileId:M.fileId,name:M.name,mediaType:M.mediaType||void 0,size:M.size})}i.push({id:h.id,role:"user",no:r++,text:I.join(`
339
- `),attachments:N.length>0?N:void 0,skillActivation:b?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:A?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;uye(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const y=a;if(y===null)continue;const k=fye(h.content);if(y.promptId!==void 0&&y.foldedSigs.some(g=>hye(g,k))){d(y,h.content);continue}y.foldedSigs.push(k),u(y,h.content)}return c(!0),i}function pye(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=oe({}),a=D(()=>{const T=e.activeSessionId;if(!T)return null;const F=l.value[T];return F?{parentId:T,agentId:F.agentId}:null}),c=D(()=>a.value?.parentId??null),u=D(()=>a.value!==null),d=D(()=>{const T=a.value;return T?!!e.sideChatSendingByAgent[T.agentId]:!1}),f=D(()=>{const T=a.value;return T?e.sideChatSendingByAgent[T.agentId]?!0:(e.tasksBySession[T.parentId]??[]).some(F=>F.id===T.agentId&&F.status==="running"):!1}),h=D(()=>{const T=a.value;if(!T)return[];const F=e.sideChatMessagesByAgent[T.agentId]??[];return _T(F,[],S=>ht().getFileUrl(S),f.value)});function p(T,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[T]:F(e.sideChatMessagesByAgent[T]??[])}}function m(T,F){p(T,S=>[...S,F])}function y(T){p(T,F=>{const S=[...F].reverse().findIndex(W=>W.role==="user");if(S===-1)return F;const B=F.length-1-S;return F.filter((W,z)=>z!==B)})}function k(T,F){p(T,S=>{const B=[...S];for(let W=B.length-1;W>=0;W-=1){const z=B[W];if(z.role==="user")return B[W]={...z,promptId:z.promptId??F},B}return S})}function g(T,F,S){S&&p(T,B=>{const W=B.at(-1);if(W?.role==="assistant"){const z=W.content[0],L=z?.type==="text"?z.text:"";return[...B.slice(0,-1),{...W,content:[{type:"text",text:`${L}${S}`}]}]}return[...B,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function v(T,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[T]:!1},!S)return;const W=(e.sideChatMessagesByAgent[T]??[]).at(-1);(W?.role==="assistant"&&W.content[0]?.type==="text"?W.content[0].text:"").trim().length>0||g(T,F,S)}async function b(T){const F=e.activeSessionId;F&&await A(F,T)}async function A(T,F){if(!l.value[T]){let S;try{({agentId:S}=await ht().startBtw(T))}catch(B){n("openSideChat",B,{sessionId:T});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[T]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await I(T,F.trim())}async function I(T,F){const S=l.value[T],B=F.trim();if(!S||!B)return;const W=T,z=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[z]:!0};const L={id:o(),sessionId:W,role:"user",content:[{type:"text",text:B}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};m(z,L);try{const O=e.sessions.find(ie=>ie.id===W),U=(O?.model&&O.model.length>0?O.model:e.defaultModel)??void 0,Z=await ht().submitPrompt(W,{content:[{type:"text",text:B}],agentId:z,model:U,thinking:await r(W,U)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[W]??!1,swarmMode:e.swarmModeBySession[W]??!1});k(z,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[W]:[...e.sideChatUserMessageIdsBySession[W]??[],Z.userMessageId]}}catch(O){n("sendSideChatPrompt",O,{sessionId:W}),y(z),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[z]:!1}}}function N(){const T=e.activeSessionId;if(!T)return;const{[T]:F,...S}=l.value;l.value=S}async function M(T){const F=a.value;F&&await I(F.parentId,T)}function $(T){if(!l.value[T])return;const{[T]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:g,finishSideChatAgent:v,openSideChat:b,openSideChatOn:A,closeSideChat:N,sendSideChatPrompt:M,clearSideChatForSession:$}}const mye="kimiWeb.optimisticUserMessage",Q3="Sub Agent";function gye(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function vye(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function yye(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function Hv(e){return e.role==="user"&&e.metadata?.[mye]===!0}function kye(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function bye(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const xye=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function J3(e){let t="",n=0;for(const o of e.content)o.type==="text"?xye.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function wye(e,t){const n=J3(e),o=J3(t);return n.text===o.text&&n.media===o.media}function _ye(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(Hv(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Hv(s)&&bye(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Hv(s)&&wye(s,t))return o}return-1}function Sye(e,t,n){let o=!1;const s=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?(o=!0,{...i,content:l}):i});return o?s:e}const Cye={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function Aye(e){const t=Rn.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?Cye[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function Mye(e,t,n){const o=vye(e);switch(yye(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[xT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!kye(t.message)){const a=_ye(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=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 s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=Sye(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===Q3&&a.description!==Q3?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,Aye(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${Rn.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function Eye(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Tye(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Ja(s.toolName)!=="todo")continue;let i=s.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:Eye(a.status)}]:[]})}}return[]}const Nye=["queued","working","suspended","completed","failed"];function ST(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Iye(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Lye(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:ST(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Iye();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function $ye(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of Nye)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function Fye(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:ST(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const Fr=vT(),lr=Jge(),Tf=lve(),CT=Dt.permission,AT=Dt.activeWorkspace,MT=Dt.planMode,ET=Dt.swarmMode,TT=Dt.goalMode,eA=40401,NT=Dt.onboarded;qa(Dt.codeFont);qa(Dt.theme);qa(Dt.thinking);function Oye(){try{const e=yo(CT);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Bye(e){try{Eo(CT,e)}catch{}}function Wv(e){const t=yo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function Tb(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);Eo(e,JSON.stringify(n))}catch{}}function IT(){Tb(MT,_e.planModeBySession)}function LT(){Tb(ET,_e.swarmModeBySession)}function $T(){Tb(TT,_e.goalModeBySession)}function Rye(){try{return yo(AT)}catch{return null}}const FT=Dt.hiddenWorkspaces;function Dye(){try{const e=yo(FT);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Pye(e){try{Eo(FT,JSON.stringify(e))}catch{}}function Hye(e){try{Eo(AT,e)}catch{}}function Wye(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const _e=zo({...gye(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:Oye(),thinking:void 0,thinkingBySession:{},planModeBySession:Wv(MT),swarmModeBySession:Wv(ET),goalModeBySession:Wv(TT),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:n2(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Rye(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Dye(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),l0=zo({planMode:!1,swarmMode:!1,goalMode:!1});function OT(e){_e.sessions=e}function a0(e,t){_e.sessions=_e.sessions.map(n=>n.id===e?t(n):n)}function zye(e){_e.sessions=[e,..._e.sessions.filter(t=>t.id!==e.id)]}function Uye(e){_e.sessions=[..._e.sessions,e]}function qye(e){_e.sessions=_e.sessions.filter(t=>t.id!==e)}function BT(){const e=_e.activeSessionId;e&&_e.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(_e.unreadBySession={..._e.unreadBySession,[e]:!1},o2({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Dt.unread&&(_e.unreadBySession=n2(),BT())});function xk(){if(Mi===null||!Mi.health().stale)return;_o("ws:stale-reconnect",{sessionId:_e.activeSessionId,status:"stale"}),Rr("ws: stale socket on focus, reconnecting",{activeSessionId:_e.activeSessionId}),Mi.reconnect();const e=_e.activeSessionId;e&&s1.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(BT(),xk())});typeof window<"u"&&(window.addEventListener("focus",xk),window.addEventListener("online",xk));function Nb(e){_e.activeSessionId=e}function jye(e){_e.messagesBySession=e}function Vye(e,t){_e.messagesBySession={..._e.messagesBySession,[e]:t}}function RT(e,t){_e.messagesBySession={..._e.messagesBySession,[e]:t(_e.messagesBySession[e]??[])}}function Kye(e){const{[e]:t,...n}=_e.messagesBySession;_e.messagesBySession=n}function DT(e){Mi?.unsubscribe(e),vke(e),n1.discard(({meta:t})=>t.sessionId===e),qye(e),Kye(e),delete _e.approvalsBySession[e],delete _e.questionsBySession[e],delete _e.tasksBySession[e],delete _e.goalBySession[e],delete _e.gitStatusBySession[e],delete _e.lastSeqBySession[e],delete _e.compactionBySession[e],delete _e.messagesLoadingMoreBySession[e],delete _e.messagesHasMoreBySession[e],delete _e.messagesLoadMoreErrorBySession[e],delete wk[e],o1.delete(e),Vp.delete(e),ZT.delete(e),Cve(e),delete _e.queuedBySession[e],delete _e.promptIdBySession[e],delete _e.inFlightBySession[e],delete _e.turnActiveBySession[e],delete _e.planModeBySession[e],delete _e.swarmModeBySession[e],delete _e.goalModeBySession[e],delete _e.thinkingBySession[e],IT(),LT(),$T()}const PT=oe(null),HT=oe([]),WT=oe(!1),zT=oe(!1),UT=oe(null);async function Zf(e){let t;try{t=await ht().getSessionStatus(e)}catch{return}a0(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),_e.swarmModeBySession={..._e.swarmModeBySession,[e]:t.swarmMode},_e.planModeBySession={..._e.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(_e.thinkingBySession={..._e.thinkingBySession,[e]:t.thinkingEffort})}async function Gye(e){const t=_e.goalVersionBySession[e]??0;let n;try{n=await ht().getSessionGoal(e)}catch{return}if((_e.goalVersionBySession[e]??0)!==t)return;const o={..._e.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,_e.goalBySession=o}function qT(e,t){const n=t??_e.activeSessionId;return n?Promise.resolve(ht().updateSession(n,e)).then(()=>Zf(n)).then(()=>!0).catch(o=>(Xf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const jT=Dt.conversationToc;function Yye(){try{const e=yo(jT);return e===null?!0:e==="true"}catch{return!0}}function Zye(e){try{Eo(jT,e?"true":"false")}catch{}}const VT=oe(Yye());function Xye(e){VT.value=e,Zye(e)}function Qye(e){try{return yo(e)??""}catch{return""}}const KT=oe(Qye(NT)==="1");function Jye(e){KT.value=e;try{Eo(NT,e?"1":"0")}catch{}}let Mi=null,tA=0;function GT(){return tA+=1,`msg_opt_${Date.now().toString(36)}_${tA}`}function eke(e,t,n){const o={sessions:_e.sessions,activeSessionId:_e.activeSessionId,messagesBySession:_e.messagesBySession,approvalsBySession:_e.approvalsBySession,planReviewByToolCallId:_e.planReviewByToolCallId,questionsBySession:_e.questionsBySession,tasksBySession:_e.tasksBySession,goalBySession:_e.goalBySession,goalVersionBySession:_e.goalVersionBySession,lastSeqBySession:_e.lastSeqBySession,turnActiveBySession:_e.turnActiveBySession,compactionBySession:_e.compactionBySession,config:_e.config,warnings:_e.warnings},s=Mye(o,e,{sessionId:t,seq:n});OT(s.sessions),Nb(s.activeSessionId),jye(s.messagesBySession),_e.approvalsBySession=s.approvalsBySession,_e.planReviewByToolCallId=s.planReviewByToolCallId,_e.questionsBySession=s.questionsBySession,_e.tasksBySession=s.tasksBySession,_e.goalBySession=s.goalBySession,_e.goalVersionBySession=s.goalVersionBySession,_e.lastSeqBySession=s.lastSeqBySession,_e.turnActiveBySession=s.turnActiveBySession,_e.compactionBySession=s.compactionBySession,_e.config=s.config??null,_e.warnings=s.warnings,e.type==="configChanged"&&(_e.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Un.loadModels(),Un.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(_e.swarmModeBySession={..._e.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(_e.planModeBySession={..._e.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(_e.thinkingBySession={..._e.thinkingBySession,[e.sessionId]:e.thinking}))}function tke(e,t){const n=_e.lastSeqBySession[t.sessionId]??0,o=_e.turnActiveBySession[t.sessionId]??!1;eke(e,t.sessionId,t.seq);const s=ps.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&ps.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?ps.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?ps.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&ps.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;_e.promptIdBySession[i]!==e.message.promptId&&(_e.promptIdBySession={..._e.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===_e.activeSessionId&&Fr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;_2e(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&w2e(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&_e.promptIdBySession[e.sessionId]===e.promptId&&ft.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&S2e(e.sessionId,e.question),e.type==="approvalRequested"&&C2e(e.sessionId,e.approval)}const n1=xge(({appEvent:e,meta:t})=>tke(e,t),({appEvent:e})=>vge(e),{coalesce:_ge});function YT(){if(Mi!==null||typeof WebSocket>"u")return;_o("ws:connection",{status:"connecting"}),_e.connection="connecting",Mi=ht().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ft.applyWorkspaceEvent(t);return}for(const o of wge({appEvent:t,meta:n}))n1(o)},onResync(t,n,o){_o("ws:resync",{sessionId:t,status:"required",seq:n}),n1.flush(),o1.add(t),s1.request(t)},onError(t,n,o){_o("ws:error",{status:"failed",errorCode:t,fatal:o}),Ib({severity:"error",title:Rn.global.t("warnings.wsTitle"),message:n,details:[lo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){_o("ws:connection",{status:t?"connected":"disconnected"}),_e.connected=t,_e.connection=t?"connected":"disconnected",t&&(cke(),ft.refreshServerMeta())}})}const wk={},o1=new Set,Vp=new Set,ZT=new Set;function nke(e){return wi(e)&&e.code===eA?!0:typeof e=="object"&&e!==null&&e.code===eA}function lo(e,t){if(!(t==null||t===""))return{label:Rn.global.t(`warnings.details.${e}`),value:XT(t)}}function XT(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack: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 oke(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function ske(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function ike(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function rke(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function nA(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function lke(e,t,n){const o=ob(t),s=wi(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[lo("operation",e),lo("sessionId",n??_e.activeSessionId),lo("connection",_e.connection),lo("timestamp",rke(i??Date.now()))];return o?l.push(lo("duration",nA(r)),lo("request",`${t.method} ${t.path}`),lo("endpoint",t.url),lo("requestId",t.requestId),lo("phase",t.phase),lo("timeout",`${t.timeoutMs}ms`),lo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),lo("contentType",t.contentType),lo("responsePreview",t.bodyPreview),lo("cause",t.cause)):s?l.push(lo("duration",nA(r)),lo("code",t.code),lo("requestId",t.requestId),lo("message",t.message),lo("details",t.details)):l.push(lo("errorName",oke(t)),lo("message",ske(t)??XT(t)),lo("stack",ike(t))),l.filter(a=>a!==void 0)}function ake(e,t,n={}){const o=ob(t),s=wi(t),i=n.title??(o?Rn.global.t("warnings.daemonNetworkTitle"):s?Rn.global.t("warnings.daemonApiTitle"):Rn.global.t("warnings.operationFailedTitle")),r=n.message??(o?Rn.global.t("warnings.daemonNetworkMessage"):s?t.message:Rn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:lke(e,t,n.sessionId)}}function Ib(e){_e.warnings=[..._e.warnings,e]}function cke(){const e=Rn.global.t("warnings.wsTitle"),t=_e.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==_e.warnings.length&&(_e.warnings=t)}function Xf(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=wi(t),s=ob(t);_o("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),Ib(ake(e,t,n))}const uke={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function dke(e){if(!wi(e))return;const t=uke[e.code];return t?Rn.global.t(t):void 0}async function fke(e){if(DT(e),_e.activeSessionId!==e)return;const t=_e.sessions[0];t?await ft.selectSession(t.id,{urlMode:"replace"}):(Nb(void 0),_e.sessionLoading=!1,ft.writeSessionUrl(void 0,"replace"))}const oA=new Set;async function hke(e){if(!oA.has(e)){oA.add(e);try{const t=await ht().getSessionWarnings(e),n=Rn.global.t("warnings.noteLabel");for(const o of t)Ib(`${n}: ${o.message}`)}catch{}}}async function Lb(e){const t=ft.localTurnStartState(e);try{const o=await ht().getSessionSnapshot(e);if(!_e.sessions.some(a=>a.id===e))return"ok";n1.flush();const s=_e.lastSeqBySession[e]??0,i=wk[e];if(!(o1.has(e)||i1.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Vp.delete(e)||(Vp.add(e),s1.request(e)),"ok";if(!ft.isLocalTurnSnapshotCurrent(e,t))return ft.afterLocalTurnStartsSettle(e,()=>{s1.request(e)}),"ok";const l=ik(o.session.usage);a0(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),Vye(e,hge(_e.messagesBySession[e]??[],o.messages)),_e.tasksBySession={..._e.tasksBySession,[e]:pge(o.subagents,_e.tasksBySession[e]??[])},_e.messagesHasMoreBySession={..._e.messagesHasMoreBySession,[e]:o.hasMoreMessages},_e.approvalsBySession={..._e.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(_e.planReviewByToolCallId={..._e.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}_e.questionsBySession={..._e.questionsBySession,[e]:o.pendingQuestions},_e.lastSeqBySession={..._e.lastSeqBySession,[e]:o.asOfSeq},wk[e]=o.epoch,o1.delete(e),Vp.delete(e),ft.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={..._e.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],_e.turnActiveBySession=a}return YT(),Mi&&(Mi.seedSnapshot(e,o),Mi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),gke(e)),i1.delete(e),l&&Zf(e),hke(e),"ok"}catch(n){return nke(n)?(await fke(e),"not-found"):(Xf("getSessionSnapshot",n,{title:Rn.global.t("warnings.sessionSnapshotTitle"),message:Rn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const s1=mge(Lb);function pke(e){return Object.prototype.hasOwnProperty.call(_e.messagesBySession,e)}const mke=4,Or=[],i1=new Set;function gke(e){const t=Or.indexOf(e);for(t!==-1&&Or.splice(t,1),Or.unshift(e);Or.length>mke;){let n=-1;for(let s=Or.length-1;s>=0;s--)if(Or[s]!==_e.activeSessionId){n=s;break}if(n===-1)break;const[o]=Or.splice(n,1);if(o===void 0)break;Mi?.unsubscribe(o),i1.add(o)}}function vke(e){const t=Or.indexOf(e);t!==-1&&Or.splice(t,1),i1.delete(e)}async function yke(e){return Lb(e)}function $b(e,t){return(_e.inFlightBySession[e]??!1)||(_e.turnActiveBySession[e]??!1)||(t??_e.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function Fb(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return Rn.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const kke=3e4,Nf=oe(0);let zv=null;function bke(){zv===null&&(zv=setInterval(()=>{Nf.value=(Nf.value+1)%Number.MAX_SAFE_INTEGER},kke),zv.unref?.())}function xke(e,t){const n=e.split(`
340
- `),o=t.split(`
341
- `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function wke(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:xke(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{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"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function _ke(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 Ske(e){const t=_e.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.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 o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function Cke(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=Rn.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=Rn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??Ske(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const Ake=D(()=>{const e=_e.sessions.find(n=>n.id===_e.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:_e.workspaceName,branch:t}}),Mke=D(()=>(Nf.value,_e.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Fb(e.updatedAt),busy:$b(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),Eke=D(()=>_e.activeSessionId??""),Tke=D(()=>{const e=_e.activeSessionId;if(e)return Un.skillsBySession.value[e]??[];const t=u0.value;return t?Un.skillsByWorkspace.value[t]??[]:[]}),Ob=D(()=>{const e=_e.activeSessionId;return e?_e.inFlightBySession[e]??!1:!1}),Nke=D(()=>ft.isStartingFirstPrompt()),ps=pye(_e,{pushOperationFailure:Xf,nextOptimisticMsgId:GT,connectEventsIfNeeded:YT,getEventConn:()=>Mi,resolveThinkingForPrompt:(e,t)=>Un.resolveThinkingForPrompt(e,t)}),Qf=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=ps.sideChatTargetBySession.value[e]?.agentId;return(_e.tasksBySession[e]??[]).filter(n=>n.id!==t)}),QT=uve(_e,Qf),Ike=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=new Set(_e.sideChatUserMessageIdsBySession[e]??[]),n=(_e.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=_e.approvalsBySession[e]??[];return _T(n,o,s=>ht().getFileUrl(s),c0.value,_e.planReviewByToolCallId)}),c0=D(()=>{const e=_e.activeSessionId;return e?(_e.turnActiveBySession[e]??!1)||(_e.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),Lke=D(()=>Ob.value||c0.value),$ke=D(()=>(QT.taskClock.value,Qf.value.map(Cke))),JT=D(()=>Lye(Qf.value)),Fke=D(()=>Fye(Qf.value)),Wc=D(()=>{const e=_e.activeSessionId;return e?_e.goalBySession[e]??null:null}),Oke=D(()=>{const e=_e.activeSessionId;return e?Tye(_e.messagesBySession[e]??[]):[]}),Bke=D(()=>{const e=_e.activeSessionId;return e?_e.compactionBySession[e]??null:null}),Rke=D(()=>_e.connection),Dke=D(()=>_e.loading),Pke=D(()=>_e.sessionLoading),Hke=D(()=>{const e=_e.activeSessionId;return e?_e.messagesLoadingMoreBySession[e]??!1:!1}),Wke=D(()=>{const e=_e.activeSessionId;return e?_e.messagesHasMoreBySession[e]??!1:!1}),zke=D(()=>{const e=_e.activeSessionId;return e?_e.messagesLoadMoreErrorBySession[e]??!1:!1}),Uke=D(()=>_e.serverVersion),qke=D(()=>_e.backend),jke=D(()=>_e.dangerousBypassAuth);function Vke(){_e.dangerousBypassAuth=!1}const Kke=D(()=>_e.permission),Gke=D(()=>_e.thinking),eN=D(()=>{const e=_e.activeSessionId;return e?_e.planModeBySession[e]??!1:l0.planMode}),Yke=D(()=>{const e=_e.activeSessionId;return e?_e.swarmModeBySession[e]??!1:l0.swarmMode}),Zke=D(()=>{const e=_e.activeSessionId;return e?_e.goalModeBySession[e]??!1:l0.goalMode}),Xke=D(()=>{const e=$ye(JT.value);return{plan:eN.value,goal:Wc.value&&Wc.value.status!=="complete"?{status:Wc.value.status,turnsUsed:Wc.value.turnsUsed,elapsedMs:Wc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Qke=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=ht();return(_e.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),Jke=D(()=>_e.warnings),e2e=D(()=>{const e=_e.activeSessionId;return e?(_e.questionsBySession[e]??[]).map(_ke):[]}),t2e=D(()=>{const e=_e.activeSessionId;return e?(_e.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:wke(t),agentName:t.agentName})):[]}),Bb=D(()=>{const e=_e.activeSessionId;return e?(_e.approvalsBySession[e]??[]).length>0?"awaiting-approval":(_e.questionsBySession[e]??[]).length>0?"awaiting-question":Ob.value||c0.value?"running":"idle":"idle"}),Un=Ive(_e,{pushOperationFailure:Xf,refreshSessionStatus:Zf,persistSessionProfile:qT,activity:Bb,updateSession:a0,updateSessionMessages:RT}),_k=D(()=>{const e=_e.activeSessionId;if(!e)return null;const t=_e.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),n2e=D(()=>{const e=_e.activeSessionId;return e?_e.gitStatusBySession[e]?.pullRequest??null:null}),o2e=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=_e.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),s2e=D(()=>{const e=_e.activeSessionId;if(!e)return null;const t=_e.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),tN=D(()=>{const e=_e.sessions.find(r=>r.id===_e.activeSessionId),t=_k.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Un.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??_e.defaultModel)??"—",s=Un.models.value.find(r=>r.id===o)??Un.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:_e.permission,branch:t,cwd:e?.cwd??"",isGitRepo:_k.value!==null}}),i2e=D(()=>HT.value),r2e=D(()=>_e.sessions.find(t=>t.id===_e.activeSessionId)?.usage.totalCostUsd??0),l2e=D(()=>_e.authReady),a2e=D(()=>_e.defaultModel),c2e=D(()=>_e.managedProviderStatus),u2e=D(()=>_e.config),d2e=D(()=>{const e=_e.activeSessionId;if(!e)return{};const t=_e.gitStatusBySession[e];return t?{...t.entries}:{}});function wu(e){const t=zi(e.cwd);return _e.workspaces.find(n=>zi(n.root)===t)?.id??e.workspaceId??e.cwd}const Rb=D(()=>fge({workspaces:_e.workspaces,sessions:_e.sessions,hiddenWorkspaceRoots:_e.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:_e.sessionsHasMoreByWorkspace})),r1=oe(mF()),_u=oe(gF()==="manual"?"manual":"recent");et(()=>[Rb.value.map(e=>e.id).join("\0"),_e.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=IF(n,r1.value);o!==null&&(r1.value=o,g6(o))});const Xa=D(()=>{const e=Rb.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Wye(t.root,_e.fsHome),sessionCount:t.sessionCount}));if(_u.value==="recent"){const t=new Map;for(const n of _e.sessions){if(n.parentSessionId)continue;const o=wu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return FF(e,t)}return LF(e,r1.value)}),u0=D(()=>{const e=_e.activeWorkspaceId,t=Xa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});et(u0,e=>{e&&(Object.prototype.hasOwnProperty.call(Un.skillsByWorkspace.value,e)||Un.loadSkillsForWorkspace(e))},{immediate:!0});const f2e=D(()=>{const e=u0.value;return e?Xa.value.find(t=>t.id===e)??null:null}),h2e=D(()=>{Nf.value;const e=new Set(Xa.value.map(n=>n.id)),t=new Map(Xa.value.map(n=>[n.id,n.name]));return _e.sessions.filter(n=>!n.parentSessionId&&e.has(wu(n))).map(n=>{const o=wu(n);return{id:n.id,title:n.title,time:Fb(n.updatedAt),busy:$b(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),p2e=D(()=>{Nf.value;const e=new Map;for(const t of _e.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=wu(t),o={id:t.id,title:t.title,time:Fb(t.updatedAt),busy:$b(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Xa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:_e.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:_e.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:_e.sessionsInitialCountByWorkspace[t.id]??yk}))});function m2e(e){r1.value=e,g6(e),_u.value!=="manual"&&(_u.value="manual",v6("manual"))}function g2e(e){_u.value!==e&&(_u.value=e,v6(e))}const nN=D(()=>{const e={};for(const[t,n]of Object.entries(_e.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(_e.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),v2e=D(()=>{const e={};for(const[t,n]of Object.entries(_e.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(_e.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),y2e=D(()=>{const e={};for(const[t,n]of Object.entries(_e.unreadBySession))n&&(e[t]=!0);return e}),k2e=D(()=>{const e={},t=nN.value;for(const n of _e.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=wu(n);e[s]=(e[s]??0)+o}return e}),b2e=D(()=>_e.recentRoots),x2e=D(()=>_e.availableOpenInApps),ft=Eve(_e,{taskPoller:QT,sideChat:ps,modelProvider:Un,pushOperationFailure:Xf,activity:Bb,sessionsKnownEmpty:ZT,setSessions:OT,updateSession:a0,upsertSessionFront:zye,appendSession:Uye,forgetSession:DT,setActiveSessionId:Nb,updateSessionMessages:RT,nextOptimisticMsgId:GT,getEventConn:()=>Mi,syncSessionFromSnapshot:Lb,reopenSession:yke,hasLoadedMessages:pke,refreshSessionStatus:Zf,refreshSessionGoal:Gye,persistSessionProfile:qT,mergedWorkspaces:Rb,workspacesView:Xa,status:tN,workspaceIdForSession:wu,savePermissionToStorage:Bye,savePlanModeToStorage:IT,saveSwarmModeToStorage:LT,saveGoalModeToStorage:$T,draftModes:l0,saveUnread:o2,saveActiveWorkspaceToStorage:Hye,saveHiddenWorkspacesToStorage:Pye,goalErrorMessage:dke,resetFastMoon:Fr.resetFastMoon,initialized:zT,connectIssue:UT,selectedDiffPath:PT,fileDiffLines:HT,fileDiffLoading:WT});function Db(e){return e===_e.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function w2e(e){if(_e.turnActiveBySession[e]){const t={..._e.turnActiveBySession};delete t[e],_e.turnActiveBySession=t}_e.inFlightBySession[e]&&(_e.inFlightBySession={..._e.inFlightBySession,[e]:!1})}function _2e(e,t,n){const o=_e.promptIdBySession[e];ft.finishPromptLocal(e,{turnWasActive:n}),e===_e.activeSessionId?(ft.loadGitStatus(e),Zf(e)):t==="idle"&&(_e.unreadBySession={..._e.unreadBySession,[e]:!0},o2({[e]:!0}));const s=(_e.approvalsBySession[e]??[]).length>0,i=(_e.questionsBySession[e]??[]).length>0;zge(t,s,i)&&lr.maybeNotifyCompletion(e,{isUserWatching:Db(e),sessionTitle:_e.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ft.selectSession(e)}}),t==="idle"&&Tf.maybePlayCompletionSound()}function S2e(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;lr.maybeNotifyQuestion({isUserWatching:Db(e),sessionTitle:_e.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ft.selectSession(e)}}),Tf.maybePlayQuestionSound()}function C2e(e,t){lr.maybeNotifyApproval({isUserWatching:Db(e),sessionTitle:_e.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ft.selectSession(e)}}),Tf.maybePlayApprovalSound()}function Pb(){return bke(),{workspace:Ake,sessions:Mke,activeSessionId:Eke,workspacesView:Xa,workspaceSortMode:_u,visibleWorkspace:f2e,activeWorkspaceId:u0,sessionsForView:h2e,workspaceGroups:p2e,attentionBySession:nN,pendingBySession:v2e,attentionByWorkspace:k2e,unreadBySession:y2e,recentRoots:b2e,turns:Ike,tasks:$ke,activeAppTasks:Qf,todos:Oke,goal:Wc,swarms:JT,swarmMembersByToolCallId:Fke,activationBadges:Xke,compaction:Bke,status:tN,sessionCost:r2e,fileDiff:i2e,selectedDiffPath:PT,fileDiffLoading:WT,changes:o2e,gitInfo:_k,gitDiffStats:s2e,activePullRequest:n2e,changesByPath:d2e,pendingApprovals:t2e,availableOpenInApps:x2e,connection:Rke,loading:Dke,sessionLoading:Pke,loadingMoreMessages:Hke,hasMoreMessages:Wke,loadMoreMessagesError:zke,serverVersion:Uke,backend:qke,dangerousBypassAuth:jke,clearDangerousBypassAuth:Vke,initialized:zT,connectIssue:UT,permission:Kke,thinking:Gke,planMode:eN,swarmMode:Yke,goalMode:Zke,queued:Qke,warnings:Jke,questions:e2e,activity:Bb,turnActive:c0,inFlight:Ob,working:Lke,isStartingFirstPrompt:Nke,fastMoon:Fr.fastMoon,models:Un.models,starredModelIds:Un.starredModelIds,providers:Un.providers,uiFontSize:Fr.uiFontSize,setUiFontSize:Fr.setUiFontSize,conversationToc:VT,setConversationToc:Xye,colorScheme:Fr.colorScheme,setColorScheme:Fr.setColorScheme,accent:Fr.accent,setAccent:Fr.setAccent,notifyOnComplete:lr.notifyOnComplete,notifyOnQuestion:lr.notifyOnQuestion,notifyOnApproval:lr.notifyOnApproval,notifyPermission:lr.notifyPermission,setNotifyOnComplete:lr.setNotifyOnComplete,setNotifyOnQuestion:lr.setNotifyOnQuestion,setNotifyOnApproval:lr.setNotifyOnApproval,soundOnComplete:Tf.soundOnComplete,setSoundOnComplete:Tf.setSoundOnComplete,onboarded:KT,setOnboarded:Jye,load:ft.load,selectSession:ft.selectSession,clearActiveSession:ft.clearActiveSession,loadOlderMessages:ft.loadOlderMessages,loadWorkspaces:ft.loadWorkspaces,loadMoreSessions:ft.loadMoreSessions,loadAllSessions:ft.loadAllSessions,selectWorkspace:ft.selectWorkspace,openWorkspace:ft.openWorkspace,openWorkspaceDraft:ft.openWorkspaceDraft,startSessionAndSendPrompt:ft.startSessionAndSendPrompt,startSessionAndActivateSkill:ft.startSessionAndActivateSkill,startSessionAndOpenSideChat:ft.startSessionAndOpenSideChat,addWorkspaceByPath:ft.addWorkspaceByPath,browseFs:ft.browseFs,getFsHome:ft.getFsHome,sendPrompt:ft.sendPrompt,steerPrompt:ft.steerPrompt,sideChatVisible:ps.sideChatVisible,sideChatSessionId:ps.sideChatSessionId,sideChatTurns:ps.sideChatTurns,sideChatRunning:ps.sideChatRunning,sideChatSending:ps.sideChatSending,openSideChat:ps.openSideChat,closeSideChat:ps.closeSideChat,sendSideChatPrompt:ps.sendSideChatPrompt,uploadImage:ft.uploadImage,abortCurrentPrompt:ft.abortCurrentPrompt,respondApproval:ft.respondApproval,respondQuestion:ft.respondQuestion,dismissQuestion:ft.dismissQuestion,pendingQuestionActions:ft.pendingQuestionActions,pendingApprovalActions:ft.pendingApprovalActions,cancelTask:ft.cancelTask,setPermission:ft.setPermission,setThinking:Un.setThinking,setPlanMode:ft.setPlanMode,togglePlanMode:ft.togglePlanMode,setSwarmMode:ft.setSwarmMode,toggleSwarmMode:ft.toggleSwarmMode,setGoalMode:ft.setGoalMode,toggleGoalMode:ft.toggleGoalMode,createGoal:ft.createGoal,controlGoal:ft.controlGoal,enqueue:ft.enqueue,dismissWarning:ft.dismissWarning,renameSession:ft.renameSession,renameWorkspace:ft.renameWorkspace,deleteWorkspace:ft.deleteWorkspace,reorderWorkspaces:m2e,setWorkspaceSortMode:g2e,archiveSession:ft.archiveSession,exportSession:ft.exportSession,restoreSession:ft.restoreSession,loadArchivedSessions:ft.loadArchivedSessions,compact:ft.compact,forkSession:ft.forkSession,undo:ft.undo,unqueue:ft.unqueue,reorderQueue:ft.reorderQueue,searchFiles:ft.searchFiles,loadGitStatus:ft.loadGitStatus,loadFileDiff:ft.loadFileDiff,clearFileDiff:ft.clearFileDiff,listDir:ft.listDir,readFileContent:ft.readFileContent,getFileDownloadUrl:ft.getFileDownloadUrl,openWorkspaceFile:ft.openWorkspaceFile,openInApp:ft.openInApp,revealWorkspaceFile:ft.revealWorkspaceFile,resolveImageUrl:ft.resolveImageUrl,loadModels:Un.loadModels,loadProviders:Un.loadProviders,skills:Tke,activateSkill:Un.activateSkill,setModel:Un.setModel,toggleStarModel:Un.toggleStarModel,addProvider:Un.addProvider,deleteProvider:Un.deleteProvider,refreshProvider:Un.refreshProvider,refreshAllProviders:Un.refreshAllProviders,authReady:l2e,defaultModel:a2e,managedProviderStatus:c2e,config:u2e,updateConfig:ft.updateConfig,checkAuth:ft.checkAuth,startOAuthLogin:Un.startOAuthLogin,pollOAuthLogin:Un.pollOAuthLogin,cancelOAuthLogin:Un.cancelOAuthLogin,logout:ft.logout}}const oN=Je({__name:"LanguageSwitcher",setup(e){const{locale:t}=$t(),n=b6.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&x6(s)}return(s,i)=>(x(),Se(ys,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),A2e=["aria-checked","aria-label","disabled"],M2e=Je({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),E("button",{class:Ue(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,A2e))}}),Mr=dt(M2e,[["__scopeId","data-v-dbe22dc4"]]),E2e=["aria-label"],T2e=["aria-selected","onClick"],N2e={class:"body"},I2e={class:"panel"},L2e={class:"sec"},$2e={class:"sec-title"},F2e={class:"row"},O2e={class:"rlabel"},B2e={class:"row"},R2e={class:"rlabel"},D2e={class:"row"},P2e={class:"rlabel"},H2e={class:"num-field"},W2e=["value","aria-label"],z2e={class:"row"},U2e={class:"rlabel"},q2e={class:"row"},j2e={class:"rlabel"},V2e={class:"hint"},K2e={class:"sec"},G2e={class:"sec-title"},Y2e={class:"row"},Z2e={class:"rlabel"},X2e={key:0,class:"hint"},Q2e={class:"row"},J2e={class:"rlabel"},ebe={key:0,class:"hint"},tbe={class:"row"},nbe={class:"rlabel"},obe={key:0,class:"hint"},sbe={class:"row"},ibe={class:"rlabel"},rbe={class:"panel"},lbe={class:"sec"},abe={class:"sec-title"},cbe={class:"row"},ube={class:"rlabel"},dbe={key:0,class:"rvalue"},fbe={class:"actions"},hbe={class:"panel"},pbe={class:"sec"},mbe={class:"sec-head"},gbe={class:"sec-title"},vbe={key:0,class:"saving"},ybe={class:"row"},kbe={class:"rlabel"},bbe={class:"hint"},xbe={key:0,class:"select-wrap"},wbe={key:0,value:"",disabled:""},_be=["label"],Sbe=["value"],Cbe={key:1,class:"rvalue mono"},Abe={class:"row"},Mbe={class:"rlabel"},Ebe={class:"hint"},Tbe={class:"row"},Nbe={class:"rlabel"},Ibe={class:"hint"},Lbe={class:"row"},$be={class:"rlabel"},Fbe={class:"hint"},Obe={class:"row"},Bbe={class:"rlabel"},Rbe={class:"hint"},Dbe={key:1,class:"empty-config"},Pbe={class:"panel"},Hbe={class:"sec"},Wbe={class:"sec-title"},zbe={class:"row"},Ube={class:"rlabel"},qbe={class:"rvalue mono"},jbe={class:"row"},Vbe={class:"rlabel"},Kbe={class:"rvalue mono"},Gbe={class:"row"},Ybe={class:"rlabel"},Zbe={class:"rvalue mono"},Xbe={key:0,class:"row"},Qbe={class:"rlabel"},Jbe={class:"hint"},exe={class:"hint"},txe={class:"row"},nxe={class:"rlabel"},oxe={key:0,class:"hint"},sxe={class:"panel"},ixe={class:"panel-head"},rxe={class:"panel-title"},lxe={class:"panel-desc"},axe={class:"archive-toolbar"},cxe={class:"archive-search"},uxe=["placeholder"],dxe={value:"all"},fxe=["value"],hxe={key:0,class:"archive-empty"},pxe={key:0,class:"archive-list"},mxe={class:"archive-workspace"},gxe={class:"path"},vxe={class:"count"},yxe={class:"setting-card"},kxe={class:"archive-meta"},bxe={class:"archive-name"},xxe={class:"archive-time"},wxe={key:1,class:"archive-empty"},_xe=100,Sxe=Je({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=_F(),a=D(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","yolo","auto"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=oe(null);mb(d);function f(ne){ne.key==="Escape"&&s("close")}An(()=>document.addEventListener("keydown",f)),On(()=>document.removeEventListener("keydown",f));function h(){zE()}const p=D(()=>{const ne=new Map;for(const j of o.models??[])ne.set(j.id,{id:j.id,label:j.displayName??j.model??j.id,provider:j.provider});for(const[j,K]of Object.entries(o.config?.models??{})){if(ne.has(j))continue;const ve=k(K);ne.set(j,{id:j,label:g(j,K,ve),provider:ve??j})}return Array.from(ne.values())}),m=D(()=>{const ne=new Map;for(const j of p.value){const K=ne.get(j.provider)??[];K.push(j),ne.set(j.provider,K)}for(const j of ne.values())j.sort((K,ve)=>K.label.localeCompare(ve.label));return Array.from(ne.entries()).toSorted(([j],[K])=>j.localeCompare(K)).map(([j,K])=>({provider:j,options:K}))}),y=D(()=>{const ne=o.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function k(ne){if(!ne||typeof ne!="object")return;const j=ne;return typeof j.provider=="string"?j.provider:void 0}function g(ne,j,K){if(!j||typeof j!="object")return ne;const ve=j,he=typeof ve.model=="string"?ve.model:void 0,Ae=K??k(j);return he&&Ae?`${ne} (${Ae}/${he})`:he?`${ne} (${he})`:ne}function v(ne){return ne===!0}function b(ne){!ne||ne===o.config?.defaultModel||s("updateConfig",{defaultModel:ne})}function A(ne){ne!==y.value&&s("updateConfig",{defaultPermissionMode:ne})}function I(ne){const j=o.config?.[ne];s("updateConfig",{[ne]:!v(j)})}function N(){const ne=o.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function M(){s("updateConfig",{thinking:{enabled:!N()}})}function $(){const ne=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ne})}function T(ne){i.value=ne}const F=Pb(),S=oe([]),B=oe(!1),W=oe(!1),z=oe(""),L=oe("all"),O=oe("archived-desc");async function U(){if(!(B.value||W.value)){B.value=!0;try{const ne=[];let j;for(;;){const K=await F.loadArchivedSessions({beforeId:j,pageSize:_xe});if(ne.push(...K.items),!K.hasMore||K.items.length===0)break;const ve=K.items.at(-1)?.id;if(ve===void 0)break;j=ve}S.value=ne,W.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{B.value=!1}}}et(i,ne=>{ne==="archived"&&!W.value&&U()});const Z=D(()=>{const ne=new Set;for(const j of S.value)ne.add(j.cwd);return Array.from(ne).sort((j,K)=>j.localeCompare(K))}),ie=D(()=>{const ne=z.value.trim().toLowerCase();let j=S.value.filter(K=>K.archived===!0);return L.value!=="all"&&(j=j.filter(K=>K.cwd===L.value)),ne&&(j=j.filter(K=>K.title.toLowerCase().includes(ne))),j=j.slice(),O.value==="archived-desc"?j.sort((K,ve)=>ve.updatedAt.localeCompare(K.updatedAt)):O.value==="created-desc"?j.sort((K,ve)=>ve.createdAt.localeCompare(K.createdAt)):j.sort((K,ve)=>K.title.localeCompare(ve.title,"zh")),j}),q=D(()=>{const ne=new Map;for(const j of ie.value){const K=ne.get(j.cwd)??[];K.push(j),ne.set(j.cwd,K)}return Array.from(ne.entries()).map(([j,K])=>({cwd:j,items:K}))});async function ee(ne){await F.restoreSession(ne)&&(S.value=S.value.filter(K=>K.id!==ne))}function fe(ne){const j=new Date(ne);if(Number.isNaN(j.getTime()))return ne;const K=ve=>String(ve).padStart(2,"0");return`${j.getFullYear()}-${K(j.getMonth()+1)}-${K(j.getDate())} ${K(j.getHours())}:${K(j.getMinutes())}`}return(ne,j)=>(x(),Se(Qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:j[19]||(j[19]=K=>s("close"))},{default:Ie(()=>[w("div",{ref_key:"dialogRef",ref:d,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),E(We,null,rt(r,K=>w("button",{key:K.id,type:"button",class:Ue(["tab",{on:i.value===K.id}]),role:"tab","aria-selected":i.value===K.id,onClick:ve=>T(K.id)},R(C(n)(K.labelKey)),11,T2e)),64))],8,E2e),w("div",N2e,[qn(w("section",I2e,[w("section",L2e,[w("h3",$2e,R(C(n)("settings.appearance")),1),w("div",F2e,[w("span",O2e,R(C(n)("theme.colorSchemeLabel")),1),ae(ys,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":j[0]||(j[0]=K=>s("setColorScheme",K))},null,8,["model-value","options"])]),w("div",B2e,[w("span",R2e,R(C(n)("theme.accentLabel")),1),ae(ys,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":j[1]||(j[1]=K=>s("setAccent",K))},null,8,["model-value","options"])]),w("div",D2e,[w("span",P2e,R(C(n)("settings.uiFontSize")),1),w("label",H2e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:j[2]||(j[2]=K=>s("setUiFontSize",Number(K.target.value)))},null,40,W2e),j[20]||(j[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",z2e,[w("span",U2e,R(C(n)("sidebar.language")),1),ae(oN)]),w("div",q2e,[w("span",j2e,[ot(R(C(n)("settings.conversationToc"))+" ",1),w("span",V2e,R(C(n)("settings.conversationTocHint")),1)]),ae(Mr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":j[3]||(j[3]=K=>s("setConversationToc",K))},null,8,["model-value","label"])])]),w("section",K2e,[w("h3",G2e,R(C(n)("settings.notifications")),1),w("div",Y2e,[w("span",Z2e,[ot(R(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",X2e,R(C(n)("settings.notifyDenied")),1)):ue("",!0)]),ae(Mr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":j[4]||(j[4]=K=>s("setNotify",K))},null,8,["model-value","disabled","label"])]),w("div",Q2e,[w("span",J2e,[ot(R(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",ebe,R(C(n)("settings.notifyDenied")),1)):ue("",!0)]),ae(Mr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":j[5]||(j[5]=K=>s("setNotifyQuestion",K))},null,8,["model-value","disabled","label"])]),w("div",tbe,[w("span",nbe,[ot(R(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",obe,R(C(n)("settings.notifyDenied")),1)):ue("",!0)]),ae(Mr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":j[6]||(j[6]=K=>s("setNotifyApproval",K))},null,8,["model-value","disabled","label"])]),w("div",sbe,[w("span",ibe,R(C(n)("settings.soundOnComplete")),1),ae(Mr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":j[7]||(j[7]=K=>s("setSound",K))},null,8,["model-value","label"])])])],512),[[xi,i.value==="general"]]),qn(w("section",rbe,[w("section",lbe,[w("h3",abe,R(C(n)("settings.account")),1),w("div",cbe,[w("span",ube,R(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ae(an,{text:e.accountModel},{default:Ie(()=>[e.authReady&&e.accountModel?(x(),E("span",dbe,R(e.accountModel),1)):ue("",!0)]),_:1},8,["text"])]),w("div",fbe,[ae(jt,{variant:"secondary",size:"sm",onClick:j[8]||(j[8]=K=>{s("openOnboarding"),s("close")})},{default:Ie(()=>[ot(R(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),Se(jt,{key:0,variant:"danger-soft",size:"sm",onClick:j[9]||(j[9]=K=>s("logout"))},{default:Ie(()=>[ot(R(C(n)("sidebar.signOut")),1)]),_:1})):(x(),Se(jt,{key:1,variant:"primary",size:"sm",onClick:j[10]||(j[10]=K=>s("login"))},{default:Ie(()=>[ot(R(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[xi,i.value==="account"]]),qn(w("section",hbe,[w("section",pbe,[w("div",mbe,[w("h3",gbe,R(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),E("span",vbe,R(C(n)("settings.saving")),1)):ue("",!0)]),e.config?(x(),E(We,{key:0},[w("div",ybe,[w("span",kbe,[ot(R(C(n)("settings.defaultModel"))+" ",1),w("span",bbe,R(C(n)("settings.defaultModelHint")),1)]),m.value.length>0?(x(),E("div",xbe,[ae(pk,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":b},{default:Ie(()=>[e.config.defaultModel?ue("",!0):(x(),E("option",wbe,R(C(n)("settings.noDefaultModel")),1)),(x(!0),E(We,null,rt(m.value,K=>(x(),E("optgroup",{key:K.provider,label:K.provider},[(x(!0),E(We,null,rt(K.options,ve=>(x(),E("option",{key:ve.id,value:ve.id},R(ve.label),9,Sbe))),128))],8,_be))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),E("span",Cbe,R(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",Abe,[w("span",Mbe,[ot(R(C(n)("settings.defaultPermission"))+" ",1),w("span",Ebe,R(C(n)("settings.defaultPermissionHint")),1)]),ae(ys,{"model-value":y.value,options:c.map(K=>({value:K,label:C(n)(u[K])})),"onUpdate:modelValue":j[11]||(j[11]=K=>A(K))},null,8,["model-value","options"])]),w("div",Tbe,[w("span",Nbe,[ot(R(C(n)("settings.defaultThinking"))+" ",1),w("span",Ibe,R(C(n)("settings.defaultThinkingHint")),1)]),ae(Mr,{"model-value":N(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":j[12]||(j[12]=K=>M())},null,8,["model-value","disabled","label"])]),w("div",Lbe,[w("span",$be,[ot(R(C(n)("settings.defaultPlanMode"))+" ",1),w("span",Fbe,R(C(n)("settings.defaultPlanModeHint")),1)]),ae(Mr,{"model-value":v(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":j[13]||(j[13]=K=>I("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",Obe,[w("span",Bbe,[ot(R(C(n)("settings.mergeSkills"))+" ",1),w("span",Rbe,R(C(n)("settings.mergeSkillsHint")),1)]),ae(Mr,{"model-value":v(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":j[14]||(j[14]=K=>I("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),E("div",Dbe,R(C(n)("settings.configUnavailable")),1))])],512),[[xi,i.value==="agent"]]),qn(w("section",Pbe,[w("section",Hbe,[w("h3",Wbe,R(C(n)("settings.advanced")),1),w("div",zbe,[w("span",Ube,R(C(n)("sidebar.daemon")),1),w("span",qbe,R(C(l)),1)]),w("div",jbe,[w("span",Vbe,R(C(n)("settings.backend")),1),w("span",Kbe,R(a.value),1)]),w("div",Gbe,[w("span",Ybe,R(C(n)("settings.serverVersion")),1),w("span",Zbe,R(e.serverVersion||"-"),1)]),e.config?(x(),E("div",Xbe,[w("span",Qbe,[ot(R(C(n)("settings.telemetry"))+" ",1),w("span",Jbe,R(C(n)("settings.telemetryHint")),1),w("span",exe,R(C(n)("settings.telemetryRestartHint")),1)]),ae(Mr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":j[15]||(j[15]=K=>$())},null,8,["model-value","disabled","label"])])):ue("",!0),w("div",txe,[w("span",nxe,[ot(R(C(n)("settings.exportLog"))+" ",1),C(Yi)()?ue("",!0):(x(),E("span",oxe,R(C(n)("settings.logHint")),1))]),ae(jt,{variant:"secondary",size:"sm",onClick:h},{default:Ie(()=>[ot(R(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[xi,i.value==="advanced"]]),qn(w("section",sxe,[w("div",ixe,[j[21]||(j[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",rxe,R(C(n)("settings.archivedTitle")),1),w("p",lxe,R(C(n)("settings.archivedDesc")),1)]),w("div",axe,[w("label",cxe,[j[22]||(j[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),qn(w("input",{"onUpdate:modelValue":j[16]||(j[16]=K=>z.value=K),placeholder:C(n)("settings.archivedSearch")},null,8,uxe),[[Cs,z.value]])]),ae(pk,{"model-value":L.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":j[17]||(j[17]=K=>L.value=K)},{default:Ie(()=>[w("option",dxe,R(C(n)("settings.archivedAllWorkspaces")),1),(x(!0),E(We,null,rt(Z.value,K=>(x(),E("option",{key:K,value:K},R(K),9,fxe))),128))]),_:1},8,["model-value","aria-label"]),ae(ys,{size:"sm","model-value":O.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":j[18]||(j[18]=K=>O.value=K)},null,8,["model-value","options"])]),B.value?(x(),E("div",hxe,R(C(n)("settings.archivedLoadingAll")),1)):(x(),E(We,{key:1},[q.value.length>0?(x(),E("div",pxe,[(x(!0),E(We,null,rt(q.value,K=>(x(),E("section",{key:K.cwd,class:"archive-card"},[w("div",mxe,[j[23]||(j[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",gxe,R(K.cwd),1),w("span",vxe,R(C(n)("settings.archivedSessionsCount",{count:K.items.length})),1)]),w("div",yxe,[(x(!0),E(We,null,rt(K.items,ve=>(x(),E("div",{key:ve.id,class:"archive-row"},[w("div",kxe,[w("div",bxe,R(ve.title),1),w("div",xxe,R(C(n)("settings.archivedAt",{time:fe(ve.updatedAt)})),1)]),ae(jt,{variant:"secondary",size:"sm",onClick:he=>ee(ve.id)},{default:Ie(()=>[ot(R(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),E("div",wxe,R(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[xi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Cxe=dt(Sxe,[["__scopeId","data-v-1b1b3473"]]),Axe=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,sN=/^[A-Za-z]:[\\/]/,Mxe=/^\/\/(?!\/)/;function Uv(e){return Axe.test(e.trim())}function Exe(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function Txe(e){return Mxe.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function Nxe(e){return sN.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function Ixe(e){return sN.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function Sk(e,t){let n=Txe(Exe(e.trim(),t));const o=Nxe(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=Ixe(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Lxe(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function $xe(e,t,n){if(n===null)return null;const{target:o}=Sk(e,t);return o===n?n:null}const Fxe={class:"aw"},Oxe={key:0,class:"crumbbar"},Bxe={class:"crumbs"},Rxe={key:0,class:"crumb-sep"},Dxe=["onClick"],Pxe=["placeholder"],Hxe={key:2,class:"folder-list"},Wxe={key:0,class:"fl-loading"},zxe={key:0,class:"fl-loading"},Uxe={key:0,class:"fl-note"},qxe=["onClick"],jxe={class:"folder-name"},Vxe={key:1,class:"fl-empty fl-error"},Kxe={key:2,class:"fl-empty fl-error"},Gxe=["onClick"],Yxe={class:"folder-name search-rel"},Zxe={key:0,class:"fl-empty"},Xxe={key:1,class:"fl-loading"},Qxe=["onClick"],Jxe={class:"folder-name"},ewe={key:0,class:"fl-empty"},twe={key:3,class:"degraded-hint"},nwe={key:4,class:"add-error",role:"alert"},owe={class:"actions"},swe={class:"footer-hint"},iwe=600,rwe=6,sA=150,lwe=Je({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe(!0),r=oe(!1),l=oe(!1),a=oe(""),c=oe(null),u=oe([]),d=oe(""),f=oe(!1),h=oe([]),p=D(()=>d.value.trim().length>0);let m=0,y=null;const k=D(()=>Uv(d.value)),g=oe("idle"),v=oe(""),b=oe("/"),A=oe([]),I=oe(""),N=oe(null),M=oe(null),$=D(()=>g.value!=="valid"?null:$xe(d.value,I.value,M.value));let T=0,F=null;function S(j,K){const ve=j.toLowerCase(),he=K.toLowerCase();let Ae=0;for(let re=0;re<he.length&&Ae<ve.length;re++)he[re]===ve[Ae]&&Ae++;return Ae===ve.length}async function B(j){const K=a.value,ve=j.trim();if(!K||ve===""){h.value=[],f.value=!1;return}const he=++m;f.value=!0;const Ae=[],re=[{path:K,depth:0}];let Y=0;for(;re.length>0&&Y<iwe&&Ae.length<sA;){if(he!==m)return;const Q=re.shift();Y++;let P;try{P=await o.browseFs(Q.path)}catch{continue}if(he!==m)return;for(const G of P.entries){if(!G.isDir)continue;const me=G.path.startsWith(K)?G.path.slice(K.length).replace(/^\/+/,""):G.path;if(S(ve,me||G.name)&&(Ae.push({path:G.path,name:G.name,rel:me||G.name}),Ae.length>=sA))break;Q.depth+1<rwe&&re.push({path:G.path,depth:Q.depth+1})}he===m&&(h.value=[...Ae])}he===m&&(f.value=!1)}et(d,j=>{y&&clearTimeout(y),F&&clearTimeout(F),T++,g.value="idle",A.value=[],M.value=null;const K=j.trim();if(K===""){m++,h.value=[],f.value=!1;return}if(Uv(K)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void W(K),150);return}y=setTimeout(()=>void B(j),220)});async function W(j){const K=++T;g.value="checking",M.value=null;const ve=Sk(j,I.value),{target:he}=ve;try{const re=await o.browseFs(he);if(K!==T)return;if(re.path){g.value="valid",A.value=[],M.value=he,a.value=re.path,c.value=re.parent,u.value=re.entries,l.value=!1;return}}catch{}if(K!==T)return;const Ae=ve.base.toLowerCase();v.value=ve.parent,b.value=ve.separator;try{const re=await o.browseFs(ve.parent);if(K!==T)return;if(re.path){A.value=re.entries.filter(Y=>Y.isDir&&Y.name.toLowerCase().startsWith(Ae)),g.value="not-found";return}}catch{}K===T&&(A.value=[],g.value="bad-parent")}function z(j){d.value=Lxe(v.value,j,b.value),N.value?.focus()}const L=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),O=D(()=>l.value?n("workspace.degradedHint"):k.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function U(j){if(j.key==="Escape"){d.value?d.value="":s("close");return}if(j.key!=="Enter")return;const K=d.value.trim();if(Uv(K)){if(j.preventDefault(),l.value){const{target:ve}=Sk(K,I.value);ve&&s("add",ve);return}g.value==="valid"?ne():g.value==="not-found"&&A.value[0]&&z(A.value[0].name)}}const Z=D(()=>{const j=a.value;if(!j)return[];const K=j.split("/").filter(Boolean),ve=[{label:"/",path:"/"}];let he="";for(const Ae of K)he+=`/${Ae}`,ve.push({label:Ae,path:he});return ve}),ie=D(()=>!(a.value.length===0||k.value&&$.value===null));async function q(j){r.value=!0;try{const K=await o.browseFs(j);if(!K.path){l.value=!0;return}a.value=K.path,c.value=K.parent,u.value=K.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ee(j){j.isDir&&q(j.path)}function fe(){c.value&&q(c.value)}function ne(){ie.value&&s("add",$.value??a.value)}return An(async()=>{r.value=!0;try{const j=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(j.home&&(I.value=j.home),o.defaultPath&&(await q(o.defaultPath),!l.value))return;I.value?await q(I.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),On(()=>{y&&clearTimeout(y),F&&clearTimeout(F)}),(j,K)=>(x(),Se(Qr,{open:i.value,"onUpdate:open":K[2]||(K[2]=ve=>i.value=ve),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:K[3]||(K[3]=ve=>s("close"))},{default:Ie(()=>[w("div",Fxe,[l.value?ue("",!0):(x(),E("div",Oxe,[ae(Xn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Ie(()=>[ae(Ge,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",Bxe,[(x(!0),E(We,null,rt(Z.value,(ve,he)=>(x(),E(We,{key:ve.path},[he>1?(x(),E("span",Rxe,"/")):ue("",!0),w("button",{class:Ue(["crumb",{last:he===Z.value.length-1}]),onClick:Ae=>q(ve.path)},R(ve.label),11,Dxe)],64))),128))])])),!r.value||l.value?(x(),E("div",{key:1,class:Ue(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[ae(Ge,{class:"filter-icon",name:"search",size:"md"}),qn(w("input",{ref_key:"filterEl",ref:N,"onUpdate:modelValue":K[0]||(K[0]=ve=>d.value=ve),class:"filter-input",type:"text",placeholder:L.value,autocomplete:"off",spellcheck:"false",onKeydown:St(U,["stop"])},null,40,Pxe),[[Cs,d.value]]),f.value||g.value==="checking"?(x(),Se(Us,{key:0,size:"sm"})):ue("",!0)],2)):ue("",!0),l.value?(x(),E("div",twe,R(C(n)("workspace.degradedHint")),1)):(x(),E("div",Hxe,[r.value?(x(),E("div",Wxe,R(C(n)("workspace.browsing")),1)):k.value&&g.value!=="valid"?(x(),E(We,{key:1},[g.value==="checking"?(x(),E("div",zxe,R(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(x(),E(We,{key:1},[A.value.length>0?(x(),E("div",Uxe,R(C(n)("workspace.pathPickHint")),1)):ue("",!0),(x(!0),E(We,null,rt(A.value,ve=>(x(),E("button",{key:ve.path,class:"folder-row",onClick:he=>z(ve.name)},[ae(Ge,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",jxe,R(ve.name),1)],8,qxe))),128)),A.value.length===0?(x(),E("div",Vxe,R(C(n)("workspace.noPathMatch",{parent:v.value})),1)):ue("",!0)],64)):g.value==="bad-parent"?(x(),E("div",Kxe,R(C(n)("workspace.badParent",{parent:v.value})),1)):ue("",!0)],64)):p.value&&!k.value?(x(),E(We,{key:2},[(x(!0),E(We,null,rt(h.value,ve=>(x(),E("button",{key:ve.path,class:"folder-row",onClick:he=>q(ve.path)},[ae(Ge,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Yxe,R(ve.rel),1)],8,Gxe))),128)),!f.value&&h.value.length===0?(x(),E("div",Zxe,R(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),E("div",Xxe,R(C(n)("workspace.searching")),1)):ue("",!0)],64)):(x(),E(We,{key:3},[(x(!0),E(We,null,rt(u.value,ve=>(x(),E("button",{key:ve.path,class:"folder-row",onClick:he=>ee(ve)},[ae(Ge,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Jxe,R(ve.name),1)],8,Qxe))),128)),u.value.length===0?(x(),E("div",ewe,R(C(n)("workspace.noSubfolders")),1)):ue("",!0)],64))])),e.error?(x(),E("div",nwe,R(e.error),1)):ue("",!0),w("div",owe,[ae(an,{text:a.value},{default:Ie(()=>[l.value?ue("",!0):(x(),Se(jt,{key:0,variant:"primary",disabled:!ie.value,onClick:ne},{default:Ie(()=>[ot(R(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ae(jt,{variant:"secondary",onClick:K[1]||(K[1]=ve=>s("close"))},{default:Ie(()=>[ot(R(C(n)("workspace.cancel")),1)]),_:1})]),w("div",swe,R(O.value),1)])]),_:1},8,["open","title"]))}}),awe=dt(lwe,[["__scopeId","data-v-07cbb13d"]]),cwe={key:0,class:"confirm-dialog__message"},uwe=Je({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),ho(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(x(),Se(Qr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:Ie(()=>[ae(jt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ie(()=>[ot(R(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),ae(jt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ie(()=>[ot(R(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ie(()=>[e.message?(x(),E("p",cwe,R(e.message),1)):ue("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),dwe=dt(uwe,[["__scopeId","data-v-2e719024"]]),fwe=Je({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=Gf();function i(){s()}return(r,l)=>(x(),Se(dwe,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),hwe={class:"rows"},pwe={class:"row"},mwe={class:"row"},gwe={class:"row"},vwe={class:"row"},ywe={class:"row"},kwe={class:"row"},bwe={class:"ctx-text"},xwe={key:0,class:"bar"},wwe={class:"row"},_we=Je({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe(!0),r=D(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=D(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:pr(o.status.ctxUsed),max:pr(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-warning)":p==="auto"?"var(--color-danger)":"var(--color-text)"}),u=D(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=D(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(x(),Se(Qr,{open:i.value,"onUpdate:open":m[0]||(m[0]=y=>i.value=y),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=y=>s("close"))},{default:Ie(()=>[w("dl",hwe,[w("div",pwe,[w("dt",null,R(C(n)("status.statusModel")),1),w("dd",null,R(e.status.model),1)]),w("div",mwe,[w("dt",null,R(C(n)("status.statusThinking")),1),w("dd",null,R(e.thinking),1)]),w("div",gwe,[w("dt",null,R(C(n)("status.statusPermission")),1),w("dd",{style:on({color:c.value})},R(a(e.status.permission)),5)]),w("div",vwe,[w("dt",null,R(C(n)("status.statusPlanMode")),1),w("dd",{class:Ue({"plan-on":e.planMode})},R(u.value),3)]),w("div",ywe,[w("dt",null,R(C(n)("status.statusSwarmMode")),1),w("dd",{class:Ue({"swarm-on":e.swarmMode})},R(d.value),3)]),w("div",kwe,[w("dt",null,R(C(n)("status.statusContext")),1),w("dd",null,[w("span",bwe,R(l.value),1),e.status.ctxMax>0?(x(),E("span",xwe,[w("i",{style:on({width:r.value+"%"})},null,4)])):ue("",!0)])]),w("div",wwe,[w("dt",null,R(C(n)("status.statusCost")),1),w("dd",null,R(h.value),1)])])]),_:1},8,["open","title"]))}}),Swe=dt(_we,[["__scopeId","data-v-09f83ff0"]]),Cwe={class:"ui-toast__icon","aria-hidden":"true"},Awe={class:"ui-toast__body"},Mwe={class:"ui-toast__title"},Ewe={key:0,class:"ui-toast__msg"},Twe=Je({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-toast",`ui-toast--${e.variant}`])},[w("span",Cwe,[jn(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),Se(Ge,{key:0,name:"check"})):e.variant==="danger"?(x(),Se(Ge,{key:1,name:"close"})):e.variant==="warning"?(x(),Se(Ge,{key:2,name:"alert-triangle"})):(x(),Se(Ge,{key:3,name:"info"}))],!0)]),w("div",Awe,[w("div",Mwe,R(e.title),1),e.message?(x(),E("div",Ewe,R(e.message),1)):ue("",!0),jn(t.$slots,"default",{},void 0,!0)]),ae(Xn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ie(()=>[ae(Ge,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Nwe=dt(Twe,[["__scopeId","data-v-adc6f346"]]),Iwe={key:0,class:"actions"},Lwe=["onClick"],$we=["onClick"],Fwe={key:1,class:"details"},Owe=Je({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t();function i(M){return typeof M=="object"&&M!==null}function r(M){return i(M)?M.title:M}function l(M){return i(M)?M.message??"":""}function a(M){return i(M)?M.details:void 0}function c(M){return i(M)?M.severity==="error":M.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(M)}function u(M){return i(M)?`notice:${M.severity}:${M.title}:${M.message??""}:${JSON.stringify(M.details??[])}`:`text:${M}`}function d(M){if(!i(M))return M;const $=[M.title];M.message&&$.push(M.message);const T=M.details??[];if(T.length>0){$.push("",`${s("warnings.diagnostics")}:`);for(const F of T)$.push(`${F.label}: ${F.value}`)}return $.join(`
342
- `)}let f=1;const h=oe([]),p=new Map,m=new Map;function y(M){const $=c(M)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?$+5e3:$}function k(M,$){const T=p.get(M)??{handle:null,deadline:0,remaining:0};T.handle=setTimeout(()=>N(M),$),T.deadline=Date.now()+$,p.set(M,T)}function g(M){const $=p.get(M);$&&$.handle!==null&&clearTimeout($.handle),p.delete(M)}function v(M){const $=p.get(M);!$||$.handle===null||(clearTimeout($.handle),$.handle=null,$.remaining=Math.max(0,$.deadline-Date.now()))}function b(M){if(h.value.find(F=>F.id===M)?.detailsOpen)return;const T=p.get(M);!T||T.handle!==null||k(M,T.remaining)}function A(M){M.detailsOpen=!M.detailsOpen,M.detailsOpen?v(M.id):b(M.id)}async function I(M){if(!await Jo(d(M.warning)))return;M.copied=!0;const T=m.get(M.id);T&&clearTimeout(T),m.set(M.id,setTimeout(()=>{M.copied=!1,m.delete(M.id)},1400))}function N(M){g(M);const $=m.get(M);$&&clearTimeout($),m.delete(M);const T=h.value.findIndex(F=>F.id===M);T!==-1&&(h.value=h.value.filter(F=>F.id!==M),o("dismiss",T))}return et(()=>n.warnings,M=>{const $=[...h.value];h.value=M.map(T=>{const F=u(T),S=$.findIndex(z=>z.key===F),B=S===-1?void 0:$.splice(S,1)[0];if(B)return B.warning=T,B;const W={id:f++,key:F,warning:T,detailsOpen:!1,copied:!1};return k(W.id,y(T)),W});for(const T of $){g(T.id);const F=m.get(T.id);F&&clearTimeout(F),m.delete(T.id)}},{immediate:!0,flush:"post"}),On(()=>{p.forEach(M=>{M.handle!==null&&clearTimeout(M.handle)}),p.clear(),m.forEach(M=>clearTimeout(M)),m.clear()}),(M,$)=>(x(),Se(Z7,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ie(()=>[(x(!0),E(We,null,rt(h.value,T=>(x(),Se(Nwe,{key:T.id,variant:c(T.warning)?"danger":"warning",title:r(T.warning),message:l(T.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>N(T.id),onPointerenter:F=>v(T.id),onPointerleave:F=>b(T.id)},{default:Ie(()=>[a(T.warning)?.length?(x(),E("div",Iwe,[w("button",{class:"link",type:"button",onClick:F=>A(T)},R(T.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Lwe),w("button",{class:"link",type:"button",onClick:F=>I(T)},R(T.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,$we)])):ue("",!0),T.detailsOpen&&a(T.warning)?.length?(x(),E("dl",Fwe,[(x(!0),E(We,null,rt(a(T.warning),F=>(x(),E("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,R(F.label),1),w("dd",null,R(F.value),1)]))),128))])):ue("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Bwe=dt(Owe,[["__scopeId","data-v-6cc72bd4"]]),Rwe={class:"topbar"},Dwe={class:"wsq"},Pwe=["aria-label"],Hwe={class:"tb-path"},Wwe={class:"ws"},zwe={class:"se"},Uwe={class:"tb-sub"},qwe=Je({__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}=$t(),o=e,s=t,i=D(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=D(()=>o.workspace?.name??n("workspace.noWorkspace")),l=D(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),E("div",Rwe,[w("span",Dwe,R(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[w("span",Hwe,[w("span",Wwe,R(r.value),1),e.sessionTitle?(x(),E(We,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",zwe,R(e.sessionTitle),1)],64)):ue("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",Uwe,[w("span",{class:Ue(["rd",{on:e.running}])},null,2),w("span",null,R(l.value),1),e.branch?(x(),E(We,{key:0},[ot(" · "+R(e.branch),1)],64)):ue("",!0),e.sessionCount>0?(x(),E(We,{key:1},[ot(" · "+R(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ue("",!0)])],8,Pwe),ae(Xn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ie(()=>[ae(Ge,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),jwe=dt(qwe,[["__scopeId","data-v-6b4b901f"]]),Vwe={key:0,class:"sheet-root"},Kwe=["aria-label"],Gwe=["aria-label"],Ywe={key:0,class:"sheet-head"},Zwe={class:"sheet-title"},Xwe={class:"sheet-body"},Qwe=Je({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return et(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),On(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),Se(Ua,{name:"sheet"},{default:Ie(()=>[e.modelValue?(x(),E("div",Vwe,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Gwe),e.title?(x(),E("div",Ywe,[w("span",Zwe,R(e.title),1)])):ue("",!0),w("div",Xwe,[jn(l.$slots,"default",{},void 0,!0)])],8,Kwe)])):ue("",!0)]),_:3}))}}),iN=dt(Qwe,[["__scopeId","data-v-745ee5a2"]]),Jwe={class:"mlist"},e_e={key:0,class:"mempty"},t_e=["onClick"],n_e={class:"mgh-main"},o_e={class:"mgh-name"},s_e={class:"mgh-path"},i_e={key:2,class:"att"},r_e={key:0,class:"mempty small"},l_e=["onClick"],a_e={class:"m"},c_e={class:"s"},u_e={key:0,class:"att"},d_e=["disabled","onClick"],f_e=["onClick"],h_e=Je({__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","loadMore"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=oe(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,v.value=null,N.value=null}const h=oe(new Set);function p(F){return h.value.has(F)}function m(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function y(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(B=>B.id===o.activeId)){const B=F.sessions.find(W=>W.id===o.activeId);if(B)return[...S,B]}return S}function k(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function g(F){return o.attentionByWorkspace[F]??0}const v=oe(null);function b(F){v.value=v.value===F?null:F,N.value=null}function A(F){v.value=null;const B=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();B&&s("rename",F.id,B)}function I(F){v.value=null,s("archive",F)}const N=oe(null);function M(F){N.value=N.value===F?null:F,v.value=null}function $(F){Jo(F.root),N.value=null}function T(F){N.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(x(),Se(iN,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=B=>s("update:modelValue",B))},{default:Ie(()=>[w("button",{type:"button",class:"newrow",onClick:a},[ae(Ge,{name:"message",size:"sm"}),ot(" "+R(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:c},[ae(Ge,{name:"folder",size:"sm"}),ot(" "+R(C(n)("sidebar.newWorkspace")),1)]),w("div",Jwe,[e.groups.length===0?(x(),E("div",e_e,R(C(n)("workspace.noWorkspace")),1)):ue("",!0),(x(!0),E(We,null,rt(e.groups,B=>(x(),E("div",{key:B.workspace.id,class:"mgroup"},[w("div",{class:Ue(["mgh",{on:B.workspace.id===e.activeWorkspaceId}]),onClick:W=>f(B.workspace.id)},[d(B.workspace.id)?(x(),Se(Ge,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),Se(Ge,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",n_e,[w("span",o_e,R(B.workspace.name),1),ae(an,{text:B.workspace.root},{default:Ie(()=>[w("span",s_e,R(B.workspace.shortPath),1)]),_:2},1032,["text"])]),d(B.workspace.id)&&g(B.workspace.id)>0?(x(),E("span",i_e,R(g(B.workspace.id)),1)):ue("",!0),ae(Xn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:St(W=>M(B.workspace.id),["stop"])},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ae(Xn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:St(W=>l(B.workspace.id),["stop"])},{default:Ie(()=>[ae(Ge,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),N.value===B.workspace.id?(x(),Se(Ml,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{size:"lg",onClick:W=>$(B.workspace)},{default:Ie(()=>[ot(R(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ae(Tn,{size:"lg",danger:"",onClick:W=>T(B.workspace)},{default:Ie(()=>[ot(R(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ue("",!0)],10,t_e),qn(w("div",null,[B.sessions.length===0?(x(),E("div",r_e,R(C(n)("sidebar.noSessions")),1)):ue("",!0),(x(!0),E(We,null,rt(y(B),W=>(x(),E("div",{key:W.id,class:Ue(["srow",{cur:W.id===e.activeId}]),onClick:z=>r(W.id)},[w("div",a_e,[w("div",{class:Ue(["t",{run:W.busy,aborted:!W.busy&&(e.attentionBySession[W.id]??0)===0&&(W.lastTurnReason==="cancelled"||W.lastTurnReason==="failed")}])},R(W.title),3),w("div",c_e,R(W.time),1)]),(e.attentionBySession[W.id]??0)>0?(x(),E("span",u_e,R(e.attentionBySession[W.id]),1)):ue("",!0),ae(Xn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:St(z=>b(W.id),["stop"])},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),v.value===W.id?(x(),Se(Ml,{key:1,class:"kmenu",onClick:S[1]||(S[1]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(Tn,{size:"lg",onClick:z=>A(W)},{default:Ie(()=>[ot(R(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ae(Tn,{size:"lg",danger:"",onClick:z=>I(W.id)},{default:Ie(()=>[ot(R(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ue("",!0)],10,l_e))),128)),B.hasMore||B.loadingMore?(x(),E("button",{key:1,type:"button",class:"mshow-more",disabled:B.loadingMore,onClick:St(W=>k(B.workspace.id),["stop"])},R(B.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,B.workspace.sessionCount-B.sessions.length)})),9,d_e)):ue("",!0),B.sessions.length>B.initialCount?(x(),E("button",{key:2,type:"button",class:"mshow-more",onClick:St(W=>m(B.workspace.id),["stop"])},R(p(B.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:B.sessions.length-B.initialCount})),9,f_e)):ue("",!0)],512),[[xi,!d(B.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),p_e=dt(h_e,[["__scopeId","data-v-df277098"]]),m_e={class:"group-title"},g_e={class:"srow-main"},v_e={class:"srow-label"},y_e={class:"srow-sub"},k_e={class:"srow read-only"},b_e={class:"srow-main"},x_e={class:"srow-label"},w_e={key:0,class:"srow-sub"},__e={class:"cache-note"},S_e={class:"srow-main"},C_e={class:"srow-label"},A_e={class:"srow-sub"},M_e=["aria-checked"],E_e={class:"srow-main"},T_e={class:"srow-label"},N_e={class:"srow-sub"},I_e=["aria-checked"],L_e={class:"srow-main"},$_e={class:"srow-label"},F_e={class:"srow read-only"},O_e={class:"srow-main"},B_e={class:"srow-label"},R_e={class:"srow-sub"},D_e=["aria-label"],P_e={class:"group-title"},H_e={class:"srow-main"},W_e={class:"srow-label"},z_e={class:"srow-sub"},U_e={class:"srow read-only pref"},q_e={class:"srow-main"},j_e={class:"srow-label"},V_e={class:"srow read-only pref"},K_e={class:"srow-main"},G_e={class:"srow-label"},Y_e={class:"srow read-only pref"},Z_e={class:"srow-main"},X_e={class:"srow-label"},Q_e={class:"num-field"},J_e=["value","aria-label"],eSe={class:"srow-main"},tSe={class:"srow-label"},nSe={class:"srow-sub"},oSe=["aria-checked"],sSe={class:"srow-main"},iSe={class:"srow-label"},rSe={class:"srow-main"},lSe={class:"srow-label"},aSe={key:2,class:"srow read-only"},cSe={class:"srow-main"},uSe={class:"srow-label"},dSe={class:"srow-val dim"},fSe={class:"arch-subhead"},hSe={class:"arch-count"},pSe={class:"arch-tools"},mSe={key:0,class:"arch-empty"},gSe={class:"arch-meta"},vSe={class:"arch-name"},ySe={class:"arch-time"},kSe={key:2,class:"arch-empty"},bSe=100,xSe=Je({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(q){s("setColorScheme",q)}const r=["manual","yolo","auto"],l=D(()=>o.models?.find(q=>q.id===o.status?.modelId)),a=D(()=>o0(l.value)),c=D(()=>s0(l.value)),u=D(()=>Xm(l.value,o.thinking)),d=D(()=>c.value.includes(u.value)?u.value:""),f=D(()=>c.value.map(q=>({value:q,label:hk(q)}))),h=D(()=>o.planMode===!0),p=D(()=>o.swarmMode===!0),m=D(()=>{const q=o.status.permission;return q==="yolo"?"var(--color-warning)":q==="auto"?"var(--color-danger)":"var(--color-text-muted)"}),y=D(()=>{const q=o.status.permission,ee=n(q==="yolo"?"mobile.permYoloSub":q==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${q} · ${ee}`}),k=D(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),g=D(()=>o.status.ctxMax>0?`${pr(o.status.ctxUsed)}/${pr(o.status.ctxMax)}`:n("status.statusNone"));function v(q){s("setThinking",hb(l.value,q))}function b(){const q=r.indexOf(o.status.permission),ee=r[(q+1)%r.length];s("setPermission",ee)}function A(){s("pickModel"),s("update:modelValue",!1)}function I(){s("login"),s("update:modelValue",!1)}function N(){s("logout"),s("update:modelValue",!1)}const M=Pb(),$=oe("main"),T=oe([]),F=oe(!1),S=oe(!1),B=oe(""),W=oe("archived-desc");async function z(){if(!F.value){F.value=!0,S.value=!1;try{const q=[];let ee;for(;;){const fe=await M.loadArchivedSessions({beforeId:ee,pageSize:bSe});if(q.push(...fe.items),!fe.hasMore||fe.items.length===0)break;const ne=fe.items.at(-1)?.id;if(ne===void 0)break;ee=ne}T.value=q,S.value=!0}catch(q){console.warn("loadAllArchived failed",q)}finally{F.value=!1}}}function L(){$.value="archived",B.value="",z()}function O(){$.value="main"}const U=D(()=>{const q=B.value.trim().toLowerCase();let ee=T.value.filter(fe=>fe.archived===!0);return q&&(ee=ee.filter(fe=>fe.title.toLowerCase().includes(q))),ee=ee.slice(),W.value==="archived-desc"?ee.sort((fe,ne)=>ne.updatedAt.localeCompare(fe.updatedAt)):W.value==="created-desc"?ee.sort((fe,ne)=>ne.createdAt.localeCompare(fe.createdAt)):ee.sort((fe,ne)=>fe.title.localeCompare(ne.title,"zh")),ee});async function Z(q){await M.restoreSession(q)&&(T.value=T.value.filter(fe=>fe.id!==q))}function ie(q){const ee=new Date(q);if(Number.isNaN(ee.getTime()))return q;const fe=ne=>String(ne).padStart(2,"0");return`${ee.getFullYear()}-${fe(ee.getMonth()+1)}-${fe(ee.getDate())} ${fe(ee.getHours())}:${fe(ee.getMinutes())}`}return et(()=>o.modelValue,q=>{q||($.value="main")}),(q,ee)=>(x(),Se(iN,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":ee[6]||(ee[6]=fe=>s("update:modelValue",fe))},{default:Ie(()=>[$.value==="main"?(x(),E(We,{key:0},[w("div",m_e,R(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:A},[w("span",g_e,[w("span",v_e,R(C(n)("status.statusModel")),1),w("span",y_e,R(e.status.model),1)]),ee[7]||(ee[7]=w("span",{class:"chev"},"›",-1))]),w("div",k_e,[w("span",b_e,[w("span",x_e,R(C(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),E("span",w_e,R(C(n)("status.modeNotSupported")),1)):ue("",!0)]),c.value.length>1?(x(),Se(ys,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":v},null,8,["model-value","options"])):(x(),E("span",{key:1,class:Ue(["srow-val",{dim:u.value==="off"}])},R(u.value==="off"?C(n)("status.planOff"):C(hk)(u.value)),3))]),w("div",__e,R(C(n)("status.cacheNote")),1),w("button",{type:"button",class:"srow",onClick:ee[0]||(ee[0]=fe=>s("togglePlan"))},[w("span",S_e,[w("span",C_e,R(C(n)("status.statusPlanMode")),1),w("span",A_e,R(C(n)("mobile.planModeSub")),1)]),w("span",{class:Ue(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,M_e)]),w("button",{type:"button",class:"srow",onClick:ee[1]||(ee[1]=fe=>s("toggleSwarm"))},[w("span",E_e,[w("span",T_e,R(C(n)("status.statusSwarmMode")),1),w("span",N_e,R(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:Ue(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,I_e)]),w("button",{type:"button",class:"srow",onClick:b},[w("span",L_e,[w("span",$_e,R(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:on({color:m.value})},R(y.value),5)]),ee[8]||(ee[8]=w("span",{class:"chev"},"›",-1))]),w("div",F_e,[w("span",O_e,[w("span",B_e,R(C(n)("status.statusContext")),1),w("span",R_e,R(g.value),1)]),w("span",{class:"ctx-meter","aria-label":g.value},[w("i",{style:on({width:k.value+"%"})},null,4)],8,D_e)]),w("div",P_e,R(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",H_e,[w("span",W_e,R(C(n)("mobile.archivedSessions")),1),w("span",z_e,R(C(n)("mobile.archivedSessionsSub")),1)]),ee[9]||(ee[9]=w("span",{class:"chev"},"›",-1))]),w("div",U_e,[w("span",q_e,[w("span",j_e,R(C(n)("theme.colorSchemeLabel")),1)]),ae(ys,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),w("div",V_e,[w("span",K_e,[w("span",G_e,R(C(n)("sidebar.language")),1)]),ae(oN)]),w("div",Y_e,[w("span",Z_e,[w("span",X_e,R(C(n)("settings.uiFontSize")),1)]),w("label",Q_e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ee[2]||(ee[2]=fe=>s("setUiFontSize",Number(fe.target.value)))},null,40,J_e),ee[10]||(ee[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:ee[3]||(ee[3]=fe=>s("setConversationToc",!e.conversationToc))},[w("span",eSe,[w("span",tSe,R(C(n)("settings.conversationToc")),1),w("span",nSe,R(C(n)("settings.conversationTocHint")),1)]),w("span",{class:Ue(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,oSe)]),e.authReady?(x(),E("button",{key:0,type:"button",class:"srow acct out",onClick:N},[w("span",sSe,[w("span",iSe,R(C(n)("sidebar.signOut")),1)])])):(x(),E("button",{key:1,type:"button",class:"srow acct in",onClick:I},[w("span",rSe,[w("span",lSe,R(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),E("div",aSe,[w("span",cSe,[w("span",uSe,R(C(n)("settings.serverVersion")),1)]),w("span",dSe,R(e.serverVersion),1)])):ue("",!0)],64)):(x(),E(We,{key:1},[w("div",fSe,[w("button",{type:"button",class:"arch-back",onClick:O},[ee[11]||(ee[11]=w("span",{class:"chev back"},"‹",-1)),ot(" "+R(C(n)("mobile.archivedBack")),1)]),w("span",hSe,R(C(n)("mobile.sessionCount",{n:U.value.length})),1)]),w("div",pSe,[ae(mu,{class:"arch-search-input","model-value":B.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":ee[4]||(ee[4]=fe=>B.value=fe)},null,8,["model-value","placeholder"]),ae(ys,{size:"sm","model-value":W.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ee[5]||(ee[5]=fe=>W.value=fe)},null,8,["model-value","options"])]),F.value?(x(),E("div",mSe,R(C(n)("settings.archivedLoadingAll")),1)):U.value.length>0?(x(!0),E(We,{key:1},rt(U.value,fe=>(x(),E("div",{key:fe.id,class:"arch-row"},[w("div",gSe,[w("div",vSe,R(fe.title),1),w("div",ySe,R(C(n)("settings.archivedAt",{time:ie(fe.updatedAt)})),1)]),ae(jt,{variant:"secondary",size:"sm",onClick:ne=>Z(fe.id)},{default:Ie(()=>[ot(R(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),E("div",kSe,R(T.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),wSe=dt(xSe,[["__scopeId","data-v-138e1e0a"]]),_Se={class:"ob-brand"},SSe={class:"ob-brand-text"},CSe={class:"ob-title"},ASe={class:"ob-sub"},MSe={class:"ob-sec"},ESe={class:"ob-label"},TSe={class:"ob-sec"},NSe={class:"ob-label"},ISe={class:"ob-sec"},LSe={class:"ob-label"},$Se=Je({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=$t(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=vT();function c(d){s.value!==d&&x6(d)}function u(){n("complete")}return(d,f)=>(x(),Se(Qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ie(()=>[w("div",_Se,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",SSe,[w("div",CSe,R(C(o)("onboarding.title")),1),w("div",ASe,R(C(o)("onboarding.subtitle")),1)])])]),default:Ie(()=>[w("section",MSe,[w("div",ESe,R(C(o)("onboarding.languageLabel")),1),ae(ys,{"model-value":C(s),options:C(b6).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),w("section",TSe,[w("div",NSe,R(C(o)("theme.colorSchemeLabel")),1),ae(ys,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),w("section",ISe,[w("div",LSe,R(C(o)("theme.accentLabel")),1),ae(ys,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),ae(jt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ie(()=>[ot(R(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),FSe=dt($Se,[["__scopeId","data-v-fbdd3eab"]]),OSe=["aria-label"],BSe={class:"gload-box"},RSe={class:"gload-text"},DSe={key:0,class:"gload-issue"},PSe={class:"gload-issue-detail"},HSe=Je({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=$t();return(n,o)=>(x(),E("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",BSe,[o[0]||(o[0]=qk('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></path></svg>',1)),ae(Us,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",RSe,R(C(t)("app.connecting")),1),e.issue?(x(),E("div",DSe,[w("div",null,R(C(t)("app.connectRetrying")),1),w("div",PSe,R(e.issue),1)])):ue("",!0)])],8,OSe))}}),WSe=dt(HSe,[["__scopeId","data-v-0b6dec6a"]]),zSe={class:"kap-root"},USe={class:"kap-head"},qSe={class:"kap-count"},jSe={class:"kap-head-actions"},VSe={class:"kap-filters"},KSe=["value"],GSe={class:"kap-check"},YSe={class:"kap-check"},ZSe={class:"kap-view-toggle",role:"group"},XSe={key:0,class:"kap-empty"},QSe=["onClick"],JSe={class:"kap-ts"},eCe={class:"kap-label"},tCe={key:0,class:"kap-detail"},nCe={class:"kap-detail-actions"},oCe=["onClick"],sCe={key:1,class:"kap-agg"},iCe={class:"mono"},rCe={class:"mono"},lCe={class:"num"},aCe={class:"num"},cCe={key:0},uCe={class:"mono"},dCe={class:"num"},fCe={class:"num"},hCe={key:0},pCe=Je({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=oe("all"),s=oe(""),i=oe(""),r=oe(!1),l=oe("timeline"),a=D(()=>(tb.value,[...Die()])),c=D(()=>{const $=new Set;for(const T of a.value)T.sessionId&&$.add(T.sessionId);return[...$].sort()});function u($){return $.kind==="rest:error"||$.code!==void 0&&$.code!==0||$.eventType==="error"||$.eventType==="parse-error"}const d=D(()=>{const $=s.value.trim().toLowerCase();return a.value.filter(T=>!(o.value!=="all"&&T.source!==o.value||i.value&&T.sessionId!==i.value||r.value&&!u(T)||$&&!`${T.label} ${T.kind} ${T.eventType??""} ${T.sessionId??""} ${T.requestId??""}`.toLowerCase().includes($)))}),f=D(()=>{const $=new Map;for(const T of d.value){if(T.kind!=="ws:in"&&T.kind!=="ws:out")continue;const F=T.kind==="ws:in"?"←":"→",S=`${F} ${T.eventType??"?"} @ ${T.sessionId??"-"}`,B=$.get(S)??{key:S,sessionId:T.sessionId??"-",eventType:T.eventType??"?",dir:F,count:0};B.count++,T.seq!==void 0&&(B.lastSeq=T.seq),$.set(S,B)}return[...$.values()].sort((T,F)=>F.count-T.count)}),h=D(()=>{const $=new Map;for(const T of d.value){if(T.source!=="rest"||T.kind==="rest:request")continue;const F=`${T.method??"?"} ${T.path??"?"}`,S=$.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(T)&&S.errors++,T.durationMs!==void 0&&(S.totalMs+=T.durationMs,S.timed++),$.set(F,S)}return[...$.entries()].map(([T,F])=>({key:T,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((T,F)=>F.count-T.count)}),p=oe(null),m=oe(!0),y=oe(null),k=oe(null);et(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await yt();const $=y.value;$&&($.scrollTop=$.scrollHeight)});function g($){p.value=p.value===$?null:$}function v($){const T=new Date($),F=(S,B=2)=>String(S).padStart(B,"0");return`${F(T.getHours())}:${F(T.getMinutes())}:${F(T.getSeconds())}.${F(T.getMilliseconds(),3)}`}function b($){return JSON.stringify($,null,2)}async function A($){await Jo(b($))&&(k.value=$.id,setTimeout(()=>{k.value===$.id&&(k.value=null)},1500))}function I(){zE(d.value)}function N($){return u($)||$.source==="client"?"b-err":$.source==="rest"?"b-rest":$.kind==="ws:lifecycle"?"b-life":$.kind==="ws:out"?"b-out":"b-in"}function M($){return $.source==="rest"?"REST":$.source==="client"?"APP":"WS"}return($,T)=>(x(),E("section",zSe,[w("header",USe,[T[11]||(T[11]=w("strong",null,"KAP debug",-1)),w("span",qSe,R(d.value.length)+"/"+R(a.value.length),1),w("div",jSe,[w("button",{type:"button",class:Ue({on:C(Nd)}),onClick:T[0]||(T[0]=F=>Nd.value=!C(Nd))},R(C(Nd)?"resume":"pause"),3),w("button",{type:"button",onClick:T[1]||(T[1]=F=>C(Pie)())},"clear"),w("button",{type:"button",onClick:T[2]||(T[2]=F=>I())},"export jsonl"),ae(an,{text:"Close window"},{default:Ie(()=>[w("button",{type:"button",onClick:T[3]||(T[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",VSe,[qn(w("select",{"onUpdate:modelValue":T[4]||(T[4]=F=>o.value=F),"aria-label":"Source filter"},[...T[12]||(T[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[cy,o.value]]),qn(w("select",{"onUpdate:modelValue":T[5]||(T[5]=F=>i.value=F),"aria-label":"Session filter"},[T[13]||(T[13]=w("option",{value:""},"all sessions",-1)),(x(!0),E(We,null,rt(c.value,F=>(x(),E("option",{key:F,value:F},R(F),9,KSe))),128))],512),[[cy,i.value]]),qn(w("input",{"onUpdate:modelValue":T[6]||(T[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Cs,s.value]]),w("label",GSe,[qn(w("input",{"onUpdate:modelValue":T[7]||(T[7]=F=>r.value=F),type:"checkbox"},null,512),[[um,r.value]]),T[14]||(T[14]=ot(" errors",-1))]),w("label",YSe,[qn(w("input",{"onUpdate:modelValue":T[8]||(T[8]=F=>m.value=F),type:"checkbox"},null,512),[[um,m.value]]),T[15]||(T[15]=ot(" follow",-1))]),w("div",ZSe,[w("button",{type:"button",class:Ue({on:l.value==="timeline"}),onClick:T[9]||(T[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:Ue({on:l.value==="aggregate"}),onClick:T[10]||(T[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),E("div",{key:0,ref_key:"listRef",ref:y,class:"kap-list"},[d.value.length===0?(x(),E("div",XSe," No trace entries yet. REST calls and WS frames will appear here. ")):ue("",!0),(x(!0),E(We,null,rt(d.value,F=>(x(),E("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:Ue(["kap-row",{expanded:p.value===F.id}]),onClick:S=>g(F.id)},[w("span",JSe,R(v(F.ts)),1),w("span",{class:Ue(["kap-badge",N(F)])},R(M(F)),3),w("span",eCe,R(F.label),1)],10,QSe),p.value===F.id?(x(),E("div",tCe,[w("div",nCe,[w("button",{type:"button",onClick:S=>A(F)},R(k.value===F.id?"copied ✓":"copy json"),9,oCe)]),w("pre",null,R(b(F)),1)])):ue("",!0)]))),128))],512)):(x(),E("div",sCe,[T[20]||(T[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[T[17]||(T[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(x(!0),E(We,null,rt(f.value,F=>(x(),E("tr",{key:F.key},[w("td",null,R(F.dir),1),w("td",iCe,R(F.eventType),1),w("td",rCe,R(F.sessionId),1),w("td",lCe,R(F.count),1),w("td",aCe,R(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),E("tr",cCe,[...T[16]||(T[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ue("",!0)])]),T[21]||(T[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[T[19]||(T[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(x(!0),E(We,null,rt(h.value,F=>(x(),E("tr",{key:F.key},[w("td",uCe,R(F.key),1),w("td",dCe,R(F.count),1),w("td",{class:Ue(["num",{err:F.errors>0}])},R(F.errors),3),w("td",fCe,R(F.avgMs),1)]))),128)),h.value.length===0?(x(),E("tr",hCe,[...T[18]||(T[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ue("",!0)])])]))]))}}),mCe=dt(pCe,[["__scopeId","data-v-3cda6fe3"]]),gCe=Je({__name:"DebugPanel",setup(e){const t=oe(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=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),f=dm(mCe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return An(()=>{c()}),ho(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),Se(an,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ie(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),vCe=dt(gCe,[["__scopeId","data-v-21346738"]]);function yCe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),o=D(()=>e.initialized.value&&!n.value),s="/login",i=oe(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}et(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return On(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function kCe({running:e,showAuthGate:t}){const{t:n}=$t(),o=["◐","◓","◑","◒"],s=oe(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}et(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});DA(()=>{typeof document<"u"&&(document.title=a.value)}),On(()=>{l()})}const rN=oe(typeof window>"u"?0:window.innerWidth);let bp=0,l1=!1;function Ck(){rN.value=window.innerWidth}function bCe(){l1||typeof window>"u"||(window.addEventListener("resize",Ck),l1=!0,Ck())}function xCe(){!l1||typeof window>"u"||(window.removeEventListener("resize",Ck),l1=!1)}function lN(e,t,n){return Math.max(t,e-n)}function Ak(e,t,n){return Math.min(n,Math.max(t,e))}function aN(){return An(()=>{bp+=1,bCe()}),ho(()=>{bp=Math.max(0,bp-1),bp===0&&xCe()}),{viewportWidth:rN}}const wCe="kimi-web.file-preview-width",zc=320;function _Ce({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=aN(),i=D(()=>Math.max(0,s.value-t.value)),r=D(()=>lN(i.value,zc,zc));function l(Q){return Ak(Math.round(Q),zc,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=oe(c.value),d=D(()=>Ak(u.value,zc,r.value)),f=oe(null),h=D(()=>{const Q=f.value;if(!Q)return null;const G=e.turns.value.find(me=>me.id===Q.turnId)?.blocks?.[Q.blockIndex];return G?.kind==="thinking"?G.thinking:null}),p=D(()=>h.value!==null);function m(Q){const P=f.value;if(P&&P.turnId===Q.turnId&&P.blockIndex===Q.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=Q}function y(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=oe(null),g=D(()=>{const Q=k.value;if(!Q)return null;const P=e.turns.value.find(G=>G.id===Q.turnId);return P?.role==="compaction"&&P.text?P.text:null}),v=D(()=>g.value!==null);function b(Q){if(k.value?.turnId===Q.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=Q}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const I=oe(null);function N(Q){const P=e.activeAppTasks.value,G=P.find(ye=>ye.id===Q)??P.find(ye=>ye.parentToolCallId===Q);if(G)return G.id;const me=P.filter(ye=>ye.kind==="subagent"&&!ye.parentToolCallId);if(me.length===1)return me[0].id}const M=D(()=>{const Q=I.value;if(!Q)return null;const P=e.activeAppTasks.value.find(G=>G.id===Q.subagentId);return P?Jve(P):null}),$=D(()=>M.value!==null);function T(Q){const P=N(Q);if(P){if(I.value?.subagentId===P){I.value=null,n.value==="agent"&&(n.value=null);return}I.value={subagentId:P},n.value="agent"}}function F(){I.value=null,n.value==="agent"&&(n.value=null)}const S=oe(null),B=D(()=>{const Q=S.value;if(!Q)return null;const P=pU(e.turns.value,Q);return P?{id:Q,title:ec(P.name),path:hU(P.arg),lines:P.status==="error"?null:S6(P),output:P.output}:null}),W=D(()=>B.value!==null);function z(Q){if(n.value==="toolDiff"&&S.value===Q){L();return}n.value="toolDiff",S.value=Q}function L(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const O=oe("list"),U=oe(null);function Z(){if(n.value==="diff"){ie();return}n.value="diff",O.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function ie(){n.value==="diff"&&(n.value=null),O.value="list",U.value=null,e.clearFileDiff()}async function q(Q){O.value="detail",U.value=Q,await e.loadFileDiff(Q)}async function ee(Q){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Q):await e.openSideChat(Q),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ne(){n.value==="btw"&&(n.value=null)}const j=D(()=>e.sideChatVisible.value),K=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||$.value)&&(n.value!=="toolDiff"||W.value)&&(n.value!=="btw"||j.value)),ve=oe(!1),he=oe({});function Ae(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return I.value?{kind:"agent",...I.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function re(Q){if(Q)switch(Q.kind){case"thinking":f.value={turnId:Q.turnId,blockIndex:Q.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:Q.turnId},n.value="compaction";break;case"agent":I.value={subagentId:Q.subagentId},n.value="agent";break;case"toolDiff":S.value=Q.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Y(){return n.value==="thinking"&&p.value?(y(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&$.value?(F(),!0):n.value==="toolDiff"&&W.value?(L(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(ie(),!0):n.value==="btw"?(fe(),!0):!1}return et(e.activeSessionId,(Q,P)=>{if(P){const G=Ae();G?he.value[P]=G:delete he.value[P]}o(),y(),A(),F(),L(),ie(),ne(),Q&&re(he.value[Q])}),{PREVIEW_WIDTH_KEY:wCe,PREVIEW_MIN:zc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:y,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:b,closeCompactionPanel:A,agentPanelMember:M,agentPanelVisible:$,openAgentPanel:T,closeAgentPanel:F,toolDiffTarget:B,toolDiffVisible:W,openToolDiff:z,closeToolDiff:L,detailDiffMode:O,detailDiffPath:U,openDiffDetail:Z,closeDiffDetail:ie,selectDiffFile:q,btwVisible:j,openSideChatTab:ee,closeSideChat:fe,hideSideChatPanel:ne,sidePanelVisible:K,panelDragging:ve,closeOpenSidePanel:Y}}const SCe=Dt.sidebarWidth,iA=Dt.sidebarCollapsed,rA=270,qv=170,CCe=480,ACe=320;function MCe(e={}){const{viewportWidth:t}=aN(),n=oe(rA),o=oe(!1),s=oe(!1),i=D(()=>{const u=ACe+(NA(e.previewOpen)?zc:0);return Math.min(CCe,lN(t.value,qv,u))}),r=D(()=>Ak(n.value,qv,i.value));function l(){try{o.value=yo(iA)==="true"}catch{o.value=!1}}function a(){try{Eo(iA,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:SCe,SIDEBAR_DEFAULT:rA,SIDEBAR_MIN:qv,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function ECe(e){return/^(?:https?:|blob:|data:)/i.test(e)}function TCe({client:e,detailTarget:t}){const{t:n}=$t(),o=oe(null),s=oe(null),i=oe(!1),r=oe(null),l=oe(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const N=l.value;return N?e.getFileDownloadUrl(N):null}),f=D(()=>o.value!==null);function h(N){return N.length>1?N.replace(/\/+$/,""):N}function p(N){const M=[];for(const $ of N.split(/[\\/]+/))if(!(!$||$===".")){if($===".."){M.pop();continue}M.push($)}return M.join("/")}function m(N){const M=N.trim();if(!M)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(M))return{error:n("filePreview.errors.unsupportedPath")};if(M.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const $=h(e.status.value.cwd);if(M.startsWith("/")){if(!$||M!==$&&!M.startsWith(`${$}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=M===$?"":M.slice($.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(M.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=p(M);return T?{path:T}:{error:n("filePreview.errors.emptyPath")}}async function y(N){const M=o.value;if(t.value==="file"&&M&&M.path===N.path&&M.line===N.line){b();return}const $=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=N,l.value=null;const T=m(N.path);if("error"in T){i.value=!1,r.value=T.error;return}l.value=T.path;try{const F=await e.readFileContent(T.path);if($!==a)return;F?s.value={...F,path:F.path||T.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if($!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{$===a&&(i.value=!1)}}function k(N){return/^data:([^;,]+)/i.exec(N)?.[1]}function g(N){if(N.kind!=="image"&&N.kind!=="video")return;const M=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const $=N.kind==="video",T={path:N.path??($?"Video":"ReadMediaFile image"),content:"",encoding:"utf-8",mime:N.mimeType??k(N.url)??($?"video/*":"image/*"),isBinary:!0,size:N.bytes??0};N.fileId?(i.value=!0,s.value=T,ht().getFileBlob(N.fileId).then(F=>{if(M===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(F),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{M===a&&(s.value&&(s.value={...s.value,sourceUrl:N.url}),i.value=!1)})):(i.value=!1,s.value=ECe(N.url)?{...T,sourceUrl:N.url}:T)}function v(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function b(){v(),t.value==="file"&&(t.value=null)}et(t,(N,M)=>{M==="file"&&N!=="file"&&v()});function A(){const N=s.value?.path??o.value?.path;N&&e.openWorkspaceFile(N,o.value?.line)}function I(){const N=s.value?.path??o.value?.path;N&&e.revealWorkspaceFile(N)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:y,openMediaPreview:g,closeFilePreview:b,openPreviewInEditor:A,revealPreviewFile:I}}const NCe=640,ICe=`(max-width: ${NCe}px)`;function LCe(){const e=oe(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(ICe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),On(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),On(()=>t.removeListener(n))),e}const $Ce={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},FCe={class:"server-auth-card"},OCe={class:"server-auth-body"},BCe={class:"server-auth-foot"},RCe=Je({__name:"ServerAuthDialog",setup(e){const t=oe(""),n=oe(null),o=oe(!1);An(()=>{yt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,GE(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(x(),E("div",$Ce,[w("div",FCe,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[ot(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),ot("). ")])],-1)),w("div",OCe,[ae(mu,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),w("div",BCe,[ae(jt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ie(()=>[ot(R(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),DCe=dt(RCe,[["__scopeId","data-v-6f624612"]]),PCe=["aria-label"],HCe=Je({__name:"InternalBuildBanner",setup(e){const{t}=$t(),n=IH;return(o,s)=>C(n)?(x(),E("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=w("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,R(C(t)("app.internalBuildBanner")),1)],8,PCe)):ue("",!0)}}),WCe=dt(HCe,[["__scopeId","data-v-166b3735"]]),zCe={class:"app-shell"},UCe={key:1,class:"auth-page"},qCe={class:"auth-page-inner"},jCe={class:"auth-page-copy"},VCe=["aria-label","aria-hidden"],KCe=Je({__name:"App",setup(e){Nre();const t=oe(!1);let n=null;const o=Pb(),s=D(()=>!o.dangerousBypassAuth.value&&t.value);Ln("resolveImage",o.resolveImageUrl),Ln("resolveSwarmMembers",Re=>o.swarmMembersByToolCallId.value.get(Re)??[]);const{t:i}=$t(),{confirm:r}=Gf(),l=Yi(),a=LCe(),c=oe(!1),u=oe(!1),d=D(()=>{const Re=o.activeSessionId.value;return o.sessions.value.find(le=>le.id===Re)?.title??""}),f=D(()=>o.visibleWorkspace.value?.sessionCount??0),h=D(()=>o.activity.value!=="idle"),p=oe(null),{showAuthGate:m,blinkAuthLogo:y}=yCe({client:o,authLogoRef:p});kCe({running:h,showAuthGate:m});function k(Re){const le=o.models.value.find(ze=>ze.id===o.status.value.modelId),Te=s0(le),ge=Te.indexOf(Xm(le,Re)),Ee=Te[(ge+1)%Te.length]??Te[0]??"off";return hb(le,Ee)}const g=D(()=>{const Re=o.models.value.find(le=>le.id===o.status.value.modelId);return Xm(Re,o.thinking.value)}),v=oe(!o.onboarded.value);function b(){o.setOnboarded(!0),v.value=!1}function A(){v.value=!0}let I=0;function N(){const Re=window.visualViewport,le=document.documentElement.style;le.setProperty("--app-height",`${Re?.height??window.innerHeight}px`),le.setProperty("--app-top",`${Re?.offsetTop??0}px`)}function M(){I||(I=requestAnimationFrame(()=>{I=0,N()}))}An(()=>{n=$re(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),Q(),N(),window.visualViewport?.addEventListener("resize",M),window.visualViewport?.addEventListener("scroll",M),window.addEventListener("resize",M),document.addEventListener("keydown",$,!0)}),On(()=>{document.removeEventListener("keydown",$,!0),window.visualViewport?.removeEventListener("resize",M),window.visualViewport?.removeEventListener("scroll",M),window.removeEventListener("resize",M),I&&(cancelAnimationFrame(I),I=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function $(Re){Re.key==="Escape"&&(Be.value||so()&&(Re.stopPropagation(),Re.preventDefault()))}const T=oe(null),F=oe(!1);et(o.activeSessionId,()=>{F.value=!0,yt(()=>{F.value=!1})});const{previewTarget:S,previewFile:B,previewLoading:W,previewError:z,previewDownloadUrl:L,previewExternalActions:O,openFilePreview:U,openMediaPreview:Z,closeFilePreview:ie,openPreviewInEditor:q,revealPreviewFile:ee}=TCe({client:o,detailTarget:T}),fe=D(()=>T.value!==null),{SIDEBAR_WIDTH_KEY:ne,SIDEBAR_DEFAULT:j,SIDEBAR_MIN:K,sidebarMax:ve,sessionColWidth:he,sidebarCollapsed:Ae,sidebarDragging:re,sideWidth:Y,loadSidebarCollapsed:Q,toggleSidebarCollapse:P}=MCe({previewOpen:fe}),{PREVIEW_WIDTH_KEY:G,PREVIEW_MIN:me,previewDefaultWidth:ye,previewMax:de,previewWidth:V,previewPanelWidth:se,thinkingPanelText:pe,thinkingVisible:ke,openThinkingPanel:Ne,closeThinkingPanel:qe,compactionPanelText:be,compactionPanelVisible:xe,openCompactionPanel:Ze,closeCompactionPanel:tt,agentPanelMember:lt,openAgentPanel:ut,closeAgentPanel:mt,toolDiffTarget:Tt,openToolDiff:wt,closeToolDiff:Ft,detailDiffMode:en,detailDiffPath:Hn,openDiffDetail:Pt,closeDiffDetail:bn,selectDiffFile:pn,btwVisible:Kt,openSideChatTab:Nn,closeSideChat:Gt,sidePanelVisible:Wt,panelDragging:mn,closeOpenSidePanel:so}=_Ce({client:o,sideWidth:Y,detailTarget:T,closeFilePreview:ie}),gn=oe(null),to=oe(!1),vt=oe(!1),Wn=oe(!1),Bn=oe(!1),Qn=oe(!1),sn=oe(!1),es=oe(null),nt=oe(null),Be=D(()=>Rc.value>0||to.value||vt.value||Wn.value||Bn.value||Qn.value||sn.value||v.value||c.value||u.value),Bt=oe(!1),Yt=oe(!1),vn=oe(!1),xn=oe(!1),nn=oe(!1);async function Vn(){Bt.value=!0,Yt.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Yt.value=!0}finally{Bt.value=!1}}async function Kn(){vn.value=!0,xn.value=!1,vt.value=!0;try{await o.loadProviders()}catch{xn.value=!0}finally{vn.value=!1}}function Jn(){Wn.value=!0}async function Oo(Re){to.value=!1,await ko(Re)}async function ko(Re){await o.setModel(Re)&&Re!==o.defaultModel.value&&o.updateConfig({defaultModel:Re})}async function li(Re){await o.addProvider(Re)}async function Uo(Re){await o.refreshProvider(Re)}async function As(Re){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Re)})}async function cs(Re){const le=o.workspacesView.value.find(Te=>Te.id===Re)?.name??Re;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:le}),variant:"danger",action:()=>o.deleteWorkspace(Re)})}async function qo(Re){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Re)})}async function Bo(Re){nn.value=!0;try{await o.updateConfig(Re)&&await o.checkAuth()}finally{nn.value=!1}}async function ai(){return o.startOAuthLogin()}async function tn(){return o.pollOAuthLogin()}async function qs(){return o.cancelOAuthLogin()}async function io(){Wn.value=!1,await o.checkAuth(),await o.load()}async function js(Re){await o.undo(1),await yt(),gn.value?.loadComposerForEdit(Re.text,Re.attachments)}function ci(Re){if(Re==="/compact"||Re.startsWith("/compact ")){o.compact(Re.slice(8).trim()||void 0);return}if(Re==="/swarm"||Re.startsWith("/swarm ")){const le=Re.slice(6).trim();le==="on"?o.setSwarmMode(!0):le==="off"?o.setSwarmMode(!1):le?(o.setSwarmMode(!0),o.sendPrompt(le)):o.toggleSwarmMode();return}if(Re==="/goal"||Re.startsWith("/goal ")){const le=Re.slice(5).trim();le==="pause"||le==="resume"||le==="cancel"?o.controlGoal(le):le?o.createGoal(le):o.toggleGoalMode();return}if(Re==="/btw"||Re.startsWith("/btw ")){const le=Re.slice(4).trim();!le&&o.sideChatVisible.value?Gt():Nn(le||void 0);return}switch(Re){case"/new":case"/clear":No();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(k(o.thinking.value));break;case"/status":Qn.value=!0;break;case"/login":Jn();break;default:{const le=Re.indexOf(" "),Te=pue((le===-1?Re:Re.slice(0,le)).slice(1)),ge=le===-1?void 0:Re.slice(le+1).trim()||void 0;if(!Te)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Te,ge):o.activateSkill(Te,ge);break}}}function Ni(Re){o.unqueue(Re)}function ui(Re){o.unqueue(Re)}function Vs(Re){o.reorderQueue(Re.from,Re.to)}async function ts(Re){const le=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&le){await o.startSessionAndSendPrompt(le,Re.text,Re.attachments);return}if(!o.activeSessionId.value&&!le){es.value=Re,Bn.value=!0;return}o.sendPrompt(Re.text,Re.attachments)}async function ns(Re){if(nt.value=null,!await o.addWorkspaceByPath(Re)){nt.value=i("workspace.addFailed");return}Bn.value=!1;const Te=es.value;es.value=null;const ge=o.activeWorkspaceId.value;Te&&ge&&await o.startSessionAndSendPrompt(ge,Te.text,Te.attachments)}function zt(){es.value=null,nt.value=null,Bn.value=!1}function Ms(){yt(()=>{gn.value?.focusComposer()})}function No(){const Re=o.activeWorkspaceId.value;Re?o.openWorkspaceDraft(Re):o.clearActiveSession(),Ms()}function di(Re){o.openWorkspaceDraft(Re),Ms()}function Ke(Re){Re&&window.open(Re,"_blank","noopener")}return(Re,le)=>(x(),E("div",zCe,[s.value?(x(),Se(DCe,{key:0})):ue("",!0),C(m)?(x(),E("section",UCe,[w("div",qCe,[(x(),E("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:le[0]||(le[0]=St(()=>{},["prevent"])),onClick:le[1]||(le[1]=(...Te)=>C(y)&&C(y)(...Te))},[...le[98]||(le[98]=[qk('<defs data-v-8cd3196b><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-8cd3196b><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-8cd3196b></rect><g class="ch-eyes" fill="#000" data-v-8cd3196b><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-8cd3196b></rect>',2)])],544)),w("div",jCe,[w("h1",null,R(C(i)("app.authPageTitle")),1),w("p",null,R(C(i)("app.authPageMessage")),1)]),ae(jt,{class:"auth-page-btn",variant:"primary",onClick:Jn},{default:Ie(()=>[ae(Ge,{name:"log-in",size:"md"}),w("span",null,R(C(i)("app.authPageLogin")),1)]),_:1})])])):(x(),E("div",{key:2,class:Ue(["app",{mobile:C(a),"sidebar-collapsed":C(Ae)&&!C(a),"macos-desktop":C(iu)}]),style:on({"--preview-w":C(se)+"px"})},[C(a)?(x(),Se(jwe,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:le[19]||(le[19]=Te=>c.value=!0),onOpenSettings:le[20]||(le[20]=Te=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),E(We,{key:0},[ae(eW,{collapsed:C(Ae),dragging:C(re),"col-width":C(Y),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:le[2]||(le[2]=Te=>C(o).selectSession(Te)),onCreate:No,onCreateInWorkspace:le[3]||(le[3]=Te=>di(Te)),onSelectWorkspace:le[4]||(le[4]=Te=>C(o).openWorkspace(Te)),onAddWorkspace:le[5]||(le[5]=Te=>Bn.value=!0),onRename:le[6]||(le[6]=(Te,ge)=>C(o).renameSession(Te,ge)),onArchive:le[7]||(le[7]=Te=>As(Te)),onFork:le[8]||(le[8]=Te=>C(o).forkSession(Te)),onExport:le[9]||(le[9]=Te=>C(o).exportSession(Te)),onRenameWorkspace:le[10]||(le[10]=(Te,ge)=>C(o).renameWorkspace(Te,ge)),onDeleteWorkspace:le[11]||(le[11]=Te=>cs(Te)),onReorderWorkspaces:le[12]||(le[12]=Te=>C(o).reorderWorkspaces(Te)),onSetWorkspaceSortMode:le[13]||(le[13]=Te=>C(o).setWorkspaceSortMode(Te)),onLoadMoreSessions:le[14]||(le[14]=Te=>void C(o).loadMoreSessions(Te)),onLoadAllSessions:le[15]||(le[15]=Te=>void C(o).loadAllSessions()),onOpenSettings:le[16]||(le[16]=Te=>sn.value=!0),onCollapse:C(P)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),qn(ae(H_,{class:"side-handle","storage-key":C(ne),"default-width":C(j),min:C(K),max:C(ve),"onUpdate:width":le[17]||(le[17]=Te=>he.value=Te),"onUpdate:dragging":le[18]||(le[18]=Te=>re.value=Te)},null,8,["storage-key","default-width","min","max"]),[[xi,!C(Ae)]])],64)),ae(bpe,{ref_key:"conversationPaneRef",ref:gn,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:le[21]||(le[21]=Te=>C(Pt)()),onSelectWorkspace:le[22]||(le[22]=Te=>di(Te)),onAddWorkspace:le[23]||(le[23]=Te=>Bn.value=!0),onOpenPr:Ke,onSubmit:le[24]||(le[24]=Te=>ts(Te)),onSteer:le[25]||(le[25]=Te=>C(o).steerPrompt(Te.text,Te.attachments)),onApproval:le[26]||(le[26]=(Te,ge)=>C(o).respondApproval(Te,ge)),onCancelTask:le[27]||(le[27]=Te=>C(o).cancelTask(Te)),onAnswer:le[28]||(le[28]=(Te,ge)=>C(o).respondQuestion(Te,ge)),onDismiss:le[29]||(le[29]=Te=>C(o).dismissQuestion(Te)),onCommand:ci,onInterrupt:le[30]||(le[30]=Te=>C(o).abortCurrentPrompt()),onUnqueue:Ni,onEditQueued:ui,onReorderQueue:Vs,onSetPermission:le[31]||(le[31]=Te=>C(o).setPermission(Te)),onSetThinking:le[32]||(le[32]=Te=>C(o).setThinking(Te)),onTogglePlan:le[33]||(le[33]=Te=>C(o).togglePlanMode()),onToggleSwarm:le[34]||(le[34]=Te=>C(o).toggleSwarmMode()),onToggleGoal:le[35]||(le[35]=Te=>C(o).toggleGoalMode()),onCreateGoal:le[36]||(le[36]=Te=>C(o).createGoal(Te)),onControlGoal:le[37]||(le[37]=Te=>C(o).controlGoal(Te)),onRefreshGitStatus:le[38]||(le[38]=Te=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:le[39]||(le[39]=(Te,ge)=>C(o).renameSession(Te,ge)),onForkSession:le[40]||(le[40]=Te=>C(o).forkSession(Te)),onArchiveSession:le[41]||(le[41]=Te=>As(Te)),onExportSession:le[42]||(le[42]=Te=>C(o).exportSession(Te)),onCompact:le[43]||(le[43]=Te=>C(o).compact()),onPickModel:le[44]||(le[44]=Te=>Vn()),onSelectModel:le[45]||(le[45]=Te=>ko(Te)),onOpenFile:le[46]||(le[46]=Te=>C(U)(Te)),onOpenMedia:le[47]||(le[47]=Te=>C(Z)(Te)),onOpenThinking:le[48]||(le[48]=Te=>C(Ne)(Te)),onOpenCompaction:le[49]||(le[49]=Te=>C(Ze)(Te)),onOpenAgent:le[50]||(le[50]=Te=>C(ut)(Te)),onOpenToolDiff:le[51]||(le[51]=Te=>C(wt)(Te)),onEditMessage:js},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","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","conversation-toc"]),!C(a)&&(C(iu)||C(Ae))?(x(),Se(Xn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Ae)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(P)},{default:Ie(()=>[ae(Ge,{name:C(Ae)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ue("",!0),C(Wt)&&!C(a)?(x(),Se(H_,{key:3,class:"preview-handle","storage-key":C(G),"default-width":C(ye),min:C(me),max:C(de),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":le[52]||(le[52]=Te=>V.value=Te),"onUpdate:dragging":le[53]||(le[53]=Te=>mn.value=Te)},null,8,["storage-key","default-width","min","max","aria-label"])):ue("",!0),!C(a)||C(Wt)?(x(),E("aside",{key:4,class:Ue(["global-preview",{open:C(Wt),mobile:C(a),"no-anim":C(mn)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Wt)},[T.value==="thinking"&&C(ke)?(x(),Se(W3,{key:0,text:C(pe)??"",onClose:C(qe)},null,8,["text","onClose"])):T.value==="compaction"&&C(xe)?(x(),Se(W3,{key:1,text:C(be)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(tt)},null,8,["text","subtitle","onClose"])):T.value==="agent"&&C(lt)?(x(),Se(Vme,{key:2,member:C(lt),onClose:C(mt)},null,8,["member","onClose"])):T.value==="btw"&&C(Kt)?(x(),Se(h1e,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:le[54]||(le[54]=Te=>C(o).sendSideChatPrompt(Te)),onClose:C(Gt)},null,8,["turns","running","sending","onClose"])):T.value==="diff"?(x(),Se(W1e,{key:4,mode:C(en),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(pn),onBack:le[55]||(le[55]=Te=>{en.value="list",Hn.value=null,C(o).clearFileDiff()}),onClose:C(bn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):T.value==="toolDiff"&&C(Tt)?(x(),Se(i1e,{key:5,target:C(Tt),onClose:C(Ft)},null,8,["target","onClose"])):T.value==="file"?(x(),Se(Mme,{key:6,file:C(B),loading:C(W),error:C(z),line:C(S)?.line,"download-url":C(L),closable:"","external-actions":C(O),"open-file":C(U),onClose:C(ie),onOpenExternal:C(q),onReveal:C(ee)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ue("",!0)],10,VCe)):ue("",!0),ae(WCe,{class:"internal-build-fab"}),to.value?(x(),Se(r0e,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:Bt.value,unavailable:Yt.value,onSelect:le[56]||(le[56]=Te=>Oo(Te)),onToggleStar:le[57]||(le[57]=Te=>C(o).toggleStarModel(Te)),onClose:le[58]||(le[58]=Te=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ue("",!0),sn.value?(x(),Se(Cxe,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":nn.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:le[59]||(le[59]=Te=>C(o).setColorScheme(Te)),onSetAccent:le[60]||(le[60]=Te=>C(o).setAccent(Te)),onSetUiFontSize:le[61]||(le[61]=Te=>C(o).setUiFontSize(Te)),onSetNotify:le[62]||(le[62]=Te=>C(o).setNotifyOnComplete(Te)),onSetNotifyQuestion:le[63]||(le[63]=Te=>C(o).setNotifyOnQuestion(Te)),onSetNotifyApproval:le[64]||(le[64]=Te=>C(o).setNotifyOnApproval(Te)),onSetSound:le[65]||(le[65]=Te=>C(o).setSoundOnComplete(Te)),onSetConversationToc:le[66]||(le[66]=Te=>C(o).setConversationToc(Te)),onUpdateConfig:le[67]||(le[67]=Te=>Bo(Te)),onLogin:le[68]||(le[68]=()=>{sn.value=!1,Jn()}),onLogout:C(o).logout,onOpenOnboarding:le[69]||(le[69]=()=>{sn.value=!1,A()}),onOpenProviders:le[70]||(le[70]=()=>{sn.value=!1,Kn()}),onClose:le[71]||(le[71]=Te=>sn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):ue("",!0),vt.value?(x(),Se(I0e,{key:7,providers:C(o).providers.value,loading:vn.value,unavailable:xn.value,onAdd:le[72]||(le[72]=Te=>li(Te)),onRefresh:le[73]||(le[73]=Te=>Uo(Te)),onDelete:le[74]||(le[74]=Te=>qo(Te)),onOpenLogin:le[75]||(le[75]=()=>{vt.value=!1,Jn()}),onClose:le[76]||(le[76]=Te=>vt.value=!1)},null,8,["providers","loading","unavailable"])):ue("",!0),Qn.value?(x(),Se(Swe,{key:8,status:C(o).status.value,thinking:g.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:le[77]||(le[77]=Te=>Qn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ue("",!0),Bn.value?(x(),Se(awe,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:nt.value,onAdd:le[78]||(le[78]=Te=>ns(Te)),onClose:zt},null,8,["browse-fs","get-fs-home","default-path","error"])):ue("",!0),ae(Ua,{name:"gload-fade"},{default:Ie(()=>[C(o).initialized.value?ue("",!0):(x(),Se(WSe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&v.value&&!C(m)?(x(),Se(FSe,{key:10,onComplete:b,onSkip:b})):ue("",!0),ae(Bwe,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(x(),Se(vCe,{key:11})):ue("",!0),ae(fwe),C(a)?(x(),Se(p_e,{key:12,modelValue:c.value,"onUpdate:modelValue":le[79]||(le[79]=Te=>c.value=Te),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:le[80]||(le[80]=Te=>C(o).selectSession(Te)),onCreate:No,onCreateInWorkspace:le[81]||(le[81]=Te=>di(Te)),onAddWorkspace:le[82]||(le[82]=Te=>Bn.value=!0),onRename:le[83]||(le[83]=(Te,ge)=>C(o).renameSession(Te,ge)),onArchive:le[84]||(le[84]=Te=>As(Te)),onDeleteWorkspace:le[85]||(le[85]=Te=>cs(Te)),onLoadMore:le[86]||(le[86]=Te=>void C(o).loadMoreSessions(Te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ue("",!0),C(a)?(x(),Se(wSe,{key:13,modelValue:u.value,"onUpdate:modelValue":le[87]||(le[87]=Te=>u.value=Te),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:le[88]||(le[88]=Te=>Vn()),onSetThinking:le[89]||(le[89]=Te=>C(o).setThinking(Te)),onTogglePlan:le[90]||(le[90]=Te=>C(o).togglePlanMode()),onToggleSwarm:le[91]||(le[91]=Te=>C(o).toggleSwarmMode()),onSetPermission:le[92]||(le[92]=Te=>C(o).setPermission(Te)),onSetColorScheme:le[93]||(le[93]=Te=>C(o).setColorScheme(Te)),onSetUiFontSize:le[94]||(le[94]=Te=>C(o).setUiFontSize(Te)),onSetConversationToc:le[95]||(le[95]=Te=>C(o).setConversationToc(Te)),onLogin:le[96]||(le[96]=()=>{u.value=!1,Jn()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ue("",!0)],6)),Wn.value?(x(),Se(age,{key:3,"on-start-o-auth-login":ai,"on-poll-o-auth-login":tn,"on-cancel-o-auth-login":qs,onSuccess:io,onClose:le[97]||(le[97]=Te=>Wn.value=!1)})):ue("",!0)]))}}),GCe=dt(KCe,[["__scopeId","data-v-8cd3196b"]]);jie();dm(GCe).use(Rn).mount("#app");export{N9 as $,ZA as A,bI as B,So as C,j4e as D,hA as E,We as F,qk as G,ot as H,ae as I,eI as J,g4e as K,Hi as L,Je as M,j7 as N,b4e as O,x4e as P,S4e as Q,Gp as R,ou as S,_1 as T,w4e as U,Vk as V,k4e as W,K4e as X,_4e as Y,H4e as Z,YCe as _,UA as a,Ho as a$,Mo as a0,Tk as a1,n4e as a2,Fk as a3,bM as a4,Lt as a5,Cu as a6,a4e as a7,Z4e as a8,f4e as a9,GA as aA,II as aB,RI as aC,An as aD,BI as aE,OI as aF,Lf as aG,FI as aH,On as aI,Bk as aJ,iI as aK,x as aL,z7 as aM,r4e as aN,Ln as aO,IA as aP,i4e as aQ,Qp as aR,zo as aS,Gv as aT,oe as aU,F4e as aV,lL as aW,rt as aX,jn as aY,PI as aZ,v4e as a_,m4e as aa,p4e as ab,h4e as ac,B4e as ad,X4e as ae,Jt as af,x7 as ag,x1 as ah,Il as ai,Gr as aj,vo as ak,O4e as al,ei as am,Dl as an,gt as ao,M4e as ap,E4e as aq,Sn as ar,yt as as,A7 as at,Ue as au,C9 as av,on as aw,NI as ax,$I as ay,ho as az,s4e as b,Qte as b$,U4e as b0,sf as b1,sm as b2,W4e as b3,Rl as b4,Y9 as b5,XCe as b6,gr as b7,fI as b8,z4e as b9,Cs as bA,xi as bB,w7 as bC,D4e as bD,et as bE,DA as bF,c4e as bG,pI as bH,N4e as bI,Ie as bJ,C4e as bK,qn as bL,ur as bM,R4e as bN,St as bO,l4e as bP,Mn as bQ,vs as bR,o3e as bS,s3e as bT,aE as bU,i3e as bV,vte as bW,lE as bX,Hy as bY,c3e as bZ,tne as b_,ZCe as ba,R as bb,xp as bc,y4e as bd,fn as be,JCe as bf,QCe as bg,NA as bh,$4e as bi,X9 as bj,C as bk,Bf as bl,Y4e as bm,V4e as bn,K7 as bo,u4e as bp,I4e as bq,hI as br,G4e as bs,A4e as bt,d4e as bu,zA as bv,um as bw,nL as bx,BM as by,cy as bz,P4e as c,U2 as c0,W2 as c1,z2 as c2,d3e as c3,Rm as c4,Gc as c5,Om as c6,Gte as c7,Yte as c8,f3e as c9,u3e as ca,e3e as cb,h3e as cc,K1 as cd,Fs as ce,dne as cf,une as cg,ute as ch,n3e as ci,rte as cj,lte as ck,t3e as cl,q2 as cm,fne as cn,w4 as co,n4 as cp,kte as cq,Bm as cr,Fm as cs,r3e as ct,a3e as cu,J4e as cv,l3e as cw,Ge as cx,Q4e as cy,dt as cz,L4e as d,Ll as e,e4e as f,Ua as g,Z7 as h,t4e as i,o4e as j,Ei as k,$f as l,Fo as m,h1 as n,Yr as o,q4e as p,D as q,dm as r,Se as s,ue as t,E as u,w as v,l7 as w,T4e as x,r7 as y,aL as z};