dimcode-web 0.1.0-alpha.20 → 0.1.0-alpha.21
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.
- package/package.json +1 -1
- package/release-manifest.json +96 -96
- package/web/assets/{AccountSettings-Dm1D868m.js → AccountSettings-nyVX4bl3.js} +1 -1
- package/web/assets/{AgentSettings-tFcwdxve.js → AgentSettings-C6opxYYo.js} +1 -1
- package/web/assets/{AppearanceSettings-C_n8ZVp3.js → AppearanceSettings-BoOhVnFz.js} +1 -1
- package/web/assets/{ArchivedSettings-CKnpAlGL.js → ArchivedSettings-D5tDripk.js} +1 -1
- package/web/assets/{CodeBlockNode-DW-_i1bK.js → CodeBlockNode-BigXVQAf.js} +2 -2
- package/web/assets/{DiagnosticsSettings-Bx-hBChz.js → DiagnosticsSettings-DJcBCpEy.js} +1 -1
- package/web/assets/{GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-DZXQ9DPx.js → GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-C2v20RcN.js} +1 -1
- package/web/assets/McpSettings-Dl7iog2J.css +1 -0
- package/web/assets/McpSettings-rHDDYrKl.js +1 -0
- package/web/assets/{ModalitySettings-ljY4FHpT.js → ModalitySettings-DprOf77o.js} +1 -1
- package/web/assets/{PermissionsSettings-DfX2uBs5.js → PermissionsSettings-DtADZ5dp.js} +1 -1
- package/web/assets/PluginSettings-DvJj4pme.js +1 -0
- package/web/assets/PluginSettings-DziS_TZL.css +1 -0
- package/web/assets/{PreCodeBlock-BMiY-Z7g.js → PreCodeBlock-Cs_v_zn2.js} +1 -1
- package/web/assets/{ProviderAuthFlow.vue_vue_type_script_setup_true_lang-B389tFJs.js → ProviderAuthFlow.vue_vue_type_script_setup_true_lang-t8Pt_gCk.js} +1 -1
- package/web/assets/{ProviderSettings-c2tleRgL.js → ProviderSettings-DwxeUHLU.js} +1 -1
- package/web/assets/{ScheduledSettings-B2Xx6vHW.js → ScheduledSettings-D9YosCWp.js} +1 -1
- package/web/assets/{SettingsPage-D3wJixRh.js → SettingsPage-B76s7xMI.js} +1 -1
- package/web/assets/{SkillSettings-ChetNtzv.js → SkillSettings-BQ774cUK.js} +1 -1
- package/web/assets/{Tooltip-DOIVeWhH.js → Tooltip-B5X1Lr7y.js} +1 -1
- package/web/assets/{abnfDiagram-N423BO3Z-BZjVDOF0.js → abnfDiagram-N423BO3Z-Budr7LDr.js} +1 -1
- package/web/assets/{arc-CiBLzAgb.js → arc-DmLVSho5.js} +1 -1
- package/web/assets/{architectureDiagram-T3A2C74G-F50OEFF4.js → architectureDiagram-T3A2C74G-CZ9twOWw.js} +1 -1
- package/web/assets/{arrow-left-TviDdWXk.js → arrow-left-Q8O22LEf.js} +1 -1
- package/web/assets/{blockDiagram-VBNYF7ZC-BLa-563x.js → blockDiagram-VBNYF7ZC-B6vsATAl.js} +1 -1
- package/web/assets/{c4Diagram-5PPSVZJV-iu-ereif.js → c4Diagram-5PPSVZJV-ZbBXLah8.js} +1 -1
- package/web/assets/channel-S4MqItxT.js +1 -0
- package/web/assets/{chunk-2GRJ4B5K-DQZox8Hn.js → chunk-2GRJ4B5K-DCbPHDn9.js} +1 -1
- package/web/assets/{chunk-2Q5K7J3B-CYPNG9OA.js → chunk-2Q5K7J3B-q-A4RCdp.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-D2DpFWtN.js → chunk-5RXB4S5H-B-mGURLT.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-C-_Qy_tL.js → chunk-5VM5RSS4-DFGchYlp.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-VrxKiMY5.js → chunk-6Q2QTUOP-0FNBovJD.js} +1 -1
- package/web/assets/{chunk-GF5L2VYU-DncOpQbg.js → chunk-GF5L2VYU-wi5f-cDY.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-BSpVTHvp.js → chunk-JWPE2WC7-C5DYyLY7.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-BY7QEXcH.js → chunk-KBJHAD2P-CoHVmRnB.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-yQA4-tM4.js → chunk-RYQCIY6F-DrN39PnO.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-DF87scO8.js → chunk-XXDRQBXY-CbRCRbeQ.js} +1 -1
- package/web/assets/classDiagram-JCYQIIEL-DUDCefSy.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-DUDCefSy.js +1 -0
- package/web/assets/{clock-3-CUmaTBi8.js → clock-3-CEcFQuW4.js} +1 -1
- package/web/assets/{context-nBNziKZK.js → context-B95juZL3.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-C_K0fE6C.js → cose-bilkent-JH36ORCC-BqViSKnD.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-Bw1VHFeH.js → cynefin-OW5HDTMX-rMAZpWdi.js} +1 -1
- package/web/assets/{cynefinDiagram-MW4NZA55-DKWxP_GI.js → cynefinDiagram-MW4NZA55-BYSCyLEg.js} +1 -1
- package/web/assets/{dagre-VZM6K2ZE-C34AbZIA.js → dagre-VZM6K2ZE-DMCK3aFx.js} +1 -1
- package/web/assets/{diagram-7IWD3JNH-CoHuC0sC.js → diagram-7IWD3JNH-BFKte3Xm.js} +1 -1
- package/web/assets/{diagram-B4RE2ZJO-DCgvcLaq.js → diagram-B4RE2ZJO-D9EupTSG.js} +1 -1
- package/web/assets/{diagram-LBJQPF4R-BaqyrpsV.js → diagram-LBJQPF4R-DKIeq9be.js} +1 -1
- package/web/assets/{diagram-Q27KOJAE-B2-20v7j.js → diagram-Q27KOJAE-BOrnx2ed.js} +1 -1
- package/web/assets/{diagram-UB23O5K3-Dw8RW9Q1.js → diagram-UB23O5K3-D8lvv7G0.js} +1 -1
- package/web/assets/{ebnfDiagram-BXEA7PRR-C1gBADbd.js → ebnfDiagram-BXEA7PRR-CGeZxtxl.js} +1 -1
- package/web/assets/{erDiagram-JOGREHBK-C0v6IHNn.js → erDiagram-JOGREHBK-eGGkPfnP.js} +1 -1
- package/web/assets/{flowDiagram-UKHOOZJN--rwBpNQR.js → flowDiagram-UKHOOZJN-p09UM-22.js} +1 -1
- package/web/assets/{ganttDiagram-PKOTCBZU-Bai6jN6z.js → ganttDiagram-PKOTCBZU-SqulGI3A.js} +1 -1
- package/web/assets/{gitGraphDiagram-DS77QQ5N-BLfTMDDp.js → gitGraphDiagram-DS77QQ5N-DVBfe-CW.js} +1 -1
- package/web/assets/index-B0IMqptZ.css +1 -0
- package/web/assets/{index-BF1thmX_.js → index-CTaNCPit.js} +1 -1
- package/web/assets/index-NdaMpp0K.js +249 -0
- package/web/assets/{index-Bg4rJsQT.js → index-lSaCQ5HQ.js} +5 -5
- package/web/assets/{index10-VUcylQwv.js → index10-B9YpVOxp.js} +1 -1
- package/web/assets/{index5-DvBMXtuB.js → index5-ZFdL0BRF.js} +1 -1
- package/web/assets/{index6-DCBMmWam.js → index6-DwYIp71E.js} +1 -1
- package/web/assets/{index8-B1LZLiIu.js → index8-DNs0laJT.js} +1 -1
- package/web/assets/{index9-MMVu88OD.js → index9-C76POzlM.js} +1 -1
- package/web/assets/{infoDiagram-6WML65LV-CCyDyas4.js → infoDiagram-6WML65LV-ClGQXzPV.js} +1 -1
- package/web/assets/{ishikawaDiagram-WSZJBQD7-DQ6pqESS.js → ishikawaDiagram-WSZJBQD7-kaFUTkwb.js} +1 -1
- package/web/assets/{journeyDiagram-NVQOT4AX-duwJBcMO.js → journeyDiagram-NVQOT4AX-BRpajxRG.js} +1 -1
- package/web/assets/{kanban-definition-27J2QSJJ-CFFrtoqw.js → kanban-definition-27J2QSJJ-QTf_fpBx.js} +1 -1
- package/web/assets/{linear-Bmw-9y_M.js → linear-BH8Hio3w.js} +1 -1
- package/web/assets/{markstream-Bbk0VtE5.js → markstream-9drg_IpK.js} +2 -2
- package/web/assets/{mermaid.core-Bg8A4HBE.js → mermaid.core-C9VqvILU.js} +4 -4
- package/web/assets/{mindmap-definition-FAOFIHXS-BJ_0jHTb.js → mindmap-definition-FAOFIHXS-A67fKlRw.js} +1 -1
- package/web/assets/{pegDiagram-VL7TDLO6-ScyUEaUT.js → pegDiagram-VL7TDLO6-BBjPwAwO.js} +1 -1
- package/web/assets/{pieDiagram-7S7Q4E2Y-BpySPZ37.js → pieDiagram-7S7Q4E2Y-B2O2_6Ql.js} +1 -1
- package/web/assets/{quadrantDiagram-CIZ2JOQS-DhZpwLgY.js → quadrantDiagram-CIZ2JOQS-9BnbLmnp.js} +1 -1
- package/web/assets/{railroadDiagram-AXF67PYL-3K7H747D.js → railroadDiagram-AXF67PYL-4jnaEanA.js} +1 -1
- package/web/assets/{refresh-cw-Dbo4EzRb.js → refresh-cw-CdGjCYEi.js} +1 -1
- package/web/assets/{requirementDiagram-LRYGKXZP-Bdv2-QSY.js → requirementDiagram-LRYGKXZP-CE9rGQ5I.js} +1 -1
- package/web/assets/{sankeyDiagram-W5VNT64P-CmnceiZ6.js → sankeyDiagram-W5VNT64P-BTub3bJG.js} +1 -1
- package/web/assets/{sequenceDiagram-SI44F4Z6-BgMHaOth.js → sequenceDiagram-SI44F4Z6-CpY_fBT6.js} +1 -1
- package/web/assets/{settings-general-BrnSzIx8.js → settings-general-qm23fkZo.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-DlRwfatS.js → sizeCapture-X5ZJPWSS-DnJ1KeP_.js} +1 -1
- package/web/assets/{stateDiagram-OKZ733FA-CP369oAp.js → stateDiagram-OKZ733FA-_5PCQD6y.js} +1 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-CUP19cPR.js +1 -0
- package/web/assets/{swimlanes-SLNWSIFB-CY_cC5Es.js → swimlanes-SLNWSIFB-YeAoXX44.js} +2 -2
- package/web/assets/swimlanesDiagram-ULZ7WXOC-BmGPOH52.js +8 -0
- package/web/assets/{timeline-definition-Z64GVDOM-B_GIaxzX.js → timeline-definition-Z64GVDOM-BLxnm5xB.js} +1 -1
- package/web/assets/{vendor-vue-Cu2DcYCH.js → vendor-vue-BSuwZuJF.js} +1 -1
- package/web/assets/{vennDiagram-T6HMQDX7-CT5m0co4.js → vennDiagram-T6HMQDX7-SZnCg-5k.js} +1 -1
- package/web/assets/{wardleyDiagram-T6FBY63Y-CTxtaMBw.js → wardleyDiagram-T6FBY63Y-Cv3hfuMY.js} +1 -1
- package/web/assets/{xychartDiagram-ELKLHX3M-wlH3CCmf.js → xychartDiagram-ELKLHX3M-Myh9al5x.js} +1 -1
- package/web/assets/zh-CN-CJTbN_T1.js +1 -0
- package/web/dimcode-web.json +2 -2
- package/web/index.html +3 -3
- package/web/assets/McpSettings-DQ-1oKqm.css +0 -1
- package/web/assets/McpSettings-DdbhpJel.js +0 -1
- package/web/assets/PluginSettings-Bg3LwShD.js +0 -1
- package/web/assets/PluginSettings-rv5I0LON.css +0 -1
- package/web/assets/channel-BQ7ck7X_.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-Bcdrqdu1.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-Bcdrqdu1.js +0 -1
- package/web/assets/index-CwtQ7tKv.css +0 -1
- package/web/assets/index-DYOKXSJi.js +0 -253
- package/web/assets/stateDiagram-v2-UEYNNEHI-Bkte4diy.js +0 -1
- package/web/assets/swimlanesDiagram-ULZ7WXOC-Cao2QUXy.js +0 -8
- package/web/assets/zh-CN-BJoeJVFx.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-MNFFEueS.js","assets/katex-C5jXJg4s.js","assets/mermaid.core-
|
|
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-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-MNFFEueS.js","assets/katex-C5jXJg4s.js","assets/mermaid.core-C9VqvILU.js","assets/index-NdaMpp0K.js","assets/vendor-vue-BSuwZuJF.js","assets/index-B0IMqptZ.css","assets/Tooltip-B5X1Lr7y.js","assets/PreCodeBlock-Cs_v_zn2.js","assets/CodeBlockNode-BigXVQAf.js","assets/index6-DwYIp71E.js","assets/index5-ZFdL0BRF.js","assets/index10-B9YpVOxp.js","assets/index8-DNs0laJT.js","assets/index9-C76POzlM.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-NdaMpp0K.js";import{H as Oi,d as Ve,o as J,c as he,e as Re,j as xr,u as He,m as cn,F as Je,C as _t,n as Yr,i as Bt,A as Al,r as be,x as Jg,w as Ie,S as wb,q as dn,g as mo,U as _b,h as je,k as Bi,I as gt,a as Gt,Q as Zn,z as L,V as Ra,s as Bs,t as kt,l as hd,v as pd,b as d1,y as gu,W as ch,X as Sb,Y as Ib,Z as Zr,T as h1,_ as Eb,$ as Te,a0 as fo,a1 as Mb,a2 as Ut}from"./vendor-vue-BSuwZuJF.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
3
|
`:`<hr class="footnotes-sep">
|
|
4
4
|
`)+`<section class="footnotes">
|
|
5
5
|
<ol class="footnotes-list">
|
|
@@ -205,16 +205,16 @@ ${C}`);c+=M}else c+=T;c+=v,p=f?d+1:e.length}return c}function pB(e,t){if(!e||!t.
|
|
|
205
205
|
<div class="code-editor"></div>
|
|
206
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
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-Bg8A4HBE.js").then(e=>e.bq),__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-Cu2DcYCH.js").then(g=>g.ai),[]),wn(()=>import("./Tooltip-DOIVeWhH.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]===`
|
|
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-C9VqvILU.js").then(e=>e.bq),__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-BSuwZuJF.js").then(g=>g.ai),[]),wn(()=>import("./Tooltip-B5X1Lr7y.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
209
|
`&&te++);for(let pe=te;pe<Q.length;pe++)Q[pe]===`
|
|
210
210
|
`?re++:Q[pe]==="\r"&&(re++,Q[pe+1]===`
|
|
211
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
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
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
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-BMiY-Z7g.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-DW-_i1bK.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-DCBMmWam.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-DvBMXtuB.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+=`
|
|
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-Cs_v_zn2.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-BigXVQAf.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-DwYIp71E.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-ZFdL0BRF.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
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
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=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
218
|
|
|
219
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-VUcylQwv.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-B1LZLiIu.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-MMVu88OD.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};
|
|
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-B9YpVOxp.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-DNs0laJT.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-C76POzlM.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};
|