dimcode-web 0.0.0-stage → 0.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +13 -4
  3. package/release-manifest.json +227 -0
  4. package/web/assets/CodeBlockNode-dNQRJI7x.js +43 -0
  5. package/web/assets/PreCodeBlock-D6Vrdwmh.js +1 -0
  6. package/web/assets/Tooltip-ZLwIccO5.js +1 -0
  7. package/web/assets/andromeeda-C4gqWexZ.js +1 -0
  8. package/web/assets/angular-html-BpR8Pn47.js +1 -0
  9. package/web/assets/arc-DPLvnfEZ.js +1 -0
  10. package/web/assets/architectureDiagram-3BPJPVTR-Dp46r6qo.js +36 -0
  11. package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
  12. package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
  13. package/web/assets/ayu-light-BA47KaF1.js +1 -0
  14. package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
  15. package/web/assets/blockDiagram-GPEHLZMM-CNkSu7fi.js +132 -0
  16. package/web/assets/c-BIGW1oBm.js +1 -0
  17. package/web/assets/c4Diagram-AAUBKEIU-CQpKn4Qu.js +10 -0
  18. package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  19. package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  20. package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  21. package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  22. package/web/assets/channel-CJ35sLov.js +1 -0
  23. package/web/assets/chunk-2J33WTMH-UvZy7f86.js +1 -0
  24. package/web/assets/chunk-4BX2VUAB-BeOeLZBs.js +1 -0
  25. package/web/assets/chunk-55IACEB6-BMehs481.js +1 -0
  26. package/web/assets/chunk-727SXJPM-BRrHfUVX.js +206 -0
  27. package/web/assets/chunk-AQP2D5EJ-DlFPEC70.js +231 -0
  28. package/web/assets/chunk-FMBD7UC4-BmrNedMT.js +15 -0
  29. package/web/assets/chunk-ND2GUHAM-BktGAoA7.js +1 -0
  30. package/web/assets/chunk-QZHKN3VN-Cn0Ufw6g.js +1 -0
  31. package/web/assets/classDiagram-4FO5ZUOK-CjlBIWs5.js +1 -0
  32. package/web/assets/classDiagram-v2-Q7XG4LA2-CjlBIWs5.js +1 -0
  33. package/web/assets/cmake-D1j8_8rp.js +1 -0
  34. package/web/assets/cose-bilkent-S5V4N54A-Bg8zNVyQ.js +1 -0
  35. package/web/assets/cpp-B-lmv-kZ.js +1 -0
  36. package/web/assets/csharp-COcwbKMJ.js +1 -0
  37. package/web/assets/css-DPfMkruS.js +1 -0
  38. package/web/assets/csv-fuZLfV_i.js +1 -0
  39. package/web/assets/cynefin-OW5HDTMX-DK7JR-k7.js +178 -0
  40. package/web/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
  41. package/web/assets/dagre-BM42HDAG-BH4Aku3T.js +4 -0
  42. package/web/assets/dark-plus-C3mMm8J8.js +1 -0
  43. package/web/assets/defaultLocale-DX6XiGOO.js +1 -0
  44. package/web/assets/diagram-2AECGRRQ-C8nUJJQE.js +43 -0
  45. package/web/assets/diagram-5GNKFQAL-PvBz3O1i.js +10 -0
  46. package/web/assets/diagram-KO2AKTUF-CLJk2tgT.js +3 -0
  47. package/web/assets/diagram-LMA3HP47-XYR2Iaou.js +24 -0
  48. package/web/assets/diagram-OG6HWLK6-C6TwDtIj.js +24 -0
  49. package/web/assets/diff-D97Zzqfu.js +1 -0
  50. package/web/assets/docker-BcOcwvcX.js +1 -0
  51. package/web/assets/dracula-BzJJZx-M.js +1 -0
  52. package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
  53. package/web/assets/elixir-CDX3lj18.js +1 -0
  54. package/web/assets/erDiagram-TEJ5UH35-D0IvMBhT.js +85 -0
  55. package/web/assets/erlang-DsQrWhSR.js +1 -0
  56. package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
  57. package/web/assets/everforest-light-C8M2exoo.js +1 -0
  58. package/web/assets/extended-p72mFE2C.js +1 -0
  59. package/web/assets/floating-ui.dom-rMPa4aDr.js +1 -0
  60. package/web/assets/flowDiagram-I6XJVG4X-DCcPqJtr.js +162 -0
  61. package/web/assets/ganttDiagram-6RSMTGT7-Dd6jNilZ.js +292 -0
  62. package/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  63. package/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  64. package/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  65. package/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  66. package/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  67. package/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  68. package/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  69. package/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  70. package/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  71. package/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  72. package/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  73. package/web/assets/gitGraphDiagram-PVQCEYII-dLEYc9sf.js +106 -0
  74. package/web/assets/github-dark-DHJKELXO.js +1 -0
  75. package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
  76. package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  77. package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  78. package/web/assets/github-light-DAi9KRSo.js +1 -0
  79. package/web/assets/github-light-default-D7oLnXFd.js +1 -0
  80. package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  81. package/web/assets/go-CxLEBnE3.js +1 -0
  82. package/web/assets/graph-CAnANduQ.js +1 -0
  83. package/web/assets/graphql-ChdNCCLP.js +1 -0
  84. package/web/assets/groovy-gcz8RCvz.js +1 -0
  85. package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  86. package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  87. package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  88. package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  89. package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  90. package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  91. package/web/assets/haskell-Df6bDoY_.js +1 -0
  92. package/web/assets/hcl-BWvSN4gD.js +1 -0
  93. package/web/assets/horizon-BUw7H-hv.js +1 -0
  94. package/web/assets/horizon-bright-Cn-bp-IR.js +1 -0
  95. package/web/assets/houston-DnULxvSX.js +1 -0
  96. package/web/assets/html-GMplVEZG.js +1 -0
  97. package/web/assets/index-BdrW2KdJ.js +173 -0
  98. package/web/assets/index-CeeeNh8y.css +1 -0
  99. package/web/assets/index-RuQTkZJb.js +220 -0
  100. package/web/assets/index-sbvImgCO.js +329 -0
  101. package/web/assets/index10-CYBa-X9L.js +8 -0
  102. package/web/assets/index5-0ddz3aZZ.js +1 -0
  103. package/web/assets/index6-sINF5Zn7.js +1 -0
  104. package/web/assets/index8-DOHEQLGI.js +2 -0
  105. package/web/assets/index9-BBZwrvIj.js +1 -0
  106. package/web/assets/infoDiagram-5YYISTIA-CsYbsXnr.js +2 -0
  107. package/web/assets/ini-BEwlwnbL.js +1 -0
  108. package/web/assets/init-Gi6I4Gst.js +1 -0
  109. package/web/assets/ishikawaDiagram-YF4QCWOH-BRTrHa87.js +70 -0
  110. package/web/assets/java-CylS5w8V.js +1 -0
  111. package/web/assets/javascript-wDzz0qaB.js +1 -0
  112. package/web/assets/journeyDiagram-JHISSGLW-CA4FF1Bb.js +139 -0
  113. package/web/assets/json-Cp-IABpG.js +1 -0
  114. package/web/assets/json5-C9tS-k6U.js +1 -0
  115. package/web/assets/jsonc-Des-eS-w.js +1 -0
  116. package/web/assets/jsx-g9-lgVsj.js +1 -0
  117. package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  118. package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  119. package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  120. package/web/assets/kanban-definition-UN3LZRKU-CUj3vX_Y.js +89 -0
  121. package/web/assets/katex-C5jXJg4s.js +257 -0
  122. package/web/assets/kotlin-BdnUsdx6.js +1 -0
  123. package/web/assets/laserwave-DUszq2jm.js +1 -0
  124. package/web/assets/latex-CR2LgHuU.js +1 -0
  125. package/web/assets/layout-DGIYPm2g.js +1 -0
  126. package/web/assets/layout-DloY-SLW.js +4 -0
  127. package/web/assets/light-plus-B7mTdjB0.js +1 -0
  128. package/web/assets/linear-DJ-jo7u7.js +1 -0
  129. package/web/assets/lua-BaeVxFsk.js +1 -0
  130. package/web/assets/make-CHLpvVh8.js +1 -0
  131. package/web/assets/markdown-Cvjx9yec.js +1 -0
  132. package/web/assets/markstream-CzP-U2lR.js +7 -0
  133. package/web/assets/material-theme-D5KoaKCx.js +1 -0
  134. package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  135. package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  136. package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
  137. package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  138. package/web/assets/mermaid.core-BvSKTRe8.js +309 -0
  139. package/web/assets/mhchem-MNFFEueS.js +1 -0
  140. package/web/assets/min-dark-CafNBF8u.js +1 -0
  141. package/web/assets/min-light-CTRr51gU.js +1 -0
  142. package/web/assets/mindmap-definition-RKZ34NQL-h3AulNua.js +96 -0
  143. package/web/assets/monokai-D4h5O-jR.js +1 -0
  144. package/web/assets/nginx-BpAMiNFr.js +1 -0
  145. package/web/assets/night-owl-C39BiMTA.js +1 -0
  146. package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
  147. package/web/assets/nord-Ddv68eIx.js +1 -0
  148. package/web/assets/objective-c-DXmwc3jG.js +1 -0
  149. package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  150. package/web/assets/one-light-C3Wv6jpd.js +1 -0
  151. package/web/assets/ordinal-Cboi1Yqb.js +1 -0
  152. package/web/assets/perl-C0TMdlhV.js +1 -0
  153. package/web/assets/php-Dhbhpdrm.js +1 -0
  154. package/web/assets/pieDiagram-4H26LBE5-CPpwBWjO.js +30 -0
  155. package/web/assets/pierre-dark-CyvmCCZW.js +1 -0
  156. package/web/assets/pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js +1 -0
  157. package/web/assets/pierre-dark-soft-BHGpRqa4.js +1 -0
  158. package/web/assets/pierre-dark-tritanopia-Beq2gCRQ.js +1 -0
  159. package/web/assets/pierre-dark-vibrant-BWBVywrn.js +1 -0
  160. package/web/assets/pierre-light-480U9XYS.js +1 -0
  161. package/web/assets/pierre-light-protanopia-deuteranopia-CaVOBURG.js +1 -0
  162. package/web/assets/pierre-light-soft-CVdyfjmI.js +1 -0
  163. package/web/assets/pierre-light-tritanopia-B4_gpKOM.js +1 -0
  164. package/web/assets/pierre-light-vibrant-DdTDNdfJ.js +1 -0
  165. package/web/assets/plastic-3e1v2bzS.js +1 -0
  166. package/web/assets/poimandres-CS3Unz2-.js +1 -0
  167. package/web/assets/powershell-Dpen1YoG.js +1 -0
  168. package/web/assets/preCodeDiffMetrics-6xZ6qvnP.js +1 -0
  169. package/web/assets/proto-C7zT0LnQ.js +1 -0
  170. package/web/assets/python-B6aJPvgy.js +1 -0
  171. package/web/assets/quadrantDiagram-W4KKPZXB-BnLu4itc.js +7 -0
  172. package/web/assets/r-Dspwwk_N.js +1 -0
  173. package/web/assets/red-bN70gL4F.js +1 -0
  174. package/web/assets/regexp-CDVJQ6XC.js +1 -0
  175. package/web/assets/requirementDiagram-4Y6WPE33-jUcosDJE.js +84 -0
  176. package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  177. package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  178. package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
  179. package/web/assets/ruby-BymL1q8G.js +1 -0
  180. package/web/assets/rust-B1yitclQ.js +1 -0
  181. package/web/assets/sankeyDiagram-5OEKKPKP-DSLSRtBi.js +40 -0
  182. package/web/assets/scala-C151Ov-r.js +1 -0
  183. package/web/assets/scss-OYdSNvt2.js +1 -0
  184. package/web/assets/sequenceDiagram-3UESZ5HK-B0cLrDIf.js +162 -0
  185. package/web/assets/shellscript-Yzrsuije.js +1 -0
  186. package/web/assets/slack-dark-BthQWCQV.js +1 -0
  187. package/web/assets/slack-ochin-DqwNpetd.js +1 -0
  188. package/web/assets/snazzy-light-Bw305WKR.js +1 -0
  189. package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
  190. package/web/assets/solarized-light-L9t79GZl.js +1 -0
  191. package/web/assets/sql-BLtJtn59.js +1 -0
  192. package/web/assets/stateDiagram-AJRCARHV-Cm32tcPC.js +1 -0
  193. package/web/assets/stateDiagram-v2-BHNVJYJU-CB0cqS10.js +1 -0
  194. package/web/assets/svelte-DZMnMd3x.js +1 -0
  195. package/web/assets/swift-D82vCrfD.js +1 -0
  196. package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
  197. package/web/assets/timeline-definition-PNZ67QCA-CQKopER7.js +120 -0
  198. package/web/assets/tokyo-night-hegEt444.js +1 -0
  199. package/web/assets/toml-vGWfd6FD.js +1 -0
  200. package/web/assets/tsx-COt5Ahok.js +1 -0
  201. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  202. package/web/assets/unused-optional-NNwleJvF.js +1 -0
  203. package/web/assets/vendor-vue-CrmKjNvT.js +53 -0
  204. package/web/assets/vennDiagram-CIIHVFJN-BH2oewdT.js +34 -0
  205. package/web/assets/vesper-DU1UobuO.js +1 -0
  206. package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  207. package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  208. package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
  209. package/web/assets/vue-DVfSmUF7.js +1 -0
  210. package/web/assets/wardleyDiagram-YWT4CUSO-DLTd3l42.js +78 -0
  211. package/web/assets/xml-sdJ4AIDG.js +1 -0
  212. package/web/assets/xychartDiagram-2RQKCTM6-BPMX-u0w.js +7 -0
  213. package/web/assets/yaml-Buea-lGh.js +1 -0
  214. package/web/assets/zh-CN-BQXM47_T.js +1 -0
  215. package/web/assets/zig-VOosw3JB.js +1 -0
  216. package/web/dimcode-web.json +5 -0
  217. package/web/index.html +44 -0
  218. package/README.md +0 -3
@@ -0,0 +1,220 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-MNFFEueS.js","assets/katex-C5jXJg4s.js","assets/mermaid.core-BvSKTRe8.js","assets/index-BdrW2KdJ.js","assets/vendor-vue-CrmKjNvT.js","assets/index-CeeeNh8y.css","assets/Tooltip-ZLwIccO5.js","assets/PreCodeBlock-D6Vrdwmh.js","assets/CodeBlockNode-dNQRJI7x.js","assets/index6-sINF5Zn7.js","assets/index5-0ddz3aZZ.js","assets/index10-CYBa-X9L.js","assets/index8-DOHEQLGI.js","assets/index9-BBZwrvIj.js"])))=>i.map(i=>d[i]);
2
+ var bb=Object.defineProperty;var xb=(e,t,n)=>t in e?bb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var le=(e,t,n)=>xb(e,typeof t!="symbol"?t+"":t,n);import{_ as wn}from"./index-BdrW2KdJ.js";import{D as Oi,d as Ve,a as J,p as he,b as Re,e as xr,z as He,i as cn,G as Je,H as _t,n as Yr,x as Bt,y as Al,r as be,m as Jg,w as Ie,I as wb,k as dn,o as mo,J as _b,c as je,f as Bi,E as gt,s as Gt,K as Zn,u as L,L as Ra,l as Bs,t as kt,g as hd,v as pd,h as d1,q as gu,M as ch,N as Sb,O as Ib,P as Zr,T as h1,Q as Eb,R as Te,S as fo,U as Mb,V as Ut}from"./vendor-vue-CrmKjNvT.js";var Tb=Object.create,fh=Object.defineProperty,Bb=Object.getOwnPropertyDescriptor,p1=Object.getOwnPropertyNames,Fb=Object.getPrototypeOf,Db=Object.prototype.hasOwnProperty,g1=(e,t)=>function(){return t||(0,e[p1(e)[0]])((t={exports:{}}).exports,t),t.exports},Rb=e=>{let t={};for(var n in e)fh(t,n,{get:e[n],enumerable:!0});return t},Nb=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=p1(t),o=0,l=i.length,s;o<l;o++)s=i[o],!Db.call(e,s)&&s!==n&&fh(e,s,{get:(a=>t[a]).bind(null,s),enumerable:!(r=Bb(t,s))||r.enumerable});return e},m1=(e,t,n)=>(n=e!=null?Tb(Fb(e)):{},Nb(fh(n,"default",{value:e,enumerable:!0}),e));function Lb(e,t,n,r){const i=Number(e[t].meta.id+1).toString();let o="";return typeof r.docId=="string"&&(o=`-${r.docId}-`),o+i}function Ob(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Pb(e,t,n,r,i){const o=i.rules.footnote_anchor_name(e,t,n,r,i),l=i.rules.footnote_caption(e,t,n,r,i);let s=o;return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${o}" id="fnref${s}">${l}</a></sup>`}function $b(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
3
+ `:`<hr class="footnotes-sep">
4
+ `)+`<section class="footnotes">
5
+ <ol class="footnotes-list">
6
+ `}function Hb(){return`</ol>
7
+ </section>
8
+ `}function Wb(e,t,n,r,i){let o=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(o+=`:${e[t].meta.subId}`),`<li id="fn${o}" class="footnote-item">`}function Kb(){return`</li>
9
+ `}function jb(e,t,n,r,i){let o=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(o+=`:${e[t].meta.subId}`),` <a href="#fnref${o}" class="footnote-backref">↩︎</a>`}function zb(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Pb,e.renderer.rules.footnote_block_open=$b,e.renderer.rules.footnote_block_close=Hb,e.renderer.rules.footnote_open=Wb,e.renderer.rules.footnote_close=Kb,e.renderer.rules.footnote_anchor=jb,e.renderer.rules.footnote_caption=Ob,e.renderer.rules.footnote_anchor_name=Lb;function r(s,a,u,c){const p=s.bMarks[a]+s.tShift[a],d=s.eMarks[a];if(p+4>d||s.src.charCodeAt(p)!==91||s.src.charCodeAt(p+1)!==94)return!1;let f;for(f=p+2;f<d;f++){if(s.src.charCodeAt(f)===32)return!1;if(s.src.charCodeAt(f)===93)break}if(f===p+2||f+1>=d||s.src.charCodeAt(++f)!==58)return!1;if(c)return!0;f++,s.env.footnotes||(s.env.footnotes={}),s.env.footnotes.refs||(s.env.footnotes.refs={});const g=s.src.slice(p+2,f-2);s.env.footnotes.refs[`:${g}`]=-1;const m=new s.Token("footnote_reference_open","",1);m.meta={label:g},m.level=s.level++,s.tokens.push(m);const A=s.bMarks[a],v=s.tShift[a],k=s.sCount[a],C=s.parentType,b=f,S=s.sCount[a]+f-(s.bMarks[a]+s.tShift[a]);let T=S;for(;f<d;){const E=s.src.charCodeAt(f);if(n(E))E===9?T+=4-T%4:T++;else break;f++}s.tShift[a]=f-b,s.sCount[a]=T-S,s.bMarks[a]=b,s.blkIndent+=4,s.parentType="footnote",s.sCount[a]<s.blkIndent&&(s.sCount[a]+=s.blkIndent),s.md.block.tokenize(s,a,u,!0),s.parentType=C,s.blkIndent-=4,s.tShift[a]=v,s.sCount[a]=k,s.bMarks[a]=A;const M=new s.Token("footnote_reference_close","",-1);return M.level=--s.level,s.tokens.push(M),!0}function i(s,a){const u=s.posMax,c=s.pos;if(c+2>=u||s.src.charCodeAt(c)!==94||s.src.charCodeAt(c+1)!==91)return!1;const p=c+2,d=t(s,c+1);if(d<0)return!1;if(!a){s.env.footnotes||(s.env.footnotes={}),s.env.footnotes.list||(s.env.footnotes.list=[]);const f=s.env.footnotes.list.length,g=[];s.md.inline.parse(s.src.slice(p,d),s.md,s.env,g);const m=s.push("footnote_ref","",0);m.meta={id:f},s.env.footnotes.list[f]={content:s.src.slice(p,d),tokens:g}}return s.pos=d+1,s.posMax=u,!0}function o(s,a){const u=s.posMax,c=s.pos;if(c+3>u||!s.env.footnotes||!s.env.footnotes.refs||s.src.charCodeAt(c)!==91||s.src.charCodeAt(c+1)!==94)return!1;let p;for(p=c+2;p<u;p++){if(s.src.charCodeAt(p)===32||s.src.charCodeAt(p)===10)return!1;if(s.src.charCodeAt(p)===93)break}if(p===c+2||p>=u)return!1;p++;const d=s.src.slice(c+2,p-1);if(typeof s.env.footnotes.refs[`:${d}`]>"u")return!1;if(!a){s.env.footnotes.list||(s.env.footnotes.list=[]);let f;s.env.footnotes.refs[`:${d}`]<0?(f=s.env.footnotes.list.length,s.env.footnotes.list[f]={label:d,count:0},s.env.footnotes.refs[`:${d}`]=f):f=s.env.footnotes.refs[`:${d}`];const g=s.env.footnotes.list[f].count;s.env.footnotes.list[f].count++;const m=s.push("footnote_ref","",0);m.meta={id:f,subId:g,label:d}}return s.pos=p,s.posMax=u,!0}function l(s){let a,u,c,p=!1;const d={};if(!s.env.footnotes||(s.tokens=s.tokens.filter(function(g){return g.type==="footnote_reference_open"?(p=!0,u=[],c=g.meta.label,!1):g.type==="footnote_reference_close"?(p=!1,d[":"+c]=u,!1):(p&&u.push(g),!p)}),!s.env.footnotes.list))return;const f=s.env.footnotes.list;s.tokens.push(new s.Token("footnote_block_open","",1));for(let g=0,m=f.length;g<m;g++){const A=new s.Token("footnote_open","",1);if(A.meta={id:g,label:f[g].label},s.tokens.push(A),f[g].tokens){a=[];const C=new s.Token("paragraph_open","p",1);C.block=!0,a.push(C);const b=new s.Token("inline","",0);b.children=f[g].tokens,b.content=f[g].content,a.push(b);const S=new s.Token("paragraph_close","p",-1);S.block=!0,a.push(S)}else f[g].label&&(a=d[`:${f[g].label}`]);a&&(s.tokens=s.tokens.concat(a));let v;s.tokens[s.tokens.length-1].type==="paragraph_close"?v=s.tokens.pop():v=null;const k=f[g].count>0?f[g].count:1;for(let C=0;C<k;C++){const b=new s.Token("footnote_anchor","",0);b.meta={id:g,subId:C,label:f[g].label},s.tokens.push(b)}v&&s.tokens.push(v),s.tokens.push(new s.Token("footnote_close","",-1))}s.tokens.push(new s.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",r,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",i),e.inline.ruler.after("footnote_inline","footnote_ref",o),e.core.ruler.after("inline","footnote_tail",l)}function Gb(e){function t(r,i){const o=r.pos,l=r.src.charCodeAt(o);if(i||l!==43)return!1;const s=r.scanDelims(r.pos,!0);let a=s.length;const u=String.fromCharCode(l);if(a<2)return!1;if(a%2){const c=r.push("text","",0);c.content=u,a--}for(let c=0;c<a;c+=2){const p=r.push("text","",0);p.content=u+u,!(!s.can_open&&!s.can_close)&&r.delimiters.push({marker:l,length:0,jump:c/2,token:r.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return r.pos+=s.length,!0}function n(r,i){let o;const l=[],s=i.length;for(let a=0;a<s;a++){const u=i[a];if(u.marker!==43||u.end===-1)continue;const c=i[u.end];o=r.tokens[u.token],o.type="ins_open",o.tag="ins",o.nesting=1,o.markup="++",o.content="",o=r.tokens[c.token],o.type="ins_close",o.tag="ins",o.nesting=-1,o.markup="++",o.content="",r.tokens[c.token-1].type==="text"&&r.tokens[c.token-1].content==="+"&&l.push(c.token-1)}for(;l.length;){const a=l.pop();let u=a+1;for(;u<r.tokens.length&&r.tokens[u].type==="ins_close";)u++;u--,a!==u&&(o=r.tokens[u],r.tokens[u]=r.tokens[a],r.tokens[a]=o)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(r){const i=r.tokens_meta,o=(r.tokens_meta||[]).length;n(r,r.delimiters);for(let l=0;l<o;l++)i[l]&&i[l].delimiters&&n(r,i[l].delimiters)})}function Qb(e){function t(r,i){const o=r.pos,l=r.src.charCodeAt(o);if(i||l!==61)return!1;const s=r.scanDelims(r.pos,!0);let a=s.length;const u=String.fromCharCode(l);if(a<2)return!1;if(a%2){const c=r.push("text","",0);c.content=u,a--}for(let c=0;c<a;c+=2){const p=r.push("text","",0);p.content=u+u,!(!s.can_open&&!s.can_close)&&r.delimiters.push({marker:l,length:0,jump:c/2,token:r.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return r.pos+=s.length,!0}function n(r,i){const o=[],l=i.length;for(let s=0;s<l;s++){const a=i[s];if(a.marker!==61||a.end===-1)continue;const u=i[a.end],c=r.tokens[a.token];c.type="mark_open",c.tag="mark",c.nesting=1,c.markup="==",c.content="";const p=r.tokens[u.token];p.type="mark_close",p.tag="mark",p.nesting=-1,p.markup="==",p.content="",r.tokens[u.token-1].type==="text"&&r.tokens[u.token-1].content==="="&&o.push(u.token-1)}for(;o.length;){const s=o.pop();let a=s+1;for(;a<r.tokens.length&&r.tokens[a].type==="mark_close";)a++;if(a--,s!==a){const u=r.tokens[a];r.tokens[a]=r.tokens[s],r.tokens[s]=u}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(r){let i;const o=r.tokens_meta,l=(r.tokens_meta||[]).length;for(n(r,r.delimiters),i=0;i<l;i++)o[i]&&o[i].delimiters&&n(r,o[i].delimiters)})}const Ub=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Yb(e,t){const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==94||t||r+2>=n)return!1;e.pos=r+1;let i=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){i=!0;break}e.md.inline.skipToken(e)}if(!i||r+1===e.pos)return e.pos=r,!1;const o=e.src.slice(r+1,e.pos);if(o.match(/(^|[^\\])(\\\\)*\s/))return e.pos=r,!1;e.posMax=e.pos,e.pos=r+1;const l=e.push("sup_open","sup",1);l.markup="^";const s=e.push("text","",0);s.content=o.replace(Ub,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function Zb(e){e.inline.ruler.after("emphasis","sup",Yb)}var Vb=g1({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,A){A=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},A),m.core.ruler.after("inline","github-task-lists",function(v){for(var k=v.tokens,C=0,b=2;b<k.length;b++)i(k,b)&&(o(k[b],C,A,v.Token),C+=1,n(k[b-2],"class",A.liClass),n(k[r(k,b-2)],"class",A.ulClass))})};function n(m,A,v){var k=m.attrIndex(A),C=[A,v];k<0?m.attrPush(C):m.attrs[k]=C}function r(m,A){for(var v=m[A].level-1,k=A-1;k>=0;k--)if(m[k].level===v)return k;return-1}function i(m,A){return p(m[A])&&d(m[A-1])&&f(m[A-2])&&g(m[A])}function o(m,A,v,k){var C=v.idPrefix+A;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(s(C,k)),m.children.push(a(k)),m.children.unshift(l(m,C,v,k)),v.divWrap&&(m.children.unshift(u(v,k)),m.children.push(c(k)))}function l(m,A,v,k){var C=new k("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",A]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&C.attrs.push(["checked","true"]),v.disabled===!0&&C.attrs.push(["disabled","true"]),C}function s(m,A){var v=new A("label_open","label",1);return v.attrs=[["for",m]],v}function a(m){return new m("label_close","label",-1)}function u(m,A){var v=new A("checkbox_open","div",0);return v.attrs=[["class",m.divClass]],v}function c(m){return new m("checkbox_close","div",-1)}function p(m){return m.type==="inline"}function d(m){return m.type==="paragraph_open"}function f(m){return m.type==="list_item_open"}function g(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),Jb=m1(Vb());const Xb=161,qb=1114109,ex=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],tx=12288,nx=65510,rx=[12288,12288,65281,65376,65504,65510],ix=8361,ox=65518,lx=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],sx=32,ax=10630,ux=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],cx=4352,fx=262141,A1=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Us=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const i=Math.floor((n+r)/2),o=i*2;if(t<e[o])r=i-1;else if(t>e[o+1])n=i+1;else return!0}return!1},Xg=19968,[dx,hx]=px(A1);function px(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const i=e[r],o=e[r+1];if(Xg>=i&&Xg<=o)return[i,o];o-i>n-t&&(t=i,n=o)}return[t,n]}const gx=e=>e<Xb||e>qb?!1:Us(ex,e),mx=e=>e<tx||e>nx?!1:Us(rx,e),Ax=e=>e<ix||e>ox?!1:Us(lx,e),vx=e=>e<sx||e>ax?!1:Us(ux,e),kx=e=>e>=dx&&e<=hx?!0:e<cx||e>fx?!1:Us(A1,e);function yx(e){return gx(e)?"ambiguous":mx(e)?"fullwidth":Ax(e)?"halfwidth":vx(e)?"narrow":kx(e)?"wide":"neutral"}function Cx(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function bx(e){return Cx(e),yx(e)}function xx(e){return new RegExp("^\\p{Emoji_Presentation}","u").test(String.fromCodePoint(e))}function dh(e){if(e<4352)return!1;switch(bx(e)){case"fullwidth":case"halfwidth":return!0;case"wide":return!xx(e);case"narrow":return!1;case"ambiguous":return null;case"neutral":return new RegExp("^\\p{sc=Hangul}","u").test(String.fromCodePoint(e))}}function wx(e,t){return dh(e)??(t===65025&&n(e));function n(r){return r===8216||r===8217||r===8220||r===8221}}function _x(e){return dh(e)??(917760<=e&&e<=917999)}function Sx(e){return dh(e)??!1}function Ix(e){return e>=65024&&e<=65038}function Ex(e){const t=e.inline.State;class n extends t{scanDelims(i,o){const l=this.posMax,s=this.src.charCodeAt(i),[a,u]=S(this.src,i);let c=a,p=null;Ix(a)&&(p=S(this.src,u)[0],new RegExp("^\\p{Zs}","u").test(String.fromCodePoint(p))||(c=p));let d=i;for(;d<l&&this.src.charCodeAt(d)===s;)d++;const f=d-i,g=d<l?this.src.codePointAt(d):32,m=e.utils.isWhiteSpace(c),A=e.utils.isWhiteSpace(g);if(m||A)return{can_open:!A,can_close:!m,length:f};const v=e.utils.isMdAsciiPunct(c)||e.utils.isPunctChar(String.fromCodePoint(c)),k=e.utils.isMdAsciiPunct(g)||e.utils.isPunctChar(String.fromCodePoint(g));let C=v,b=k;if(o){const T=Sx(g)||(p!==null?wx(p,a):_x(a));C||(C=T||!k),b||(b=T||!v)}return{can_open:C,can_close:b,length:f};function S(T,M){if(M<=0)return[32,-1];const E=T.charCodeAt(M-1);if((E&64512)!==56320)return[E,M-1];const $=T.codePointAt(M-2);return $>65535?[$,M-2]:[E,M-1]}}}e.inline.State=n}const Mx=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]]);function Tx(e){return e>=55296&&e<=57343||e>1114111?65533:Mx.get(e)??e}function Bx(e){const t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let i=0,o=0;i<n;i+=2){const l=t.charCodeAt(i),s=t.charCodeAt(i+1);r[o++]=l|s<<8}return r}const Fx=Bx("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var Fn;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Fn||(Fn={}));var Yt;(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"})(Yt||(Yt={}));const qg=32;function gd(e){return e>=Yt.ZERO&&e<=Yt.NINE}function Dx(e){return e>=Yt.UPPER_A&&e<=Yt.UPPER_F||e>=Yt.LOWER_A&&e<=Yt.LOWER_F}function Rx(e){return e>=Yt.UPPER_A&&e<=Yt.UPPER_Z||e>=Yt.LOWER_A&&e<=Yt.LOWER_Z||gd(e)}function Nx(e){return e===Yt.EQUALS||Rx(e)}var fn;(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"})(fn||(fn={}));var Ci;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ci||(Ci={}));var Lx=class{constructor(e,t,n){le(this,"decodeTree");le(this,"emitCodePoint");le(this,"errors");le(this,"state",fn.EntityStart);le(this,"consumed",1);le(this,"result",0);le(this,"treeIndex",0);le(this,"excess",1);le(this,"decodeMode",Ci.Strict);le(this,"runConsumed",0);this.decodeTree=e,this.emitCodePoint=t,this.errors=n}startEntity(e){this.decodeMode=e,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case fn.EntityStart:return e.charCodeAt(t)===Yt.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(e,t));case fn.NumericStart:return this.stateNumericStart(e,t);case fn.NumericDecimal:return this.stateNumericDecimal(e,t);case fn.NumericHex:return this.stateNumericHex(e,t);case fn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|qg)===Yt.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){const n=e.charCodeAt(t);if(gd(n)||Dx(n)){const r=n<=Yt.NINE?n-Yt.ZERO:(n|qg)-Yt.LOWER_A+10;this.result=this.result*16+r,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){const n=e.charCodeAt(t);if(gd(n))this.result=this.result*10+(n-Yt.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Yt.SEMI)this.consumed+=1;else if(this.decodeMode===Ci.Strict)return 0;return this.emitCodePoint(Tx(this.result),this.consumed),this.errors&&(e!==Yt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&Fn.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&Fn.FLAG13)!==0){const l=(r&Fn.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const s=r&Fn.JUMP_TABLE;if(e.charCodeAt(t)!==s)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<l;){if(t>=e.length)return-1;const s=this.runConsumed-1,a=n[this.treeIndex+1+(s>>1)],u=s%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(l>>1),r=n[this.treeIndex],i=(r&Fn.VALUE_LENGTH)>>14}if(t>=e.length)break;const o=e.charCodeAt(t);if(o===Yt.SEMI&&i!==0&&(r&Fn.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=Px(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===Ci.Attribute&&(i===0||Nx(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Fn.VALUE_LENGTH)>>14,i!==0){if(o===Yt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ci.Strict&&(r&Fn.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var r;const{result:e,decodeTree:t}=this,n=(t[e]&Fn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),(r=this.errors)==null||r.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(Fn.VALUE_LENGTH|Fn.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ci.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}};function Ox(e){let t="";const n=new Lx(e,r=>t+=String.fromCodePoint(r));return function(i,o){let l=0,s=0;for(;(s=i.indexOf("&",s))>=0;){t+=i.slice(l,s),n.startEntity(o);const u=n.write(i,s+1);if(u<0){l=s+n.end();break}l=s+u,s=u===0?l+1:l}const a=t+i.slice(l);return t="",a}}function Px(e,t,n,r){const i=(t&Fn.BRANCH_LENGTH)>>7,o=t&Fn.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const u=r-o;return u<0||u>=i?-1:e[n+u]-1}const l=i+1>>1;let s=0,a=i-1;for(;s<=a;){const u=s+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(c<r)s=u+1;else if(c>r)a=u-1;else return e[n+l+u]}return-1}const $x=Ox(Fx);function hh(e,t=Ci.Legacy){return $x(e,t)}const em={};function Hx(e){let t=em[e];if(t)return t;t=em[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function Qu(e,t){typeof t!="string"&&(t=Qu.defaultChars);const n=Hx(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,l=r.length;o<l;o+=3){const s=parseInt(r.slice(o+1,o+3),16);if(s<128){i+=n[s];continue}if((s&224)===192&&o+3<l){const a=parseInt(r.slice(o+4,o+6),16);if((a&192)===128){const u=s<<6&1984|a&63;u<128?i+="��":i+=String.fromCharCode(u),o+=3;continue}}if((s&240)===224&&o+6<l){const a=parseInt(r.slice(o+4,o+6),16),u=parseInt(r.slice(o+7,o+9),16);if((a&192)===128&&(u&192)===128){const c=s<<12&61440|a<<6&4032|u&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),o+=6;continue}}if((s&248)===240&&o+9<l){const a=parseInt(r.slice(o+4,o+6),16),u=parseInt(r.slice(o+7,o+9),16),c=parseInt(r.slice(o+10,o+12),16);if((a&192)===128&&(u&192)===128&&(c&192)===128){let p=s<<18&1835008|a<<12&258048|u<<6&4032|c&63;p<65536||p>1114111?i+="����":(p-=65536,i+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),o+=9;continue}}i+="�"}return i})}Qu.defaultChars=";/?:@&=+$,#";Qu.componentChars="";var md=Qu;const tm={};function Wx(e){let t=tm[e];if(t)return t;t=tm[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):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 Uu(e,t,n){typeof t!="string"&&(n=t,t=Uu.defaultChars),typeof n>"u"&&(n=!0);const r=Wx(t);let i="";for(let o=0,l=e.length;o<l;o++){const s=e.charCodeAt(o);if(n&&s===37&&o+2<l&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){i+=e.slice(o,o+3),o+=2;continue}if(s<128){i+=r[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<l){const a=e.charCodeAt(o+1);if(a>=56320&&a<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}Uu.defaultChars=";/?:@&=+$,-_.!~*'()#";Uu.componentChars="-_.!~*'()";var v1=Uu;function ph(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 mu(){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 Kx=/^([a-z0-9.+-]+:)/i,jx=/:[0-9]*$/,zx=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Gx=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
10
+ `," "]),Qx=["'"].concat(Gx),nm=["%","/","?",";","#"].concat(Qx),rm=["/","?","#"],Ux=255,im=/^[+a-z0-9A-Z_-]{0,63}$/,Yx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,om={javascript:!0,"javascript:":!0},lm={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Zx(e,t){if(e&&e instanceof mu)return e;const n=new mu;return n.parse(e,t),n}mu.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const u=zx.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let l=Kx.exec(o);if(l&&(l=l[0],n=l.toLowerCase(),this.protocol=l,o=o.substr(l.length)),(t||l||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(l&&om[l])&&(o=o.substr(2),this.slashes=!0)),!om[l]&&(i||l&&!lm[l])){let u=-1;for(let g=0;g<rm.length;g++)r=o.indexOf(rm[g]),r!==-1&&(u===-1||r<u)&&(u=r);let c,p;u===-1?p=o.lastIndexOf("@"):p=o.lastIndexOf("@",u),p!==-1&&(c=o.slice(0,p),o=o.slice(p+1),this.auth=c),u=-1;for(let g=0;g<nm.length;g++)r=o.indexOf(nm[g]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=o.length),o[u-1]===":"&&u--;const d=o.slice(0,u);o=o.slice(u),this.parseHost(d),this.hostname=this.hostname||"";const f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){const g=this.hostname.split(/\./);for(let m=0,A=g.length;m<A;m++){const v=g[m];if(v&&!v.match(im)){let k="";for(let C=0,b=v.length;C<b;C++)v.charCodeAt(C)>127?k+="x":k+=v[C];if(!k.match(im)){const C=g.slice(0,m),b=g.slice(m+1),S=v.match(Yx);S&&(C.push(S[1]),b.unshift(S[2])),b.length&&(o=b.join(".")+o),this.hostname=C.join(".");break}}}}this.hostname.length>Ux&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=o.indexOf("#");s!==-1&&(this.hash=o.substr(s),o=o.slice(0,s));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),lm[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};mu.prototype.parseHost=function(e){let t=jx.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 gh=Zx,k1=Rb({decode:()=>md,encode:()=>v1,format:()=>ph,parse:()=>gh}),Vx=Object.defineProperty,y1=e=>{let t={};for(var n in e)Vx(t,n,{get:e[n],enumerable:!0});return t},un=class{constructor(e,t,n){le(this,"type");le(this,"tag");le(this,"attrs");le(this,"map");le(this,"nesting");le(this,"level");le(this,"children");le(this,"content");le(this,"markup");le(this,"info");le(this,"meta");le(this,"block");le(this,"hidden");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,r=t.length;n<r;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),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}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}`}},Jx=y1({arrayReplaceAt:()=>iw,assign:()=>nw,countLines:()=>Qt,escapeHtml:()=>hw,escapeRE:()=>gw,fromCodePoint:()=>Rs,has:()=>tw,isMdAsciiPunct:()=>b1,isPunctChar:()=>C1,isPunctCode:()=>Ds,isSpace:()=>rw,isString:()=>qx,isValidEntityCode:()=>Zu,isWhiteSpace:()=>Fs,lib:()=>mw,mdurl:()=>k1,normalizeReference:()=>Yu,ucmicro:()=>Au,unescapeAll:()=>Ns,unescapeMd:()=>aw});const Au={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\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]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,S:/[\$\+<->\^`\|~\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]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Xx(e){return Object.prototype.toString.call(e)}function qx(e){return Xx(e)==="[object String]"}const ew=Object.prototype.hasOwnProperty;function tw(e,t){return ew.call(e,t)}function nw(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(r=>{e[r]=n[r]})}}),e}function rw(e){return e===9||e===32}function Fs(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 C1(e){return Au.P.test(e)||Au.S.test(e)}const sm=new Map;function Ds(e){if(b1(e))return!0;if(e>=0&&e<128)return!1;const t=sm.get(e);if(t!==void 0)return t;const n=C1(String.fromCharCode(e));return sm.set(e,n),n}function b1(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 Yu(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function iw(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Zu(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 Rs(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 x1=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,ow=new RegExp(`${x1.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),lw=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function sw(e,t){if(t.charCodeAt(0)===35&&lw.test(t)){const r=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Zu(r)?Rs(r):e}const n=hh(e);return n!==e?n:e}function aw(e){return e.includes("\\")?e.replace(x1,"$1"):e}function Ns(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(ow,(t,n,r)=>n||sw(t,r))}const uw=/[&<>"]/,cw=/[&<>"]/g,fw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function dw(e){return fw[e]}function hw(e){return uw.test(e)?e.replace(cw,dw):e}const pw=/[.?*+^$[\]\\(){}|-]/g;function gw(e){return e.replace(pw,"\\$&")}const mw={mdurl:k1,ucmicro:Au};function Qt(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
11
+ `,n+1))!==-1;)t++;return t}const Aw=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,vw=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,mh=["references","footnotes","abbreviations","abbr","abbrs"],Ah=Symbol.for("markdown-it-ts.global-state"),vh=Object.prototype.hasOwnProperty;function kw(e){const t=e.length;let n=0;for(;n<t;){const r=e.indexOf("[",n);if(r===-1)return!1;let i=0,o=r-1;for(;o>=0&&e.charCodeAt(o)!==10;){const l=e.charCodeAt(o);if(l===32||l===9){i++,o--;continue}break}if((o<0||e.charCodeAt(o)===10)&&i<=3&&e.charCodeAt(r+1)!==94){let l=r+1;if(l>=t||e.charCodeAt(l)===93){n=r+1;continue}for(;l<t;){const s=e.charCodeAt(l);if(s===93){let a=l+1;for(;a<t&&(e.charCodeAt(a)===32||e.charCodeAt(a)===9);)a++;if(a<t&&e.charCodeAt(a)===58)return!0;break}if(s===91)break;if(s===92){l+=2;continue}l++}}n=r+1}return!1}function am(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function wr(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ii(e){if(Array.isArray(e))return e.map(t=>Ii(t));if(wr(e)){const t={};for(const n of Object.keys(e))t[n]=Ii(e[n]);return t}return e}function vu(e){return Array.isArray(e)?e.map((t,n)=>String(n)):wr(e)?Object.keys(e):[]}function Ad(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(!Ad(e[n],t[n]))return!1;return!0}if(wr(e)||wr(t)){if(!wr(e)||!wr(t))return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!vh.call(t,i)||!Ad(e[i],t[i]))return!1;return!0}return Object.is(e,t)}function w1(e,t){if(Array.isArray(e))return e[Number(t)];if(wr(e))return e[t]}function yw(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Ii(t[n]);return e}if(wr(e)&&wr(t)){for(const n of Object.keys(e))vh.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Ii(t[n]);return e}return Ii(t)}function Cw(e,t,n){const r=n.ownedKeys??[],i=e[t];if(wr(i)||Array.isArray(i)){const o=new Set(vu(n.value));for(const l of r)n.existed&&o.has(l)?i[l]=Ii(w1(n.value,l)):delete i[l];!n.existed&&vu(i).length===0&&delete e[t];return}n.existed?e[t]=Ii(n.value):delete e[t]}function kh(e){const t=e[Ah];return am(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&am(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function bw(e,t){Object.defineProperty(e,Ah,{value:t,enumerable:!1,configurable:!0,writable:!0})}function _i(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Aw.test(e)?"footnote-definition":vw.test(e)?"abbreviation-definition":kw(e)?"reference-definition":null}function Ys(e){var t;return((t=kh(e))==null?void 0:t.reason)??null}function il(e,t,n){if(Ys(e)&&Xr(e),!t)return n();yh(e,t);try{const r=n();return Ch(e),r}catch(r){throw Xr(e),r}}function yh(e,t){try{Xr(e);const n={};for(const r of mh)n[r]=vh.call(e,r)?{existed:!0,value:Ii(e[r])}:{existed:!1};bw(e,{reason:t,snapshot:n})}catch{}}function Ch(e){const t=kh(e);if(t)for(const n of mh){const r=t.snapshot[n];if(!r)continue;r.ownedKeys=[];const i=e[n];if(!wr(i)&&!Array.isArray(i))continue;const o=new Set(vu(r.existed?r.value:void 0));r.ownedKeys=vu(i).filter(l=>o.has(l)?!Ad(i[l],w1(r.value,l)):!0)}}function Xr(e){const t=kh(e);if(t){for(const n of mh){const r=t.snapshot[n];if(!r){delete e[n];continue}if(r.ownedKeys){Cw(e,n,r);continue}r.existed?e[n]=yw(e[n],r.value):delete e[n]}delete e[Ah]}}function vf(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 vd=Symbol.for("markdown-it-ts.diagnostics");function Zs(e,t){if(e)try{const n=e[vd];if(n&&typeof n=="object")return n;if(!t)return;const r={};return e[vd]=r,r}catch{return}}function ar(e){return Zs(e,!1)}function xw(e){if(e)try{const t=e[vd];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Dn(e){xw(e)}function Jl(e,t){const n=Zs(e,!0);n&&(n.stockFast=t)}function ln(e,t){const n=Zs(e,!0);n&&(n.strategy=t)}function kf(e,t){const n=Zs(e,!0);n&&(n.chunk=t)}function _1(e,t){const n=Zs(e,!0);n&&(n.unbounded=t)}const ww=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_w=/[\0-\x1F\x7F-\x9F]/,Sw=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\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[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\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\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,Iw=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Ew=class{constructor(e={}){le(this,"src_Any",ww.source);le(this,"src_Cc",_w.source);le(this,"src_Z",Iw.source);le(this,"src_P",Sw.source);le(this,"src_ZPCc",[this.src_Z,this.src_P,this.src_Cc].join("|"));le(this,"src_ZCc",[this.src_Z,this.src_Cc].join("|"));le(this,"cache",{});le(this,"opts",{maxLength:1e4,urlAuth:!1,schema_names:[]});this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const r=this.escapeRE(e),i=this.escapeRE(t),o=`(?:(?!${this.src_ZCc}|${r}|${i}).)`;let l=`${r}${o}{0,1000}${i}`;for(let s=2;s<=n;s++)l=`${r}(?:${o}|${l}){0,1000}${i}`;return l}get_text_separators(){var e;return(e=this.cache).text_separators??(e.text_separators=/[><\uff5c]/)}get_pseudo_letter(){var e;return(e=this.cache).src_pseudo_letter??(e.src_pseudo_letter=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`))}get_ipv4_addr(){var e;return(e=this.cache).src_ip4??(e.src_ip4=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"))}get_ipv6_addr(){var n;const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return(n=this.cache).src_ip6_addr??(n.src_ip6_addr=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`))}get_ipv6_url_host(){var e;return(e=this.cache).src_ip6_host??(e.src_ip6_host=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`))}get_ipv6_mail_host(){var e;return(e=this.cache).src_ipv6_mail_host??(e.src_ipv6_mail_host=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`))}get_auth(){var e;return(e=this.cache).src_auth??(e.src_auth=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`))}get_port(){var e;return(e=this.cache).src_port??(e.src_port=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"))}get_host_terminator(){var e;return(e=this.cache).src_host_terminator??(e.src_host_terminator=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`))}get_path_terminator(){var e;return(e=this.cache).src_path_terminator??(e.src_path_terminator=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`))}get_path(){var e;return(e=this.cache).src_path??(e.src_path=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`))}get_mail_name(){var e;return(e=this.cache).src_mail_name??(e.src_mail_name=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}"))}get_xn(){var e;return(e=this.cache).src_xn??(e.src_xn=new RegExp("xn--[a-z0-9\\-]{1,59}"))}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){var e;return(e=this.cache).src_domain_root??(e.src_domain_root=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`))}get_domain(){var e;return(e=this.cache).src_domain??(e.src_domain=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`))}get_url_host_port(){var e;return(e=this.cache).url_host_port??(e.url_host_port=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source))}get_fuzzy_url_host_port(){var e;return(e=this.cache).fuzzy_url_host_port??(e.fuzzy_url_host_port=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source))}get_mail_host(){var e;return(e=this.cache).src_mail_host??(e.src_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source))}get_fuzzy_mail_host(){var e;return(e=this.cache).src_fuzzy_mail_host??(e.src_fuzzy_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source))}get_path_extra(){var e;return(e=this.cache).src_path_extra??(e.src_path_extra=new RegExp(""))}get_fuzzy_mail_host_search(){var e;return(e=this.cache).mail_fuzzy_host_search??(e.mail_fuzzy_host_search=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig"))}get_fuzzy_link_search(){var e;return(e=this.cache).link_fuzzy_search??(e.link_fuzzy_search=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig"))}get_http_validator(){var e;return(e=this.cache).http_validator??(e.http_validator=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy"))}get_relative_proto_validator(){var e;return(e=this.cache).relative_proto_validator??(e.relative_proto_validator=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy"))}get_mail_name_validator(){var e;return(e=this.cache).mail_name_validator??(e.mail_name_validator=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`))}get_mailto_validator(){var e;return(e=this.cache).mailto_validator??(e.mailto_validator=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy"))}get_schema_names(){var e;return(e=this.cache).schema_names??(e.schema_names=new RegExp((this.opts.schema_names||[]).map(t=>this.escapeRE(t)).join("|")))}get_schema_search(){var e;return(e=this.cache).schema_search??(e.schema_search=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig"))}get_schema_at_start(){var e;return(e=this.cache).schema_at_start??(e.schema_at_start=new RegExp(`^${this.get_schema_search().source}`,"i"))}},yf={validate:(e,t,n)=>{const r=n.re.get_http_validator();r.lastIndex=t;const i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)},Mw={"http:":yf,"https:":yf,"ftp:":yf,"//":{validate:function(e,t,n){const r=n.re.get_relative_proto_validator();r.lastIndex=t;const i=r.exec(e);return i?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const r=n.re.get_mailto_validator();r.lastIndex=t;const i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)}},Tw="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|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Bw="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Fw(){const e=Bw.split("|");return Tw.split("|").forEach(t=>{const n=t.indexOf(":"),r=t.slice(0,n);for(const i of t.slice(n+1))e.push(r+i)}),e}var Dw={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Fw(),urlAuth:!1,maxLength:1e4},um=class{constructor(e,t,n,r){le(this,"schema");le(this,"index");le(this,"lastIndex");le(this,"raw");le(this,"text");le(this,"url");const i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}},S1=class{constructor(e={}){le(this,"__opts__");le(this,"__schemas__");le(this,"re");const{rebuilder:t,...n}=e;this.__opts__={...Dw,...n},this.__schemas__={...Mw},this.re=t||new Ew,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(r,i)=>i.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const r=this.re.get_fuzzy_mail_host_search(),i=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){const o=e.slice(Math.max(0,t.index-65),t.index);if(i.test(o))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let r,i,o,l,s,a,u=!1,c=!1,p=!1,d=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(i=this.re.get_fuzzy_mail_host_search(),i.lastIndex=0,o=this.re.get_mail_name_validator());;){const f=Math.max(d-1,0);if(i&&o&&!p&&(!s||s.index<d))for(i.lastIndex<f&&(i.lastIndex=f);;){const k=i.exec(e);if(!k){p=!0,s=void 0;break}const C=o.exec(e.slice(Math.max(0,k.index-65),k.index));if(C){if(s={schema:"mailto:",index:k.index-C[1].length,lastIndex:k.index+k[0].length},s.index>=d)break;i.lastIndex<f&&(i.lastIndex=f)}}if(r&&!c&&(!l||l.index<d))for(r.lastIndex<f&&(r.lastIndex=f);;){const k=r.exec(e);if(!k){c=!0,l=void 0;break}if(l={schema:"",index:k.index+k[1].length,lastIndex:k.index+k[0].length},l.index>=d)break;r.lastIndex<f&&(r.lastIndex=f)}let g=s;(!g||l&&(l.index<g.index||l.index===g.index&&l.lastIndex>g.lastIndex))&&(g=l);let m;if(!u)for(;;){if(!a){n.lastIndex<f&&(n.lastIndex=f);const b=n.exec(e);if(!b){u=!0;break}a={schema:b[2],index:b.index+b[1].length,lastIndex:b.index+b[0].length}}if(a.index<d){a=void 0;continue}if(g&&a.index>g.index)break;const k=a;a=void 0;const C=this.testSchemaAt(e,k.schema,k.lastIndex);if(C){m={schema:k.schema,index:k.index,lastIndex:k.lastIndex+C};break}}let A=m;if((!A||s&&(s.index<A.index||s.index===A.index&&s.lastIndex>A.lastIndex))&&(A=s),(!A||l&&(l.index<A.index||l.index===A.index&&l.lastIndex>A.lastIndex))&&(A=l),!A)break;A===s?s=void 0:A===l&&(l=void 0);const v=new um(e,A.schema,A.index,A.lastIndex);v.schema?this.__schemas__[v.schema].normalize(v,this):this.normalize(v),t.push(v),d=A.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new um(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Rw=g1({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const p=/^xn--/,d=/[^\0-\x7F]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,A=Math.floor,v=String.fromCharCode;function k(_){throw new RangeError(g[_])}function C(_,W){const z=[];let N=_.length;for(;N--;)z[N]=W(_[N]);return z}function b(_,W){const z=_.split("@");let N="";z.length>1&&(N=z[0]+"@",_=z[1]),_=_.replace(f,".");const R=C(_.split("."),W).join(".");return N+R}function S(_){const W=[];let z=0;const N=_.length;for(;z<N;){const R=_.charCodeAt(z++);if(R>=55296&&R<=56319&&z<N){const oe=_.charCodeAt(z++);(oe&64512)==56320?W.push(((R&1023)<<10)+(oe&1023)+65536):(W.push(R),z--)}else W.push(R)}return W}const T=_=>String.fromCodePoint(..._),M=function(_){return _>=48&&_<58?26+(_-48):_>=65&&_<91?_-65:_>=97&&_<123?_-97:36},E=function(_,W){return _+22+75*(_<26)-((W!=0)<<5)},$=function(_,W,z){let N=0;for(_=z?A(_/700):_>>1,_+=A(_/W);_>m*26>>1;N+=36)_=A(_/m);return A(N+(m+1)*_/(_+38))},X=function(_){const W=[],z=_.length;let N=0,R=128,oe=72,ne=_.lastIndexOf("-");ne<0&&(ne=0);for(let ee=0;ee<ne;++ee)_.charCodeAt(ee)>=128&&k("not-basic"),W.push(_.charCodeAt(ee));for(let ee=ne>0?ne+1:0;ee<z;){const ie=N;for(let Q=1,te=36;;te+=36){ee>=z&&k("invalid-input");const re=M(_.charCodeAt(ee++));re>=36&&k("invalid-input"),re>A((2147483647-N)/Q)&&k("overflow"),N+=re*Q;const pe=te<=oe?1:te>=oe+26?26:te-oe;if(re<pe)break;const ce=36-pe;Q>A(2147483647/ce)&&k("overflow"),Q*=ce}const G=W.length+1;oe=$(N-ie,G,ie==0),A(N/G)>2147483647-R&&k("overflow"),R+=A(N/G),N%=G,W.splice(N++,0,R)}return String.fromCodePoint(...W)},K=function(_){const W=[];_=S(_);const z=_.length;let N=128,R=0,oe=72;for(const ie of _)ie<128&&W.push(v(ie));const ne=W.length;let ee=ne;for(ne&&W.push("-");ee<z;){let ie=2147483647;for(const Q of _)Q>=N&&Q<ie&&(ie=Q);const G=ee+1;ie-N>A((2147483647-R)/G)&&k("overflow"),R+=(ie-N)*G,N=ie;for(const Q of _)if(Q<N&&++R>2147483647&&k("overflow"),Q===N){let te=R;for(let re=36;;re+=36){const pe=re<=oe?1:re>=oe+26?26:re-oe;if(te<pe)break;const ce=te-pe,Ce=36-pe;W.push(v(E(pe+ce%Ce,0))),te=A(ce/Ce)}W.push(v(E(te,0))),oe=$(R,G,ee===ne),R=0,++ee}++R,++N}return W.join("")},P={version:"2.3.1",ucs2:{decode:S,encode:T},decode:X,encode:K,toASCII:function(_){return b(_,function(W){return d.test(W)?"xn--"+K(W):W})},toUnicode:function(_){return b(_,function(W){return p.test(W)?X(W.slice(4).toLowerCase()):W})}};t.exports=P})}),I1=m1(Rw());function bh(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=Ns(e.slice(t+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let l=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(l++,l>32))return o;if(r===41){if(l===0)break;l--}i++}return t===i||l!==0||(o.str=Ns(e.slice(t,i)),o.pos=i,o.ok=!0),o}var E1=bh;const ru=-2;function Nw(e,t,n,r){let i=1,o=t+1;for(;o<n;){const l=e.charCodeAt(o);if(l===93){if(i--,i===0)return o;if(r){const s=o+1<n?e.charCodeAt(o+1):0;if(s===40||s===91)return ru}o++;continue}if(l===92){o+=2;continue}if(l===96||l===60||l===33&&o+1<n&&e.charCodeAt(o+1)===91)return ru;if(l===91){i++,o++;continue}o++}return-1}function xh(e,t,n){let r=1,i=!1,o,l;const s=e.src,a=e.posMax,u=e.pos,c=e.linkLabelNoCloseFrom;if(c>=0&&t+1>=c)return-1;const p=s.indexOf("]",t+1);if(p<0||p>=a)return e.linkLabelNoCloseFrom=t+1,-1;const d=Nw(s,t,a,n);if(d!==ru)return d;for(e.pos=t+1;e.pos<a;){if(o=s.charCodeAt(e.pos),o===93&&(r--,r===0)){i=!0;break}if(l=e.pos,e.md.inline.skipToken(e),o===91){if(l===e.pos-1)r++;else if(n)return e.pos=u,-1}}let f=-1;return i&&(f=e.pos),e.pos=u,f}var ku=xh;function wh(e,t,n,r){let i,o=t;const l={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)l.str=r.str,l.marker=r.marker;else{if(o>=n)return l;let s=e.charCodeAt(o);if(s!==34&&s!==39&&s!==40)return l;t++,o++,s===40&&(s=41),l.marker=s}for(;o<n;){if(i=e.charCodeAt(o),i===l.marker)return l.pos=o+1,l.str+=Ns(e.slice(t,o)),l.ok=!0,l;if(i===40&&l.marker===41)return l;i===92&&o+1<n&&o++,o++}return l.can_continue=!0,l.str+=Ns(e.slice(t,o)),l}var M1=wh;function Vu(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 _h(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function Lw(e,t,n){const r=Vu(e,t),i=[t,n];r<0?_h(e,i):e.attrs[r]=i}function Ow(e,t){const n=Vu(e,t);return n>=0?e.attrs[n][1]:null}function Pw(e,t,n){const r=Vu(e,t);r<0?_h(e,[t,n]):e.attrs[r][1]=`${e.attrs[r][1]} ${n}`}var $w=y1({attrGet:()=>Ow,attrIndex:()=>Vu,attrJoin:()=>Pw,attrPush:()=>_h,attrSet:()=>Lw,parseLinkDestination:()=>bh,parseLinkLabel:()=>xh,parseLinkTitle:()=>wh});function Hw(e){return e.includes("\r")||e.includes("\0")}function T1(e){return typeof e=="string"?e:e.toString()}function kd(e){if(e.inlineMode){const t=new un("inline","",0);t.content=T1(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 Ww=/^([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])?)*)$/,Kw=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function jw(e,t){let n=e.pos;const r=e.src;if(r.charCodeAt(n)!==60)return!1;const i=n,o=e.posMax;for(;;){if(++n>=o)return!1;const s=r.charCodeAt(n);if(s===60)return!1;if(s===62)break}const l=r.slice(i+1,n);if(Kw.test(l)){const s=e.md.normalizeLink(l);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(l);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=l.length+2,!0}if(Ww.test(l)){const s=e.md.normalizeLink(`mailto:${l}`);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(l);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=l.length+2,!0}return!1}var B1=jw;function zw(e,t){const n=e.src;let r=e.pos;if(n.charCodeAt(r)!==96)return!1;const i=r;r++;const o=e.posMax;for(;r<o&&n.charCodeAt(r)===96;)r++;const l=n.slice(i,r),s=l.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=l),e.pos+=s,!0;let a=r,u;for(;(u=n.indexOf("`",a))!==-1;){for(a=u+1;a<o&&n.charCodeAt(a)===96;)a++;const c=a-u;if(c===s){if(!t){const p=e.push("code_inline","code",0);p.markup=l;let d=n.slice(r,u);d.includes(`
12
+ `)&&(d=d.replace(/\n/g," ")),d.length>2&&d.charCodeAt(0)===32&&d.charCodeAt(d.length-1)===32&&(d=d.slice(1,-1)),p.content=d}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=l),e.pos+=s,!0}var F1=zw;function cm(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let l=0;l<n;l++){const s=e[l];if(o.push(0),(e[r].marker!==s.marker||i!==s.token-1)&&(r=l),i=s.token,s.length=s.length||0,!s.close)continue;Object.prototype.hasOwnProperty.call(t,s.marker)||(t[s.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[s.marker][(s.open?3:0)+s.length%3];let u=r-o[r]-1,c=u;for(;u>a;u-=o[u]+1){const p=e[u];if(p.marker===s.marker&&p.open&&p.end<0){let d=!1;if((p.close||s.open)&&(p.length+s.length)%3===0&&(p.length%3!==0||s.length%3!==0)&&(d=!0),!d){const f=u>0&&!e[u-1].open?o[u-1]+1:0;o[l]=l-u+f,o[u]=f,s.open=!1,p.end=l,p.close=!1,c=-1,i=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function Gw(e){const t=e.tokens_meta,n=e.tokens_meta.length;cm(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&cm(t[r].delimiters)}var Qw=Gw;const D1="*",R1="_";function Uw(e,t){if(t)return!1;const n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;const r=e.scanDelims(e.pos,n===42);if(!r||r.length===0)return!1;const i=n===42?D1:R1,o=r.length,l=r.can_open,s=r.can_close,a=e.tokens,u=e.delimiters;for(let c=0;c<o;c++){const p=e.push("text","",0);p.content=i,u.push({marker:n,length:o,token:a.length-1,end:-1,open:l,close:s})}return e.pos+=o,!0}function fm(e,t){const n=t.length,r=e.tokens;for(let i=n-1;i>=0;i--){const o=t[i],l=o.marker;if(l!==95&&l!==42||o.end===-1)continue;const s=t[o.end],a=o.token,u=s.token,c=i>0&&t[i-1].end===o.end+1&&t[i-1].marker===l&&t[i-1].token===a-1&&t[o.end+1].token===u+1,p=l===42?D1:R1,d=r[a];c?(d.type="strong_open",d.tag="strong",d.nesting=1,d.markup=p+p,d.content=""):(d.type="em_open",d.tag="em",d.nesting=1,d.markup=p,d.content="");const f=r[u];c?(f.type="strong_close",f.tag="strong",f.nesting=-1,f.markup=p+p,f.content=""):(f.type="em_close",f.tag="em",f.nesting=-1,f.markup=p,f.content=""),c&&(r[t[i-1].token].content="",r[t[o.end+1].token].content="",i--)}}function Yw(e){const t=e.tokens_meta,n=e.tokens_meta.length;fm(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&fm(e,t[r].delimiters)}const yd={tokenize:Uw,postProcess:Yw};function N1(e){return hh(e)}function Sh(e){return e>=48&&e<=57}function Zw(e){const t=e|32;return Sh(e)||t>=97&&t<=102}function L1(e){const t=e|32;return t>=97&&t<=122}function Vw(e){return L1(e)||Sh(e)}function Jw(e,t,n){let r=t+2;if(r>=n)return null;let i=!1,o=7,l=r;for((e.charCodeAt(r)|32)===120&&(i=!0,o=6,r++,l=r);r<n&&r-l<o;){const s=e.charCodeAt(r);if(!(i?Zw(s):Sh(s)))break;r++}return r===l||r>=n||e.charCodeAt(r)!==59?null:e.slice(t,r+1)}function Xw(e,t,n){let r=t+1;if(r>=n||!L1(e.charCodeAt(r)))return null;for(r++;r<n&&r-t-1<32&&Vw(e.charCodeAt(r));)r++;if(r-t-1<2||r>=n||e.charCodeAt(r)!==59)return null;const i=e.slice(t,r+1);return N1(i)!==i?i:null}function qw(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const i=Jw(e.src,n,r);if(i){if(!t){const o=(i.charCodeAt(2)|32)===120?Number.parseInt(i.slice(3,-1),16):Number.parseInt(i.slice(2,-1),10),l=e.push("text_special","",0);l.content=Zu(o)?Rs(o):Rs(65533),l.markup=i,l.info="entity"}return e.pos+=i.length,!0}}else{const i=Xw(e.src,n,r);if(i){const o=N1(i);if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=i,l.info="entity"}return e.pos+=i.length,!0}}return!1}var O1=qw;const P1=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Cd=new Array(128),$1=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Cd[e]=`\\${t}`,$1[e]=P1[e]?t:Cd[e]}function dm(e,t,n){e.pending&&e.pushPending();const r=new un("text_special","",0);r.level=e.level,r.content=t,r.markup=n,r.info="escape",e.pendingLevel=e.level,e.tokens.push(r),e.tokens_meta.push(null)}function e2(e,t){let n=e.pos;const r=e.posMax,i=e.src;if(i.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=i.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=i.charCodeAt(n),!(o!==9&&o!==32));)n++;return e.pos=n,!0}if(o<128)return t?(e.pos=n+1,!0):(dm(e,$1[o],Cd[o]),e.pos=n+1,!0);if(t){if(o>=55296&&o<=56319&&n+1<r){const a=i.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let l=i.charAt(n);if(o>=55296&&o<=56319&&n+1<r){const a=i.charCodeAt(n+1);a>=56320&&a<=57343&&(l+=i.charAt(n+1),n++)}const s=`\\${l}`;return dm(e,o<256&&P1[o]?l:s,s),e.pos=n+1,!0}var H1=e2;function t2(e){var l;let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++){const s=i[t];s&&(s.nesting&&s.nesting<0&&r--,s.level=r,s.nesting&&s.nesting>0&&r++,s.type==="text"&&t+1<o&&((l=i[t+1])==null?void 0:l.type)==="text"?i[t+1].content=s.content+i[t+1].content:(t!==n&&(i[n]=s),n++))}t!==n&&(i.length=n)}var n2=t2;const W1=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,K1="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r2=new RegExp(`^(?:${W1}|${K1}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),i2=new RegExp(`^(?:${W1}|${K1})`);function j1(e){return e===32||e===9||e===10||e===12||e===13}function o2(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||j1(t)}function l2(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(!j1(n))return!1}return!1}function s2(e){const t=e|32;return t>=97&&t<=122}function a2(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos,i=e.src;if(i.charCodeAt(r)!==60||r+2>=n)return!1;const o=i.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!s2(o))return!1;const l=i.slice(r).match(r2);if(!l)return!1;const s=l[0];if(!t){const a=e.pushSimple("html_inline","");a.content=s,o2(s)&&e.linkLevel++,l2(s)&&e.linkLevel--}return e.pos+=s.length,!0}var z1=a2;function u2(e,t){let n,r,i,o,l,s,a,u,c="";const p=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const f=e.pos+2,g=ku(e,e.pos+1,!1);if(g<0)return!1;if(o=g+1,o<d&&e.src.charCodeAt(o)===40){for(o++;o<d&&(n=e.src.charCodeAt(o),!(n!==32&&n!==10));o++);if(o>=d)return!1;if(s=E1(e.src,o,e.posMax),s.ok){for(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c="",u=o;o<d&&(n=e.src.charCodeAt(o),!(n!==32&&n!==10));o++);if(s=M1(e.src,o,e.posMax),o<d&&u!==o&&s.ok)for(a=s.str,o=s.pos;o<d&&(n=e.src.charCodeAt(o),!(n!==32&&n!==10));o++);else a=""}if(o>=d||e.src.charCodeAt(o)!==41)return e.pos=p,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<d&&e.src.charCodeAt(o)===91?(u=o+1,o=ku(e,o),o>=0?i=e.src.slice(u,o++):o=g+1):o=g+1,i||(i=e.src.slice(f,g)),l=e.env.references[Yu(i)],!l)return e.pos=p,!1;c=l.href,a=l.title}if(!t){r=e.src.slice(f,g);const m=[];e.md.inline.parse(r,e.md,e.env,m);const A=e.push("image","img",0);A.attrs=[["src",c],["alt",""]],A.children=m,A.content=r,a&&A.attrs.push(["title",a])}return e.pos=o,e.posMax=d,!0}var G1=u2;function Cf(e,t,n){for(;t<n;){const r=e.charCodeAt(t);if(r!==32&&r!==10)break;t++}return t}function c2(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;const n=e.src,r=e.pos,i=e.posMax,o=e.pos+1,l=ku(e,e.pos,!0);if(l<0)return!1;let s=l+1,a="",u="",c=!0;if(s<i&&n.charCodeAt(s)===40){s=Cf(n,s+1,i);const p=E1(n,s,i);if(p.ok){const d=e.md.normalizeLink(p.str);e.md.validateLink(d)&&(a=d,s=p.pos,c=!1)}else s<i&&n.charCodeAt(s)===41&&(a="",c=!1);if(!c){if(s=Cf(n,s,i),s<i&&n.charCodeAt(s)!==41){const d=M1(n,s,i);d.ok&&(u=d.str,s=Cf(n,d.pos,i))}s<i&&n.charCodeAt(s)===41?s++:c=!0}}if(c){if(typeof e.env.references>"u")return!1;let p;if(s=l+1,s<i&&n.charCodeAt(s)===91){const f=s+1,g=ku(e,s);g>=0?(p=n.slice(f,g),p||(p=n.slice(o,l)),s=g+1):p=n.slice(o,l)}else p=n.slice(o,l);const d=e.env.references[Yu(p)];if(!d)return e.pos=r,!1;a=d.href,u=d.title}if(!t){e.pos=o,e.posMax=l;const p=e.push("link_open","a",1);p.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=s,e.posMax=i,!0}var Q1=c2;function U1(e){const t=e|32;return t>=97&&t<=122}function f2(e){return e>=48&&e<=57}function d2(e){return U1(e)||f2(e)||e===43||e===45||e===46}function h2(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&d2(e.charCodeAt(t));)t--;return t++,t>=e.length||!U1(e.charCodeAt(t))?null:e.slice(t)}function p2(e,t,n){let r=t;for(;r<n;){const i=e.charCodeAt(r);if(i<=32||i===127||i===60)break;r++}return e.slice(t,r)}function Y1(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=h2(e.pending);if(!i)return!1;const o=p2(e.src,n-i.length,r),l=e.md.linkify.matchAtStart(o);if(!l)return!1;let s=l.url;if(s.length<=i.length)return!1;let a=s.length;for(;a>0&&s.charCodeAt(a-1)===42;)a--;a!==s.length&&(s=s.slice(0,a));const u=e.md.normalizeLink(s);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const p=e.push("text","",0);p.content=e.md.normalizeLinkText(s);const d=e.push("link_close","a",-1);d.markup="linkify",d.info="auto"}return e.pos+=s.length-i.length,!0}function g2(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<i;){const o=e.src.charCodeAt(n);if(o!==9&&o!==32)break;n++}return e.pos=n,!0}var Z1=g2;function m2(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);if(!i)return!1;let o=i.length;const l=String.fromCharCode(r);if(o<2)return!1;let s;o%2&&(s=e.push("text","",0),s.content=l,o--);for(let a=0;a<o;a+=2)s=e.push("text","",0),s.content=l+l,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function hm(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const l=t[o];if(l.marker!==126||l.end===-1)continue;const s=t[l.end];n=e.tokens[l.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&r.push(s.token-1)}for(;r.length;){const o=r.pop();let l=o+1;for(;l<e.tokens.length&&e.tokens[l].type==="s_close";)l++;l--,o!==l&&(n=e.tokens[l],e.tokens[l]=e.tokens[o],e.tokens[o]=n)}}function A2(e){const t=e.delimiters;hm(e,t);const n=e.tokens_meta;if(n)for(let r=0;r<n.length;r++)n[r]&&n[r].delimiters&&hm(e,n[r].delimiters)}const bd={tokenize:m2,postProcess:A2},V1=new Uint8Array(256);for(const e of[10,33,35,36,37,38,42,43,45,58,60,61,62,64,91,92,93,94,95,96,123,125,126])V1[e]=1;function pm(e){return e<256&&V1[e]===1}function v2(e,t){const n=e.src,r=e.pos,i=e.posMax;if(r>=i||pm(n.charCodeAt(r)))return!1;let o=r+1;for(;o<i&&!pm(n.charCodeAt(o));)o++;return t||(e.pending+=o===r+1?n.charAt(r):n.slice(r,o)),e.pos=o,!0}var J1=v2;function Ih(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function k2(e){if(e.length===0)return 0;const t=e.slice().sort((r,i)=>r-i),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function y2(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 X1(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,r={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Ih(),records:Object.create(null)};return t.__mdtsRuleProfile=r,r}function ol(e,t,n,r,i,o){const l=X1(e);if(!l)return;const s=`${t}:${n}`,a=l.records[s]??(l.records[s]=y2(t,n));a.calls++,a.inclusiveMs+=r,r>a.maxMs&&(a.maxMs=r),a.samples.push(r),o?(a.silentCalls++,i&&a.silentHits++):(a.normalCalls++,i&&a.normalHits++),i&&a.hits++,l.completedAt=Ih()}function C2(e){const t=X1(e);if(!t)return null;const n=Object.keys(t.records);for(let r=0;r<n.length;r++){const i=t.records[n[r]];i.medianMs=k2(i.samples)}return t.completedAt=Ih(),t}var gm=class{constructor(){le(this,"rules",[]);le(this,"cache",null);le(this,"namedCache",null);le(this,"version",0)}invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const r=this.rules.findIndex(i=>i.name===e);r>=0&&this.rules.splice(r,1),this.rules.push({name:e,fn:t,alt:(n==null?void 0:n.alt)||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const r=this.rules.findIndex(i=>i.name===e);if(t===void 0){if(r<0)return;const i=this.rules[r];return Object.freeze({name:i.name,fn:i.fn,alt:i.alt?Object.freeze(i.alt.slice()):void 0,enabled:i.enabled})}if(r<0)throw new Error(`Parser rule not found: ${e}`);this.rules[r].fn=t,(n==null?void 0:n.alt)!==void 0&&(this.rules[r].alt=n.alt),this.invalidateCache()}before(e,t,n,r){const i=this.rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(l=>l.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,alt:(r==null?void 0:r.alt)||[],enabled:!0}),this.invalidateCache()}after(e,t,n,r){const i=this.rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(l=>l.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,alt:(r==null?void 0:r.alt)||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],r=[];let i=!1;for(const o of n){const l=this.rules.findIndex(s=>s.name===o);if(l<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}r.push(o),this.rules[l].enabled||(this.rules[l].enabled=!0,i=!0)}return i&&this.invalidateCache(),r}disable(e,t){const n=Array.isArray(e)?e:[e],r=[];let i=!1;for(const o of n){const l=this.rules.findIndex(s=>s.name===o);if(l<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}r.push(o),this.rules[l].enabled&&(this.rules[l].enabled=!1,i=!0)}return i&&this.invalidateCache(),r}enableOnly(e){const t=new Set(e);let n=!1;for(const r of this.rules){const i=t.has(r.name);r.enabled!==i&&(r.enabled=i,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(){var r;const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],l=[];for(const s of this.rules)s.enabled&&(i!==""&&!((r=s.alt)!=null&&r.includes(i))||(o.push(s.fn),l.push({name:s.name,fn:s.fn})));t.set(i,o),n.set(i,l)}this.cache=t,this.namedCache=n}},xd=class{constructor(e,t,n,r){le(this,"src");le(this,"md");le(this,"env");le(this,"tokens");le(this,"tokens_meta");le(this,"pos");le(this,"posMax");le(this,"level");le(this,"pending");le(this,"pendingLevel");le(this,"cache");le(this,"delimiters");le(this,"_prev_delimiters");le(this,"backticks");le(this,"backticksScanned");le(this,"linkLevel");le(this,"linkLabelNoCloseFrom");le(this,"maxNesting");this.src=e,this.md=t,this.env=n,this.tokens=r,this.tokens_meta=new Array(r.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 un("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 un(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 r=new un(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){const{src:n,posMax:r}=this,i=n.charCodeAt(e);let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;const l=o-e,s=e>0?n.charCodeAt(e-1):32,a=o<r?n.charCodeAt(o):32,u=Fs(s),c=Fs(a),p=Ds(s),d=Ds(a),f=!c&&(!d||u||p),g=!u&&(!p||c||d);return{can_open:f&&(t||!g||p),can_close:g&&(t||!f||d),length:l}}};xd.prototype.Token=un;const b2=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function mm(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return Z1(e,t);case 33:return G1(e,t);case 38:return O1(e,t);case 42:case 95:return yd.tokenize(e,t);case 58:return e.md.options.linkify&&Y1(e,t);case 60:return B1(e,t)||z1(e,t);case 91:return Q1(e,t);case 92:return H1(e,t);case 96:return F1(e,t);case 126:return bd.tokenize(e,t);default:return J1(e,t)}}function q1(e){return!b2.test(e)}var x2=class{constructor(){le(this,"ruler");le(this,"ruler2");le(this,"State",xd);le(this,"cachedRulesVersion",-1);le(this,"cachedRules",[]);le(this,"cachedRules2Version",-1);le(this,"cachedRules2",[]);le(this,"defaultRulerVersion");le(this,"defaultRuler2Version");this.ruler=new gm,this.ruler2=new gm,this.ruler.push("text",J1),this.ruler.push("linkify",Y1),this.ruler.push("newline",Z1),this.ruler.push("escape",H1),this.ruler.push("backticks",F1),this.ruler.push("strikethrough",bd.tokenize),this.ruler.push("emphasis",yd.tokenize),this.ruler.push("link",Q1),this.ruler.push("image",G1),this.ruler.push("autolink",B1),this.ruler.push("html_inline",z1),this.ruler.push("entity",O1),this.ruler2.push("balance_pairs",Qw),this.ruler2.push("strikethrough",bd.postProcess),this.ruler2.push("emphasis",yd.postProcess),this.ruler2.push("fragments_join",n2),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),r=n.length,i=e.cache,o=i[t],l=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(o!==void 0){e.pos=o;return}let s=!1;if(e.level<e.maxNesting){if(l){const a=this.ruler.getNamedRules("");for(let u=0;u<r;u++){e.level++;const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();s=a[u].fn(e,!0);const p=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ol(e.env,"inline",a[u].name,p-c,!!s,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,s=mm(e,!0),e.level--,s&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a<r;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,i[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,r=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const o=this.isDefaultRuleset();for(;e.pos<r;){const l=e.pos;let s=!1;if(e.level<e.maxNesting){if(o)s=mm(e,!1);else for(let a=0;a<n&&(s=t[a](e,!1),!s);a++);if(s&&l>=e.pos)throw new Error("inline rule didn't increment state.pos")}if(s){if(e.pos>=r)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const i=this.ruler.getNamedRules("");for(;e.pos<r;){const o=e.pos;let l=!1;if(e.level<e.maxNesting)for(let s=0;s<n;s++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=i[s].fn(e,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ol(e.env,"inline",i[s].name,u-a,!!l,!1),l){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(l){if(e.pos>=r)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}usesDefaultState(){return this.State===xd}parseSource(e,t,n,r){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&this.usesDefaultState()&&q1(e)){const a=new un("text","",0);a.content=e,r.push(a);return}const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.getRules2(),l=o.length;if(!(i.env&&(Object.prototype.hasOwnProperty.call(i.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(i.env,"__mdtsProfileRules")))){for(let a=0;a<l;a++)o[a](i,!1);return}const s=this.ruler2.getNamedRules("");for(let a=0;a<l;a++){const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();s[a].fn(i,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ol(i.env,"inline2",s[a].name,c-u,!0,!1)}}parse(e,t,n,r){this.parseSource(e,t,n,r)}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 ev(e){var i,o,l;const t=e.tokens,n=(i=e.md)==null?void 0:i.inline,r=!!((o=n==null?void 0:n.isDefaultRuleset)!=null&&o.call(n))&&((l=n==null?void 0:n.usesDefaultState)==null?void 0:l.call(n))!==!1;for(let s=0,a=t.length;s<a;s++){const u=t[s];if(u.type==="inline"&&e.md){if(u.children||(u.children=[]),r&&u.content.length>0&&q1(u.content)){const c=new un("text","",0);c.content=u.content,u.children.push(c);continue}e.md.inline.parse(u.content,e.md,e.env,u.children)}}}const w2=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,_2=/[0-9a-z]/i;function S2(e){return e.includes(".")||e.includes("@")||e.includes(":")}const Am=new WeakMap;function I2(e){var o,l;const t=(l=(o=e.re)==null?void 0:o.get_schema_search)==null?void 0:l.call(o);if(!t)return!1;const n=Am.get(e);if(n&&n.schemaSearch===t)return n.safe;const r=e.__schemas__;let i=!0;if(r){for(const s in r)if(s.charCodeAt(s.length-1)!==58){i=!1;break}}return Am.set(e,{schemaSearch:t,safe:i}),i}function E2(e){return/^<a[>\s]/i.test(e)}function M2(e){return/^<\/a\s*>/i.test(e)}function T2(e,t){var n;if(t.schema||t.index!==0||!t.raw)return t;for(let r=1;r<t.raw.length;r++){const i=t.raw[r-1],o=t.raw[r];if(!w2.test(i)||!_2.test(o))continue;const l=t.raw.slice(r),s=(n=e.match(l))==null?void 0:n[0];if(!(!s||s.index!==0||s.lastIndex!==l.length))return{...s,index:t.index+r,lastIndex:t.index+r+s.lastIndex}}return t}function tv(e){var i,o;const t=e.tokens;if(!((o=(i=e.md)==null?void 0:i.options)!=null&&o.linkify))return;const n=I2(e.md.linkify),r=l=>n?S2(l):!0;for(let l=0;l<t.length;l++){const s=t[l];if(s.type!=="inline"||!r(s.content))continue;let a=s.children;a||(a=[],s.children=a);let u=0;for(let c=a.length-1;c>=0;c--){const p=a[c];if(p.type==="link_close"){for(c--;c>=0&&a[c].level!==p.level&&a[c].type!=="link_open";)c--;continue}if(p.type==="html_inline"&&(E2(p.content)&&u>0&&u--,M2(p.content)&&u++),u>0||p.type!=="text"||!r(p.content))continue;const d=p.content;let f=(e.md.linkify.match(d)||[]).map(v=>T2(e.md.linkify,v));if(f.length===0)continue;const g=[];let m=p.level,A=0;f.length>0&&f[0].index===0&&c>0&&a[c-1].type==="text_special"&&(f=f.slice(1));for(let v=0;v<f.length;v++){const k=f[v],C=e.md.normalizeLink(k.url);if(!e.md.validateLink(C))continue;let b=k.text;k.schema?k.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const S=k.index;if(S>A){const $=new un("text","",0);$.content=d.slice(A,S),$.level=m,g.push($)}const T=new un("link_open","a",1);T.attrs=[["href",C]],T.level=m++,T.markup="linkify",T.info="auto",g.push(T);const M=new un("text","",0);M.content=b,M.level=m,g.push(M);const E=new un("link_close","a",-1);E.level=--m,E.markup="linkify",E.info="auto",g.push(E),A=k.lastIndex}if(A!==0){if(A<d.length){const v=new un("text","",0);v.content=d.slice(A),v.level=m,g.push(v)}a.splice(c,1,...g)}}}}const B2=/\r\n?|\n/g,F2=/\0/g;function os(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),r=t.includes("\0");if(!n&&!r)return;let i=t;n&&(i=i.replace(B2,`
13
+ `)),r&&(i=i.replace(F2,"�")),e.src=i}const nv=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,D2=/\((?:c|tm|r)\)/i,R2=/\((c|tm|r)\)/gi,N2={c:"©",r:"®",tm:"™"};function L2(e,t){return N2[t.toLowerCase()]}function O2(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(R2,L2)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function P2(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&nv.test(r.content)&&(r.content=r.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–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function rv(e){var t,n;if((n=(t=e.md)==null?void 0:t.options)!=null&&n.typographer)for(let r=e.tokens.length-1;r>=0;r--){const i=e.tokens[r];if(i.type!=="inline")continue;const o=i.content||(Array.isArray(i.children)?i.children.map(l=>l.type==="text"?l.content:"").join(""):"");D2.test(o)&&O2(i.children||[]),nv.test(o)&&P2(i.children||[])}}var $2=class{constructor(){le(this,"rules",[]);le(this,"cache",null);le(this,"namedCache",null);le(this,"version",0)}invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(r=>r.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(r=>r.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 r=this.rules.findIndex(o=>o.name===e);if(r<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(o=>o.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const r=this.rules.findIndex(o=>o.name===e);if(r<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(o=>o.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],r=[];let i=!1;for(const o of n){const l=this.rules.findIndex(s=>s.name===o);if(l<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}r.push(o),this.rules[l].enabled||(this.rules[l].enabled=!0,i=!0)}return i&&this.invalidateCache(),r}disable(e,t){const n=Array.isArray(e)?e:[e],r=[];let i=!1;for(const o of n){const l=this.rules.findIndex(s=>s.name===o);if(l<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}r.push(o),this.rules[l].enabled&&(this.rules[l].enabled=!1,i=!0)}return i&&this.invalidateCache(),r}enableOnly(e){const t=new Set(e);let n=!1;for(const r of this.rules){const i=t.has(r.name);r.enabled!==i&&(r.enabled=i,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 H2=/['"]/,vm=/['"]/g,km="’";function Na(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function W2(e,t){let n;const r=[],i=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let o=0;o<e.length;o++){const l=e[o],s=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,l.type!=="text")continue;let a=l.content,u=0,c=a.length;e:for(;u<c;){vm.lastIndex=u;const p=vm.exec(a);if(!p)break;let d=!0,f=!0;u=p.index+1;const g=p[0]==="'";let m=32;if(p.index-1>=0)m=a.charCodeAt(p.index-1);else for(n=o-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 A=32;if(u<c)A=a.charCodeAt(u);else for(n=o+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){A=e[n].content.charCodeAt(0);break}const v=Ds(m),k=Ds(A),C=Fs(m),b=Fs(A);if(b?d=!1:k&&(C||v||(d=!1)),C?f=!1:v&&(b||k||(f=!1)),A===34&&p[0]==='"'&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=v,f=k),!d&&!f){g&&(l.content=Na(l.content,p.index,km));continue}if(f)for(n=r.length-1;n>=0;n--){let S=r[n];if(r[n].level<s)break;if(S.single===g&&r[n].level===s){S=r[n];let T,M;g?(T=i[2]||"‘",M=i[3]||"’"):(T=i[0]||"“",M=i[1]||"”"),l.content=Na(l.content,p.index,M),e[S.token].content=Na(e[S.token].content,S.pos,T),u+=M.length-1,S.token===o&&(u+=T.length-1),a=l.content,c=a.length,r.length=n;continue e}}d?r.push({token:o,pos:p.index,single:g,level:s}):f&&g&&(l.content=Na(l.content,p.index,km))}}}function iv(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 r=typeof n.content=="string"?n.content:(n.children||[]).map(i=>i.content||"").join("");!H2.test(r)||!n.children||W2(n.children,e)}}function ov(e){const t=e.tokens||[],n=t.length;for(let r=0;r<n;r++){const i=t[r];if(i.type!=="inline"||!Array.isArray(i.children))continue;const o=i.children,l=o.length;for(let u=0;u<l;u++)o[u].type==="text_special"&&(o[u].type="text");let s=0,a=0;for(;a<l;a++)o[a].type==="text"&&a+1<l&&o[a+1].type==="text"?o[a+1].content=o[a].content+o[a+1].content:(a!==s&&(o[s]=o[a]),s++);a!==s&&(o.length=s)}}const K2=/^(?:vbscript|javascript|file|data):/,j2=/^data:image\/(?:gif|png|jpeg|webp);/,lv=["http:","https:","mailto:"],sv=/[^\0-\x7F]/,z2=/xn--/,G2=/%(?![0-9a-f]{2})|[^\w;/?:@&=+$,\-.!~*'()#%]/i,Q2=/%[0-9a-f]{2}/i;function av(e){const t=e.trim().toLowerCase();return K2.test(t)?j2.test(t):!0}function uv(e){const t=gh(e,!0);if(t.hostname&&(!t.protocol||lv.includes(t.protocol))&&sv.test(t.hostname))try{t.hostname=I1.default.toASCII(t.hostname)}catch{}const n=ph(t);return G2.test(n)?v1(n):n}function cv(e){const t=gh(e,!0);if(t.hostname&&(!t.protocol||lv.includes(t.protocol))&&(sv.test(t.hostname)||z2.test(t.hostname)))try{t.hostname=I1.default.toUnicode(t.hostname)}catch{}const n=ph(t);return Q2.test(n)?md(n,`${md.defaultChars}%`):n}function U2(e){switch(e){case 9:case 32:return!0}return!1}function Y2(e,t,n,r){const i=e.src,o=e.bMarks,l=e.eMarks,s=e.tShift,a=e.sCount,u=e.bsCount;let c=o[t]+s[t],p=l[t];const d=e.lineMax;if(a[t]-e.blkIndent>=4||i.charCodeAt(c)!==62)return!1;if(r)return!0;const f=[],g=[],m=[],A=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),k=e.parentType;e.parentType="blockquote";let C=!1,b;for(b=t;b<n;b++){const $=a[b]<e.blkIndent;if(c=o[b]+s[b],p=l[b],c>=p)break;if(i.charCodeAt(c++)===62&&!$){let K=a[b]+1,I,B;i.charCodeAt(c)===32?(c++,K++,B=!1,I=!0):i.charCodeAt(c)===9?(I=!0,(u[b]+K)%4===3?(c++,K++,B=!1):B=!0):I=!1;let P=K;for(f.push(o[b]),o[b]=c;c<p;){const _=i.charCodeAt(c);if(U2(_))_===9?P+=4-(P+u[b]+(B?1:0))%4:P++;else break;c++}C=c>=p,g.push(u[b]),u[b]=a[b]+1+(I?1:0),m.push(a[b]),a[b]=P-K,A.push(s[b]),s[b]=c-o[b];continue}if(C)break;let X=!1;for(let K=0,I=v.length;K<I;K++)if(v[K](e,b,n,!0)){X=!0;break}if(X){e.lineMax=b,e.blkIndent!==0&&(f.push(o[b]),g.push(u[b]),A.push(s[b]),m.push(a[b]),a[b]-=e.blkIndent);break}f.push(o[b]),g.push(u[b]),A.push(s[b]),m.push(a[b]),a[b]=-1}const S=e.blkIndent;e.blkIndent=0;const T=e.push("blockquote_open","blockquote",1);T.markup=">";const M=[t,0];T.map=M,e.md.block.tokenize(e,t,b);const E=e.push("blockquote_close","blockquote",-1);E.markup=">",e.lineMax=d,e.parentType=k,M[1]=e.line;for(let $=0;$<A.length;$++)o[$+t]=f[$],s[$+t]=A[$],a[$+t]=m[$],u[$+t]=g[$];return e.blkIndent=S,!0}function Z2(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=`${e.getLines(t,i,4+e.blkIndent,!1)}
14
+ `,o.map=[t,e.line],!0}function V2(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const l=e.src.charCodeAt(i);if(l!==126&&l!==96)return!1;let s=i;i=e.skipChars(i,l);let a=i-s;if(a<3)return!1;const u=e.src.slice(s,i),c=e.src.slice(i,o);if(l===96&&c.includes(String.fromCharCode(l)))return!1;if(r)return!0;let p=t,d=!1;for(;p++,!(p>=n||(i=s=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],i<o&&e.sCount[p]<e.blkIndent));)if(e.src.charCodeAt(i)===l&&!(e.sCount[p]-e.blkIndent>=4)&&(i=e.skipChars(i,l),!(i-s<a)&&(i=e.skipSpaces(i),!(i<o)))){d=!0;break}a=e.sCount[t],e.line=p+(d?1:0);const f=e.push("fence","code",0);return f.info=c,f.content=e.getLines(t+1,p,a,!0),f.markup=u,f.map=[t,e.line],!0}const ym=["","h1","h2","h3","h4","h5","h6"],Cm=["","#","##","###","####","#####","######"];function bm(e){switch(e){case 9:case 32:return!0}return!1}function J2(e,t,n,r){const i=e.src,o=e.bMarks,l=e.tShift,s=e.eMarks;let a=o[t]+l[t],u=s[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let c=i.charCodeAt(a);if(c!==35||a>=u)return!1;let p=1;for(c=i.charCodeAt(++a);c===35&&a<u&&p<=6;)p++,c=i.charCodeAt(++a);if(p>6||a<u&&!bm(c))return!1;if(r)return!0;u=e.skipSpacesBack(u,a);const d=e.skipCharsBack(u,35,a);d>a&&bm(i.charCodeAt(d-1))&&(u=d),e.line=t+1;const f=e.push("heading_open",ym[p],1);f.markup=Cm[p],f.map=[t,e.line];const g=e.push("inline","",0);g.content=i.slice(a,u).trim(),g.map=[t,e.line],g.children=[];const m=e.push("heading_close",ym[p],-1);return m.markup=Cm[p],!0}function X2(e){switch(e){case 9:case 32:return!0}return!1}function q2(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const l=e.src.charCodeAt(o++);if(l!==42&&l!==45&&l!==95)return!1;let s=1;for(;o<i;){const u=e.src.charCodeAt(o++);if(u!==l&&!X2(u))return!1;u===l&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=String.fromCharCode(l).repeat(s),!0}const Uo=[[/^<(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(`${i2.source}\\s*$`),/^$/,!1]];function e_(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let l=e.src.slice(i,o),s=0;for(;s<Uo.length&&!Uo[s][0].test(l);s++);if(s===Uo.length)return!1;if(r)return Uo[s][2];let a=t+1;if(!Uo[s][1].test(l)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(i=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],l=e.src.slice(i,o),Uo[s][1].test(l)){l.length!==0&&a++;break}}e.line=a;const u=e.push("html_block","",0);return u.map=[t,a],u.content=e.getLines(t,a,e.blkIndent,!0),!0}function t_(e){switch(e){case 9:case 32:return!0}return!1}const cs={Pipe:1,ParagraphTerminator:2},fv=new Uint8Array(256);for(const e of[35,42,43,45,60,62,95,96,124,126,48,49,50,51,52,53,54,55,56,57])fv[e]=1;var dv=class{constructor(e,t,n,r){le(this,"src");le(this,"md");le(this,"env");le(this,"tokens");le(this,"bMarks",[]);le(this,"eMarks",[]);le(this,"tShift",[]);le(this,"sCount",[]);le(this,"bsCount",[]);le(this,"lineFlags",[]);le(this,"blkIndent",0);le(this,"line",0);le(this,"lineMax",0);le(this,"tight",!1);le(this,"ddIndent",-1);le(this,"listIndent",-1);le(this,"parentType","root");le(this,"level",0);this.src=e,this.md=t,this.env=n,this.tokens=r;const i=this.src,o=i.length,l=this.bMarks,s=this.eMarks,a=this.tShift,u=this.sCount,c=this.bsCount,p=this.lineFlags;let d=0,f=i.indexOf("|");for(;d<o;){let g=d;for(;g<o&&g-d<4&&i.charCodeAt(g)!==10;)g++;if(g-d===4&&g<o){const C=i.indexOf(`
15
+ `,g);g=C===-1?o:C}let m=0,A=0,v=d;for(;v<g;){const C=i.charCodeAt(v);if(C===32){m++,A++,v++;continue}if(C===9){m++,A+=4-A%4,v++;continue}break}let k=0;v<g&&(fv[i.charCodeAt(v)]===1&&(k|=cs.ParagraphTerminator),f<d&&(f=i.indexOf("|",d)),f!==-1&&f<g&&(k|=cs.Pipe|cs.ParagraphTerminator),f===-1&&(f=o)),l.push(d),s.push(g),a.push(m),u.push(A),c.push(0),p.push(k),d=g+1}l.push(o),s.push(o),a.push(0),u.push(0),c.push(0),p.push(0),this.lineMax=l.length-1}push(e,t,n){if(n===0){const i=new un(e,t,0);return i.block=!0,i.level=this.level,this.tokens.push(i),i}const r=new un(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,r=this.eMarks;for(let i=this.lineMax;e<i&&!(t[e]+n[e]<r[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const r=t.charCodeAt(e);if(r!==9&&r!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const r=n.charCodeAt(--e);if(r!==9&&r!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";if(e+1===t){const c=e,p=this.bMarks[c];let d=p;const f=r?this.eMarks[c]+1:this.eMarks[c];let g=0;const m=this.src,A=this.bsCount,v=this.tShift;for(;d<f&&g<n;){const k=m.charCodeAt(d);if(k===9||k===32)k===9?g+=4-(g+A[c])%4:g++;else if(d-p<v[c])g++;else break;d++}return g>n?" ".repeat(g-n)+m.slice(d,f):m.slice(d,f)}const i=new Array(t-e),o=this.src,l=this.bMarks,s=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,p=e;p<t;p++,c++){let d=0;const f=l[p];let g=f,m;for(p+1<t||r?m=s[p]+1:m=s[p];g<m&&d<n;){const A=o.charCodeAt(g);if(t_(A))A===9?d+=4-(d+a[p])%4:d++;else if(g-f<u[p])d++;else break;g++}d>n?i[c]=" ".repeat(d-n)+o.slice(g,m):i[c]=o.slice(g,m)}return i.join("")}};dv.prototype.Token=un;function n_(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===124)return!0;return!1}function hv(e){var n,r;const t=(r=(n=e==null?void 0:e.md)==null?void 0:n.block)==null?void 0:r.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function pv(e,t,n,r,i){if(e.lineFlags&&(e.lineFlags[t]&cs.ParagraphTerminator)===0||r>=i)return!1;const o=n.charCodeAt(r);switch(o){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return o>=48&&o<=57?!0:n_(n,r,i)}const xm=["","h1","h2"];function r_(e,t,n){const r=e.md.block.ruler.getRulesForState(e,"paragraph"),i=e.src,o=e.bMarks,l=e.tShift,s=e.eMarks,a=e.sCount,u=e.blkIndent,c=hv(e);if(a[t]-u>=4)return!1;const p=e.parentType;e.parentType="paragraph";let d=0,f,g=t+1;for(;g<n;g++){const b=o[g]+l[g],S=s[g];if(b>=S)break;if(a[g]-u>3)continue;if(a[g]>=u&&(f=i.charCodeAt(b),f===45||f===61)){let M=b+1,E=M;for(;M<S&&i.charCodeAt(M)===f;)M++;for(E=M;M<S;){const $=i.charCodeAt(M);if($!==9&&$!==32)break;M++}if(M>=S){d=f===61?1:2;break}if(E-b>1)continue}if(a[g]<0||c&&!pv(e,g,i,b,S))continue;let T=!1;for(let M=0,E=r.length;M<E;M++)if(r[M](e,g,n,!0)){T=!0;break}if(T)break}if(!d)return!1;let m;if(g===t+1){const b=o[t]+l[t];let S=s[t];for(;S>b;){const T=i.charCodeAt(S-1);if(T!==9&&T!==32)break;S--}m=i.slice(b,S)}else m=e.getLines(t,g,u,!1).trim();e.line=g+1;const A=f===61?"=":"-",v=e.push("heading_open",xm[d],1);v.markup=A,v.map=[t,e.line];const k=e.push("inline","",0);k.content=m,k.map=[t,e.line-1],k.children=[];const C=e.push("heading_close",xm[d],-1);return C.markup=A,e.parentType=p,!0}function gv(e){switch(e){case 9:case 32:return!0}return!1}function wm(e,t){const n=e.eMarks,r=e.bMarks,i=e.tShift,o=e.src,l=n[t];let s=r[t]+i[t];const a=o.charCodeAt(s++);return a!==42&&a!==45&&a!==43||s<l&&!gv(o.charCodeAt(s))?-1:s}function _m(e,t){const n=e.bMarks,r=e.tShift,i=e.eMarks,o=e.src,l=n[t]+r[t],s=i[t];let a=l;if(a+1>=s)return-1;let u=o.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=s)return-1;if(u=o.charCodeAt(a++),u>=48&&u<=57){if(a-l>=10)return-1;continue}if(u===41||u===46)break;return-1}return a<s&&(u=o.charCodeAt(a),!gv(u))?-1:a}function i_(e,t,n){const r=e.bMarks,i=e.tShift,o=e.src,l=r[t]+i[t];let s=0;for(let a=l;a<n-1;a++)s=s*10+o.charCodeAt(a)-48;return s}const o_=["0","1","2","3","4","5","6","7","8","9"];function l_(e,t){const n=e.level+2,r=e.tokens;for(let i=t+2,o=r.length-2;i<o;i++){const l=r[i];if(l.level===n){if(l.type==="paragraph_open"){l.hidden=!0,r[i+2].hidden=!0,i+=2;continue}if(l.nesting===1){let s=1;for(;s>0&&++i<o;)s+=r[i].nesting}}}}function s_(e,t,n,r){let i,o,l=0,s=t,a=!0;if(e.sCount[s]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[s]-e.listIndent>=4&&e.sCount[s]<e.blkIndent)return!1;let u=!1;r&&e.parentType==="paragraph"&&e.sCount[s]>=e.blkIndent&&(u=!0);let c,p,d;const f=e.src,g=e.bMarks,m=e.tShift,A=e.eMarks,v=e.sCount,k=e.bsCount,C=g[s]+m[s];if(C>=A[s])return!1;const b=f.charCodeAt(C);if(b>=48&&b<=57){if(d=_m(e,s),d<0||(c=!0,l=C,p=i_(e,s,d),u&&p!==1))return!1}else if(b===42||b===45||b===43){if(d=wm(e,s),d<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(d)>=A[s])return!1;if(r)return!0;const S=f.charCodeAt(d-1),T=String.fromCharCode(S);if(c){const I=e.push("ordered_list_open","ol",1);p!==void 0&&p!==1&&(I.attrs=[["start",String(p)]])}else e.push("bullet_list_open","ul",1);const M=[s,0];e.tokens[e.tokens.length-1].map=M,e.tokens[e.tokens.length-1].markup=T;let E=!1;const $=e.tokens.length-1,X=e.md.block.ruler.getRulesForState(e,"list"),K=e.parentType;for(e.parentType="list";s<n;){o=d,i=A[s];const I=v[s]+d-(g[s]+m[s]);let B=I;for(;o<i;){const G=f.charCodeAt(o);if(G===9)B+=4-(B+k[s])%4;else if(G===32)B++;else break;o++}const P=o;let _;P>=i?_=1:_=B-I,_>4&&(_=1);const W=I+_,z=e.push("list_item_open","li",1);z.markup=T;const N=[s,0];z.map=N,c&&(z.info=d-l-1===1?o_[f.charCodeAt(l)-48]:f.slice(l,d-1));const R=e.tight,oe=e.tShift[s],ne=e.sCount[s],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[s]=P-g[s],e.sCount[s]=B,P>=i&&e.isEmpty(s+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,s,n,!0),(!e.tight||E)&&(a=!1),E=e.line-s>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ee,e.tShift[s]=oe,e.sCount[s]=ne,e.tight=R,e.push("list_item_close","li",-1).markup=T,s=e.line,N[1]=s,s>=n||e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)break;let ie=!1;for(let G=0,Q=X.length;G<Q;G++)if(X[G](e,s,n,!0)){ie=!0;break}if(ie)break;if(c){if(d=_m(e,s),d<0)break;l=g[s]+m[s]}else if(d=wm(e,s),d<0)break;if(S!==f.charCodeAt(d-1))break}return c?e.push("ordered_list_close","ol",-1).markup=T:e.push("bullet_list_close","ul",-1).markup=T,M[1]=s,e.line=s,e.parentType=K,a&&l_(e,$),!0}function Sm(e){return e===9||e===32}function a_(e,t,n){const r=e.md.block.ruler.getRulesForState(e,"paragraph"),i=e.parentType,o=e.src,l=e.bMarks,s=e.tShift,a=e.eMarks,u=e.sCount,c=e.blkIndent,p=hv(e);let d=t+1;for(e.parentType="paragraph";d<n&&!e.isEmpty(d);d++){if(u[d]-c>3||u[d]<0)continue;if(i==="list"&&u[d]>=c){const C=l[d]+s[d],b=a[d];if(C<b){const S=o.charCodeAt(C);if(S===42||S===45||S===43){if(C+1>=b||Sm(o.charCodeAt(C+1)))break}else if(S>=48&&S<=57&&C+1<b){let T=C+1;for(;;){if(T>=b){T=-1;break}const M=o.charCodeAt(T++);if(M>=48&&M<=57){if(T-C>=10){T=-1;break}continue}if((M===41||M===46)&&(T>=b||Sm(o.charCodeAt(T))))break;T=-1;break}if(T>=0)break}}}const A=l[d]+s[d],v=a[d];if(p&&!pv(e,d,o,A,v))continue;let k=!1;for(let C=0,b=r.length;C<b;C++)if(r[C](e,d,n,!0)){k=!0;break}if(k)break}const f=e.getLines(t,d,c,!1).trim();e.line=d;const g=e.push("paragraph_open","p",1);g.map=[t,e.line];const m=e.push("inline","",0);return m.content=f,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}function La(e){switch(e){case 9:case 32:return!0}return!1}function u_(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],l=t+1;const s=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function a(C){const b=e.lineMax;if(C>=b||e.isEmpty(C))return null;let S=!1;if(e.sCount[C]-e.blkIndent>3&&(S=!0),e.sCount[C]<0&&(S=!0),!S){const E=e.parentType;e.parentType="reference";let $=!1;for(let X=0,K=s.length;X<K;X++)if(s[X](e,C,b,!0)){$=!0;break}if(e.parentType=E,$)return null}const T=e.bMarks[C]+e.tShift[C],M=e.eMarks[C];return e.src.slice(T,M+1)}let u=e.src.slice(i,o+1);o=u.length;let c=-1;for(i=1;i<o;i++){const C=u.charCodeAt(i);if(C===91)return!1;if(C===93){c=i;break}else if(C===10){const b=a(l);b!==null&&(u+=b,o=u.length,l++)}else if(C===92&&(i++,i<o&&u.charCodeAt(i)===10)){const b=a(l);b!==null&&(u+=b,o=u.length,l++)}}if(c<0||u.charCodeAt(c+1)!==58)return!1;for(i=c+2;i<o;i++){const C=u.charCodeAt(i);if(C===10){const b=a(l);b!==null&&(u+=b,o=u.length,l++)}else if(!La(C))break}const p=e.md.helpers.parseLinkDestination(u,i,o);if(!p.ok)return!1;const d=e.md.normalizeLink(p.str);if(!e.md.validateLink(d))return!1;i=p.pos;const f=i,g=l,m=i;for(;i<o;i++){const C=u.charCodeAt(i);if(C===10){const b=a(l);b!==null&&(u+=b,o=u.length,l++)}else if(!La(C))break}let A=e.md.helpers.parseLinkTitle(u,i,o);for(;A.can_continue;){const C=a(l);if(C===null)break;u+=C,i=o,o=u.length,l++,A=e.md.helpers.parseLinkTitle(u,i,o,A)}let v;for(i<o&&m!==i&&A.ok?(v=A.str,i=A.pos):(v="",i=f,l=g);i<o&&La(u.charCodeAt(i));)i++;if(i<o&&u.charCodeAt(i)!==10&&v)for(v="",i=f,l=g;i<o&&La(u.charCodeAt(i));)i++;if(i<o&&u.charCodeAt(i)!==10)return!1;const k=Yu(u.slice(1,c));return k?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:v,href:d}),e.line=l),!0):!1}function bf(e){switch(e){case 9:case 32:return!0}return!1}const c_=65536;function xf(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function f_(e,t){if(e.lineFlags)return(e.lineFlags[t]&cs.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];n<r;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Im(e){if(!e.includes("\\"))return e.split("|");const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,l=0,s="";for(;r<n;)i===124&&(o?(s+=e.substring(l,r-1),l=r):(t.push(s+e.substring(l,r)),s="",l=r+1)),o=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(l)),t}function d_(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const l=e.src.charCodeAt(o++);if(l!==124&&l!==45&&l!==58||o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!bf(s)||l===45&&bf(s)||!f_(e,t))return!1;for(;o<e.eMarks[i];){const b=e.src.charCodeAt(o);if(b!==124&&b!==45&&b!==58&&!bf(b))return!1;o++}let a=xf(e,t+1),u=a.split("|");const c=[];for(let b=0;b<u.length;b++){const S=u[b].trim();if(!S){if(b===0||b===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?c.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?c.push("left"):c.push("")}if(a=xf(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;u=Im(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const p=u.length;if(p===0||p!==c.length)return!1;if(r)return!0;const d=e.parentType;e.parentType="table";const f=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.push("table_open","table",1),m=[t,0];g.map=m;const A=e.push("thead_open","thead",1);A.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let b=0;b<u.length;b++){const S=e.push("th_open","th",1);c[b]&&(S.attrs=[["style",`text-align:${c[b]}`]]);const T=e.push("inline","",0);T.content=u[b].trim(),T.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let k,C=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let b=!1;for(let T=0,M=f.length;T<M;T++)if(f[T](e,i,n,!0)){b=!0;break}if(b||(a=xf(e,i).trim(),!a)||e.sCount[i]-e.blkIndent>=4||(u=Im(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=p-u.length,C>c_))break;if(i===t+2){const T=e.push("tbody_open","tbody",1);T.map=k=[t+2,0]}const S=e.push("tr_open","tr",1);S.map=[i,i+1];for(let T=0;T<p;T++){const M=e.push("td_open","td",1);c[T]&&(M.attrs=[["style",`text-align:${c[T]}`]]);const E=e.push("inline","",0);E.content=u[T]?u[T].trim():"",E.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return k&&(e.push("tbody_close","tbody",-1),k[1]=i),e.push("table_close","table",-1),m[1]=i,e.parentType=d,e.line=i,!0}var h_=class{constructor(){le(this,"_rules",[]);le(this,"cache",null);le(this,"namedCache",null);le(this,"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==null?void 0:n.alt)||[]}),this.invalidateCache()}before(e,t,n,r){const i=this._rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this._rules.findIndex(l=>l.name===t);o>=0&&this._rules.splice(o,1),this._rules.splice(i,0,{name:t,enabled:!0,fn:n,alt:(r==null?void 0:r.alt)||[]}),this.invalidateCache()}after(e,t,n,r){const i=this._rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this._rules.findIndex(l=>l.name===t);o>=0&&this._rules.splice(o,1),this._rules.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:(r==null?void 0:r.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==null?void 0:e.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:r,fn:i})=>(o,l,s,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=i(o,l,s,a),p=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ol(o==null?void 0:o.env,"block",r,p-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const r=this._rules.findIndex(i=>i.name===e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[r].fn=t,n!=null&&n.alt&&(this._rules[r].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],r=[];let i=!1;return n.forEach(o=>{const l=this._rules.findIndex(s=>s.name===o);if(l===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${o}`)}r.push(o),this._rules[l].enabled||(this._rules[l].enabled=!0,i=!0)}),i&&this.invalidateCache(),r}disable(e,t){const n=Array.isArray(e)?e:[e],r=[];let i=!1;return n.forEach(o=>{const l=this._rules.findIndex(s=>s.name===o);if(l===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${o}`)}r.push(o),this._rules[l].enabled&&(this._rules[l].enabled=!1,i=!0)}),i&&this.invalidateCache(),r}enableOnly(e){const t=new Set(e);let n=!1;for(const r of this._rules){const i=t.has(r.name);r.enabled!==i&&(r.enabled=i,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const r of this._rules)if(r.enabled)for(const i of r.alt)e.add(i);const t=Object.create(null),n=Object.create(null);for(const r of e){const i=[],o=[];for(const l of this._rules)l.enabled&&(r!==""&&!l.alt.includes(r)||(i.push(l.fn),o.push({name:l.name,fn:l.fn})));t[r]=i,n[r]=o}this.cache=t,this.namedCache=n}};const Oa=[["table",d_,["paragraph","reference"]],["code",Z2],["fence",V2,["paragraph","reference","blockquote","list"]],["blockquote",Y2,["paragraph","reference","blockquote","list"]],["hr",q2,["paragraph","reference","blockquote","list"]],["list",s_,["paragraph","reference","blockquote"]],["reference",u_],["html_block",e_,["paragraph","reference","blockquote"]],["heading",J2,["paragraph","reference","blockquote"]],["lheading",r_],["paragraph",a_]];var mv=class{constructor(){le(this,"ruler");le(this,"cachedRulesVersion",-1);le(this,"cachedRules",[]);this.ruler=new h_;for(let e=0;e<Oa.length;e++)this.ruler.push(Oa[e][0],Oa[e][1],{alt:(Oa[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const r=this.getRules(),i=r.length,o=e.md.options.maxNesting,l=e.bMarks,s=e.tShift,a=e.eMarks,u=e.sCount;let c=t,p=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;c<n;){for(;c<n&&l[c]+s[c]>=a[c];)c++;if(e.line=c,c>=n||u[c]<e.blkIndent)break;if(e.level>=o){e.line=n;break}const f=e.line;let g=!1;for(let m=0;m<i;m++)if(g=r[m](e,c,n,!1),g){if(f>=e.line)throw new Error("block rule didn't increment state.line");break}if(!g)throw new Error("none of the block rules matched");e.tight=!p,l[e.line-1]+s[e.line-1]>=a[e.line-1]&&(p=!0),c=e.line,c<n&&l[c]+s[c]>=a[c]&&(p=!0,c++,e.line=c)}return}const d=this.ruler.getNamedRules("");for(;c<n;){for(;c<n&&l[c]+s[c]>=a[c];)c++;if(e.line=c,c>=n||u[c]<e.blkIndent)break;if(e.level>=o){e.line=n;break}const f=e.line;let g=!1;for(let m=0;m<i;m++){const A=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();g=d[m].fn(e,c,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ol(e.env,"block",d[m].name,v-A,g,!1),g){if(f>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!g)throw new Error("none of the block rules matched");e.tight=!p,l[e.line-1]+s[e.line-1]>=a[e.line-1]&&(p=!0),c=e.line,c<n&&l[c]+s[c]>=a[c]&&(p=!0,c++,e.line=c)}}parse(e,t,n,r){if(!e||e.length===0)return;const i=new dv(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Av=class{constructor(e,t,n={}){le(this,"src");le(this,"env");le(this,"tokens");le(this,"inlineMode");le(this,"md");this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Av.prototype.Token=un;const Em=[["normalize",os],["block",kd],["inline",ev],["linkify",tv],["replacements",rv],["smartquotes",iv],["text_join",ov]],p_={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},g_={parseLinkLabel:xh,parseLinkDestination:bh,parseLinkTitle:wh};function m_(){return{...p_}}function A_(){return{...g_}}var v_=class{constructor(){le(this,"fallbackParser");le(this,"lastState",null);le(this,"block");le(this,"inline");le(this,"ruler");le(this,"linkifyInstance",null);le(this,"cachedCoreRulesVersion",-1);le(this,"cachedCoreRules",[]);le(this,"cachedCoreNamedRulesVersion",-1);le(this,"cachedCoreNamedRules",[]);this.block=new mv,this.inline=new x2,this.ruler=new $2;for(let e=0;e<Em.length;e++){const[t,n]=Em[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:m_(),helpers:A_(),normalizeLink:uv,normalizeLinkText:cv,validateLink:av,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new S1({fuzzyLink:!0})),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 Av(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,t){const n=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(!n&&!t){const i=this.getCoreRules();for(let o=0;o<i.length;o++)i[o](e);return}const r=this.getCoreNamedRules();for(let i=0;i<r.length;i++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r[i].fn(e);const l=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();n&&ol(e.env,"core",r[i].name,l-o,!0,!1),t==null||t(r[i],e)}n&&C2(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&Hw(e))return this.parse(T1(e),t,n);const r=this.createState(e,t,n);return this.process(r),this.lastState=r,r}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 k_=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function yu(e){return!k_.test(e)}function ls(e,t){const n=e.indexOf(`
16
+ `,t);return n===-1?e.length:n}function iu(e,t,n){for(let r=t;r<n;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9)return!1}return!0}function Mm(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function wf(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function y_(e){if(e.length>3)return yu(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 C_=["","h1","h2","h3","h4","h5","h6"],b_=["","#","##","###","####","#####","######"],Tm=0,_f=1,Sf=2;function gr(e,t,n,r){const i=new un(e,t,n);return i.level=r,i.block=!0,i}function Eh(e,t,n){const r=gr("inline","",0,n);r.map=[t,t+1],r.content=e;const i=new un("text","",0);return i.content=e,r.children=[i],r}function x_(e,t,n,r,i){let o=0,l=n;for(;l<r&&t.charCodeAt(l)===35&&o<6;)l++,o++;if(o===0||l>=r||t.charCodeAt(l)!==32)return!1;let s=l+1;for(;s<r&&t.charCodeAt(s)===32;)s++;let a=r;for(;a>s&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>s&&t.charCodeAt(u-1)===35;)u--;if(u>s&&t.charCodeAt(u-1)===32)for(a=u-1;a>s&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(s,a);if(!yu(c))return!1;const p=C_[o],d=b_[o],f=gr("heading_open",p,1,0);f.map=[i,i+1],f.markup=d,e.push(f),e.push(Eh(c,i,1));const g=gr("heading_close",p,-1,0);return g.markup=d,e.push(g),!0}function w_(e,t,n){const r=gr("paragraph_open","p",1,0);r.map=[n,n+1],e.push(r),e.push(Eh(t,n,1)),e.push(gr("paragraph_close","p",-1,0))}function __(e,t,n){const r=e.charCodeAt(n-1);return r===32||r===9?e.slice(t,n).trim():e.slice(t,n)}function If(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function S_(e,t){const n=gr("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function I_(e,t,n){const r=gr("list_item_open","li",1,1);r.map=[n,n+1],r.markup="-",e.push(r);const i=gr("paragraph_open","p",1,2);i.map=[n,n+1],i.hidden=!0,e.push(i),e.push(Eh(t,n,3));const o=gr("paragraph_close","p",-1,2);o.hidden=!0,e.push(o);const l=gr("list_item_close","li",-1,1);return l.markup="-",e.push(l),r}function E_(e){const t=gr("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function M_(e,t,n,r){if(!Mm(e,t,n))return null;const i=e.slice(t+3,n);if(i.includes("`"))return null;const o=n<e.length?n+1:n;let l=o,s=o,a=r+1;for(;s<e.length;){const u=ls(e,s);if(Mm(e,s,u)&&iu(e,s+3,u)){const c=gr("fence","code",0,0);return c.map=[r,a+1],c.markup="```",c.info=i,c.content=e.slice(o,l),{token:c,nextPos:u<e.length?u+1:u,nextLine:a+1}}s=u<e.length?u+1:u,l=s,a++}return null}function T_(e,t){if(e.length===0)return t&&(t.matched=!0),[];if(e.includes("\r")||e.includes("\0"))return null;const n=[];let r=e.length>=1e5?Tm:Sf,i="",o=!1,l=!1,s=0,a=0;for(;s<e.length;){const u=ls(e,s);if(s===u){s=u<e.length?u+1:u,a++;continue}const c=e.charCodeAt(s);if(c===32||c===9){if(!iu(e,s,u))return null;s=u<e.length?u+1:u,a++;continue}if(c===35){if(!x_(n,e,s,u,a))return null;t&&(t.blocks++,t.headings++);const g=u<e.length?u+1:u;s=If(e,g),a+=1+s-g;continue}if(c===45){if(!wf(e,s,u))return null;const g=a;let m=s,A=a,v=null,k=null;for(;m<e.length;){const S=ls(e,m);if(!wf(e,m,S))break;const T=m+2,M=S===T+1?e[T]:e.slice(T,S);if(!y_(M))return null;v===null&&(v=S_(n,g)),k=I_(n,M,A),m=S<e.length?S+1:S,A++}if(v===null||k===null)return null;let C=m,b=A;for(;C<e.length;){if(e.charCodeAt(C)===10){C++,b++;continue}const S=ls(e,C);if(!iu(e,C,S)){if(wf(e,C,S))return null;break}C=S<e.length?S+1:S,b++}v.map[1]=b,k.map[1]=b,E_(n),t&&(t.blocks++,t.lists++),s=C,a=b;continue}if(c===96){const g=M_(e,s,u,a);if(!g)return null;n.push(g.token),t&&(t.blocks++,t.fences++),s=If(e,g.nextPos),a=g.nextLine+s-g.nextPos;continue}const p=__(e,s,u);let d;if(r===Sf?(t&&t.paragraphCacheBypasses++,d=yu(p)):r===_f&&p===i?(t&&t.paragraphCacheHits++,d=o):(t&&t.paragraphCacheMisses++,d=yu(p),r===Tm?(l&&(r=p===i?_f:Sf),i=p,o=d,l=!0):r===_f&&(i=p,o=d)),!d)return null;const f=u<e.length?u+1:u;if(f<e.length&&e.charCodeAt(f)!==10&&!iu(e,f,ls(e,f)))return null;w_(n,p,a),t&&(t.blocks++,t.paragraphs++),s=If(e,f),a+=1+s-f}return t&&(t.matched=!0),n}const B_=/[&<>"]/,Bm=/[&<>"]/g,F_=/&/g,D_=/[<>"]/g,R_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Ef(e){return R_[e]||e}function vt(e){if(e.length===0)return"";if(e.length<32)return B_.test(e)?e.replace(Bm,Ef):e;const t=e.includes("&"),n=e.includes("<"),r=e.includes(">"),i=e.includes('"');return!t&&!n&&!r&&!i?e:t&&!n&&!r&&!i?e.replace(F_,"&amp;"):t?e.replace(Bm,Ef):e.replace(D_,Ef)}const N_=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),L_=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function vv(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(N_,(t,n,r)=>{if(n)return n;if(L_.test(r)){const o=r[1].toLowerCase()==="x"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Zu(o)?Rs(o):"�"}const i=hh(t);return i!==t?i:t})}const O_=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,P_=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,$_=/"/g;function el(e,t){const n=e.indexOf(`
17
+ `,t);return n===-1?e.length:n}function Cu(e,t,n){for(let r=t;r<n;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9)return!1}return!0}function Pa(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function H_(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Cu(e,t,el(e,t))}function Fm(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function W_(e,t,n){const r=e.charCodeAt(n-1);return r===32||r===9?e.slice(t,n).trim():e.slice(t,n)}function Mh(e){return P_.test(e)?O_.test(e)?null:e.replace($_,"&quot;"):e}function K_(e,t,n){let r=0,i=t;for(;i<n&&e.charCodeAt(i)===35&&r<6;)i++,r++;if(r===0||i>=n||e.charCodeAt(i)!==32)return null;let o=i+1;for(;o<n&&e.charCodeAt(o)===32;)o++;let l=n;for(;l>o&&e.charCodeAt(l-1)===32;)l--;let s=l;for(;s>o&&e.charCodeAt(s-1)===35;)s--;if(s>o&&e.charCodeAt(s-1)===32)for(l=s-1;l>o&&e.charCodeAt(l-1)===32;)l--;const a=Mh(e.slice(o,l));return a===null?null:`<h${r}>${a}</h${r}>
18
+ `}function Dm(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}const Th=new Uint8Array(256).fill(1);for(const e of[10,33,35,36,37,38,42,43,45,58,60,61,62,64,91,92,93,94,95,96,123,125,126])Th[e]=0;Th[34]=0;function j_(e,t){const n=e.charCodeAt(t);return n===34?`<li>&quot;</li>
19
+ `:n<256&&Th[n]===0?null:`<li>${e[t]}</li>
20
+ `}function z_(e,t,n){const r=t+2;if(n===r+1)return j_(e,r);const i=Mh(e.slice(t+2,n));return i===null?null:`<li>${i}</li>
21
+ `}function G_(e,t,n){for(;t<n;){const i=e.charCodeAt(t);if(i!==32&&i!==9)break;t++}for(;n>t;){const i=e.charCodeAt(n-1);if(i!==32&&i!==9)break;n--}let r=n;for(let i=t;i<n;i++){const o=e.charCodeAt(i);if(o===96)return null;if(o===32||o===9){r=i;break}}return e.slice(t,r)}function Q_(e,t,n,r,i){if(!Fm(e,t,n))return null;const o=G_(e,t+3,n);if(o===null)return null;const l=n<e.length?n+1:n;let s=l,a=l;for(;a<e.length;){const u=el(e,a);if(Fm(e,a,u)&&Cu(e,a+3,u)){const c=e.slice(l,s);let p;return o===r.lang?(i&&i.fenceCacheHits++,p=r.open):(i&&i.fenceCacheMisses++,p=o?`<pre><code class="language-${vt(o)}">`:"<pre><code>",r.lang=o,r.open=p),{html:`${p}${vt(c)}</code></pre>
22
+ `,nextPos:u<e.length?u+1:u}}a=u<e.length?u+1:u,s=a}return null}function kv(e,t){if(e.length===0)return t&&(t.matched=!0),"";if(e.includes("\r")||e.includes("\0"))return null;let n=0,r="";const i=e.length>=25e4,o=[],l={lang:null,open:""};let s="",a="",u="",c="";for(;n<e.length;){const p=el(e,n);if(n===p){n=p<e.length?p+1:p;continue}const d=e.charCodeAt(n);if(d===32||d===9){if(!Cu(e,n,p))return null;n=p<e.length?p+1:p;continue}if(d===35){const A=K_(e,n,p);if(A===null)return null;t&&(t.blocks++,t.headings++),i?o.push(A):r+=A,n=Pa(e,p<e.length?p+1:p);continue}if(d===45){let A=n;for(;A<e.length;){const b=el(e,A);if(!Dm(e,A,b))break;A=b<e.length?b+1:b}if(A===n)return null;const v=e.slice(n,A);let k;if(v===s)t&&t.listCacheHits++,k=a;else{t&&t.listCacheMisses++;let b=n;for(k=`<ul>
23
+ `;b<A;){const S=el(e,b),T=z_(e,b,S);if(T===null)return null;k+=T,b=S<e.length?S+1:S}k+=`</ul>
24
+ `,s=v,a=k}let C=Pa(e,A);for(;C<e.length;){if(e.charCodeAt(C)===10){C++;continue}const b=el(e,C);if(!Cu(e,C,b)){if(Dm(e,C,b))return null;break}C=b<e.length?b+1:b}t&&(t.blocks++,t.lists++),i?o.push(k):r+=k,n=C;continue}if(d===96){const A=Q_(e,n,p,l,t);if(!A)return null;t&&(t.blocks++,t.fences++),i?o.push(A.html):r+=A.html,n=Pa(e,A.nextPos);continue}const f=W_(e,n,p);let g;if(f===u)t&&t.paragraphCacheHits++,g=c;else{t&&t.paragraphCacheMisses++;const A=Mh(f);if(A===null)return null;g=`<p>${A}</p>
25
+ `,u=f,c=g}const m=p<e.length?p+1:p;if(m<e.length&&e.charCodeAt(m)!==10&&H_(e,m))return null;t&&(t.blocks++,t.paragraphs++),i?o.push(g):r+=g,n=Pa(e,m)}return t&&(t.matched=!0),i?o.join(""):r}function Rm(e){return kv(e)}function Nm(e,t){return kv(e,t)}const U_={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function bu(e,t,n={},r){Dn(n);const i={...U_,...r||{}},o=_i(t);if(i.fallbackOnGlobalState!==!1&&o)return kf(n,{count:1,fallback:!0,fallbackReason:o,globalStateDetected:o,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}),il(n,o,()=>e.core.parse(t,n,e).tokens);let l=ou(t,i);if(i.maxChunks&&l.length>i.maxChunks&&(l=J_(l,i.maxChunks)),lu(t,l))return kf(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}),il(n,o,()=>e.core.parse(t,n,e).tokens);let s=0;const a=[];return kf(n,{count:l.length,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines,globalStateDetected:o||void 0,globalStateFallbackDisabled:i.fallbackOnGlobalState===!1&&!!o}),il(n,o,()=>{for(let u=0;u<l.length;u++){const c=l[u],p=t.slice(c.start,c.end),d=e.core.parse(p,n,e).tokens;s!==0&&d.length&&Z_(d,s),V_(a,d),s+=c.lineCount}return a})}function ou(e,t,n=!0){const r=[];let i=0,o=0,l=0,s=0,a=0,u=0,c=null;function p(d){d<=l||(r.push({start:l,end:d,lineCount:s}),l=d,i=0,o=0,s=0)}for(let d=0;d<e.length;){let f=e.indexOf(`
26
+ `,d),g=f;f===-1?(f=e.length,g=e.length):g=f+1;const m=X_(e,d,f);if(t.fenceAware){let k=d;for(;k<f;){const b=e.charCodeAt(k);if(b===32||b===9)k++;else break}const C=e[k];if(C==="`"||C==="~"){let b=k;for(;b<f&&e[b]===C;)b++;const S=b-k;S>=3&&(c?c.marker===C&&S>=c.length&&(c=null):c={marker:C,length:S})}}const A=g-d;i+=A,o+=1,s+=1,m?(a=0,u=0):(a+=1,u+=A);const v=m;if((i>=t.maxChunkChars||o>=t.maxChunkLines)&&!c)if(v)p(g);else{const k=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=k||u>=C)&&p(g)}d=g}return n&&p(e.length),r}function lu(e,t,n={rangesCoverWholeSource:!0}){const r=n.rangesCoverWholeSource?t.length-1:t.length;for(let i=0;i<r;i++)if(!Y_(e,t[i].end))return!0;return!1}function Y_(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 r=n+1;r<t-1;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9&&i!==13)return!1}return!0}function Z_(e,t){if(t===0)return;const n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);for(;n.length;){const r=n.pop();if(r.map&&(r.map[0]+=t,r.map[1]+=t),r.children)for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}}function V_(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function J_(e,t){if(e.length<=t)return e;const n=[];let r=0;for(let i=0;i<t;i++){const o=t-i,l=e.length-r,s=Math.ceil(l/o),a=e.slice(r,r+s);let u=0;for(let c=0;c<a.length;c++)u+=a[c].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:u}),r+=s}return n}function X_(e,t,n){for(let r=t;r<n;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9&&i!==13)return!1}return!0}const yv=4e6,Cv=8e4,q_=1e4,eS=200,tS=1e4,nS=200;function bv(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function rS(e,t){if(t===0)return;const n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);for(;n.length;){const r=n.pop();if(r.map&&(r.map[0]+=t,r.map[1]+=t),r.children)for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}}function mi(e){return e.length===0?0:Qt(e)+(e.charCodeAt(e.length-1)===10?0:1)}function iS(e,t,n){for(let r=t;r<n;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9&&i!==13)return!1}return!0}function oS(e,t){if(!t||e.length===0)return!1;let n=null;for(let r=0;r<e.length;){let i=e.indexOf(`
27
+ `,r);i===-1&&(i=e.length);let o=r;for(;o<i;){const s=e.charCodeAt(o);if(s===32||s===9)o++;else break}const l=e[o];if(l==="`"||l==="~"){let s=o;for(;s<i&&e[s]===l;)s++;const a=s-o;a>=3&&(n?n.marker===l&&a>=n.length&&(n=null):n={marker:l,length:a})}r=i===e.length?e.length:i+1}return n!==null}function lS(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 iS(e,n+1,e.length-1)?!oS(e,t):!1}function sS(e,t,n,r={}){const i=r.mode??"full",o=r.fenceAware??(i==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(r.maxChunkChars!==void 0||r.maxChunkLines!==void 0||r.autoTune===!1){const l=r.maxChunkChars??(i==="stream"?e.options.streamChunkSizeChars??tS:e.options.fullChunkSizeChars??q_),s=r.maxChunkLines??(i==="stream"?e.options.streamChunkSizeLines??nS:e.options.fullChunkSizeLines??eS);return{maxChunkChars:l,maxChunkLines:s,holdBelowChars:l,holdBelowLines:s,fenceAware:o}}return i==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:o}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:o}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:o}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:o}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:o}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:o}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:o}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:o}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:o}}var Vs=class{constructor(e,t={}){le(this,"md");le(this,"options");le(this,"pending","");le(this,"tokens",[]);le(this,"committedChars",0);le(this,"committedLines",0);le(this,"fedChunks",0);le(this,"parsedChunks",0);le(this,"globalStateEnv",null);le(this,"markedGlobalStateReason",null);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=mi(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const r=ou(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!r.length)return this.updateEnvDiagnostics(e,t,n),null;if(lu(this.pending,r,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const i=this.commitRanges(r,e);return this.pending=this.pending.slice(i),this.updateEnvDiagnostics(e,t,mi(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!lS(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,mi(this.pending)),null;const n=ou(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,mi(this.pending)),null;const r=lu(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:mi(this.pending)}]:n;return this.commitRanges(r,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const r=this.resolveWindow();return this.updateEnvDiagnostics(e,r,0),this.tokens}const t=this.resolveWindow(),n=ou(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const r=lu(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:mi(this.pending)}]:n;this.commitRanges(r,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:mi(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+mi(this.pending);return sS(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Ys(e)&&Xr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=_i(t);n&&(yh(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let r=0;r<e.length;r++){const i=e[r],o=this.pending.slice(i.start,i.end),l=this.md.core.parse(o,t,this.md).tokens,s=this.committedChars,a=this.committedLines;a!==0&&l.length&&rS(l,a),this.options.retainTokens!==!1&&bv(this.tokens,l),this.committedChars+=o.length,this.committedLines+=i.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(l,{chunkIndex:this.parsedChunks,chunkChars:o.length,chunkLines:i.lineCount,tokenCount:l.length,startOffset:s,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=i.end}return this.markedGlobalStateReason&&Ch(t),n}catch(r){throw this.markedGlobalStateReason&&(Xr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),r}}updateEnvDiagnostics(e,t,n){_1(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 aS(e,t,n={},r={}){Dn(n);const i=new Vs(e,{mode:"full",...r});for(const o of t)i.feed(o),i.flushAvailable(n);return i.flushForce(n)}async function uS(e,t,n={},r={}){Dn(n);const i=new Vs(e,{mode:"full",...r});for await(const o of t)i.feed(o),i.flushAvailable(n);return i.flushForce(n)}function cS(e,t,n,r={},i={}){Dn(r);const o=new Vs(e,{mode:"full",...i,retainTokens:!1,onChunkTokens:n});for(const l of t)o.feed(l),o.flushAvailable(r);return o.flushForce(r),o.stats()}async function fS(e,t,n,r={},i={}){Dn(r);const o=new Vs(e,{mode:"full",...i,retainTokens:!1,onChunkTokens:n});for await(const l of t)o.feed(l),o.flushAvailable(r);return o.flushForce(r),o.stats()}function xv(e,t,n){if(e.options.autoUnbounded===!1)return!1;const r=e.options.autoUnboundedThresholdChars??yv,i=e.options.autoUnboundedThresholdLines??Cv;return t>=r||n>=i}function wv(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??yv))return"yes";const r=e.options.autoUnboundedThresholdLines??Cv;return n!==void 0?n>=r?"yes":"no":t<2*r-1?"no":"need-lines"}function fs(e,t,n={},r={}){var s;Dn(n);const i=_i(t);if(Ys(n)&&Xr(n),r.fallbackOnGlobalState!==!1&&i)return _1(n,{mode:"full",fallback:!0,fallbackReason:i,committedChars:t.length,committedLines:Qt(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:i}),il(n,i,()=>e.core.parse(t,n,e).tokens);const o=[],l=new Vs(e,{mode:"full",...r,retainTokens:!1,onChunkTokens(a){bv(o,a)}});if(i&&yh(n,i),l.feed(t),l.flushForce(n),i&&(Ch(n),r.fallbackOnGlobalState===!1)){const a=(s=ar(n))==null?void 0:s.unbounded;a&&(a.globalStateDetected=i,a.globalStateFallbackDisabled=!0)}return o}const ll=(e,t,n)=>e<t?t:e>n?n:e;function _v(e){return e.experimental?{...e,...e.experimental}:e}const Lm=[{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"}],Om=[{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 Sv(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function dS(e,t=Math.max(0,e/40|0),n={}){const r=_v(n),i=r.fullChunkFenceAware??!0,o=r.fullChunkTargetChunks??8,l=r.fullChunkAdaptive!==!1;for(let s=0;s<Lm.length;s++){const a=Lm[s];if(e<=a.max){if(a.strategy!=="adaptive")return Sv(i,a);break}}return e>5e6?{strategy:"plain",fenceAware:i,notes:">5M plain"}:l?{strategy:"adaptive",maxChunkChars:ll(Math.ceil(e/o),8e3,64e3),maxChunkLines:ll(Math.ceil(t/o),150,700),maxChunks:ll(Math.ceil(e/64e3),o,16),fenceAware:i,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:r.fullChunkSizeChars??1e4,maxChunkLines:r.fullChunkSizeLines??200,fenceAware:i,maxChunks:r.fullChunkMaxChunks}}function Pm(e,t=Math.max(0,e/40|0),n={}){const r=_v(n),i=r.streamChunkFenceAware??!0,o=r.streamChunkTargetChunks??8,l=r.streamChunkAdaptive!==!1;for(let s=0;s<Om.length;s++){const a=Om[s];if(e<=a.max){if(a.strategy!=="adaptive")return Sv(i,a);break}}return e>5e6?{strategy:"plain",fenceAware:i,notes:">5M plain"}:l?{strategy:"adaptive",maxChunkChars:ll(Math.ceil(e/o),8e3,64e3),maxChunkLines:ll(Math.ceil(t/o),150,700),maxChunks:ll(Math.ceil(e/64e3),o,32),fenceAware:i,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:r.streamChunkSizeChars??1e4,maxChunkLines:r.streamChunkSizeLines??200,maxChunks:r.streamChunkMaxChunks,fenceAware:i}}var hS={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"]}}},pS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},gS={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 Ju(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function su(e,t){if(Ju(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const $m=e=>Ju(e)?e:Promise.resolve(e);function ds(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 vt(e)}}function Fi(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${ds(t[0])}="${vt(t[1])}"`;for(let r=1;r<e.length;r++){const i=e[r];n+=` ${ds(i[0])}="${vt(i[1])}"`}return n}function Iv(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const r=e.charCodeAt(t);if(r===32||r===9||r===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const r=e.charCodeAt(n);if(r!==32&&r!==9&&r!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function hs(e,t,n,r,i){if(t.indexOf("<pre")===0)return`${t}
28
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${vt(`${i.langPrefix??"language-"}${r}`)}">${t}</code></pre>
29
+ `;const o=e.attrIndex("class"),l=e.attrs?e.attrs.slice():[],s=`${i.langPrefix??"language-"}${r}`;return o<0?l.push(["class",s]):(l[o]=l[o].slice(),l[o][1]+=` ${s}`),`<pre><code${Fi(l)}>${t}</code></pre>
30
+ `}return`<pre><code${Fi(e.attrs)}>${t}</code></pre>
31
+ `}function Ls(e){return!e.attrs||e.attrs.length===0?`<code>${vt(e.content)}</code>`:`<code${Fi(e.attrs)}>${vt(e.content)}</code>`}function wd(e){const t=vt(e.content);return e.attrs?`<pre${Fi(e.attrs)}><code>${t}</code></pre>
32
+ `:`<pre><code>${t}</code></pre>
33
+ `}function mS(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="${vt(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${vt(n[0][1])}">`}return null}function Hm(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${ds(t[0][0])}="${vt(t[0][1])}">`:t.length===2?`<a ${ds(t[0][0])}="${vt(t[0][1])}" ${ds(t[1][0])}="${vt(t[1][1])}">`:`<a${Fi(t)}>`}function AS(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 Wm(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 xu(e,t){if(e.hidden)return"";const n=e.attrs,r=e.nesting,i=e.tag;if(!n||n.length===0)return r===0?t?`<${i} />`:`<${i}>`:r===-1?`</${i}>`:`<${i}>`;let o=(r===-1?"</":"<")+i+Fi(n);return r===0&&t&&(o+=" /"),`${o}>`}const vS={langPrefix:"language-",xhtmlOut:!1,breaks:!1},$a=Object.prototype.hasOwnProperty,ft={code_inline(e,t){return Ls(e[t])},code_block(e,t){return wd(e[t])},fence(e,t,n,r,i){const o=e[t],l=o.info?vv(o.info).trim():"",{langName:s,langAttrs:a}=Iv(l),u=n.highlight,c=vt(o.content);if(!u)return hs(o,c,l,s,n);const p=u(o.content,s,a);return Ju(p)?p.then(d=>hs(o,d||c,l,s,n)):hs(o,p||c,l,s,n)},image(e,t,n,r,i){const o=e[t],l=i.renderInlineAsText(o.children||[],n,r),s=o.attrIndex("alt");return s>=0&&o.attrs?o.attrs[s][1]=l:o.attrs?o.attrs.push(["alt",l]):o.attrs=[["alt",l]],xu(o,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
34
+ `:`<br>
35
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
36
+ `:`<br>
37
+ `:`
38
+ `},text(e,t){return vt(e[t].content)},text_special(e,t){return vt(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Km(e,t,n){const r=e.info?vv(e.info).trim():"",{langName:i,langAttrs:o}=Iv(r),l=t.highlight,s=vt(e.content);if(!l)return hs(e,s,r,i,t);const a=l(e.content,i,o);if(Ju(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return hs(e,a||s,r,i,t)}function Mf(e,t,n,r){switch(e.type){case"text":return t.text===ft.text?e.content.length===0?"":vt(e.content):null;case"text_special":return t.text_special===ft.text_special?e.content.length===0?"":vt(e.content):null;case"softbreak":return t.softbreak===ft.softbreak?r:null;case"hardbreak":return t.hardbreak===ft.hardbreak?n:null;case"html_inline":return t.html_inline===ft.html_inline?e.content:null;case"code_inline":return t.code_inline===ft.code_inline?Ls(e):null;default:return null}}function kS(e,t,n,r,i){const o=e[0];switch(o.type){case"text":if(i.text===ft.text)return o.content.length===0?"":vt(o.content);break;case"text_special":if(i.text_special===ft.text_special)return o.content.length===0?"":vt(o.content);break;case"softbreak":if(i.softbreak===ft.softbreak)return t.breaks?t.xhtmlOut?`<br />
39
+ `:`<br>
40
+ `:`
41
+ `;break;case"hardbreak":if(i.hardbreak===ft.hardbreak)return t.xhtmlOut?`<br />
42
+ `:`<br>
43
+ `;break;case"html_inline":if(i.html_inline===ft.html_inline)return o.content;break;case"code_inline":if(i.code_inline===ft.code_inline)return Ls(o);break}const l=i[o.type];if(!l)return xu(o,t.xhtmlOut===!0);const s=l(e,0,t,n,r);return typeof s=="string"?s:su(s,o.type)}var yS=class{constructor(e={}){le(this,"rules");le(this,"baseOptions");le(this,"normalizedBase");this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...ft}}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 r=this.mergeOptions(t),i=n??{},o=this.rules,l=r.xhtmlOut===!0;let s,a,u,c,p,d,f="",g="",m=!1,A="";for(let v=0;v<e.length;v++){const k=e[v],C=k.type,b=v>0&&e[v-1].hidden?`
44
+ `:"";if(C==="list_item_open"&&(!k.attrs||k.attrs.length===0)&&v+3<e.length){const M=e[v+1],E=e[v+2],$=e[v+3];if(M.type==="paragraph_open"&&M.hidden&&E.type==="inline"&&$.type==="paragraph_close"&&$.hidden){A+=`${b}<li>${this.renderInlineTokens(E.children||[],r,i)}`,v+=3;continue}}if(v+2<e.length){const M=e[v+1],E=e[v+2];if(M.type==="inline"&&E.nesting===-1&&E.tag===k.tag&&!E.hidden){const $=mS(k,b);if($!==null){A+=`${$+this.renderInlineTokens(M.children||[],r,i)}</${k.tag}>
45
+ `,v+=2;continue}}}if(C==="inline"){const M=k.children||[];if(M.length===1){m||(s=o.text,a=o.text_special,u=o.softbreak,c=o.hardbreak,p=o.html_inline,d=o.code_inline,f=r.xhtmlOut?`<br />
46
+ `:`<br>
47
+ `,g=r.breaks?f:`
48
+ `,m=!0);const E=M[0];switch(E.type){case"text":if(s===ft.text){A+=vt(E.content);continue}break;case"text_special":if(a===ft.text_special){A+=vt(E.content);continue}break;case"softbreak":if(u===ft.softbreak){A+=g;continue}break;case"hardbreak":if(c===ft.hardbreak){A+=f;continue}break;case"html_inline":if(p===ft.html_inline){A+=E.content;continue}break;case"code_inline":if(d===ft.code_inline){A+=Ls(E);continue}break}}A+=this.renderInlineTokens(M,r,i);continue}const S=o[C];if(!S){const M=k.attrs;if(!k.hidden){if(!M||M.length===0)switch(C){case"hr":A+=l?`<hr />
49
+ `:`<hr>
50
+ `;continue;case"heading_open":A+=`<${k.tag}>`;continue;case"heading_close":A+=`</${k.tag}>
51
+ `;continue;case"paragraph_open":A+=`${b}<p>`;continue;case"paragraph_close":A+=`</p>
52
+ `;continue;case"list_item_open":{const E=e[v+1];A+=b+(E&&(E.type==="inline"||E.hidden||E.nesting===-1&&E.tag==="li")?"<li>":`<li>
53
+ `);continue}case"list_item_close":A+=`</li>
54
+ `;continue;case"bullet_list_open":A+=`${b}<ul>
55
+ `;continue;case"bullet_list_close":A+=`</ul>
56
+ `;continue;case"blockquote_open":A+=b+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
57
+ `);continue;case"blockquote_close":A+=`</blockquote>
58
+ `;continue;case"ordered_list_open":A+=`${b}<ol>
59
+ `;continue;case"ordered_list_close":A+=`</ol>
60
+ `;continue;case"table_open":A+=`${b}<table>
61
+ `;continue;case"table_close":A+=`</table>
62
+ `;continue;case"thead_open":A+=`${b}<thead>
63
+ `;continue;case"thead_close":A+=`</thead>
64
+ `;continue;case"tbody_open":A+=`${b}<tbody>
65
+ `;continue;case"tbody_close":A+=`</tbody>
66
+ `;continue;case"tr_open":A+=`${b}<tr>
67
+ `;continue;case"tr_close":A+=`</tr>
68
+ `;continue;case"td_open":A+=`${b}<td>`;continue;case"td_close":A+=`</td>
69
+ `;continue;case"th_open":A+=`${b}<th>`;continue;case"th_close":A+=`</th>
70
+ `;continue}else if(M.length===1){const E=M[0];if(C==="ordered_list_open"&&E[0]==="start"){A+=`${b}<ol start="${vt(E[1])}">
71
+ `;continue}if(C==="td_open"&&E[0]==="style"){A+=`${b}<td style="${vt(E[1])}">`;continue}if(C==="th_open"&&E[0]==="style"){A+=`${b}<th style="${vt(E[1])}">`;continue}}}A+=this.renderToken(e,v,r);continue}if(C==="code_block"&&S===ft.code_block){A+=wd(k);continue}if(C==="fence"&&S===ft.fence){A+=Km(k,r);continue}if(C==="html_block"&&S===ft.html_block){A+=k.content;continue}const T=S(e,v,r,i,this);typeof T=="string"?A+=T:A+=su(T,k.type)}return A}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const r=this.mergeOptions(t),i=n??{},o=this.rules;let l="";for(let s=0;s<e.length;s++){const a=e[s];if(a.type==="inline"){l+=await this.renderInlineTokensAsync(a.children||[],r,i);continue}const u=o[a.type];u?l+=await $m(u(e,s,r,i,this)):l+=this.renderToken(e,s,r)}return l}renderInline(e,t,n){const r=this.mergeOptions(t),i=n??{};return this.renderInlineTokens(e,r,i)}async renderInlineAsync(e,t,n){const r=this.mergeOptions(t),i=n??{};return this.renderInlineTokensAsync(e,r,i)}renderInlineAsText(e,t,n){const r=this.mergeOptions(t),i=n??{};return this.renderInlineAsTextInternal(e,r,i)}renderAttrs(e){return Fi(e.attrs)}renderToken(e,t,n){const r=e[t];if(r.hidden)return"";const i=r.block,o=r.nesting,l=r.tag,s=r.attrs;let a=!1;if(i&&(a=!0,o===1&&t+1<e.length)){const d=e[t+1];(d.type==="inline"||d.hidden||d.nesting===-1&&d.tag===l)&&(a=!1)}const u=i&&o!==-1&&t>0&&e[t-1].hidden?`
72
+ `:"",c=a?`>
73
+ `:">";if(!s||s.length===0)return o===0?n.xhtmlOut?`${u}<${l} /${c}`:`${u}<${l}${c}`:o===-1?`${u}</${l}${c}`:`${u}<${l}${c}`;let p=u+(o===-1?"</":"<")+l+Fi(s);return o===0&&n.xhtmlOut&&(p+=" /"),p+c}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 r=()=>(n||(n={...t}),n);if($a.call(e,"highlight")&&e.highlight!==t.highlight&&(r().highlight=e.highlight),$a.call(e,"langPrefix")){const i=e.langPrefix;i!==t.langPrefix&&(r().langPrefix=i)}if($a.call(e,"xhtmlOut")){const i=e.xhtmlOut;i!==t.xhtmlOut&&(r().xhtmlOut=i)}if($a.call(e,"breaks")){const i=e.breaks;i!==t.breaks&&(r().breaks=i)}return n||t}buildNormalizedBase(){return Object.freeze({...vS,...this.baseOptions})}renderSingleToken(e,t,n,r){const i=this.rules,o=t.type;if(o==="code_block"&&i.code_block===ft.code_block)return wd(t);if(o==="html_block"&&i.html_block===ft.html_block)return t.content;const l=this.mergeOptions(n),s=r??{};if(o==="inline")return this.renderInlineTokens(t.children||[],l,s);const a=i[o];if(!a)return t.block?this.renderToken(e,0,l):xu(t,l.xhtmlOut===!0);if(o==="fence"&&a===ft.fence)return Km(t,l);const u=a(e,0,l,s,this);return typeof u=="string"?u:su(u,o)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const r=this.rules;if(e.length===1)return kS(e,t,n,this,r);const i=t.xhtmlOut===!0,o=i?`<br />
74
+ `:`<br>
75
+ `,l=t.breaks?o:`
76
+ `,s=r.text,a=r.text_special,u=r.softbreak,c=r.hardbreak,p=r.html_inline,d=r.code_inline,f=r.link_open,g=r.link_close,m=r.em_open,A=r.em_close,v=r.strong_open,k=r.strong_close;let C="";for(let b=0;b<e.length;b++){const S=e[b];if(S.type==="link_open"&&!f&&!g&&b+2<e.length){const E=e[b+1];if(e[b+2].type==="link_close"&&AS(E)){const $=Mf(E,r,o,l);if($!==null){const X=`${Hm(S)+$}</a>`;if(u===ft.softbreak&&b+3<e.length&&e[b+3].type==="softbreak"){C+=X+l,b+=3;continue}C+=X,b+=2;continue}}}if(S.type==="link_open"&&!f&&!g&&b+1<e.length&&e[b+1].type==="link_close"){C+=`${Hm(S)}</a>`,b+=1;continue}if(S.type==="em_open"&&!m&&!A&&b+2<e.length){const E=e[b+1];if(e[b+2].type==="em_close"&&Wm(E)){const $=Mf(E,r,o,l);if($!==null){C+=`<em>${$}</em>`,b+=2;continue}}}if(S.type==="strong_open"&&!v&&!k&&b+2<e.length){const E=e[b+1];if(e[b+2].type==="strong_close"&&Wm(E)){const $=Mf(E,r,o,l);if($!==null){C+=`<strong>${$}</strong>`,b+=2;continue}}}switch(S.type){case"text":if(s===ft.text){const E=S.content.length===0?"":vt(S.content);if(p===ft.html_inline&&b+1<e.length&&e[b+1].type==="html_inline"){for(C+=E+e[++b].content;b+1<e.length&&e[b+1].type==="html_inline";)C+=e[++b].content;continue}C+=E;continue}break;case"text_special":if(a===ft.text_special){S.content.length!==0&&(C+=vt(S.content));continue}break;case"softbreak":if(u===ft.softbreak){C+=l;continue}break;case"hardbreak":if(c===ft.hardbreak){C+=o;continue}break;case"html_inline":if(p===ft.html_inline){for(C+=S.content;b+1<e.length&&e[b+1].type==="html_inline";)C+=e[++b].content;continue}break;case"code_inline":if(d===ft.code_inline){C+=Ls(S);continue}break}const T=r[S.type];if(!T){C+=S.block?this.renderToken(e,b,t):xu(S,i);continue}const M=T(e,b,t,n,this);typeof M=="string"?C+=M:C+=su(M,S.type)}return C}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const r=this.rules;let i="";for(let o=0;o<e.length;o++){const l=r[e[o].type];l?i+=await $m(l(e,o,t,n,this)):i+=this.renderToken(e,o,t)}return i}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let r="";for(let i=0;i<e.length;i++){const o=e[i];switch(o.type){case"text":case"text_special":r+=o.content;break;case"image":r+=this.renderInlineAsTextInternal(o.children||[],t,n);break;case"html_inline":case"html_block":r+=o.content;break;case"softbreak":case"hardbreak":r+=`
77
+ `;break}}return r}},CS=yS;const bS=[],Ha=4096;function xS(e){const t={...e};return Array.isArray(e.quotes)&&(t.quotes=[...e.quotes]),e.experimental&&(t.experimental={...e.experimental}),t}function wS(e,t){const n=Object.keys(t);return Object.keys(e).length!==n.length?!1:n.every(r=>{if(!Object.hasOwn(e,r))return!1;const i=e[r],o=t[r];if(Array.isArray(i)&&Array.isArray(o))return i.length===o.length&&i.every((l,s)=>Object.is(l,o[s]));if(r==="experimental"&&i&&o){const l=i,s=o,a=Object.keys(s);return Object.keys(l).length===a.length&&a.every(u=>Object.hasOwn(l,u)&&Object.is(l[u],s[u]))}return Object.is(i,o)})}function _S(e){return{options:xS(e.options),coreVersion:e.core.ruler.version,blockVersion:e.block.ruler.version,inlineVersion:e.inline.ruler.version,inline2Version:e.inline.ruler2.version}}function jm(e,t){return wS(e.options,t.options)&&e.coreVersion===t.core.ruler.version&&e.blockVersion===t.block.ruler.version&&e.inlineVersion===t.inline.ruler.version&&e.inline2Version===t.inline.ruler2.version}function SS(e){const t=e.length;let n=0;for(;n<=t;){let r=e.indexOf(`
78
+ `,n);r===-1&&(r=t);const i=r<t;let o=n,l=0;for(;o<r;){const s=e.charCodeAt(o);if(s===32){if(l++,o++,l>=4)return!0;continue}if(s===9){if(l+=4-l%4,o++,l>=4)return!0;continue}break}if(o<r){const s=e.charCodeAt(o);switch(s){case 35:{let a=o;for(;a<r&&e.charCodeAt(a)===35;)a++;const u=a-o;if(u>0&&u<=6){if(a<r){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===r&&i)return!0}break}case 62:{const a=o+1;if(a<r){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===r&&i)return!0;break}case 45:case 42:case 43:{const a=o+1;if(a<r){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===r&&i)return!0;break}case 96:case 126:{let a=o;for(;a<r&&e.charCodeAt(a)===s;)a++;if(a-o>=3)return!0;break}default:if(s>=48&&s<=57){let a=o+1;for(;a<r;){const u=e.charCodeAt(a);if(u<48||u>57)break;a++}if(a<r&&e.charCodeAt(a)===46){const u=a+1;if(u<r){const c=e.charCodeAt(u);if(c===32||c===9||c===13)return!0}else if(u===r&&i)return!0}}break}}if(r===t)break;n=r+1}return!1}function IS(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 ES(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(!Ev(e[n],t[n]))return!1;return!0}function Ev(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,r=t.map;return!!n!=!!r||n&&r&&(n[0]!==r[0]||n[1]!==r[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||!IS(e.attrs,t.attrs)||!ES(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function zm(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var MS=class{constructor(e){le(this,"core");le(this,"anchorBlock",new mv);le(this,"cache",null);le(this,"snapshots",new WeakSet);le(this,"stats",zm());le(this,"normalizeLineEndings",!0);le(this,"tokenMapsTrusted",!0);le(this,"allowUntrustedTailReuse",!1);le(this,"MIN_SIZE_FOR_OPTIMIZATION",1e3);le(this,"DEFAULT_SKIP_CACHE_CHARS",1e6);le(this,"DEFAULT_SKIP_CACHE_LINES",1e5);le(this,"IMPLICIT_STREAM_CHUNK_MIN_CHARS",16e4);le(this,"MIN_LIST_LINES_FOR_MERGE",80);le(this,"MIN_LIST_CHARS_FOR_MERGE",800);le(this,"MIN_TABLE_LINES_FOR_MERGE",48);le(this,"MIN_TABLE_CHARS_FOR_MERGE",1200);le(this,"MIN_UNBOUNDED_APPEND_TOTAL_CHARS",5e5);le(this,"MIN_UNBOUNDED_APPEND_CHARS",64e3);le(this,"MIN_UNBOUNDED_APPEND_LINES",700);this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=zm(),this.stats.resets=e}snapshot(){const e=this.cache;if(!e)return null;const t=e.snapshotState??{cache:e};e.snapshotState=t;const n={state:t,get sourceLength(){return this.state.cache.src.length},get tokenCount(){return this.state.cache.tokens.length}};return this.snapshots.add(n),n}restore(e,t){if(!this.snapshots.has(e))throw new TypeError("Invalid stream snapshot");const n=e.state.cache;return this.cache=n,jm(n.config,t)?n.tokens:this.parse(n.src,n.env,t)}append(e,t,n){const r=this.cache;if(!r)throw new Error("Stream append requires cached history; call stream.parse(fullSource) first");return this.ensureBoundaryState(r),this.parse(r.src+e,t,n,e)}parse(e,t,n,r){var re,pe,ce,Ce,ze,Ne,Ze,st,Ke,St,Pe,Ft,vn,Vt,fr,Lr,Ar,$n,Hn,It,Dt,Ht,vr,kn,Wn,yt,rt,ot,Ct,jt,qt,pt,tt;const i=this.cache,o=i==null?void 0:i.env,l=n.core.ruler.getNamedRules(""),s=l.findIndex(xe=>xe.fn===os),a=l.findIndex(xe=>xe.fn===kd),u=l.find(xe=>xe.name==="normalize");this.normalizeLineEndings=s>=0&&a>=0&&s<a;const c=t,p=!!i&&!jm(i.config,n),d=u&&u.fn!==os,f=u&&!this.normalizeLineEndings&&e.includes("\r"),g=a<0||l.slice(0,a).some(xe=>xe.fn!==os);this.tokenMapsTrusted=!(a<0||l.slice(a+1).some(xe=>xe.fn!==ev&&xe.fn!==tv&&xe.fn!==rv&&xe.fn!==iv&&xe.fn!==ov)),this.allowUntrustedTailReuse=this.tokenMapsTrusted||((re=n.options)==null?void 0:re.streamTailLocalPostBlockRules)===!0;const m=p||d||f||g?null:i;if(Dn(c??(i==null?void 0:i.env)??o),!m||c&&c!==m.env){const xe=c??(i==null?void 0:i.env)??o??{},Le=!!n.__explicitStreamChunkFallbackSetting,nt=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,Xe=!!((pe=n.options)!=null&&pe.streamChunkedFallback),at=!Le&&nt,tn=Xe||at,it=((ce=n.options)==null?void 0:ce.streamChunkAdaptive)!==!1,Ge=((Ce=n.options)==null?void 0:Ce.streamChunkTargetChunks)??8,ut=(ze=n.options)==null?void 0:ze.streamChunkSizeChars,Et=(Ne=n.options)==null?void 0:Ne.streamChunkSizeLines,Jt=(Ze=n.options)==null?void 0:Ze.streamChunkMaxChunks,Ee=!!n.__explicitStreamChunkConfig,nn=((st=n.options)==null?void 0:st.autoTuneChunks)!==!1,qe=((Ke=n.options)==null?void 0:Ke.streamChunkFenceAware)??!0,At=((St=n.options)==null?void 0:St.streamLargeCachePolicy)??"retain",Mt=((Pe=n.options)==null?void 0:Pe.streamSkipCacheAboveChars)??this.DEFAULT_SKIP_CACHE_CHARS,an=((Ft=n.options)==null?void 0:Ft.streamSkipCacheAboveLines)??this.DEFAULT_SKIP_CACHE_LINES;let bt,er=!1;if(At==="skip"&&(er=e.length>=Mt,!er&&an!==void 0&&(bt=Qt(e),er=bt>=an)),er&&r===void 0&&!(i!=null&&i.snapshotState)){const tr=this.parseFullDocument(e,xe,n,bt,!1);return this.cache=null,this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ln(xe,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!((vn=ar(xe))!=null&&vn.unbounded)}),tr.tokens}else if(tn){const tr=(nr,kr,Pr)=>nr<kr?kr:nr>Pr?Pr:nr;bt===void 0&&(bt=Qt(e));const Wt=nn&&!Ee?Pm(e.length,bt,n.options):null,Hi=(Wt==null?void 0:Wt.maxChunkChars)??(it?tr(Math.ceil(e.length/Ge),8e3,64e3):ut??1e4),Or=(Wt==null?void 0:Wt.maxChunkLines)??(it?tr(Math.ceil(bt/Ge),150,700):Et??200),ti=(Wt==null?void 0:Wt.maxChunks)??(it?tr(Math.ceil(e.length/64e3),Ge,32):Jt),ni=e.length>0&&e.charCodeAt(e.length-1)===10,ri=at&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&(Wt==null?void 0:Wt.strategy)!=="plain";if((Xe||ri)&&(e.length>=Hi*2||bt>=Or*2)&&ni){const nr=bu(n,e,xe,{maxChunkChars:Hi,maxChunkLines:Or,fenceAware:(Wt==null?void 0:Wt.fenceAware)??qe,maxChunks:ti}),kr=((fr=(Vt=ar(xe))==null?void 0:Vt.chunk)==null?void 0:fr.globalStateDetected)??null,Pr=this.setCache({src:e,tokens:nr,env:xe,lineCount:bt,lastSegment:void 0,globalStateReason:kr},n);return this.updateCacheLineCount(Pr,bt),this.recordChunkedParseResult(xe,Xe?"explicit-initial-large-doc":"default-initial-large-doc"),nr}}const me=this.parseFullDocument(e,xe,n,bt);bt=me.lineCount;const ei=this.setCache({src:e,tokens:me.tokens,env:xe,lineCount:bt,lastSegment:void 0,globalStateReason:me.globalStateReason},n);return this.updateCacheLineCount(ei,bt),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ln(xe,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!((Lr=ar(xe))!=null&&Lr.unbounded)}),me.tokens}if(e===m.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ln(m.env,{area:"stream",path:"stream-cache",reason:"same-source"}),m.tokens;const A=r!==void 0?r:e.startsWith(m.src)?e.slice(m.src.length):null;let v=m.globalStateReason;v===void 0&&(v=_i(m.src),m.globalStateReason=v);const k=v?null:A!==null?this.detectGlobalStateForAppend(m,A):_i(e),C=v||k;if(C){const xe=c??m.env;Xr(xe);const Le=this.parseFullDocument(e,xe,n),nt=Le.tokens,Xe=Le.lineCount,at=this.setCache({src:e,tokens:nt,env:xe,lineCount:Xe,lastSegment:void 0,globalStateReason:Le.globalStateReason},n);return this.updateCacheLineCount(at,Xe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ln(xe,{area:"stream",path:"stream-full",reason:`global-state:${C}`,unbounded:!!((Ar=ar(xe))!=null&&Ar.unbounded)}),nt}const b=(($n=n.options)==null?void 0:$n.streamOptimizationMinSize)??this.MIN_SIZE_FOR_OPTIMIZATION;if(m.src.length<b&&e.length<b*1.5&&A===null){const xe=c??m.env,Le=this.parseFullDocument(e,xe,n),nt=Le.tokens,Xe=Le.lineCount,at=this.setCache({src:e,tokens:nt,env:xe,lineCount:Xe,lastSegment:void 0,globalStateReason:Le.globalStateReason},n);return this.updateCacheLineCount(at,Xe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ln(xe,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!((Hn=ar(xe))!=null&&Hn.unbounded)}),nt}const S=this.ensureLastSegment(m,r!==void 0),T=this.tokenMapsTrusted||this.allowUntrustedTailReuse&&(m.lastSegmentVerified===!0||!!(S&&this.hasVerifiedSegmentAnchor(m,S,n))),M=A!==null&&this.shouldPreferTailReparseForAppend(m,T)||!this.tokenMapsTrusted?null:this.getAppendedSegment(m,e,A);if(M){const xe=m.lineCount??Qt(m.src);let Le=3;M.length>5e3?Le=8:M.length>1e3?Le=6:M.length>200&&(Le=4),Le=Math.min(Le,xe);let nt=null;const Xe=((It=n.options)==null?void 0:It.streamContextParseStrategy)??"chars",at=((Dt=n.options)==null?void 0:Dt.streamContextParseMinChars)??200,tn=((Ht=n.options)==null?void 0:Ht.streamContextParseMinLines)??2;let it;const Ge=()=>(it===void 0&&(it=Qt(M)),it),ut=this.canDirectlyParseAppend(m),Et=ut&&this.shouldUseUnboundedAppend(e,m,M);let Jt=!1;if(!ut)switch(Xe){case"lines":Jt=Ge()>=tn;break;case"constructs":if(M.length>=at){Jt=!0;break}if(SS(M)){Jt=!0;break}Jt=Ge()>=tn;break;case"chars":default:Jt=M.length>=at}if(Le>0&&Jt){const qe=this.getTailLines(m.src,Le)+M;try{const At=this.core.parse(qe,m.env,n).tokens,Mt=At.findIndex(an=>an.map&&typeof an.map[1]=="number"&&an.map[1]>Le);if(Mt!==-1){const an=At.slice(Mt),bt=xe-Le;bt!==0&&this.shiftTokenLines(an,bt),nt={tokens:an}}}catch{nt=null}}else nt=null;if(!nt){const qe=xe;if(Et)nt={tokens:fs(n,M,m.env,{mode:"stream"})},qe>0&&this.shiftTokenLines(nt.tokens,qe);else{const At=this.core.parse(M,m.env,n);qe>0&&this.shiftTokenLines(At.tokens,qe),nt=At}}let Ee=0;if(m.tokens.length>0&&nt.tokens.length>0){const qe=m.tokens[m.tokens.length-1],At=nt.tokens[0];try{qe.type==="inline"&&At.type==="inline"&&(At.children&&At.children.length>0&&(qe.children||(qe.children=[]),this.appendTokens(qe.children,At.children)),qe.content=(qe.content||"")+(At.content||""),Ee=1)}catch{Ee=0}}const nn=m.tokens.length;if(nt.tokens.length>Ee){const qe=m.tokens,At=nt.tokens,Mt=Math.min(qe.length,At.length-Ee);let an=0;for(let bt=Mt;bt>0;bt--){let er=!0;for(let me=0;me<bt;me++){const ei=qe[qe.length-bt+me],tr=At[Ee+me];if(!Ev(ei,tr)){er=!1;break}}if(er){an=bt;break}}an>0&&(Ee+=an),At.length>Ee&&this.appendTokens(m.tokens,At,Ee)}if(m.boundary?this.updateBoundaryStateForAppend(m,M):this.updateFenceMarkerCacheForAppend(m,M),m.src=e,m.globalStateReason=null,m.lineCount=xe+(it??Ge()),m.tokens.length>nn){const qe=this.getLastSegment(m.tokens,e,nn,m.tokens.length,e.length-M.length,xe);if(qe){m.lastSegment=qe;const At=e.length-M.length;m.lastSegmentSource=M.slice(Math.max(0,qe.srcOffset-At))}else m.lastSegment=void 0,m.lastSegmentSource=void 0}else m.lastSegment=void 0,m.lastSegmentSource=void 0;return m.lastSegmentVerified=void 0,this.stats.total+=1,this.stats.appendHits+=1,Et&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ln(m.env,{area:"stream",path:Et?"stream-unbounded-append":"stream-append",reason:Et?"large-delta":"safe-append",unbounded:Et}),m.tokens}const E=c??m.env,$=T?this.tryTailSegmentReparse(e,m,E,n,S??void 0,A??void 0):this.allowUntrustedTailReuse?this.tryUntrustedParagraphTailReparse(e,m,E,n):null;if($)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ln(E,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),$;const X=!!n.__explicitStreamChunkFallbackSetting,K=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,I=!!((vr=n.options)!=null&&vr.streamChunkedFallback),B=!X&&!M&&K,P=I||B,_=((kn=n.options)==null?void 0:kn.streamChunkAdaptive)!==!1,W=((Wn=n.options)==null?void 0:Wn.streamChunkTargetChunks)??8,z=(yt=n.options)==null?void 0:yt.streamChunkSizeChars,N=(rt=n.options)==null?void 0:rt.streamChunkSizeLines,R=(ot=n.options)==null?void 0:ot.streamChunkMaxChunks,oe=!!n.__explicitStreamChunkConfig,ne=((Ct=n.options)==null?void 0:Ct.autoTuneChunks)!==!1,ee=((jt=n.options)==null?void 0:jt.streamChunkFenceAware)??!0;let ie=M&&m.lineCount!==void 0?m.lineCount+Qt(M):void 0;if(P){ie===void 0&&(ie=Qt(e));const xe=(Ge,ut,Et)=>Ge<ut?ut:Ge>Et?Et:Ge,Le=ne&&!oe?Pm(e.length,ie,n.options):null,nt=(Le==null?void 0:Le.maxChunkChars)??(_?xe(Math.ceil(e.length/W),8e3,64e3):z??1e4),Xe=(Le==null?void 0:Le.maxChunkLines)??(_?xe(Math.ceil(ie/W),150,700):N??200),at=(Le==null?void 0:Le.maxChunks)??(_?xe(Math.ceil(e.length/64e3),W,32):R),tn=e.length>0&&e.charCodeAt(e.length-1)===10,it=B&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&(Le==null?void 0:Le.strategy)!=="plain";if((I||it)&&(e.length>=nt*2||ie>=Xe*2)&&tn){const Ge=bu(n,e,E,{maxChunkChars:nt,maxChunkLines:Xe,fenceAware:(Le==null?void 0:Le.fenceAware)??ee,maxChunks:at}),ut=((pt=(qt=ar(E))==null?void 0:qt.chunk)==null?void 0:pt.globalStateDetected)??null,Et=this.setCache({src:e,tokens:Ge,env:E,lineCount:ie,lastSegment:void 0,globalStateReason:ut},n);return this.updateCacheLineCount(Et,ie),this.recordChunkedParseResult(E,I?"explicit-fallback-large-doc":"default-fallback-large-doc"),Ge}}const G=this.parseFullDocument(e,E,n,ie),Q=G.tokens;ie=G.lineCount;const te=this.setCache({src:e,tokens:Q,env:E,lineCount:ie,lastSegment:void 0,globalStateReason:G.globalStateReason},n);return this.updateCacheLineCount(te,ie),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ln(E,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!((tt=ar(E))!=null&&tt.unbounded)}),Q}recordChunkedParseResult(e,t){var i,o;const n=(i=ar(e))==null?void 0:i.chunk,r=n!=null&&n.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,r){this.stats.fullParses+=1,this.stats.lastMode="full",ln(e,{area:"stream",path:"stream-full",reason:`global-state:${r}`,unbounded:!!((o=ar(e))!=null&&o.unbounded)});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ln(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,r,i=!0){var a,u,c,p;Ys(t)&&Xr(t);const o=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?wv(n,e.length,r):"no";if(o==="yes"){const d=fs(n,e,t),f=((u=(a=ar(t))==null?void 0:a.unbounded)==null?void 0:u.globalStateDetected)??null;return ln(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:d,lineCount:r??(i?Qt(e):0),globalStateReason:f}}let l=r;if(o==="need-lines"&&(l=Qt(e),xv(n,e.length,l))){const d=fs(n,e,t),f=((p=(c=ar(t))==null?void 0:c.unbounded)==null?void 0:p.globalStateDetected)??null;return ln(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:d,lineCount:l,globalStateReason:f}}l===void 0&&(l=i?Qt(e):0);const s=_i(e);return{tokens:il(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l,globalStateReason:s}}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:Qt(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){var u;const r=e.src;if(n===null||n===void 0&&!t.startsWith(r)||(n!==void 0?!this.ensureBoundaryState(e).endsWithNewline:!r.endsWith(`
79
+ `)))return null;const i=n??t.slice(r.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let l=0,s=-1;for(let c=0;c<o&&!(i.charCodeAt(c)===10&&(s===-1&&(s=c),l++,l>=2));c++);if(l<2)return null;const a=(s===-1?i:i.slice(0,s)).trim();if(a.length===0)return null;if(/^[-=]+$/.test(a)){let c;if(n!==void 0)c=this.ensureBoundaryState(e).previousLineNonBlank;else{const p=r.slice(0,-1),d=p.lastIndexOf(`
80
+ `);c=p.slice(d+1).trim().length>0}if(c)return null}if(n!==void 0){const c=this.ensureLastSegment(e);if(c&&this.segmentHasFence(e,c)){const p=this.tokenMapsTrusted?this.ensureSegmentSourceOffset(e,c):0;if(this.endsInsideOpenFence(r,p))return null}}else{const c=this.tokenMapsTrusted?((u=this.ensureLastSegment(e))==null?void 0:u.srcOffset)??0:0;if((this.tokenMapsTrusted||this.cacheHasFenceMarker(e))&&this.endsInsideOpenFence(r,c))return null}return this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,r,i,o){const l=i??this.ensureLastSegment(t);if(!l)return null;const s=o!==void 0;if(s&&this.ensureSegmentSourceOffset(t,l),l.srcOffset<=0&&l.tokenStart<=0)return null;if(!s){const d=t.src.slice(0,l.srcOffset);if(!e.startsWith(d))return null}const a=s?t.lastSegmentSource??t.src.slice(l.srcOffset):t.src.slice(l.srcOffset),u=s?a+o:e.slice(l.srcOffset);if(u===a)return null;const c=s?o:e.startsWith(t.src)?e.slice(t.src.length):null,p=s&&this.tokenMapsTrusted?e:this.getNormalizedUpdatedSource(t,e,o);if(c){const d=this.tryContainerTailAppendMerge(e,t,n,r,l,c,p);if(d)return t.lastSegmentSource=s?u:void 0,d}if(this.mayContainReferenceDefinition(a)||this.mayContainReferenceDefinition(u))return null;try{const d=this.parseAtLineOffset(u,n,r,l.lineStart,p),f=d.state,g=this.getLastSegment(f.tokens,u,0,f.tokens.length,d.mapsShifted?0:void 0,d.mapsShifted?l.lineStart:void 0);return l.lineStart>0&&!d.mapsShifted&&this.shiftTokenLines(f.tokens,l.lineStart),c?s?this.updateBoundaryStateForAppend(t,c):this.updateFenceMarkerCacheForAppend(t,c):(t.boundary=void 0,t.hasFenceMarker=void 0),t.src=e,t.normalizedSrc=p,t.env=n,t.globalStateReason=null,(!s||!c)&&(t.globalStateCarry=void 0),t.tokens.length=l.tokenStart,this.appendTokens(t.tokens,f.tokens),t.lineCount=l.lineStart+Qt(u),g?(t.lastSegment={tokenStart:l.tokenStart+g.tokenStart,tokenEnd:l.tokenStart+g.tokenEnd,lineStart:d.mapsShifted?g.lineStart:l.lineStart+g.lineStart,lineEnd:d.mapsShifted?g.lineEnd:l.lineStart+g.lineEnd,srcOffset:l.srcOffset+g.srcOffset},t.lastSegmentSource=s?u.slice(g.srcOffset):void 0):(t.lastSegment=null,t.lastSegmentSource=void 0),t.lastSegmentVerified=void 0,t.tokens}catch{return null}}tryUntrustedParagraphTailReparse(e,t,n,r){var a;if(t.boundary?t.boundary.endsWithBlankLine:this.endsWithBlankLine(t.src))return null;const i=this.ensureLastSegment(t);if(!i||((a=t.tokens[i.tokenStart])==null?void 0:a.type)!=="paragraph_open")return null;const o=t.tokens.slice(i.tokenStart,i.tokenEnd).find(u=>u.type==="inline");if(!(o!=null&&o.content))return null;let l=t.src.length;for(;l>0;){const u=t.src.charCodeAt(l-1);if(u!==10&&u!==13)break;l--}const s=t.src.lastIndexOf(o.content,l-o.content.length);return s<0||s+o.content.length!==l?null:this.tryTailSegmentReparse(e,t,n,r,{...i,lineStart:this.countSourceLineBreaks(t.src,s),srcOffset:s})}countSourceLineBreaks(e,t){let n=0;for(let r=0;r<t;r++){const i=e.charCodeAt(r);i===10?n++:this.normalizeLineEndings&&i===13&&(n++,e.charCodeAt(r+1)===10&&r++)}return n}hasVerifiedSegmentAnchor(e,t,n){var l,s;t.srcOffset<0&&this.ensureSegmentSourceOffset(e,t);const r=e.lineCount??Qt(e.src),i=this.getDocLineCount(e.src,r);if(!(t.lineStart>=0&&t.lineStart<=t.lineEnd&&t.lineEnd<=i&&t.srcOffset<e.src.length))return!1;const o=e.src.slice(t.srcOffset);try{const a=Object.create(n);Object.defineProperty(a,"block",{value:this.anchorBlock});const u=this.core.createState(o,{},a);this.normalizeLineEndings&&os(u),this.anchorBlock.parse(u.src,a,u.env,u.tokens);const c=this.getLastSegment(u.tokens,o);if(!c||c.tokenStart!==0)return!1;const p=typeof u.src=="string"?u.src:o,d=(l=u.tokens[0])==null?void 0:l.type,f=(s=e.tokens[t.tokenStart])==null?void 0:s.type,g=f==="table_open"&&d==="paragraph_open"&&/^\s*\|/.test(p)||f==="inline"&&d==="html_block"||f==="math_block"&&d==="paragraph_open"&&/^\s*\$\$\s*(?:\n|$)/.test(p);if(d!==f&&!g)return!1;const m=e.tokens.slice(t.tokenStart,t.tokenEnd).map(v=>v.content).filter(Boolean);let A=0;for(const v of m){if(A=p.indexOf(v,A),A<0)return!1;A+=v.length}return!0}catch{return!1}}normalizeSource(e){return e.replace(/\r\n?/g,`
81
+ `).replace(/\0/g,"�")}cacheHasFenceMarker(e){return e.hasFenceMarker===void 0&&(e.hasFenceMarker=e.src.includes("```")||e.src.includes("~~~")),e.hasFenceMarker}updateFenceMarkerCacheForAppend(e,t){if(this.cacheHasFenceMarker(e))return;const n=e.src.slice(-2)+t;e.hasFenceMarker=n.includes("```")||n.includes("~~~")}getNormalizedUpdatedSource(e,t,n){if(!this.normalizeLineEndings)return t;if(n===void 0&&!t.startsWith(e.src))return this.normalizeSource(t);const r=e.normalizedSrc??this.normalizeSource(e.src),i=n??t.slice(e.src.length);let o=this.normalizeSource(i);return e.src.endsWith("\r")&&i.startsWith(`
82
+ `)&&(o=o.slice(1)),r+o}parseAtLineOffset(e,t,n,r,i){if(this.tokenMapsTrusted||r<=0)return{state:this.core.parse(e,t,n),mapsShifted:!1};const o=this.core.createState(e,t,n);let l=!1;return this.core.process(o,(s,a)=>{!l&&s.fn===kd&&(this.shiftTokenLines(a.tokens,r),i!==void 0&&(a.src=i),l=!0)}),{state:o,mapsShifted:l}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let r=e.length-1;r>=0;r--)if(e.charCodeAt(r)===10&&(n--,n===0))return e.slice(r+1);return e}endsInsideOpenFence(e,t){const n=e.slice(t),r=n.length;let i=null,o=0;for(;o<r;){let l=n.indexOf(`
83
+ `,o);if(this.normalizeLineEndings){const u=n.indexOf("\r",o);u>=0&&(l===-1||u<l)&&(l=u)}l===-1&&(l=r);let s=o,a=0;for(;s<l;){const u=n.charCodeAt(s);if(u===32){if(s++,a++,a>=4)break}else if(u===9){a=4;break}else break}if(a<4&&s<l){const u=n.charCodeAt(s);if(u===96||u===126){let c=s;for(;c<l&&n.charCodeAt(c)===u;)c++;const p=c-s;if(p>=3)if(i){if(i.marker===u&&p>=i.length){let d=c;for(;d<l;){const f=n.charCodeAt(d);if(f===32||f===9)d++;else break}d===l&&(i=null)}}else{const d=u===96?n.indexOf("`",c):-1;d>=0&&d<l||(i={marker:u,length:p})}}}if(l===r)break;o=l+(this.normalizeLineEndings&&n.charCodeAt(l)===13&&n.charCodeAt(l+1)===10?2:1)}return i!==null}peek(){var e;return((e=this.cache)==null?void 0:e.tokens)??bS}hasCache(){return this.cache!==null}getStats(){return{...this.stats}}setCache(e,t){var i;const n=(i=this.cache)==null?void 0:i.snapshotState,r={...e,config:_S(t),snapshotState:n};return n&&(n.cache=r),this.cache=r,r}appendTokens(e,t,n=0,r=t.length){for(let i=n;i<r;i++)e.push(t[i])}updateCacheLineCount(e,t){e.lineCount=t??Qt(e.src),e.lastSegment=void 0,e.lastSegmentVerified=void 0,e.normalizedSrc=void 0,e.globalStateCarry=e.src.slice(-Ha),e.boundary=void 0,e.lastSegmentSource=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-Ha))+t,r=_i(n);return e.globalStateCarry=n.length>Ha?n.slice(n.length-Ha):n,r&&(e.globalStateReason=r),r}ensureLastSegment(e,t=!1){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src,0,e.tokens.length,void 0,void 0,t)),e.lastSegment}getLastSegment(e,t,n=0,r=e.length,i,o,l=!1){var c,p,d,f;if(r<=n)return null;let s=Number.POSITIVE_INFINITY,a=-1,u=0;for(let g=r-1;g>=n;g--){const m=e[g];if(m.map&&(m.map[0]<s&&(s=m.map[0]),m.map[1]>a&&(a=m.map[1])),m.nesting<0){u+=-m.nesting;continue}if(m.nesting>0){if(u-=m.nesting,m.level===0&&u<=0){const A=Number.isFinite(s)?s:((c=m.map)==null?void 0:c[0])??0,v=a>=A?a:((p=m.map)==null?void 0:p[1])??A;return{tokenStart:g,tokenEnd:r,lineStart:A,lineEnd:v,srcOffset:l?-1:this.getLineStartOffset(t,A,i,o)}}continue}if(m.level===0&&u===0){const A=Number.isFinite(s)?s:((d=m.map)==null?void 0:d[0])??0,v=a>=A?a:((f=m.map)==null?void 0:f[1])??A;return{tokenStart:g,tokenEnd:r,lineStart:A,lineEnd:v,srcOffset:l?-1:this.getLineStartOffset(t,A,i,o)}}}return null}segmentHasFence(e,t){const n=Math.min(t.tokenEnd,e.tokens.length);for(let r=t.tokenStart;r<n;r++)if(e.tokens[r].type==="fence")return!0;return!1}ensureSegmentSourceOffset(e,t){if(t.srcOffset<0){const n=e.lineCount;t.srcOffset=n!==void 0&&t.lineStart<=n&&t.lineEnd<=n+1?this.getLineStartOffsetFromEnd(e.src,t.lineStart,n):this.getLineStartOffset(e.src,t.lineStart)}return t.srcOffset}getLineStartOffsetFromEnd(e,t,n){if(t<=0)return 0;let r=n-t+1,i=e.length;for(;r>0;){if(i=e.lastIndexOf(`
84
+ `,i-1),i<0)return 0;r--}return i+1}getLineStartOffset(e,t,n,r){return n!==void 0&&r!==void 0&&t>=r?this.getLineStartOffsetFrom(e,n,t-r):this.getLineStartOffsetFrom(e,0,t)}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let r=n,i=t;for(;i<e.length;){const o=e.charCodeAt(i);if(o===10)i++,r--;else if(this.normalizeLineEndings&&o===13)i++,i<e.length&&e.charCodeAt(i)===10&&i++,r--;else{i++;continue}if(r===0)return i}return e.length}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){var n;if(!this.tokenMapsTrusted||!(e.boundary?e.boundary.endsWithBlankLine:this.endsWithBlankLine(e.src)))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch((n=e.tokens[t.tokenStart])==null?void 0:n.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,r,i,o,l){if(!o||this.mayContainReferenceDefinition(o))return null;const s=t.tokens[i.tokenStart];switch(s==null?void 0:s.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,r,i,o,s,l);case"table_open":return this.tryTableTailAppendMerge(e,t,n,r,i,o,s,l);default:return null}}tryListTailAppendMerge(e,t,n,r,i,o,l,s){var C,b;if(t.src.length===0||!(t.boundary?t.boundary.endsWithNewline:t.src.charCodeAt(t.src.length-1)===10))return null;this.ensureSegmentSourceOffset(t,i);const a=i.lineEnd-i.lineStart,u=t.src.length-i.srcOffset;if(a<this.MIN_LIST_LINES_FOR_MERGE&&u<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=l.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close",p=t.lineCount??Qt(t.src);let d,f=!1;try{const S=this.parseAtLineOffset(o,n,r,p,s);d=S.state.tokens,f=S.mapsShifted}catch{return null}if(!this.isSingleTopLevelContainer(d,l.type,c,l.markup))return null;const g=d.slice(1,-1);if(g.length===0)return null;p>0&&!f&&this.shiftTokenLines(g,p);const m=this.getListParagraphMode(t.tokens,i.tokenStart,t.tokens.length,l.level),A=this.getListParagraphMode(d,0,d.length,0);(m==="loose"||A==="loose"||(t.boundary?t.boundary.endsWithBlankLine:this.endsWithBlankLine(t.src))||(((b=(C=d[0])==null?void 0:C.map)==null?void 0:b[0])??0)-(f?p:0)>0)&&(this.setListParagraphVisibility(t.tokens,i.tokenStart,t.tokens.length,l.level,!1),this.setListParagraphVisibility(g,0,g.length,l.level,!1)),t.tokens.splice(t.tokens.length-1,0,...g),t.boundary?this.updateBoundaryStateForAppend(t,o):this.updateFenceMarkerCacheForAppend(t,o),t.src=e,t.normalizedSrc=s,t.env=n,t.globalStateReason=null;const v=p+Qt(o);t.lineCount=v;const k=this.getCachedDocLineCount(t,v);return l.map&&(l.map[1]=k),t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:k,srcOffset:i.srcOffset},t.lastSegmentVerified=!0,t.tokens}tryTableTailAppendMerge(e,t,n,r,i,o,l,s){var T,M;if(t.src.length===0||!(t.boundary?t.boundary.endsWithNewline:t.src.charCodeAt(t.src.length-1)===10)||/(?:^|\n)[ \t]*\n/.test(o))return null;this.ensureSegmentSourceOffset(t,i);const a=i.lineEnd-i.lineStart,u=t.src.length-i.srcOffset;if(a<this.MIN_TABLE_LINES_FOR_MERGE&&u<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(i.srcOffset));if(!c)return null;const p=`${c}${o}`,d=i.lineEnd-2;let f,g=!1;try{const E=this.parseAtLineOffset(p,n,r,d,s);f=E.state.tokens,g=E.mapsShifted}catch{return null}if(!this.isSingleTopLevelContainer(f,"table_open","table_close")||(((M=(T=f[0])==null?void 0:T.map)==null?void 0:M[1])??-1)!==this.getDocLineCount(p))return null;const m=this.getTableBodySection(f,0,f.length,0),A=this.getTableBodySection(t.tokens,i.tokenStart,t.tokens.length,l.level);if(!m||!A||m.tbodyOpenIndex<0||m.tbodyCloseIndex<0)return null;const v=A.tbodyOpenIndex>=0?f.slice(m.tbodyOpenIndex+1,m.tbodyCloseIndex):f.slice(m.tbodyOpenIndex,m.tbodyCloseIndex+1);if(v.length===0)return null;d!==0&&!g&&this.shiftTokenLines(v,d);const k=A.tbodyCloseIndex>=0?A.tbodyCloseIndex:A.tableCloseIndex,C=t.lineCount??Qt(t.src);t.tokens.splice(k,0,...v),t.boundary?this.updateBoundaryStateForAppend(t,o):this.updateFenceMarkerCacheForAppend(t,o),t.src=e,t.normalizedSrc=s,t.env=n,t.globalStateReason=null;const b=C+Qt(o);t.lineCount=b;const S=this.getCachedDocLineCount(t,b);if(l.map&&(l.map[1]=S),A.tbodyOpenIndex>=0){const E=t.tokens[A.tbodyOpenIndex];E!=null&&E.map&&(E.map[1]=S)}return t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:S,srcOffset:i.srcOffset},t.lastSegmentVerified=!0,t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
85
+ `);if(t<0)return null;const n=e.indexOf(`
86
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,r){var s;if(t<0||t>=n||((s=e[t])==null?void 0:s.type)!=="table_open")return null;let i=-1;for(let a=n-1;a>t;a--){const u=e[a];if(u.type==="table_close"&&u.level===r){i=a;break}}if(i<0)return null;let o=-1,l=-1;for(let a=t+1;a<i;a++){const u=e[a];if(u.type==="tbody_open"&&u.level===r+1){o=a;break}}if(o>=0){for(let a=i-1;a>o;a--){const u=e[a];if(u.type==="tbody_close"&&u.level===r+1){l=a;break}}if(l<0)return null}return{tableCloseIndex:i,tbodyOpenIndex:o,tbodyCloseIndex:l}}isSingleTopLevelContainer(e,t,n,r){if(e.length<2)return!1;const i=e[0],o=e[e.length-1];if(i.type!==t||o.type!==n||i.level!==0||o.level!==0||r!==void 0&&i.markup!==r)return!1;let l=0;for(let s=0;s<e.length;s++){const a=e[s];if(a.level===0&&s>0&&s<e.length-1&&l===0)return!1;(a.nesting>0||a.nesting<0)&&(l+=a.nesting)}return l===0}getListParagraphMode(e,t,n,r){let i=!1,o=!1;const l=r+2;for(let s=t;s<n;s++){const a=e[s];if(!(a.type!=="paragraph_open"||a.level!==l)&&(a.hidden?i=!0:o=!0,i&&o))return"loose"}return o?"loose":i?"tight":"none"}setListParagraphVisibility(e,t,n,r,i){const o=r+2;for(let l=t;l<n;l++){const s=e[l];(s.type==="paragraph_open"||s.type==="paragraph_close")&&s.level===o&&(s.hidden=i)}}shouldPreferTailReparseForAppend(e,t){const n=this.ensureLastSegment(e);if(!n)return!1;const r=e.tokens[n.tokenStart];if(!this.tokenMapsTrusted)return t;switch(r==null?void 0:r.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!(e.boundary?e.boundary.endsWithBlankLine:this.endsWithBlankLine(e.src));default:return(r==null?void 0:r.nesting)===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 r=e.charCodeAt(n);if(r===32||r===9){n--;continue}return r===10}return!0}ensureBoundaryState(e){if(e.boundary)return e.boundary;const t=e.src,n=t.length,r=n>0&&t.charCodeAt(n-1)===10,i=r?n-1:n;let o=i-1;for(;o>=0&&t.charCodeAt(o)!==10;)o--;let l=!1;for(let s=o+1;s<i;s++){const a=t.charCodeAt(s);if(a!==32&&a!==9){l=!0;break}}return e.boundary={currentLineNonBlank:r?!1:l,previousLineNonBlank:r?l:!1,endsWithNewline:r,endsWithBlankLine:this.endsWithBlankLine(t)},e.boundary}updateBoundaryStateForAppend(e,t){const n=this.ensureBoundaryState(e);let r=n.currentLineNonBlank,i=n.previousLineNonBlank;for(let o=0;o<t.length;o++){const l=t.charCodeAt(o);l===10?(i=r,r=!1):l!==32&&l!==9&&(r=!0)}n.currentLineNonBlank=r,n.previousLineNonBlank=i,n.endsWithNewline=t.length>0?t.charCodeAt(t.length-1)===10:n.endsWithNewline,n.endsWithBlankLine=e.src.length+t.length>=2&&n.endsWithNewline&&!i}getDocLineCount(e,t=Qt(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}getCachedDocLineCount(e,t){return e.src.length===0?0:e.boundary?e.boundary.endsWithNewline?t:t+1:this.getDocLineCount(e.src,t)}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let r=0;r<e.length;r++){const i=e[r];if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children){n??(n=[]);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o]);for(;n.length>0;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let l=o.children.length-1;l>=0;l--)n.push(o.children[l])}}}}};const Gm={default:pS,zero:gS,commonmark:hS};function TS(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version,inlineState:e.inline.State}}function BS(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||e.inline.State!==t.inlineState}function Qm(e){return e.experimental?{...e,...e.experimental}:e}function pr(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 Um(e,t,n){for(let r=0;r<n.length;r++){const i=n[r];if(pr(t,i)||pr(e,i))return!0}return!1}function Ym(e,t,n){return pr(t,n)||pr(e,n)}function Zm(e,t){var r;const n=(r=ar(e))==null?void 0:r.chunk;if(n!=null&&n.fallback){ln(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}ln(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function Yo(){return typeof performance<"u"?performance.now():Date.now()}function FS(e,t){var E,$,X,K;let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamTailLocalPostBlockRules:!1,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},r="default",i;!t&&typeof e!="string"?(i=e,r="default"):typeof e=="string"&&(r=e,i=t);const o=Gm[r];if(!o)throw new Error(`Wrong \`markdown-it\` preset "${r}", check name`);if(o!=null&&o.options&&(n={...n,...o.options}),i&&(n={...n,...i}),n=Qm(n),typeof n.quotes=="string"){const I=n.quotes;I.length>=4?n.quotes=[I[0],I[1],I[2],I[3]]:n.quotes=["“","”","‘","’"]}let l=Um(o==null?void 0:o.options,i,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),s=Um(o==null?void 0:o.options,i,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Ym(o==null?void 0:o.options,i,"fullChunkedFallback"),u=Ym(o==null?void 0:o.options,i,"streamChunkedFallback"),c=!1,p=null,d=null;const f=new v_;let g=null;const m=()=>(g||(g=new CS(n)),g);let A=null;const v=()=>(A||(A=new MS(f)),A);let k=null;const C=()=>(k||(k=new S1({fuzzyLink:!0})),k),b=I=>!c&&!!p&&!BS(I,p),S=(I,B)=>r==="default"&&!c&&g===null&&d!==null&&I.parse===d&&b(I)&&!I.stream.enabled&&B<(I.options.autoUnboundedThresholdChars??4e6)&&I.options.html===!1&&I.options.xhtmlOut===!1&&I.options.breaks===!1&&I.options.langPrefix==="language-"&&I.options.linkify===!1&&I.options.typographer===!1&&I.options.highlight===null,T=(I,B)=>r==="default"&&!c&&b(I)&&!I.stream.enabled&&!I.options.fullChunkedFallback&&B<(I.options.autoUnboundedThresholdChars??4e6)&&I.options.html===!1&&I.options.linkify===!1&&I.options.typographer===!1,M={core:f,block:f.block,inline:f.inline,get linkify(){const I=C();return Object.defineProperty(this,"linkify",{value:I,writable:!0,configurable:!0}),I},get renderer(){const I=m();return Object.defineProperty(this,"renderer",{value:I,writable:!0,configurable:!0}),I},options:n,__explicitFullChunkConfig:l,__explicitStreamChunkConfig:s,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return b(this)},set(I){const B=Qm(I);return this.options={...this.options,...B},(pr(I,"fullChunkSizeChars")||pr(I,"fullChunkSizeLines")||pr(I,"fullChunkMaxChunks"))&&(l=!0,this.__explicitFullChunkConfig=!0),(pr(I,"streamChunkSizeChars")||pr(I,"streamChunkSizeLines")||pr(I,"streamChunkMaxChunks"))&&(s=!0,this.__explicitStreamChunkConfig=!0),pr(I,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),pr(I,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),g&&g.set(B),typeof B.stream=="boolean"&&(this.stream.enabled=B.stream,A&&(A.reset(),A.resetStats())),this},configure(I){var P,_,W,z;const B=typeof I=="string"?Gm[I]:I;if(!B)throw new Error("Wrong `markdown-it` preset, can't be empty");if(B.options&&this.set(B.options),B.components){const N=B.components;(P=N.core)!=null&&P.rules&&this.core.ruler.enableOnly(N.core.rules),(_=N.block)!=null&&_.rules&&this.block.ruler.enableOnly(N.block.rules),(W=N.inline)!=null&&W.rules&&this.inline.ruler.enableOnly(N.inline.rules),(z=N.inline2)!=null&&z.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(I,B){var z,N,R,oe;const P=Array.isArray(I)?I:[I],_=[(z=this.core)==null?void 0:z.ruler,(N=this.block)==null?void 0:N.ruler,(R=this.inline)==null?void 0:R.ruler,(oe=this.inline)==null?void 0:oe.ruler2],W=new Set;for(const ne of _){if(!ne)continue;const ee=ne.enable(P,!0);for(let ie=0;ie<ee.length;ie++)W.add(ee[ie])}if(!B){const ne=P.filter(ee=>!W.has(ee));if(ne.length)throw new Error(`Rules manager: invalid rule name ${ne.join(", ")}`)}return this},disable(I,B){var z,N,R,oe;const P=Array.isArray(I)?I:[I],_=[(z=this.core)==null?void 0:z.ruler,(N=this.block)==null?void 0:N.ruler,(R=this.inline)==null?void 0:R.ruler,(oe=this.inline)==null?void 0:oe.ruler2],W=new Set;for(const ne of _){if(!ne)continue;const ee=ne.disable(P,!0);for(let ie=0;ie<ee.length;ie++)W.add(ee[ie])}if(!B){const ne=P.filter(ee=>!W.has(ee));if(ne.length)throw new Error(`Rules manager: invalid rule name ${ne.join(", ")}`)}return this},use(I,...B){const P=typeof I=="function"?I:I&&typeof I.default=="function"?I.default:void 0;if(!P)throw new TypeError("MarkdownIt.use: plugin must be a function");const _=[this,...B],W=I;return c=!0,P.apply(W,_),this},render(I,B){let P;if(S(this,I.length)){B!==void 0&&(Dn(B),P=vf("render"));const z=P?Yo():0,N=P?Nm(I,P):Rm(I);if(P&&(P.attemptMs=Yo()-z,N===null&&(P.fallbackReason="unsupported-stock-subset"),Jl(B,P)),N!==null)return B!==void 0&&ln(B,{area:"render",path:"stock-fast",reason:"stock-subset"}),N}const _=B??{},W=this.parse(I,_);return P&&Jl(_,P),m().render(W,this.options,_)},async renderAsync(I,B){let P;if(S(this,I.length)){B!==void 0&&(Dn(B),P=vf("render"));const z=P?Yo():0,N=P?Nm(I,P):Rm(I);if(P&&(P.attemptMs=Yo()-z,N===null&&(P.fallbackReason="unsupported-stock-subset"),Jl(B,P)),N!==null)return B!==void 0&&ln(B,{area:"render",path:"stock-fast",reason:"stock-subset"}),N}const _=B??{},W=this.parse(I,_);return P&&Jl(_,P),m().renderAsync(W,this.options,_)},renderIterable(I,B={}){const P=this.parseIterable(I,B);return m().render(P,this.options,B)},async renderAsyncIterable(I,B={}){const P=await this.parseAsyncIterable(I,B);return m().renderAsync(P,this.options,B)},renderInline(I,B={}){const P=this.parseInline(I,B);return m().render(P,this.options,B)},validateLink:av,normalizeLink:uv,normalizeLinkText:cv,utils:Jx,helpers:{...$w},parse(I,B){if(typeof I!="string")throw new TypeError("Input data should be a String");if(B!==void 0&&Dn(B),T(this,I.length)){const z=B===void 0?void 0:vf("parse"),N=z?Yo():0,R=T_(I,z);if(z&&(z.attemptMs=Yo()-N,R===null&&(z.fallbackReason="unsupported-stock-subset"),Jl(B,z)),R!==null)return B!==void 0&&ln(B,{area:"parse",path:"stock-fast",reason:"stock-subset"}),R}const P=B??{};let _;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const z=wv(this,I.length);if(z==="yes"){const N=fs(this,I,P);return ln(B,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),N}z==="need-lines"&&(_=Qt(I))}if(!this.stream.enabled){const z=I.length,N=this.options.autoTuneChunks!==!1,R=l,oe=!a&&b(this),ne=!!this.options.fullChunkedFallback,ee=oe&&z>=2e5;let ie;(ne||ee||_!==void 0)&&(ie=_??Qt(I));const G=(ne||ee)&&N&&!R?dS(z,ie,this.options):null;if(ne||ee){const Q=ie??0;if(ne?z>=(this.options.fullChunkThresholdChars??2e4)||Q>=(this.options.fullChunkThresholdLines??400):ee){if(G&&G.strategy!=="plain"){const te=bu(this,I,P,{maxChunkChars:G.maxChunkChars,maxChunkLines:G.maxChunkLines,fenceAware:G.fenceAware,maxChunks:G.maxChunks});return B&&Zm(B,ne?"explicit-full-chunk":"default-large-string"),te}if(ne){const te=(Ke,St,Pe)=>Ke<St?St:Ke>Pe?Pe:Ke,re=this.options.fullChunkAdaptive!==!1,pe=this.options.fullChunkTargetChunks??8,ce=te(Math.ceil(z/pe),8e3,64e3),Ce=te(Math.ceil(Q/pe),150,700),ze=re?ce:this.options.fullChunkSizeChars??1e4,Ne=re?Ce:this.options.fullChunkSizeLines??200,Ze=re?te(Math.ceil(z/64e3),pe,32):this.options.fullChunkMaxChunks,st=bu(this,I,P,{maxChunkChars:ze,maxChunkLines:Ne,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ze});return B&&Zm(B,"explicit-full-chunk"),st}}}if(_!==void 0&&b(this)&&xv(this,z,ie??_)){const Q=fs(this,I,P);return ln(B,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Q}}const W=_i(I);return ln(B,{area:"parse",path:"plain",reason:"default-plain"}),il(P,W,()=>f.parse(I,P,this).tokens)},parseIterable(I,B={}){return Dn(B),aS(this,I,B)},parseAsyncIterable(I,B={}){return Dn(B),uS(this,I,B)},parseIterableToSink(I,B,P={}){return Dn(P),cS(this,I,B,P)},parseAsyncIterableToSink(I,B,P={}){return Dn(P),fS(this,I,B,P)},parseInline(I,B={}){if(typeof I!="string")throw new TypeError("Input data should be a String");Dn(B),Ys(B)&&Xr(B);const P=f.createState(I,B,this);return P.inlineMode=!0,f.process(P),P.tokens}};if(M.stream={enabled:!!n.stream,parse(I,B){return M.stream.enabled?v().parse(I,B,M):M.parse(I,B??{})},append(I,B){if(!M.stream.enabled)throw new Error("Stream append requires stream mode");return v().append(I,B,M)},snapshot(){return A?A.snapshot():null},restore(I){if(!M.stream.enabled)throw new Error("Stream restore requires stream mode");return v().restore(I,M)},reset(){v().reset()},hasCache(){return(A==null?void 0:A.hasCache())??!1},peek(){return A?A.peek():[]},stats(){return A?A.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){A&&A.resetStats()}},o!=null&&o.components){const I=o.components;(E=I.core)!=null&&E.rules&&M.core.ruler.enableOnly(I.core.rules),($=I.block)!=null&&$.rules&&M.block.ruler.enableOnly(I.block.rules),(X=I.inline)!=null&&X.rules&&M.inline.ruler.enableOnly(I.inline.rules),(K=I.inline2)!=null&&K.rules&&M.inline.ruler2.enableOnly(I.inline2.rules)}return p=TS(M),d=M.parse,M}var DS=FS;let RS;function NS(){return RS}const Bh=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Mv=["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"],Fh=["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"],Tv=["svg","g","path"],Bv=["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"],Fv=["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"],Dv=["action","data","href","src","srcset","poster","xlink:href","formaction"],Rv=["script"],Nv=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],qr=new Set(Bh),Dh=new Set(Fh),pl=new Set([...Bh,...Mv,...Fh,...Tv]),Rh=new Set([...pl,...Bv]),Lv=new Set(Fv),Ov=new Set(Dv),vl=new Set(Rv),Nh=new Set(Nv);function Lh(e){let t="";for(const n of e){const r=n.charCodeAt(0);r<=31||r>=127&&r<=159||/\s/u.test(n)||(t+=n)}return t}const LS={amp:"&",bsol:"\\",colon:":",newline:`
87
+ `,sol:"/",tab:" "};function Pv(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,r,i)=>{const o=n??r;if(o){const l=Number.parseInt(o,n?10:16);try{return Number.isFinite(l)?String.fromCodePoint(l):""}catch{return""}}return LS[String(i??"").toLowerCase()]??t})}const Wa=new Set(["http","https","mailto","tel"]),OS=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),oo=new Set(["http","https"]);function $v(e){var t,n;return((n=(t=e.match(/^([a-z][a-z0-9+.-]*):/i))==null?void 0:t[1])==null?void 0:n.toLowerCase())??""}const PS=/^https?:\/\//i;function $S(e){if(!PS.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 HS(e,t,n){if(!ps(t,n)||!e.startsWith("file:///"))return!1;const r=e.charAt(8);return r!=="/"&&r!=="\\"}function ps(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function WS(e,t){return t==="href"||t==="xlink:href"?ps(e,t)?Wa:oo:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?oo:(ps(e,t),Wa)}function Ei(e,t={}){if($S(e))return!1;const n=Lh(Pv(e)).toLowerCase(),r=String(t.tagName??"").toLowerCase(),i=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const l=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return r==="img"&&i==="src"?!l:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const o=$v(n);return o?o==="file"?!HS(n,r,i):ps(r,i)?OS.has(o):!WS(r,i).has(o):!1}function Hv(e){const t=Pv(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=$v(Lh(t).toLowerCase());return n==="http"||n==="https"}function KS(e,t={}){const n=String(e??"").trim();return n?Ei(n,t)?"":n:""}function _d(e){return KS(e,{tagName:"img",attrName:"src"})}function jS(e,t,n){function r(d){return d.trim().split(" ",2)[0]===t}function i(d,f,g,m,A){return d[f].nesting===1&&d[f].attrJoin("class",t),A.renderToken(d,f,g,m,A)}n=n||{};const o=3,l=n.marker||":",s=l.charCodeAt(0),a=l.length,u=n.validate||r,c=n.render||i;function p(d,f,g,m){let A,v=!1,k=d.bMarks[f]+d.tShift[f],C=d.eMarks[f];if(s!==d.src.charCodeAt(k))return!1;for(A=k+1;A<=C&&l[(A-k)%a]===d.src[A];A++);const b=Math.floor((A-k)/a);if(b<o)return!1;A-=(A-k)%a;const S=d.src.slice(k,A),T=d.src.slice(A,C);if(!u(T,S))return!1;if(m)return!0;let M=f;for(;M++,!(M>=g||(k=d.bMarks[M]+d.tShift[M],C=d.eMarks[M],k<C&&d.sCount[M]<d.blkIndent));)if(s===d.src.charCodeAt(k)&&!(d.sCount[M]-d.blkIndent>=4)){for(A=k+1;A<=C&&l[(A-k)%a]===d.src[A];A++);if(!(Math.floor((A-k)/a)<b)&&(A-=(A-k)%a,A=d.skipSpaces(A),!(A<C))){v=!0;break}}const E=d.parentType,$=d.lineMax;d.parentType="container",d.lineMax=M;const X=d.push("container_"+t+"_open","div",1);X.markup=S,X.block=!0,X.info=T,X.map=[f,M],d.md.block.tokenize(d,f+1,M);const K=d.push("container_"+t+"_close","div",-1);return K.markup=d.src.slice(k,A),K.block=!0,d.parentType=E,d.lineMax=$,d.line=M+(v?1:0),!0}e.block.ruler.before("fence","container_"+t,p,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=c,e.renderer.rules["container_"+t+"_close"]=c}function zS(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 r=[];let i="",o=!1,l=!1;for(let a=0;a<n.length;a++){const u=n[a];if(u==="\\"){i+=u,a+1<n.length&&(i+=n[a+1],a++);continue}if(!l&&u==="'"){o=!o,i+=u;continue}if(!o&&u==='"'){l=!l,i+=u;continue}if(!o&&!l&&u===","){r.push(i.trim()),i="";continue}i+=u}i.trim()&&r.push(i.trim());const s={};for(const a of r){if(!a)continue;let u=!1,c=!1,p=-1;for(let A=0;A<a.length;A++){const v=a[A];if(v==="\\"){A++;continue}if(!c&&v==="'"){u=!u;continue}if(!u&&v==='"'){c=!c;continue}if(!u&&!c&&v===":"){p=A;break}}if(p===-1)return null;const d=a.slice(0,p).trim(),f=a.slice(p+1).trim();if(!d)return null;let g=d;if(g.startsWith('"')&&g.endsWith('"')||g.startsWith("'")&&g.endsWith("'"))try{g=JSON.parse(g.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(g))return null;let m;if(!f)m="";else if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{m=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=f}else/^-?\d+(?:\.\d+)?$/.test(f)?m=Number(f):f==="true"||f==="false"?m=f==="true":f==="null"?m=null:m=f;s[g]=m}return s}function Wv(e,t,n){for(const r of e){const i=r,o=i.map;if(Array.isArray(o)&&o.length>=2){const l=Number(o[0]),s=Number(o[1]);Number.isFinite(l)&&Number.isFinite(s)&&(i.map=[l+t,Math.min(s+t,n)])}Array.isArray(i.children)&&Wv(i.children,t,n)}}function Kv(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(jS,t,{render(n,r){return n[r].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
88
+ `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,r,i)=>{const o=t,l=o.bMarks[n]+o.tShift[n],s=o.eMarks[n],a=o.src.slice(l,s),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const p=a.slice(u[0].length).trim();let d,f;const g=p.indexOf("{"),m=g>=0?p.slice(g).trimStart():void 0;if(g===-1)d=p||void 0;else{if(d=p.slice(0,g).trim()||void 0,m!=null&&m.startsWith("{")){let T=0,M=-1;for(let E=0;E<m.length;E++)if(m[E]==="{"?T++:m[E]==="}"&&T--,T===0){M=E+1;break}M>0&&(f=m.slice(0,M))}f||(d=p||void 0)}if(i)return!0;const A=!!o.env.__markstreamFinal;let v=n+1,k=!1;for(;v<=r;){const T=o.bMarks[v]+o.tShift[v],M=o.eMarks[v];if(o.src.slice(T,M).trim()===":::"){k=!0;break}v++}k||(v=r);const C=o.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,k?v:r],C.meta={...C.meta??{},unclosed:!k&&!A},d&&C.attrSet("data-args",d),f)try{const T=JSON.parse(f);for(const[M,E]of Object.entries(T)){const $=E!=null&&typeof E=="object";C.attrSet(`data-${M}`,$?JSON.stringify(E):String(E))}}catch{const T=zS(f);if(T)for(const[M,E]of Object.entries(T)){const $=E!=null&&typeof E=="object";C.attrSet(`data-${M}`,$?JSON.stringify(E):String(E))}else C.attrSet("data-attrs",f)}const b=[];for(let T=n+1;T<v;T++){const M=o.bMarks[T]+o.tShift[T],E=o.eMarks[T];b.push(o.src.slice(M,E))}if(b.some(T=>T.trim().length>0)){let T=b.join(`
89
+ `);T.endsWith(`
90
+ `)||(T+=`
91
+ `),T.endsWith(`
92
+
93
+ `)||(T+=`
94
+ `);const M=o.tokens[o.tokens.length-1];M&&(M.raw=T);const E=[];o.md.block.parse(T,o.md,o.env,E),Wv(E,n+1,n+1+b.length),o.tokens.push(...E)}const S=o.push("vmr_container_close","div",-1);return k||(S.hidden=!0,S.map=[r,r]),o.line=k?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,t=0){let n=!1,r=!1;for(let i=t;i<e.length;i++){const o=e[i];if(o==="\\"){i++;continue}if(!r&&o==="'"){n=!n;continue}if(!n&&o==='"'){r=!r;continue}if(!n&&!r&&o===">")return i}return-1}function Xu(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let r;for(;(r=n.exec(e))!==null;){const i=r[1];if(!i)continue;const o=r[2]||r[3]||r[4]||"";t.push([i,o])}return t}const GS=/^[a-z][a-z0-9_-]*$/;function Sd(e){return GS.test(String(e??"").trim().toLowerCase())}function cr(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Sd(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 r=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const i=t.slice(r,n).toLowerCase(),o=t[n]??"";return o&&!/[\s/>]/.test(o)?"":Sd(i)?i:""}function Pi(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const r of e){const i=cr(r);!i||t.has(i)||(t.add(i),n.push(i))}return n}function jv(...e){const t=new Set,n=[];for(const r of e)for(const i of Pi(r))t.has(i)||(t.add(i),n.push(i));return n}function zv(e){const t=Pi(e);return{key:t.join(","),tags:t}}function Oh(e){return cr(e)}function Gv(e,t){const n=String(e??""),r=cr(t);if(!r)return!1;const i=Rr(r),o=n.match(new RegExp(String.raw`^\s*<\s*${i}(?:\s[^>]*)?(\s*\/)?>`,"i"));return o?o[1]?!0:new RegExp(String.raw`<\s*\/\s*${i}\s*>`,"i").test(n):!1}function Ph(e,t){const n=cr(t);return!!n&&!pl.has(n)&&!Gv(e,n)}function Qv(e,t){const n=String(e??""),r=cr(t);if(!r)return n;const i=Rr(r),o=new RegExp(String.raw`^\s*<\s*${i}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${i}\s*>\s*$`,"i");return n.replace(o,"").replace(l,"")}const Uv=qr,QS=pl,Yv=new Set(Dh);Yv.delete("details");const US=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,YS=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Id=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,ZS=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function wu(e){var t;return(((t=e.match(Id))==null?void 0:t[1])??"").toLowerCase()}function $h(e){return/^\s*<\s*\//.test(e)}function Hh(e,t){return Uv.has(t)||/\/\s*>\s*$/.test(e)}function VS(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r];if(!i||i.type!=="html_inline")continue;const o=String(i.content??""),l=wu(o);if(l===t){if($h(o)){if(n===0)return r;n--;continue}Hh(o,l)||n++}}return-1}function JS(e,t){let n=0;for(const r of e){if(!r||r.type!=="html_inline")continue;const i=String(r.content??""),o=wu(i);if(o===t){if($h(i)){n>0&&n--;continue}Hh(i,o)||n++}}return n}function Vm(e,t,n=0){const r=new RegExp(String.raw`<\s*(\/?)\s*${Rr(t)}(?=[\s>/])[^>]*>`,"gi");r.lastIndex=Math.max(0,n);let i=0,o;for(;(o=r.exec(e))!==null;){const l=o[0]??"",s=!!o[1],a=!s&&/\/\s*>$/.test(l);if(s){if(i===0)return{start:o.index,end:o.index+l.length};i--;continue}a||i++}return null}function XS(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Rr(t)}(?=[\s>/])[^>]*>`,"gi");let r=0,i;for(;(i=n.exec(e))!==null;){const o=i[0]??"",l=!!i[1],s=!l&&/\/\s*>$/.test(o);if(l){r>0&&r--;continue}s||r++}return r}function _u(e){const t=e;return String(t.raw??t.content??t.markup??"")}function qS(e){const t=e;return t.meta||(t.meta={}),t.meta}function Tf(e,t,n){const r=qS(e);r.markstreamCustomHtmlRaw=t,r.markstreamCustomHtmlInner=n}function eI(e,t){if(!t.size)return;const n=Array.from(t,f=>new RegExp(String.raw`<\s*${Rr(f)}(?=[\s>/])`,"i")),r=[];let i=!1;const o=f=>f?n.some(g=>g.test(f)):!1,l=f=>{if(!(!f||!r.length))for(const g of r)g.raw+=f,g.inner+=f},s=()=>{!r.length||!i||(l(`
95
+ `),i=!1)},a=f=>{l(f)},u=f=>{for(let m=0;m<r.length;m++)r[m].raw+=f,m<r.length-1&&(r[m].inner+=f);const g=r.pop();Tf(g.token,g.raw,g.inner)},c=f=>{var A,v;const g=(A=r[r.length-1])==null?void 0:A.tag;if(!g)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Rr(g)}\s*>`,"i");return((v=f.match(m))==null?void 0:v[0])??null},p=f=>!!c(f),d=(f,g,m)=>{const A=m??(f.type==="html_inline"?wu(g):"");if(!(A&&t.has(A))){l(g);return}const v=$h(g),k=!v&&Hh(g,A);if(v){if(!r.length||r[r.length-1].tag!==A){l(g);return}u(g);return}if(l(g),k){Tf(f,g,"");return}r.push({tag:A,token:f,raw:g,inner:""})};for(const f of e){if(f.type==="inline"&&Array.isArray(f.children)){const g=String(f.content??"");if(p(g)?i=!1:s(),!r.length&&!o(g)){i=!1;continue}let m=0,A=!0;for(const v of f.children){const k=_u(v),C=v.type==="html_inline"?wu(k):"",b=C&&t.has(C);let S=k;if(A&&g&&k&&(r.length||b)){const T=g.indexOf(k,m);if(T!==-1)a(g.slice(m,T)),S=g.slice(T,T+k.length),m=T+k.length;else{if(r.length&&!b)continue;A=!1}}d(v,S,C)}A&&g&&m<g.length&&r.length&&a(g.slice(m)),i=r.length>0;continue}if(r.length&&typeof f.content=="string"){const g=_u(f),m=f.type==="html_block"?c(g):null;if(m){u(`${i?`
96
+ `:""}${m}`),i=r.length>0;continue}if(!f.content)continue;s(),l(f.content),i=!0}}for(const f of r)Tf(f.token,f.raw,f.inner)}function tI(e){return/^\s*<\s*[!?]/.test(e)}function nI(e){const t=new Set(QS);if(e&&Array.isArray(e))for(const n of e){const r=String(n??"").trim();if(!r)continue;const i=r.match(/^[<\s/]*([A-Z][\w-]*)/i);i&&t.add(i[1].toLowerCase())}return t}function Jm(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function rI(e,t){let n=null;for(const o of e.matchAll(US)){const l=o.index??-1;if(l<0)continue;const s=(o[1]??"").toLowerCase();Jm(s,t)&&Xt(e.slice(l))===-1&&(!n||l<n.index)&&(n={index:l,tag:s,closing:!1})}for(const o of e.matchAll(YS)){const l=o.index??-1;if(l<0)continue;const s=(o[1]??"").toLowerCase();Jm(s,t)&&Xt(e.slice(l))===-1&&(!n||l<n.index)&&(n={index:l,tag:s,closing:!0})}const r=/<\/\s*$/.exec(e);if(r&&typeof r.index=="number"){const o=r.index;!e.slice(o).includes(">")&&(!n||o<n.index)&&(n={index:o,tag:"",closing:!0})}const i=/<\s*$/.exec(e);if(i&&typeof i.index=="number"){const o=i.index,l=e.slice(o);!l.startsWith("</")&&!l.includes(">")&&(!n||o<n.index)&&(n={index:o,tag:"",closing:!1})}return n}function iI(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function oI(e,t){var a;if(!e.length)return{children:e};const n=[];let r=null,i=null;function o(u,c){u&&(c?n.push(iI(c,u)):n.push({type:"text",content:u,raw:u}))}function l(u,c){let p=0;for(;p<u.length;){const d=u.indexOf("<",p);if(d===-1){o(u.slice(p),c);break}o(u.slice(p,d),c);const f=u.slice(d),g=f.match(Id);if(!g){o("<",c),p=d+1;continue}const m=Xt(f);if(m===-1){o("<",c),p=d+1;continue}const A=f.slice(0,m+1),v=(g[1]??"").toLowerCase();t.has(v)?n.push({type:"html_inline",tag:"",content:A,raw:A}):o(A,c),p=d+A.length}}function s(u,c){if(!u)return;const p=rI(u,t);if(!p){l(u,c);return}const d=u.slice(0,p.index);d&&l(d,c),r={tag:p.tag,buffer:u.slice(p.index),closing:p.closing},i=r.buffer}for(const u of e){if(r){r.buffer+=_u(u),i=r.buffer;const c=Xt(r.buffer);if(c===-1)continue;const p=r.buffer.slice(0,c+1),d=r.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:p,raw:p}),r=null,i=null,d&&s(d);continue}if(u.type==="html_inline"){const c=_u(u),p=(((a=c.match(Id))==null?void 0:a[1])??"").toLowerCase();if(p&&t.has(p)&&Xt(c)===-1){r={tag:p,buffer:c,closing:/^<\s*\//.test(c)},i=r.buffer;continue}}if(u.type==="text"){const c=String(u.content??"");if(!c.includes("<")){n.push(u);continue}s(c,u);continue}n.push(u)}return{children:n,pendingBuffer:i??void 0}}const lI=["a","span","strong","em","b","i","u"];function sI(e,t={}){var d;const n=new Set;if((d=t.customHtmlTags)!=null&&d.length)for(const f of t.customHtmlTags){const g=cr(f);g&&n.add(g)}const r=f=>{var b;const g=f,m=new Set(n),A=Array.isArray((b=g.env)==null?void 0:b.__markstreamCustomHtmlTags)?g.env.__markstreamCustomHtmlTags:[];for(const S of A){const T=cr(String(S??""));T&&m.add(T)}const v=nI(Array.from(m)),k=new Set(lI);for(const S of m)k.add(S);return{autoCloseInlineTagSet:k,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:S=>m.has(S)||!v.has(S)||Yv.has(S)}},i=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const g=f.children[0];return(g==null?void 0:g.type)!=="html_block"?"":String(f.content??g.content??"")},o=(f,g)=>{f.type="html_block",f.content=g,f.raw=g,f.children=[]},l=f=>f.replace(/^(?:\r?\n)+/,""),s=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,g)=>{const m=l(f);if(!/\S/.test(m))return[];if(s(m))return[{type:"code_block",content:a(m),raw:m}];const A=m.replace(/^[\t ]+/,"");if(!A)return[];if(A.startsWith("<"))return[{type:"html_block",content:A}];const v={type:"inline",tag:"",nesting:0,content:A,children:[{type:"text",content:A,raw:A}]};return g==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:g==="text"?[{type:"text",content:A,raw:A}]:[v]},c=(f,g,m)=>{var A,v;return((A=f[g-1])==null?void 0:A.type)==="paragraph_open"&&((v=f[g+1])==null?void 0:v.type)==="paragraph_close"?"inline":m},p=(f,g)=>{const m=l(g);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const g=f.tokens??[],{commonHtmlTags:m,customTagSet:A}=r(f);for(const v of g){const k=v;if(k.type!=="inline"||!Array.isArray(k.children))continue;const C=String(k.content??""),b=k.children.length?k.children:C.includes("<")?[{type:"text",content:C,raw:C}]:null;if(b)try{const S=oI(b,m);if(k.children=S.children,S.pendingBuffer){const T=C.lastIndexOf(S.pendingBuffer);if(T!==-1){const M=C.slice(0,T);k.content=M,typeof k.raw=="string"&&(k.raw=M)}}}catch(S){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",S)}}eI(g,A)}),e.core.ruler.push("fix_html_inline_tokens",f=>{var C,b,S,T,M,E,$,X,K,I,B,P,_,W,z;const g=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:A,shouldMergeHtmlBlockTag:v}=r(f),k=[];for(let N=0;N<g.length;N++){const R=g[N];if(k.length>0){const[ne,ee]=k[k.length-1];if(N!==ee){if(R.type==="paragraph_open"||R.type==="paragraph_close"){g.splice(N,1),N--;continue}const ie=String(R.content??R.raw??"");if(ie){const G=g[ee],Q=`${String(G.content||"")}
97
+ ${ie}`,te=Xt(Q),re=te===-1?null:Vm(Q,ne,te+1);if(re){const pe=Q.slice(0,re.end),ce=Q.slice(re.end);G.content=pe,G.loading=!1,g.splice(N,1),k.pop();const Ce=p(G,ce)?[]:u(ce,c(g,N,"paragraph"));Ce.length&&g.splice(N,0,...Ce),N--;continue}G.content=Q,G.loading!==!1&&(G.loading=!0)}g.splice(N,1),N--;continue}}const oe=i(R);if(oe){if(tI(oe))continue;const ne=(((C=oe.match(/<\s*(?:\/\s*)?([^\s>/]+)/))==null?void 0:C[1])??"").toLowerCase(),ee=/^\s*<\s*\//.test(oe);if(!ne||!v(ne))continue;if(o(R,oe),!ee)ne&&!new RegExp(`^\\s*<\\s*${ne}\\b[^>]*\\/\\s*>`,"i").test(oe)&&XS(oe,ne)>0&&k.push([ne,N]);else if(k.length>0&&ne&&k[k.length-1][0]===ne){const[,ie]=k[k.length-1],G=g[ie];G.content=`${String(G.content||"")}
98
+ ${oe}`,G.loading=!1,k.pop(),g.splice(N,1),N--}continue}else if(k.length>0){if(R.type==="paragraph_open"||R.type==="paragraph_close"){g.splice(N,1),N--;continue}const ne=R.content||"",ee=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(ne);if(ne){const[,ie]=k[k.length-1],G=g[ie];G.content=`${G.content||""}
99
+ ${ne}`,G.loading!==!1&&(G.loading=!ee)}ee&&k.pop(),g.splice(N,1),N--}else continue}if(A.size>0){const N=new Map,R=new Map,oe=ie=>{let G=N.get(ie);return G||(G=new RegExp(`<\\s*${ie}\\b`,"i"),N.set(ie,G)),G},ne=ie=>{let G=R.get(ie);return G||(G=new RegExp(`<\\s*\\/\\s*${ie}\\s*>`,"i"),R.set(ie,G)),G},ee=[];for(let ie=0;ie<g.length;ie++){const G=g[ie],Q=String(G.content??"");if(ee.length>0){const re=ee[ee.length-1],pe=g[re.index],ce=G.type==="html_block"?ne(re.tag).exec(Q):null;if(ce){const Ne=ce.index+ce[0].length,Ze=Q.slice(0,Ne),st=Q.slice(Ne);pe.content=`${String(pe.content??"")}
100
+ ${Ze}`,Array.isArray(pe.children)&&pe.children.push({type:"html_inline",content:`</${re.tag}>`,raw:`</${re.tag}>`}),ee.pop();const Ke=p(pe,st)?[]:u(st,c(g,ie,"paragraph"));Ke.length?g.splice(ie,1,...Ke):(g.splice(ie,1),ie--);continue}if(G.type!=="inline")continue;const Ce=Array.isArray(G.children)?G.children:[],ze=VS(Ce,re.tag);if(ze!==-1){const Ne=Ce.slice(0,ze+1),Ze=Ce.slice(ze+1),st=Ne.map(Ke=>String((Ke==null?void 0:Ke.content)??(Ke==null?void 0:Ke.raw)??"")).join("");if(pe.content=`${String(pe.content??"")}
101
+ ${st}`,Array.isArray(pe.children)&&pe.children.push(...Ne),Ze.length){const Ke=Ze.map(St=>String(St.content??St.raw??"")).join("");if(Ke.trim()){const St=Ke.replace(/^\s+/,"");if(p(pe,Ke))g.splice(ie,1),ie--;else if(St.startsWith("<"))g.splice(ie,1,{type:"html_block",content:St});else{const Pe=u(Ke,c(g,ie,"paragraph"));g.splice(ie,1,...Pe)}}else g.splice(ie,1),ie--}else g.splice(ie,1),ie--;ee.pop();continue}pe.content=`${String(pe.content??"")}
102
+ ${Q}`,Array.isArray(pe.children)&&pe.children.push(...Ce),g.splice(ie,1),ie--;continue}if(G.type!=="inline")continue;const te=Array.isArray(G.children)?G.children:[];for(const re of A)if((te.length?JS(te,re):oe(re).test(Q)&&!ne(re).test(Q)?1:0)>0){ee.push({tag:re,index:ie});break}}}{let N=0;for(let R=0;R<g.length;R++){const oe=g[R];if(oe.type==="paragraph_open"){N++;continue}oe.type==="paragraph_close"&&(N>0?N--:(g.splice(R,1),R--))}}for(let N=0;N<g.length;N++){const R=g[N];if(R.type==="html_block"){const G=(((S=(b=R.content)==null?void 0:b.match(/<([^\s>/]+)/))==null?void 0:S[1])??"").toLowerCase();if(G.startsWith("!")||G.startsWith("?")){R.loading=!1;continue}if(A.has(G)){const ze=String(R.content??""),Ne=Xt(ze),Ze=Ne===-1?null:Vm(ze,G,Ne+1);R.loading=Ze?!1:R.loading!==void 0?R.loading:!0;const st=(Ze==null?void 0:Ze.start)??-1,Ke=Ze?Ze.end-Ze.start:0;if(st!==-1){const St=ze.slice(0,st+Ke);let Pe="";Ne!==-1&&Ne<st&&(Pe=ze.slice(Ne+1,st)),R.children=[{type:G,content:Pe,raw:St,attrs:[],tag:G,loading:!1}],R.content=St,R.raw=St;const Ft=u(ze.slice(st+Ke)||"","text");Ft.length&&g.splice(N+1,0,...Ft)}else R.children=[{type:G,content:"",raw:ze,attrs:[],tag:G,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(G))continue;R.type="inline";const Q=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let te;for(;(te=Q.exec(R.content||""))!==null;)te[1],te[2]||te[3]||te[4];const re=String(R.content??""),pe=new RegExp(`<\\/\\s*${G}\\s*>`,"i").exec(re),ce=pe?pe.index:-1,Ce=pe?pe[0].length:0;if(ce!==-1){const ze=re.slice(0,ce+Ce),Ne=(re.slice(ce+Ce)||"").replace(/^\s+/,"");R.children=[{type:"html_block",content:ze,tag:G,loading:!1}],R.content=ze,R.raw=ze,Ne&&g.splice(N+1,0,Ne.startsWith("<")?{type:"html_block",content:Ne}:{type:"text",content:Ne,raw:Ne})}else R.children=[{type:"html_block",content:R.content,tag:G,loading:!0}];continue}if(!R||R.type!=="inline")continue;if(R.children.length===2&&R.children[0].type==="html_inline"){const G=(((M=(T=R.children[0].content)==null?void 0:T.match(/<([^\s>/]+)/))==null?void 0:M[1])??"").toLowerCase(),Q=R.children[1],te=(($=(E=String((Q==null?void 0:Q.content)??"").match(/^<\s*\/\s*([^\s>]+)/))==null?void 0:E[1])==null?void 0:$.toLowerCase())??"";if((Q==null?void 0:Q.type)==="html_inline"&&te===G)continue;m.has(G)?(R.children[0].loading=!0,R.children[0].tag=G,R.children.push({type:"html_inline",tag:G,loading:!0,content:`</${G}>`})):R.children=[{type:"html_block",loading:!0,tag:G,content:String(((X=R.children[0])==null?void 0:X.content)??"")+String(((K=R.children[1])==null?void 0:K.content)??"")}];continue}else if(R.children.length===3&&R.children[0].type==="html_inline"&&R.children[2].type==="html_inline"){const G=(((B=(I=R.children[0].content)==null?void 0:I.match(/<([^\s>/]+)/))==null?void 0:B[1])??"").toLowerCase();if(m.has(G))continue;R.children=[{type:"html_block",loading:!1,tag:G,content:R.children.map(Q=>Q.content).join("")}];continue}if(!((P=R.content)!=null&&P.startsWith("<"))||((_=R.children)==null?void 0:_.length)!==1)continue;const oe=String(R.content),ne=R,ee=ne.children[0];if((ee==null?void 0:ee.type)!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(oe)&&(ne.children.length=0);continue}const ie=((z=(W=String(ee.content??oe).match(ZS))==null?void 0:W[1])==null?void 0:z.toLowerCase())??"";if(ie){if(/\/\s*>\s*$/.test(oe)||Uv.has(ie)){ne.children=[{type:"html_inline",content:oe}];continue}ne.children.length=0}}})}function aI(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 uI(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const r=n.tokens??[];for(let i=0;i<r.length;i++){const o=r[i];if(o.type!=="code_block")continue;const l=String(o.content??"").trim();if(!l)continue;const s=l.split(/\r?\n/).filter(a=>a.trim().length>0);if(s.length===1&&!aI(s[0]??"")){const a=s[0]??"",u=o.level??0;r.splice(i,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),i+=2}}})}const Zv=Symbol("markstream.parse-context");function qu(e){return!!(e&&e[Zv]===!0)}function Wh(e={},t={}){return{...e,[Zv]:!0,customHtmlBlockCursor:0,disableStreamParse:!1,disableStructuredReuse:!1,insideStrong:!1,isFragment:!1,...t}}function Js(e){return qu(e)?e:Wh(e)}function cI(e,t=e,n={}){return Wh(t,{runtime:e.runtime,markdownIt:e.markdownIt,...n})}const Vv=/\.([a-z0-9]{1,15})$/i,fI=/[_()[\]{}<>]/u,dI=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,hI=/[?#@]/u,pI=/[\\/]/u,gI=/^[\p{L}\p{N}./\\-]+$/u,mI=/^[A-Za-z0-9-]{1,63}$/u,AI=/^xn--[a-z0-9-]{2,59}$/i,vI=/^(?:[A-Z]{1,6}|\d{1,8})$/u,kI=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,yI=/文件名\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,CI=/文件名\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,bI=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Jv=2e3,xI=16384,wI=512*Jv,_I={},SI=new Set(["ai","md","py","rs","sh","zip"]),Xv=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),II=new Set([...Xv,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),EI=new Set(["com","dev","io","page","site"]),MI=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),TI=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"]),Xo=new Map;let Bf=0;function Xm(e,t){if(!e||e.length>xI)return t;for(Xo.has(e)||(Bf+=e.length),Xo.set(e,t);Xo.size>Jv||Bf>wI;){const n=Xo.keys().next().value;if(!n)break;Xo.delete(n),Bf-=n.length}return t}function Os(e){return(e==null?void 0:e.filename)===!0||(e==null?void 0:e.explicitFilename)===!0||(e==null?void 0:e.marketTicker)===!0}function Ff(e,t){const n={filename:(e==null?void 0:e.filename)||(t==null?void 0:t.filename),explicitFilename:(e==null?void 0:e.explicitFilename)||(t==null?void 0:t.explicitFilename),marketTicker:(e==null?void 0:e.marketTicker)||(t==null?void 0:t.marketTicker)};return Os(n)?n:void 0}function qm(e,t){if(!Os(t))return e;const n=Js(e),r=n.linkifyDemotionContext;return{...n,linkifyDemotionContext:{filename:(r==null?void 0:r.filename)||(t==null?void 0:t.filename),explicitFilename:(r==null?void 0:r.explicitFilename)||(t==null?void 0:t.explicitFilename),marketTicker:(r==null?void 0:r.marketTicker)||(t==null?void 0:t.marketTicker)}}}function eA(e){const t=Xs(e);return Os(t)?t:void 0}function BI(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function tA(e,t){if(!Os(t))return;const n=String(e??"").trim().split(/\s+/u).map(BI).filter(Boolean);if(n.length===0)return;const r={};return t!=null&&t.filename&&n.every(i=>Su(i,{filename:!0,explicitFilename:t.explicitFilename}))&&(r.filename=!0),t!=null&&t.explicitFilename&&r.filename&&(r.explicitFilename=!0),t!=null&&t.marketTicker&&n.every(i=>Su(i,{marketTicker:!0}))&&(r.marketTicker=!0),Os(r)?r:void 0}function $i(e,t=!1){let n=Js(e).linkifyDemotionSeedContext;return{options(r){return t||r==null?qm(e,n):qm(e,Ff(eA(r),tA(r,n)))},remember(r){const i=eA(r);n=t?Ff(n,i):Ff(i,tA(r,n))},reset(){n=void 0},snapshot(){return n}}}function nA(e){return mI.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function FI(e){var r;const t=e.split(".");if(t.length<2)return!1;const n=((r=t[t.length-1])==null?void 0:r.toLowerCase())??"";return nA(n)||AI.test(n)?t.every(nA):!1}function qv(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function DI(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function RI(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function ek(e,t,n){const r=DI(t);return qv(e)&&RI(r)&&String(n??"").toLowerCase().includes(r.toLowerCase())}function NI(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 Xs(e){const t=String(e??""),n=Xo.get(t);return n||(NI(t)?Xm(t,{explicitFilename:yI.test(t),filename:CI.test(t),marketTicker:bI.test(t)}):Xm(t,_I))}function LI(e){return FI(e.split(/[\\/]/)[0]??"")}function OI(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function PI(e){if(fI.test(e)||!gI.test(e))return!0;if(pI.test(e))return!LI(e);const t=e.replace(Vv,"");return qv(t)?!0:t.split(".").filter(Boolean).some(OI)}function $I(e,t,n){if(!(n?II:Xv).has(t))return!1;const r=e.slice(0,-(t.length+1));return r===""?e.startsWith("."):(n?kI:vI).test(r)}function Su(e,t={}){if(!e||dI.test(e)||hI.test(e))return!1;const n=e.match(Vv);if(!n)return!1;const r=String(n[1]??"").toLowerCase();return $I(e,r,t.marketTicker===!0)?!0:TI.has(r)?!SI.has(r)||t.filename?!0:PI(e):!!(t.explicitFilename&&EI.has(r)||t.filename&&MI.has(r))}const Kh=new WeakMap,tk=new WeakSet;function Ed(e,t){return Kh.set(e,t),e}function jh(e){return Kh.get(e)}function zh(e){if(!e)return"";const t=jh(e);if(t==="linkify"||t==="autolink")return t;const n=typeof e.markup=="string"?e.markup:"";return n==="linkify"||n==="autolink"?n:""}function nk(e,t){if(!e||!t)return;const n=jh(e);n&&Kh.set(t,n)}function HI(e){tk.add(e)}function rk(e){return e===void 0||tk.has(e)}const rA=["!"];function iA(e){return e==="linkify"||e==="autolink"?e:"recovery"}function Qn(e){return{type:"text",content:e,raw:e}}function lo(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 so(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 Ai(e,t,n,r="recovery"){let i="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),i=o[1].trim()}return Ed({type:"link",loading:n,href:t,title:i,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},r)}function WI(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==null?void 0:n.type)==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Qn(t))}}function oA(e,t){let n=-1;for(const r of t){const i=e.indexOf(r);i!==-1&&(n===-1||i<n)&&(n=i)}return n}function KI(e){var n,r;const t=(r=(n=e.attrs)==null?void 0:n.find(i=>(i==null?void 0:i[0])==="href"))==null?void 0:r[1];return typeof t=="string"?t:""}function jI(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(r=>(r==null?void 0:r[0])==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function lA(e,t,n){let r="";for(let i=t+1;i<n;i++){const o=e[i];if((o==null?void 0:o.type)!=="text"||typeof o.content!="string")return null;r+=o.content}return r||null}function sA(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r==="(")t++;else if(r===")"){if(t===0)return n;t--}}return-1}function zI(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let r=0;r<n.length;r++){const i=n[r];if(i&&i.type==="inline"&&Array.isArray(i.children))try{i.children=GI(i.children,typeof i.content=="string"?i.content:void 0)}catch(o){console.error("[applyFixLinkTokens] failed to fix inline children",o)}}})}function GI(e,t){var l,s,a,u,c,p,d,f,g,m,A,v,k,C,b,S,T,M,E,$,X,K,I,B,P,_,W,z,N,R,oe,ne,ee,ie,G,Q,te,re,pe,ce,Ce,ze,Ne,Ze,st,Ke,St,Pe,Ft,vn,Vt,fr,Lr,Ar,$n,Hn,It,Dt,Ht,vr,kn,Wn,yt,rt,ot,Ct,jt,qt,pt,tt,xe,Le,nt,Xe,at,tn,it,Ge,ut,Et,Jt,Ee,nn,qe,At,Mt,an,bt,er,me,ei,tr,Wt,Hi,Or,ti,ni,ri,nr,kr,Pr;if(e.length<3)return e;const n=e.some(Z=>Z.type==="code_inline"),r=new Map;let i=0;for(let Z=0;Z<e.length;Z++){const Be=e[Z];if(Be.type==="link_open"){let ye=-1;for(let ve=Z+1;ve<e.length;ve++)if(((l=e[ve])==null?void 0:l.type)==="link_close"){ye=ve;break}if(ye!==-1&&Be.markup==="linkify"){r.set(Be,i);const ve=lA(e,Z,ye),Ue=i>0&&ve?sA(ve):-1;if(Ue!==-1&&ve)for(const et of ve.slice(Ue))et==="("?i++:et===")"&&i>0&&i--}ye!==-1&&(Z=ye);continue}if(!(Be.type!=="text"||typeof Be.content!="string"))for(const ye of Be.content)ye==="("?i++:ye===")"&&i>0&&i--}const o=Xs(t);for(let Z=0;Z<=e.length-1;Z++){Z<0&&(Z=0);const Be=e[Z];if(!Be)break;if(Be.type==="link_open"&&(Be.markup==="linkify"||Be.markup==="autolink")){let ye=-1;for(let ve=Z+1;ve<e.length;ve++)if(((s=e[ve])==null?void 0:s.type)==="link_close"){ye=ve;break}if(ye!==-1){const ve=lA(e,Z,ye),Ue=KI(Be);if(!n&&Be.markup==="linkify"&&ve&&!ek(ve,Ue,t)&&Su(ve,o)){e.splice(Z,ye-Z+1,Qn(ve));continue}let et=oA(ve??"",rA);if(Be.markup==="linkify"&&(ve!=null&&ve.includes(")"))&&(r.get(Be)??0)>0){const $e=sA(ve);$e!==-1&&(et===-1||$e<et)&&(et=$e)}const Fe=oA(Ue,rA);let Oe=et;for(let $e=Z+1;$e<ye;$e++){const ct=e[$e];if((ct==null?void 0:ct.type)!=="text"||typeof ct.content!="string")continue;if(Oe>=ct.content.length){Oe-=ct.content.length;continue}if(Oe<0)break;const yn=ct.content[Oe],Tt=ct.content.slice(0,Oe);let Tn=ct.content.slice(Oe);for(let Bn=$e+1;Bn<ye;Bn++){const We=e[Bn];(We==null?void 0:We.type)==="text"&&typeof We.content=="string"&&(Tn+=We.content)}ct.content=Tt,ct.raw=Tt;const Kn=ye-($e+1);Kn>0&&(e.splice($e+1,Kn),ye=$e+1);let Sr=Ue;if(yn==="!"&&Fe!==-1)Sr=Ue.slice(0,Fe);else if(Tn){const Bn=encodeURI(Tn);if(Bn&&Ue.endsWith(Bn))Sr=Ue.slice(0,Ue.length-Bn.length);else{const We=yn?encodeURI(yn):"",bl=We?Ue.indexOf(We):-1;bl!==-1&&(Sr=Ue.slice(0,bl))}}Sr!==Ue&&jI(Be,Sr),Tn&&e.splice(ye+1,0,Qn(Tn));break}}}if(!n){if((Be==null?void 0:Be.type)==="em_open"&&((a=e[Z-1])==null?void 0:a.type)==="text"&&((u=e[Z-1].content)!=null&&u.endsWith("*"))){const ye=((c=e[Z-1].content)==null?void 0:c.replace(/(\*+)$/,""))||"";e[Z-1].content=ye,Be.type="strong_open",Be.tag="strong",Be.markup="**";for(let ve=Z+1;ve<e.length;ve++)if(((p=e[ve])==null?void 0:p.type)==="em_close"){e[ve].type="strong_close",e[ve].tag="strong",e[ve].markup="**";break}}else if((Be==null?void 0:Be.type)==="text"&&((d=Be.content)!=null&&d.endsWith("("))&&((f=e[Z+1])==null?void 0:f.type)==="link_open"){const ye=Be.content.match(/\[([^\]]+)\]/);if(ye){let ve=Be.content.slice(0,ye.index);const Ue=ve.match(/(\*+)$/),et=(g=e[Z+1])==null?void 0:g.markup,Fe=(et==="linkify"||et==="autolink")&&(ye.index??0)+ye[0].length===Be.content.length-1?"explicit":iA(et),Oe=[];if(Ue){ve=ve.slice(0,Ue.index),ve&&Oe.push(Qn(ve));const $e=ye[1],ct=Ue[1].length;lo(Oe,ct);let yn=((m=e[Z+2])==null?void 0:m.content)||"";if(((A=e[Z+4])==null?void 0:A.type)==="text"&&!((v=e[Z+4].content)!=null&&v.startsWith(")"))&&(yn+=((k=e[Z+4])==null?void 0:k.content)||"",e[Z+4].content=""),Oe.push(Ai($e,yn,!((b=(C=e[Z+4])==null?void 0:C.content)!=null&&b.startsWith(")")),Fe)),so(Oe,ct),((S=e[Z+4])==null?void 0:S.type)==="text"){const Tt=(T=e[Z+4].content)==null?void 0:T.replace(/^\)\**/,"");Tt&&Oe.push(Qn(Tt)),e.splice(Z,5,...Oe)}else e.splice(Z,4,...Oe)}else{ve&&Oe.push(Qn(ve));let $e=ye[1];const ct=$e.match(/^\*+/);if(ct){const Tt=ct[0].length;$e=$e.replace(/^\*+/,"").replace(/\*+$/,"");let Tn=((M=e[Z+2])==null?void 0:M.content)||"";if(((E=e[Z+4])==null?void 0:E.type)==="text"&&!(($=e[Z+4].content)!=null&&$.startsWith(")"))&&(Tn+=((X=e[Z+4])==null?void 0:X.content)||"",e[Z+4].content=""),lo(Oe,Tt),Oe.push(Ai($e,Tn,!((I=(K=e[Z+4])==null?void 0:K.content)!=null&&I.startsWith(")")),Fe)),so(Oe,Tt),((B=e[Z+4])==null?void 0:B.type)==="text"){const Kn=(P=e[Z+4].content)==null?void 0:P.replace(/^\)/,"");Kn&&Oe.push(Qn(Kn)),e.splice(Z,5,...Oe)}else e.splice(Z,4,...Oe);Z===0?Z=Oe.length-1:Z-=Oe.length+1;continue}let yn=((_=e[Z+2])==null?void 0:_.content)||"";if(((W=e[Z+4])==null?void 0:W.type)==="text"&&!((z=e[Z+4].content)!=null&&z.startsWith(")"))&&(yn+=((N=e[Z+4])==null?void 0:N.content)||"",e[Z+4].content=""),Oe.push(Ai($e,yn,!((oe=(R=e[Z+4])==null?void 0:R.content)!=null&&oe.startsWith(")")),Fe)),((ne=e[Z+4])==null?void 0:ne.type)==="text"){const Tt=(ee=e[Z+4].content)==null?void 0:ee.replace(/^\)/,"");Tt&&Oe.push(Qn(Tt)),e.splice(Z,5,...Oe)}else e.splice(Z,4,...Oe)}Z-=Oe.length+1;continue}}else if(Be.type==="link_open"&&Be.markup==="linkify"&&((ie=e[Z-1])==null?void 0:ie.type)==="text"&&((G=e[Z-1].content)!=null&&G.endsWith("("))){if(((Q=e[Z-2])==null?void 0:Q.type)==="link_close"){const ye=[],ve=e[Z-3].content||"";let Ue=((re=(te=Be.attrs)==null?void 0:te.find(et=>et[0]==="href"))==null?void 0:re[1])||"";if(((pe=e[Z+3])==null?void 0:pe.type)==="text"){const et=(((ce=e[Z+3])==null?void 0:ce.content)??"").indexOf(")"),Fe=et===-1;et===-1&&(Ue+=((ze=(Ce=e[Z+3])==null?void 0:Ce.content)==null?void 0:ze.slice(0,et))||"",e[Z+3].content=""),ye.push(Ai(ve,Ue,Fe,"linkify"));const Oe=(Ne=e[Z+3].content)==null?void 0:Ne.replace(/^\)\**/,"");Oe&&ye.push(Qn(Oe)),e.splice(Z-4,8,...ye)}else ye.push(Ed({type:"link",loading:!0,href:Ue,title:"",text:ve,children:[{type:"text",content:Ue,raw:Ue}],raw:`[${ve}](${Ue})`},"linkify")),e.splice(Z-4,7,...ye);continue}else if(e[Z-1].content==="]("&&((Ze=e[Z-3])==null?void 0:Ze.type)==="text"&&((st=e[Z-3].content)!=null&&st.endsWith(")")))if(((Ke=e[Z-2])==null?void 0:Ke.type)==="strong_open"){const[ye,ve]=((St=e[Z-3].content)==null?void 0:St.split("[**"))||[];e[Z+1].content=ve||"",e[Z-3].content=ye||"",e[Z-1].content=""}else if(((Pe=e[Z-2])==null?void 0:Pe.type)==="em_open"){const[ye,ve]=((Ft=e[Z-3].content)==null?void 0:Ft.split("[*"))||[];e[Z+1].content=ve||"",e[Z-3].content=ye||"",e[Z-1].content=""}else{const[ye,ve]=((vn=e[Z-3].content)==null?void 0:vn.split("["))||[];e[Z+1].content=ve||"",e[Z-3].content=ye||"",e[Z-1].content=""}}if(Be.type==="link_close"&&Be.nesting===-1&&((Vt=e[Z-2])==null?void 0:Vt.type)==="link_open"&&((fr=e[Z+1])==null?void 0:fr.type)==="text"&&((Lr=e[Z-1])==null?void 0:Lr.type)==="text"){const ye=e[Z-1].content||"",ve=e[Z-2].attrs||[],Ue=((Ar=ve.find(Tt=>Tt[0]==="href"))==null?void 0:Ar[1])||"",et=(($n=ve.find(Tt=>Tt[0]==="title"))==null?void 0:$n[1])||"";let Fe=3,Oe=2;const $e=(((Hn=e[Z-3])==null?void 0:Hn.content)||"").match(/^(\*+)$/),ct=[];if($e){Oe+=1;const Tt=$e[1].length;lo(ct,Tt)}if(Be.markup!=="linkify"&&e[Z+1].type==="text"&&((Dt=(It=e[Z+1])==null?void 0:It.content)!=null&&Dt.startsWith("]("))){Fe+=1;for(let Tt=Z+1;Tt<e.length;Tt++){const Tn=$e?$e[1].length:e[Z-3].markup.length,Kn=e[Tt];if(Tn===1&&Kn.type==="em_close")break;if(Tn===2&&Kn.type==="strong_close")break;if(Tn===3&&(Kn.type==="em_close"||Kn.type==="strong_close"))break;Fe+=1}}const yn=Ed({type:"link",loading:!1,href:Ue,title:et,text:ye,children:[{type:"text",content:ye,raw:ye}],raw:`[${ye}](${Ue})`},Be.markup?iA(Be.markup):"explicit");if(ct.push(yn),$e){const Tt=$e[1].length;so(ct,Tt)}e.splice(Z-Oe,Fe,...ct),Z-=ct.length+1;continue}else if((Ht=Be.content)!=null&&Ht.startsWith("](")&&((vr=e[Z-1].markup)!=null&&vr.includes("*"))&&((kn=e[Z-4])==null?void 0:kn.type)==="text"&&((Wn=e[Z-4].content)!=null&&Wn.endsWith("["))){const ye=e[Z-1].markup.length,ve=[],Ue=e[Z-4].content.slice(0,e[Z-4].content.length-ye);Ue&&ve.push(Qn(Ue)),lo(ve,ye);const et=e[Z-2].content||"";let Fe=Be.content.slice(2),Oe=!0;if(((yt=e[Z+1])==null?void 0:yt.type)==="text"){const $e=(((rt=e[Z+1])==null?void 0:rt.content)??"").indexOf(")");Oe=$e===-1,$e===-1&&(Fe+=((Ct=(ot=e[Z+1])==null?void 0:ot.content)==null?void 0:Ct.slice(0,$e))||"",e[Z+1].content="")}if(ve.push(Ai(et,Fe,Oe)),so(ve,ye),((jt=e[Z+1])==null?void 0:jt.type)==="text"){const $e=(qt=e[Z+1].content)==null?void 0:qt.replace(/^\)\**/,"");$e&&ve.push(Qn($e)),e.splice(Z-4,8,...ve)}else((pt=e[Z+1])==null?void 0:pt.type)==="link_open"?e.splice(Z-4,10,...ve):e.splice(Z-4,7,...ve);Z-=ve.length+1;continue}else if((tt=Be.content)!=null&&tt.startsWith("](")&&e[Z-1].type==="strong_close"&&((xe=e[Z-4])==null?void 0:xe.type)==="text"&&((nt=(Le=e[Z-4])==null?void 0:Le.content)!=null&&nt.includes("**["))){const ye=[],ve=e[Z-4].content.split("**[")[0];ve&&ye.push(Qn(ve)),lo(ye,2);const Ue=e[Z-2].content||"";let et=Be.content.slice(2),Fe=!0;if(((Xe=e[Z+1])==null?void 0:Xe.type)==="text"){const Oe=(((at=e[Z+1])==null?void 0:at.content)??"").indexOf(")");Fe=Oe===-1,Oe===-1&&(et+=((it=(tn=e[Z+1])==null?void 0:tn.content)==null?void 0:it.slice(0,Oe))||"",e[Z+1].content="")}if(ye.push(Ai(Ue,et,Fe)),so(ye,2),((Ge=e[Z+1])==null?void 0:Ge.type)==="text"){const Oe=(ut=e[Z+1].content)==null?void 0:ut.replace(/^\)\**/,"");Oe&&ye.push(Qn(Oe)),e.splice(Z-4,8,...ye)}else((Et=e[Z+1])==null?void 0:Et.type)==="link_open"?e.splice(Z-4,10,...ye):e.splice(Z-4,7,...ye);Z-=ye.length+1;continue}else if(Be.type==="strong_close"&&((Jt=e[Z+1])==null?void 0:Jt.type)==="text"&&((Ee=e[Z+1].content)!=null&&Ee.includes("]("))&&e[Z-1].type==="text"&&/\[.*$/.test(e[Z-1].content||"")){const ye=[],[ve,Ue]=((nn=e[Z-1].content)==null?void 0:nn.split("["))||["",""];ve&&ye.push(Qn(ve)),lo(ye,2);let[et,Fe]=e[Z+1].content.split("](");et=Ue+et;let Oe=4;if(((qe=e[Z+2])==null?void 0:qe.type)==="link_open"){const ct=(Mt=(At=e[Z+2].attrs)==null?void 0:At.find(yn=>yn[0]==="href"))==null?void 0:Mt[1];((an=e[Z+5])==null?void 0:an.type)==="text"&&e[Z+5].content==="."?(Fe=(ct||Fe)+e[Z+5].content,e[Z+5].content=""):Fe=ct||Fe,Oe+=3}let $e=!0;if(Be.nesting===-1&&(et=et.replace(/\*+$/,"")),((bt=e[Z+2])==null?void 0:bt.type)==="text"){const ct=(((er=e[Z+2])==null?void 0:er.content)??"").indexOf(")");$e=ct===-1,ct===-1&&(Fe+=((ei=(me=e[Z+2])==null?void 0:me.content)==null?void 0:ei.slice(0,ct))||"",e[Z+2].content="")}ye.push(Ai(et,Fe,$e)),so(ye,2),e.splice(Z-2,Oe,...ye)}if(Be.type==="text"&&/\*+\[[^\]]*$/.test(Be.content||"")&&((tr=e[Z+1])==null?void 0:tr.type)==="strong_open"&&((Wt=e[Z+2])==null?void 0:Wt.type)==="text"&&e[Z+2].content==="]("&&((Hi=e[Z+3])==null?void 0:Hi.type)==="link_open"&&((Or=e[Z+5])==null?void 0:Or.type)==="link_close"&&((ti=e[Z+6])==null?void 0:ti.type)==="text"&&e[Z+6].content===")"&&((ni=e[Z+7])==null?void 0:ni.type)==="strong_close"){const ye=(Be.content||"").match(/^(\*+)\[(.*)$/);if(ye){const ve=(ye[2]||"")+ye[1];let Ue=((kr=(nr=(ri=e[Z+3])==null?void 0:ri.attrs)==null?void 0:nr.find(Fe=>Fe[0]==="href"))==null?void 0:kr[1])||"";!Ue&&((Pr=e[Z+4])==null?void 0:Pr.type)==="text"&&(Ue=e[Z+4].content||"");const et=[];lo(et,2),et.push(Ai(ve,Ue,!1)),so(et,2),e.splice(Z,9,...et),Z-=et.length-1;continue}}}}if(n)return e;for(let Z=0;Z<e.length-1;Z++){const Be=e[Z],ye=e[Z+1];if((Be==null?void 0:Be.type)!=="link"||(ye==null?void 0:ye.type)!=="text"||typeof ye.content!="string"||!ye.content.startsWith("!"))continue;const ve=String(Be.href??"");if(String(Be.text??"")!==ve||!ve.endsWith("=")&&!ve.endsWith("#"))continue;WI(Be,"!");const Ue=ye.content.slice(1);Ue?(ye.content=Ue,ye.raw=Ue):e.splice(Z+1,1)}return e}function QI(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let r=0;r<n.length;r++){const i=n[r];if(i&&i.type==="inline"&&Array.isArray(i.children))try{i.children=UI(i.children)}catch(o){console.error("[applyFixListItem] failed to fix inline children",o)}}})}function UI(e){var r;const t=e[e.length-1],n=String((t==null?void 0:t.content)??"");return(t==null?void 0:t.type)==="text"&&/^\s*\d+\.\s*$/.test(n)&&((r=e[e.length-2])==null?void 0:r.tag)==="br"&&e.splice(e.length-1,1),e}function YI(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let r=0;r<n.length;r++){const i=n[r];if(i&&i.type==="inline"&&Array.isArray(i.children))try{i.children=ZI(i.children)}catch(o){console.error("[applyFixStrongTokens] failed to fix inline children",o)}}})}function ZI(e){var c,p,d,f,g,m,A;let t=0;const n=new Set,r=new Set;let i=0;for(let v=0;v<e.length;v++){const k=e[v],C=k.type;if(C==="strong_open"){t++;const b=String(k.markup??"");let S=v-1;for(;S>=0&&e[S].type==="text"&&e[S].content==="";)S--;const T=e[S];let M=v+1;for(;M<e.length&&e[M].type==="text"&&e[M].content==="";)M++;const E=e[M];b==="__"&&((c=T==null?void 0:T.content)!=null&&c.endsWith("_")||(p=E==null?void 0:E.content)!=null&&p.startsWith("_"))&&(k.type="text",k.tag="",k.content=b,k.raw=b,k.markup="",k.attrs=null,k.map=null,k.info="",k.meta=null,n.add(t))}else if(C==="strong_close")n.has(t)&&k.markup==="__"&&(k.type="text",k.content=k.markup,k.raw=String(k.markup??""),k.tag="",k.markup="",k.attrs=null,k.map=null,k.info="",k.meta=null),t--,t<0&&(t=0);else if(C==="em_open"){i++;const b=String(k.markup??"");let S=v-1;for(;S>=0&&e[S].type==="text"&&e[S].content==="";)S--;const T=e[S];let M=v+1;for(;M<e.length&&e[M].type==="text"&&e[M].content==="";)M++;const E=e[M];b==="_"&&((d=T==null?void 0:T.content)!=null&&d.endsWith("_")||(f=E==null?void 0:E.content)!=null&&f.startsWith("_"))&&(k.type="text",k.tag="",k.content=b,k.raw=b,k.markup="",k.attrs=null,k.map=null,k.info="",k.meta=null,r.add(i))}else C==="em_close"&&(r.has(i)&&k.markup==="_"&&(k.type="text",k.content=k.markup,k.raw=String(k.markup??""),k.tag="",k.markup="",k.attrs=null,k.map=null,k.info="",k.meta=null),i--,i<0&&(i=0))}if(e.length<5)return e;const o=e.length-4,l=e[o];let s=[...e];const a=e[o+1],u=String(l.content??"");if(l.type==="link_open"&&((g=e[o-1])==null?void 0:g.type)==="em_open"&&((m=e[o-2])==null?void 0:m.type)==="text"&&((A=e[o-2].content)!=null&&A.endsWith("*"))){const v=String(e[o-2].content??"").slice(0,-1),k=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[o],e[o+1],e[o+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];v&&k.unshift({type:"text",content:v,raw:v}),s.splice(o-2,6,...k)}else if(l.type==="text"&&u.endsWith("*")&&a.type==="em_open"){const v=e[o+2],k=(v==null?void 0:v.type)==="text"?4:3,C=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:(v==null?void 0:v.type)==="text"?String(v.content??""):"",raw:(v==null?void 0:v.type)==="text"?String(v.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],b=u.slice(0,-1);b&&C.unshift({type:"text",content:b,raw:b}),s.splice(o,k,...C)}return s=VI(s),s}function VI(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=e[n+1],o=e[n+2],l=e[n+3],s=e[n+4],a=e[n+5],u=e[n+6];if((r==null?void 0:r.type)==="strong_open"&&(i==null?void 0:i.type)==="text"&&(o==null?void 0:o.type)==="strong_close"&&(l==null?void 0:l.type)==="strong_open"&&(s==null?void 0:s.type)==="math_inline"&&(a==null?void 0:a.type)==="strong_close"&&(u==null?void 0:u.type)==="text"){const c=String(u.content??""),p=c.indexOf("**");if(p!==-1){const d=c.slice(0,p),f=c.slice(p+2);t.push(r),t.push(i),t.push(s),d&&t.push({...u,type:"text",content:d,raw:d}),t.push(a),f&&t.push({...u,type:"text",content:f,raw:f}),n+=6;continue}}if((r==null?void 0:r.type)==="strong_open"&&(i==null?void 0:i.type)==="text"&&(o==null?void 0:o.type)==="strong_close"&&(l==null?void 0:l.type)==="strong_open"&&(s==null?void 0:s.type)==="math_inline"&&(a==null?void 0:a.type)==="strong_close"){const c=JI(e,n+6);if(c){t.push(r),t.push(i),t.push(s);for(let p=n+6;p<c.index;p++)t.push(e[p]);c.beforeClose&&t.push({...e[c.index],type:"text",content:c.beforeClose,raw:c.beforeClose}),t.push(a),c.afterClose&&t.push({...e[c.index],type:"text",content:c.afterClose,raw:c.afterClose}),n=c.index;continue}}t.push(r)}return t}function JI(e,t){for(let n=t;n<e.length;n++){const r=e[n];if((r==null?void 0:r.type)==="strong_open")return null;if((r==null?void 0:r.type)!=="text")continue;const i=String(r.content??""),o=i.indexOf("**");if(o!==-1)return{index:n,beforeClose:i.slice(0,o),afterClose:i.slice(o+2)}}return null}function XI(e){e.core.ruler.after("block","fix_table_tokens",t=>{var r;const n=t;try{const i=iE(n.tokens??[],!!((r=n.env)!=null&&r.__markstreamFinal),n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function aA(e){const t=Array.isArray(e)?[...e]:null,n=t?[t[0],t[0]+1]:null;return[{type:"table_open",tag:"table",attrs:null,map:t,children:null,content:"",markup:"",info:"",level:0,nesting:1,block:!0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,map:n,nesting:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,map:n,nesting:1,children:null}]}function uA(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,map:null,nesting:-1,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,map:null,nesting:-1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,nesting:-1,block:!0,meta:null}]}function cA(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,map:null,nesting:1,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,map:null,nesting:0,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,map:null,nesting:-1,children:null}]}function ik(e,t){if(!e.startsWith("|")||e.includes(`
103
+ `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(r=>r.trim().length>0)?n:null}function Df(e){return ik(e)!==null}function ok(e){return/^:?-+:?$/.test(e.trim())}function qI(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(ok)}function eE(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function tE(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(ok)&&eE(n)}function nE(e){return e==="|"||e==="|:"}function rE(e){const t=ik(e);return t!==null&&t.every(n=>!n.includes(":"))}function iE(e,t=!1,n=""){var f;if(e.length<3)return e;const r=e.length-2,i=e[r];if(i.type!=="inline")return e;const o=(f=e[r-1])==null?void 0:f.map,l=String(i.content??""),s=l.split(`
104
+ `)[0]??"",[a="",u="",...c]=l.split(`
105
+ `),p=!t&&!l.includes(`
106
+ `)&&/\r?\n$/.test(n)&&Df(l);let d=null;if(!t&&(l.includes(`
107
+ `)&&c.length===0&&Df(a)&&tE(u)||p)){const g=s.slice(1,-1).split("|").map(A=>A.trim()).flatMap(A=>cA(A)),m=[...aA(o),...g,...uA()];d=[...e],d.splice(r-1,3,...m)}else if(l.includes(`
108
+ `)&&c.length===0&&Df(a)&&qI(u)){const g=s.slice(1,-1).split("|").map(A=>A.trim()).flatMap(A=>cA(A)),m=[...aA(o),...g,...uA()];d=[...e],d.splice(r-1,3,...m)}else if(l.includes(`
109
+ `)&&c.length===0&&rE(a)&&nE(u))return i.content=l.slice(0,-2),i.children.splice(2,1),e;return d??e}function lk(e,t,n,r){const i=e.length;if(n==="$$"&&r==="$$"){let u=t;for(;u<i-1;){if(e[u]==="$"&&e[u+1]==="$"){let c=u-1,p=0;for(;c>=0&&e[c]==="\\";)p++,c--;if(p%2===0)return u}u++}return-1}const o=n[n.length-1],l=r;let s=0,a=t;for(;a<i;){if(e.slice(a,a+l.length)===l){let c=a-1,p=0;for(;c>=0&&e[c]==="\\";)p++,c--;if(p%2===0){if(s===0)return a;s--,a+=l.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===o?s++:u===l[l.length-1]&&s>0&&s--,a++}return-1}var oE=lk;const sk=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Ps=sk.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),lE=/\\[a-z]+/i,ak="(?:\\\\|\\u0008)",sE=new RegExp(String.raw`${ak}(?:${Ps})\s*\{[^}]+\}`,"i"),aE=new RegExp(String.raw`(?:${ak})?(?:${Ps})\s*\{`,"i"),uE=/\\(?:text|frac|left|right|times)/,cE=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,fE=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,dE=/[A-Z]+\s*\([^)]+\)/i,hE=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,pE=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,gE=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,mE={"\b":"\\b","\v":"\\v","\f":"\\f"};function AE(e){let t="";for(const n of e)t+=mE[n]??n;return t}function Qr(e){if(!e)return!1;const t=AE(e),n=t.trim();if(gE.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const r=lE.test(t),i=sE.test(t),o=aE.test(t),l=uE.test(t),s=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=cE.test(t)&&!fE.test(t),u=dE.test(t),c=hE.test(n),p=pE.test(t),d=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),f=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return r||i||o||l||s||a||u||c||p||d||f}const uk="__markstreamMathPluginApplied",Md=80,ck=2e4,Rf=ck+4096;function Gh(e){return!!e[uk]}function vE(e){e[uk]=!0}const Qh=["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"],kE=["cdot","mathbf{","partial","mu_{"],fk=Qh.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),dk="[ \r\b\f\v]",yE=new RegExp(`([^\\\\])(${kE.map(e=>e).join("|")})+`,"g"),CE=/span\{([^}]+)\}/,bE=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,xE=/(^|[^\\])\\\r?\n/g,wE=/(^|[^\\])\\$/g,_E=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,SE=new RegExp(`(${dk})|(${fk})\\b`,"g"),fA=new Map,dA=new Map;function IE(e){if(!e)return SE;const t=[...e];t.sort((l,s)=>s.length-l.length);const n=t.join(""),r=fA.get(n);if(r)return r;const i=`(?:${t.map(l=>l.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,o=new RegExp(`(${dk})|(${i})\\b`,"g");return fA.set(n,o),o}function EE(e,t){const n=e?[]:[...t??[]];e||n.sort((s,a)=>a.length-s.length);const r=e?"__default__":n.join(""),i=dA.get(r);if(i)return i;const o=e?[Ps,fk].filter(Boolean).join("|"):[n.map(s=>s.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Ps].filter(Boolean).join("|"),l=new RegExp(`(^|[^\\\\\\w])(${o})\\s*\\{`,"g");return dA.set(r,l),l}const hA={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function pA(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function ME(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&_E.test(n))return t;const r=n?t.slice(n.length):t;return`${n}${"\\!".repeat(r.length)}`})}function gA(e){var i;const t=/(^|[^\\])(__|\*\*)/g;let n,r=null;for(;(n=t.exec(e))!==null;)r={marker:n[2],index:n.index+(((i=n[1])==null?void 0:i.length)??0)};return r}function zr(e,t){const n=(t==null?void 0:t.commands)??Qh,r=(t==null?void 0:t.escapeExclamation)??!0,i=(t==null?void 0:t.commands)==null,o=IE(i?void 0:n);let l=e.replace(o,(u,c,p,d,f)=>{if(c!==void 0&&hA[c]!==void 0)return`\\${hA[c]}`;if(p&&n.includes(p)){const g=f&&typeof d=="number"?f[d-1]:void 0;return g==="\\"||g&&/\w/.test(g)?u:`\\${p}`}return u});r&&(l=ME(l));let s=l;const a=EE(i,i?void 0:n);return s=s.replace(a,(u,c,p)=>`${c}\\${p}{`),s=s.replace(CE,"span\\{$1\\}").replace(bE,"\\operatorname{span}\\{$1\\}"),s=s.replace(xE,`$1\\\\
110
+ `),s=s.replace(wE,"$1\\\\"),s=s.replace(yE,"$1\\$2"),s}function mA(e){const t=e.trim();return!(!Qr(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))}const AA=new WeakMap;function TE(e){var o;let t=AA.get(e);if(t)return t;const n=e.src,r=((o=e.env)==null?void 0:o.__markstreamFinal)!==!0,i=[];for(let l=0;l<n.length;l++){const s=n[l];(s==="$"||s==="\\")&&i.push(l)}return t={codeSpanRanges:hk(n),imageRanges:FE(n,r),mathOpenerPositions:i},AA.set(e,t),t}function BE(e,t){let n=0,r=e.length;for(;n<r;){const i=n+r>>1;e[i]<t?n=i+1:r=i}return n<e.length}function hk(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const r=n;let i=1;for(;r+i<e.length&&e[r+i]==="`";)i++;let o=r+i,l=-1;for(;o<e.length;){if(e[o]!=="`"){o++;continue}let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;if(s===i){l=o;break}o+=s}if(l!==-1){t.push([r,l+i]),n=l+i;continue}n=r+i}return t}function Iu(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function FE(e,t=!1){const n=[];let r=0;for(;r<e.length-1;){if(e[r]==="!"&&e[r+1]==="["){const i=r;let o=r+2,l=1;for(;o<e.length&&l>0;){if(e[o]==="\\"&&o+1<e.length){o+=2;continue}e[o]==="["?l++:e[o]==="]"&&l--,o++}if(l===0&&o<e.length&&e[o]==="("){let s=o+1,a=1;for(;s<e.length&&a>0;){if(e[s]==="\\"&&s+1<e.length){s+=2;continue}e[s]==="("?a++:e[s]===")"&&a--,s++}if(a===0){n.push([i,s]),r=s;continue}if(t){n.push([i,e.length]),r=e.length;continue}}}r++}return n}function qs(e,t){let n=t-1,r=0;for(;n>=0&&e[n]==="\\";)r++,n--;return r%2===1}function Td(e,t){let n=t;for(;n<e.length;){const r=e.indexOf("$",n);if(r===-1)return-1;if(qs(e,r)){n=r+1;continue}return r}return-1}function Nf(e,t){let n=t;for(;n<e.length;){const r=Td(e,n);if(r===-1)return-1;if(r>0&&e[r-1]==="$"||r+1<e.length&&e[r+1]==="$"){n=r+1;continue}return r}return-1}function qo(e,t,n=0){let r=Math.max(0,n);for(;r<e.length;){const i=e.indexOf(t,r);if(i===-1)return-1;if(!qs(e,i))return i;r=i+Math.max(1,t.length)}return-1}function vA(e,t,n=0,r=e.length,i=[]){let o=0,l=Math.max(0,n);const s=Math.min(e.length,Math.max(0,r));for(;l<s;){const a=e.indexOf(t,l);if(a===-1||a>=s)break;const u=Iu(i,a);if(u){l=Math.max(a+Math.max(1,t.length),u[1]);continue}qs(e,a)||o++,l=a+Math.max(1,t.length)}return o}function Uh(e,t,n){const r=Hs(String(e??""));if(!r.endsWith(t))return-1;const i=r.length-t.length;if(i<=0||!Hs(r.slice(0,i)).trim()||qs(r,i))return-1;const o=hk(r);if(Iu(o,i))return-1;const l=vA(r,t,0,i,o);if(t==="$$"){if(l%2===1)return-1}else if(l>vA(r,n,0,i,o))return-1;return i}function $s(e){return e===" "||e===" "}function Hs(e){let t=e.length;for(;t>0&&$s(e[t-1]);)t--;return e.slice(0,t)}function kA(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
111
+ `&&t++;return t}function yA(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function DE(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let r=0;r<e.length;r++){const i=e[r];if(i===t){n++;continue}if(!$s(i))return!1}return n>=3}function RE(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let r=0;for(;t[n]==="-";)r++,n++;return r<3?!1:(t[n]===":"&&n++,n===t.length)}function NE(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(RE)}function LE(e){let t=0;if(!yA(e[t]))return!1;for(;yA(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:$s(e[t+1])}function pk(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&&$s(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&$s(t[1])||LE(t)||DE(t)||NE(t))}function CA(e,t){return e?t?`${e}
112
+ ${t}`:e:t}function Bd(e){const t=String(e??"").trim();return t?Qr(t):!1}function bA(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function gk(e,t){if(e.length<=Rf)return{source:e,lineOffset:0};if(t){const o=e.length-Rf;let l=e.indexOf(`
113
+ `,o);l=l===-1?e.length:l+1;const s=t.lineOffset+kA(e.slice(t.windowStart,l));return t.lineOffset=s,t.windowStart=l,{source:e.slice(l),lineOffset:s}}let n=e.length-Rf;const r=e.indexOf(`
114
+ `,n);n=r===-1?e.length:r+1;const i=kA(e.slice(0,n));return{source:e.slice(n),lineOffset:i}}function mk(e,t){const n=String(e??"");if(!n||!n.includes("$$")&&!n.includes("\\["))return!1;const{source:r}=gk(n,t);if(!r)return!1;const i=r.split(/\r?\n/),o=Math.max(0,i.length-Md-2),l=[["$$","$$"],["\\[","\\]"]];for(let s=o;s<i.length;s++){const a=Hs(i[s]);if(a&&!pk(a)){for(const[u,c]of l)if(Uh(a,u,c)!==-1)return!0}}return!1}function OE(e,t){const n=String(e??"");if(!n||!n.includes("$$")&&!n.includes("\\["))return null;const{source:r,lineOffset:i}=gk(n,t);if(!r)return null;const o=r.split(/\r?\n/),l=Math.max(0,o.length-Md-2),s=[["$$","$$"],["\\[","\\]"]];for(let a=l;a<o.length-1;a++){const u=Hs(o[a]);for(const[c,p]of s){const d=Uh(u,c,p);if(d===-1)continue;let f="",g=!1;for(let m=a+1;m<o.length;m++){if(m-a>Md){g=!0;break}const A=o[m],v=qo(A,p);if(v!==-1){const k=CA(f,A.slice(0,v));if(!Bd(k)){g=!0;break}const C=A.slice(v+p.length),b=C.trim()?`suffix:${bA(C)}`:"nosuffix";return["closed",c,i+a,d,i+m,v,bA(k),b].join(":")}if(pk(A)){g=!0;break}if(f=CA(f,A),f.length>ck){g=!0;break}}if(!g&&Bd(f))return["pending",c,i+a,d].join(":")}}return null}function Lf(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function PE(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const r=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(r)?!1:r===""||/^[)\s,.!?;:]/.test(r)}function Of(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function Ak(e,t){vE(e);const n=(l,s,a)=>{const u=String(s??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=l.push("paragraph_open","p",1);c.map=[a,a+1];const p=l.push("inline","",0);p.content=u,p.map=[a,a+1],p.children=[],l.push("paragraph_close","p",-1)},r=(l,s)=>{var T,M;const a=l,u=!!(t!=null&&t.strictDelimiters),c=!((T=a==null?void 0:a.env)!=null&&T.__markstreamFinal),p=(E,$)=>{let X=$;for(;X<E.length&&(E[X]===" "||E[X]===" ");)X++;if(X===$||!(E[X]===`
115
+ `||E[X]==="\r"&&E[X+1]===`
116
+ `))return $;const K=E.slice($,X),I=a.push("text","",0);return I.content=K,X};if(/^\*[^*]+/.test(a.src))return!1;const d=String(a.pending??""),f=Math.max(0,a.pos-d.length),g=TE(a);if(!BE(g.mathOpenerPositions,f))return!1;if(a.src[a.pos]==="$"){let E=a.pos+1;for(;a.src[E]==="$";)E++;const $=E-a.pos,X=a.src[E];if($>=3&&(!X||/\s/.test(X))){const K=a.push("text","",0);return K.content=a.src.slice(a.pos,E),a.pos=E,!0}}const m=[["$$","$$"],["$","$"],["\\(","\\)"]];let A=f,v=f;const k=f,C=a.src,{codeSpanRanges:b,imageRanges:S}=g;for(const[E,$]of m){let X=!1;E==="$$"&&A!==k&&(A=k);let K=-1,I=-1,B=0;const P=_=>{if((_==="undefined"||_==null)&&(_=""),_==="\\"){a.pos=a.pos+_.length,A=a.pos;return}if(_==="\\)"||_==="\\("){const N=a.push("text_special","",0);N.content=_==="\\)"?")":"(",N.markup=_,a.pos=a.pos+_.length,A=a.pos;return}if(!_)return;if(E==="$$"&&_.includes("$")){let N=0;for(;N<_.length;){const R=Td(_,N);if(R===-1){const ce=_.slice(N);if(ce){const Ce=a.push("text","",0);Ce.content=ce,a.pos=a.pos+ce.length,A=a.pos}break}if(R>0&&_[R-1]==="$"||R+1<_.length&&_[R+1]==="$"){const ce=_.slice(N,R+1);if(ce){const Ce=a.push("text","",0);Ce.content=ce,a.pos=a.pos+ce.length,A=a.pos}N=R+1;continue}const oe=_.slice(N,R);if(oe){const ce=a.push("text","",0);ce.content=oe,a.pos=a.pos+oe.length,A=a.pos}const ne=Nf(_,R+1);if(ne===-1){const ce=_.slice(R),Ce=a.push("text","",0);Ce.content=ce,a.pos=a.pos+ce.length,A=a.pos;break}const ee=_.slice(R+1,ne),ie=ee.includes("`"),G=!ee||!ee.trim(),Q=_[ne+1],te=Lf(ee,Q),re=Of(ee);if(!ie&&!G&&!te&&!re){const ce=a.push("math_inline","math",0);ce.content=zr(ee,t),ce.markup="$",ce.raw=`$${ee}$`,ce.loading=!1,a.pos=a.pos+(ne-R+1),A=a.pos,N=ne+1;continue}const pe=a.push("text","",0);pe.content="$",a.pos=a.pos+1,A=a.pos,N=R+1}return}const W=_.indexOf("![");if(W!==-1){if(W>0){const oe=_.slice(0,W),ne=a.push("text","",0);ne.content=oe,a.pos=a.pos+oe.length,A=a.pos}const N=_.slice(W).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(N){const[,oe,ne]=N,ee=ne.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),ie=ee?ee[1]:ne,G=ee&&ee[2]?ee[2]:null,Q=a.push("image","img",0);Q.attrs=[["src",ie],["alt",oe]],G&&Q.attrs.push(["title",G]),Q.content=oe,Q.children=[{type:"text",content:oe,tag:""}],a.pos=a.pos+N[0].length,A=a.pos;const te=_.slice(W+N[0].length);te&&P(te);return}const R=a.push("text","",0);R.content=_,a.pos=a.pos+_.length,A=a.pos;return}const z=a.push("text","",0);z.content=_,a.pos=a.pos+_.length,A=a.pos};for(;!(A>=C.length);){const _=C.indexOf(E,A);if(_===-1)break;if(qs(C,_)){A=_+Math.max(1,E.length);continue}const W=Iu(b,_);if(W){A=W[1];continue}const z=Iu(S,_);if(z){A=z[1];continue}if(_===K&&A===I){if(B++,B>2){A=_+Math.max(1,E.length);continue}}else B=0,K=_,I=A;if(E==="("&&_>0){let te=_-1;for(;te>=0&&C[te]===" ";)te--;if(te>=0&&C[te]==="]"){A=_+E.length;continue}}if(E==="$"&&_>0&&C[_-1]==="$"){A=_+1;continue}if(E==="$"&&_<C.length-1&&C[_+1]==="$"){A=_+2;continue}const N=E==="$"?Nf(C,_+E.length):oE(C,_+E.length,E,$);if(N===-1){const te=C.slice(_+E.length);if(te.includes(E)){A=C.indexOf(E,_+E.length);continue}if(N===-1){const re=E==="$"&&PE(te);if(c&&!u&&!re&&Qr(te)&&!te.includes("`")){if(A=_+E.length,X=!0,!s){a.pending="";const pe=v?C.slice(v,A):C.slice(0,A),ce=pA(pe)%2===1;if(v)P(C.slice(v,A));else{let Ce=C.slice(0,A);Ce.endsWith(E)&&(Ce=Ce.slice(0,Ce.length-E.length)),P(Ce)}if(ce){const Ce=((M=gA(pe))==null?void 0:M.marker)??"**",ze=a.push("strong_open","",0);ze.markup=Ce;const Ne=a.push("math_inline","math",0);Ne.content=zr(te,t),Ne.markup=E==="$$"?"$$":E==="\\("?"\\(\\)":E==="$"?"$":"()",Ne.raw=`${E}${te}${$}`,Ne.loading=!0,ze.content=te,a.push("strong_close","",0)}else{const Ce=a.push("math_inline","math",0);Ce.content=zr(te,t),Ce.markup=E==="$$"?"$$":E==="\\("?"\\(\\)":E==="$"?"$":"()",Ce.raw=`${E}${te}${$}`,Ce.loading=!0}a.pos=C.length}A=C.length,v=A}break}}const R=C.slice(_+E.length,N),oe=R.includes("`"),ne=!R||!R.trim(),ee=E==="$",ie=C[N+$.length],G=ee&&Lf(R,ie),Q=ee&&Of(R);if(u?oe||ne||G||Q:oe||ne||G||Q||!ee&&!Qr(R)){A=N+$.length;const te=C.slice(a.pos,A);a.pending||(P(te),v=A);continue}if(X=!0,!s){const te=C.slice(a.pos-(a.pending??"").length,_);let re=C.slice(0,A)?C.slice(v,_):te;const pe=pA(re)%2===1;_!==a.pos&&pe&&(re=a.pending+C.slice(a.pos,_));const ce=pe?gA(re):null,Ce=(ce==null?void 0:ce.marker)??"**";if(a.pending!==re)if(a.pending="",pe)if(ce){const ze=re.slice(ce.index+Ce.length);P(re.slice(0,ce.index));const Ne=a.push("strong_open","",0);Ne.markup=Ce;const Ze=a.push("text","",0);Ze.content=ze,a.push("strong_close","",0)}else P(re);else P(re);if(pe){const ze=a.push("strong_open","",0);ze.markup=Ce;const Ne=a.push("math_inline","math",0);Ne.content=zr(R,t),Ne.markup=E==="$$"?"$$":E==="\\("?"\\(\\)":E==="$"?"$":"()",Ne.raw=`${E}${R}${$}`,Ne.loading=!1;const Ze=C.slice(N+$.length).startsWith(Ce);return Ze&&a.push("strong_close","",0),a.pos=p(C,N+$.length),A=a.pos,v=A,Ze||a.push("strong_close","",0),!0}else{const ze=a.push("math_inline","math",0);ze.content=zr(R,t),ze.markup=E==="$$"?"$$":E==="\\("?"\\(\\)":E==="$"?"$":"()",ze.raw=`${E}${R}${$}`,ze.loading=!1}}return A=p(C,N+$.length),v=A,a.pos=A,!0}if(X){if(s)a.pos=A;else{if(E==="$$"&&A<C.length&&C.slice(A).includes("$")){let _=A;for(;!(_>=C.length);){const W=Td(C,_);if(W===-1)break;if(W+1<C.length&&C[W+1]==="$"){_=W+2;continue}if(W>0&&C[W-1]==="$"){_=W+1;continue}const z=Nf(C,W+1);if(z===-1)break;const N=C.slice(W+1,z),R=N.includes("`"),oe=!N||!N.trim(),ne=C[z+1],ee=Lf(N,ne),ie=Of(N);if(!R&&!oe&&!ee&&!ie){const G=C.slice(A,W);G&&P(G);const Q=a.push("math_inline","math",0);Q.content=zr(N,t),Q.markup="$",Q.raw=`$${N}$`,Q.loading=!1,A=z+1,_=z+1}else P("$"),_=W+1}_<C.length&&P(C.slice(_))}else A<C.length&&P(C.slice(A));a.pos=C.length}return!0}}return!1},i=(l,s,a,u)=>{var ne;const c=l,p=!((ne=c==null?void 0:c.env)!=null&&ne.__markstreamFinal),d=t==null?void 0:t.strictDelimiters,f=d?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],g=c.bMarks[s]+c.tShift[s];let m=c.src.slice(g,c.eMarks[s]).trim(),A=!1,v="",k="",C=!1,b="",S=!1;for(const[ee,ie]of f)if(m.startsWith(ee))if(ee.includes("[")){const G=ee==="\\["?m.slice(ee.length):"";if(ee==="\\["&&qo(G,ie)===-1&&!/^\s*!\[/.test(G)&&!G.includes("`")&&Qr(G)){A=!0,v=ee,k=ie;break}if(t!=null&&t.strictDelimiters){if(m.replace("\\","")==="["){if(s+1<a){A=!0,v=ee,k=ie;break}continue}}else if(m.replace("\\","")==="["){if(s+1<a){A=!0,v=ee,k=ie;break}continue}else{const Q=c.tokens[c.tokens.length-1];if(Q&&Q.type==="list_item_open"&&Q.mark==="-"&&m.slice(ee.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const te=m.indexOf("]");if(m.slice(te).trim()!=="]")continue;const re=m.slice(ee.length,te);if(ee==="["?mA(re):Qr(re)){A=!0,v=ee,k=ie;break}continue}}}else{A=!0,v=ee,k=ie;break}else if((ee==="$$"||ee==="\\[")&&m.endsWith(ee)&&s+1<a){const G=Uh(m,ee,ie);if(G===-1)continue;b=Hs(m.slice(0,G)),S=!0;const Q=c.bMarks[s+1]+c.tShift[s+1];m=c.src.slice(Q,c.eMarks[s+1]).trim(),C=!0,A=!0,v=ee,k=ie;break}if(!A)return!1;if(u&&!S)return!0;const T=m.indexOf(v),M=T+v.length,E=!d&&v==="["?m.indexOf("\\]",M):-1,$=E>=0?"\\]":k,X=E>=0?E:qo(m,k,M);if(!C&&X>v.length){const ee=m.slice(T+v.length,X),ie=c.push("math_block","math",0);ie.content=zr(ee),ie.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",ie.map=[s,s+1],ie.raw=`${v}${ee}${$}`,ie.block=!0,ie.loading=!1,c.line=s+1;const G=m.slice(X+$.length);return G.trim()&&n(c,G,s),!0}let K=s,I="",B=!1,P="",_=s;const W=C?m:m===v?"":m.slice(v.length),z=!d&&v==="\\["?"]":"",N=qo(W,k);if(N!==-1){const ee=N;I=W.slice(0,ee),P=W.slice(ee+k.length),_=C?s+1:s,B=!0,K=_}else for(W&&!C&&(I=W),K=s+1;K<a;K++){const ee=c.bMarks[K]+c.tShift[K],ie=c.eMarks[K],G=c.src.slice(ee,ie),Q=G.trim();if(!d&&v==="["&&Q==="\\]"){k="\\]",B=!0;break}if(z&&G.trim()===z){k=z,B=!0;break}if(Q===k){B=!0;break}else if(!d&&v==="["&&G.includes("\\]")){B=!0;const te=G.indexOf("\\]");k="\\]";const re=G.slice(0,te);re&&(I+=(I?`
117
+ `:"")+re),P=G.slice(te+k.length),_=K;break}else if(qo(G,k)!==-1){B=!0;const te=qo(G,k),re=G.slice(0,te);re&&(I+=(I?`
118
+ `:"")+re),P=G.slice(te+k.length),_=K;break}I+=(I?`
119
+ `:"")+G}if((!p||d)&&!B)return!1;const R=/^\s*!\[/.test(I);if(!(S?!R&&Bd(I):v==="$$"?!R:v==="["?mA(I):Qr(I)))return!1;if(u)return!0;b&&n(c,b,s);const oe=c.push("math_block","math",0);return oe.content=zr(I),oe.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",oe.raw=`${v}${I}${I.startsWith(`
120
+ `)?`
121
+ `:""}${k}`,oe.map=[s,K+1],oe.block=!0,oe.loading=!B,c.line=K+1,P.trim()&&n(c,P,_),!0},o=(l,s,a,u)=>{const c=l,p=c.bMarks[s]+c.tShift[s],d=c.src.slice(p,c.eMarks[s]).trim();return!d.startsWith("$$")&&!d.startsWith("\\[")?!1:i(l,s,a,u)};e.inline.ruler.before("escape","math",r),e.block.ruler.before("lheading","explicit_math_block",o,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",i,{alt:["paragraph","reference","blockquote","list"]})}function $E(e){const t=e.renderer.rules.image||function(n,r,i,o,l){const s=n,a=l;return a.renderToken?a.renderToken(s,r,i):""};e.renderer.rules.image=(n,r,i,o,l)=>{var a,u;const s=n;return(u=(a=s[r]).attrSet)==null||u.call(a,"loading","lazy"),t(s,r,i,o,l)},e.renderer.rules.fence=e.renderer.rules.fence||((n,r)=>{const i=n[r],o=String(i.info??"").trim();return`<pre class="${o?`language-${e.utils.escapeHtml(o.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(i.content??""))}</code></pre>`})}const HE=/^<a[>\s]/i,WE=/^<\/a\s*>/i,xA=/[@:]|\/\/|\.\S/;function KE(e,t){var i,o;if((e==null?void 0:e.type)!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let r=0;for(let l=n.length-1;l>=0;l--){const s=n[l];if((s==null?void 0:s.type)==="link_close"){for(l--;l>=0&&((i=n[l])==null?void 0:i.level)!==s.level&&((o=n[l])==null?void 0:o.type)!=="link_open";)l--;continue}if((s==null?void 0:s.type)==="html_inline"){const a=String(s.content??"");HE.test(a)&&r>0&&r--,WE.test(a)&&r++}if(!(r>0)&&(s==null?void 0:s.type)==="text"&&t.test(String(s.content??"")))return!0}return!1}function jE(e){var u,c,p;const t=(u=e.core)==null?void 0:u.ruler,n=(p=(c=t.getNamedRules)==null?void 0:c.call(t).find(d=>d.name==="linkify"))==null?void 0:p.fn;if(typeof n!="function")return;const r=e.options.linkify?e.linkify:void 0,i=r==null?void 0:r.test,o=r==null?void 0:r.match,l=(r==null?void 0:r.re)&&Object.getPrototypeOf(r.re);let s,a=!1;t.at("linkify",d=>{var b,S,T;if(!((S=(b=d.md)==null?void 0:b.options)!=null&&S.linkify))return;const f=Array.isArray(d.tokens)?d.tokens:[],g=d.md.linkify;if(!g||!f.some(M=>(M==null?void 0:M.type)==="inline"))return;const m=g.re,A=m&&Object.getPrototypeOf(m)===l&&!Object.values(m).some(M=>typeof M=="function"),v=g.test===i&&g.match===o;if(v&&A&&s!==m.cache){s=m.cache;const{schema_names:M=[],tlds:E=[]}=m.opts;a=M.every($=>$==="//"||$.endsWith(":"))&&E.every($=>/^[\p{L}\p{N}-]+$/u.test($))}let k=!!v&&!!A&&a&&(((T=d.env)==null?void 0:T.__markstreamFinal)!==!1||!!(m!=null&&m.cache.link_fuzzy_search));const C=f.filter(M=>{if(k&&(M==null?void 0:M.type)==="inline"){const E=M.children;if(Array.isArray(E)&&E.length>0){if(!E.some($=>($==null?void 0:$.type)==="text"&&xA.test(String($.content??""))))return!1}else if(!xA.test(String(M.content??"")))return!1;k=!1}return KE(M,g)});if(C.length)return n(Object.assign(Object.create(Object.getPrototypeOf(d)),d,{tokens:C}))})}function zE(e){var s,a,u;const t=e.inline.ruler,n=(s=t.getNamedRules)==null?void 0:s.call(t),r=(a=n==null?void 0:n.find(c=>c.name==="link"))==null?void 0:a.fn,i=(u=n==null?void 0:n.find(c=>c.name==="image"))==null?void 0:u.fn;if(typeof r!="function"||typeof i!="function")return;const o=e.validateLink,l=e;l.__markstreamOriginalValidateLink=o,t.at("link",(...c)=>{var g;const p=c[0].md,d=(p==null?void 0:p.validateLink)===o?(g=p.options)==null?void 0:g.validateLink:p==null?void 0:p.validateLink;if(!p||typeof d!="function")return r(...c);const f=p.validateLink;p.validateLink=d;try{return r(...c)}finally{p.validateLink=f}}),t.at("image",(...c)=>{const p=c[0].md;if(!p)return i(...c);const d=p.validateLink;p.validateLink=o;try{return i(...c)}finally{p.validateLink=d}})}function GE(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},r=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,i=Object.prototype.hasOwnProperty.call(t,"validateLink"),o={stream:r,...n},l=new DS({html:!0,linkify:!0,typographer:!0,...t,experimental:o}),s="streamTailLocalPostBlockRules";if(!(Object.prototype.hasOwnProperty.call(t,s)||Object.prototype.hasOwnProperty.call(n,s))&&Object.prototype.hasOwnProperty.call(l.options,s)&&(l.options[s]=!0),!i){const a=u=>!Ei(u,{tagName:"a",attrName:"href"});HI(a),l.set({validateLink:a})}return zE(l),jE(l),(e.cjkFriendly??!0)&&l.use(Ex),(e.enableMath??!0)&&Ak(l,{...NS()??{},...e.mathOptions??{}}),(e.enableContainers??!0)&&Kv(l),e.enableFixIndentedCodeBlock!==!1&&uI(l),zI(l),YI(l),QI(l),XI(l),$E(l),sI(l,{customHtmlTags:e.customHtmlTags}),l}const Xl=new Map;function gl(e,t){const n=t?`${e}:::${t}`:e;let r=Xl.get(n);if(!r&&(r=new RegExp(e,t),Xl.set(n,r),Xl.size>200)){const i=Array.from(Xl.keys()).slice(0,50);for(const o of i)Xl.delete(o)}return r.lastIndex=0,r}const QE=/\S/,UE=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i,YE=/<\/html>\s*$/i,ZE=/^<\s*[!?]/,VE=/^([A-Z][\w:-]*)/i,wA=/\/\s*>$/;function JE(e){const t=e.search(QE);if(t===-1||e.charCodeAt(t)!==60)return null;const n=e.trim();if(!n)return null;const r=UE.test(n),i=YE.test(n);return!r||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function gs(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function XE(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return gl(String.raw`^\s*<\s*\/\s*${Rr(t)}\s*>\s*$`,"i").test(n)}const Pf=new Set(["iframe","script","style","textarea","title"]);function ml(e,t,n){var d,f;if(!e||!t)return null;const r=t.toLowerCase(),i=g=>{if(e.startsWith("<!--",g)){const S=e.indexOf("-->",g+4);return{closing:!1,end:S===-1?e.length:S+3,selfClosing:!1,tag:""}}if(e.startsWith("<![CDATA[",g)){const S=e.indexOf("]]>",g+9);return{closing:!1,end:S===-1?e.length:S+3,selfClosing:!1,tag:""}}const m=Xt(e,g);if(m===-1)return null;const A=m+1,v=e.slice(g,A);if(ZE.test(v))return{closing:!1,end:A,selfClosing:!1,tag:""};let k=v.slice(1).trimStart();const C=k.startsWith("/");C&&(k=k.slice(1).trimStart());const b=k.match(VE);return b!=null&&b[1]?{closing:C,end:A,selfClosing:wA.test(v),tag:b[1].toLowerCase()}:{closing:!1,end:g+1,selfClosing:!1,tag:""}},o=(g,m)=>{const A=gl(String.raw`<\s*\/\s*${Rr(g)}(?=\s|>)`,"gi");A.lastIndex=m;const v=A.exec(e);if(!v||v.index==null)return null;const k=i(v.index);return k?{start:v.index,end:k.end}:null};let l=-1,s=-1,a=Math.max(0,n);for(;a<e.length;){const g=e.indexOf("<",a);if(g===-1)return null;const m=i(g);if(!m)return null;if(!m.closing&&m.tag===r){l=g,s=m.end-1;break}if(!m.closing&&Pf.has(m.tag)){a=((d=o(m.tag,m.end))==null?void 0:d.end)??e.length;continue}a=m.end}if(l===-1||s===-1)return null;const u=e.slice(l,s+1);if(qr.has(r)||wA.test(u))return{raw:u,start:l,end:s+1,closed:!0};if(Pf.has(r)){const g=o(r,s+1);return g?{raw:e.slice(l,g.end),start:l,end:g.end,closeStart:g.start,closed:!0}:{raw:e.slice(l),start:l,end:e.length,closed:!1}}let c=1,p=s+1;for(;p<e.length;){const g=e.indexOf("<",p);if(g===-1)return{raw:e.slice(l),start:l,end:e.length,closed:!1};const m=i(g);if(!m)return null;if(m.closing&&m.tag===r){c--;const A=m.end;if(c===0)return{raw:e.slice(l,A),start:l,end:A,closeStart:g,closed:!0};p=A;continue}if(!m.closing&&m.tag===r){!m.selfClosing&&!qr.has(m.tag)&&c++,p=m.end;continue}if(!m.closing&&Pf.has(m.tag)){p=((f=o(m.tag,m.end))==null?void 0:f.end)??e.length;continue}p=m.end}return{raw:e.slice(l),start:l,end:e.length,closed:!1}}function qE(e,t){if(!t)return 0;let n=0,r=0;for(;n<e.length&&r<t.length;){if(e[n]===t[r]){n++,r++;continue}if(e[n]==="\r"||e[n]===`
122
+ `){n++;continue}return-1}return r===t.length?n:-1}function e3(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
123
+ </${t}>`}function _A(e){return e.replace(/\r\n/g,`
124
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function t3(e,t,n){return n?e.includes(n,t)?!0:_A(e.slice(Math.max(0,t))).includes(_A(n)):!1}function n3(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
125
+ `&&n++,n):e[n]===`
126
+ `?n+1:t}function vk(e,t){const n=gl(String.raw`<\s*\/\s*${Rr(t)}(?=\s|>)`,"gi");let r=-1,i;for(;(i=n.exec(e))!==null;)r=i.index;return r}const r3=/^\s*(?:<!--|<!|<\?)/,i3=/^\s*<([A-Z][\w:-]*)/i,kk=/\/\s*>$/,o3=/<[^>]*$/;function l3(e,t,n){const r=t.toLowerCase(),i=gl(String.raw`^<\s*${r}(?=\s|>|/)`,"i"),o=gl(String.raw`^<\s*\/\s*${r}(?=\s|>)`,"i");let l=0,s=Math.max(0,n);for(;s<e.length;){const a=e.indexOf("<",s);if(a===-1)return-1;const u=e.slice(a);if(o.test(u)){const c=Xt(u);if(c===-1)return-1;if(l===0)return a+c+1;l--,s=a+c+1;continue}if(i.test(u)){const c=Xt(u);if(c===-1)return-1;const p=u.slice(0,c+1);kk.test(p)||l++,s=a+c+1;continue}s=a+1}return-1}function yk(e){var c;const t=String(e.content??"");if(r3.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(((c=t.match(i3))==null?void 0:c[1])||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const r=Xt(t),i=r===-1?t:t.slice(0,r+1),o=r!==-1&&kk.test(i),l=qr.has(n),s=Xu(i),a=(r===-1?-1:l3(t,n,r+1))!==-1,u=!(l||o||a);return{type:"html_block",content:u?`${t.replace(o3,"")}
127
+ </${n}>`:t,raw:t,tag:n,attrs:s.length?s:void 0,loading:u}}function Yh(e,t,n){const r=qu(n)?n.sourceLineMapper:void 0;if(!r)return{startLine:e,endLine:t};const i=r(e),o=t>e?r(t-1).endLine:r(t).startLine;return{startLine:i.startLine,endLine:Math.max(i.startLine,o)}}function SA(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let r=0;for(let i=0;i<n;i++)e[i]===`
128
+ `&&r++;return r}function s3(e,t,n){const r=Math.max(0,Math.min(e.length,Math.trunc(t))),i=Math.max(r,Math.min(e.length,Math.trunc(n))),o=SA(e,r);let l=SA(e,i);return i>r&&e[i-1]!==`
129
+ `&&l++,{startLine:o,endLine:l}}function Ws(e,t,n,r){const i=s3(e,t,n);return Yh(i.startLine,i.endLine,r)}function a3(e,t){const n=e==null?void 0:e.map;if(!Array.isArray(n)||n.length<2)return null;const r=Number(n[0]),i=Number(n[1]);return!Number.isFinite(r)||!Number.isFinite(i)?null:Yh(r,i,t)}function dt(e,t,n){if(!(n!=null&&n.includeSourceMap))return e;const r=a3(t,n);if(!r)return e;if(e.sourceMap=r,e.type==="code_block"){const i=e;i.startLine=r.startLine,i.endLine=r.endLine}return e}function u3(e,t,n,r){if(!(r!=null&&r.includeSourceMap))return e;const i=t==null?void 0:t.map;if(!Array.isArray(i)||i.length<2)return e;const o=Number(i[0]),l=Number(i[1]),s=Number(n);return!Number.isFinite(o)||!Number.isFinite(l)||!Number.isFinite(s)||(e.sourceMap=Yh(o,Math.max(l,s),r)),e}function ko(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=>ko(n))),nk(e,t),t}function c3(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ka(e,t,n){for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(!i||!("value"in i))continue;const o=Object.getOwnPropertyDescriptor(t,r);o&&(!("value"in o)||o.writable===!1)||(t[r]=bi(i.value,n))}}function bi(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,r=t.get(n);if(r)return r;if(Array.isArray(e)){const l=[];t.set(n,l);for(const s of e)l.push(bi(s,t));return l}if(e instanceof Map){const l=new Map;t.set(n,l);for(const[s,a]of e)l.set(bi(s,t),bi(a,t));return l}if(e instanceof Set){const l=new Set;t.set(n,l);for(const s of e)l.add(bi(s,t));return l}if(e instanceof Date){const l=new Date(e.getTime());return t.set(n,l),l}if(e instanceof RegExp){const l=new RegExp(e.source,e.flags);return l.lastIndex=e.lastIndex,t.set(n,l),l}if(typeof URL<"u"&&e instanceof URL){const l=new URL(e.href);return t.set(n,l),Ka(n,l,t),l}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const l=new URLSearchParams(e.toString());return t.set(n,l),Ka(n,l,t),l}if(e instanceof Error){let l;const s=e.constructor;try{l=new s(e.message)}catch{l=new Error(e.message)}return Object.setPrototypeOf(l,Object.getPrototypeOf(e)),t.set(n,l),Ka(n,l,t),l}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!c3(e)){const l=Object.create(Object.getPrototypeOf(e));return t.set(n,l),Ka(n,l,t),l}const i={};t.set(n,i);const o=e;for(const l of Object.keys(o))i[l]=bi(o[l],t);return i}function f3(e,t){for(let n=0;n<t.length;n++){const r=Object.getOwnPropertyDescriptor(e,t[n]);if(t[n]==="__proto__"||!r||!("value"in r)||r.writable!==!0||r.configurable!==!0)return!1}return!0}function Zh(e,t=!0){const n=d3(e,t);return nk(e,n),n}function d3(e,t=!0){if(!t)return ko(e);const n=Reflect.ownKeys(e),r=Object.keys(e);if(n.length===r.length&&f3(e,r))try{return h3(e,r,t)}catch{return IA(e,t)}return IA(e,t)}function h3(e,t,n){const r=Object.getPrototypeOf(e),i={},o=new WeakMap,l=e.children,s=e.attrs,a=e.map,u=e;for(let c=0;c<t.length;c++){const p=t[c],d=u[p];if(p==="children"&&Array.isArray(l)){const f=new Array(l.length);for(let g=0;g<l.length;g++)f[g]=Zh(l[g],n);i[p]=f}else if(p==="attrs"&&Array.isArray(s)){const f=new Array(s.length);for(let g=0;g<s.length;g++){const m=s[g];f[g]=[m[0],m[1]]}i[p]=f}else p==="map"&&Array.isArray(a)?i[p]=[a[0],a[1]]:n&&d&&typeof d=="object"?i[p]=bi(d,o):i[p]=d}return Object.setPrototypeOf(i,r),i}function IA(e,t=!0){const n=Object.create(Object.getPrototypeOf(e)),r=new WeakMap;for(const i of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,i);if(!o)continue;if(!("value"in o)){Object.defineProperty(n,i,o);continue}const l=o.value;let s=l;i==="attrs"&&Array.isArray(l)?s=l.map(a=>[...a]):i==="map"&&Array.isArray(l)?s=[...l]:i==="children"&&Array.isArray(l)?s=l.map(a=>Zh(a,t)):t&&l&&typeof l=="object"&&(s=bi(l,r)),Object.defineProperty(n,i,{...o,value:s})}return n}function EA(e,t=!0){return e.map(n=>Zh(n,t))}function Dr(e,t){let n=t-1,r=0;for(;n>=0&&e[n]==="\\";)r++,n--;return r%2===1}function Fd(e){return e===" "||e===" "}function Ck(e,t){return t===" "?e+1:e+4-e%4}function Vh(e){let t=0,n=0;for(;t<e.length&&Fd(e[t]);)n=Ck(n,e[t]),t++;return{index:t,column:n}}function kl(e){const t=Vh(e);return t.column>3?null:t}function $f(e){const t=kl(e);if(!t)return null;const n=t.index,r=e[n];if(r!=="`"&&r!=="~")return null;let i=n;for(;i<e.length&&e[i]===r;)i++;const o=i-n;if(o<3)return null;const l=e.slice(i);return r==="`"&&l.includes("`")?null:{markerChar:r,markerLen:o,rest:l}}function Jh(e){var l;const t=kl(e);if(!t)return null;const n=e.slice(t.index),r=(l=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n))==null?void 0:l[0];if(!r)return null;let i=t.index+r.length,o=t.column+r.length;if(!Fd(e[i]))return null;for(;i<e.length&&Fd(e[i]);)o=Ck(o,e[i]),i++;return{content:e.slice(i),contentIndent:o}}function Xh(e){let t=e,n=!1;for(;;){const r=kl(t);if(!r)return n?t:null;let i=r.index;if(t[i]!==">")return n?t:null;n=!0,i++,(t[i]===" "||t[i]===" ")&&i++,t=t.slice(i)}}function qh(e){const t=$f(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=Xh(e),r=n==null?null:$f(n);if(r)return{...r,inBlockquote:!0,inList:!1,listIndent:0};const i=Jh(e);if(!i)return null;const o=$f(i.content);return o==null?null:{...o,inBlockquote:!1,inList:!0,listIndent:i.contentIndent}}function ep(e,t,n){let r=t;for(;r<e.length&&e[r]===n;)r++;return r-t}function bk(e,t,n){let r=t;for(;r<e.length;){const i=e.indexOf("`",r);if(i===-1)return-1;const o=ep(e,i,"`");if(o===n)return i;r=i+o}return-1}const p3=["$","\\["],g3=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/;function m3(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function ms(e){return{...e}}function A3(e,t,n,r=ec(t).state,i={lineOffset:0,windowStart:0}){e.tolerantMathBoundary={explicitBracketMath:r,source:t,key:n,pendingCandidate:n===null&&mk(t,i),scanWindow:i}}function v3(e){return e.endsWith("$")||e.endsWith("\\")}function k3(e){const t=Math.max(e.lastIndexOf(`
130
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return p3.some(r=>n.endsWith(r))}function y3(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||k3(e)&&/[\r\n]/.test(t)):!1}function xk(e,t){let n=!1,r="",i=0,o=!1,l=!1,s=0,a=null,u=0;for(;u<t;){const c=e.indexOf(`
131
+ `,u),p=c===-1||c>=t?t:c,d=e.slice(u,p),f=d.endsWith("\r")?d.slice(0,-1):d,g=Vh(f),m=Jh(f);n&&o&&f.trim()&&Xh(f)==null&&(n=!1,r="",i=0,o=!1,l=!1,s=0),n&&l&&f.trim()&&g.column<s&&!m&&(n=!1,r="",i=0,o=!1,l=!1,s=0),m?a=m.contentIndent:f.trim()&&a!=null&&g.column<a&&!n&&(a=null);const A=qh(f);if(A&&(n?A.markerChar===r&&A.markerLen>=i&&/^\s*$/.test(A.rest)&&(n=!1,r="",i=0,o=!1,l=!1,s=0):(n=!0,r=A.markerChar,i=A.markerLen,o=A.inBlockquote,l=A.inList||a!=null&&!A.inBlockquote&&g.column>=a,s=A.listIndent||a||0)),c===-1||c>=t)break;u=c+1}return n}function C3(e,t){const n=p=>p===" "||p===" ",r=p=>{const d=p.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||p==="_"||p==="-"||p===":"},i=p=>{if(p[0]!=="<")return null;let d=1;for(;d<p.length&&n(p[d]);)d++;const f=p[d]==="/";if(f)for(d++;d<p.length&&n(p[d]);)d++;const g=d;for(;d<p.length&&r(p[d]);)d++;if(d===g)return null;const m=p.slice(g,d).toLowerCase();if(!Dh.has(m))return null;const A=p[d];if(A&&A!==" "&&A!==" "&&A!==">"&&A!=="/")return null;const v=Xt(p);if(v===-1)return null;let k=v-1;for(;k>=0&&n(p[k]);)k--;return{closing:f,tag:m,selfClosing:!f&&p[k]==="/",after:p.slice(v+1)}},o=(p,d)=>{const f=p.toLowerCase();let g=0;for(;g<f.length;){const m=f.indexOf("</",g);if(m===-1)return!1;for(g=m+2;g<f.length&&n(f[g]);)g++;if(f.startsWith(d,g)){const A=f[g+d.length];if(!A||A===" "||A===" "||A===">")return!0}}return!1},l=[];let s=!1,a=!1,u=!1,c=0;for(;c<t;){const p=e.indexOf(`
132
+ `,c),d=p===-1||p>=t?t:p,f=e.slice(c,d),g=f.endsWith("\r")?f.slice(0,-1):f,m=kl(g);if(m){const A=g.slice(m.index);if(s)s=!A.includes("-->");else if(a)a=!A.includes(">");else if(u)u=!A.includes("?>");else if(A.startsWith("<!--"))s=!A.includes("-->");else if(A.startsWith("<?"))u=!A.includes("?>");else if(A.startsWith("<!"))a=!A.includes(">");else{const v=i(A);if(v)if(v.closing){for(let k=l.length-1;k>=0;k--)if(l[k]===v.tag){l.length=k;break}}else v.selfClosing||o(v.after,v.tag)||l.push(v.tag)}}if(p===-1||p>=t)break;c=p+1}return s||a||u||l.length>0}function b3(e,t,n){if(!(n!=null&&n.length))return!1;const r=new Set(Pi(n));if(!r.size)return!1;const i=c=>{const p=c.charCodeAt(0);return p>=65&&p<=90||p>=97&&p<=122||p>=48&&p<=57||c==="_"||c==="-"||c===":"},o=c=>c===" "||c===" ",l=c=>{if(c[0]!=="<")return null;let p=1;for(;p<c.length&&o(c[p]);)p++;const d=c[p]==="/";if(d)for(p++;p<c.length&&o(c[p]);)p++;const f=p;for(;p<c.length&&i(c[p]);)p++;if(p===f)return null;const g=c.slice(f,p).toLowerCase();if(!r.has(g))return null;const m=c[p];if(m&&m!==" "&&m!==" "&&m!==">"&&m!=="/")return null;const A=c.indexOf(">",p);if(A===-1)return null;let v=A-1;for(;v>=0&&o(c[v]);)v--;return{closing:d,tag:g,selfClosing:!d&&c[v]==="/",after:c.slice(A+1)}},s=(c,p)=>{const d=c.toLowerCase();let f=0;for(;f<d.length;){const g=d.indexOf("</",f);if(g===-1)return!1;for(f=g+2;f<d.length&&o(d[f]);)f++;if(d.startsWith(p,f)){const m=d[f+p.length];if(!m||m===" "||m===" "||m===">")return!0}}return!1},a=[];let u=0;for(;u<t;){const c=e.indexOf(`
133
+ `,u),p=c===-1||c>=t?t:c,d=e.slice(u,p),f=d.endsWith("\r")?d.slice(0,-1):d,g=kl(f);if(g){const m=l(f.slice(g.index));if(m)if(m.closing){for(let A=a.length-1;A>=0;A--)if(a[A]===m.tag){a.length=A;break}}else m.selfClosing||s(m.after,m.tag)||a.push(m.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function x3(e,t){const n=g3.exec(e);if(!n)return null;const r=n[1]??"",i=n.index+r.length,o=e.indexOf(`
134
+ `,i),l=e.slice(i,o===-1?e.length:o);return!kl(l.endsWith("\r")?l.slice(0,-1):l)||xk(e,i)||C3(e,i)||b3(e,i,t)?null:`${e.slice(0,n.index)}${r}`}function Hf(e){e.inFence=!1,e.fenceChar="",e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function MA(e,t,n,r,i){let o=0,l=!1;for(;o<e.length;){const s=o;if(t.inMath){if(e.startsWith("\\]",o)&&!Dr(e,s)){r!=null&&i&&n+o+2>r&&(l=!0),t.inMath=!1,t.mathOpenOffset=null,o+=2;continue}o++;continue}if(t.inDollarMath){if(e.startsWith("$$",o)&&!Dr(e,s)){r!=null&&i&&n+o+2>r&&(l=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,o+=2;continue}o++;continue}if(e[o]==="`"&&!Dr(e,s)){const a=ep(e,o,"`"),u=bk(e,o+a,a);if(u===-1)break;o=u+a;continue}if(e.startsWith("\\[",o)&&!Dr(e,s)){t.inMath=!0,t.mathOpenOffset=n+o,o+=2;continue}if(e.startsWith("$$",o)&&!Dr(e,s)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+o,o+=2;continue}o++}return l}function w3(e,t,n=!0){const r=t.markdownIt;if(!Gh(r))return e;const i=n?t.pendingExplicitMathTail:void 0,o=(i==null?void 0:i.source)===e?i.state:i&&t.sourceExtends(i.source,e)?wk(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:ec(e).state;n&&(t.pendingExplicitMathTail={source:e,state:o});const{context:l}=o,s=l.inMath?l.mathOpenOffset:l.inDollarMath?l.dollarMathOpenOffset:null;if(s==null)return e;const a=e.slice(s+2),u=e.lastIndexOf(`
135
+ `,s-1)+1;if(e.slice(u,s).trim()!==""&&!/^\r?\n/.test(a)||/^\s*!\[/.test(a))return e;const c=a.trim(),p=/^(?:[a-z]|pi)$/i.test(c);return Qr(a)&&!p?e:e.slice(0,s)}function _3(e,t,n,r,i){const o=Vh(e),l=Jh(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&Xh(e)==null&&Hf(t),t.inFence&&t.fenceInList&&e.trim()&&o.column<t.fenceListIndent&&!l&&Hf(t),l?t.listContentIndent=l.contentIndent:e.trim()&&t.listContentIndent!=null&&o.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){const s=qh(e);if(s)t.inFence?s.markerChar===t.fenceChar&&s.markerLen>=t.fenceLen&&/^\s*$/.test(s.rest)&&Hf(t):(t.inFence=!0,t.fenceChar=s.markerChar,t.fenceLen=s.markerLen,t.fenceInBlockquote=s.inBlockquote,t.fenceInList=s.inList||t.listContentIndent!=null&&!s.inBlockquote&&o.column>=t.listContentIndent,t.fenceListIndent=s.listIndent||t.listContentIndent||0);else if(!t.inFence)return MA(e,t,n,r,i)}else return MA(e,t,n,r,i);return!1}function ec(e,t=m3(),n=null,r=!1,i=0){const o=ms(t);let l=ms(t),s="",a=!1,u=0;for(;u<e.length;){const c=e.indexOf(`
136
+ `,u),p=c!==-1,d=p&&c>u&&e[c-1]==="\r"?c-1:p?c:e.length,f=e.slice(u,d);_3(f,o,i+u,n,r)&&(a=!0),p?(l=ms(o),s=""):s=f,u=p?c+1:e.length}return{closedOpenMath:a,state:{committedContext:l,context:o,lineBuffer:s}}}function wk(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:ms(e.committedContext),context:ms(e.context),lineBuffer:e.lineBuffer+t}}:ec(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function S3(e,t){var p;const n=e.markdownIt;if(!Gh(n)||typeof((p=n.stream)==null?void 0:p.reset)!="function")return;const r=e.tolerantMathBoundary;if((r==null?void 0:r.source)===t)return;const i=r?e.sourceExtends(r.source,t):!1,o=i&&r?t.slice(r.source.length):"",l=i&&r?wk(r.explicitBracketMath,o,r.source.length-r.explicitBracketMath.lineBuffer.length):ec(t),s=l.state,a=i&&r?l.closedOpenMath:!1;if(r&&i&&r.key===null&&r.pendingCandidate===!1&&!a&&!y3(r.source,o)&&!v3(t)){r.source=t,r.explicitBracketMath=s;return}const u=i&&r?r.scanWindow:{lineOffset:0,windowStart:0},c=OE(t,u);(r&&(r&&!i||r.key!==c||a)||!r&&c)&&e.resetStreamOnly(),A3(e,t,c,s,u)}function I3(e){const t=e.tolerantMathBoundary;return typeof(t==null?void 0:t.key)=="string"&&t.key.startsWith("pending:")}function E3(e){let t=!1,n="",r=0,i=!1,o=!1,l=!1,s=0;const a=(c,p)=>{const d=qh(c);if(d){t?d.markerChar===n&&d.markerLen>=r&&/^\s*$/.test(d.rest)&&(t=!1,n="",r=0):(t=!0,n=d.markerChar,r=d.markerLen);return}if(t)return;let f=0;for(;f<c.length;){if(i){c.startsWith("$$",f)&&!Dr(c,f)?(i=!1,f+=2):f++;continue}if(o){c.startsWith("\\]",f)&&!Dr(c,f)?(o=!1,f+=2):f++;continue}const g=c[f];if(g==="`"){const m=ep(c,f,"`"),A=bk(c,f+m,m);if(A===-1)break;f=A+m;continue}if(g==="\\"){const m=c[f+1];m==="["&&!Dr(c,f)?(o=!0,f+=2):(m==="]"&&Dr(c,f),f+=2);continue}if(g==="$"){if(c[f+1]==="$"&&!Dr(c,f)){i=!0,l=!1,f+=2;continue}if(l){l=!1,f++;continue}const m=c[f+1];(m===void 0||m!==" "&&m!==" "&&!/\d/.test(m))&&(l=!0),f++;continue}f++}};return{scanTo:c=>{for(;s<c;){const p=e.indexOf(`
137
+ `,s),d=p===-1||p>=c?c:p,f=d>s&&e[d-1]==="\r"?d-1:d;if(a(e.slice(s,f)),p===-1||p>=c){s=c;break}l=!1,s=p+1}},inMath:()=>i||o||l}}function TA(){return typeof performance<"u"?performance.now():Date.now()}function M3(e,t){const n=t.__markstreamFinal===!0?"final":"streaming";let r=e.streamParseEnvs.get(n);r||(r={},e.streamParseEnvs.set(n,r));for(const i of Object.keys(r))Object.prototype.hasOwnProperty.call(t,i)||delete r[i];return Object.assign(r,t),r}function tp(e,t){const n=e.markdownIt,r=n.stream,i=t.streamParse??"auto";return t.disableStreamParse!==!0&&n.__markstreamHasCustomParserExtensions===!1&&(i===!0||i==="auto"&&t.final!==!0)&&(r==null?void 0:r.enabled)===!0&&typeof r.parse=="function"}function T3(e,t){const n=e.markdownIt,r=t.streamParse??"auto",i=n.stream;return t.final===!0&&r==="auto"&&t.disableStreamParse!==!0&&n.__markstreamHasCustomParserExtensions===!1&&(i==null?void 0:i.enabled)===!0&&typeof i.reset=="function"}function B3(e,t){return T3(e,t)?(e.resetForFinalAutoParse(),!0):!1}function F3(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function D3(e,t){const n=e==null?void 0:e.map,r=t==null?void 0:t.map;return n===r?!0:!Array.isArray(n)||!Array.isArray(r)?!1:n.length===r.length&&n.every((i,o)=>i===r[o])}function Wf(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&&D3(e,t)}function BA(e,t){var n,r,i;return((n=e[t])==null?void 0:n.type)==="paragraph_open"&&((r=e[t+1])==null?void 0:r.type)==="inline"&&((i=e[t+2])==null?void 0:i.type)==="paragraph_close"}function R3(e){for(let t=0;t+5<e.length;t++)if(BA(e,t)&&BA(e,t+3)&&Wf(e[t],e[t+3])&&Wf(e[t+1],e[t+4])&&Wf(e[t+2],e[t+5]))return!0;return!1}function N3(e,t,n){return Gh(e)&&mk(t)&&R3(n)}function L3(e){return e.topLevelStreamParseMode}function FA(e,t,n,r,i){var u,c,p,d;const o=e.markdownIt;if((u=r.customHtmlTags)!=null&&u.length&&(n.__markstreamCustomHtmlTags=r.customHtmlTags),!tp(e,r))return r.isFragment||(e.topLevelStreamParseMode="sync"),o.parse(t,n);if(S3(e,t),I3(e))return e.topLevelStreamParseMode="sync",o.parse(t,n);e.markStreamParseStarted();const l=o.stream.parse(t,M3(e,n));if(N3(o,t,l))return e.resetStreamOnly(),e.topLevelStreamParseMode="sync",o.parse(t,n);if(e.topLevelStreamParseMode=((d=(p=(c=o.stream)==null?void 0:c.stats)==null?void 0:p.call(c))==null?void 0:d.lastMode)??"stream",!F3(r))return l;if(!(i!=null&&i.recordTokenCloneMs))return EA(l,!0);const s=TA(),a=EA(l,!0);return i.recordTokenCloneMs(TA()-s),a}const O3=new Set(["code_inline","em_close","em_open","emoji","hardbreak","html_block","html_inline","image","ins_close","ins_open","link","link_close","link_open","mark_close","mark_open","math_inline","s_close","s_open","softbreak","strong_close","strong_open","sub","sup","text"]),P3=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"]]),$3=new Set(["code_block","fence","hr","html_block","inline","math_block"]);function _k(e,t){return e.every(n=>{if(!O3.has(n.type)||(n.type==="link"||n.type==="link_open"||n.type==="link_close")&&!rk(t))return!1;if(n.type==="link"){const i=jh(n);if(i!=="explicit"&&i!=="linkify"&&i!=="autolink")return!1}if(n.type==="link_open"||n.type==="link_close"){const i=n.markup??"";if(i!==""&&i!=="linkify"&&i!=="autolink")return!1}const r=n.children;return!Array.isArray(r)||_k(r,t)})}function H3(e){const t=P3.get(e);if(t)return t;const n=/^container_(.+)_open$/.exec(e);return n?`container_${n[1]}_close`:void 0}function Kf(e,t,n=0){var l,s;const r=[];let i=!1,o=n;for(;o<e.length;){const a=e[o];if(!a||a.level!==0)return null;const u=H3(a.type);let c=o+1;if(u){if(a.nesting!==1)return null;for(;c<e.length;){const p=e[c];if(p.level===0){if(p.type!==u||p.nesting!==-1)return null;c++;break}c++}if(((l=e[c-1])==null?void 0:l.type)!==u)return null;if(a.type==="paragraph_open"||a.type==="heading_open"){if(c!==o+3||((s=e[o+1])==null?void 0:s.type)!=="inline")return null}else i=!0}else if($3.has(a.type)){if(a.nesting!==0)return null;i=!0}else return null;for(let p=o;p<c;p++){const d=e[p];if(d.type!=="inline")continue;const f=d.children;if(!Array.isArray(f)||!_k(f,t))return null}r.push(o),o=c}return{mixed:i,starts:r}}function W3(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function Sk(e){var t;return e.reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!((t=e.customHtmlTags)!=null&&t.length)&&e.includeSourceMap!==!0}function K3(e,t){const n=e==null?void 0:e.map,r=t==null?void 0:t.map;return n===r?!0:!Array.isArray(n)||!Array.isArray(r)?!1:n.length===r.length&&n.every((i,o)=>i===r[o])}function j3(e,t){const n=e==null?void 0:e.attrs,r=t==null?void 0:t.attrs;if(n===r)return!0;if(!Array.isArray(n)||!Array.isArray(r)||n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const o=n[i],l=r[i];if(o[0]!==l[0]||o[1]!==l[1])return!1}return!0}function DA(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.level===t.level&&e.markup===t.markup&&e.content===t.content&&e.info===t.info&&K3(e,t)&&j3(e,t)}function RA(e,t,n,r,i,o,l,s=0,a){const u=r.starts;if(u.length===0||i.length!==u.length){e.structuredStream=void 0;return}const c=u.map((g,m)=>{const A=u[m+1]??n.length;return{firstToken:n[g],lastToken:n[A-1],tokenCount:A-g}}),p=r.mixed?Math.max(0,u.length-1):W3(t)?u.length:Math.max(0,u.length-1),d=p-s-1,f=d>=0?l==null?void 0:l[d]:a;e.structuredStream={groupBoundaries:c,groupStarts:u,tokenCount:n.length,tokens:n,mixed:r.mixed,source:t,nodes:i,linkifyDemotionContext:f,stableGroupCount:p,requireClosingStrong:o.requireClosingStrong,validateLink:o.validateLink}}function z3(e,t,n,r){if(e.tokens===t)return!0;const i=n.length-1;for(let o=0;o<r;o++){const l=n[o],s=n[o+1]??t.length,a=e.groupBoundaries[o];if(!a||a.tokenCount!==s-l)return!1;if(!(a.firstToken===t[l]&&a.lastToken===t[s-1])&&(o>=i||!DA(a.firstToken,t[l])||!DA(a.lastToken,t[s-1])))return!1}return!0}function G3(e,t,n,r,i){var g;const o=r.disableStructuredReuse,l=tp(e,r)&&Sk(r);if(r.isFragment||(e.structuredReuseTailStart=void 0),!l)return o||(e.structuredStream=void 0),i.processTokens(n,r);if(o)return i.processTokens(n,r);const s=e.structuredStream,a=L3(e),u=!!s&&(a==="append"||a==="tail")&&s.tokenCount!==void 0&&s.tokenCount<=n.length&&n===s.tokens;let c;if(u){const m=Kf(n,r.validateLink,s.tokenCount);c=m?{starts:s.groupStarts.concat(m.starts),mixed:s.mixed||m.mixed}:Kf(n,r.validateLink)}else c=Kf(n,r.validateLink);if(!c)return e.structuredStream=void 0,i.processTokens(n,r);const p=c.starts,d=s&&c.mixed?Math.min(s.stableGroupCount,Math.max(0,s.groupBoundaries.length-1)):(s==null?void 0:s.stableGroupCount)??0;if(s&&d>0&&s.requireClosingStrong===r.requireClosingStrong&&s.validateLink===r.validateLink&&e.sourceExtends(s.source,t)&&p.length>=d&&(a==="append"||a==="tail")&&z3(s,n,p,d)){const m=p[d]??n.length,A={...r,linkifyDemotionSeedContext:s.linkifyDemotionContext},v=i.processTokens(n.slice(m),A),k=p.length-d;if(v.length===k){const C=s.nodes.slice(0,d).concat(v);return e.structuredReuseTailStart=d,(g=i.recordReusedTopLevelNodes)==null||g.call(i,d),RA(e,t,n,c,C,r,A.linkifyDemotionResultContexts,d,s.linkifyDemotionContext),C}}const f=i.processTokens(n,r);return RA(e,t,n,c,f,r,r.linkifyDemotionResultContexts),f}function NA(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 Q3(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function au(e,t){return cI(e,{final:t,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink},{disableStreamParse:!0,disableStructuredReuse:!0,isFragment:!0})}const U3=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),Y3=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m,Z3=/(?:^|\n)(?: {4}|\t)(?![ \t]*<)\S/m;function V3(e){return/\n\s*\n/.test(e)||Y3.test(e)||Z3.test(e)}function J3(e){if(e.length===0)return!1;if(e.some(n=>U3.has(String((n==null?void 0:n.type)??"").toLowerCase()))||e.some(n=>{if((n==null?void 0:n.type)!=="html_block")return!1;const r=n;return Array.isArray(r.children)&&r.children.length>0})||e.length>1)return!0;const[t]=e;return!!(t&&t.type==="paragraph")}function X3(e){const t=[];let n=0;for(;n<e.length;){for(;/\s/.test(e[n]??"");)n++;if(n>=e.length)break;const r=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!(r!=null&&r[1]))return null;const i=ml(e,r[1],n);if(!i||i.start!==n)return null;t.push(i.raw),n=i.end}return t.length>1?t:null}function sl(e,t,n){return e.trim()?t.parseFragment(e,n):[]}function q3(e,t,n,r,i){var c;const o=((c=n.customHtmlTags)==null?void 0:c.join("\0"))??"",l=n.runtime,s=i?l==null?void 0:l.siblingHtmlChildren:void 0,a=s&&s.final===r&&s.customHtmlTags===o&&s.requireClosingStrong===n.requireClosingStrong&&s.validateLink===n.validateLink,u=e.map((p,d)=>a&&s.blocks[d]===p?s.children[d]:sl(p,t,n));return i&&l&&(l.siblingHtmlChildren={blocks:e,children:u,customHtmlTags:o,final:r,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),u.flat()}function eM(e,t,n,r){const i=o=>{if((o==null?void 0:o.type)!=="html_block")return o;const l=o,s=String(l.tag??"").toLowerCase();if(!s||s==="details"||Nh.has(s)||Array.isArray(l.children))return o;const a=String(o.raw??l.content??"");if(!a)return o;const u=Xt(a);if(u===-1)return o;const c=ml(a,s,0),p=(c==null?void 0:c.closeStart)??-1,d=(c==null?void 0:c.closed)===!0&&p>=u+1,f=d?a.slice(u+1,p):a.slice(u+1);if(!f.trim()||!V3(f))return o;const g=au(n,r),m=d?null:X3(f),A=!n.isFragment&&typeof n.preTransformTokens!="function"&&typeof n.postTransformTokens!="function"&&typeof n.postTransformNodes!="function"&&t.markdownIt.__markstreamHasCustomParserExtensions===!1&&rk(n.validateLink),v=m?q3(m,t,g,r,A):sl(f,t,g);return J3(v)&&(l.children=v),o};return e.map(i)}function tM(e,t=0){var n;for(let r=t;r<e.length;r++)if(((n=e[r])==null?void 0:n.type)==="html_block")return!0;return!1}function nM(e,t,n){const r=sl(e,t,n),i=r[0];return r.length===1&&(i==null?void 0:i.type)==="paragraph"&&Array.isArray(i.children)?i.children:r}function Dd(e,t,n){const r=yk({content:e}),i=Xt(e),o=vk(e,"summary");if(i!==-1&&o!==-1&&o>=i+1){const l=nM(e.slice(i+1,o),t,n);l.length>0&&(r.children=l)}return r.raw=e,r}function rM(e,t,n){const r=Xt(e);if(r===-1)return[];const i=e.slice(r+1);if(!i.trim())return[];const o=ml(i,"summary",0);if(!o)return sl(i,t,n);const l=i.slice(0,o.start),s=i.slice(o.end);return[...sl(l,t,n),Dd(o.raw,t,n),...sl(s,t,n)]}function Ik(e,t,n,r,i,o=0){var a,u;const l=[];let s=o;for(let c=0;c<e.length;c++){const p=e[c],d=gs(p);let f=-1;if(d&&(f=t.indexOf(d,s),f!==-1&&(s=f+d.length)),!NA(p)){l.push(p);continue}const g=String(p.raw??gs(p)??""),m=f!==-1?f:t.indexOf(g,Math.max(0,s-g.length));if(m===-1){l.push(p);continue}let A=1,v=-1;for(let te=c+1;te<e.length;te++){const re=e[te];if(NA(re)){A++;continue}if(Q3(re)&&(A--,A===0)){v=te;break}}const k=ml(t,"details",m),C=v===-1&&(k==null?void 0:k.closed)===!0,b=C?(()=>{const te=vk(g,"details");return te!==-1?g.slice(0,te):g})():g,S=v===-1?"</details>":String(e[v].raw??gs(e[v])??"</details>"),T=C||v!==-1&&(k==null?void 0:k.closed)===!0,M=S.replace(/[\t\r\n ]+$/,""),E=T?(()=>{const te=((k==null?void 0:k.raw)??"").lastIndexOf(M);return te===-1?t.length:m+te})():t.length,$=Xt(g),X=$!==-1?m+$+1:m+g.length,K=t.slice(X,E===-1?t.length:E),I=E+M.length,B=T?Math.max(E+S.length,n3(t,I)):t.length,P=T?t.slice(E,B):S,_=T?t.slice(m,B):t.slice(m),W=Sk(r)&&(((a=r.runtime)==null?void 0:a.structuredReuseTailStart)??0)>0?(u=r.runtime)==null?void 0:u.detailsStitchCache:void 0,z=W==null?void 0:W.get(p);if(z&&z.openRaw===g&&z.explicitClose===T&&z.closeSliceEnd===B&&z.middleSource===K){if(l.push(z.node),s=T?B:t.length,v===-1&&!C)break;v!==-1&&(c=v);continue}const[N]=Ik(C?[]:v===-1?e.slice(c+1):e.slice(c+1,v),t,n,r,i,m+g.length);let R=rM(b,n,au(r,i)),oe=N;const ne=N[0];if(!R.some(te=>{const re=te;return(re==null?void 0:re.type)==="html_block"&&String(re.tag??"").toLowerCase()==="summary"})){if((ne==null?void 0:ne.type)==="html_block"&&String(ne.tag??"").toLowerCase()==="summary"&&!Array.isArray(ne.children))oe=[Dd(String(ne.raw??ne.content??""),n,au(r,i)),...N.slice(1)];else if($!==-1){const te=ml(t,"summary",m+$+1);if(te&&te.closed){const re=t.slice(m+$+1,te.start);/^[\t \r\n]*$/.test(re)&&(R=[Dd(te.raw,n,au(r,i)),...R])}}}const ee=n.markdownIt.parse(K,{__markstreamFinal:i}),ie=n.markdownIt.renderer.render(ee,n.markdownIt.options,{__markstreamFinal:i}),G=$!==-1?t.slice(m,m+$+1):g,Q={...p,tag:"details",attrs:Xu(g.slice(0,$+1)),raw:_,content:`${G}${ie}${P}`,children:[...R,...oe],loading:!i&&!T};if(r.includeSourceMap&&(Q.sourceMap=Ws(t,m,T?B:t.length,r)),W&&T&&W.set(p,{openRaw:g,explicitClose:T,closeSliceEnd:B,middleSource:K,node:Q}),l.push(Q),s=T?B:t.length,v===-1&&!C)break;v!==-1&&(c=v)}return[l,s]}function iM(e,t,n,r,i){var s;if(!t)return-1;const o=((s=i.getInternalNodeSourceRange(e))==null?void 0:s.start)??-1,l=o>=r&&n.startsWith(t,o);return(e==null?void 0:e.type)==="html_block"?l&&o===r?o:n.indexOf(t,r):o<0?n.indexOf(t,r):l?o:-1}function oM(e,t,n,r,i,o=0){if(!n)return e;const l=e.slice();let s=o;for(let a=0;a<l.length;a++){const u=l[a],c=gs(u),p=iM(u,c,n,s,r);if((u==null?void 0:u.type)!=="html_block"){p!==-1&&(s=p+c.length);continue}const d=String(u.tag??"").toLowerCase();if(!d)continue;if(d==="details"){p!==-1&&(s=p+c.length);continue}const f=ml(n,d,p!==-1?p:s);if(!f)continue;s=f.end;const g=String(u.content??c),m=String(u.raw??g),A=p+m.length;if(p!==-1&&f.end<A&&n.slice(p,A)===m){s=A,i!=null&&i.includeSourceMap&&(u.sourceMap=Ws(n,p,A,i));continue}const v=e3(f.raw,d,f.closed),k=!t&&!f.closed,C=g!==v||m!==f.raw||!!u.loading!==k,b=Xt(f.raw),S=b===-1?"":f.raw.slice(0,b+1),T=S?Xu(S):[];if(u.content=v,u.raw=f.raw,u.loading=k,u.attrs=T.length?T:void 0,i!=null&&i.includeSourceMap&&(u.sourceMap=Ws(n,f.start,f.end,i)),!C)continue;let M=qE(f.raw,m);M===-1&&(M=0);const E=a+1;for(;E<l.length;){if(f.closed&&XE(l[E],d)){l.splice(E,1);continue}const $=gs(l[E]);if(!$)break;const X=f.raw.indexOf($,M);if(X===-1){if(t3(n,f.end,$))break;const K=r.getInternalNodeSourceRange(l[E]);if(!K)break;if(K.start>=f.start&&K.end<=f.end){l.splice(E,1);continue}break}M=X+$.length,l.splice(E,1)}}return l}function lM(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function sM(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,r=n===""||n==="true";return{type:"checkbox_input",checked:r,raw:r?"[x]":"[ ]"}}function aM(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function yo(e,t,n,r,i=!1){let o="",l=t+1,s=1;const a=[];for(;l<e.length;){if(e[l].type===n){if(s===1)break;s--}r&&e[l].type===r&&s++;const u=e[l];o+=String(i?e[l].content??u.text??"":e[l].content??""),a.push(e[l]),l++}return{content:o,innerTokens:a,nextIndex:l<e.length?l+1:e.length}}function Eu(e,t,n,r){const i=[],{content:o,innerTokens:l,nextIndex:s}=yo(e,t,"em_close",void 0,!0);return i.push(...n(l,void 0,void 0,r)),{node:{type:"emphasis",children:i,raw:`*${o}*`},nextIndex:s}}function uM(e){return gl(`(?:^|\\r\\n|\\n|\\r) {0,3}${e}+[ \\t]*$`)}const Ek=["diff ","index ","--- ","+++ ","@@ "],cM=/\r?\n/;function fM(e){const t=String(e??"");return t?Ek.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function LA(e,t,n,r){n.length>0&&e.push(...n),r.length>0&&t.push(...r),n.length=0,r.length=0}function OA(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function dM(e,t){const n=[],r=[],i=[],o=[],l=e.split(cM),s=/\r?\n$/.test(e),a=l.some(f=>f.startsWith("diff ")||f.startsWith("--- ")||f.startsWith("+++ ")||f.startsWith("@@ ")),u=f=>{const g=f;if(!Ek.some(m=>g.startsWith(m)))if(g.startsWith("-")){const m=g.slice(1);i.push(OA(m,a))}else if(g.startsWith("+")){const m=g.slice(1);o.push(OA(m,a))}else{LA(n,r,i,o);const m=a&&g.startsWith(" ")?g.slice(1):g;n.push(m),r.push(m)}},c=s?Math.max(0,l.length-1):l.length;for(let f=0;f<c;f++){const g=l[f]??"";!t&&!s&&f===c-1&&fM(g)||u(g)}(t||i.length>0||o.length>0)&&LA(n,r,i,o);const p=n.join(`
138
+ `),d=r.join(`
139
+ `);return{original:t&&s&&p?`${p}
140
+ `:p,updated:t&&s&&d?`${d}
141
+ `:d}}function tc(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},r=typeof n.closed=="boolean"?n.closed:void 0,i=r===!0||r!==!1&&t,o=String(e.info??""),l=o.startsWith("diff"),s=l?(()=>{const u=o,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():o;let a=String(e.content??"");if(!i&&e.markup){const u=e.markup[0],c=uM(u);c.test(a)&&(a=a.replace(c,""))}if(l){const{original:u,updated:c}=dM(a,i===!0);return{type:"code_block",language:s,code:String(c??""),raw:String(a??""),diff:l,loading:r===!0?!1:r===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:s,code:String(a??""),raw:String(a??""),diff:l,loading:r===!0?!1:r===!1?!0:!t}}function hM(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function pM(){return{type:"hardbreak",raw:`\\
142
+ `}}function gM(e,t,n,r){const i=[],{content:o,innerTokens:l,nextIndex:s}=yo(e,t,"mark_close");return i.push(...n(l,void 0,void 0,r)),{node:{type:"highlight",children:i,raw:`==${o}==`},nextIndex:s}}function nc(e){const t=e==null?void 0:e.customHtmlTags;if(!Array.isArray(t)||t.length===0)return pl;const n=new Set(pl);for(const r of Pi(t))r&&n.add(r);return n}let jf=null;const zf=new WeakMap;function PA(){return jf||(jf={customTagSet:null,allowedTagSet:nc()}),jf}function Mk(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function Tk(e){return/^<\s*\//.test(e)}function Bk(e,t){return/\/\s*>\s*$/.test(t)||qr.has(e)}function mM(e){if(!e||e.length===0)return PA();const t=zf.get(e);if(t)return t;const n=e.map(cr).filter(Boolean);if(!n.length){const i=PA();return zf.set(e,i),i}const r={customTagSet:new Set(n),allowedTagSet:nc({customHtmlTags:e})};return zf.set(e,r),r}function Fk(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function AM(e){const t=e.meta,n=t==null?void 0:t.markstreamCustomHtmlRaw,r=t==null?void 0:t.markstreamCustomHtmlInner;return typeof n=="string"&&typeof r=="string"?{raw:n,inner:r}:null}function Mu(e,t){const n=t.toLowerCase();for(let r=e.length-1;r>=0;r--){const[i,o]=e[r];if(String(i).toLowerCase()===n)return o}}function vM(e,t,n){const r=e.slice();return Mu(r,"href")||r.push(["href",t]),n!=null&&!Mu(r,"title")&&r.push(["title",n]),r}function Rd(e){return e.map(Fk).join("")}function uu(e){const t=[],n=r=>{const i=String(r??"");if(!i)return;const o=t[t.length-1];if((o==null?void 0:o.type)==="text"){o.content=`${o.content}${i}`,o.raw=`${o.raw}${i}`;return}t.push({type:"text",content:i,raw:i})};for(const r of e)if(r){if(r.type==="reference"||r.type==="footnote_reference"){n(String(r.raw??""));continue}if("children"in r&&Array.isArray(r.children)){t.push({...r,children:uu(r.children)});continue}t.push(r)}return t}function kM(e,t,n){let r=0;for(let i=t;i<e.length;i++){const o=e[i];if(o.type!=="html_inline")continue;const l=String(o.content??""),s=Mk(l),a=Tk(l),u=Bk(s,l);if(!a&&!u&&s===n){r++;continue}if(a&&s===n){if(r===0)return i;r--}}return-1}function Gf(e,t,n){const r=[e[t]];let i=[],o=t+1,l=!1;const s=n?kM(e,t+1,n):-1;return s!==-1?(i=e.slice(t+1,s),r.push(...i,e[s]),o=s+1,l=!0):(i=e.slice(t+1),i.length&&r.push(...i),o=e.length),{closed:l,html:Rd(r),innerTokens:i,nextIndex:o}}function yM(e,t,n,r,i,o,l){const s=String(e.content??""),a=Mk(s),{customTagSet:u,allowedTagSet:c}=mM(l==null?void 0:l.customHtmlTags);if(!a)return[{type:"inline_code",code:s,raw:s},n+1];if(!c.has(a)&&!Gf(t,n,a).closed){const S=Fk(e);return[{type:"text",content:S,raw:S},n+1]}if(a==="br")return[{type:"hardbreak",raw:s},n+1];const p=Tk(s),d=Bk(a,s);if(p)return[{type:"html_inline",tag:a,content:s,children:[],raw:s,loading:!1},n+1];if(a==="a"){const S=Gf(t,n,a),T=Xu(s),M=S.innerTokens,E=String(Mu(T,"href")??""),$=Mu(T,"title"),X=$==null?null:String($),K=vM(T,E,X),I=uu(M.length?r(M,i,o,l):[]),B=M.length?Rd(M):E||"";return!I.length&&B&&I.push({type:"text",content:B,raw:B}),[{type:"link",href:E,title:X,text:B,attrs:K,children:I,loading:!S.closed,raw:S.html||s,markup:"html"},S.nextIndex]}if(d)return[{type:u!=null&&u.has(a)?a:"html_inline",tag:a,content:s,children:[],raw:s,loading:!1},n+1];const f=Gf(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:uu(f.innerTokens.length?r(f.innerTokens,i,o,l):[]),raw:f.html},f.nextIndex];const g=uu(f.innerTokens.length?r(f.innerTokens,i,o,l):[]);let m=f.html||s,A=!f.closed,v=!1;if(!f.closed){const S=`</${a}>`;m.toLowerCase().includes(S.toLowerCase())||(m+=S),v=!0,A=!0}const k=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=C.exec(s))!==null;){const S=b[1],T=b[2]||b[3]||b[4]||"";k.push([S,T])}if(u!=null&&u.has(a)){const S=AM(e);return[{type:a,tag:a,attrs:k,content:S?S.inner:f.innerTokens.length?Rd(f.innerTokens):"",children:f.innerTokens.length?r(f.innerTokens,i,o,l):[],raw:(S==null?void 0:S.raw)??m,loading:e.loading||A,autoClosed:v},f.nextIndex]}return[{type:"html_inline",tag:a,attrs:k,content:m,children:g,raw:m,loading:A,autoClosed:v},f.nextIndex]}function CM(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function bM(e,t,n,r){const i=[],{content:o,innerTokens:l,nextIndex:s}=yo(e,t,"ins_close");return i.push(...n(l,void 0,void 0,r)),{node:{type:"insert",children:i,raw:`++${String(o)}++`},nextIndex:s}}function Dk(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=>Dk(t)).join(""):String(e.content??"")}function xM(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>Dk(t)).join("")}function Rk(e,t=!1){var p,d,f,g,m;let n=e.attrs??[],r=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const A of e.children){const v=A.attrs;if(Array.isArray(v)&&v.length>0){n=v,r=A;break}}const i=String(((p=n.find(A=>A[0]==="src"))==null?void 0:p[1])??""),o=(d=n.find(A=>A[0]==="alt"))==null?void 0:d[1],l=xM(r??e);let s="";l?s=l:o!=null&&String(o).length>0?s=String(o):(r==null?void 0:r.content)!=null&&String(r.content).length>0?s=String(r.content):Array.isArray(r==null?void 0:r.children)&&((f=r.children[0])!=null&&f.content)?s=String(r.children[0].content):Array.isArray(e.children)&&((g=e.children[0])!=null&&g.content)?s=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(s=String(e.content));const a=((m=n.find(A=>A[0]==="title"))==null?void 0:m[1])??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:i,alt:s,title:u,raw:c,loading:t}}function wM(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const r=n==null?void 0:n[0];r&&t.push([String(r),String((n==null?void 0:n[1])??"")])}return t}function Tu(e,t){const n=t.toLowerCase();for(let r=e.length-1;r>=0;r--){const[i,o]=e[r];if(String(i).toLowerCase()===n)return o}}function _M(e,t,n){const r=e.slice();return Tu(r,"href")||r.push(["href",t]),n!=null&&!Tu(r,"title")&&r.push(["title",n]),r}function Bu(e,t,n,r){var v;const i=e[t],o=wM(i.attrs),l=String(Tu(o,"href")??""),s=Tu(o,"title"),a=s==null?null:String(s),u=_M(o,l,a);let c=t+1;const p=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)p.push(e[c]),c++;((v=e[c])==null?void 0:v.type)==="link_close"&&(d=!1);let f=p;const g=p[p.length-1];if(qu(r)&&r.insideStrong&&(g==null?void 0:g.type)==="text"&&String(g.content??"").endsWith("**")&&!p.some(k=>k.type==="strong_open")){const k=String(g.content??""),C=String(g.raw??k),b=ko(g);b.content=k.slice(0,-2),b.raw=C.replace(/\*\*$/,""),f=p.slice(),f[f.length-1]=b}const m=n(f,void 0,void 0,r),A=m.map(k=>{const C=k;return"content"in k?String(C.content??""):String(C.raw??"")}).join("");return{node:{type:"link",href:l,title:a,text:A,children:m,raw:`[${A}](${l}${a?` "${a}"`:""})`,loading:d,attrs:u,markup:zh(i)},nextIndex:c<e.length?c+1:e.length}}const Nk=/\\([\\()[\]`$|*_\-!])/g,np=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),rp=1,Lk=2,SM=4,IM=8,Ok=16,ki=32,cu=64,ss=128,Pk=256,EM=512,As=1024,MM=1982;function Fu(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=ss;break;case 36:t|=Pk;break;case 40:t|=As;break;case 42:t|=Lk;break;case 91:t|=ki;break;case 92:t|=rp;break;case 93:t|=cu;break;case 95:t|=SM;break;case 96:t|=Ok;break;case 124:t|=EM;break;case 126:t|=IM;break}return t}function TM(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let r=0;for(;n+r<e.length&&e[n+r]==="\\";)r++;const i=e[n+r];if(t+="\\".repeat(Math.floor(r/2)),r%2===1){if(i&&np.has(i)){t+=i,n+=r+1;continue}t+="\\"}n+=r}return t}function BM(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r],o=e[r+1];if(i==="\\"&&o&&np.has(o)){if(n===t)return r+1;n++,r++;continue}if(n===t)return r;n++}return-1}function FM(e,t,n){const r=BM(e,t);if(r===-1||e[r]!==n)return!1;let i=0;for(let o=r-1;o>=0&&e[o]==="\\";o--)i++;return i%2===1}function DM(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function mr(e,t){return String(e.markup??"").startsWith(t)}function $A(e,t,n=Fu(e)){let r=e;const i=String(t.content??"");return(n&rp)!==0&&r.endsWith("\\")&&!mr(t,"\\\\")&&!i.endsWith("\\\\")&&(r=r.slice(0,-1)),(n&As)!==0&&r.endsWith("(")&&!mr(t,"\\(")&&!i.endsWith("\\(")&&(r=r.slice(0,-1)),(n&Lk)!==0&&/\*+$/.test(r)&&!mr(t,"\\*")&&!i.endsWith("\\*")&&(r=r.replace(/\*+$/,"")),r}function RM(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(Nk,"$1")===t))return n}function Ks(e,t,n,r,i){const o=[],{content:l,innerTokens:s,nextIndex:a}=yo(e,t,"strong_close","strong_open"),u={...Js(i),insideStrong:!0};return o.push(...n(s,RM(r,l),void 0,u)),{node:{type:"strong",children:o,raw:`**${String(l)}**`},nextIndex:a}}const NM=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,LM=/:\/\//;function OM(e){return e?NM.test(e)||LM.test(e):!1}function HA(e,t,n){var i;if(!t)return;const r=e.parseInlineTokens([{...n,type:"text",content:t,raw:t}],t,e.pPreToken,e.options);if(r.length===1&&((i=r[0])==null?void 0:i.type)==="text"){const o=r[0];e.pushText(String(o.content??""),String(o.raw??o.content??""));return}for(const o of r)e.pushParsed(o)}function PM(e,t){var n,r,i,o,l,s;return t.endsWith("](")?((n=e.tokens[e.index+1])==null?void 0:n.type)==="link_open"&&((r=e.tokens[e.index+1])==null?void 0:r.markup)==="linkify"&&((i=e.tokens[e.index+2])==null?void 0:i.type)==="text"&&((o=e.tokens[e.index+3])==null?void 0:o.type)==="link_close"&&((l=e.tokens[e.index+4])==null?void 0:l.type)==="text"&&String(((s=e.tokens[e.index+4])==null?void 0:s.content)??"").startsWith(")"):!1}function $M(e,t){var u,c,p,d;if(HM(e,t))return;if(QM(e)){const{node:f,nextIndex:g}=Bu(e.tokens,e.index,e.parseInlineTokens,e.options),m=String(f.text||f.href||"");e.pushText(m,m),e.index=g;return}e.resetCurrentTextNode();const n=e.index,{node:r,nextIndex:i}=Bu(e.tokens,e.index,e.parseInlineTokens,e.options);e.index=i;const o=r.text||r.href||"";if(t.markup==="linkify"&&!ek(o,r.href,e.raw)&&Su(o,e.options.linkifyDemotionContext)){e.pushText(o,o);return}const l=r.children.length===1&&((u=r.children[0])==null?void 0:u.type)==="text";if(r.loading&&e.raw&&r.text===r.href&&l){const f=DM(e.raw,r.href);f&&(r.text=f,r.children=[{type:"text",content:f,raw:f}],r.raw=`[${f}](${r.href}${r.title?` "${r.title}"`:""})`)}if((c=e.options)!=null&&c.validateLink&&!e.options.validateLink(r.href)){e.pushText(r.text,r.text);return}const s=(d=(p=t.attrs)==null?void 0:p.find(([f])=>f==="href"))==null?void 0:d[1],a=String(s??"");if(e.raw&&a){const f=e.raw.indexOf("](");if(f!==-1){const g=e.raw.indexOf(")",f+2);g===-1?r.loading=!0:r.loading&&e.raw.slice(f+2,g).includes(a)&&(r.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(r.href)&&Wk(e,r,n-1)||$k(e,r)||e.pushParsed(r)}function HM(e,t){if(t.markup!=="linkify")return!1;const{node:n,nextIndex:r}=Bu(e.tokens,e.index,e.parseInlineTokens,e.options);return Hk(e,n,r)?(e.index=r,!0):!1}function $k(e,t){if(t.type!=="link")return!1;const n=e.result[e.result.length-1];if(!n||n.type!=="text")return!1;const r=String(n.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!r)return!1;const i=t,o=String(i.href??""),l=String(i.text??""),s=String(r[2]??""),a=o.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!o||!(l===o||l===a||OM(l)))return!1;const u=String(r[1]??"");return u?(n.content=u,n.raw=u):e.result.pop(),e.pushParsed({...t,text:s,children:[{type:"text",content:s,raw:s}],raw:`[${s}](${o}${i.title?` "${i.title}"`:""})`,markup:zh(t)}),!0}function WM(e,t){if(t.type!=="link")return!1;const n=t,r=String(n.href??"");return r?Hk(e,{href:r,title:n.title==null||n.title===""?null:String(n.title),loading:!!n.loading},e.index+1):!1}function Hk(e,t,n){const r=e.result[e.result.length-1];if((r==null?void 0:r.type)!=="image"||r.src||!r.loading||!String(r.raw??"").endsWith("]("))return!1;const i=e.tokens[n],o=String((i==null?void 0:i.content)??"");if((i==null?void 0:i.type)!=="text"||!o.startsWith(")"))return!1;e.result.pop(),e.currentTextNode=null;const l=String(r.alt??"");e.pushParsed({type:"image",src:t.href,alt:l,title:t.title,raw:`![${l}](${t.href}${t.title?` "${t.title}"`:""})`,loading:!!t.loading});const s=o.slice(1),a=ko(i);return a.content=s,a.raw=s,e.ensureWorkingTokens()[n]=a,!0}function Wk(e,t,n=e.index-1){var d;if(t.type!=="link")return!1;const r=e.result[e.result.length-1],i=e.tokens[n];if(!r||r.type!=="text"||(i==null?void 0:i.type)!=="text")return!1;const o=String(r.content??""),l=String(i.content??"");if(!o.endsWith("!")||!l.endsWith("!")||mr(i,"\\!"))return!1;const s=o.slice(0,-1);s?(r.content=s,r.raw=s,e.currentTextNode=r):(e.result.pop(),e.currentTextNode=null);const a=t,u=String(a.text??((d=a.children)==null?void 0:d.map(f=>String((f==null?void 0:f.content)??(f==null?void 0:f.raw)??"")).join(""))??""),c=String(a.href??""),p=a.title==null||a.title===""?null:String(a.title);return e.pushParsed({type:"image",src:c,alt:u,title:p,raw:`![${u}](${c}${p?` "${p}"`:""})`,loading:!!a.loading}),!0}function rc(e,t="",n=null){const r=String(e.alt??e.raw??"");return{type:"link",href:t,title:n,text:r,children:[e],raw:`[${r}](${t}${n?` "${n}"`:""})`,loading:!0,markup:""}}function Kk(e){const t=e.startsWith("![")?e:`![${e}`,n=t.slice(2),r=n.indexOf("](");return{type:"image",src:"",alt:r===-1?n.replace(/\]$/,""):n.slice(0,r),title:null,raw:t,loading:!0}}function KM(e,t){const n=t.indexOf("[![");if(n===-1||typeof e.raw=="string"&&e.tokens.length===1&&FM(e.raw,n,"["))return!1;const r=t.slice(0,n);r&&e.pushText(r,r);const i=Kk(t.slice(n+1));return e.pushParsed(rc(i)),e.index++,!0}function jM(e,t){var o;if((o=e.options)!=null&&o.final)return!1;const n=e.tokens[e.index-1];if((n==null?void 0:n.type)!=="text"||!String(n.content??"").endsWith("[")||mr(n,"\\["))return!1;const r=e.result[e.result.length-1];if((r==null?void 0:r.type)==="text"&&r.content.endsWith("[")){const l=r.content.slice(0,-1);l?(r.content=l,r.raw=l,e.currentTextNode=r):(e.result.pop(),e.currentTextNode=null)}const i=Rk(t);return e.pushParsed(rc(i)),e.index++,!0}function zM(e,t){if(t.type!=="link")return!1;const n=t,r=String(n.raw??""),i=String(n.text??"");if(!r.startsWith("[![")&&!i.startsWith("!["))return!1;const o=n.title==null||n.title===""?null:String(n.title),l={type:"image",src:String(n.href??""),alt:i.replace(/^!\[/,"").replace(/\]$/,""),title:o,raw:r.startsWith("[![")?r.slice(1):r,loading:!0};return e.pushParsed(rc(l)),!0}function GM(e,t){var d;if(!t.startsWith("]("))return!1;const n=e.tokens[e.index-2];if((n==null?void 0:n.type)==="text"&&String(n.content??"").endsWith("[")&&mr(n,"\\["))return!1;const r=e.result[e.result.length-1];if((r==null?void 0:r.type)!=="image"&&(r==null?void 0:r.type)!=="link")return!1;const i=r,o=(r==null?void 0:r.type)==="link"&&Array.isArray(i.children)&&i.children.length===1&&((d=i.children[0])==null?void 0:d.type)==="image"?e.result.pop():null,l=o?o.children[0]:e.result.pop();if(!l||l.type!=="image")return!1;const s=e.tokens[e.index+1];let a=String((o==null?void 0:o.href)??""),u=(o==null?void 0:o.title)==null?null:String(o.title),c=!0;if((s==null?void 0:s.type)==="link_open"){const{node:f,nextIndex:g}=Bu(e.tokens,e.index+1,e.parseInlineTokens,e.options);a=f.href,u=f.title,c=!0,e.index=g}else{if(a=t.slice(2),a.includes('"')){const f=a.split('"');a=String(f[0]??"").trim(),u=f[1]==null?null:String(f[1]).trim()}e.index++}const p=rc(l,a,u);return p.loading=c,e.pushParsed(p),!0}function QM(e){var n,r;const t=e.tokens[e.index-3];return((n=e.tokens[e.index-2])==null?void 0:n.type)==="image"&&((r=e.tokens[e.index-1])==null?void 0:r.type)==="text"&&String(e.tokens[e.index-1].content??"")==="]("&&(t==null?void 0:t.type)==="text"&&String(t.content??"").endsWith("[")&&mr(t,"\\[")}function UM(e,t,n){var l,s;const r=t.indexOf("[");if(r===-1)return!1;let i=t.slice(0,r);const o=t.indexOf("](",r);if(o!==-1){const a=e.tokens[e.index+2];let u=t.slice(r+1,o);if(u.includes("[")){const A=u.indexOf("[");i+=t.slice(0,r+A+1);const v=r+A+1;u=t.slice(v+1,o)}const c=e.tokens[e.index+1];if(t.endsWith("](")&&(c==null?void 0:c.type)==="link_open"&&a){const A=e.tokens[e.index+4];let v=4,k=!0;if((A==null?void 0:A.type)==="text"){const b=String(A.content??"");if(b.startsWith(")")){k=!1;const S=b.slice(1);if(S){const T=ko(A);T.content=S,T.raw=S,e.ensureWorkingTokens()[e.index+4]=T}else v++}else b==="."&&v++}HA(e,i,n);const C=String(a.content??"");return(l=e.options)!=null&&l.validateLink&&!e.options.validateLink(C)?e.pushText(u,u):e.pushParsed({type:"link",href:C,title:null,text:u,children:[{type:"text",content:u,raw:u}],loading:k,markup:""}),e.index+=v,!0}const p=t.indexOf(")",o),d=p!==-1?t.slice(o+2,p):"",f=p===-1;let g=i.match(/\*+$/);if(g&&(i=i.replace(/\*+$/,"")),HA(e,i,n),g||(g=u.match(/^\*+/)),!e.requireClosingStrong&&g){const A=g[0].length;u=u.replace(/^\*+/,"").replace(/\*+$/,"");const v=[];if(A===1?v.push({type:"em_open",tag:"em",nesting:1}):A===2?v.push({type:"strong_open",tag:"strong",nesting:1}):A===3&&(v.push({type:"strong_open",tag:"strong",nesting:1}),v.push({type:"em_open",tag:"em",nesting:1})),v.push({type:"link",href:d,title:null,text:u,children:[{type:"text",content:u,raw:u}],loading:f,markup:""}),A===1){v.push({type:"em_close",tag:"em",nesting:-1});const{node:k}=Eu(v,0,e.parseInlineTokens,e.options);e.pushParsed(k)}else if(A===2){v.push({type:"strong_close",tag:"strong",nesting:-1});const{node:k}=Ks(v,0,e.parseInlineTokens,void 0,e.options);e.pushParsed(k)}else if(A===3){v.push({type:"em_close",tag:"em",nesting:-1}),v.push({type:"strong_close",tag:"strong",nesting:-1});const{node:k}=Ks(v,0,e.parseInlineTokens,void 0,e.options);e.pushParsed(k)}else{const{node:k}=Eu(v,0,e.parseInlineTokens,e.options);e.pushParsed(k)}}else(s=e.options)!=null&&s.validateLink&&!e.options.validateLink(d)?e.pushText(u,u):e.pushParsed({type:"link",href:d,title:null,text:u,children:[{type:"text",content:u,raw:u}],loading:f,markup:""});const m=p!==-1?t.slice(p+1):"";return m&&(e.dispatchToken({type:"text",content:m,raw:m}),e.index--),e.index++,!0}return!1}function YM(e,t){const n=t.indexOf("![");if(n===-1)return!1;const r=t.slice(0,n);return r&&!e.currentTextNode?e.currentTextNode={type:"text",content:r,raw:r}:r&&e.currentTextNode&&(e.currentTextNode.content+=r),e.currentTextNode&&(e.result.push(e.currentTextNode),e.currentTextNode=null),e.pushParsed(Kk(t.slice(n))),e.index++,!0}function ZM(e,t){jM(e,t)||(e.resetCurrentTextNode(),e.pushParsed(Rk(t)),e.index++)}function VM(e,t){const n=t;if(t.type==="link"&&n.href!=null&&e.options.validateLink&&!e.options.validateLink(String(n.href))){e.resetCurrentTextNode();const r=String(n.text??"");e.pushText(r,r),e.index++}else zM(e,t)||WM(e,t)||Wk(e,t)||$k(e,t)||e.pushToken(t),e.index++}function WA(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 JM(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function jk(e,t,n,r){const i=[],{content:o,innerTokens:l,nextIndex:s}=yo(e,t,"s_close");return i.push(...n(l,void 0,void 0,r)),{node:{type:"strikethrough",children:i,raw:`~~${o}~~`},nextIndex:s}}function XM(e,t,n,r){const i=[],{content:o,innerTokens:l,nextIndex:s}=yo(e,t,"sub_close");i.push(...n(l,void 0,void 0,r));const a=String(e[t].content??""),u=o||a;return{node:{type:"subscript",children:i.length>0?i:[{type:"text",content:u,raw:u}],raw:`~${u}~`},nextIndex:s}}function qM(e,t,n,r){const i=[],{content:o,innerTokens:l,nextIndex:s}=yo(e,t,"sup_close");return i.push(...n(l,void 0,void 0,r)),{node:{type:"superscript",children:i.length>0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s}}const eT=/\s/u,tT=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,nT=new RegExp("\\p{P}","u"),rT=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,iT=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u;function oT(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 zk(e,t=0){if(!e)return-1;let n=0;for(let r=0;r<e.length;r++){const i=e[r],o=e[r+1];if(i==="\\"&&o&&np.has(o)){if(o==="*"&&n>=t){n++,r++;continue}n++,r++;continue}if(i==="*"&&n>=t)return n;n++}return-1}function Di(e){return!!e&&eT.test(e)}function Ri(e){return!!e&&(tT.test(e)||nT.test(e))}function Gk(e,t){return!!e&&!!t&&new RegExp("^\\p{Script=Han}$","u").test(t)&&rT.test(e)}function Qk(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&iT.test(e)}function lT(e,t){const n=t>0?e[t-1]:void 0,r=e[t+1];return!r||Di(r)?!1:!(Ri(r)&&!Gk(r,n)&&n&&!Di(n)&&!Ri(n))}function sT(e,t){const n=t>0?e[t-1]:void 0,r=e[t+1];return!n||Di(n)?!1:!(Ri(n)&&!Qk(n,r)&&r&&!Di(r)&&!Ri(r))}function aT(e,t,n=0){let r=n,i=!1;for(;r<t.length;){const o=e?zk(e,r):t.indexOf("*",r);if(o===-1)break;if(sT(t,o))return{index:o,sawInvalidClose:i};i=!0,r=o+1}return{index:-1,sawInvalidClose:i}}function uT(e,t){const n=t>0?e[t-1]:void 0,r=e[t+2];return!r||Di(r)?!1:!(Ri(r)&&!Gk(r,n)&&n&&!Di(n)&&!Ri(n))}function cT(e,t){const n=t>0?e[t-1]:void 0,r=e[t+2];return!n||Di(n)?!1:!(Ri(n)&&!Qk(n,r)&&r&&!Di(r)&&!Ri(r))}function fT(e,t=0){let n=t,r=!1;for(;n<e.length;){const i=e.indexOf("**",n);if(i===-1)break;if(cT(e,i))return{index:i,sawInvalidClose:r};r=!0,n=i+2}return{index:-1,sawInvalidClose:r}}const dT=/[\p{L}\p{N}]/u,hT=/^[\p{L}\p{N}]+$/u;function Nd(e){return e?dT.test(e):!1}function Uk(e){return e?hT.test(e):!1}function vs(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const r=t>0?e[t-1]:void 0,i=n<e.length?e[n]:void 0;return{len:n-t,prev:r,next:i,intraword:Nd(r)&&Nd(i)}}function pT(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const r=vs(e,n),i=n+r.len;r.len>=2&&r.intraword&&t.push({start:n,end:i}),n=i}for(let n=0;n<t.length-1;n++){const r=t[n],i=t[n+1];if(!Uk(e.slice(r.end,i.start)))return i.end}return-1}function gT(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function mT(e,t){let n=t;for(;n<e.length;){const r=e.indexOf("***",n);if(r===-1)return-1;const i=vs(e,r);if(i.len>=3)return r;n=r+i.len}return-1}function AT(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const vT=/[^~]*~{2,}[^~]+/,kT=/\*\*/,yT=/[[_*^~]/;function Yk(e,t){return t===e.tokens[e.index]}function Ld(e,t,n){var s,a;const r=Yk(e,n)&&e.tokens.length===1?e.raw:String(n.content??""),i=[],o=pT(t);if(o!==-1){e.pushText(t.slice(0,o),t.slice(0,o));const u=t.slice(o);return u&&(e.dispatchToken({type:"text",content:u,raw:u}),e.index--),e.index++,!0}if(vT.test(t)){const u=t.indexOf("~~");u!==-1&&i.push({type:"strikethrough",index:u})}if(kT.test(t)){const u=t.indexOf("**");u!==-1&&i.push({type:"strong",index:u})}if(/[^*]*\*[^*]+/.test(t)){const u=r?zk(r,0):t.indexOf("*");if(r&&u===-1)return!1;u!==-1&&i.push({type:"emphasis",index:u})}i.sort((u,c)=>u.index!==c.index?u.index-c.index:u.type===c.type?0:u.type==="strong"?-1:c.type==="strong"?1:0);const l=i[0];if(!l)return!1;if(l.type==="strikethrough"){const u=l.index,c=u>-1?t.slice(0,u):"";if(c&&e.pushText(c,c),u===-1)return e.index++,!0;const p=t.indexOf("~~",u+2),d=p===-1?t.slice(u+2):t.slice(u+2,p),f=p===-1?"":t.slice(p+2),{node:g}=jk([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:d,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,e.parseInlineTokens,e.options);return e.resetCurrentTextNode(),e.pushParsed(g),f&&(e.dispatchToken({type:"text",content:f,raw:f}),e.index--),e.index++,!0}if(l.type==="strong"){const u=l.index,c=u>-1?t.slice(0,u):"";if(c&&e.pushText(c,c),u===-1)return e.index++,!0;if(e.raw&&u===0){let A=!1,v=0;for(;v<t.length&&t[v]==="*";)v++;if(e.raw.startsWith("\\*")&&(A=!0),A){let k=0,C=0;for(;C<e.raw.length&&k<v;)if(e.raw[C]==="\\"&&C+1<e.raw.length&&e.raw[C+1]==="*")k+=1,C+=2;else{if(e.raw[C]==="*")break;C++}if(k>=2)return e.pushText(t,t),e.index++,!0}}if(e.raw&&(t.match(/\*/g)||[]).length>oT(e.raw))return e.pushText(t.slice(c.length),t.slice(c.length)),e.index++,!0;const p=vs(t,u);if(p.len>=3){const A=mT(t,u+p.len);if(A!==-1){const v=t.slice(u+p.len,A);if(gT(v)){const{node:k}=Ks([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:v,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,e.parseInlineTokens,e.raw,e.options);e.resetCurrentTextNode(),e.pushParsed(k);const C=t.slice(A+3);return C&&(e.dispatchToken({type:"text",content:C,raw:C}),e.index--),e.index++,!0}}}if(!uT(t,u)){const A=t.slice(u,u+p.len);e.pushText(A,A);const v=t.slice(u+p.len);return v&&(e.dispatchToken({type:"text",content:v,raw:v}),e.index--),e.index++,!0}const d=fT(t,u+2);let f="",g="";if(d.index!==-1){f=t.slice(u+2,d.index),g=t.slice(d.index+2);const A=d.index,v=vs(t,A);if(p.intraword&&v.intraword&&!Uk(f)||!f&&p.len>=4&&p.intraword)return e.pushText(t.slice(c.length),t.slice(c.length)),e.index++,!0}else{if(e.requireClosingStrong||d.sawInvalidClose||p.intraword)return e.pushText(t.slice(c.length),t.slice(c.length)),e.index++,!0;f=t.slice(u+2),g=""}if(!f&&/^\*+$/.test(g))return e.pushText(t,t),e.index++,!0;const{node:m}=Ks([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:f,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,e.parseInlineTokens,e.raw,e.options);return e.resetCurrentTextNode(),e.pushParsed(m),g&&(e.dispatchToken({type:"text",content:g,raw:g}),e.index--),e.index++,!0}if(l.type==="emphasis"){let u=l.index;u===-1&&(u=0);const c=t.slice(0,u);if(c&&e.pushText(c,c),!lT(t,u)){e.pushText(t[u],t[u]);const A=t.slice(u+1);return A&&(e.dispatchToken({type:"text",content:A,raw:A}),e.index--),e.index++,!0}const p=vs(t,u),d=aT(r,t,u+1),f=d.index,g=e.tokens[e.index+1];if((s=e.options)!=null&&s.final&&(g==null?void 0:g.type)==="em_open"&&f!==-1&&t.slice(u+1,f).trim()!==t.slice(u+1,f)||f===-1&&(d.sawInvalidClose||(a=e.options)!=null&&a.final||p.intraword||!Nd(t[u+1])))return e.pushText(t.slice(u),t.slice(u)),e.index++,!0;const{node:m}=Eu([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:f>-1?t.slice(u+1,f):t.slice(u+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,e.parseInlineTokens,e.options);if(e.resetCurrentTextNode(),e.pushParsed(m),f!==-1&&f<t.length-1){const A=t.slice(f+1);A&&(e.dispatchToken({type:"text",content:A,raw:A}),e.index--)}return e.index++,!0}return!1}function CT(e,t,n){if(!t.includes("`"))return!1;const i=(d=>{for(let f=0;f<d.length;f++){if(d[f]!=="`")continue;let g=0;for(let m=f-1;m>=0&&d[m]==="\\";m--)g++;if(g%2===0)return f}return-1})(t);if(i===-1)return!1;let o=1;for(let d=i+1;d<t.length&&t[d]==="`";d++)o++;const l="`".repeat(o),s=i+o,a=t.indexOf(l,s);if(a===-1){if(o===1){const f=t.slice(0,i),g=t.slice(i+1);return f&&(Ld(e,f,n)?e.index--:e.pushText(f,f)),e.pushParsed({type:"inline_code",code:g,raw:String(g)}),e.index++,!0}let d=t;for(let f=e.index+1;f<e.tokens.length;f++)d+=String((e.tokens[f].content??"")+(e.tokens[f].markup??""));return e.index=e.tokens.length-1,e.pushText(d,d),e.index++,!0}e.resetCurrentTextNode();const u=t.slice(0,i),c=t.slice(i+o,a),p=t.slice(a+o);return u&&(Ld(e,u,n)?e.index--:e.pushText(u,u)),e.pushParsed({type:"inline_code",code:c,raw:String(c??"")}),p&&(e.dispatchToken({type:"text",content:p,raw:p}),e.index--),e.index++,!0}function bT(e,t){var l,s,a;const n=e.options.markdownIt;if(!n||e.tokens.length<=1||!e.tokens.some(u=>(u==null?void 0:u.type)==="math_inline")||!yT.test(t))return null;const r=n.parseInline(t,{__markstreamFinal:!!((l=e.options)!=null&&l.final)});if(!Array.isArray(r)||r.length===0)return null;const i=(((s=r.find(u=>(u==null?void 0:u.type)==="inline"))==null?void 0:s.children)??[]).filter(u=>!((u==null?void 0:u.type)==="text"&&String(u.content??"")===""));if(!i.length||!i.some(u=>(u==null?void 0:u.type)!=="text")||i.length===1&&((a=i[0])==null?void 0:a.type)==="text"&&String(i[0].content??"")===t)return null;const o=e.parseInlineTokens(i,t,e.pPreToken,e.options);return o.length?o:null}function KA(e,t,n,r,i,o=Fu(t)){var a,u,c;const l=AT({...n,content:t});if(e.currentTextNode){e.currentTextNode.content+=(a=e.options)!=null&&a.final?l.content:$A(l.content,n,o),e.currentTextNode.raw+=l.raw;return}const s=(r==null?void 0:r.tag)==="br"&&((u=e.tokens[e.index-2])==null?void 0:u.content)==="[";i||(l.content=(c=e.options)!=null&&c.final?l.content:$A(l.content,n,o)),e.currentTextNode=l,e.currentTextNode.center=s,e.result.push(e.currentTextNode)}function xT(e,t){var g,m,A,v,k,C,b;const n=String(t.content??""),r=Fu(n),i=(r&rp)!==0,o=Yk(e,t)&&e.tokens.length===1&&i&&typeof e.raw=="string"?String(e.raw):"";let l=o?TM(o):i?n.replace(Nk,"$1"):n;const s=l===n?r:Fu(l);if(t.content==="<"||l==="1"&&((g=e.tokens[e.index-1])==null?void 0:g.tag)==="br"){e.index++;return}const a=(s&Pk)!==0?l.indexOf("$"):-1;a!==-1&&a===l.lastIndexOf("$")&&l.endsWith("$")&&(l=l.slice(0,-1)),l.endsWith("undefined")&&!((m=e.raw)!=null&&m.endsWith("undefined"))&&(l=l.slice(0,-9));let u=e.result.length,c="";for(let S=e.result.length-1;S>=0;S--){const T=e.result[S];if(T.type!=="text")break;u=S,c=String(T.content??"")+c}u<e.result.length&&(l.startsWith(c)?(e.currentTextNode=null,e.result.length=u):e.currentTextNode=e.result[e.result.length-1]);const p=e.tokens[e.index+1];if(((A=e.options)==null?void 0:A.final)!==!0&&((l==="`"||l==="|"||l==="$")&&!mr(t,`\\${l}`)||/^\*+$/.test(l)&&!mr(t,"\\*"))){e.index++;return}if(!p&&((v=e.options)==null?void 0:v.final)!==!0&&(s&As)!==0&&/[^\]]\s*\(\s*$/.test(l)&&(l=l.replace(/\(\s*$/,"")),!l){e.index++;return}if((s&(ki|ss))===(ki|ss)&&KM(e,l)||(s&(cu|As))===(cu|As)&&GM(e,l))return;if((s&MM)===0){KA(e,l,t,e.tokens[e.index-1],p,s),e.index++;return}if((s&ki)!==0&&wT(e,l))return;const d=e.tokens[e.index-1];if((s&ki)!==0&&l==="["&&!((k=p==null?void 0:p.markup)!=null&&k.includes("*"))&&!mr(t,"\\[")||(s&cu)!==0&&l==="]"&&!((C=d==null?void 0:d.markup)!=null&&C.includes("*"))&&!mr(t,"\\]")){e.index++;return}if((s&Ok)!==0&&CT(e,n,t)||(s&(ss|ki))===(ss|ki)&&YM(e,l)||(s&ki)!==0&&(((b=e.tokens[e.index+1])==null?void 0:b.type)!=="link_open"||PM(e,l))&&UM(e,l,t))return;const f=bT(e,n);if(f){e.resetCurrentTextNode();for(const S of f)e.pushParsed(S);e.index++;return}Ld(e,l,t)||(KA(e,l,t,d,p,s),e.index++)}function wT(e,t){var r;if(!(t!=null&&t.startsWith("[")&&((r=e.pPreToken)==null?void 0:r.type)==="list_item_open"))return!1;const n=t.slice(1).match(/[^\s\]]/);if(n===null)return e.index++,!0;if(n&&/x/i.test(n[0])){const i=n[0]==="x"||n[0]==="X";return e.pushParsed({type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}),e.index++,!0}return!1}function _T(e,t){if(!e.currentTextNode||t.loading!==!0||t.markup!=="\\(\\)")return;const n=e.tokens[e.index-1];!n||n.type!=="text"||!mr(n,"\\(")||e.currentTextNode.content.endsWith("(")&&(e.currentTextNode.content=e.currentTextNode.content.slice(0,-1),e.currentTextNode.raw.endsWith("(")&&(e.currentTextNode.raw=e.currentTextNode.raw.slice(0,-1)),!e.currentTextNode.content&&e.result[e.result.length-1]===e.currentTextNode&&(e.result.pop(),e.currentTextNode=null))}function jA(e,t){var n,r;switch(t.type){case"text":xT(e,t);break;case"softbreak":e.currentTextNode?(e.currentTextNode.content+=`
143
+ `,e.currentTextNode.raw+=`
144
+ `):(e.currentTextNode={type:"text",content:`
145
+ `,raw:`
146
+ `},e.result.push(e.currentTextNode)),e.index++;break;case"code_inline":e.pushParsed(CM(t)),e.index++;break;case"html_inline":{const[i,o]=yM(t,e.tokens,e.index,e.parseInlineTokens,e.raw,e.pPreToken,e.options);e.pushParsed(i),e.index=o;break}case"link_open":$M(e,t);break;case"image":ZM(e,t);break;case"strong_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=Ks(e.tokens,e.index,e.parseInlineTokens,t.content,e.options);e.pushParsed(i),e.index=o;break}case"em_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=Eu(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(i),e.index=o;break}case"s_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=jk(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(i),e.index=o;break}case"mark_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=gM(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(i),e.index=o;break}case"ins_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=bM(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(i),e.index=o;break}case"sub_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=XM(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(i),e.index=o;break}case"sup_open":{e.resetCurrentTextNode();const{node:i,nextIndex:o}=qM(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(i),e.index=o;break}case"sub":e.resetCurrentTextNode(),e.pushParsed({type:"subscript",children:[{type:"text",content:String(t.content??""),raw:String(t.content??"")}],raw:`~${String(t.content??"")}~`}),e.index++;break;case"sup":e.resetCurrentTextNode(),e.pushParsed({type:"superscript",children:[{type:"text",content:String(t.content??""),raw:String(t.content??"")}],raw:`^${String(t.content??"")}^`}),e.index++;break;case"emoji":{e.resetCurrentTextNode();const i=e.tokens[e.index-1];(i==null?void 0:i.type)==="text"&&/\|:-+/.test(String(i.content??""))?e.pushText("",""):e.pushParsed(aM(t)),e.index++;break}case"checkbox":e.resetCurrentTextNode(),e.pushParsed(lM(t)),e.index++;break;case"checkbox_input":e.resetCurrentTextNode(),e.pushParsed(sM(t)),e.index++;break;case"footnote_ref":e.resetCurrentTextNode(),e.pushParsed(hM(t)),e.index++;break;case"footnote_anchor":{e.resetCurrentTextNode();const i=t.meta??{},o=String(i.label??t.content??"");e.pushParsed({type:"footnote_anchor",id:o,raw:String(t.content??"")}),e.index++;break}case"hardbreak":e.resetCurrentTextNode(),e.pushParsed(pM()),e.index++;break;case"fence":e.resetCurrentTextNode(),e.pushParsed(tc(e.tokens[e.index])),e.index++;break;case"math_inline":_T(e,t),e.resetCurrentTextNode(),!t.content&&t.markup==="$"&&((n=e.tokens[e.index+1])==null?void 0:n.type)==="text"&&((r=e.tokens[e.index+2])==null?void 0:r.type)==="math_inline"?(e.pushParsed(WA({...t,content:e.tokens[e.index+1].content})),e.index+=2):e.pushParsed(WA(t)),e.index++;break;case"reference":ST(e,t);break;case"text_special":e.pushText(String(t.content??""),String(t.content??"")),e.index++;break;default:VM(e,t);break}}function ST(e,t){e.resetCurrentTextNode(),e.pushParsed(JM(t)),e.index++}const IT=/[!$(*[\\\]_`|~]/;function Du(e,t,n,r){if(!e||e.length===0)return[];if(e.length===1&&e[0].type==="text"){const A=e[0].content;if(typeof A=="string"&&A&&A!=="<"&&!A.endsWith("undefined")&&!IT.test(A))return[{type:"text",content:A,raw:A,center:!1}]}let i=Js(r);const o=i.linkifyDemotionContext,l=Xs(t),s={filename:(o==null?void 0:o.filename)||l.filename,explicitFilename:(o==null?void 0:o.explicitFilename)||l.explicitFilename,marketTicker:(o==null?void 0:o.marketTicker)||l.marketTicker};(s.filename||s.explicitFilename||s.marketTicker)&&(i={...i,linkifyDemotionContext:s}),r=i;const a=r==null?void 0:r.requireClosingStrong,u=e,c={currentTextNode:null,index:0,options:i,parseInlineTokens:Du,pPreToken:n,raw:t,requireClosingStrong:a,result:[],tokens:e,dispatchToken:A=>jA(c,A),ensureWorkingTokens:p,pushParsed:f,pushText:m,pushToken:g,resetCurrentTextNode:d};function p(){return c.tokens===u&&(c.tokens=c.tokens.slice()),c.tokens}function d(){c.currentTextNode=null}function f(A){d(),c.result.push(A)}function g(A){d();const v=ko(A);v.type==="link"&&(v.markup=zh(A)),c.result.push(v)}function m(A,v){c.currentTextNode?(c.currentTextNode.content+=A,c.currentTextNode.raw+=v??A):(c.currentTextNode={type:"text",content:String(A??""),raw:String(v??A??"")},c.result.push(c.currentTextNode))}for(;c.index<c.tokens.length;){const A=c.tokens[c.index];jA(c,A)}return c.result}function ET(e){const t=new WeakSet,n=r=>{if(!r||typeof r!="object"||t.has(r))return;if(t.add(r),Array.isArray(r)){for(const o of r)n(o);return}const i=r;i.type==="html_block"&&i.loading===!0&&(i.loading=!1);for(const o of Object.values(i))n(o)};n(e)}function Zk(e,t){const n=t.postTransformNodes;if(typeof n!="function")return e;const r=n(e);return Array.isArray(r)?r:e}function MT(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const r=e.children;if(!(!Array.isArray(r)||r.length===0))for(;r.length;){const i=r[r.length-1];if(!i){r.pop();continue}if(i.type==="softbreak"||i.type==="hardbreak"){r.pop();continue}if(i.type==="text"){const o=String(i.content??""),l=o.replace(/[ \t\r\n]+$/g,"");if(l===o)break;if(l){i.content=l;break}r.pop();continue}break}}function TT(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 r=e.children;if(!(!Array.isArray(r)||r.length===0))for(;r.length;){const i=r[r.length-1];if(!i){r.pop();continue}if(i.type==="softbreak"||i.type==="hardbreak"){r.pop();continue}if(i.type==="text"){const o=String(i.content??"");if(/^[ \t\r\n\d.)]*$/.test(o)){r.pop();continue}const l=o.replace(/[ \t\r\n\d.)]+$/g,"");l!==o&&(l?i.content=l:r.pop())}break}}function BT(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function yl(e,t,n,r){const i=e[t],o=[],l=$i(n,!0);let s=t+1;for(;s<e.length&&e[s].type!=="bullet_list_close"&&e[s].type!=="ordered_list_close";)if(e[s].type==="list_item_open"){const u=[];let c=s+1;for(;c<e.length&&e[c].type!=="list_item_close";)if(e[c].type==="paragraph_open"){const d=e[c+1],f=BT(d)?ko(d):d,g=e[c-1];f!==d&&(TT(f),MT(f));const m=String(f.content??""),A={type:"paragraph",children:r(f.children||[],m,g,l.options()),raw:m};n!=null&&n.includeSourceMap&&dt(A,e[c],n),u.push(A),l.remember(m),c+=3}else if(e[c].type==="blockquote_open"){const[d,f]=Cl(e,c,l.options(),r);u.push(d),l.remember(d.raw),c=f}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=yl(e,c,l.options(),r);u.push(d),l.remember(d.raw),c=f}else{const d=lp(e,c,l.options(),ip,r);d?(u.push(d[0]),l.remember(d[0].raw),c=d[1]):c+=1}const p={type:"list_item",children:u,raw:u.map(d=>d.raw).join("")};n!=null&&n.includeSourceMap&&dt(p,e[s],n),o.push(p),s=c+1}else s+=1;const a={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const u=i.attrs.find(c=>c[0]==="start");if(u){const c=Number(u[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:o,raw:o.map(u=>u.raw).join(`
147
+ `)};return n!=null&&n.includeSourceMap&&dt(a,i,n),[a,s+1]}function FT(e,t,n,r,i){const o=String(n[1]??"note"),l=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),s=[],a=$i(r,!0);let u=t+1;for(;u<e.length&&e[u].type!=="container_close";)if(e[u].type==="paragraph_open"){const c=e[u+1];if(c){const p={type:"paragraph",children:i(c.children||[],String(c.content??""),void 0,a.options()),raw:String(c.content??"")};r!=null&&r.includeSourceMap&&dt(p,e[u],r),s.push(p),a.remember(p.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[c,p]=yl(e,u,a.options(),i);r!=null&&r.includeSourceMap&&dt(c,e[u],r),s.push(c),a.remember(c.raw),u=p}else if(e[u].type==="blockquote_open"){const[c,p]=Cl(e,u,a.options(),i);r!=null&&r.includeSourceMap&&dt(c,e[u],r),s.push(c),a.remember(c.raw),u=p}else{const c=ic(e,u,a.options(),i);c?(s.push(c[0]),a.remember(c[0].raw),u=c[1]):u++}return[{type:"admonition",kind:o,title:l,children:s,raw:`:::${o} ${l}
148
+ ${s.map(c=>c.raw).join(`
149
+ `)}
150
+ :::`},u+1]}const DT=new Set(["warning","info","note","tip","danger","caution"]);function RT(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 r=n.search(/\s/),i=(r===-1?n:n.slice(0,r)).toLowerCase();return DT.has(i)?{kind:i,title:r===-1?"":n.slice(r).trim()}:null}function NT(e,t,n,r){const i=e[t];let o="note",l="";const s=i.type.match(/^container_(\w+)_open$/);if(s){o=s[1];const d=String(i.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const f=d.slice(o.length).trim();f&&(l=f)}}else{const d=RT(String(i.info??"").trim());d&&(o=d.kind,l=d.title)}l||(l=o.charAt(0).toUpperCase()+o.slice(1));const a=[],u=$i(n,!0);let c=t+1;const p=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!p.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let g=-1;for(let A=f.length-1;A>=0;A--){const v=f[A];if(v.type==="text"&&/:+/.test(v.content)){g=A;break}}const m={type:"paragraph",children:r((g!==-1?f.slice(0,g):f)||[],void 0,void 0,u.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n!=null&&n.includeSourceMap&&dt(m,e[c],n),a.push(m),u.remember(m.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=yl(e,c,u.options(),r);n!=null&&n.includeSourceMap&&dt(d,e[c],n),a.push(d),u.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Cl(e,c,u.options(),r);n!=null&&n.includeSourceMap&&dt(d,e[c],n),a.push(d),u.remember(d.raw),c=f}else{const d=ic(e,c,u.options(),r);d?(a.push(d[0]),u.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:l,children:a,raw:`:::${o} ${l}
151
+ ${a.map(d=>d.raw).join(`
152
+ `)}
153
+ :::`},c+1]}const LT=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function OT(e,t,n,r){const i=e[t];if(i.type!=="container_open")return null;const o=LT.exec(String(i.info??""));return o?FT(e,t,o,n,r):null}const ip={parseContainer:(e,t,n,r)=>NT(e,t,n,r),matchAdmonition:OT};function Cl(e,t,n,r){const i=[],o=$i(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="blockquote_close";){const a=e[l];switch(a.type){case"paragraph_open":{const u=e[l+1],c={type:"paragraph",children:r(u.children||[],String(u.content??""),void 0,o.options()),raw:String(u.content??"")};n!=null&&n.includeSourceMap&&dt(c,a,n),i.push(c),o.remember(c.raw),l+=3;break}case"bullet_list_open":case"ordered_list_open":{const[u,c]=yl(e,l,o.options(),r);i.push(u),o.remember(u.raw),l=c;break}case"blockquote_open":{const[u,c]=Cl(e,l,o.options(),r);i.push(u),o.remember(u.raw),l=c;break}default:{const u=lp(e,l,o.options(),ip,r);u?(i.push(u[0]),o.remember(u[0].raw),l=u[1]):l++;break}}}const s={type:"blockquote",children:i,raw:i.map(a=>a.raw).join(`
154
+ `)};return n!=null&&n.includeSourceMap&&dt(s,e[t],n),[s,l+1]}function PT(e){var o;if((o=e.info)!=null&&o.startsWith("diff"))return tc(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let r=t;n!=null&&n[1]&&(r=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const i=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:r,raw:r,loading:!i}}function $T(e,t,n,r){const i=[];let o=t+1,l=[],s=[];const a=$i(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const u=e[o+1];l=r(u.children||[],void 0,void 0,a.options()),a.remember(l.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let u=o+1;for(s=[];u<e.length&&e[u].type!=="dd_close";)if(e[u].type==="paragraph_open"){const c=e[u+1];s.push({type:"paragraph",children:r(c.children||[],String(c.content??""),void 0,a.options()),raw:String(c.content??"")}),a.remember(String(c.content??"")),u+=3}else u++;l.length>0&&(i.push({type:"definition_item",term:l,definition:s,raw:`${l.map(c=>c.raw).join("")}: ${s.map(c=>c.raw).join(`
155
+ `)}`}),l=[]),o=u+1}else o++;return[{type:"definition_list",items:i,raw:i.map(u=>u.raw).join(`
156
+ `)},o+1]}function HT(e,t,n,r){const i=e[t].meta??{},o=String((i==null?void 0:i.label)??"0"),l=[],s=$i(n,!0);let a=t+1;for(;a<e.length&&e[a].type!=="footnote_close";)if(e[a].type==="paragraph_open"){const u=e[a+1],c=u.children?[...u.children]:[];e[a+2].type==="footnote_anchor"&&c.push(e[a+2]);const p={type:"paragraph",children:r(c,String(u.content??""),void 0,s.options()),raw:String(u.content??"")};l.push(p),s.remember(p.raw),a+=3}else a++;return[{type:"footnote",id:o,children:l,raw:`[^${o}]: ${l.map(u=>u.raw).join(`
157
+ `)}`},a+1]}function WT(e,t,n,r){var p;const i=e[t],o=i.attrs,l=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(d=>Array.isArray(d)&&d.length>=1&&d[0]).map(([d,f])=>[String(d),f==null||f===""?!0:String(f)])):void 0,s=String(((p=i.tag)==null?void 0:p.substring(1))??"1"),a=Number.parseInt(s,10),u=e[t+1],c=String(u.content??"");return{type:"heading",level:a,text:c,...l?{attrs:l}:{},children:r(u.children||[],c,void 0,n),raw:c}}function KT(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 jT(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,r]=t;if(!r)continue;const i=String(r).trim().toLowerCase();if(n==="style"){const o=/text-align\s*:\s*(left|right|center)/i.exec(i);if(o)return o[1].toLowerCase()}}return"left"}function Vk(e){return(e==null?void 0:e.filename)===!0||(e==null?void 0:e.explicitFilename)===!0||(e==null?void 0:e.marketTicker)===!0}function Jk(e,t){const n={filename:(e==null?void 0:e.filename)||(t==null?void 0:t.filename),explicitFilename:(e==null?void 0:e.explicitFilename)||(t==null?void 0:t.explicitFilename),marketTicker:(e==null?void 0:e.marketTicker)||(t==null?void 0:t.marketTicker)};return Vk(n)?n:void 0}function zT(e,t,n){const r=Jk(Xs(t),n);if(!Vk(r))return e;const i=Js(e),o=i.linkifyDemotionContext;return{...i,linkifyDemotionContext:{filename:(o==null?void 0:o.filename)||(r==null?void 0:r.filename),explicitFilename:(o==null?void 0:o.explicitFilename)||(r==null?void 0:r.explicitFilename),marketTicker:(o==null?void 0:o.marketTicker)||(r==null?void 0:r.marketTicker)}}}function GT(e,t,n,r){var u;let i=t+1,o=null;const l=[];let s=!1;for(;i<e.length&&e[i].type!=="table_close";)if(e[i].type==="thead_open")s=!0,i++;else if(e[i].type==="thead_close")s=!1,i++;else if(e[i].type==="tbody_open"||e[i].type==="tbody_close")i++;else if(e[i].type==="tr_open"){const c=[];let p=i+1,d;for(;p<e.length&&e[p].type!=="tr_close";)if(e[p].type==="th_open"||e[p].type==="td_open"){const g=e[p].type==="th_open",m=e[p+1],A=String(m.content??""),v=jT(e[p].attrs),k=c.length,C=!g&&!s,b=C?(u=o==null?void 0:o.cells[k])==null?void 0:u.raw:void 0;c.push({type:"table_cell",header:g||s,children:r(m.children||[],A,void 0,zT(n,b,C?d:void 0)),raw:A,align:v}),C&&(d=Jk(d,Xs(A))),p+=3}else p++;const f={type:"table_row",cells:c,raw:c.map(g=>g.raw).join("|")};s?o=f:l.push(f),i=p+1}else i++;o||(o={type:"table_row",cells:[],raw:""});const a=e[t].loading===!0;return[{type:"table",header:o,rows:l,loading:a&&!(n!=null&&n.final)&&l.length===0,raw:[o,...l].map(c=>c.raw).join(`
158
+ `)},i+1]}function QT(){return{type:"thematic_break",raw:"---"}}let Qf=null;const Uf=new WeakMap;function zA(){return Qf||(Qf={allowedTagSet:nc(),customTagSet:null}),Qf}function UT(e){if(!e||e.length===0)return zA();const t=Uf.get(e);if(t)return t;const n=e.map(cr).filter(Boolean);if(!n.length){const i=zA();return Uf.set(e,i),i}const r={allowedTagSet:nc({customHtmlTags:e}),customTagSet:new Set(n)};return Uf.set(e,r),r}function YT(e,t,n,r){var g;const i=e[t],o=i.attrs;let l="";const s={};if(o){for(const[m,A]of o)if(m==="class"){const v=A.match(/(?:\s|^)vmr-container-(\S+)/);v&&(l=v[1])}else if(m.startsWith("data-")){const v=m.slice(5);try{s[v]=JSON.parse(A)}catch{s[v]=A}}}const a=[],u=$i(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const m=e[c+1];if(m){const A={type:"paragraph",children:r(m.children||[],void 0,void 0,u.options()),raw:String(m.content??"")};n!=null&&n.includeSourceMap&&dt(A,e[c],n),a.push(A),u.remember(A.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[m,A]=yl(e,c,u.options(),r);n!=null&&n.includeSourceMap&&dt(m,e[c],n),a.push(m),u.remember(m.raw),c=A}else if(e[c].type==="blockquote_open"){const[m,A]=Cl(e,c,u.options(),r);n!=null&&n.includeSourceMap&&dt(m,e[c],n),a.push(m),u.remember(m.raw),c=A}else{const m=ic(e,c,u.options(),r);m?(a.push(m[0]),u.remember(m[0].raw),c=m[1]):c++}const p=c<e.length&&e[c].type==="vmr_container_close",d=p&&((g=i.meta)==null?void 0:g.unclosed)!==!0||!!(n!=null&&n.final);let f=`::: ${l}`;return Object.keys(s).length>0&&(f+=` ${JSON.stringify(s)}`),f+=`
159
+ `,a.length>0&&(f+=i.raw??a.map(m=>m.raw).join(`
160
+ `),f+=`
161
+ `),f+=":::",[{type:"vmr_container",name:l,loading:!d,attrs:Object.keys(s).length>0?s:void 0,children:a,raw:f},p?c+1:c]}function Yf(e,t,n,r){if(n!=null&&n.type.endsWith("_close")){let i=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(i)||(i=Array.isArray(t.map)?Number(t.map[1])+1:NaN),u3(e,t,i,r)}return dt(e,t,r)}function ZT(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}const GA=new Map;function op(e){let t=GA.get(e);if(t)return t;const n=Rr(e);return t={strip:new RegExp(`[\\t ]*<\\s*\\/\\s*${n}[^>]*$`,"i"),search:new RegExp(`<\\s*${n}(?=\\s|>|/)`,"gi"),openAny:new RegExp(`<\\s*${n}(?=\\s|>|/)`,"gi"),closeAny:new RegExp(`<\\s*\\/\\s*${n}(?=\\s|>)`,"gi")},GA.set(e,t),t}function VT(e,t){if(!e||!t)return e;const n=op(t).strip;return e.replace(n,"")}function JT(e,t,n){var s,a;if(!e||!t)return null;const{openAny:r,closeAny:i}=op(t.toLowerCase());let o=0,l=Math.max(0,n);for(;l<e.length;){const u=e.indexOf("<",l);if(u===-1)break;if(i.lastIndex=u,((s=i.exec(e))==null?void 0:s.index)===u){const c=Xt(e.slice(u));if(c===-1)return null;if(o===0)return{start:u,end:u+c+1};o--,l=u+c+1;continue}if(r.lastIndex=u,((a=r.exec(e))==null?void 0:a.index)===u){const c=Xt(e.slice(u));if(c===-1)return null;const p=e.slice(u,u+c+1);/\/\s*>$/.test(p)||o++,l=u+c+1;continue}l=u+1}return null}function XT(e,t,n){if(!e||!t)return null;const{search:r,openAny:i,closeAny:o}=op(t.toLowerCase());r.lastIndex=Math.max(0,n||0);const l=r.exec(e);if(!l||l.index==null)return null;const s=l.index,a=e.slice(s),u=Xt(a);if(u===-1)return null;const c=s+u;if(/\/\s*>\s*$/.test(a.slice(0,u+1))){const m=c+1;return{raw:e.slice(s,m),start:s,end:m}}let p=1,d=c+1;const f=m=>{var A;return i.lastIndex=m,((A=i.exec(e))==null?void 0:A.index)===m},g=m=>{var A;return o.lastIndex=m,((A=o.exec(e))==null?void 0:A.index)===m};for(;d<e.length;){const m=e.indexOf("<",d);if(m===-1)return{raw:e.slice(s),start:s,end:e.length};if(g(m)){const A=e.indexOf(">",m);if(A===-1)return null;if(p--,p===0){const v=A+1;return{raw:e.slice(s,v),start:s,end:v}}d=A+1;continue}if(f(m)){const A=Xt(e.slice(m));if(A===-1)return null;p++,d=m+A+1;continue}d=m+1}return{raw:e.slice(s),start:s,end:e.length}}function Od(e){return Number.isFinite(e)&&e>0?e:0}function qT(e,t){const n=Od(t);if(!e||n<=0)return 0;let r=0;for(let i=0;i<e.length;i++)if(e[i]===`
162
+ `&&(r++,r===n))return i+1;return e.length}function ic(e,t,n,r){var l,s,a;const i=e[t],o=(n==null?void 0:n.includeSourceMap)===!0;switch(i.type){case"heading_open":{const u=WT(e,t,n,r);return o&&dt(u,i,n),[u,t+3]}case"code_block":{const u=PT(i);return o&&dt(u,i,n),[u,t+1]}case"fence":{const u=tc(i);return o&&dt(u,i,n),[u,t+1]}case"math_block":{const u=KT(i);return o&&dt(u,i,n),[u,t+1]}case"html_block":{const u=yk(i),c=u.tag?UT(n==null?void 0:n.customHtmlTags):null;if(u.tag&&u.loading&&c&&!c.allowedTagSet.has(u.tag)){const p=String(i.content??"").replace(/\n+$/,""),d={type:"paragraph",children:p?[{type:"text",content:p,raw:p}]:[],raw:p};return o&&dt(d,i,n),[d,t+1]}if(u.tag&&((l=c==null?void 0:c.customTagSet)!=null&&l.has(u.tag))){const p=u.tag,d=qu(n)?n:void 0,f=String((d==null?void 0:d.sourceMarkdown)??""),g=Number((d==null?void 0:d.customHtmlBlockCursor)??0),m=Number(((s=i.map)==null?void 0:s[0])??0),A=Array.isArray(i.map)?((a=d==null?void 0:d.sourceLineOffsets)==null?void 0:a[m])??qT(f,m):0,v=XT(f,p,Math.max(Od(g),Od(A)));v&&d&&(d.customHtmlBlockCursor=v.end);const k=String((v==null?void 0:v.raw)??u.raw??""),C=Xt(k),b=C!==-1?k.slice(0,C+1):k,S=C!==-1&&/\/\s*>\s*$/.test(b),T=C===-1?null:JT(k,p,C+1),M=(T==null?void 0:T.start)??-1;let E="";C!==-1&&(M!==-1&&C<M?E=k.slice(C+1,M):E=k.slice(C+1)),M===-1&&(E=VT(E,p));const $=[],X=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let K;for(;(K=X.exec(b))!==null;){const P=K[1];if(!P||P.toLowerCase()===p)continue;const _=K[2]||K[3]||K[4]||"";$.push([P,_])}const I=!(n!=null&&n.final)&&!S&&T==null,B={type:p,tag:p,content:ZT(E),raw:String((v==null?void 0:v.raw)??u.raw??k),loading:I,attrs:$.length?$:void 0};return o&&(v?B.sourceMap=Ws(f,v.start,v.end,n):dt(B,i,n)),[B,t+1]}return o&&dt(u,i,n),[u,t+1]}case"table_open":{const[u,c]=GT(e,t,n,r);return o&&dt(u,i,n),[u,c]}case"dl_open":{const[u,c]=$T(e,t,n,r);return o&&dt(u,i,n),[u,c]}case"footnote_open":{const[u,c]=HT(e,t,n,r);return o&&dt(u,i,n),[u,c]}case"hr":{const u=QT();return o&&dt(u,i,n),[u,t+1]}}return null}function lp(e,t,n,r,i){const o=ic(e,t,n,i);if(o)return o;const l=e[t],s=(n==null?void 0:n.includeSourceMap)===!0;switch(l.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(r!=null&&r.parseContainer){const a=r.parseContainer(e,t,n,i);return s&&Yf(a[0],l,e[a[1]-1],n),a}break;case"container_open":if(r!=null&&r.matchAdmonition){const a=r.matchAdmonition(e,t,n,i);if(a)return s&&Yf(a[0],l,e[a[1]-1],n),a}break;case"vmr_container_open":{const a=YT(e,t,n,i);return s&&Yf(a[0],l,e[a[1]-1],n),a}}return null}function eB(){return{type:"hardbreak",raw:`\\
163
+ `}}function tB(e,t,n,r){const i=e[t+1],o=String(i.content??"");return{type:"paragraph",children:r(i.children||[],o,void 0,n),raw:o}}function Fr(e,t,n){const r=t==null?void 0:t.map,i=n.sourceMarkdown,o=n.runtime;if(!Array.isArray(r)||r.length<2||typeof i!="string"||!o)return;const l=Number(r[0]),s=Number(r[1]);if(!Number.isFinite(l)||!Number.isFinite(s))return;let a=n.sourceLineOffsets;if(!a){a=[0];for(let u=0;u<i.length;u++)i[u]===`
164
+ `&&a.push(u+1);n.sourceLineOffsets=a}o.nodeSourceRanges.set(e,{start:a[Math.max(0,Math.trunc(l))]??i.length,end:a[Math.max(0,Math.trunc(s))]??i.length})}function QA(e,t){return t.nodeSourceRanges.get(e)}const UA=new Map;function nB(e){const t=e==null?void 0:e.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=t.join("\0"),r=UA.get(n);if(r)return r;const i=Pi(t),o=i.length?new Set(i):null;return o&&UA.set(n,o),o}function rB(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 YA(e){return{type:"paragraph",children:e,raw:e.map(rB).join("")}}function ZA(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function VA(e,t){if(e.type!=="paragraph")return null;const n=e.children,r=Array.isArray(n)?n:[];if(r.length===0)return null;const i=nB(t);if(!(i!=null&&i.size))return null;let o=-1;for(let c=0;c<r.length;c++){const p=r[c];if(!i.has(String((p==null?void 0:p.type)??"").toLowerCase()))continue;const d=r.slice(0,c);if(String(p.content??"").trim()&&d.some(f=>(f==null?void 0:f.type)==="hardbreak")){o=c;break}}if(o===-1)return null;const l=r.slice(0,o),s=r[o];if(!s)return null;const a=[];l.length&&a.push(YA(l)),a.push(s);const u=r.slice(o+1);return u.length&&a.push(YA(u)),a}function JA(e,t,n){var a;if(!e||!Array.isArray(e))return[];const r=[],i=[],o=$i(t),l=(t==null?void 0:t.includeSourceMap)===!0;let s=0;for(;s<e.length;){const u=lp(e,s,o.options(),ip,n);if(u){Fr(u[0],e[s],t),r.push(u[0]),o.remember(u[0].raw),i.push(o.snapshot()),s=u[1];continue}const c=e[s];switch(c.type){case"paragraph_open":{const d=String(((a=e[s+1])==null?void 0:a.content)??""),f=tB(e,s,o.options(d),n);l&&dt(f,c,t);const g=VA(f,t);if(g){l&&ZA(g,f);for(const m of g)Fr(m,c,t);r.push(...g)}else Fr(f,c,t),r.push(f);o.remember(f.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[d,f]=yl(e,s,o.options(),n);l&&dt(d,c,t),Fr(d,c,t),r.push(d),o.remember(d.raw),s=f;break}case"blockquote_open":{const[d,f]=Cl(e,s,o.options(),n);l&&dt(d,c,t),Fr(d,c,t),r.push(d),o.remember(d.raw),s=f;break}case"footnote_anchor":{const d=c.meta??{},f={type:"footnote_anchor",id:String(d.label??c.content??""),raw:String(c.content??"")};l&&dt(f,c,t),Fr(f,c,t),r.push(f),o.remember(String(c.content??"")),s++;break}case"hardbreak":r.push(eB()),o.reset(),s++;break;case"text":{const d=String(c.content??""),f={type:"paragraph",raw:d,children:d?[{type:"text",content:d,raw:d}]:[]};l&&dt(f,c,t),Fr(f,c,t),r.push(f),o.remember(d),s++;break}case"inline":{const d=String(c.content??""),f=n(c.children||[],d,void 0,o.options(d));if(f.length!==0)if(f.every(g=>g.type==="html_block")){if(l)for(const g of f)dt(g,c,t);for(const g of f)Fr(g,c,t);r.push(...f)}else{const g={type:"paragraph",raw:d,children:f};l&&dt(g,c,t);const m=VA(g,t);if(m){l&&ZA(m,g);for(const A of m)Fr(A,c,t);r.push(...m)}else Fr(g,c,t),r.push(g)}o.remember(d)}s+=1;break;default:s+=1;break}const p=o.snapshot();for(;i.length<r.length;)i.push(p)}return t.linkifyDemotionResultContexts=i,r}function iB(e,t){const n=e.sourceLineOffsets;if((n==null?void 0:n.source)===t)return n.offsets;if(n&&t.length>n.source.length&&e.sourceExtends(n.source,t)){const i=n.offsets;for(let o=n.source.length;o<t.length;o++)t.charCodeAt(o)===10&&i.push(o+1);return n.source=t,i}const r=Xk(t);return e.sourceLineOffsets={source:t,offsets:r},r}function Xk(e){const t=[0];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t.push(n+1);return t}const al=new WeakMap,XA=new WeakSet,qA=new WeakSet;function oB(e,t){return e.customHtmlTags===t.customHtmlTags&&e.hasCustomParserExtensions===t.hasCustomParserExtensions&&e.includeSourceMap===t.includeSourceMap&&e.postTransformNodes===t.postTransformNodes&&e.postTransformTokens===t.postTransformTokens&&e.preTransformTokens===t.preTransformTokens&&e.requireClosingStrong===t.requireClosingStrong&&e.reuseStableTopLevelNodes===t.reuseStableTopLevelNodes&&e.streamParse===t.streamParse&&e.validateLink===t.validateLink}var lB=class{constructor(e){this.streamParseEnvs=new Map,this.htmlPassIdentityPreserving=!1,this.detailsStitchCache=new WeakMap,this.nodeSourceRanges=new WeakMap,this.finalized=!1,this.resettingStream=!1,this.streamStateActive=!1,this.streamResetInCurrentRootParse=!1,this.markdownIt=e}sourceExtends(e,t){return this.sourceRelationPrevious===e&&this.sourceRelationCurrent===t?!0:t.startsWith(e)?(this.sourceRelationPrevious=e,this.sourceRelationCurrent=t,!0):!1}beginRootParse(e,t){this.streamResetInCurrentRootParse=!1;const n=this.documentSource!==void 0&&e!==this.documentSource&&!this.sourceExtends(this.documentSource,e),r=this.semantics!==void 0&&!oB(this.semantics,t);(this.finalized||n||r)&&this.resetDocument(this.streamStateActive),this.finalized=!1,this.documentSource=e,this.semantics=t}finishRootParse(e){this.sourceRelationPrevious=void 0,this.sourceRelationCurrent=void 0,e&&(this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!0)}resetForFinalAutoParse(){this.streamResetInCurrentRootParse||this.resetStreamOnly(),this.clearDocumentCaches()}markStreamParseStarted(){this.streamStateActive=!0}resetDocument(e){e&&this.resetStreamOnly(),this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!1}resetStreamOnly(){const e=this.markdownIt.stream,t=e==null?void 0:e.reset;if(!(!e||typeof t!="function")){this.resettingStream=!0;try{t.call(e),this.streamStateActive=!1,this.streamResetInCurrentRootParse=!0}finally{this.resettingStream=!1}}}isResettingStream(){return this.resettingStream}handleExternalStreamReset(){this.streamStateActive=!1,this.streamResetInCurrentRootParse=!0,this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!1}invalidateConfiguration(){this.resetDocument(!0)}dispose(){this.resetDocument(!0),al.delete(this.markdownIt)}clearDocumentCaches(){this.safeMarkdown=void 0,this.tolerantMathBoundary=void 0,this.pendingExplicitMathTail=void 0,this.streamParseEnvs.clear(),this.topLevelStreamParseMode=void 0,this.structuredStream=void 0,this.htmlPassIdentityPreserving=!1,this.siblingHtmlChildren=void 0,this.detailsStitchCache=new WeakMap,this.nodeSourceRanges=new WeakMap,this.sourceLineOffsets=void 0,this.sourceRelationPrevious=void 0,this.sourceRelationCurrent=void 0}};function sB(e){const t=e,n=e;if(!XA.has(t)){XA.add(t);const l=e.use;e.use=function(...a){var u;try{return n.__markstreamHasCustomParserExtensions=!0,Reflect.apply(l,this,a)}finally{(u=al.get(t))==null||u.invalidateConfiguration()}};const s=e.set;e.set=function(...a){var u;try{return Reflect.apply(s,this,a)}finally{(u=al.get(t))==null||u.invalidateConfiguration()}}}const r=e.stream;if(!r||typeof r.reset!="function")return;const i=r;if(qA.has(i))return;qA.add(i);const o=r.reset;r.reset=function(...l){const s=al.get(t);try{return Reflect.apply(o,this,l)}finally{s!=null&&s.isResettingStream()||s==null||s.handleExternalStreamReset()}}}function aB(e){const t=e;let n=al.get(t);return n||(n=new lB(e),al.set(t,n)),sB(e),n}function e0(e,t){if(e===t)return;const n=e.split(/\r?\n/),r=t.split(/\r?\n/),i=[];let o=0;for(let l=0;l<r.length;l++){const s=r[l]??"";if(n[o]===s){i[l]={startLine:o,endLine:o+1},o++;continue}const a=n[o]??"";if(s!==""&&a!==s&&a.startsWith(s)){let f=s,g=-1;for(let m=l+1;m<r.length;m++){if(f+=r[m]??"",f===a){g=m;break}if(!a.startsWith(f))break}if(g!==-1){for(let m=l;m<=g;m++)i[m]={startLine:o,endLine:o+1};o++,l=g;continue}i[l]={startLine:o,endLine:o+1};continue}let u=n[o]??"",c=-1;for(let f=o+1;f<n.length;f++){if(u+=`\\n${n[f]??""}`,u===s){c=f+1;break}if(!s.startsWith(u))break}if(c!==-1){i[l]={startLine:o,endLine:c},o=c;continue}let p=-1;if(s!==""){const f=Math.min(n.length,o+80);for(let g=o;g<f;g++)if(n[g]===s){p=g;break}}if(p!==-1){i[l]={startLine:p,endLine:p+1},o=p+1;continue}const d=Math.min(Math.max(0,n.length-1),Math.max(0,o-1));i[l]={startLine:d,endLine:d+1}}return l=>{const s=Number.isFinite(l)?Math.max(0,Math.trunc(l)):0;if(s<i.length)return i[s]??{startLine:0,endLine:0};const a=i[i.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},u=Math.min(n.length,a.endLine+s-i.length);return{startLine:u,endLine:Math.min(n.length,u+1)}}}const ja=new Map;function uB(e){let t=ja.get(e);return t||(t=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${e}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim"),ja.size>=64&&ja.clear(),ja.set(e,t)),t}function cB(e){const t=l=>l===" "||l===" "||l===`
165
+ `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let s=1;if(s<l.length&&t(l[s])||l.startsWith("<!--")||l.startsWith("<?")||l.startsWith("<!")||l[s]==="/"&&(s++,s<l.length&&t(l[s])))return!1;const a=g=>{const m=g.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122},u=g=>{const m=g.charCodeAt(0);return m>=48&&m<=57},c=g=>g==="!"||a(g),p=g=>a(g)||u(g)||g===":"||g==="-",d=g=>a(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",f=d;if(s>=l.length||!c(l[s]))return!1;for(s++;s<l.length&&p(l[s]);)s++;for(;s<l.length;){for(;s<l.length&&t(l[s]);)s++;if(s>=l.length)return!0;if(l[s]==="/"){for(s++;s<l.length&&t(l[s]);)s++;return s>=l.length}if(!d(l[s]))return!1;for(s++;s<l.length&&f(l[s]);)s++;for(;s<l.length&&t(l[s]);)s++;if(s<l.length&&l[s]==="="){for(s++;s<l.length&&t(l[s]);)s++;if(s>=l.length)return!0;const g=l[s];if(g==='"'||g==="'"){for(s++;s<l.length&&l[s]!==g;)s++;if(s>=l.length)return!0;s++}else{for(;s<l.length;){const m=l[s];if(t(m)||m==="<"||m===">"||m==='"'||m==="'"||m==="`")break;s++}if(s>=l.length)return!0}}}return!0},r=String(e??""),i=r.lastIndexOf("<");if(i===-1)return r;if(i>0){const l=r[i-1],s=l===" "||l===" "||l===`
166
+ `||l==="\r",a=r[i-2];if(!s&&!((l==="n"||l==="r")&&a==="\\"))return r}const o=r.slice(i);return o.includes(">")||o.length>1&&(o[1]===" "||o[1]===" "||o[1]===`
167
+ `||o[1]==="\r")||!n(o)||xk(r,i)?r:r.slice(0,i)}function fB(e,t){if(!e||!t.length)return e;const n=new Set(t.map(g=>String(g??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const r=g=>g===" "||g===" ",i=g=>{const m=g.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||g==="_"||g==="-"||g===":"},o=g=>{if(!g)return!1;if(g[0]===" ")return!0;let m=0;for(let A=0;A<g.length;A++){const v=g[A];if(v===" "){if(m++,m>=4)return!0;continue}if(v===" ")return!0;break}return!1},l=g=>{let m=!1,A=!1;for(let v=0;v<g.length;v++){const k=g[v];if(k==="\\"){v++;continue}if(!A&&k==="'"){m=!m;continue}if(!m&&k==='"'){A=!A;continue}if(!m&&!A&&k===">")return v}return-1},s=g=>{let m=0;for(;m<g.length&&r(g[m]);)m++;const A=g[m];if(A!=="`"&&A!=="~")return null;let v=m;for(;v<g.length&&g[v]===A;)v++;const k=v-m;return k<3?null:{markerChar:A,markerLen:k,rest:g.slice(v)}},a=(g,m)=>{if(o(g))return-1;const A=g.replace(/^[ \t]+/,"");if(!A||A.startsWith(">")||A.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(A))return-1;let v=!1,k=0;for(;k<g.length;){const C=g[k];if(C!=="<"){r(C)||(v=!0),k++;continue}const b=l(g.slice(k));if(b===-1){v=!0,k++;continue}const S=g.slice(k,k+b+1);let T=1;for(;T<S.length&&r(S[T]);)T++;if(T>=S.length){v=!0,k++;continue}const M=S[T];if(M==="!"||M==="?"){v=!0,k+=b+1;continue}if(M==="/"){v=!0,k+=b+1;continue}const E=T;for(;T<S.length&&i(S[T]);)T++;if(T===E){v=!0,k++;continue}const $=S.slice(E,T).toLowerCase(),X=S[T];if(X&&X!==" "&&X!==" "&&X!==">"&&X!=="/"){v=!0,k++;continue}const K=new RegExp(String.raw`<\s*\/\s*${$}\s*>`,"i"),I=/\/\s*>$/.test(S),B=K.test(g.slice(k+b+1)),P=K.test(e.slice(m+k+b+1)),_=/[\r\n]/.test(e.slice(m+k+b+1));if(v&&n.has($)&&!I&&!B&&(P||_))return k;v=!0,k+=b+1}return-1};let u=!1,c="",p=0,d="",f=0;for(;f<e.length;){const g=e.indexOf(`
168
+ `,f),m=g!==-1,A=m&&g>f&&e[g-1]==="\r",v=m?A?g-1:g:e.length,k=e.slice(f,v),C=m?A?`\r
169
+ `:`
170
+ `:"",b=s(k);let S=k;if(!u&&!b){const T=a(k,f);if(T!==-1){const M=C||`
171
+ `;S=`${k.slice(0,T).replace(/[ \t]+$/,"")}${M}${M}${k.slice(T).replace(/^[ \t]+/,"")}`}}d+=S,d+=C,b&&(u?b.markerChar===c&&b.markerLen>=p&&/^\s*$/.test(b.rest)&&(u=!1,c="",p=0):(u=!0,c=b.markerChar,p=b.markerLen)),f=m?g+1:e.length}return d}function dB(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()));if(!n.size)return e;const r=p=>p===" "||p===" ",i=p=>{const d=p.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||p==="_"||p==="-"},o=p=>{let d=0;for(;d<p.length&&r(p[d]);)d++;return p.slice(d)},l=p=>{let d=!1,f=!1;for(let g=0;g<p.length;g++){const m=p[g];if(m==="\\"){g++;continue}if(!f&&m==="'"){d=!d;continue}if(!d&&m==='"'){f=!f;continue}if(!d&&!f&&m===">")return g}return-1},s=(p,d,f)=>{const g=f.toLowerCase();let m=p.indexOf("<",d);for(;m!==-1;){let A=m+1;for(;A<p.length&&r(p[A]);)A++;if(A>=p.length||p[A]!=="/"){m=p.indexOf("<",m+1);continue}for(A++;A<p.length&&r(p[A]);)A++;if(A+g.length>p.length){m=p.indexOf("<",m+1);continue}let v=!0;for(let C=0;C<g.length;C++){const b=p[A+C];if((b>="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==g[C]){v=!1;break}}if(!v){m=p.indexOf("<",m+1);continue}let k=A+g.length;if(k<p.length&&i(p[k])){m=p.indexOf("<",m+1);continue}for(;k<p.length&&r(p[k]);)k++;if(k<p.length&&p[k]===">")return!0;m=p.indexOf("<",m+1)}return!1},a=p=>{let d=0;for(;d<p.length&&r(p[d]);)d++;if(d>=p.length||p[d]!=="<")return p;for(d++;d<p.length&&r(p[d]);)d++;if(d>=p.length||p[d]==="/")return p;const f=d;for(;d<p.length&&i(p[d]);)d++;if(d===f)return p;const g=p.slice(f,d).toLowerCase();if(!n.has(g))return p;const m=l(p.slice(d));if(m===-1)return p;const A=d+m;if(s(p,A+1,g))return p;const v=o(p.slice(A+1));return v?`${p.slice(0,A+1)}
172
+ ${v}`:p};let u="",c=0;for(;c<e.length;){const p=e.indexOf(`
173
+ `,c);if(p===-1){u+=a(e.slice(c));break}const d=p>c&&e[p-1]==="\r",f=d?p-1:p,g=e.slice(c,f);u+=a(g),u+=d?`\r
174
+ `:`
175
+ `,c=p+1}return u}function hB(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const r=d=>d===" "||d===" ",i=d=>{let f=0,g=!1,m=0;for(;f<d.length;){for(;f<d.length&&r(d[f]);)f++;if(f>=d.length||d[f]!==">")break;for(g=!0,f++;f<d.length&&r(d[f]);)f++;m=f}return g?{prefix:d.slice(0,m),content:d.slice(m)}:null},o=d=>{let f=0;for(;f<d.length&&r(d[f]);)f++;const g=d[f];if(g!=="`"&&g!=="~")return null;let m=f;for(;m<d.length&&d[m]===g;)m++;const A=m-f;return A<3?null:{markerChar:g,markerLen:A,rest:d.slice(m)}},l=Array.from(n).map(d=>new RegExp(String.raw`(<\s*\/\s*${d}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let s=!1,a="",u=0,c="",p=0;for(;p<e.length;){const d=e.indexOf(`
176
+ `,p),f=d!==-1,g=f&&d>p&&e[d-1]==="\r",m=f?g?d-1:d:e.length,A=e.slice(p,m),v=f?g?`\r
177
+ `:`
178
+ `:"",k=i(A),C=(k==null?void 0:k.prefix)??"",b=(k==null?void 0:k.content)??A,S=o(b);S&&(s?S.markerChar===a&&S.markerLen>=u&&/^\s*$/.test(S.rest)&&(s=!1,a="",u=0):(s=!0,a=S.markerChar,u=S.markerLen));let T=b;if(!s&&T.includes("</"))for(const M of l)T=T.replace(M,(E,$,X,K)=>{var B,P,_,W;if(K.replace(/^[\t ]+/,"").startsWith("|"))return E;const I=K.slice(0,X).replace(/^[\t ]+/,"");if(I.length>0){const z=((P=(B=$.match(/^<\s*\/\s*([A-Z][\w:-]*)/i))==null?void 0:B[1])==null?void 0:P.toLowerCase())??"",N=((W=(_=I.match(/^<\s*([A-Z][\w:-]*)/i))==null?void 0:_[1])==null?void 0:W.toLowerCase())??"";if(!z||!N||z!==N)return E}return`${$}
179
+
180
+ `});if(C){const M=C+T.split(`
181
+ `).join(`
182
+ ${C}`);c+=M}else c+=T;c+=v,p=f?d+1:e.length}return c}function pB(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const r=I=>I===" "||I===" ",i=I=>{if(!I)return!1;if(I[0]===" ")return!0;let B=0;for(let P=0;P<I.length;P++){const _=I[P];if(_===" "){if(B++,B>=4)return!0;continue}if(_===" ")return!0;break}return!1},o=I=>{const B=I.charCodeAt(0);return B>=65&&B<=90||B>=97&&B<=122||B>=48&&B<=57||I==="_"||I==="-"||I===":"},l=I=>{let B=0;for(;B<I.length&&r(I[B]);)B++;return I.slice(B)},s=I=>{let B=0,P=!1,_=0;for(;B<I.length;){for(;B<I.length&&r(I[B]);)B++;if(B>=I.length||I[B]!==">")break;for(P=!0,B++;B<I.length&&r(I[B]);)B++;_=B}if(!P)return null;const W=I.slice(0,_);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:I.slice(_)}},a=I=>l(I).startsWith("<"),u=I=>{for(let B=0;B<I.length;B++){const P=I[B];if(P!==" "&&P!==" ")return!1}return!0},c=I=>{if(i(I))return"";const B=l(I);if(!B.startsWith("<"))return"";let P=1;for(;P<B.length&&r(B[P]);)P++;if(P>=B.length||B[P]==="/"||B[P]==="!"||B[P]==="?")return"";const _=P;for(;P<B.length&&o(B[P]);)P++;if(P===_)return"";const W=B.slice(_,P).toLowerCase();if(!n.has(W))return"";const z=B[P];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":W},p=I=>{if(i(I))return null;const B=l(I);if(!B.startsWith("<"))return null;let P=1;for(;P<B.length&&r(B[P]);)P++;if(P>=B.length)return null;const _=B[P]==="/";if(_)for(P++;P<B.length&&r(B[P]);)P++;const W=B[P];if(!W||W==="!"||W==="?")return null;const z=P;for(;P<B.length&&o(B[P]);)P++;if(P===z)return null;const N=B.slice(z,P).toLowerCase();if(!n.has(N))return null;const R=B[P];if(R&&R!==" "&&R!==" "&&R!==">"&&R!=="/")return null;if(_)return{type:"close",name:N};if(/\/\s*>\s*$/.test(B))return{type:"open",name:N,complete:!0};const oe=B.indexOf(">",P);if(oe!==-1){const ne=B.slice(oe+1);if(new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i").test(ne))return{type:"open",name:N,complete:!0}}return{type:"open",name:N,complete:!1}},d=I=>{if(i(I))return null;const B=l(I).replace(/[ \t]+$/,"");if(!B.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(B))return null;const P=B.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P!=null&&P[1])return P[1].toLowerCase();const _=B.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!(_!=null&&_[1])||!_[2])return null;const W=_[1].toLowerCase();return W===_[2].toLowerCase()?W:null};let f=!1,g="",m=0;const A=I=>{let B=0;for(;B<I.length&&r(I[B]);)B++;const P=I[B];if(P!=="`"&&P!=="~")return null;let _=B;for(;_<I.length&&I[_]===P;)_++;const W=_-B;return W<3?null:{markerChar:P,markerLen:W,rest:I.slice(_)}},v=I=>A(I),k=I=>{const B=l(I);return B?i(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(B):!1},C=(I,B,P)=>{let _=I,W=0;for(;_<e.length;){const z=e.indexOf(`
183
+ `,_),N=z!==-1,R=N&&z>_&&e[z-1]==="\r",oe=N?R?z-1:z:e.length,ne=e.slice(_,oe),ee=s(ne),ie=(ee==null?void 0:ee.key)??"";if(W>0&&B&&ie!==B)break;const G=(ee==null?void 0:ee.content)??ne,Q=p(G);if((Q==null?void 0:Q.name)===P){if(Q.type==="open")Q.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(u(G)||k(G)))return!0;if(N)_=z+1;else break}return!1};let b="",S=0,T=!0,M=!1,E=!1,$=`
184
+ `;const X=[];let K="";for(;S<e.length;){const I=e.indexOf(`
185
+ `,S),B=I!==-1,P=B&&I>S&&e[I-1]==="\r",_=B?P?I-1:I:e.length,W=e.slice(S,_),z=B?P?`\r
186
+ `:`
187
+ `:"",N=s(W),R=(N==null?void 0:N.key)??"",oe=(N==null?void 0:N.content)??W,ne=v(oe);ne&&(f?ne.markerChar===g&&ne.markerLen>=m&&/^\s*$/.test(ne.rest)&&(f=!1,g="",m=0):(f=!0,g=ne.markerChar,m=ne.markerLen));const ee=X.length>0;if(!f&&!ee){const G=c(oe),Q=!!G&&!T&&M&&E&&C(S,R,G);G&&!T&&(!M||Q)&&(R&&K&&R===K?b+=`${R}${$}`:R||(b+=$))}if(b+=W,b+=z,z&&($=z),!f){const G=p(oe);if(G){if(G.type==="open")G.complete||X.push(G.name);else for(let Q=X.length-1;Q>=0;Q--)if(X[Q]===G.name){X.length=Q;break}}}const ie=u(oe);T=ie,M=!ie&&a(oe),E=!ie&&!!d(oe),K=R,S=B?I+1:e.length}return b}function gB(e,t,n){let r=e;if(t!=null&&t.length&&r.includes("<")){const i=Pi(t);if(i.length&&(r=fB(r,i),r=dB(r,i),r=pB(r,i),r=hB(r,i),r.includes("</")))for(const o of i)r=r.replace(uB(o),"$1$2$2")}return n||(r=cB(r)),r}const mB=1024,AB=16;function Zf(e,t,n){let r=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const i=E3(r);return r=r.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(o,l,s,a)=>{i.scanTo(a+1);const u=i.inMath();return i.scanTo(a+o.length),u?`${l}\\n${s}`:o}),t||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,o=>o.startsWith(`
188
+ `)?`
189
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,o=>o.startsWith(`
190
+ `)?`
191
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,o=>o.startsWith(`
192
+ `)?`
193
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
194
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,o=>o.startsWith(`
195
+ `)?`
196
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(o,l,s)=>`${l}${s.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,o=>o.startsWith(`
197
+ `)?`
198
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
199
+ `)),r=x3(r,n.customHtmlTags)??r),r=gB(r,n.customHtmlTags,t),r}function vB(e,t,n,r){var s;const i=`${n?"final":"stream"}:${(r.customHtmlTags??[]).join(",")}`,o=r.isFragment?void 0:e.safeMarkdown;let l;if(!n&&!((s=r.customHtmlTags)!=null&&s.length)&&o&&o.mode===i&&t.length>=o.source.length&&e.sourceExtends(o.source,t)){const a=Math.max(0,o.source.length-mB-AB),u=Zf(t.slice(a),n,r),c=o.source.length-a;l=u.length>=c&&u.slice(0,c)===o.safeMarkdown.slice(-c)?o.safeMarkdown.slice(0,o.safeMarkdown.length-c)+u:Zf(t,n,r)}else l=Zf(t,n,r);return n||(l=w3(l,e,!r.isFragment)),r.isFragment||(e.safeMarkdown={source:t,safeMarkdown:l,mode:i}),l}function Gr(){return typeof performance<"u"?performance.now():Date.now()}function xi(e,t,n){e&&(e[t]=(e[t]??0)+n)}function kB(e){return e.parserMetrics}function qk(e,t,n){return t&&xi(t,"parseMarkdownToStructureTotalMs",Gr()-n),e}function t0(e,t,n,r){return qk(Zk(e,t),n,r)}function n0(e,t,n){if(!n)return JA(e,t,Du);xi(n,"processTokensInputTokens",e.length);const r=Gr(),i=JA(e,t,Du);return xi(n,"processTokensMs",Gr()-r),i}function yB(e,t){var i;const n=e,r=typeof n.validateLink=="function"&&n.__markstreamOriginalValidateLink&&n.validateLink!==n.__markstreamOriginalValidateLink?n.validateLink:void 0;return t.validateLink??r??((i=n.options)==null?void 0:i.validateLink)??(typeof n.validateLink=="function"?n.validateLink:void 0)}function ey(e,t){var S;const n=t.runtime,r=t.markdownIt,i={...t,customHtmlBlockCursor:0,sourceLineOffsets:void 0},o=kB(i),l=o?{recordTokenCloneMs:T=>xi(o,"tokenCloneMs",T)}:void 0,s=o?Gr():0,a=!!i.final,u=(e??"").toString();i.isFragment||B3(n,i);const c=vB(n,u,a,i);o&&xi(o,"safeMarkdownMs",Gr()-s);const p=JE(c);if(p){if(i.includeSourceMap){const E={...i,sourceLineMapper:e0(u,c)};p[0].sourceMap=Ws(c,0,c.length,E)}const T=i.preTransformTokens,M=i.postTransformTokens;if(tp(n,i)||typeof T=="function"||typeof M=="function"){const E=FA(n,c,{__markstreamFinal:a},i,l),$=typeof T=="function"&&T(E)||E;typeof M=="function"&&M($)}return t0(p,i,o,s)}const d=o?Gr():0,f=FA(n,c,{__markstreamFinal:a},i,l);if(o&&xi(o,"tokenizeMs",Gr()-d),!f||!Array.isArray(f))return t0([],i,o,s);const g=i.preTransformTokens,m=i.postTransformTokens;let A=f;g&&typeof g=="function"&&(A=g(A)||A);const v={...i,sourceLineMapper:i.includeSourceMap===!0?e0(u,c):void 0,sourceMarkdown:c,sourceLineOffsets:i.isFragment?Xk(c):iB(n,c),customHtmlBlockCursor:0};let k=G3(n,c,A,v,{processTokens:(T,M)=>n0(T,M,o),recordReusedTopLevelNodes:T=>xi(o,"processTokensReusedTopLevelNodes",T)});if(m&&typeof m=="function"){const T=m(A);if(Array.isArray(T)){const M=T[0],E=M==null?void 0:M.type;M&&typeof E=="string"?k=n0(T,{...v,customHtmlBlockCursor:0},o):k=T}}const C=n.structuredReuseTailStart,b=C&&C>0&&C<k.length?C:0;if(tM(k)){const T=o?Gr():0,M={getInternalNodeSourceRange:z=>QA(z,n),markdownIt:r,parseFragment:(z,N)=>ey(z,N)},E=b>0&&n.htmlPassIdentityPreserving,$=E?(S=QA(k[b],n))==null?void 0:S.start:void 0;let X=!1;for(let z=E?b:0;z<k.length;z++){const N=k[z];if(N.type==="html_block"&&String(N.tag??"").toLowerCase()==="details"){X=!0;break}}const K=E&&!X&&$!=null,I=K?k.slice(0,b):[],B=K?k.slice(b):k,P=K?$:0;let _=oM(B,a,c,M,v,P);const W=_.length===B.length&&_.every((z,N)=>z===B[N]);X&&(_=Ik(_,c,M,v,a,P)[0]),_=eM(_,M,v,a),k=K?I.concat(_):_,n.htmlPassIdentityPreserving=!X&&W,o&&xi(o,"htmlBlockPassesMs",Gr()-T)}else n.htmlPassIdentityPreserving=!0;return a&&ET(k),k=Zk(k,i),i.debug&&console.log("Parsed Markdown Tree Structure:",k),qk(k,o,s)}function ty(e,t,n={}){const r=(e??"").toString(),i=aB(t),o=yB(t,n),l=Wh(n,{markdownIt:t,runtime:i,validateLink:o}),s=t;i.beginRootParse(r,{customHtmlTags:(n.customHtmlTags??[]).join("\0"),hasCustomParserExtensions:s.__markstreamHasCustomParserExtensions===!0,includeSourceMap:n.includeSourceMap===!0,postTransformNodes:n.postTransformNodes,postTransformTokens:n.postTransformTokens,preTransformTokens:n.preTransformTokens,requireClosingStrong:n.requireClosingStrong,reuseStableTopLevelNodes:n.reuseStableTopLevelNodes===!0,streamParse:n.streamParse,validateLink:o});try{return ey(r,l)}finally{i.finishRootParse(n.final===!0)}}const CB=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,ks=/\d/u,bB=/[,.!?;:,。;、!?:]/u,xB=new RegExp("\\d\\p{Script=Han}{1,3}$","u");function wB(e){return e.pos>0&&e.pos+1<e.posMax&&ks.test(e.src[e.pos-1])&&ks.test(e.src[e.pos+1])}function _B(e,t,n,r,i,o={}){const l=e.charCodeAt(0);return(s,a)=>{const u=s,c=u.posMax,p=u.pos;if(u.src.charCodeAt(p)!==l||a||o.refuseDigitRange&&wB(u))return!1;u.pos=p+1;let d=!1;for(;u.pos<c;){if(u.src.charCodeAt(u.pos)===l){d=!0;break}u.md.inline.skipToken(u)}if(!d||p+1===u.pos)return u.pos=p,!1;const f=u.src.slice(p+1,u.pos);if(!f||f.match(/(^|[^\\])(\\\\)*\s/))return u.pos=p,!1;const g=u.src[u.pos+1],m=ks.test(f[0]),A=g!==void 0&&ks.test(g);if(m&&A&&(xB.test(u.src.slice(0,p))||bB.test(f)||ks.test(f[f.length-1])))return u.pos=p,!1;const v=u.push(n,i,1);v.markup=t;const k=u.push("text","",0);k.content=f.replace(CB,"$1");const C=u.push(r,i,-1);return C.markup=t,u.pos=u.pos+1,!0}}function SB(e){const t=_B("~","~","sub_open","sub_close","sub",{refuseDigitRange:!0});e.inline.ruler.after("emphasis","sub",t)}const IB=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,EB=new Set([...vl,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),ny=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 r0(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function MB(e){return typeof e=="string"?e:e==null?"":String(e)}function ry(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function wi(e){return MB(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function iy(e){return wi(e).replace(/`/g,"&#96;")}function oc(e){return String(e??"").trim().toLowerCase()}function lc(e,t="safe"){const n=oc(e);return n?t==="escape"?!0:t==="trusted"?vl.has(n):!ny.has(n):!1}function sp(e,t="safe"){const n=oc(e);return n?t==="escape"?!0:t==="trusted"?vl.has(n):EB.has(n):!1}function i0(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,r])=>r===""?` ${n}`:` ${n}="${iy(r)}"`).join("")}function oy(e){const t=e.startsWith("/"),n=t?e.slice(1):e,r=n.match(IB);return r?{attrsStr:t?"":n.slice(r[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:r[1]}:null}function TB(e,t){const n=e.split(",").map(r=>r.trim()).filter(Boolean);return n.length===0?!1:n.some(r=>{const i=r.split(/\s+/,1)[0]??"";return!i||Ei(i,{tagName:t,attrName:"srcset"})})}function ly(e,t,n,r){return Lv.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?TB(t,r):!!(Ov.has(e)&&t&&Ei(t,{tagName:r,attrName:e}))}function co(e,t){const n=t.toLowerCase();return Object.keys(e).find(r=>r.toLowerCase()===n)}function sy(e,t,n,r=!1){if(t!=="safe"||oc(n)!=="a")return e;const i=co(e,"href");if(r&&(!i||!e[i])){const a=co(e,"target"),u=co(e,"rel");return a&&delete e[a],u&&delete e[u],e}const o=co(e,"target");if((o?String(e[o]).trim():"").toLowerCase()!=="_blank")return e;const l=co(e,"rel"),s=new Set(String(l?e[l]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return s.add("noopener"),s.add("noreferrer"),l&&l!=="rel"&&delete e[l],e.rel=Array.from(s).join(" "),e}function o0(e,t="safe",n){const r={};for(const[i,o]of Object.entries(e)){const l=i.trim(),s=l.toLowerCase();!l||!ry(l)||ly(s,o,t,n)||(r[l]=o)}return sy(r,t,n,!!co(e,"href"))}function ay(e,t){const n=e.toLowerCase();return Rh.has(n)?!1:r0(t,n)||r0(t,e)}function sc(e,t="safe",n){const r={};for(const[i,o]of Object.entries(e)){const l=i.trim(),s=l.toLowerCase();!l||!ry(l)||ly(s,o,t,n)||(r[l]=o)}return sy(r,t,n,!!co(e,"href"))}function ul(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,r]of e)n&&(t[String(n)]=r==null?"":String(r));return t}function ys(e,t="safe",n){const r=sc(ul(e),t,n),i=Object.entries(r).map(([o,l])=>[o,l]);return i.length>0?i:void 0}function uy(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 r=Number(e);if(e!==""&&!Number.isNaN(r))return r}return e}function cy(e){const t={};for(const[n,r]of Object.entries(e))t[n]=uy(r,n);return t}function Vf(e){return e.trim().length>0}function fy(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 r=e.indexOf("<",n);if(r===-1){if(n<e.length){const l=e.slice(n);Vf(l)&&t.push({type:"text",content:l})}break}if(r>n){const l=e.slice(n,r);Vf(l)&&t.push({type:"text",content:l})}if(e.startsWith("![CDATA[",r+1)){const l=e.indexOf("]]>",r);if(l!==-1){t.push({type:"text",content:e.slice(r,l+3)}),n=l+3;continue}break}if(e.startsWith("!",r+1)){const l=e.indexOf(">",r);if(l!==-1){n=l+1;continue}break}const i=e.indexOf(">",r);if(i===-1)break;const o=oy(e.slice(r+1,i));if(!o){const l=e.slice(r,i+1);Vf(l)&&t.push({type:"text",content:l}),n=i+1;continue}if(o.isClosing)t.push({type:"tag_close",tagName:o.tagName});else{const l={};if(o.attrsStr){const s=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=s.exec(o.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(l[u]=c)}}t.push({type:o.isSelfClosing||qr.has(o.tagName.toLowerCase())?"self_closing":"tag_open",tagName:o.tagName,attrs:l})}n=i+1}return t}function BB(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const s=e.indexOf("-->",n);if(s!==-1){n=s+3;continue}break}const r=e.indexOf("<",n);if(r===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(r>n&&t.push({type:"text",content:e.slice(n,r)}),e.startsWith("![CDATA[",r+1)){const s=e.indexOf("]]>",r);if(s!==-1){t.push({type:"text",content:e.slice(r,s+3)}),n=s+3;continue}break}if(e.startsWith("!",r+1)){const s=e.indexOf(">",r);if(s!==-1){n=s+1;continue}break}const i=e.indexOf(">",r);if(i===-1)break;const o=oy(e.slice(r+1,i));if(!o){t.push({type:"text",content:e.slice(r,i+1)}),n=i+1;continue}if(o.isClosing){t.push({type:"tag_close",tagName:o.tagName}),n=i+1;continue}const l={};if(o.attrsStr){const s=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=s.exec(o.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(l[u]=c)}}t.push({type:o.isSelfClosing||qr.has(o.tagName.toLowerCase())?"self_closing":"tag_open",tagName:o.tagName,attrs:l}),n=i+1}return t}function FB(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${wi(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([r,i])=>i===""?` ${wi(r)}`:` ${wi(r)}="${iy(i)}"`).join("");return e.type==="self_closing"?`&lt;${wi(t)}${n} /&gt;`:`&lt;${wi(t)}${n}&gt;`}function js(e,t="safe"){if(!e)return"";if(t==="escape")return wi(e);const n=BB(e),r=[],i=[],o=[];for(const l of n){if(l.type==="text"){o.length===0&&i.push(wi(l.content??""));continue}const s=oc(l.tagName);if(!s)continue;if(sp(s,t)){l.type==="tag_open"?o.push(s):l.type==="tag_close"&&o[o.length-1]===s&&o.pop();continue}if(o.length>0)continue;if(t==="safe"&&lc(s,t)){i.push(FB(l));continue}if(l.type==="self_closing"){i.push(`<${s}${i0(o0(l.attrs??{},t,s))}>`);continue}if(l.type==="tag_open"){i.push(`<${s}${i0(o0(l.attrs??{},t,s))}>`),qr.has(s)||r.push(s);continue}const a=r.lastIndexOf(s);if(a===-1)continue;for(;r.length>a+1;){const c=r.pop();c&&i.push(`</${c}>`)}const u=r.pop();u&&i.push(`</${u}>`)}for(;r.length>0;){const l=r.pop();l&&i.push(`</${l}>`)}return i.join("")}const DB=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],l0="http://www.w3.org/2000/svg",RB=new Set(["script","style","iframe","object","embed","link","meta"]),NB=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"]),LB=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),OB=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),PB=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function $B(e){var t;return((t=e.getAttribute("href")||e.getAttribute("xlink:href"))==null?void 0:t.startsWith("#"))===!0}function HB(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function WB(e){var n;const t=e.nodeName.toLowerCase();return t==="use"?$B(e):t==="image"?HB(e):t==="text"||t==="tspan"?!!((n=e.textContent)!=null&&n.trim()):PB.has(t)}function KB(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 jB(e,t,n){const r=e.toLowerCase(),i=t.toLowerCase(),o=String(n??"").trim();return o?(r==="use"||r==="marker"||r==="clippath"||r==="mask")&&(i==="href"||i==="xlink:href")?o.startsWith("#")?o:"":r==="a"&&(i==="href"||i==="xlink:href")?Ei(o,{tagName:"a",attrName:"href"})?"":o:r==="image"&&(i==="href"||i==="xlink:href"||i==="src")?Ei(o,{tagName:"img",attrName:"src"})?"":o:i==="href"||i==="xlink:href"?o.startsWith("#")?o:"":Ei(o,{tagName:r,attrName:i})?"":o:""}function zB(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const r=e[n];if(r==='"'||r==="'"){const o=n+1,l=e.indexOf(r,o);if(l===-1)return{next:e.length,url:""};for(n=l+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(o,l)}}const i=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(i,n)}}function dy(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const r=n.trim();if(/^[0-9a-f]+$/i.test(r)){const i=Number.parseInt(r,16);try{return Number.isFinite(i)?String.fromCodePoint(i):""}catch{return""}}return String(n).trim()})}function hy(e){const t=dy(e),n=t.toLowerCase();let r=0;for(;r<n.length;){const i=n.indexOf("url(",r);if(i===-1)return!1;const o=zB(t,i);if(r=Math.max(o.next,i+4),!o.url.trim().startsWith("#"))return!0}return!1}function s0(e){const t=dy(e);return DB.some(n=>n.test(t))||hy(t)}function GB(e){var n;if(e.tagName.toLowerCase()!=="a"||((n=e.getAttribute("target"))==null?void 0:n.trim().toLowerCase())!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(r=>r.trim()).filter(Boolean).filter(r=>r.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function za(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function py(e,t){if(e.nodeType===Node.TEXT_NODE){const i=e.textContent??"";i&&t.push(i);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,r=n.tagName.toLowerCase();if(!RB.has(r)){if(r==="br"){t.push(`
200
+ `);return}for(const i of Array.from(n.childNodes))py(i,t)}}function QB(e){var t;for(const n of Array.from(e.querySelectorAll("foreignObject"))){const r=[];py(n,r);const i=r.join("").split(/\r?\n/).map(p=>p.trim()).filter(Boolean);if(!i.length){n.remove();continue}const o=za(n.getAttribute("width")),l=za(n.getAttribute("height")),s=za(n.getAttribute("x")),a=za(n.getAttribute("y")),u=e.ownerDocument.createElementNS(l0,"text");u.setAttribute("x",String(s+o/2)),u.setAttribute("y",String(a+l/2)),u.setAttribute("text-anchor","middle"),u.setAttribute("dominant-baseline","central");const c=n.querySelector(".nodeLabel");if(c!=null&&c.getAttribute("class")&&u.setAttribute("class",c.getAttribute("class")),i.length===1)u.textContent=i[0];else{const p=-.6*(i.length-1);for(const[d,f]of i.entries()){const g=e.ownerDocument.createElementNS(l0,"tspan");g.setAttribute("x",String(s+o/2)),g.setAttribute("dy",d===0?`${p}em`:"1.2em"),g.textContent=f,u.appendChild(g)}}(t=n.parentNode)==null||t.replaceChild(u,n)}}function UB(e){QB(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const r=n.tagName.toLowerCase();if(!NB.has(r)){n.remove();continue}if(r==="style"&&s0(n.textContent??"")){n.remove();continue}const i=Array.from(n.attributes);for(const o of i){const l=o.name.toLowerCase();if(/^on/i.test(l)){n.removeAttribute(o.name);continue}if(l==="style"&&o.value&&s0(o.value)){n.removeAttribute(o.name);continue}if(l==="srcdoc"){n.removeAttribute(o.name);continue}if(LB.has(l)&&o.value){const s=jB(r,l,o.value);if(!s){n.removeAttribute(o.name);continue}s!==o.value&&n.setAttribute(o.name,s);continue}if(OB.has(l)&&o.value&&hy(o.value)){n.removeAttribute(o.name);continue}if(o.value){const s=KB(o.value);s!==o.value&&n.setAttribute(o.name,s)}}GB(n)}}function YB(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 UB(n),ZB(n)?null:n}catch{return null}}function ZB(e){const t=e.getAttribute("viewBox");if(t){const i=t.trim().split(/[\s,]+/);if(i.length===4){const o=Number.parseFloat(i[2]||""),l=Number.parseFloat(i[3]||"");if(!Number.isFinite(o)||!Number.isFinite(l)||o<=0||l<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let r=!1;for(const i of n){WB(i)&&(r=!0);for(const o of Array.from(i.attributes))if(/\bNaN\b/i.test(o.value)||o.name==="style"&&/max-width:\s*0(?:px)?/i.test(o.value))return!0}return!r}const Ga=[];function Jf(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function VB(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function JB(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function Pd(e=`editor-${Date.now()}`,t={}){var f,g;const n=GE(t),r=n;r.__markstreamRegisteredPluginCount=Ga.length,r.__markstreamHasCustomParserExtensions=!!((f=t.plugin)!=null&&f.length||(g=t.apply)!=null&&g.length||Ga.length);const i={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const m=t.i18n;o=A=>m[A]??i[A]??A}else o=m=>i[m]??m;if(Array.isArray(t.plugin))for(const m of t.plugin){const A=m;if(Array.isArray(A)){const[v,...k]=A;typeof v=="function"&&n.use(v,...k)}else typeof A=="function"&&n.use(A)}if(Array.isArray(t.apply))for(const m of t.apply)try{m(n)}catch(A){console.error("[getMarkdown] apply function threw an error",A)}if(Ga.length)for(const m of Ga)if(Array.isArray(m)){const[A,...v]=m;typeof A=="function"&&n.use(A,...v)}else typeof m=="function"&&n.use(m);n.use(SB),n.use(Zb),n.use(Qb);const l=Jb,s=l.default??l;n.use(s),n.use(Gb),n.use(zb),n.core.ruler.after("block","mark_fence_closed",m=>{var b;const A=m,v=A.src,k=!!((b=A.env)!=null&&b.__markstreamFinal);let C;for(const S of A.tokens){if(S.type!=="fence"||!S.map||!S.markup)continue;const T=S.map[0],M=S.map[1],E=S.markup,$=E[0],X=E.length,K=Math.max(0,M-1);C??(C=v.split(/\r?\n/));const I=C[K]??"";let B=0;for(;B<I.length&&(I[B]===" "||I[B]===" ");)B++;let P=0;for(;B+P<I.length&&I[B+P]===$;)P++;let _=B+P;for(;_<I.length&&(I[_]===" "||I[_]===" ");)_++;const W=k?!0:M>T+1&&P>=X&&_===I.length,z=S;z.meta=z.meta??{},z.meta.unclosed=!W,z.meta.closed=!!W}}),n.renderer.rules.fence=(m,A)=>{const v=m[A],k=String(v.info??"").trim(),C=String(v.content??""),b=btoa(unescape(encodeURIComponent(C))),S=VB(k),T=Jf(S),M=JB(`editor-${e}-${A}-${S}`),E=Jf(o("common.copy"));return`<div class="code-block" data-code="${b}" data-lang="${T}" id="${M}">
201
+ <div class="code-header">
202
+ <span class="code-lang">${Jf(S.toUpperCase())}</span>
203
+ <button class="copy-button" data-code="${b}">${E}</button>
204
+ </div>
205
+ <div class="code-editor"></div>
206
+ </div>`};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=m=>{if(!m.startsWith("["))return!1;const A=u.exec(m);if(!A)return m!=="["&&!/^\[\d+$/.test(m);const v=String(A[1]??"");return m.slice(A[0].length).startsWith("(")?!1:!/^\d+$/.test(v)},p=(m,A)=>{const v=m;if(v.src[v.pos]!=="[")return!1;const k=a.exec(v.src.slice(v.pos));if(!k)return!1;const C=v.src.slice(Math.max(0,v.pos-120),v.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(C))return!1;const b=v.src.slice(v.pos+k[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!A){const S=k[1],T=v.push("reference","span",0);T.content=S,T.markup=k[0],T.raw=k[0]}return v.pos+=k[0].length,!0};n.inline.ruler.before("escape","reference",p),n.renderer.rules.reference=(m,A)=>{const k=String(m[A].content??"");return`<span class="reference-link" data-reference-id="${k}" role="button" tabindex="0" title="Click to view reference">${k}</span>`};const d=n.use.bind(n);return n.use=((...m)=>(r.__markstreamHasCustomParserExtensions=!0,d(...m))),n}var XB=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{s(n.next(a))}catch(u){i(u)}},l=a=>{try{s(n.throw(a))}catch(u){i(u)}},s=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,l);s((n=n.apply(e,t)).next())});const Ru=Symbol.for("markstream-vue:node-lifecycle"),a0='<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>',u0='<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>',qB={id:"material",core:{"":u0,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:u0,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:a0,csharp:a0,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:()=>wn(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},ap=new Map;let gy="material";const tl=new Map,c0=new Map;let $d=null;function my(e){ap.set(e.id,e)}function eF(e){const t=ap.get(gy);if(!t)return;const n=t.core[e];if(n)return n;const r=tl.get(t.id);if(r){const i=r[e];if(i)return i}t.loadExtended&&!tl.has(t.id)&&nF(t)}function tF(){var e,t;return(t=(e=ap.get(gy))==null?void 0:e.fallback)!=null?t:""}function nF(e){return XB(this,null,function*(){var t,n,r;if(tl.has(e.id))return(t=tl.get(e.id))!=null?t:null;let i=c0.get(e.id);return i||(i=((r=(n=e.loadExtended)==null?void 0:n.call(e))!=null?r:Promise.resolve(null)).then(o=>(tl.set(e.id,o),$d==null||$d(),o)).catch(()=>(tl.set(e.id,null),null)),c0.set(e.id,i)),i})}const Ay=Oi(0);$d=()=>{Ay.value++},my(qB);const rF={"":"",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 ea(e){var t;const n=(function(r){if(!r)return"";const i=r.trim();if(!i)return"";const[o]=i.split(/\s+/),[l]=o.split(":");return l.toLowerCase()})(e);return(t=rF[n])!=null?t:n}function iF(e){const t=ea(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"shell":return"zsh";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function vy(e){return eF(ea(e))||tF()}const Hd={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"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"};function CR(){}var ac=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{s(n.next(a))}catch(u){i(u)}},l=a=>{try{s(n.throw(a))}catch(u){i(u)}},s=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,l);s((n=n.apply(e,t)).next())});let Un=null,nl=!1,rl=null,up=ky;function ta(e){var t;const n=(t=e==null?void 0:e.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function cp(){try{const e=globalThis;return ta(e==null?void 0:e.katex)}catch{return null}}function ky(){return ac(null,null,function*(){const e=cp();if(e)return e;const t=yield wn(()=>import("./katex-C5jXJg4s.js"),[]);try{yield wn(()=>import("./mhchem-MNFFEueS.js"),__vite__mapDeps([0,1]))}catch{}return ta(t)})}function yy(e){const t=Promise.resolve(e).then(n=>{var r;return rl===t&&n?(Un=(r=ta(n))!=null?r:n,Un):null}).catch(()=>null).finally(()=>{rl===t&&(rl=null)});return rl=t,nl=!0,t}function fp(){return typeof up=="function"}function bR(){var e;const t=up;if(!t||t===ky)return null;if(Un)return Un;const n=cp();if(n)return Un=n,Un;if(nl)return null;try{const r=t();return r?typeof(r==null?void 0:r.then)=="function"?(yy(r),null):(Un=(e=ta(r))!=null?e:r,Un):null}catch{return null}}function Cy(){return ac(this,null,function*(){var e;const t=cp();if(t)return Un=t,Un;if(Un)return Un;if(rl)return rl;if(nl)return null;const n=up;if(!n)return nl=!0,null;try{const r=n();if(typeof(r==null?void 0:r.then)=="function")return yy(r);if(r)return Un=(e=ta(r))!=null?e:r,nl=!0,Un}catch{}return nl=!0,null})}function by(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Zo=null;const Wd=new Map,as=new Map;let Kd=5;const Cs=new Set;function xy(){if(Wd.size<Kd&&Cs.size){let e=Kd-Wd.size;for(const t of Array.from(Cs)){if(e<=0)break;Cs.delete(t),e--;try{t()}catch{}}}}function wy(e,t=!0,n=2e3,r){return ac(this,null,function*(){performance.now();const i=by(e);if(!fp()){const s=new Error("KaTeX rendering disabled");return s.name="KaTeXDisabled",s.code="KATEX_DISABLED",Promise.reject(s)}if(Zo)return Promise.reject(Zo);const o=`${t?"d":"i"}:${i}`,l=as.get(o);return l?(xy(),Promise.resolve(l)):(Zo=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Zo.name="WorkerInitError",Zo.code="WORKER_INIT_ERROR",Promise.reject(Zo))})}function oF(e,t=!0,n){const r=`${t?"d":"i"}:${by(e)}`;if(as.set(r,n),as.size>200){const i=as.keys().next().value;as.delete(i)}}const _y="WORKER_BUSY";function Sy(e=2e3,t){return Wd.size<Kd?Promise.resolve():new Promise((n,r)=>{let i,o=!1,l=null,s=()=>{};const a=()=>{i&&globalThis.clearTimeout(i),Cs.delete(s),t&&l&&t.removeEventListener("abort",l),l=null};s=()=>{o||(o=!0,a(),n())},Cs.add(s),i=globalThis.setTimeout(()=>{if(o)return;o=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",r(u)},e),queueMicrotask(()=>xy()),t&&(l=()=>{if(o)return;o=!0,a();const u=new Error("Aborted");u.name="AbortError",r(u)},t.aborted?l():t.addEventListener("abort",l,{once:!0}))})}const ql={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function lF(e){return ac(this,arguments,function*(t,n=!0,r={}){var i,o,l,s;if(!fp()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(i=r.timeout)!=null?i:ql.timeout,u=(o=r.waitTimeout)!=null?o:ql.waitTimeout,c=(l=r.backoffMs)!=null?l:ql.backoffMs,p=(s=r.maxRetries)!=null?s:ql.maxRetries,d=Number.isFinite(p)?Math.max(0,Math.min(Math.floor(p),8)):ql.maxRetries,f=r.signal;let g=0;for(;;){if(f!=null&&f.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield wy(t,n,a,f)}catch(m){if((m==null?void 0:m.code)!==_y||g>=d)throw m;if(g++,yield Sy(u,f).catch(()=>{}),f==null?void 0:f.aborted){const A=new Error("Aborted");throw A.name="AbortError",A}c>0&&(yield new Promise(A=>globalThis.setTimeout(A,c*g)))}}})}function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}function sF(e,t){if(zs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aF(e){var t=sF(e,"string");return zs(t)=="symbol"?t:t+""}function uF(e,t,n){return(t=aF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Si(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f0(Object(n),!0).forEach(function(r){uF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iy(){return{original:[],modified:[],matches:[],originalLines:new Set,modifiedLines:new Set}}function d0(e,t){if(e.length===0||e.length>t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function cF(e,t,n,r){e.original=t,e.modified=n,e.matches=r,e.originalLines=new Set(t),e.modifiedLines=new Set(n)}const fF=["diff ","index ","--- ","+++ ","@@ "],Ey="\",dF=/\r\n$|\n$|\r$/,jd=/\r\n|\n|\r/,hF=/(?:\r\n|\n|\r)$/;function My(e,t){const n=String(e??"");return t?n:n.replace(dF,"")}function Gs(e,t){const n=My(e,t);return n?n.split(jd):[]}function Nu(e,t,n,r){const i=My(e,t),o=r==="original"?"originalSplit":"modifiedSplit",l=n[o];if(l&&t===l.loading&&i.startsWith(l.source)){var s;if(i==="")return n[o]={source:"",loading:t,lines:[]},[];const u=i.slice(l.source.length);if(u==="")return l.lines;const c=l.source.endsWith("\r"),p=(c?l.source.slice(-1)+u:((s=l.lines.at(-1))!==null&&s!==void 0?s:"")+u).split(jd),d=c?l.lines.slice(0,-1).concat(p.slice(1)):l.lines.slice(0,-1).concat(p);return n[o]={source:i,loading:t,lines:d},d}const a=i?i.split(jd):[];return n[o]={source:i,loading:t,lines:a},a}function pF(e){var t;return((t=String(e??"").split(/\s+/g)[0])===null||t===void 0||(t=t.split(":")[0])===null||t===void 0?void 0:t.toLowerCase().replace(/[^\w-]/g,""))||"plaintext"}function Ty(e){return String(e??"").trim().length===0}function ht(e,t,n,r,i=!1){const o=Ty(e);return{code:e,empty:o,key:n,kind:o&&t!=="hunk"&&t!=="spacer"&&!i?"context":t,number:r}}function yi(e,t){return!Ty(e[t])||t<e.length-1}function bs(e){return e.startsWith("-")&&!e.startsWith("---")}function Lu(e){return e.startsWith("+")&&!e.startsWith("+++")}function By(e){return e.some(t=>fF.some(n=>t.startsWith(n)))}function Ou(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function Pu(e){return hF.test(String(e??""))}function Ur(e,t){return Si(Si({},ht("No newline at end of file","metadata",e,"")),{},{metadataKind:t})}function gF(e,t,n){const r=String(t??"").length>0&&!Pu(t),i=String(n??"").length>0&&!Pu(n);return!r&&!i||(r&&e.push(Ur("inline-no-newline-original","removed")),i&&e.push(Ur("inline-no-newline-modified","added"))),e}function mF(e,t){var n,r;if(pF(e)==="diff")return!0;const i=(n=(r=String(t??"").split(/\r?\n/,1)[0])===null||r===void 0?void 0:r.trim())!==null&&n!==void 0?n:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(i)}function AF(e,t,n){const r=e.some(o=>bs(o)),i=e.some(o=>Lu(o));return r&&i||mF(t,n)&&(r||i)}function Fy(e,t,n){if(n&&d0(n.original,e)&&d0(n.modified,t)){const i=e.slice(n.original.length),o=t.slice(n.modified.length);if(i.every(l=>!n.modifiedLines.has(l))&&o.every(l=>!n.originalLines.has(l))){const l=n.matches.concat(h0(i,o).map(s=>({originalIndex:s.originalIndex+n.original.length,modifiedIndex:s.modifiedIndex+n.modified.length})));for(const s of i)n.originalLines.add(s);for(const s of o)n.modifiedLines.add(s);return n.original=e,n.modified=t,n.matches=l,l}}const r=h0(e,t);return n&&cF(n,e,t,r),r}function h0(e,t){var n;const r=[];let i=0;for(;i<e.length&&i<t.length&&e[i]===t[i];)r.push({originalIndex:i,modifiedIndex:i}),i++;const o=[];let l=e.length-1,s=t.length-1;for(;l>=i&&s>=i&&e[l]===t[s];)o.push({originalIndex:l,modifiedIndex:s}),l--,s--;o.reverse();const a=l-i+1,u=s-i+1;if(a<=0||u<=0||(a+1)*(u+1)>15e5)return r.concat(o);const c=new Map,p=new Uint32Array(u);for(let k=0;k<u;k++){const C=t[i+k];let b=c.get(C);b===void 0&&(b=c.size+1,c.set(C,b)),p[k]=b}const d=new Uint32Array(a);for(let k=0;k<a;k++)d[k]=(n=c.get(e[i+k]))!==null&&n!==void 0?n:0;const f=u+1,g=new Uint32Array((a+1)*(u+1));for(let k=a-1;k>=0;k--)for(let C=u-1;C>=0;C--){const b=k*f+C;d[k]===p[C]?g[b]=g[(k+1)*f+C+1]+1:g[b]=Math.max(g[(k+1)*f+C],g[k*f+C+1])}const m=[];let A=0,v=0;for(;A<a&&v<u;)e[i+A]===t[i+v]?(m.push({originalIndex:i+A,modifiedIndex:i+v}),A++,v++):g[(A+1)*f+v]>=g[A*f+v+1]?A++:v++;return r.concat(m,o)}const vF=["diff ","index ","--- ","+++ "];function Dy(e,t){return t&&vF.some(n=>e.startsWith(n))}function kF(e){const t=[];let n=1,r=1;const i=By(e);for(const[l,s]of e.entries())if(s===Ey){var o;const a=(o=t.at(-1))===null||o===void 0?void 0:o.kind,u=a==="removed"||a==="added"?a:"context";t.push(Ur(`inline-no-newline-${l}`,u))}else{if(Dy(s,i))continue;if(s.startsWith("@@")){const a=s.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);a&&(n=Number(a[1]),r=Number(a[2])),t.push(ht(s,"hunk",`inline-hunk-${l}`,""))}else if(bs(s))t.push(ht(Ou(s.slice(1),i),"removed",`inline-removed-${l}`,n++,!0));else if(Lu(s))t.push(ht(Ou(s.slice(1),i),"added",`inline-added-${l}`,r++,!0));else{const a=i&&s.startsWith(" ")?s.slice(1):s;t.push(ht(a,"context",`inline-context-${l}`,r)),n++,r++}}return t}function yF(e,t,n,r){const i=r?Nu(e,n,r,"original"):Gs(e,n),o=r?Nu(t,n,r,"modified"):Gs(t,n),l=Fy(i,o,r);if(l.length>0){const d=[];let f=0,g=0;for(const m of l){for(;f<m.originalIndex;)d.push(ht(i[f],"removed",`inline-removed-source-${f}`,f+1,yi(i,f))),f++;for(;g<m.modifiedIndex;)d.push(ht(o[g],"added",`inline-added-source-${g}`,g+1,yi(o,g))),g++;d.push(ht(o[m.modifiedIndex],"context",`inline-context-source-${m.originalIndex}-${m.modifiedIndex}`,m.modifiedIndex+1)),f=m.originalIndex+1,g=m.modifiedIndex+1}for(;f<i.length;)d.push(ht(i[f],"removed",`inline-removed-source-${f}`,f+1,yi(i,f))),f++;for(;g<o.length;)d.push(ht(o[g],"added",`inline-added-source-${g}`,g+1,yi(o,g))),g++;return d}const s=[];let a=0,u=i.length-1,c=o.length-1;for(;a<=u&&a<=c&&i[a]===o[a];)s.push(ht(o[a],"context",`inline-prefix-${a}`,a+1)),a++;const p=[];for(;u>=a&&c>=a&&i[u]===o[c];)p.unshift(ht(o[c],"context",`inline-suffix-${c}`,c+1)),u--,c--;for(let d=a;d<=u;d++)s.push(ht(i[d],"removed",`inline-removed-source-${d}`,d+1,yi(i,d)));for(let d=a;d<=c;d++)s.push(ht(o[d],"added",`inline-added-source-${d}`,d+1,yi(o,d)));return s.concat(p)}function CF(e,t,n,r,i){const o=i?Nu(e,n,i,"original"):Gs(e,n),l=i?Nu(t,n,i,"modified"):Gs(t,n),s=Fy(o,l,i),a=[],u=[];let c=0,p=0,d=0;const f=(A,v)=>{const k=Math.max(A-c,v-p);for(let C=0;C<k;C++){const b=c+C,S=p+C;a.push(b<A?ht(o[b],"removed",`original-changed-${d}-${b}`,b+1,yi(o,b)):ht("","spacer",`original-spacer-${d}-${C}`,"")),u.push(S<v?ht(l[S],"added",`modified-changed-${d}-${S}`,S+1,yi(l,S)):ht("","spacer",`modified-spacer-${d}-${C}`,""))}c=A,p=v,d++};for(const A of s)f(A.originalIndex,A.modifiedIndex),a.push(ht(o[A.originalIndex],"context",`original-context-${A.originalIndex}-${A.modifiedIndex}`,A.originalIndex+1)),u.push(ht(l[A.modifiedIndex],"context",`modified-context-${A.originalIndex}-${A.modifiedIndex}`,A.modifiedIndex+1)),c=A.originalIndex+1,p=A.modifiedIndex+1;f(o.length,l.length);const g=String(e??"").length>0&&!Pu(e),m=String(t??"").length>0&&!Pu(t);return(g||m)&&(a.push(g?Ur("original-no-newline","removed"):ht("","spacer","original-no-newline-spacer","")),u.push(m?Ur("modified-no-newline","added"):ht("","spacer","modified-no-newline-spacer",""))),zd([{key:"original",className:"markstream-pre__diff-pane--original",lines:a},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u}],r)}function bF(e){var t,n;if(e==null||e===!1)return null;const r=e===!0?{}:e;return r.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((t=r.contextLineCount)!==null&&t!==void 0?t:2)),minimumLineCount:Math.max(1,Math.floor((n=r.minimumLineCount)!==null&&n!==void 0?n:4))}}function zd(e,t){var n;const r=bF(t);if(!r||e.length<1||e.length>2||e.length===2&&e[0].lines.length!==e[1].lines.length)return e;const i=e[0].lines,o=(n=e[1])===null||n===void 0?void 0:n.lines;let l=i.length;for(;l>0&&e.every(c=>c.lines[l-1].kind==="metadata");)l--;const s=c=>i[c].kind==="context"&&(o===void 0||o[c].kind==="context"&&i[c].code===o[c].code),a=[];let u=0;for(;u<l;){const c=u;for(;u<l&&s(u);)u++;const p=u;if(p-c>=r.minimumLineCount){const d=c+(c===0?0:r.contextLineCount),f=p===l,g=p-(f?0:r.contextLineCount);g-d>=r.minimumLineCount&&a.push({start:d,end:f?i.length:g,count:f?l-d:g-d,first:d===0,last:f})}u===c&&u++}return a.length?e.map((c,p)=>{const d=[];let f=0;for(const g of a)d.push(...c.lines.slice(f,g.start)),d.push({code:p===0?`${g.count} unmodified lines`:"",kind:"collapsed",empty:!1,key:`${c.key}-collapsed-${g.start}-${g.end}`,number:"",collapsedFirst:g.first,collapsedLast:g.last}),f=g.end;return d.push(...c.lines.slice(f)),Si(Si({},c),{},{lines:d})}):e}function Ry(e){const t=e.loading===!0,n=e.inline===!0,r=Gs(e.code,t),i=e.originalCode,o=e.updatedCode,l=i!=null||o!=null;if(n)return zd([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:l?gF(yF(i,o,t,e.matchCache),i,o):kF(r)}],e.hideUnchangedRegions);if(!AF(r,e.language,e.raw)&&l)return CF(i,o,t,e.hideUnchangedRegions,e.matchCache);const{original:s,modified:a}=wF(r);return zd([{key:"original",className:"markstream-pre__diff-pane--original",lines:s.map((u,c)=>Si(Si({},u),{},{key:`original-${c}`,number:u.kind==="metadata"||u.kind==="spacer"?"":u.number}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:a.map((u,c)=>Si(Si({},u),{},{key:`modified-${c}`,number:u.kind==="metadata"||u.kind==="spacer"?"":u.number}))}],e.hideUnchangedRegions)}function xF(e){const t=e.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);return t?{original:Number(t[1]),modified:Number(t[2])}:void 0}function wF(e){const t=[],n=[],r=By(e);let i=1,o=1,l="context",s=0;for(;s<e.length;){const a=e[s];if(a===Ey){l==="removed"?(t.push(Ur("original-patch-no-newline","removed")),n.push(ht("","spacer","",""))):l==="added"?(t.push(ht("","spacer","","")),n.push(Ur("modified-patch-no-newline","added"))):(t.push(Ur("original-patch-no-newline","context")),n.push(Ur("modified-patch-no-newline","context"))),s++;continue}if(Dy(a,r)){s++;continue}if(a.startsWith("@@")){const c=xF(a);c&&(i=c.original,o=c.modified),t.push(ht(a,"hunk","","")),n.push(ht(a,"hunk","","")),l="context",s++;continue}if(bs(a)||Lu(a)){const c=[],p=[];for(;s<e.length&&(bs(e[s])||Lu(e[s]));)bs(e[s])?(c.push(Ou(e[s].slice(1),r)),l="removed"):(p.push(Ou(e[s].slice(1),r)),l="added"),s++;const d=Math.max(c.length,p.length);for(let f=0;f<d;f++)t.push(f<c.length?ht(c[f],"removed","",i++,!0):ht("","spacer","","")),n.push(f<p.length?ht(p[f],"added","",o++,!0):ht("","spacer","",""));continue}const u=r&&a.startsWith(" ")?a.slice(1):a;t.push(ht(u,"context","",i++)),n.push(ht(u,"context","",o++)),l="context",s++}return{original:t,modified:n}}function xR(e){const{getTranslate:t,setTranslate:n,canStart:r,onActiveChange:i}=e;let o=null,l={x:0,y:0},s={x:0,y:0};function a(p){const d=p==null?void 0:p.pointerId;d!=null&&d!==o||o!=null&&(o=null,typeof window<"u"&&(window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),window.removeEventListener("blur",a)),i==null||i(!1))}function u(p){if(!(o==null||p.pointerId!==o)){if(p.buttons===0){a();return}n({x:s.x+(p.clientX-l.x),y:s.y+(p.clientY-l.y)})}}function c(p){if(!(p.button!==0||o!=null)&&!(r&&!r(p))){if(p.preventDefault(),o=p.pointerId,l={x:p.clientX,y:p.clientY},s=t(),typeof window>"u"){o=null;return}window.addEventListener("pointermove",u),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a),window.addEventListener("blur",a),i==null||i(!0)}}return{start:c,stop:a,isActive:()=>o!=null}}const _F={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 SF(e){var t,n;const r=String(e??"").trim();if(!r)return"";const[i=""]=r.split(/\s+/);return(t=(n=i.split(":")[0])===null||n===void 0?void 0:n.trim().toLowerCase())!==null&&t!==void 0?t:""}function IF(e){var t;const n=SF(e);return(t=_F[n])!==null&&t!==void 0?t:n}function ao(e,t,n=1){const r=Number(e);return Number.isFinite(r)?Math.max(n,r):t}function p0(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}const g0=2048,EF=200;function Xf(){return typeof performance<"u"?performance.now():Date.now()}var MF=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.timerId=null,this.visibilityListener=null,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState="candidate",this.fenceIndent=0,this.fenceMarker="",this.fenceMarkerLength=0,this.activeFenceMarker="",this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges=[],this.atomicRevealRangeIndex=0,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=f=>this.destroyed?()=>{}:(this.listeners.add(f),()=>{this.listeners.delete(f)}),this.enqueue=f=>{if(this.destroyed||!f)return;this.done&&(this.done=!1);const g=this.source.length>0,m=this.pendingChars<=0,A=this.isRevealBlocked();if(this.source+=f,this.scanAppendedSource(),m||A&&!this.isRevealBlocked()){const v=Xf();this.startedAt=g&&this.hasStarted?v-this.normalizedStartDelayMs:v,this.lastTick=v,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(f={})=>{var g;if(!this.destroyed){if(this.done=!0,this.releaseTrailingFenceCandidate(),(g=f.flush)!==null&&g!==void 0?g:this.flushOnFinish){this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.releaseTrailingFenceCandidate(),this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(f="",g)=>{if(this.destroyed)return;this.cancelLoop(),g!=null&&g.prefixKnown?(this.source=f,this.scanAppendedSource()):f.startsWith(this.source)?(this.source=f,this.scanAppendedSource()):(this.resetFenceScanner(),this.source=f,this.scanAppendedSource());const m=this.getRevealableEnd();this.visible=m>=this.source.length?this.source:this.source.slice(0,m),this.discardConsumedAtomicRanges(),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 f=Xf();this.lastTick=f,this.startedAt||(this.startedAt=f),this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.detachVisibilityListener(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=f=>{if(this.rafId=0,this.timerId=null,this.destroyed||this.paused)return;if(!this.hasRevealableChars()){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(f-this.startedAt<this.normalizedStartDelayMs){this.ensureLoop();return}const g=this.pendingChars;if(this.burstInitialContent&&g>=this.burstRevealThresholdChars){const T=this.getRevealableEnd();this.visible.length<T&&(this.visible=T>=this.source.length?this.source:this.source.slice(0,T),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit()),this.ensureLoop();return}const m=1e3/Math.max(1,this.maxCommitFps),A=Math.min(100,Math.max(0,f-this.lastTick));if(A<m){this.ensureLoop();return}this.lastTick=f;const v=this.pendingChars,k=v>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,C=FF(v/Math.max(.001,k/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(C-this.currentCps)*.2,this.charBudget+=this.currentCps*(A/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),S=this.takeNextRevealSlice(b);S.text&&(this.visible+=S.text,this.charBudget=Math.max(0,this.charBudget-S.graphemeCount),this.emit()),this.ensureLoop()},this.handleVisibilityChange=()=>{if(!this.destroyed){if(this.isDocumentHidden()){this.cancelLoop(),this.ensureLoop();return}(this.timerId!=null||!this.rafId)&&(this.cancelLoop(),this.ensureLoop())}};const{minCharsPerSecond:n=40,maxCharsPerSecond:r=1e3,targetLatencyMs:i=900,catchUpLatencyMs:o=350,catchUpThreshold:l=600,maxCommitFps:s=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1,burstInitialContent:p=!1,burstRevealThresholdChars:d=g0}=e;this.minCharsPerSecond=ao(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ao(r,1e3,1)),this.normalizedTargetLatencyMs=ao(i,900,1),this.normalizedCatchUpLatencyMs=ao(o,350,1),this.normalizedCatchUpThreshold=p0(l,600),this.normalizedStartDelayMs=p0(a,80),this.maxCommitFps=Math.trunc(ao(s,30,1)),this.maxCharsPerCommit=Math.trunc(ao(u,80,1)),this.flushOnFinish=c,this.burstInitialContent=p===!0,this.burstRevealThresholdChars=Math.max(1,Math.trunc(ao(d,g0,1))),this.segmenter=BF(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}attachVisibilityListener(){this.visibilityListener||typeof document>"u"||typeof document.addEventListener!="function"||(this.visibilityListener=this.handleVisibilityChange,document.addEventListener("visibilitychange",this.visibilityListener))}detachVisibilityListener(){!this.visibilityListener||typeof document>"u"||typeof document.removeEventListener!="function"||(document.removeEventListener("visibilitychange",this.visibilityListener),this.visibilityListener=null)}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}resetFenceScanner(){this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState="candidate",this.fenceIndent=0,this.fenceMarker="",this.fenceMarkerLength=0,this.activeFenceMarker="",this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges.length=0,this.atomicRevealRangeIndex=0}scanAppendedSource(e=!1){for(;this.fenceScanOffset<this.source.length;){const t=this.source[this.fenceScanOffset];if(t==="\r"){if(this.fenceScanOffset+1>=this.source.length&&!e)break;if(this.source[this.fenceScanOffset+1]===`
207
+ `){const n=this.fenceScanOffset+2;this.completeFenceLine(n),this.fenceScanOffset=n;continue}}if(t===`
208
+ `){const n=this.fenceScanOffset+1;this.completeFenceLine(n),this.fenceScanOffset=n;continue}this.consumeFenceCharacter(t),this.fenceScanOffset++}this.updateFenceRevealBlock()}consumeFenceCharacter(e){if(this.fenceLineState!=="normal"){if(this.fenceLineState==="opening"){this.fenceMarker==="`"&&e==="`"&&(this.fenceLineState="normal");return}if(this.fenceLineState==="closing"){e!==" "&&e!==" "&&(this.fenceLineState="normal");return}if(!this.fenceMarker){if(e===" "&&this.fenceIndent<3){this.fenceIndent++;return}if(e==="`"||e==="~"){this.fenceMarker=e,this.fenceMarkerLength=1;return}this.fenceLineState="normal";return}if(e===this.fenceMarker){this.fenceMarkerLength++;return}if(this.activeFenceMarker){this.fenceLineState=this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(e===" "||e===" ")?"closing":"normal";return}this.fenceLineState=this.fenceMarkerLength>=3?"opening":"normal"}}completeFenceLine(e){const t=this.fenceLineState==="candidate"&&this.fenceMarkerLength>=3;!this.activeFenceMarker&&(this.fenceLineState==="opening"||t)?(this.atomicRevealRanges.push({start:this.fenceLineStart,end:e}),this.activeFenceMarker=this.fenceMarker,this.activeFenceLength=this.fenceMarkerLength):this.activeFenceMarker&&this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(this.fenceLineState==="closing"||t)&&(this.activeFenceMarker="",this.activeFenceLength=0),this.fenceLineStart=e,this.fenceLineState="candidate",this.fenceIndent=0,this.fenceMarker="",this.fenceMarkerLength=0,this.blockedRevealEnd=0}updateFenceRevealBlock(){this.blockedRevealEnd=!this.activeFenceMarker&&(this.fenceLineState==="opening"||this.fenceLineState==="candidate"&&(this.fenceIndent>0||this.fenceMarkerLength>0))?this.fenceLineStart+1:0}releaseTrailingFenceCandidate(){this.scanAppendedSource(!0),this.blockedRevealEnd&&((this.fenceLineState==="opening"||this.fenceLineState==="candidate"&&this.fenceMarkerLength>=3)&&this.source.length>this.fenceLineStart&&this.atomicRevealRanges.push({start:this.fenceLineStart,end:this.source.length}),this.fenceLineState="normal",this.blockedRevealEnd=0)}isRevealBlocked(){return this.blockedRevealEnd!==0}getRevealableEnd(){return this.blockedRevealEnd?Math.min(this.source.length,this.blockedRevealEnd-1):this.source.length}hasRevealableChars(){return this.visible.length<this.getRevealableEnd()}takeNextRevealSlice(e){this.discardConsumedAtomicRanges();const t=this.getRevealableEnd();if(this.visible.length>=t)return{text:"",graphemeCount:0};const n=this.atomicRevealRanges[this.atomicRevealRangeIndex];if(n&&this.visible.length>=n.start&&this.visible.length<n.end)return m0(this.source,this.visible.length,n.end-this.visible.length,this.segmenter,Math.min(n.end,t));const r=n&&n.start>this.visible.length?Math.min(n.start,t):t;return m0(this.source,this.visible.length,e,this.segmenter,r)}discardConsumedAtomicRanges(){for(;this.atomicRevealRangeIndex<this.atomicRevealRanges.length&&this.atomicRevealRanges[this.atomicRevealRangeIndex].end<=this.visible.length;)this.atomicRevealRangeIndex++;this.atomicRevealRangeIndex>=64&&this.atomicRevealRangeIndex*2>=this.atomicRevealRanges.length&&(this.atomicRevealRanges.splice(0,this.atomicRevealRangeIndex),this.atomicRevealRangeIndex=0)}isDocumentHidden(){return typeof document<"u"&&document.visibilityState==="hidden"}ensureLoop(){if(!(this.destroyed||this.rafId||this.timerId!=null||this.paused||!this.hasRevealableChars())){if(typeof requestAnimationFrame!="function"){this.flush();return}if(this.attachVisibilityListener(),this.isDocumentHidden()&&typeof setTimeout=="function"){this.timerId=setTimeout(()=>{this.timerId=null,this.tick(Xf())},EF);return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0),this.timerId!=null&&(clearTimeout(this.timerId),this.timerId=null),this.detachVisibilityListener()}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function TF(e={},t){const n=new MF(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 BF(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function m0(e,t,n,r,i=e.length){const o=Math.min(e.length,Math.max(t,i));if(t>=o||n<=0)return{text:"",graphemeCount:0};if(!r){let p=t,d=0;for(;p<o&&d<n;){const f=e.charCodeAt(p),g=e.charCodeAt(p+1),m=f>=55296&&f<=56319&&g>=56320&&g<=57343?2:1;p=Math.min(o,p+m),d++}return{text:e.slice(t,p),graphemeCount:d}}let l=t,s=0,a=!0;for(;s<n&&l<o;){const p=e.codePointAt(l),d=p>65535?2:1;if(l+d>o||!A0(p)){a=!1;break}l+=d,s++}if(a&&l>t&&!(l<o&&e.charCodeAt(l-1)===13&&e.charCodeAt(l)===10)){const p=e.codePointAt(l),d=p!=null&&l+(p!=null&&p>65535?2:1)<=o&&A0(p);if(l>=o||d)return{text:e.slice(t,l),graphemeCount:s}}const u=o-t;let c=Math.min(u,Math.max(64,n*2));for(;;){const p=c>=u,d=e.slice(t,t+c);let f=0,g=0;for(const m of r.segment(d)){if(g>=n)return{text:e.slice(t,t+f),graphemeCount:g};f+=m.segment.length,g++}if(p)return{text:e.slice(t,t+f),graphemeCount:g};c=Math.min(u,c*2)}}function FF(e,t,n){return Math.min(n,Math.max(t,e))}function DF(e){return e>=11904&&e<=12329||e>=12336&&e<=12351||e>=12352&&e<=12440||e>=12443&&e<=12543||e>=12544&&e<=12799||e>=12800&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65437||e>=65440&&e<=65519||e>=127488&&e<=127743||e>=131072&&e<=196607}function A0(e){return e<=127||DF(e)}const wR=120,_R=360;function ho(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function RF(e){var t;for(const n of e.split(/\r?\n/)){const r=n.trim();if(!r||r.startsWith("%%"))continue;const i=r.match(/^([A-Z][\w-]*)\b/i);return((t=i==null?void 0:i[1])==null?void 0:t.toLowerCase())||""}return""}function $u(e){const t=e.split(/\r?\n/).map(i=>i.trim()).filter(i=>i&&!i.startsWith("%%")),n=Math.max(1,t.length),r=RF(e);return r==="gantt"?220+28*n:r==="sequencediagram"?180+26*n:r==="classdiagram"||r==="statediagram"||r==="erdiagram"?180+24*n:r==="flowchart"||r==="graph"?170+28*n:200+22*n}function Hu(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 na(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Wu(e,t=360,n=500){return na(e,t,n)}function SR(e,t=120,n=500){return na(e,t,n)}function Ku(e,t=360,n=500){return na(e,t,n)}function Ny(e,t=240,n=500){return na(e,t,n)}const NF=new Set(["direction","label","shape","icon","near","link","tooltip","width","height","grid-rows","grid-columns","grid-gap","vertical-gap","horizontal-gap","class","constraint","source-arrowhead","target-arrowhead"]),LF=new Set(["vars","classes","style","layers","scenarios","steps"]);function v0(e){let t=0,n=!1;for(let r=0;r<e.length;r++){const i=e[r];i!=='"'&&i!=="'"?n||(i==="{"?t+=1:i==="}"&&(t-=1)):n=!n}return t}function Ly(e){let t=0,n=0,r=0;for(const i of e.split(/\r?\n/)){const o=i.trim();if(r>0){r=Math.max(0,r+v0(o));continue}if(!o||o.startsWith("#")||o.startsWith("...")||/^[}\]]+$/.test(o))continue;const l=o.match(/^([A-Z_][\w-]*)\s*:(.*)$/i);if(l){const s=l[1].toLowerCase();if(LF.has(s)){t+=1,r=Math.max(0,v0(l[2]));continue}if(NF.has(s)){t+=1;continue}}n+=1,t+=1}return na(120+46*Math.max(1,n)+8*Math.max(0,t-n),240,500)}var OF=Object.defineProperty,PF=Object.defineProperties,$F=Object.getOwnPropertyDescriptors,k0=Object.getOwnPropertySymbols,HF=Object.prototype.hasOwnProperty,WF=Object.prototype.propertyIsEnumerable,y0=(e,t,n)=>t in e?OF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oy=(e,t)=>{for(var n in t||(t={}))HF.call(t,n)&&y0(e,n,t[n]);if(k0)for(var n of k0(t))WF.call(t,n)&&y0(e,n,t[n]);return e},C0=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{s(n.next(a))}catch(u){i(u)}},l=a=>{try{s(n.throw(a))}catch(u){i(u)}},s=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,l);s((n=n.apply(e,t)).next())});const Gd=()=>wn(()=>import("./mermaid.core-BvSKTRe8.js").then(e=>e.bn),__vite__mapDeps([2,3,4,5]));let vi=null,us=Gd,Qa=null,b0=!1,x0=!1;function Qd(){return typeof us=="function"}function w0(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 i=t.mermaidAPI;return n=Oy({},t),r={render:i.render.bind(i),parse:i.parse?i.parse.bind(i):void 0,initialize:o=>typeof t.initialize=="function"?t.initialize(o):i.initialize?i.initialize(o):void 0},PF(n,$F(r))}var n,r;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function _0(e){if(e)try{const t=e==null?void 0:e.initialize;e.initialize=n=>{const r=Oy({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,r):e!=null&&e.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(r):void 0}}catch{}}function IR(){return C0(this,null,function*(){if(vi)return vi;const e=(function(){try{const n=globalThis;return w0(n==null?void 0:n.mermaid)}catch{return null}})();if(e)return vi=e,_0(vi),vi;const t=us;return t?t===Gd&&b0?null:Qa||(Qa=C0(null,null,function*(){let n;try{n=yield t()}catch(r){if(t===Gd)return t===us&&(b0=!0,(function(i){x0||(x0=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(r)),null;throw r}finally{t===us&&(Qa=null)}return t!==us?null:n?(vi=w0(n),_0(vi),vi):null}),Qa):null})}let Vo=null;const Jo=new Map,Ud="MERMAID_DISABLED";function Py(e,t,n,r){if(!Qd()){const l=new Error("Mermaid rendering disabled");return l.name="MermaidDisabled",l.code=Ud,Promise.reject(l)}const i=`${e}\0${t.theme}\0${n}\0${t.code}`;let o=Jo.get(i);return o||(o=(function(l,s,a=1400){if(!Qd()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=Ud,Promise.reject(u)}return Vo||(Vo=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Vo.name="WorkerInitError",Vo.code="WORKER_INIT_ERROR"),Promise.reject(Vo)})(e,t,n),Jo.set(i,o),o.then(()=>{Jo.get(i)===o&&Jo.delete(i)},()=>{Jo.get(i)===o&&Jo.delete(i)})),(function(l,s){if(!s)return l;if(s.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const p=()=>s.removeEventListener("abort",c);c=()=>{p();const d=new Error("Aborted");d.name="AbortError",u(d)},s.addEventListener("abort",c,{once:!0}),l.then(d=>{p(),a(d)},d=>{p(),u(d)})})})(o,r)}function KF(e,t,n=1400,r){return Py("canParse",{code:e,theme:t},n,r)}function jF(e,t,n=1400,r){return Py("findPrefix",{code:e,theme:t},n,r)}function zF(e){try{if(typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function")return globalThis.requestAnimationFrame(e)}catch{}return globalThis.setTimeout(e,0)}function GF(e){try{if(e==null)return;if(typeof globalThis<"u"&&typeof globalThis.cancelAnimationFrame=="function")return void globalThis.cancelAnimationFrame(e)}catch{}try{globalThis.clearTimeout(e)}catch{}}var QF=Object.defineProperty,UF=Object.defineProperties,YF=Object.getOwnPropertyDescriptors,S0=Object.getOwnPropertySymbols,ZF=Object.prototype.hasOwnProperty,VF=Object.prototype.propertyIsEnumerable,I0=(e,t,n)=>t in e?QF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ae=(e,t)=>{for(var n in t||(t={}))ZF.call(t,n)&&I0(e,n,t[n]);if(S0)for(var n of S0(t))VF.call(t,n)&&I0(e,n,t[n]);return e},lt=(e,t)=>UF(e,YF(t)),$t=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{s(n.next(a))}catch(u){i(u)}},l=a=>{try{s(n.throw(a))}catch(u){i(u)}},s=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,l);s((n=n.apply(e,t)).next())});const JF="__global__",qf="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Yd=(()=>{const e=globalThis;if(e[qf])return e[qf];const t={scopedCustomComponents:{},revision:Oi(0)};return e[qf]=t,t})(),E0=Yd.revision,XF=Symbol("markstreamCustomComponents"),qF=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 ra(e){return qF.has(String(e).trim().toLowerCase())}function eD(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function ed(e={}){const t={};for(const[n,r]of Object.entries(e))if(r!=null){t[n]=r;for(const i of new Set([cr(n),cr(eD(n))]))!i||ra(i)||Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r)}return t}function sn(e){const t=Bt(XF,null);return L(()=>{var n;return E0.value,(function(r,i={}){return E0.value,Ae(Ae(Ae({},ed(Yd.scopedCustomComponents[JF]||{})),ed(i)),ed((function(o){return o&&Yd.scopedCustomComponents[o]||{}})(r)))})(e==null?void 0:e(),(n=t==null?void 0:t.value)!=null?n:{})})}const tD=["aria-label"],nD={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"},rD={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"},mt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Vn=mt(Ve({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(J(),he("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(J(),he("svg",rD,[...n[1]||(n[1]=[Re("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),Re("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(J(),he("svg",nD,[...n[0]||(n[0]=[Re("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,tD))}),[["__scopeId","data-v-be21ab83"]]);Vn.install=e=>{e.component(Vn.__name,Vn)};const iD={class:"emoji-node"},Rn=mt(Ve({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(J(),he("span",iD,kt(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Rn.install=e=>{e.component(Rn.__name,Rn)};const M0=".markdown-renderer";function $y(e,t){var n,r;if(typeof document>"u"||typeof Element>"u")return null;const i=(function(l){return`[id="${l.replace(/["\\]/g,"\\$&")}"]`})(t);let o=e instanceof Element?e.closest(M0):null;for(;o;){const l=o.querySelector(i);if(l)return l;o=(r=(n=o.parentElement)==null?void 0:n.closest(M0))!=null?r:null}return document.querySelector(i)}const oD=["id"],lD=["title"],Jn=mt(Ve({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=e,n=`#fnref--${t.node.id}`;function r(i){if(typeof document>"u")return;const o=$y(i.currentTarget,`fnref--${t.node.id}`);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(i,o)=>(J(),he("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:r},[Re("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+kt(e.node.id)+"]",9,lD)],8,oD))}}),[["__scopeId","data-v-d1baf613"]]);Jn.install=e=>{e.component(Jn.__name,Jn)};const Hy=(()=>{try{return!1}catch{}return!1})();function td(e){Hy&&console.warn(e)}function Wy(e,t){return ay(e,t)}function T0(e,t="safe",n){return sc(e,t,n)}function Ky(e){return cy(e)}function nd(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function dp(e,t="safe"){const n=String(e.tag||e.type||"").trim(),r=ys((i=e.attrs)?Array.isArray(i)?i.every(Array.isArray)?i.map(([l,s])=>[String(l),nd(s)]):i.filter(l=>l&&typeof l=="object"&&!Array.isArray(l)&&"name"in l).map(l=>[String(l.name),nd(l.value)]):Object.entries(i).map(([l,s])=>[l,nd(s)]):null,t,n);var i;if(!r)return;const o=Ky(ul(r));return Object.keys(o).length>0?o:void 0}function B0(e,t,n=!1){const r=Object.entries(t??{}),i=r.length>0?r.map(([o,l])=>l===""?` ${o}`:` ${o}="${l}"`).join(""):"";return n?`<${e}${i} />`:`<${e}${i}>`}function es(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function rd(e,t,n,r,i,o,l=!1){const s=Wy(e,r);if(vl.has(e.toLowerCase())||!s&&sp(e,o))return null;if(!s&&lc(e,o))return l?[B0(e,t,!0)]:[B0(e,t),...n,`</${e}>`];const a=sc(t,o,e),u=a.key,c=u!=null&&u!==""?u:i;if(s){const p=r[e]||r[e.toLowerCase()],d=Ky(a);return Te(p,lt(Ae({},d),{key:c}),n.length>0?n:void 0)}return Te(e,lt(Ae({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function jy(e,t,n="safe",r=!1){var i,o;try{if(!r&&Object.keys(t).length===0)return{ok:!0,hasCustomComponents:!1,nodes:null};const l=fy(e);let s=!1;for(const u of l)if((u.type==="tag_open"||u.type==="self_closing")&&Wy((i=u.tagName)!=null?i:"",t)){s=!0;break}const a=r||s?(function(u,c,p="safe"){let d=0;const f=[],g=[];for(const m of u)if(m.type==="text")(f.length>0?f[f.length-1].children:g).push(m.content);else if(m.type==="self_closing"){const A=rd(m.tagName,m.attrs||{},[],c,"ms-html-"+d++,p,!0);es(f.length>0?f[f.length-1].children:g,A)}else if(m.type==="tag_open")f.push({tagName:m.tagName,children:[],attrs:m.attrs,autoKey:"ms-html-"+d++});else if(m.type==="tag_close"){const A=m.tagName.toLowerCase();let v=-1;for(let k=f.length-1;k>=0;k--)if(f[k].tagName.toLowerCase()===A){v=k;break}if(v!==-1)for(;f.length>v;){const k=f.pop(),C=rd(k.tagName,k.attrs||{},k.children,c,k.autoKey,p);f.length>0?es(f[f.length-1].children,C):es(g,C),k.tagName.toLowerCase()!==A&&f.length>v&&td(`Auto-closing unclosed tag: <${k.tagName}>`)}else td(`Ignoring closing tag with no matching opening tag: </${m.tagName}>`)}for(;f.length>0;){const m=f.pop(),A=rd(m.tagName,m.attrs||{},m.children,c,m.autoKey,p);f.length>0?es(f[f.length-1].children,A):es(g,A),td(`Auto-closing unclosed tag: <${m.tagName}>`)}return g})(l,t,n):null;return{ok:!0,hasCustomComponents:s,nodes:a}}catch(l){return o=l,Hy&&console.error("Failed to parse HTML to VNodes:",o),{ok:!1,hasCustomComponents:!1,nodes:null}}}const sD=["innerHTML"],Xn=mt(Ve({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),r=L(()=>{var s,a;return(a=(s=t.htmlPolicy)!=null?s:n==null?void 0:n.value)!=null?a:"safe"}),i=sn(()=>t.customId),o=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),l=L(()=>{const s=t.node.content;if(!s)return{mode:"html",content:""};if(r.value==="escape")return{mode:"html",content:js(s,r.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:s};const a=t.node.loading===!0&&t.node.autoClosed===!0,u=jy(s,i.value,r.value,a);return u.ok&&(a||u.hasCustomComponents)?{mode:"dynamic",nodes:u.nodes}:{mode:"html",content:js(s,r.value)}});return(s,a)=>l.value.mode==="dynamic"?(J(),he("span",{key:0,class:cn(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[xr(He(o),{nodes:l.value.nodes},null,8,["nodes"])],2)):l.value.mode==="text"?(J(),he("span",{key:1,class:cn(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},kt(l.value.content),3)):(J(),he("span",{key:2,class:cn(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:l.value.content},null,10,sD))}}),[["__scopeId","data-v-fbbbc497"]]);function zy(e){const t=be(e),n=Oi([]);let r=e,i=0;function o(){let l=0,s="";for(const a of n.value){if(!a.finished)break;s+=a.content,l++}l&&(t.value+=s,n.value=n.value.slice(l))}return{settledContent:t,segments:n,update:function(l,s,a){if(a&&l===r&&(!s||s===l||n.value.length>0))return;const u=s??r;if(a&&u&&l.length>u.length&&l.startsWith(u)){u!==r&&(t.value=u,n.value=[]);const c=l.slice(u.length),p=performance.now(),d=n.value.at(-1);d&&(p-d.startedAt<50||n.value.length>=4)?n.value=[...n.value.slice(0,-1),lt(Ae({},d),{content:d.content+c})]:n.value=[...n.value,{id:i++,content:c,startedAt:p,finished:!1}]}else t.value=l,n.value=[];r=l},finish:function(l,s=!1){const a=n.value.find(u=>u.id===l);a&&(a.finished=!0,s||o())},settleFinished:o}}Xn.install=e=>{e.component(Xn.__name,Xn)};const aD={class:"inline-code"},uD={key:0},cD=["onAnimationend"],An=mt(Ve({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Al(),r=Bt("markstreamFade",void 0),i=Bt("markstreamTextStreamState",void 0),o=L(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=L(()=>typeof o.value=="boolean"?o.value:typeof(r==null?void 0:r.value)!="boolean"||r.value),s=L(()=>{var g;return String((g=t.node.code)!=null?g:"")}),a=L(()=>!l.value),u=L(()=>{var g;const m=(g=n["index-key"])!=null?g:n.indexKey;return m==null||m===""?"":String(m)}),{settledContent:c,segments:p,update:d,finish:f}=zy(t.node.code);return Ie([()=>t.node.code,u,l],([g])=>{const m=String(g??""),A=u.value;d(m,A?i==null?void 0:i.get(A):void 0,l.value),A&&(i==null||i.set(A,m))},{immediate:!0}),(g,m)=>(J(),he("code",aD,[a.value?(J(),he(Je,{key:0},[d1(kt(s.value),1)],64)):(J(),he(Je,{key:1},[He(c)?(J(),he("span",uD,kt(He(c)),1)):Gt("",!0),(J(!0),he(Je,null,_t(He(p),A=>(J(),he("span",{key:A.id,class:"inline-code-stream-delta",onAnimationend:v=>He(f)(A.id)},kt(A.content),41,cD))),128))],64))]))}}),[["__scopeId","data-v-557cf4dd"]]);An.install=e=>{e.component(An.__name,An)};const Zd=be(!1),F0=be(""),D0=be("top"),xs=be(null),ws=be(null),Vd=be(null),Jd=be(null),R0=be(null);let fu=null,du=null,Xd=0;function Gy(){fu&&(clearTimeout(fu),fu=null),du&&(clearTimeout(du),du=null)}let Ua=!1,Ya=null,N0=!1;function fD(e,t,n="top",r=!1,i,o){if(!e)return;const l=++Xd;Gy();const s=()=>$t(null,null,function*(){var a,u;if(yield(function(){return $t(this,null,function*(){if(!Ua&&!N0&&typeof document<"u"){Ya!=null||(Ya=$t(null,null,function*(){const[{createApp:c,h:p},{default:d}]=yield Promise.all([wn(()=>import("./vendor-vue-CrmKjNvT.js").then(g=>g.aa),[]),wn(()=>import("./Tooltip-ZLwIccO5.js"),__vite__mapDeps([6,3,4,5]))]),f=document.createElement("div");f.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(f),c({setup:()=>()=>{var g;return p(d,{visible:Zd.value,"anchor-el":xs.value,content:F0.value,placement:D0.value,id:ws.value,originX:Vd.value,originY:Jd.value,isDark:(g=R0.value)!=null?g:void 0})}}).mount(f),Ua=!0}));try{yield Ya}catch(c){Ua=!1,Ya=null,N0=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),Ua&&l===Xd){ws.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,xs.value=e,F0.value=t,D0.value=n,Vd.value=(a=i==null?void 0:i.x)!=null?a:null,Jd.value=(u=i==null?void 0:i.y)!=null?u:null,R0.value=typeof o=="boolean"?o:null,Zd.value=!0;try{e.setAttribute("aria-describedby",ws.value)}catch{}}});r?s():fu=setTimeout(s,80)}function dD(e=!1){Xd+=1,Gy();const t=()=>{if(xs.value&&ws.value)try{xs.value.removeAttribute("aria-describedby")}catch{}Zd.value=!1,xs.value=null,ws.value=null,Vd.value=null,Jd.value=null};e?t():du=setTimeout(t,120)}const hD={"common.copy":"Copy","common.selectCopy":"全选(复制)","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..."},pD=Symbol("markstreamI18nFallback");function Qy(e,t){var n;return(n=t==null?void 0:t[e])!=null?n:hD[e]}const qd=(e,t)=>{var n;return(n=Qy(e,t))!=null?n:(function(r){return(r.split(".").pop()||r).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,i=>i.toUpperCase()).trim()})(e)};function L0(e,t){return{t(n){const r=Qy(n,t);if(e.te&&r!=null&&!e.te(n))return qd(n,t);const i=e.t(n);return i===n&&r!=null?qd(n,t):i}}}function gD(){const e=(function(){var n,r,i;try{const o=Bs(),l=pD,s=o==null?void 0:o.provides,a=(n=o==null?void 0:o.appContext)==null?void 0:n.provides;return(i=(r=s==null?void 0:s[l])!=null?r:a==null?void 0:a[l])!=null?i:null}catch{}return null})(),t=(function(){var n,r;try{const i=Bs(),o=i==null?void 0:i.proxy,l=o==null?void 0:o.$t;if(typeof l=="function"){const u=o==null?void 0:o.$te;return{t:l.bind(o),te:typeof u=="function"?u.bind(o):void 0}}const s=(r=(n=i==null?void 0:i.appContext)==null?void 0:n.config)==null?void 0:r.globalProperties,a=s==null?void 0:s.$t;if(typeof a=="function"){const u=s==null?void 0:s.$te;return{t:a.bind(s),te:typeof u=="function"?u.bind(s):void 0}}}catch{}return null})();if(t)return L0(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const r=n();if(r&&typeof r.t=="function")return L0({t:r.t.bind(r),te:typeof r.te=="function"?r.te.bind(r):void 0},e)}catch{}}catch{}return{t:n=>qd(n,e)}}const Uy=Symbol("ViewportPriority"),Yy=Symbol("ViewportPriorityOptions"),Zy=Symbol("OffscreenHeavyNodeDeferral"),mD=L(()=>!1),Ao="400px";function hp(){return Bt(Yy,void 0)}function pp(){return Bt(Zy,mD)}function AD(e,t){var n,r;const i=typeof window<"u"&&typeof document<"u",o=typeof t=="boolean"?be(t):t,l=i?(n=window.requestIdleCallback)!=null?n:M=>window.setTimeout(()=>M({didTimeout:!0,timeRemaining:()=>0}),16):null,s=i?(r=window.cancelIdleCallback)!=null?r:M=>window.clearTimeout(M):null,a=new WeakMap;let u=1;const c=new Map,p=new Map,d=new Set;let f=null,g=null;function m(M){if(!M)return"viewport";let E=a.get(M);return E||(E=u++,a.set(M,E)),String(E)}function A(){if(f!=null){try{s==null||s(f)}catch{}f=null}}function v(M){if(M){const E=c.get(M);if(E&&!E.targets.size){try{E.io.disconnect()}catch{}c.delete(M)}}p.size||d.size||A()}function k(M){const E=p.get(M);if(!E)return;const $=c.get(E.bucketKey);if(!E.visible.value){E.visible.value=!0;try{E.resolve()}catch{}}try{$==null||$.io.unobserve(M)}catch{}$==null||$.targets.delete(M),p.delete(M),d.delete(M),v(E.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&f==null&&d.size&&(f=l(()=>{f=null;const M=d.values().next().value;M&&(d.delete(M),k(M),d.size&&C())},{timeout:1200}))}function b(M,E){if(!i||typeof IntersectionObserver>"u")return null;const $=(function(_,W){var z,N,R;return{root:(z=e==null?void 0:e(_??null))!=null?z:null,rootMargin:(N=W==null?void 0:W.rootMargin)!=null?N:Ao,threshold:(R=W==null?void 0:W.threshold)!=null?R:0}})(M,E),X=[m((K=$).root),K.rootMargin,K.threshold].join("\0");var K;const I=c.get(X);if(I)return{key:X,bucket:I};let B;try{B=new IntersectionObserver(_=>{for(const W of _)(W.isIntersecting||W.intersectionRatio>0)&&k(W.target)},{root:$.root,rootMargin:$.rootMargin,threshold:$.threshold})}catch{return null}const P={io:B,targets:new Map};return c.set(X,P),{key:X,bucket:P}}function S(){if(i&&o.value)for(const[M,E]of Array.from(p.entries())){const $=b(M,E.opts);if(!$){k(M);continue}if($.key===E.bucketKey)continue;const X=E.bucketKey,K=c.get(X);try{K==null||K.io.unobserve(M)}catch{}K==null||K.targets.delete(M),E.bucketKey=$.key,$.bucket.targets.set(M,E),$.bucket.io.observe(M),v(X)}}Ie(o,M=>{if(!M){for(const E of Array.from(p.keys()))k(E);A()}},{flush:"sync"});const T=(M,E)=>{const $=be(!1);let X,K=!1;const I=new Promise(W=>{X=()=>{K||(K=!0,W())}}),B=()=>{const W=p.get(M);if(!W)return d.delete(M),void v();const z=c.get(W.bucketKey);try{z==null||z.io.unobserve(M)}catch{}z==null||z.targets.delete(M),p.delete(M),d.delete(M),v(W.bucketKey)};if(!i||!o.value)return $.value=!0,X(),{isVisible:$,whenVisible:I,destroy:B};const P=b(M,E);if(!P)return $.value=!0,X(),{isVisible:$,whenVisible:I,destroy:B};const _={resolve:X,visible:$,bucketKey:P.key,opts:E};return p.set(M,_),P.bucket.targets.set(M,_),P.bucket.io.observe(M),i&&g==null&&(g=window.requestAnimationFrame(()=>{g=null,S()})),(E==null?void 0:E.allowIdle)!==!1&&(d.add(M),C()),{isVisible:$,whenVisible:I,destroy:B}};return T.refresh=S,Ut(Uy,T),T}function gp(){var e,t;const n=Bt(Uy,void 0);if(n)return n;const r=new WeakMap,i=new Map,o=new Set;let l=null;const s=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,u=()=>{if(l!=null){try{a==null||a(l)}catch{}l=null}},c=f=>{if(!f)return;const g=i.get(f);if(g&&!g.targets.size){try{g.io.disconnect()}catch{}i.delete(f)}},p=f=>{const g=r.get(f);if(!g)return;const m=i.get(g.bucketKey);if(!g.visible.value){g.visible.value=!0;try{g.resolve()}catch{}}try{m==null||m.io.unobserve(f)}catch{}r.delete(f),m==null||m.targets.delete(f),o.delete(f),c(g.bucketKey),o.size||u()},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&s&&l==null&&o.size&&(l=s(()=>{l=null;const f=o.values().next().value;f&&(o.delete(f),p(f),o.size&&d())},{timeout:1200}))};return(f,g)=>{const m=be(!1);let A,v=!1;const k=new Promise(S=>{A=()=>{v||(v=!0,S())}}),C=()=>{const S=r.get(f);if(!S)return o.delete(f),void(o.size||u());const T=i.get(S.bucketKey);try{T==null||T.io.unobserve(f)}catch{}r.delete(f),T==null||T.targets.delete(f),o.delete(f),c(S.bucketKey),o.size||u()},b=(S=>{var T,M;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const E=(B=>{var P,_;return[(P=B==null?void 0:B.rootMargin)!=null?P:Ao,(_=B==null?void 0:B.threshold)!=null?_:0].join("\0")})(S),$=i.get(E);if($)return{key:E,bucket:$};const X=(T=S==null?void 0:S.rootMargin)!=null?T:Ao;let K;try{K=new IntersectionObserver(B=>{for(const P of B)(P.isIntersecting||P.intersectionRatio>0)&&p(P.target)},{root:null,rootMargin:X,threshold:(M=S==null?void 0:S.threshold)!=null?M:0})}catch{return null}const I={io:K,targets:new Set};return i.set(E,I),{key:E,bucket:I}})(g);return b?(r.set(f,{resolve:A,visible:m,bucketKey:b.key}),b.bucket.targets.add(f),b.bucket.io.observe(f),(g==null?void 0:g.allowIdle)!==!1&&(o.add(f),d()),{isVisible:m,whenVisible:k,destroy:C}):(m.value=!0,A(),{isVisible:m,whenVisible:k,destroy:C})}}function vD(e,t){var n,r;const i=(r=(n=e.indexKey)!=null?n:t["index-key"])!=null?r:t.indexKey;return i==null||i===""?"":String(i)}const kD=["data-markstream-viewport-pending"],yD=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],CD={key:1,class:"image-placeholder"},bD={key:1,class:"image-node__raw-text"},xD={key:2,class:"image-error"},Vr=mt(Ve({__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,r,i;const o=e,l=t,s=be(!1),a=be(!1),u=be(!1),c=be(""),p=be("primary"),d=be(null),f=Al(),g=Bt(Ru,null),m=gp(),A=hp(),v=pp(),k=L(()=>_d(o.node.src)),C=L(()=>_d(o.fallbackSrc)),b=(i=(r=(n=Bs())==null?void 0:n.vnode.el)==null?void 0:r.querySelector)==null?void 0:i.call(r,"img"),S=typeof window<"u"&&(b==null?void 0:b.getAttribute("src"))===(k.value||C.value),T=be(typeof window>"u"||S||!v.value),M=Oi(null);let E="",$=null;const X=L(()=>c.value),K=L(()=>!o.lazy),I=L(()=>typeof window<"u"&&v.value&&!S),B=L(()=>!I.value||T.value),P=L(()=>B.value?X.value:""),_=L(()=>{var ce,Ce;return(Ce=(ce=A==null?void 0:A.value.heavyBlockMargin)!=null?ce:A==null?void 0:A.value.rootMargin)!=null?Ce:Ao}),W=L(()=>!o.node.loading&&p.value!=="failed"&&c.value.length>0),z=L(()=>p.value==="failed"),N=L(()=>(a.value||!K.value||I.value)&&!s.value&&!u.value&&p.value!=="failed"&&c.value.length>0),R=L(()=>vD(o,f));function oe(ce=R.value){ce&&d.value&&(g==null||g.reportHeight(ce,d.value.offsetHeight))}function ne(ce=R.value){ce&&dn(()=>{oe(ce)})}function ee(){$&&(clearTimeout($),$=null)}function ie(){const ce=R.value;ce&&E!==ce&&(E&&(g==null||g.markSettled(E)),ee(),E=ce,g==null||g.markPending(ce),typeof window<"u"&&($=window.setTimeout(()=>{E===ce&&(ne(ce),G())},8e3)))}function G(){return $t(this,null,function*(){const ce=E;ce&&(ee(),E="",yield dn(),oe(ce),g==null||g.markSettled(ce))})}function Q(){if(p.value==="primary"&&C.value&&C.value!==c.value)return p.value="fallback",c.value=C.value,s.value=!1,u.value=!1,void ne();p.value="failed",u.value=!0,l("error",c.value),ne()}function te(){s.value=!0,a.value=!1,u.value=!1,l("load",X.value),ne()}function re(ce){ce.preventDefault(),s.value&&!u.value&&l("click",[ce,X.value])}const{t:pe}=gD();return Ie([k,C,()=>o.node.loading],()=>(s.value=!1,u.value=!1,o.node.loading?(a.value=!0,c.value=k.value,void(p.value="primary")):k.value?(c.value=k.value,void(p.value="primary")):C.value?(c.value=C.value,void(p.value="fallback")):(c.value="",p.value="failed",void(u.value=!0))),{immediate:!0}),typeof window<"u"&&Ie([d,I],([ce,Ce],ze,Ne)=>{var Ze;if((Ze=M.value)==null||Ze.destroy(),M.value=null,!Ce||T.value)return void(T.value=!0);if(!ce)return void(T.value=!1);let st=!0;const Ke=m(ce,{rootMargin:_.value,allowIdle:!1});M.value=Ke,T.value=Ke.isVisible.value,Ke.whenVisible.then(()=>{st&&M.value===Ke&&(T.value=!0)}),Ne(()=>{st=!1,Ke.destroy(),M.value===Ke&&(M.value=null)})},{immediate:!0}),Ie([W,s,u,X,()=>o.lazy,B],([ce,Ce,ze,Ne,Ze,st])=>ce&&Ne&&!ze&&st?Ce?(G(),void ne()):Ze?(ie(),void ne()):void(Ce||ze||ie()):(G(),void ne()),{flush:"post",immediate:!0}),mo(()=>{var ce;(ce=M.value)==null||ce.destroy(),M.value=null,(function(){const Ce=E;Ce&&(ee(),E="",g==null||g.markSettled(Ce))})()}),(ce,Ce)=>{var ze,Ne,Ze,st,Ke;return J(),he("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":I.value&&!T.value?"true":void 0},[W.value?(J(),he("img",{key:0,src:P.value||void 0,alt:String((Ne=(ze=o.node.alt)!=null?ze:o.node.title)!=null?Ne:""),title:String((st=(Ze=o.node.title)!=null?Ze:o.node.alt)!=null?st:""),class:cn(["image-node__img",{"has-placeholder":e.node.loading||N.value,"is-loading":!K.value&&!s.value,"is-loaded":K.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:o.lazy?"lazy":void 0,fetchpriority:K.value?"high":void 0,decoding:K.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(Ke=o.node.alt)!=null?Ke:He(pe)("image.preview"),onError:Q,onLoad:te,onClick:re},null,42,yD)):Gt("",!0),!e.node.loading&&!N.value||u.value?Gt("",!0):(J(),he("span",CD,[o.usePlaceholder?gu(ce.$slots,"placeholder",{key:0,node:o.node,displaySrc:X.value,imageLoaded:s.value,hasError:u.value,fallbackSrc:o.fallbackSrc,lazy:o.lazy},()=>[Ce[0]||(Ce[0]=Re("span",{class:"image-shimmer"},null,-1))],!0):(J(),he("span",bD,kt(e.node.raw),1))])),z.value?(J(),he("span",xD,[gu(ce.$slots,"error",{node:o.node,displaySrc:X.value,imageLoaded:s.value,hasError:u.value,fallbackSrc:o.fallbackSrc,lazy:o.lazy},()=>[Ce[1]||(Ce[1]=Re("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[Re("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)),Re("span",null,kt(He(pe)("image.loadError")),1)],!0)])):Gt("",!0)],8,kD)}}}),[["__scopeId","data-v-e4e45fcb"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const ju=Zr({loader:()=>Promise.resolve().then(()=>fC),suspensible:!1}),wD={key:2},Nr=Ve({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=sn(()=>t.customId),r=Bt("markstreamHtmlPolicy",void 0),i=Bt("markstreamNestedRendererProps",void 0),o=L(()=>{var f;return(f=r==null?void 0:r.value)!=null?f:"safe"}),l=L(()=>{var f,g;const m=(f=i==null?void 0:i.value)!=null?f:{};return lt(Ae({},m),{customId:(g=t.customId)!=null?g:m.customId,htmlPolicy:o.value})}),s=L(()=>t.components[String(t.node.type)]),a=L(()=>!!(s.value&&n.value[t.node.type]&&!ra(String(t.node.type)))),u=L(()=>a.value?dp(t.node,o.value):void 0),c=L(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=L(()=>{var f;return String((f=t.node.content)!=null?f:"")}),d=L(()=>{var f,g;return String((g=(f=t.node.content)!=null?f:t.node.raw)!=null?g:"")});return(f,g)=>s.value&&a.value?(J(),je(Zn(s.value),gt({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":l.value.isDark,"data-markstream-reference-id":e.node.type==="reference"?String(e.node.id):void 0}),{default:Bi(()=>[c.value?(J(),je(He(ju),gt({key:0},l.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):p.value?(J(),je(He(ju),gt({key:1},l.value,{content:p.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):Gt("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark","data-markstream-reference-id"])):s.value?(J(),je(Zn(s.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey,"data-markstream-reference-id":e.node.type==="reference"?String(e.node.id):void 0},null,8,["node","custom-id","index-key","data-markstream-reference-id"])):e.fallbackToText?(J(),he("span",wD,kt(d.value),1)):Gt("",!0)}}),_D=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],SD={key:0,translate:"no",class:"markstream-pre__diff-code"},ID={class:"markstream-pre__diff-pane-content"},ED={key:0,class:"markstream-pre__diff-collapsed-icon","aria-hidden":"true"},MD={class:"markstream-pre__diff-number","aria-hidden":"true"},TD={class:"markstream-pre__diff-content"},BD={class:"markstream-pre__diff-content-inner"},FD={key:0,translate:"no",class:"markstream-pre__code markstream-pre__code--wrapped"},DD=["data-line-number","textContent"],RD={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},ND=["textContent"],LD=["textContent"],Mi=Ve({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e,n=Al(),r=Iy();function i(Q,te){const re=String(Q??"");return te?re:re.replace(/\r\n$|\n$|\r$/,"")}const o=L(()=>{var Q,te,re;const pe=String((te=(Q=t.node)==null?void 0:Q.language)!=null?te:"");return String((re=String(pe).split(/\s+/g)[0])!=null?re:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),l=L(()=>`language-${o.value}`),s=L(()=>{var Q;return t.loading===!0||((Q=t.node)==null?void 0:Q.loading)===!0}),a=L(()=>{var Q;return i((Q=t.node)==null?void 0:Q.code,s.value)});let u="",c=1;const p=L(()=>(function(Q){let te=0,re=1;Q.startsWith(u)&&(te=u.length,re=c,te>0&&Q[te-1]==="\r"&&Q[te]===`
209
+ `&&te++);for(let pe=te;pe<Q.length;pe++)Q[pe]===`
210
+ `?re++:Q[pe]==="\r"&&(re++,Q[pe+1]===`
211
+ `&&pe++);return u=Q,c=re,re})(a.value));let d="",f=[],g=0,m=0;const A=new RegExp("(?<=\\n)|(?<=\\r)(?!\\n)"),v=L(()=>(function(Q){const te=Q.length>d.length&&Q.startsWith(d),re=te?f:[],pe=te?m:0;te&&(re.length=g);for(const Ce of Q.slice(pe).split(A))re.push(Ce);const ce=Q[Q.length-1];return ce===`
212
+ `?(g=re.length,m=Q.length,re.push("")):(g=re.length-1,m=Q.length-re[re.length-1].length,ce==="\r"&&re.push("")),d=Q,f=re,re})(a.value)),k=L(()=>{var Q;return t.showLineNumbers===!0&&((Q=t.node)==null?void 0:Q.diff)===!0}),C=L(()=>{var Q;if(cn(n.class).split(/\s+/).includes("is-wrap"))return!0;const te=Yr(n.style);return typeof te=="string"?/(?:^|;)\s*white-space\s*:\s*(?:pre-wrap|break-spaces)(?:\s*!important)?\s*(?:;|$)/i.test(te):["pre-wrap","break-spaces"].includes(String((Q=te==null?void 0:te.whiteSpace)!=null?Q:te==null?void 0:te["white-space"]))}),b=L(()=>k.value&&C.value);let S=0,T="";const M=L(()=>{const Q=p.value;Q<S&&(S=0,T="");for(let te=S+1;te<=Q;te++)T+=`${T?`
213
+ `:""}${te}`;return S=Q,T}),E=L(()=>k.value&&t.diffInline===!0),$=L(()=>{const Q=Number(t.reservedHeightPx);if(!Number.isFinite(Q)||Q<=0)return;const te=`${Math.ceil(Q)}px`;return s.value?{maxHeight:te,overflow:"auto"}:{height:te,minHeight:te,maxHeight:te,overflow:"auto"}});function X(Q,te){const re=i(Q,te);if(!re)return 0;let pe=1;for(let ce=0;ce<re.length;ce++)re[ce]===`
214
+ `?pe++:re[ce]==="\r"&&(pe++,re[ce+1]===`
215
+ `&&ce++);return pe}const K=L(()=>{var Q,te,re,pe,ce;return k.value?Ry({code:(Q=t.node)==null?void 0:Q.code,hideUnchangedRegions:t.diffHideUnchangedRegions,inline:E.value,language:(te=t.node)==null?void 0:te.language,loading:s.value,matchCache:r,originalCode:(re=t.node)==null?void 0:re.originalCode,raw:(pe=t.node)==null?void 0:pe.raw,updatedCode:(ce=t.node)==null?void 0:ce.updatedCode}):[]}),I=L(()=>{const Q=K.value;let te=1,re=!1;for(const pe of Q)for(const ce of pe.lines)ce.kind==="collapsed"&&(re=!0),typeof ce.number=="number"&&ce.number>te&&(te=ce.number);return{maxNumberedLine:te,hasCollapsed:re}}),B=L(()=>{var Q,te;if(t.showLineNumbers!==!0)return;let re=k.value?1:p.value;k.value&&(re=Math.max(re,X((Q=t.node)==null?void 0:Q.originalCode,s.value),X((te=t.node)==null?void 0:te.updatedCode,s.value),I.value.maxNumberedLine));const pe=`${Math.max(2,String(re).length)}ch`;return{"--markstream-pre-line-number-width":pe,"--markstream-pre-diff-line-number-width":pe,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),P=L(()=>k.value&&I.value.hasCollapsed),_=L(()=>{const Q=o.value;return Q?`Code block: ${Q}`:"Code block"}),W=be(null),z=be([]);let N=null,R=null,oe=!1,ne=null;function ee(){if(oe||typeof window>"u"||!k.value||E.value||!b.value||N!=null)return;const Q=R??(R=wn(()=>import("./preCodeDiffMetrics-6xZ6qvnP.js"),[]));N=window.requestAnimationFrame(()=>{Q.then(({measurePreCodeDiffLines:te})=>{!oe&&W.value&&(z.value=te(W.value,z.value))},()=>{R=null}).finally(()=>{N=null})})}function ie(Q){ne==null||ne.disconnect(),ne=null,Q&&k.value&&!E.value&&b.value&&typeof ResizeObserver<"u"&&(ne=new ResizeObserver(()=>{ee()}),ne.observe(Q))}function G(Q,te){if(!b.value)return;const re=z.value[Q];if(!re)return;const pe=te==="original"?re.originalHeight:re.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(re.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(pe)}px`}}return Ie(W,Q=>{ie(Q),ee()},{flush:"post"}),Ie([k,E,K,b],()=>{ie(W.value),k.value&&!E.value&&b.value?ee():z.value.length&&(z.value=[])},{flush:"post",immediate:!0}),mo(()=>{oe=!0,N!=null&&(window.cancelAnimationFrame(N),N=null),ne==null||ne.disconnect(),ne=null}),(Q,te)=>{return J(),he("pre",{ref_key:"preRef",ref:W,style:Yr([$.value,B.value]),class:cn([l.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":k.value,"markstream-pre--diff-inline":E.value,"markstream-pre--diff-collapsed":P.value}]),"aria-busy":s.value,"aria-label":_.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[k.value?(J(),he("code",SD,[(J(!0),he(Je,null,_t(K.value,pe=>(J(),he("span",{key:pe.key,class:cn(["markstream-pre__diff-pane",pe.className])},[Re("span",ID,[(J(!0),he(Je,null,_t(pe.lines,(ce,Ce)=>(J(),he("span",{key:ce.key,class:cn(["markstream-pre__diff-line",[`markstream-pre__diff-line--${ce.kind}`,ce.metadataKind?`markstream-pre__diff-line--metadata-${ce.metadataKind}`:"",{"markstream-pre__diff-line--empty":ce.empty,"markstream-pre__diff-line--collapsed-first":ce.collapsedFirst===!0,"markstream-pre__diff-line--collapsed-last":ce.collapsedLast===!0}]]),style:Yr(G(Ce,pe.key))},[te[1]||(te[1]=Re("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),ce.kind==="collapsed"?(J(),he("span",ED,[...te[0]||(te[0]=[Re("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true"},[Re("path",{d:"M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"})],-1)])])):Gt("",!0),Re("span",MD,kt(ce.number),1),Re("span",TD,[Re("span",BD,kt(ce.code),1)])],6))),128))])],2))),128))])):(J(),he(Je,{key:1},[t.showLineNumbers===!0&&((re=t.node)==null?void 0:re.diff)!==!0&&C.value?(J(),he("code",FD,[(J(!0),he(Je,null,_t(v.value,(pe,ce)=>(J(),he("span",{key:ce,class:"markstream-pre__logical-line","data-line-number":ce+1,textContent:kt(pe)},null,8,DD))),128))])):(J(),he(Je,{key:1},[t.showLineNumbers?(J(),he("span",RD,[Re("span",{class:"markstream-pre__line-numbers-text",textContent:kt(M.value)},null,8,ND)])):Gt("",!0),Re("code",{translate:"no",class:"markstream-pre__code",textContent:kt(a.value)},null,8,LD)],64))],64))],14,_D);var re}}});Mi.install=e=>{e.component(Mi.__name,Mi)};const OD=["onAnimationend"],Zt=mt(Ve({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Al(),r=Bt("markstreamFade",void 0),i=Bt("markstreamTextStreamState",void 0),o=L(()=>{const K=n.fade;return K===""||K===!0||K==="true"||K!==!1&&K!=="false"&&void 0}),l=L(()=>typeof o.value=="boolean"?o.value:typeof(r==null?void 0:r.value)!="boolean"||r.value),s=L(()=>{var K;const I=(K=n["index-key"])!=null?K:n.indexKey;return I==null||I===""?"":String(I)}),{settledContent:a,segments:u,update:c,finish:p,settleFinished:d}=zy(t.node.content),f=be(null),g=be(null),m=be([]);let A,v="",k=null,C=null,b=!1;function S(){var K;if(!m.value.length)return!1;const I=(K=document.getSelection)==null?void 0:K.call(document);if(!I||I.isCollapsed)return!1;for(let B=0;B<I.rangeCount;B++){const P=I.getRangeAt(B);if(m.value.some(_=>P.intersectsNode(_)))return!0}return!1}function T(K){const I=s.value;c(K,I?i==null?void 0:i.get(I):void 0,l.value),I&&(i==null||i.set(I,K))}Ie([a,f,g],function(){var K,I;const B=f.value;if(!B)return;const P=String((K=a.value)!=null?K:""),_=g.value;return k||(k=B.firstChild,v=(I=k==null?void 0:k.data)!=null?I:""),P.startsWith(v)?!k&&P?(B.textContent=P,k=B.firstChild,void(v=P)):void(P.length>v.length&&_&&(_.appendChild(document.createTextNode(P.slice(v.length))),v=P,(function(W){var z,N;if(W.childNodes.length<=4||(function(oe){var ne;const ee=(ne=document.getSelection)==null?void 0:ne.call(document);if(!ee||ee.rangeCount===0)return!1;const{anchorNode:ie,focusNode:G}=ee;return ie!=null&&oe.contains(ie)||G!=null&&oe.contains(G)})(W))return;let R="";for(let oe=0;oe<W.childNodes.length;oe++)R+=(N=(z=W.childNodes[oe])==null?void 0:z.textContent)!=null?N:"";W.textContent=R})(_))):(B.textContent=P,k=B.firstChild,_&&(_.textContent=""),void(v=P))},{immediate:!0}),Ie([()=>t.node.content,s,l],([K])=>{const I=String(K??"");if(S())return C=I,void $();C=null,b=!1,T(I)},{immediate:!0});const M=be(a.value);function E(){if(!S())if(X(),C!=null){const K=C;C=null,b=!1,T(K),d()}else b&&(b=!1,d())}function $(){A||(A=document,A.addEventListener("selectionchange",E))}function X(){A==null||A.removeEventListener("selectionchange",E),A=void 0}return ch(X),(K,I)=>(J(),he("span",{class:cn([[e.node.center?"text-node-center":""],"text-node"])},[hd(Re("span",{ref_key:"settledTextEl",ref:f},kt(M.value),513),[[pd,He(a)!==""]]),hd(Re("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[pd,He(a)!==""]]),(J(!0),he(Je,null,_t(He(u),B=>(J(),he("span",{key:B.id,ref_for:!0,ref_key:"streamedDeltaEls",ref:m,class:"text-node-stream-delta",onAnimationend:P=>(function(_){const W=S();p(_,W),W&&(b=!0,$())})(B.id)},kt(B.content),41,OD))),128))],2))}}),[["__scopeId","data-v-3be01052"]]);function PD(e){var t;if(typeof e=="boolean")return e;const n=e;if((n==null?void 0:n.expandUnchanged)===!0)return!1;const r=Number((t=n==null?void 0:n.parseDiffOptions)==null?void 0:t.context),i=Number(n==null?void 0:n.collapsedContextThreshold);return{enabled:!0,contextLineCount:isFinite(r)&&r>=0?Math.floor(r):2,minimumLineCount:isFinite(i)&&i>=0?Math.floor(i)+1:6,revealLineCount:5}}function eh(e){return e.diffStyle==="unified"}function Vy(e){var t,n;const r=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(r.length<3)return"";const i=r[0];if(i!=="`"&&i!=="~"||r[1]!==i||r[2]!==i)return"";let o=3;for(;r[o]===i;)o+=1;return r.slice(o).trim()}function O0(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function $D(e){var t;return e.diff===!0||O0(e.language)||O0(Vy(String((t=e.raw)!=null?t:"")))}function HD(e,t,n){const r=(function(i){const o=Vy(i);if(!o)return"";const l=o.split(/\s+/).filter(Boolean);if(!l.length)return"";const s=l[0]==="diff"?l.slice(1):l;for(const a of s){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:r||t,caption:r?n?`Diff / ${t}`:t:""}}function P0(e){const t=String(e??"").replace(/\r\n$|\n$|\r$/,"");return t?t.split(/\r\n|\n|\r/):[]}Zt.install=e=>{e.component(Zt.__name,Zt)};let $0="",H0="",id=null;function ER(e,t){var n;if(id&&$0===e&&H0===t)return id;const r=P0(e),i=P0(t);let o=0,l=r.length-1,s=i.length-1;for(;o<=l&&o<=s&&r[o]===i[o];)o++;for(;l>=o&&s>=o&&r[l]===i[s];)l--,s--;const a=Math.max(0,l-o+1),u=Math.max(0,s-o+1);let c;if(a===0||u===0)c={removed:a,added:u};else if((a+1)*(u+1)<=15e5){const p=new Map,d=new Uint32Array(u);for(let k=0;k<u;k++){const C=i[o+k];let b=p.get(C);b===void 0&&(b=p.size+1,p.set(C,b)),d[k]=b}const f=new Uint32Array(a);for(let k=0;k<a;k++)f[k]=(n=p.get(r[o+k]))!=null?n:0;const g=u+1;let m=new Uint32Array(g),A=new Uint32Array(g);for(let k=a-1;k>=0;k--){A[u]=0;for(let b=u-1;b>=0;b--)A[b]=f[k]===d[b]?m[b+1]+1:Math.max(m[b],A[b+1]);const C=m;m=A,A=C}const v=m[0];c={removed:a-v,added:u-v}}else c={removed:a,added:u};return $0=e,H0=t,id=c,c}function WD(e){var t,n,r,i,o;const l=e.isDark?"dark":"light";return e.theme!==void 0?typeof e.theme=="string"?e.theme:e.theme[l]:(o=e.isDark?(n=e.darkTheme)!=null?n:(t=e.themes)==null?void 0:t[0]:(i=e.lightTheme)!=null?i:(r=e.themes)==null?void 0:r[1])!=null?o:`vitesse-${l}`}function KD(e,t=!1){const n=e.toLowerCase();return n?/dark|night|moon|black|dracula|mocha|frappe|macchiato|ocean|poimandres|monokai|laserwave|tokyo|rose-pine|material-theme/.test(n)&&!/light|latte|dawn|lotus/.test(n):t}function jD(e){const t=WD(e),n=t==="vitesse-dark"||t!=="vitesse-light"&&KD(t,e.isDark===!0);if(t!=="vitesse-dark"&&t!=="vitesse-light"){const r=n?"var(--markstream-code-theme-bg, #121212)":"var(--markstream-code-theme-bg, #ffffff)";return{builtin:!1,dark:n,name:t,background:r,diffAddedLine:`color-mix(in lab, ${r} ${n?"80%":"88%"}, ${n?"#4d9375":"#1e754f"})`,diffAddedNumber:`color-mix(in lab, ${r} ${n?"85%":"91%"}, ${n?"#4d9375":"#1e754f"})`,diffRemovedLine:`color-mix(in lab, ${r} ${n?"80%":"88%"}, ${n?"#cb7676":"#ab5959"})`,diffRemovedNumber:`color-mix(in lab, ${r} ${n?"85%":"91%"}, ${n?"#cb7676":"#ab5959"})`,foreground:n?"var(--markstream-code-theme-fg, #dbd7caee)":"var(--markstream-code-theme-fg, #393a34)",lineNumber:n?"var(--markstream-code-theme-line-number, #dedcd550)":"var(--markstream-code-theme-line-number, #393a3450)"}}return n?{builtin:!0,dark:!0,name:t,background:"#121212",diffAddedLine:"color-mix(in lab, #121212 80%, #4d9375)",diffAddedNumber:"color-mix(in lab, #121212 85%, #4d9375)",diffRemovedLine:"color-mix(in lab, #121212 80%, #cb7676)",diffRemovedNumber:"color-mix(in lab, #121212 85%, #cb7676)",foreground:"#dbd7caee",lineNumber:"#dedcd550"}:{builtin:!0,dark:!1,name:t,background:"#ffffff",diffAddedLine:"color-mix(in lab, #ffffff 88%, #1e754f)",diffAddedNumber:"color-mix(in lab, #ffffff 91%, #1e754f)",diffRemovedLine:"color-mix(in lab, #ffffff 88%, #ab5959)",diffRemovedNumber:"color-mix(in lab, #ffffff 91%, #ab5959)",foreground:"#393a34",lineNumber:"#393a3450"}}const MR=12,TR=18;function Za(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0}function th(e){var t,n,r,i,o,l;const s=(t=Za(e==null?void 0:e.fontSize))!=null?t:12,a=(n=Za(e==null?void 0:e.lineHeight))!=null?n:s===12?18:Math.max(12,Math.round(1.5*s)),u=typeof(e==null?void 0:e.fontFamily)=="string"&&e.fontFamily.trim()?e.fontFamily.trim():'"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace',c=(r=typeof(p=e==null?void 0:e.padding)=="number"&&Number.isFinite(p)&&p>=0?p:void 0)!=null?r:8;var p;return{fontFamily:u,fontSize:s,lineHeight:a,maxHeight:(i=Za(e==null?void 0:e.maxHeight))!=null?i:500,overflow:(o=e==null?void 0:e.overflow)!=null?o:"wrap",padding:c,paddingBottom:c,scrollbarGutter:6,tabSize:(l=Za(e==null?void 0:e.tabSize))!=null?l:4}}function hu(e,t,n){return Ve({name:e,inheritAttrs:!1,setup(r,{attrs:i,slots:o}){var l,s;const a=gp(),u=hp(),c=pp(),p=typeof window<"u"&&((s=(l=Bs())==null?void 0:l.vnode.el)==null?void 0:s.nodeType)===1,d=be(typeof window>"u"||p||!c.value),f=Oi(null);let g=null;function m(A){const v=A&&"$el"in A?A.$el:A;f.value=v instanceof HTMLElement?v:null}return typeof window<"u"&&Ie([f,c],([A,v],k,C)=>{if(g==null||g.destroy(),g=null,!v||d.value)return void(d.value=!0);if(!A)return;let b=!0;const S=a(A,{rootMargin:u==null?void 0:u.value.heavyBlockMargin,allowIdle:!1});g=S,d.value=S.isVisible.value,S.whenVisible.then(()=>{b&&g===S&&(d.value=!0)}),C(()=>{b=!1,S.destroy(),g===S&&(g=null)})},{immediate:!0}),mo(()=>{g==null||g.destroy(),g=null}),()=>Te(d.value?t:n,lt(Ae({},i),{ref:m}),o)}})}const nh=Ve({name:"CodeBlockNodeLoadingShell",inheritAttrs:!1,props:["node","isDark","loading","stream","codeBlockOptions","showLineNumbers","theme","darkTheme","lightTheme","isShowPreview","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","enableFontSizeControl","minWidth","maxWidth","themes","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","indexKey","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline","diffInline","diffHideUnchangedRegions","reservedHeightPx"],emits:["click","mouseover","mouseout","copy","previewCode","handleArtifactClick"],setup(e,{attrs:t}){const n=e,r=Iy();return()=>{var i,o,l,s,a,u,c,p,d,f,g,m;const A=(i=n.codeBlockOptions)!=null?i:{},v=th(A),k=jD({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes}),C=ea(String((l=(o=n.node)==null?void 0:o.language)!=null?l:"")),b=$D(n.node),S=HD(String((a=(s=n.node)==null?void 0:s.raw)!=null?a:""),Hd[C]||(C==="typescript"?"TypeScript":C?C.charAt(0).toUpperCase()+C.slice(1):Hd[""]),b),T=b?Ry({originalCode:(u=n.node)==null?void 0:u.originalCode,updatedCode:(c=n.node)==null?void 0:c.updatedCode,loading:!0,matchCache:r}).flatMap(P=>P.lines):[],M=b?{removed:T.filter(P=>P.kind==="removed").length,added:T.filter(P=>P.kind==="added").length}:null,E=Number((p=n.estimatedContentHeightPx)!=null?p:n.reservedHeightPx),$=!b&&Number.isFinite(E)&&E>0?Math.min(v.maxHeight,Math.ceil(E)):void 0,X=P=>Te("button",{class:`code-action-btn code-loading-action code-loading-action--${P} 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"}),K=n.showExpandButton!==!1||n.showPreviewButton!==!1&&n.isShowPreview!==!1&&(C==="html"||C==="svg")||n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1,I=P=>P==null?void 0:typeof P=="number"?`${P}px`:String(P),B={"--code-bg":k.background,"--code-fg":k.foreground,"--code-line-number":k.lineNumber,"--markstream-code-fallback-bg":k.background,"--markstream-code-fallback-fg":k.foreground,"--markstream-diff-added-line-fill":k.diffAddedLine,"--markstream-diff-added-number-fill":k.diffAddedNumber,"--markstream-diff-editor-bg":k.background,"--markstream-diff-metadata-bg":k.background,"--markstream-diff-metadata-fg":k.lineNumber,"--markstream-diff-removed-line-fill":k.diffRemovedLine,"--markstream-diff-removed-number-fill":k.diffRemovedNumber,"--markstream-diff-shell-bg":k.background,"--markstream-pre-resolved-theme-bg":k.background,"--markstream-pre-resolved-theme-fg":k.foreground,"--markstream-pre-resolved-theme-line-number":k.lineNumber};return Te("div",lt(Ae({},t),{class:["code-block-container rounded-lg border",{dark:n.isDark===!0,"is-dark":k.dark,"is-rendering":n.loading!==!1,"is-diff":b},t.class],style:[Ae(lt(Ae({},B),{backgroundColor:k.background,color:k.foreground,minWidth:I(n.minWidth),maxWidth:I(n.maxWidth)}),b?{}:{borderColor:"var(--markstream-code-border-color, var(--code-border))"}),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:Te("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)]"},[Te("div",{class:"code-header-main"},[Te("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",innerHTML:vy(C)}),Te("div",{class:"code-header-copy"},[Te("div",{class:"code-header-title"},S.title),S.caption?Te("div",{class:"code-header-caption"},S.caption):null])]),Te("div",{class:"flex items-center gap-0.5"},[M?Te("div",{class:"code-diff-stats","aria-label":`-${M.removed} +${M.added}`},[Te("span",{class:"code-diff-stat removed"},`-${M.removed}`),Te("span",{class:"code-diff-stat added"},`+${M.added}`)]):null,n.showCopyButton===!1?null:X("copy"),n.showCollapseButton===!1?null:X("collapse"),K?Te("div",{class:"relative"},[X("more")]):null])]),Te("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Te(Mi,{node:n.node,loading:n.loading,showLineNumbers:(d=n.showLineNumbers)!=null?d:A.disableLineNumbers!==!0,diffInline:b&&!!((g=(f=n.diffInline)!=null?f:n.estimatedDiffInline)!=null?g:A.diffStyle==="unified"),diffHideUnchangedRegions:b?(m=n.diffHideUnchangedRegions)!=null?m:PD(A):void 0,reservedHeightPx:$,class:["code-pre-fallback",{"is-wrap":v.overflow==="wrap"}],style:lt(Ae({},B),{"--markstream-code-padding-x":`${v.padding}px`,"--markstream-code-padding-y":`${v.padding}px`,"--markstream-code-tab-size":v.tabSize,"--markstream-pre-diff-line-height":`${v.lineHeight}px`,backgroundColor:k.background,color:k.foreground,fontFamily:v.fontFamily,fontSize:`${v.fontSize}px`,lineHeight:`${v.lineHeight}px`,maxHeight:`${$??v.maxHeight}px`,overflow:"auto",paddingTop:`${v.padding}px`,paddingBottom:`${v.paddingBottom}px`,tabSize:v.tabSize,whiteSpace:v.overflow==="wrap"?"pre-wrap":"pre",overflowWrap:v.overflow==="wrap"?"anywhere":"normal"}),"data-markstream-code-loading":"1"})]),Te("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Te("div",{class:"loading-skeleton"},[Te("div",{class:"skeleton-line"}),Te("div",{class:"skeleton-line"}),Te("div",{class:"skeleton-line short"})])])])}}}),ts=Zr({loader:()=>wn(()=>import("./PreCodeBlock-D6Vrdwmh.js").then(e=>e.P),__vite__mapDeps([7,4])),loadingComponent:nh,delay:0,suspensible:!0}),od=hu("ViewportDeferredCodeBlockNode",Zr({loader:()=>$t(null,null,function*(){try{return(yield wn(()=>import("./CodeBlockNode-dNQRJI7x.js"),__vite__mapDeps([8,4,7,3,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer.',e),Mi}}),loadingComponent:nh,delay:0,suspensible:!1}),nh),_r=Zr(()=>$t(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t==null?void 0:t.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,r,i,o;return Te(Zt,lt(Ae({},t),{node:{type:"text",content:(r=t.node.raw)!=null?r:`$${(n=t.node.content)!=null?n:""}$`,raw:(o=t.node.raw)!=null?o:`$${(i=t.node.content)!=null?i:""}$`}}))};try{return yield Cy(),(yield wn(()=>import("./index6-sINF5Zn7.js"),__vite__mapDeps([9,4,3,5]))).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,r,i,o;return Te(Zt,lt(Ae({},t),{node:{type:"text",content:(r=t.node.raw)!=null?r:`$${(n=t.node.content)!=null?n:""}$`,raw:(o=t.node.raw)!=null?o:`$${(i=t.node.content)!=null?i:""}$`}}))}})),Jy=Zr(()=>$t(null,null,function*(){try{return yield Cy(),(yield wn(()=>import("./index5-0ddz3aZZ.js"),__vite__mapDeps([10,4,3,5]))).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,r,i;return Te(Zt,lt(Ae({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(i=e.node.raw)!=null?i:`$$${(r=e.node.content)!=null?r:""}$$`}}))}})),zD=["data-reference-id","data-markstream-reference-id"],_n=mt(Ve({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(J(),he("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0","data-reference-id":e.node.id,"data-markstream-reference-id":e.node.id,onClick:n[0]||(n[0]=r=>t.$emit("click",r,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=r=>t.$emit("mouseEnter",r,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=r=>t.$emit("mouseLeave",r,e.node.id,e.messageId,e.threadId))},kt(e.node.id),41,zD))}),[["__scopeId","data-v-b96c91c3"]]);_n.install=e=>{e.component(_n.__name,_n)};const GD={class:"superscript-node"},Nn=mt(Ve({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,strong:Sn,emphasis:Mn,footnote_reference:Jn,strikethrough:In,highlight:qn,insert:On,subscript:Ln,emoji:Rn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("sup",GD,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"superscript"}-${s}`,components:r.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${s}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const QD={class:"subscript-node"},Ln=mt(Ve({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,strong:Sn,emphasis:Mn,footnote_reference:Jn,strikethrough:In,highlight:qn,insert:On,superscript:Nn,emoji:Rn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("sub",QD,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"subscript"}-${s}`,components:r.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${s}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ln.install=e=>{e.component(Ln.__name,Ln)};const UD={class:"strong-node"},Sn=mt(Ve({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,emphasis:Mn,strikethrough:In,highlight:qn,insert:On,subscript:Ln,superscript:Nn,emoji:Rn,footnote_reference:Jn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("strong",UD,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"strong"}-${s}`,components:r.value,node:l,"index-key":`${e.indexKey||"strong"}-${s}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Sn.install=e=>{e.component(Sn.__name,Sn)};const YD={class:"strikethrough-node"},In=mt(Ve({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,strong:Sn,emphasis:Mn,highlight:qn,insert:On,subscript:Ln,superscript:Nn,emoji:Rn,footnote_reference:Jn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("del",YD,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"strikethrough"}-${s}`,components:r.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${s}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);In.install=e=>{e.component(In.__name,In)};const ZD=["href","title","aria-label","aria-hidden","target","rel"],VD=["aria-hidden"],JD={class:"link-text-wrapper relative inline-flex"},XD={class:"leading-[normal] link-text"},En=mt(Ve({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Bt("markstreamShowTooltips",void 0),r=L(()=>{const v=n==null?void 0:n.value;return typeof v=="boolean"?v:t.showTooltip}),i=L(()=>{var v,k,C,b,S;const T=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",M=(v=t.animationOpacity)!=null?v:.35,E=Math.max(.12,Math.min(.5*M,M)),$={"--underline-height":`${(k=t.underlineHeight)!=null?k:2}px`,"--underline-bottom":T,"--underline-opacity":String(M),"--underline-rest-opacity":String(E),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(S=t.animationIteration)!=null?S:"infinite"};return t.color&&($["--link-color"]=t.color),$}),o=sn(()=>t.customId),l=L(()=>Ae({text:Zt,strong:Sn,strikethrough:In,emphasis:Mn,image:Vr,html_inline:Xn,inline_code:An},o.value)),s=Al(),a=L(()=>{var v,k;const C=(v=t.node)==null?void 0:v.attrs;if(!C||typeof C!="object")return{};const b={};if(Array.isArray(C))for(const S of C)Array.isArray(S)&&S[0]&&(b[String(S[0])]=String((k=S[1])!=null?k:""));else for(const[S,T]of Object.entries(C))S&&T!=null&&T!==!1&&(b[S]=T===!0?"":String(T));return T0(b,"safe","a")}),u=L(()=>Ae(Ae({},s),a.value)),c=L(()=>{var v,k;return T0({href:String((k=(v=t.node)==null?void 0:v.href)!=null?k:"")},"safe","a").href}),p=L(()=>{if(!c.value)return;const v=u.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(Hv(c.value)?"_blank":void 0)}),d=L(()=>{var v;return String((v=p.value)!=null?v:"").trim().toLowerCase()==="_blank"}),f=L(()=>{if(!c.value)return;const v=u.value.rel,k=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(k).filter(b=>b.toLowerCase()!=="opener"));return d.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),g=L(()=>{const v=Ae({},u.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function m(){r.value&&dD()}const A=L(()=>{var v,k;const C=(v=t.node)==null?void 0:v.title;return typeof C=="string"&&C.trim().length>0?C:String((k=c.value)!=null?k:"")});return(v,k)=>{var C,b;return e.node.loading?(J(),he("span",gt({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},He(s),{style:i.value}),[Re("span",JD,[Re("span",XD,[xr(He(Zt),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),k[1]||(k[1]=Re("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,VD)):(J(),he("a",gt({key:0,class:"link-node",href:c.value,title:r.value?"":A.value,"aria-label":`Link: ${A.value}`,"aria-hidden":e.node.loading?"true":"false",target:p.value,rel:f.value},g.value,{style:i.value,onMouseenter:k[0]||(k[0]=S=>(function(T){var M,E,$,X;if(!r.value)return;const K=T,I=(K==null?void 0:K.clientX)!=null&&(K==null?void 0:K.clientY)!=null?{x:K.clientX,y:K.clientY}:void 0,B=((M=t.node)==null?void 0:M.title)||((E=c.value)!=null&&E.includes("xn--")&&((X=($=t.node)==null?void 0:$.text)!=null&&X.includes("://"))?t.node.text:c.value)||"";fD(T.currentTarget,B,"top",!1,I)})(S)),onMouseleave:m}),[(J(!0),he(Je,null,_t(e.node.children,(S,T)=>(J(),je(He(Nr),{key:`${e.indexKey||"emphasis"}-${T}`,components:l.value,node:S,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${T}`},null,8,["components","node","custom-id","index-key"]))),128))],16,ZD))}}}),[["__scopeId","data-v-a414d325"]]);En.install=e=>{e.component(En.__name,En)};const qD={class:"insert-node"},On=mt(Ve({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,strong:Sn,emphasis:Mn,strikethrough:In,highlight:qn,subscript:Ln,superscript:Nn,emoji:Rn,footnote_reference:Jn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("ins",qD,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"insert"}-${s}`,components:r.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${s}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);On.install=e=>{e.component(On.__name,On)};const e4={class:"highlight-node"},qn=mt(Ve({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,strong:Sn,emphasis:Mn,strikethrough:In,insert:On,subscript:Ln,superscript:Nn,emoji:Rn,footnote_reference:Jn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("mark",e4,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"highlight"}-${s}`,components:r.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${s}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);qn.install=e=>{e.component(qn.__name,qn)};const t4={class:"emphasis-node"},Mn=mt(Ve({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>Ae({text:Zt,inline_code:An,link:En,html_inline:Xn,strong:Sn,strikethrough:In,highlight:qn,insert:On,subscript:Ln,superscript:Nn,emoji:Rn,footnote_reference:Jn,math_inline:_r,reference:_n},n.value));return(i,o)=>(J(),he("em",t4,[(J(!0),he(Je,null,_t(e.node.children,(l,s)=>(J(),je(He(Nr),{key:`${e.indexKey||"emphasis"}-${s}`,components:r.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${s}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Mn.install=e=>{e.component(Mn.__name,Mn)};const n4={class:"hard-break"},Jr=mt(Ve({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(J(),he("br",n4))}),[["__scopeId","data-v-50c58f70"]]);Jr.install=e=>{e.component(Jr.__name,Jr)};const Qs=Ve({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=fo({checkbox:Vn,checkbox_input:Vn,emoji:Rn,emphasis:Mn,hardbreak:Jr,highlight:qn,inline_code:An,insert:On,link:En,reference:_n,strikethrough:In,strong:Sn,subscript:Ln,superscript:Nn,text:Zt}),r=sn(()=>t.customId),i=L(()=>{const o=r.value;return Object.keys(o).length>0?Ae(Ae({},n),o):n});return(o,l)=>(J(!0),he(Je,null,_t(e.nodes,(s,a)=>(J(),je(He(Nr),{key:a,components:i.value,node:s,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function rh(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(rh)}function zu(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(rh))return e;if(!t||e.length!==1)return null;const r=e[0];if((r==null?void 0:r.type)!=="paragraph"||!Array.isArray(r.children))return null;const i=r.children;return(n||i.length>0)&&i.every(rh)?i:null}function vo(e){var t,n;if(!(e!=null&&e.length))return null;let r="";for(const i of e){if((i==null?void 0:i.type)!=="text"||i.center===!0)return null;r+=String((n=(t=i.content)!=null?t:i.raw)!=null?n:"")}return r}const r4=["cite"],i4={key:0,dir:"auto",class:"paragraph-node"},o4=["custom-id"],_s=mt(Ve({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=sn(()=>t.customId),r=L(()=>!!n.value.paragraph),i=L(()=>!!n.value.text),o=L(()=>zu(t.node.children,!r.value)),l=L(()=>t.fade!==!1||i.value?null:vo(o.value));return Ut("markstreamShowTooltips",L(()=>t.showTooltips)),Ut("markstreamFade",L(()=>t.fade)),(s,a)=>(J(),he("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[o.value?(J(),he("p",i4,[l.value!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(l.value),9,o4)):(J(),je(He(Qs),{key:1,nodes:o.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(J(),je(He(Pn),{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]=u=>s.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,r4))}}),[["__scopeId","data-v-abfecebc"]]);_s.install=e=>{e.component(_s.__name,_s)};const l4={class:"definition-list"},s4={class:"definition-term"},a4={class:"definition-desc"},Ss=mt(Ve({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,r)=>(J(),he("dl",l4,[(J(!0),he(Je,null,_t(t.node.items,(i,o)=>(J(),he(Je,{key:o},[Re("dt",s4,[xr(He(Pn),{"index-key":`definition-term-${t.indexKey}-${o}`,nodes:i.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[0]||(r[0]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),Re("dd",a4,[xr(He(Pn),{"index-key":`definition-desc-${t.indexKey}-${o}`,nodes:i.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[1]||(r[1]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Ss.install=e=>{e.component(Ss.__name,Ss)};const u4=["href","title"],cl=mt(Ve({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(r){var i;if(r.preventDefault(),typeof document>"u")return;const o=$y(r.currentTarget,`fnref-${String((i=t.node.id)!=null?i:"")}`);o&&o.scrollIntoView({behavior:"smooth",block:"center"})}return(r,i)=>(J(),he("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,u4))}}),[["__scopeId","data-v-0dbaa45e"]]);cl.install=e=>{e.component(cl.__name,cl)};const c4=["id"],f4={class:"flex-1"},fl=Ve({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,r)=>(J(),he("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[Re("div",f4,[xr(He(Pn),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[0]||(r[0]=i=>n.$emit("copy",i))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,c4))}});fl.install=e=>{e.component(fl.__name,fl)};const d4=["custom-id"],ih=mt(Ve({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=sn(()=>t.customId),r=Bt("markstreamFade",void 0),i=L(()=>(r==null?void 0:r.value)!==!1||n.value.text?null:vo(t.node.children)),o=L(()=>Ae({text:Zt,inline_code:An,link:En,image:Vr,strong:Sn,emphasis:Mn,strikethrough:In,highlight:qn,insert:On,subscript:Ln,superscript:Nn,emoji:Rn,checkbox:Vn,checkbox_input:Vn,footnote_reference:Jn,hardbreak:Jr,math_inline:_r,reference:_n},n.value));return(l,s)=>(J(),je(Zn(`h${e.node.level}`),gt({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Bi(()=>[i.value!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(i.value),9,d4)):(J(!0),he(Je,{key:1},_t(e.node.children,(a,u)=>(J(),je(He(Nr),{key:u,components:o.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),ia=ih;ia.install=e=>{e.component(ih.__name,ih)};const h4={key:0,dir:"auto",class:"paragraph-node"},p4=["custom-id"],g4={dir:"auto",class:"paragraph-node"},m4=["custom-id"],po=mt(Ve({__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=L(()=>{var f;return(f=t.node)!=null?f:t.item}),r=sn(()=>t.customId),i=L(()=>!!r.value.paragraph),o=L(()=>!!r.value.text),l=L(()=>{var f;return zu((f=n.value)==null?void 0:f.children,!i.value)}),s=L(()=>{var f;if(i.value)return null;const g=(f=n.value)==null?void 0:f.children;if(!Array.isArray(g)||g.length<2)return null;const m=g[0];if((m==null?void 0:m.type)!=="paragraph"||!Array.isArray(m.children))return null;const A=g.slice(1);if(!A.every(k=>(k==null?void 0:k.type)==="list"))return null;const v=zu([m]);return v?{paragraphChildren:v,nestedLists:A}:null});function a(){return t.fade===!1&&!o.value}const u=L(()=>a()?vo(l.value):null),c=L(()=>{var f;return a()?vo((f=s.value)==null?void 0:f.paragraphChildren):null}),p=Object.freeze({}),d=L(()=>{const{value:f}=t;return typeof f=="number"&&Number.isFinite(f)?{value:f}:p});return Ut("markstreamShowTooltips",L(()=>t.showTooltips)),Ut("markstreamFade",L(()=>t.fade)),(f,g)=>{var m,A;return J(),he("li",gt({class:"list-item",dir:"auto"},d.value),[l.value?(J(),he("p",h4,[u.value!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(u.value),9,p4)):(J(),je(He(Qs),{key:1,nodes:l.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):s.value?(J(),he(Je,{key:1},[Re("p",g4,[c.value!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(c.value),9,m4)):(J(),je(He(Qs),{key:1,nodes:s.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(J(!0),he(Je,null,_t(s.value.nestedLists,(v,k)=>(J(),je(He(Pn),{key:k,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${k}`,"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:g[0]||(g[0]=C=>f.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(J(),je(He(Pn),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(A=(m=n.value)==null?void 0:m.children)!=null?A:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:g[1]||(g[1]=v=>f.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);po.install=e=>{e.component(po.__name,po)};const go=mt(Ve({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=sn(()=>e.customId),n=L(()=>t.value.list_item||po);return(r,i)=>(J(),je(Zn(e.node.ordered?"ol":"ul"),{class:cn(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Bi(()=>[(J(!0),he(Je,null,_t(e.node.items,(o,l)=>{var s;return J(),je(Zn(n.value),gt({key:`${e.indexKey||"list"}-${l}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((s=e.node.start)!=null?s:1)+l:void 0,onCopy:i[0]||(i[0]=a=>r.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);go.install=e=>{e.component(go.__name,go)};const A4={key:2,class:"html-block-node__raw"},v4=["innerHTML"],k4={key:1,class:"html-block-node__placeholder"},dl=mt(Ve({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){var t;const n=e,r=Bt("markstreamHtmlPolicy",void 0),i=Bt("markstreamNestedRendererProps",void 0),o=L(()=>{var N,R;return(R=(N=n.htmlPolicy)!=null?N:r==null?void 0:r.value)!=null?R:"safe"}),l=L(()=>{var N,R;const oe=(N=i==null?void 0:i.value)!=null?N:{};return lt(Ae({},oe),{customId:(R=n.customId)!=null?R:oe.customId,htmlPolicy:o.value})}),s=Zr({loader:()=>Promise.resolve().then(()=>fC),suspensible:!1}),a=L(()=>{const N=ys(n.node.attrs,o.value);if(!N)return;const R=ul(N);return Object.keys(R).length>0?R:void 0}),u=L(()=>{const N=String(n.node.tag||"").trim(),R=ys(n.node.attrs,o.value,N);if(!R)return;const oe=ul(R);return Object.keys(oe).length>0?oe:void 0}),c=sn(()=>n.customId),p=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=be(null);function f(N,R,oe,ne){if(N!==!0)return!1;const ee=String(R??"");if(!ee)return!1;if(ee!==String(oe??""))return!0;const ie=String(ne??"").trim();return!!ie&&ee.toLowerCase().includes(`</${ie.toLowerCase()}`)===!1}const g=be(f(n.node.loading,n.node.raw,n.node.content,n.node.tag)),m=be(typeof window>"u"||g.value),A=be(n.node.content),v=be(0),k=be(String((t=n.node.raw)!=null?t:"")),C=L(()=>Array.isArray(n.node.children)?n.node.children:[]);Ie(()=>[n.node.loading,n.node.raw,n.node.content,n.node.tag],([N,R,oe,ne])=>{const ee=String(R??""),ie=!k.value||ee.startsWith(k.value),G=f(N,R,oe,ne);ie?G&&(g.value=!0):(g.value=G,v.value=0),G&&(m.value=!0),k.value=ee},{flush:"sync"});const b=L(()=>String(n.node.tag||"div")),S=L(()=>{var N;if(b.value.trim().toLowerCase()!=="details"||(N=n.node.attrs)!=null&&N.some(([oe])=>String(oe).toLowerCase()==="open"))return null;const R=C.value[0];return(R==null?void 0:R.type)==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),T=L(()=>{var N;return vo((N=S.value)==null?void 0:N.children)}),M=L(()=>{const N=S.value;if(!N)return;const R=ys(N.attrs,o.value,"summary");if(!R)return;const oe=ul(R);return Object.keys(oe).length>0?oe:void 0}),E=L(()=>T.value==null?C.value:C.value.slice(1)),$=L(()=>{const N=b.value.trim().toLowerCase();return Nh.has(N)||lc(N,o.value)}),X=L(()=>C.value.length>0&&!!n.node.tag&&!$.value),K=L(()=>{var N,R,oe;if(X.value)return{mode:"structured"};if(!m.value)return{mode:"html",content:(N=A.value)!=null?N:""};const ne=(R=A.value)!=null?R:n.node.content;if(!ne)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:js(ne,o.value)};const ee=g.value||n.node.loading===!0,ie=jy(ne,c.value,o.value,ee);return ie.ok&&(ee||ie.hasCustomComponents)?{mode:"dynamic",nodes:ie.nodes}:ee?{mode:"text",content:(oe=n.node.raw)!=null?oe:ne}:{mode:"html",content:js(ne,o.value)}}),I=gp(),B=hp(),P=pp(),_=Oi(null),W=!!n.node.loading;let z=null;return typeof window<"u"?(Ie([()=>d.value,()=>n.node.loading,g],([N,R,oe],ne,ee)=>{if(z==null||z.disconnect(),z=null,!N||!oe||R===!1||typeof ResizeObserver>"u")return;const ie=new ResizeObserver(G=>{var Q,te;if(!g.value||n.node.loading===!1)return;const re=G[0],pe=Array.isArray(re==null?void 0:re.borderBoxSize)?re.borderBoxSize[0]:re==null?void 0:re.borderBoxSize,ce=(te=(Q=pe==null?void 0:pe.blockSize)!=null?Q:re==null?void 0:re.contentRect.height)!=null?te:0;ce>v.value&&(v.value=ce)});z=ie,ie.observe(N),ee(()=>ie.disconnect())},{immediate:!0}),Ie(()=>n.node.loading,N=>$t(null,null,function*(){N!==!1||!g.value||v.value<=0||(yield dn(),requestAnimationFrame(()=>{n.node.loading===!1&&(v.value=0)}))})),Ie([()=>d.value,()=>B==null?void 0:B.value.heavyBlockMargin,()=>B==null?void 0:B.value.rootMargin],([N],R,oe)=>{var ne,ee,ie,G;if((ee=(ne=_.value)==null?void 0:ne.destroy)==null||ee.call(ne),_.value=null,!W)return m.value=!0,void(A.value=n.node.content);if(!N)return void(g.value||(m.value=!1));let Q=!0;const te=(G=(ie=B==null?void 0:B.value.heavyBlockMargin)!=null?ie:B==null?void 0:B.value.rootMargin)!=null?G:Ao,re=I(N,{rootMargin:te,allowIdle:!P.value});_.value=re,m.value=m.value||re.isVisible.value,re.whenVisible.then(()=>{Q&&_.value===re&&(m.value=!0)}),oe(()=>{Q=!1,re.destroy(),_.value===re&&(_.value=null)})},{immediate:!0}),Ie(()=>n.node.content,N=>{W&&!m.value||(A.value=N)})):m.value=!0,mo(()=>{var N,R;z==null||z.disconnect(),z=null,(R=(N=_.value)==null?void 0:N.destroy)==null||R.call(N),_.value=null}),(N,R)=>(J(),je(Zn(X.value?b.value:"div"),gt({ref_key:"htmlRef",ref:d,class:"html-block-node",style:v.value>0?{boxSizing:"border-box",minHeight:`${v.value}px`}:void 0,"data-markstream-viewport-pending":He(P)&&!m.value?"true":void 0},X.value?u.value:void 0),{default:Bi(()=>[m.value?(J(),he(Je,{key:0},[K.value.mode==="structured"?(J(),he(Je,{key:0},[T.value!==null?(J(),he(Je,{key:0},[Re("summary",Sb(Ib(M.value)),kt(T.value),17),E.value.length?(J(),je(He(s),gt({key:0},l.value,{nodes:E.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):Gt("",!0)],64)):(J(),je(He(s),gt({key:1},l.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):K.value.mode==="dynamic"?(J(),je(He(p),{key:1,nodes:K.value.nodes},null,8,["nodes"])):K.value.mode==="text"?(J(),he("pre",A4,kt(K.value.content),1)):(J(),he("div",gt({key:3},a.value,{innerHTML:K.value.content}),null,16,v4))],64)):(J(),he("div",k4,[gu(N.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=Re("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=Re("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=Re("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["style","data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-08559f85"]]);dl.install=e=>{e.component(dl.__name,dl)};const y4={dir:"auto",class:"paragraph-node"},C4=["custom-id"],Ti=mt(Ve({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=sn(()=>t.customId),r=Bt("markstreamHtmlPolicy",void 0),i=Bt("markstreamFade",void 0),o=Bt("markstreamParseOptions",void 0),l=Bt("markstreamCustomMarkdownIt",void 0),s=Bt("markstreamNestedRendererProps",void 0),a=L(()=>{var $;return($=r==null?void 0:r.value)!=null?$:"safe"}),u=L(()=>{var $;return($=t.parseOptions)!=null?$:o==null?void 0:o.value}),c=L(()=>{var $;return($=t.customMarkdownIt)!=null?$:l==null?void 0:l.value}),p=L(()=>{var $,X;return(X=t.customHtmlTags)!=null?X:($=s==null?void 0:s.value)==null?void 0:$.customHtmlTags}),d=L(()=>{var $,X;const K=($=s==null?void 0:s.value)!=null?$:{};return lt(Ae({},K),{customId:(X=t.customId)!=null?X:K.customId,customHtmlTags:p.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})});function f($){var X;return $.type==="text"&&String((X=$.content)!=null?X:"").trim()===""}const g=L(()=>t.node.children.filter($=>!f($))),m=L(()=>g.value.length>0&&g.value.every($=>$.type==="image"||(function(X){var K;const I=(function(B){return B.type==="link"&&Array.isArray(B.children)?B.children.filter(P=>!f(P)):[]})(X);return I.length===1&&((K=I[0])==null?void 0:K.type)==="image"})($))),A=L(()=>new Set(Pi(p.value))),v=L(()=>{if(!m.value||g.value.length<=1)return t.node.children;const $=[];for(let X=0;X<t.node.children.length;X++){const K=t.node.children[X];if(!f(K)){$.push(K);continue}const I=$.length>0,B=t.node.children.slice(X+1).some(P=>!f(P));I&&B&&$.push(lt(Ae({},K),{content:" ",raw:" "}))}return $}),k=L(()=>(i==null?void 0:i.value)===!1&&!n.value.text),C=L(()=>k.value?vo(v.value):null);function b($,X){return Ae({node:$,"index-key":`${t.indexKey}-${X}`,"custom-id":t.customId,"custom-html-tags":p.value},$.type==="reference"?{"data-markstream-reference-id":String($.id)}:{})}function S($){var X,K;const I=$,B=String(I.type);if(n.value[B])return null;const P=(function(W){if(!Array.isArray(W))return"";const z=[];for(const N of W){if(!N||typeof N!="object")return null;const R=S(N);if(R==null)return null;z.push(R)}return z.join("")})(I.children);if(P==null)return null;const _=[B,I.loading,P];switch(B){case"text":return[..._,I.content,I.center].join("");case"inline_code":return[..._,I.code].join("");case"image":return[..._,I.src,I.alt,I.title].join("");case"link":return[..._,I.href,I.title,I.text,JSON.stringify((X=I.attrs)!=null?X:null)].join("");case"html_inline":case"html_block":return[..._,I.tag,I.content,I.autoClosed,JSON.stringify((K=I.attrs)!=null?K:null)].join("");case"emoji":return[..._,I.name,I.markup].join("");case"checkbox":case"checkbox_input":return[..._,I.checked].join("");case"math_inline":return[..._,I.content,I.markup].join("");case"reference":case"footnote_anchor":case"footnote_reference":return[..._,I.id].join("");case"hardbreak":case"emphasis":case"strong":case"strikethrough":case"highlight":case"insert":case"subscript":case"superscript":return _.join("");default:return null}}const T=new Map,M=L(()=>Ae({inline_code:An,image:Vr,link:En,hardbreak:Jr,emphasis:Mn,strong:Sn,strikethrough:In,highlight:qn,insert:On,subscript:Ln,superscript:Nn,html_inline:Xn,html_block:dl,emoji:Rn,checkbox:Vn,math_inline:_r,checkbox_input:Vn,reference:_n,footnote_anchor:cl,footnote_reference:Jn,text:Zt},n.value)),E=L(()=>{const $=v.value;if(T.size>$.length)for(const X of T.keys())X>=$.length&&T.delete(X);return $.map((X,K)=>{var I;const B=S(X),P=T.get(K),_=B!=null&&(P==null?void 0:P.sig)===B?P.child:X;B==null?T.delete(K):T.set(K,{child:_,sig:B});const W=(function(z){var N,R,oe,ne;if(z.type==="html_block"||z.type==="html_inline"){const ee=String((N=z.tag)!=null?N:"").trim().toLowerCase()||Oh(z.content);if(ee&&!A.value.has(ee)&&Ph((R=z.content)!=null?R:z.raw,ee)){const ie=String((ne=(oe=z.content)!=null?oe:z.raw)!=null?ne:"");return{child:{type:"text",content:ie,raw:ie},component:Zt,isCustomComponent:!1}}}return{child:z,component:M.value[z.type],isCustomComponent:!!(n.value[z.type]&&!ra(String(z.type)))}})(_);return lt(Ae({},W),{index:K,key:`${t.indexKey||"paragraph"}-${K}`,customAttrs:W.isCustomComponent?dp(W.child,a.value):void 0,hasSlotChildren:Array.isArray(W.child.children)&&W.child.children.length>0,slotContent:String((I=W.child.content)!=null?I:""),originalChild:_})})});return($,X)=>(J(),he("p",y4,[C.value!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(C.value),9,C4)):(J(!0),he(Je,{key:1},_t(E.value,K=>{return J(),he(Je,{key:K.key},[m.value&&f(K.originalChild)?(J(),he(Je,{key:0},[d1(kt((I=K.originalChild,String((B=I.content)!=null?B:""))),1)],64)):K.isCustomComponent?(J(),je(Zn(K.component),gt({key:1,ref_for:!0},K.customAttrs,{node:K.child,loading:K.child.loading,"index-key":K.key,"custom-id":t.customId,"custom-html-tags":p.value,"is-dark":d.value.isDark}),{default:Bi(()=>[K.hasSlotChildren?(J(),je(He(ju),gt({key:0,ref_for:!0},d.value,{nodes:K.child.children,"index-key":K.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(J(),je(He(ju),gt({key:1,ref_for:!0},d.value,{content:K.slotContent,final:!K.child.loading,"index-key":`${K.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):Gt("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(J(),je(Zn(K.component),gt({key:2,ref_for:!0},b(K.child,K.index)),null,16))],64);var I,B}),128))]))}}),[["__scopeId","data-v-0498f5d7"]]);Ti.install=e=>{e.component(Ti.__name,Ti)};const b4={class:"table-node-wrapper"},x4=["aria-busy"],w4={key:0},_4=["custom-id"],S4=["aria-label","onPointerdown"],I4=["custom-id"],E4={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},hl=mt(Ve({__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=L(()=>{var v;return(v=t.node.loading)!=null&&v}),r=L(()=>{var v;return(v=t.node.rows)!=null?v:[]}),i=be(null),o=be([]);let l=null;const s=L(()=>t.node.header.cells.length),a=L(()=>o.value.some(v=>Number.isFinite(v)&&v>0)),u=L(()=>a.value?o.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);Ut("markstreamShowTooltips",L(()=>t.showTooltips)),Ut("markstreamFade",L(()=>t.fade));const c=sn(()=>t.customId),p=L(()=>!!c.value.text),d=L(()=>!!c.value.paragraph),f=new WeakMap;function g(v){const k=t.fade===!1&&!p.value,C=!d.value,b=f.get(v);if((b==null?void 0:b.children)===v.children&&b.textFastPath===k&&b.paragraphFastPath===C)return b.info;const S=zu(v.children,C,!0),T={simpleChildren:S,plainText:S&&k?vo(S):null};return f.set(v,{children:v.children,textFastPath:k,paragraphFastPath:C,info:T}),T}function m(v){if(!l)return;v.preventDefault();const k=l.startWidth+l.nextStartWidth,C=Math.min(48,Math.floor(k/2)),b=Math.max(C,Math.min(k-C,Math.round(l.startWidth+v.clientX-l.startX))),S=[...l.widths];S[l.index]=b,S[l.index+1]=k-b,o.value=S}function A(){l&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),l=null)}return Ie(s,()=>{A(),o.value=[]}),mo(A),(v,k)=>(J(),he("div",b4,[Re("table",{ref_key:"tableRef",ref:i,class:cn(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(J(),he("colgroup",w4,[(J(!0),he(Je,null,_t(e.node.header.cells,(C,b)=>(J(),he("col",{key:b,style:Yr(u.value[b])},null,4))),128))])):Gt("",!0),Re("thead",null,[Re("tr",null,[(J(!0),he(Je,null,_t(e.node.header.cells,(C,b)=>(J(),he("th",{key:b,dir:"auto",class:cn([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[g(C).plainText!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(g(C).plainText),9,_4)):g(C).simpleChildren?(J(),je(He(Qs),{key:1,nodes:g(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(J(),je(He(Pn),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:k[0]||(k[0]=S=>v.$emit("copy",S))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b<e.node.header.cells.length-1?(J(),he("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${b+1} and ${b+2}`,onPointerdown:S=>(function(T,M){if(M.button!==0)return;const E=(function(){var K;const I=(K=i.value)==null?void 0:K.querySelectorAll("thead th");return Array.from(I??[],B=>Math.round(B.getBoundingClientRect().width))})(),$=E[T],X=E[T+1];$&&X&&(M.preventDefault(),l={index:T,startX:M.clientX,startWidth:$,nextStartWidth:X,widths:E},o.value=E,window.addEventListener("pointermove",m),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A))})(b,S)},null,40,S4)):Gt("",!0)],2))),128))])]),Re("tbody",null,[(J(!0),he(Je,null,_t(r.value,(C,b)=>(J(),he("tr",{key:b},[(J(!0),he(Je,null,_t(C.cells,(S,T)=>(J(),he("td",{key:T,class:cn([S.align==="right"?"text-right":S.align==="center"?"text-center":"text-left"]),dir:"auto"},[g(S).plainText!==null?(J(),he("span",{key:0,class:"text-node","custom-id":t.customId},kt(g(S).plainText),9,I4)):g(S).simpleChildren?(J(),je(He(Qs),{key:1,nodes:g(S).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${T}`},null,8,["nodes","custom-id","index-key"])):(J(),je(He(Pn),{key:2,nodes:S.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:k[1]||(k[1]=M=>v.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,x4),xr(h1,{name:"table-node-fade"},{default:Bi(()=>[n.value?(J(),he("div",E4,[gu(v.$slots,"loading",{isLoading:n.value},()=>[k[2]||(k[2]=Re("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),k[3]||(k[3]=Re("span",{class:"sr-only"},"Loading",-1))],!0)])):Gt("",!0)]),_:3})]))}}),[["__scopeId","data-v-cd7fd3ec"]]);hl.install=e=>{e.component(hl.__name,hl)};const M4={class:"hr-node"},Is=mt({},[["render",function(e,t){return J(),he("hr",M4)}],["__scopeId","data-v-39b2349c"]]);Is.install=e=>{e.component(Is.__name,Is)};const T4={class:"unknown-node"},oh=Ve({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(J(),he("div",T4,kt(e.node.raw),1))}),Es=mt(Ve({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=L(()=>`vmr-container vmr-container-${t.node.name}`),r=sn(()=>t.customId),i=L(()=>Ae({text:Zt,paragraph:Ti,heading:ia,inline_code:An,link:En,image:Vr,strong:Sn,emphasis:Mn,strikethrough:In,insert:On,subscript:Ln,superscript:Nn,checkbox:Vn,checkbox_input:Vn,hardbreak:Jr,math_inline:_r,reference:_n,list:go,math_block:Jy,table:hl},r.value));return(o,l)=>(J(),he("div",gt({class:n.value},e.node.attrs),[(J(!0),he(Je,null,_t(e.node.children,(s,a)=>{return J(),je(Zn((u=s.type,i.value[u]||oh)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:s,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade,"data-markstream-reference-id":s.type==="reference"?String(s.id):void 0},null,8,["custom-id","node","index-key","typewriter","fade","data-markstream-reference-id"]);var u}),128))],16))}}),[["__scopeId","data-v-672fe0a7"]]);Es.install=e=>{e.component(Es.__name,Es)};const ld="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",B4=["diff ","index ","--- ","+++ ","@@ "],on=(()=>{const e=globalThis;if(e[ld])return e[ld];const t={configs:{},controllers:{},revision:Oi(0),preparedCache:new Map,blockEstimateCache:new Map};return e[ld]=t,t})();let ns=null,lh=null,sd=null;function Xy(){return lh||typeof window>"u"?null:(sd||(sd=wn(()=>import("./layout-DloY-SLW.js"),[]).then(e=>(lh=e,on.revision.value++,e)).catch(()=>null)),sd.then(()=>{}))}const Va=on.revision;function W0(e){var t;return e&&(t=on.configs[e])!=null?t:null}function K0(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function F4(e){return(e==null?void 0:e.type)==="text"||(e==null?void 0:e.type)==="emoji"||(e==null?void 0:e.type)==="hardbreak"}function ad(e){var t,n,r;if(!Array.isArray(e)||e.length===0)return null;let i="";for(const o of e){if(!F4(o))return null;o.type==="text"?i+=String((t=o.content)!=null?t:""):o.type==="emoji"?i+=String((r=(n=o.name)!=null?n:o.raw)!=null?r:""):o.type==="hardbreak"&&(i+=`
216
+ `)}return i.length>0?i:null}function ud(e,t,n){var r,i;if(!e||!Number.isFinite(t)||t<=0||!(function(){var l;if(ns!=null)return ns;if(typeof document>"u")return!1;try{const s=document.createElement("canvas");return ns=!!((l=s.getContext)!=null&&l.call(s,"2d")),ns}catch{return ns=!1,!1}})())return null;const o=lh;if(!o)return Xy(),null;try{const l=Math.round(100*t)/100,s=[(r=n.whiteSpace)!=null?r:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,l,e].join("\0"),a=on.blockEstimateCache.get(s);if(a)return on.blockEstimateCache.delete(s),on.blockEstimateCache.set(s,a),{kind:"simple-text",height:a.height,contentHeight:a.contentHeight};const u=(i=n.whiteSpace)!=null?i:"pre-wrap",c=(function(m,A,v,k){const C=`${k}\0${v}\0${A}`,b=on.preparedCache.get(C);if(b)return on.preparedCache.delete(C),on.preparedCache.set(C,b),b.prepared;const S=m.prepare(A,v,{whiteSpace:k});for(on.preparedCache.set(C,{prepared:S});on.preparedCache.size>240;){const T=on.preparedCache.keys().next().value;if(!T)break;on.preparedCache.delete(T)}return S})(o,e,n.font,u),p=Math.max(24,l-n.widthAdjustment),d=o.layout(c,p,n.lineHeight),f=Math.max(n.lineHeight,d.height),g=Math.max(n.lineHeight,Math.round(f+n.wrapperOverhead));for(on.blockEstimateCache.set(s,{height:g,contentHeight:Math.round(f)});on.blockEstimateCache.size>4e3;){const m=on.blockEstimateCache.keys().next().value;if(!m)break;on.blockEstimateCache.delete(m)}return{kind:"simple-text",height:g,contentHeight:Math.round(f)}}catch{return null}}function qy(e,t,n){var r,i;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const o=ad(e.children);return o&&n.paragraph?ud(o,t,n.paragraph):null}if(e.type==="heading"){const o=Number(e.level||0),l=ad(e.children),s=n.headings[o];return l&&s?ud(l,t,s):null}if(e.type==="list_item"){const o=Array.isArray(e.children)?e.children:[];if(o.length!==1||((r=o[0])==null?void 0:r.type)!=="paragraph"||!n.listItem)return null;const l=ad((i=o[0])==null?void 0:i.children);return l?ud(l,t,n.listItem):null}if(e.type==="list"){const o=Array.isArray(e.items)?e.items:[];if(!o.length)return null;let l=Math.max(0,n.listWrapperOverhead);for(const s of o){const a=qy(s,t,n);if(!a)return null;l+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(l)),contentHeight:Math.max(1,Math.round(l))}}return null}function rs(e){if(!e)return 1;const t=String(e).split(/\r\n|\n|\r/);return Math.max(1,t.length)}function ur(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function j0(e,t){return e.diff?eh({diffStyle:t})?(function(n){const r=ur(n.raw);if(r){const i=r.split(/\r?\n/);return n.originalCode!=null||n.updatedCode!=null?Math.max(1,i.filter(o=>!B4.some(l=>o.startsWith(l))).length):Math.max(1,i.length)}return rs(ur(n.originalCode))+rs(ur(n.updatedCode))})(e):(function(n){const r=n.originalCode,i=n.updatedCode;if(r!=null||i!=null)return Math.max(rs(ur(r)),rs(ur(i)));const o=ur(n.code).split(/\r?\n/);let l=0,s=0;for(const a of o)a.startsWith("+")&&!a.startsWith("+++")?s++:a.startsWith("-")&&!a.startsWith("---")?l++:(l++,s++);return Math.max(1,l,s)})(e):rs(ur(e.code,e.loading===!0))}function cd(e,t,n){return Math.max(1,Math.ceil((function(r,i){let o=0;for(const l of r)o+=l===" "?i-o%i:l>="ᄀ"?2:1;return o})(e,n)/t))}function z0(e,t,n,r,i,o){var l,s,a;const u=e/(o?2:1),c=((l=i.codeBlockOptions)==null?void 0:l.padding)==null?t:r.padding,p=(a=i.showLineNumbers)!=null?a:((s=i.codeBlockOptions)==null?void 0:s.disableLineNumbers)!==!0,d=Math.max(2,String(Math.max(1,n)).length)*t,f=p?3*t+d+2:0;return Math.max(1,Math.floor((u-f-2*c)/t))}function D4(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function fd(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const r=window.getComputedStyle(t),i=e.offsetHeight,o=K0(r.lineHeight,1.5*K0(r.fontSize,16)),l=e.getBoundingClientRect().width,s=t.getBoundingClientRect().width;return{font:D4(r),lineHeight:o,wrapperOverhead:Math.max(0,i-o),widthAdjustment:Math.max(0,l-s),whiteSpace:n}}const R4=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function G0(e,t={}){var n;const r={},i=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return r;const o=Object.getOwnPropertyDescriptors(e);for(const[l,s]of Object.entries(o))R4.has(l)||i.has(l)||s.enumerable&&"value"in s&&(r[l]=s.value);return r}function pu(e,t){const n=t.trim().toLowerCase();if(n)for(const r of[n,ea(n),IF(n),n==="d2lang"?"d2":""]){const i=r&&e[r];if(i)return i}}function Q0(e,t,n,r){var i;const o=(function(d){return Math.max(0,Math.ceil(d.scrollHeight||0)-Math.ceil(d.clientHeight||0))})(e),l=(function(d,f){return Number.isFinite(d)?Math.min(Math.max(0,d),f):0})(n,o);if(!r.isReverseFlexScrollRoot(e))return void(e.scrollTop=l);const s=Math.max(0,o-l),a=[-s,s];let u=a[0],c=Number.POSITIVE_INFINITY;for(const d of a){e.scrollTop=d;const f=r.getNormalizedScrollTop(e,t,!1),g=Math.abs(f-l);g<c&&(c=g,u=d)}e.scrollTop=u;const p=(i=r.epsilonPx)!=null?i:2;Math.abs(r.getNormalizedScrollTop(e,t,!1)-l)>p&&(e.scrollTop=u)}function U0(e,t){let n=0,r=null,i=null;const o=()=>{const l=i;i=null,r=null,l&&(n=Date.now(),e(...l))};return function(...l){const s=Date.now(),a=t-(s-n);i=l,a<=0?(r&&(clearTimeout(r),r=null),n=s,i=null,e(...l)):r||(r=setTimeout(o,a))}}function eC(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}function Y0(e){return eC(e)!=="off"}const tC=Symbol("MarkstreamMathBlockMinHeightCache");function BR(){return Bt(tC,null)}const N4=new Set(["text","inline_code","emoji","footnote_reference"]),L4=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function is(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function uo(e,t,n,r=22){const i=String(e??"");if(!i)return n;const o=Math.max(18,Math.floor(Math.max(320,t)/8)),l=i.split(/\r?\n/).length,s=Math.ceil(i.length/o),a=Math.max(1,l,s);return Math.max(n,Math.ceil(a*r+12))}function nC(e){var t;if(!e||typeof e!="object")return!1;const n=e,r=String((t=n.type)!=null?t:"");if(N4.has(r))return!0;if(!L4.has(r))return!1;const i=n.children;return!Array.isArray(i)||!i.length||i.every(nC)}function sh(e){var t,n,r,i,o,l,s,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((r=(n=u.content)!=null?n:u.raw)!=null?r:"");if(c==="inline_code")return String((l=(o=(i=u.code)!=null?i:u.content)!=null?o:u.raw)!=null?l:"");if(c==="emoji")return String((a=(s=u.name)!=null?s:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const p=[];for(const d of["children","items","cells","rows"]){const f=u[d];if(Array.isArray(f)){const g=f.map(sh).filter(Boolean).join(" ");g&&p.push(g)}}return p.join(" ").replace(/\s+/g," ").trim()}function rC(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const r=t[n];return Array.isArray(r)&&r.some(rC)})}function O4(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),r=e.split(/\r?\n/).length,i=Math.ceil(e.length/n),o=Math.max(1,r,i);return 30+26*Math.max(0,o-1)}function Z0(e,t){var n,r,i,o,l,s,a,u,c,p,d,f,g,m;if(!e||typeof e!="object")return 32;const A=e,v=String((n=A.type)!=null?n:""),k=Number.isFinite(t)&&t>0?t:640;switch(v){case"heading":return(function(C){var b;const S=Number((b=C.level)!=null?b:C.depth);return S>=4?20:S===3?30:S===2?32:44})(A);case"paragraph":return(function(C,b){const S=String(C??"");if(!S)return 28;const T=Math.max(18,Math.floor(Math.max(320,b)/8)),M=S.split(/\r?\n/).length,E=Math.ceil(S.length/T);return Math.max(1,M,E)<=1?28:uo(S,b,34)})(String((i=(r=A.raw)!=null?r:A.content)!=null?i:""),k);case"list":return(function(C,b){var S;const T=Array.isArray(C.items)?C.items:[];if(!T.length)return 48;const M=Math.max(48,30*T.length+12);let E=12;for(const K of T)E+=O4(sh(K)||String((S=K.raw)!=null?S:""),b);const $=Math.max(0,E-M);if(T.length>20){const K=Math.round(2.4*T.length);return Math.round(M+Math.max(K,Math.min($,3*T.length)))}if($<=0)return M;const X=T.length>8?8*T.length:$;return Math.round(M+Math.min($,X))})(A,k);case"list_item":return uo(String((l=(o=A.raw)!=null?o:A.content)!=null?l:""),k,34);case"blockquote":return uo(String((a=(s=A.raw)!=null?s:A.content)!=null?a:""),k,56);case"table":return(function(C,b){const S=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!S.length){const T=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*T+48)}return Math.max(120,Math.round(4+S.reduce((T,M)=>T+(function(E,$){const X=Math.max(1,E.length),K=Math.max(80,($-32)/X),I=Math.max(10,Math.floor(K/8)),B=Math.max(1,...E.map(P=>{var _;const W=sh(P)||String((_=P==null?void 0:P.raw)!=null?_:"");return Math.ceil(W.length/I)||1}));return 54+34*Math.max(0,B-1)+(X<=3&&E.some(rC)?14:0)})((function(E){var $;return Array.isArray(E==null?void 0:E.cells)&&($=E.cells)!=null?$:[]})(M),b),0)))})(A,k);case"code_block":{const C=String((u=A.language)!=null?u:"").trim().toLowerCase(),b=String((p=(c=A.code)!=null?c:A.raw)!=null?p:"");return C==="mermaid"?Wu($u(b)):C==="infographic"?Ku(Hu(b)):uo(b,k,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,b){var S,T,M;const E=C.match(/^\s*<details\b([^>]*)>/i);return E&&!/(?:^|\s)open(?:\s|=|$)/i.test((S=E[1])!=null?S:"")?uo(((M=(T=C.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i))==null?void 0:T[1])==null?void 0:M.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):uo(C,b,96)})(String((f=(d=A.raw)!=null?d:A.content)!=null?f:""),k);case"thematic_break":return 24;default:return uo(String((m=(g=A.raw)!=null?g:A.content)!=null?m:""),k,40)}}function V0(e,t,n){return Math.min(Math.max(e,t),n)}const J0=new WeakMap;function Ms(e,t,n){var r;const i=e;if(n.has(i))return n.get(i);const o=String(e.type).trim().toLowerCase();if(t[o])return n.set(i,!0),!0;if(o==="code_block"){const a=String((r=e.language)!=null?r:"").trim().toLowerCase();if(a&&pu(t,a))return n.set(i,!0),!0}const l=e;n.set(i,!1);const s=Object.values(l).some(a=>Array.isArray(a)?a.some(u=>Ni(u)&&Ms(u,t,n)):Ni(a)&&Ms(a,t,n));return n.set(i,s),s}const P4=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],$4=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],H4=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),iC=["raw","content","code","originalCode","updatedCode"],X0=new WeakMap,q0=new WeakMap;let W4=1;function br(){return typeof performance<"u"?performance.now():Date.now()}function e1(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Yn(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=X0.get(t);return n||(n=W4++,X0.set(t,n)),String(n)}function t1(e,t,n,r={}){var i,o;const l=r.includeFinal!==!1,s={md:Yn(t),customMarkdownIt:Yn(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(i=e.customHtmlTags)!=null?i:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(o=e.streamParse)!=null?o:"auto",validateLink:Yn(e.validateLink),preTransformTokens:Yn(e.preTransformTokens),postTransformTokens:Yn(e.postTransformTokens),postTransformNodes:Yn(e.postTransformNodes)};return l&&(s.final=e.final===!0),JSON.stringify(s)}function n1(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
217
+ `,t-1)+1;return e.slice(n,t).trim()}function oC(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 mp(e){const t=String(e??"");return`${t.length}:${oC(t)}`}function ah(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(l){return l.length<=8192?mp(l):`${l.length}:${oC(l.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Yn(e)}`;if(typeof e!="object")return typeof e;const r=e,i=t.get(r);if(i)return`cycle:${i}`;if(n>=6)return`object:${Yn(r)}`;const o=Yn(r);if(t.set(r,o),Array.isArray(e)){const l=e.slice(0,200);return`a:${e.length}:${l.map(s=>ah(s,t,n+1)).join(",")}`}if(typeof e=="object"){const l=e,s=Object.keys(l).sort(),a=s.slice(0,80);return`o:${s.length}:${a.map(u=>`${u}:${ah(l[u],t,n+1)}`).join(";")}`}return typeof e}function Ni(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function lC(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(r=>Ni(r)?Li(r,t,n+1):lC(r,t,n+1)).join(",")}`:Ni(e)?Li(e,t,n):ah(e,t,n)}function K4(e,t,n){return Object.keys(e).sort().filter(r=>r!=="children"&&!iC.includes(r)).map(r=>{const i=e[r];return typeof i=="string"?`${r}=s:${mp(i)}`:typeof i=="number"||typeof i=="boolean"||i==null?`${r}=${String(i)}`:typeof i=="function"?`${r}=fn:${Yn(i)}`:H4.has(r)&&(Array.isArray(i)||typeof i=="object")?`${r}=${lC(i,t,n+1)}`:i&&typeof i=="object"?`${r}=object:${Yn(i)}`:""}).filter(Boolean).join(";")}function j4(e){return iC.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${mp(n)}`:""}).filter(Boolean).join(";")}function Li(e,t=new WeakMap,n=0){const r=q0.get(e);if(r)return r;const i=e,o=t.get(i);if(o)return`node-cycle:${o}`;if(n>=6)return`node:${e.type}:${Yn(i)}`;const l=Yn(i);t.set(i,l);const s=(function(a,u,c){const p=a,d=Array.isArray(p.children)?p.children:[],f=d.length?d.slice(0,200).map(g=>Li(g,u,c+1)).join("|"):"";return[a.type,j4(p),K4(p,u,c),d.length,f].join(":")})(e,t,n);return q0.set(i,s),s}function sC(e,t){return Li(e)===Li(t)}function Ap(e,t,n){const r=br(),i=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=br()-r,e[i]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function r1(e,t,n){return Ap(t,n,()=>Li(e))}function aC(e,t,n){return r1(e,n,"stabilizeSignatureMs")===r1(t,n,"stabilizeSignatureMs")}function Ja(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function i1(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function o1(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function z4(e,t){return e.length===t.length&&e===t}function uc(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const r=e,i=t,o=Object.keys(r).filter(c=>c!=="type"&&c!=="children").sort(),l=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort();if(o.length!==l.length)return!1;for(let c=0;c<o.length;c++){const p=o[c];if(p!==l[c])return!1;const d=r[p],f=i[p];if(typeof d!=typeof f)return!1;if(typeof d!="string"){if(typeof d!="number"&&typeof d!="boolean"&&d!=null)return null;if(!Object.is(d,f))return!1}else if(typeof f!="string"||!z4(d,f))return!1}const s=Object.prototype.hasOwnProperty.call(r,"children");if(s!==Object.prototype.hasOwnProperty.call(i,"children"))return!1;if(!s)return!0;const a=r.children,u=i.children;if(!Array.isArray(a)||!Array.isArray(u))return null;if(a.length!==u.length)return!1;for(let c=0;c<a.length;c++){const p=a[c],d=u[c];if(!Ni(p)||!Ni(d))return null;const f=uc(p,d,n+1);if(f==null)return null;if(!f)return!1}return!0}function uC(e,t,n=0){if(e===t||e.type!==t.type||n>=6)return;const r=e,i=t;for(const o of["children","items","rows","cells"]){const l=r[o],s=i[o];if(!Array.isArray(l)||!Array.isArray(s))continue;const a=Math.min(l.length,s.length);for(let u=0;u<a;u++){const c=l[u],p=s[u];c!==p&&Ni(c)&&Ni(p)&&(uc(c,p)===!0?s[u]=c:uC(c,p,n+1))}}}function G4(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=uc(e,t);return n??sC(e,t)}function Q4(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let r=null;return Ap(n,"stabilizeSignatureMs",()=>{r=uc(e,t)}),r??aC(e,t,n)}function U4(e,t){const n={};for(const r of P4){const i=e[r],o=t==null?void 0:t[r];typeof i=="number"&&(n[r]=i-(typeof o=="number"?o:0))}return n}function Y4(e,t){var n;const r=Pd(t.instanceMsgId),i=new Map,o=(n=t.smoothStreamingEnabled)!=null?n:L(()=>!1),l=be(t.renderContent.value);let s=[],a="",u="",c="",p=!1,d="",f=new WeakMap;const g=(function(){let W="",z=0,N=!1,R=!1,oe=!1,ne=!1;function ee(){W="",z=0,N=!1,R=!1,oe=!1,ne=!1}function ie(G){let Q=!1;for(let te=0;te<G.length;te++){const re=G.charCodeAt(te);if(re===10||re===13){const ce=re===10&&ne;ne=re===13,N=!1,ce||(oe||(R=!1,z=0),oe=!1);continue}ne=!1;const pe=re===9||re===32;if(pe||(oe=!0,R&&(Q=!0)),z)if(z!==1)pe||(re!==58?z=re===91?1:0:(Q=!0,R=!0));else{if(N){N=!1;continue}if(re===92){N=!0;continue}re===93&&(z=2)}else re===91&&(z=1)}return Q}return(G,Q)=>{if(!G||!Q.startsWith(G)||Q.length<=G.length)return ee(),[!0,0];let te=0;W!==G&&(ee(),ie(G),te=G.length);const re=Q.slice(G.length),pe=ie(re);return W=Q,[pe,te+re.length]}})();let m,A=0,v=0,k=br(),C=-1,b=0;function S(W){C=Number.isInteger(W)?W:0,b+=1}function T(){m&&(clearTimeout(m),m=void 0)}function M(){T();const W=t.renderContent.value;l.value!==W&&(l.value=W),k=br()}Ie([t.renderContent,t.effectiveFinal,o],([W,z,N])=>{l.value!==W&&(!N||z||(function(R,oe){if(!R&&oe||oe.length<=80||oe.length<R.length||!oe.startsWith(R))return!0;const ne=oe.slice(R.length);return!(!ne||!(function(G){const Q=(function(te){return te.includes("|")?te.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]})(G);return Q.length>=2&&Q.every(te=>{const re=te.trim();return re.length>=1&&re.replace(/^:/,"").replace(/:$/,"").split("").every(pe=>pe==="-")})})(n1(oe))&&(ee=oe,ie=n1(ee),!(/^={3,}$/.test(ie)||/^-{3,}$/.test(ie)||ne.includes(`
218
+
219
+ `)||/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(ne))));var ee,ie})(l.value,W)?M():(function(){if(v+=1,m)return;const R=Math.max(0,(function(oe){const ne=oe.parseCoalesceMs;return typeof ne=="number"&&Number.isFinite(ne)&&ne>=0?ne:80})(e)-(br()-k));R<=0?M():m=setTimeout(M,R)})())},{flush:"sync",immediate:!0}),ch(T);const E=L(()=>{var W,z,N,R;return jv(e.customHtmlTags,(W=e.parseOptions)==null?void 0:W.customHtmlTags,(R=(N=(z=t.customComponentsMap)==null?void 0:z.value)!=null?N:{},Object.entries(R).map(([oe,ne])=>{const ee=cr(oe);return ne==null||!ee||ra(ee)||Rh.has(ee)||vl.has(ee)?"":ee}).filter(Boolean)))}),$=L(()=>{const{key:W,tags:z}=zv(E.value);if(!W)return r;const N=i.get(W);if(N)return N;const R=Pd(t.instanceMsgId,{customHtmlTags:z});return i.set(W,R),R}),X=L(()=>{const W=$.value;if(!e.customMarkdownIt)return W;const z=e.customMarkdownIt(W);return W.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),K=L(()=>{var W,z;const N=(W=e.parseOptions)!=null?W:{},R=t.effectiveFinal.value,oe=E.value,ne=R!=null,ee=oe.length>0;return ne||ee||N.streamParse==null?Ae(Ae(lt(Ae({},N),{streamParse:(z=N.streamParse)==null||z}),ne?{final:R}:{}),ee?{customHtmlTags:oe}:{}):N}),I=L(()=>{var W;return new Set(((W=K.value.customHtmlTags)!=null?W:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),B=L(()=>t1(K.value,X.value,e.customMarkdownIt,{includeFinal:!0})),P=L(()=>t1(K.value,X.value,e.customMarkdownIt,{includeFinal:!1}));Ie([B,P],([W,z],[N,R])=>{N&&(W===N&&z===R||(M(),z!==R&&(s=[],c="")))},{flush:"sync"});const _=L(()=>{var W,z,N,R,oe,ne,ee,ie,G,Q,te;if((W=e.nodes)!=null&&W.length)return s=[],c="",S(0),fo(e.nodes.slice());const re=l.value;if(!re)return s=[],c="",S(-1),[];const pe=t.debugPerformanceEnabled.value,ce=pe?br():0,Ce=X.value,ze=B.value,Ne=P.value;a&&ze!==a&&(function(rt){var ot,Ct;(Ct=(ot=rt.stream)==null?void 0:ot.reset)==null||Ct.call(ot)})(Ce),u&&Ne!==u&&(s=[],c="");const Ze=(N=(z=t.customComponentsMap)==null?void 0:z.value)!=null?N:{},st=(function(rt){const ot=rt,Ct=J0.get(ot);if(Ct!==void 0)return Ct;const jt=(function(qt){return JSON.stringify(Object.entries(qt).sort(([pt],[tt])=>pt.localeCompare(tt)).map(([pt,tt])=>[pt,Yn(tt)]))})(rt);return J0.set(ot,jt),jt})(Ze);d&&st!==d&&(s=[],c="",f=new WeakMap);const Ke=Object.keys(Ze).length>0,St=typeof K.value.postTransformNodes=="function";St!==p&&(s=[],c="");const Pe=!St&&s.length>0&&re.startsWith(c)&&Ne===u,Ft=pe?e1(Ce):null,vn=pe?{}:void 0,Vt=o1(Ce),fr=Ke&&s.some(rt=>Ms(rt,Ze,f)),Lr=!Vt&&!St&&(!Ke||s.length>0&&!fr),Ar=Ae(lt(Ae({},K.value),{reuseStableTopLevelNodes:Lr}),vn?{parserMetrics:vn}:{}),$n=ty(re,Ce,Ar),Hn=pe?br():0;if(Pe&&!Vt&&!Ke&&!K.value.preTransformTokens&&!K.value.postTransformTokens){const rt=Math.min(s.length,$n.length);for(let ot=0;ot<rt;ot++)uC(s[ot],$n[ot])}const It=pe?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Dt,Ht=pe?Ja($n.length):void 0,vr=0,kn=0,Wn=0;if(Pe){const rt=pe?br():0,[ot,Ct]=Ke?[0,0]:(function(pt){var tt,xe;const[Le,nt]=pt.scanGlobalReferenceAppend(pt.previousContent,pt.content),Xe=pt.parseOptions;return[pt.previousDirtyStartIndex>0&&Xe.final!==!0&&!pt.customMarkdownIt&&!o1(pt.md)&&!Le&&typeof Xe.preTransformTokens!="function"&&typeof Xe.postTransformTokens!="function"&&typeof Xe.postTransformNodes!="function"&&((xe=(tt=Xe.customHtmlTags)==null?void 0:tt.length)!=null?xe:0)===0?pt.previousDirtyStartIndex:0,nt]})({content:re,previousContent:c,previousDirtyStartIndex:C,parseOptions:K.value,customMarkdownIt:e.customMarkdownIt,md:Ce,scanGlobalReferenceAppend:g});Wn=Ct;const jt=ot<=0,qt=Ke?pt=>!Ms(pt,Ze,f):void 0;if(It){const pt=(function(tt,xe,Le,nt={}){if(!xe.length)return{nodes:tt,metrics:Ja(tt.length)};const Xe=nt.reuseDirtyTail!==!1,at=(function(Ge,ut,Et,Jt){var Ee;const nn=Math.min(Ge.length,ut.length);for(let qe=Math.min(nn,Math.max(0,(Ee=Jt.scanStartIndex)!=null?Ee:0));qe<nn;qe++){const At=ut[qe],Mt=Ge[qe];if(Jt.canReuseNode&&(!Jt.canReuseNode(At)||!Jt.canReuseNode(Mt))||!Q4(At,Mt,Et))return qe}return Ge.length===ut.length?-1:nn})(tt,xe,Le,nt);if(at<0)return{nodes:xe,metrics:{reusedNodeCount:tt.length,dirtyStartIndex:at,stablePrefixNodeCount:tt.length,dirtyTailNodeCount:0}};const tn=tt.slice();let it=at;for(let Ge=0;Ge<at;Ge++)tn[Ge]=xe[Ge];if(Xe)for(let Ge=at;Ge<tt.length;Ge++){const ut=xe[Ge],Et=tt[Ge];ut&&(!nt.canReuseNode||nt.canReuseNode(ut)&&nt.canReuseNode(Et))&&aC(ut,Et,Le)&&(tn[Ge]=ut,it+=1)}return{nodes:tn,metrics:{reusedNodeCount:it,dirtyStartIndex:at,stablePrefixNodeCount:at,dirtyTailNodeCount:i1(at,tt,xe)}}})($n,s,It,{canReuseNode:qt,reuseDirtyTail:jt,scanStartIndex:ot});Dt=pt.nodes,Ht=pt.metrics}else{const pt=(function(tt,xe,Le={}){if(!xe.length)return{nodes:tt,metrics:Ja(tt.length)};const nt=Le.reuseDirtyTail!==!1,Xe=(function(it,Ge,ut){var Et;const Jt=Math.min(it.length,Ge.length);for(let Ee=Math.min(Jt,Math.max(0,(Et=ut.scanStartIndex)!=null?Et:0));Ee<Jt;Ee++){const nn=Ge[Ee],qe=it[Ee];if(ut.canReuseNode&&(!ut.canReuseNode(nn)||!ut.canReuseNode(qe))||!G4(nn,qe))return Ee}return it.length===Ge.length?-1:Jt})(tt,xe,Le);if(Xe<0)return{nodes:xe,metrics:{reusedNodeCount:tt.length,dirtyStartIndex:Xe,stablePrefixNodeCount:tt.length,dirtyTailNodeCount:0}};const at=tt.slice();let tn=Xe;for(let it=0;it<Xe;it++)at[it]=xe[it];if(nt)for(let it=Xe;it<tt.length;it++){const Ge=xe[it],ut=tt[it];Ge&&(!Le.canReuseNode||Le.canReuseNode(Ge)&&Le.canReuseNode(ut))&&sC(Ge,ut)&&(at[it]=Ge,tn+=1)}return{nodes:at,metrics:{reusedNodeCount:tn,dirtyStartIndex:Xe,stablePrefixNodeCount:Xe,dirtyTailNodeCount:i1(Xe,tt,xe)}}})($n,s,{canReuseNode:qt,reuseDirtyTail:jt,scanStartIndex:ot});Dt=pt.nodes,Ht=pt.metrics}vr=pe?br()-rt:0,kn=jt?(Ht==null?void 0:Ht.dirtyStartIndex)==null||Ht.dirtyStartIndex<0?Dt.length:Ht.dirtyStartIndex:Dt.length}else Dt=$n,Ht=Ja(Dt.length);if(t.effectiveFinal.value!==!0&&(It?(function(rt,ot,Ct=0){for(let jt=Math.max(0,Ct);jt<rt.length;jt++)Ap(ot,"primeSignatureMs",()=>Li(rt[jt]))})(Dt,It,kn):(function(rt,ot=0){for(let Ct=Math.max(0,ot);Ct<rt.length;Ct++)Li(rt[Ct])})(Dt,kn)),Ke)for(let rt=(Ht==null?void 0:Ht.dirtyStartIndex)!=null&&Ht.dirtyStartIndex>=0?Ht.dirtyStartIndex:Dt.length;rt<Dt.length;rt++)Ms(Dt[rt],Ze,f);const yt=pe?br()-Hn:0;if(A+=1,c=re,a=ze,u=Ne,p=St,d=st,s=Dt,S((R=Ht==null?void 0:Ht.dirtyStartIndex)!=null?R:0),pe){const rt=e1(Ce),ot=typeof(rt==null?void 0:rt.total)=="number"&&rt.total>((oe=Ft==null?void 0:Ft.total)!=null?oe:0);t.logPerf(ot?"parse(stream)":"parse(sync)",Ae(Ae(Ae({rendererId:t.instanceMsgId,ms:Math.round(br()-ce),nodes:Dt.length,contentLength:re.length,parseCommitCount:A,parseCoalescedCount:v,nodeReuseMs:yt,referenceDefinitionScanChars:Wn,signatureMs:(ne=It==null?void 0:It.signatureMs)!=null?ne:0,stabilizeSignatureMs:(ee=It==null?void 0:It.stabilizeSignatureMs)!=null?ee:0,primeSignatureMs:(ie=It==null?void 0:It.primeSignatureMs)!=null?ie:0,signatureCallCount:(G=It==null?void 0:It.signatureCallCount)!=null?G:0,stabilizeSignatureCallCount:(Q=It==null?void 0:It.stabilizeSignatureCallCount)!=null?Q:0,primeSignatureCallCount:(te=It==null?void 0:It.primeSignatureCallCount)!=null?te:0,stabilizeMs:vr},Ht??{}),vn?Object.fromEntries($4.map(Ct=>{var jt;return[Ct,(jt=vn[Ct])!=null?jt:0]})):{}),rt?{streamMode:rt.lastMode,streamDelta:U4(rt,Ft),streamStats:rt}:{}))}return fo(Dt)});return{effectiveCustomHtmlTags:E,effectiveCustomHtmlTagsSet:I,mdBase:$,mdInstance:X,mergedParseOptions:K,getParsedNodesDirtyStartIndex:()=>C,getParsedNodesRevision:()=>b,parsedNodes:_}}function Z4(e){const{isClient:t}=e,n=be(new Set),r=new Map,i=new Map,o=new Map;function l(u){if(!t)return;const c=o.get(u);c!=null&&(window.clearTimeout(c),o.delete(u))}function s(){if(t)for(const u of o.values())window.clearTimeout(u);o.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:r,nodeVisibilityWatchStops:i,nodeVisibilityFallbackTimers:o,clearVisibilityFallback:l,clearAllVisibilityFallbacks:s,markNodeVisible:function(u,c=!0){var p;c&&l(u),(function(d,f){if((m=(g=e.shouldTrackVisibleNodeIndices)==null?void 0:g.call(e))!=null&&!m)return;var g,m;const A=n.value,v=A.has(d);if(f){if(v)return;const C=new Set(A);return C.add(d),void(n.value=C)}if(!v)return;const k=new Set(A);k.delete(d),n.value=k})(u,c),c&&((p=e.onNodeMarkedVisible)==null||p.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[d,f]of i.entries())d<u||(f(),i.delete(d));for(const[d,f]of r.entries())d<u||(f.destroy(),r.delete(d),l(d),(c=e.onNodeVisibilityCleaned)==null||c.call(e,d));for(const d of Array.from(o.keys()))d<u||l(d);if(!n.value.size)return;const p=new Set;for(const d of n.value)d<u&&p.add(d);n.value=p},destroyNodeVisibilityState:function(){a();for(const u of i.values())u();i.clear();for(const u of r.values())u.destroy();r.clear(),s()}}}function V4(e){const{isClient:t,virtualizationEnabled:n,listenerEnabled:r,scrollRootElement:i,resolveScrollContainer:o,scheduleFocusSync:l,onScroll:s}=e;let a=null,u=null,c=!1,p=null;const d=e.requestFrame===void 0?typeof requestAnimationFrame=="function"?requestAnimationFrame:null:e.requestFrame,f=e.cancelFrame===void 0?typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null:e.cancelFrame;function g(){p!=null&&(f==null||f(p),p=null),c=!1,a&&(a(),a=null),u=null,i.value=null}function m(A){const v=e.getScrollTop?e.getScrollTop(A):A.scrollTop;return Math.max(0,Number.isFinite(v)?Math.abs(v):0)}return{cleanupScrollListener:g,setupScrollListener:function(){if(!t)return;if(!((A=r==null?void 0:r.value)!=null?A:n.value))return void g();var A;const v=o();if(!v)return void g();if(i.value===v&&a)return;g(),u=m(v);const k=()=>{s==null||s(),n.value&&(()=>{if(c)return;c=!0;const C=()=>{if(c=!1,p=null,n.value){const b=(function(S){const T=m(S),M=u;u=T;const E=Math.max(480,.75*(S.clientHeight||0));return M==null?T>E?{immediate:!0}:void 0:Math.abs(T-M)>E?{immediate:!0}:void 0})(v);b?l(b):l()}};d?p=d(C):C()})()};v.addEventListener("scroll",k,{passive:!0}),i.value=v,a=()=>{v.removeEventListener("scroll",k)}}}}function cC(e={}){const t=be(""),n=be(""),r=be(!1),i=TF(e),o=()=>{const c=i.getSnapshot();t.value=c.source,n.value=c.visible,r.value=c.done},l=i.subscribe(o);o();const s=L(()=>Math.max(0,t.value.length-n.value.length)),a=L(()=>s.value===0),u=L(()=>r.value&&a.value);return Eb()&&ch(()=>{l(),i.destroy()}),{source:t,visible:n,done:r,final:u,caughtUp:a,pendingChars:s,enqueue:c=>i.enqueue(c),finish:c=>i.finish(c),flush:()=>i.flush(),reset:(c,p)=>i.reset(c,p),pause:()=>i.pause(),resume:()=>i.resume()}}const J4={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},l1=/auto|scroll|overlay/i;function X4(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return l1.test(t)||l1.test(n)}function q4(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 s1=Ve({name:"D2BlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=L(()=>{var n,r;return Ny((r=ho(e.estimatedPreviewHeightPx))!=null?r:Ly(String((n=e.node.code)!=null?n:"")))});return()=>Te("div",{class:"d2-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))",boxShadow:"var(--ms-shadow-subtle)"},"data-markstream-d2":"1","data-markstream-mode":"pending"},[e.showHeader?Te("div",{class:"d2-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)"}},[Te("div",{class:"flex items-center gap-x-2"},[Te("span",{class:"d2-label font-medium font-mono",style:{fontSize:"var(--ms-text-label)",color:"var(--code-action-fg)"}},"D2")]),Te("div",{class:"d2-header-actions flex items-center","aria-hidden":"true"})]):null,Te("div",{class:"d2-block-body",style:{minHeight:`${t.value}px`}})])}}),eR={class:"m-0 p-0"},tR=["data-probe"],nR=mt(Ve(lt(Ae({},{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(r){var i,o;return(o=(i=t.headingNodes)==null?void 0:i[r])!=null?o:null}return(r,i)=>(J(),he("div",{class:"height-estimation-probes",style:Yr({width:`${e.width}px`}),"aria-hidden":"true"},[Re("div",{ref:o=>e.setParagraphWrapper(o),class:cn(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[xr(He(Ti),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),Re("div",{ref:o=>e.setListItemWrapper(o),class:cn(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[Re("ul",eR,[xr(He(po),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),Re("div",{ref:o=>e.setListWrapper(o),class:cn(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[xr(He(go),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(J(),he(Je,null,_t(6,o=>Re("div",{key:`probe-heading-${o}`,ref_for:!0,ref:l=>e.setHeadingWrapper(o,l),class:cn(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${o}`},[xr(He(ia),{node:n(o),"index-key":`probe-heading-${o}`},null,8,["node","index-key"])],10,tR)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),dd=Ve({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=L(()=>{var n,r;return Ku((r=ho(e.estimatedPreviewHeightPx))!=null?r:Hu(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Te("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?Te("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)"}},[Te("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Te("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Te("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Te("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},()=>Te("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,Te("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Te("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:"")),Te("div",{class:"absolute inset-0"},[Te("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),a1=Ve({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=L(()=>{var n,r;return Wu((r=ho(e.estimatedPreviewHeightPx))!=null?r:$u(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Te("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?Te("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)"}},[Te("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Te("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Te("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},()=>Te("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Te("span",{class:"action-icon block"})])))]):null,Te("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)"}},[Te("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:"")),Te("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"}})])])}}}),rR=Ve({name:"NodeRendererContent",props:["item","sourceNodes","fade","final","nestedRendererProps"],setup:e=>()=>Te(h1,{name:"fade",css:e.fade!==!1,appear:e.fade!==!1&&e.final!==!0},{default:()=>{const t=e.item;return t.rendersCustomNode?Te(t.component,Ae({key:0},t.customNodeProps),{default:()=>t.hasSlotChildren?Te(Gu,lt(Ae({key:0},e.nestedRendererProps),{nodes:t.node.children,indexKey:t.indexKey,batchRendering:!1,deferNodesUntilVisible:!1,renderAsFragment:!0})):t.slotContent?Te(Gu,lt(Ae({key:1},e.nestedRendererProps),{content:t.slotContent,final:!t.node.loading,indexKey:`${t.indexKey}-content`,smoothStreaming:!1,batchRendering:!1,deferNodesUntilVisible:!1,renderAsFragment:!0})):Gt("v-if",!0)}):Te(t.component,Ae({key:1},t.nodeProps))}})}),iR={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 Pt(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 oR=["data-custom-id"],lR=["data-node-index","data-node-type"],u1="typewriter-simple-cursor-target",Gu=mt(Ve(lt(Ae({},{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:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockOptions:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},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 r=e,i=n;function o(h){if(!(typeof Event<"u"&&h instanceof Event))return typeof h=="string"&&i("copy-code",h),void i("copy",h)}function l(h){i("handleArtifactClick",h)}function s(h){i("mouseover",h)}function a(h){i("mouseout",h)}const u=Bs(),c=Bt("markstreamNestedRendererProps",void 0);function p(h){const y=u==null?void 0:u.vnode.props;return!!y&&(Object.prototype.hasOwnProperty.call(y,h)||Object.prototype.hasOwnProperty.call(y,String(h).replace(/[A-Z]/g,x=>`-${x.toLowerCase()}`)))}function d(h){var y,x;const w=r[h];return p(h)?w:(x=(y=c==null?void 0:c.value)==null?void 0:y[h])!=null?x:w}const f=L(()=>{return(h=d("mode"))==="chat"||h==="minimal"||h==="docs"?h:"docs";var h}),g=L(()=>eC(d("typewriter"))),m=L(()=>g.value!=="off"),A=L(()=>d("domMode")==="minimal"?"minimal":"full"),v=L(()=>d("renderCodeBlocksAsPre")===!0),k=L(()=>iR[f.value]),C=L(()=>{var h;return(h=d("showTooltips"))!=null?h:k.value.showTooltips}),b=L(()=>{var h;return(h=d("fade"))!=null?h:k.value.fade}),S=L(()=>{var h;return(h=d("batchRendering"))!=null?h:k.value.batchRendering}),T=L(()=>{var h;return(h=d("initialRenderBatchSize"))!=null?h:k.value.initialRenderBatchSize}),M=L(()=>{var h;return(h=d("renderBatchSize"))!=null?h:k.value.renderBatchSize}),E=L(()=>{var h;return(h=d("renderBatchDelay"))!=null?h:k.value.renderBatchDelay}),$=L(()=>{var h;return(h=d("renderBatchBudgetMs"))!=null?h:k.value.renderBatchBudgetMs}),X=L(()=>{var h;return(h=d("renderBatchIdleTimeoutMs"))!=null?h:k.value.renderBatchIdleTimeoutMs}),K=L(()=>{var h;return(h=d("deferNodesUntilVisible"))!=null?h:k.value.deferNodesUntilVisible}),I=L(()=>{var h;return(h=d("maxLiveNodes"))!=null?h:k.value.maxLiveNodes}),B=L(()=>{var h;return(h=d("liveNodeBuffer"))!=null?h:k.value.liveNodeBuffer}),P=L(()=>{var h;return(h=d("nodeVirtual"))!=null?h:k.value.nodeVirtual}),_={get content(){return r.content},get nodes(){return r.nodes},get final(){return r.final},get parseOptions(){return d("parseOptions")},get customMarkdownIt(){return d("customMarkdownIt")},get debugPerformance(){return r.debugPerformance},get customHtmlTags(){return d("customHtmlTags")},get mode(){return d("mode")},get domMode(){return A.value},get htmlPolicy(){return d("htmlPolicy")},get viewportPriority(){return d("viewportPriority")},get viewportPriorityOptions(){return d("viewportPriorityOptions")},get codeBlockStream(){return d("codeBlockStream")},get codeBlockDarkTheme(){return d("codeBlockDarkTheme")},get codeBlockLightTheme(){return d("codeBlockLightTheme")},get codeBlockMinWidth(){return d("codeBlockMinWidth")},get codeBlockMaxWidth(){return d("codeBlockMaxWidth")},get codeBlockOptions(){return d("codeBlockOptions")},get codeBlockProps(){return d("codeBlockProps")},get mermaidProps(){return d("mermaidProps")},get d2Props(){return d("d2Props")},get infographicProps(){return d("infographicProps")},get showTooltips(){return C.value},get themes(){return d("themes")},get isDark(){return d("isDark")},get customId(){return d("customId")},get indexKey(){return r.indexKey},get typewriter(){return d("typewriter")},get smoothStreaming(){return r.smoothStreaming},get smoothStreamingOptions(){return d("smoothStreamingOptions")},get parseCoalesceMs(){return d("parseCoalesceMs")},get fade(){return b.value},get batchRendering(){return S.value},get initialRenderBatchSize(){return T.value},get renderBatchSize(){return M.value},get renderBatchDelay(){return E.value},get renderBatchBudgetMs(){return $.value},get renderBatchIdleTimeoutMs(){return X.value},get deferNodesUntilVisible(){return K.value},get maxLiveNodes(){return I.value},get liveNodeBuffer(){return B.value},get nodeVirtual(){return P.value},get virtualScroll(){return r.virtualScroll},get renderAsFragment(){return r.renderAsFragment}};function W(h){i("height-change",h)}function z(h){i("virtual-state-change",h)}function N(h){i("anchor-change",h)}const R=be(),oe=be(null),ne=be(null),ee=be(null),ie=Ra({1:null,2:null,3:null,4:null,5:null,6:null}),G=be(!1),Q=new Map,te=be(0);let re=!1;const pe=be(0),ce=be({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function Ce(h,y){return typeof h!="string"?y:h.trim()||y}function ze(h){const y=Number(h);return Number.isFinite(y)&&y>0?Math.max(1,Math.trunc(y)):640}const Ne=L(()=>{var h;const y=(h=_.viewportPriorityOptions)!=null?h:{},x=Ce(y.rootMargin,Ao);return{rootMargin:x,heavyBlockMargin:Ce(y.heavyBlockMargin,x),maxTargets:ze(y.maxTargets)}}),Ze=L(()=>{var h;return(h=Ne.value.rootMargin)!=null?h:Ao}),st=L(()=>{var h;return(h=Ne.value.maxTargets)!=null?h:640});function Ke(){var h,y;if(((h=r.virtualScroll)==null?void 0:h.enabled)!==!0)return null;const x=(y=r.virtualScroll)==null?void 0:y.scrollRoot;return St(typeof x=="function"?x():x)}function St(h){return h?typeof HTMLElement<"u"&&h instanceof HTMLElement?h:typeof h=="object"&&"value"in h?St(h.value):typeof h=="object"&&"$el"in h?St(h.$el):null:null}Ut(Yy,Ne);const{isClient:Pe,renderAsFragment:Ft,debugPerformanceEnabled:vn,resolvedShowTooltips:Vt,resolvedHtmlPolicy:fr,inheritedSmoothStreaming:Lr,ownsTypewriterCursor:Ar}=(function(h){const y=typeof window<"u",x=Al(),w=Bt("markstreamHtmlPolicy",void 0),F=Bt("markstreamTypewriterCursor",void 0),D=Bt("markstreamSmoothStreaming",void 0),H=L(()=>h.renderAsFragment===!0),O=L(()=>!!(h.debugPerformance&&y&&typeof console<"u")),q=L(()=>{var de;if(typeof h.showTooltips=="boolean")return h.showTooltips;const se=(de=x.showTooltips)!=null?de:x["show-tooltips"];return se===""||se===!0||se==="true"||se!==!1&&se!=="false"&&void 0}),j=L(()=>{var de,se;return(se=(de=h.htmlPolicy)!=null?de:w==null?void 0:w.value)!=null?se:"safe"}),ue=L(()=>(F==null?void 0:F.value)!==!0);return{isClient:y,renderAsFragment:H,debugPerformanceEnabled:O,resolvedShowTooltips:q,resolvedHtmlPolicy:j,inheritedSmoothStreaming:D,inheritedTypewriterCursor:F,ownsTypewriterCursor:ue}})(_),{resolveViewportRoot:$n,resolveScrollContainer:Hn,isReverseFlexScrollRoot:It,getNormalizedScrollTop:Dt,getOffsetTopWithinRoot:Ht}=(function(h,y){function x(){var O,q;return(q=(O=y.scrollRoot)==null?void 0:O.call(y))!=null?q:null}function w(O){if(typeof window>"u")return null;const q=x();if(q)return q;const j=O??h.value;if(!j)return null;const ue=j.ownerDocument||document,de=ue.scrollingElement||ue.documentElement;let se=j;for(;se&&se!==ue.body&&se!==de;){if(X4(window.getComputedStyle(se))&&q4(se))return se;se=se.parentElement}return null}function F(O){if(!y.isClient)return!1;try{const q=window.getComputedStyle(O);return!!(q.display||"").toLowerCase().includes("flex")&&(q.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function D(O,q,j){var ue,de;if(j)return H(q);const se=O.scrollTop;if(!F(O))return se;const Y=se<0?-se:se;return Math.max(0,((ue=O.scrollHeight)!=null?ue:0)-((de=O.clientHeight)!=null?de:0))-Y}function H(O){var q,j,ue,de,se;const Y=Number((q=O.scrollingElement)==null?void 0:q.scrollTop),V=Number((ue=(j=O.documentElement)==null?void 0:j.scrollTop)!=null?ue:0),U=Number((se=(de=O.body)==null?void 0:de.scrollTop)!=null?se:0);return Math.max(0,Number.isFinite(Y)?Y:0,Number.isFinite(V)?V:0,Number.isFinite(U)?U:0)}return{resolveViewportRoot:w,resolveScrollContainer:function(O){var q,j,ue,de;const se=x();if(se)return se;const Y=w((q=O??h.value)!=null?q:null);if(Y)return Y;const V=(de=(ue=O==null?void 0:O.ownerDocument)!=null?ue:(j=h.value)==null?void 0:j.ownerDocument)!=null?de:typeof document<"u"?document:null;return(V==null?void 0:V.scrollingElement)||(V==null?void 0:V.documentElement)||null},isReverseFlexScrollRoot:F,getNormalizedScrollTop:D,getOffsetTopWithinRoot:function(O,q){const j=q.ownerDocument||O.ownerDocument||document;if((function(Y,V){return Y===V.documentElement||Y===V.body||Y===V.scrollingElement})(q,j))return O.getBoundingClientRect().top+H(j);const ue=q.getBoundingClientRect(),de=O.getBoundingClientRect(),se=D(q,j,!1);return de.top-ue.top+se}}})(R,{isClient:Pe,scrollRoot:Ke});Ut("markstreamShowTooltips",Vt),Ut("markstreamHtmlPolicy",fr),Ut("markstreamTypewriter",m),Ut("markstreamFade",L(()=>_.fade!==!1)),Ut("markstreamTypewriterCursor",L(()=>!0)),Ut("markstreamTextStreamState",Q),Ut("markstreamStreamVersion",te),Ut("markstreamParseOptions",L(()=>_.parseOptions)),Ut("markstreamCustomMarkdownIt",L(()=>_.customMarkdownIt));const{smoothStreamingEnabled:vr,renderContent:kn,requestedFinal:Wn,effectiveFinal:yt}=(function(h,y){const x=cC(lt(Ae(Ae({},J4),h.smoothStreamingOptions),{burstInitialContent:!Y0(h.typewriter)})),w=L(()=>{var se,Y,V;return h.smoothStreaming!==!1&&!((se=h.nodes)!=null&&se.length)&&(h.smoothStreaming===!0||!((Y=y.inheritedSmoothStreaming)!=null&&Y.value))&&(h.smoothStreaming===!0||Y0(h.typewriter)||((V=h.maxLiveNodes)!=null?V:0)<=0)}),F=be(!y.isClient||h.smoothStreaming===!0);Jg(()=>{F.value=!0});const D=L(()=>F.value&&w.value),H=L(()=>{var se;return D.value?x.visible.value:(se=h.content)!=null?se:""}),O=L(()=>{var se,Y;const V=(se=h.parseOptions)!=null?se:{};return(Y=h.final)!=null?Y:V.final}),q=L(()=>{const se=O.value;return D.value&&se!=null?!!se&&x.caughtUp.value:se});let j=0,ue=!1;function de(){j=0,ue=!1}return Ie([()=>h.content,()=>h.nodes,D,O],([se,Y,V,U])=>{if(Y!=null&&Y.length)return de(),void x.reset("");const ae=se??"";if(!V)return de(),x.reset(ae),void(U&&x.finish({flush:!0}));const fe=x.source.value;if(ae){if(ae!==fe)if(ae.startsWith(fe)){const ge=ae.slice(fe.length),ke=x.pendingChars.value;ge.length<=8?(j++,ue||j>=2&&ke<=8?(ue=!0,x.reset(ae,{prefixKnown:!0})):x.enqueue(ge)):(de(),x.enqueue(ge))}else de(),x.reset(ae)}else de(),x.reset("");U&&x.finish()},{immediate:!0}),{smoothStream:x,smoothStreamingEligible:w,smoothStreamingEnabled:D,renderContent:H,requestedFinal:O,effectiveFinal:q}})(_,{isClient:Pe,inheritedSmoothStreaming:Lr}),rt=Wn.value===!0;Ut("markstreamSmoothStreaming",vr);const ot=be(!1),Ct=be(!1),jt=be(!1);let qt="",pt=!1,tt=null;function xe(){Pe&&tt!=null&&(window.clearTimeout(tt),tt=null)}function Le(){ot.value=!1,xe()}function nt(h,y){if(!vn.value)return;const x=(function(){if(!vn.value)return null;const w=Ge(Xe),F=Ge(at),D=Math.max(it,F);if(w<=0&&D<=0)return null;const H={total:w,maxPerFrame:D,byLabel:(O=Xe,Object.fromEntries(Array.from(O.entries()).sort((q,j)=>j[1]-q[1]||q[0].localeCompare(j[0]))))};var O;return Xe.clear(),at.clear(),it=0,H})();console.info(`[markstream-vue][perf] ${h}`,x?lt(Ae({},y),{layoutReads:x}):y)}Ie([()=>_.indexKey,()=>_.customId],()=>{var h,y;Le(),Ct.value=!1,jt.value=!((h=r.nodes)!=null&&h.length)&&Wn.value!==!0&&!!r.content,qt=(y=kn.value)!=null?y:"",pt=qt.length>0},{flush:"sync"}),Ie([()=>r.content,()=>r.nodes,Wn],([h,y,x])=>{!(y!=null&&y.length)&&x!==!0&&h&&(jt.value=!0)},{flush:"sync",immediate:!0}),Ie([kn,()=>r.nodes,yt],([h,y,x])=>{const w=h??"";return y!=null&&y.length||x===!0?(Le(),Ct.value=!1,qt=w,void(pt=!0)):(w.length>0&&(jt.value=!0),pt?(qt&&w.length>qt.length&&w.startsWith(qt)?(ot.value=!0,Ct.value=!0,Pe&&(xe(),tt=window.setTimeout(()=>{var F;tt=null,yt.value===!0||(F=r.nodes)!=null&&F.length||(Oo(),ot.value=!1,fi())},1200))):(w.length<qt.length||!w.startsWith(qt))&&(Le(),Ct.value=!1),void(qt=w)):(qt=w,void(pt=!0)))},{flush:"sync",immediate:!0});const Xe=new Map,at=new Map;let tn=!1,it=0;function Ge(h){let y=0;for(const x of h.values())y+=x;return y}function ut(){it=Math.max(it,Ge(at)),at.clear(),tn=!1}function Et(h){h.maxPerFrame=Math.max(Number(h.maxPerFrame||0),Number(h.currentFrameTotal||0)),h.currentFrameTotal=0,h.frameScheduled=!1}function Jt(h){var y,x;vn.value&&(Xe.set(h,((y=Xe.get(h))!=null?y:0)+1),at.set(h,((x=at.get(h))!=null?x:0)+1),(function(w){const F=(function(){if(!Pe||typeof window>"u")return null;const D=window;if(D.__markstreamLayoutReadPerformance)return D.__markstreamLayoutReadPerformance;const H={total:0,maxPerFrame:0,byLabel:{}};return D.__markstreamLayoutReadPerformance=H,H})();F&&(F.total=Number(F.total||0)+1,F.byLabel[w]=Number(F.byLabel[w]||0)+1,F.currentFrameTotal=Number(F.currentFrameTotal||0)+1,F.frameScheduled||(F.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>Et(F),0):queueMicrotask(()=>Et(F)):window.requestAnimationFrame(()=>Et(F))))})(h),tn||(tn=!0,Pe&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(ut):typeof queueMicrotask!="function"?setTimeout(ut,0):queueMicrotask(ut)))}function Ee(h,y){return Jt(h),y()}const nn=_.customId?`renderer-${_.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,qe=(function(h){const y=new Map;return{scope:h,cache:y,clear:()=>y.clear()}})(nn),At=nn;Ut(tC,qe);const Mt=sn(()=>_.customId),{effectiveCustomHtmlTagsSet:an,mdInstance:bt,mergedParseOptions:er,parsedNodes:me,getParsedNodesDirtyStartIndex:ei,getParsedNodesRevision:tr}=Y4(_,{instanceMsgId:nn,renderContent:kn,effectiveFinal:yt,smoothStreamingEnabled:vr,debugPerformanceEnabled:vn,customComponentsMap:Mt,logPerf:nt});Ie(me,()=>{ot.value||qe.clear(),te.value+=1,re&&ir(Bl(me.value.length))},{immediate:!0});const Wt=L(()=>({customId:_.customId,customHtmlTags:er.value.customHtmlTags,parseOptions:_.parseOptions,customMarkdownIt:_.customMarkdownIt,htmlPolicy:fr.value,viewportPriority:_.viewportPriority,viewportPriorityOptions:Ne.value,mode:f.value,domMode:_.domMode,codeBlockStream:_.codeBlockStream,codeBlockDarkTheme:_.codeBlockDarkTheme,codeBlockLightTheme:_.codeBlockLightTheme,renderCodeBlocksAsPre:v.value,codeBlockMinWidth:_.codeBlockMinWidth,codeBlockMaxWidth:_.codeBlockMaxWidth,codeBlockOptions:_.codeBlockOptions,codeBlockProps:_.codeBlockProps,mermaidProps:_.mermaidProps,d2Props:_.d2Props,infographicProps:_.infographicProps,showTooltips:Vt.value,themes:_.themes,isDark:_.isDark,typewriter:m.value,smoothStreamingOptions:_.smoothStreamingOptions,parseCoalesceMs:_.parseCoalesceMs,fade:_.fade}));Ut("markstreamNestedRendererProps",Wt);const Hi=L(()=>me.value),Or=L(()=>me.value.length),ti=be(null),ni=be(null),ri=be(null),nr=be(null),kr=r.indexKey!=null&&String(r.indexKey).startsWith("list-item-"),Pr=!kr&&_.customId?W0(_.customId):null,Z=L(()=>Pr?(Va.value,W0(_.customId)):null),Be=L(()=>{var h;return!!(!Ft.value&&_.customId&&!kr&&((h=Z.value)!=null&&h.enabled))}),ye=L(()=>!!(Pe&&Be.value)),ve=L(()=>{var h;return!!(!Ft.value&&((h=r.virtualScroll)!=null&&h.enabled))}),Ue=L(()=>ve.value),et=be(!1);Jg(()=>{et.value=!0});const Fe=L(()=>!!(Pe&&ve.value));Ut("markstreamHostScrollManaged",Fe);const Oe=L(()=>!!(et.value&&Fe.value)),$e=L(()=>ye.value||Fe.value);Ie($e,h=>{h&&Xy()},{immediate:!0});const ct=L(()=>ye.value||Oe.value),yn=L(()=>{var h;return $e.value&&((h=Z.value)==null?void 0:h.textEstimation)!==!1});function Tt(){if(pe.value>0)return pe.value;const h=Ee("getMeasuredContainerWidth.clientWidth",()=>{var y;return((y=R.value)==null?void 0:y.clientWidth)||0});return Number.isFinite(h)&&h>0?h:0}const Tn=L(()=>{const h=Tt();return h>0?Math.max(1,Math.round(h)):640}),Kn=L(()=>{var h,y;return!(yt.value!==!0||ve.value||f.value!=="chat"&&f.value!=="minimal"||p("maxLiveNodes")||p("liveNodeBuffer")||(h=r.nodes)!=null&&h.length||jt.value||!(((y=_.maxLiveNodes)!=null?y:0)<=0))}),Sr=L(()=>{var h;return Kn.value?50:Math.max(1,(h=_.maxLiveNodes)!=null?h:320)}),Bn=L(()=>{var h;return Kn.value?16:Math.max(0,(h=_.liveNodeBuffer)!=null?h:60)}),We=L(()=>{var h;return!Ft.value&&_.nodeVirtual!==!1&&!(((h=_.maxLiveNodes)!=null?h:0)<=0&&!Kn.value)&&(_.nodeVirtual===!0?me.value.length>0:me.value.length>Sr.value)}),bl=L(()=>We.value||ye.value||Fe.value),cc=L(()=>_.viewportPriority!==!1),hC=L(()=>!!cc.value&&!G.value);var vp;vp=L(()=>cc.value),Ut(Zy,vp);const kp=L(()=>{var h;return!(Ft.value||_.deferNodesUntilVisible===!1||((h=_.maxLiveNodes)!=null?h:0)<=0||We.value||me.value.length>900||_.viewportPriority===!1)}),Wi=AD(h=>{var y,x;return $n((x=(y=h==null?void 0:h.parentElement)!=null?y:R.value)!=null?x:null)},cc),{requestFrame:Cn,cancelFrame:jn,hasIdleCallback:pC,isTestEnv:oa}=(function(h){const y=h.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,x=h.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,w=h.isClient&&typeof window.requestIdleCallback=="function",F=(function(){var D;if(typeof globalThis>"u"||!("process"in globalThis))return;const H=(D=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:D.value;return H==null?void 0:H.env})();return{requestFrame:y,cancelFrame:x,hasIdleCallback:w,isTestEnv:(F==null?void 0:F.NODE_ENV)==="test"}})({isClient:Pe}),yp=L(()=>yt.value===!0&&!ve.value),{resolvedBatchSize:fc,resolvedInitialBatch:Co,batchingEnabled:gC,incrementalRenderingActive:dc,renderedCount:dr,previousRenderContext:mC,adaptiveBatchSize:AC,previousBatchConfig:vC}=(function(h,y){var x;const w=L(()=>{var de;const se=Math.trunc((de=h.renderBatchSize)!=null?de:80);return Number.isFinite(se)?Math.max(0,se):0}),F=L(()=>{var de;const se=Math.trunc((de=h.initialRenderBatchSize)!=null?de:w.value);return Number.isFinite(se)?Math.max(0,se):w.value}),D=L(()=>!y.renderAsFragment.value&&h.batchRendering!==!1&&w.value>0&&y.isClient&&!y.isTestEnv),H=be(0),O=be({key:h.indexKey,total:0}),q=be(Math.max(1,w.value||1)),j=L(()=>{var de,se,Y;return D.value&&!((de=y.continuousStreaming)!=null&&de.value)&&!((se=y.forceFullRenderFinalContent)!=null&&se.value)&&((Y=h.maxLiveNodes)!=null?Y:0)<=0}),ue=be({batchSize:w.value,initial:F.value,delay:(x=h.renderBatchDelay)!=null?x:16,enabled:j.value});return{resolvedBatchSize:w,resolvedInitialBatch:F,batchingEnabled:D,incrementalRenderingActive:j,renderedCount:H,previousRenderContext:O,adaptiveBatchSize:q,previousBatchConfig:ue}})(_,{isClient:Pe,isTestEnv:oa,renderAsFragment:Ft,forceFullRenderFinalContent:yp,continuousStreaming:L(()=>Ct.value&&yt.value!==!0)}),hc=L(()=>{var h;return!Ft.value&&_.batchRendering!==!1&&fc.value>0&&!oa&&((h=_.maxLiveNodes)!=null?h:0)<=0&&!yp.value}),kC=L(()=>hc.value),Cp=L(()=>$e.value||kC.value),bp=L(()=>{var h;return Cp.value&&((h=Z.value)==null?void 0:h.codeBlockEstimation)!==!1}),zn=new Map,$r=new Map,xl=new Map,pc=new WeakMap;let Hr=null;const bo=[];Ie(()=>me.value.length,h=>{bo.length>h&&(bo.length=h)});const bn=[],la=[];let ii=[],wl=[],_l=-1;const xo=Oi(la),oi=new Set,xp=be(0);let sa=0;const wp=be(0),yC=L(()=>(wp.value,Array.from(zn.entries()).sort((h,y)=>h[0]-y[0]))),Sl=be(null),rr=be(null);let li,Ki=null,gc=0,Il=null;function ir(h){li.markFallbackHeightPrefixDirty(h)}function mc(h){return li.getFallbackNodeHeight(h)}function wo(h,y){return li.estimateHeightRange(h,y)}function Ac(h){return li.estimateIndexForOffset(h)}const{activeRestoreAnchor:ji,getRelativeScrollTopWithinContainer:CC,setRelativeScrollTopWithinContainer:bC,resolveAnchorOffset:xC,clearRestoreReconcile:El,scheduleRestoreReconcile:Ml,captureRestoreAnchor:_p,restoreAnchor:Sp,getAnchorDrift:wC}=(function(h){const{isClient:y,containerRef:x,parsedNodeCount:w,requestFrame:F,cancelFrame:D,resolveScrollContainer:H,getNormalizedScrollTop:O,getOffsetTopWithinRoot:q,isReverseFlexScrollRoot:j,estimateIndexForOffset:ue,estimateHeightRange:de,getFallbackNodeHeight:se,clamp:Y}=h,V=be(null);let U=null,ae=[];function fe(){const _e=H(),Se=x.value;if(!_e||!Se)return null;const Me=_e.ownerDocument||Se.ownerDocument||document;if(_e===Me.documentElement||_e===Me.body||_e===Me.scrollingElement){const Qe=Se.getBoundingClientRect();return Math.max(0,-Qe.top)}return Math.max(0,O(_e,Me,!1)-q(Se,_e))}function ge(_e){var Se;const Me=H(),Qe=x.value;if(!Me||!Qe)return;const Nt=Math.max(0,_e),Lt=Me.ownerDocument||Qe.ownerDocument||document,gn=Lt.defaultView||(typeof window<"u"?window:null);if(Me===Lt.documentElement||Me===Lt.body||Me===Lt.scrollingElement){const Ye=O(Me,Lt,!0)+Qe.getBoundingClientRect().top;return void((Se=gn==null?void 0:gn.scrollTo)==null||Se.call(gn,0,Math.max(0,Ye+Nt)))}Q0(Me,Lt,q(Qe,Me)+Nt,{isReverseFlexScrollRoot:Ye=>{var xt;return(xt=j==null?void 0:j(Ye))!=null&&xt},getNormalizedScrollTop:O})}function ke(_e){const Se=w.value,Me=Y(_e.nodeIndex,0,Math.max(0,Se-1));return de(0,Me)+Math.max(0,_e.offsetWithinNodePx)}function we(){if(U!=null&&(D==null||D(U),U=null),y)for(const _e of ae)window.clearTimeout(_e);ae=[]}function De(_e){const Se=ke(_e),Me=fe();Me!=null&&Math.abs(Me-Se)<=.5||ge(Se)}return{activeRestoreAnchor:V,getRelativeScrollTopWithinContainer:fe,setRelativeScrollTopWithinContainer:ge,resolveAnchorOffset:ke,clearRestoreReconcile:we,applyRestoreAnchor:De,scheduleRestoreReconcile:function(){V.value&&y&&U==null&&(U=F?F(()=>{U=null,V.value&&De(V.value)}):null,U==null&&V.value&&De(V.value))},captureRestoreAnchor:function(){const _e=fe(),Se=w.value;if(_e==null||Se<=0)return null;const Me=Y(ue(_e+1),0,Se-1),Qe=de(0,Me),Nt=se(Me);return{nodeIndex:Me,offsetWithinNodePx:Y(_e-Qe,0,Math.max(0,Nt-1))}},restoreAnchor:function(_e){const Se=w.value;if(V.value={nodeIndex:Y(_e.nodeIndex,0,Math.max(0,Se-1)),offsetWithinNodePx:Math.max(0,_e.offsetWithinNodePx)},we(),De(V.value),y)for(const Me of[0,120,280,480])ae.push(window.setTimeout(()=>{V.value&&De(V.value)},Me))},getAnchorDrift:function(_e){const Se=fe();return Se==null?null:Se-ke(_e)}}})({isClient:Pe,containerRef:R,parsedNodeCount:Or,requestFrame:Cn,cancelFrame:jn,resolveScrollContainer:()=>Sl.value||Hn(),getNormalizedScrollTop:Dt,getOffsetTopWithinRoot:Ht,isReverseFlexScrollRoot:It,estimateIndexForOffset:Ac,estimateHeightRange:wo,getFallbackNodeHeight:mc,clamp:pn}),{nodeHeights:_o,heightStats:Ir,heightTreeSize:Ip,heightSumTree:_C,heightKnownTree:SC,averageNodeHeight:IC,resetHeightMeasurements:EC,pruneHeightMeasurements:MC,rebuildHeightTrees:vc,syncHeightTreeSize:TC,recordNodeHeight:BC,removeNodeHeights:FC,exportHeightCache:DC,importHeightCache:RC,fenwickRangeSum:NC}=(function(h={}){const y=Ra({}),x=Ra({total:0,count:0}),w=be(0),F=be([]),D=be([]);function H(){for(const Y of Object.keys(y))delete y[Number(Y)];x.total=0,x.count=0,w.value=0,F.value=[],D.value=[]}function O(Y,V,U){for(let ae=V+1;ae<Y.length;ae+=ae&-ae)Y[ae]+=U}function q(Y,V){let U=0;for(let ae=V+1;ae>0;ae-=ae&-ae)U+=Y[ae];return U}function j(Y,V,U){if(U<=V)return 0;const ae=q(Y,U-1);return V<=0?ae:ae-q(Y,V-1)}function ue(Y){w.value=Y;const V=new Array(Y+1).fill(0),U=new Array(Y+1).fill(0);for(const[ae,fe]of Object.entries(y)){const ge=Number(ae),ke=Number(fe);!Number.isFinite(ge)||ge<0||ge>=Y||!Number.isFinite(ke)||ke<=0||(O(V,ge,ke),O(U,ge,1))}F.value=V,D.value=U}function de(Y){if(!Number.isInteger(Y)||Y<0)return!1;const V=y[Y];if(!Number.isFinite(V)||V<=0)return!1;if(delete y[Y],x.total=Math.max(0,x.total-V),x.count=Math.max(0,x.count-1),w.value>Y){const U=F.value,ae=D.value;U.length&&ae.length&&(O(U,Y,-V),O(ae,Y,-1))}return!0}const se=L(()=>x.count>0?Math.max(12,x.total/x.count):32);return{nodeHeights:y,heightStats:x,heightTreeSize:w,heightSumTree:F,heightKnownTree:D,averageNodeHeight:se,resetHeightMeasurements:H,pruneHeightMeasurements:function(Y){if(Y<=0)return void H();let V=0,U=0;for(const[ae,fe]of Object.entries(y)){const ge=Number(ae),ke=Number(fe);!Number.isFinite(ge)||ge<0||ge>=Y||!Number.isFinite(ke)||ke<=0?delete y[ge]:(V+=ke,U++)}x.total=V,x.count=U},rebuildHeightTrees:ue,syncHeightTreeSize:function(Y){const V=w.value;if(Y===V)return;if(Y<V||V===0)return void ue(Y);const U=F.value,ae=D.value;U.length=Y+1,ae.length=Y+1;for(let fe=V;fe<Y;fe++)U[fe+1]=0,ae[fe+1]=0;for(let fe=V;fe<Y;fe++){const ge=Number(y[fe]);!Number.isFinite(ge)||ge<=0||(O(U,fe,ge),O(ae,fe,1))}for(let fe=V+1;fe<=Y;fe++){const ge=fe-(fe&-fe);ge>=V||(U[fe]+=j(U,ge,V),ae[fe]+=j(ae,ge,V))}w.value=Y},recordNodeHeight:function(Y,V,U={}){(function(ae,fe,ge={}){var ke;if(!Number.isFinite(fe)||fe<=0)return!1;const we=y[ae];if(we&&(ge.allowShrink===!1&&fe<we||Math.abs(fe-we)<=1))return!1;if(y[ae]=fe,we?x.total+=fe-we:(x.total+=fe,x.count++),w.value>ae){const De=F.value,_e=D.value;if(De.length&&_e.length)if(we){const Se=fe-we;Se!==0&&O(De,ae,Se)}else O(De,ae,fe),O(_e,ae,1)}ge.notify!==!1&&((ke=h.onHeightRecorded)==null||ke.call(h,ae))})(Y,V,lt(Ae({},U),{notify:!0}))},removeNodeHeight:function(Y,V={}){var U;const ae=de(Y);return ae&&V.notify!==!1&&((U=h.onHeightRecorded)==null||U.call(h,Y)),ae},removeNodeHeights:function(Y,V={}){var U;let ae=0,fe=Number.POSITIVE_INFINITY;for(const ge of Y){const ke=Number(ge);de(ke)&&(ae++,ke<fe&&(fe=ke))}return ae>0&&V.notify!==!1&&((U=h.onHeightRecorded)==null||U.call(h,Number.isFinite(fe)?fe:void 0)),ae},exportHeightCache:function(){return Object.entries(y).map(([Y,V])=>({index:Number(Y),height:Number(V)})).filter(Y=>Number.isFinite(Y.index)&&Y.index>=0&&Number.isFinite(Y.height)&&Y.height>0).sort((Y,V)=>Y.index-V.index)},importHeightCache:function(Y,V={}){var U;if(!Array.isArray(Y))return;const ae=w.value;let fe=!1;if(V.mode!=="merge"){const ge=Object.keys(y);if(ge.length>0){for(const ke of ge)delete y[Number(ke)];fe=!0}}for(const ge of Y){const ke=Number(ge.index),we=Number(ge.height);if(!Number.isInteger(ke)||ke<0||ae>0&&ke>=ae||!Number.isFinite(we)||we<=0)continue;const De=y[ke];De&&Math.abs(De-we)<=1||(y[ke]=we,fe=!0)}fe&&((function(){let ge=0,ke=0;const we=w.value;for(const[De,_e]of Object.entries(y)){const Se=Number(De),Me=Number(_e);!Number.isFinite(Se)||Se<0||we>0&&Se>=we||!Number.isFinite(Me)||Me<=0?delete y[Se]:(ge+=Me,ke++)}x.total=ge,x.count=ke})(),ae>0&&ue(ae),(U=h.onHeightRecorded)==null||U.call(h))},fenwickRangeSum:j}})({onHeightRecorded:h=>{ir(h??0),Fe.value&&Ql(),ji.value&&Ml(),rr.value&&Do(),Rt("node-resize")}});function Ep(h){Number.isInteger(h)&&h>=0&&oi.add(h)}function Mp(h){for(const y of h)Ep(Number(y))}function So(h){sa++;let y=!0;try{const x=h();return y=x!==!1,x}finally{sa--,sa===0&&y&&xp.value++}}function kc(){ii=[],wl=[],_l=-1,oi.clear(),xo.value=la}function aa(){kc(),So(()=>EC()),bn.length=0}function Tp(h){!Number.isInteger(h)||h<0||h>=me.value.length||(bn[h]=Nl(h))}function Bp(h,y,x={}){const w=_o[h];Ep(h),BC(h,y,x);const F=_o[h];return Object.is(w,F)?(oi.delete(h),!1):(F&&F>0?Tp(h):w&&h<bn.length&&(bn[h]=void 0),!0)}function yc(h,y){const x=Ee("getNodeLayoutHeight.content.offsetHeight",()=>y.offsetHeight);return x>0?x:Ee("getNodeLayoutHeight.slot.offsetHeight",()=>{var w,F;return(F=(w=zn.get(h))==null?void 0:w.offsetHeight)!=null?F:0})}function Fp(h,y={}){y.mode!=="merge"?kc():Mp(h.map(x=>x.index)),So(()=>RC(h,y)),Zc()}const hr=L(()=>kp.value&&hC.value),ua=L(()=>$e.value||hc.value||hr.value&&me.value.length>Co.value),LC=L(()=>{var h;return!Ft.value&&_.batchRendering!==!1&&fc.value>0&&((h=_.maxLiveNodes)!=null?h:0)<=0}),OC=L(()=>!Ft.value&&rt&&yt.value===!0&&!We.value&&!ve.value&&!Be.value&&!hr.value&&!LC.value),Cc=L(()=>!!Wi&&hr.value),Io=L(()=>[Cc.value,hr.value,We.value,G.value,st.value,Ze.value,Co.value,!!Wi].join("|")),Dp=L(()=>We.value||Fe.value),{focusIndex:Wr,liveRange:hn,updateLiveRange:Tl}=(function(h,y){const{parsedNodeCount:x,virtualizationEnabled:w,maxLiveNodesResolved:F,liveNodeBufferResolved:D,clamp:H}=y,O=D??L(()=>{var ue;return Math.max(0,(ue=h.liveNodeBuffer)!=null?ue:60)}),q=be(0),j=Ra({start:0,end:0});return{liveNodeBufferResolved:O,focusIndex:q,liveRange:j,updateLiveRange:function(){const ue=x.value;if(!w.value||ue===0)return j.start=0,void(j.end=ue);const de=Math.min(F.value,ue),se=O.value,Y=H(q.value-se,0,Math.max(0,ue-de));j.start=Y,j.end=Math.min(ue,Y+de)}}})(_,{parsedNodeCount:Or,virtualizationEnabled:We,maxLiveNodesResolved:Sr,liveNodeBufferResolved:Bn,clamp:pn}),yr=new Map,zi=new Map,ca=new Map,si=new Map,fa=[],Kr=new Map;let Rp=-1/0;const ai=new Set,Np=be(0);let bc=!1;const Lp=L(()=>(Np.value,ai.size)),Gn=new Map,Er=new Map,Op=be(0);let ui=0;const xc=L(()=>(Op.value,ui));let or=null;const da=L(()=>{if(!We.value)return me.value.length;const h=Bn.value,y=Math.max(hn.end+h,Co.value),x=Math.min(me.value.length,y);return Math.max(dr.value,x)});function ha(){bc||(bc=!0,queueMicrotask(()=>{bc=!1,Np.value+=1}))}function Pp(h,y,x="node-resize"){if(!Pe||typeof window>"u")return null;const w=window.setTimeout(()=>{ai.delete(w)&&ha();try{y()}finally{Rt(x)}},Math.max(0,h));return ai.add(w),ha(),w}function pa(h){Pe&&h!=null&&(ai.delete(h)&&ha(),window.clearTimeout(h))}function $p(){if(Pe&&typeof window<"u")for(const h of ai)window.clearTimeout(h);ai.size&&(ai.clear(),ha()),fa.length=0,si.clear()}function PC(h){oe.value=h}function $C(h){ne.value=h}function HC(h){ee.value=h}const{cancelScheduledFocusSync:wc,scheduleFocusSync:Cr}=(function(h){const{isClient:y,containerRef:x,virtualizationEnabled:w,requestFrame:F,cancelFrame:D,syncFocusToScroll:H}=h;let O=null;function q(){var ue,de,se;return(se=(de=(ue=x.value)==null?void 0:ue.ownerDocument)==null?void 0:de.defaultView)!=null?se:typeof window<"u"?window:null}function j(){if(!O)return;const ue=q();O.viaTimeout?ue?ue.clearTimeout(O.id):clearTimeout(O.id):D==null||D(O.id),O=null}return{cancelScheduledFocusSync:j,scheduleFocusSync:function(ue={}){if(!w.value)return;if(!y)return void H(!0);if(ue.immediate)return j(),void H(!0);if(O)return;const de=()=>{O=null,H()};if(F)return void(O={id:F(de),viaTimeout:!1});const se=q();O={id:se?se.setTimeout(de,16):setTimeout(de,16),viaTimeout:!0}}}})({isClient:Pe,containerRef:R,virtualizationEnabled:We,requestFrame:Cn,cancelFrame:jn,syncFocusToScroll:function(h=!1){var y;if(!We.value)return;const x=Sl.value||Hn();if(!x)return;const w=x.ownerDocument||((y=R.value)==null?void 0:y.ownerDocument)||document,F=(w==null?void 0:w.defaultView)||(typeof window<"u"?window:null),D=x===(w==null?void 0:w.documentElement)||x===(w==null?void 0:w.body),H=me.value.length;if(H<=0)return;if(!D&&H>0&&It(x)){const U=Ee("syncFocusToScroll.clientHeight",()=>x.clientHeight||0),ae=Ee("syncFocusToScroll.scrollTop",()=>x.scrollTop),fe=ae<0?-ae:ae;return void Aa(pn((O=Math.max(0,fe)+.5*Math.max(0,U),li.estimateIndexForOffsetFromEnd(O)),0,Math.max(0,H-1)),h)}var O;const q=(function(U,ae,fe,ge){const ke=R.value;if(!ke)return null;const we=ge?0:Ee("syncFocusToScroll.model.root.getBoundingClientRect",()=>U.getBoundingClientRect().top),De=Ee("syncFocusToScroll.model.container.getBoundingClientRect",()=>ke.getBoundingClientRect().top),_e=Math.max(0,we-De),Se=ge?Ee("syncFocusToScroll.model.viewport.clientHeight",()=>{var Me,Qe,Nt,Lt;return(Lt=(Nt=(Qe=fe==null?void 0:fe.innerHeight)!=null?Qe:(Me=ae.documentElement)==null?void 0:Me.clientHeight)!=null?Nt:U.clientHeight)!=null?Lt:0}):Ee("syncFocusToScroll.model.root.clientHeight",()=>U.clientHeight);return pn(Ac(_e+.5*Math.max(0,Se)),0,Math.max(0,me.value.length-1))})(x,w,F,D);if(q!=null)return void Aa(q,h);const j=D?null:Ee("syncFocusToScroll.root.getBoundingClientRect",()=>x.getBoundingClientRect()),ue=D?0:j.top,de=D?Ee("syncFocusToScroll.viewport.clientHeight",()=>{var U,ae;return(ae=(U=F==null?void 0:F.innerHeight)!=null?U:x.clientHeight)!=null?ae:0}):j.bottom,se=yC.value;let Y=null,V=null;for(const[U,ae]of se){if(!ae)continue;const fe=Ee("syncFocusToScroll.slot.getBoundingClientRect",()=>ae.getBoundingClientRect());fe.bottom<=ue||fe.top>=de||(Y==null&&(Y=U),V=U)}if(Y==null||V==null){const U=R.value;if(!U)return;const ae=D?{top:0}:Ee("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>x.getBoundingClientRect()),fe=Ee("syncFocusToScroll.fallback.scrollTop",()=>Dt(x,w,D)),ge=D?(()=>{const we=Ee("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>U.getBoundingClientRect()),De=(D?0:ae.top)-we.top;return Math.max(0,De)})():(()=>{const we=Ht(U,x);return Math.max(0,fe-we)})(),ke=D?Ee("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var we,De,_e,Se;return(Se=(_e=(De=F==null?void 0:F.innerHeight)!=null?De:(we=w==null?void 0:w.documentElement)==null?void 0:we.clientHeight)!=null?_e:x.clientHeight)!=null?Se:0}):Ee("syncFocusToScroll.fallback.root.clientHeight",()=>x.clientHeight);return void Aa(pn(Ac(ge+.5*Math.max(0,ke)),0,Math.max(0,me.value.length-1)),!0)}Aa(Math.round((Y+V)/2),h)}}),{visibleNodeIndices:_c,nodeVisibilityHandles:Eo,nodeVisibilityWatchStops:ga,nodeVisibilityFallbackTimers:Hp,clearVisibilityFallback:ma,markNodeVisible:ci,cleanupNodeVisibility:WC,destroyNodeVisibilityState:Sc}=Z4({isClient:Pe,shouldTrackVisibleNodeIndices:()=>hr.value,shouldCleanupNodeVisibility:()=>We.value,onNodeMarkedVisible:h=>{We.value?Cr():Wr.value=pn(h,0,Math.max(0,me.value.length-1))},onNodeVisibilityCleaned:h=>{zn.delete(h)&&mg()}}),{cleanupScrollListener:Wp,setupScrollListener:KC}=V4({isClient:Pe,virtualizationEnabled:We,listenerEnabled:Dp,scrollRootElement:Sl,resolveScrollContainer:Hn,scheduleFocusSync:Cr,onScroll:function(){const h=rr.value;if(!h)return;const y=Dl();if(!y||(function(w){if(No()>=gc)return Il=null,!1;const F=Il;if(F==null)return!0;const D=Math.abs(w.scrollTop-F)<=2;return D||(Il=null),D})(y))return;const x=tg(y);x!=null?(x<-32||Math.abs(Math.max(0,x)-Math.max(0,h.distanceFromBottomPx))>32)&&Zi("restore"):Zi("restore")},requestFrame:Cn,cancelFrame:jn,getScrollTop:h=>{var y;const x=h.ownerDocument||((y=R.value)==null?void 0:y.ownerDocument)||document,w=h===x.documentElement||h===x.body||h===x.scrollingElement;return Ee("scrollListener.getScrollTop",()=>Dt(h,x,w))}});function Aa(h,y=!1){const x=pn(h,0,Math.max(0,me.value.length-1));!y&&Math.abs(x-Wr.value)<=1||(Wr.value=x,Tl())}function pn(h,y,x){return Math.min(Math.max(h,y),x)}function Bl(h=me.value.length){const y=ei();return!Number.isInteger(y)||y<0?h:pn(y,0,h)}function Ic(h){return h==null?void 0:h.firstElementChild}function Kp(h,y){var x;return h?(x=h.matches)!=null&&x.call(h,y)?h:h.querySelector(y):null}function jC(h,y){h<1||h>6||(ie[h]=y)}function jp(){if(!ua.value||typeof ResizeObserver>"u")return void(pe.value=0);const h=Ee("updateMeasuredContainerWidth.clientWidth",()=>{var y,x;return(x=(y=R.value)==null?void 0:y.clientWidth)!=null?x:0});pe.value=h>0?h:0}let Fl=null;function Ec(){Fl==null||Fl.disconnect(),Fl=null}const Mc=L(()=>v.value?ts:od);function zp(){var h;return((h=_.codeBlockProps)==null?void 0:h.showHeader)!==!1}function zC(){var h;return((h=_.codeBlockProps)==null?void 0:h.showCopyButton)!==!1}function Gp(){var h,y;const x=(h=_.codeBlockProps)==null?void 0:h.showLineNumbers;return typeof x=="boolean"?x:((y=_.codeBlockOptions)==null?void 0:y.disableLineNumbers)!==!0}function Qp(h,y,x){var w;const F=_o[y],D=typeof F=="number"&&F>0;if(yn.value&&!D&&!(function(H){return!!Mt.value.paragraph&&(H.type==="paragraph"||H.type==="list_item"||H.type==="list")})(h)){const H=qy(h,x,ce.value);if(H)return H}if(bp.value&&!D&&h.type==="code_block"){const H=(function(O){if(O.type!=="code_block")return null;const q=$g(O,Ia(O));return q===ts?"pre":q===Mc.value||q===od?"stream-diffs":null})(h);if(H==="stream-diffs"||H==="pre")return(function(O,q){if(!O||O.type!=="code_block")return null;const j=q.rendererKind,ue=j!=="pre"&&q.showHeader!==!1,de=j==="pre"&&q.showHeader!==!1,se=!!O.diff;let Y=0,V=500;if(j==="stream-diffs"){const ae=j0(O,q.diffStyle),fe=18,ge=(function(ke){return ke?0:16})(se);V=500,Y=Math.round(ae*fe+ge)}else{const ae=th(q.codeBlockOptions),fe=(function(ge,ke,we){var De,_e;const Se=j0(ge,ke.diffStyle),Me=Number(ke.width);if(we.overflow!=="wrap"||!Number.isFinite(Me)||Me<=0)return Se;const Qe=Math.max(1,.6*we.fontSize),Nt=!!ge.diff,Lt=Nt&&eh({diffStyle:ke.diffStyle});if(!Nt||Lt){const Ot=(Nt?ur(ge.raw)||[ur(ge.originalCode),ur(ge.updatedCode)].filter(Boolean).join(`
220
+ `):ur(ge.code,ge.loading===!0)).split(/\r\n|\n|\r/),to=z0(Me,Qe,Ot.length,we,ke,!1);return Ot.reduce((pi,en)=>pi+cd(en,to,we.tabSize),0)}const gn=ur(ge.originalCode).split(/\r\n|\n|\r/),Ye=ur(ge.updatedCode).split(/\r\n|\n|\r/);if(ge.originalCode==null&&ge.updatedCode==null)return Se;const xt=Math.max(gn.length,Ye.length),Kt=z0(Me,Qe,xt,we,ke,!0);let wt=0;for(let Ot=0;Ot<xt;Ot++)wt+=Math.max(cd((De=gn[Ot])!=null?De:"",Kt,we.tabSize),cd((_e=Ye[Ot])!=null?_e:"",Kt,we.tabSize));return wt})(O,q,ae);Y=Math.round(fe*ae.lineHeight+ae.padding+ae.paddingBottom),V=ae.maxHeight}const U=Math.max(1,Math.min(Y,V));return Ae({kind:"code-block",height:Math.round(U+(j==="pre"?de?37:0:ue?40:0)),contentHeight:U,rendererKind:j},se&&j==="stream-diffs"?{diffInline:eh({diffStyle:q.diffStyle})}:{})})(h,{rendererKind:H,codeBlockOptions:_.codeBlockOptions,showHeader:zp(),showLineNumbers:Gp(),width:x,diffStyle:(w=_.codeBlockOptions)==null?void 0:w.diffStyle})}return null}wb(()=>{if(xp.value,sa>0)return;const h=me.value,y=tr();if(!h.length||!Cp.value)return ii=[],wl=[],_l=-1,oi.clear(),void(xo.value=la);const x=pe.value||Ee("estimatedNodeHeights.clientWidth",()=>{var j;return((j=R.value)==null?void 0:j.clientWidth)||0});if(!Number.isFinite(x)||x<=0)return ii=[],wl=[],_l=-1,oi.clear(),void(xo.value=la);const w=(function(j){var ue,de;const se=th(_.codeBlockOptions);return[Math.round(j),yn.value,bp.value,ce.value,se.fontSize,se.lineHeight,se.fontFamily,se.padding,se.paddingBottom,se.maxHeight,se.tabSize,se.overflow,(de=(ue=_.codeBlockOptions)==null?void 0:ue.diffStyle)!=null?de:"split",Gp(),zp(),zC(),v.value,Mt.value,Va.value]})(x),F=ii.length<=h.length&&(H=w,(D=wl).length===H.length&&D.every((j,ue)=>Object.is(j,H[ue])));var D,H;const O=F&&_l===y?h.length:F?Bl(h.length):0,q=F?Array.from(oi):[];ii.length=h.length;for(let j=O;j<h.length;j++)ii[j]=Qp(h[j],j,x);for(const j of q)j>=0&&j<h.length&&j<O&&(ii[j]=Qp(h[j],j,x));oi.clear(),wl=w,_l=y,xo.value=ii,Mb(xo)},{flush:"sync"});const Gi=L(()=>xo.value);li=(function(h){let y=!0,x=-1;const w=[0];let F="",D=-1;const H=new WeakMap;function O(V=0){y=!0,V<=0?x=0:(x<0||V<x)&&(x=V)}function q(V){var U;const ae=h.nodeHeights[V];if(Number.isFinite(ae)&&ae>0)return ae;const fe=h.parsedNodes.value[V],ge=fe==null?void 0:fe.type,ke=!!((U=h.hasCustomParagraphComponent)!=null&&U.call(h)),we=h.estimatedNodeHeights.value[V],De=we==null?void 0:we.height;if(!(function(Se,Me,Qe){return!!(Qe&&(Me==null?void 0:Me.kind)==="simple-text"&&(Se==="paragraph"||Se==="list_item"||Se==="list"))})(ge,we,ke)&&Number.isFinite(De)&&De>0)return De;const _e=(function(Se,Me){var Qe;if(!Se||typeof Se!="object"||((Qe=h.shouldCacheStaticFallbackHeight)==null?void 0:Qe.call(h))===!1)return Z0(Se,Me);const Nt=Se,Lt=H.get(Nt);if(Lt&&Lt.width===Me)return Lt.height;const gn=Z0(Se,Me);return H.set(Nt,{width:Me,height:gn}),gn})(fe,h.getContainerWidth()||640);return ge==="heading"||ge==="paragraph"&&_e<=28&&(function(Se,Me){if(Me)return!1;const Qe=Se.children;return!Array.isArray(Qe)||!Qe.length||Qe.every(nC)})(fe,ke)?_e:Math.max(h.averageNodeHeight.value,_e)}function j(){var V;const U=h.parsedNodes.value.length,ae=h.getPrefixCacheKeyParts().join(":"),fe=w;F!==ae&&(F=ae,O(0));const ge=h.averageNodeHeight.value;D!==ge&&(D=ge,O(0)),fe.length>U+1&&(fe.length=U+1,x>=0&&x>=fe.length-1&&(y=!1));const ke=fe.length-1;if(!y){if(ke===U)return fe;x=ke}const we=Math.min(x,ke);fe.length<U+1&&(fe.length=U+1);for(let De=we;De<U;De++)fe[De+1]=fe[De]+(h.heightEstimationActive.value?q(De):(V=h.nodeHeights[De])!=null?V:ge);return y=!1,x=U,fe}function ue(V){var U,ae;const fe=h.parsedNodes.value.length;if(fe<=0||V<=0)return 0;const ge=j();if(V>=((U=ge[fe])!=null?U:0))return fe-1;let ke=0,we=fe-1,De=fe-1;for(;ke<=we;){const _e=ke+we>>1;((ae=ge[_e+1])!=null?ae:0)>=V?(De=_e,we=_e-1):ke=_e+1}return De}function de(V,U){var ae,fe;if(V>=U)return 0;if(h.heightEstimationActive.value)return(function(we,De){var _e,Se;const Me=h.parsedNodes.value.length,Qe=V0(Math.trunc(we),0,Me),Nt=V0(Math.trunc(De),Qe,Me);if(Qe>=Nt)return 0;const Lt=j();return((_e=Lt[Nt])!=null?_e:0)-((Se=Lt[Qe])!=null?Se:0)})(V,U);if(h.heightTreeSize.value!==h.parsedNodes.value.length){let we=0;for(let De=V;De<U;De++)we+=(ae=h.nodeHeights[De])!=null?ae:h.averageNodeHeight.value;return we}const ge=h.heightSumTree.value,ke=h.heightKnownTree.value;if(!ge.length||!ke.length){let we=0;for(let De=V;De<U;De++)we+=(fe=h.nodeHeights[De])!=null?fe:h.averageNodeHeight.value;return we}return h.fenwickRangeSum(ge,V,U)+(U-V-h.fenwickRangeSum(ke,V,U))*h.averageNodeHeight.value}function se(V){var U;if(V<=0)return 0;const ae=h.parsedNodes.value;if(h.heightEstimationActive.value)return ue(V);if(h.heightTreeSize.value===ae.length&&h.heightSumTree.value.length&&h.heightKnownTree.value.length){const ge=h.averageNodeHeight.value,ke=h.heightSumTree.value,we=h.heightKnownTree.value,De=Qe=>Qe<=0?0:h.fenwickRangeSum(ke,0,Qe)+(Qe-h.fenwickRangeSum(we,0,Qe))*ge;let _e=0,Se=ae.length-1,Me=ae.length-1;for(;_e<=Se;){const Qe=_e+Se>>1;De(Qe+1)>=V?(Me=Qe,Se=Qe-1):_e=Qe+1}return Me}let fe=V;for(let ge=0;ge<ae.length;ge++){const ke=(U=h.nodeHeights[ge])!=null?U:h.averageNodeHeight.value;if(fe<=ke)return ge;fe-=ke}return Math.max(0,ae.length-1)}function Y(){if(!h.heightEstimationActive.value)return 0;let V=0;const U=h.estimatedNodeHeights.value;for(let ae=0;ae<U.length;ae++){if(!U[ae])continue;const fe=h.nodeHeights[ae];Number.isFinite(fe)&&fe>0||V++}return V}return{markFallbackHeightPrefixDirty:O,getFallbackNodeHeight:q,estimateHeightRange:de,estimateIndexForOffset:se,estimateIndexForOffsetFromEnd:function(V){var U,ae;const fe=h.parsedNodes.value;if(!fe.length)return 0;if(V<=0)return Math.max(0,fe.length-1);if(h.heightEstimationActive.value){const ke=(U=j()[fe.length])!=null?U:0;return ue(Math.max(0,ke-V))}if(h.heightTreeSize.value===fe.length){const ke=de(0,fe.length);return se(Math.max(0,ke-V))}let ge=V;for(let ke=fe.length-1;ke>=0;ke--){const we=(ae=h.nodeHeights[ke])!=null?ae:h.averageNodeHeight.value;if(ge<=we)return ke;ge-=we}return 0},getEstimatedNodeHeightCount:Y,buildVirtualHeightSummary:function(V){var U;const ae=h.parsedNodes.value.length;return{totalNodes:ae,measuredCount:h.heightStats.count,estimatedCount:Y(),averageNodeHeight:h.averageNodeHeight.value,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,estimatedTotalHeight:de(0,ae),width:(U=V.width)!=null?U:h.getContainerWidth()}}}})({parsedNodes:me,nodeHeights:_o,heightStats:Ir,heightTreeSize:Ip,heightSumTree:_C,heightKnownTree:SC,averageNodeHeight:IC,heightEstimationActive:$e,estimatedNodeHeights:Gi,getContainerWidth:Tt,shouldCacheStaticFallbackHeight:()=>{var h;return!((h=r.nodes)!=null&&h.length)},hasCustomParagraphComponent:()=>!!Mt.value.paragraph,getPrefixCacheKeyParts:()=>{var h;const y=is(pe.value||Ee("getFallbackHeightPrefix.clientWidth",()=>{var x;return((x=R.value)==null?void 0:x.clientWidth)||0}));return[((h=r.virtualScroll)==null?void 0:h.measurementKey)==null?"":String(r.virtualScroll.measurementKey),y,$e.value?1:0,Va.value,Mt.value.paragraph?1:0]},fenwickRangeSum:NC}),re=!0,Ie(()=>me.value.length,(h,y)=>{var x;ir(y!=null&&h>=y?Bl(h):0),h<=0?aa():(h<Ip.value&&(x=h,kc(),So(()=>MC(x))),TC(h))},{immediate:!0});const GC=L(()=>{if(!We.value)return me.value.map((w,F)=>({node:w,index:F}));const h=me.value.length,y=pn(hn.start,0,h),x=pn(hn.end,y,h);return me.value.slice(y,x).map((w,F)=>({node:w,index:y+F}))}),Tc=L(()=>We.value?wo(0,Math.min(hn.start,me.value.length)):0),Bc=L(()=>{if(!We.value)return 0;const h=me.value.length;return wo(Math.min(hn.end,h),h)});function Up(){return li.buildVirtualHeightSummary({topSpacerHeight:Tc.value,bottomSpacerHeight:Bc.value,width:Qi()})}function QC(){const h=me.value,y=Up();return lt(Ae({},y),{probe:{paragraphReady:!!ce.value.paragraph,listItemReady:!!ce.value.listItem,listWrapperOverhead:ce.value.listWrapperOverhead,headingReadyLevels:Object.entries(ce.value.headings).filter(([,x])=>!!x).map(([x])=>Number(x))},nodes:h.map((x,w)=>{var F,D,H,O,q,j,ue,de,se;return{index:w,type:x.type,estimateKind:(D=(F=Gi.value[w])==null?void 0:F.kind)!=null?D:null,rendererKind:(O=(H=Gi.value[w])==null?void 0:H.rendererKind)!=null?O:null,estimatedHeight:(j=(q=Gi.value[w])==null?void 0:q.height)!=null?j:null,estimatedContentHeight:(de=(ue=Gi.value[w])==null?void 0:ue.contentHeight)!=null?de:null,measuredHeight:(se=_o[w])!=null?se:null}})})}function Fc(){return r.indexKey!=null?String(r.indexKey):ve.value?`virtual-${zt()}`:"markdown-renderer"}function Yp(h){const y=String(h),x=`${Fc()}-`;if(!y.startsWith(x))return null;const w=y.slice(x.length).match(/^(\d+)(?:$|-)/);if(!w)return null;const F=Number(w[1]);return!Number.isInteger(F)||F<0||F>=me.value.length?null:F}function zt(){var h,y,x;const w=(h=r.virtualScroll)==null?void 0:h.sessionKey;return String(w!=null&&w!==""?w:(x=(y=r.indexKey)!=null?y:_.customId)!=null?x:nn)}function rn(){var h;const y=(h=r.virtualScroll)==null?void 0:h.threadKey;return y==null||y===""?void 0:String(y)}const Zp=L(()=>{var h,y,x;return(x=rn())!=null?x:String((y=(h=r.indexKey)!=null?h:_.customId)!=null?y:nn)});function Dc(h){var y;return(h??"")===((y=rn())!=null?y:"")}function jr(){var h,y,x;return y=(h=r.virtualScroll)==null?void 0:h.measurementKey,x=(function(w){const F=w.codeBlockProps,D=w.codeBlockOptions,H=D==null?void 0:D.parseDiffOptions;return[w.isDark?"dark":"light",w.renderCodeBlocksAsPre?"code-pre":"code-rich",w.codeBlockStream===!1?"code-static":"code-stream",Pt(w.codeBlockMinWidth),Pt(w.codeBlockMaxWidth),Pt(D==null?void 0:D.fontSize),Pt(D==null?void 0:D.lineHeight),Pt(D==null?void 0:D.fontFamily),Pt(D==null?void 0:D.maxHeight),Pt(D==null?void 0:D.tabSize),Pt(D==null?void 0:D.padding),Pt(D==null?void 0:D.overflow),Pt(D==null?void 0:D.disableLineNumbers),Pt(D==null?void 0:D.diffStyle),Pt(D==null?void 0:D.diffIndicators),Pt(D==null?void 0:D.hunkSeparators),Pt(D==null?void 0:D.expandUnchanged),Pt(D==null?void 0:D.collapsedContextThreshold),Pt(D==null?void 0:D.expansionLineCount),Pt(H==null?void 0:H.context),Pt(F==null?void 0:F.showHeader),Pt(F==null?void 0:F.showCopyButton),Pt(F==null?void 0:F.showExpandButton),Pt(F==null?void 0:F.showPreviewButton),Pt(F==null?void 0:F.showCollapseButton),Pt(F==null?void 0:F.showFontSizeButtons),Pt(F==null?void 0:F.showLineNumbers)].join("\0")})({renderCodeBlocksAsPre:v.value,isDark:_.isDark,codeBlockStream:_.codeBlockStream,codeBlockMinWidth:_.codeBlockMinWidth,codeBlockMaxWidth:_.codeBlockMaxWidth,codeBlockOptions:_.codeBlockOptions,codeBlockProps:_.codeBlockProps}),[y==null?"":String(y),x].join("\0")}function Qi(){return Tt()}const va=L(()=>is(Qi())),lr=L(()=>[jr(),va.value].join("\0")),UC=L(()=>{var h;return ve.value?["virtual",(h=rn())!=null?h:"",zt(),lr.value].join("\0"):r.indexKey});function Mo(){Op.value+=1}function Rc(h){return!(!h||!Number.isInteger(h.index)||h.index<0||h.index>=me.value.length||h.sessionKey!==zt()||h.threadKey!==rn()||h.layoutEpochKey!==lr.value)}function Vp(h){const y=String(h),x=Er.get(y);return x?Rc(x)?x.index:null:Yp(y)}function Jp(h="async-node"){(Gn.size||Er.size)&&(ui=0,Gn.clear(),Er.clear(),Mo(),Rt(h))}const To=Bt(Ru,null),Nc={reportHeight(h,y){if(!Fe.value)return;const x=Vp(h);if(x==null)return;const w=yr.get(x);if(!w)return;const F=Number(y),D=yc(x,w);(function(H,O,q={}){So(()=>Bp(H,O,q))})(x,Number.isFinite(F)&&F>0?Math.max(F,D||0):D)},markPending(h){if(!Fe.value)return;const y=Yp(h);y!=null&&(function(x,w){var F;const D=Er.get(x);if(D&&Rc(D))return Gn.set(x,Math.max(0,(F=Gn.get(x))!=null?F:0)+1),ui+=1,Mo(),void Rt("async-node");Gn.set(x,1),ui+=1,Er.set(x,(function(H){return{index:H,sessionKey:zt(),threadKey:rn(),layoutEpochKey:lr.value}})(w)),Mo(),Rt("async-node")})(String(h),y)},markSettled(h){if(!Fe.value)return;const y=String(h),x=Vp(h);if((x!=null||(function(w){return Gn.has(String(w))})(y))&&(function(w){var F;const D=(F=Gn.get(w))!=null?F:0;return!(D<=0||(D<=1?(Gn.delete(w),Er.delete(w)):Gn.set(w,D-1),ui=Math.max(0,ui-1),Mo(),D===1&&Rt("async-node"),0))})(y)&&x!=null){const w=yr.get(x);w&&wa(x,w)}}};function YC(h){if(h!==void 0)return h;let y=0;for(const x of yr.values())y+=Ee("getVisibleDomHeight.offsetHeight",()=>x.offsetHeight);return y}Ut(Ru,{reportHeight(h,y){Nc.reportHeight(h,y),To==null||To.reportHeight(h,y)},markPending(h){Nc.markPending(h),To==null||To.markPending(h)},markSettled(h){Nc.markSettled(h),To==null||To.markSettled(h)}});let Lc,Oc=null,Bo=null;function ka(h){return h!==!1&&h!=null&&h!==""}function Xp(){return We.value?(function(){if(!We.value)return!0;const h=me.value.length,y=pn(hn.start,0,h),x=pn(hn.end,y,h);if(y>=x)return!0;for(let w=y;w<x;w++)if(!zn.has(w)||ba(w)&&!yr.has(w))return!1;return!0})():dr.value>=da.value}function Pc(){return yt.value===!0&&!ot.value&&xc.value===0&&ai.size===0&&Kr.size===0&&or==null&&Xp()}function qp(){var h,y;if(((h=r.virtualScroll)==null?void 0:h.settleMode)!=="manual"||Oc===zt()&&Lc===rn())return!0;const x=(y=r.virtualScroll)==null?void 0:y.settledToken;return!!ka(x)&&Bo===Ul(x)}function $c(){return Pc()&&qp()}function ZC(h,y){return y.totalNodes<=0?h==="final"?"final":"estimate":y.measuredCount>=y.totalNodes?h==="final"?"final":"measured":y.measuredCount>0||y.estimatedCount>0?"mixed":"estimate"}function Ui(h="manual",y,x){const w=Up(),F=(function(D){return D||(yt.value!==!0?me.value.length>0?"streaming":"estimating":!Xp()||Kr.size>0||or!=null?"measuring":$c()?"settled":"settling")})(y);return{sessionKey:zt(),threadKey:rn(),phase:F,nodeCount:w.totalNodes,liveRange:{start:hn.start,end:hn.end},renderedCount:dr.value,measuredCount:w.measuredCount,estimatedCount:w.estimatedCount,averageNodeHeight:w.averageNodeHeight,topSpacerHeight:w.topSpacerHeight,bottomSpacerHeight:w.bottomSpacerHeight,visibleDomHeight:YC(x),totalHeight:eg(w),width:w.width,final:yt.value===!0,stable:$c(),confidence:ZC(F,w),reason:h}}function Dl(){const h=Sl.value||Hn(),y=R.value;if(!h||!y)return null;const x=h.ownerDocument||y.ownerDocument||document,w=h===x.documentElement||h===x.body||h===x.scrollingElement,F=Ee("getScrollBox.scrollTop",()=>Dt(h,x,w)),D=Ee("getScrollBox.scrollHeight",()=>{var O,q,j,ue,de;return w?Math.max((q=(O=x.documentElement)==null?void 0:O.scrollHeight)!=null?q:0,(ue=(j=x.body)==null?void 0:j.scrollHeight)!=null?ue:0,(de=h.scrollHeight)!=null?de:0):h.scrollHeight}),H=Ee("getScrollBox.clientHeight",()=>{var O;return w?((O=x.documentElement)==null?void 0:O.clientHeight)||h.clientHeight||0:h.clientHeight});return{root:h,doc:x,isViewportRoot:w,scrollTop:F,scrollHeight:D,clientHeight:H}}function eg(h){var y;const x=me.value.length,w=Math.max(0,wo(0,x)),F=Ee("getRendererLogicalHeight.offsetHeight",()=>{var H,O;return(O=(H=R.value)==null?void 0:H.offsetHeight)!=null?O:0}),D=Math.max(0,F>0?F:Ee("getRendererLogicalHeight.scrollHeight",()=>{var H,O;return(O=(H=R.value)==null?void 0:H.scrollHeight)!=null?O:0}));return x<=0?Math.ceil(F):We.value?w>0?Math.max(1,Math.ceil(w),(function(){let H=Tc.value+Bc.value;for(const O of zn.values())O&&(H+=Math.max(0,Ee("getVirtualizedDomLogicalHeight.offsetHeight",()=>O.offsetHeight||0)));return Math.ceil(Math.max(0,H))})(),(function(H,O){return H<=0||O<=0?0:O<=H+Math.max(512,.05*H)?Math.ceil(O):0})(w,D)):Math.max(1,Math.ceil(D)):Fe.value?w>0||Ir.count>0||((y=h==null?void 0:h.estimatedCount)!=null?y:li.getEstimatedNodeHeightCount())>0?(dc.value&&dr.value,Math.max(1,Math.ceil(D),Math.ceil(w))):Math.ceil(D):Math.max(1,Math.ceil(D),Math.ceil(w))}function tg(h){const y=R.value;if(!y)return null;const x=Ee("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>y.getBoundingClientRect());return(function(F){return F.isViewportRoot?F.clientHeight:Ee("getViewportBottomInRoot.getBoundingClientRect",()=>F.root.getBoundingClientRect().bottom)})(h)-x.bottom}function VC(h={}){const y=h.requireViewport!==!1,x=(function(D=64){const H=Dl(),O=R.value;if(!H||!O)return!1;const q=(function(ue){if(ue.isViewportRoot)return{top:0,bottom:ue.clientHeight};const de=Ee("getVirtualViewportRect.getBoundingClientRect",()=>ue.root.getBoundingClientRect());return{top:de.top,bottom:de.bottom}})(H),j=Ee("isRendererNearVirtualViewport.getBoundingClientRect",()=>O.getBoundingClientRect());return j.bottom>=q.top-D&&j.top<=q.bottom+D})();if(y&&!x)return null;const w=(function(){const D=Dl(),H=R.value;if(!D||!H||Math.max(0,D.scrollHeight-D.scrollTop-D.clientHeight)>64)return null;const O=tg(D);return O==null?null:O>=-8&&O<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,O)}:null})();if(w)return{anchor:w,captured:!0};const F=_p();if(F)return{anchor:{type:"node",nodeIndex:F.nodeIndex,offsetWithinNodePx:F.offsetWithinNodePx},captured:x};if(h.allowFallback===!0){const D=(function(){const H=me.value.length;return H<=0?null:{type:"node",nodeIndex:pn(Wr.value,0,Math.max(0,H-1)),offsetWithinNodePx:0}})();return D?{anchor:D,captured:!1}:null}return null}function ya(h){let y=2166136261;for(let x=0;x<h.length;x++)y^=h.charCodeAt(x),y=Math.imul(y,16777619);return(y>>>0).toString(36)}function JC(h,y){let x=h;for(let w=0;w<y.length;w++)x^=y.charCodeAt(w),x=Math.imul(x,16777619);return x^=31,x=Math.imul(x,16777619),x}const XC=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Rl(h,y=new WeakSet,x=0){if(h==null||typeof h=="number"||typeof h=="boolean")return String(h);if(typeof h=="string")return`s:${(function(w){const F=w.length>8192?`${w.slice(0,8192)}...${w.length}`:w;return`${w.length}:${ya(F)}`})(h)}`;if(typeof h=="function")return"fn";if(typeof h!="object")return typeof h;if(y.has(h))return"cycle";if(x>=6)return"max-depth";y.add(h);try{if(Array.isArray(h)){if(h.length<=160){const j=[];for(let ue=0;ue<h.length;ue++)j.push(Rl(h[ue],y,x+1));return`a:${h.length}:${j.join(",")}`}const D=[],H=[],O=Math.max(0,h.length-32);let q=2166136261;for(let j=0;j<h.length;j++){const ue=Rl(h[j],y,x+1);q=JC(q,ue),j<32&&D.push(ue),j>=O&&H.push(ue)}return[`a:${h.length}`,`h=${D.join(",")}`,`t=${H.join(",")}`,`all=${(q>>>0).toString(36)}`].join(":")}const w=h,F=Object.keys(w).filter(D=>{const H=w[D];return D!=="parent"&&D!=="el"&&D!=="component"&&(H==null||typeof H=="string"||typeof H=="number"||typeof H=="boolean"||XC.has(D))}).sort();return`o:${F.length}:${F.map(D=>`${D}=${Rl(w[D],y,x+1)}`).join(";")}`}finally{y.delete(h)}}let ng=-1;const Hc=new Map;let Wc=-1,Kc="",Yi=[2166136261];function Nl(h){var y;const x=me.value[h],w=tr();if(ng!==w&&(ng=w,Hc.clear()),!x)return"";if((y=r.nodes)!=null&&y.length||_.parseOptions||_.customMarkdownIt||bt.value.__markstreamHasCustomParserExtensions||Object.keys(Mt.value).length!==0)return ya(Rl(x));const F=Hc.get(h);if(F!==void 0)return F;const D=ya(Rl(x));return Hc.set(h,D),D}function qC(h,y){let x=h;for(let w=0;w<y.length;w++)x^=y.charCodeAt(w),x=Math.imul(x,16777619);return x>>>0}function jc(){var h,y;const x=te.value;if(Wc===x)return Kc;const w=me.value.length;let F=Bl(w);(Wc!==x-1||F>w||Yi.length<F+1)&&(F=0),F===0?Yi=[2166136261]:Yi.length=F+1;for(let D=F;D<w;D++){const H=Nl(D);Yi[D+1]=qC((h=Yi[D])!=null?h:2166136261,H)}return Yi.length=w+1,Kc=(((y=Yi[w])!=null?y:2166136261)>>>0).toString(36),Wc=x,Kc}function Fo(h,y={}){var x;const w=y.includeHeightCache===!0,F=(x=y.includeContentHash)!=null?x:w,D=w?(function(O){const q=(function(){var U,ae;const fe=Number((ae=(U=r.virtualScroll)==null?void 0:U.heightCacheLimit)!=null?ae:5e3);return!Number.isFinite(fe)||fe<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(fe))})();if(!Number.isFinite(q)||O.length<=q)return O;const j=new Map,ue=U=>{!U||j.size>=q||j.set(U.index,U)},de=me.value.length,se=pn(hn.start-2*Bn.value,0,de),Y=pn(hn.end+2*Bn.value,se,de);for(const U of O)U.index>=se&&U.index<Y&&ue(U);const V=Math.max(1,Math.ceil(O.length/q));for(let U=0;U<O.length&&j.size<q;U+=V)ue(O[U]);for(let U=O.length-1;U>=0&&j.size<q;U-=V)ue(O[U]);return Array.from(j.values()).sort((U,ae)=>U.index-ae.index).slice(0,q)})(DC().map(O=>{var q;const j=me.value[O.index];return j?lt(Ae({},O),{nodeType:String((q=j.type)!=null?q:""),signature:Nl(O.index)}):null}).filter(O=>!!O)):[],H=VC({allowFallback:y.allowAnchorFallback===!0,requireViewport:y.requireViewport});return H||D.length||y.includeEmptyState===!0?lt(Ae({sessionKey:h.sessionKey,threadKey:h.threadKey},H?{anchor:H.anchor,anchorCaptured:H.captured}:{anchorCaptured:!1}),{metrics:h,width:h.width,contentHash:F?jc():void 0,measurementKey:jr()||void 0,heightCache:D.length?D:void 0}):null}function zc(h){var y,x;const w=Dl();if(!w)return;const F=(function(O){const q=R.value;if(!q)return null;const j=Ht(q,O.root),ue=me.value.length,de=Ee("getRendererBottomOffsetWithinRoot.offsetHeight",()=>q.offsetHeight||0),se=Math.max(0,de>0?de:ue>0?Ee("getRendererBottomOffsetWithinRoot.scrollHeight",()=>q.scrollHeight||0):0),Y=eg();return j+Math.max(se,Y)})(w);if(F==null)return;const D=Math.max(0,h.distanceFromBottomPx),H=Math.max(0,F-w.clientHeight-D);(function(O){gc=No()+120,Il=O})(H),w.isViewportRoot?(x=(y=w.doc.defaultView)==null?void 0:y.scrollTo)==null||x.call(y,0,H):Q0(w.root,w.doc,H,{isReverseFlexScrollRoot:It,getNormalizedScrollTop:Dt})}const Gc=[];function rg(){if(Pe)for(Ki!=null&&(jn==null||jn(Ki),Ki=null);Gc.length;){const h=Gc.pop();h!=null&&window.clearTimeout(h)}}function Zi(h){const y=!!rr.value;rr.value=null,gc=0,Il=null,rg(),y&&h&&Rt(h)}function Do(){if(!rr.value||!Pe||Ki!=null)return;const h=()=>{Ki=null;const y=rr.value;y&&zc(y)};Ki=Cn?Cn(h):null,Ki==null&&h()}function ig(h,y={}){const x=me.value.length;return x<=0?[]:h.filter(w=>!(!Number.isInteger(w.index)||w.index<0||w.index>=x)&&!(!Number.isFinite(w.height)||w.height<=0)&&!(y.requireSignature&&!w.signature)&&!(y.requireCompatibilityMetadata&&!w.nodeType&&!w.signature)&&(function(F){var D;const H=me.value[F.index];return!(!H||F.nodeType&&F.nodeType!==String((D=H.type)!=null?D:"")||F.signature&&F.signature!==Nl(F.index))})(w))}function og(h){const y=is(Qi()),x=is(h);return y!==-1&&x!==-1&&y===x}function Qc(h){var y;const x=Number(h==null?void 0:h.width);if(Number.isFinite(x)&&x>0)return x;const w=Number((y=h==null?void 0:h.metrics)==null?void 0:y.width);return Number.isFinite(w)&&w>0?w:null}function lg(h){var y;return h.sessionKey===zt()&&!!Dc(h.threadKey)&&((y=h.measurementKey)!=null?y:"")===jr()&&!!og(Qc(h))&&!!(function(x){const w=x.heightCache;return!!(w!=null&&w.length)&&(sg(x)?w.some(F=>!!(F.nodeType||F.signature)):w.some(F=>!!F.signature))})(h)}function sg(h){return!!(h.contentHash&&h.contentHash===jc())}function eb(h){return!sg(h)}let Vi=null,Ji=null,Ll=null,Ol=null,Pl=null;function Uc(h){var y;const x=h.map(F=>{var D,H;return[F.index,Math.round(10*F.height),(D=F.nodeType)!=null?D:"",(H=F.signature)!=null?H:""].join("")}).join(""),w=is(Qi());return[(y=rn())!=null?y:"",zt(),jr(),me.value.length,w,h.length,ya(x)].join(":")}function ag(h=(y=>(y=r.virtualScroll)==null?void 0:y.heightCache)()){if(!Fe.value||!(h!=null&&h.length)||me.value.length<=0||!og((y=r.virtualScroll)==null?void 0:y.heightCacheWidth))return!1;var y;const x=ig(h,{requireSignature:!0});if(!x.length)return!1;const w=Uc(x);return w===Vi?(Ji="standalone",!0):(Fp(x,{mode:"merge"}),ir(),Vi=w,Ji="standalone",Kl(),Rt("restore"),!0)}function ug(){var h;const y=(h=r.virtualScroll)==null?void 0:h.restoreAnchor;return y==null||y===!1?null:y===!0?"true":String(y)}function Yc(h,y={}){var x,w,F;if(!Fe.value||!h||h.sessionKey!==zt()||!Dc(h.threadKey)||me.value.length<=0)return!1;const D=!!((x=h.heightCache)!=null&&x.length)&&!Ca(),H=!h.anchor||h.anchorCaptured===!1&&y.allowUncapturedAnchor!==!0?null:h.anchor,O=y.restoreAnchor===!0&&!!H&&!Ca()&&Number(Qc(h))>0;let q=!1;if((w=h.heightCache)!=null&&w.length&&lg(h)){const ue=ig(h.heightCache,{requireCompatibilityMetadata:!h.contentHash,requireSignature:eb(h)});ue.length&&(Fp(ue,{mode:"merge"}),ir(),Vi=Uc(ue),Ji="restore",Kl(),q=!0)}if(D||O)return!1;if(!y.restoreAnchor||!H)return q&&Rt("restore"),!0;const j=(function(ue,de){var se;const Y=ue.anchor,V=Y?Y.type==="bottom"?`bottom:${Math.round(Y.distanceFromBottomPx)}`:`node:${Y.nodeIndex}:${Math.round(Y.offsetWithinNodePx)}`:"none";return[(se=rn())!=null?se:"",zt(),jr(),va.value,de,V].join(":")})(h,(F=y.restoreToken)!=null?F:"imperative");return Ll===j?(q&&Rt("restore"),!0):(Ll=j,(function(ue){const de=()=>{if(ue.type==="node")return Zi(),void Sp({nodeIndex:ue.nodeIndex,offsetWithinNodePx:ue.offsetWithinNodePx});if(El(),ji.value=null,rr.value=ue,rg(),zc(ue),Pe)for(const se of[0,120,280,480])Gc.push(window.setTimeout(()=>{const Y=rr.value;Y&&zc(Y)},se))};(function(se){if(!We.value)return!1;const Y=me.value.length;return!(Y<=0||(Wr.value=se.type==="node"?pn(se.nodeIndex,0,Y-1):Y-1,Tl(),0))})(ue)?dn(de):de()})(H),Rt("restore"),!0)}function Ca(){const h=Qi();return Number.isFinite(h)&&h>0}function cg(h){var y;return h.sessionKey===zt()&&!!Dc(h.threadKey)&&(me.value.length<=0||!(!((y=h.heightCache)!=null&&y.length)||Ca())||!(!(h.anchor&&Number(Qc(h))>0)||Ca()))}function Zc(){bn.length=0;for(const h of Object.keys(_o)){const y=Number(h);Number.isInteger(y)&&y>=0&&y<me.value.length&&Tp(y)}}function $l(){or!=null&&(jn==null||jn(or),or=null),rf()}function fg(){return!Pe||oa?Promise.resolve():new Promise(h=>{let y=!1,x=null;const w=()=>{y||(y=!0,x!=null&&window.clearTimeout(x),h())};if(Cn)return Cn(w),void(x=window.setTimeout(w,50));x=window.setTimeout(w,0)})}function Vc(h,y=rn(),x=lr.value){return zt()===h&&rn()===y&&lr.value===x}function Jc(){return $t(this,arguments,function*(h={}){var y,x,w,F,D;const H=zt(),O=rn(),q=lr.value,j=(y=h.frames)!=null?y:2,ue=(x=h.timeoutMs)!=null?x:120,de=(w=h.reason)!=null?w:"manual",se=h.expectedSettledTokenKey,Y=h.flushPendingTimers===!0,V=Ui(de),U=()=>lt(Ae({},V),{phase:V.final?"settling":V.phase,stable:!1,confidence:V.confidence==="final"?"mixed":V.confidence,reason:de}),ae=()=>Vc(H,O,q)&&(se==null||Wl()===se);for(let we=0;we<j;we++){if(yield dn(),!ae()||(yield fg(),!ae()))return U();fi(),$l()}if(yield(function(we){return!Pe||we<=0?Promise.resolve():new Promise(De=>window.setTimeout(De,we))})(ue),!ae()||(Y&&$p(),fi(),$l(),!ae()))return U();const fe=Pc();fe&&(Oc=H,Lc=O,((F=r.virtualScroll)==null?void 0:F.settleMode)==="manual"&&se!=null&&ka((D=r.virtualScroll)==null?void 0:D.settledToken)&&Wl()===se&&(Bo=Ul(r.virtualScroll.settledToken)));const ge=ae()&&fe&&qp(),ke=Ui(de,ge?"final":void 0);return tf(ke,!0),ke})}let dg="content",Xi=null,qi=null,Xc=0,Hl=null,Ro=null,qc=null,ef=null;function No(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hg(h){var y,x;const w=Hl;if(!w)return!0;const F=(x=(y=r.virtualScroll)==null?void 0:y.heightDiffThresholdPx)!=null?x:1;return Math.abs(h.totalHeight-w.totalHeight)>F||h.sessionKey!==w.sessionKey||h.phase!==w.phase||h.stable!==w.stable||h.final!==w.final||h.threadKey!==w.threadKey||h.nodeCount!==w.nodeCount||h.measuredCount!==w.measuredCount||h.width!==w.width}function Wl(h=(y=>(y=r.virtualScroll)==null?void 0:y.settledToken)()){return Pt(h)}function pg(h,y){var x,w;return[h,y.sessionKey,(x=y.threadKey)!=null?x:"",jr(),jc(),Pt((w=r.virtualScroll)==null?void 0:w.settledToken),Math.round(y.totalHeight),Math.round(y.width)].join("\0")}function Kl(){qc=null,ef=null,Ro=null}function tb(h){const y=h.heightCache;return y!=null&&y.length?Uc(y):""}function jl(h){var y,x,w;const F=h.metrics,D=h.anchor?(H=h.anchor).type==="bottom"?`bottom:${Math.round(H.distanceFromBottomPx)}`:`node:${H.nodeIndex}:${Math.round(H.offsetWithinNodePx)}`:"none";var H;return[h.sessionKey,(y=h.threadKey)!=null?y:"",(x=h.measurementKey)!=null?x:jr(),(w=h.contentHash)!=null?w:"",tb(h),D,h.anchorCaptured?1:0,F.liveRange.start,F.liveRange.end,F.renderedCount,F.nodeCount,Math.round(F.totalHeight),Math.round(F.width),F.phase,F.stable?1:0].join("\0")}function tf(h,y=!1){if(!Fe.value||(function(H=!1){return!H&&ve.value&&!Oe.value})(y))return;const x=y||hg(h),w=(function(H,O=!1){return O||H.stable||H.phase==="final"?{state:Fo(H,{includeHeightCache:!0})}:{state:Fo(H)}})(h,y),F=w.state,D=!!(F&&(x||(function(H,O=!1){return!!O||jl(H)!==Ro})(F,y)));if(x&&(W(h),Hl=h,Xc=No()),F&&D&&(z(F),F.anchor&&N(F.anchor),Ro=jl(F)),h.stable){const H=pg("settled",h);if(H!==qc){qc=H;const O=Fo(h,{includeHeightCache:!0});O&&(z(O),Ro=jl(O)),(function(q){i("render-settled",q)})(h)}}if(h.phase==="final"){const H=pg("final",h);if(H!==ef){ef=H;const O=Fo(h,{includeHeightCache:!0});O&&(z(O),Ro=jl(O)),(function(q){i("render-final",q)})(h)}}}function nf(){Xi!=null&&(jn==null||jn(Xi),Xi=null),qi!=null&&Pe&&(window.clearTimeout(qi),qi=null)}function gg(){Xi=null,qi=null;const h=No();let y;h-Rp>=120&&(Rp=h,y=fi()),(Kr.size>8||or==null)&&$l(),tf(Ui(dg,void 0,y))}function Rt(h){var y,x;if(!Fe.value||(dg=h,Xi!=null||qi!=null))return;const w=Math.max(0,(x=(y=r.virtualScroll)==null?void 0:y.emitIntervalMs)!=null?x:32),F=Math.max(0,w-(No()-Xc)),D=()=>{qi=null,Xi=Cn?Cn(gg):null,Xi==null&&gg()};Pe&&F>0?qi=window.setTimeout(D,F):D()}function mg(){wp.value+=1}function ba(h){var y;if(dc.value&&h>=dr.value){const x=me.value[h],w=Wn.value===!0&&yt.value!==!0&&h>=me.value.length-2,F=(x==null?void 0:x.type)==="code_block"||(x==null?void 0:x.type)==="image"||(x==null?void 0:x.type)==="mermaid"||(x==null?void 0:x.type)==="infographic";if(!w||F)return!1}return!hr.value||h<Co.value||!!(ot.value&&yt.value!==!0&&!((y=r.nodes)!=null&&y.length)&&h>=me.value.length-Bn.value)||_c.value.has(h)}function Lo(h){const y=ga.get(h);y&&(y(),ga.delete(h));const x=Eo.get(h);x&&(x.destroy(),Eo.delete(h)),ma(h)}function xa(h,y){let x=!1;if(y){const D=zn.get(h);if(D===y&&$r.get(h)===Io.value)return;zn.set(h,y),D!==y&&(x=!0)}else zn.delete(h)&&(x=!0);if(x&&mg(),y||ma(h),!Cc.value||!Wi)return Lo(h),y?$r.set(h,Io.value):$r.delete(h),void(y&&hr.value&&ci(h,!0));if(!We.value&&hr.value&&!G.value&&Eo.size>=st.value&&(G.value||(G.value=!0,Sc()),!Cc.value||!Wi))return Lo(h),$r.set(h,Io.value),void(y&&ci(h,!0));if(h<Co.value&&!We.value||_c.value.has(h))return Lo(h),$r.set(h,Io.value),void ci(h,!0);if(!y)return Lo(h),void $r.delete(h);Lo(h);const w=Wi(y,{rootMargin:Ze.value});if(!w)return void $r.delete(h);Eo.set(h,w),$r.set(h,Io.value),ci(h,w.isVisible.value),hr.value&&(function(D){if(!Pe||!hr.value)return;ma(D);const H=D%17*23,O=window.setTimeout(()=>{if(Hp.delete(D),!hr.value||_c.value.has(D))return;const q=zn.get(D);if(!q)return;const j=Hn(q),ue=q.ownerDocument||document,de=ue.defaultView||window,se=!j||j===ue.documentElement||j===ue.body,Y=!se&&j?Ee("nodeVisibilityFallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()):null,V=se?0:Y.top,U=se?Ee("nodeVisibilityFallback.clientHeight",()=>{var fe,ge;return(ge=(fe=de.innerHeight)!=null?fe:j==null?void 0:j.clientHeight)!=null?ge:0}):Y.bottom,ae=Ee("nodeVisibilityFallback.node.getBoundingClientRect",()=>q.getBoundingClientRect());ae.bottom>=V-500&&ae.top<=U+500&&ci(D,!0)},1800+H);Hp.set(D,O)})(h);let F=null;F=Ie(()=>w.isVisible.value,D=>{if(D){ma(h),ci(h,!0),F==null||F(),ga.delete(h),Eo.get(h)===w&&Eo.delete(h);try{w.destroy()}catch{}}},{immediate:!0}),ga.set(h,F),We.value&&Cr()}function rf(){or=null,So(()=>{let h=!1;for(const[y,x]of Kr)Kr.delete(y),yr.get(y)===x.el&&zi.get(y)===x.version&&(h=Bp(y,x.height,{allowShrink:x.allowShrink})||h);return h})}function Oo(){or!=null&&(jn==null||jn(or),or=null),Kr.clear()}function Ag(h,y,x){var w;if(!Number.isFinite(x)||x<=0||yr.get(h)!==y)return;const F=zi.get(h);if(F==null)return;const D=me.value[h],H=ot.value&&yt.value!==!0&&!((w=r.nodes)!=null&&w.length)&&h>=me.value.length-2,O=!((D==null?void 0:D.loading)===!0||H),q=Kr.get(h),j=q?q.allowShrink&&O:O,ue=q&&!j?Math.max(q.height,x):x;Kr.set(h,{height:ue,allowShrink:j,version:F,el:y}),or==null&&(or=Cn?Cn(rf):null,or==null&&rf())}function wa(h,y){Ag(h,y,yc(h,y))}function fi(){let h=0;for(const[y,x]of yr){const w=yc(y,x);h+=w,Ag(y,x,w)}return h}function vg(){Hr==null||Hr.disconnect(),Hr=null,xl.clear()}function of(){for(;fa.length;)pa(fa.pop())}Ie(Oe,h=>{h&&Rt("content")},{flush:"post"}),t({getVirtualMetrics:Ui,captureVirtualState:function(h={}){var y;return Fo(Ui("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:h.allowFallbackAnchor===!0,requireViewport:h.requireViewport===!0,includeEmptyState:(y=h.includeEmptyState)==null||y})},restoreVirtualState:function(h,y={}){const x=y.restoreAnchor===!0,w=y.restoreToken==null?"imperative":String(y.restoreToken);Ol=h,Pl={restoreAnchor:x,restoreToken:w,allowUncapturedAnchor:y.allowUncapturedAnchor===!0},!Yc(h,{restoreAnchor:x,restoreToken:w,allowUncapturedAnchor:y.allowUncapturedAnchor===!0})&&cg(h)||(Ol=null,Pl=null)},forceMeasure:function(h="manual"){return $t(this,null,function*(){yield dn(),yield fg(),fi(),$l(),yield dn();const y=Ui(h);return tf(y,!0),y})},settle:Jc,scrollToNode:function(h,y="start"){Zi(),El();const x=me.value.length;if(x<=0)return;const w=pn(h,0,x-1),F=()=>{var D;const H=xC({nodeIndex:w,offsetWithinNodePx:0}),O=mc(w),q=Dl(),j=(D=q==null?void 0:q.clientHeight)!=null?D:0,ue=CC();let de=H;if(y==="center")de=H-j/2+O/2;else if(y==="end")de=H-j+O;else if(y==="nearest"&&ue!=null){if(H>=ue&&H+O<=ue+j)return;de=H<ue?H:H-j+O}bC(Math.max(0,de)),Cr({immediate:!0}),We.value&&(Wr.value=w,Tl())};if(We.value)return Wr.value=w,Tl(),void dn(F);F()}});const lf=new Set;Ie(()=>bl.value,h=>{if(h)ca.clear();else{vg();for(const y of si.values())for(const x of y)pa(x);si.clear(),zi.clear(),of(),Oo()}},{immediate:!0}),Ie(yt,h=>{h&&(function(){if(Pe&&yt.value&&yr.size){of();for(const y of Hr?[80]:[80,240,640]){const x=Pp(y,()=>{for(const[w,F]of yr)F&&wa(w,F)},"final");x!=null&&fa.push(x)}}})(),Rt(h?"final":"content")});const nb=U0(()=>Rt("content"),16),rb=U0(()=>Rt("batch"),16);Ie([()=>me.value.length,()=>dr.value],()=>{rr.value&&Do(),nb()},{flush:"post",immediate:!0}),Ie([()=>hn.start,()=>hn.end],()=>{rb()},{flush:"post"});const{cleanupBatchScheduler:ib}=(function(h){const{props:y,isClient:x,isTestEnv:w,parsedNodesIdentity:F,parsedNodeCount:D,desiredRenderedCount:H,datasetKey:O,batchingEnabled:q,incrementalRenderingActive:j,resolvedBatchSize:ue,resolvedInitialBatch:de,renderedCount:se,adaptiveBatchSize:Y,previousRenderContext:V,previousBatchConfig:U,requestFrame:ae,cancelFrame:fe,hasIdleCallback:ge,cleanupNodeVisibility:ke,onDatasetKeyChanged:we,onDatasetChanged:De}=h;let _e=null,Se="raf",Me=null,Qe=0,Nt=!1,Lt=!1;const gn=new Set,Ye=new Set;function xt(){if(x){_e!=null&&(Se==="raf"&&fe?fe(_e):Se==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(_e):Se==="timeout"&&window.clearTimeout(_e),_e=null),Qe+=1;for(const en of gn)fe&&fe(en);for(const en of Ye)window.clearTimeout(en);gn.clear(),Ye.clear(),Me=null,Nt=!1,Lt=!1}}function Kt(){return typeof performance<"u"?performance.now():Date.now()}function wt(en){(function(sr){var gi;if(!j.value)return;const Mr=Math.max(2,(gi=y.renderBatchBudgetMs)!=null?gi:6),Tr=Math.max(1,ue.value||1),Br=Math.max(1,Math.floor(Tr/4));sr>1.5*Mr?Y.value=Math.max(Br,Math.floor(.8*Y.value)):sr<.6*Mr&&Y.value<Tr&&(Y.value=Math.min(Tr,Math.ceil(1.2*Y.value)))})(en),Nt=!1;const mn=Lt||se.value<H.value;Lt=!1,mn&&pi()}function Ot(en,mn={}){var sr,gi;if(!j.value)return;const Mr=H.value;if(se.value>=Mr)return;const Tr=Math.max(1,en),Br=()=>{const zo=Kt();_e=null;const Vl=Me??Tr;Me=null;const Go=Kt();se.value=Math.min(Mr,se.value+Vl),ke(se.value),(function(Af,Da){if(!x)return void wt(Da);Nt=!0;const Gg=++Qe;dn().then(()=>{var Qg;if(Gg!==Qe)return;const yb=Kt(),Cb=Math.max(Da,yb-Af),Ug=()=>{Gg===Qe&&wt(Cb)};if(ae){let io=null,Qo=null,Zg=!1;const Vg=()=>{Zg||(Zg=!0,io!==null&&(gn.delete(io),io=null),Qo!==null&&(Ye.delete(Qo),window.clearTimeout(Qo),Qo=null),Ug())};return io=ae(()=>{Vg()}),gn.add(io),Qo=window.setTimeout(()=>{io!==null&&fe&&fe(io),Vg()},Math.max(32,(Qg=y.renderBatchIdleTimeoutMs)!=null?Qg:120)),void Ye.add(Qo)}const Yg=window.setTimeout(()=>{Ye.delete(Yg),Ug()},0);Ye.add(Yg)})})(zo,Kt()-Go)};if(!x||mn.immediate)return void Br();const no=Math.max(0,(sr=y.renderBatchDelay)!=null?sr:16);if(Me=Me!=null?Math.max(Me,Tr):Tr,_e!=null)return;const ro=typeof document<"u"&&document.visibilityState==="hidden";if(!w&&!ro&&ge&&window.requestIdleCallback){const zo=Math.max(0,(gi=y.renderBatchIdleTimeoutMs)!=null?gi:120);return Se="idle",void(_e=window.requestIdleCallback(()=>Br(),{timeout:zo}))}if(ae&&!w&&!ro)return Se="raf",void(_e=ae(()=>{no===0?Br():(Se="timeout",_e=window.setTimeout(()=>Br(),no))}));Se="timeout",_e=window.setTimeout(()=>Br(),no)}function to(en,mn={}){Nt?Lt=!0:en==null?pi():Ot(en,mn)}function pi(){j.value&&Ot(q.value?Math.max(1,Math.round(Y.value)):Math.max(1,ue.value))}return Ie([F,D,O,j,ue,de,()=>y.renderBatchDelay],()=>{var en;const mn=D.value,sr=V.value,gi=O.value,Mr=!Object.is(gi,sr.key),Tr=mn!==sr.total,Br=Tr&&mn>sr.total&&sr.total>0&&!Mr,no=Mr||Tr;V.value={key:gi,total:mn};const ro=U.value,zo=(en=y.renderBatchDelay)!=null?en:16,Vl=ro.batchSize!==ue.value||ro.initial!==de.value||ro.delay!==zo||ro.enabled!==j.value;U.value={batchSize:ue.value,initial:de.value,delay:zo,enabled:j.value},Mr&&we(mn),(no||Vl||!j.value)&&xt(),(no&&!Br||Vl)&&(Y.value=Math.max(1,ue.value||1)),no&&!Br&&De();const Go=H.value;if(!mn)return se.value=0,void ke(0);if(!j.value)return se.value=Go,void ke(se.value);const Af=Mr||sr.total===0;se.value=Af||Vl?Math.min(Go,de.value):Math.min(se.value,Go);const Da=Math.max(1,de.value||ue.value||mn);se.value<Go?to(Da,{immediate:!x}):ke(se.value)},{immediate:!0}),Ie(H,(en,mn)=>{j.value&&(typeof mn=="number"&&en<=mn||en>se.value&&to())}),{cleanupBatchScheduler:xt}})({props:_,isClient:Pe,isTestEnv:oa,parsedNodesIdentity:Hi,parsedNodeCount:Or,desiredRenderedCount:da,datasetKey:UC,batchingEnabled:gC,incrementalRenderingActive:dc,resolvedBatchSize:fc,resolvedInitialBatch:Co,renderedCount:dr,adaptiveBatchSize:AC,previousRenderContext:mC,previousBatchConfig:vC,requestFrame:Cn,cancelFrame:jn,hasIdleCallback:pC,cleanupNodeVisibility:WC,onDatasetKeyChanged:h=>{Oo(),aa(),ir(),Kl(),h>0&&vc(h)},onDatasetChanged:()=>{We.value&&Cr({immediate:!0})}});Ie([Dp,We,()=>R.value,()=>Ke()],([h,y])=>{if(!h)return Wp(),void wc();KC(),y?Cr({immediate:!0}):wc()},{flush:"post",immediate:!0});let _a=!1;function kg(){We.value&&Pe&&!_a&&(_a=!0,Cn?Cn(()=>{_a=!1,Cr({immediate:!0})}):queueMicrotask(()=>{_a=!1,Cr({immediate:!0})}))}Ie([()=>me.value.length,()=>We.value],([h,y])=>{y&&h&&Pe&&kg()},{flush:"post"}),Ie($e,h=>{h&&(function(){var y;if(ti.value&&ni.value&&ri.value&&((y=nr.value)!=null&&y[1]))return;const x=fo({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),w=fo({type:"list_item",children:[x],raw:"- Probe paragraph text"}),F=fo({type:"list",ordered:!1,items:[w],raw:"- Probe paragraph text"});ti.value=x,ni.value=w,ri.value=F;const D={1:null,2:null,3:null,4:null,5:null,6:null};for(let H=1;H<=6;H++)D[H]=fo({type:"heading",level:H,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(H)} Probe heading`});nr.value=D})()},{immediate:!0}),Ie([()=>R.value,ua],()=>{if(!ua.value)return Ec(),void(pe.value=0);jp(),Ec(),ua.value&&R.value&&typeof ResizeObserver<"u"&&(Fl=new ResizeObserver(()=>{jp(),$e.value&&(ji.value&&Ml(),rr.value&&Do(),Rt("resize"))}),Fl.observe(R.value))},{immediate:!0}),Ie([$e,Tn,lr],()=>$t(null,null,function*(){if(!$e.value)return ce.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ir();yield dn(),(function(){if(!$e.value||typeof window>"u")return ce.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ir();const h={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},y=Kp(Ic(oe.value),".paragraph-node");h.paragraph=fd(oe.value,y,"pre-wrap");const x=Ic(ne.value),w=x==null?void 0:x.querySelector(".paragraph-node");h.listItem=fd(ne.value,w,"pre-wrap");const F=Ee("readSimpleTextProbeProfile.list.offsetHeight",()=>{var H,O;return(O=(H=ee.value)==null?void 0:H.offsetHeight)!=null?O:0}),D=Ee("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var H,O;return(O=(H=ne.value)==null?void 0:H.offsetHeight)!=null?O:0});h.listWrapperOverhead=Math.max(0,F-D);for(let H=1;H<=6;H++){const O=Kp(Ic(ie[H]),`h${H}`);h.headings[H]=fd(ie[H],O,"pre-wrap")}ce.value=h,ir()})()}),{flush:"post",immediate:!0}),Ie(()=>me.value.length,()=>{We.value&&kg()}),Ie([$e,pe],()=>{ir(),We.value&&Cr({immediate:!0}),ji.value&&Ml(),rr.value&&Do(),Rt("resize")},{immediate:!1}),Ie(()=>hr.value,h=>{if(h)for(const[y,x]of zn)xa(y,x);else if(Sc(),We.value)Cr({immediate:!0});else for(const[y,x]of zn)x&&ci(y,!0)},{immediate:!1}),Ie([Ze,st,()=>Ke()],()=>{var h;(h=Wi.refresh)==null||h.call(Wi);for(const[y,x]of zn)xa(y,x)},{immediate:!1}),Ie([()=>_.viewportPriority,()=>me.value.length,st],([h,y,x])=>{if(h!==!1){if(G.value&&(y<=200||y<=x)){G.value=!1;for(const[w,F]of zn)xa(w,F)}}else G.value=!1}),Ie(()=>dr.value,()=>{We.value&&Cr({immediate:!0})}),Ie([Wr,Sr,Bn,()=>me.value.length,We],()=>{Tl()},{immediate:!0});let zl=null,Gl=!1,Po=null;function Ql(){zl=null,Oc=null,Lc=void 0,Bo=null,Kl()}function sf(){Oo(),aa(),ir(),bn.length=0;const h=me.value.length;h>0&&vc(h),Zc()}function af(){nf(),$p(),Hl=null,Vi=null,Ji=null,Ll=null,Ol=null,Pl=null,Gl=!1,Ql(),Jp("restore"),El(),Zi()}function Ul(h){var y;return[(y=rn())!=null?y:"",zt(),jr(),va.value,Wl(h),me.value.length,Math.round(wo(0,me.value.length)),Math.round(Qi()),Ir.count,Math.round(Ir.total)].join(":")}function yg(){return $t(this,null,function*(){var h,y,x,w;const F=(h=r.virtualScroll)==null?void 0:h.settledToken,D=Wl(F),H=zt(),O=rn(),q=lr.value;if(Fe.value&&((y=r.virtualScroll)==null?void 0:y.settleMode)==="manual"&&ka(F))if(Pc()){if(Ul(F)!==Bo&&!Gl){Gl=!0;try{const j=yield Jc({reason:"manual",expectedSettledTokenKey:D}),ue=Wl()===D;Vc(H,O,q)&&j.sessionKey===H&&j.threadKey===O&&ue&&j.stable&&j.phase==="final"&&(Bo=Ul((x=r.virtualScroll)==null?void 0:x.settledToken))}finally{Gl=!1,yield dn();const j=(w=r.virtualScroll)==null?void 0:w.settledToken,ue=ka(j)?Ul(j):"";Vc(H,O,q)&&ue&&Bo!==ue&&yg()}}}else Rt("manual")})}Ie(Fe,(h,y)=>{if(h!==y){if(!h)return af(),void nf();af(),sf(),Po=lr.value,Rt("content")}},{flush:"post"}),Ie([Fe,lr],([h,y])=>{h?Po!=null?Po!==y&&(Po=y,(function(x="resize"){Oo(),aa(),ir(),bn.length=0;const w=me.value.length;w>0&&vc(w),Zc(),Vi=null,Ji=null,Ll=null,Hl=null,Gl=!1,Ql(),ag(),dn(()=>{fi(),ji.value&&Ml(),rr.value&&Do(),Rt(x)})})("resize")):Po=y:Po=null},{flush:"post",immediate:!0}),Ie([Fe,()=>zt(),()=>rn()],([h])=>{h&&(af(),sf(),Jp("content"),Rt("content"))}),Ie([Fe,()=>zt(),()=>rn(),lr,()=>me.value.length],([h])=>{h&&(function(y="async-node"){var x;let w=!1;for(const[F,D]of Array.from(Er.entries()))Rc(D)||(ui-=Math.max(0,(x=Gn.get(F))!=null?x:0),Er.delete(F),Gn.delete(F),w=!0);w&&(Mo(),Rt(y))})("async-node")},{flush:"post"}),Ie([Fe,()=>{var h;return(h=r.virtualScroll)==null?void 0:h.sessionKey},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.measurementKey},()=>r.indexKey,()=>te.value],([h])=>{h&&(Kl(),(function(y="content"){if(!Fe.value)return;const x=[],w=me.value.length,F=Bl(w),D=bn.length-1,H=Math.max(w-1,D);for(let O=F;O<=H;O++){if(O>=w){O<=D&&bn[O]!==void 0&&x.push(O);continue}const q=Nl(O),j=bn[O];j!=null&&j!==q&&x.push(O),bn[O]=q}if(D>=w){for(let O=w;O<=D;O++)bn[O]=void 0;bn.length=w}x.length&&((function(O,q={}){const j=Array.from(O,Number);Mp(j);let ue=0;if(So(()=>(ue=FC(j,q),ue>0)),ue>0)(function(de){for(const se of de)Number.isInteger(se)&&se>=0&&se<bn.length&&(bn[se]=void 0)})(j);else for(const de of j)oi.delete(de)})(x,{notify:!1}),ir(F),Ql(),ji.value&&Ml(),rr.value&&Do(),Rt(y))})("content"))},{flush:"post",immediate:!0}),Ie([Fe,()=>me.value.length,()=>zt(),()=>rn()],([h,y,x,w],[F,D,H,O])=>{h&&F&&x===H&&w===O&&y!==D&&Ql()},{flush:"post"}),Ie([Fe,()=>{var h;return(h=r.virtualScroll)==null?void 0:h.heightCache},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.heightCacheWidth},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.restoreState},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.measurementKey},()=>me.value.length,()=>zt(),pe],()=>{ag()},{flush:"post",immediate:!0}),Ie(ug,(h,y)=>{h==null&&y!=null&&(El(),ji.value=null,Zi(),Ll=null)},{flush:"post"}),Ie([Fe,()=>{var h;return(h=r.virtualScroll)==null?void 0:h.restoreState},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.restoreAnchor},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.measurementKey},()=>me.value.length,()=>zt(),pe],h=>$t(null,[h],function*([y,x]){if(!y||!x)return;yield dn();const w=ug();Yc(x,{restoreAnchor:w!=null,restoreToken:w??void 0})}),{flush:"post",immediate:!0}),Ie([Fe,pe,()=>{var h;return(h=r.virtualScroll)==null?void 0:h.restoreState},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.measurementKey}],([h])=>{var y;if(!h)return;const x=(y=r.virtualScroll)==null?void 0:y.restoreState;x&&Vi&&Ji==="restore"&&(lg(x)||(sf(),Vi=null,Ji=null,Rt("resize")))},{flush:"post"}),Ie([Fe,()=>me.value.length,()=>zt(),pe],h=>$t(null,[h],function*([y]){var x;const w=Ol,F=Pl;y&&w&&(yield dn(),!Yc(w,{restoreAnchor:(F==null?void 0:F.restoreAnchor)===!0,restoreToken:(x=F==null?void 0:F.restoreToken)!=null?x:"imperative",allowUncapturedAnchor:(F==null?void 0:F.allowUncapturedAnchor)===!0})&&cg(w)||(Ol=null,Pl=null))}),{flush:"post",immediate:!0}),Ie([Fe,yt,()=>{var h;return(h=r.virtualScroll)==null?void 0:h.settleMode},()=>zt(),()=>rn(),lr,xc,Lp,()=>dr.value,da,()=>Ir.count,()=>Ir.total],([h,y,x])=>{if(!h||y!==!0||x==="manual"||!$c())return;const w=(function(){var F;const D=me.value.length;return[(F=rn())!=null?F:"",zt(),jr(),va.value,D,Math.round(wo(0,D)),Math.round(Qi()),Ir.count,Math.round(Ir.total)].join(":")})();zl!==w&&(zl=w,Jc({reason:"final"}).then(F=>{F.stable||zl!==w||(zl=null)}))},{flush:"post",immediate:!0}),Ie([Fe,yt,()=>{var h;return(h=r.virtualScroll)==null?void 0:h.settleMode},()=>{var h;return(h=r.virtualScroll)==null?void 0:h.settledToken},()=>zt(),()=>rn(),lr,xc,Lp,()=>dr.value,da,()=>me.value.length,()=>Ir.count,()=>Ir.total],()=>{yg()},{flush:"post",immediate:!0}),Ie([()=>me.value.length,We,Sr,Bn,()=>hn.start,()=>hn.end],([h,y,x,w,F,D])=>{vn.value&&nt("virtualization",{nodes:h,virtualization:y,maxLiveNodes:x,buffer:w,focusIndex:Wr.value,scroll:y?(()=>{const H=Sl.value||Hn();return H?{reverse:It(H),scrollTop:Math.round(H.scrollTop),scrollTopAbs:Math.round(Math.abs(H.scrollTop)),scrollHeight:Math.round(H.scrollHeight),clientHeight:Math.round(H.clientHeight)}:null})():null,liveRange:{start:F,end:D},rendered:dr.value})}),Ie([()=>_.customId],([h],y,x)=>{if(!h||kr)return;const w=(function(F,D){return F?(on.controllers[F]=D,()=>{on.controllers[F]===D&&delete on.controllers[F]}):()=>{}})(h,{captureRestoreAnchor:_p,restoreAnchor:Sp,getAnchorDrift:wC,getReport:QC});x(()=>{w()})},{immediate:!0}),mo(()=>{(function(){if(Fe.value)try{fi(),$l();const h=Ui("manual");hg(h)&&(W(h),Hl=h,Xc=No());const y=Fo(h,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});y&&(z(y),y.anchor&&N(y.anchor),Ro=jl(y))}catch{}})(),ib(),Sc(),xe(),vg();for(const h of si.values())for(const y of h)pa(y);si.clear(),zi.clear(),bn.length=0,of(),Oo(),Ec(),El(),Zi(),nf(),Wp(),wc()});const ob=hu("ViewportDeferredMermaidBlockNode",Zr({loader:()=>$t(null,null,function*(){try{return(yield wn(()=>import("./index10-CYBa-X9L.js"),__vite__mapDeps([11,4,3,5]))).default}catch(h){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".',h),Mi}}),loadingComponent:a1,delay:0}),a1),lb=hu("ViewportDeferredInfographicBlockNode",Zr({loader:()=>$t(null,null,function*(){try{return(yield wn(()=>import("./index8-DOHEQLGI.js"),__vite__mapDeps([12,4,3,5]))).default}catch(h){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Showing the Infographic source fallback. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',h),dd}}),loadingComponent:dd,delay:0}),dd),sb=hu("ViewportDeferredD2BlockNode",Zr({loader:()=>$t(null,null,function*(){try{return(yield wn(()=>import("./index9-BBZwrvIj.js"),__vite__mapDeps([13,4,3,5]))).default}catch(h){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".',h),Mi}}),loadingComponent:s1,delay:0}),s1),Cg={text:Zt,paragraph:Ti,heading:ia,code_block:od,list:go,list_item:po,blockquote:_s,table:hl,definition_list:Ss,footnote:fl,footnote_reference:Jn,footnote_anchor:cl,admonition:Ts,vmr_container:Es,hardbreak:Jr,link:En,image:Vr,thematic_break:Is,math_inline:_r,math_block:Jy,strong:Sn,emphasis:Mn,strikethrough:In,highlight:qn,insert:On,subscript:Ln,superscript:Nn,emoji:Rn,checkbox:Vn,checkbox_input:Vn,inline_code:An,html_inline:Xn,reference:_n,html_block:dl},bg=L(()=>Fc()),ab=L(()=>G0(_.codeBlockProps)),ub=L(()=>G0(_.codeBlockProps)),uf=L(()=>lt(Ae(Ae({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,themes:_.themes,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof Vt.value=="boolean"?{showTooltips:Vt.value}:{}),ub.value),{codeBlockOptions:_.codeBlockOptions})),cf=L(()=>lt(Ae(Ae({},uf.value),ab.value),{codeBlockOptions:_.codeBlockOptions}));function Yl(h){return typeof h=="boolean"?h:void 0}const xg=L(()=>{var h,y,x,w,F,D,H;const O=_.codeBlockProps||{},q={},j=Yl(O.showLineNumbers);q.showLineNumbers=j??((h=_.codeBlockOptions)==null?void 0:h.disableLineNumbers)!==!0,q.showHeader=(y=Yl(O.showHeader))==null||y,q.showCopyButton=(x=Yl(O.showCopyButton))==null||x,typeof O.clipboardWriter=="function"&&(q.clipboardWriter=O.clipboardWriter);const ue=(w=Yl(O.showTooltips))!=null?w:Vt.value;typeof ue=="boolean"&&(q.showTooltips=ue),q.codeBlockOptions=_.codeBlockOptions,q.isDark=_.isDark,q.darkTheme=(F=O.darkTheme)!=null?F:_.codeBlockDarkTheme,q.lightTheme=(D=O.lightTheme)!=null?D:_.codeBlockLightTheme,q.theme=O.theme,q.themes=(H=O.themes)!=null?H:_.themes;const de=Yl(O.diffInline);de!==void 0&&(q.diffInline=de),O.diffHideUnchangedRegions!==void 0&&(q.diffHideUnchangedRegions=O.diffHideUnchangedRegions);const se=(function(Y){const V=Number(Y);return Number.isFinite(V)&&V>0?V:void 0})(O.reservedHeightPx);return se!==void 0&&(q.reservedHeightPx=se),q}),wg=L(()=>Ae({},_.mermaidProps||{})),_g=L(()=>Ae({},_.d2Props||{})),Sg=L(()=>Ae({},_.infographicProps||{})),$o=L(()=>({typewriter:m.value,fade:_.fade,customHtmlTags:er.value.customHtmlTags})),Ig=L(()=>Ae(Ae({},$o.value),typeof Vt.value=="boolean"?{showTooltip:Vt.value}:{})),Eg=L(()=>Ae(Ae({},$o.value),typeof Vt.value=="boolean"?{showTooltips:Vt.value}:{})),Mg=L(()=>Ae(Ae({},$o.value),typeof Vt.value=="boolean"?{showTooltips:Vt.value}:{})),Tg=L(()=>Ae(Ae({},$o.value),typeof Vt.value=="boolean"?{showTooltips:Vt.value}:{}));function cb(h){return Array.isArray(h.children)&&h.children.length>0}const Bg=new WeakMap,Fg=new WeakMap,ff=[],df=[];let Ho=null,Dg=[];function hf(h,y){var x;const w=String((x=h==null?void 0:h.code)!=null?x:""),F=Fg.get(h);if(F&&F.code===w)return F.height;const D=y(w);return Fg.set(h,{code:w,height:D}),D}function Rg(h,y){if(h.length!==y.length)return!1;for(let x=0;x<h.length;x++)if(!Object.is(h[x],y[x]))return!1;return!0}const fb=L(()=>{const h=new Map,y=new Map;return me.value.forEach((x,w)=>{var F;if(x.type!=="footnote")return;const D=x.id,H=(F=h.get(D))!=null?F:0;y.set(w,H),h.set(D,H+1)}),y});function Ng(h,y){var x,w,F,D,H;const O=(function(Ye,xt,Kt){const wt=$e.value?Gi.value[xt]:null;return[xt,Ye.loading,wt,Kt]})(h.node,h.index,y),q=Bg.get(h.node);if(q&&Rg(q.signature,O))return q.item;let j=(function(Ye,xt){var Kt,wt;if(Ye.type!=="code_block")return bo[xt]=void 0,Ye;const Ot=Ye,to=[Ot.language,Ot.loading,Ot.diff,Ot.code,Ot.originalCode,Ot.updatedCode,Ot.raw,Ot.startLine,Ot.endLine,(Kt=Ot.sourceMap)==null?void 0:Kt.startLine,(wt=Ot.sourceMap)==null?void 0:wt.endLine],pi=bo[xt];if(pi&&to.every((mn,sr)=>mn===pi.signature[sr]))return pi.node;const en=Ae({},Ot);return bo[xt]={signature:to,node:en},en})(h.node,h.index);const ue=Ia(j);let de=$g(j,ue);if((j.type==="html_block"||j.type==="html_inline")&&de===Cg[j.type]){const Ye=j,xt=String((x=Ye.tag)!=null?x:"").trim().toLowerCase()||Oh(Ye.content);if(xt){const Kt=Mt.value[xt];if(an.value.has(xt)&&Kt)de=Kt,j=lt(Ae({},Ye),{type:xt,tag:xt,content:Qv(Ye.content,xt)});else if(Ph((w=Ye.content)!=null?w:Ye.raw,xt)){const wt=String((D=(F=Ye.content)!=null?F:Ye.raw)!=null?D:"");j.type==="html_inline"?(de=Zt,j={type:"text",content:wt,raw:wt}):(de=Ti,j={type:"paragraph",children:[{type:"text",content:wt,raw:wt}],raw:wt})}}}const se=j.type==="code_block"&&v.value&&de===ts&&!pu(Mt.value,ue);let Y=Ae({},(function(Ye,xt,Kt){const wt=xt??Ia(Ye);if(Ye.type==="code_block"){const Ot=wt?pu(Mt.value,wt):void 0;if(Kt&&v.value&&!Ot&&Kt===ts)return xg.value;if(Kt&&wt&&Kt===Ot)return wt==="mermaid"?Lg(Ye):wt==="infographic"?Og(Ye):wt==="d2"||wt==="d2lang"?Pg(Ye):cf.value;if(Kt&&Kt===Mt.value.code_block)return cf.value}return wt==="mermaid"?Lg(Ye):wt==="infographic"?Og(Ye):wt==="d2"||wt==="d2lang"?Pg(Ye):Ye.type==="link"?Ig.value:Ye.type==="list"?Eg.value:Ye.type==="blockquote"?Mg.value:Ye.type==="table"?Tg.value:Ye.type==="code_block"?uf.value:$o.value})(j,ue,de));const V=$e.value?Gi.value[h.index]:null;j.type==="code_block"&&(V==null?void 0:V.kind)==="code-block"&&(Y=lt(Ae({},Y),se?{reservedHeightPx:V.contentHeight}:{estimatedHeightPx:V.height,estimatedContentHeightPx:V.contentHeight,estimatedDiffInline:V.diffInline})),se||j.type!=="code_block"||ue!=="mermaid"||ho(Y.estimatedPreviewHeightPx)!=null||(Y=lt(Ae({},Y),{estimatedPreviewHeightPx:Wu(hf(j,$u))})),se||j.type!=="code_block"||ue!=="infographic"||ho(Y.estimatedPreviewHeightPx)!=null||(Y=lt(Ae({},Y),{estimatedPreviewHeightPx:Ku(hf(j,Hu))})),j.type==="math_block"&&(Y=lt(Ae({},Y),{cacheScope:At}));const U=(function(Ye,xt){const Kt=String(Ye.type);return!ra(Kt)&&Mt.value[Kt]===xt})(j,de),ae=U?dp(j,fr.value):void 0,fe=j.loading;let ge=h.index;j.type==="footnote"&&de===fl&&(ge=`footnote-${j.id}-${fb.value.get(h.index)}`);const ke=`${bg.value}-${ge}`,we=Ae({node:j,loading:fe,"index-key":ke},j.type==="reference"?{"data-markstream-reference-id":String(j.id)}:{}),De={"custom-id":_.customId,"is-dark":_.isDark},_e={onCopy:o,onHandleArtifactClick:l},Se={onClick:Hg,onMouseover:pb,onMouseout:gb},Me={onMouseover:s,onMouseout:a},Qe=Ae(Ae({},ae??{}),Y),Nt=gt(we,Y,De,_e),Lt=gt(Qe,we,De,_e),gn={node:j,sourceLoading:fe,index:h.index,component:de,bindings:Y,customBindings:Qe,nodeProps:Nt,customNodeProps:Lt,fragmentNodeProps:gt(Nt,Se),customFragmentNodeProps:gt(Lt,Se),minimalNodeProps:gt(Nt,Me),rendersCustomNode:U,hasSlotChildren:cb(j),slotContent:String((H=j.content)!=null?H:""),isCodeBlock:j.type==="code_block",indexKey:ke,vnodeKey:`${Zp.value}\0${ge}\0${j.type}`};return Bg.set(h.node,{signature:O,item:gn}),gn}const Sa=L(()=>{var h,y,x,w,F;const D=Ho,H=(function(){const U=[v.value,Mt.value,an.value,fr.value,Zp.value,bg.value,At,Mc.value,_.customId,_.isDark,xg.value,uf.value,cf.value,wg.value,Sg.value,_g.value,$o.value,Ig.value,Eg.value,Mg.value,Tg.value,$e.value,Va.value,pe.value];return Ho&&Rg(Ho,U)?Ho:(Ho=U,U)})(),O=D!==H;if(Ho=H,We.value)return GC.value.map(U=>Ng(U,H));const q=me.value,j=q.length;let ue=!1;ff.length>j&&(ff.length=j,df.length=j,ue=!0);const de=ff,se=Math.min(de.length,j);let Y=O?0:se;if(!O)for(let U=0;U<se;U++){const ae=q[U];if(ae.type==="code_block"){if(((h=de[U])==null?void 0:h.node)!==((y=bo[U])==null?void 0:y.node)||df[U]!==ae||!Object.is((x=de[U])==null?void 0:x.sourceLoading,ae.loading)){Y=U;break}}else if(((w=de[U])==null?void 0:w.node)!==ae||!Object.is((F=de[U])==null?void 0:F.sourceLoading,ae.loading)){Y=U;break}}if(!ue&&Y===j)return Dg;for(let U=Y;U<j;U++)de[U]=Ng({node:q[U],index:U},H),df[U]=q[U];const V=de.slice();return Dg=V,V});function Ia(h){var y;return(h==null?void 0:h.type)==="code_block"?String((y=h.language)!=null?y:"").trim().toLowerCase():""}function pf(h,y,x,w){var F;const D=Ae({},h.value);return ho(D.estimatedPreviewHeightPx)==null&&(D.estimatedPreviewHeightPx=w(hf(y,x),void 0,D.maxHeight==="none"?null:(F=ho(D.maxHeight))!=null?F:void 0)),D}function Lg(h){return pf(wg,h,$u,Wu)}function Og(h){return pf(Sg,h,Hu,Ku)}function Pg(h){return pf(_g,h,Ly,Ny)}function $g(h,y){if(!h)return oh;const x=Mt.value,w=x[String(h.type)];if(h.type==="code_block"){const F=y??Ia(h),D=F?pu(x,F):void 0;return D||(v.value?x.code_block||ts:F==="mermaid"?x.mermaid||ob:F==="infographic"?x.infographic||lb:F==="d2"||F==="d2lang"?x.d2||sb:w||x.code_block||Mc.value)}return w||Cg[String(h.type)]||oh}function Hg(h){const y=h.target instanceof Element?h.target.closest("[data-markstream-reference-id]"):null,x=h.currentTarget,w=y&&x instanceof Element&&x.contains(y)?y.dataset.markstreamReferenceId:void 0;i("click",h,w)}function db(h){var y;(y=h.target)!=null&&y.closest("[data-node-index]")&&i("mouseover",h)}function hb(h){var y;(y=h.target)!=null&&y.closest("[data-node-index]")&&i("mouseout",h)}function pb(h){i("mouseover",h)}function gb(h){i("mouseout",h)}const di=be(null),xn=be(!1),Wo=be(null),mb=L(()=>!(_.domMode!=="minimal"||Ft.value||_.fade!==!1||m.value||xn.value||hc.value||We.value||Ue.value||Be.value||kp.value||Object.keys(Mt.value).length!==0));let Ko,eo=null,gf=0,Ea=0,Ma=0;const Wg=["code_block","admonition","table","math_block","html_block","image","thematic_break"],Ab=new Set(Wg),Kg=[".typewriter-cursor",".height-estimation-probes",...Wg.map(h=>`[data-node-type="${h}"]`),"script","style"].join(",");function jg(h){if(!h||typeof h!="object")return!1;const y=h.type;return typeof y=="string"&&Ab.has(y)}function Ta(h){var y,x;if(!h||typeof h!="object")return 0;const w=h,F=(x=(y=w.raw)!=null?y:w.content)!=null?x:w.code;if(typeof F=="string")return F.length;const D=w.children;if(Array.isArray(D))return D.reduce((O,q)=>O+Ta(q),0);const H=w.items;return Array.isArray(H)?H.reduce((O,q)=>O+Ta(q),0):0}function Zl(){Ko&&(clearTimeout(Ko),Ko=void 0)}function mf(){gf+=1,eo!=null&&(jn==null||jn(eo),eo=null)}function jo(){mf(),hi(),di.value&&(di.value.style.visibility="hidden")}function vb(h){var y;if(h.nodeType!==Node.TEXT_NODE||!((y=h.textContent)!=null?y:"").trim())return!1;const x=h.parentElement;return!!x&&!x.closest(Kg)}function kb(h){let y=h.lastChild;for(;y;){if(vb(y))return y;if(y.nodeType===Node.ELEMENT_NODE){const x=y;if(!x.matches(Kg)&&x.lastChild){y=x.lastChild;continue}}for(;y&&y!==h&&!y.previousSibling;)y=y.parentNode;if(!y||y===h)break;y=y.previousSibling}return null}function zg(){const h=Sa.value;for(let y=h.length-1;y>=0;y--){const x=h[y];if(!x||jg(x.node)||!ba(x.index))continue;const w=zn.get(x.index);if(!w)continue;const F=kb(w);if(F)return F}return null}function hi(){Wo.value&&(Wo.value.classList.remove(u1),Wo.value=null)}function Ba(){if(g.value!=="simple"||!Pe||!xn.value||!R.value)return void hi();const h=zg(),y=h?(function(x){var w;const F=(w=x.parentElement)==null?void 0:w.closest(".text-node");return F instanceof HTMLElement?F:x.parentElement})(h):null;y!==Wo.value&&(hi(),y&&(y.classList.add(u1),Wo.value=y))}function Fa(){if(g.value!=="precise"||!Pe||!xn.value||eo!=null)return;const h=gf,y=()=>{eo=null,h===gf&&(function(){var x,w;if(g.value!=="precise"||!(Pe&&xn.value&&R.value&&di.value))return;const F=R.value,D=di.value;D.style.visibility="hidden";const H=zg();if(!H)return;let O=0,q=0,j=20,ue=!1;if(H!=null&&H.textContent){const de=H.textContent.length,se=document.createRange();se.setStart(H,Math.max(0,de-1)),se.setEnd(H,de);const Y=typeof se.getClientRects=="function"?se.getClientRects():void 0,V=(w=Y==null?void 0:Y[Y.length-1])!=null?w:(x=H.parentElement)==null?void 0:x.getBoundingClientRect();if(V){const U=Ee("typewriterCursor.root.getBoundingClientRect",()=>F.getBoundingClientRect());O=V.right-U.left+F.scrollLeft,q=V.top-U.top+F.scrollTop,j=V.height||j,ue=!0}se.detach()}ue&&(D.style.transform=`translate(${Math.max(0,O)}px, ${Math.max(0,q)}px)`,D.style.height=`${j}px`,D.style.visibility="visible")})()};Cn?eo=Cn(y):y()}return Ie([kn,()=>r.content,()=>r.nodes,()=>_.typewriter,yt],()=>$t(null,null,function*(){var h,y;if(!Pe||Ft.value||!Ar.value)return;if(!m.value)return void((xn.value||Ko||eo!=null||Wo.value||di.value)&&(xn.value=!1,Zl(),jo()));if(yt.value)return xn.value=!1,Zl(),void jo();if((h=r.nodes)!=null&&h.length)return xn.value=!1,Zl(),jo(),Ea=((y=r.content)!=null?y:"").length,void(Ma=kn.value.length);const x=(function(){var O,q;return(O=r.nodes)!=null&&O.length?r.nodes.reduce((j,ue)=>j+Ta(ue),0):((q=r.content)!=null?q:"").length})(),w=(function(){var O;return(O=r.nodes)!=null&&O.length?r.nodes.reduce((q,j)=>q+Ta(j),0):kn.value.length})(),F=!jg(me.value[me.value.length-1]),D=x>Ea,H=w>Ma;if(!m.value||!F||!D&&!H)return m.value&&F||(xn.value=!1,jo()),Ea=x,void(Ma=w);Ea=x,Ma=w,xn.value=!0,g.value==="precise"&&di.value&&(di.value.style.visibility="hidden"),Zl(),yield dn(),g.value==="simple"?Ba():(hi(),Fa()),Ko=setTimeout(()=>{Ko=void 0,xn.value=!1},3e3)}),{flush:"post",immediate:!0}),Ie(xn,h=>$t(null,null,function*(){h?(yield dn(),g.value!=="simple"?(hi(),g.value==="precise"&&Fa()):Ba()):jo()}),{flush:"post"}),Ie(g,()=>$t(null,null,function*(){if(Pe&&!Ft.value&&Ar.value&&xn.value){if(yield dn(),g.value==="simple")return mf(),void Ba();hi(),g.value!=="precise"?jo():Fa()}}),{flush:"post"}),Ie([()=>dr.value,()=>hn.start,()=>hn.end],()=>$t(null,null,function*(){Pe&&!Ft.value&&Ar.value&&xn.value&&(yield dn(),g.value!=="simple"?(hi(),g.value==="precise"&&Fa()):Ba())}),{flush:"post"}),mo(()=>{Zl(),mf(),hi(),qe.clear()}),(h,y)=>{const x=_b("NodeRenderer",!0);return He(Ft)?(J(!0),he(Je,{key:0},_t(Sa.value,w=>(J(),he(Je,{key:w.vnodeKey},[w.rendersCustomNode?(J(),je(Zn(w.component),gt({key:0,ref_for:!0},w.customFragmentNodeProps),{default:Bi(()=>[w.hasSlotChildren?(J(),je(x,gt({key:0,ref_for:!0},Wt.value,{nodes:w.node.children,"index-key":w.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):w.slotContent?(J(),je(x,gt({key:1,ref_for:!0},Wt.value,{content:w.slotContent,final:!w.node.loading,"index-key":`${w.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):Gt("",!0)]),_:2},1040)):(J(),je(Zn(w.component),gt({key:1,ref_for:!0},w.fragmentNodeProps),null,16))],64))),128)):(J(),he("div",{key:1,ref_key:"containerRef",ref:R,class:cn(["markstream-vue markdown-renderer",[{dark:_.isDark},{virtualized:We.value},{"virtual-scroll-coordinated":Oe.value},{"stable-layout":OC.value},{"typewriter-simple-cursor":xn.value&&g.value==="simple"}]]),"data-custom-id":_.customId,onClick:Hg,onMouseover:db,onMouseout:hb},[ct.value||We.value?(J(),he(Je,{key:0},[ct.value?(J(),je(nR,{key:0,width:Tn.value,"flow-root":We.value||Oe.value,"paragraph-node":ti.value,"list-item-node":ni.value,"list-node":ri.value,"heading-nodes":nr.value,"set-paragraph-wrapper":PC,"set-list-item-wrapper":$C,"set-list-wrapper":HC,"set-heading-wrapper":jC},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):Gt("",!0),We.value?(J(),he("div",{key:1,class:"node-spacer",style:Yr({height:`${Tc.value}px`}),"aria-hidden":"true"},null,4)):Gt("",!0)],64)):Gt("",!0),mb.value?(J(!0),he(Je,{key:1},_t(Sa.value,w=>(J(),he(Je,{key:w.vnodeKey},[ba(w.index)?(J(),je(Zn(w.component),gt({key:0,ref_for:!0},w.minimalNodeProps),null,16)):Gt("",!0)],64))),128)):(J(!0),he(Je,{key:2},_t(Sa.value,w=>(J(),he("div",{key:w.vnodeKey,ref_for:!0,ref:F=>xa(w.index,F),class:"node-slot","data-node-index":w.index,"data-node-type":w.node.type},[He(lf).has(w.vnodeKey)||ba(w.index)?(J(),he("div",{key:0,ref_for:!0,ref:F=>(function(D,H,O){var q,j;if(O?lf.add(H):lf.delete(H),O){const Y=me.value[D],V=ca.get(D);if(V&&V.el===O&&V.node===Y&&V.loading===(Y==null?void 0:Y.loading))return}O||(function(Y){var V;const U=`${Fc()}-${Y}`;let ae=!1;for(const fe of Array.from(Gn.keys())){const ge=Er.get(fe);((ge==null?void 0:ge.index)===Y||fe===U||fe.startsWith(`${U}-`))&&(ui-=Math.max(0,(V=Gn.get(fe))!=null?V:0),Gn.delete(fe),Er.delete(fe),ae=!0)}ae&&(Mo(),Rt("async-node"))})(D),Kr.delete(D),(function(Y){var V;const U=((V=zi.get(Y))!=null?V:0)+1;zi.set(Y,U)})(D);const ue=si.get(D);if(ue){for(const Y of ue)pa(Y);si.delete(D)}if((function(Y){const V=xl.get(Y);V&&(Hr==null||Hr.unobserve(V),pc.delete(V),xl.delete(Y))})(D),!O||!bl.value)return yr.delete(D),zi.delete(D),void ca.delete(D);yr.set(D,O),ca.set(D,{el:O,node:me.value[D],loading:(q=me.value[D])==null?void 0:q.loading});const de=()=>{wa(D,O)};queueMicrotask(de);const se=(Hr||typeof ResizeObserver>"u"||(Hr=new ResizeObserver(Y=>{if(Y.length)for(const V of Y){const U=pc.get(V.target),ae=xl.get(U??-1);U!=null&&ae&&wa(U,ae)}else fi()})),Hr);if(se&&(xl.set(D,O),pc.set(O,D),se.observe(O)),typeof window<"u"){const Y=((j=me.value[D])==null?void 0:j.type)==="code_block"?[16,80,240,800]:yt.value?[80]:[];if(Y.length){const V=Y.map(U=>Pp(U,de,"node-resize")).filter(U=>U!=null);V.length&&si.set(D,V)}}})(w.index,w.vnodeKey,F),class:"node-content"},[w.isCodeBlock?w.rendersCustomNode?(J(),je(Zn(w.component),gt({key:1,ref_for:!0},w.customNodeProps),{default:Bi(()=>[w.hasSlotChildren?(J(),je(x,gt({key:0,ref_for:!0},Wt.value,{nodes:w.node.children,"index-key":w.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):w.slotContent?(J(),je(x,gt({key:1,ref_for:!0},Wt.value,{content:w.slotContent,final:!w.node.loading,"index-key":`${w.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):Gt("",!0)]),_:2},1040)):(J(),je(Zn(w.component),gt({key:2,ref_for:!0},w.nodeProps),null,16)):(J(),je(rR,{key:0,item:w,"source-nodes":r.nodes,fade:_.fade,final:He(Wn),"nested-renderer-props":w.rendersCustomNode?Wt.value:void 0},null,8,["item","source-nodes","fade","final","nested-renderer-props"]))],512)):(J(),he("div",{key:1,class:"node-placeholder",style:Yr({height:`${mc(w.index)}px`})},null,4))],8,lR))),128)),xn.value&&g.value==="precise"?(J(),he("span",{key:3,ref_key:"typewriterCursorRef",ref:di,class:"typewriter-cursor","aria-hidden":"true"},null,512)):Gt("",!0),We.value?(J(),he("div",{key:4,class:"node-spacer",style:Yr({height:`${Bc.value}px`}),"aria-hidden":"true"},null,4)):Gt("",!0)],42,oR))}}})),[["__scopeId","data-v-179398b5"]]),Pn=Gu;Pn.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Pn.__name,Pn.name].filter(n=>!!n));for(const n of t)e.component(n,Gu)};const fC=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),sR={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"},aR={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"},uR={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"},cR={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"},fR={class:"admonition-title"},dR=["aria-expanded","aria-controls"],hR=["id"],Ts=mt(Ve({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const r=e,i=t,o=L(()=>{if(r.node.title&&r.node.title.trim().length)return r.node.title;const u=r.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),l=be(!!r.node.collapsible&&!((n=r.node.open)==null||n));function s(){r.node.collapsible&&(l.value=!l.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(J(),he("div",{class:cn(["admonition",[`admonition-${r.node.kind}`]])},[Re("div",{id:a,class:"admonition-legend"},[r.node.kind==="note"||r.node.kind==="info"?(J(),he("svg",sR,[...c[1]||(c[1]=[Re("circle",{cx:"12",cy:"12",r:"10"},null,-1),Re("path",{d:"M12 16v-4"},null,-1),Re("path",{d:"M12 8h.01"},null,-1)])])):r.node.kind==="tip"?(J(),he("svg",aR,[...c[2]||(c[2]=[Re("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),Re("path",{d:"M9 18h6"},null,-1),Re("path",{d:"M10 22h4"},null,-1)])])):r.node.kind==="warning"||r.node.kind==="caution"?(J(),he("svg",uR,[...c[3]||(c[3]=[Re("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),Re("path",{d:"M12 9v4"},null,-1),Re("path",{d:"M12 17h.01"},null,-1)])])):r.node.kind==="danger"||r.node.kind==="error"?(J(),he("svg",cR,[...c[4]||(c[4]=[Re("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),Re("path",{d:"M12 8v4"},null,-1),Re("path",{d:"M12 16h.01"},null,-1)])])):Gt("",!0),Re("span",fR,kt(o.value),1),r.node.collapsible?(J(),he("button",{key:4,class:"admonition-toggle","aria-expanded":!l.value,"aria-controls":`${a}-content`,onClick:s},[(J(),he("svg",{style:Yr({rotate:l.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"},[...c[5]||(c[5]=[Re("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,dR)):Gt("",!0)]),hd(Re("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[xr(He(Pn),{"index-key":`admonition-${e.indexKey}`,nodes:r.node.children,"custom-id":r.customId,typewriter:r.typewriter,fade:r.fade,onCopy:c[0]||(c[0]=p=>i("copy",p))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,hR),[[pd,!l.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ts.install=e=>{e.component(Ts.__name,Ts)};const uh=()=>wn(()=>import("./unused-optional-NNwleJvF.js"),[]);let Xa=null,qa=uh,eu=null,c1=!1,f1=!1;function FR(){return $t(this,null,function*(){if(Xa)return Xa;const e=qa;return e?e===uh&&c1?null:eu||(eu=$t(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===uh)return e===qa&&(c1=!0,(function(r){f1||(f1=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',r))})(n)),null;throw n}finally{e===qa&&(eu=null)}return e!==qa?null:t?(Xa=(function(n){var r;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 i=(r=n.default)!=null?r:n;return typeof i=="function"?i:i!=null&&i.D2&&typeof i.D2=="function"?i.D2:i})(t),Xa):null}),eu):null})}let tu=null,dC=null,nu=null;function pR(){return typeof dC=="function"}function DR(){return $t(this,null,function*(){if(tu)return tu;const e=dC;return e?nu||(nu=$t(null,null,function*(){const t=yield e(),n=(function(r){var i,o,l;if(!r)return null;const s=(i=r.default)!=null?i:r,a=typeof s=="function"&&typeof((o=s.prototype)==null?void 0:o.render)=="function"?s:(l=r.Infographic)!=null?l:s==null?void 0:s.Infographic;return typeof a=="function"?a:null})(t);return n?(tu=n,tu):null}).finally(()=>{nu=null}),nu):null})}const RR=Symbol("markstreamLanguageIconResolver");let gR=null;function mR(){return gR}function AR(e){return $t(this,null,function*(){})}const NR=Object.freeze(Object.defineProperty({__proto__:null,AdmonitionNode:Ts,BLOCKED_HTML_TAGS:vl,BLOCKED_HTML_TAG_NAMES:Rv,BLOCK_HTML_TAG_NAMES:Fh,BlockquoteNode:_s,CheckboxNode:Vn,DANGEROUS_HTML_ATTRS:Lv,DANGEROUS_HTML_ATTR_NAMES:Fv,DefinitionListNode:Ss,ESCAPED_TEX_BRACE_COMMANDS:Ps,EXTENDED_STANDARD_HTML_TAGS:Rh,EXTENDED_STANDARD_HTML_TAG_NAMES:Bv,EmojiNode:Rn,EmphasisNode:Mn,FootnoteAnchorNode:cl,FootnoteNode:fl,FootnoteReferenceNode:Jn,HardBreakNode:Jr,HeadingNode:ia,HighlightNode:qn,HtmlBlockNode:dl,HtmlInlineNode:Xn,INLINE_HTML_TAG_NAMES:Mv,ImageNode:Vr,InlineCodeNode:An,InsertNode:On,KATEX_COMMANDS:Qh,LinkNode:En,ListItemNode:po,ListNode:go,MARKSTREAM_NODE_LIFECYCLE_KEY:Ru,MERMAID_DISABLED_CODE:Ud,MarkdownRender:Pn,NON_STRUCTURING_HTML_TAGS:Nh,NON_STRUCTURING_HTML_TAG_NAMES:Nv,ParagraphNode:Ti,PreCodeNode:Mi,ReferenceNode:_n,SAFE_ALLOWED_HTML_TAGS:ny,STANDARD_BLOCK_HTML_TAGS:Dh,STANDARD_HTML_TAGS:pl,SVG_HTML_TAG_NAMES:Tv,StrikethroughNode:In,StrongNode:Sn,SubscriptNode:Ln,SuperscriptNode:Nn,TEX_BRACE_COMMANDS:sk,TableNode:hl,TextNode:Zt,ThematicBreakNode:Is,URL_HTML_ATTRS:Ov,URL_HTML_ATTR_NAMES:Dv,VOID_HTML_TAGS:qr,VOID_HTML_TAG_NAMES:Bh,VmrContainerNode:Es,WORKER_BUSY_CODE:_y,applyContainers:Kv,applyMath:Ak,canParseOffthread:KF,convertHtmlAttrsToProps:cy,convertHtmlPropValue:uy,default:Pn,findMatchingClose:lk,findPrefixOffthread:jF,getHtmlTagFromContent:Oh,getLanguageIcon:vy,getMarkdown:Pd,getStreamDiffsWorkerPool:mR,hasCompleteHtmlTagContent:Gv,isCustomHtmlComponentTag:ay,isHtmlLikeTagName:Sd,isHtmlTagBlocked:lc,isHtmlTagHardBlocked:sp,isInfographicEnabled:pR,isKatexEnabled:fp,isMathLike:Qr,isMermaidEnabled:Qd,isUnsafeHtmlUrl:Ei,languageIconsRevision:Ay,languageMap:Hd,mergeCustomHtmlTags:jv,normalizeCustomHtmlTagName:cr,normalizeCustomHtmlTags:Pi,normalizeLanguageIdentifier:ea,normalizeStandaloneBackslashT:zr,parseFenceToken:tc,parseInlineTokens:Du,parseMarkdownToStructure:ty,registerIconTheme:my,renderKaTeXInWorker:wy,renderKaTeXWithBackpressure:lF,resolveCustomHtmlTags:zv,resolveLanguageId:iF,safeCancelRaf:GF,safeRaf:zF,sanitizeHtmlAttrs:sc,sanitizeHtmlContent:js,sanitizeHtmlTokenAttrs:ys,sanitizeImageSrc:_d,setKaTeXCache:oF,shouldOpenLinkInNewTab:Hv,shouldRenderUnknownHtmlTagAsText:Ph,stripCustomHtmlWrapper:Qv,stripHtmlControlAndWhitespace:Lh,syncStreamDiffsWorkerTheme:AR,toSafeSvgElement:YB,tokenAttrsToRecord:ul,tokenizeHtml:fy,useSmoothMarkdownStream:cC,waitForKaTeXWorkerSlot:Sy},Symbol.toStringTag,{value:"Module"}));export{Mi as $,ea as A,_y as B,CR as C,DR as D,Cy as E,lF as F,jD as G,Hd as H,AR as I,MR as J,PD as K,GF as L,Ay as M,RF as N,wR as O,FR as P,TR as Q,SR as R,Wu as S,$u as T,IR as U,jF as V,YB as W,ER as X,fD as Y,dD as Z,KF as _,mt as a,eh as a0,vy as a1,eF as a2,tF as a3,NR as a4,pR as b,xR as c,pp as d,BR as e,gp as f,Hu as g,RR as h,zF as i,$D as j,th as k,Ru as l,vD as m,_R as n,gD as o,by as p,WD as q,ho as r,hp as s,KD as t,Ku as u,bR as v,HD as w,mR as x,iF as y,oF as z};