markstream-vue 0.0.2-beta.5 → 0.0.2-beta.7

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.
@@ -1,8 +1,8 @@
1
- "use strict";var so=Object.create;var hn=Object.defineProperty,co=Object.defineProperties,uo=Object.getOwnPropertyDescriptor,mo=Object.getOwnPropertyDescriptors,fo=Object.getOwnPropertyNames,En=Object.getOwnPropertySymbols,ho=Object.getPrototypeOf,Tn=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable;var Nn=(t,o,n)=>o in t?hn(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,Z=(t,o)=>{for(var n in o||(o={}))Tn.call(o,n)&&Nn(t,n,o[n]);if(En)for(var n of En(o))po.call(o,n)&&Nn(t,n,o[n]);return t},qe=(t,o)=>co(t,mo(o));var vo=(t,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of fo(o))!Tn.call(t,r)&&r!==n&&hn(t,r,{get:()=>o[r],enumerable:!(s=uo(o,r))||s.enumerable});return t};var gt=(t,o,n)=>(n=t!=null?so(ho(t)):{},vo(o||!t||!t.__esModule?hn(n,"default",{value:t,enumerable:!0}):n,t));var V=(t,o,n)=>new Promise((s,r)=>{var l=m=>{try{v(n.next(m))}catch(d){r(d)}},i=m=>{try{v(n.throw(m))}catch(d){r(d)}},v=m=>m.done?s(m.value):Promise.resolve(m.value).then(l,i);v((n=n.apply(t,o)).next())});const vn=require("stream-markdown-parser"),e=require("vue"),kt=require("@floating-ui/dom"),go=["cite"],ko=e.defineComponent({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("blockquote",{class:"blockquote",dir:"auto",cite:t.node.cite},[e.withMemo([t.node.children],()=>e.createVNode(e.unref(Ee),{"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],typewriter:t.typewriter,onCopy:n[0]||(n[0]=s=>o.$emit("copy",s))},null,8,["index-key","nodes","typewriter"]),n,1)],8,go))}}),R=(t,o)=>{const n=t.__vccOpts||t;for(const[s,r]of o)n[s]=r;return n},wt=R(ko,[["__scopeId","data-v-adfdba00"]]);wt.install=t=>{t.component(wt.__name,wt)};const wo={class:"checkbox-node"},yo=["checked"],xo=e.defineComponent({__name:"CheckboxNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",wo,[e.createElementVNode("input",{type:"checkbox",checked:t.node.checked,disabled:"",class:"checkbox-input"},null,8,yo)]))}}),Le=R(xo,[["__scopeId","data-v-8dc6c46f"]]);Le.install=t=>{t.component(Le.__name,Le)};const bo={class:"definition-list"},Bo={class:"definition-term"},Mo={class:"definition-desc"},Co=e.defineComponent({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("dl",bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.items,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[e.createElementVNode("dt",Bo,[e.createVNode(e.unref(Ee),{"index-key":`definition-term-${t.indexKey}-${r}`,nodes:s.term,typewriter:t.typewriter,onCopy:n[0]||(n[0]=l=>o.$emit("copy",l))},null,8,["index-key","nodes","typewriter"])]),e.createElementVNode("dd",Mo,[e.createVNode(e.unref(Ee),{"index-key":`definition-desc-${t.indexKey}-${r}`,nodes:s.definition,typewriter:t.typewriter,onCopy:n[1]||(n[1]=l=>o.$emit("copy",l))},null,8,["index-key","nodes","typewriter"])])],64))),128))]))}}),yt=R(Co,[["__scopeId","data-v-5a21f288"]]);yt.install=t=>{t.component(yt.__name,yt)};const Eo={class:"emoji-node"},No=e.defineComponent({__name:"EmojiNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",Eo,e.toDisplayString(t.node.name),1))}}),se=R(No,[["__scopeId","data-v-de55dc97"]]);se.install=t=>{t.component(se.__name,se)};const At="__global__",it={};function To(t,o){typeof t=="string"?it[t]=o||{}:it[At]=t||{}}function Ne(t){return t?it[t]||it[At]||{}:it[At]||{}}function $o(t){if(t===At)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete it[t]}function So(){delete it[At]}const Vo=["id"],Io=["title"],_o=e.defineComponent({__name:"FootnoteReferenceNode",props:{node:{}},setup(t){const n=`#footnote-${t.node.id}`;function s(){if(typeof document=="undefined")return;const r=document.querySelector(n);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(r,l)=>(e.openBlock(),e.createElementBlock("sup",{class:"footnote-reference",id:`fnref-${t.node.id}`,onClick:s},[e.createElementVNode("span",{href:n,title:`查看脚注 ${t.node.id}`,class:"footnote-link cursor-pointer"},"["+e.toDisplayString(t.node.id)+"]",9,Io)],8,Vo))}}),ce=R(_o,[["__scopeId","data-v-3546d1d1"]]);ce.install=t=>{t.component(ce.__name,ce)};const Lo={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},de=e.defineComponent({__name:"InlineCodeNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("code",Lo,e.toDisplayString(t.node.code),1))}});de.install=t=>{t.component(de.__name,de)};const Do=["id"],zo=e.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(t){const o=t,n=e.computed(()=>{if(o.isDark!==void 0&&o.isDark!==null)return!!o.isDark;if(typeof document!="undefined")try{if(document.documentElement.classList.contains("dark")||window!=null&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(m){}return!1}),s=e.ref(null),r=e.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=e.ref(!1);let i=null;function v(){return V(this,null,function*(){var h,b;if(!o.anchorEl||!s.value)return;const m=[kt.offset((h=o.offset)!=null?h:8),kt.flip(),kt.shift({padding:8})],{x:d,y:g}=yield kt.computePosition(o.anchorEl,s.value,{placement:(b=o.placement)!=null?b:"top",middleware:m,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(d)}px, ${Math.round(g)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return e.watch(()=>o.visible,m=>V(null,null,function*(){if(m)if(l.value=!1,yield e.nextTick(),o.anchorEl&&s.value)try{const d=o.anchorEl.getBoundingClientRect();yield v();const g=r.value.transform;if(o.originX!=null&&o.originY!=null){const h=Math.abs(Number(o.originX)-d.left),b=Math.abs(Number(o.originY)-d.top);Math.hypot(h,b)>120?(r.value.transform=`translate3d(${Math.round(o.originX)}px, ${Math.round(o.originY)}px, 0)`,yield e.nextTick(),l.value=!0,yield e.nextTick(),r.value.transform=g):l.value=!0}else l.value=!0;i=kt.autoUpdate(o.anchorEl,s.value,v)}catch(d){yield v(),l.value=!0,i=kt.autoUpdate(o.anchorEl,s.value,v)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),e.watch([()=>o.anchorEl,()=>o.placement,()=>o.content],()=>V(null,null,function*(){o.visible&&o.anchorEl&&s.value&&(yield e.nextTick(),yield v())})),e.onBeforeUnmount(()=>{i&&i()}),(m,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"tooltip",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:o.id,ref_key:"tooltip",ref:s,style:e.normalizeStyle({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:e.normalizeClass(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[n.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},e.toDisplayString(t.content),15,Do),[[e.vShow,t.visible&&l.value]])]),_:1})]))}}),Ro=R(zo,[["__scopeId","data-v-993f63aa"]]),xn=e.ref(!1),jn=e.ref(""),Pn=e.ref("top"),jt=e.ref(null),Wt=e.ref(null),bn=e.ref(null),Bn=e.ref(null),An=e.ref(null);let Qt=null,en=null;function Wn(){Qt&&(clearTimeout(Qt),Qt=null),en&&(clearTimeout(en),en=null)}let $n=!1;function Ho(){if($n||typeof document=="undefined")return;$n=!0;const t=document.createElement("div");t.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(t);const o={setup(){return()=>{var n;return e.h(Ro,{visible:xn.value,"anchor-el":jt.value,content:jn.value,placement:Pn.value,id:Wt.value,originX:bn.value,originY:Bn.value,isDark:(n=An.value)!=null?n:void 0})}}};e.createApp(o).mount(t)}function Tt(t,o,n="top",s=!1,r,l){if(!t)return;Ho(),Wn();const i=()=>{var v,m;Wt.value=`tooltip-${Date.now()}-${Math.floor(Math.random()*1e3)}`,jt.value=t,jn.value=o,Pn.value=n,bn.value=(v=r==null?void 0:r.x)!=null?v:null,Bn.value=(m=r==null?void 0:r.y)!=null?m:null,An.value=typeof l=="boolean"?l:null,xn.value=!0;try{t.setAttribute("aria-describedby",Wt.value)}catch(d){}};s?i():Qt=setTimeout(i,80)}function nn(t=!1){Wn();const o=()=>{if(jt.value&&Wt.value)try{jt.value.removeAttribute("aria-describedby")}catch(n){}xn.value=!1,jt.value=null,Wt.value=null,bn.value=null,Bn.value=null};t?o():en=setTimeout(o,120)}function jo(t){return(t.split(".").pop()||t).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,n=>n.toUpperCase()).trim()}const Kn={"common.copy":"Copy","common.copySuccess":"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 Po(t){Object.assign(Kn,t)}function on(){try{const o=globalThis.$vueI18nUse||null;if(o&&typeof o=="function")try{const n=o();if(n&&typeof n.t=="function")return{t:n.t.bind(n)}}catch(n){}}catch(o){}const t=o=>{var n;return(n=Kn[o])!=null?n:jo(o)};return V(null,null,function*(){try{const o=yield import("vue-i18n"),n=o.useI18n||o.default&&o.default.useI18n;if(n&&typeof n=="function")try{const s=n();if(s&&typeof s.t=="function")try{globalThis.$vueI18nUse=()=>s}catch(r){}}catch(s){}}catch(o){}}),{t}}const Fn=Symbol("ViewportPriority");function Ao(t,o){const n=typeof window!="undefined"&&typeof document!="undefined",s=typeof o=="boolean"?e.ref(o):o;let r=null;const l=new WeakMap;function i(){var d;if(r||!n)return r;if(typeof IntersectionObserver=="undefined")return null;const m=(d=t())!=null?d:null;return r=new IntersectionObserver(g=>{for(const h of g){const b=l.get(h.target);if(!b)continue;if(h.isIntersecting||h.intersectionRatio>0){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch(H){}}r==null||r.unobserve(h.target),l.delete(h.target)}}},{root:m,rootMargin:"300px",threshold:0}),r}const v=(m,d)=>{const g=e.ref(!1);let h=!1,b;const M=new Promise(z=>{b=()=>{h||(h=!0,z())}}),H=()=>{try{r==null||r.unobserve(m)}catch(z){}l.delete(m)};if(!n||!s.value)return g.value=!0,b(),{isVisible:g,whenVisible:M,destroy:H};const _=i();return _?(l.set(m,{resolve:b,visible:g}),_.observe(m),{isVisible:g,whenVisible:M,destroy:H}):(g.value=!0,b(),{isVisible:g,whenVisible:M,destroy:H})};return e.provide(Fn,v),v}function rn(){const t=e.inject(Fn,void 0);if(t)return t;const o=new WeakMap;let n=null;const s=()=>n||(typeof window=="undefined"||typeof IntersectionObserver=="undefined"?null:(n=new IntersectionObserver(l=>{for(const i of l){const v=o.get(i.target);if(!v)continue;if(i.isIntersecting||i.intersectionRatio>0){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch(d){}}n==null||n.unobserve(i.target),o.delete(i.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return l=>{const i=e.ref(!1);let v=!1,m;const d=new Promise(b=>{m=()=>{v||(v=!0,b())}}),g=()=>{try{n==null||n.unobserve(l)}catch(b){}o.delete(l)},h=s();return h?(o.set(l,{resolve:m,visible:i}),h.observe(l),{isVisible:i,whenVisible:d,destroy:g}):(i.value=!0,m(),{isVisible:i,whenVisible:d,destroy:g})}}const Wo={class:"relative inline-block"},Ko=["src","alt","title","loading","tabindex","aria-label"],Fo={class:"text-sm whitespace-nowrap"},Oo={key:1,class:"text-sm text-gray-500"},Xo={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},Yo={class:"text-sm whitespace-nowrap"},qo={key:0,class:"mt-2 text-sm text-gray-500 italic"},Uo=e.defineComponent({__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(t,{emit:o}){const n=t,s=o,r=e.ref(!1),l=e.ref(!1),i=e.ref(!1),v=e.ref(null),m=rn(),d=e.ref(null),g=e.ref(typeof window=="undefined");typeof window!="undefined"&&e.watch(()=>v.value,T=>{var D;if((D=d.value)==null||D.destroy(),d.value=null,!T){g.value=!1;return}const ae=m(T,{rootMargin:"400px"});d.value=ae,g.value=ae.isVisible.value,ae.whenVisible.then(()=>{g.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var T;(T=d.value)==null||T.destroy(),d.value=null});const h=e.computed(()=>l.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),b=e.computed(()=>!n.lazy||g.value),M=e.computed(()=>/\.svg(?:\?|$)/i.test(h.value));function H(){n.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,s("error",n.node.src))}function _(){r.value=!0,l.value=!1,s("load",h.value)}function z(T){T.preventDefault(),!(!r.value||l.value)&&s("click",[T,h.value])}const{t:$}=on();return e.watch(h,()=>{r.value=!1,l.value=!1}),(T,ae)=>(e.openBlock(),e.createElementBlock("figure",{ref_key:"figureRef",ref:v,class:"text-center my-8"},[e.createElementVNode("div",Wo,[e.createVNode(e.Transition,{name:"img-switch",mode:"out-in"},{default:e.withCtx(()=>{var D,W,E,G,X;return[!t.node.loading&&!l.value&&b.value?(e.openBlock(),e.createElementBlock("img",{key:"image",src:h.value,alt:String((W=(D=n.node.alt)!=null?D:n.node.title)!=null?W:""),title:String((G=(E=n.node.title)!=null?E:n.node.alt)!=null?G:""),class:e.normalizeClass(["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:e.normalizeStyle(M.value?{minHeight:n.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:n.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:e.unref($)("image.preview"),onError:H,onLoad:_,onClick:z},null,46,Ko)):l.value?!t.node.loading&&!n.fallbackSrc?(e.openBlock(),e.createElementBlock("div",Xo,[e.renderSlot(T.$slots,"error",{node:n.node,displaySrc:h.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:M.value},()=>[ae[1]||(ae[1]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[e.createElementVNode("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)),e.createElementVNode("span",Yo,e.toDisplayString(e.unref($)("image.loadError")),1)],!0)])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:e.normalizeStyle(M.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?e.renderSlot(T.$slots,"placeholder",{key:0,node:n.node,displaySrc:h.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:M.value},()=>[ae[0]||(ae[0]=e.createElementVNode("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Fo,e.toDisplayString(e.unref($)("image.loading")),1)],!0):(e.openBlock(),e.createElementBlock("span",Oo,e.toDisplayString(t.node.raw),1))],4))]}),_:3})]),n.showCaption&&n.node.alt?(e.openBlock(),e.createElementBlock("figcaption",qo,e.toDisplayString(n.node.alt),1)):e.createCommentVNode("",!0)],512))}}),Xe=R(Uo,[["__scopeId","data-v-7ca79b66"]]);Xe.install=t=>{t.component(Xe.__name,Xe)};let Jt=null,Sn=!1;function an(){return V(this,null,function*(){if(Jt)return Jt;if(Sn)return null;try{return Jt=yield import("katex"),yield import("katex/contrib/mhchem"),Jt}catch(t){return Sn=!0,null}})}const pn=e.shallowRef(!1);let Vn=null;function On(){return Vn||(Vn=an().then(t=>{pn.value=!!t}).catch(()=>{pn.value=!1})),e.readonly(pn)}const Zo=e.defineComponent({__name:"TextNode",props:{node:{}},emits:["copy"],setup(t){const o=On();return(n,s)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([[e.unref(o)&&t.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},e.toDisplayString(t.node.content),3))}}),te=R(Zo,[["__scopeId","data-v-56f30838"]]);te.install=t=>{t.component(te.__name,te)};const He=e.defineAsyncComponent(()=>V(null,null,function*(){var o,n;if(typeof globalThis!="undefined"&&typeof globalThis.process!="undefined"&&((n=(o=globalThis.process)==null?void 0:o.env)==null?void 0:n.NODE_ENV)==="test")return s=>{var r,l;return e.h(te,qe(Z({},s),{node:qe(Z({},s.node),{content:(l=s.node.raw)!=null?l:`$${(r=s.node.content)!=null?r:""}$`})}))};try{if(yield an())return(yield Promise.resolve().then(()=>require("./index-BRnwZs4_.cjs"))).default}catch(s){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".',s)}return s=>{var r,l;return e.h(te,qe(Z({},s),{node:qe(Z({},s.node),{content:(l=s.node.raw)!=null?l:`$${(r=s.node.content)!=null?r:""}$`})}))}})),Go=e.defineAsyncComponent(()=>V(null,null,function*(){try{if(yield an())return(yield Promise.resolve().then(()=>require("./index-BPiQ08MX.cjs"))).default}catch(t){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".',t)}return t=>{var o,n;return e.h(te,qe(Z({},t),{node:qe(Z({},t.node),{content:(n=t.node.raw)!=null?n:`$$${(o=t.node.content)!=null?o:""}$$`})}))}})),ue=e.defineComponent({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",{class:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>o.$emit("click",s,t.node.id,t.messageId,t.threadId)),onMouseenter:n[1]||(n[1]=s=>o.$emit("mouseEnter",s,t.node.id,t.messageId,t.threadId)),onMouseleave:n[2]||(n[2]=s=>o.$emit("mouseLeave",s,t.node.id,t.messageId,t.threadId))},e.toDisplayString(t.node.id),33))}});ue.install=t=>{t.component(ue.__name,ue)};const Jo={class:"superscript-node"},Qo={key:1},er=e.defineComponent({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,footnote_reference:ce,strikethrough:fe,highlight:Be,insert:be,subscript:xe,emoji:se,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("sup",Jo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"superscript"}-${i}`},[n[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:0,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"superscript"}-${i}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",Qo,e.toDisplayString(l.content||l.raw),1))],64))),128))]))}}),ye=R(er,[["__scopeId","data-v-0ca396bb"]]);ye.install=t=>{t.component(ye.__name,ye)};const tr={class:"subscript-node"},nr={key:1},or=e.defineComponent({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,footnote_reference:ce,strikethrough:fe,highlight:Be,insert:be,superscript:ye,emoji:se,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("sub",tr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"subscript"}-${i}`},[n[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:0,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"subscript"}-${i}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",nr,e.toDisplayString(l.content||l.raw),1))],64))),128))]))}}),xe=R(or,[["__scopeId","data-v-5e1f04df"]]);xe.install=t=>{t.component(xe.__name,xe)};const rr={class:"strong-node"},ar=e.defineComponent({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,emphasis:Te,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("strong",rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"strong"}-${i}`,"index-key":`${t.indexKey||"strong"}-${i}`,node:l,"custom-id":o.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),me=R(ar,[["__scopeId","data-v-53b6c7df"]]);me.install=t=>{t.component(me.__name,me)};const lr={class:"strikethrough-node"},ir=e.defineComponent({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("del",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"strikethrough"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"strikethrough"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),fe=R(ir,[["__scopeId","data-v-3716d25c"]]);fe.install=t=>{t.component(fe.__name,fe)};const sr=["href","title","aria-label","aria-hidden"],cr=["aria-hidden"],dr={class:"link-text-wrapper relative inline-flex"},ur={class:"leading-[normal] link-text"},mr={class:"leading-[normal] link-text"},fr=e.defineComponent({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(t){const o=t,n=e.computed(()=>{var d,g,h,b,M,H;const m=o.underlineBottom!==void 0?typeof o.underlineBottom=="number"?`${o.underlineBottom}px`:String(o.underlineBottom):"-3px";return{"--link-color":(d=o.color)!=null?d:"#0366d6","--underline-height":`${(g=o.underlineHeight)!=null?g:2}px`,"--underline-bottom":m,"--underline-opacity":String((h=o.animationOpacity)!=null?h:.9),"--underline-duration":`${(b=o.animationDuration)!=null?b:.8}s`,"--underline-timing":(M=o.animationTiming)!=null?M:"linear","--underline-iteration":typeof o.animationIteration=="number"?String(o.animationIteration):(H=o.animationIteration)!=null?H:"infinite"}}),s={text:te,strong:me,strikethrough:fe,emphasis:Te,image:Xe},r=e.useAttrs();function l(m){var b,M,H,_,z,$;if(!o.showTooltip)return;const d=m,g=(d==null?void 0:d.clientX)!=null&&(d==null?void 0:d.clientY)!=null?{x:d.clientX,y:d.clientY}:void 0,h=($=(z=(H=(b=o.node)==null?void 0:b.href)!=null?H:(M=o.node)==null?void 0:M.title)!=null?z:(_=o.node)==null?void 0:_.text)!=null?$:"";Tt(m.currentTarget,h,"top",!1,g)}function i(){o.showTooltip&&nn()}const v=e.computed(()=>{var m,d;return String((d=(m=o.node.title)!=null?m:o.node.href)!=null?d:"")});return(m,d)=>t.node.loading?(e.openBlock(),e.createElementBlock("span",e.mergeProps({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":t.node.loading?"false":"true"},e.unref(r),{style:n.value}),[e.createElementVNode("span",dr,[e.createElementVNode("span",ur,[e.createElementVNode("span",mr,e.toDisplayString(t.node.text),1)]),d[1]||(d[1]=e.createElementVNode("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,cr)):(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:0,class:"link-node",href:t.node.href,title:v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":t.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},e.unref(r),{style:n.value,onMouseenter:d[0]||(d[0]=g=>l(g)),onMouseleave:i}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(g,h)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[g.type]),{key:`${t.indexKey||"emphasis"}-${h}`,node:g,"custom-id":o.customId,"index-key":`${t.indexKey||"link-text"}-${h}`},null,8,["node","custom-id","index-key"]))),128))],16,sr))}}),he=R(fr,[["__scopeId","data-v-0ea92a03"]]);he.install=t=>{t.component(he.__name,he)};const hr={class:"insert-node"},pr=e.defineComponent({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,strikethrough:fe,highlight:Be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("ins",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"insert"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"insert"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),be=R(pr,[["__scopeId","data-v-b8737de3"]]);be.install=t=>{t.component(be.__name,be)};const vr={class:"highlight-node"},gr=e.defineComponent({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,strikethrough:fe,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("mark",vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"highlight"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"highlight"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Be=R(gr,[["__scopeId","data-v-fc52b444"]]);Be.install=t=>{t.component(Be.__name,Be)};const kr={class:"emphasis-node"},wr=e.defineComponent({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("em",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"emphasis"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"emphasis"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Te=R(wr,[["__scopeId","data-v-c25e2822"]]);Te.install=t=>{t.component(Te.__name,Te)};const yr=["id"],xr={class:"flex-1"},xt=e.defineComponent({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{id:`fnref--${t.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[e.createElementVNode("div",xr,[e.withMemo([t.node.children],()=>e.createVNode(e.unref(Ee),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,typewriter:t.typewriter,onCopy:n[0]||(n[0]=s=>o.$emit("copy",s))},null,8,["index-key","nodes","typewriter"]),n,1)])],8,yr))}});xt.install=t=>{t.component(xt.__name,xt)};const br=["href","title"],Br=e.defineComponent({__name:"FootnoteAnchorNode",props:{node:{}},setup(t){const o=t;function n(s){var i;if(s.preventDefault(),typeof document=="undefined")return;const r=`fnref-${String((i=o.node.id)!=null?i:"")}`,l=document.getElementById(r);l&&l.scrollIntoView({behavior:"smooth"})}return(s,r)=>(e.openBlock(),e.createElementBlock("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",onClick:n,href:`#fnref-${t.node.id}`,title:`返回引用 ${t.node.id}`}," ↩︎ ",8,br))}}),st=R(Br,[["__scopeId","data-v-14465a9a"]]);st.install=t=>{t.component(st.__name,st)};const Mr={class:"hard-break"},Cr=e.defineComponent({__name:"HardBreakNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("br",Mr))}}),Ue=R(Cr,[["__scopeId","data-v-50c58f70"]]);Ue.install=t=>{t.component(Ue.__name,Ue)};const Er=e.defineComponent({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,image:Xe,strong:me,emphasis:Te,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,checkbox:Le,checkbox_input:Le,footnote_reference:ce,hardbreak:Ue,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>e.withMemo([t.node.children],()=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(`h${t.node.level}`),{class:e.normalizeClass(["heading-node",[`heading-${t.node.level}`]]),dir:"auto"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i,v,m)=>{const d=[l];if(m&&m.key===`${t.indexKey||"heading"}-${i}`&&e.isMemoSame(m,d))return m;const g=(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"heading"}-${i}`,"custom-id":o.customId,node:l,"index-key":`${t.indexKey||"heading"}-${i}`},null,8,["custom-id","node","index-key"]));return g.memo=d,g},r,0),128))]),_:1},8,["class"])),r,2)}}),gn=R(Er,[["__scopeId","data-v-d8e179e9"]]),ln=gn;ln.install=t=>{t.component(gn.__name,gn)};const Nr=e.defineComponent({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>o.value==null?{}:{value:o.value});return(s,r)=>(e.openBlock(),e.createElementBlock("li",e.mergeProps({class:"list-item pl-1.5 my-2",dir:"auto"},n.value),[e.withMemo([o.item.children],()=>e.createVNode(e.unref(Ee),{"index-key":`list-item-${o.indexKey}`,nodes:o.item.children,typewriter:o.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=l=>s.$emit("copy",l))},null,8,["index-key","nodes","typewriter"]),r,1)],16))}}),bt=R(Nr,[["__scopeId","data-v-e7aa2cc3"]]);bt.install=t=>{t.component(bt.__name,bt)};const Tr=e.defineComponent({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.node.ordered?"ol":"ul"),{class:e.normalizeClass(["list-node",{"list-decimal":t.node.ordered,"list-disc":!t.node.ordered}])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.items,(s,r,l,i)=>{var d;const v=[s];if(i&&i.key===`${t.indexKey||"list"}-${r}`&&e.isMemoSame(i,v))return i;const m=(e.openBlock(),e.createBlock(e.unref(bt),{key:`${t.indexKey||"list"}-${r}`,item:s,"custom-id":t.customId,"index-key":`${t.indexKey||"list"}-${r}`,typewriter:t.typewriter,value:t.node.ordered?((d=t.node.start)!=null?d:1)+r:void 0,onCopy:n[0]||(n[0]=g=>o.$emit("copy",g))},null,8,["item","custom-id","index-key","typewriter","value"]));return m.memo=v,m},n,1),128))]),_:1},8,["class"]))}}),Bt=R(Tr,[["__scopeId","data-v-79057d57"]]);Bt.install=t=>{t.component(Bt.__name,Bt)};const $r="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e";function Xn(t){try{if(typeof globalThis!="undefined"&&typeof globalThis.requestAnimationFrame=="function")return globalThis.requestAnimationFrame(t)}catch(o){}return globalThis.setTimeout(t,0)}let re=null,Ze=null;const ee=new Map,Sr=5;let tn=Sr,kn=!1;function Vr(t){kn=!!t}function Ir(t){Number.isFinite(t)&&t>0&&(tn=Math.floor(t))}function _r(){return{inFlight:ee.size,max:tn}}const Yn="WORKER_BUSY";function Lr(t){re=t,Ze=null;const o=t;re.onmessage=n=>{if(re!==o)return;const{id:s,ok:r,result:l,error:i}=n.data,v=ee.get(s);v&&(r===!1||i?v.reject(new Error(i||"Unknown error")):v.resolve(l))},re.onerror=n=>{var s,r;if(re===o){if(ee.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",(n==null?void 0:n.message)||n);return}try{kn?console.error("[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n):(r=console.debug)==null||r.call(console,"[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n)}catch(l){}for(const[l,i]of ee.entries())i.reject(new Error(`Worker error: ${n.message}`));ee.clear()}},re.onmessageerror=n=>{var s,r;if(re===o){if(ee.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n);return}try{kn?console.error("[mermaidWorkerClient] Worker messageerror:",n):(r=console.debug)==null||r.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch(l){}for(const[l,i]of ee.entries())i.reject(new Error("Worker messageerror"));ee.clear()}}}function Dr(){var t;if(re)try{for(const[o,n]of ee.entries())n.reject(new Error("Worker cleared"));ee.clear(),(t=re.terminate)==null||t.call(re)}catch(o){}re=null,Ze=null}function zr(){return re||(Ze=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ze.name="WorkerInitError",Ze.code="WORKER_INIT_ERROR",null)}function qn(t,o,n=1400){if(Ze)return Promise.reject(Ze);const s=zr();if(!s)return Promise.reject(Ze);if(ee.size>=tn){const r=new Error("Worker busy");return r.name="WorkerBusy",r.code=Yn,r.inFlight=ee.size,r.max=tn,Promise.reject(r)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let v=!1,m;const d=()=>{v||(v=!0,m!=null&&globalThis.clearTimeout(m),ee.delete(i))},g={resolve:h=>{d(),r(h)},reject:h=>{d(),l(h)}};ee.set(i,g);try{s.postMessage({id:i,action:t,payload:o})}catch(h){ee.delete(i),l(h);return}m=globalThis.setTimeout(()=>{const h=new Error("Worker call timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT";const b=ee.get(i);b&&b.reject(h)},n)})}function Un(t,o,n=1400){return V(this,null,function*(){try{return yield qn("canParse",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function Zn(t,o,n=1400){return V(this,null,function*(){try{return yield qn("findPrefix",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function wn(){if(re)try{for(const[t,o]of ee.entries())o.reject(new Error("Worker terminated"));ee.clear(),re.terminate()}finally{re=null}}let oe=null;function Rr(){return V(this,null,function*(){if(oe)return oe;try{const t=yield import("mermaid"),o=t&&t.default?t.default:t;if(o&&(typeof o.render=="function"||typeof o.parse=="function"||typeof o.initialize=="function"))oe=o;else if(o&&o.mermaidAPI&&(typeof o.mermaidAPI.render=="function"||typeof o.mermaidAPI.parse=="function")){const n=o.mermaidAPI;oe=qe(Z({},o),{render:n.render.bind(n),parse:n.parse?n.parse.bind(n):void 0,initialize:s=>typeof o.initialize=="function"?o.initialize(s):n.initialize?n.initialize(s):void 0})}else t.mermaid&&typeof t.mermaid.render=="function"?oe=t.mermaid:oe=o}catch(t){throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.')}try{const t=oe==null?void 0:oe.initialize;oe.initialize=o=>{const n=Z({suppressErrorRendering:!0},o||{});if(typeof t=="function")return t.call(oe,n);if(oe!=null&&oe.mermaidAPI&&typeof oe.mermaidAPI.initialize=="function")return oe.mermaidAPI.initialize(n)}}catch(t){}return oe})}const Hr={key:0},jr={key:1,class:"flex items-center space-x-2"},Pr=["src"],Ar={key:2},Wr={class:"flex items-center space-x-1"},Kr={class:"flex items-center space-x-1"},Fr={key:4},Or={key:5,class:"flex items-center space-x-1"},Xr=["aria-pressed"],Yr={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"},qr={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"},Ur=["disabled"],Zr=["disabled"],Gr={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"},Jr={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"},Qr={key:1,class:"relative"},ea={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},ta={class:"flex items-center gap-2 backdrop-blur rounded-lg"},na={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},oa=300,ra=500,aa=e.defineComponent({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal","toggleMode"],setup(t,{emit:o}){var Mn,Cn;const n=t,s=o,{t:r}=on();let l=null;const i=e.ref(!1);typeof window!="undefined"&&V(null,null,function*(){var c;l=yield Rr(),i.value=!!l,(c=l==null?void 0:l.initialize)==null||c.call(l,{startOnLoad:!1,securityLevel:"loose"})});const v=e.ref(!1),m=e.ref(!1),d=e.ref(),g=e.ref(),h=e.ref(),b=e.ref(),M=e.ref(null),H=rn(),_=e.ref(null),z=e.ref(typeof window=="undefined"),$=e.ref(),T=e.computed(()=>n.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function ae(c){const a=T.value,y=`%%{init: {"theme": "${c==="dark"?"dark":"default"}"}}%%
1
+ "use strict";var so=Object.create;var hn=Object.defineProperty,co=Object.defineProperties,uo=Object.getOwnPropertyDescriptor,mo=Object.getOwnPropertyDescriptors,fo=Object.getOwnPropertyNames,En=Object.getOwnPropertySymbols,ho=Object.getPrototypeOf,Tn=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable;var Nn=(t,o,n)=>o in t?hn(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,Z=(t,o)=>{for(var n in o||(o={}))Tn.call(o,n)&&Nn(t,n,o[n]);if(En)for(var n of En(o))po.call(o,n)&&Nn(t,n,o[n]);return t},qe=(t,o)=>co(t,mo(o));var vo=(t,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of fo(o))!Tn.call(t,r)&&r!==n&&hn(t,r,{get:()=>o[r],enumerable:!(s=uo(o,r))||s.enumerable});return t};var gt=(t,o,n)=>(n=t!=null?so(ho(t)):{},vo(o||!t||!t.__esModule?hn(n,"default",{value:t,enumerable:!0}):n,t));var V=(t,o,n)=>new Promise((s,r)=>{var l=m=>{try{v(n.next(m))}catch(d){r(d)}},i=m=>{try{v(n.throw(m))}catch(d){r(d)}},v=m=>m.done?s(m.value):Promise.resolve(m.value).then(l,i);v((n=n.apply(t,o)).next())});const vn=require("stream-markdown-parser"),e=require("vue"),kt=require("@floating-ui/dom"),go=["cite"],ko=e.defineComponent({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("blockquote",{class:"blockquote",dir:"auto",cite:t.node.cite},[e.withMemo([t.node.children],()=>e.createVNode(e.unref(Ee),{"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],typewriter:t.typewriter,onCopy:n[0]||(n[0]=s=>o.$emit("copy",s))},null,8,["index-key","nodes","typewriter"]),n,1)],8,go))}}),R=(t,o)=>{const n=t.__vccOpts||t;for(const[s,r]of o)n[s]=r;return n},wt=R(ko,[["__scopeId","data-v-adfdba00"]]);wt.install=t=>{t.component(wt.__name,wt)};const wo={class:"checkbox-node"},yo=["checked"],xo=e.defineComponent({__name:"CheckboxNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",wo,[e.createElementVNode("input",{type:"checkbox",checked:t.node.checked,disabled:"",class:"checkbox-input"},null,8,yo)]))}}),Le=R(xo,[["__scopeId","data-v-8dc6c46f"]]);Le.install=t=>{t.component(Le.__name,Le)};const bo={class:"definition-list"},Bo={class:"definition-term"},Mo={class:"definition-desc"},Co=e.defineComponent({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("dl",bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.items,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[e.createElementVNode("dt",Bo,[e.createVNode(e.unref(Ee),{"index-key":`definition-term-${t.indexKey}-${r}`,nodes:s.term,typewriter:t.typewriter,onCopy:n[0]||(n[0]=l=>o.$emit("copy",l))},null,8,["index-key","nodes","typewriter"])]),e.createElementVNode("dd",Mo,[e.createVNode(e.unref(Ee),{"index-key":`definition-desc-${t.indexKey}-${r}`,nodes:s.definition,typewriter:t.typewriter,onCopy:n[1]||(n[1]=l=>o.$emit("copy",l))},null,8,["index-key","nodes","typewriter"])])],64))),128))]))}}),yt=R(Co,[["__scopeId","data-v-5a21f288"]]);yt.install=t=>{t.component(yt.__name,yt)};const Eo={class:"emoji-node"},No=e.defineComponent({__name:"EmojiNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",Eo,e.toDisplayString(t.node.name),1))}}),se=R(No,[["__scopeId","data-v-de55dc97"]]);se.install=t=>{t.component(se.__name,se)};const At="__global__",it={};function To(t,o){typeof t=="string"?it[t]=o||{}:it[At]=t||{}}function Ne(t){return t?it[t]||it[At]||{}:it[At]||{}}function $o(t){if(t===At)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete it[t]}function So(){delete it[At]}const Vo=["id"],Io=["title"],_o=e.defineComponent({__name:"FootnoteReferenceNode",props:{node:{}},setup(t){const n=`#footnote-${t.node.id}`;function s(){if(typeof document=="undefined")return;const r=document.querySelector(n);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(r,l)=>(e.openBlock(),e.createElementBlock("sup",{id:`fnref-${t.node.id}`,class:"footnote-reference",onClick:s},[e.createElementVNode("span",{href:n,title:`查看脚注 ${t.node.id}`,class:"footnote-link cursor-pointer"},"["+e.toDisplayString(t.node.id)+"]",9,Io)],8,Vo))}}),ce=R(_o,[["__scopeId","data-v-01af0fee"]]);ce.install=t=>{t.component(ce.__name,ce)};const Lo={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},de=e.defineComponent({__name:"InlineCodeNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("code",Lo,e.toDisplayString(t.node.code),1))}});de.install=t=>{t.component(de.__name,de)};const Do=["id"],zo=e.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(t){const o=t,n=e.computed(()=>{if(o.isDark!==void 0&&o.isDark!==null)return!!o.isDark;if(typeof document!="undefined")try{if(document.documentElement.classList.contains("dark")||window!=null&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(m){}return!1}),s=e.ref(null),r=e.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=e.ref(!1);let i=null;function v(){return V(this,null,function*(){var h,b;if(!o.anchorEl||!s.value)return;const m=[kt.offset((h=o.offset)!=null?h:8),kt.flip(),kt.shift({padding:8})],{x:d,y:g}=yield kt.computePosition(o.anchorEl,s.value,{placement:(b=o.placement)!=null?b:"top",middleware:m,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(d)}px, ${Math.round(g)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return e.watch(()=>o.visible,m=>V(null,null,function*(){if(m)if(l.value=!1,yield e.nextTick(),o.anchorEl&&s.value)try{const d=o.anchorEl.getBoundingClientRect();yield v();const g=r.value.transform;if(o.originX!=null&&o.originY!=null){const h=Math.abs(Number(o.originX)-d.left),b=Math.abs(Number(o.originY)-d.top);Math.hypot(h,b)>120?(r.value.transform=`translate3d(${Math.round(o.originX)}px, ${Math.round(o.originY)}px, 0)`,yield e.nextTick(),l.value=!0,yield e.nextTick(),r.value.transform=g):l.value=!0}else l.value=!0;i=kt.autoUpdate(o.anchorEl,s.value,v)}catch(d){yield v(),l.value=!0,i=kt.autoUpdate(o.anchorEl,s.value,v)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),e.watch([()=>o.anchorEl,()=>o.placement,()=>o.content],()=>V(null,null,function*(){o.visible&&o.anchorEl&&s.value&&(yield e.nextTick(),yield v())})),e.onBeforeUnmount(()=>{i&&i()}),(m,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"tooltip",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:o.id,ref_key:"tooltip",ref:s,style:e.normalizeStyle({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:e.normalizeClass(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[n.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},e.toDisplayString(t.content),15,Do),[[e.vShow,t.visible&&l.value]])]),_:1})]))}}),Ro=R(zo,[["__scopeId","data-v-993f63aa"]]),xn=e.ref(!1),jn=e.ref(""),Pn=e.ref("top"),jt=e.ref(null),Wt=e.ref(null),bn=e.ref(null),Bn=e.ref(null),An=e.ref(null);let Qt=null,en=null;function Wn(){Qt&&(clearTimeout(Qt),Qt=null),en&&(clearTimeout(en),en=null)}let $n=!1;function Ho(){if($n||typeof document=="undefined")return;$n=!0;const t=document.createElement("div");t.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(t);const o={setup(){return()=>{var n;return e.h(Ro,{visible:xn.value,"anchor-el":jt.value,content:jn.value,placement:Pn.value,id:Wt.value,originX:bn.value,originY:Bn.value,isDark:(n=An.value)!=null?n:void 0})}}};e.createApp(o).mount(t)}function Tt(t,o,n="top",s=!1,r,l){if(!t)return;Ho(),Wn();const i=()=>{var v,m;Wt.value=`tooltip-${Date.now()}-${Math.floor(Math.random()*1e3)}`,jt.value=t,jn.value=o,Pn.value=n,bn.value=(v=r==null?void 0:r.x)!=null?v:null,Bn.value=(m=r==null?void 0:r.y)!=null?m:null,An.value=typeof l=="boolean"?l:null,xn.value=!0;try{t.setAttribute("aria-describedby",Wt.value)}catch(d){}};s?i():Qt=setTimeout(i,80)}function nn(t=!1){Wn();const o=()=>{if(jt.value&&Wt.value)try{jt.value.removeAttribute("aria-describedby")}catch(n){}xn.value=!1,jt.value=null,Wt.value=null,bn.value=null,Bn.value=null};t?o():en=setTimeout(o,120)}function jo(t){return(t.split(".").pop()||t).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,n=>n.toUpperCase()).trim()}const Kn={"common.copy":"Copy","common.copySuccess":"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 Po(t){Object.assign(Kn,t)}function on(){try{const o=globalThis.$vueI18nUse||null;if(o&&typeof o=="function")try{const n=o();if(n&&typeof n.t=="function")return{t:n.t.bind(n)}}catch(n){}}catch(o){}const t=o=>{var n;return(n=Kn[o])!=null?n:jo(o)};return V(null,null,function*(){try{const o=yield import("vue-i18n"),n=o.useI18n||o.default&&o.default.useI18n;if(n&&typeof n=="function")try{const s=n();if(s&&typeof s.t=="function")try{globalThis.$vueI18nUse=()=>s}catch(r){}}catch(s){}}catch(o){}}),{t}}const Fn=Symbol("ViewportPriority");function Ao(t,o){const n=typeof window!="undefined"&&typeof document!="undefined",s=typeof o=="boolean"?e.ref(o):o;let r=null;const l=new WeakMap;function i(){var d;if(r||!n)return r;if(typeof IntersectionObserver=="undefined")return null;const m=(d=t())!=null?d:null;return r=new IntersectionObserver(g=>{for(const h of g){const b=l.get(h.target);if(!b)continue;if(h.isIntersecting||h.intersectionRatio>0){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch(H){}}r==null||r.unobserve(h.target),l.delete(h.target)}}},{root:m,rootMargin:"300px",threshold:0}),r}const v=(m,d)=>{const g=e.ref(!1);let h=!1,b;const M=new Promise(z=>{b=()=>{h||(h=!0,z())}}),H=()=>{try{r==null||r.unobserve(m)}catch(z){}l.delete(m)};if(!n||!s.value)return g.value=!0,b(),{isVisible:g,whenVisible:M,destroy:H};const _=i();return _?(l.set(m,{resolve:b,visible:g}),_.observe(m),{isVisible:g,whenVisible:M,destroy:H}):(g.value=!0,b(),{isVisible:g,whenVisible:M,destroy:H})};return e.provide(Fn,v),v}function rn(){const t=e.inject(Fn,void 0);if(t)return t;const o=new WeakMap;let n=null;const s=()=>n||(typeof window=="undefined"||typeof IntersectionObserver=="undefined"?null:(n=new IntersectionObserver(l=>{for(const i of l){const v=o.get(i.target);if(!v)continue;if(i.isIntersecting||i.intersectionRatio>0){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch(d){}}n==null||n.unobserve(i.target),o.delete(i.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return l=>{const i=e.ref(!1);let v=!1,m;const d=new Promise(b=>{m=()=>{v||(v=!0,b())}}),g=()=>{try{n==null||n.unobserve(l)}catch(b){}o.delete(l)},h=s();return h?(o.set(l,{resolve:m,visible:i}),h.observe(l),{isVisible:i,whenVisible:d,destroy:g}):(i.value=!0,m(),{isVisible:i,whenVisible:d,destroy:g})}}const Wo={class:"relative inline-block"},Ko=["src","alt","title","loading","tabindex","aria-label"],Fo={class:"text-sm whitespace-nowrap"},Oo={key:1,class:"text-sm text-gray-500"},Xo={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},Yo={class:"text-sm whitespace-nowrap"},qo={key:0,class:"mt-2 text-sm text-gray-500 italic"},Uo=e.defineComponent({__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(t,{emit:o}){const n=t,s=o,r=e.ref(!1),l=e.ref(!1),i=e.ref(!1),v=e.ref(null),m=rn(),d=e.ref(null),g=e.ref(typeof window=="undefined");typeof window!="undefined"&&e.watch(()=>v.value,T=>{var D;if((D=d.value)==null||D.destroy(),d.value=null,!T){g.value=!1;return}const ae=m(T,{rootMargin:"400px"});d.value=ae,g.value=ae.isVisible.value,ae.whenVisible.then(()=>{g.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var T;(T=d.value)==null||T.destroy(),d.value=null});const h=e.computed(()=>l.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),b=e.computed(()=>!n.lazy||g.value),M=e.computed(()=>/\.svg(?:\?|$)/i.test(h.value));function H(){n.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,s("error",n.node.src))}function _(){r.value=!0,l.value=!1,s("load",h.value)}function z(T){T.preventDefault(),!(!r.value||l.value)&&s("click",[T,h.value])}const{t:$}=on();return e.watch(h,()=>{r.value=!1,l.value=!1}),(T,ae)=>(e.openBlock(),e.createElementBlock("figure",{ref_key:"figureRef",ref:v,class:"text-center my-8"},[e.createElementVNode("div",Wo,[e.createVNode(e.Transition,{name:"img-switch",mode:"out-in"},{default:e.withCtx(()=>{var D,W,E,G,X;return[!t.node.loading&&!l.value&&b.value?(e.openBlock(),e.createElementBlock("img",{key:"image",src:h.value,alt:String((W=(D=n.node.alt)!=null?D:n.node.title)!=null?W:""),title:String((G=(E=n.node.title)!=null?E:n.node.alt)!=null?G:""),class:e.normalizeClass(["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:e.normalizeStyle(M.value?{minHeight:n.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:n.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:e.unref($)("image.preview"),onError:H,onLoad:_,onClick:z},null,46,Ko)):l.value?!t.node.loading&&!n.fallbackSrc?(e.openBlock(),e.createElementBlock("div",Xo,[e.renderSlot(T.$slots,"error",{node:n.node,displaySrc:h.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:M.value},()=>[ae[1]||(ae[1]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[e.createElementVNode("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)),e.createElementVNode("span",Yo,e.toDisplayString(e.unref($)("image.loadError")),1)],!0)])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:e.normalizeStyle(M.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?e.renderSlot(T.$slots,"placeholder",{key:0,node:n.node,displaySrc:h.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:M.value},()=>[ae[0]||(ae[0]=e.createElementVNode("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Fo,e.toDisplayString(e.unref($)("image.loading")),1)],!0):(e.openBlock(),e.createElementBlock("span",Oo,e.toDisplayString(t.node.raw),1))],4))]}),_:3})]),n.showCaption&&n.node.alt?(e.openBlock(),e.createElementBlock("figcaption",qo,e.toDisplayString(n.node.alt),1)):e.createCommentVNode("",!0)],512))}}),Xe=R(Uo,[["__scopeId","data-v-7ca79b66"]]);Xe.install=t=>{t.component(Xe.__name,Xe)};let Jt=null,Sn=!1;function an(){return V(this,null,function*(){if(Jt)return Jt;if(Sn)return null;try{return Jt=yield import("katex"),yield import("katex/contrib/mhchem"),Jt}catch(t){return Sn=!0,null}})}const pn=e.shallowRef(!1);let Vn=null;function On(){return Vn||(Vn=an().then(t=>{pn.value=!!t}).catch(()=>{pn.value=!1})),e.readonly(pn)}const Zo=e.defineComponent({__name:"TextNode",props:{node:{}},emits:["copy"],setup(t){const o=On();return(n,s)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([[e.unref(o)&&t.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},e.toDisplayString(t.node.content),3))}}),te=R(Zo,[["__scopeId","data-v-56f30838"]]);te.install=t=>{t.component(te.__name,te)};const He=e.defineAsyncComponent(()=>V(null,null,function*(){var o,n;if(typeof globalThis!="undefined"&&typeof globalThis.process!="undefined"&&((n=(o=globalThis.process)==null?void 0:o.env)==null?void 0:n.NODE_ENV)==="test")return s=>{var r,l;return e.h(te,qe(Z({},s),{node:qe(Z({},s.node),{content:(l=s.node.raw)!=null?l:`$${(r=s.node.content)!=null?r:""}$`})}))};try{if(yield an())return(yield Promise.resolve().then(()=>require("./index-DqNfDUws.cjs"))).default}catch(s){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".',s)}return s=>{var r,l;return e.h(te,qe(Z({},s),{node:qe(Z({},s.node),{content:(l=s.node.raw)!=null?l:`$${(r=s.node.content)!=null?r:""}$`})}))}})),Go=e.defineAsyncComponent(()=>V(null,null,function*(){try{if(yield an())return(yield Promise.resolve().then(()=>require("./index-BZTwjxhO.cjs"))).default}catch(t){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".',t)}return t=>{var o,n;return e.h(te,qe(Z({},t),{node:qe(Z({},t.node),{content:(n=t.node.raw)!=null?n:`$$${(o=t.node.content)!=null?o:""}$$`})}))}})),ue=e.defineComponent({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",{class:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>o.$emit("click",s,t.node.id,t.messageId,t.threadId)),onMouseenter:n[1]||(n[1]=s=>o.$emit("mouseEnter",s,t.node.id,t.messageId,t.threadId)),onMouseleave:n[2]||(n[2]=s=>o.$emit("mouseLeave",s,t.node.id,t.messageId,t.threadId))},e.toDisplayString(t.node.id),33))}});ue.install=t=>{t.component(ue.__name,ue)};const Jo={class:"superscript-node"},Qo={key:1},er=e.defineComponent({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,footnote_reference:ce,strikethrough:fe,highlight:Be,insert:be,subscript:xe,emoji:se,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("sup",Jo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"superscript"}-${i}`},[n[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:0,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"superscript"}-${i}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",Qo,e.toDisplayString(l.content||l.raw),1))],64))),128))]))}}),ye=R(er,[["__scopeId","data-v-0ca396bb"]]);ye.install=t=>{t.component(ye.__name,ye)};const tr={class:"subscript-node"},nr={key:1},or=e.defineComponent({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,footnote_reference:ce,strikethrough:fe,highlight:Be,insert:be,superscript:ye,emoji:se,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("sub",tr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"subscript"}-${i}`},[n[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:0,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"subscript"}-${i}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",nr,e.toDisplayString(l.content||l.raw),1))],64))),128))]))}}),xe=R(or,[["__scopeId","data-v-5e1f04df"]]);xe.install=t=>{t.component(xe.__name,xe)};const rr={class:"strong-node"},ar=e.defineComponent({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,emphasis:Te,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("strong",rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"strong"}-${i}`,"index-key":`${t.indexKey||"strong"}-${i}`,node:l,"custom-id":o.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),me=R(ar,[["__scopeId","data-v-53b6c7df"]]);me.install=t=>{t.component(me.__name,me)};const lr={class:"strikethrough-node"},ir=e.defineComponent({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("del",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"strikethrough"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"strikethrough"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),fe=R(ir,[["__scopeId","data-v-3716d25c"]]);fe.install=t=>{t.component(fe.__name,fe)};const sr=["href","title","aria-label","aria-hidden"],cr=["aria-hidden"],dr={class:"link-text-wrapper relative inline-flex"},ur={class:"leading-[normal] link-text"},mr={class:"leading-[normal] link-text"},fr=e.defineComponent({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(t){const o=t,n=e.computed(()=>{var d,g,h,b,M,H;const m=o.underlineBottom!==void 0?typeof o.underlineBottom=="number"?`${o.underlineBottom}px`:String(o.underlineBottom):"-3px";return{"--link-color":(d=o.color)!=null?d:"#0366d6","--underline-height":`${(g=o.underlineHeight)!=null?g:2}px`,"--underline-bottom":m,"--underline-opacity":String((h=o.animationOpacity)!=null?h:.9),"--underline-duration":`${(b=o.animationDuration)!=null?b:.8}s`,"--underline-timing":(M=o.animationTiming)!=null?M:"linear","--underline-iteration":typeof o.animationIteration=="number"?String(o.animationIteration):(H=o.animationIteration)!=null?H:"infinite"}}),s={text:te,strong:me,strikethrough:fe,emphasis:Te,image:Xe},r=e.useAttrs();function l(m){var b,M,H,_,z,$;if(!o.showTooltip)return;const d=m,g=(d==null?void 0:d.clientX)!=null&&(d==null?void 0:d.clientY)!=null?{x:d.clientX,y:d.clientY}:void 0,h=($=(z=(H=(b=o.node)==null?void 0:b.href)!=null?H:(M=o.node)==null?void 0:M.title)!=null?z:(_=o.node)==null?void 0:_.text)!=null?$:"";Tt(m.currentTarget,h,"top",!1,g)}function i(){o.showTooltip&&nn()}const v=e.computed(()=>{var m,d;return String((d=(m=o.node.title)!=null?m:o.node.href)!=null?d:"")});return(m,d)=>t.node.loading?(e.openBlock(),e.createElementBlock("span",e.mergeProps({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":t.node.loading?"false":"true"},e.unref(r),{style:n.value}),[e.createElementVNode("span",dr,[e.createElementVNode("span",ur,[e.createElementVNode("span",mr,e.toDisplayString(t.node.text),1)]),d[1]||(d[1]=e.createElementVNode("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,cr)):(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:0,class:"link-node",href:t.node.href,title:v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":t.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},e.unref(r),{style:n.value,onMouseenter:d[0]||(d[0]=g=>l(g)),onMouseleave:i}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(g,h)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[g.type]),{key:`${t.indexKey||"emphasis"}-${h}`,node:g,"custom-id":o.customId,"index-key":`${t.indexKey||"link-text"}-${h}`},null,8,["node","custom-id","index-key"]))),128))],16,sr))}}),he=R(fr,[["__scopeId","data-v-0ea92a03"]]);he.install=t=>{t.component(he.__name,he)};const hr={class:"insert-node"},pr=e.defineComponent({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,strikethrough:fe,highlight:Be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("ins",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"insert"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"insert"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),be=R(pr,[["__scopeId","data-v-b8737de3"]]);be.install=t=>{t.component(be.__name,be)};const vr={class:"highlight-node"},gr=e.defineComponent({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,emphasis:Te,strikethrough:fe,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("mark",vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"highlight"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"highlight"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Be=R(gr,[["__scopeId","data-v-fc52b444"]]);Be.install=t=>{t.component(Be.__name,Be)};const kr={class:"emphasis-node"},wr=e.defineComponent({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,strong:me,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,footnote_reference:ce,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>(e.openBlock(),e.createElementBlock("em",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"emphasis"}-${i}`,node:l,"custom-id":o.customId,"index-key":`${t.indexKey||"emphasis"}-${i}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Te=R(wr,[["__scopeId","data-v-c25e2822"]]);Te.install=t=>{t.component(Te.__name,Te)};const yr=["href","title"],xr=e.defineComponent({__name:"FootnoteAnchorNode",props:{node:{}},setup(t){const o=t;function n(s){var i;if(s.preventDefault(),typeof document=="undefined")return;const r=`fnref-${String((i=o.node.id)!=null?i:"")}`,l=document.getElementById(r);l&&l.scrollIntoView({behavior:"smooth"})}return(s,r)=>(e.openBlock(),e.createElementBlock("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${t.node.id}`,title:`返回引用 ${t.node.id}`,onClick:n}," ↩︎ ",8,yr))}}),st=R(xr,[["__scopeId","data-v-4756ce0d"]]);st.install=t=>{t.component(st.__name,st)};const br=["id"],Br={class:"flex-1"},xt=e.defineComponent({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{id:`fnref--${t.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[e.createElementVNode("div",Br,[e.withMemo([t.node.children],()=>e.createVNode(e.unref(Ee),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,typewriter:t.typewriter,onCopy:n[0]||(n[0]=s=>o.$emit("copy",s))},null,8,["index-key","nodes","typewriter"]),n,1)])],8,br))}});xt.install=t=>{t.component(xt.__name,xt)};const Mr={class:"hard-break"},Cr=e.defineComponent({__name:"HardBreakNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("br",Mr))}}),Ue=R(Cr,[["__scopeId","data-v-50c58f70"]]);Ue.install=t=>{t.component(Ue.__name,Ue)};const Er=e.defineComponent({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({text:te,inline_code:de,link:he,image:Xe,strong:me,emphasis:Te,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,checkbox:Le,checkbox_input:Le,footnote_reference:ce,hardbreak:Ue,math_inline:He,reference:ue},Ne(o.customId));return(s,r)=>e.withMemo([t.node.children],()=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(`h${t.node.level}`),{class:e.normalizeClass(["heading-node",[`heading-${t.node.level}`]]),dir:"auto"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(l,i,v,m)=>{const d=[l];if(m&&m.key===`${t.indexKey||"heading"}-${i}`&&e.isMemoSame(m,d))return m;const g=(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[l.type]),{key:`${t.indexKey||"heading"}-${i}`,"custom-id":o.customId,node:l,"index-key":`${t.indexKey||"heading"}-${i}`},null,8,["custom-id","node","index-key"]));return g.memo=d,g},r,0),128))]),_:1},8,["class"])),r,2)}}),gn=R(Er,[["__scopeId","data-v-d8e179e9"]]),ln=gn;ln.install=t=>{t.component(gn.__name,gn)};const Nr=e.defineComponent({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>o.value==null?{}:{value:o.value});return(s,r)=>(e.openBlock(),e.createElementBlock("li",e.mergeProps({class:"list-item pl-1.5 my-2",dir:"auto"},n.value),[e.withMemo([o.item.children],()=>e.createVNode(e.unref(Ee),{"index-key":`list-item-${o.indexKey}`,nodes:o.item.children,typewriter:o.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=l=>s.$emit("copy",l))},null,8,["index-key","nodes","typewriter"]),r,1)],16))}}),bt=R(Nr,[["__scopeId","data-v-e7aa2cc3"]]);bt.install=t=>{t.component(bt.__name,bt)};const Tr=e.defineComponent({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.node.ordered?"ol":"ul"),{class:e.normalizeClass(["list-node",{"list-decimal":t.node.ordered,"list-disc":!t.node.ordered}])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.items,(s,r,l,i)=>{var d;const v=[s];if(i&&i.key===`${t.indexKey||"list"}-${r}`&&e.isMemoSame(i,v))return i;const m=(e.openBlock(),e.createBlock(e.unref(bt),{key:`${t.indexKey||"list"}-${r}`,item:s,"custom-id":t.customId,"index-key":`${t.indexKey||"list"}-${r}`,typewriter:t.typewriter,value:t.node.ordered?((d=t.node.start)!=null?d:1)+r:void 0,onCopy:n[0]||(n[0]=g=>o.$emit("copy",g))},null,8,["item","custom-id","index-key","typewriter","value"]));return m.memo=v,m},n,1),128))]),_:1},8,["class"]))}}),Bt=R(Tr,[["__scopeId","data-v-79057d57"]]);Bt.install=t=>{t.component(Bt.__name,Bt)};const $r="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e";function Xn(t){try{if(typeof globalThis!="undefined"&&typeof globalThis.requestAnimationFrame=="function")return globalThis.requestAnimationFrame(t)}catch(o){}return globalThis.setTimeout(t,0)}let re=null,Ze=null;const ee=new Map,Sr=5;let tn=Sr,kn=!1;function Vr(t){kn=!!t}function Ir(t){Number.isFinite(t)&&t>0&&(tn=Math.floor(t))}function _r(){return{inFlight:ee.size,max:tn}}const Yn="WORKER_BUSY";function Lr(t){re=t,Ze=null;const o=t;re.onmessage=n=>{if(re!==o)return;const{id:s,ok:r,result:l,error:i}=n.data,v=ee.get(s);v&&(r===!1||i?v.reject(new Error(i||"Unknown error")):v.resolve(l))},re.onerror=n=>{var s,r;if(re===o){if(ee.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",(n==null?void 0:n.message)||n);return}try{kn?console.error("[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n):(r=console.debug)==null||r.call(console,"[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n)}catch(l){}for(const[l,i]of ee.entries())i.reject(new Error(`Worker error: ${n.message}`));ee.clear()}},re.onmessageerror=n=>{var s,r;if(re===o){if(ee.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n);return}try{kn?console.error("[mermaidWorkerClient] Worker messageerror:",n):(r=console.debug)==null||r.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch(l){}for(const[l,i]of ee.entries())i.reject(new Error("Worker messageerror"));ee.clear()}}}function Dr(){var t;if(re)try{for(const[o,n]of ee.entries())n.reject(new Error("Worker cleared"));ee.clear(),(t=re.terminate)==null||t.call(re)}catch(o){}re=null,Ze=null}function zr(){return re||(Ze=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ze.name="WorkerInitError",Ze.code="WORKER_INIT_ERROR",null)}function qn(t,o,n=1400){if(Ze)return Promise.reject(Ze);const s=zr();if(!s)return Promise.reject(Ze);if(ee.size>=tn){const r=new Error("Worker busy");return r.name="WorkerBusy",r.code=Yn,r.inFlight=ee.size,r.max=tn,Promise.reject(r)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let v=!1,m;const d=()=>{v||(v=!0,m!=null&&globalThis.clearTimeout(m),ee.delete(i))},g={resolve:h=>{d(),r(h)},reject:h=>{d(),l(h)}};ee.set(i,g);try{s.postMessage({id:i,action:t,payload:o})}catch(h){ee.delete(i),l(h);return}m=globalThis.setTimeout(()=>{const h=new Error("Worker call timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT";const b=ee.get(i);b&&b.reject(h)},n)})}function Un(t,o,n=1400){return V(this,null,function*(){try{return yield qn("canParse",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function Zn(t,o,n=1400){return V(this,null,function*(){try{return yield qn("findPrefix",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function wn(){if(re)try{for(const[t,o]of ee.entries())o.reject(new Error("Worker terminated"));ee.clear(),re.terminate()}finally{re=null}}let oe=null;function Rr(){return V(this,null,function*(){if(oe)return oe;try{const t=yield import("mermaid"),o=t&&t.default?t.default:t;if(o&&(typeof o.render=="function"||typeof o.parse=="function"||typeof o.initialize=="function"))oe=o;else if(o&&o.mermaidAPI&&(typeof o.mermaidAPI.render=="function"||typeof o.mermaidAPI.parse=="function")){const n=o.mermaidAPI;oe=qe(Z({},o),{render:n.render.bind(n),parse:n.parse?n.parse.bind(n):void 0,initialize:s=>typeof o.initialize=="function"?o.initialize(s):n.initialize?n.initialize(s):void 0})}else t.mermaid&&typeof t.mermaid.render=="function"?oe=t.mermaid:oe=o}catch(t){throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.')}try{const t=oe==null?void 0:oe.initialize;oe.initialize=o=>{const n=Z({suppressErrorRendering:!0},o||{});if(typeof t=="function")return t.call(oe,n);if(oe!=null&&oe.mermaidAPI&&typeof oe.mermaidAPI.initialize=="function")return oe.mermaidAPI.initialize(n)}}catch(t){}return oe})}const Hr={key:0},jr={key:1,class:"flex items-center space-x-2"},Pr=["src"],Ar={key:2},Wr={class:"flex items-center space-x-1"},Kr={class:"flex items-center space-x-1"},Fr={key:4},Or={key:5,class:"flex items-center space-x-1"},Xr=["aria-pressed"],Yr={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"},qr={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"},Ur=["disabled"],Zr=["disabled"],Gr={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"},Jr={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"},Qr={key:1,class:"relative"},ea={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},ta={class:"flex items-center gap-2 backdrop-blur rounded-lg"},na={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},oa=300,ra=500,aa=e.defineComponent({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal","toggleMode"],setup(t,{emit:o}){var Mn,Cn;const n=t,s=o,{t:r}=on();let l=null;const i=e.ref(!1);typeof window!="undefined"&&V(null,null,function*(){var c;l=yield Rr(),i.value=!!l,(c=l==null?void 0:l.initialize)==null||c.call(l,{startOnLoad:!1,securityLevel:"loose"})});const v=e.ref(!1),m=e.ref(!1),d=e.ref(),g=e.ref(),h=e.ref(),b=e.ref(),M=e.ref(null),H=rn(),_=e.ref(null),z=e.ref(typeof window=="undefined"),$=e.ref(),T=e.computed(()=>n.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function ae(c){const a=T.value,y=`%%{init: {"theme": "${c==="dark"?"dark":"default"}"}}%%
2
2
  `;return a.trim().startsWith("%%{")?a:y+a}const D=e.ref(1),W=e.ref(0),E=e.ref(0),G=e.ref(!1),X=e.ref({x:0,y:0}),P=e.ref(!1),pe=e.ref(!1),K=e.ref(!1),Ye=e.ref(null),je=e.ref(0),Pe=e.ref(!1);let $e=null;const U=e.ref("360px");let Y=null;const I=e.ref(!1),le=e.ref(!1),Me=e.ref({}),Ae=e.ref(null),ve=e.ref(""),Je=e.ref(0);let ne=null;const ge=e.ref(!1),Se=e.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),w=e.computed(()=>{var c,a,u,y;return{worker:(c=n.workerTimeoutMs)!=null?c:1400,parse:(a=n.parseTimeoutMs)!=null?a:1800,render:(u=n.renderTimeoutMs)!=null?u:2500,fullRender:(y=n.fullRenderTimeoutMs)!=null?y:4e3}}),k=(Mn=globalThis.cancelIdleCallback)!=null?Mn:(c=>clearTimeout(c));let B=null,q=null,J=!1,Qe=800,ie=null,et=0,$t=!0;typeof window!="undefined"&&e.watch(()=>d.value,c=>{var u;if((u=_.value)==null||u.destroy(),_.value=null,!c){z.value=!1;return}const a=H(c,{rootMargin:"400px"});_.value=a,z.value=a.isVisible.value,a.whenVisible.then(()=>{z.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var c;(c=_.value)==null||c.destroy(),_.value=null});function De(c,a){const u=a==null?void 0:a.timeoutMs,y=a==null?void 0:a.signal;if(y!=null&&y.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let N=null,C=!1,L=null;return new Promise((j,Ce)=>{const Q=()=>{N!=null&&clearTimeout(N),L&&y&&y.removeEventListener("abort",L)};u&&u>0&&(N=globalThis.setTimeout(()=>{C||(C=!0,Q(),Ce(new Error("Operation timed out")))},u)),y&&(L=()=>{C||(C=!0,Q(),Ce(new DOMException("Aborted","AbortError")))},y.addEventListener("abort",L)),c().then(vt=>{C||(C=!0,Q(),j(vt))}).catch(vt=>{C||(C=!0,Q(),Ce(vt))})})}function We(c){if(typeof document=="undefined"||!h.value)return;const a=document.createElement("div");a.className="text-red-500 p-4",a.textContent="Failed to render diagram: ";const u=document.createElement("span");u.textContent=c instanceof Error?c.message:"Unknown error",a.appendChild(u),h.value.innerHTML="",h.value.appendChild(a),U.value="360px",ge.value=!0,at()}function tt(c){const a=c;return!a||a.disabled}function F(c,a,u="top"){if(tt(c.currentTarget))return;const y=c,N=(y==null?void 0:y.clientX)!=null&&(y==null?void 0:y.clientY)!=null?{x:y.clientX,y:y.clientY}:void 0;Tt(c.currentTarget,a,u,!1,N,n.isDark)}function O(){nn()}function St(c){if(tt(c.currentTarget))return;const a=v.value?r("common.copied")||"Copied":r("common.copy")||"Copy",u=c,y=(u==null?void 0:u.clientX)!=null&&(u==null?void 0:u.clientY)!=null?{x:u.clientX,y:u.clientY}:void 0;Tt(c.currentTarget,a,"top",!1,y,n.isDark)}function Vt(c,a){const y=`%%{init: {"theme": "${a==="dark"?"dark":"default"}"}}%%
3
3
  `;return c.trimStart().startsWith("%%{")?c:y+c}function It(){return $t&&!P.value&&!I.value&&!ge.value}function Ft(c){const a=c.split(/\r?\n/);for(;a.length>0;){const y=a[a.length-1].trimEnd();if(y===""){a.pop();continue}if(/^[-=~>|<\s]+$/.test(y.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(y)||/[-|><]$/.test(y)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(y)){a.pop();continue}break}return a.join(`
4
4
  `)}function Ot(c,a,u){return V(this,null,function*(){var L,j;if(!l)return;const y=l,N=Vt(c,a);if(typeof y.parse=="function")return yield De(()=>y.parse(N),{timeoutMs:(L=u==null?void 0:u.timeoutMs)!=null?L:w.value.parse,signal:u==null?void 0:u.signal}),!0;const C=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield De(()=>l.render(C,N),{timeoutMs:(j=u==null?void 0:u.timeoutMs)!=null?j:w.value.render,signal:u==null?void 0:u.signal}),!0})}function mt(c,a,u){return V(this,null,function*(){var y;try{return yield Un(c,a,(y=u==null?void 0:u.timeoutMs)!=null?y:w.value.worker)}catch(N){return yield Ot(c,a,u)}})}function sn(c,a,u){return V(this,null,function*(){var N;try{if(yield mt(c,a,u))return{fullOk:!0,prefixOk:!1}}catch(C){if((C==null?void 0:C.name)==="AbortError")throw C}let y=Ft(c);if(y&&y.trim()&&y!==c)try{try{const L=yield Zn(c,a,(N=u==null?void 0:u.timeoutMs)!=null?N:w.value.worker);L&&L.trim()&&(y=L)}catch(L){}if(yield mt(y,a,u))return{fullOk:!1,prefixOk:!0,prefix:y}}catch(C){if((C==null?void 0:C.name)==="AbortError")throw C}return{fullOk:!1,prefixOk:!1}})}const nt=e.computed(()=>P.value||K.value||m.value);function ft(c){if(!d.value||!h.value)return;const a=h.value.querySelector("svg");if(!a)return;let u=0,y=0;const N=a.getAttribute("viewBox"),C=a.getAttribute("width"),L=a.getAttribute("height");if(N){const j=N.split(" ");j.length===4&&(u=Number.parseFloat(j[2]),y=Number.parseFloat(j[3]))}if((!u||!y)&&C&&L&&(u=Number.parseFloat(C),y=Number.parseFloat(L)),Number.isNaN(u)||Number.isNaN(y)||u<=0||y<=0)try{const j=a.getBBox();j&&j.width>0&&j.height>0&&(u=j.width,y=j.height)}catch(j){console.error("Failed to get SVG BBox:",j);return}if(u>0&&y>0){const j=y/u;let Q=(c!=null?c:d.value.clientWidth)*j;Q>y&&(Q=y),U.value=`${Q}px`}}const ze=e.ref(!1),_t=e.computed(()=>({transform:`translate(${W.value}px, ${E.value}px) scale(${D.value})`}));function Xt(c){c.key==="Escape"&&ze.value&&ht()}function Yt(){if(ze.value=!0,typeof document!="undefined")try{document.body.style.overflow="hidden"}catch(c){}if(typeof window!="undefined")try{window.addEventListener("keydown",Xt)}catch(c){}e.nextTick(()=>{if(d.value&&b.value){const c=d.value.cloneNode(!0);c.classList.add("fullscreen");const a=c.querySelector("[data-mermaid-wrapper]");a&&(M.value=a,a.style.transform=_t.value.transform),b.value.innerHTML="",b.value.appendChild(c)}})}function ht(){if(ze.value=!1,b.value&&(b.value.innerHTML=""),M.value=null,typeof document!="undefined")try{document.body.style.overflow=""}catch(c){}if(typeof window!="undefined")try{window.removeEventListener("keydown",Xt)}catch(c){}}function qt(c,a){let u=null;return(...y)=>{u&&clearTimeout(u),u=setTimeout(()=>c(...y),a)}}function f(){if(!P.value||!i.value)return;const c=T.value.length;c!==je.value&&(Pe.value=!0,je.value=c,$e&&clearTimeout($e),$e=setTimeout(()=>{Pe.value&&P.value&&T.value.trim()&&(Pe.value=!1,Dt("preview"))},ra))}e.watch(_t,c=>{ze.value&&M.value&&(M.value.style.transform=c.transform)},{immediate:!0});function p(){D.value<3&&(D.value+=.1)}function x(){D.value>.5&&(D.value-=.1)}function A(){D.value=1,W.value=0,E.value=0}function S(c){G.value=!0,c instanceof MouseEvent?X.value={x:c.clientX-W.value,y:c.clientY-E.value}:X.value={x:c.touches[0].clientX-W.value,y:c.touches[0].clientY-E.value}}function ke(c){if(!G.value)return;let a,u;c instanceof MouseEvent?(a=c.clientX,u=c.clientY):(a=c.touches[0].clientX,u=c.touches[0].clientY),W.value=a-X.value.x,E.value=u-X.value.y}function Ve(){G.value=!1}function Ke(c){if(c.ctrlKey||c.metaKey){if(c.preventDefault(),!d.value)return;const a=d.value.getBoundingClientRect(),u=c.clientX-a.left,y=c.clientY-a.top,N=a.width/2,C=a.height/2,L=u-N,j=y-C,Ce=(L-W.value)/D.value,Q=(j-E.value)/D.value,io=-c.deltaY*.01,Gt=Math.min(Math.max(D.value+io,.5),3);Gt!==D.value&&(W.value=L-Ce*Gt,E.value=j-Q*Gt,D.value=Gt)}}function Ie(){return V(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(T.value)),v.value=!0,s("copy",T.value),setTimeout(()=>{v.value=!1},1e3)}catch(c){console.error("Failed to copy:",c)}})}function ot(c,a=null){return V(this,null,function*(){try{const u=a!=null?a:new XMLSerializer().serializeToString(c),y=new Blob([u],{type:"image/svg+xml;charset=utf-8"}),N=URL.createObjectURL(y);if(typeof document!="undefined"){const C=document.createElement("a");C.href=N,C.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(C),C.click(),document.body.removeChild(C)}catch(L){}URL.revokeObjectURL(N)}}catch(u){console.error("Failed to export SVG:",u)}})}function pt(){var y;const c=(y=h.value)==null?void 0:y.querySelector("svg");if(!c){console.error("SVG element not found");return}const a=new XMLSerializer().serializeToString(c),u={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:c,svgString:a};s("export",u),u.defaultPrevented||ot(c,a)}function cn(){var y,N;const c=(N=(y=h.value)==null?void 0:y.querySelector("svg"))!=null?N:null,a=c?new XMLSerializer().serializeToString(c):null,u={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:c,svgString:a};s("openModal",u),u.defaultPrevented||Yt()}function Lt(c){const a={payload:{type:"toggle-mode",target:c},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};s("toggleMode",c,a),a.defaultPrevented||Dt(c)}function Dt(c){return V(this,null,function*(){const a=$.value;if(!a){pe.value=!0,P.value=c==="source";return}const u=a.getBoundingClientRect().height;a.style.height=`${u}px`,a.style.overflow="hidden",pe.value=!0,P.value=c==="source",yield e.nextTick();const y=a.scrollHeight;a.style.transition="height 180ms ease",a.offsetHeight,a.style.height=`${y}px`;const N=()=>{a.style.transition="",a.style.height="",a.style.overflow="",a.removeEventListener("transitionend",C)};function C(){N()}a.addEventListener("transitionend",C),setTimeout(()=>N(),220)})}function rt(){return V(this,null,function*(){if(K.value)return Ye.value;if(!h.value&&(yield e.nextTick(),!h.value)){console.warn("Mermaid container not ready");return}return K.value=!0,Ye.value=V(null,null,function*(){var c;if(l){h.value&&(h.value.style.opacity="0");try{const a=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;!I.value&&!le.value&&((c=l.initialize)==null||c.call(l,{securityLevel:"loose",startOnLoad:!1}));const u=n.isDark?"dark":"light",y=ae(u),N=yield De(()=>l.render(a,y),{timeoutMs:w.value.fullRender}),C=N==null?void 0:N.svg,L=N==null?void 0:N.bindFunctions;if(h.value){h.value.innerHTML=C,L==null||L(h.value),!I.value&&!le.value&&(ft(),I.value=!0,Se.value={zoom:D.value,translateX:W.value,translateY:E.value,containerHeight:U.value});const j=n.isDark?"dark":"light";Me.value[j]=C,le.value&&(le.value=!1),ge.value=!1}}catch(a){console.error("Failed to render mermaid diagram:",a),n.loading===!1&&We(a)}finally{yield e.nextTick(),h.value&&(h.value.style.opacity="1"),K.value=!1,Ye.value=null}}}),Ye.value})}function dn(c){return V(this,null,function*(){if(It()&&!(!h.value&&(yield e.nextTick(),!h.value))&&!K.value){K.value=!0;try{if(!l)return;const a=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,u=n.isDark?"dark":"light",y=Ft(c),N=y&&y.trim()?y:c,C=Vt(N,u);h.value&&(h.value.style.opacity="0");const L=yield De(()=>l.render(a,C),{timeoutMs:w.value.render}),j=L==null?void 0:L.svg,Ce=L==null?void 0:L.bindFunctions;h.value&&j&&(h.value.innerHTML=j,Ce==null||Ce(h.value),ft())}catch(a){}finally{yield e.nextTick(),h.value&&(h.value.style.opacity="1"),K.value=!1}}})}const un=(Cn=globalThis.requestIdleCallback)!=null?Cn:((c,a)=>setTimeout(()=>c({didTimeout:!0}),16));function zt(){return V(this,null,function*(){var j,Ce;const c=Date.now(),a=++Je.value;ne&&ne.abort(),ne=new AbortController;const u=ne.signal,y=n.isDark?"dark":"light",N=T.value,C=N.replace(/\s+/g,"");if(!N.trim()){h.value&&(h.value.innerHTML=""),Ae.value=null,ve.value="",ge.value=!1;return}if(C===ve.value)return;try{const Q=yield sn(N,y,{signal:u,timeoutMs:w.value.worker});if(Q.fullOk){yield rt(),Je.value===a&&(Ae.value=(Ce=(j=h.value)==null?void 0:j.innerHTML)!=null?Ce:null,ve.value=C,ge.value=!1);return}const vt=et&&c<=et;if(Q.prefixOk&&Q.prefix&&It()&&!vt){yield dn(Q.prefix);return}}catch(Q){if((Q==null?void 0:Q.name)==="AbortError")return}if(Je.value!==a||ge.value)return;const L=Me.value[y];L&&h.value&&(h.value.innerHTML=L)})}const Rt=qt(()=>{un(()=>{zt()},{timeout:500})},oa);function at(){J&&(J=!1,Qe=800,$t=!1,ie&&(ie.abort(),ie=null),B&&(globalThis.clearTimeout(B),B=null),q&&(k(q),q=null),et=Date.now())}function Ut(){if(at(),ne){try{ne.abort()}catch(c){}ne=null}if(ie){try{ie.abort()}catch(c){}ie=null}wn()}function mn(c=800){J&&(B&&globalThis.clearTimeout(B),B=globalThis.setTimeout(()=>{q=un(()=>V(null,null,function*(){if(!J)return;if(P.value||I.value){at();return}const a=n.isDark?"dark":"light",u=T.value;if(!u.trim()){mn(Qe);return}ie&&ie.abort(),ie=new AbortController;try{if((yield mt(u,a,{signal:ie.signal,timeoutMs:w.value.worker}))&&(yield rt(),I.value)){at();return}}catch(y){}Qe=Math.min(Math.floor(Qe*1.5),4e3),mn(Qe)}),{timeout:500})},c))}function fn(){J||P.value||I.value||(J=!0,et=0,$t=!0,mn(500))}e.watch(()=>T.value,()=>{I.value=!1,Me.value={},Rt(),!P.value&&i.value&&fn(),f()}),e.watch(()=>n.isDark,()=>V(null,null,function*(){if(!I.value||ge.value)return;const c=n.isDark?"dark":"light";if(Me.value[c]){h.value&&(h.value.innerHTML=Me.value[c]);return}const a={zoom:D.value,translateX:W.value,translateY:E.value,containerHeight:U.value},u=D.value!==1||W.value!==0||E.value!==0;le.value=!0,u&&(D.value=1,W.value=0,E.value=0,yield e.nextTick()),yield rt(),u&&(yield e.nextTick(),D.value=a.zoom,W.value=a.translateX,E.value=a.translateY,U.value=a.containerHeight,Se.value=a)})),e.watch(()=>P.value,c=>V(null,null,function*(){if(c)at(),I.value&&(Se.value={zoom:D.value,translateX:W.value,translateY:E.value,containerHeight:U.value});else{if(ge.value)return;const a=n.isDark?"dark":"light";if(I.value&&Me.value[a]){yield e.nextTick(),h.value&&(h.value.innerHTML=Me.value[a]),D.value=Se.value.zoom,W.value=Se.value.translateX,E.value=Se.value.translateY,U.value=Se.value.containerHeight;return}if(yield e.nextTick(),!i.value)return;yield zt(),fn()}})),e.watch(()=>n.loading,(c,a)=>V(null,null,function*(){if(a===!0&&c===!1){const u=T.value.trim();if(!u)return Ut();const y=n.isDark?"dark":"light",N=u.replace(/\s+/g,"");if(I.value&&N===ve.value){yield e.nextTick(),h.value&&!h.value.querySelector("svg")&&Me.value[y]&&(h.value.innerHTML=Me.value[y]),Ut();return}try{yield mt(u,y,{timeoutMs:w.value.worker}),yield rt(),ve.value=N,ge.value=!1,Ut()}catch(C){Ut(),We(C)}}})),e.watch(d,c=>{Y&&Y.disconnect(),c&&!I.value&&!le.value&&(Y=new ResizeObserver(a=>{a&&a.length>0&&!I.value&&!le.value&&Xn(()=>{const u=a[0].contentRect.width;ft(u)})}),Y.observe(c))},{immediate:!0}),e.onMounted(()=>V(null,null,function*(){yield e.nextTick(),pe.value||(P.value=!i.value),z.value&&(Rt(),je.value=T.value.length)})),e.watch(()=>i.value,c=>{pe.value||(P.value=!c)}),e.watch(()=>z.value,c=>{c&&(I.value||(Rt(),je.value=T.value.length),!n.loading&&!I.value&&Rt())},{immediate:!1}),e.onUnmounted(()=>{$e&&clearTimeout($e),Y&&Y.disconnect(),ne&&(ne.abort(),ne=null),wn(),at()}),e.watch(()=>m.value,c=>V(null,null,function*(){c?(at(),ne&&ne.abort()):I.value||(yield e.nextTick(),Rt(),P.value||fn())}),{immediate:!1});const Zt=e.computed(()=>n.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return(c,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["my-4 rounded-lg border overflow-hidden shadow-sm",[n.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.loading}]])},[n.showHeader?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",n.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[c.$slots["header-left"]?(e.openBlock(),e.createElementBlock("div",Hr,[e.renderSlot(c.$slots,"header-left",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",jr,[e.createElementVNode("img",{src:e.unref($r),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,Pr),e.createElementVNode("span",{class:e.normalizeClass(["text-sm font-medium font-mono",n.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),c.$slots["header-center"]?(e.openBlock(),e.createElementBlock("div",Ar,[e.renderSlot(c.$slots,"header-center",{},void 0,!0)])):n.showModeToggle&&i.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["flex items-center space-x-1 rounded-md p-0.5",n.isDark?"bg-gray-700":"bg-gray-100"])},[e.createElementVNode("button",{class:e.normalizeClass(["px-2.5 py-1 text-xs rounded transition-colors",[P.value?n.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:a[0]||(a[0]=()=>Lt("preview")),onMouseenter:a[1]||(a[1]=u=>F(u,e.unref(r)("common.preview")||"Preview")),onFocus:a[2]||(a[2]=u=>F(u,e.unref(r)("common.preview")||"Preview")),onMouseleave:O,onBlur:O},[e.createElementVNode("div",Wr,[a[21]||(a[21]=e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("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"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})])],-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("common.preview")||"Preview"),1)])],34),e.createElementVNode("button",{class:e.normalizeClass(["px-2.5 py-1 text-xs rounded transition-colors",[P.value?n.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:a[3]||(a[3]=()=>Lt("source")),onMouseenter:a[4]||(a[4]=u=>F(u,e.unref(r)("common.source")||"Source")),onFocus:a[5]||(a[5]=u=>F(u,e.unref(r)("common.source")||"Source")),onMouseleave:O,onBlur:O},[e.createElementVNode("div",Kr,[a[22]||(a[22]=e.createElementVNode("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"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("common.source")||"Source"),1)])],34)],2)):e.createCommentVNode("",!0),c.$slots["header-right"]?(e.openBlock(),e.createElementBlock("div",Fr,[e.renderSlot(c.$slots,"header-right",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",Or,[n.showCollapseButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(Zt.value),"aria-pressed":m.value,onClick:a[6]||(a[6]=u=>m.value=!m.value),onMouseenter:a[7]||(a[7]=u=>F(u,m.value?e.unref(r)("common.expand")||"Expand":e.unref(r)("common.collapse")||"Collapse")),onFocus:a[8]||(a[8]=u=>F(u,m.value?e.unref(r)("common.expand")||"Expand":e.unref(r)("common.collapse")||"Collapse")),onMouseleave:O,onBlur:O},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:m.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"},[...a[23]||(a[23]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,Xr)):e.createCommentVNode("",!0),n.showCopyButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(Zt.value),onClick:Ie,onMouseenter:a[9]||(a[9]=u=>St(u)),onFocus:a[10]||(a[10]=u=>St(u)),onMouseleave:O,onBlur:O},[v.value?(e.openBlock(),e.createElementBlock("svg",qr,[...a[25]||(a[25]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Yr,[...a[24]||(a[24]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),e.createElementVNode("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],34)):e.createCommentVNode("",!0),n.showExportButton&&i.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(`${Zt.value} ${nt.value?"opacity-50 cursor-not-allowed":""}`),disabled:nt.value,onClick:pt,onMouseenter:a[11]||(a[11]=u=>F(u,e.unref(r)("common.export")||"Export")),onFocus:a[12]||(a[12]=u=>F(u,e.unref(r)("common.export")||"Export")),onMouseleave:O,onBlur:O},[...a[26]||(a[26]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElementVNode("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,Ur)):e.createCommentVNode("",!0),n.showFullscreenButton&&i.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(`${Zt.value} ${nt.value?"opacity-50 cursor-not-allowed":""}`),disabled:nt.value,onClick:cn,onMouseenter:a[13]||(a[13]=u=>F(u,ze.value?e.unref(r)("common.minimize")||"Minimize":e.unref(r)("common.open")||"Open")),onFocus:a[14]||(a[14]=u=>F(u,ze.value?e.unref(r)("common.minimize")||"Minimize":e.unref(r)("common.open")||"Open")),onMouseleave:O,onBlur:O},[ze.value?(e.openBlock(),e.createElementBlock("svg",Jr,[...a[28]||(a[28]=[e.createElementVNode("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)])])):(e.openBlock(),e.createElementBlock("svg",Gr,[...a[27]||(a[27]=[e.createElementVNode("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)])]))],42,Zr)):e.createCommentVNode("",!0)]))],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"modeContainerRef",ref:$},[P.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-4",n.isDark?"bg-gray-900":"bg-gray-50"])},[e.createElementVNode("pre",{class:e.normalizeClass(["text-sm font-mono whitespace-pre-wrap",n.isDark?"text-gray-300":"text-gray-700"])},e.toDisplayString(T.value),3)],2)):(e.openBlock(),e.createElementBlock("div",Qr,[n.showZoomControls?(e.openBlock(),e.createElementBlock("div",ea,[e.createElementVNode("div",ta,[e.createElementVNode("button",{class:e.normalizeClass(["p-2 text-xs rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:p,onMouseenter:a[15]||(a[15]=u=>F(u,e.unref(r)("common.zoomIn")||"Zoom in")),onFocus:a[16]||(a[16]=u=>F(u,e.unref(r)("common.zoomIn")||"Zoom in")),onMouseleave:O,onBlur:O},[...a[29]||(a[29]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),e.createElementVNode("button",{class:e.normalizeClass(["p-2 text-xs rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:x,onMouseenter:a[17]||(a[17]=u=>F(u,e.unref(r)("common.zoomOut")||"Zoom out")),onFocus:a[18]||(a[18]=u=>F(u,e.unref(r)("common.zoomOut")||"Zoom out")),onMouseleave:O,onBlur:O},[...a[30]||(a[30]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),e.createElementVNode("button",{class:e.normalizeClass(["p-2 text-xs rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:A,onMouseenter:a[19]||(a[19]=u=>F(u,e.unref(r)("common.resetZoom")||"Reset zoom")),onFocus:a[20]||(a[20]=u=>F(u,e.unref(r)("common.resetZoom")||"Reset zoom")),onMouseleave:O,onBlur:O},e.toDisplayString(Math.round(D.value*100))+"% ",35)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"mermaidContainer",ref:d,class:e.normalizeClass(["min-h-[360px] relative transition-all duration-100 overflow-hidden block",n.isDark?"bg-gray-900":"bg-gray-50"]),style:e.normalizeStyle({height:U.value}),onWheel:Ke,onMousedown:S,onMousemove:ke,onMouseup:Ve,onMouseleave:Ve,onTouchstartPassive:S,onTouchmovePassive:ke,onTouchendPassive:Ve},[e.createElementVNode("div",{ref_key:"mermaidWrapper",ref:g,"data-mermaid-wrapper":"",class:e.normalizeClass(["absolute inset-0 cursor-grab",{"cursor-grabbing":G.value}]),style:e.normalizeStyle(_t.value)},[e.createElementVNode("div",{ref_key:"mermaidContent",ref:h,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],38),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"mermaid-dialog",appear:""},{default:e.withCtx(()=>[ze.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:e.withModifiers(ht,["self"])},[e.createElementVNode("div",{class:e.normalizeClass(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",n.isDark?"bg-gray-900":"bg-white"])},[e.createElementVNode("div",na,[e.createElementVNode("button",{class:e.normalizeClass(["p-2 text-xs rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:p},[...a[31]||(a[31]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),e.createElementVNode("button",{class:e.normalizeClass(["p-2 text-xs rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:x},[...a[32]||(a[32]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),e.createElementVNode("button",{class:e.normalizeClass(["p-2 text-xs rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:A},e.toDisplayString(Math.round(D.value*100))+"% ",3),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center p-2 rounded transition-colors",[n.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ht},[...a[33]||(a[33]=[e.createElementVNode("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"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),e.createElementVNode("div",{ref_key:"modalContent",ref:b,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden",onWheel:Ke,onMousedown:S,onMousemove:ke,onMouseup:Ve,onMouseleave:Ve,onTouchstart:S,onTouchmove:ke,onTouchend:Ve},null,544)],2)])):e.createCommentVNode("",!0)]),_:1})]))]))],512),[[e.vShow,!m.value]])],2))}}),ct=R(aa,[["__scopeId","data-v-0556d04e"]]);ct.install=t=>{t.component(ct.__name,ct)};const la={dir:"auto",class:"paragraph-node"},ia=e.defineComponent({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=Z({inline_code:de,image:Xe,link:he,hardbreak:Ue,emphasis:Te,strong:me,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,checkbox:Le,math_inline:He,checkbox_input:Le,reference:ue,footnote_anchor:st,footnote_reference:ce},Ne(o.customId)),s=On();return(r,l)=>(e.openBlock(),e.createElementBlock("p",la,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(i,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"paragraph"}-${v}`},[i.type!=="text"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n[i.type]),{key:0,node:i,"index-key":`${t.indexKey}-${v}`,"custom-id":o.customId},null,8,["node","index-key","custom-id"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([[e.unref(s)&&i.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},e.toDisplayString(i.content),3))],64))),128))]))}}),Mt=R(ia,[["__scopeId","data-v-e7323e31"]]);Mt.install=t=>{t.component(Mt.__name,Mt)};const sa=["aria-busy","aria-label","data-language"],ca=["textContent"],dt=e.defineComponent({__name:"PreCodeNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{var m,d,g;const l=String((d=(m=o.node)==null?void 0:m.language)!=null?d:"");return String((g=String(l).split(/\s+/g)[0])!=null?g:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=e.computed(()=>`language-${n.value}`),r=e.computed(()=>{const l=n.value;return l?`Code block: ${l}`:"Code block"});return(l,i)=>(e.openBlock(),e.createElementBlock("pre",{class:e.normalizeClass([s.value]),"aria-busy":t.node.loading===!0,"aria-label":r.value,"data-language":n.value,tabindex:"0"},[i[0]||(i[0]=e.createTextVNode(" ",-1)),e.createElementVNode("code",{translate:"no",textContent:e.toDisplayString(t.node.code)},null,8,ca),i[1]||(i[1]=e.createTextVNode(`
5
- `,-1))],10,sa))}});dt.install=t=>{t.component(dt.__name,dt)};const da={class:"table-node-wrapper"},ua=["aria-busy"],ma={class:"border-[var(--table-border,#cbd5e1)]"},fa={class:"border-b"},ha={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},pa=e.defineComponent({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>{var i,v,m,d;return(d=(m=(v=(i=o.node)==null?void 0:i.header)==null?void 0:v.cells)==null?void 0:m.length)!=null?d:0}),s=e.computed(()=>{const i=n.value||1,v=Math.floor(100/i);return Array.from({length:i}).map((m,d)=>d===i-1?`${100-v*(i-1)}%`:`${v}%`)}),r=e.computed(()=>{var i;return(i=o.node.loading)!=null?i:!1}),l=e.computed(()=>{var i;return(i=o.node.rows)!=null?i:[]});return(i,v)=>(e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("table",{class:e.normalizeClass(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":r.value}]),"aria-busy":r.value},[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(m,d)=>(e.openBlock(),e.createElementBlock("col",{key:`col-${d}`,style:e.normalizeStyle({width:m})},null,4))),128))]),e.createElementVNode("thead",ma,[e.createElementVNode("tr",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.header.cells,(m,d)=>(e.openBlock(),e.createElementBlock("th",{key:`header-${d}`,dir:"auto",class:e.normalizeClass(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",[m.align==="right"?"text-right":m.align==="center"?"text-center":"text-left"]])},[e.createVNode(e.unref(Ee),{nodes:m.children,"index-key":`table-th-${t.indexKey}`,typewriter:o.typewriter,onCopy:v[0]||(v[0]=g=>i.$emit("copy",g))},null,8,["nodes","index-key","typewriter"])],2))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(m,d)=>(e.openBlock(),e.createElementBlock("tr",{key:`row-${d}`,class:e.normalizeClass(["border-[var(--table-border,#cbd5e1)]",[d<l.value.length-1?"border-b":""]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.cells,(g,h)=>(e.openBlock(),e.createElementBlock("td",{key:`cell-${d}-${h}`,class:e.normalizeClass(["p-[calc(4/7*1em)] overflow-x-auto",[g.align==="right"?"text-right":g.align==="center"?"text-center":"text-left"]]),dir:"auto"},[e.createVNode(e.unref(Ee),{nodes:g.children,"index-key":`table-td-${t.indexKey}`,typewriter:o.typewriter,onCopy:v[1]||(v[1]=b=>i.$emit("copy",b))},null,8,["nodes","index-key","typewriter"])],2))),128))],2))),128))])],10,ua),e.createVNode(e.Transition,{name:"table-node-fade"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",ha,[e.renderSlot(i.$slots,"loading",{isLoading:r.value},()=>[v[2]||(v[2]=e.createElementVNode("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=e.createElementVNode("span",{class:"sr-only"},"Loading",-1))],!0)])):e.createCommentVNode("",!0)]),_:3})]))}}),Ct=R(pa,[["__scopeId","data-v-50ef14ca"]]);Ct.install=t=>{t.component(Ct.__name,Ct)};const va={},ga={class:"hr-node"};function ka(t,o){return e.openBlock(),e.createElementBlock("hr",ga)}const Et=R(va,[["render",ka],["__scopeId","data-v-639cbad9"]]);Et.install=t=>{t.component(Et.__name,Et)};const wa={key:1,class:"html-block-node__placeholder"},ya=e.defineComponent({__name:"HtmlBlockNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{const d=o.node.attrs;if(d){if(Array.isArray(d)){const g={};for(const h of d){if(!h||h.length<2)continue;const[b,M]=h;b!=null&&(g[String(b)]=M==null?"":String(M))}return g}return d}}),s=e.ref(null),r=e.ref(typeof window=="undefined"),l=e.ref(o.node.content),i=rn(),v=e.ref(null),m=!!o.node.loading;return typeof window!="undefined"?(e.watch(s,d=>{var h,b;if((b=(h=v.value)==null?void 0:h.destroy)==null||b.call(h),v.value=null,!m){r.value=!0,l.value=o.node.content;return}if(!d){r.value=!1;return}const g=i(d,{rootMargin:"400px"});v.value=g,r.value=g.isVisible.value,g.whenVisible.then(()=>{r.value=!0})},{immediate:!0}),e.watch(()=>o.node.content,d=>{(!m||r.value)&&(l.value=d)})):r.value=!0,e.onBeforeUnmount(()=>{var d,g;(g=(d=v.value)==null?void 0:d.destroy)==null||g.call(d),v.value=null}),(d,g)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"htmlRef",ref:s,class:"html-block-node"},n.value),[r.value?e.withMemo([l.value],()=>(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:l.value},null,8,["innerHTML"])),g,0):(e.openBlock(),e.createElementBlock("div",wa,[e.renderSlot(d.$slots,"placeholder",{node:t.node},()=>[g[1]||(g[1]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar"},null,-1)),g[2]||(g[2]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),g[3]||(g[3]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),xa=R(ya,[["__scopeId","data-v-ed22b926"]]),ba={class:"unknown-node"},In=e.defineComponent({__name:"FallbackComponent",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",ba,e.toDisplayString(t.node.raw),1))}}),Ba=["data-node-index","data-node-type"],Ma=e.defineComponent({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},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(t,{emit:o}){var Yt,ht,qt;const n=t,s=o,r=e.ref(),l=e.ref(n.viewportPriority!==!1),i=Ao(()=>r.value,l),v=vn.getMarkdown(),m=e.computed(()=>n.customMarkdownIt?n.customMarkdownIt(v):v),d=e.computed(()=>{var f;if((f=n.nodes)!=null&&f.length)return e.markRaw(n.nodes.slice());if(n.content){const p=vn.parseMarkdownToStructure(n.content,m.value,n.parseOptions);return e.markRaw(p)}return[]}),g=typeof window!="undefined",h=g&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,b=g&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,M=typeof globalThis!="undefined"&&typeof globalThis.process!="undefined"&&((ht=(Yt=globalThis.process)==null?void 0:Yt.env)==null?void 0:ht.NODE_ENV)==="test",H=g&&typeof window.requestIdleCallback=="function",_=e.computed(()=>{var p;const f=Math.trunc((p=n.renderBatchSize)!=null?p:80);return Number.isFinite(f)?Math.max(0,f):0}),z=e.computed(()=>{var p;const f=Math.trunc((p=n.initialRenderBatchSize)!=null?p:_.value);return Number.isFinite(f)?Math.max(0,f):_.value}),$=e.computed(()=>n.batchRendering!==!1&&_.value>0&&g&&!M),T=e.ref(0),ae=e.ref({key:n.indexKey,total:0}),D=e.ref({batchSize:_.value,initial:z.value,delay:(qt=n.renderBatchDelay)!=null?qt:16,enabled:$.value}),W=e.shallowRef([]),E=e.ref(Math.max(1,_.value||1)),G=e.reactive({}),X=new Map,P=new Map,pe=e.computed(()=>n.deferNodesUntilVisible!==!1&&l.value!==!1),K=e.computed(()=>{var f;return((f=n.maxLiveNodes)!=null?f:0)>0}),Ye=e.computed(()=>!!i&&(pe.value||K.value)),je=e.computed(()=>{var f;return Math.max(1,(f=n.maxLiveNodes)!=null?f:320)}),Pe=e.computed(()=>{var f;return Math.max(0,(f=n.liveNodeBuffer)!=null?f:60)}),$e=e.ref(0),U=e.reactive({start:0,end:0}),Y=new Map,I=e.computed(()=>{if(!K.value)return d.value.length;const f=Pe.value,p=Math.max(U.end+f,z.value),x=Math.min(d.value.length,p);return Math.max(T.value,x)});function le(f,p,x){return Math.min(Math.max(f,p),x)}function Me(){const f=d.value.length;if(!K.value||f===0){U.start=0,U.end=f;return}const p=Math.min(je.value,f),x=Pe.value,A=le($e.value-x,0,Math.max(0,f-p));U.start=A,U.end=Math.min(f,A+p)}const Ae=e.reactive({}),ve=e.reactive({total:0,count:0});function Je(f,p){if(!Number.isFinite(p)||p<=0)return;const x=Ae[f];Ae[f]=p,x?ve.total+=p-x:(ve.total+=p,ve.count++)}const ne=e.computed(()=>ve.count>0?Math.max(12,ve.total/ve.count):32);function ge(f,p){var A;if(f>=p)return 0;let x=0;for(let S=f;S<p;S++)x+=(A=Ae[S])!=null?A:ne.value;return x}const Se=e.computed(()=>{if(!K.value)return d.value.map((A,S)=>({node:A,index:S}));const f=d.value.length,p=le(U.start,0,f),x=le(U.end,p,f);return d.value.slice(p,x).map((A,S)=>({node:A,index:p+S}))}),w=e.computed(()=>K.value?ge(0,Math.min(U.start,d.value.length)):0),k=e.computed(()=>{if(!K.value)return 0;const f=d.value.length,p=Math.min(U.end,f);return ge(p,f)});function B(){const f=d.value.length,p=Math.min(f,T.value);if(p<=0){W.value=[],q(0);return}if(p>=f){W.value=d.value,q(p);return}W.value=d.value.slice(0,p),q(p)}function q(f){if(X.size)for(const[p,x]of X)p>=f&&(x.destroy(),X.delete(p),pe.value&&delete G[p],P.delete(p))}function J(f,p){pe.value&&(G[f]=p),p&&($e.value=le(f,0,Math.max(0,d.value.length-1)))}function Qe(f){return!pe.value||f<z.value?!0:G[f]===!0}function ie(f){const p=X.get(f);p&&(p.destroy(),X.delete(f))}function et(f,p){if(p?P.set(f,p):P.delete(f),!Ye.value||!i){ie(f),p?J(f,!0):pe.value&&delete G[f];return}if(f<z.value&&!K.value){ie(f),J(f,!0);return}if(!p){ie(f),pe.value&&delete G[f];return}ie(f);const x=i(p,{rootMargin:"400px"});x&&(X.set(f,x),J(f,x.isVisible.value),x.whenVisible.then(()=>{J(f,!0)}).catch(()=>{}))}function $t(f,p){if(!p){Y.delete(f);return}Y.set(f,p),queueMicrotask(()=>{Je(f,p.offsetHeight)})}let De=null,We=null,tt=!1,F=null,O=null;function St(){g&&(De!=null&&(b==null||b(De),De=null),We!=null&&(window.clearTimeout(We),We=null),O!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(O),O=null),tt=!1,F=null)}function Vt(f,p={}){var Ve,Ke;if(!$.value)return;const x=I.value;if(T.value>=x)return;const A=Math.max(1,f),S=Ie=>{var Dt;De=null,We=null,O=null,tt=!1;const ot=F!=null?F:A;F=null;const pt=Math.max(2,(Dt=n.renderBatchBudgetMs)!=null?Dt:6),cn=rt=>{const dn=typeof performance!="undefined"?performance.now():Date.now();T.value=Math.min(x,T.value+Math.max(1,rt)),B();const zt=(typeof performance!="undefined"?performance.now():Date.now())-dn;return Ft(zt),zt};let Lt=ot;for(;cn(Lt),!(T.value>=x||!Ie||(typeof Ie.timeRemaining=="function"?Ie.timeRemaining():0)<=pt*.5);)Lt=Math.max(1,Math.round(E.value));T.value<x&&It()};if(!g||p.immediate){S();return}const ke=Math.max(0,(Ve=n.renderBatchDelay)!=null?Ve:16);if(F=F!=null?Math.max(F,A):A,!tt){if(tt=!0,!M&&H&&window.requestIdleCallback){const Ie=Math.max(0,(Ke=n.renderBatchIdleTimeoutMs)!=null?Ke:120);O=window.requestIdleCallback(ot=>{S(ot)},{timeout:Ie});return}if(!h||M){We=window.setTimeout(()=>S(),ke);return}De=h(()=>{if(ke===0){S();return}We=window.setTimeout(()=>S(),ke)})}}function It(){const f=$.value?Math.max(1,Math.round(E.value)):Math.max(1,_.value);Vt(f)}function Ft(f){var S;if(!$.value)return;const p=Math.max(2,(S=n.renderBatchBudgetMs)!=null?S:6),x=Math.max(1,_.value||1),A=Math.max(1,Math.floor(x/4));f>p*1.2?E.value=Math.max(A,Math.floor(E.value*.7)):f<p*.5&&E.value<x&&(E.value=Math.min(x,Math.ceil(E.value*1.2)))}e.watch([()=>d.value,()=>d.value.length,()=>$.value,()=>_.value,()=>z.value,()=>n.renderBatchDelay,()=>n.indexKey],()=>{var pt;const p=d.value.length,x=ae.value,A=n.indexKey,S=A!==void 0?A!==x.key:p!==x.total;ae.value={key:A,total:p};const ke=D.value,Ve=(pt=n.renderBatchDelay)!=null?pt:16,Ke=ke.batchSize!==_.value||ke.initial!==z.value||ke.delay!==Ve||ke.enabled!==$.value;D.value={batchSize:_.value,initial:z.value,delay:Ve,enabled:$.value},(S||Ke||!$.value)&&St(),(S||Ke)&&(E.value=Math.max(1,_.value||1));const Ie=I.value;if(!p){T.value=0,B();return}if(!$.value){T.value=Ie,B();return}S||Ke?T.value=Math.min(Ie,z.value):T.value=Math.min(T.value,Ie);const ot=Math.max(1,z.value||_.value||p);T.value<Ie?Vt(ot,{immediate:!g}):B()},{immediate:!0}),e.watch(()=>pe.value,f=>{if(!f){for(const p of X.values())p.destroy();X.clear();for(const p of Object.keys(G))delete G[p];for(const[p,x]of P)x&&J(p,!0);return}for(const[p,x]of P)et(p,x)},{immediate:!1}),e.watch(()=>T.value,(f,p)=>{K.value&&(typeof p=="number"&&f<=p||f>0&&($e.value=f-1))}),e.watch([$e,je,Pe,()=>d.value.length,K],()=>{Me()},{immediate:!0}),e.watch(()=>I.value,(f,p)=>{$.value&&(typeof p=="number"&&f<=p||f>T.value&&It())}),e.onBeforeUnmount(()=>{St();for(const f of X.values())f.destroy();X.clear()});const Ot=e.defineAsyncComponent(()=>V(null,null,function*(){try{return(yield Promise.resolve().then(()=>require("./index-JoDqKzfX.cjs"))).default}catch(f){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".',f),dt}})),mt=e.computed(()=>n.renderCodeBlocksAsPre?dt:Ot),sn={text:te,paragraph:Mt,heading:ln,code_block:Ot,list:Bt,blockquote:wt,table:Ct,definition_list:yt,footnote:xt,footnote_reference:ce,footnote_anchor:st,admonition:Nt,hardbreak:Ue,link:he,image:Xe,thematic_break:Et,math_inline:He,math_block:Go,strong:me,emphasis:Te,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,checkbox:Le,checkbox_input:Le,inline_code:de,reference:ue,html_block:xa};function nt(f){var x;if(!f)return In;const p=Ne(n.customId)[String(f.type)];if(p)return p;if(f.type==="code_block"){if(String((x=f.language)!=null?x:"").trim().toLowerCase()==="mermaid")return Ne(n.customId).mermaid||ct;const S=Ne(n.customId).code_block;return S||mt.value}return sn[String(f.type)]||In}function ft(f){var p;return(f==null?void 0:f.type)==="code_block"&&String((p=f.language)!=null?p:"").trim().toLowerCase()==="mermaid"?{}:f.type==="code_block"?Z({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,monacoOptions:n.codeBlockMonacoOptions,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},n.codeBlockProps||{}):{typewriter:n.typewriter}}function ze(f){s("click",f)}function _t(f){var x;(x=f.target)!=null&&x.closest("[data-node-index]")&&s("mouseover",f)}function Xt(f){var x;(x=f.target)!=null&&x.closest("[data-node-index]")&&s("mouseout",f)}return(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:r,class:"markdown-renderer",onClick:ze,onMouseover:_t,onMouseout:Xt},[K.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"node-spacer",style:e.normalizeStyle({height:`${w.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,x=>{var A;return e.openBlock(),e.createElementBlock("div",{key:x.index,ref_for:!0,ref:S=>et(x.index,S),class:"node-slot","data-node-index":x.index,"data-node-type":x.node.type},[Qe(x.index)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_for:!0,ref:S=>$t(x.index,S),class:"node-content"},[x.node.type!=="code_block"&&n.typewriter!==!1?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"typewriter",appear:""},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nt(x.node)),e.mergeProps({node:x.node,loading:x.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${x.index}`},{ref_for:!0},ft(x.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:p[0]||(p[0]=S=>s("copy",S)),onHandleArtifactClick:p[1]||(p[1]=S=>s("handleArtifactClick",S))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nt(x.node)),e.mergeProps({key:1,node:x.node,loading:x.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${x.index}`},{ref_for:!0},ft(x.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:p[2]||(p[2]=S=>s("copy",S)),onHandleArtifactClick:p[3]||(p[3]=S=>s("handleArtifactClick",S))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"node-placeholder",style:e.normalizeStyle({height:`${(A=Ae[x.index])!=null?A:ne.value}px`})},null,4))],8,Ba)}),128)),K.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"node-spacer",style:e.normalizeStyle({height:`${k.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0)],544))}}),Ee=R(Ma,[["__scopeId","data-v-ec898fde"]]);Ee.install=t=>{var n,s;const o=(s=(n=Ee.__name)!=null?n:Ee.name)!=null?s:"NodeRenderer";t.component(o,Ee)};const Ca={key:0,class:"admonition-icon"},Ea={class:"admonition-title"},Na=["aria-expanded","aria-controls","title"],Ta={key:0},$a={key:1},Sa=["id"],Va=e.defineComponent({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean}},emits:["copy"],setup(t,{emit:o}){var d;const n=t,s=o,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},l=e.computed(()=>{if(n.node.title&&n.node.title.trim().length)return n.node.title;const g=n.node.kind||"note";return g.charAt(0).toUpperCase()+g.slice(1)}),i=e.ref(n.node.collapsible?!((d=n.node.open)==null||d):!1);function v(){n.node.collapsible&&(i.value=!i.value)}const m=`admonition-${Math.random().toString(36).slice(2,9)}`;return(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["admonition",[`admonition-${n.node.kind}`,n.isDark?"is-dark":""]])},[e.createElementVNode("div",{id:m,class:"admonition-header"},[r[n.node.kind]?(e.openBlock(),e.createElementBlock("span",Ca,e.toDisplayString(r[n.node.kind]),1)):e.createCommentVNode("",!0),e.createElementVNode("span",Ea,e.toDisplayString(l.value),1),n.node.collapsible?(e.openBlock(),e.createElementBlock("button",{key:1,class:"admonition-toggle","aria-expanded":!i.value,"aria-controls":`${m}-content`,title:i.value?"Expand":"Collapse",onClick:v},[i.value?(e.openBlock(),e.createElementBlock("span",Ta,"▶")):(e.openBlock(),e.createElementBlock("span",$a,"▼"))],8,Na)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("div",{id:`${m}-content`,class:"admonition-content","aria-labelledby":m},[e.withMemo([n.node.children],()=>e.createVNode(e.unref(Ee),{"index-key":`admonition-${t.indexKey}`,nodes:n.node.children,typewriter:n.typewriter,onCopy:h[0]||(h[0]=b=>s("copy",b))},null,8,["index-key","nodes","typewriter"]),h,1)],8,Sa),[[e.vShow,!i.value]])],2))}}),Nt=R(Va,[["__scopeId","data-v-578c25d2"]]);Nt.install=t=>{t.component(Nt.__name,Nt)};let _n=!1;function Ia(t){return V(this,null,function*(){if(!_n)return _n=!0,t.preloadMonacoWorkers()})}let Ht=null,Ln=!1;function _a(){return V(this,null,function*(){if(Ht)return Ht;if(Ln)return null;try{return Ht=yield import("stream-monaco"),yield Ia(Ht),Ht}catch(t){return Ln=!0,null}})}const La='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>',Da=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
5
+ `,-1))],10,sa))}});dt.install=t=>{t.component(dt.__name,dt)};const da={class:"table-node-wrapper"},ua=["aria-busy"],ma={class:"border-[var(--table-border,#cbd5e1)]"},fa={class:"border-b"},ha={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},pa=e.defineComponent({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>{var i,v,m,d;return(d=(m=(v=(i=o.node)==null?void 0:i.header)==null?void 0:v.cells)==null?void 0:m.length)!=null?d:0}),s=e.computed(()=>{const i=n.value||1,v=Math.floor(100/i);return Array.from({length:i}).map((m,d)=>d===i-1?`${100-v*(i-1)}%`:`${v}%`)}),r=e.computed(()=>{var i;return(i=o.node.loading)!=null?i:!1}),l=e.computed(()=>{var i;return(i=o.node.rows)!=null?i:[]});return(i,v)=>(e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("table",{class:e.normalizeClass(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":r.value}]),"aria-busy":r.value},[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(m,d)=>(e.openBlock(),e.createElementBlock("col",{key:`col-${d}`,style:e.normalizeStyle({width:m})},null,4))),128))]),e.createElementVNode("thead",ma,[e.createElementVNode("tr",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.header.cells,(m,d)=>(e.openBlock(),e.createElementBlock("th",{key:`header-${d}`,dir:"auto",class:e.normalizeClass(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",[m.align==="right"?"text-right":m.align==="center"?"text-center":"text-left"]])},[e.createVNode(e.unref(Ee),{nodes:m.children,"index-key":`table-th-${t.indexKey}`,typewriter:o.typewriter,onCopy:v[0]||(v[0]=g=>i.$emit("copy",g))},null,8,["nodes","index-key","typewriter"])],2))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(m,d)=>(e.openBlock(),e.createElementBlock("tr",{key:`row-${d}`,class:e.normalizeClass(["border-[var(--table-border,#cbd5e1)]",[d<l.value.length-1?"border-b":""]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.cells,(g,h)=>(e.openBlock(),e.createElementBlock("td",{key:`cell-${d}-${h}`,class:e.normalizeClass(["p-[calc(4/7*1em)] overflow-x-auto",[g.align==="right"?"text-right":g.align==="center"?"text-center":"text-left"]]),dir:"auto"},[e.createVNode(e.unref(Ee),{nodes:g.children,"index-key":`table-td-${t.indexKey}`,typewriter:o.typewriter,onCopy:v[1]||(v[1]=b=>i.$emit("copy",b))},null,8,["nodes","index-key","typewriter"])],2))),128))],2))),128))])],10,ua),e.createVNode(e.Transition,{name:"table-node-fade"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",ha,[e.renderSlot(i.$slots,"loading",{isLoading:r.value},()=>[v[2]||(v[2]=e.createElementVNode("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=e.createElementVNode("span",{class:"sr-only"},"Loading",-1))],!0)])):e.createCommentVNode("",!0)]),_:3})]))}}),Ct=R(pa,[["__scopeId","data-v-50ef14ca"]]);Ct.install=t=>{t.component(Ct.__name,Ct)};const va={},ga={class:"hr-node"};function ka(t,o){return e.openBlock(),e.createElementBlock("hr",ga)}const Et=R(va,[["render",ka],["__scopeId","data-v-639cbad9"]]);Et.install=t=>{t.component(Et.__name,Et)};const wa={key:1,class:"html-block-node__placeholder"},ya=e.defineComponent({__name:"HtmlBlockNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{const d=o.node.attrs;if(d){if(Array.isArray(d)){const g={};for(const h of d){if(!h||h.length<2)continue;const[b,M]=h;b!=null&&(g[String(b)]=M==null?"":String(M))}return g}return d}}),s=e.ref(null),r=e.ref(typeof window=="undefined"),l=e.ref(o.node.content),i=rn(),v=e.ref(null),m=!!o.node.loading;return typeof window!="undefined"?(e.watch(s,d=>{var h,b;if((b=(h=v.value)==null?void 0:h.destroy)==null||b.call(h),v.value=null,!m){r.value=!0,l.value=o.node.content;return}if(!d){r.value=!1;return}const g=i(d,{rootMargin:"400px"});v.value=g,r.value=g.isVisible.value,g.whenVisible.then(()=>{r.value=!0})},{immediate:!0}),e.watch(()=>o.node.content,d=>{(!m||r.value)&&(l.value=d)})):r.value=!0,e.onBeforeUnmount(()=>{var d,g;(g=(d=v.value)==null?void 0:d.destroy)==null||g.call(d),v.value=null}),(d,g)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"htmlRef",ref:s,class:"html-block-node"},n.value),[r.value?e.withMemo([l.value],()=>(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:l.value},null,8,["innerHTML"])),g,0):(e.openBlock(),e.createElementBlock("div",wa,[e.renderSlot(d.$slots,"placeholder",{node:t.node},()=>[g[1]||(g[1]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar"},null,-1)),g[2]||(g[2]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),g[3]||(g[3]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),xa=R(ya,[["__scopeId","data-v-ed22b926"]]),ba={class:"unknown-node"},In=e.defineComponent({__name:"FallbackComponent",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",ba,e.toDisplayString(t.node.raw),1))}}),Ba=["data-node-index","data-node-type"],Ma=e.defineComponent({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},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(t,{emit:o}){var Yt,ht,qt;const n=t,s=o,r=e.ref(),l=e.ref(n.viewportPriority!==!1),i=Ao(()=>r.value,l),v=vn.getMarkdown(),m=e.computed(()=>n.customMarkdownIt?n.customMarkdownIt(v):v),d=e.computed(()=>{var f;if((f=n.nodes)!=null&&f.length)return e.markRaw(n.nodes.slice());if(n.content){const p=vn.parseMarkdownToStructure(n.content,m.value,n.parseOptions);return e.markRaw(p)}return[]}),g=typeof window!="undefined",h=g&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,b=g&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,M=typeof globalThis!="undefined"&&typeof globalThis.process!="undefined"&&((ht=(Yt=globalThis.process)==null?void 0:Yt.env)==null?void 0:ht.NODE_ENV)==="test",H=g&&typeof window.requestIdleCallback=="function",_=e.computed(()=>{var p;const f=Math.trunc((p=n.renderBatchSize)!=null?p:80);return Number.isFinite(f)?Math.max(0,f):0}),z=e.computed(()=>{var p;const f=Math.trunc((p=n.initialRenderBatchSize)!=null?p:_.value);return Number.isFinite(f)?Math.max(0,f):_.value}),$=e.computed(()=>n.batchRendering!==!1&&_.value>0&&g&&!M),T=e.ref(0),ae=e.ref({key:n.indexKey,total:0}),D=e.ref({batchSize:_.value,initial:z.value,delay:(qt=n.renderBatchDelay)!=null?qt:16,enabled:$.value}),W=e.shallowRef([]),E=e.ref(Math.max(1,_.value||1)),G=e.reactive({}),X=new Map,P=new Map,pe=e.computed(()=>n.deferNodesUntilVisible!==!1&&l.value!==!1),K=e.computed(()=>{var f;return((f=n.maxLiveNodes)!=null?f:0)>0}),Ye=e.computed(()=>!!i&&(pe.value||K.value)),je=e.computed(()=>{var f;return Math.max(1,(f=n.maxLiveNodes)!=null?f:320)}),Pe=e.computed(()=>{var f;return Math.max(0,(f=n.liveNodeBuffer)!=null?f:60)}),$e=e.ref(0),U=e.reactive({start:0,end:0}),Y=new Map,I=e.computed(()=>{if(!K.value)return d.value.length;const f=Pe.value,p=Math.max(U.end+f,z.value),x=Math.min(d.value.length,p);return Math.max(T.value,x)});function le(f,p,x){return Math.min(Math.max(f,p),x)}function Me(){const f=d.value.length;if(!K.value||f===0){U.start=0,U.end=f;return}const p=Math.min(je.value,f),x=Pe.value,A=le($e.value-x,0,Math.max(0,f-p));U.start=A,U.end=Math.min(f,A+p)}const Ae=e.reactive({}),ve=e.reactive({total:0,count:0});function Je(f,p){if(!Number.isFinite(p)||p<=0)return;const x=Ae[f];Ae[f]=p,x?ve.total+=p-x:(ve.total+=p,ve.count++)}const ne=e.computed(()=>ve.count>0?Math.max(12,ve.total/ve.count):32);function ge(f,p){var A;if(f>=p)return 0;let x=0;for(let S=f;S<p;S++)x+=(A=Ae[S])!=null?A:ne.value;return x}const Se=e.computed(()=>{if(!K.value)return d.value.map((A,S)=>({node:A,index:S}));const f=d.value.length,p=le(U.start,0,f),x=le(U.end,p,f);return d.value.slice(p,x).map((A,S)=>({node:A,index:p+S}))}),w=e.computed(()=>K.value?ge(0,Math.min(U.start,d.value.length)):0),k=e.computed(()=>{if(!K.value)return 0;const f=d.value.length,p=Math.min(U.end,f);return ge(p,f)});function B(){const f=d.value.length,p=Math.min(f,T.value);if(p<=0){W.value=[],q(0);return}if(p>=f){W.value=d.value,q(p);return}W.value=d.value.slice(0,p),q(p)}function q(f){if(X.size)for(const[p,x]of X)p>=f&&(x.destroy(),X.delete(p),pe.value&&delete G[p],P.delete(p))}function J(f,p){pe.value&&(G[f]=p),p&&($e.value=le(f,0,Math.max(0,d.value.length-1)))}function Qe(f){return!pe.value||f<z.value?!0:G[f]===!0}function ie(f){const p=X.get(f);p&&(p.destroy(),X.delete(f))}function et(f,p){if(p?P.set(f,p):P.delete(f),!Ye.value||!i){ie(f),p?J(f,!0):pe.value&&delete G[f];return}if(f<z.value&&!K.value){ie(f),J(f,!0);return}if(!p){ie(f),pe.value&&delete G[f];return}ie(f);const x=i(p,{rootMargin:"400px"});x&&(X.set(f,x),J(f,x.isVisible.value),x.whenVisible.then(()=>{J(f,!0)}).catch(()=>{}))}function $t(f,p){if(!p){Y.delete(f);return}Y.set(f,p),queueMicrotask(()=>{Je(f,p.offsetHeight)})}let De=null,We=null,tt=!1,F=null,O=null;function St(){g&&(De!=null&&(b==null||b(De),De=null),We!=null&&(window.clearTimeout(We),We=null),O!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(O),O=null),tt=!1,F=null)}function Vt(f,p={}){var Ve,Ke;if(!$.value)return;const x=I.value;if(T.value>=x)return;const A=Math.max(1,f),S=Ie=>{var Dt;De=null,We=null,O=null,tt=!1;const ot=F!=null?F:A;F=null;const pt=Math.max(2,(Dt=n.renderBatchBudgetMs)!=null?Dt:6),cn=rt=>{const dn=typeof performance!="undefined"?performance.now():Date.now();T.value=Math.min(x,T.value+Math.max(1,rt)),B();const zt=(typeof performance!="undefined"?performance.now():Date.now())-dn;return Ft(zt),zt};let Lt=ot;for(;cn(Lt),!(T.value>=x||!Ie||(typeof Ie.timeRemaining=="function"?Ie.timeRemaining():0)<=pt*.5);)Lt=Math.max(1,Math.round(E.value));T.value<x&&It()};if(!g||p.immediate){S();return}const ke=Math.max(0,(Ve=n.renderBatchDelay)!=null?Ve:16);if(F=F!=null?Math.max(F,A):A,!tt){if(tt=!0,!M&&H&&window.requestIdleCallback){const Ie=Math.max(0,(Ke=n.renderBatchIdleTimeoutMs)!=null?Ke:120);O=window.requestIdleCallback(ot=>{S(ot)},{timeout:Ie});return}if(!h||M){We=window.setTimeout(()=>S(),ke);return}De=h(()=>{if(ke===0){S();return}We=window.setTimeout(()=>S(),ke)})}}function It(){const f=$.value?Math.max(1,Math.round(E.value)):Math.max(1,_.value);Vt(f)}function Ft(f){var S;if(!$.value)return;const p=Math.max(2,(S=n.renderBatchBudgetMs)!=null?S:6),x=Math.max(1,_.value||1),A=Math.max(1,Math.floor(x/4));f>p*1.2?E.value=Math.max(A,Math.floor(E.value*.7)):f<p*.5&&E.value<x&&(E.value=Math.min(x,Math.ceil(E.value*1.2)))}e.watch([()=>d.value,()=>d.value.length,()=>$.value,()=>_.value,()=>z.value,()=>n.renderBatchDelay,()=>n.indexKey],()=>{var pt;const p=d.value.length,x=ae.value,A=n.indexKey,S=A!==void 0?A!==x.key:p!==x.total;ae.value={key:A,total:p};const ke=D.value,Ve=(pt=n.renderBatchDelay)!=null?pt:16,Ke=ke.batchSize!==_.value||ke.initial!==z.value||ke.delay!==Ve||ke.enabled!==$.value;D.value={batchSize:_.value,initial:z.value,delay:Ve,enabled:$.value},(S||Ke||!$.value)&&St(),(S||Ke)&&(E.value=Math.max(1,_.value||1));const Ie=I.value;if(!p){T.value=0,B();return}if(!$.value){T.value=Ie,B();return}S||Ke?T.value=Math.min(Ie,z.value):T.value=Math.min(T.value,Ie);const ot=Math.max(1,z.value||_.value||p);T.value<Ie?Vt(ot,{immediate:!g}):B()},{immediate:!0}),e.watch(()=>pe.value,f=>{if(!f){for(const p of X.values())p.destroy();X.clear();for(const p of Object.keys(G))delete G[p];for(const[p,x]of P)x&&J(p,!0);return}for(const[p,x]of P)et(p,x)},{immediate:!1}),e.watch(()=>T.value,(f,p)=>{K.value&&(typeof p=="number"&&f<=p||f>0&&($e.value=f-1))}),e.watch([$e,je,Pe,()=>d.value.length,K],()=>{Me()},{immediate:!0}),e.watch(()=>I.value,(f,p)=>{$.value&&(typeof p=="number"&&f<=p||f>T.value&&It())}),e.onBeforeUnmount(()=>{St();for(const f of X.values())f.destroy();X.clear()});const Ot=e.defineAsyncComponent(()=>V(null,null,function*(){try{return(yield Promise.resolve().then(()=>require("./index-IDe4W9b6.cjs"))).default}catch(f){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".',f),dt}})),mt=e.computed(()=>n.renderCodeBlocksAsPre?dt:Ot),sn={text:te,paragraph:Mt,heading:ln,code_block:Ot,list:Bt,blockquote:wt,table:Ct,definition_list:yt,footnote:xt,footnote_reference:ce,footnote_anchor:st,admonition:Nt,hardbreak:Ue,link:he,image:Xe,thematic_break:Et,math_inline:He,math_block:Go,strong:me,emphasis:Te,strikethrough:fe,highlight:Be,insert:be,subscript:xe,superscript:ye,emoji:se,checkbox:Le,checkbox_input:Le,inline_code:de,reference:ue,html_block:xa};function nt(f){var x;if(!f)return In;const p=Ne(n.customId)[String(f.type)];if(p)return p;if(f.type==="code_block"){if(String((x=f.language)!=null?x:"").trim().toLowerCase()==="mermaid")return Ne(n.customId).mermaid||ct;const S=Ne(n.customId).code_block;return S||mt.value}return sn[String(f.type)]||In}function ft(f){var p;return(f==null?void 0:f.type)==="code_block"&&String((p=f.language)!=null?p:"").trim().toLowerCase()==="mermaid"?{}:f.type==="code_block"?Z({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,monacoOptions:n.codeBlockMonacoOptions,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},n.codeBlockProps||{}):{typewriter:n.typewriter}}function ze(f){s("click",f)}function _t(f){var x;(x=f.target)!=null&&x.closest("[data-node-index]")&&s("mouseover",f)}function Xt(f){var x;(x=f.target)!=null&&x.closest("[data-node-index]")&&s("mouseout",f)}return(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:r,class:"markdown-renderer",onClick:ze,onMouseover:_t,onMouseout:Xt},[K.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"node-spacer",style:e.normalizeStyle({height:`${w.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,x=>{var A;return e.openBlock(),e.createElementBlock("div",{key:x.index,ref_for:!0,ref:S=>et(x.index,S),class:"node-slot","data-node-index":x.index,"data-node-type":x.node.type},[Qe(x.index)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_for:!0,ref:S=>$t(x.index,S),class:"node-content"},[x.node.type!=="code_block"&&n.typewriter!==!1?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"typewriter",appear:""},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nt(x.node)),e.mergeProps({node:x.node,loading:x.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${x.index}`},{ref_for:!0},ft(x.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:p[0]||(p[0]=S=>s("copy",S)),onHandleArtifactClick:p[1]||(p[1]=S=>s("handleArtifactClick",S))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nt(x.node)),e.mergeProps({key:1,node:x.node,loading:x.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${x.index}`},{ref_for:!0},ft(x.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:p[2]||(p[2]=S=>s("copy",S)),onHandleArtifactClick:p[3]||(p[3]=S=>s("handleArtifactClick",S))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"node-placeholder",style:e.normalizeStyle({height:`${(A=Ae[x.index])!=null?A:ne.value}px`})},null,4))],8,Ba)}),128)),K.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"node-spacer",style:e.normalizeStyle({height:`${k.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0)],544))}}),Ee=R(Ma,[["__scopeId","data-v-67bd5de6"]]);Ee.install=t=>{var n,s;const o=(s=(n=Ee.__name)!=null?n:Ee.name)!=null?s:"NodeRenderer";t.component(o,Ee)};const Ca={key:0,class:"admonition-icon"},Ea={class:"admonition-title"},Na=["aria-expanded","aria-controls","title"],Ta={key:0},$a={key:1},Sa=["id"],Va=e.defineComponent({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean}},emits:["copy"],setup(t,{emit:o}){var d;const n=t,s=o,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},l=e.computed(()=>{if(n.node.title&&n.node.title.trim().length)return n.node.title;const g=n.node.kind||"note";return g.charAt(0).toUpperCase()+g.slice(1)}),i=e.ref(n.node.collapsible?!((d=n.node.open)==null||d):!1);function v(){n.node.collapsible&&(i.value=!i.value)}const m=`admonition-${Math.random().toString(36).slice(2,9)}`;return(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["admonition",[`admonition-${n.node.kind}`,n.isDark?"is-dark":""]])},[e.createElementVNode("div",{id:m,class:"admonition-header"},[r[n.node.kind]?(e.openBlock(),e.createElementBlock("span",Ca,e.toDisplayString(r[n.node.kind]),1)):e.createCommentVNode("",!0),e.createElementVNode("span",Ea,e.toDisplayString(l.value),1),n.node.collapsible?(e.openBlock(),e.createElementBlock("button",{key:1,class:"admonition-toggle","aria-expanded":!i.value,"aria-controls":`${m}-content`,title:i.value?"Expand":"Collapse",onClick:v},[i.value?(e.openBlock(),e.createElementBlock("span",Ta,"▶")):(e.openBlock(),e.createElementBlock("span",$a,"▼"))],8,Na)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("div",{id:`${m}-content`,class:"admonition-content","aria-labelledby":m},[e.withMemo([n.node.children],()=>e.createVNode(e.unref(Ee),{"index-key":`admonition-${t.indexKey}`,nodes:n.node.children,typewriter:n.typewriter,onCopy:h[0]||(h[0]=b=>s("copy",b))},null,8,["index-key","nodes","typewriter"]),h,1)],8,Sa),[[e.vShow,!i.value]])],2))}}),Nt=R(Va,[["__scopeId","data-v-578c25d2"]]);Nt.install=t=>{t.component(Nt.__name,Nt)};let _n=!1;function Ia(t){return V(this,null,function*(){if(!_n)return _n=!0,t.preloadMonacoWorkers()})}let Ht=null,Ln=!1;function _a(){return V(this,null,function*(){if(Ht)return Ht;if(Ln)return null;try{return Ht=yield import("stream-monaco"),yield Ia(Ht),Ht}catch(t){return Ln=!0,null}})}const La='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>',Da=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
6
6
  <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M14.4561802 11.3673353C13.0276218 14.1261537 11.8858593 15.5 10.8437759 15.5 10.3588459 15.5 9.88231005 15.3491298 9.41749082 15.0543006 8.74000639 14.6241577 7.8668418 14.6059458 7.17068967 15.0074382 6.60881451 15.3319356 6.07177167 15.5 5.56305868 15.5 4.02887542 15.5 1.5 10.9491129 1.5 8.45090396 1.5 5.78581061 2.95006811 3.551507 5.15647301 3.551507 6.19383481 3.551507 7.09007204 4.20001691 7.84308619 4.497206 8.16210316 4.62512517 8.52255587 4.61592787 8.83410596 4.47192 9.44477141 4.18872223 10.2497236 3.551507 11.2503615 3.551507 12.4715175 3.551507 13.5338865 4.33779342 14.4184071 5.47479877 14.5532906 5.64778615 14.5172013 5.89341518 14.3377895 6.02349446 13.3500923 6.736546 12.8746057 7.53893969 12.8746057 8.45090396 12.8746057 9.36404821 13.3502672 10.1652619 14.3377895 10.8793249 14.4946576 10.992887 14.5445377 11.1984946 14.4561802 11.3673353ZM8.5 3C8.5 3 8.3468635 1.3936039 10 1" />
7
7
  </svg>
8
8
  `,za=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
@@ -244,4 +244,4 @@
244
244
  `,Rl=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
245
245
  <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />
246
246
  </svg>
247
- `;let yn=null;function Gn(t){yn=t!=null?t:null}function Jn(t){if(yn){const o=yn(t);if(o!=null&&o!=="")return o}switch(t){case"javascript":case"js":return nl;case"typescript":case"ts":return _l;case"jsx":return tl;case"tsx":return Il;case"html":return Qa;case"css":return Ka;case"scss":return bl;case"json":return ol;case"python":case"py":return kl;case"ruby":case"rb":return yl;case"go":case"golang":return Za;case"r":return wl;case"java":return el;case"kotlin":case"kt":return al;case"c":return Ra;case"cpp":case"c++":return Pa;case"cs":case"csharp":return Wa;case"php":return vl;case"scala":return Bl;case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return Ml;case"sql":return El;case"yaml":case"yml":return Rl;case"markdown":case"md":return sl;case"xml":return zl;case"rust":case"rs":return xl;case"swift":return $l;case"perl":return pl;case"lua":return il;case"haskell":return Ja;case"erlang":return qa;case"clojure":return Ha;case"vue":return Dl;case"svg":return Tl;case"mermaid":return dl;case"dart":return Fa;case"assembly":return za;case"dockerfile":return Xa;case"fortran":return Ua;case"lisp":return ll;case"ocaml":return hl;case"prolog":return gl;case"groovy":return Ga;case"matlab":return cl;case"cobol":return ja;case"ada":return La;case"julia":return rl;case"elixir":return Ya;case"vb.net":return Ll;case"nim":return ul;case"crystal":return Aa;case"d":return Oa;case"applescript":return Da;case"solidity":return Cl;case"objectivec":return ml;case"objectivecpp":return fl;case"terraform":return Sl;case"plain":case"text":return Vl;default:return Nl}}const Qn={js:"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","":"Plain Text",plain:"Plain Text"},Hl={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)"}},jl={class:"flex items-center space-x-2"},Pl=["innerHTML"],Al={class:"text-sm font-medium font-mono"},Wl={class:"flex items-center space-x-2"},Kl=["aria-pressed"],Fl=["disabled"],Ol=["disabled"],Xl=["disabled"],Yl=["aria-label"],ql={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"},Ul={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"},Zl=["aria-pressed"],Gl={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"},Jl={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"},Ql=["aria-label"],ei={class:"code-loading-placeholder"},Dn=10,zn=36,Rn=1,ti=e.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:void 0},lightTheme:{default:void 0},isDark:{type:Boolean},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},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(t,{emit:o}){var Se;const n=t,s=o,{t:r}=on(),l=e.ref(String((Se=n.node.language)!=null?Se:"")),i=e.ref(!1),v=e.ref(!1),m=e.ref(!1),d=e.ref(null),g=e.ref(!0),h=e.ref(0),b=e.ref(14),M=e.ref(b.value),H=e.computed(()=>{const w=b.value,k=M.value;return typeof w=="number"&&Number.isFinite(w)&&w>0&&typeof k=="number"&&Number.isFinite(k)&&k>0}),_=e.computed(()=>{const w=l.value.trim().toLowerCase();return Qn[w]||w.charAt(0).toUpperCase()+w.slice(1)}),z=e.computed(()=>l.value.trim().toLowerCase()==="mermaid"),$=e.computed(()=>{const w=l.value.trim().toLowerCase();return Jn(w.split(":")[0])}),T=e.computed(()=>{const w=l.value.trim().toLowerCase();return n.isShowPreview&&(w==="html"||w==="svg")}),ae=e.computed(()=>{const w={},k=J=>{if(J!=null)return typeof J=="number"?`${J}px`:String(J)},B=k(n.minWidth),q=k(n.maxWidth);return B&&(w.minWidth=B),q&&(w.maxWidth=q),w}),D=e.computed(()=>({fontSize:`${M.value}px`}));function W(){return n.isDark?n.darkTheme:n.lightTheme}let E,G,X,P=()=>{};function pe(){return V(this,null,function*(){if(!G)try{const w=yield import("stream-markdown");if(G=w.createShikiStreamRenderer,X=w.registerHighlight,P=w.disposeHighlighter,X({themes:n.themes}),E=G(d.value,{theme:W()}),!n.loading){const k=l.value.split(":")[0].toLocaleLowerCase().trim();E.updateCode(n.node.code,k)}}catch(w){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",w)}})}function K(){return V(this,null,function*(){if(z.value){P(),E==null||E.dispose();return}pe()})}K(),e.onMounted(()=>{K()}),e.watch(()=>n.themes,()=>V(null,null,function*(){X&&X({themes:n.themes})})),e.watch(()=>[n.node.code,n.node.language],B=>V(null,[B],function*([w,k]){if(k!==l.value&&(l.value=k.trim()),!!d.value){if(z.value){P(),E==null||E.dispose();return}E||(yield K()),!(!E||!w)&&(n.stream===!1&&n.loading||(k=k.split(":")[0].toLocaleLowerCase().trim(),E.updateCode(w,k)))}}));const Ye=e.watch(()=>[n.darkTheme,n.lightTheme],()=>V(null,null,function*(){if(d.value){if(z.value)return P(),E==null||E.dispose(),Ye();E||(yield K()),E==null||E.setTheme(W())}}));e.watch(()=>n.node.code,()=>V(null,null,function*(){if(v.value||!g.value)return;yield e.nextTick();const w=d.value;w&&w.scrollHeight>w.clientHeight&&(w.scrollTop=w.scrollHeight)}));function je(w,k=50){return w.scrollHeight-w.scrollTop-w.clientHeight<=k}function Pe(){const w=d.value;if(!w||v.value)return;const k=w.scrollTop;k<h.value?g.value=!1:je(w)&&(g.value=!0),h.value=k}function $e(){return V(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n.node.code)),i.value=!0,s("copy",n.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(w){console.error("Copy failed:",w)}})}function U(w){const k=w;return!k||k.disabled}function Y(w,k,B="top"){if(U(w.currentTarget))return;const q=w,J=(q==null?void 0:q.clientX)!=null&&(q==null?void 0:q.clientY)!=null?{x:q.clientX,y:q.clientY}:void 0;Tt(w.currentTarget,k,B,!1,J,n.isDark)}function I(){nn()}function le(w){if(U(w.currentTarget))return;const k=i.value?r("common.copied")||"Copied":r("common.copy")||"Copy",B=w,q=(B==null?void 0:B.clientX)!=null&&(B==null?void 0:B.clientY)!=null?{x:B.clientX,y:B.clientY}:void 0;Tt(w.currentTarget,k,"top",!1,q,n.isDark)}function Me(){v.value=!v.value;const w=d.value;w&&(v.value?(w.style.maxHeight="none",w.style.overflow="visible"):(w.style.maxHeight="500px",w.style.overflow="auto",g.value=!0,e.nextTick(()=>{w.scrollHeight>w.clientHeight&&(w.scrollTop=w.scrollHeight)})))}function Ae(){m.value=!m.value}function ve(){const w=Math.min(zn,M.value+Rn);M.value=w}function Je(){const w=Math.max(Dn,M.value-Rn);M.value=w}function ne(){M.value=b.value}function ge(){if(!T.value)return;const w=(l.value||n.node.language).toLowerCase(),k=w==="html"?"text/html":"image/svg+xml",B=w==="html"?"HTML Preview":"SVG Preview";s("previewCode",{type:k,content:n.node.code,title:B})}return(w,k)=>z.value?(e.openBlock(),e.createBlock(e.unref(ct),{key:0,node:t.node,"is-dark":n.isDark,loading:n.loading},null,8,["node","is-dark","loading"])):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(ae.value),class:e.normalizeClass(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[n.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",n.isDark?"is-dark":""]])},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Hl,[e.renderSlot(w.$slots,"header-left",{},()=>[e.createElementVNode("div",jl,[e.createElementVNode("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:$.value},null,8,Pl),e.createElementVNode("span",Al,e.toDisplayString(_.value),1)])],!0),e.renderSlot(w.$slots,"header-right",{},()=>[e.createElementVNode("div",Wl,[e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":m.value,onClick:Ae,onMouseenter:k[0]||(k[0]=B=>Y(B,m.value?e.unref(r)("common.expand")||"Expand":e.unref(r)("common.collapse")||"Collapse")),onFocus:k[1]||(k[1]=B=>Y(B,m.value?e.unref(r)("common.expand")||"Expand":e.unref(r)("common.collapse")||"Collapse")),onMouseleave:I,onBlur:I},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:m.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"},[...k[17]||(k[17]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Kl),n.showFontSizeButtons&&n.enableFontSizeControl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:Number.isFinite(M.value)?M.value<=Dn:!1,onClick:k[2]||(k[2]=B=>Je()),onMouseenter:k[3]||(k[3]=B=>Y(B,e.unref(r)("common.decrease")||"Decrease")),onFocus:k[4]||(k[4]=B=>Y(B,e.unref(r)("common.decrease")||"Decrease")),onMouseleave:I,onBlur:I},[...k[18]||(k[18]=[e.createElementVNode("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"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Fl),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!H.value||M.value===b.value,onClick:k[5]||(k[5]=B=>ne()),onMouseenter:k[6]||(k[6]=B=>Y(B,e.unref(r)("common.reset")||"Reset")),onFocus:k[7]||(k[7]=B=>Y(B,e.unref(r)("common.reset")||"Reset")),onMouseleave:I,onBlur:I},[...k[19]||(k[19]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),e.createElementVNode("path",{d:"M3 3v5h5"})])],-1)])],40,Ol),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:Number.isFinite(M.value)?M.value>=zn:!1,onClick:k[8]||(k[8]=B=>ve()),onMouseenter:k[9]||(k[9]=B=>Y(B,e.unref(r)("common.increase")||"Increase")),onFocus:k[10]||(k[10]=B=>Y(B,e.unref(r)("common.increase")||"Increase")),onMouseleave:I,onBlur:I},[...k[20]||(k[20]=[e.createElementVNode("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"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Xl)],64)):e.createCommentVNode("",!0),n.showCopyButton?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":i.value?e.unref(r)("common.copied")||"Copied":e.unref(r)("common.copy")||"Copy",onClick:$e,onMouseenter:k[11]||(k[11]=B=>le(B)),onFocus:k[12]||(k[12]=B=>le(B)),onMouseleave:I,onBlur:I},[i.value?(e.openBlock(),e.createElementBlock("svg",Ul,[...k[22]||(k[22]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ql,[...k[21]||(k[21]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),e.createElementVNode("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,Yl)):e.createCommentVNode("",!0),n.showExpandButton?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":v.value,onClick:Me,onMouseenter:k[13]||(k[13]=B=>Y(B,v.value?e.unref(r)("common.collapse")||"Collapse":e.unref(r)("common.expand")||"Expand")),onFocus:k[14]||(k[14]=B=>Y(B,v.value?e.unref(r)("common.collapse")||"Collapse":e.unref(r)("common.expand")||"Expand")),onMouseleave:I,onBlur:I},[v.value?(e.openBlock(),e.createElementBlock("svg",Gl,[...k[23]||(k[23]=[e.createElementVNode("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)])])):(e.openBlock(),e.createElementBlock("svg",Jl,[...k[24]||(k[24]=[e.createElementVNode("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)])]))],40,Zl)):e.createCommentVNode("",!0),T.value&&n.showPreviewButton?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":e.unref(r)("common.preview")||"Preview",onClick:ge,onMouseenter:k[15]||(k[15]=B=>Y(B,e.unref(r)("common.preview")||"Preview")),onFocus:k[16]||(k[16]=B=>Y(B,e.unref(r)("common.preview")||"Preview")),onMouseleave:I,onBlur:I},[...k[25]||(k[25]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("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"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Ql)):e.createCommentVNode("",!0)])],!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:e.normalizeStyle(D.value),onScroll:Pe},null,36),[[e.vShow,!m.value&&(t.stream?!0:!t.loading)]]),e.withDirectives(e.createElementVNode("div",ei,[e.renderSlot(w.$slots,"loading",{loading:t.loading,stream:t.stream},()=>[k[26]||(k[26]=e.createElementVNode("div",{class:"loading-skeleton"},[e.createElementVNode("div",{class:"skeleton-line"}),e.createElementVNode("div",{class:"skeleton-line"}),e.createElementVNode("div",{class:"skeleton-line short"})],-1))],!0)],512),[[e.vShow,!t.stream&&t.loading]])],6))}}),Pt=R(ti,[["__scopeId","data-v-9201c1b9"]]);Pt.install=t=>{t.component(Pt.__name,Pt)};let _e=null,Ge=null,Hn=!1;const we=new Map,Fe=new Map,eo=200;let ut=5;const lt=new Set;function Kt(){if(we.size<ut&&lt.size){const t=Array.from(lt);lt.clear();for(const o of t)try{o()}catch(n){}}}let Re=null;function ni(t){_e=t,Ge=null,_e.onmessage=o=>{const{id:n,html:s,error:r}=o.data,l=we.get(n);if(l)if(we.delete(n),clearTimeout(l.timeoutId),Kt(),r)l.reject(new Error(r));else{const{content:i,displayMode:v}=o.data;if(i){const m=`${v?"d":"i"}:${i}`;if(Fe.set(m,s),Fe.size>eo){const d=Fe.keys().next().value;Fe.delete(d)}}l.resolve(s)}},_e.onerror=o=>{console.error("[katexWorkerClient] Worker error:",o);for(const[n,s]of we.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${o.message}`));we.clear(),Kt()}}function oi(){var t;_e&&((t=_e.terminate)==null||t.call(_e)),_e=null,Ge=null}function ri(){return _e||(Ge=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ge.name="WorkerInitError",Ge.code="WORKER_INIT_ERROR",null)}function ai(t){Hn=!!t,_e&&_e.postMessage({type:"init",debug:Hn})}function to(t,o=!0,n=2e3,s){return V(this,null,function*(){const r=performance.now();if(Ge)return Promise.reject(Ge);const l=`${o?"d":"i"}:${t}`,i=Fe.get(l);if(i)return Re&&Re.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!0}),Promise.resolve(i);const v=ri();if(!v)return Promise.reject(Ge);if(we.size>=ut){const m=new Error("Worker busy");return m.name="WorkerBusy",m.code="WORKER_BUSY",m.busy=!0,m.inFlight=we.size,m.max=ut,Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(m)}return new Promise((m,d)=>{if(s!=null&&s.aborted){const $=new Error("Aborted");$.name="AbortError",d($);return}const g=Math.random().toString(36).slice(2),h=globalThis.setTimeout(()=>{we.delete(g);const $=new Error("Worker render timed out");$.name="WorkerTimeout",$.code="WORKER_TIMEOUT",Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"timeout"}),d($),Kt()},n),b=()=>{globalThis.clearTimeout(h),we.has(g)&&we.delete(g);const $=new Error("Aborted");$.name="AbortError",d($),Kt()};s&&s.addEventListener("abort",b,{once:!0});const M=m,H=d,_=$=>{Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!0}),M($)},z=$=>{Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!1,error:($==null?void 0:$.message)||String($)}),H($)};we.set(g,{resolve:_,reject:z,timeoutId:h}),v.postMessage({id:g,content:t,displayMode:o})})})}function li(t,o=!0,n){const s=`${o?"d":"i"}:${t}`;if(Fe.set(s,n),Fe.size>eo){const r=Fe.keys().next().value;Fe.delete(r)}}function ii(){return{inFlight:we.size,max:ut}}function si(t){Number.isFinite(t)&&t>0&&(ut=Math.floor(t))}const no="WORKER_BUSY";function ci(){return we.size>=ut}function oo(t=2e3,o){return we.size<ut?Promise.resolve():new Promise((n,s)=>{let r=!1,l;const i=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),lt.delete(i),n())};if(lt.add(i),l=globalThis.setTimeout(()=>{if(r)return;r=!0,lt.delete(i);const v=new Error("Wait for worker slot timed out");v.name="WorkerBusyTimeout",v.code="WORKER_BUSY_TIMEOUT",s(v)},t),queueMicrotask(()=>Kt()),o){const v=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),lt.delete(i);const m=new Error("Aborted");m.name="AbortError",s(m)};o.aborted?v():o.addEventListener("abort",v,{once:!0})}})}const Oe={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function di(t){t.timeout!=null&&(Oe.timeout=Math.max(0,Math.floor(t.timeout))),t.waitTimeout!=null&&(Oe.waitTimeout=Math.max(0,Math.floor(t.waitTimeout))),t.backoffMs!=null&&(Oe.backoffMs=Math.max(0,Math.floor(t.backoffMs))),t.maxRetries!=null&&(Oe.maxRetries=Math.max(0,Math.floor(t.maxRetries)))}function ui(){return Z({},Oe)}function mi(s){return V(this,arguments,function*(t,o=!0,n={}){var g,h,b,M;const r=(g=n.timeout)!=null?g:Oe.timeout,l=(h=n.waitTimeout)!=null?h:Oe.waitTimeout,i=(b=n.backoffMs)!=null?b:Oe.backoffMs,v=(M=n.maxRetries)!=null?M:Oe.maxRetries,m=n.signal;let d=0;for(;;){if(m!=null&&m.aborted){const H=new Error("Aborted");throw H.name="AbortError",H}try{return yield to(t,o,r,m)}catch(H){if((H==null?void 0:H.code)!==no||d>=v)throw H;if(d++,yield oo(l,m).catch(()=>{}),m!=null&&m.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}i>0&&(yield new Promise(_=>globalThis.setTimeout(_,i*d)))}}})}const ro=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-JoDqKzfX.cjs"))),ao=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BPiQ08MX.cjs"))),lo=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BRnwZs4_.cjs"))),fi={AdmonitionNode:Nt,BlockquoteNode:wt,CheckboxNode:Le,CodeBlockNode:ro,DefinitionListNode:yt,EmojiNode:se,FootnoteNode:xt,FootnoteReferenceNode:ce,FootnoteAnchorNode:st,HardBreakNode:Ue,HeadingNode:ln,HighlightNode:Be,ImageNode:Xe,InlineCodeNode:de,PreCodeNode:dt,InsertNode:be,LinkNode:he,ListItemNode:bt,ListNode:Bt,MathBlockNode:ao,MathInlineNode:lo,MermaidBlockNode:ct,ParagraphNode:Mt,StrikethroughNode:fe,StrongNode:me,SubscriptNode:xe,SuperscriptNode:ye,TableNode:Ct,TextNode:te,ThematicBreakNode:Et,ReferenceNode:ue,MarkdownCodeBlockNode:Pt},hi={install(t,o){Object.entries(fi).forEach(([n,s])=>{t.component(n,s)}),o!=null&&o.getLanguageIcon&&Gn(o.getLanguageIcon),o!=null&&o.mathOptions&&vn.setDefaultMathOptions(o.mathOptions)}};exports.AdmonitionNode=Nt;exports.BlockquoteNode=wt;exports.CheckboxNode=Le;exports.CodeBlockNode=ro;exports.DefinitionListNode=yt;exports.EmojiNode=se;exports.FootnoteAnchorNode=st;exports.FootnoteReferenceNode=ce;exports.HardBreakNode=Ue;exports.HighlightNode=Be;exports.ImageNode=Xe;exports.InsertNode=be;exports.LinkNode=he;exports.ListItemNode=bt;exports.ListNode=Bt;exports.MERMAID_WORKER_BUSY_CODE=Yn;exports.MarkdownCodeBlockNode=Pt;exports.MathBlockNode=ao;exports.MathInlineNode=lo;exports.MermaidBlockNode=ct;exports.NodeRenderer=Ee;exports.ParagraphNode=Mt;exports.StrikethroughNode=fe;exports.StrongNode=me;exports.SubscriptNode=xe;exports.SuperscriptNode=ye;exports.TableNode=Ct;exports.TextNode=te;exports.ThematicBreakNode=Et;exports.VueRendererMarkdown=hi;exports.WORKER_BUSY_CODE=no;exports._HeadingNode=ln;exports._export_sfc=R;exports._sfc_main=dt;exports._sfc_main$1=xt;exports._sfc_main$2=de;exports._sfc_main$3=ue;exports.canParseOffthread=Un;exports.clearGlobalCustomComponents=So;exports.clearKaTeXWorker=oi;exports.clearMermaidWorker=Dr;exports.findPrefixOffthread=Zn;exports.getCustomNodeComponents=Ne;exports.getKaTeXBackpressureDefaults=ui;exports.getKaTeXWorkerLoad=ii;exports.getKatex=an;exports.getLanguageIcon=Jn;exports.getMermaidWorkerLoad=_r;exports.getUseMonaco=_a;exports.hideTooltip=nn;exports.isKaTeXWorkerBusy=ci;exports.languageMap=Qn;exports.removeCustomComponents=$o;exports.renderKaTeXInWorker=to;exports.renderKaTeXWithBackpressure=mi;exports.safeRaf=Xn;exports.setCustomComponents=To;exports.setDefaultI18nMap=Po;exports.setKaTeXBackpressureDefaults=di;exports.setKaTeXCache=li;exports.setKaTeXWorker=ni;exports.setKaTeXWorkerDebug=ai;exports.setKaTeXWorkerMaxConcurrency=si;exports.setLanguageIconResolver=Gn;exports.setMermaidWorker=Lr;exports.setMermaidWorkerClientDebug=Vr;exports.setMermaidWorkerMaxConcurrency=Ir;exports.showTooltipForAnchor=Tt;exports.terminateWorker=wn;exports.useSafeI18n=on;exports.useViewportPriority=rn;exports.waitForKaTeXWorkerSlot=oo;
247
+ `;let yn=null;function Gn(t){yn=t!=null?t:null}function Jn(t){if(yn){const o=yn(t);if(o!=null&&o!=="")return o}switch(t){case"javascript":case"js":return nl;case"typescript":case"ts":return _l;case"jsx":return tl;case"tsx":return Il;case"html":return Qa;case"css":return Ka;case"scss":return bl;case"json":return ol;case"python":case"py":return kl;case"ruby":case"rb":return yl;case"go":case"golang":return Za;case"r":return wl;case"java":return el;case"kotlin":case"kt":return al;case"c":return Ra;case"cpp":case"c++":return Pa;case"cs":case"csharp":return Wa;case"php":return vl;case"scala":return Bl;case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return Ml;case"sql":return El;case"yaml":case"yml":return Rl;case"markdown":case"md":return sl;case"xml":return zl;case"rust":case"rs":return xl;case"swift":return $l;case"perl":return pl;case"lua":return il;case"haskell":return Ja;case"erlang":return qa;case"clojure":return Ha;case"vue":return Dl;case"svg":return Tl;case"mermaid":return dl;case"dart":return Fa;case"assembly":return za;case"dockerfile":return Xa;case"fortran":return Ua;case"lisp":return ll;case"ocaml":return hl;case"prolog":return gl;case"groovy":return Ga;case"matlab":return cl;case"cobol":return ja;case"ada":return La;case"julia":return rl;case"elixir":return Ya;case"vb.net":return Ll;case"nim":return ul;case"crystal":return Aa;case"d":return Oa;case"applescript":return Da;case"solidity":return Cl;case"objectivec":return ml;case"objectivecpp":return fl;case"terraform":return Sl;case"plain":case"text":return Vl;default:return Nl}}const Qn={js:"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","":"Plain Text",plain:"Plain Text"},Hl={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)"}},jl={class:"flex items-center space-x-2"},Pl=["innerHTML"],Al={class:"text-sm font-medium font-mono"},Wl={class:"flex items-center space-x-2"},Kl=["aria-pressed"],Fl=["disabled"],Ol=["disabled"],Xl=["disabled"],Yl=["aria-label"],ql={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"},Ul={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"},Zl=["aria-pressed"],Gl={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"},Jl={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"},Ql=["aria-label"],ei={class:"code-loading-placeholder"},Dn=10,zn=36,Rn=1,ti=e.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:void 0},lightTheme:{default:void 0},isDark:{type:Boolean},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},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(t,{emit:o}){var Se;const n=t,s=o,{t:r}=on(),l=e.ref(String((Se=n.node.language)!=null?Se:"")),i=e.ref(!1),v=e.ref(!1),m=e.ref(!1),d=e.ref(null),g=e.ref(!0),h=e.ref(0),b=e.ref(14),M=e.ref(b.value),H=e.computed(()=>{const w=b.value,k=M.value;return typeof w=="number"&&Number.isFinite(w)&&w>0&&typeof k=="number"&&Number.isFinite(k)&&k>0}),_=e.computed(()=>{const w=l.value.trim().toLowerCase();return Qn[w]||w.charAt(0).toUpperCase()+w.slice(1)}),z=e.computed(()=>l.value.trim().toLowerCase()==="mermaid"),$=e.computed(()=>{const w=l.value.trim().toLowerCase();return Jn(w.split(":")[0])}),T=e.computed(()=>{const w=l.value.trim().toLowerCase();return n.isShowPreview&&(w==="html"||w==="svg")}),ae=e.computed(()=>{const w={},k=J=>{if(J!=null)return typeof J=="number"?`${J}px`:String(J)},B=k(n.minWidth),q=k(n.maxWidth);return B&&(w.minWidth=B),q&&(w.maxWidth=q),w}),D=e.computed(()=>({fontSize:`${M.value}px`}));function W(){return n.isDark?n.darkTheme:n.lightTheme}let E,G,X,P=()=>{};function pe(){return V(this,null,function*(){if(!G)try{const w=yield import("stream-markdown");if(G=w.createShikiStreamRenderer,X=w.registerHighlight,P=w.disposeHighlighter,X({themes:n.themes}),E=G(d.value,{theme:W()}),!n.loading){const k=l.value.split(":")[0].toLocaleLowerCase().trim();E.updateCode(n.node.code,k)}}catch(w){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",w)}})}function K(){return V(this,null,function*(){if(z.value){P(),E==null||E.dispose();return}pe()})}K(),e.onMounted(()=>{K()}),e.watch(()=>n.themes,()=>V(null,null,function*(){X&&X({themes:n.themes})})),e.watch(()=>[n.node.code,n.node.language],B=>V(null,[B],function*([w,k]){if(k!==l.value&&(l.value=k.trim()),!!d.value){if(z.value){P(),E==null||E.dispose();return}E||(yield K()),!(!E||!w)&&(n.stream===!1&&n.loading||(k=k.split(":")[0].toLocaleLowerCase().trim(),E.updateCode(w,k)))}}));const Ye=e.watch(()=>[n.darkTheme,n.lightTheme],()=>V(null,null,function*(){if(d.value){if(z.value)return P(),E==null||E.dispose(),Ye();E||(yield K()),E==null||E.setTheme(W())}}));e.watch(()=>n.node.code,()=>V(null,null,function*(){if(v.value||!g.value)return;yield e.nextTick();const w=d.value;w&&w.scrollHeight>w.clientHeight&&(w.scrollTop=w.scrollHeight)}));function je(w,k=50){return w.scrollHeight-w.scrollTop-w.clientHeight<=k}function Pe(){const w=d.value;if(!w||v.value)return;const k=w.scrollTop;k<h.value?g.value=!1:je(w)&&(g.value=!0),h.value=k}function $e(){return V(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n.node.code)),i.value=!0,s("copy",n.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(w){console.error("Copy failed:",w)}})}function U(w){const k=w;return!k||k.disabled}function Y(w,k,B="top"){if(U(w.currentTarget))return;const q=w,J=(q==null?void 0:q.clientX)!=null&&(q==null?void 0:q.clientY)!=null?{x:q.clientX,y:q.clientY}:void 0;Tt(w.currentTarget,k,B,!1,J,n.isDark)}function I(){nn()}function le(w){if(U(w.currentTarget))return;const k=i.value?r("common.copied")||"Copied":r("common.copy")||"Copy",B=w,q=(B==null?void 0:B.clientX)!=null&&(B==null?void 0:B.clientY)!=null?{x:B.clientX,y:B.clientY}:void 0;Tt(w.currentTarget,k,"top",!1,q,n.isDark)}function Me(){v.value=!v.value;const w=d.value;w&&(v.value?(w.style.maxHeight="none",w.style.overflow="visible"):(w.style.maxHeight="500px",w.style.overflow="auto",g.value=!0,e.nextTick(()=>{w.scrollHeight>w.clientHeight&&(w.scrollTop=w.scrollHeight)})))}function Ae(){m.value=!m.value}function ve(){const w=Math.min(zn,M.value+Rn);M.value=w}function Je(){const w=Math.max(Dn,M.value-Rn);M.value=w}function ne(){M.value=b.value}function ge(){if(!T.value)return;const w=(l.value||n.node.language).toLowerCase(),k=w==="html"?"text/html":"image/svg+xml",B=w==="html"?"HTML Preview":"SVG Preview";s("previewCode",{type:k,content:n.node.code,title:B})}return(w,k)=>z.value?(e.openBlock(),e.createBlock(e.unref(ct),{key:0,node:t.node,"is-dark":n.isDark,loading:n.loading},null,8,["node","is-dark","loading"])):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(ae.value),class:e.normalizeClass(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[n.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",n.isDark?"is-dark":""]])},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Hl,[e.renderSlot(w.$slots,"header-left",{},()=>[e.createElementVNode("div",jl,[e.createElementVNode("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:$.value},null,8,Pl),e.createElementVNode("span",Al,e.toDisplayString(_.value),1)])],!0),e.renderSlot(w.$slots,"header-right",{},()=>[e.createElementVNode("div",Wl,[e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":m.value,onClick:Ae,onMouseenter:k[0]||(k[0]=B=>Y(B,m.value?e.unref(r)("common.expand")||"Expand":e.unref(r)("common.collapse")||"Collapse")),onFocus:k[1]||(k[1]=B=>Y(B,m.value?e.unref(r)("common.expand")||"Expand":e.unref(r)("common.collapse")||"Collapse")),onMouseleave:I,onBlur:I},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:m.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"},[...k[17]||(k[17]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Kl),n.showFontSizeButtons&&n.enableFontSizeControl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:Number.isFinite(M.value)?M.value<=Dn:!1,onClick:k[2]||(k[2]=B=>Je()),onMouseenter:k[3]||(k[3]=B=>Y(B,e.unref(r)("common.decrease")||"Decrease")),onFocus:k[4]||(k[4]=B=>Y(B,e.unref(r)("common.decrease")||"Decrease")),onMouseleave:I,onBlur:I},[...k[18]||(k[18]=[e.createElementVNode("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"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Fl),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!H.value||M.value===b.value,onClick:k[5]||(k[5]=B=>ne()),onMouseenter:k[6]||(k[6]=B=>Y(B,e.unref(r)("common.reset")||"Reset")),onFocus:k[7]||(k[7]=B=>Y(B,e.unref(r)("common.reset")||"Reset")),onMouseleave:I,onBlur:I},[...k[19]||(k[19]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),e.createElementVNode("path",{d:"M3 3v5h5"})])],-1)])],40,Ol),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:Number.isFinite(M.value)?M.value>=zn:!1,onClick:k[8]||(k[8]=B=>ve()),onMouseenter:k[9]||(k[9]=B=>Y(B,e.unref(r)("common.increase")||"Increase")),onFocus:k[10]||(k[10]=B=>Y(B,e.unref(r)("common.increase")||"Increase")),onMouseleave:I,onBlur:I},[...k[20]||(k[20]=[e.createElementVNode("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"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Xl)],64)):e.createCommentVNode("",!0),n.showCopyButton?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":i.value?e.unref(r)("common.copied")||"Copied":e.unref(r)("common.copy")||"Copy",onClick:$e,onMouseenter:k[11]||(k[11]=B=>le(B)),onFocus:k[12]||(k[12]=B=>le(B)),onMouseleave:I,onBlur:I},[i.value?(e.openBlock(),e.createElementBlock("svg",Ul,[...k[22]||(k[22]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ql,[...k[21]||(k[21]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),e.createElementVNode("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,Yl)):e.createCommentVNode("",!0),n.showExpandButton?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":v.value,onClick:Me,onMouseenter:k[13]||(k[13]=B=>Y(B,v.value?e.unref(r)("common.collapse")||"Collapse":e.unref(r)("common.expand")||"Expand")),onFocus:k[14]||(k[14]=B=>Y(B,v.value?e.unref(r)("common.collapse")||"Collapse":e.unref(r)("common.expand")||"Expand")),onMouseleave:I,onBlur:I},[v.value?(e.openBlock(),e.createElementBlock("svg",Gl,[...k[23]||(k[23]=[e.createElementVNode("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)])])):(e.openBlock(),e.createElementBlock("svg",Jl,[...k[24]||(k[24]=[e.createElementVNode("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)])]))],40,Zl)):e.createCommentVNode("",!0),T.value&&n.showPreviewButton?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":e.unref(r)("common.preview")||"Preview",onClick:ge,onMouseenter:k[15]||(k[15]=B=>Y(B,e.unref(r)("common.preview")||"Preview")),onFocus:k[16]||(k[16]=B=>Y(B,e.unref(r)("common.preview")||"Preview")),onMouseleave:I,onBlur:I},[...k[25]||(k[25]=[e.createElementVNode("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"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("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"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Ql)):e.createCommentVNode("",!0)])],!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:e.normalizeStyle(D.value),onScroll:Pe},null,36),[[e.vShow,!m.value&&(t.stream?!0:!t.loading)]]),e.withDirectives(e.createElementVNode("div",ei,[e.renderSlot(w.$slots,"loading",{loading:t.loading,stream:t.stream},()=>[k[26]||(k[26]=e.createElementVNode("div",{class:"loading-skeleton"},[e.createElementVNode("div",{class:"skeleton-line"}),e.createElementVNode("div",{class:"skeleton-line"}),e.createElementVNode("div",{class:"skeleton-line short"})],-1))],!0)],512),[[e.vShow,!t.stream&&t.loading]])],6))}}),Pt=R(ti,[["__scopeId","data-v-9201c1b9"]]);Pt.install=t=>{t.component(Pt.__name,Pt)};let _e=null,Ge=null,Hn=!1;const we=new Map,Fe=new Map,eo=200;let ut=5;const lt=new Set;function Kt(){if(we.size<ut&&lt.size){const t=Array.from(lt);lt.clear();for(const o of t)try{o()}catch(n){}}}let Re=null;function ni(t){_e=t,Ge=null,_e.onmessage=o=>{const{id:n,html:s,error:r}=o.data,l=we.get(n);if(l)if(we.delete(n),clearTimeout(l.timeoutId),Kt(),r)l.reject(new Error(r));else{const{content:i,displayMode:v}=o.data;if(i){const m=`${v?"d":"i"}:${i}`;if(Fe.set(m,s),Fe.size>eo){const d=Fe.keys().next().value;Fe.delete(d)}}l.resolve(s)}},_e.onerror=o=>{console.error("[katexWorkerClient] Worker error:",o);for(const[n,s]of we.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${o.message}`));we.clear(),Kt()}}function oi(){var t;_e&&((t=_e.terminate)==null||t.call(_e)),_e=null,Ge=null}function ri(){return _e||(Ge=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ge.name="WorkerInitError",Ge.code="WORKER_INIT_ERROR",null)}function ai(t){Hn=!!t,_e&&_e.postMessage({type:"init",debug:Hn})}function to(t,o=!0,n=2e3,s){return V(this,null,function*(){const r=performance.now();if(Ge)return Promise.reject(Ge);const l=`${o?"d":"i"}:${t}`,i=Fe.get(l);if(i)return Re&&Re.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!0}),Promise.resolve(i);const v=ri();if(!v)return Promise.reject(Ge);if(we.size>=ut){const m=new Error("Worker busy");return m.name="WorkerBusy",m.code="WORKER_BUSY",m.busy=!0,m.inFlight=we.size,m.max=ut,Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(m)}return new Promise((m,d)=>{if(s!=null&&s.aborted){const $=new Error("Aborted");$.name="AbortError",d($);return}const g=Math.random().toString(36).slice(2),h=globalThis.setTimeout(()=>{we.delete(g);const $=new Error("Worker render timed out");$.name="WorkerTimeout",$.code="WORKER_TIMEOUT",Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"timeout"}),d($),Kt()},n),b=()=>{globalThis.clearTimeout(h),we.has(g)&&we.delete(g);const $=new Error("Aborted");$.name="AbortError",d($),Kt()};s&&s.addEventListener("abort",b,{once:!0});const M=m,H=d,_=$=>{Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!0}),M($)},z=$=>{Re&&Re.recordRender({type:"worker",duration:performance.now()-r,formulaLength:t.length,timestamp:Date.now(),success:!1,error:($==null?void 0:$.message)||String($)}),H($)};we.set(g,{resolve:_,reject:z,timeoutId:h}),v.postMessage({id:g,content:t,displayMode:o})})})}function li(t,o=!0,n){const s=`${o?"d":"i"}:${t}`;if(Fe.set(s,n),Fe.size>eo){const r=Fe.keys().next().value;Fe.delete(r)}}function ii(){return{inFlight:we.size,max:ut}}function si(t){Number.isFinite(t)&&t>0&&(ut=Math.floor(t))}const no="WORKER_BUSY";function ci(){return we.size>=ut}function oo(t=2e3,o){return we.size<ut?Promise.resolve():new Promise((n,s)=>{let r=!1,l;const i=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),lt.delete(i),n())};if(lt.add(i),l=globalThis.setTimeout(()=>{if(r)return;r=!0,lt.delete(i);const v=new Error("Wait for worker slot timed out");v.name="WorkerBusyTimeout",v.code="WORKER_BUSY_TIMEOUT",s(v)},t),queueMicrotask(()=>Kt()),o){const v=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),lt.delete(i);const m=new Error("Aborted");m.name="AbortError",s(m)};o.aborted?v():o.addEventListener("abort",v,{once:!0})}})}const Oe={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function di(t){t.timeout!=null&&(Oe.timeout=Math.max(0,Math.floor(t.timeout))),t.waitTimeout!=null&&(Oe.waitTimeout=Math.max(0,Math.floor(t.waitTimeout))),t.backoffMs!=null&&(Oe.backoffMs=Math.max(0,Math.floor(t.backoffMs))),t.maxRetries!=null&&(Oe.maxRetries=Math.max(0,Math.floor(t.maxRetries)))}function ui(){return Z({},Oe)}function mi(s){return V(this,arguments,function*(t,o=!0,n={}){var g,h,b,M;const r=(g=n.timeout)!=null?g:Oe.timeout,l=(h=n.waitTimeout)!=null?h:Oe.waitTimeout,i=(b=n.backoffMs)!=null?b:Oe.backoffMs,v=(M=n.maxRetries)!=null?M:Oe.maxRetries,m=n.signal;let d=0;for(;;){if(m!=null&&m.aborted){const H=new Error("Aborted");throw H.name="AbortError",H}try{return yield to(t,o,r,m)}catch(H){if((H==null?void 0:H.code)!==no||d>=v)throw H;if(d++,yield oo(l,m).catch(()=>{}),m!=null&&m.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}i>0&&(yield new Promise(_=>globalThis.setTimeout(_,i*d)))}}})}const ro=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-IDe4W9b6.cjs"))),ao=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BZTwjxhO.cjs"))),lo=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DqNfDUws.cjs"))),fi={AdmonitionNode:Nt,BlockquoteNode:wt,CheckboxNode:Le,CodeBlockNode:ro,DefinitionListNode:yt,EmojiNode:se,FootnoteNode:xt,FootnoteReferenceNode:ce,FootnoteAnchorNode:st,HardBreakNode:Ue,HeadingNode:ln,HighlightNode:Be,ImageNode:Xe,InlineCodeNode:de,PreCodeNode:dt,InsertNode:be,LinkNode:he,ListItemNode:bt,ListNode:Bt,MathBlockNode:ao,MathInlineNode:lo,MermaidBlockNode:ct,ParagraphNode:Mt,StrikethroughNode:fe,StrongNode:me,SubscriptNode:xe,SuperscriptNode:ye,TableNode:Ct,TextNode:te,ThematicBreakNode:Et,ReferenceNode:ue,MarkdownCodeBlockNode:Pt},hi={install(t,o){Object.entries(fi).forEach(([n,s])=>{t.component(n,s)}),o!=null&&o.getLanguageIcon&&Gn(o.getLanguageIcon),o!=null&&o.mathOptions&&vn.setDefaultMathOptions(o.mathOptions)}};exports.AdmonitionNode=Nt;exports.BlockquoteNode=wt;exports.CheckboxNode=Le;exports.CodeBlockNode=ro;exports.DefinitionListNode=yt;exports.EmojiNode=se;exports.FootnoteAnchorNode=st;exports.FootnoteReferenceNode=ce;exports.HardBreakNode=Ue;exports.HighlightNode=Be;exports.ImageNode=Xe;exports.InsertNode=be;exports.LinkNode=he;exports.ListItemNode=bt;exports.ListNode=Bt;exports.MERMAID_WORKER_BUSY_CODE=Yn;exports.MarkdownCodeBlockNode=Pt;exports.MathBlockNode=ao;exports.MathInlineNode=lo;exports.MermaidBlockNode=ct;exports.NodeRenderer=Ee;exports.ParagraphNode=Mt;exports.StrikethroughNode=fe;exports.StrongNode=me;exports.SubscriptNode=xe;exports.SuperscriptNode=ye;exports.TableNode=Ct;exports.TextNode=te;exports.ThematicBreakNode=Et;exports.VueRendererMarkdown=hi;exports.WORKER_BUSY_CODE=no;exports._HeadingNode=ln;exports._export_sfc=R;exports._sfc_main=dt;exports._sfc_main$1=xt;exports._sfc_main$2=de;exports._sfc_main$3=ue;exports.canParseOffthread=Un;exports.clearGlobalCustomComponents=So;exports.clearKaTeXWorker=oi;exports.clearMermaidWorker=Dr;exports.findPrefixOffthread=Zn;exports.getCustomNodeComponents=Ne;exports.getKaTeXBackpressureDefaults=ui;exports.getKaTeXWorkerLoad=ii;exports.getKatex=an;exports.getLanguageIcon=Jn;exports.getMermaidWorkerLoad=_r;exports.getUseMonaco=_a;exports.hideTooltip=nn;exports.isKaTeXWorkerBusy=ci;exports.languageMap=Qn;exports.removeCustomComponents=$o;exports.renderKaTeXInWorker=to;exports.renderKaTeXWithBackpressure=mi;exports.safeRaf=Xn;exports.setCustomComponents=To;exports.setDefaultI18nMap=Po;exports.setKaTeXBackpressureDefaults=di;exports.setKaTeXCache=li;exports.setKaTeXWorker=ni;exports.setKaTeXWorkerDebug=ai;exports.setKaTeXWorkerMaxConcurrency=si;exports.setLanguageIconResolver=Gn;exports.setMermaidWorker=Lr;exports.setMermaidWorkerClientDebug=Vr;exports.setMermaidWorkerMaxConcurrency=Ir;exports.showTooltipForAnchor=Tt;exports.terminateWorker=wn;exports.useSafeI18n=on;exports.useViewportPriority=rn;exports.waitForKaTeXWorkerSlot=oo;