markstream-vue 0.0.10-beta.3 → 0.0.10-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/exports.js CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,a=(e,n)=>{for(var t in n||(n={}))r.call(n,t)&&i(e,t,n[t]);if(o)for(var t of o(n))l.call(n,t)&&i(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),d=(e,n,t)=>i(e,"symbol"!=typeof n?n+"":n,t),u=(e,n,t)=>new Promise((o,r)=>{var l=e=>{try{a(t.next(e))}catch(n){r(n)}},i=e=>{try{a(t.throw(e))}catch(n){r(n)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((t=t.apply(e,n)).next())});import{getMarkdown as c,parseMarkdownToStructure as m,setDefaultMathOptions as p}from"stream-markdown-parser";import{defineComponent as h,openBlock as v,createElementBlock as f,createVNode as g,unref as y,createElementVNode as w,Fragment as k,renderList as x,toDisplayString as b,shallowRef as M,h as _,computed as T,normalizeClass as C,useAttrs as B,inject as I,ref as S,watch as $,createCommentVNode as E,nextTick as L,onBeforeUnmount as N,createBlock as j,Teleport as H,Transition as P,withCtx as D,withDirectives as R,normalizeStyle as K,vShow as O,createApp as W,provide as A,renderSlot as z,readonly as F,defineAsyncComponent as V,resolveDynamicComponent as U,mergeProps as X,markRaw as q,reactive as G,onMounted as Y}from"vue";import{autoUpdate as Z,offset as J,flip as Q,shift as ee,computePosition as ne}from"@floating-ui/dom";const te=["cite"],oe=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},re=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g(y(zt),{"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"])],8,te))}}),[["__scopeId","data-v-6d8bbd17"]]);re.install=e=>{e.component(re.__name,re)};const le={class:"checkbox-node"},ie=["checked"],ae=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",le,[w("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,ie)]))}),[["__scopeId","data-v-8dc6c46f"]]);ae.install=e=>{e.component(ae.__name,ae)};const se={class:"definition-list"},de={class:"definition-term"},ue={class:"definition-desc"},ce=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(v(),f("dl",se,[(v(!0),f(k,null,x(n.node.items,(o,r)=>(v(),f(k,{key:r},[w("dt",de,[g(y(zt),{"index-key":`definition-term-${n.indexKey}-${r}`,nodes:o.term,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[0]||(t[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])]),w("dd",ue,[g(y(zt),{"index-key":`definition-desc-${n.indexKey}-${r}`,nodes:o.definition,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[1]||(t[1]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);ce.install=e=>{e.component(ce.__name,ce)};const me={class:"emoji-node"},pe=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",me,b(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);pe.install=e=>{e.component(pe.__name,pe)};const he="__global__",ve="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",fe=(()=>{const e=globalThis;if(e[ve])return e[ve];const n={scopedCustomComponents:{},revision:M(0)};return e[ve]=n,n})(),ge=fe.revision;function ye(e,n){"string"==typeof e?fe.scopedCustomComponents[e]=n||{}:fe.scopedCustomComponents[he]=e||{},ge.value++}function we(e){const n=fe.scopedCustomComponents[he]||{};if(!e)return n;const t=fe.scopedCustomComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?a(a({},n),t):n:t}function ke(e){if(e===he)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete fe.scopedCustomComponents[e],ge.value++}function xe(){delete fe.scopedCustomComponents[he],ge.value++}const be=["id"],Me=["title"],_e=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const n=`#footnote-${e.node.id}`;function t(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(o,r)=>(v(),f("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[w("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+b(e.node.id)+"]",9,Me)],8,be))}}),[["__scopeId","data-v-01af0fee"]]);_e.install=e=>{e.component(_e.__name,_e)};const Te=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),Ce=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Be=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Ie=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,Se=/* @__PURE__ */new Set(["script"]),$e=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),Ee=(()=>{try{return Boolean(!1)}catch(e){}return!1})();function Le(e){Ee&&console.warn(e)}function Ne(e){const n=function(e){let n="";for(const t of e){const e=t.charCodeAt(0);e<=31||127===e||/\s/u.test(t)||(n+=t)}return n}(e).toLowerCase();return!(!n.startsWith("javascript:")&&!n.startsWith("vbscript:"))||!!n.startsWith("data:")&&!(n.startsWith("data:image/")||n.startsWith("data:video/")||n.startsWith("data:audio/"))}function je(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function He(e,n){const t=e.toLowerCase();return!Be.has(t)&&(je(n,t)||je(n,e))}function Pe(e){const n={};for(const[t,o]of Object.entries(e)){const e=t.toLowerCase();Te.has(e)||$e.has(e)&&o&&Ne(o)||(n[t]=o)}return n}function De(e,n){const t=n.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(t))return"true"===e||""===e||e===n;if(["value","min","max","step","width","height","size","maxlength"].includes(t)){const n=Number(e);if(""!==e&&!Number.isNaN(n))return n}return e}function Re(e){return e.trim().length>0}function Ke(e,n,t,o,r){if(Se.has(e.toLowerCase()))return null;const l=Pe(n),i=l.key,d=null!=i&&""!==i?i:r;if(He(e,o)){const n=o[e]||o[e.toLowerCase()],r=function(e){const n={};for(const[t,o]of Object.entries(e))n[t]=De(o,t);return n}(l);return _(n,s(a({},r),{key:d}),t.length>0?t:void 0)}return _(e,s(a({},l),{innerHTML:void 0,key:d}),t.length>0?t:void 0)}function Oe(e,n){if(!e||!e.includes("<"))return!1;if(!n||0===Object.keys(n).length)return!1;let t;for(Ie.lastIndex=0;null!==(t=Ie.exec(e));)if(He(t[1],n))return!0;return!1}function We(e,n){if(!e)return[];try{const t=function(e,n){let t=0;const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=Ke(l.tagName,l.attrs||{},[],n,"ms-html-"+t++),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs,autoKey:"ms-html-"+t++});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let t=-1;for(let n=o.length-1;n>=0;n--)if(o[n].tagName.toLowerCase()===e){t=n;break}if(-1!==t)for(;o.length>t;){const l=o.pop(),i=Ke(l.tagName,l.attrs||{},l.children,n,l.autoKey);o.length>0?null!=i&&o[o.length-1].children.push(i):null!=i&&r.push(i),l.tagName.toLowerCase()!==e&&o.length>t&&Le(`Auto-closing unclosed tag: <${l.tagName}>`)}else Le(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),t=Ke(e.tagName,e.attrs||{},e.children,n,e.autoKey);o.length>0?null!=t&&o[o.length-1].children.push(t):null!=t&&r.push(t),Le(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var n,t,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const n=e.indexOf("--\x3e",l);if(-1!==n){l=n+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const n=e.slice(l);Re(n)&&r.push({type:"text",content:n})}break}if(i>l){const n=e.slice(l,i);Re(n)&&r.push({type:"text",content:n})}if(e.startsWith("![CDATA[",i+1)){const n=e.indexOf("]]>",i);if(-1!==n){r.push({type:"text",content:e.slice(i,n+3)}),l=n+3;continue}break}if(e.startsWith("!",i+1)){const n=e.indexOf(">",i);if(-1!==n){l=n+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),d=s.startsWith("/"),u=s.endsWith("/");if(d){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=u?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(t=null!=(n=r[2])?n:r[3])?t:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:u||Ce.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),n);return t}catch(o){return t=o,Ee&&console.error("Failed to parse HTML to VNodes:",t),null}var t}const Ae=["innerHTML"],ze=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const n=e,t=T(()=>(ge.value,we(n.customId))),o=h({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=T(()=>{const e=n.node.content;if(!e)return{mode:"html",content:""};if(n.node.loading&&!n.node.autoClosed)return{mode:"text",content:e};if(n.node.loading&&n.node.autoClosed){const n=We(e,t.value);if(null!==n)return{mode:"dynamic",nodes:n}}if(!Oe(e,t.value))return{mode:"html",content:e};const o=We(e,t.value);return null===o?{mode:"html",content:e}:{mode:"dynamic",nodes:o}});return(e,t)=>"dynamic"===r.value.mode?(v(),f("span",{key:0,class:C(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},[g(y(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):"text"===r.value.mode?(v(),f("span",{key:1,class:C(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},b(r.value.content),3)):(v(),f("span",{key:2,class:C(["html-inline-node",{"html-inline-node--loading":n.node.loading}]),innerHTML:r.value.content},null,10,Ae))}}),[["__scopeId","data-v-71cd1a9f"]]);ze.install=e=>{e.component(ze.__name,ze)};const Fe={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},Ve={key:0},Ue=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"InlineCodeNode",props:{node:{}},setup(e){const n=e,t=B(),o=I("markstreamTypewriter",void 0),r=I("markstreamTextStreamState",void 0),l=T(()=>{const e=t.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),i=T(()=>"boolean"==typeof l.value?l.value:"boolean"!=typeof(null==o?void 0:o.value)||o.value),a=T(()=>{var e;const n=null!=(e=t["index-key"])?e:t.indexKey;return null==n||""===n?"":String(n)}),s=S(n.node.code),d=S(""),u=S(0);function c(){return s.value+d.value}function m(e){s.value=e,d.value=""}function p(){d.value&&(s.value=c(),d.value="")}$([()=>n.node.code,a,i],([e])=>{const n=String(null!=e?e:""),t=c(),o=a.value,l=o?null==r?void 0:r.get(o):void 0,p=null!=l?l:t;return i.value?n===p?(m(n),void(o&&(null==r||r.set(o,n)))):p&&n.startsWith(p)&&n.length>p.length?(s.value=p,d.value=n.slice(p.length),u.value+=1,void(o&&(null==r||r.set(o,n)))):(m(n),void(o&&(null==r||r.set(o,n)))):(m(n),void(o&&(null==r||r.set(o,n))))},{immediate:!0}),$(i,e=>{e||m(c())});const h=T(()=>u.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(e,n)=>(v(),f("code",Fe,[s.value?(v(),f("span",Ve,b(s.value),1)):E("",!0),d.value?(v(),f("span",{key:1,class:C(["inline-code-stream-delta",[h.value]]),onAnimationend:p},b(d.value),35)):E("",!0)]))}}),[["__scopeId","data-v-ffb68151"]]);Ue.install=e=>{e.component(Ue.__name,Ue)};const Xe={class:"markstream-vue"},qe=["id"],Ge=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const n=e,t=T(()=>{if(void 0!==n.isDark&&null!==n.isDark)return Boolean(n.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=S(null),r=S({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=S(!1);let i=null;function a(){return u(this,null,function*(){var e,t;if(!n.anchorEl||!o.value)return;const l=[J(null!=(e=n.offset)?e:8),Q(),ee({padding:8})],{x:i,y:a}=yield ne(n.anchorEl,o.value,{placement:null!=(t=n.placement)?t:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return $(()=>n.visible,e=>u(null,null,function*(){if(e)if(l.value=!1,yield L(),n.anchorEl&&o.value)try{const e=n.anchorEl.getBoundingClientRect();yield a();const t=r.value.transform;if(null!=n.originX&&null!=n.originY){const o=Math.abs(Number(n.originX)-e.left),i=Math.abs(Number(n.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(n.originX)}px, ${Math.round(n.originY)}px, 0)`,yield L(),l.value=!0,yield L(),r.value.transform=t):l.value=!0}else l.value=!0;i=Z(n.anchorEl,o.value,a)}catch(t){yield a(),l.value=!0,i=Z(n.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),$([()=>n.anchorEl,()=>n.placement,()=>n.content],()=>u(null,null,function*(){n.visible&&n.anchorEl&&o.value&&(yield L(),yield a())})),N(()=>{i&&i()}),(i,a)=>(v(),j(H,{to:"body"},[w("div",Xe,[g(P,{name:"tooltip",appear:""},{default:D(()=>[R(w("div",{id:n.id,ref_key:"tooltip",ref:o,style:K({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:C(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[t.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},b(e.content),15,qe),[[O,e.visible&&l.value]])]),_:1})])]))}}),[["__scopeId","data-v-d524cc01"]]),Ye=S(!1),Ze=S(""),Je=S("top"),Qe=S(null),en=S(null),nn=S(null),tn=S(null),on=S(null);let rn=null,ln=null;function an(){rn&&(clearTimeout(rn),rn=null),ln&&(clearTimeout(ln),ln=null)}let sn=!1;function dn(e,n,t="top",o=!1,r,l){if(!e)return;!function(){if(!sn&&"undefined"!=typeof document)try{sn=!0;const e=document.createElement("div");e.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(e),W({setup:()=>()=>{var e;return _(Ge,{visible:Ye.value,"anchor-el":Qe.value,content:Ze.value,placement:Je.value,id:en.value,originX:nn.value,originY:tn.value,isDark:null!=(e=on.value)?e:void 0})}}).mount(e)}catch(e){sn=!1,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",e)}}(),an();const i=()=>{var o,i;en.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Qe.value=e,Ze.value=n,Je.value=t,nn.value=null!=(o=null==r?void 0:r.x)?o:null,tn.value=null!=(i=null==r?void 0:r.y)?i:null,on.value="boolean"==typeof l?l:null,Ye.value=!0;try{e.setAttribute("aria-describedby",en.value)}catch(a){}};o?i():rn=setTimeout(i,80)}function un(e=!1){an();const n=()=>{if(Qe.value&&en.value)try{Qe.value.removeAttribute("aria-describedby")}catch(e){}Ye.value=!1,Qe.value=null,en.value=null,nn.value=null,tn.value=null};e?n():ln=setTimeout(n,120)}const cn={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function mn(e){Object.assign(cn,e)}function pn(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const e=n();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return u(null,null,function*(){try{const n=yield import("vue-i18n"),t=n.useI18n||n.default&&n.default.useI18n;if(t&&"function"==typeof t)try{const n=t();if(n&&"function"==typeof n.t)try{globalThis.$vueI18nUse=()=>n}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var n;return null!=(n=cn[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const hn=/* @__PURE__ */Symbol("ViewportPriority");function vn(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?S(n):n;let r=null,l=null;const i=/* @__PURE__ */new Map;const a=(n,a)=>{const s=S(!1);let d,u=!1;const c=new Promise(e=>{d=()=>{u||(u=!0,e())}}),m=()=>{try{null==r||r.unobserve(n)}catch(e){}if(i.delete(n),!i.size){try{null==r||r.disconnect()}catch(e){}r=null,l=null}};if(!t||!o.value)return s.value=!0,d(),{isVisible:s,whenVisible:c,destroy:m};const p=function(n,o){if(!t)return r;if("undefined"==typeof IntersectionObserver)return null;const a=function(n,t){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,rootMargin:null!=(r=null==t?void 0:t.rootMargin)?r:"300px",threshold:null!=(l=null==t?void 0:t.threshold)?l:0}}(n,o);if(r&&(d=a,(s=l)&&s.root===d.root&&s.rootMargin===d.rootMargin&&s.threshold===d.threshold))return r;var s,d;if(r)try{r.disconnect()}catch(u){}r=new IntersectionObserver(e=>{for(const n of e){const e=i.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(u){}}null==r||r.unobserve(n.target),i.delete(n.target)}}},{root:a.root,rootMargin:a.rootMargin,threshold:a.threshold}),l=a;for(const e of i.keys())r.observe(e);return r}(n,a);return p?(i.set(n,{resolve:d,visible:s}),p.observe(n),{isVisible:s,whenVisible:c,destroy:m}):(s.value=!0,d(),{isVisible:s,whenVisible:c,destroy:m})};return A(hn,a),a}function fn(){const e=I(hn,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=S(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{try{null==t||t.unobserve(e)}catch(o){}n.delete(e)},s=t||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(t=new IntersectionObserver(e=>{for(const r of e){const e=n.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(r.target),n.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const gn={class:"relative inline-block"},yn=["src","alt","title","loading","tabindex","aria-label"],wn={class:"text-sm whitespace-nowrap"},kn={key:1,class:"text-sm text-gray-500"},xn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},bn={class:"text-sm whitespace-nowrap"},Mn={key:0,class:"mt-2 text-sm text-gray-500 italic"},_n=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:n}){const t=e,o=n,r=S(!1),l=S(!1),i=S(!1),a=S(null),s=fn(),d=S(null),u=S("undefined"==typeof window),c=S("undefined"==typeof window);"undefined"!=typeof window&&$(()=>a.value,e=>{var n;if(null==(n=d.value)||n.destroy(),d.value=null,!e)return u.value=!1,void(c.value=!1);const t=s(e,{rootMargin:"400px"});d.value=t,u.value=t.isVisible.value,c.value=!0,t.whenVisible.then(()=>{u.value=!0})},{immediate:!0}),N(()=>{var e;null==(e=d.value)||e.destroy(),d.value=null});const m=T(()=>l.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),p=T(()=>!t.lazy||u.value||!c.value),h=T(()=>/\.svg(?:\?|$)/i.test(m.value));function k(){t.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,o("error",t.node.src))}function x(){r.value=!0,l.value=!1,o("load",m.value)}function M(e){e.preventDefault(),r.value&&!l.value&&o("click",[e,m.value])}const{t:_}=pn();return $(m,()=>{r.value=!1,l.value=!1}),(n,o)=>(v(),f("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[w("div",gn,[g(P,{name:"img-switch",mode:"out-in"},{default:D(()=>{var i,a,s,d,u;return[e.node.loading||l.value||!p.value?l.value?e.node.loading||t.fallbackSrc?E("",!0):(v(),f("div",xn,[z(n.$slots,"error",{node:t.node,displaySrc:m.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[1]||(o[1]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),w("span",bn,b(y(_)("image.loadError")),1)],!0)])):(v(),f("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:K(h.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?z(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:m.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[0]||(o[0]=w("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),w("span",wn,b(y(_)("image.loading")),1)],!0):(v(),f("span",kn,b(e.node.raw),1))],4)):(v(),f("img",{key:"image",src:m.value,alt:String(null!=(a=null!=(i=t.node.alt)?i:t.node.title)?a:""),title:String(null!=(d=null!=(s=t.node.title)?s:t.node.alt)?d:""),class:C(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!r.value,"opacity-100":r.value,"cursor-pointer":r.value}]),style:K(h.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(u=t.node.alt)?u:y(_)("image.preview"),onError:k,onLoad:x,onClick:M},null,46,yn))]}),_:3})]),t.showCaption&&t.node.alt?(v(),f("figcaption",Mn,b(t.node.alt),1)):E("",!0)],512))}}),[["__scopeId","data-v-9b5d9aad"]]);_n.install=e=>{e.component(_n.__name,_n)};let Tn=null,Cn=!1,Bn=$n;function In(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function Sn(){try{const e=globalThis;return In(null==e?void 0:e.katex)}catch(e){return null}}function $n(){return u(null,null,function*(){const e=Sn();if(e)return e;const n=yield import("katex");try{yield import("katex/dist/contrib/mhchem")}catch(t){}return In(n)})}function En(e){Bn=e,Tn=null,Cn=!1}function Ln(e){En(null!=e?e:$n)}function Nn(){En(null)}function jn(){return"function"==typeof Bn}function Hn(){var e;const n=Sn();if(n)return Tn=n,Tn;if(Tn)return Tn;const t=Bn;if(!t||t===$n)return null;try{const n=t();return n&&"function"!=typeof(null==n?void 0:n.then)?(Tn=null!=(e=In(n))?e:n,Tn):null}catch(o){return null}}function Pn(){return u(this,null,function*(){var e;const n=Sn();if(n)return Tn=n,Tn;if(Tn)return Tn;if(Cn)return null;const t=Bn;if(!t)return Cn=!0,null;try{const n=yield t();if(n)return Tn=null!=(e=In(n))?e:n,Tn}catch(o){}return Cn=!0,null})}const Dn=M(!1);let Rn=null;const Kn={key:0},On=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=e,t=(Rn||(Rn=Pn().then(e=>{Dn.value=!!e}).catch(()=>{Dn.value=!1})),F(Dn)),o=B(),r=I("markstreamTypewriter",void 0),l=I("markstreamTextStreamState",void 0),i=I("markstreamStreamVersion",void 0),a=T(()=>{const e=o.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),s=T(()=>"boolean"==typeof a.value?a.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),d=T(()=>{var e;const n=null!=(e=o["index-key"])?e:o.indexKey;return null==n||""===n?"":String(n)}),u=S(n.node.content),c=S(""),m=S(0);function p(){return u.value+c.value}function h(e){u.value=e,c.value=""}function g(){c.value&&(u.value=p(),c.value="")}$([()=>n.node.content,d,s,()=>null==i?void 0:i.value],([e])=>{const n=String(null!=e?e:""),t=p(),o=d.value,r=o?null==l?void 0:l.get(o):void 0,i=null!=r?r:t;return s.value?n===i?(c.value?g():t!==n&&h(n),void(o&&(null==l||l.set(o,n)))):i&&n.startsWith(i)&&n.length>i.length?(u.value=i,c.value=n.slice(i.length),m.value+=1,void(o&&(null==l||l.set(o,n)))):(h(n),void(o&&(null==l||l.set(o,n)))):(h(n),void(o&&(null==l||l.set(o,n))))},{immediate:!0}),$(s,e=>{e||h(p())});const w=T(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(n,o)=>(v(),f("span",{class:C([[y(t)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},[u.value?(v(),f("span",Kn,b(u.value),1)):E("",!0),c.value?(v(),f("span",{key:1,class:C(["text-node-stream-delta",[w.value]]),onAnimationend:g},b(c.value),35)):E("",!0)],2))}}),[["__scopeId","data-v-03641323"]]);On.install=e=>{e.component(On.__name,On)};const Wn=V(()=>u(null,null,function*(){var e,n;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(n=null==(e=globalThis.process)?void 0:e.env)?void 0:n.NODE_ENV)&&"undefined"!=typeof window)return e=>{var n,t;return _(On,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield Pn())return(yield import("./index2.js")).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return e=>{var n,t;return _(On,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),An=V(()=>u(null,null,function*(){try{if(yield Pn())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var n,t;return _(On,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),zn=/* @__PURE__ */h({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(v(),f("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabindex:"0",onClick:t[0]||(t[0]=t=>n.$emit("click",t,e.node.id,e.messageId,e.threadId)),onMouseenter:t[1]||(t[1]=t=>n.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)),onMouseleave:t[2]||(t[2]=t=>n.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId))},b(e.node.id),33))});zn.install=e=>{e.component(zn.__name,zn)};const Fn={class:"superscript-node"},Vn={key:1},Un=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,strong:Zn,emphasis:ut,footnote_reference:_e,strikethrough:Qn,highlight:st,insert:it,subscript:Gn,emoji:pe,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("sup",Fn,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),f(k,{key:`${e.indexKey||"superscript"}-${r}`},[o[t.type]?(v(),j(U(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",Vn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);Un.install=e=>{e.component(Un.__name,Un)};const Xn={class:"subscript-node"},qn={key:1},Gn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,strong:Zn,emphasis:ut,footnote_reference:_e,strikethrough:Qn,highlight:st,insert:it,superscript:Un,emoji:pe,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("sub",Xn,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),f(k,{key:`${e.indexKey||"subscript"}-${r}`},[o[t.type]?(v(),j(U(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",qn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Yn={class:"strong-node"},Zn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,emphasis:ut,strikethrough:Qn,highlight:st,insert:it,subscript:Gn,superscript:Un,emoji:pe,footnote_reference:_e,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("strong",Yn,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),j(U(o[t.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const Jn={class:"strikethrough-node"},Qn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,strong:Zn,emphasis:ut,highlight:st,insert:it,subscript:Gn,superscript:Un,emoji:pe,footnote_reference:_e,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("del",Jn,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),j(U(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const et=["href","title","aria-label","aria-hidden"],nt=["aria-hidden"],tt={class:"link-text-wrapper relative inline-flex"},ot={class:"leading-[normal] link-text"},rt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=I("markstreamShowTooltips",void 0),o=T(()=>{const e=null==t?void 0:t.value;return"boolean"==typeof e?e:n.showTooltip}),r=T(()=>{var e,t,o,r,l,i;const a=void 0!==n.underlineBottom?"number"==typeof n.underlineBottom?`${n.underlineBottom}px`:String(n.underlineBottom):"-3px",s=null!=(e=n.animationOpacity)?e:.35,d=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(t=n.color)?t:"#0366d6","--underline-height":`${null!=(o=n.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(d),"--underline-duration":`${null!=(r=n.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=n.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(i=n.animationIteration)?i:"infinite"}}),l={text:On,strong:Zn,strikethrough:Qn,emphasis:ut,image:_n,html_inline:ze,inline_code:Ue},i=T(()=>(ge.value,we(n.customId))),s=B(),d=T(()=>{var e,t;const o=null==(e=n.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const n of o)Array.isArray(n)&&n[0]&&(r[String(n[0])]=String(null!=(t=n[1])?t:""));else for(const[n,l]of Object.entries(o))n&&null!=l&&!1!==l&&(r[n]=!0===l?"":String(l));return Pe(r)}),u=T(()=>{const e=a(a({},s),d.value);return delete e.title,e});function c(){o.value&&un()}const m=T(()=>{var e,t,o;const r=null==(e=n.node)?void 0:e.title;return"string"==typeof r&&r.trim().length>0?r:String(null!=(o=null==(t=n.node)?void 0:t.href)?o:"")});return(t,a)=>{var d,p;return e.node.loading?(v(),f("span",X({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(s),{style:r.value}),[w("span",tt,[w("span",ot,[g(y(On),{class:"leading-[normal] link-text",node:{type:"text",content:String(null!=(d=e.node.text)?d:""),raw:String(null!=(p=e.node.text)?p:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),a[1]||(a[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,nt)):(v(),f("a",X({key:0,class:"link-node",href:e.node.href,title:o.value?"":m.value,"aria-label":`Link: ${m.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},u.value,{style:r.value,onMouseenter:a[0]||(a[0]=e=>function(e){var t,r,l;if(!o.value)return;const i=e,a=null!=(null==i?void 0:i.clientX)&&null!=(null==i?void 0:i.clientY)?{x:i.clientX,y:i.clientY}:void 0,s=(null==(t=n.node)?void 0:t.title)||(null==(r=n.node)?void 0:r.href)||(null==(l=n.node)?void 0:l.text)||"";dn(e.currentTarget,s,"top",!1,a)}(e)),onMouseleave:c}),[(v(!0),f(k,null,x(e.node.children,(t,o)=>(v(),j(U(function(e){return i.value[e.type]||l[e.type]||null}(t)),{key:`${e.indexKey||"emphasis"}-${o}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${o}`},null,8,["node","custom-id","index-key"]))),128))],16,et))}}}),[["__scopeId","data-v-a4831c9e"]]);rt.install=e=>{e.component(rt.__name,rt)};const lt={class:"insert-node"},it=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,strong:Zn,emphasis:ut,strikethrough:Qn,highlight:st,subscript:Gn,superscript:Un,emoji:pe,footnote_reference:_e,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("ins",lt,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),j(U(o[t.type]),{key:`${e.indexKey||"insert"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);it.install=e=>{e.component(it.__name,it)};const at={class:"highlight-node"},st=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,strong:Zn,emphasis:ut,strikethrough:Qn,insert:it,subscript:Gn,superscript:Un,emoji:pe,footnote_reference:_e,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("mark",at,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),j(U(o[t.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);st.install=e=>{e.component(st.__name,st)};const dt={class:"emphasis-node"},ut=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,html_inline:ze,strong:Zn,strikethrough:Qn,highlight:st,insert:it,subscript:Gn,superscript:Un,emoji:pe,footnote_reference:_e,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),f("em",dt,[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),j(U(o[t.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);ut.install=e=>{e.component(ut.__name,ut)};const ct=["href","title"],mt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const n=e;function t(e){var t;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(t=n.node.id)?t:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(n,o)=>(v(),f("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,ct))}}),[["__scopeId","data-v-4756ce0d"]]);mt.install=e=>{e.component(mt.__name,mt)};const pt=["id"],ht={class:"flex-1"},vt=/* @__PURE__ */h({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[w("div",ht,[g(y(zt),{"index-key":`footnote-${n.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"])])],8,pt))}});vt.install=e=>{e.component(vt.__name,vt)};const ft={class:"hard-break"},gt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(v(),f("br",ft))}),[["__scopeId","data-v-50c58f70"]]);gt.install=e=>{e.component(gt.__name,gt)};const yt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=a({text:On,inline_code:Ue,link:rt,image:_n,strong:Zn,emphasis:ut,strikethrough:Qn,highlight:st,insert:it,subscript:Gn,superscript:Un,emoji:pe,checkbox:ae,checkbox_input:ae,footnote_reference:_e,hardbreak:gt,math_inline:Wn,reference:zn},t);return(t,r)=>(v(),j(U(`h${e.node.level}`),X({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:D(()=>[(v(!0),f(k,null,x(e.node.children,(t,r)=>(v(),j(U(o[t.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-ffb7cf51"]]),wt=yt;wt.install=e=>{e.component(yt.__name,yt)};const kt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=T(()=>{var e;return null!=(e=n.node)?e:n.item}),o=T(()=>null==n.value?{}:{value:n.value});return(e,r)=>{var l,i;return v(),f("li",X({class:"list-item pl-1.5 my-2",dir:"auto"},o.value),[g(y(zt),X({showTooltips:n.showTooltips},{"index-key":`list-item-${n.indexKey}`,nodes:null!=(i=null==(l=t.value)?void 0:l.children)?i:[],"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=n=>e.$emit("copy",n))}),null,16,["index-key","nodes","custom-id","typewriter"])],16)}}}),[["__scopeId","data-v-ce59e808"]]);kt.install=e=>{e.component(kt.__name,kt)};const xt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const n=T(()=>(ge.value,we(e.customId).list_item||kt));return(t,o)=>(v(),j(U(e.node.ordered?"ol":"ul"),{class:C(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:D(()=>[(v(!0),f(k,null,x(e.node.items,(r,l)=>{var i;return v(),j(U(n.value),X({key:`${e.indexKey||"list"}-${l}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(i=e.node.start)?i:1)+l:void 0,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))}),null,16,["node","custom-id","index-key","typewriter","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-8e81cbc8"]]);xt.install=e=>{e.component(xt.__name,xt)};const bt={key:1,class:"html-block-node__raw"},Mt=["innerHTML"],_t={key:1,class:"html-block-node__placeholder"},Tt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const n=e,t=T(()=>{const e=n.node.attrs;if(e){if(Array.isArray(e)){const n={};for(const t of e){if(!t||t.length<2)continue;const[e,o]=t;null!=e&&(n[String(e)]=null==o?"":String(o))}return n}return e}}),o=T(()=>(ge.value,we(n.customId))),r=h({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),l=S(null),i=S("undefined"==typeof window),a=S(n.node.content),s=T(()=>{var e,t,r;if(!i.value)return{mode:"html",content:null!=(e=a.value)?e:""};const l=null!=(t=a.value)?t:n.node.content;if(!l)return{mode:"html",content:""};if(n.node.loading){const e=We(l,o.value);return null===e?{mode:"text",content:null!=(r=n.node.raw)?r:l}:{mode:"dynamic",nodes:e}}if(!Oe(l,o.value))return{mode:"html",content:l};const s=We(l,o.value);return null===s?{mode:"html",content:l}:{mode:"dynamic",nodes:s}}),d=fn(),u=S(null),c=!!n.node.loading;return"undefined"!=typeof window?($(l,e=>{var t,o;if(null==(o=null==(t=u.value)?void 0:t.destroy)||o.call(t),u.value=null,!c)return i.value=!0,void(a.value=n.node.content);if(!e)return void(i.value=!1);const r=d(e,{rootMargin:"400px"});u.value=r,i.value=r.isVisible.value,r.whenVisible.then(()=>{i.value=!0})},{immediate:!0}),$(()=>n.node.content,e=>{c&&!i.value||(a.value=e)})):i.value=!0,N(()=>{var e,n;null==(n=null==(e=u.value)?void 0:e.destroy)||n.call(e),u.value=null}),(n,o)=>(v(),f("div",X({ref_key:"htmlRef",ref:l,class:"html-block-node"},t.value),[i.value?(v(),f(k,{key:0},["dynamic"===s.value.mode?(v(),j(y(r),{key:0,nodes:s.value.nodes},null,8,["nodes"])):"text"===s.value.mode?(v(),f("pre",bt,b(s.value.content),1)):(v(),f("div",{key:2,innerHTML:a.value},null,8,Mt))],64)):(v(),f("div",_t,[z(n.$slots,"placeholder",{node:e.node},()=>[o[0]||(o[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),o[1]||(o[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),o[2]||(o[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-b7cace40"]]);Tt.install=e=>{e.component(Tt.__name,Tt)};const Ct=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=we(n.customId),o=T(()=>0===n.node.children.length?"p":n.node.children.every(e=>{var n;return"image"===e.type||"text"===e.type&&""===String(null!=(n=e.content)?n:"").trim()})?"div":"p"),r=a({inline_code:Ue,image:_n,link:rt,hardbreak:gt,emphasis:ut,strong:Zn,strikethrough:Qn,highlight:st,insert:it,subscript:Gn,superscript:Un,html_inline:ze,html_block:Tt,emoji:pe,checkbox:ae,math_inline:Wn,checkbox_input:ae,reference:zn,footnote_anchor:mt,footnote_reference:_e,text:On},t);return(t,l)=>(v(),j(U(o.value),{dir:"auto",class:"paragraph-node"},{default:D(()=>[(v(!0),f(k,null,x(e.node.children,(t,o)=>(v(),j(U(r[t.type]),{key:`${e.indexKey||"paragraph"}-${o}`,node:t,"index-key":`${e.indexKey}-${o}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"]))),128))]),_:1}))}}),[["__scopeId","data-v-83b021c4"]]);Ct.install=e=>{e.component(Ct.__name,Ct)};const Bt=["aria-busy","aria-label","data-language"],It=["textContent"],St=/* @__PURE__ */h({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=T(()=>{var e,t,o;const r=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=T(()=>`language-${t.value}`),r=T(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,l)=>(v(),f("pre",{class:C([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":t.value,"data-markstream-pre":"1",tabindex:"0"},[w("code",{translate:"no",textContent:b(e.node.code)},null,8,It)],10,Bt))}});St.install=e=>{e.component(St.__name,St)};const $t={class:"table-node-wrapper"},Et=["aria-busy"],Lt={class:"border-[var(--table-border,#cbd5e1)]"},Nt={class:"border-b"},jt={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Ht=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=T(()=>{var e;return null!=(e=n.node.loading)&&e}),o=T(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(r,l)=>(v(),f("div",$t,[w("table",{class:C(["my-8 text-sm table-node",{"table-node--loading":t.value}]),"aria-busy":t.value},[w("thead",Lt,[w("tr",Nt,[(v(!0),f(k,null,x(e.node.header.cells,(e,t)=>(v(),f("th",{key:`header-${t}`,dir:"auto",class:C(["font-semibold p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[g(y(zt),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[0]||(l[0]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),w("tbody",null,[(v(!0),f(k,null,x(o.value,(e,t)=>(v(),f("tr",{key:`row-${t}`,class:C(["border-[var(--table-border,#cbd5e1)]",[t<o.value.length-1?"border-b":""]])},[(v(!0),f(k,null,x(e.cells,(e,o)=>(v(),f("td",{key:`cell-${t}-${o}`,class:C(["p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[g(y(zt),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[1]||(l[1]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,Et),g(P,{name:"table-node-fade"},{default:D(()=>[t.value?(v(),f("div",jt,[z(r.$slots,"loading",{isLoading:t.value},()=>[l[2]||(l[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),l[3]||(l[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):E("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);Ht.install=e=>{e.component(Ht.__name,Ht)};const Pt={class:"hr-node"},Dt=/* @__PURE__ */oe({},[["render",function(e,n){return v(),f("hr",Pt)}],["__scopeId","data-v-639cbad9"]]);Dt.install=e=>{e.component(Dt.__name,Dt)};const Rt={class:"unknown-node"},Kt=/* @__PURE__ */h({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(v(),f("div",Rt,b(e.node.raw),1))}),Ot=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=T(()=>`vmr-container vmr-container-${n.node.name}`),o=we(n.customId),r=a({text:On,paragraph:Ct,heading:wt,inline_code:Ue,link:rt,image:_n,strong:Zn,emphasis:ut,strikethrough:Qn,insert:it,subscript:Gn,superscript:Un,checkbox:ae,checkbox_input:ae,hardbreak:gt,math_inline:Wn,reference:zn,list:xt,math_block:An,table:Ht},o);return(o,l)=>(v(),f("div",X({class:t.value},e.node.attrs),[(v(!0),f(k,null,x(e.node.children,(t,o)=>{return v(),j(U((l=t.type,r[l]||Kt)),{key:`${e.indexKey||"vmr-container"}-${o}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"vmr-container"}-${o}`},null,8,["custom-id","node","index-key"]);var l}),128))],16))}}),[["__scopeId","data-v-a88d22ce"]]);Ot.install=e=>{e.component(Ot.__name,Ot)};const Wt=["data-custom-id"],At=["data-node-index","data-node-type"],zt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:!0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:n}){var t,o,r;const l=e,i=n,d=S(),p=S(!1),h=/auto|scroll|overlay/i,g="undefined"!=typeof window,y=T(()=>l.debugPerformance&&g&&"undefined"!=typeof console),w=B(),b=/* @__PURE__ */new Map,M=S(0),_=T(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const n=null!=(e=w.showTooltips)?e:w["show-tooltips"];return""===n||!0===n||"true"===n||!1!==n&&"false"!==n&&void 0});function I(e,n){y.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function H(e){if(!e)return!1;const n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();return h.test(n)||h.test(t)}function R(e){const n=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,t=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return n||t}function O(e){if("undefined"==typeof window)return null;const n=null!=e?e:d.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let r=n;for(;r&&r!==t.body&&r!==o;){if(H(window.getComputedStyle(r))&&R(r))return r;r=r.parentElement}return null}A("markstreamShowTooltips",_),A("markstreamTypewriter",T(()=>!1!==l.typewriter)),A("markstreamTextStreamState",b),A("markstreamStreamVersion",M),$([()=>l.content,()=>l.nodes],()=>{M.value+=1},{immediate:!0});const W=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,z=c(W),F=/* @__PURE__ */new Map,Y=T(()=>{const{key:e,tags:n}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const n=/* @__PURE__ */new Set,t=[];for(const o of e){const e=J(o);e&&!n.has(e)&&(n.add(e),t.push(e))}return 0===t.length?{key:"",tags:[]}:{key:t.join(","),tags:t}}(l.customHtmlTags);if(!e)return z;const t=F.get(e);if(t)return t;const o=c(W,{customHtmlTags:n});return F.set(e,o),o}),Z=T(()=>{const e=Y.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function J(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}const Q=T(()=>{var e,n,t,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(n=l.final)?n:r.final,s=[...null!=(t=l.customHtmlTags)?t:[],...null!=(o=r.customHtmlTags)?o:[]].map(J).filter(Boolean),d=null!=i,u=s.length>0;return d||u?a(a(a({},r),d?{final:i}:{}),u?{customHtmlTags:Array.from(new Set(s))}:{}):r}),ee=T(()=>{var e;const n=null!=(e=Q.value.customHtmlTags)?e:[];return new Set(n.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),ne=T(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return q(l.nodes.slice());if(l.content){const e=y.value?performance.now():0,n=m(l.content,Z.value,Q.value);return y.value&&I("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:l.content.length}),q(n)}return[]}),te=T(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),oe=T(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&ne.value.length>te.value}),le=T(()=>!1!==l.viewportPriority&&!p.value),ie=vn(e=>{var n;return O(null!=(n=null!=e?e:d.value)?n:null)},le),se=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,de=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,ue="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),me=g&&"function"==typeof window.requestIdleCallback,he=T(()=>{var e;const n=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),ve=T(()=>{var e;const n=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:he.value);return Number.isFinite(n)?Math.max(0,n):he.value}),fe=T(()=>!1!==l.batchRendering&&he.value>0&&g&&!ue),ye=S(0),ke=S({key:l.indexKey,total:0}),xe=S(Math.max(1,he.value||1)),be=S(/* @__PURE__ */new Set),Me=/* @__PURE__ */new Map,Te=/* @__PURE__ */new Map,Ce=/* @__PURE__ */new Map,Be=/* @__PURE__ */new Map,Ie=/* @__PURE__ */new WeakMap,Se=S(0),$e=T(()=>(Se.value,Array.from(Be.entries()).sort((e,n)=>e[0]-n[0]))),Ee=S(0),Le=S([]),Ne=S([]),je=S(null);let He=null,Pe=null;const De=T(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!oe.value&&!(ne.value.length>900)&&le.value}),Re=T(()=>{var e;return fe.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Ke=S({batchSize:he.value,initial:ve.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Re.value}),Oe=T(()=>!!ie&&(De.value||oe.value)),We=T(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),Ae=S(0),Fe=G({start:0,end:0}),Ve=/* @__PURE__ */new Map,Xe=T(()=>{if(!oe.value)return ne.value.length;const e=We.value,n=Math.max(Fe.end+e,ve.value),t=Math.min(ne.value.length,n);return Math.max(ye.value,t)});function qe(e){var n,t,o,r;const l=O(null!=(n=null!=e?e:d.value)?n:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=d.value)?void 0:t.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function Ge(e){if(!g)return!1;try{const n=window.getComputedStyle(e);return!!(n.display||"").toLowerCase().includes("flex")&&(n.flexDirection||"").toLowerCase().endsWith("reverse")}catch(n){return!1}}function Ye(){He&&(He(),He=null),je.value=null}function Ze(){if(!g||!oe.value)return;const e=qe();if(!e||je.value===e)return;Ye();const n=()=>Qe();e.addEventListener("scroll",n,{passive:!0}),je.value=e,He=()=>{e.removeEventListener("scroll",n)}}function Je(){var e,n,t;if(!Pe)return;const o=null!=(t=null==(n=null==(e=d.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;Pe.viaTimeout?o?o.clearTimeout(Pe.id):clearTimeout(Pe.id):null==de||de(Pe.id),Pe=null}function Qe(e={}){var n,t,o;if(!oe.value)return;if(!g)return void en(!0);if(e.immediate)return Je(),void en(!0);if(Pe)return;const r=()=>{Pe=null,en()};if(se)Pe={id:se(r),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=d.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Pe={id:l,viaTimeout:!0}}}function en(e=!1){var n,t,o,r,l,i,a;if(!oe.value)return;const s=je.value||qe();if(!s)return;const u=s.ownerDocument||(null==(n=d.value)?void 0:n.ownerDocument)||document,c=(null==u?void 0:u.defaultView)||("undefined"!=typeof window?window:null),m=s===(null==u?void 0:u.documentElement)||s===(null==u?void 0:u.body),p=ne.value.length;if(!m&&p>0&&Ge(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,r=function(e){var n;const t=ne.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);if(Ee.value===t.length){const n=cn(0,t.length);return fn(Math.max(0,n-e))}let o=e;for(let r=t.length-1;r>=0;r--){const e=null!=(n=tn[r])?n:un.value;if(o<=e)return r;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),l=nn(r,0,Math.max(0,p-1));return void((e||Math.abs(l-Ae.value)>1)&&(Ae.value=l))}const h=m?null:s.getBoundingClientRect(),v=m?0:h.top,f=m?null!=(o=null!=(t=null==c?void 0:c.innerHeight)?t:s.clientHeight)?o:0:h.bottom,g=$e.value;let y=null,w=null;for(const[d,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=v||e.top>=f||(null==y&&(y=d),w=d)}if(null==y||null==w){const e=d.value;if(!e)return;const n=m?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,r,l,i,a,s;if(t)return null!=(i=null!=(l=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?l:null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)?i:0;const d=e.scrollTop;if(!Ge(e))return d;const u=d<0?-d:d;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-u}(s,u,m),o=m?(()=>{const t=e.getBoundingClientRect(),o=(m?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,r=0;for(;t&&t!==n&&r++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),p=m?null!=(a=null!=(i=null!=(l=null==c?void 0:c.innerHeight)?l:null==(r=null==u?void 0:u.documentElement)?void 0:r.clientHeight)?i:s.clientHeight)?a:0:s.clientHeight,h=fn(o+.5*Math.max(0,p));return void(Ae.value=nn(h,0,Math.max(0,ne.value.length-1)))}const k=Math.round((y+w)/2);!e&&Math.abs(k-Ae.value)<=1||(Ae.value=nn(k,0,Math.max(0,ne.value.length-1)))}function nn(e,n,t){return Math.min(Math.max(e,n),t)}const tn=G({}),on=G({total:0,count:0});function rn(){for(const e of Object.keys(tn))delete tn[Number(e)];on.total=0,on.count=0,Ee.value=0,Le.value=[],Ne.value=[]}function ln(e,n,t){for(let o=n+1;o<e.length;o+=o&-o)e[o]+=t}function an(e,n){let t=0;for(let o=n+1;o>0;o-=o&-o)t+=e[o];return t}function sn(e,n,t){if(t<=n)return 0;const o=an(e,t-1);return n<=0?o:o-an(e,n-1)}function dn(e){Ee.value=e;const n=new Array(e+1).fill(0),t=new Array(e+1).fill(0);for(const[o,r]of Object.entries(tn)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(ln(n,l,i),ln(t,l,1))}Le.value=n,Ne.value=t}const un=T(()=>on.count>0?Math.max(12,on.total/on.count):32);function cn(e,n){var t,o;if(e>=n)return 0;if(Ee.value!==ne.value.length){let o=0;for(let r=e;r<n;r++)o+=null!=(t=tn[r])?t:un.value;return o}const r=Le.value,l=Ne.value;if(!r.length||!l.length){let t=0;for(let r=e;r<n;r++)t+=null!=(o=tn[r])?o:un.value;return t}return sn(r,e,n)+(n-e-sn(l,e,n))*un.value}$(()=>ne.value.length,e=>{e<=0?rn():(e<Ee.value&&function(e){if(e<=0)return void rn();let n=0,t=0;for(const[o,r]of Object.entries(tn)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete tn[l]:(n+=i,t++)}on.total=n,on.count=t}(e),e!==Ee.value&&dn(e))},{immediate:!0});const mn=T(()=>{if(!oe.value)return ne.value.map((e,n)=>({node:e,index:n}));const e=ne.value.length,n=nn(Fe.start,0,e),t=nn(Fe.end,n,e);return ne.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),pn=T(()=>oe.value?cn(0,Math.min(Fe.start,ne.value.length)):0),hn=T(()=>{if(!oe.value)return 0;const e=ne.value.length;return cn(Math.min(Fe.end,e),e)});function fn(e){var n;if(e<=0)return 0;const t=ne.value;if(Ee.value===t.length&&Le.value.length&&Ne.value.length){const n=un.value,o=Le.value,r=Ne.value,l=e=>e<=0?0:an(o,e-1)+(e-an(r,e-1))*n;let i=0,a=t.length-1,s=t.length-1;for(;i<=a;){const n=i+a>>1;l(n+1)>=e?(s=n,a=n-1):i=n+1}return s}let o=e;for(let r=0;r<t.length;r++){const e=null!=(n=tn[r])?n:un.value;if(o<=e)return r;o-=e}return Math.max(0,t.length-1)}function gn(){Se.value+=1}function yn(e,n){const t=be.value,o=t.has(e);if(n){if(o)return;const n=new Set(t);return n.add(e),void(be.value=n)}if(!o)return;const r=new Set(t);r.delete(e),be.value=r}function wn(){0!==be.value.size&&(be.value=/* @__PURE__ */new Set)}function kn(e){if(!Me.size)return;if(!oe.value)return;let n=!1;for(const[t,o]of Me)t>=e&&(o.destroy(),Me.delete(t),De.value&&yn(t,!1),En(t),Be.delete(t)&&(n=!0));n&&gn()}function xn(e,n){De.value&&yn(e,n),n&&(oe.value?Qe():Ae.value=nn(e,0,Math.max(0,ne.value.length-1)))}function bn(e){const n=Te.get(e);n&&(n(),Te.delete(e));const t=Me.get(e);t&&(t.destroy(),Me.delete(e)),En(e)}function Mn(e,n){let t=!1;if(n){const o=Be.get(e);Be.set(e,n),o!==n&&(t=!0)}else Be.delete(e)&&(t=!0);if(t&&gn(),n||En(e),!Oe.value||!ie)return bn(e),void(n&&xn(e,!0));if(!oe.value&&De.value&&!p.value&&Me.size>=640&&(function(){if(!p.value){p.value=!0;for(const e of Me.values())e.destroy();if(Me.clear(),g)for(const e of Ce.values())window.clearTimeout(e);Ce.clear(),wn()}}(),!Oe.value||!ie))return bn(e),void(n&&xn(e,!0));if(e<ve.value&&!oe.value)return bn(e),void xn(e,!0);if(be.value.has(e))return bn(e),void xn(e,!0);if(!n)return void bn(e);bn(e);const o=ie(n,{rootMargin:"400px"});if(!o)return;Me.set(e,o),xn(e,o.isVisible.value),De.value&&function(e){if(!g||!De.value)return;En(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(Ce.delete(e),!De.value)return;if(be.value.has(e))return;const o=Be.get(e);if(!o)return;const r=qe(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,d=a?0:s.top,u=a?null!=(t=null!=(n=i.innerHeight)?n:null==r?void 0:r.clientHeight)?t:0:s.bottom,c=o.getBoundingClientRect();c.bottom>=d-500&&c.top<=u+500&&xn(e,!0)},1800+n);Ce.set(e,t)}(e);let r=null;r=$(()=>o.isVisible.value,n=>{if(n){En(e),xn(e,!0),null==r||r(),Te.delete(e),Me.get(e)===o&&Me.delete(e);try{o.destroy()}catch(t){}}},{immediate:!0}),Te.set(e,r),oe.value&&Qe()}let Tn=null,Cn=null,Bn=!1,In=null,Sn=null;function $n(){g&&(null!=Tn&&(null==de||de(Tn),Tn=null),null!=Cn&&(window.clearTimeout(Cn),Cn=null),null!=Sn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Sn),Sn=null),Bn=!1,In=null)}function En(e){if(!g)return;const n=Ce.get(e);null!=n&&(window.clearTimeout(n),Ce.delete(e))}function Ln(e,n={}){var t,o;if(!Re.value)return;const r=Xe.value;if(ye.value>=r)return;const i=Math.max(1,e),a=e=>{var n;Tn=null,Cn=null,Sn=null,Bn=!1;const t=null!=In?In:i;In=null;const o=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),a=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();ye.value=Math.min(r,ye.value+Math.max(1,e)),kn(ye.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!Re.value)return;const t=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),o=Math.max(1,he.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*t?xe.value=Math.max(r,Math.floor(.7*xe.value)):e<.5*t&&xe.value<o&&(xe.value=Math.min(o,Math.ceil(1.2*xe.value)))}(t),t};let s=t;for(;(a(s),!(ye.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(xe.value));ye.value<r&&Nn()};if(!g||n.immediate)return void a();const s=Math.max(0,null!=(t=l.renderBatchDelay)?t:16);if(In=null!=In?Math.max(In,i):i,!Bn){if(Bn=!0,!ue&&me&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(Sn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}se&&!ue?Tn=se(()=>{0!==s?Cn=window.setTimeout(()=>a(),s):a()}):Cn=window.setTimeout(()=>a(),s)}}function Nn(){Re.value&&Ln(fe.value?Math.max(1,Math.round(xe.value)):Math.max(1,he.value))}$([()=>ne.value,()=>ne.value.length,()=>Re.value,()=>he.value,()=>ve.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const n=ne.value.length,t=ke.value,o=l.indexKey,r=void 0!==o&&o!==t.key,i=n!==t.total,a=r||i;ke.value={key:o,total:n};const s=Ke.value,d=null!=(e=l.renderBatchDelay)?e:16,u=s.batchSize!==he.value||s.initial!==ve.value||s.delay!==d||s.enabled!==Re.value;Ke.value={batchSize:he.value,initial:ve.value,delay:d,enabled:Re.value},r&&(rn(),n>0&&dn(n)),(a||u||!Re.value)&&$n(),(a||u)&&(xe.value=Math.max(1,he.value||1)),a&&oe.value&&Qe({immediate:!0});const c=Xe.value;if(!n)return ye.value=0,void kn(0);if(!Re.value)return ye.value=c,void kn(ye.value);const m=r||0===t.total;ye.value=m||u?Math.min(c,ve.value):Math.min(ye.value,c);const p=Math.max(1,ve.value||he.value||n);ye.value<c?Ln(p,{immediate:!g}):kn(ye.value)},{immediate:!0}),$(()=>oe.value,e=>{if(!e)return Ye(),void Je();Ze(),Qe({immediate:!0})},{immediate:!0}),$([()=>ne.value.length,()=>oe.value],e=>u(null,[e],function*([e,n]){n&&e&&g&&(yield L(),Qe({immediate:!0}))}),{flush:"post"}),$(()=>d.value,()=>{oe.value&&(Ze(),Qe({immediate:!0}))}),$(()=>ne.value.length,()=>{oe.value&&Qe({immediate:!0})}),$(()=>De.value,e=>{if(e)for(const[n,t]of Be)Mn(n,t);else{for(const e of Me.values())e.destroy();Me.clear();for(const e of Array.from(Ce.keys()))En(e);wn();for(const[e,n]of Be)n&&xn(e,!0)}},{immediate:!1}),$([()=>l.viewportPriority,()=>ne.value.length],([e,n])=>{!1!==e?p.value&&n<=200&&(p.value=!1):p.value=!1}),$(()=>ye.value,()=>{oe.value&&Qe({immediate:!0})}),$([Ae,te,We,()=>ne.value.length,oe],()=>{!function(){const e=ne.value.length;if(!oe.value||0===e)return Fe.start=0,void(Fe.end=e);const n=Math.min(te.value,e),t=We.value,o=nn(Ae.value-t,0,Math.max(0,e-n));Fe.start=o,Fe.end=Math.min(e,o+n)}()},{immediate:!0}),$([()=>ne.value.length,oe,te,We,()=>Fe.start,()=>Fe.end],([e,n,t,o,r,l])=>{y.value&&I("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:Ae.value,scroll:n?(()=>{const e=je.value||qe();return e?{reverse:Ge(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:ye.value})}),$(()=>Xe.value,(e,n)=>{Re.value&&("number"==typeof n&&e<=n||e>ye.value&&Nn())}),N(()=>{$n();for(const e of Me.values())e.destroy();Me.clear();for(const e of Te.values())e();Te.clear();for(const e of Array.from(Ce.keys()))En(e);Ye(),Je()});const jn=V(()=>u(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),St}})),Hn=V(()=>u(null,null,function*(){try{return(yield import("./index5.js")).default}catch(e){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".',e),St}})),Pn=V(()=>u(null,null,function*(){try{return(yield import("./index6.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',e),St}})),Dn=V(()=>u(null,null,function*(){try{return(yield import("./index7.js")).default}catch(e){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".',e),St}})),Rn=T(()=>l.renderCodeBlocksAsPre?St:jn),Kn={text:On,paragraph:Ct,heading:wt,code_block:jn,list:xt,list_item:kt,blockquote:re,table:Ht,definition_list:ce,footnote:vt,footnote_reference:_e,footnote_anchor:mt,admonition:Yt,vmr_container:Ot,hardbreak:gt,link:rt,image:_n,thematic_break:Dt,math_inline:Wn,math_block:An,strong:Zn,emphasis:ut,strikethrough:Qn,highlight:st,insert:it,subscript:Gn,superscript:Un,emoji:pe,checkbox:ae,checkbox_input:ae,inline_code:Ue,html_inline:ze,reference:zn,html_block:Tt},Fn=T(()=>(ge.value,we(l.customId))),Vn=T(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Xn=T(()=>a(a({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof _.value?{showTooltips:_.value}:{}),l.codeBlockProps||{})),qn=T(()=>a({},l.mermaidProps||{})),Yn=T(()=>a({},l.d2Props||{})),Jn=T(()=>a({},l.infographicProps||{})),et=T(()=>({typewriter:l.typewriter})),nt=T(()=>a(a({},et.value),"boolean"==typeof _.value?{showTooltip:_.value}:{})),tt=T(()=>a(a({},et.value),"boolean"==typeof _.value?{showTooltips:_.value}:{})),ot=T(()=>mn.value.map(e=>{var n;let t=function(e){var n,t,o,r,l,i,s;if("code_block"!==e.type)return e;const d=e,u=[String(null!=(n=d.language)?n:""),String(null!=(t=d.loading)?t:""),String(null!=(o=d.diff)?o:""),String(null!=(r=d.code)?r:""),String(null!=(l=d.originalCode)?l:""),String(null!=(i=d.updatedCode)?i:""),String(null!=(s=d.raw)?s:"")].join("\0"),c=Ie.get(d);if(c&&c.signature===u)return c.node;const m=a({},d);return Ie.set(d,{signature:u,node:m}),m}(e.node);const o=at(t);let r=function(e,n){if(!e)return Kt;const t=Fn.value,o=t[String(e.type)];if("code_block"===e.type){const r=null!=n?n:at(e);if("mermaid"===r)return t.mermaid||Hn;if("infographic"===r)return t.infographic||Pn;if("d2"===r||"d2lang"===r)return t.d2||Dn;if(o)return o;return t.code_block||Rn.value}return o||Kn[String(e.type)]||Kt}(t,o);if(("html_block"===t.type||"html_inline"===t.type)&&r===Kn[t.type]){const e=String(null!=(n=t.tag)?n:"").trim().toLowerCase()||function(e){const n=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return n?n[1].toLowerCase():""}(t.content);if(e&&ee.value.has(e)){const n=Fn.value[e];n&&(r=n,t=s(a({},t),{type:e,tag:e,content:lt(t.content,e)}))}}return s(a({},e),{node:t,component:r,bindings:dt(t,o),isCodeBlock:"code_block"===t.type,indexKey:`${Vn.value}-${e.index}`})}));function lt(e,n){const t=String(null!=e?e:"");if(!n)return t;const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return t.replace(r,"").replace(l,"")}function at(e){var n;return"code_block"===(null==e?void 0:e.type)?String(null!=(n=e.language)?n:"").trim().toLowerCase():""}function dt(e,n){const t=null!=n?n:at(e);return"mermaid"===t?qn.value:"infographic"===t?Jn.value:"d2"===t||"d2lang"===t?Yn.value:"link"===e.type?nt.value:"list"===e.type?tt.value:"code_block"===e.type?Xn.value:et.value}function ct(e){i("click",e)}function pt(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseover",e)}function ht(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseout",e)}return(e,n)=>(v(),f("div",{ref_key:"containerRef",ref:d,class:C(["markstream-vue markdown-renderer",[{dark:l.isDark},{virtualized:oe.value}]]),"data-custom-id":l.customId,onClick:ct,onMouseover:pt,onMouseout:ht},[oe.value?(v(),f("div",{key:0,class:"node-spacer",style:K({height:`${pn.value}px`}),"aria-hidden":"true"},null,4)):E("",!0),(v(!0),f(k,null,x(ot.value,e=>{var t,o;return v(),f("div",{key:e.index,ref_for:!0,ref:n=>Mn(e.index,n),class:"node-slot","data-node-index":e.index,"data-node-type":e.node.type},[(o=e.index,Re.value&&o>=ye.value||!(!De.value||o<ve.value||be.value.has(o))?(v(),f("div",{key:1,class:"node-placeholder",style:K({height:`${null!=(t=tn[e.index])?t:un.value}px`})},null,4)):(v(),f("div",{key:0,ref_for:!0,ref:n=>function(e,n){n?(Ve.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=tn[e];if(tn[e]=n,t?on.total+=n-t:(on.total+=n,on.count++),Ee.value>e){const o=Le.value,r=Ne.value;if(o.length&&r.length)if(t){const r=n-t;0!==r&&ln(o,e,r)}else ln(o,e,n),ln(r,e,1)}}(e,n.offsetHeight)})):Ve.delete(e)}(e.index,n),class:"node-content"},[e.isCodeBlock||!1===l.typewriter?(v(),j(U(e.component),X({key:1,node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(v(),j(P,{key:0,name:"typewriter",appear:""},{default:D(()=>[(v(),j(U(e.component),X({node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024))],512)))],8,At)}),128)),oe.value?(v(),f("div",{key:1,class:"node-spacer",style:K({height:`${hn.value}px`}),"aria-hidden":"true"},null,4)):E("",!0)],42,Wt))}}),[["__scopeId","data-v-74a6bf34"]]);zt.install=e=>{var n,t;const o=null!=(t=null!=(n=zt.__name)?n:zt.name)?t:"NodeRenderer";e.component(o,zt)};const Ft={key:0,class:"admonition-icon"},Vt={class:"admonition-title"},Ut=["aria-expanded","aria-controls","title"],Xt={key:0},qt={key:1},Gt=["id"],Yt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,r=n,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=T(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),a=S(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(a.value=!a.value)}const d=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(v(),f("div",{class:C(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[w("div",{id:d,class:"admonition-header"},[l[o.node.kind]?(v(),f("span",Ft,b(l[o.node.kind]),1)):E("",!0),w("span",Vt,b(i.value),1),o.node.collapsible?(v(),f("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${d}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(v(),f("span",Xt,"▶")):(v(),f("span",qt,"▼"))],8,Ut)):E("",!0)]),R(w("div",{id:`${d}-content`,class:"admonition-content","aria-labelledby":d},[g(y(zt),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"])],8,Gt),[[O,!a.value]])],2))}}),[["__scopeId","data-v-ee240a2a"]]);Yt.install=e=>{e.component(Yt.__name,Yt)};const Zt=()=>import("@terrastruct/d2");let Jt=null,Qt=Zt;function eo(e){Qt=e,Jt=null}function no(e){eo(null!=e?e:Zt)}function to(){eo(null)}function oo(){return"function"==typeof Qt}function ro(){return u(this,null,function*(){if(Jt)return Jt;const e=Qt;if(!e)return null;let n;try{n=yield e()}catch(t){if(e===Zt)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw t}return n?(Jt=function(e){var n;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const t=null!=(n=e.default)?n:e;return"function"==typeof t?t:(null==t?void 0:t.D2)&&"function"==typeof t.D2?t.D2:t}(n),Jt):null})}let lo=!1,io=null,ao=!1;function so(){return u(this,null,function*(){if(io)return io;if(ao)return null;try{return io=yield import("stream-monaco"),yield function(e){return u(this,null,function*(){if(lo)return;lo=!0;const n=null==globalThis?void 0:globalThis.MonacoEnvironment;return!n||"function"!=typeof n.getWorker&&"function"!=typeof n.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(io),(yield function(e){return u(this,null,function*(){const n=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof n)return!0;try{const e=yield n(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(t){return console.warn("[markstream-vue] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",t),!1}})}(io))?io:(io=null,ao=!0,null)}catch(e){return ao=!0,null}})}function uo({R:e,H:n=0,B:t=50}){const o=e*(1-n)||1e-6;return Math.max(1,Math.floor(t/o))}function co(e){const n=e.length+10*(e.match(/\\/g)||[]).length;return n<10?"simple":n<40?"medium":"complex"}function mo(e){switch(e){case"simple":return 3;case"medium":return 10;case"complex":return 30}}function po(e,n){var t,o;let r=0;for(const l of e){const e=mo(co(l));e>r&&(r=e)}return uo({R:r,H:null!=(t=null==n?void 0:n.H)?t:0,B:null!=(o=null==n?void 0:n.B)?o:50})}const ho='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n',vo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n',fo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';let go=null,yo=null,wo=null;const ko=M(0),xo={"":fo,plain:fo,text:fo,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n',typescript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n',cs:ho,csharp:ho,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n',shell:vo,powershell:vo,sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n'},bo={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Mo(){return u(this,null,function*(){return yo||(wo||(wo=import("./languageIconExtended.js").then(e=>(yo=e.EXTENDED_LANGUAGE_ICON_MAP,ko.value++,yo)).catch(()=>null)),wo)})}function _o(e){go=null!=e?e:null}function To(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[o]=t.split(":");return o.toLowerCase()}(e);return null!=(n=bo[t])?n:t}function Co(e){const n=To(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function Bo(){return u(this,null,function*(){yield Mo()})}function Io(e){if(go){const n=go(e);if(null!=n&&""!==n)return n}const n=To(e),t=xo[n];if(t)return t;return(null==yo?void 0:yo[n])||(Mo(),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>')}const So={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},$o=new class{constructor(){d(this,"metrics",[]),d(this,"enabled",!1),d(this,"maxMetrics",1e3)}enable(){this.enabled=!0}disable(){this.enabled=!1}recordRender(e){this.enabled&&(this.metrics.push(e),this.metrics.length>this.maxMetrics&&this.metrics.shift())}getStats(){if(0===this.metrics.length)return{totalRenders:0,cacheHitRate:0,averageWorkerTime:0,averageDirectTime:0,averageCacheHitTime:0,workerSavings:0,recommendation:"Insufficient data"};const e=this.metrics.filter(e=>"worker"===e.type&&e.success),n=this.metrics.filter(e=>"direct"===e.type&&e.success),t=this.metrics.filter(e=>"cache-hit"===e.type),o=this.metrics.length,r=t.length,l=r/o*100,i=e.length>0?e.reduce((e,n)=>e+n.duration,0)/e.length:0,a=n.length>0?n.reduce((e,n)=>e+n.duration,0)/n.length:0,s=t.length>0?t.reduce((e,n)=>e+n.duration,0)/t.length:0,d=o*a-(e.reduce((e,n)=>e+n.duration,0)+n.reduce((e,n)=>e+n.duration,0)+t.reduce((e,n)=>e+n.duration,0));let u="";return u=l>70&&i<2*a?"✅ Worker + Cache is highly beneficial":l>50?"✅ Worker + Cache is beneficial":i>3*a?"⚠️ Worker overhead too high, consider direct rendering":a<5?"⚠️ Formulas too simple, Worker overhead may not be worth it":"✅ Worker prevents main thread blocking",{totalRenders:o,cacheHits:r,cacheHitRate:l.toFixed(1),workerCalls:e.length,directCalls:n.length,averageWorkerTime:i.toFixed(2),averageDirectTime:a.toFixed(2),averageCacheHitTime:s.toFixed(3),workerSavings:d.toFixed(2),recommendation:u}}printReport(){const e=this.getStats();return console.group("📊 KaTeX Rendering Performance Report"),e.totalRenders,e.cacheHits,e.cacheHitRate,e.workerCalls,e.directCalls,e.averageWorkerTime,e.averageDirectTime,e.averageCacheHitTime,e.workerSavings,e.recommendation,console.groupEnd(),e}reset(){this.metrics=[]}exportMetrics(){return{metrics:[...this.metrics],stats:this.getStats(),timestamp:Date.now()}}};function Eo(){$o.enable()}function Lo(){$o.disable()}function No(){return $o.printReport()}function jo(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(n){}return globalThis.setTimeout(e,0)}function Ho(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(n){}try{globalThis.clearTimeout(e)}catch(n){}}"undefined"!=typeof window&&(window.__katexPerfReport=No,window.__katexPerfMonitor=$o);const Po={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},Do={class:"flex items-center gap-x-2"},Ro=["innerHTML"],Ko={class:"text-sm font-medium font-mono"},Oo={class:"flex items-center gap-x-2"},Wo=["aria-pressed"],Ao=["disabled"],zo=["disabled"],Fo=["disabled"],Vo=["aria-label"],Uo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Xo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},qo=["aria-pressed"],Go={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Yo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Zo=["aria-label"],Jo=["innerHTML"],Qo={class:"code-loading-placeholder"},er=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean}},emits:["previewCode","copy"],setup(e,{emit:n}){const t=e,o=n,{t:r}=pn(),l=S(To(t.node.language)),i=S(!1),a=S(!1),s=S(!1),d=S(null),c=S(null),m=S(""),p=S(!1);let h;const g=S(!0),x=S(0),M=S(14),_=S(M.value),B=T(()=>{const e=M.value,n=_.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),I=T(()=>{const e=l.value.trim().toLowerCase();return So[e]||e.charAt(0).toUpperCase()+e.slice(1)}),j=T(()=>(ko.value,Io(l.value.trim().toLowerCase().split(":")[0]))),H=T(()=>{const e=l.value.trim().toLowerCase();return t.isShowPreview&&("html"===e||"svg"===e)}),P=T(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},o=n(t.minWidth),r=n(t.maxWidth);return o&&(e.minWidth=o),r&&(e.maxWidth=r),e}),D=T(()=>({fontSize:`${_.value}px`})),W=T(()=>!1!==t.showTooltips);function A(){return t.isDark?t.darkTheme:t.lightTheme}function F(e){if(null==h||h.disconnect(),h=void 0,!e)return m.value="",void(p.value=!1);var n;m.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,p.value=!1}function V(){m.value="",p.value=!0}function U(){var e;const n=c.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function X(){return u(this,null,function*(){if(yield L(),U())return void V();const e=c.value;e&&(null==h||h.disconnect(),h=new MutationObserver(()=>{U()&&(V(),null==h||h.disconnect(),h=void 0)}),h.observe(e,{childList:!0,subtree:!0}))})}let q,G,Z,J;const Q=/* @__PURE__ */new Set,ee=/* @__PURE__ */new Set,ne=void 0!==import.meta&&Boolean(!1);function te(e,n){return u(this,null,function*(){if(!q)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),r=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return r?!J||J.has(r)?r:(n&&ne&&!Q.has(r)&&(Q.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield q.updateCode(e,t)}catch(o){"plaintext"!==t?(ne&&!ee.has(t)&&(ee.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield q.updateCode(e,"plaintext")):ne&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function oe(){return u(this,null,function*(){yield function(){return u(this,null,function*(){if(!G)try{const e=yield import("stream-markdown");G=e.createShikiStreamRenderer,Z=e.registerHighlight;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;J=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==Z||Z({themes:t.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),d.value&&c.value?(null==Z||Z({themes:t.themes}),!q&&G&&(q=G(c.value,{theme:A()}),p.value=!0),q?!1===t.stream&&t.loading?F(t.node.code):(F(t.node.code),yield te(t.node.code,l.value),yield X()):F(t.node.code)):F(t.node.code)})}function re(){const e=d.value;if(!e||a.value)return;const n=e.scrollTop;n<x.value?g.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(g.value=!0),x.value=n}function le(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(t.node.code)),i.value=!0,o("copy",t.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ie(e){const n=e.currentTarget||e.target;return!n||n.disabled?null:n}function ae(e,n,o="top"){if(!W.value)return;const r=ie(e);if(!r)return;const l=e;dn(r,n,o,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,t.isDark)}function se(){W.value&&un()}function de(e){if(!W.value)return;const n=ie(e);if(!n)return;const o=e;dn(n,i.value?r("common.copied")||"Copied":r("common.copy")||"Copy","top",!1,null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0,t.isDark)}function ue(){s.value=!s.value}function ce(){if(!H.value)return;const e=(l.value||t.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";o("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:t.node.code,title:n})}return oe(),Y(()=>{oe()}),N(()=>{null==h||h.disconnect(),h=void 0}),$(()=>t.themes,()=>u(null,null,function*(){Z&&Z({themes:t.themes})})),$(()=>t.loading,e=>{e||oe()}),$(W,e=>{e||un()}),$(()=>[t.node.code,t.node.language],e=>u(null,[e],function*([e,n]){const o=To(n);o!==l.value&&(l.value=o),d.value&&c.value?(q||(F(e),yield oe()),q&&e&&(!1===t.stream&&t.loading||(F(e),yield te(e,n),yield X()))):F(e)})),$(()=>[t.darkTheme,t.lightTheme],()=>u(null,null,function*(){d.value&&c.value&&(q||(yield oe()),null==q||q.setTheme(A()))})),$(()=>t.node.code,()=>u(null,null,function*(){if(a.value||!g.value)return;yield L();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,o)=>(v(),f("div",{style:K(P.value),class:C(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[t.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",t.isDark?"is-dark":""]])},[t.showHeader?(v(),f("div",Po,[z(n.$slots,"header-left",{},()=>[w("div",Do,[w("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:j.value},null,8,Ro),w("span",Ko,b(I.value),1)])],!0),z(n.$slots,"header-right",{},()=>[w("div",Oo,[t.showCollapseButton?(v(),f("button",{key:0,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:ue,onMouseenter:o[0]||(o[0]=e=>ae(e,s.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onFocus:o[1]||(o[1]=e=>ae(e,s.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onMouseleave:se,onBlur:se},[(v(),f("svg",{style:K({rotate:s.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...o[18]||(o[18]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Wo)):E("",!0),t.showFontSizeButtons&&t.enableFontSizeControl?(v(),f(k,{key:1},[w("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(_.value)&&_.value<=10,onClick:o[2]||(o[2]=e=>function(){const e=Math.max(10,_.value-1);_.value=e}()),onMouseenter:o[3]||(o[3]=e=>ae(e,y(r)("common.decrease")||"Decrease")),onFocus:o[4]||(o[4]=e=>ae(e,y(r)("common.decrease")||"Decrease")),onMouseleave:se,onBlur:se},[...o[19]||(o[19]=[w("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Ao),w("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!B.value||_.value===M.value,onClick:o[5]||(o[5]=e=>{_.value=M.value}),onMouseenter:o[6]||(o[6]=e=>ae(e,y(r)("common.reset")||"Reset")),onFocus:o[7]||(o[7]=e=>ae(e,y(r)("common.reset")||"Reset")),onMouseleave:se,onBlur:se},[...o[20]||(o[20]=[w("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)])],40,zo),w("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(_.value)&&_.value>=36,onClick:o[8]||(o[8]=e=>function(){const e=Math.min(36,_.value+1);_.value=e}()),onMouseenter:o[9]||(o[9]=e=>ae(e,y(r)("common.increase")||"Increase")),onFocus:o[10]||(o[10]=e=>ae(e,y(r)("common.increase")||"Increase")),onMouseleave:se,onBlur:se},[...o[21]||(o[21]=[w("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Fo)],64)):E("",!0),t.showCopyButton?(v(),f("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":i.value?y(r)("common.copied")||"Copied":y(r)("common.copy")||"Copy",onClick:le,onMouseenter:o[11]||(o[11]=e=>de(e)),onFocus:o[12]||(o[12]=e=>de(e)),onMouseleave:se,onBlur:se},[i.value?(v(),f("svg",Xo,[...o[23]||(o[23]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),f("svg",Uo,[...o[22]||(o[22]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Vo)):E("",!0),t.showExpandButton?(v(),f("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":a.value,onClick:o[13]||(o[13]=e=>function(e){if(a.value=!a.value,e&&W.value){const n=ie(e);n&&dn(n,a.value?r("common.collapse")||"Collapse":r("common.expand")||"Expand","top",!1,void 0,t.isDark)}const n=d.value;n&&(a.value?(n.style.maxHeight="none",n.style["overflow-y"]="visible",n.style["overflow-x"]="auto"):(n.style.maxHeight="500px",n.style.overflow="auto",g.value=!0,L(()=>{n.scrollHeight>n.clientHeight&&(n.scrollTop=n.scrollHeight)})))}(e)),onMouseenter:o[14]||(o[14]=e=>ae(e,a.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onFocus:o[15]||(o[15]=e=>ae(e,a.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onMouseleave:se,onBlur:se},[a.value?(v(),f("svg",Go,[...o[24]||(o[24]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(v(),f("svg",Yo,[...o[25]||(o[25]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],40,qo)):E("",!0),H.value&&t.showPreviewButton?(v(),f("button",{key:4,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":y(r)("common.preview")||"Preview",onClick:ce,onMouseenter:o[16]||(o[16]=e=>ae(e,y(r)("common.preview")||"Preview")),onFocus:o[17]||(o[17]=e=>ae(e,y(r)("common.preview")||"Preview")),onMouseleave:se,onBlur:se},[...o[26]||(o[26]=[w("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Zo)):E("",!0)])],!0)])):E("",!0),R(w("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:K(D.value),onScroll:re},[w("div",{ref_key:"rendererTarget",ref:c,class:"code-block-render"},null,512),p.value?E("",!0):(v(),f("div",{key:0,class:"code-fallback-plain",innerHTML:m.value},null,8,Jo))],36),[[O,!(s.value||!e.stream&&e.loading)]]),R(w("div",Qo,[z(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[o[27]||(o[27]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))],!0)],512),[[O,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-af5307e3"]]);er.install=e=>{e.component(er.__name,er)};const nr=()=>import("mermaid");let tr=null,or=nr;function rr(e){or=e,tr=null}function lr(e){rr(null!=e?e:nr)}function ir(){rr(null)}function ar(){return"function"==typeof or}function sr(e){if(!e)return e;const n=e&&e.default?e.default:e;if(n&&("function"==typeof n.render||"function"==typeof n.parse||"function"==typeof n.initialize))return n;if(n&&n.mermaidAPI&&("function"==typeof n.mermaidAPI.render||"function"==typeof n.mermaidAPI.parse)){const e=n.mermaidAPI;return s(a({},n),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:t=>"function"==typeof n.initialize?n.initialize(t):e.initialize?e.initialize(t):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:n}function dr(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=a({suppressErrorRendering:!0},t||{});return"function"==typeof n?n.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(n){}}function ur(){return u(this,null,function*(){if(tr)return tr;const e=function(){try{const e=globalThis;return sr(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return tr=e,dr(tr),tr;const n=or;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===nr)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(tr=sr(t),dr(tr),tr):null})}function cr(e){return JSON.stringify(e)}function mr(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,r=e.mhchemUrl,l=cr(a({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=cr(o),s=r?cr(r):'""';return"module"===t?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function pr(e){var n,t;const o=mr(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const d="module"===(null!=(n=e.mode)?n:"classic")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,u=new Worker(l,d);if(e.debug)try{u.postMessage({type:"init",debug:!0})}catch(c){}return{worker:u,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(c){}}},source:o}}Ge.install=e=>{e.component(Ge.__name,Ge)};let hr=null,vr=null,fr=!1;const gr=/* @__PURE__ */new Map,yr=/* @__PURE__ */new Map;let wr=5;const kr=/* @__PURE__ */new Set;function xr(){if(gr.size<wr&&kr.size){const n=Array.from(kr);kr.clear();for(const t of n)try{t()}catch(e){}}}function br(e){hr=e,vr=null,hr.onmessage=e=>{const{id:n,html:t,error:o}=e.data,r=gr.get(n);if(r)if(gr.delete(n),clearTimeout(r.timeoutId),xr(),o)r.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(yr.set(e,t),yr.size>200){const e=yr.keys().next().value;yr.delete(e)}}r.resolve(t)}},hr.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of gr.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));gr.clear(),xr()}}function Mr(){var e;hr&&(null==(e=hr.terminate)||e.call(hr)),hr=null,vr=null}function _r(e){fr=!!e,hr&&hr.postMessage({type:"init",debug:fr})}function Tr(e,n=!0,t=2e3,o){return u(this,null,function*(){if(performance.now(),!jn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(vr)return Promise.reject(vr);const r=`${n?"d":"i"}:${e}`,l=yr.get(r);if(l)return Promise.resolve(l);const i=hr||(vr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),vr.name="WorkerInitError",vr.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(vr);if(gr.size>=wr){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=gr.size,e.max=wr,Promise.reject(e)}return new Promise((r,l)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void l(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{gr.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",l(e),xr()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),gr.has(a)&&gr.delete(a);const e=new Error("Aborted");e.name="AbortError",l(e),xr()},{once:!0});const d=r,u=l;gr.set(a,{resolve:e=>{d(e)},reject:e=>{u(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:n})})})}function Cr(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(yr.set(o,t),yr.size>200){const e=yr.keys().next().value;yr.delete(e)}}function Br(){return{inFlight:gr.size,max:wr}}function Ir(e){Number.isFinite(e)&&e>0&&(wr=Math.floor(e))}const Sr="WORKER_BUSY";function $r(){return gr.size>=wr}function Er(e=2e3,n){return gr.size<wr?Promise.resolve():new Promise((t,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),kr.delete(i),t())};if(kr.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,kr.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>xr()),n){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),kr.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const Lr={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Nr(e){null!=e.timeout&&(Lr.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Lr.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Lr.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Lr.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function jr(){return a({},Lr)}function Hr(e){return u(this,arguments,function*(e,n=!0,t={}){var o,r,l,i;if(!jn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=t.timeout)?o:Lr.timeout,s=null!=(r=t.waitTimeout)?r:Lr.waitTimeout,d=null!=(l=t.backoffMs)?l:Lr.backoffMs,u=null!=(i=t.maxRetries)?i:Lr.maxRetries,c=Number.isFinite(u)?Math.max(0,Math.min(Math.floor(u),8)):Lr.maxRetries,m=t.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Tr(e,n,a,m)}catch(h){if((null==h?void 0:h.code)!==Sr||p>=c)throw h;if(p++,yield Er(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}d>0&&(yield new Promise(e=>globalThis.setTimeout(e,d*p)))}}})}function Pr(e){return JSON.stringify(e)}function Dr(e){var n;const t=null!=(n=e.mode)?n:"module",o=Pr(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${Pr(a({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===t?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function Rr(e){var n,t;const o=Dr(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const d="module"===(null!=(n=e.mode)?n:"module")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,u=new Worker(l,d);if(e.debug)try{u.postMessage({type:"init",debug:!0})}catch(c){}return{worker:u,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(c){}}},source:o}}let Kr=null,Or=null;const Wr=/* @__PURE__ */new Map;let Ar=5,zr=!1;function Fr(e){zr=!!e}function Vr(e){Number.isFinite(e)&&e>0&&(Ar=Math.floor(e))}function Ur(){return{inFlight:Wr.size,max:Ar}}const Xr="WORKER_BUSY",qr="MERMAID_DISABLED";function Gr(e){Kr=e,Or=null;const n=e;Kr.onmessage=e=>{if(Kr!==n)return;const{id:t,ok:o,result:r,error:l}=e.data,i=Wr.get(t);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Kr.onerror=e=>{var t,o;if(Kr===n)if(0!==Wr.size){try{zr?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[n,t]of Wr.entries())t.reject(new Error(`Worker error: ${e.message}`));Wr.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Kr.onmessageerror=e=>{var t,o;if(Kr===n)if(0!==Wr.size){try{zr?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,n]of Wr.entries())n.reject(new Error("Worker messageerror"));Wr.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Yr(){var e;if(Kr)try{for(const[e,n]of Wr.entries())n.reject(new Error("Worker cleared"));Wr.clear(),null==(e=Kr.terminate)||e.call(Kr)}catch(n){}Kr=null,Or=null}function Zr(e,n,t=1400){if(!ar()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=qr,Promise.reject(e)}if(Or)return Promise.reject(Or);const o=Kr||(Or=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Or.name="WorkerInitError",Or.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Or);if(Wr.size>=Ar){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Xr,e.inFlight=Wr.size,e.max=Ar,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const d=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Wr.delete(i))},u={resolve:e=>{d(),r(e)},reject:e=>{d(),l(e)}};Wr.set(i,u);try{o.postMessage({id:i,action:e,payload:n})}catch(c){return Wr.delete(i),void l(c)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=Wr.get(i);n&&n.reject(e)},t)})}function Jr(e,n,t=1400){return u(this,null,function*(){try{return yield Zr("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function Qr(e,n,t=1400){return u(this,null,function*(){try{return yield Zr("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function el(){if(Kr)try{for(const[e,n]of Wr.entries())n.reject(new Error("Worker terminated"));Wr.clear(),Kr.terminate()}finally{Kr=null}}const nl=V(()=>import("./index4.js")),tl=V(()=>import("./index3.js")),ol=V(()=>import("./index2.js")),rl=V(()=>import("./index5.js")),ll=V(()=>import("./index6.js")),il=V(()=>import("./index7.js")),al={AdmonitionNode:Yt,BlockquoteNode:re,CheckboxNode:ae,CodeBlockNode:nl,DefinitionListNode:ce,EmojiNode:pe,EmphasisNode:ut,FootnoteNode:vt,FootnoteReferenceNode:_e,FootnoteAnchorNode:mt,HardBreakNode:gt,HeadingNode:wt,HtmlBlockNode:Tt,HtmlInlineNode:ze,HighlightNode:st,ImageNode:_n,D2BlockNode:il,InfographicBlockNode:ll,InlineCodeNode:Ue,PreCodeNode:St,InsertNode:it,LinkNode:rt,ListItemNode:kt,ListNode:xt,MathBlockNode:tl,MathInlineNode:ol,MermaidBlockNode:rl,ParagraphNode:Ct,StrikethroughNode:Qn,StrongNode:Zn,SubscriptNode:Gn,SuperscriptNode:Un,TableNode:Ht,TextNode:On,ThematicBreakNode:Dt,VmrContainerNode:Ot,ReferenceNode:zn,MarkdownCodeBlockNode:er},sl={install(e,n){Object.entries(al).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&_o(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&p(n.mathOptions)}};export{rl as $,Yt as A,re as B,ae as C,il as D,pe as E,mt as F,_e as G,gt as H,wt as I,st as J,Tt as K,ze as L,_n as M,ll as N,Ue as O,it as P,rt as Q,kt as R,xt as S,qr as T,Xr as U,er as V,Sr as W,zt as X,tl as Y,ol as Z,oe as _,fn as a,Ct as a0,zn as a1,Qn as a2,Zn as a3,Gn as a4,Un as a5,Ht as a6,On as a7,Dt as a8,Ge as a9,jn as aA,ar as aB,$o as aC,Bo as aD,po as aE,uo as aF,ke as aG,Tr as aH,ye as aI,eo as aJ,mn as aK,Nr as aL,br as aM,_r as aN,Ir as aO,En as aP,_o as aQ,rr as aR,Gr as aS,Fr as aT,Vr as aU,Er as aV,Ot as aa,sl as ab,mr as ac,Dr as ad,xe as ae,Mr as af,Yr as ag,pr as ah,Rr as ai,mo as aj,to as ak,Nn as al,ir as am,Lo as an,no as ao,Ln as ap,lr as aq,Eo as ar,co as as,we as at,jr as au,Br as av,Ur as aw,No as ax,oo as ay,$r as az,ko as b,Io as c,St as d,dn as e,Ho as f,so as g,un as h,Hn as i,Hr as j,Pn as k,So as l,Cr as m,To as n,ur as o,Jr as p,Qr as q,Co as r,jo as s,el as t,pn as u,ro as v,nl as w,ce as x,ut as y,vt as z};
1
+ var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,a=(e,n)=>{for(var t in n||(n={}))r.call(n,t)&&i(e,t,n[t]);if(o)for(var t of o(n))l.call(n,t)&&i(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),d=(e,n,t)=>i(e,"symbol"!=typeof n?n+"":n,t),u=(e,n,t)=>new Promise((o,r)=>{var l=e=>{try{a(t.next(e))}catch(n){r(n)}},i=e=>{try{a(t.throw(e))}catch(n){r(n)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((t=t.apply(e,n)).next())});import{DANGEROUS_HTML_ATTRS as c,URL_HTML_ATTRS as m,isUnsafeHtmlUrl as p,VOID_HTML_TAGS as h,EXTENDED_STANDARD_HTML_TAGS as v,BLOCKED_HTML_TAGS as f,getMarkdown as g,parseMarkdownToStructure as y,setDefaultMathOptions as w}from"stream-markdown-parser";import{defineComponent as k,openBlock as x,createElementBlock as b,createVNode as _,unref as M,createElementVNode as T,Fragment as C,renderList as B,toDisplayString as I,shallowRef as S,h as $,computed as E,normalizeClass as L,useAttrs as N,inject as j,ref as H,watch as P,createCommentVNode as D,nextTick as R,onBeforeUnmount as K,createBlock as A,Teleport as O,Transition as z,withCtx as W,withDirectives as F,normalizeStyle as V,vShow as U,createApp as X,renderSlot as q,readonly as G,defineAsyncComponent as Y,resolveDynamicComponent as Z,mergeProps as J,provide as Q,createTextVNode as ee,markRaw as ne,reactive as te,onMounted as oe}from"vue";import{autoUpdate as re,offset as le,flip as ie,shift as ae,computePosition as se}from"@floating-ui/dom";const de=["cite"],ue=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},ce=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(x(),b("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[_(M(Ft),{"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"])],8,de))}}),[["__scopeId","data-v-6d8bbd17"]]);ce.install=e=>{e.component(ce.__name,ce)};const me={class:"checkbox-node"},pe=["checked"],he=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(x(),b("span",me,[T("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,pe)]))}),[["__scopeId","data-v-8dc6c46f"]]);he.install=e=>{e.component(he.__name,he)};const ve={class:"definition-list"},fe={class:"definition-term"},ge={class:"definition-desc"},ye=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(x(),b("dl",ve,[(x(!0),b(C,null,B(n.node.items,(o,r)=>(x(),b(C,{key:r},[T("dt",fe,[_(M(Ft),{"index-key":`definition-term-${n.indexKey}-${r}`,nodes:o.term,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[0]||(t[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])]),T("dd",ge,[_(M(Ft),{"index-key":`definition-desc-${n.indexKey}-${r}`,nodes:o.definition,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[1]||(t[1]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);ye.install=e=>{e.component(ye.__name,ye)};const we={class:"emoji-node"},ke=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(x(),b("span",we,I(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ke.install=e=>{e.component(ke.__name,ke)};const xe="__global__",be="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",_e=(()=>{const e=globalThis;if(e[be])return e[be];const n={scopedCustomComponents:{},revision:S(0)};return e[be]=n,n})(),Me=_e.revision;function Te(e,n){"string"==typeof e?_e.scopedCustomComponents[e]=n||{}:_e.scopedCustomComponents[xe]=e||{},Me.value++}function Ce(e){const n=_e.scopedCustomComponents[xe]||{};if(!e)return n;const t=_e.scopedCustomComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?a(a({},n),t):n:t}function Be(e){if(e===xe)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete _e.scopedCustomComponents[e],Me.value++}function Ie(){delete _e.scopedCustomComponents[xe],Me.value++}const Se=["id"],$e=["title"],Ee=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const n=`#footnote-${e.node.id}`;function t(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(o,r)=>(x(),b("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[T("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+I(e.node.id)+"]",9,$e)],8,Se))}}),[["__scopeId","data-v-01af0fee"]]);Ee.install=e=>{e.component(Ee.__name,Ee)};const Le=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,Ne=(()=>{try{return Boolean(!1)}catch(e){}return!1})();function je(e){Ne&&console.warn(e)}function He(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function Pe(e,n){const t=e.toLowerCase();return!v.has(t)&&(He(n,t)||He(n,e))}function De(e){const n={};for(const[t,o]of Object.entries(e)){const e=t.toLowerCase();c.has(e)||m.has(e)&&o&&p(o)||(n[t]=o)}return n}function Re(e,n){const t=n.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(t))return"true"===e||""===e||e===n;if(["value","min","max","step","width","height","size","maxlength"].includes(t)){const n=Number(e);if(""!==e&&!Number.isNaN(n))return n}return e}function Ke(e){return e.trim().length>0}function Ae(e,n,t,o,r){if(f.has(e.toLowerCase()))return null;const l=De(n),i=l.key,d=null!=i&&""!==i?i:r;if(Pe(e,o)){const n=o[e]||o[e.toLowerCase()],r=function(e){const n={};for(const[t,o]of Object.entries(e))n[t]=Re(o,t);return n}(l);return $(n,s(a({},r),{key:d}),t.length>0?t:void 0)}return $(e,s(a({},l),{innerHTML:void 0,key:d}),t.length>0?t:void 0)}function Oe(e,n){if(!e||!e.includes("<"))return!1;if(!n||0===Object.keys(n).length)return!1;let t;for(Le.lastIndex=0;null!==(t=Le.exec(e));)if(Pe(t[1],n))return!0;return!1}function ze(e,n){if(!e)return[];try{const t=function(e,n){let t=0;const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=Ae(l.tagName,l.attrs||{},[],n,"ms-html-"+t++),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs,autoKey:"ms-html-"+t++});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let t=-1;for(let n=o.length-1;n>=0;n--)if(o[n].tagName.toLowerCase()===e){t=n;break}if(-1!==t)for(;o.length>t;){const l=o.pop(),i=Ae(l.tagName,l.attrs||{},l.children,n,l.autoKey);o.length>0?null!=i&&o[o.length-1].children.push(i):null!=i&&r.push(i),l.tagName.toLowerCase()!==e&&o.length>t&&je(`Auto-closing unclosed tag: <${l.tagName}>`)}else je(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),t=Ae(e.tagName,e.attrs||{},e.children,n,e.autoKey);o.length>0?null!=t&&o[o.length-1].children.push(t):null!=t&&r.push(t),je(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var n,t,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const n=e.indexOf("--\x3e",l);if(-1!==n){l=n+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const n=e.slice(l);Ke(n)&&r.push({type:"text",content:n})}break}if(i>l){const n=e.slice(l,i);Ke(n)&&r.push({type:"text",content:n})}if(e.startsWith("![CDATA[",i+1)){const n=e.indexOf("]]>",i);if(-1!==n){r.push({type:"text",content:e.slice(i,n+3)}),l=n+3;continue}break}if(e.startsWith("!",i+1)){const n=e.indexOf(">",i);if(-1!==n){l=n+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),d=s.startsWith("/"),u=s.endsWith("/");if(d){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=u?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(t=null!=(n=r[2])?n:r[3])?t:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:u||h.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),n);return t}catch(o){return t=o,Ne&&console.error("Failed to parse HTML to VNodes:",t),null}var t}const We=["innerHTML"],Fe=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const n=e,t=E(()=>(Me.value,Ce(n.customId))),o=k({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=E(()=>{const e=n.node.content;if(!e)return{mode:"html",content:""};if(n.node.loading&&!n.node.autoClosed)return{mode:"text",content:e};if(n.node.loading&&n.node.autoClosed){const n=ze(e,t.value);if(null!==n)return{mode:"dynamic",nodes:n}}if(!Oe(e,t.value))return{mode:"html",content:e};const o=ze(e,t.value);return null===o?{mode:"html",content:e}:{mode:"dynamic",nodes:o}});return(e,t)=>"dynamic"===r.value.mode?(x(),b("span",{key:0,class:L(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},[_(M(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):"text"===r.value.mode?(x(),b("span",{key:1,class:L(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},I(r.value.content),3)):(x(),b("span",{key:2,class:L(["html-inline-node",{"html-inline-node--loading":n.node.loading}]),innerHTML:r.value.content},null,10,We))}}),[["__scopeId","data-v-71cd1a9f"]]);Fe.install=e=>{e.component(Fe.__name,Fe)};const Ve={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},Ue={key:0},Xe=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"InlineCodeNode",props:{node:{}},setup(e){const n=e,t=N(),o=j("markstreamTypewriter",void 0),r=j("markstreamTextStreamState",void 0),l=E(()=>{const e=t.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),i=E(()=>"boolean"==typeof l.value?l.value:"boolean"!=typeof(null==o?void 0:o.value)||o.value),a=E(()=>{var e;const n=null!=(e=t["index-key"])?e:t.indexKey;return null==n||""===n?"":String(n)}),s=H(n.node.code),d=H(""),u=H(0);function c(){return s.value+d.value}function m(e){s.value=e,d.value=""}function p(){d.value&&(s.value=c(),d.value="")}P([()=>n.node.code,a,i],([e])=>{const n=String(null!=e?e:""),t=c(),o=a.value,l=o?null==r?void 0:r.get(o):void 0,p=null!=l?l:t;return i.value?n===p?(m(n),void(o&&(null==r||r.set(o,n)))):p&&n.startsWith(p)&&n.length>p.length?(s.value=p,d.value=n.slice(p.length),u.value+=1,void(o&&(null==r||r.set(o,n)))):(m(n),void(o&&(null==r||r.set(o,n)))):(m(n),void(o&&(null==r||r.set(o,n))))},{immediate:!0}),P(i,e=>{e||m(c())});const h=E(()=>u.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(e,n)=>(x(),b("code",Ve,[s.value?(x(),b("span",Ue,I(s.value),1)):D("",!0),d.value?(x(),b("span",{key:1,class:L(["inline-code-stream-delta",[h.value]]),onAnimationend:p},I(d.value),35)):D("",!0)]))}}),[["__scopeId","data-v-ffb68151"]]);Xe.install=e=>{e.component(Xe.__name,Xe)};const qe={class:"markstream-vue"},Ge=["id"],Ye=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const n=e,t=E(()=>{if(void 0!==n.isDark&&null!==n.isDark)return Boolean(n.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=H(null),r=H({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=H(!1);let i=null;function a(){return u(this,null,function*(){var e,t;if(!n.anchorEl||!o.value)return;const l=[le(null!=(e=n.offset)?e:8),ie(),ae({padding:8})],{x:i,y:a}=yield se(n.anchorEl,o.value,{placement:null!=(t=n.placement)?t:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return P(()=>n.visible,e=>u(null,null,function*(){if(e)if(l.value=!1,yield R(),n.anchorEl&&o.value)try{const e=n.anchorEl.getBoundingClientRect();yield a();const t=r.value.transform;if(null!=n.originX&&null!=n.originY){const o=Math.abs(Number(n.originX)-e.left),i=Math.abs(Number(n.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(n.originX)}px, ${Math.round(n.originY)}px, 0)`,yield R(),l.value=!0,yield R(),r.value.transform=t):l.value=!0}else l.value=!0;i=re(n.anchorEl,o.value,a)}catch(t){yield a(),l.value=!0,i=re(n.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),P([()=>n.anchorEl,()=>n.placement,()=>n.content],()=>u(null,null,function*(){n.visible&&n.anchorEl&&o.value&&(yield R(),yield a())})),K(()=>{i&&i()}),(i,a)=>(x(),A(O,{to:"body"},[T("div",qe,[_(z,{name:"tooltip",appear:""},{default:W(()=>[F(T("div",{id:n.id,ref_key:"tooltip",ref:o,style:V({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:L(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[t.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},I(e.content),15,Ge),[[U,e.visible&&l.value]])]),_:1})])]))}}),[["__scopeId","data-v-d524cc01"]]),Ze=H(!1),Je=H(""),Qe=H("top"),en=H(null),nn=H(null),tn=H(null),on=H(null),rn=H(null);let ln=null,an=null;function sn(){ln&&(clearTimeout(ln),ln=null),an&&(clearTimeout(an),an=null)}let dn=!1;function un(e,n,t="top",o=!1,r,l){if(!e)return;!function(){if(!dn&&"undefined"!=typeof document)try{dn=!0;const e=document.createElement("div");e.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(e),X({setup:()=>()=>{var e;return $(Ye,{visible:Ze.value,"anchor-el":en.value,content:Je.value,placement:Qe.value,id:nn.value,originX:tn.value,originY:on.value,isDark:null!=(e=rn.value)?e:void 0})}}).mount(e)}catch(e){dn=!1,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",e)}}(),sn();const i=()=>{var o,i;nn.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,en.value=e,Je.value=n,Qe.value=t,tn.value=null!=(o=null==r?void 0:r.x)?o:null,on.value=null!=(i=null==r?void 0:r.y)?i:null,rn.value="boolean"==typeof l?l:null,Ze.value=!0;try{e.setAttribute("aria-describedby",nn.value)}catch(a){}};o?i():ln=setTimeout(i,80)}function cn(e=!1){sn();const n=()=>{if(en.value&&nn.value)try{en.value.removeAttribute("aria-describedby")}catch(e){}Ze.value=!1,en.value=null,nn.value=null,tn.value=null,on.value=null};e?n():an=setTimeout(n,120)}const mn={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function pn(e){Object.assign(mn,e)}function hn(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const e=n();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return u(null,null,function*(){try{const n=yield import("vue-i18n"),t=n.useI18n||n.default&&n.default.useI18n;if(t&&"function"==typeof t)try{const n=t();if(n&&"function"==typeof n.t)try{globalThis.$vueI18nUse=()=>n}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var n;return null!=(n=mn[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const vn=["src","alt","title","loading","tabindex","aria-label"],fn={key:"placeholder",class:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},gn={class:"text-sm whitespace-nowrap"},yn={key:1,class:"text-sm text-gray-500"},wn={key:"error",class:"image-node__error image-node__error--inline px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},kn={class:"text-sm whitespace-nowrap"},xn=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!0},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:n}){const t=e,o=n,r=H(!1),l=H(!1),i=H(!1),a=E(()=>l.value&&t.fallbackSrc?t.fallbackSrc:t.node.src);function s(){t.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,o("error",t.node.src))}function d(){r.value=!0,l.value=!1,o("load",a.value)}function u(e){e.preventDefault(),r.value&&!l.value&&o("click",[e,a.value])}const{t:c}=hn();return P(a,()=>{r.value=!1,l.value=!1}),(n,o)=>(x(),A(z,{name:"img-switch",mode:"out-in"},{default:W(()=>{var i,m,p,h,v;return[e.node.loading||l.value?l.value?e.node.loading||t.fallbackSrc?D("",!0):(x(),b("span",wn,[q(n.$slots,"error",{node:t.node,displaySrc:a.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy},()=>[o[1]||(o[1]=T("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[T("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)),T("span",kn,I(M(c)("image.loadError")),1)],!0)])):(x(),b("span",fn,[t.usePlaceholder?q(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:a.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy},()=>[o[0]||(o[0]=T("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),T("span",gn,I(M(c)("image.loading")),1)],!0):(x(),b("span",yn,I(e.node.raw),1))])):(x(),b("img",{key:"image",src:a.value,alt:String(null!=(m=null!=(i=t.node.alt)?i:t.node.title)?m:""),title:String(null!=(h=null!=(p=t.node.title)?p:t.node.alt)?h:""),class:L(["image-node__img h-auto rounded-lg transition-opacity duration-200 ease-in-out image-node__img--inline",{"opacity-0":!r.value,"opacity-100":r.value,"cursor-pointer":r.value}]),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(v=t.node.alt)?v:M(c)("image.preview"),onError:s,onLoad:d,onClick:u},null,42,vn))]}),_:3}))}}),[["__scopeId","data-v-38c5c389"]]);xn.install=e=>{e.component(xn.__name,xn)};let bn=null,_n=!1,Mn=Bn;function Tn(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function Cn(){try{const e=globalThis;return Tn(null==e?void 0:e.katex)}catch(e){return null}}function Bn(){return u(null,null,function*(){const e=Cn();if(e)return e;const n=yield import("katex");try{yield import("katex/dist/contrib/mhchem")}catch(t){}return Tn(n)})}function In(e){Mn=e,bn=null,_n=!1}function Sn(e){In(null!=e?e:Bn)}function $n(){In(null)}function En(){return"function"==typeof Mn}function Ln(){var e;const n=Cn();if(n)return bn=n,bn;if(bn)return bn;const t=Mn;if(!t||t===Bn)return null;try{const n=t();return n&&"function"!=typeof(null==n?void 0:n.then)?(bn=null!=(e=Tn(n))?e:n,bn):null}catch(o){return null}}function Nn(){return u(this,null,function*(){var e;const n=Cn();if(n)return bn=n,bn;if(bn)return bn;if(_n)return null;const t=Mn;if(!t)return _n=!0,null;try{const n=yield t();if(n)return bn=null!=(e=Tn(n))?e:n,bn}catch(o){}return _n=!0,null})}const jn=S(!1);let Hn=null;const Pn={key:0},Dn=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=e,t=(Hn||(Hn=Nn().then(e=>{jn.value=!!e}).catch(()=>{jn.value=!1})),G(jn)),o=N(),r=j("markstreamTypewriter",void 0),l=j("markstreamTextStreamState",void 0),i=j("markstreamStreamVersion",void 0),a=E(()=>{const e=o.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),s=E(()=>"boolean"==typeof a.value?a.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),d=E(()=>{var e;const n=null!=(e=o["index-key"])?e:o.indexKey;return null==n||""===n?"":String(n)}),u=H(n.node.content),c=H(""),m=H(0);function p(){return u.value+c.value}function h(e){u.value=e,c.value=""}function v(){c.value&&(u.value=p(),c.value="")}P([()=>n.node.content,d,s,()=>null==i?void 0:i.value],([e])=>{const n=String(null!=e?e:""),t=p(),o=d.value,r=o?null==l?void 0:l.get(o):void 0,i=null!=r?r:t;return s.value?n===i?(c.value?v():t!==n&&h(n),void(o&&(null==l||l.set(o,n)))):i&&n.startsWith(i)&&n.length>i.length?(u.value=i,c.value=n.slice(i.length),m.value+=1,void(o&&(null==l||l.set(o,n)))):(h(n),void(o&&(null==l||l.set(o,n)))):(h(n),void(o&&(null==l||l.set(o,n))))},{immediate:!0}),P(s,e=>{e||h(p())});const f=E(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(n,o)=>(x(),b("span",{class:L([[M(t)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},[u.value?(x(),b("span",Pn,I(u.value),1)):D("",!0),c.value?(x(),b("span",{key:1,class:L(["text-node-stream-delta",[f.value]]),onAnimationend:v},I(c.value),35)):D("",!0)],2))}}),[["__scopeId","data-v-03641323"]]);Dn.install=e=>{e.component(Dn.__name,Dn)};const Rn=Y(()=>u(null,null,function*(){var e,n;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(n=null==(e=globalThis.process)?void 0:e.env)?void 0:n.NODE_ENV)&&"undefined"!=typeof window)return e=>{var n,t;return $(Dn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield Nn())return(yield import("./index2.js")).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return e=>{var n,t;return $(Dn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),Kn=Y(()=>u(null,null,function*(){try{if(yield Nn())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var n,t;return $(Dn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),An=/* @__PURE__ */k({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(x(),b("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabindex:"0",onClick:t[0]||(t[0]=t=>n.$emit("click",t,e.node.id,e.messageId,e.threadId)),onMouseenter:t[1]||(t[1]=t=>n.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)),onMouseleave:t[2]||(t[2]=t=>n.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId))},I(e.node.id),33))});An.install=e=>{e.component(An.__name,An)};const On={class:"superscript-node"},zn={key:1},Wn=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,strong:qn,emphasis:at,footnote_reference:Ee,strikethrough:Yn,highlight:lt,insert:ot,subscript:Un,emoji:ke,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("sup",On,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),b(C,{key:`${e.indexKey||"superscript"}-${r}`},[o[t.type]?(x(),A(Z(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(x(),b("span",zn,I(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);Wn.install=e=>{e.component(Wn.__name,Wn)};const Fn={class:"subscript-node"},Vn={key:1},Un=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,strong:qn,emphasis:at,footnote_reference:Ee,strikethrough:Yn,highlight:lt,insert:ot,superscript:Wn,emoji:ke,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("sub",Fn,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),b(C,{key:`${e.indexKey||"subscript"}-${r}`},[o[t.type]?(x(),A(Z(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(x(),b("span",Vn,I(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);Un.install=e=>{e.component(Un.__name,Un)};const Xn={class:"strong-node"},qn=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,emphasis:at,strikethrough:Yn,highlight:lt,insert:ot,subscript:Un,superscript:Wn,emoji:ke,footnote_reference:Ee,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("strong",Xn,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),A(Z(o[t.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);qn.install=e=>{e.component(qn.__name,qn)};const Gn={class:"strikethrough-node"},Yn=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,strong:qn,emphasis:at,highlight:lt,insert:ot,subscript:Un,superscript:Wn,emoji:ke,footnote_reference:Ee,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("del",Gn,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),A(Z(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Yn.install=e=>{e.component(Yn.__name,Yn)};const Zn=["href","title","aria-label","aria-hidden"],Jn=["aria-hidden"],Qn={class:"link-text-wrapper relative inline-flex"},et={class:"leading-[normal] link-text"},nt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=j("markstreamShowTooltips",void 0),o=E(()=>{const e=null==t?void 0:t.value;return"boolean"==typeof e?e:n.showTooltip}),r=E(()=>{var e,t,o,r,l,i;const a=void 0!==n.underlineBottom?"number"==typeof n.underlineBottom?`${n.underlineBottom}px`:String(n.underlineBottom):"-3px",s=null!=(e=n.animationOpacity)?e:.35,d=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(t=n.color)?t:"#0366d6","--underline-height":`${null!=(o=n.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(d),"--underline-duration":`${null!=(r=n.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=n.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(i=n.animationIteration)?i:"infinite"}}),l={text:Dn,strong:qn,strikethrough:Yn,emphasis:at,image:xn,html_inline:Fe,inline_code:Xe},i=E(()=>(Me.value,Ce(n.customId))),s=N(),d=E(()=>{var e,t;const o=null==(e=n.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const n of o)Array.isArray(n)&&n[0]&&(r[String(n[0])]=String(null!=(t=n[1])?t:""));else for(const[n,l]of Object.entries(o))n&&null!=l&&!1!==l&&(r[n]=!0===l?"":String(l));return De(r)}),u=E(()=>{const e=a(a({},s),d.value);return delete e.title,e});function c(){o.value&&cn()}const m=E(()=>{var e,t,o;const r=null==(e=n.node)?void 0:e.title;return"string"==typeof r&&r.trim().length>0?r:String(null!=(o=null==(t=n.node)?void 0:t.href)?o:"")});return(t,a)=>{var d,p;return e.node.loading?(x(),b("span",J({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},M(s),{style:r.value}),[T("span",Qn,[T("span",et,[_(M(Dn),{class:"leading-[normal] link-text",node:{type:"text",content:String(null!=(d=e.node.text)?d:""),raw:String(null!=(p=e.node.text)?p:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),a[1]||(a[1]=T("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Jn)):(x(),b("a",J({key:0,class:"link-node",href:e.node.href,title:o.value?"":m.value,"aria-label":`Link: ${m.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},u.value,{style:r.value,onMouseenter:a[0]||(a[0]=e=>function(e){var t,r,l;if(!o.value)return;const i=e,a=null!=(null==i?void 0:i.clientX)&&null!=(null==i?void 0:i.clientY)?{x:i.clientX,y:i.clientY}:void 0,s=(null==(t=n.node)?void 0:t.title)||(null==(r=n.node)?void 0:r.href)||(null==(l=n.node)?void 0:l.text)||"";un(e.currentTarget,s,"top",!1,a)}(e)),onMouseleave:c}),[(x(!0),b(C,null,B(e.node.children,(t,o)=>(x(),A(Z(function(e){return i.value[e.type]||l[e.type]||null}(t)),{key:`${e.indexKey||"emphasis"}-${o}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${o}`},null,8,["node","custom-id","index-key"]))),128))],16,Zn))}}}),[["__scopeId","data-v-a4831c9e"]]);nt.install=e=>{e.component(nt.__name,nt)};const tt={class:"insert-node"},ot=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,strong:qn,emphasis:at,strikethrough:Yn,highlight:lt,subscript:Un,superscript:Wn,emoji:ke,footnote_reference:Ee,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("ins",tt,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),A(Z(o[t.type]),{key:`${e.indexKey||"insert"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);ot.install=e=>{e.component(ot.__name,ot)};const rt={class:"highlight-node"},lt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,strong:qn,emphasis:at,strikethrough:Yn,insert:ot,subscript:Un,superscript:Wn,emoji:ke,footnote_reference:Ee,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("mark",rt,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),A(Z(o[t.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);lt.install=e=>{e.component(lt.__name,lt)};const it={class:"emphasis-node"},at=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,html_inline:Fe,strong:qn,strikethrough:Yn,highlight:lt,insert:ot,subscript:Un,superscript:Wn,emoji:ke,footnote_reference:Ee,math_inline:Rn,reference:An},t);return(t,r)=>(x(),b("em",it,[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),A(Z(o[t.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);at.install=e=>{e.component(at.__name,at)};const st=["href","title"],dt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const n=e;function t(e){var t;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(t=n.node.id)?t:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(n,o)=>(x(),b("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,st))}}),[["__scopeId","data-v-4756ce0d"]]);dt.install=e=>{e.component(dt.__name,dt)};const ut=["id"],ct={class:"flex-1"},mt=/* @__PURE__ */k({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(x(),b("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[T("div",ct,[_(M(Ft),{"index-key":`footnote-${n.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"])])],8,ut))}});mt.install=e=>{e.component(mt.__name,mt)};const pt={class:"hard-break"},ht=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(x(),b("br",pt))}),[["__scopeId","data-v-50c58f70"]]);ht.install=e=>{e.component(ht.__name,ht)};const vt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId),o=a({text:Dn,inline_code:Xe,link:nt,image:xn,strong:qn,emphasis:at,strikethrough:Yn,highlight:lt,insert:ot,subscript:Un,superscript:Wn,emoji:ke,checkbox:he,checkbox_input:he,footnote_reference:Ee,hardbreak:ht,math_inline:Rn,reference:An},t);return(t,r)=>(x(),A(Z(`h${e.node.level}`),J({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:W(()=>[(x(!0),b(C,null,B(e.node.children,(t,r)=>(x(),A(Z(o[t.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-ffb7cf51"]]),ft=vt;ft.install=e=>{e.component(vt.__name,vt)};const gt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=E(()=>{var e;return null!=(e=n.node)?e:n.item}),o=E(()=>null==n.value?{}:{value:n.value});return(e,r)=>{var l,i;return x(),b("li",J({class:"list-item pl-1.5 my-2",dir:"auto"},o.value),[_(M(Ft),J({showTooltips:n.showTooltips},{"index-key":`list-item-${n.indexKey}`,nodes:null!=(i=null==(l=t.value)?void 0:l.children)?i:[],"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=n=>e.$emit("copy",n))}),null,16,["index-key","nodes","custom-id","typewriter"])],16)}}}),[["__scopeId","data-v-ce59e808"]]);gt.install=e=>{e.component(gt.__name,gt)};const yt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const n=E(()=>(Me.value,Ce(e.customId).list_item||gt));return(t,o)=>(x(),A(Z(e.node.ordered?"ol":"ul"),{class:L(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:W(()=>[(x(!0),b(C,null,B(e.node.items,(r,l)=>{var i;return x(),A(Z(n.value),J({key:`${e.indexKey||"list"}-${l}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(i=e.node.start)?i:1)+l:void 0,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))}),null,16,["node","custom-id","index-key","typewriter","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-8e81cbc8"]]);yt.install=e=>{e.component(yt.__name,yt)};const wt=/* @__PURE__ */Symbol("ViewportPriority");function kt(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?H(n):n;let r=null,l=null;const i=/* @__PURE__ */new Map;const a=(n,a)=>{const s=H(!1);let d,u=!1;const c=new Promise(e=>{d=()=>{u||(u=!0,e())}}),m=()=>{try{null==r||r.unobserve(n)}catch(e){}if(i.delete(n),!i.size){try{null==r||r.disconnect()}catch(e){}r=null,l=null}};if(!t||!o.value)return s.value=!0,d(),{isVisible:s,whenVisible:c,destroy:m};const p=function(n,o){if(!t)return r;if("undefined"==typeof IntersectionObserver)return null;const a=function(n,t){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,rootMargin:null!=(r=null==t?void 0:t.rootMargin)?r:"300px",threshold:null!=(l=null==t?void 0:t.threshold)?l:0}}(n,o);if(r&&(d=a,(s=l)&&s.root===d.root&&s.rootMargin===d.rootMargin&&s.threshold===d.threshold))return r;var s,d;if(r)try{r.disconnect()}catch(u){}r=new IntersectionObserver(e=>{for(const n of e){const e=i.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(u){}}null==r||r.unobserve(n.target),i.delete(n.target)}}},{root:a.root,rootMargin:a.rootMargin,threshold:a.threshold}),l=a;for(const e of i.keys())r.observe(e);return r}(n,a);return p?(i.set(n,{resolve:d,visible:s}),p.observe(n),{isVisible:s,whenVisible:c,destroy:m}):(s.value=!0,d(),{isVisible:s,whenVisible:c,destroy:m})};return Q(wt,a),a}function xt(){const e=j(wt,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=H(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{try{null==t||t.unobserve(e)}catch(o){}n.delete(e)},s=t||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(t=new IntersectionObserver(e=>{for(const r of e){const e=n.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(r.target),n.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const bt={key:1,class:"html-block-node__raw"},_t=["innerHTML"],Mt={key:1,class:"html-block-node__placeholder"},Tt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const n=e,t=E(()=>{const e=n.node.attrs;if(e){if(Array.isArray(e)){const n={};for(const t of e){if(!t||t.length<2)continue;const[e,o]=t;null!=e&&(n[String(e)]=null==o?"":String(o))}return n}return e}}),o=E(()=>(Me.value,Ce(n.customId))),r=k({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),l=H(null),i=H("undefined"==typeof window),a=H(n.node.content),s=E(()=>{var e,t,r;if(!i.value)return{mode:"html",content:null!=(e=a.value)?e:""};const l=null!=(t=a.value)?t:n.node.content;if(!l)return{mode:"html",content:""};if(n.node.loading){const e=ze(l,o.value);return null===e?{mode:"text",content:null!=(r=n.node.raw)?r:l}:{mode:"dynamic",nodes:e}}if(!Oe(l,o.value))return{mode:"html",content:l};const s=ze(l,o.value);return null===s?{mode:"html",content:l}:{mode:"dynamic",nodes:s}}),d=xt(),u=H(null),c=!!n.node.loading;return"undefined"!=typeof window?(P(l,e=>{var t,o;if(null==(o=null==(t=u.value)?void 0:t.destroy)||o.call(t),u.value=null,!c)return i.value=!0,void(a.value=n.node.content);if(!e)return void(i.value=!1);const r=d(e,{rootMargin:"400px"});u.value=r,i.value=r.isVisible.value,r.whenVisible.then(()=>{i.value=!0})},{immediate:!0}),P(()=>n.node.content,e=>{c&&!i.value||(a.value=e)})):i.value=!0,K(()=>{var e,n;null==(n=null==(e=u.value)?void 0:e.destroy)||n.call(e),u.value=null}),(n,o)=>(x(),b("div",J({ref_key:"htmlRef",ref:l,class:"html-block-node"},t.value),[i.value?(x(),b(C,{key:0},["dynamic"===s.value.mode?(x(),A(M(r),{key:0,nodes:s.value.nodes},null,8,["nodes"])):"text"===s.value.mode?(x(),b("pre",bt,I(s.value.content),1)):(x(),b("div",{key:2,innerHTML:a.value},null,8,_t))],64)):(x(),b("div",Mt,[q(n.$slots,"placeholder",{node:e.node},()=>[o[0]||(o[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),o[1]||(o[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),o[2]||(o[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-b7cace40"]]);Tt.install=e=>{e.component(Tt.__name,Tt)};const Ct={dir:"auto",class:"paragraph-node"},Bt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=Ce(n.customId);function o(e){var n;return"text"===e.type&&""===String(null!=(n=e.content)?n:"").trim()}function r(e){var n;return String(null!=(n=e.content)?n:"")}const l=E(()=>n.node.children.filter(e=>!o(e))),i=E(()=>l.value.length>0&&l.value.every(e=>"image"===e.type||function(e){var n;const t=function(e){return"link"===e.type&&Array.isArray(e.children)?e.children.filter(e=>!o(e)):[]}(e);return 1===t.length&&"image"===(null==(n=t[0])?void 0:n.type)}(e))),d=E(()=>{if(!i.value||l.value.length<=1)return n.node.children;const e=[];for(let t=0;t<n.node.children.length;t++){const r=n.node.children[t];if(!o(r)){e.push(r);continue}const l=e.length>0,i=n.node.children.slice(t+1).some(e=>!o(e));l&&i&&e.push(s(a({},r),{content:" ",raw:" "}))}return e});function u(e,t){return{node:e,"index-key":`${n.indexKey}-${t}`,"custom-id":n.customId}}const c=a({inline_code:Xe,image:xn,link:nt,hardbreak:ht,emphasis:at,strong:qn,strikethrough:Yn,highlight:lt,insert:ot,subscript:Un,superscript:Wn,html_inline:Fe,html_block:Tt,emoji:ke,checkbox:he,math_inline:Rn,checkbox_input:he,reference:An,footnote_anchor:dt,footnote_reference:Ee,text:Dn},t);return(n,t)=>(x(),b("p",Ct,[(x(!0),b(C,null,B(d.value,(n,t)=>(x(),b(C,{key:`${e.indexKey||"paragraph"}-${t}`},[i.value&&o(n)?(x(),b(C,{key:0},[ee(I(r(n)),1)],64)):(x(),A(Z(c[n.type]),J({key:1,ref_for:!0},u(n,t)),null,16))],64))),128))]))}}),[["__scopeId","data-v-c4fdb7c8"]]);Bt.install=e=>{e.component(Bt.__name,Bt)};const It=["aria-busy","aria-label","data-language"],St=["textContent"],$t=/* @__PURE__ */k({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=E(()=>{var e,t,o;const r=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=E(()=>`language-${t.value}`),r=E(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,l)=>(x(),b("pre",{class:L([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":t.value,"data-markstream-pre":"1",tabindex:"0"},[T("code",{translate:"no",textContent:I(e.node.code)},null,8,St)],10,It))}});$t.install=e=>{e.component($t.__name,$t)};const Et={class:"table-node-wrapper"},Lt=["aria-busy"],Nt={class:"border-[var(--table-border,#cbd5e1)]"},jt={class:"border-b"},Ht={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Pt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=E(()=>{var e;return null!=(e=n.node.loading)&&e}),o=E(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(r,l)=>(x(),b("div",Et,[T("table",{class:L(["my-8 text-sm table-node",{"table-node--loading":t.value}]),"aria-busy":t.value},[T("thead",Nt,[T("tr",jt,[(x(!0),b(C,null,B(e.node.header.cells,(e,t)=>(x(),b("th",{key:`header-${t}`,dir:"auto",class:L(["font-semibold p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[_(M(Ft),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[0]||(l[0]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),T("tbody",null,[(x(!0),b(C,null,B(o.value,(e,t)=>(x(),b("tr",{key:`row-${t}`,class:L(["border-[var(--table-border,#cbd5e1)]",[t<o.value.length-1?"border-b":""]])},[(x(!0),b(C,null,B(e.cells,(e,o)=>(x(),b("td",{key:`cell-${t}-${o}`,class:L(["p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[_(M(Ft),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[1]||(l[1]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,Lt),_(z,{name:"table-node-fade"},{default:W(()=>[t.value?(x(),b("div",Ht,[q(r.$slots,"loading",{isLoading:t.value},()=>[l[2]||(l[2]=T("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),l[3]||(l[3]=T("span",{class:"sr-only"},"Loading",-1))],!0)])):D("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);Pt.install=e=>{e.component(Pt.__name,Pt)};const Dt={class:"hr-node"},Rt=/* @__PURE__ */ue({},[["render",function(e,n){return x(),b("hr",Dt)}],["__scopeId","data-v-639cbad9"]]);Rt.install=e=>{e.component(Rt.__name,Rt)};const Kt={class:"unknown-node"},At=/* @__PURE__ */k({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(x(),b("div",Kt,I(e.node.raw),1))}),Ot=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=E(()=>`vmr-container vmr-container-${n.node.name}`),o=Ce(n.customId),r=a({text:Dn,paragraph:Bt,heading:ft,inline_code:Xe,link:nt,image:xn,strong:qn,emphasis:at,strikethrough:Yn,insert:ot,subscript:Un,superscript:Wn,checkbox:he,checkbox_input:he,hardbreak:ht,math_inline:Rn,reference:An,list:yt,math_block:Kn,table:Pt},o);return(o,l)=>(x(),b("div",J({class:t.value},e.node.attrs),[(x(!0),b(C,null,B(e.node.children,(t,o)=>{return x(),A(Z((l=t.type,r[l]||At)),{key:`${e.indexKey||"vmr-container"}-${o}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"vmr-container"}-${o}`},null,8,["custom-id","node","index-key"]);var l}),128))],16))}}),[["__scopeId","data-v-a88d22ce"]]);Ot.install=e=>{e.component(Ot.__name,Ot)};const zt=["data-custom-id"],Wt=["data-node-index","data-node-type"],Ft=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:!0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:n}){var t,o,r;const l=e,i=n,d=H(),c=H(!1),m=/auto|scroll|overlay/i,p="undefined"!=typeof window,h=E(()=>l.debugPerformance&&p&&"undefined"!=typeof console),v=N(),f=/* @__PURE__ */new Map,w=H(0),k=E(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const n=null!=(e=v.showTooltips)?e:v["show-tooltips"];return""===n||!0===n||"true"===n||!1!==n&&"false"!==n&&void 0});function _(e,n){h.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function M(e){if(!e)return!1;const n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();return m.test(n)||m.test(t)}function T(e){const n=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,t=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return n||t}function I(e){if("undefined"==typeof window)return null;const n=null!=e?e:d.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let r=n;for(;r&&r!==t.body&&r!==o;){if(M(window.getComputedStyle(r))&&T(r))return r;r=r.parentElement}return null}Q("markstreamShowTooltips",k),Q("markstreamTypewriter",E(()=>!1!==l.typewriter)),Q("markstreamTextStreamState",f),Q("markstreamStreamVersion",w),P([()=>l.content,()=>l.nodes],()=>{w.value+=1},{immediate:!0});const S=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,$=g(S),j=/* @__PURE__ */new Map,O=E(()=>{const{key:e,tags:n}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const n=/* @__PURE__ */new Set,t=[];for(const o of e){const e=U(o);e&&!n.has(e)&&(n.add(e),t.push(e))}return 0===t.length?{key:"",tags:[]}:{key:t.join(","),tags:t}}(l.customHtmlTags);if(!e)return $;const t=j.get(e);if(t)return t;const o=g(S,{customHtmlTags:n});return j.set(e,o),o}),F=E(()=>{const e=O.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function U(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}const X=E(()=>{var e,n,t,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(n=l.final)?n:r.final,s=[...null!=(t=l.customHtmlTags)?t:[],...null!=(o=r.customHtmlTags)?o:[]].map(U).filter(Boolean),d=null!=i,u=s.length>0;return d||u?a(a(a({},r),d?{final:i}:{}),u?{customHtmlTags:Array.from(new Set(s))}:{}):r}),q=E(()=>{var e;const n=null!=(e=X.value.customHtmlTags)?e:[];return new Set(n.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),G=E(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return ne(l.nodes.slice());if(l.content){const e=h.value?performance.now():0,n=y(l.content,F.value,X.value);return h.value&&_("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:l.content.length}),ne(n)}return[]}),ee=E(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),oe=E(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&G.value.length>ee.value}),re=E(()=>!1!==l.viewportPriority&&!c.value),le=kt(e=>{var n;return I(null!=(n=null!=e?e:d.value)?n:null)},re),ie=p&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,ae=p&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,se="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),de=p&&"function"==typeof window.requestIdleCallback,ue=E(()=>{var e;const n=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),me=E(()=>{var e;const n=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:ue.value);return Number.isFinite(n)?Math.max(0,n):ue.value}),pe=E(()=>!1!==l.batchRendering&&ue.value>0&&p&&!se),ve=H(0),fe=H({key:l.indexKey,total:0}),ge=H(Math.max(1,ue.value||1)),we=H(/* @__PURE__ */new Set),xe=/* @__PURE__ */new Map,be=/* @__PURE__ */new Map,_e=/* @__PURE__ */new Map,Te=/* @__PURE__ */new Map,Be=/* @__PURE__ */new WeakMap,Ie=H(0),Se=E(()=>(Ie.value,Array.from(Te.entries()).sort((e,n)=>e[0]-n[0]))),$e=H(0),Le=H([]),Ne=H([]),je=H(null);let He=null,Pe=null;const De=E(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!oe.value&&!(G.value.length>900)&&re.value}),Re=E(()=>{var e;return pe.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Ke=H({batchSize:ue.value,initial:me.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Re.value}),Ae=E(()=>!!le&&(De.value||oe.value)),Oe=E(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),ze=H(0),We=te({start:0,end:0}),Ve=/* @__PURE__ */new Map,Ue=E(()=>{if(!oe.value)return G.value.length;const e=Oe.value,n=Math.max(We.end+e,me.value),t=Math.min(G.value.length,n);return Math.max(ve.value,t)});function qe(e){var n,t,o,r;const l=I(null!=(n=null!=e?e:d.value)?n:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=d.value)?void 0:t.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function Ge(e){if(!p)return!1;try{const n=window.getComputedStyle(e);return!!(n.display||"").toLowerCase().includes("flex")&&(n.flexDirection||"").toLowerCase().endsWith("reverse")}catch(n){return!1}}function Ye(){He&&(He(),He=null),je.value=null}function Ze(){if(!p||!oe.value)return;const e=qe();if(!e||je.value===e)return;Ye();const n=()=>Qe();e.addEventListener("scroll",n,{passive:!0}),je.value=e,He=()=>{e.removeEventListener("scroll",n)}}function Je(){var e,n,t;if(!Pe)return;const o=null!=(t=null==(n=null==(e=d.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;Pe.viaTimeout?o?o.clearTimeout(Pe.id):clearTimeout(Pe.id):null==ae||ae(Pe.id),Pe=null}function Qe(e={}){var n,t,o;if(!oe.value)return;if(!p)return void en(!0);if(e.immediate)return Je(),void en(!0);if(Pe)return;const r=()=>{Pe=null,en()};if(ie)Pe={id:ie(r),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=d.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Pe={id:l,viaTimeout:!0}}}function en(e=!1){var n,t,o,r,l,i,a;if(!oe.value)return;const s=je.value||qe();if(!s)return;const u=s.ownerDocument||(null==(n=d.value)?void 0:n.ownerDocument)||document,c=(null==u?void 0:u.defaultView)||("undefined"!=typeof window?window:null),m=s===(null==u?void 0:u.documentElement)||s===(null==u?void 0:u.body),p=G.value.length;if(!m&&p>0&&Ge(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,r=function(e){var n;const t=G.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);if($e.value===t.length){const n=cn(0,t.length);return vn(Math.max(0,n-e))}let o=e;for(let r=t.length-1;r>=0;r--){const e=null!=(n=tn[r])?n:un.value;if(o<=e)return r;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),l=nn(r,0,Math.max(0,p-1));return void((e||Math.abs(l-ze.value)>1)&&(ze.value=l))}const h=m?null:s.getBoundingClientRect(),v=m?0:h.top,f=m?null!=(o=null!=(t=null==c?void 0:c.innerHeight)?t:s.clientHeight)?o:0:h.bottom,g=Se.value;let y=null,w=null;for(const[d,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=v||e.top>=f||(null==y&&(y=d),w=d)}if(null==y||null==w){const e=d.value;if(!e)return;const n=m?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,r,l,i,a,s;if(t)return null!=(i=null!=(l=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?l:null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)?i:0;const d=e.scrollTop;if(!Ge(e))return d;const u=d<0?-d:d;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-u}(s,u,m),o=m?(()=>{const t=e.getBoundingClientRect(),o=(m?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,r=0;for(;t&&t!==n&&r++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),p=m?null!=(a=null!=(i=null!=(l=null==c?void 0:c.innerHeight)?l:null==(r=null==u?void 0:u.documentElement)?void 0:r.clientHeight)?i:s.clientHeight)?a:0:s.clientHeight,h=vn(o+.5*Math.max(0,p));return void(ze.value=nn(h,0,Math.max(0,G.value.length-1)))}const k=Math.round((y+w)/2);!e&&Math.abs(k-ze.value)<=1||(ze.value=nn(k,0,Math.max(0,G.value.length-1)))}function nn(e,n,t){return Math.min(Math.max(e,n),t)}const tn=te({}),on=te({total:0,count:0});function rn(){for(const e of Object.keys(tn))delete tn[Number(e)];on.total=0,on.count=0,$e.value=0,Le.value=[],Ne.value=[]}function ln(e,n,t){for(let o=n+1;o<e.length;o+=o&-o)e[o]+=t}function an(e,n){let t=0;for(let o=n+1;o>0;o-=o&-o)t+=e[o];return t}function sn(e,n,t){if(t<=n)return 0;const o=an(e,t-1);return n<=0?o:o-an(e,n-1)}function dn(e){$e.value=e;const n=new Array(e+1).fill(0),t=new Array(e+1).fill(0);for(const[o,r]of Object.entries(tn)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(ln(n,l,i),ln(t,l,1))}Le.value=n,Ne.value=t}const un=E(()=>on.count>0?Math.max(12,on.total/on.count):32);function cn(e,n){var t,o;if(e>=n)return 0;if($e.value!==G.value.length){let o=0;for(let r=e;r<n;r++)o+=null!=(t=tn[r])?t:un.value;return o}const r=Le.value,l=Ne.value;if(!r.length||!l.length){let t=0;for(let r=e;r<n;r++)t+=null!=(o=tn[r])?o:un.value;return t}return sn(r,e,n)+(n-e-sn(l,e,n))*un.value}P(()=>G.value.length,e=>{e<=0?rn():(e<$e.value&&function(e){if(e<=0)return void rn();let n=0,t=0;for(const[o,r]of Object.entries(tn)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete tn[l]:(n+=i,t++)}on.total=n,on.count=t}(e),e!==$e.value&&dn(e))},{immediate:!0});const mn=E(()=>{if(!oe.value)return G.value.map((e,n)=>({node:e,index:n}));const e=G.value.length,n=nn(We.start,0,e),t=nn(We.end,n,e);return G.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),pn=E(()=>oe.value?cn(0,Math.min(We.start,G.value.length)):0),hn=E(()=>{if(!oe.value)return 0;const e=G.value.length;return cn(Math.min(We.end,e),e)});function vn(e){var n;if(e<=0)return 0;const t=G.value;if($e.value===t.length&&Le.value.length&&Ne.value.length){const n=un.value,o=Le.value,r=Ne.value,l=e=>e<=0?0:an(o,e-1)+(e-an(r,e-1))*n;let i=0,a=t.length-1,s=t.length-1;for(;i<=a;){const n=i+a>>1;l(n+1)>=e?(s=n,a=n-1):i=n+1}return s}let o=e;for(let r=0;r<t.length;r++){const e=null!=(n=tn[r])?n:un.value;if(o<=e)return r;o-=e}return Math.max(0,t.length-1)}function fn(){Ie.value+=1}function gn(e,n){const t=we.value,o=t.has(e);if(n){if(o)return;const n=new Set(t);return n.add(e),void(we.value=n)}if(!o)return;const r=new Set(t);r.delete(e),we.value=r}function yn(){0!==we.value.size&&(we.value=/* @__PURE__ */new Set)}function wn(e){if(!xe.size)return;if(!oe.value)return;let n=!1;for(const[t,o]of xe)t>=e&&(o.destroy(),xe.delete(t),De.value&&gn(t,!1),$n(t),Te.delete(t)&&(n=!0));n&&fn()}function kn(e,n){De.value&&gn(e,n),n&&(oe.value?Qe():ze.value=nn(e,0,Math.max(0,G.value.length-1)))}function bn(e){const n=be.get(e);n&&(n(),be.delete(e));const t=xe.get(e);t&&(t.destroy(),xe.delete(e)),$n(e)}function _n(e,n){let t=!1;if(n){const o=Te.get(e);Te.set(e,n),o!==n&&(t=!0)}else Te.delete(e)&&(t=!0);if(t&&fn(),n||$n(e),!Ae.value||!le)return bn(e),void(n&&kn(e,!0));if(!oe.value&&De.value&&!c.value&&xe.size>=640&&(function(){if(!c.value){c.value=!0;for(const e of xe.values())e.destroy();if(xe.clear(),p)for(const e of _e.values())window.clearTimeout(e);_e.clear(),yn()}}(),!Ae.value||!le))return bn(e),void(n&&kn(e,!0));if(e<me.value&&!oe.value)return bn(e),void kn(e,!0);if(we.value.has(e))return bn(e),void kn(e,!0);if(!n)return void bn(e);bn(e);const o=le(n,{rootMargin:"400px"});if(!o)return;xe.set(e,o),kn(e,o.isVisible.value),De.value&&function(e){if(!p||!De.value)return;$n(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(_e.delete(e),!De.value)return;if(we.value.has(e))return;const o=Te.get(e);if(!o)return;const r=qe(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,d=a?0:s.top,u=a?null!=(t=null!=(n=i.innerHeight)?n:null==r?void 0:r.clientHeight)?t:0:s.bottom,c=o.getBoundingClientRect();c.bottom>=d-500&&c.top<=u+500&&kn(e,!0)},1800+n);_e.set(e,t)}(e);let r=null;r=P(()=>o.isVisible.value,n=>{if(n){$n(e),kn(e,!0),null==r||r(),be.delete(e),xe.get(e)===o&&xe.delete(e);try{o.destroy()}catch(t){}}},{immediate:!0}),be.set(e,r),oe.value&&Qe()}let Mn=null,Tn=null,Cn=!1,Bn=null,In=null;function Sn(){p&&(null!=Mn&&(null==ae||ae(Mn),Mn=null),null!=Tn&&(window.clearTimeout(Tn),Tn=null),null!=In&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(In),In=null),Cn=!1,Bn=null)}function $n(e){if(!p)return;const n=_e.get(e);null!=n&&(window.clearTimeout(n),_e.delete(e))}function En(e,n={}){var t,o;if(!Re.value)return;const r=Ue.value;if(ve.value>=r)return;const i=Math.max(1,e),a=e=>{var n;Mn=null,Tn=null,In=null,Cn=!1;const t=null!=Bn?Bn:i;Bn=null;const o=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),a=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();ve.value=Math.min(r,ve.value+Math.max(1,e)),wn(ve.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!Re.value)return;const t=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),o=Math.max(1,ue.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*t?ge.value=Math.max(r,Math.floor(.7*ge.value)):e<.5*t&&ge.value<o&&(ge.value=Math.min(o,Math.ceil(1.2*ge.value)))}(t),t};let s=t;for(;(a(s),!(ve.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ge.value));ve.value<r&&Ln()};if(!p||n.immediate)return void a();const s=Math.max(0,null!=(t=l.renderBatchDelay)?t:16);if(Bn=null!=Bn?Math.max(Bn,i):i,!Cn){if(Cn=!0,!se&&de&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(In=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}ie&&!se?Mn=ie(()=>{0!==s?Tn=window.setTimeout(()=>a(),s):a()}):Tn=window.setTimeout(()=>a(),s)}}function Ln(){Re.value&&En(pe.value?Math.max(1,Math.round(ge.value)):Math.max(1,ue.value))}P([()=>G.value,()=>G.value.length,()=>Re.value,()=>ue.value,()=>me.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const n=G.value.length,t=fe.value,o=l.indexKey,r=void 0!==o&&o!==t.key,i=n!==t.total,a=r||i;fe.value={key:o,total:n};const s=Ke.value,d=null!=(e=l.renderBatchDelay)?e:16,u=s.batchSize!==ue.value||s.initial!==me.value||s.delay!==d||s.enabled!==Re.value;Ke.value={batchSize:ue.value,initial:me.value,delay:d,enabled:Re.value},r&&(rn(),n>0&&dn(n)),(a||u||!Re.value)&&Sn(),(a||u)&&(ge.value=Math.max(1,ue.value||1)),a&&oe.value&&Qe({immediate:!0});const c=Ue.value;if(!n)return ve.value=0,void wn(0);if(!Re.value)return ve.value=c,void wn(ve.value);const m=r||0===t.total;ve.value=m||u?Math.min(c,me.value):Math.min(ve.value,c);const h=Math.max(1,me.value||ue.value||n);ve.value<c?En(h,{immediate:!p}):wn(ve.value)},{immediate:!0}),P(()=>oe.value,e=>{if(!e)return Ye(),void Je();Ze(),Qe({immediate:!0})},{immediate:!0}),P([()=>G.value.length,()=>oe.value],e=>u(null,[e],function*([e,n]){n&&e&&p&&(yield R(),Qe({immediate:!0}))}),{flush:"post"}),P(()=>d.value,()=>{oe.value&&(Ze(),Qe({immediate:!0}))}),P(()=>G.value.length,()=>{oe.value&&Qe({immediate:!0})}),P(()=>De.value,e=>{if(e)for(const[n,t]of Te)_n(n,t);else{for(const e of xe.values())e.destroy();xe.clear();for(const e of Array.from(_e.keys()))$n(e);yn();for(const[e,n]of Te)n&&kn(e,!0)}},{immediate:!1}),P([()=>l.viewportPriority,()=>G.value.length],([e,n])=>{!1!==e?c.value&&n<=200&&(c.value=!1):c.value=!1}),P(()=>ve.value,()=>{oe.value&&Qe({immediate:!0})}),P([ze,ee,Oe,()=>G.value.length,oe],()=>{!function(){const e=G.value.length;if(!oe.value||0===e)return We.start=0,void(We.end=e);const n=Math.min(ee.value,e),t=Oe.value,o=nn(ze.value-t,0,Math.max(0,e-n));We.start=o,We.end=Math.min(e,o+n)}()},{immediate:!0}),P([()=>G.value.length,oe,ee,Oe,()=>We.start,()=>We.end],([e,n,t,o,r,l])=>{h.value&&_("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:ze.value,scroll:n?(()=>{const e=je.value||qe();return e?{reverse:Ge(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:ve.value})}),P(()=>Ue.value,(e,n)=>{Re.value&&("number"==typeof n&&e<=n||e>ve.value&&Ln())}),K(()=>{Sn();for(const e of xe.values())e.destroy();xe.clear();for(const e of be.values())e();be.clear();for(const e of Array.from(_e.keys()))$n(e);Ye(),Je()});const Nn=Y(()=>u(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),$t}})),jn=Y(()=>u(null,null,function*(){try{return(yield import("./index5.js")).default}catch(e){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".',e),$t}})),Hn=Y(()=>u(null,null,function*(){try{return(yield import("./index6.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',e),$t}})),Pn=Y(()=>u(null,null,function*(){try{return(yield import("./index7.js")).default}catch(e){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".',e),$t}})),On=E(()=>l.renderCodeBlocksAsPre?$t:Nn),zn={text:Dn,paragraph:Bt,heading:ft,code_block:Nn,list:yt,list_item:gt,blockquote:ce,table:Pt,definition_list:ye,footnote:mt,footnote_reference:Ee,footnote_anchor:dt,admonition:Zt,vmr_container:Ot,hardbreak:ht,link:nt,image:xn,thematic_break:Rt,math_inline:Rn,math_block:Kn,strong:qn,emphasis:at,strikethrough:Yn,highlight:lt,insert:ot,subscript:Un,superscript:Wn,emoji:ke,checkbox:he,checkbox_input:he,inline_code:Xe,html_inline:Fe,reference:An,html_block:Tt},Fn=E(()=>(Me.value,Ce(l.customId))),Vn=E(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Xn=E(()=>a(a({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof k.value?{showTooltips:k.value}:{}),l.codeBlockProps||{})),Gn=E(()=>a({},l.mermaidProps||{})),Zn=E(()=>a({},l.d2Props||{})),Jn=E(()=>a({},l.infographicProps||{})),Qn=E(()=>({typewriter:l.typewriter})),et=E(()=>a(a({},Qn.value),"boolean"==typeof k.value?{showTooltip:k.value}:{})),tt=E(()=>a(a({},Qn.value),"boolean"==typeof k.value?{showTooltips:k.value}:{})),rt=E(()=>mn.value.map(e=>{var n;let t=function(e){var n,t,o,r,l,i,s;if("code_block"!==e.type)return e;const d=e,u=[String(null!=(n=d.language)?n:""),String(null!=(t=d.loading)?t:""),String(null!=(o=d.diff)?o:""),String(null!=(r=d.code)?r:""),String(null!=(l=d.originalCode)?l:""),String(null!=(i=d.updatedCode)?i:""),String(null!=(s=d.raw)?s:"")].join("\0"),c=Be.get(d);if(c&&c.signature===u)return c.node;const m=a({},d);return Be.set(d,{signature:u,node:m}),m}(e.node);const o=st(t);let r=function(e,n){if(!e)return At;const t=Fn.value,o=t[String(e.type)];if("code_block"===e.type){const r=null!=n?n:st(e);if("mermaid"===r)return t.mermaid||jn;if("infographic"===r)return t.infographic||Hn;if("d2"===r||"d2lang"===r)return t.d2||Pn;if(o)return o;return t.code_block||On.value}return o||zn[String(e.type)]||At}(t,o);if(("html_block"===t.type||"html_inline"===t.type)&&r===zn[t.type]){const e=String(null!=(n=t.tag)?n:"").trim().toLowerCase()||function(e){const n=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return n?n[1].toLowerCase():""}(t.content);if(e&&q.value.has(e)){const n=Fn.value[e];n&&(r=n,t=s(a({},t),{type:e,tag:e,content:it(t.content,e)}))}}return s(a({},e),{node:t,component:r,bindings:ut(t,o),isCodeBlock:"code_block"===t.type,indexKey:`${Vn.value}-${e.index}`})}));function it(e,n){const t=String(null!=e?e:"");if(!n)return t;const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return t.replace(r,"").replace(l,"")}function st(e){var n;return"code_block"===(null==e?void 0:e.type)?String(null!=(n=e.language)?n:"").trim().toLowerCase():""}function ut(e,n){const t=null!=n?n:st(e);return"mermaid"===t?Gn.value:"infographic"===t?Jn.value:"d2"===t||"d2lang"===t?Zn.value:"link"===e.type?et.value:"list"===e.type?tt.value:"code_block"===e.type?Xn.value:Qn.value}function ct(e){i("click",e)}function pt(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseover",e)}function vt(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseout",e)}return(e,n)=>(x(),b("div",{ref_key:"containerRef",ref:d,class:L(["markstream-vue markdown-renderer",[{dark:l.isDark},{virtualized:oe.value}]]),"data-custom-id":l.customId,onClick:ct,onMouseover:pt,onMouseout:vt},[oe.value?(x(),b("div",{key:0,class:"node-spacer",style:V({height:`${pn.value}px`}),"aria-hidden":"true"},null,4)):D("",!0),(x(!0),b(C,null,B(rt.value,e=>{var t,o;return x(),b("div",{key:e.index,ref_for:!0,ref:n=>_n(e.index,n),class:"node-slot","data-node-index":e.index,"data-node-type":e.node.type},[(o=e.index,Re.value&&o>=ve.value||!(!De.value||o<me.value||we.value.has(o))?(x(),b("div",{key:1,class:"node-placeholder",style:V({height:`${null!=(t=tn[e.index])?t:un.value}px`})},null,4)):(x(),b("div",{key:0,ref_for:!0,ref:n=>function(e,n){n?(Ve.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=tn[e];if(tn[e]=n,t?on.total+=n-t:(on.total+=n,on.count++),$e.value>e){const o=Le.value,r=Ne.value;if(o.length&&r.length)if(t){const r=n-t;0!==r&&ln(o,e,r)}else ln(o,e,n),ln(r,e,1)}}(e,n.offsetHeight)})):Ve.delete(e)}(e.index,n),class:"node-content"},[e.isCodeBlock||!1===l.typewriter?(x(),A(Z(e.component),J({key:1,node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),A(z,{key:0,name:"typewriter",appear:""},{default:W(()=>[(x(),A(Z(e.component),J({node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024))],512)))],8,Wt)}),128)),oe.value?(x(),b("div",{key:1,class:"node-spacer",style:V({height:`${hn.value}px`}),"aria-hidden":"true"},null,4)):D("",!0)],42,zt))}}),[["__scopeId","data-v-74a6bf34"]]);Ft.install=e=>{var n,t;const o=null!=(t=null!=(n=Ft.__name)?n:Ft.name)?t:"NodeRenderer";e.component(o,Ft)};const Vt={key:0,class:"admonition-icon"},Ut={class:"admonition-title"},Xt=["aria-expanded","aria-controls","title"],qt={key:0},Gt={key:1},Yt=["id"],Zt=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,r=n,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=E(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),a=H(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(a.value=!a.value)}const d=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(x(),b("div",{class:L(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[T("div",{id:d,class:"admonition-header"},[l[o.node.kind]?(x(),b("span",Vt,I(l[o.node.kind]),1)):D("",!0),T("span",Ut,I(i.value),1),o.node.collapsible?(x(),b("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${d}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(x(),b("span",qt,"▶")):(x(),b("span",Gt,"▼"))],8,Xt)):D("",!0)]),F(T("div",{id:`${d}-content`,class:"admonition-content","aria-labelledby":d},[_(M(Ft),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"])],8,Yt),[[U,!a.value]])],2))}}),[["__scopeId","data-v-ee240a2a"]]);Zt.install=e=>{e.component(Zt.__name,Zt)};const Jt=()=>import("@terrastruct/d2");let Qt=null,eo=Jt;function no(e){eo=e,Qt=null}function to(e){no(null!=e?e:Jt)}function oo(){no(null)}function ro(){return"function"==typeof eo}function lo(){return u(this,null,function*(){if(Qt)return Qt;const e=eo;if(!e)return null;let n;try{n=yield e()}catch(t){if(e===Jt)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw t}return n?(Qt=function(e){var n;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const t=null!=(n=e.default)?n:e;return"function"==typeof t?t:(null==t?void 0:t.D2)&&"function"==typeof t.D2?t.D2:t}(n),Qt):null})}let io=!1,ao=null,so=!1;function uo(){return u(this,null,function*(){if(ao)return ao;if(so)return null;try{return ao=yield import("stream-monaco"),yield function(e){return u(this,null,function*(){if(io)return;io=!0;const n=null==globalThis?void 0:globalThis.MonacoEnvironment;return!n||"function"!=typeof n.getWorker&&"function"!=typeof n.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(ao),(yield function(e){return u(this,null,function*(){const n=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof n)return!0;try{const e=yield n(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(t){return console.warn("[markstream-vue] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",t),!1}})}(ao))?ao:(ao=null,so=!0,null)}catch(e){return so=!0,null}})}function co({R:e,H:n=0,B:t=50}){const o=e*(1-n)||1e-6;return Math.max(1,Math.floor(t/o))}function mo(e){const n=e.length+10*(e.match(/\\/g)||[]).length;return n<10?"simple":n<40?"medium":"complex"}function po(e){switch(e){case"simple":return 3;case"medium":return 10;case"complex":return 30}}function ho(e,n){var t,o;let r=0;for(const l of e){const e=po(mo(l));e>r&&(r=e)}return co({R:r,H:null!=(t=null==n?void 0:n.H)?t:0,B:null!=(o=null==n?void 0:n.B)?o:50})}const vo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n',fo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n',go='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';let yo=null,wo=null,ko=null;const xo=S(0),bo={"":go,plain:go,text:go,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n',typescript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n',cs:vo,csharp:vo,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n',shell:fo,powershell:fo,sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n'},_o={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Mo(){return u(this,null,function*(){return wo||(ko||(ko=import("./languageIconExtended.js").then(e=>(wo=e.EXTENDED_LANGUAGE_ICON_MAP,xo.value++,wo)).catch(()=>null)),ko)})}function To(e){yo=null!=e?e:null}function Co(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[o]=t.split(":");return o.toLowerCase()}(e);return null!=(n=_o[t])?n:t}function Bo(e){const n=Co(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function Io(){return u(this,null,function*(){yield Mo()})}function So(e){if(yo){const n=yo(e);if(null!=n&&""!==n)return n}const n=Co(e),t=bo[n];if(t)return t;return(null==wo?void 0:wo[n])||(Mo(),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>')}const $o={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},Eo=new class{constructor(){d(this,"metrics",[]),d(this,"enabled",!1),d(this,"maxMetrics",1e3)}enable(){this.enabled=!0}disable(){this.enabled=!1}recordRender(e){this.enabled&&(this.metrics.push(e),this.metrics.length>this.maxMetrics&&this.metrics.shift())}getStats(){if(0===this.metrics.length)return{totalRenders:0,cacheHitRate:0,averageWorkerTime:0,averageDirectTime:0,averageCacheHitTime:0,workerSavings:0,recommendation:"Insufficient data"};const e=this.metrics.filter(e=>"worker"===e.type&&e.success),n=this.metrics.filter(e=>"direct"===e.type&&e.success),t=this.metrics.filter(e=>"cache-hit"===e.type),o=this.metrics.length,r=t.length,l=r/o*100,i=e.length>0?e.reduce((e,n)=>e+n.duration,0)/e.length:0,a=n.length>0?n.reduce((e,n)=>e+n.duration,0)/n.length:0,s=t.length>0?t.reduce((e,n)=>e+n.duration,0)/t.length:0,d=o*a-(e.reduce((e,n)=>e+n.duration,0)+n.reduce((e,n)=>e+n.duration,0)+t.reduce((e,n)=>e+n.duration,0));let u="";return u=l>70&&i<2*a?"✅ Worker + Cache is highly beneficial":l>50?"✅ Worker + Cache is beneficial":i>3*a?"⚠️ Worker overhead too high, consider direct rendering":a<5?"⚠️ Formulas too simple, Worker overhead may not be worth it":"✅ Worker prevents main thread blocking",{totalRenders:o,cacheHits:r,cacheHitRate:l.toFixed(1),workerCalls:e.length,directCalls:n.length,averageWorkerTime:i.toFixed(2),averageDirectTime:a.toFixed(2),averageCacheHitTime:s.toFixed(3),workerSavings:d.toFixed(2),recommendation:u}}printReport(){const e=this.getStats();return console.group("📊 KaTeX Rendering Performance Report"),e.totalRenders,e.cacheHits,e.cacheHitRate,e.workerCalls,e.directCalls,e.averageWorkerTime,e.averageDirectTime,e.averageCacheHitTime,e.workerSavings,e.recommendation,console.groupEnd(),e}reset(){this.metrics=[]}exportMetrics(){return{metrics:[...this.metrics],stats:this.getStats(),timestamp:Date.now()}}};function Lo(){Eo.enable()}function No(){Eo.disable()}function jo(){return Eo.printReport()}function Ho(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(n){}return globalThis.setTimeout(e,0)}function Po(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(n){}try{globalThis.clearTimeout(e)}catch(n){}}"undefined"!=typeof window&&(window.__katexPerfReport=jo,window.__katexPerfMonitor=Eo);const Do={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},Ro={class:"flex items-center gap-x-2"},Ko=["innerHTML"],Ao={class:"text-sm font-medium font-mono"},Oo={class:"flex items-center gap-x-2"},zo=["aria-pressed"],Wo=["disabled"],Fo=["disabled"],Vo=["disabled"],Uo=["aria-label"],Xo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},qo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Go=["aria-pressed"],Yo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Zo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Jo=["aria-label"],Qo=["innerHTML"],er={class:"code-loading-placeholder"},nr=/* @__PURE__ */ue(/* @__PURE__ */k({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean}},emits:["previewCode","copy"],setup(e,{emit:n}){const t=e,o=n,{t:r}=hn(),l=H(Co(t.node.language)),i=H(!1),a=H(!1),s=H(!1),d=H(null),c=H(null),m=H(""),p=H(!1);let h;const v=H(!0),f=H(0),g=H(14),y=H(g.value),w=E(()=>{const e=g.value,n=y.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),k=E(()=>{const e=l.value.trim().toLowerCase();return $o[e]||e.charAt(0).toUpperCase()+e.slice(1)}),_=E(()=>(xo.value,So(l.value.trim().toLowerCase().split(":")[0]))),B=E(()=>{const e=l.value.trim().toLowerCase();return t.isShowPreview&&("html"===e||"svg"===e)}),S=E(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},o=n(t.minWidth),r=n(t.maxWidth);return o&&(e.minWidth=o),r&&(e.maxWidth=r),e}),$=E(()=>({fontSize:`${y.value}px`})),N=E(()=>!1!==t.showTooltips);function j(){return t.isDark?t.darkTheme:t.lightTheme}function A(e){if(null==h||h.disconnect(),h=void 0,!e)return m.value="",void(p.value=!1);var n;m.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,p.value=!1}function O(){m.value="",p.value=!0}function z(){var e;const n=c.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function W(){return u(this,null,function*(){if(yield R(),z())return void O();const e=c.value;e&&(null==h||h.disconnect(),h=new MutationObserver(()=>{z()&&(O(),null==h||h.disconnect(),h=void 0)}),h.observe(e,{childList:!0,subtree:!0}))})}let X,G,Y,Z;const J=/* @__PURE__ */new Set,Q=/* @__PURE__ */new Set,ee=void 0!==import.meta&&Boolean(!1);function ne(e,n){return u(this,null,function*(){if(!X)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),r=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return r?!Z||Z.has(r)?r:(n&&ee&&!J.has(r)&&(J.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield X.updateCode(e,t)}catch(o){"plaintext"!==t?(ee&&!Q.has(t)&&(Q.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield X.updateCode(e,"plaintext")):ee&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function te(){return u(this,null,function*(){yield function(){return u(this,null,function*(){if(!G)try{const e=yield import("stream-markdown");G=e.createShikiStreamRenderer,Y=e.registerHighlight;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Z=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==Y||Y({themes:t.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),d.value&&c.value?(null==Y||Y({themes:t.themes}),!X&&G&&(X=G(c.value,{theme:j()}),p.value=!0),X?!1===t.stream&&t.loading?A(t.node.code):(A(t.node.code),yield ne(t.node.code,l.value),yield W()):A(t.node.code)):A(t.node.code)})}function re(){const e=d.value;if(!e||a.value)return;const n=e.scrollTop;n<f.value?v.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(v.value=!0),f.value=n}function le(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(t.node.code)),i.value=!0,o("copy",t.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ie(e){const n=e.currentTarget||e.target;return!n||n.disabled?null:n}function ae(e,n,o="top"){if(!N.value)return;const r=ie(e);if(!r)return;const l=e;un(r,n,o,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,t.isDark)}function se(){N.value&&cn()}function de(e){if(!N.value)return;const n=ie(e);if(!n)return;const o=e;un(n,i.value?r("common.copied")||"Copied":r("common.copy")||"Copy","top",!1,null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0,t.isDark)}function ue(){s.value=!s.value}function ce(){if(!B.value)return;const e=(l.value||t.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";o("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:t.node.code,title:n})}return te(),oe(()=>{te()}),K(()=>{null==h||h.disconnect(),h=void 0}),P(()=>t.themes,()=>u(null,null,function*(){Y&&Y({themes:t.themes})})),P(()=>t.loading,e=>{e||te()}),P(N,e=>{e||cn()}),P(()=>[t.node.code,t.node.language],e=>u(null,[e],function*([e,n]){const o=Co(n);o!==l.value&&(l.value=o),d.value&&c.value?(X||(A(e),yield te()),X&&e&&(!1===t.stream&&t.loading||(A(e),yield ne(e,n),yield W()))):A(e)})),P(()=>[t.darkTheme,t.lightTheme],()=>u(null,null,function*(){d.value&&c.value&&(X||(yield te()),null==X||X.setTheme(j()))})),P(()=>t.node.code,()=>u(null,null,function*(){if(a.value||!v.value)return;yield R();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,o)=>(x(),b("div",{style:V(S.value),class:L(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[t.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",t.isDark?"is-dark":""]])},[t.showHeader?(x(),b("div",Do,[q(n.$slots,"header-left",{},()=>[T("div",Ro,[T("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:_.value},null,8,Ko),T("span",Ao,I(k.value),1)])],!0),q(n.$slots,"header-right",{},()=>[T("div",Oo,[t.showCollapseButton?(x(),b("button",{key:0,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:ue,onMouseenter:o[0]||(o[0]=e=>ae(e,s.value?M(r)("common.expand")||"Expand":M(r)("common.collapse")||"Collapse")),onFocus:o[1]||(o[1]=e=>ae(e,s.value?M(r)("common.expand")||"Expand":M(r)("common.collapse")||"Collapse")),onMouseleave:se,onBlur:se},[(x(),b("svg",{style:V({rotate:s.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...o[18]||(o[18]=[T("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,zo)):D("",!0),t.showFontSizeButtons&&t.enableFontSizeControl?(x(),b(C,{key:1},[T("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(y.value)&&y.value<=10,onClick:o[2]||(o[2]=e=>function(){const e=Math.max(10,y.value-1);y.value=e}()),onMouseenter:o[3]||(o[3]=e=>ae(e,M(r)("common.decrease")||"Decrease")),onFocus:o[4]||(o[4]=e=>ae(e,M(r)("common.decrease")||"Decrease")),onMouseleave:se,onBlur:se},[...o[19]||(o[19]=[T("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[T("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Wo),T("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!w.value||y.value===g.value,onClick:o[5]||(o[5]=e=>{y.value=g.value}),onMouseenter:o[6]||(o[6]=e=>ae(e,M(r)("common.reset")||"Reset")),onFocus:o[7]||(o[7]=e=>ae(e,M(r)("common.reset")||"Reset")),onMouseleave:se,onBlur:se},[...o[20]||(o[20]=[T("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[T("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[T("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),T("path",{d:"M3 3v5h5"})])],-1)])],40,Fo),T("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(y.value)&&y.value>=36,onClick:o[8]||(o[8]=e=>function(){const e=Math.min(36,y.value+1);y.value=e}()),onMouseenter:o[9]||(o[9]=e=>ae(e,M(r)("common.increase")||"Increase")),onFocus:o[10]||(o[10]=e=>ae(e,M(r)("common.increase")||"Increase")),onMouseleave:se,onBlur:se},[...o[21]||(o[21]=[T("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[T("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Vo)],64)):D("",!0),t.showCopyButton?(x(),b("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":i.value?M(r)("common.copied")||"Copied":M(r)("common.copy")||"Copy",onClick:le,onMouseenter:o[11]||(o[11]=e=>de(e)),onFocus:o[12]||(o[12]=e=>de(e)),onMouseleave:se,onBlur:se},[i.value?(x(),b("svg",qo,[...o[23]||(o[23]=[T("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(x(),b("svg",Xo,[...o[22]||(o[22]=[T("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[T("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),T("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Uo)):D("",!0),t.showExpandButton?(x(),b("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":a.value,onClick:o[13]||(o[13]=e=>function(e){if(a.value=!a.value,e&&N.value){const n=ie(e);n&&un(n,a.value?r("common.collapse")||"Collapse":r("common.expand")||"Expand","top",!1,void 0,t.isDark)}const n=d.value;n&&(a.value?(n.style.maxHeight="none",n.style["overflow-y"]="visible",n.style["overflow-x"]="auto"):(n.style.maxHeight="500px",n.style.overflow="auto",v.value=!0,R(()=>{n.scrollHeight>n.clientHeight&&(n.scrollTop=n.scrollHeight)})))}(e)),onMouseenter:o[14]||(o[14]=e=>ae(e,a.value?M(r)("common.collapse")||"Collapse":M(r)("common.expand")||"Expand")),onFocus:o[15]||(o[15]=e=>ae(e,a.value?M(r)("common.collapse")||"Collapse":M(r)("common.expand")||"Expand")),onMouseleave:se,onBlur:se},[a.value?(x(),b("svg",Yo,[...o[24]||(o[24]=[T("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(x(),b("svg",Zo,[...o[25]||(o[25]=[T("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],40,Go)):D("",!0),B.value&&t.showPreviewButton?(x(),b("button",{key:4,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":M(r)("common.preview")||"Preview",onClick:ce,onMouseenter:o[16]||(o[16]=e=>ae(e,M(r)("common.preview")||"Preview")),onFocus:o[17]||(o[17]=e=>ae(e,M(r)("common.preview")||"Preview")),onMouseleave:se,onBlur:se},[...o[26]||(o[26]=[T("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[T("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[T("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),T("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Jo)):D("",!0)])],!0)])):D("",!0),F(T("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:V($.value),onScroll:re},[T("div",{ref_key:"rendererTarget",ref:c,class:"code-block-render"},null,512),p.value?D("",!0):(x(),b("div",{key:0,class:"code-fallback-plain",innerHTML:m.value},null,8,Qo))],36),[[U,!(s.value||!e.stream&&e.loading)]]),F(T("div",er,[q(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[o[27]||(o[27]=T("div",{class:"loading-skeleton"},[T("div",{class:"skeleton-line"}),T("div",{class:"skeleton-line"}),T("div",{class:"skeleton-line short"})],-1))],!0)],512),[[U,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-af5307e3"]]);nr.install=e=>{e.component(nr.__name,nr)};const tr=()=>import("mermaid");let or=null,rr=tr;function lr(e){rr=e,or=null}function ir(e){lr(null!=e?e:tr)}function ar(){lr(null)}function sr(){return"function"==typeof rr}function dr(e){if(!e)return e;const n=e&&e.default?e.default:e;if(n&&("function"==typeof n.render||"function"==typeof n.parse||"function"==typeof n.initialize))return n;if(n&&n.mermaidAPI&&("function"==typeof n.mermaidAPI.render||"function"==typeof n.mermaidAPI.parse)){const e=n.mermaidAPI;return s(a({},n),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:t=>"function"==typeof n.initialize?n.initialize(t):e.initialize?e.initialize(t):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:n}function ur(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=a({suppressErrorRendering:!0},t||{});return"function"==typeof n?n.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(n){}}function cr(){return u(this,null,function*(){if(or)return or;const e=function(){try{const e=globalThis;return dr(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return or=e,ur(or),or;const n=rr;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===tr)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(or=dr(t),ur(or),or):null})}function mr(e){return JSON.stringify(e)}function pr(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,r=e.mhchemUrl,l=mr(a({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=mr(o),s=r?mr(r):'""';return"module"===t?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function hr(e){var n,t;const o=pr(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const d="module"===(null!=(n=e.mode)?n:"classic")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,u=new Worker(l,d);if(e.debug)try{u.postMessage({type:"init",debug:!0})}catch(c){}return{worker:u,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(c){}}},source:o}}Ye.install=e=>{e.component(Ye.__name,Ye)};let vr=null,fr=null,gr=!1;const yr=/* @__PURE__ */new Map,wr=/* @__PURE__ */new Map;let kr=5;const xr=/* @__PURE__ */new Set;function br(){if(yr.size<kr&&xr.size){const n=Array.from(xr);xr.clear();for(const t of n)try{t()}catch(e){}}}function _r(e){vr=e,fr=null,vr.onmessage=e=>{const{id:n,html:t,error:o}=e.data,r=yr.get(n);if(r)if(yr.delete(n),clearTimeout(r.timeoutId),br(),o)r.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(wr.set(e,t),wr.size>200){const e=wr.keys().next().value;wr.delete(e)}}r.resolve(t)}},vr.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of yr.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));yr.clear(),br()}}function Mr(){var e;vr&&(null==(e=vr.terminate)||e.call(vr)),vr=null,fr=null}function Tr(e){gr=!!e,vr&&vr.postMessage({type:"init",debug:gr})}function Cr(e,n=!0,t=2e3,o){return u(this,null,function*(){if(performance.now(),!En()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(fr)return Promise.reject(fr);const r=`${n?"d":"i"}:${e}`,l=wr.get(r);if(l)return Promise.resolve(l);const i=vr||(fr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),fr.name="WorkerInitError",fr.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(fr);if(yr.size>=kr){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=yr.size,e.max=kr,Promise.reject(e)}return new Promise((r,l)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void l(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{yr.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",l(e),br()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),yr.has(a)&&yr.delete(a);const e=new Error("Aborted");e.name="AbortError",l(e),br()},{once:!0});const d=r,u=l;yr.set(a,{resolve:e=>{d(e)},reject:e=>{u(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:n})})})}function Br(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(wr.set(o,t),wr.size>200){const e=wr.keys().next().value;wr.delete(e)}}function Ir(){return{inFlight:yr.size,max:kr}}function Sr(e){Number.isFinite(e)&&e>0&&(kr=Math.floor(e))}const $r="WORKER_BUSY";function Er(){return yr.size>=kr}function Lr(e=2e3,n){return yr.size<kr?Promise.resolve():new Promise((t,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),xr.delete(i),t())};if(xr.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,xr.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>br()),n){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),xr.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const Nr={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function jr(e){null!=e.timeout&&(Nr.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Nr.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Nr.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Nr.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Hr(){return a({},Nr)}function Pr(e){return u(this,arguments,function*(e,n=!0,t={}){var o,r,l,i;if(!En()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=t.timeout)?o:Nr.timeout,s=null!=(r=t.waitTimeout)?r:Nr.waitTimeout,d=null!=(l=t.backoffMs)?l:Nr.backoffMs,u=null!=(i=t.maxRetries)?i:Nr.maxRetries,c=Number.isFinite(u)?Math.max(0,Math.min(Math.floor(u),8)):Nr.maxRetries,m=t.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Cr(e,n,a,m)}catch(h){if((null==h?void 0:h.code)!==$r||p>=c)throw h;if(p++,yield Lr(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}d>0&&(yield new Promise(e=>globalThis.setTimeout(e,d*p)))}}})}function Dr(e){return JSON.stringify(e)}function Rr(e){var n;const t=null!=(n=e.mode)?n:"module",o=Dr(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${Dr(a({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===t?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function Kr(e){var n,t;const o=Rr(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const d="module"===(null!=(n=e.mode)?n:"module")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,u=new Worker(l,d);if(e.debug)try{u.postMessage({type:"init",debug:!0})}catch(c){}return{worker:u,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(c){}}},source:o}}let Ar=null,Or=null;const zr=/* @__PURE__ */new Map;let Wr=5,Fr=!1;function Vr(e){Fr=!!e}function Ur(e){Number.isFinite(e)&&e>0&&(Wr=Math.floor(e))}function Xr(){return{inFlight:zr.size,max:Wr}}const qr="WORKER_BUSY",Gr="MERMAID_DISABLED";function Yr(e){Ar=e,Or=null;const n=e;Ar.onmessage=e=>{if(Ar!==n)return;const{id:t,ok:o,result:r,error:l}=e.data,i=zr.get(t);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Ar.onerror=e=>{var t,o;if(Ar===n)if(0!==zr.size){try{Fr?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[n,t]of zr.entries())t.reject(new Error(`Worker error: ${e.message}`));zr.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Ar.onmessageerror=e=>{var t,o;if(Ar===n)if(0!==zr.size){try{Fr?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,n]of zr.entries())n.reject(new Error("Worker messageerror"));zr.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Zr(){var e;if(Ar)try{for(const[e,n]of zr.entries())n.reject(new Error("Worker cleared"));zr.clear(),null==(e=Ar.terminate)||e.call(Ar)}catch(n){}Ar=null,Or=null}function Jr(e,n,t=1400){if(!sr()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Gr,Promise.reject(e)}if(Or)return Promise.reject(Or);const o=Ar||(Or=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Or.name="WorkerInitError",Or.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Or);if(zr.size>=Wr){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=qr,e.inFlight=zr.size,e.max=Wr,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const d=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),zr.delete(i))},u={resolve:e=>{d(),r(e)},reject:e=>{d(),l(e)}};zr.set(i,u);try{o.postMessage({id:i,action:e,payload:n})}catch(c){return zr.delete(i),void l(c)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=zr.get(i);n&&n.reject(e)},t)})}function Qr(e,n,t=1400){return u(this,null,function*(){try{return yield Jr("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function el(e,n,t=1400){return u(this,null,function*(){try{return yield Jr("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function nl(){if(Ar)try{for(const[e,n]of zr.entries())n.reject(new Error("Worker terminated"));zr.clear(),Ar.terminate()}finally{Ar=null}}const tl=Y(()=>import("./index4.js")),ol=Y(()=>import("./index3.js")),rl=Y(()=>import("./index2.js")),ll=Y(()=>import("./index5.js")),il=Y(()=>import("./index6.js")),al=Y(()=>import("./index7.js")),sl={AdmonitionNode:Zt,BlockquoteNode:ce,CheckboxNode:he,CodeBlockNode:tl,DefinitionListNode:ye,EmojiNode:ke,EmphasisNode:at,FootnoteNode:mt,FootnoteReferenceNode:Ee,FootnoteAnchorNode:dt,HardBreakNode:ht,HeadingNode:ft,HtmlBlockNode:Tt,HtmlInlineNode:Fe,HighlightNode:lt,ImageNode:xn,D2BlockNode:al,InfographicBlockNode:il,InlineCodeNode:Xe,PreCodeNode:$t,InsertNode:ot,LinkNode:nt,ListItemNode:gt,ListNode:yt,MathBlockNode:ol,MathInlineNode:rl,MermaidBlockNode:ll,ParagraphNode:Bt,StrikethroughNode:Yn,StrongNode:qn,SubscriptNode:Un,SuperscriptNode:Wn,TableNode:Pt,TextNode:Dn,ThematicBreakNode:Rt,VmrContainerNode:Ot,ReferenceNode:An,MarkdownCodeBlockNode:nr},dl={install(e,n){Object.entries(sl).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&To(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&w(n.mathOptions)}};export{ll as $,Zt as A,ce as B,he as C,al as D,ke as E,dt as F,Ee as G,ht as H,ft as I,lt as J,Tt as K,Fe as L,xn as M,il as N,Xe as O,ot as P,nt as Q,gt as R,yt as S,Gr as T,qr as U,nr as V,$r as W,Ft as X,ol as Y,rl as Z,ue as _,xt as a,Bt as a0,An as a1,Yn as a2,qn as a3,Un as a4,Wn as a5,Pt as a6,Dn as a7,Rt as a8,Ye as a9,En as aA,sr as aB,Eo as aC,Io as aD,ho as aE,co as aF,Be as aG,Cr as aH,Te as aI,no as aJ,pn as aK,jr as aL,_r as aM,Tr as aN,Sr as aO,In as aP,To as aQ,lr as aR,Yr as aS,Vr as aT,Ur as aU,Lr as aV,Ot as aa,dl as ab,pr as ac,Rr as ad,Ie as ae,Mr as af,Zr as ag,hr as ah,Kr as ai,po as aj,oo as ak,$n as al,ar as am,No as an,to as ao,Sn as ap,ir as aq,Lo as ar,mo as as,Ce as at,Hr as au,Ir as av,Xr as aw,jo as ax,ro as ay,Er as az,xo as b,So as c,$t as d,un as e,Po as f,uo as g,cn as h,Ln as i,Pr as j,Nn as k,$o as l,Br as m,Co as n,cr as o,Qr as p,el as q,Bo as r,Ho as s,nl as t,hn as u,lo as v,tl as w,ye as x,at as y,mt as z};