markstream-vue 0.0.3-beta.5 → 0.0.3-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/README.zh-CN.md +4 -0
- package/dist/{exports-DhNgUzYL.js → exports-CVYl7bes.js} +847 -839
- package/dist/{exports-1obt4rfJ.cjs → exports-ISf5W5H7.cjs} +7 -7
- package/dist/exports.js +1 -1
- package/dist/{index-Cy9ounEH.js → index-B90_xyRN.js} +1 -1
- package/dist/{index-BS4IAchB.cjs → index-BOwgCLNK.cjs} +1 -1
- package/dist/{index-BDPiDbZr.js → index-Bg9riGZT.js} +1 -1
- package/dist/{index-KPngPBen.cjs → index-Bjfg9_i9.cjs} +1 -1
- package/dist/{index-DD2YWdWI.cjs → index-BqQOMeNc.cjs} +1 -1
- package/dist/{index-gpZy9BH3.js → index-CpUcwcBM.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Ao=Object.create;var Rn=Object.defineProperty,Ho=Object.defineProperties,jo=Object.getOwnPropertyDescriptor,Po=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertyNames,Qn=Object.getOwnPropertySymbols,Ko=Object.getPrototypeOf,to=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var eo=(t,o,n)=>o in t?Rn(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,q=(t,o)=>{for(var n in o||(o={}))to.call(o,n)&&eo(t,n,o[n]);if(Qn)for(var n of Qn(o))Oo.call(o,n)&&eo(t,n,o[n]);return t},it=(t,o)=>Ho(t,Po(o));var Wo=(t,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of Fo(o))!to.call(t,l)&&l!==n&&Rn(t,l,{get:()=>o[l],enumerable:!(s=jo(o,l))||s.enumerable});return t};var Wt=(t,o,n)=>(n=t!=null?Ao(Ko(t)):{},Wo(o||!t||!t.__esModule?Rn(n,"default",{value:t,enumerable:!0}):n,t));var L=(t,o,n)=>new Promise((s,l)=>{var m=g=>{try{f(n.next(g))}catch(p){l(p)}},u=g=>{try{f(n.throw(g))}catch(p){l(p)}},f=g=>g.done?s(g.value):Promise.resolve(g.value).then(m,u);f((n=n.apply(t,o)).next())});const Bn=require("stream-markdown-parser"),e=require("vue"),Xt=require("@floating-ui/dom");var zn=typeof document!="undefined"?document.currentScript:null;const Xo=["cite"],Uo=e.defineComponent({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createElementBlock("blockquote",{class:"blockquote",dir:"auto",cite:t.node.cite},[e.withMemo([o.node.children],()=>e.createVNode(e.unref(He),{"index-key":`blockquote-${o.indexKey}`,nodes:o.node.children||[],"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[0]||(s[0]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter"]),s,1)],8,Xo))}}),P=(t,o)=>{const n=t.__vccOpts||t;for(const[s,l]of o)n[s]=l;return n},Yt=P(Uo,[["__scopeId","data-v-eeadc8a3"]]);Yt.install=t=>{t.component(Yt.__name,Yt)};const Yo={class:"checkbox-node"},qo=["checked"],Zo=e.defineComponent({__name:"CheckboxNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",Yo,[e.createElementVNode("input",{type:"checkbox",checked:t.node.checked,disabled:"",class:"checkbox-input"},null,8,qo)]))}}),Qe=P(Zo,[["__scopeId","data-v-8dc6c46f"]]);Qe.install=t=>{t.component(Qe.__name,Qe)};const Go={class:"definition-list"},Jo={class:"definition-term"},Qo={class:"definition-desc"},er=e.defineComponent({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createElementBlock("dl",Go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.node.items,(l,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[e.createElementVNode("dt",Jo,[e.createVNode(e.unref(He),{"index-key":`definition-term-${o.indexKey}-${m}`,nodes:l.term,"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[0]||(s[0]=u=>n.$emit("copy",u))},null,8,["index-key","nodes","custom-id","typewriter"])]),e.createElementVNode("dd",Qo,[e.createVNode(e.unref(He),{"index-key":`definition-desc-${o.indexKey}-${m}`,nodes:l.definition,"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[1]||(s[1]=u=>n.$emit("copy",u))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),qt=P(er,[["__scopeId","data-v-f88691d6"]]);qt.install=t=>{t.component(qt.__name,qt)};const tr={class:"emoji-node"},nr=e.defineComponent({__name:"EmojiNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",tr,e.toDisplayString(t.node.name),1))}}),ge=P(nr,[["__scopeId","data-v-de55dc97"]]);ge.install=t=>{t.component(ge.__name,ge)};const pn="__global__",$t={};function or(t,o){typeof t=="string"?$t[t]=o||{}:$t[pn]=t||{}}function et(t){return t?$t[t]||$t[pn]||{}:$t[pn]||{}}function rr(t){if(t===pn)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete $t[t]}function ar(){delete $t[pn]}const lr=["id"],ir=["title"],sr=e.defineComponent({__name:"FootnoteReferenceNode",props:{node:{}},setup(t){const n=`#footnote-${t.node.id}`;function s(){if(typeof document=="undefined")return;const l=document.querySelector(n);l?l.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(l,m)=>(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,ir)],8,lr))}}),we=P(sr,[["__scopeId","data-v-01af0fee"]]);we.install=t=>{t.component(we.__name,we)};const cr={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-['']"},ke=e.defineComponent({__name:"InlineCodeNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("code",cr,e.toDisplayString(t.node.code),1))}});ke.install=t=>{t.component(ke.__name,ke)};const ur=["id"],dr=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(g){}return!1}),s=e.ref(null),l=e.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),m=e.ref(!1);let u=null;function f(){return L(this,null,function*(){var x,S;if(!o.anchorEl||!s.value)return;const g=[Xt.offset((x=o.offset)!=null?x:8),Xt.flip(),Xt.shift({padding:8})],{x:p,y}=yield Xt.computePosition(o.anchorEl,s.value,{placement:(S=o.placement)!=null?S:"top",middleware:g,strategy:"fixed"});l.value.transform=`translate3d(${Math.round(p)}px, ${Math.round(y)}px, 0)`,l.value.left="0px",l.value.top="0px"})}return e.watch(()=>o.visible,g=>L(null,null,function*(){if(g)if(m.value=!1,yield e.nextTick(),o.anchorEl&&s.value)try{const p=o.anchorEl.getBoundingClientRect();yield f();const y=l.value.transform;if(o.originX!=null&&o.originY!=null){const x=Math.abs(Number(o.originX)-p.left),S=Math.abs(Number(o.originY)-p.top);Math.hypot(x,S)>120?(l.value.transform=`translate3d(${Math.round(o.originX)}px, ${Math.round(o.originY)}px, 0)`,yield e.nextTick(),m.value=!0,yield e.nextTick(),l.value.transform=y):m.value=!0}else m.value=!0;u=Xt.autoUpdate(o.anchorEl,s.value,f)}catch(p){yield f(),m.value=!0,u=Xt.autoUpdate(o.anchorEl,s.value,f)}else m.value=!0;else m.value=!1,u&&(u(),u=null)})),e.watch([()=>o.anchorEl,()=>o.placement,()=>o.content],()=>L(null,null,function*(){o.visible&&o.anchorEl&&s.value&&(yield e.nextTick(),yield f())})),e.onBeforeUnmount(()=>{u&&u()}),(g,p)=>(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:l.value.left,top:l.value.top,transform:l.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,ur),[[e.vShow,t.visible&&m.value]])]),_:1})]))}}),mr=P(dr,[["__scopeId","data-v-993f63aa"]]),Kn=e.ref(!1),mo=e.ref(""),fo=e.ref("top"),mn=e.ref(null),hn=e.ref(null),On=e.ref(null),Wn=e.ref(null),po=e.ref(null);let Mn=null,Cn=null;function ho(){Mn&&(clearTimeout(Mn),Mn=null),Cn&&(clearTimeout(Cn),Cn=null)}let no=!1;function fr(){if(no||typeof document=="undefined")return;no=!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(mr,{visible:Kn.value,"anchor-el":mn.value,content:mo.value,placement:fo.value,id:hn.value,originX:On.value,originY:Wn.value,isDark:(n=po.value)!=null?n:void 0})}}};e.createApp(o).mount(t)}function on(t,o,n="top",s=!1,l,m){if(!t)return;fr(),ho();const u=()=>{var f,g;hn.value=`tooltip-${Date.now()}-${Math.floor(Math.random()*1e3)}`,mn.value=t,mo.value=o,fo.value=n,On.value=(f=l==null?void 0:l.x)!=null?f:null,Wn.value=(g=l==null?void 0:l.y)!=null?g:null,po.value=typeof m=="boolean"?m:null,Kn.value=!0;try{t.setAttribute("aria-describedby",hn.value)}catch(p){}};s?u():Mn=setTimeout(u,80)}function Nn(t=!1){ho();const o=()=>{if(mn.value&&hn.value)try{mn.value.removeAttribute("aria-describedby")}catch(n){}Kn.value=!1,mn.value=null,hn.value=null,On.value=null,Wn.value=null};t?o():Cn=setTimeout(o,120)}function pr(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 vo={"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 hr(t){Object.assign(vo,t)}function _n(){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=vo[o])!=null?n:pr(o)};return L(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(l){}}catch(s){}}catch(o){}}),{t}}const go=Symbol("ViewportPriority");function vr(t,o){const n=typeof window!="undefined"&&typeof document!="undefined",s=typeof o=="boolean"?e.ref(o):o;let l=null,m=null;const u=new WeakMap;function f(p){var S,V,E;if(l||!n)return l;if(typeof IntersectionObserver=="undefined")return null;const y=(S=t==null?void 0:t(p!=null?p:null))!=null?S:null,x=m||{};return l=new IntersectionObserver(X=>{for(const I of X){const b=u.get(I.target);if(!b)continue;if(I.isIntersecting||I.intersectionRatio>0){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch(K){}}l==null||l.unobserve(I.target),u.delete(I.target)}}},{root:y,rootMargin:(V=x.rootMargin)!=null?V:"300px",threshold:(E=x.threshold)!=null?E:0}),l}const g=(p,y)=>{const x=e.ref(!1);let S=!1,V;const E=new Promise(b=>{V=()=>{S||(S=!0,b())}}),X=()=>{try{l==null||l.unobserve(p)}catch(b){}u.delete(p)};if(!n||!s.value)return x.value=!0,V(),{isVisible:x,whenVisible:E,destroy:X};!m&&y&&(m=q({},y));const I=f(p);return I?(u.set(p,{resolve:V,visible:x}),I.observe(p),{isVisible:x,whenVisible:E,destroy:X}):(x.value=!0,V(),{isVisible:x,whenVisible:E,destroy:X})};return e.provide(go,g),g}function Sn(){const t=e.inject(go,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(m=>{for(const u of m){const f=o.get(u.target);if(!f)continue;if(u.isIntersecting||u.intersectionRatio>0){if(!f.visible.value){f.visible.value=!0;try{f.resolve()}catch(p){}}n==null||n.unobserve(u.target),o.delete(u.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return m=>{const u=e.ref(!1);let f=!1,g;const p=new Promise(S=>{g=()=>{f||(f=!0,S())}}),y=()=>{try{n==null||n.unobserve(m)}catch(S){}o.delete(m)},x=s();return x?(o.set(m,{resolve:g,visible:u}),x.observe(m),{isVisible:u,whenVisible:p,destroy:y}):(u.value=!0,g(),{isVisible:u,whenVisible:p,destroy:y})}}const gr={class:"relative inline-block"},wr=["src","alt","title","loading","tabindex","aria-label"],kr={class:"text-sm whitespace-nowrap"},yr={key:1,class:"text-sm text-gray-500"},xr={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},br={class:"text-sm whitespace-nowrap"},Br={key:0,class:"mt-2 text-sm text-gray-500 italic"},Mr=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,l=e.ref(!1),m=e.ref(!1),u=e.ref(!1),f=e.ref(null),g=Sn(),p=e.ref(null),y=e.ref(typeof window=="undefined");typeof window!="undefined"&&e.watch(()=>f.value,Z=>{var Y;if((Y=p.value)==null||Y.destroy(),p.value=null,!Z){y.value=!1;return}const K=g(Z,{rootMargin:"400px"});p.value=K,y.value=K.isVisible.value,K.whenVisible.then(()=>{y.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var Z;(Z=p.value)==null||Z.destroy(),p.value=null});const x=e.computed(()=>m.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),S=e.computed(()=>!n.lazy||y.value),V=e.computed(()=>/\.svg(?:\?|$)/i.test(x.value));function E(){n.fallbackSrc&&!u.value?(u.value=!0,m.value=!0):(m.value=!0,s("error",n.node.src))}function X(){l.value=!0,m.value=!1,s("load",x.value)}function I(Z){Z.preventDefault(),!(!l.value||m.value)&&s("click",[Z,x.value])}const{t:b}=_n();return e.watch(x,()=>{l.value=!1,m.value=!1}),(Z,K)=>(e.openBlock(),e.createElementBlock("figure",{ref_key:"figureRef",ref:f,class:"text-center my-8"},[e.createElementVNode("div",gr,[e.createVNode(e.Transition,{name:"img-switch",mode:"out-in"},{default:e.withCtx(()=>{var Y,te,$,Ve,ee;return[!t.node.loading&&!m.value&&S.value?(e.openBlock(),e.createElementBlock("img",{key:"image",src:x.value,alt:String((te=(Y=n.node.alt)!=null?Y:n.node.title)!=null?te:""),title:String((Ve=($=n.node.title)!=null?$:n.node.alt)!=null?Ve:""),class:e.normalizeClass(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!l.value,"opacity-100":l.value,"cursor-pointer":l.value}]),style:e.normalizeStyle(V.value?{minHeight:n.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:n.lazy?"lazy":"eager",decoding:"async",tabindex:l.value?0:-1,"aria-label":(ee=n.node.alt)!=null?ee:e.unref(b)("image.preview"),onError:E,onLoad:X,onClick:I},null,46,wr)):m.value?!t.node.loading&&!n.fallbackSrc?(e.openBlock(),e.createElementBlock("div",xr,[e.renderSlot(Z.$slots,"error",{node:n.node,displaySrc:x.value,imageLoaded:l.value,hasError:m.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:V.value},()=>[K[1]||(K[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",br,e.toDisplayString(e.unref(b)("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(V.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?e.renderSlot(Z.$slots,"placeholder",{key:0,node:n.node,displaySrc:x.value,imageLoaded:l.value,hasError:m.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:V.value},()=>[K[0]||(K[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",kr,e.toDisplayString(e.unref(b)("image.loading")),1)],!0):(e.openBlock(),e.createElementBlock("span",yr,e.toDisplayString(t.node.raw),1))],4))]}),_:3})]),n.showCaption&&n.node.alt?(e.openBlock(),e.createElementBlock("figcaption",Br,e.toDisplayString(n.node.alt),1)):e.createCommentVNode("",!0)],512))}}),vt=P(Mr,[["__scopeId","data-v-7ca79b66"]]);vt.install=t=>{t.component(vt.__name,vt)};let dn=null,En=!1,Xn=wo;function wo(){return L(null,null,function*(){const t=yield import("katex");return yield import("katex/contrib/mhchem"),t})}function Cr(){dn=null,En=!1}function Un(t){Xn=t,Cr()}function Er(t){Un(t!=null?t:wo)}function Tr(){Un(null)}function Yn(){return typeof Xn=="function"}function In(){return L(this,null,function*(){if(dn)return dn;if(En)return null;const t=Xn;if(!t)return En=!0,null;try{const o=yield t();if(o)return dn=o,dn}catch(o){}return En=!0,null})}const An=e.shallowRef(!1);let oo=null;function ko(){return oo||(oo=In().then(t=>{An.value=!!t}).catch(()=>{An.value=!1})),e.readonly(An)}const Nr=e.defineComponent({__name:"TextNode",props:{node:{}},emits:["copy"],setup(t){const o=ko();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))}}),de=P(Nr,[["__scopeId","data-v-56f30838"]]);de.install=t=>{t.component(de.__name,de)};const ct=e.defineAsyncComponent(()=>L(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 l,m;return e.h(de,it(q({},s),{node:it(q({},s.node),{content:(m=s.node.raw)!=null?m:`$${(l=s.node.content)!=null?l:""}$`})}))};try{if(yield In())return(yield Promise.resolve().then(()=>require("./index-DD2YWdWI.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 l,m;return e.h(de,it(q({},s),{node:it(q({},s.node),{content:(m=s.node.raw)!=null?m:`$${(l=s.node.content)!=null?l:""}$`})}))}})),_r=e.defineAsyncComponent(()=>L(null,null,function*(){try{if(yield In())return(yield Promise.resolve().then(()=>require("./index-KPngPBen.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(de,it(q({},t),{node:it(q({},t.node),{content:(n=t.node.raw)!=null?n:`$$${(o=t.node.content)!=null?o:""}$$`})}))}})),ye=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))}});ye.install=t=>{t.component(ye.__name,ye)};const Sr={class:"superscript-node"},Ir={key:1},$r=e.defineComponent({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,strong:xe,emphasis:je,footnote_reference:we,strikethrough:be,highlight:$e,insert:Ie,subscript:Se,emoji:ge,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("sup",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"superscript"}-${f}`},[s[u.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:0,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"superscript"}-${f}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",Ir,e.toDisplayString(u.content||u.raw),1))],64))),128))]))}}),_e=P($r,[["__scopeId","data-v-9ae5549f"]]);_e.install=t=>{t.component(_e.__name,_e)};const Vr={class:"subscript-node"},Lr={key:1},Dr=e.defineComponent({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,strong:xe,emphasis:je,footnote_reference:we,strikethrough:be,highlight:$e,insert:Ie,superscript:_e,emoji:ge,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("sub",Vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"subscript"}-${f}`},[s[u.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:0,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"subscript"}-${f}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",Lr,e.toDisplayString(u.content||u.raw),1))],64))),128))]))}}),Se=P(Dr,[["__scopeId","data-v-37438707"]]);Se.install=t=>{t.component(Se.__name,Se)};const Rr={class:"strong-node"},zr=e.defineComponent({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,emphasis:je,strikethrough:be,highlight:$e,insert:Ie,subscript:Se,superscript:_e,emoji:ge,footnote_reference:we,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("strong",Rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"strong"}-${f}`,"index-key":`${t.indexKey||"strong"}-${f}`,node:u,"custom-id":o.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),xe=P(zr,[["__scopeId","data-v-3f61dca6"]]);xe.install=t=>{t.component(xe.__name,xe)};const Ar={class:"strikethrough-node"},Hr=e.defineComponent({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,strong:xe,emphasis:je,highlight:$e,insert:Ie,subscript:Se,superscript:_e,emoji:ge,footnote_reference:we,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("del",Ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"strikethrough"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"strikethrough"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),be=P(Hr,[["__scopeId","data-v-8236f64d"]]);be.install=t=>{t.component(be.__name,be)};const jr=["href","title","aria-label","aria-hidden"],Pr=["aria-hidden"],Fr={class:"link-text-wrapper relative inline-flex"},Kr={class:"leading-[normal] link-text"},Or={class:"leading-[normal] link-text"},Wr=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 p,y,x,S,V,E;const g=o.underlineBottom!==void 0?typeof o.underlineBottom=="number"?`${o.underlineBottom}px`:String(o.underlineBottom):"-3px";return{"--link-color":(p=o.color)!=null?p:"#0366d6","--underline-height":`${(y=o.underlineHeight)!=null?y:2}px`,"--underline-bottom":g,"--underline-opacity":String((x=o.animationOpacity)!=null?x:.9),"--underline-duration":`${(S=o.animationDuration)!=null?S:.8}s`,"--underline-timing":(V=o.animationTiming)!=null?V:"linear","--underline-iteration":typeof o.animationIteration=="number"?String(o.animationIteration):(E=o.animationIteration)!=null?E:"infinite"}}),s={text:de,strong:xe,strikethrough:be,emphasis:je,image:vt},l=e.useAttrs();function m(g){var S,V,E;if(!o.showTooltip)return;const p=g,y=(p==null?void 0:p.clientX)!=null&&(p==null?void 0:p.clientY)!=null?{x:p.clientX,y:p.clientY}:void 0,x=((S=o.node)==null?void 0:S.title)||((V=o.node)==null?void 0:V.href)||((E=o.node)==null?void 0:E.text)||"";on(g.currentTarget,x,"top",!1,y)}function u(){o.showTooltip&&Nn()}const f=e.computed(()=>{var g,p;return String((p=(g=o.node.title)!=null?g:o.node.href)!=null?p:"")});return(g,p)=>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(l),{style:n.value}),[e.createElementVNode("span",Fr,[e.createElementVNode("span",Kr,[e.createElementVNode("span",Or,e.toDisplayString(t.node.text),1)]),p[1]||(p[1]=e.createElementVNode("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Pr)):(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:0,class:"link-node",href:t.node.href,title:t.showTooltip?"":f.value,"aria-label":`Link: ${f.value}`,"aria-hidden":t.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},e.unref(l),{style:n.value,onMouseenter:p[0]||(p[0]=y=>m(y)),onMouseleave:u}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(y,x)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[y.type]),{key:`${t.indexKey||"emphasis"}-${x}`,node:y,"custom-id":o.customId,"index-key":`${t.indexKey||"link-text"}-${x}`},null,8,["node","custom-id","index-key"]))),128))],16,jr))}}),Be=P(Wr,[["__scopeId","data-v-80b69735"]]);Be.install=t=>{t.component(Be.__name,Be)};const Xr={class:"insert-node"},Ur=e.defineComponent({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,strong:xe,emphasis:je,strikethrough:be,highlight:$e,subscript:Se,superscript:_e,emoji:ge,footnote_reference:we,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("ins",Xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"insert"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"insert"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Ie=P(Ur,[["__scopeId","data-v-0b4b6459"]]);Ie.install=t=>{t.component(Ie.__name,Ie)};const Yr={class:"highlight-node"},qr=e.defineComponent({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,strong:xe,emphasis:je,strikethrough:be,insert:Ie,subscript:Se,superscript:_e,emoji:ge,footnote_reference:we,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("mark",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"highlight"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"highlight"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),$e=P(qr,[["__scopeId","data-v-fbe5e4f2"]]);$e.install=t=>{t.component($e.__name,$e)};const Zr={class:"emphasis-node"},Gr=e.defineComponent({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,strong:xe,strikethrough:be,highlight:$e,insert:Ie,subscript:Se,superscript:_e,emoji:ge,footnote_reference:we,math_inline:ct,reference:ye},n);return(l,m)=>(e.openBlock(),e.createElementBlock("em",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"emphasis"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"emphasis"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),je=P(Gr,[["__scopeId","data-v-8723e015"]]);je.install=t=>{t.component(je.__name,je)};const Jr=["href","title"],Qr=e.defineComponent({__name:"FootnoteAnchorNode",props:{node:{}},setup(t){const o=t;function n(s){var u;if(s.preventDefault(),typeof document=="undefined")return;const l=`fnref-${String((u=o.node.id)!=null?u:"")}`,m=document.getElementById(l);m&&m.scrollIntoView({behavior:"smooth"})}return(s,l)=>(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,Jr))}}),Vt=P(Qr,[["__scopeId","data-v-4756ce0d"]]);Vt.install=t=>{t.component(Vt.__name,Vt)};const ea=["id"],ta={class:"flex-1"},Zt=e.defineComponent({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t;return(n,s)=>(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",ta,[e.withMemo([o.node.children],()=>e.createVNode(e.unref(He),{"index-key":`footnote-${o.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[0]||(s[0]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter"]),s,1)])],8,ea))}});Zt.install=t=>{t.component(Zt.__name,Zt)};const na={class:"hard-break"},oa=e.defineComponent({__name:"HardBreakNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("br",na))}}),bt=P(oa,[["__scopeId","data-v-50c58f70"]]);bt.install=t=>{t.component(bt.__name,bt)};const ra=e.defineComponent({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({text:de,inline_code:ke,link:Be,image:vt,strong:xe,emphasis:je,strikethrough:be,highlight:$e,insert:Ie,subscript:Se,superscript:_e,emoji:ge,checkbox:Qe,checkbox_input:Qe,footnote_reference:we,hardbreak:bt,math_inline:ct,reference:ye},n);return(l,m)=>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,(u,f,g,p)=>{const y=[u];if(p&&p.key===`${t.indexKey||"heading"}-${f}`&&e.isMemoSame(p,y))return p;const x=(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"heading"}-${f}`,"custom-id":o.customId,node:u,"index-key":`${t.indexKey||"heading"}-${f}`},null,8,["custom-id","node","index-key"]));return x.memo=y,x},m,0),128))]),_:1},8,["class"])),m,2)}}),Hn=P(ra,[["__scopeId","data-v-e3e7e2ce"]]),$n=Hn;$n.install=t=>{t.component(Hn.__name,Hn)};const aa=e.defineComponent({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>o.value==null?{}:{value:o.value});return(s,l)=>(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(He),{"index-key":`list-item-${o.indexKey}`,nodes:o.item.children,"custom-id":o.customId,typewriter:o.typewriter,"batch-rendering":!1,onCopy:l[0]||(l[0]=m=>s.$emit("copy",m))},null,8,["index-key","nodes","custom-id","typewriter"]),l,1)],16))}}),Gt=P(aa,[["__scopeId","data-v-7a618746"]]);Gt.install=t=>{t.component(Gt.__name,Gt)};const la=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,l,m,u)=>{var p;const f=[s];if(u&&u.key===`${t.indexKey||"list"}-${l}`&&e.isMemoSame(u,f))return u;const g=(e.openBlock(),e.createBlock(e.unref(Gt),{key:`${t.indexKey||"list"}-${l}`,item:s,"custom-id":t.customId,"index-key":`${t.indexKey||"list"}-${l}`,typewriter:t.typewriter,value:t.node.ordered?((p=t.node.start)!=null?p:1)+l:void 0,onCopy:n[0]||(n[0]=y=>o.$emit("copy",y))},null,8,["item","custom-id","index-key","typewriter","value"]));return g.memo=f,g},n,1),128))]),_:1},8,["class"]))}}),Jt=P(la,[["__scopeId","data-v-79057d57"]]);Jt.install=t=>{t.component(Jt.__name,Jt)};const ia="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 yo(t){try{if(typeof globalThis!="undefined"&&typeof globalThis.requestAnimationFrame=="function")return globalThis.requestAnimationFrame(t)}catch(o){}return globalThis.setTimeout(t,0)}const qn=()=>import("mermaid");let Ut=null,Zn=qn;function sa(){Ut=null}function Gn(t){Zn=t,sa()}function ca(t){Gn(t!=null?t:qn)}function ua(){Gn(null)}function xo(){return typeof Zn=="function"}function da(t){if(!t)return t;const o=t&&t.default?t.default:t;if(o&&(typeof o.render=="function"||typeof o.parse=="function"||typeof o.initialize=="function"))return o;if(o&&o.mermaidAPI&&(typeof o.mermaidAPI.render=="function"||typeof o.mermaidAPI.parse=="function")){const n=o.mermaidAPI;return it(q({},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})}return t.mermaid&&typeof t.mermaid.render=="function"?t.mermaid:o}function ma(t){if(t)try{const o=t==null?void 0:t.initialize;t.initialize=n=>{const s=q({suppressErrorRendering:!0},n||{});if(typeof o=="function")return o.call(t,s);if(t!=null&&t.mermaidAPI&&typeof t.mermaidAPI.initialize=="function")return t.mermaidAPI.initialize(s)}}catch(o){}}function fa(){return L(this,null,function*(){if(Ut)return Ut;const t=Zn;if(!t)return null;let o;try{o=yield t()}catch(n){throw t===qn?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):n}return o?(Ut=da(o),ma(Ut),Ut):null})}let pe=null,Bt=null;const ue=new Map,pa=5;let Tn=pa,jn=!1;function ha(t){jn=!!t}function va(t){Number.isFinite(t)&&t>0&&(Tn=Math.floor(t))}function ga(){return{inFlight:ue.size,max:Tn}}const bo="WORKER_BUSY",Bo="MERMAID_DISABLED";function wa(t){pe=t,Bt=null;const o=t;pe.onmessage=n=>{if(pe!==o)return;const{id:s,ok:l,result:m,error:u}=n.data,f=ue.get(s);f&&(l===!1||u?f.reject(new Error(u||"Unknown error")):f.resolve(m))},pe.onerror=n=>{var s,l;if(pe===o){if(ue.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",(n==null?void 0:n.message)||n);return}try{jn?console.error("[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n):(l=console.debug)==null||l.call(console,"[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n)}catch(m){}for(const[m,u]of ue.entries())u.reject(new Error(`Worker error: ${n.message}`));ue.clear()}},pe.onmessageerror=n=>{var s,l;if(pe===o){if(ue.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n);return}try{jn?console.error("[mermaidWorkerClient] Worker messageerror:",n):(l=console.debug)==null||l.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch(m){}for(const[m,u]of ue.entries())u.reject(new Error("Worker messageerror"));ue.clear()}}}function ka(){var t;if(pe)try{for(const[o,n]of ue.entries())n.reject(new Error("Worker cleared"));ue.clear(),(t=pe.terminate)==null||t.call(pe)}catch(o){}pe=null,Bt=null}function ya(){return pe||(Bt=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Bt.name="WorkerInitError",Bt.code="WORKER_INIT_ERROR",null)}function Mo(t,o,n=1400){if(!xo()){const l=new Error("Mermaid rendering disabled");return l.name="MermaidDisabled",l.code=Bo,Promise.reject(l)}if(Bt)return Promise.reject(Bt);const s=ya();if(!s)return Promise.reject(Bt);if(ue.size>=Tn){const l=new Error("Worker busy");return l.name="WorkerBusy",l.code=bo,l.inFlight=ue.size,l.max=Tn,Promise.reject(l)}return new Promise((l,m)=>{const u=Math.random().toString(36).slice(2);let f=!1,g;const p=()=>{f||(f=!0,g!=null&&globalThis.clearTimeout(g),ue.delete(u))},y={resolve:x=>{p(),l(x)},reject:x=>{p(),m(x)}};ue.set(u,y);try{s.postMessage({id:u,action:t,payload:o})}catch(x){ue.delete(u),m(x);return}g=globalThis.setTimeout(()=>{const x=new Error("Worker call timed out");x.name="WorkerTimeout",x.code="WORKER_TIMEOUT";const S=ue.get(u);S&&S.reject(x)},n)})}function Co(t,o,n=1400){return L(this,null,function*(){try{return yield Mo("canParse",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function Eo(t,o,n=1400){return L(this,null,function*(){try{return yield Mo("findPrefix",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function Pn(){if(pe)try{for(const[t,o]of ue.entries())o.reject(new Error("Worker terminated"));ue.clear(),pe.terminate()}finally{pe=null}}const xa={key:0},ba={key:1,class:"flex items-center space-x-2 overflow-hidden"},Ba=["src"],Ma={key:2},Ca={class:"flex items-center space-x-1"},Ea={class:"flex items-center space-x-1"},Ta={key:4},Na={key:5,class:"flex items-center space-x-1"},_a=["aria-pressed"],Sa={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"},Ia={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"},$a=["disabled"],Va=["disabled"],La={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"},Da={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"},Ra={key:1,class:"relative"},za={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Aa={class:"flex items-center gap-2 backdrop-blur rounded-lg"},Ha={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},ja=300,Pa=500,Fa=3,Ka=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},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!1}},emits:["copy","export","openModal","toggleMode"],setup(t,{emit:o}){var sn,cn;const n=t,s=o,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},m=e.ref(!1),u=e.computed(()=>n.isStrict?"strict":"loose"),f=e.computed(()=>({startOnLoad:!1,securityLevel:u.value,dompurifyConfig:u.value==="strict"?l:void 0,flowchart:u.value==="strict"?{htmlLabels:!1}:void 0}));function g(a){return a.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}const p=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],y=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function x(a){if(!a)return"";const r=a.trim();return y.test(r)?r:""}function S(a){const r=new Set(["script"]),c=[a,...Array.from(a.querySelectorAll("*"))];for(const w of c){if(r.has(w.tagName.toLowerCase())){w.remove();continue}const _=Array.from(w.attributes);for(const T of _){const R=T.name;if(/^on/i.test(R)){w.removeAttribute(R);continue}if(R==="style"&&T.value){const D=T.value;if(p.some(ne=>ne.test(D))){w.removeAttribute(R);continue}}if((R==="href"||R==="xlink:href")&&T.value){const D=x(T.value);if(!D){w.removeAttribute(R);continue}D!==T.value&&w.setAttribute(R,D)}}}}function V(a){if(typeof window=="undefined"||typeof DOMParser=="undefined"||!a)return null;const r=g(a),w=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;if(!w||w.nodeName.toLowerCase()!=="svg")return null;const _=w;return S(_),_}function E(a,r){if(!a)return"";try{a.replaceChildren()}catch(w){a.innerHTML=""}const c=V(r);return c?(a.appendChild(c),a.innerHTML):""}function X(a){if(a)try{a.replaceChildren()}catch(r){a.innerHTML=""}}function I(a,r){if(!a)return"";if(u.value==="strict")return E(a,r);try{a.replaceChildren()}catch(c){a.innerHTML=""}if(r)try{a.insertAdjacentHTML("afterbegin",r)}catch(c){a.innerHTML=r}return a.innerHTML}const{t:b}=_n();function Z(){return L(this,null,function*(){try{const a=yield fa();return m.value=!!a,a}catch(a){throw m.value=!1,a}})}typeof window!="undefined"&&L(null,null,function*(){var a;try{const r=yield Z();if(!r)return;(a=r==null?void 0:r.initialize)==null||a.call(r,q({},f.value))}catch(r){m.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",r)}});const K=e.ref(!1),Y=e.ref(!1),te=e.ref(),$=e.ref(),Ve=e.ref(),ee=e.ref(null),Me=Sn(),tt=e.ref(null),A=e.ref(typeof window=="undefined"),gt=e.ref(),G=e.computed(()=>n.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function ve(a,r=G.value){const c=r,_=`%%{init: {"theme": "${a==="dark"?"dark":"default"}"}}%%
|
|
2
|
-
`;return c.trim().startsWith("%%{")?c:_+c}const C=e.ref(1),O=e.ref(0),j=e.ref(0),
|
|
3
|
-
`;return a.trimStart().startsWith("%%{")?a:w+a}function rn(){return
|
|
4
|
-
`)}function Vn(a,r,c){return L(this,null,function*(){var D,ne;const w=yield Z();if(!w)return;const _=w,T=wn(a,r);if(typeof _.parse=="function")return yield Ze(()=>_.parse(T),{timeoutMs:(D=c==null?void 0:c.timeoutMs)!=null?D:z.value.parse,signal:c==null?void 0:c.signal}),!0;const R=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Ze(()=>w.render(R,T),{timeoutMs:(ne=c==null?void 0:c.timeoutMs)!=null?ne:z.value.render,signal:c==null?void 0:c.signal}),!0})}function Tt(a,r,c){return L(this,null,function*(){var w;try{return yield Co(a,r,(w=c==null?void 0:c.timeoutMs)!=null?w:z.value.worker)}catch(_){return yield Vn(a,r,c)}})}function Ln(a,r,c){return L(this,null,function*(){var _;try{if(yield Tt(a,r,c))return{fullOk:!0,prefixOk:!1}}catch(T){if((T==null?void 0:T.name)==="AbortError")throw T}let w=an(a);if(w&&w.trim()&&w!==a)try{try{const R=yield Eo(a,r,(_=c==null?void 0:c.timeoutMs)!=null?_:z.value.worker);R&&R.trim()&&(w=R)}catch(R){}if(yield Tt(w,r,c))return{fullOk:!1,prefixOk:!0,prefix:w}}catch(T){if((T==null?void 0:T.name)==="AbortError")throw T}return{fullOk:!1,prefixOk:!1}})}const Ht=e.computed(()=>F.value||J.value||Y.value);function jt(a){if(!te.value||!$.value)return;const r=$.value.querySelector("svg");if(!r)return;let c=0,w=0;const _=r.getAttribute("viewBox"),T=r.getAttribute("width"),R=r.getAttribute("height");if(_){const D=_.split(" ");D.length===4&&(c=Number.parseFloat(D[2]),w=Number.parseFloat(D[3]))}if((!c||!w)&&T&&R&&(c=Number.parseFloat(T),w=Number.parseFloat(R)),Number.isNaN(c)||Number.isNaN(w)||c<=0||w<=0)try{const D=r.getBBox();D&&D.width>0&&D.height>0&&(c=D.width,w=D.height)}catch(D){console.error("Failed to get SVG BBox:",D);return}if(c>0&&w>0){const D=w/c;let le=(a!=null?a:te.value.clientWidth)*D;le>w&&(le=w),W.value=`${le}px`}}const Ge=e.ref(!1),ln=e.computed(()=>({transform:`translate(${O.value}px, ${j.value}px) scale(${C.value})`}));function kn(a){a.key==="Escape"&&Ge.value&&Pt()}function Dn(){if(Ge.value=!0,typeof document!="undefined")try{document.body.style.overflow="hidden"}catch(a){}if(typeof window!="undefined")try{window.addEventListener("keydown",kn)}catch(a){}e.nextTick(()=>{if(te.value&&Ve.value){const a=te.value.cloneNode(!0);a.classList.add("fullscreen");const r=a.querySelector("[data-mermaid-wrapper]");r&&(ee.value=r,r.style.transform=ln.value.transform),X(Ve.value),Ve.value.appendChild(a)}})}function Pt(){if(Ge.value=!1,Ve.value&&X(Ve.value),ee.value=null,typeof document!="undefined")try{document.body.style.overflow=""}catch(a){}if(typeof window!="undefined")try{window.removeEventListener("keydown",kn)}catch(a){}}function yn(a,r){let c=null;return(...w)=>{c&&clearTimeout(c),c=setTimeout(()=>a(...w),r)}}function xn(){if(!F.value||!m.value)return;const a=G.value.length;a!==nt.value&&(dt.value=!0,nt.value=a,ie&&clearTimeout(ie),ie=setTimeout(()=>{dt.value&&F.value&&G.value.trim()&&(dt.value=!1,at("preview"))},Pa))}e.watch(ln,a=>{Ge.value&&ee.value&&(ee.value.style.transform=a.transform)},{immediate:!0});function i(){C.value<3&&(C.value+=.1)}function d(){C.value>.5&&(C.value-=.1)}function h(){C.value=1,O.value=0,j.value=0}function N(a){Ce.value=!0,a instanceof MouseEvent?Le.value={x:a.clientX-O.value,y:a.clientY-j.value}:Le.value={x:a.touches[0].clientX-O.value,y:a.touches[0].clientY-j.value}}function B(a){if(!Ce.value)return;let r,c;a instanceof MouseEvent?(r=a.clientX,c=a.clientY):(r=a.touches[0].clientX,c=a.touches[0].clientY),O.value=r-Le.value.x,j.value=c-Le.value.y}function H(){Ce.value=!1}function fe(a){if(n.enableWheelZoom&&(a.ctrlKey||a.metaKey)){if(a.preventDefault(),!te.value)return;const r=te.value.getBoundingClientRect(),c=a.clientX-r.left,w=a.clientY-r.top,_=r.width/2,T=r.height/2,R=c-_,D=w-T,ne=(R-O.value)/C.value,le=(D-j.value)/C.value,zo=-a.deltaY*.01,bn=Math.min(Math.max(C.value+zo,.5),3);bn!==C.value&&(O.value=R-ne*bn,j.value=D-le*bn,C.value=bn)}}function ze(){return L(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(G.value)),K.value=!0,s("copy",G.value),setTimeout(()=>{K.value=!1},1e3)}catch(a){console.error("Failed to copy:",a)}})}function Oe(a,r=null){return L(this,null,function*(){try{const c=r!=null?r:new XMLSerializer().serializeToString(a),w=new Blob([c],{type:"image/svg+xml;charset=utf-8"}),_=URL.createObjectURL(w);if(typeof document!="undefined"){const T=document.createElement("a");T.href=_,T.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(T),T.click(),document.body.removeChild(T)}catch(R){}URL.revokeObjectURL(_)}}catch(c){console.error("Failed to export SVG:",c)}})}function Te(){var w;const a=(w=$.value)==null?void 0:w.querySelector("svg");if(!a){console.error("SVG element not found");return}const r=new XMLSerializer().serializeToString(a),c={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:a,svgString:r};s("export",c),c.defaultPrevented||Oe(a,r)}function We(){var w,_;const a=(_=(w=$.value)==null?void 0:w.querySelector("svg"))!=null?_:null,r=a?new XMLSerializer().serializeToString(a):null,c={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:a,svgString:r};s("openModal",c),c.defaultPrevented||Dn()}function xt(a){const r={payload:{type:"toggle-mode",target:a},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};s("toggleMode",a,r),r.defaultPrevented||at(a)}function at(a){return L(this,null,function*(){const r=gt.value;if(!r){oe.value=!0,F.value=a==="source";return}const c=r.getBoundingClientRect().height;r.style.height=`${c}px`,r.style.overflow="hidden",oe.value=!0,F.value=a==="source",yield e.nextTick();const w=r.scrollHeight;r.style.transition="height 180ms ease",r.offsetHeight,r.style.height=`${w}px`;const _=()=>{r.style.transition="",r.style.height="",r.style.overflow="",r.removeEventListener("transitionend",T)};function T(){_()}r.addEventListener("transitionend",T),setTimeout(()=>_(),220)})}function Ae(){return L(this,null,function*(){if(J.value)return ut.value;if(!$.value&&(yield e.nextTick(),!$.value)){console.warn("Mermaid container not ready");return}return J.value=!0,ut.value=L(null,null,function*(){var a;$.value&&($.value.style.opacity="0");try{const r=yield Z();if(!r)return;const c=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;!Q.value&&!he.value&&((a=r.initialize)==null||a.call(r,it(q({},f.value),{dompurifyConfig:q({},l)})));const w=n.isDark?"dark":"light",_=ve(w),T=yield Ze(()=>r.render(c,_),{timeoutMs:z.value.fullRender}),R=T==null?void 0:T.svg;if($.value){const D=I($.value,R);!Q.value&&!he.value&&(jt(),Q.value=!0,k.value={zoom:C.value,translateX:O.value,translateY:j.value,containerHeight:W.value});const ne=n.isDark?"dark":"light";D&&(Fe.value[ne]=D),he.value&&(he.value=!1),v.value=!1,ot=0,Pe()}}catch(r){const c=ft(r),w=ot+1;if(c&&w<=Fa){ot=w;const _=Math.min(1200,600*w);se(_)}else ot=0,Pe(),console.error("Failed to render mermaid diagram:",r),n.loading===!1&&Et(r)}finally{yield e.nextTick(),$.value&&($.value.style.opacity="1"),J.value=!1,ut.value=null}}),ut.value})}function Nt(a){return L(this,null,function*(){if(rn()&&!(!$.value&&(yield e.nextTick(),!$.value))&&!J.value){J.value=!0;try{const r=yield Z();if(!r)return;const c=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,w=n.isDark?"dark":"light",_=an(a),T=_&&_.trim()?_:a,R=wn(T,w);$.value&&($.value.style.opacity="0");const D=yield Ze(()=>r.render(c,R),{timeoutMs:z.value.render}),ne=D==null?void 0:D.svg;$.value&&ne&&(I($.value,ne),jt())}catch(r){}finally{yield e.nextTick(),$.value&&($.value.style.opacity="1"),J.value=!1}}})}function _t(){return L(this,null,function*(){var D,ne;const a=Date.now(),r=++Ct.value;re&&re.abort(),re=new AbortController;const c=re.signal,w=n.isDark?"dark":"light",_=G.value,T=_.replace(/\s+/g,"");if(!_.trim()){$.value&&X($.value),rt.value=null,Ee.value="",v.value=!1;return}if(T===Ee.value)return;try{const le=yield Ln(_,w,{signal:c,timeoutMs:z.value.worker});if(le.fullOk){yield Ae(),Ct.value===r&&(rt.value=(ne=(D=$.value)==null?void 0:D.innerHTML)!=null?ne:null,Ee.value=T,v.value=!1);return}const Ot=At&&a<=At;if(le.prefixOk&&le.prefix&&rn()&&!Ot){yield Nt(le.prefix);return}}catch(le){if((le==null?void 0:le.name)==="AbortError")return}if(Ct.value!==r||v.value)return;const R=Fe.value[w];R&&$.value&&I($.value,R)})}function Je(){kt&&(kt=!1,qe=800,mt=!1,Re&&(Re.abort(),Re=null),Ye&&(globalThis.clearTimeout(Ye),Ye=null),Ke&&(De(Ke),Ke=null),At=Date.now())}function lt(){if(Je(),re){try{re.abort()}catch(a){}re=null}if(Re){try{Re.abort()}catch(a){}Re=null}Pn(),Pe(),ot=0}function Ft(a=800){kt&&(Ye&&globalThis.clearTimeout(Ye),Ye=globalThis.setTimeout(()=>{Ke=wt(()=>L(null,null,function*(){if(!kt)return;if(F.value||Q.value){Je();return}const r=n.isDark?"dark":"light",c=G.value;if(!c.trim()){Ft(qe);return}Re&&Re.abort(),Re=new AbortController;try{if((yield Tt(c,r,{signal:Re.signal,timeoutMs:z.value.worker}))&&(yield Ae(),Q.value)){Je();return}}catch(w){}qe=Math.min(Math.floor(qe*1.5),4e3),Ft(qe)}),{timeout:500})},a))}function Kt(){kt||F.value||Q.value||(kt=!0,At=0,mt=!0,Ft(500))}e.watch(()=>G.value,()=>{Q.value=!1,Fe.value={},Ue(),!F.value&&m.value&&Kt(),xn()}),e.watch(()=>n.isDark,()=>L(null,null,function*(){if(!Q.value||v.value)return;const a=n.isDark?"dark":"light",r=Fe.value[a];if(r){$.value&&I($.value,r);return}const c={zoom:C.value,translateX:O.value,translateY:j.value,containerHeight:W.value},w=C.value!==1||O.value!==0||j.value!==0;he.value=!0,w&&(C.value=1,O.value=0,j.value=0,yield e.nextTick()),yield Ae(),w&&(yield e.nextTick(),C.value=c.zoom,O.value=c.translateX,j.value=c.translateY,W.value=c.containerHeight,k.value=c)})),e.watch(()=>F.value,a=>L(null,null,function*(){if(a)Je(),Q.value&&(k.value={zoom:C.value,translateX:O.value,translateY:j.value,containerHeight:W.value});else{if(v.value)return;const r=n.isDark?"dark":"light";if(Q.value&&Fe.value[r]){yield e.nextTick(),$.value&&I($.value,Fe.value[r]),C.value=k.value.zoom,O.value=k.value.translateX,j.value=k.value.translateY,W.value=k.value.containerHeight;return}if(yield e.nextTick(),!m.value)return;yield _t(),Kt()}})),e.watch(()=>n.loading,(a,r)=>L(null,null,function*(){if(r===!0&&a===!1){const c=G.value.trim();if(!c)return lt();const w=n.isDark?"dark":"light",_=c.replace(/\s+/g,"");if(Q.value&&_===Ee.value){yield e.nextTick(),$.value&&!$.value.querySelector("svg")&&Fe.value[w]&&I($.value,Fe.value[w]),lt();return}try{yield Tt(c,w,{timeoutMs:z.value.worker}),yield Ae(),Ee.value=_,v.value=!1,lt()}catch(T){lt(),Et(T)}}})),e.watch(te,a=>{ce&&ce.disconnect(),a&&!Q.value&&!he.value&&(ce=new ResizeObserver(r=>{r&&r.length>0&&!Q.value&&!he.value&&yo(()=>{const c=r[0].contentRect.width;jt(c)})}),ce.observe(a))},{immediate:!0}),e.onMounted(()=>L(null,null,function*(){yield e.nextTick(),oe.value||(F.value=!m.value),A.value&&(Ue(),nt.value=G.value.length)})),e.watch(()=>m.value,a=>{oe.value||(F.value=!a)}),e.watch(()=>A.value,a=>{a&&(Q.value||(Ue(),nt.value=G.value.length),!n.loading&&!Q.value&&Ue())},{immediate:!1}),e.onUnmounted(()=>{ie&&clearTimeout(ie),ce&&ce.disconnect(),re&&(re.abort(),re=null),Pn(),Je(),Pe()}),e.watch(()=>Y.value,a=>L(null,null,function*(){a?(Je(),re&&re.abort()):Q.value||(yield e.nextTick(),Ue(),F.value||Kt())}),{immediate:!1});const St=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(a,r)=>(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"])},[a.$slots["header-left"]?(e.openBlock(),e.createElementBlock("div",xa,[e.renderSlot(a.$slots,"header-left",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",ba,[e.createElementVNode("img",{src:e.unref(ia),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,Ba),e.createElementVNode("span",{class:e.normalizeClass(["text-sm font-medium font-mono truncate",n.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),a.$slots["header-center"]?(e.openBlock(),e.createElementBlock("div",Ma,[e.renderSlot(a.$slots,"header-center",{},void 0,!0)])):n.showModeToggle&&m.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",[F.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:r[0]||(r[0]=()=>xt("preview")),onMouseenter:r[1]||(r[1]=c=>ae(c,e.unref(b)("common.preview")||"Preview")),onFocus:r[2]||(r[2]=c=>ae(c,e.unref(b)("common.preview")||"Preview")),onMouseleave:U,onBlur:U},[e.createElementVNode("div",Ca,[r[21]||(r[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(b)("common.preview")||"Preview"),1)])],34),e.createElementVNode("button",{class:e.normalizeClass(["px-2.5 py-1 text-xs rounded transition-colors",[F.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:r[3]||(r[3]=()=>xt("source")),onMouseenter:r[4]||(r[4]=c=>ae(c,e.unref(b)("common.source")||"Source")),onFocus:r[5]||(r[5]=c=>ae(c,e.unref(b)("common.source")||"Source")),onMouseleave:U,onBlur:U},[e.createElementVNode("div",Ea,[r[22]||(r[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(b)("common.source")||"Source"),1)])],34)],2)):e.createCommentVNode("",!0),a.$slots["header-right"]?(e.openBlock(),e.createElementBlock("div",Ta,[e.renderSlot(a.$slots,"header-right",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",Na,[n.showCollapseButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(St.value),"aria-pressed":Y.value,onClick:r[6]||(r[6]=c=>Y.value=!Y.value),onMouseenter:r[7]||(r[7]=c=>ae(c,Y.value?e.unref(b)("common.expand")||"Expand":e.unref(b)("common.collapse")||"Collapse")),onFocus:r[8]||(r[8]=c=>ae(c,Y.value?e.unref(b)("common.expand")||"Expand":e.unref(b)("common.collapse")||"Collapse")),onMouseleave:U,onBlur:U},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:Y.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"},[...r[23]||(r[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,_a)):e.createCommentVNode("",!0),n.showCopyButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(St.value),onClick:ze,onMouseenter:r[9]||(r[9]=c=>gn(c)),onFocus:r[10]||(r[10]=c=>gn(c)),onMouseleave:U,onBlur:U},[K.value?(e.openBlock(),e.createElementBlock("svg",Ia,[...r[25]||(r[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",Sa,[...r[24]||(r[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&&m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(`${St.value} ${Ht.value?"opacity-50 cursor-not-allowed":""}`),disabled:Ht.value,onClick:Te,onMouseenter:r[11]||(r[11]=c=>ae(c,e.unref(b)("common.export")||"Export")),onFocus:r[12]||(r[12]=c=>ae(c,e.unref(b)("common.export")||"Export")),onMouseleave:U,onBlur:U},[...r[26]||(r[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,$a)):e.createCommentVNode("",!0),n.showFullscreenButton&&m.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(`${St.value} ${Ht.value?"opacity-50 cursor-not-allowed":""}`),disabled:Ht.value,onClick:We,onMouseenter:r[13]||(r[13]=c=>ae(c,Ge.value?e.unref(b)("common.minimize")||"Minimize":e.unref(b)("common.open")||"Open")),onFocus:r[14]||(r[14]=c=>ae(c,Ge.value?e.unref(b)("common.minimize")||"Minimize":e.unref(b)("common.open")||"Open")),onMouseleave:U,onBlur:U},[Ge.value?(e.openBlock(),e.createElementBlock("svg",Da,[...r[28]||(r[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",La,[...r[27]||(r[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,Va)):e.createCommentVNode("",!0)]))],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"modeContainerRef",ref:gt},[F.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(G.value),3)],2)):(e.openBlock(),e.createElementBlock("div",Ra,[n.showZoomControls?(e.openBlock(),e.createElementBlock("div",za,[e.createElementVNode("div",Aa,[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:i,onMouseenter:r[15]||(r[15]=c=>ae(c,e.unref(b)("common.zoomIn")||"Zoom in")),onFocus:r[16]||(r[16]=c=>ae(c,e.unref(b)("common.zoomIn")||"Zoom in")),onMouseleave:U,onBlur:U},[...r[29]||(r[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:d,onMouseenter:r[17]||(r[17]=c=>ae(c,e.unref(b)("common.zoomOut")||"Zoom out")),onFocus:r[18]||(r[18]=c=>ae(c,e.unref(b)("common.zoomOut")||"Zoom out")),onMouseleave:U,onBlur:U},[...r[30]||(r[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:h,onMouseenter:r[19]||(r[19]=c=>ae(c,e.unref(b)("common.resetZoom")||"Reset zoom")),onFocus:r[20]||(r[20]=c=>ae(c,e.unref(b)("common.resetZoom")||"Reset zoom")),onMouseleave:U,onBlur:U},e.toDisplayString(Math.round(C.value*100))+"% ",35)])])):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({ref_key:"mermaidContainer",ref:te,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",n.isDark?"bg-gray-900":"bg-gray-50"],style:{height:W.value}},e.toHandlers(M.value,!0),{onMousedown:N,onMousemove:B,onMouseup:H,onMouseleave:H,onTouchstartPassive:N,onTouchmovePassive:B,onTouchendPassive:H}),[e.createElementVNode("div",{"data-mermaid-wrapper":"",class:e.normalizeClass(["absolute inset-0 cursor-grab",{"cursor-grabbing":Ce.value}]),style:e.normalizeStyle(ln.value)},[e.createElementVNode("div",{ref_key:"mermaidContent",ref:$,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"mermaid-dialog",appear:""},{default:e.withCtx(()=>[Ge.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(Pt,["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",Ha,[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:i},[...r[31]||(r[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:d},[...r[32]||(r[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:h},e.toDisplayString(Math.round(C.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:Pt},[...r[33]||(r[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",e.mergeProps({ref_key:"modalContent",ref:Ve,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},e.toHandlers(M.value,!0),{onMousedown:N,onMousemove:B,onMouseup:H,onMouseleave:H,onTouchstartPassive:N,onTouchmovePassive:B,onTouchendPassive:H}),null,16)],2)])):e.createCommentVNode("",!0)]),_:1})]))]))],512),[[e.vShow,!Y.value]])],2))}}),Lt=P(Ka,[["__scopeId","data-v-3636e700"]]);Lt.install=t=>{t.component(Lt.__name,Lt)};const Oa=e.defineComponent({__name:"HtmlInlineNode",props:{node:{}},setup(t){const o=t,n=e.ref(null),s=typeof window!="undefined";function l(){if(!s||!n.value)return;const u=n.value;u.innerHTML="";const f=document.createElement("template");f.innerHTML=o.node.content,u.appendChild(f.content.cloneNode(!0))}function m(){if(!n.value)return;const u=n.value;u.innerHTML="",u.textContent=o.node.content}return e.onMounted(()=>{o.node.loading&&!o.node.autoClosed?m():l()}),e.watch(()=>[o.node.content,o.node.loading,o.node.autoClosed],()=>{o.node.loading&&!o.node.autoClosed?m():l()}),e.onBeforeUnmount(()=>{n.value&&(n.value.innerHTML="")}),(u,f)=>(e.openBlock(),e.createElementBlock("span",{ref_key:"containerRef",ref:n,class:e.normalizeClass(["html-inline-node",{"html-inline-node--loading":o.node.loading}])},null,2))}}),Dt=P(Oa,[["__scopeId","data-v-e632756e"]]);Dt.install=t=>{t.component(Dt.__name,Dt)};const Wa={dir:"auto",class:"paragraph-node"},Xa=e.defineComponent({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=et(o.customId),s=q({inline_code:ke,image:vt,link:Be,hardbreak:bt,emphasis:je,strong:xe,strikethrough:be,highlight:$e,insert:Ie,subscript:Se,superscript:_e,html_inline:Dt,emoji:ge,checkbox:Qe,math_inline:ct,checkbox_input:Qe,reference:ye,footnote_anchor:Vt,footnote_reference:we},n),l=ko();return(m,u)=>(e.openBlock(),e.createElementBlock("p",Wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"paragraph"}-${g}`},[f.type!=="text"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[f.type]),{key:0,node:f,"index-key":`${t.indexKey}-${g}`,"custom-id":o.customId},null,8,["node","index-key","custom-id"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([[e.unref(l)&&f.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},e.toDisplayString(f.content),3))],64))),128))]))}}),Qt=P(Xa,[["__scopeId","data-v-0117537a"]]);Qt.install=t=>{t.component(Qt.__name,Qt)};const Ua=["aria-busy","aria-label","data-language"],Ya=["textContent"],Rt=e.defineComponent({__name:"PreCodeNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{var g,p,y;const m=String((p=(g=o.node)==null?void 0:g.language)!=null?p:"");return String((y=String(m).split(/\s+/g)[0])!=null?y:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=e.computed(()=>`language-${n.value}`),l=e.computed(()=>{const m=n.value;return m?`Code block: ${m}`:"Code block"});return(m,u)=>(e.openBlock(),e.createElementBlock("pre",{class:e.normalizeClass([s.value]),"aria-busy":t.node.loading===!0,"aria-label":l.value,"data-language":n.value,tabindex:"0"},[e.createElementVNode("code",{translate:"no",textContent:e.toDisplayString(t.node.code)},null,8,Ya)],10,Ua))}});Rt.install=t=>{t.component(Rt.__name,Rt)};const qa={class:"table-node-wrapper"},Za=["aria-busy"],Ga={class:"border-[var(--table-border,#cbd5e1)]"},Ja={class:"border-b"},Qa={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},el=e.defineComponent({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>{var u,f,g,p;return(p=(g=(f=(u=o.node)==null?void 0:u.header)==null?void 0:f.cells)==null?void 0:g.length)!=null?p:0}),s=e.computed(()=>{const u=n.value||1,f=Math.floor(100/u);return Array.from({length:u}).map((g,p)=>p===u-1?`${100-f*(u-1)}%`:`${f}%`)}),l=e.computed(()=>{var u;return(u=o.node.loading)!=null?u:!1}),m=e.computed(()=>{var u;return(u=o.node.rows)!=null?u:[]});return(u,f)=>(e.openBlock(),e.createElementBlock("div",qa,[e.createElementVNode("table",{class:e.normalizeClass(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(g,p)=>(e.openBlock(),e.createElementBlock("col",{key:`col-${p}`,style:e.normalizeStyle({width:g})},null,4))),128))]),e.createElementVNode("thead",Ga,[e.createElementVNode("tr",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.header.cells,(g,p)=>(e.openBlock(),e.createElementBlock("th",{key:`header-${p}`,dir:"auto",class:e.normalizeClass(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",[g.align==="right"?"text-right":g.align==="center"?"text-center":"text-left"]])},[e.createVNode(e.unref(He),{nodes:g.children,"index-key":`table-th-${o.indexKey}`,"custom-id":o.customId,typewriter:o.typewriter,onCopy:f[0]||(f[0]=y=>u.$emit("copy",y))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(g,p)=>(e.openBlock(),e.createElementBlock("tr",{key:`row-${p}`,class:e.normalizeClass(["border-[var(--table-border,#cbd5e1)]",[p<m.value.length-1?"border-b":""]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.cells,(y,x)=>(e.openBlock(),e.createElementBlock("td",{key:`cell-${p}-${x}`,class:e.normalizeClass(["p-[calc(4/7*1em)] overflow-x-auto",[y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"]]),dir:"auto"},[e.createVNode(e.unref(He),{nodes:y.children,"index-key":`table-td-${o.indexKey}`,"custom-id":o.customId,typewriter:o.typewriter,onCopy:f[1]||(f[1]=S=>u.$emit("copy",S))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,Za),e.createVNode(e.Transition,{name:"table-node-fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Qa,[e.renderSlot(u.$slots,"loading",{isLoading:l.value},()=>[f[2]||(f[2]=e.createElementVNode("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),f[3]||(f[3]=e.createElementVNode("span",{class:"sr-only"},"Loading",-1))],!0)])):e.createCommentVNode("",!0)]),_:3})]))}}),en=P(el,[["__scopeId","data-v-a874491c"]]);en.install=t=>{t.component(en.__name,en)};const tl={},nl={class:"hr-node"};function ol(t,o){return e.openBlock(),e.createElementBlock("hr",nl)}const tn=P(tl,[["render",ol],["__scopeId","data-v-639cbad9"]]);tn.install=t=>{t.component(tn.__name,tn)};const rl={key:1,class:"html-block-node__placeholder"},al=e.defineComponent({__name:"HtmlBlockNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{const p=o.node.attrs;if(p){if(Array.isArray(p)){const y={};for(const x of p){if(!x||x.length<2)continue;const[S,V]=x;S!=null&&(y[String(S)]=V==null?"":String(V))}return y}return p}}),s=e.ref(null),l=e.ref(typeof window=="undefined"),m=e.ref(o.node.content),u=Sn(),f=e.ref(null),g=!!o.node.loading;return typeof window!="undefined"?(e.watch(s,p=>{var x,S;if((S=(x=f.value)==null?void 0:x.destroy)==null||S.call(x),f.value=null,!g){l.value=!0,m.value=o.node.content;return}if(!p){l.value=!1;return}const y=u(p,{rootMargin:"400px"});f.value=y,l.value=y.isVisible.value,y.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),e.watch(()=>o.node.content,p=>{(!g||l.value)&&(m.value=p)})):l.value=!0,e.onBeforeUnmount(()=>{var p,y;(y=(p=f.value)==null?void 0:p.destroy)==null||y.call(p),f.value=null}),(p,y)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"htmlRef",ref:s,class:"html-block-node"},n.value),[l.value?e.withMemo([m.value],()=>(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:m.value},null,8,["innerHTML"])),y,0):(e.openBlock(),e.createElementBlock("div",rl,[e.renderSlot(p.$slots,"placeholder",{node:t.node},()=>[y[1]||(y[1]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar"},null,-1)),y[2]||(y[2]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),y[3]||(y[3]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),ll=P(al,[["__scopeId","data-v-ed22b926"]]),il={class:"unknown-node"},ro=e.defineComponent({__name:"FallbackComponent",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",il,e.toDisplayString(t.node.raw),1))}}),sl=["data-node-index","data-node-type"],cl=900,ul=640,dl=200,ml=1800,fl=e.defineComponent({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},customHtmlTags:{},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 Pt,yn,xn;const n=t,s=o,l=e.ref(),m=e.ref(!1),u=/auto|scroll|overlay/i;function f(i){if(typeof window=="undefined")return null;const d=i!=null?i:l.value;if(!d)return null;const h=d.ownerDocument||document,N=h.scrollingElement||h.documentElement;let B=d;for(;B&&!(B===h.body||B===N);){const H=window.getComputedStyle(B),fe=(H.overflowY||"").toLowerCase(),ze=(H.overflow||"").toLowerCase();if(u.test(fe)||u.test(ze))return B;B=B.parentElement}return null}const g=n.customId?`renderer-${n.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,p=Bn.getMarkdown(g),y=e.computed(()=>{const i=n.customHtmlTags;return!i||i.length===0?p:Bn.getMarkdown(g,{customHtmlTags:i})}),x=e.computed(()=>{const i=y.value;return n.customMarkdownIt?n.customMarkdownIt(i):i});function S(i){const d=String(i!=null?i:"").trim();if(!d)return"";const h=d.match(/^[<\s/]*([A-Z][\w-]*)/i);return h?h[1].toLowerCase():""}const V=e.computed(()=>{var B,H,fe;const i=(B=n.parseOptions)!=null?B:{},d=(H=n.customHtmlTags)!=null?H:[],h=(fe=i.customHtmlTags)!=null?fe:[],N=[...d,...h].map(S).filter(Boolean);return N.length?it(q({},i),{customHtmlTags:Array.from(new Set(N))}):i}),E=e.computed(()=>{var i;if((i=n.nodes)!=null&&i.length)return e.markRaw(n.nodes.slice());if(n.content){const d=Bn.parseMarkdownToStructure(n.content,x.value,V.value);return e.markRaw(d)}return[]}),X=e.computed(()=>{var i;return Math.max(1,(i=n.maxLiveNodes)!=null?i:320)}),I=e.computed(()=>{var i;return((i=n.maxLiveNodes)!=null?i:0)<=0?!1:E.value.length>X.value}),b=e.computed(()=>!(n.viewportPriority===!1||m.value||n.deferNodesUntilVisible===!1||I.value||E.value.length>cl)),Z=vr(i=>{var d;return f((d=i!=null?i:l.value)!=null?d:null)},b),K=typeof window!="undefined",Y=K&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,te=K&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,$=typeof globalThis!="undefined"&&typeof globalThis.process!="undefined"&&((yn=(Pt=globalThis.process)==null?void 0:Pt.env)==null?void 0:yn.NODE_ENV)==="test",Ve=K&&typeof window.requestIdleCallback=="function",ee=e.computed(()=>{var d;const i=Math.trunc((d=n.renderBatchSize)!=null?d:80);return Number.isFinite(i)?Math.max(0,i):0}),Me=e.computed(()=>{var d;const i=Math.trunc((d=n.initialRenderBatchSize)!=null?d:ee.value);return Number.isFinite(i)?Math.max(0,i):ee.value}),tt=e.computed(()=>n.batchRendering!==!1&&ee.value>0&&K&&!$),A=e.ref(0),gt=e.ref({key:n.indexKey,total:0}),G=e.ref(Math.max(1,ee.value||1)),ve=e.reactive({}),C=new Map,O=new Map,j=new Map,Ce=e.ref(null);let Le=null,F=null;const oe=e.computed(()=>!1),J=e.computed(()=>{var i;return tt.value&&((i=n.maxLiveNodes)!=null?i:0)<=0}),ut=e.ref({batchSize:ee.value,initial:Me.value,delay:(xn=n.renderBatchDelay)!=null?xn:16,enabled:J.value}),nt=e.computed(()=>!!Z&&(oe.value||I.value)),dt=e.computed(()=>{var i;return Math.max(0,(i=n.liveNodeBuffer)!=null?i:60)}),ie=e.ref(0),me=e.reactive({start:0,end:0}),ot=new Map,wt=e.computed(()=>{if(!I.value)return E.value.length;const i=dt.value,d=Math.max(me.end+i,Me.value),h=Math.min(E.value.length,d);return Math.max(A.value,h)});function Ue(i){var N,B,H;const d=f((N=l.value)!=null?N:null);if(d)return d;const h=(H=(B=l.value)==null?void 0:B.ownerDocument)!=null?H:typeof document!="undefined"?document:null;return(h==null?void 0:h.scrollingElement)||(h==null?void 0:h.documentElement)||null}function Pe(){Le&&(Le(),Le=null),Ce.value=null}function se(){if(!K||!I.value)return;const i=Ue();if(!i||Ce.value===i)return;Pe();const d=()=>ce();i.addEventListener("scroll",d,{passive:!0}),Ce.value=i,Le=()=>{i.removeEventListener("scroll",d)}}function W(){var d,h,N;if(!F)return;const i=(N=(h=(d=l.value)==null?void 0:d.ownerDocument)==null?void 0:h.defaultView)!=null?N:typeof window!="undefined"?window:null;F.viaTimeout?i?i.clearTimeout(F.id):clearTimeout(F.id):te==null||te(F.id),F=null}function ce(i={}){var h,N,B;if(!I.value)return;if(!K){Q(!0);return}if(i.immediate){W(),Q(!0);return}if(F)return;const d=()=>{F=null,Q()};if(Y)F={id:Y(d),viaTimeout:!1};else{const H=(B=(N=(h=l.value)==null?void 0:h.ownerDocument)==null?void 0:N.defaultView)!=null?B:typeof window!="undefined"?window:null;F={id:H?H.setTimeout(d,16):setTimeout(d,16),viaTimeout:!0}}}function Q(i=!1){var at,Ae,Nt,_t,Je,lt,Ft,Kt,St,sn,cn;if(!I.value)return;const d=Ce.value||Ue();if(!d)return;const h=d.ownerDocument||((at=l.value)==null?void 0:at.ownerDocument)||document,N=(h==null?void 0:h.defaultView)||(typeof window!="undefined"?window:null),B=d===(h==null?void 0:h.documentElement)||d===(h==null?void 0:h.body),H=B?null:d.getBoundingClientRect(),fe=B?0:H.top,ze=B?(Nt=(Ae=N==null?void 0:N.innerHeight)!=null?Ae:d.clientHeight)!=null?Nt:0:H.bottom,Oe=Array.from(j.entries()).sort((a,r)=>a[0]-r[0]);let Te=null,We=null;for(const[a,r]of Oe){if(!r)continue;const c=r.getBoundingClientRect();c.bottom<=fe||c.top>=ze||(Te==null&&(Te=a),We=a)}if(Te==null||We==null){const a=l.value;if(!a)return;const r=B?{top:0}:d.getBoundingClientRect(),c=a.getBoundingClientRect(),w=B?(Ft=(lt=(_t=h==null?void 0:h.documentElement)==null?void 0:_t.scrollTop)!=null?lt:(Je=h==null?void 0:h.body)==null?void 0:Je.scrollTop)!=null?Ft:0:d.scrollTop,_=c.top-(B?0:r.top)+w,T=Math.max(0,w-_),R=B?(cn=(sn=(St=N==null?void 0:N.innerHeight)!=null?St:(Kt=h==null?void 0:h.documentElement)==null?void 0:Kt.clientHeight)!=null?sn:d.clientHeight)!=null?cn:0:d.clientHeight,D=T+Math.max(0,R)*.5,ne=De(D);ie.value=he(ne,0,Math.max(0,E.value.length-1));return}const xt=Math.round((Te+We)/2);!i&&Math.abs(xt-ie.value)<=1||(ie.value=he(xt,0,Math.max(0,E.value.length-1)))}function he(i,d,h){return Math.min(Math.max(i,d),h)}function Fe(){const i=E.value.length;if(!I.value||i===0){me.start=0,me.end=i;return}const d=Math.min(X.value,i),h=dt.value,N=he(ie.value-h,0,Math.max(0,i-d));me.start=N,me.end=Math.min(i,N+d)}const rt=e.reactive({}),Ee=e.reactive({total:0,count:0});function Ct(i,d){if(!Number.isFinite(d)||d<=0)return;const h=rt[i];rt[i]=d,h?Ee.total+=d-h:(Ee.total+=d,Ee.count++)}const re=e.computed(()=>Ee.count>0?Math.max(12,Ee.total/Ee.count):32);function v(i,d){var N;if(i>=d)return 0;let h=0;for(let B=i;B<d;B++)h+=(N=rt[B])!=null?N:re.value;return h}const k=e.computed(()=>{if(!I.value)return E.value.map((N,B)=>({node:N,index:B}));const i=E.value.length,d=he(me.start,0,i),h=he(me.end,d,i);return E.value.slice(d,h).map((N,B)=>({node:N,index:d+B}))}),M=e.computed(()=>I.value?v(0,Math.min(me.start,E.value.length)):0),z=e.computed(()=>{if(!I.value)return 0;const i=E.value.length,d=Math.min(me.end,i);return v(d,i)});function De(i){var N;if(i<=0)return 0;let d=i;const h=E.value;for(let B=0;B<h.length;B++){const H=(N=rt[B])!=null?N:re.value;if(d<=H)return B;d-=H}return Math.max(0,h.length-1)}function Ye(i){if(C.size&&I.value)for(const[d,h]of C)d>=i&&(h.destroy(),C.delete(d),oe.value&&delete ve[d],U(d),j.delete(d))}function Ke(i,d){oe.value&&(ve[i]=d),d&&(I.value?ce():ie.value=he(i,0,Math.max(0,E.value.length-1)))}function kt(i){return J.value&&i>=A.value?!1:!oe.value||i<Me.value?!0:ve[i]===!0}function qe(i){const d=C.get(i);d&&(d.destroy(),C.delete(i)),U(i)}function Re(i,d){if(d?j.set(i,d):j.delete(i),d||U(i),!nt.value||!Z){qe(i),d?Ke(i,!0):oe.value&&delete ve[i];return}if(!I.value&&oe.value&&!m.value&&C.size>=ul&&(wn(),!nt.value||!Z)){qe(i),d?Ke(i,!0):oe.value&&delete ve[i];return}if(i<Me.value&&!I.value){qe(i),Ke(i,!0);return}if(!d){qe(i),oe.value&&delete ve[i];return}qe(i);const h=Z(d,{rootMargin:"400px"});h&&(C.set(i,h),Ke(i,h.isVisible.value),oe.value&&gn(i),h.whenVisible.then(()=>{U(i),Ke(i,!0)}).catch(()=>{}).finally(()=>{C.get(i)===h&&C.delete(i);try{h.destroy()}catch(N){}}),I.value&&ce())}function At(i,d){if(!d){ot.delete(i);return}ot.set(i,d),queueMicrotask(()=>{Ct(i,d.offsetHeight)})}let mt=null,Ze=null,Et=!1,ft=null,yt=null;function ae(){K&&(mt!=null&&(te==null||te(mt),mt=null),Ze!=null&&(window.clearTimeout(Ze),Ze=null),yt!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(yt),yt=null),Et=!1,ft=null)}function U(i){if(!K)return;const d=O.get(i);d!=null&&(window.clearTimeout(d),O.delete(i))}function gn(i){if(!K||!oe.value)return;U(i);const d=window.setTimeout(()=>{O.delete(i),Ke(i,!0)},ml);O.set(i,d)}function wn(i){if(!m.value){m.value=!0;for(const d of C.values())d.destroy();if(C.clear(),K)for(const d of O.values())window.clearTimeout(d);O.clear();for(const d of Object.keys(ve))delete ve[d]}}function rn(i,d={}){var fe,ze;if(!J.value)return;const h=wt.value;if(A.value>=h)return;const N=Math.max(1,i),B=Oe=>{var Ae;mt=null,Ze=null,yt=null,Et=!1;const Te=ft!=null?ft:N;ft=null;const We=Math.max(2,(Ae=n.renderBatchBudgetMs)!=null?Ae:6),xt=Nt=>{const _t=typeof performance!="undefined"?performance.now():Date.now();A.value=Math.min(h,A.value+Math.max(1,Nt)),Ye(A.value);const lt=(typeof performance!="undefined"?performance.now():Date.now())-_t;return Vn(lt),lt};let at=Te;for(;xt(at),!(A.value>=h||!Oe||(typeof Oe.timeRemaining=="function"?Oe.timeRemaining():0)<=We*.5);)at=Math.max(1,Math.round(G.value));A.value<h&&an()};if(!K||d.immediate){B();return}const H=Math.max(0,(fe=n.renderBatchDelay)!=null?fe:16);if(ft=ft!=null?Math.max(ft,N):N,!Et){if(Et=!0,!$&&Ve&&window.requestIdleCallback){const Oe=Math.max(0,(ze=n.renderBatchIdleTimeoutMs)!=null?ze:120);yt=window.requestIdleCallback(Te=>{B(Te)},{timeout:Oe});return}if(!Y||$){Ze=window.setTimeout(()=>B(),H);return}mt=Y(()=>{if(H===0){B();return}Ze=window.setTimeout(()=>B(),H)})}}function an(){if(!J.value)return;const i=tt.value?Math.max(1,Math.round(G.value)):Math.max(1,ee.value);rn(i)}function Vn(i){var B;if(!J.value)return;const d=Math.max(2,(B=n.renderBatchBudgetMs)!=null?B:6),h=Math.max(1,ee.value||1),N=Math.max(1,Math.floor(h/4));i>d*1.2?G.value=Math.max(N,Math.floor(G.value*.7)):i<d*.5&&G.value<h&&(G.value=Math.min(h,Math.ceil(G.value*1.2)))}e.watch([()=>E.value,()=>E.value.length,()=>J.value,()=>ee.value,()=>Me.value,()=>n.renderBatchDelay,()=>n.indexKey],()=>{var Ae;const d=E.value.length,h=gt.value,N=n.indexKey,B=N!==void 0&&N!==h.key,H=d!==h.total,fe=B||H;gt.value={key:N,total:d};const ze=ut.value,Oe=(Ae=n.renderBatchDelay)!=null?Ae:16,Te=ze.batchSize!==ee.value||ze.initial!==Me.value||ze.delay!==Oe||ze.enabled!==J.value;ut.value={batchSize:ee.value,initial:Me.value,delay:Oe,enabled:J.value},(fe||Te||!J.value)&&ae(),(fe||Te)&&(G.value=Math.max(1,ee.value||1)),fe&&I.value&&ce({immediate:!0});const We=wt.value;if(!d){A.value=0,Ye(0);return}if(!J.value){A.value=We,Ye(A.value);return}B||h.total===0||Te?A.value=Math.min(We,Me.value):A.value=Math.min(A.value,We);const at=Math.max(1,Me.value||ee.value||d);A.value<We?rn(at,{immediate:!K}):Ye(A.value)},{immediate:!0}),e.watch(()=>I.value,i=>{if(!i){Pe(),W();return}se(),ce({immediate:!0})},{immediate:!0}),e.watch(()=>l.value,()=>{I.value&&(se(),ce({immediate:!0}))}),e.watch(()=>E.value.length,()=>{I.value&&ce({immediate:!0})}),e.watch(()=>oe.value,i=>{if(!i){for(const d of C.values())d.destroy();C.clear();for(const d of Array.from(O.keys()))U(d);for(const d of Object.keys(ve))delete ve[d];for(const[d,h]of j)h&&Ke(d,!0);return}for(const[d,h]of j)Re(d,h)},{immediate:!1}),e.watch([()=>n.viewportPriority,()=>E.value.length],([i,d])=>{if(i===!1){m.value=!1;return}m.value&&d<=dl&&(m.value=!1)}),e.watch(()=>A.value,()=>{I.value&&ce({immediate:!0})}),e.watch([ie,X,dt,()=>E.value.length,I],()=>{Fe()},{immediate:!0}),e.watch(()=>wt.value,(i,d)=>{J.value&&(typeof d=="number"&&i<=d||i>A.value&&an())}),e.onBeforeUnmount(()=>{ae();for(const i of C.values())i.destroy();C.clear();for(const i of Array.from(O.keys()))U(i);Pe(),W()});const Tt=e.defineAsyncComponent(()=>L(null,null,function*(){try{return(yield Promise.resolve().then(()=>require("./index-BS4IAchB.cjs"))).default}catch(i){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".',i),Rt}})),Ln=e.computed(()=>n.renderCodeBlocksAsPre?Rt:Tt),Ht={text:de,paragraph:Qt,heading:$n,code_block:Tt,list:Jt,blockquote:Yt,table:en,definition_list:qt,footnote:Zt,footnote_reference:we,footnote_anchor:Vt,admonition:nn,hardbreak:bt,link:Be,image:vt,thematic_break:tn,math_inline:ct,math_block:_r,strong:xe,emphasis:je,strikethrough:be,highlight:$e,insert:Ie,subscript:Se,superscript:_e,emoji:ge,checkbox:Qe,checkbox_input:Qe,inline_code:ke,html_inline:Dt,reference:ye,html_block:ll};function jt(i){var N;if(!i)return ro;const d=et(n.customId),h=d[String(i.type)];if(i.type==="code_block"){if(String((N=i.language)!=null?N:"").trim().toLowerCase()==="mermaid")return d.mermaid||Lt;if(h)return h;const H=d.code_block;return H||Ln.value}return h||Ht[String(i.type)]||ro}function Ge(i){var d;return(i==null?void 0:i.type)==="code_block"&&String((d=i.language)!=null?d:"").trim().toLowerCase()==="mermaid"?{}:i.type==="code_block"?q({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 ln(i){s("click",i)}function kn(i){var h;(h=i.target)!=null&&h.closest("[data-node-index]")&&s("mouseover",i)}function Dn(i){var h;(h=i.target)!=null&&h.closest("[data-node-index]")&&s("mouseout",i)}return(i,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:l,class:"markdown-renderer",onClick:ln,onMouseover:kn,onMouseout:Dn},[I.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"node-spacer",style:e.normalizeStyle({height:`${M.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,h=>{var N;return e.openBlock(),e.createElementBlock("div",{key:h.index,ref_for:!0,ref:B=>Re(h.index,B),class:"node-slot","data-node-index":h.index,"data-node-type":h.node.type},[kt(h.index)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_for:!0,ref:B=>At(h.index,B),class:"node-content"},[h.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(jt(h.node)),e.mergeProps({node:h.node,loading:h.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${h.index}`},{ref_for:!0},Ge(h.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:d[0]||(d[0]=B=>s("copy",B)),onHandleArtifactClick:d[1]||(d[1]=B=>s("handleArtifactClick",B))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(jt(h.node)),e.mergeProps({key:1,node:h.node,loading:h.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${h.index}`},{ref_for:!0},Ge(h.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:d[2]||(d[2]=B=>s("copy",B)),onHandleArtifactClick:d[3]||(d[3]=B=>s("handleArtifactClick",B))}),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:`${(N=rt[h.index])!=null?N:re.value}px`})},null,4))],8,sl)}),128)),I.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"node-spacer",style:e.normalizeStyle({height:`${z.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0)],544))}}),He=P(fl,[["__scopeId","data-v-0327402f"]]);He.install=t=>{var n,s;const o=(s=(n=He.__name)!=null?n:He.name)!=null?s:"NodeRenderer";t.component(o,He)};const pl={key:0,class:"admonition-icon"},hl={class:"admonition-title"},vl=["aria-expanded","aria-controls","title"],gl={key:0},wl={key:1},kl=["id"],yl=e.defineComponent({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t,{emit:o}){var p;const n=t,s=o,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},m=e.computed(()=>{if(n.node.title&&n.node.title.trim().length)return n.node.title;const y=n.node.kind||"note";return y.charAt(0).toUpperCase()+y.slice(1)}),u=e.ref(n.node.collapsible?!((p=n.node.open)==null||p):!1);function f(){n.node.collapsible&&(u.value=!u.value)}const g=`admonition-${Math.random().toString(36).slice(2,9)}`;return(y,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["admonition",[`admonition-${n.node.kind}`,n.isDark?"is-dark":""]])},[e.createElementVNode("div",{id:g,class:"admonition-header"},[l[n.node.kind]?(e.openBlock(),e.createElementBlock("span",pl,e.toDisplayString(l[n.node.kind]),1)):e.createCommentVNode("",!0),e.createElementVNode("span",hl,e.toDisplayString(m.value),1),n.node.collapsible?(e.openBlock(),e.createElementBlock("button",{key:1,class:"admonition-toggle","aria-expanded":!u.value,"aria-controls":`${g}-content`,title:u.value?"Expand":"Collapse",onClick:f},[u.value?(e.openBlock(),e.createElementBlock("span",gl,"▶")):(e.openBlock(),e.createElementBlock("span",wl,"▼"))],8,vl)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("div",{id:`${g}-content`,class:"admonition-content","aria-labelledby":g},[e.withMemo([n.node.children],()=>e.createVNode(e.unref(He),{"index-key":`admonition-${t.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:x[0]||(x[0]=S=>s("copy",S))},null,8,["index-key","nodes","custom-id","typewriter"]),x,1)],8,kl),[[e.vShow,!u.value]])],2))}}),nn=P(yl,[["__scopeId","data-v-5e95c2b7"]]);nn.install=t=>{t.component(nn.__name,nn)};let ao=!1;function xl(t){return L(this,null,function*(){if(!ao)return ao=!0,t.preloadMonacoWorkers()})}let un=null,lo=!1;function bl(){return L(this,null,function*(){if(un)return un;if(lo)return null;try{return un=yield import("stream-monaco"),yield xl(un),un}catch(t){return lo=!0,null}})}const Bl='<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>',Ml=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
1
|
+
"use strict";var Ao=Object.create;var Rn=Object.defineProperty,Ho=Object.defineProperties,jo=Object.getOwnPropertyDescriptor,Po=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertyNames,Qn=Object.getOwnPropertySymbols,Ko=Object.getPrototypeOf,to=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var eo=(t,o,n)=>o in t?Rn(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,q=(t,o)=>{for(var n in o||(o={}))to.call(o,n)&&eo(t,n,o[n]);if(Qn)for(var n of Qn(o))Oo.call(o,n)&&eo(t,n,o[n]);return t},st=(t,o)=>Ho(t,Po(o));var Wo=(t,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of Fo(o))!to.call(t,l)&&l!==n&&Rn(t,l,{get:()=>o[l],enumerable:!(s=jo(o,l))||s.enumerable});return t};var Wt=(t,o,n)=>(n=t!=null?Ao(Ko(t)):{},Wo(o||!t||!t.__esModule?Rn(n,"default",{value:t,enumerable:!0}):n,t));var L=(t,o,n)=>new Promise((s,l)=>{var m=g=>{try{f(n.next(g))}catch(h){l(h)}},u=g=>{try{f(n.throw(g))}catch(h){l(h)}},f=g=>g.done?s(g.value):Promise.resolve(g.value).then(m,u);f((n=n.apply(t,o)).next())});const Bn=require("stream-markdown-parser"),e=require("vue"),Xt=require("@floating-ui/dom");var zn=typeof document!="undefined"?document.currentScript:null;const Xo=["cite"],Uo=e.defineComponent({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createElementBlock("blockquote",{class:"blockquote",dir:"auto",cite:t.node.cite},[e.withMemo([o.node.children],()=>e.createVNode(e.unref(je),{"index-key":`blockquote-${o.indexKey}`,nodes:o.node.children||[],"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[0]||(s[0]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter"]),s,1)],8,Xo))}}),P=(t,o)=>{const n=t.__vccOpts||t;for(const[s,l]of o)n[s]=l;return n},Yt=P(Uo,[["__scopeId","data-v-eeadc8a3"]]);Yt.install=t=>{t.component(Yt.__name,Yt)};const Yo={class:"checkbox-node"},qo=["checked"],Zo=e.defineComponent({__name:"CheckboxNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",Yo,[e.createElementVNode("input",{type:"checkbox",checked:t.node.checked,disabled:"",class:"checkbox-input"},null,8,qo)]))}}),et=P(Zo,[["__scopeId","data-v-8dc6c46f"]]);et.install=t=>{t.component(et.__name,et)};const Go={class:"definition-list"},Jo={class:"definition-term"},Qo={class:"definition-desc"},er=e.defineComponent({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createElementBlock("dl",Go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.node.items,(l,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[e.createElementVNode("dt",Jo,[e.createVNode(e.unref(je),{"index-key":`definition-term-${o.indexKey}-${m}`,nodes:l.term,"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[0]||(s[0]=u=>n.$emit("copy",u))},null,8,["index-key","nodes","custom-id","typewriter"])]),e.createElementVNode("dd",Qo,[e.createVNode(e.unref(je),{"index-key":`definition-desc-${o.indexKey}-${m}`,nodes:l.definition,"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[1]||(s[1]=u=>n.$emit("copy",u))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),qt=P(er,[["__scopeId","data-v-f88691d6"]]);qt.install=t=>{t.component(qt.__name,qt)};const tr={class:"emoji-node"},nr=e.defineComponent({__name:"EmojiNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("span",tr,e.toDisplayString(t.node.name),1))}}),ge=P(nr,[["__scopeId","data-v-de55dc97"]]);ge.install=t=>{t.component(ge.__name,ge)};const hn="__global__",Vt={};function or(t,o){typeof t=="string"?Vt[t]=o||{}:Vt[hn]=t||{}}function tt(t){return t?Vt[t]||Vt[hn]||{}:Vt[hn]||{}}function rr(t){if(t===hn)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete Vt[t]}function ar(){delete Vt[hn]}const lr=["id"],ir=["title"],sr=e.defineComponent({__name:"FootnoteReferenceNode",props:{node:{}},setup(t){const n=`#footnote-${t.node.id}`;function s(){if(typeof document=="undefined")return;const l=document.querySelector(n);l?l.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(l,m)=>(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,ir)],8,lr))}}),we=P(sr,[["__scopeId","data-v-01af0fee"]]);we.install=t=>{t.component(we.__name,we)};const cr=e.defineComponent({__name:"HtmlInlineNode",props:{node:{}},setup(t){const o=t,n=e.ref(null),s=typeof window!="undefined";function l(){if(!s||!n.value)return;const u=n.value;u.innerHTML="";const f=document.createElement("template");f.innerHTML=o.node.content,u.appendChild(f.content.cloneNode(!0))}function m(){if(!n.value)return;const u=n.value;u.innerHTML="",u.textContent=o.node.content}return e.onMounted(()=>{o.node.loading&&!o.node.autoClosed?m():l()}),e.watch(()=>[o.node.content,o.node.loading,o.node.autoClosed],()=>{o.node.loading&&!o.node.autoClosed?m():l()}),e.onBeforeUnmount(()=>{n.value&&(n.value.innerHTML="")}),(u,f)=>(e.openBlock(),e.createElementBlock("span",{ref_key:"containerRef",ref:n,class:e.normalizeClass(["html-inline-node",{"html-inline-node--loading":o.node.loading}])},null,2))}}),ke=P(cr,[["__scopeId","data-v-e632756e"]]);ke.install=t=>{t.component(ke.__name,ke)};const ur={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-['']"},ye=e.defineComponent({__name:"InlineCodeNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("code",ur,e.toDisplayString(t.node.code),1))}});ye.install=t=>{t.component(ye.__name,ye)};const dr=["id"],mr=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(g){}return!1}),s=e.ref(null),l=e.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),m=e.ref(!1);let u=null;function f(){return L(this,null,function*(){var x,S;if(!o.anchorEl||!s.value)return;const g=[Xt.offset((x=o.offset)!=null?x:8),Xt.flip(),Xt.shift({padding:8})],{x:h,y}=yield Xt.computePosition(o.anchorEl,s.value,{placement:(S=o.placement)!=null?S:"top",middleware:g,strategy:"fixed"});l.value.transform=`translate3d(${Math.round(h)}px, ${Math.round(y)}px, 0)`,l.value.left="0px",l.value.top="0px"})}return e.watch(()=>o.visible,g=>L(null,null,function*(){if(g)if(m.value=!1,yield e.nextTick(),o.anchorEl&&s.value)try{const h=o.anchorEl.getBoundingClientRect();yield f();const y=l.value.transform;if(o.originX!=null&&o.originY!=null){const x=Math.abs(Number(o.originX)-h.left),S=Math.abs(Number(o.originY)-h.top);Math.hypot(x,S)>120?(l.value.transform=`translate3d(${Math.round(o.originX)}px, ${Math.round(o.originY)}px, 0)`,yield e.nextTick(),m.value=!0,yield e.nextTick(),l.value.transform=y):m.value=!0}else m.value=!0;u=Xt.autoUpdate(o.anchorEl,s.value,f)}catch(h){yield f(),m.value=!0,u=Xt.autoUpdate(o.anchorEl,s.value,f)}else m.value=!0;else m.value=!1,u&&(u(),u=null)})),e.watch([()=>o.anchorEl,()=>o.placement,()=>o.content],()=>L(null,null,function*(){o.visible&&o.anchorEl&&s.value&&(yield e.nextTick(),yield f())})),e.onBeforeUnmount(()=>{u&&u()}),(g,h)=>(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:l.value.left,top:l.value.top,transform:l.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,dr),[[e.vShow,t.visible&&m.value]])]),_:1})]))}}),fr=P(mr,[["__scopeId","data-v-993f63aa"]]),Kn=e.ref(!1),mo=e.ref(""),fo=e.ref("top"),mn=e.ref(null),pn=e.ref(null),On=e.ref(null),Wn=e.ref(null),ho=e.ref(null);let Mn=null,Cn=null;function po(){Mn&&(clearTimeout(Mn),Mn=null),Cn&&(clearTimeout(Cn),Cn=null)}let no=!1;function hr(){if(no||typeof document=="undefined")return;no=!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(fr,{visible:Kn.value,"anchor-el":mn.value,content:mo.value,placement:fo.value,id:pn.value,originX:On.value,originY:Wn.value,isDark:(n=ho.value)!=null?n:void 0})}}};e.createApp(o).mount(t)}function on(t,o,n="top",s=!1,l,m){if(!t)return;hr(),po();const u=()=>{var f,g;pn.value=`tooltip-${Date.now()}-${Math.floor(Math.random()*1e3)}`,mn.value=t,mo.value=o,fo.value=n,On.value=(f=l==null?void 0:l.x)!=null?f:null,Wn.value=(g=l==null?void 0:l.y)!=null?g:null,ho.value=typeof m=="boolean"?m:null,Kn.value=!0;try{t.setAttribute("aria-describedby",pn.value)}catch(h){}};s?u():Mn=setTimeout(u,80)}function Nn(t=!1){po();const o=()=>{if(mn.value&&pn.value)try{mn.value.removeAttribute("aria-describedby")}catch(n){}Kn.value=!1,mn.value=null,pn.value=null,On.value=null,Wn.value=null};t?o():Cn=setTimeout(o,120)}function pr(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 vo={"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 vr(t){Object.assign(vo,t)}function _n(){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=vo[o])!=null?n:pr(o)};return L(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(l){}}catch(s){}}catch(o){}}),{t}}const go=Symbol("ViewportPriority");function gr(t,o){const n=typeof window!="undefined"&&typeof document!="undefined",s=typeof o=="boolean"?e.ref(o):o;let l=null,m=null;const u=new WeakMap;function f(h){var S,V,E;if(l||!n)return l;if(typeof IntersectionObserver=="undefined")return null;const y=(S=t==null?void 0:t(h!=null?h:null))!=null?S:null,x=m||{};return l=new IntersectionObserver(X=>{for(const I of X){const b=u.get(I.target);if(!b)continue;if(I.isIntersecting||I.intersectionRatio>0){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch(K){}}l==null||l.unobserve(I.target),u.delete(I.target)}}},{root:y,rootMargin:(V=x.rootMargin)!=null?V:"300px",threshold:(E=x.threshold)!=null?E:0}),l}const g=(h,y)=>{const x=e.ref(!1);let S=!1,V;const E=new Promise(b=>{V=()=>{S||(S=!0,b())}}),X=()=>{try{l==null||l.unobserve(h)}catch(b){}u.delete(h)};if(!n||!s.value)return x.value=!0,V(),{isVisible:x,whenVisible:E,destroy:X};!m&&y&&(m=q({},y));const I=f(h);return I?(u.set(h,{resolve:V,visible:x}),I.observe(h),{isVisible:x,whenVisible:E,destroy:X}):(x.value=!0,V(),{isVisible:x,whenVisible:E,destroy:X})};return e.provide(go,g),g}function Sn(){const t=e.inject(go,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(m=>{for(const u of m){const f=o.get(u.target);if(!f)continue;if(u.isIntersecting||u.intersectionRatio>0){if(!f.visible.value){f.visible.value=!0;try{f.resolve()}catch(h){}}n==null||n.unobserve(u.target),o.delete(u.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return m=>{const u=e.ref(!1);let f=!1,g;const h=new Promise(S=>{g=()=>{f||(f=!0,S())}}),y=()=>{try{n==null||n.unobserve(m)}catch(S){}o.delete(m)},x=s();return x?(o.set(m,{resolve:g,visible:u}),x.observe(m),{isVisible:u,whenVisible:h,destroy:y}):(u.value=!0,g(),{isVisible:u,whenVisible:h,destroy:y})}}const wr={class:"relative inline-block"},kr=["src","alt","title","loading","tabindex","aria-label"],yr={class:"text-sm whitespace-nowrap"},xr={key:1,class:"text-sm text-gray-500"},br={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},Br={class:"text-sm whitespace-nowrap"},Mr={key:0,class:"mt-2 text-sm text-gray-500 italic"},Cr=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,l=e.ref(!1),m=e.ref(!1),u=e.ref(!1),f=e.ref(null),g=Sn(),h=e.ref(null),y=e.ref(typeof window=="undefined");typeof window!="undefined"&&e.watch(()=>f.value,Z=>{var Y;if((Y=h.value)==null||Y.destroy(),h.value=null,!Z){y.value=!1;return}const K=g(Z,{rootMargin:"400px"});h.value=K,y.value=K.isVisible.value,K.whenVisible.then(()=>{y.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var Z;(Z=h.value)==null||Z.destroy(),h.value=null});const x=e.computed(()=>m.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),S=e.computed(()=>!n.lazy||y.value),V=e.computed(()=>/\.svg(?:\?|$)/i.test(x.value));function E(){n.fallbackSrc&&!u.value?(u.value=!0,m.value=!0):(m.value=!0,s("error",n.node.src))}function X(){l.value=!0,m.value=!1,s("load",x.value)}function I(Z){Z.preventDefault(),!(!l.value||m.value)&&s("click",[Z,x.value])}const{t:b}=_n();return e.watch(x,()=>{l.value=!1,m.value=!1}),(Z,K)=>(e.openBlock(),e.createElementBlock("figure",{ref_key:"figureRef",ref:f,class:"text-center my-8"},[e.createElementVNode("div",wr,[e.createVNode(e.Transition,{name:"img-switch",mode:"out-in"},{default:e.withCtx(()=>{var Y,te,$,Le,ee;return[!t.node.loading&&!m.value&&S.value?(e.openBlock(),e.createElementBlock("img",{key:"image",src:x.value,alt:String((te=(Y=n.node.alt)!=null?Y:n.node.title)!=null?te:""),title:String((Le=($=n.node.title)!=null?$:n.node.alt)!=null?Le:""),class:e.normalizeClass(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!l.value,"opacity-100":l.value,"cursor-pointer":l.value}]),style:e.normalizeStyle(V.value?{minHeight:n.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:n.lazy?"lazy":"eager",decoding:"async",tabindex:l.value?0:-1,"aria-label":(ee=n.node.alt)!=null?ee:e.unref(b)("image.preview"),onError:E,onLoad:X,onClick:I},null,46,kr)):m.value?!t.node.loading&&!n.fallbackSrc?(e.openBlock(),e.createElementBlock("div",br,[e.renderSlot(Z.$slots,"error",{node:n.node,displaySrc:x.value,imageLoaded:l.value,hasError:m.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:V.value},()=>[K[1]||(K[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",Br,e.toDisplayString(e.unref(b)("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(V.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?e.renderSlot(Z.$slots,"placeholder",{key:0,node:n.node,displaySrc:x.value,imageLoaded:l.value,hasError:m.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:V.value},()=>[K[0]||(K[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",yr,e.toDisplayString(e.unref(b)("image.loading")),1)],!0):(e.openBlock(),e.createElementBlock("span",xr,e.toDisplayString(t.node.raw),1))],4))]}),_:3})]),n.showCaption&&n.node.alt?(e.openBlock(),e.createElementBlock("figcaption",Mr,e.toDisplayString(n.node.alt),1)):e.createCommentVNode("",!0)],512))}}),gt=P(Cr,[["__scopeId","data-v-7ca79b66"]]);gt.install=t=>{t.component(gt.__name,gt)};let dn=null,En=!1,Xn=wo;function wo(){return L(null,null,function*(){const t=yield import("katex");return yield import("katex/contrib/mhchem"),t})}function Er(){dn=null,En=!1}function Un(t){Xn=t,Er()}function Tr(t){Un(t!=null?t:wo)}function Nr(){Un(null)}function Yn(){return typeof Xn=="function"}function In(){return L(this,null,function*(){if(dn)return dn;if(En)return null;const t=Xn;if(!t)return En=!0,null;try{const o=yield t();if(o)return dn=o,dn}catch(o){}return En=!0,null})}const An=e.shallowRef(!1);let oo=null;function ko(){return oo||(oo=In().then(t=>{An.value=!!t}).catch(()=>{An.value=!1})),e.readonly(An)}const _r=e.defineComponent({__name:"TextNode",props:{node:{}},emits:["copy"],setup(t){const o=ko();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))}}),de=P(_r,[["__scopeId","data-v-56f30838"]]);de.install=t=>{t.component(de.__name,de)};const ut=e.defineAsyncComponent(()=>L(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 l,m;return e.h(de,st(q({},s),{node:st(q({},s.node),{content:(m=s.node.raw)!=null?m:`$${(l=s.node.content)!=null?l:""}$`})}))};try{if(yield In())return(yield Promise.resolve().then(()=>require("./index-BqQOMeNc.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 l,m;return e.h(de,st(q({},s),{node:st(q({},s.node),{content:(m=s.node.raw)!=null?m:`$${(l=s.node.content)!=null?l:""}$`})}))}})),Sr=e.defineAsyncComponent(()=>L(null,null,function*(){try{if(yield In())return(yield Promise.resolve().then(()=>require("./index-Bjfg9_i9.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(de,st(q({},t),{node:st(q({},t.node),{content:(n=t.node.raw)!=null?n:`$$${(o=t.node.content)!=null?o:""}$$`})}))}})),xe=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))}});xe.install=t=>{t.component(xe.__name,xe)};const Ir={class:"superscript-node"},$r={key:1},Vr=e.defineComponent({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,strong:be,emphasis:Pe,footnote_reference:we,strikethrough:Be,highlight:Ve,insert:$e,subscript:Ie,emoji:ge,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("sup",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"superscript"}-${f}`},[s[u.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:0,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"superscript"}-${f}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",$r,e.toDisplayString(u.content||u.raw),1))],64))),128))]))}}),Se=P(Vr,[["__scopeId","data-v-6dc1e3ba"]]);Se.install=t=>{t.component(Se.__name,Se)};const Lr={class:"subscript-node"},Dr={key:1},Rr=e.defineComponent({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,strong:be,emphasis:Pe,footnote_reference:we,strikethrough:Be,highlight:Ve,insert:$e,superscript:Se,emoji:ge,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("sub",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"subscript"}-${f}`},[s[u.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:0,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"subscript"}-${f}`},null,8,["node","custom-id","index-key"])):(e.openBlock(),e.createElementBlock("span",Dr,e.toDisplayString(u.content||u.raw),1))],64))),128))]))}}),Ie=P(Rr,[["__scopeId","data-v-69de9b81"]]);Ie.install=t=>{t.component(Ie.__name,Ie)};const zr={class:"strong-node"},Ar=e.defineComponent({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,emphasis:Pe,strikethrough:Be,highlight:Ve,insert:$e,subscript:Ie,superscript:Se,emoji:ge,footnote_reference:we,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("strong",zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"strong"}-${f}`,"index-key":`${t.indexKey||"strong"}-${f}`,node:u,"custom-id":o.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),be=P(Ar,[["__scopeId","data-v-af3ce037"]]);be.install=t=>{t.component(be.__name,be)};const Hr={class:"strikethrough-node"},jr=e.defineComponent({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,strong:be,emphasis:Pe,highlight:Ve,insert:$e,subscript:Ie,superscript:Se,emoji:ge,footnote_reference:we,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("del",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"strikethrough"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"strikethrough"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Be=P(jr,[["__scopeId","data-v-904d5bd1"]]);Be.install=t=>{t.component(Be.__name,Be)};const Pr=["href","title","aria-label","aria-hidden"],Fr=["aria-hidden"],Kr={class:"link-text-wrapper relative inline-flex"},Or={class:"leading-[normal] link-text"},Wr={class:"leading-[normal] link-text"},Xr=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 h,y,x,S,V,E;const g=o.underlineBottom!==void 0?typeof o.underlineBottom=="number"?`${o.underlineBottom}px`:String(o.underlineBottom):"-3px";return{"--link-color":(h=o.color)!=null?h:"#0366d6","--underline-height":`${(y=o.underlineHeight)!=null?y:2}px`,"--underline-bottom":g,"--underline-opacity":String((x=o.animationOpacity)!=null?x:.9),"--underline-duration":`${(S=o.animationDuration)!=null?S:.8}s`,"--underline-timing":(V=o.animationTiming)!=null?V:"linear","--underline-iteration":typeof o.animationIteration=="number"?String(o.animationIteration):(E=o.animationIteration)!=null?E:"infinite"}}),s={text:de,strong:be,strikethrough:Be,emphasis:Pe,image:gt,html_inline:ke},l=e.useAttrs();function m(g){var S,V,E;if(!o.showTooltip)return;const h=g,y=(h==null?void 0:h.clientX)!=null&&(h==null?void 0:h.clientY)!=null?{x:h.clientX,y:h.clientY}:void 0,x=((S=o.node)==null?void 0:S.title)||((V=o.node)==null?void 0:V.href)||((E=o.node)==null?void 0:E.text)||"";on(g.currentTarget,x,"top",!1,y)}function u(){o.showTooltip&&Nn()}const f=e.computed(()=>{var g,h;return String((h=(g=o.node.title)!=null?g:o.node.href)!=null?h:"")});return(g,h)=>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(l),{style:n.value}),[e.createElementVNode("span",Kr,[e.createElementVNode("span",Or,[e.createElementVNode("span",Wr,e.toDisplayString(t.node.text),1)]),h[1]||(h[1]=e.createElementVNode("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Fr)):(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:0,class:"link-node",href:t.node.href,title:t.showTooltip?"":f.value,"aria-label":`Link: ${f.value}`,"aria-hidden":t.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},e.unref(l),{style:n.value,onMouseenter:h[0]||(h[0]=y=>m(y)),onMouseleave:u}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(y,x)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[y.type]),{key:`${t.indexKey||"emphasis"}-${x}`,node:y,"custom-id":o.customId,"index-key":`${t.indexKey||"link-text"}-${x}`},null,8,["node","custom-id","index-key"]))),128))],16,Pr))}}),Me=P(Xr,[["__scopeId","data-v-0753b32c"]]);Me.install=t=>{t.component(Me.__name,Me)};const Ur={class:"insert-node"},Yr=e.defineComponent({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,strong:be,emphasis:Pe,strikethrough:Be,highlight:Ve,subscript:Ie,superscript:Se,emoji:ge,footnote_reference:we,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("ins",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"insert"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"insert"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),$e=P(Yr,[["__scopeId","data-v-ab1ec9bc"]]);$e.install=t=>{t.component($e.__name,$e)};const qr={class:"highlight-node"},Zr=e.defineComponent({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,strong:be,emphasis:Pe,strikethrough:Be,insert:$e,subscript:Ie,superscript:Se,emoji:ge,footnote_reference:we,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("mark",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"highlight"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"highlight"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Ve=P(Zr,[["__scopeId","data-v-38e31bf6"]]);Ve.install=t=>{t.component(Ve.__name,Ve)};const Gr={class:"emphasis-node"},Jr=e.defineComponent({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,html_inline:ke,strong:be,strikethrough:Be,highlight:Ve,insert:$e,subscript:Ie,superscript:Se,emoji:ge,footnote_reference:we,math_inline:ut,reference:xe},n);return(l,m)=>(e.openBlock(),e.createElementBlock("em",Gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"emphasis"}-${f}`,node:u,"custom-id":o.customId,"index-key":`${t.indexKey||"emphasis"}-${f}`},null,8,["node","custom-id","index-key"]))),128))]))}}),Pe=P(Jr,[["__scopeId","data-v-8264674d"]]);Pe.install=t=>{t.component(Pe.__name,Pe)};const Qr=["href","title"],ea=e.defineComponent({__name:"FootnoteAnchorNode",props:{node:{}},setup(t){const o=t;function n(s){var u;if(s.preventDefault(),typeof document=="undefined")return;const l=`fnref-${String((u=o.node.id)!=null?u:"")}`,m=document.getElementById(l);m&&m.scrollIntoView({behavior:"smooth"})}return(s,l)=>(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,Qr))}}),Lt=P(ea,[["__scopeId","data-v-4756ce0d"]]);Lt.install=t=>{t.component(Lt.__name,Lt)};const ta=["id"],na={class:"flex-1"},Zt=e.defineComponent({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t;return(n,s)=>(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",na,[e.withMemo([o.node.children],()=>e.createVNode(e.unref(je),{"index-key":`footnote-${o.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:s[0]||(s[0]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter"]),s,1)])],8,ta))}});Zt.install=t=>{t.component(Zt.__name,Zt)};const oa={class:"hard-break"},ra=e.defineComponent({__name:"HardBreakNode",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("br",oa))}}),Bt=P(ra,[["__scopeId","data-v-50c58f70"]]);Bt.install=t=>{t.component(Bt.__name,Bt)};const aa=e.defineComponent({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({text:de,inline_code:ye,link:Me,image:gt,strong:be,emphasis:Pe,strikethrough:Be,highlight:Ve,insert:$e,subscript:Ie,superscript:Se,emoji:ge,checkbox:et,checkbox_input:et,footnote_reference:we,hardbreak:Bt,math_inline:ut,reference:xe},n);return(l,m)=>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,(u,f,g,h)=>{const y=[u];if(h&&h.key===`${t.indexKey||"heading"}-${f}`&&e.isMemoSame(h,y))return h;const x=(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[u.type]),{key:`${t.indexKey||"heading"}-${f}`,"custom-id":o.customId,node:u,"index-key":`${t.indexKey||"heading"}-${f}`},null,8,["custom-id","node","index-key"]));return x.memo=y,x},m,0),128))]),_:1},8,["class"])),m,2)}}),Hn=P(aa,[["__scopeId","data-v-e3e7e2ce"]]),$n=Hn;$n.install=t=>{t.component(Hn.__name,Hn)};const la=e.defineComponent({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>o.value==null?{}:{value:o.value});return(s,l)=>(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(je),{"index-key":`list-item-${o.indexKey}`,nodes:o.item.children,"custom-id":o.customId,typewriter:o.typewriter,"batch-rendering":!1,onCopy:l[0]||(l[0]=m=>s.$emit("copy",m))},null,8,["index-key","nodes","custom-id","typewriter"]),l,1)],16))}}),Gt=P(la,[["__scopeId","data-v-7a618746"]]);Gt.install=t=>{t.component(Gt.__name,Gt)};const ia=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,l,m,u)=>{var h;const f=[s];if(u&&u.key===`${t.indexKey||"list"}-${l}`&&e.isMemoSame(u,f))return u;const g=(e.openBlock(),e.createBlock(e.unref(Gt),{key:`${t.indexKey||"list"}-${l}`,item:s,"custom-id":t.customId,"index-key":`${t.indexKey||"list"}-${l}`,typewriter:t.typewriter,value:t.node.ordered?((h=t.node.start)!=null?h:1)+l:void 0,onCopy:n[0]||(n[0]=y=>o.$emit("copy",y))},null,8,["item","custom-id","index-key","typewriter","value"]));return g.memo=f,g},n,1),128))]),_:1},8,["class"]))}}),Jt=P(ia,[["__scopeId","data-v-79057d57"]]);Jt.install=t=>{t.component(Jt.__name,Jt)};const sa="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 yo(t){try{if(typeof globalThis!="undefined"&&typeof globalThis.requestAnimationFrame=="function")return globalThis.requestAnimationFrame(t)}catch(o){}return globalThis.setTimeout(t,0)}const qn=()=>import("mermaid");let Ut=null,Zn=qn;function ca(){Ut=null}function Gn(t){Zn=t,ca()}function ua(t){Gn(t!=null?t:qn)}function da(){Gn(null)}function xo(){return typeof Zn=="function"}function ma(t){if(!t)return t;const o=t&&t.default?t.default:t;if(o&&(typeof o.render=="function"||typeof o.parse=="function"||typeof o.initialize=="function"))return o;if(o&&o.mermaidAPI&&(typeof o.mermaidAPI.render=="function"||typeof o.mermaidAPI.parse=="function")){const n=o.mermaidAPI;return st(q({},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})}return t.mermaid&&typeof t.mermaid.render=="function"?t.mermaid:o}function fa(t){if(t)try{const o=t==null?void 0:t.initialize;t.initialize=n=>{const s=q({suppressErrorRendering:!0},n||{});if(typeof o=="function")return o.call(t,s);if(t!=null&&t.mermaidAPI&&typeof t.mermaidAPI.initialize=="function")return t.mermaidAPI.initialize(s)}}catch(o){}}function ha(){return L(this,null,function*(){if(Ut)return Ut;const t=Zn;if(!t)return null;let o;try{o=yield t()}catch(n){throw t===qn?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):n}return o?(Ut=ma(o),fa(Ut),Ut):null})}let he=null,Mt=null;const ue=new Map,pa=5;let Tn=pa,jn=!1;function va(t){jn=!!t}function ga(t){Number.isFinite(t)&&t>0&&(Tn=Math.floor(t))}function wa(){return{inFlight:ue.size,max:Tn}}const bo="WORKER_BUSY",Bo="MERMAID_DISABLED";function ka(t){he=t,Mt=null;const o=t;he.onmessage=n=>{if(he!==o)return;const{id:s,ok:l,result:m,error:u}=n.data,f=ue.get(s);f&&(l===!1||u?f.reject(new Error(u||"Unknown error")):f.resolve(m))},he.onerror=n=>{var s,l;if(he===o){if(ue.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",(n==null?void 0:n.message)||n);return}try{jn?console.error("[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n):(l=console.debug)==null||l.call(console,"[mermaidWorkerClient] Worker error:",(n==null?void 0:n.message)||n)}catch(m){}for(const[m,u]of ue.entries())u.reject(new Error(`Worker error: ${n.message}`));ue.clear()}},he.onmessageerror=n=>{var s,l;if(he===o){if(ue.size===0){(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n);return}try{jn?console.error("[mermaidWorkerClient] Worker messageerror:",n):(l=console.debug)==null||l.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch(m){}for(const[m,u]of ue.entries())u.reject(new Error("Worker messageerror"));ue.clear()}}}function ya(){var t;if(he)try{for(const[o,n]of ue.entries())n.reject(new Error("Worker cleared"));ue.clear(),(t=he.terminate)==null||t.call(he)}catch(o){}he=null,Mt=null}function xa(){return he||(Mt=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Mt.name="WorkerInitError",Mt.code="WORKER_INIT_ERROR",null)}function Mo(t,o,n=1400){if(!xo()){const l=new Error("Mermaid rendering disabled");return l.name="MermaidDisabled",l.code=Bo,Promise.reject(l)}if(Mt)return Promise.reject(Mt);const s=xa();if(!s)return Promise.reject(Mt);if(ue.size>=Tn){const l=new Error("Worker busy");return l.name="WorkerBusy",l.code=bo,l.inFlight=ue.size,l.max=Tn,Promise.reject(l)}return new Promise((l,m)=>{const u=Math.random().toString(36).slice(2);let f=!1,g;const h=()=>{f||(f=!0,g!=null&&globalThis.clearTimeout(g),ue.delete(u))},y={resolve:x=>{h(),l(x)},reject:x=>{h(),m(x)}};ue.set(u,y);try{s.postMessage({id:u,action:t,payload:o})}catch(x){ue.delete(u),m(x);return}g=globalThis.setTimeout(()=>{const x=new Error("Worker call timed out");x.name="WorkerTimeout",x.code="WORKER_TIMEOUT";const S=ue.get(u);S&&S.reject(x)},n)})}function Co(t,o,n=1400){return L(this,null,function*(){try{return yield Mo("canParse",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function Eo(t,o,n=1400){return L(this,null,function*(){try{return yield Mo("findPrefix",{code:t,theme:o},n)}catch(s){return Promise.reject(s)}})}function Pn(){if(he)try{for(const[t,o]of ue.entries())o.reject(new Error("Worker terminated"));ue.clear(),he.terminate()}finally{he=null}}const ba={key:0},Ba={key:1,class:"flex items-center space-x-2 overflow-hidden"},Ma=["src"],Ca={key:2},Ea={class:"flex items-center space-x-1"},Ta={class:"flex items-center space-x-1"},Na={key:4},_a={key:5,class:"flex items-center space-x-1"},Sa=["aria-pressed"],Ia={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"},$a={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"},Va=["disabled"],La=["disabled"],Da={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"},Ra={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"},za={key:1,class:"relative"},Aa={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Ha={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ja={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},Pa=300,Fa=500,Ka=3,Oa=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},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!1}},emits:["copy","export","openModal","toggleMode"],setup(t,{emit:o}){var sn,cn;const n=t,s=o,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},m=e.ref(!1),u=e.computed(()=>n.isStrict?"strict":"loose"),f=e.computed(()=>({startOnLoad:!1,securityLevel:u.value,dompurifyConfig:u.value==="strict"?l:void 0,flowchart:u.value==="strict"?{htmlLabels:!1}:void 0}));function g(a){return a.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}const h=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],y=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function x(a){if(!a)return"";const r=a.trim();return y.test(r)?r:""}function S(a){const r=new Set(["script"]),c=[a,...Array.from(a.querySelectorAll("*"))];for(const w of c){if(r.has(w.tagName.toLowerCase())){w.remove();continue}const _=Array.from(w.attributes);for(const T of _){const R=T.name;if(/^on/i.test(R)){w.removeAttribute(R);continue}if(R==="style"&&T.value){const D=T.value;if(h.some(ne=>ne.test(D))){w.removeAttribute(R);continue}}if((R==="href"||R==="xlink:href")&&T.value){const D=x(T.value);if(!D){w.removeAttribute(R);continue}D!==T.value&&w.setAttribute(R,D)}}}}function V(a){if(typeof window=="undefined"||typeof DOMParser=="undefined"||!a)return null;const r=g(a),w=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;if(!w||w.nodeName.toLowerCase()!=="svg")return null;const _=w;return S(_),_}function E(a,r){if(!a)return"";try{a.replaceChildren()}catch(w){a.innerHTML=""}const c=V(r);return c?(a.appendChild(c),a.innerHTML):""}function X(a){if(a)try{a.replaceChildren()}catch(r){a.innerHTML=""}}function I(a,r){if(!a)return"";if(u.value==="strict")return E(a,r);try{a.replaceChildren()}catch(c){a.innerHTML=""}if(r)try{a.insertAdjacentHTML("afterbegin",r)}catch(c){a.innerHTML=r}return a.innerHTML}const{t:b}=_n();function Z(){return L(this,null,function*(){try{const a=yield ha();return m.value=!!a,a}catch(a){throw m.value=!1,a}})}typeof window!="undefined"&&L(null,null,function*(){var a;try{const r=yield Z();if(!r)return;(a=r==null?void 0:r.initialize)==null||a.call(r,q({},f.value))}catch(r){m.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",r)}});const K=e.ref(!1),Y=e.ref(!1),te=e.ref(),$=e.ref(),Le=e.ref(),ee=e.ref(null),Ce=Sn(),nt=e.ref(null),A=e.ref(typeof window=="undefined"),wt=e.ref(),G=e.computed(()=>n.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function ve(a,r=G.value){const c=r,_=`%%{init: {"theme": "${a==="dark"?"dark":"default"}"}}%%
|
|
2
|
+
`;return c.trim().startsWith("%%{")?c:_+c}const C=e.ref(1),O=e.ref(0),j=e.ref(0),Ee=e.ref(!1),De=e.ref({x:0,y:0}),F=e.ref(!1),oe=e.ref(!1),J=e.ref(!1),dt=e.ref(null),ot=e.ref(0),mt=e.ref(!1);let ie=null,me=null,rt=0;const kt=(sn=globalThis.requestIdleCallback)!=null?sn:((a,r)=>setTimeout(()=>a({didTimeout:!0}),16)),Ye=yn(()=>{kt(()=>{St()},{timeout:500})},Pa);function Fe(){me!=null&&(globalThis.clearTimeout(me),me=null)}function se(a=600){if(typeof globalThis=="undefined")return;const r=Math.max(0,a);Fe();const c=()=>{if(me=null,n.loading||J.value||!A.value){const w=Math.min(1200,Math.max(300,r*1.2));se(w);return}Ye()};me=globalThis.setTimeout(c,r)}const W=e.ref("360px");let ce=null;const Q=e.ref(!1),pe=e.ref(!1),Ke=e.ref({}),at=e.ref(null),Te=e.ref(""),Et=e.ref(0);let re=null;const v=e.ref(!1),k=e.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),M=e.computed(()=>n.enableWheelZoom?{wheel:fe}:{}),z=e.computed(()=>{var a,r,c,w;return{worker:(a=n.workerTimeoutMs)!=null?a:1400,parse:(r=n.parseTimeoutMs)!=null?r:1800,render:(c=n.renderTimeoutMs)!=null?c:2500,fullRender:(w=n.fullRenderTimeoutMs)!=null?w:4e3}}),Re=(cn=globalThis.cancelIdleCallback)!=null?cn:(a=>clearTimeout(a));let qe=null,Oe=null,yt=!1,Ze=800,ze=null,At=0,ft=!0;typeof window!="undefined"&&e.watch(()=>te.value,a=>{var c;if((c=nt.value)==null||c.destroy(),nt.value=null,!a){A.value=!1;return}const r=Ce(a,{rootMargin:"400px"});nt.value=r,A.value=r.isVisible.value,r.whenVisible.then(()=>{A.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var a;(a=nt.value)==null||a.destroy(),nt.value=null});function Ge(a,r){const c=r==null?void 0:r.timeoutMs,w=r==null?void 0:r.signal;if(w!=null&&w.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let _=null,T=!1,R=null;return new Promise((D,ne)=>{const le=()=>{_!=null&&clearTimeout(_),R&&w&&w.removeEventListener("abort",R)};c&&c>0&&(_=globalThis.setTimeout(()=>{T||(T=!0,le(),ne(new Error("Operation timed out")))},c)),w&&(R=()=>{T||(T=!0,le(),ne(new DOMException("Aborted","AbortError")))},w.addEventListener("abort",R)),a().then(Ot=>{T||(T=!0,le(),D(Ot))}).catch(Ot=>{T||(T=!0,le(),ne(Ot))})})}function Tt(a){if(typeof document=="undefined"||!$.value)return;const r=document.createElement("div");r.className="text-red-500 p-4",r.textContent="Failed to render diagram: ";const c=document.createElement("span");c.textContent=a instanceof Error?a.message:"Unknown error",r.appendChild(c),X($.value),$.value.appendChild(r),W.value="360px",v.value=!0,Qe()}function ht(a){const r=typeof a=="string"?a:typeof(a==null?void 0:a.message)=="string"?a.message:"";return typeof r=="string"&&/timed out/i.test(r)}function xt(a){const r=a;return!r||r.disabled}function ae(a,r,c="top"){if(xt(a.currentTarget))return;const w=a,_=(w==null?void 0:w.clientX)!=null&&(w==null?void 0:w.clientY)!=null?{x:w.clientX,y:w.clientY}:void 0;on(a.currentTarget,r,c,!1,_,n.isDark)}function U(){Nn()}function gn(a){if(xt(a.currentTarget))return;const r=K.value?b("common.copied")||"Copied":b("common.copy")||"Copy",c=a,w=(c==null?void 0:c.clientX)!=null&&(c==null?void 0:c.clientY)!=null?{x:c.clientX,y:c.clientY}:void 0;on(a.currentTarget,r,"top",!1,w,n.isDark)}function wn(a,r){const w=`%%{init: {"theme": "${r==="dark"?"dark":"default"}"}}%%
|
|
3
|
+
`;return a.trimStart().startsWith("%%{")?a:w+a}function rn(){return ft&&!F.value&&!Q.value&&!v.value}function an(a){const r=a.split(/\r?\n/);for(;r.length>0;){const w=r[r.length-1].trimEnd();if(w===""){r.pop();continue}if(/^[-=~>|<\s]+$/.test(w.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(w)||/[-|><]$/.test(w)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(w)){r.pop();continue}break}return r.join(`
|
|
4
|
+
`)}function Vn(a,r,c){return L(this,null,function*(){var D,ne;const w=yield Z();if(!w)return;const _=w,T=wn(a,r);if(typeof _.parse=="function")return yield Ge(()=>_.parse(T),{timeoutMs:(D=c==null?void 0:c.timeoutMs)!=null?D:z.value.parse,signal:c==null?void 0:c.signal}),!0;const R=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Ge(()=>w.render(R,T),{timeoutMs:(ne=c==null?void 0:c.timeoutMs)!=null?ne:z.value.render,signal:c==null?void 0:c.signal}),!0})}function Nt(a,r,c){return L(this,null,function*(){var w;try{return yield Co(a,r,(w=c==null?void 0:c.timeoutMs)!=null?w:z.value.worker)}catch(_){return yield Vn(a,r,c)}})}function Ln(a,r,c){return L(this,null,function*(){var _;try{if(yield Nt(a,r,c))return{fullOk:!0,prefixOk:!1}}catch(T){if((T==null?void 0:T.name)==="AbortError")throw T}let w=an(a);if(w&&w.trim()&&w!==a)try{try{const R=yield Eo(a,r,(_=c==null?void 0:c.timeoutMs)!=null?_:z.value.worker);R&&R.trim()&&(w=R)}catch(R){}if(yield Nt(w,r,c))return{fullOk:!1,prefixOk:!0,prefix:w}}catch(T){if((T==null?void 0:T.name)==="AbortError")throw T}return{fullOk:!1,prefixOk:!1}})}const Ht=e.computed(()=>F.value||J.value||Y.value);function jt(a){if(!te.value||!$.value)return;const r=$.value.querySelector("svg");if(!r)return;let c=0,w=0;const _=r.getAttribute("viewBox"),T=r.getAttribute("width"),R=r.getAttribute("height");if(_){const D=_.split(" ");D.length===4&&(c=Number.parseFloat(D[2]),w=Number.parseFloat(D[3]))}if((!c||!w)&&T&&R&&(c=Number.parseFloat(T),w=Number.parseFloat(R)),Number.isNaN(c)||Number.isNaN(w)||c<=0||w<=0)try{const D=r.getBBox();D&&D.width>0&&D.height>0&&(c=D.width,w=D.height)}catch(D){console.error("Failed to get SVG BBox:",D);return}if(c>0&&w>0){const D=w/c;let le=(a!=null?a:te.value.clientWidth)*D;le>w&&(le=w),W.value=`${le}px`}}const Je=e.ref(!1),ln=e.computed(()=>({transform:`translate(${O.value}px, ${j.value}px) scale(${C.value})`}));function kn(a){a.key==="Escape"&&Je.value&&Pt()}function Dn(){if(Je.value=!0,typeof document!="undefined")try{document.body.style.overflow="hidden"}catch(a){}if(typeof window!="undefined")try{window.addEventListener("keydown",kn)}catch(a){}e.nextTick(()=>{if(te.value&&Le.value){const a=te.value.cloneNode(!0);a.classList.add("fullscreen");const r=a.querySelector("[data-mermaid-wrapper]");r&&(ee.value=r,r.style.transform=ln.value.transform),X(Le.value),Le.value.appendChild(a)}})}function Pt(){if(Je.value=!1,Le.value&&X(Le.value),ee.value=null,typeof document!="undefined")try{document.body.style.overflow=""}catch(a){}if(typeof window!="undefined")try{window.removeEventListener("keydown",kn)}catch(a){}}function yn(a,r){let c=null;return(...w)=>{c&&clearTimeout(c),c=setTimeout(()=>a(...w),r)}}function xn(){if(!F.value||!m.value)return;const a=G.value.length;a!==ot.value&&(mt.value=!0,ot.value=a,ie&&clearTimeout(ie),ie=setTimeout(()=>{mt.value&&F.value&&G.value.trim()&&(mt.value=!1,lt("preview"))},Fa))}e.watch(ln,a=>{Je.value&&ee.value&&(ee.value.style.transform=a.transform)},{immediate:!0});function i(){C.value<3&&(C.value+=.1)}function d(){C.value>.5&&(C.value-=.1)}function p(){C.value=1,O.value=0,j.value=0}function N(a){Ee.value=!0,a instanceof MouseEvent?De.value={x:a.clientX-O.value,y:a.clientY-j.value}:De.value={x:a.touches[0].clientX-O.value,y:a.touches[0].clientY-j.value}}function B(a){if(!Ee.value)return;let r,c;a instanceof MouseEvent?(r=a.clientX,c=a.clientY):(r=a.touches[0].clientX,c=a.touches[0].clientY),O.value=r-De.value.x,j.value=c-De.value.y}function H(){Ee.value=!1}function fe(a){if(n.enableWheelZoom&&(a.ctrlKey||a.metaKey)){if(a.preventDefault(),!te.value)return;const r=te.value.getBoundingClientRect(),c=a.clientX-r.left,w=a.clientY-r.top,_=r.width/2,T=r.height/2,R=c-_,D=w-T,ne=(R-O.value)/C.value,le=(D-j.value)/C.value,zo=-a.deltaY*.01,bn=Math.min(Math.max(C.value+zo,.5),3);bn!==C.value&&(O.value=R-ne*bn,j.value=D-le*bn,C.value=bn)}}function Ae(){return L(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(G.value)),K.value=!0,s("copy",G.value),setTimeout(()=>{K.value=!1},1e3)}catch(a){console.error("Failed to copy:",a)}})}function We(a,r=null){return L(this,null,function*(){try{const c=r!=null?r:new XMLSerializer().serializeToString(a),w=new Blob([c],{type:"image/svg+xml;charset=utf-8"}),_=URL.createObjectURL(w);if(typeof document!="undefined"){const T=document.createElement("a");T.href=_,T.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(T),T.click(),document.body.removeChild(T)}catch(R){}URL.revokeObjectURL(_)}}catch(c){console.error("Failed to export SVG:",c)}})}function Ne(){var w;const a=(w=$.value)==null?void 0:w.querySelector("svg");if(!a){console.error("SVG element not found");return}const r=new XMLSerializer().serializeToString(a),c={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:a,svgString:r};s("export",c),c.defaultPrevented||We(a,r)}function Xe(){var w,_;const a=(_=(w=$.value)==null?void 0:w.querySelector("svg"))!=null?_:null,r=a?new XMLSerializer().serializeToString(a):null,c={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:a,svgString:r};s("openModal",c),c.defaultPrevented||Dn()}function bt(a){const r={payload:{type:"toggle-mode",target:a},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};s("toggleMode",a,r),r.defaultPrevented||lt(a)}function lt(a){return L(this,null,function*(){const r=wt.value;if(!r){oe.value=!0,F.value=a==="source";return}const c=r.getBoundingClientRect().height;r.style.height=`${c}px`,r.style.overflow="hidden",oe.value=!0,F.value=a==="source",yield e.nextTick();const w=r.scrollHeight;r.style.transition="height 180ms ease",r.offsetHeight,r.style.height=`${w}px`;const _=()=>{r.style.transition="",r.style.height="",r.style.overflow="",r.removeEventListener("transitionend",T)};function T(){_()}r.addEventListener("transitionend",T),setTimeout(()=>_(),220)})}function He(){return L(this,null,function*(){if(J.value)return dt.value;if(!$.value&&(yield e.nextTick(),!$.value)){console.warn("Mermaid container not ready");return}return J.value=!0,dt.value=L(null,null,function*(){var a;$.value&&($.value.style.opacity="0");try{const r=yield Z();if(!r)return;const c=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;!Q.value&&!pe.value&&((a=r.initialize)==null||a.call(r,st(q({},f.value),{dompurifyConfig:q({},l)})));const w=n.isDark?"dark":"light",_=ve(w),T=yield Ge(()=>r.render(c,_),{timeoutMs:z.value.fullRender}),R=T==null?void 0:T.svg;if($.value){const D=I($.value,R);!Q.value&&!pe.value&&(jt(),Q.value=!0,k.value={zoom:C.value,translateX:O.value,translateY:j.value,containerHeight:W.value});const ne=n.isDark?"dark":"light";D&&(Ke.value[ne]=D),pe.value&&(pe.value=!1),v.value=!1,rt=0,Fe()}}catch(r){const c=ht(r),w=rt+1;if(c&&w<=Ka){rt=w;const _=Math.min(1200,600*w);se(_)}else rt=0,Fe(),console.error("Failed to render mermaid diagram:",r),n.loading===!1&&Tt(r)}finally{yield e.nextTick(),$.value&&($.value.style.opacity="1"),J.value=!1,dt.value=null}}),dt.value})}function _t(a){return L(this,null,function*(){if(rn()&&!(!$.value&&(yield e.nextTick(),!$.value))&&!J.value){J.value=!0;try{const r=yield Z();if(!r)return;const c=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,w=n.isDark?"dark":"light",_=an(a),T=_&&_.trim()?_:a,R=wn(T,w);$.value&&($.value.style.opacity="0");const D=yield Ge(()=>r.render(c,R),{timeoutMs:z.value.render}),ne=D==null?void 0:D.svg;$.value&&ne&&(I($.value,ne),jt())}catch(r){}finally{yield e.nextTick(),$.value&&($.value.style.opacity="1"),J.value=!1}}})}function St(){return L(this,null,function*(){var D,ne;const a=Date.now(),r=++Et.value;re&&re.abort(),re=new AbortController;const c=re.signal,w=n.isDark?"dark":"light",_=G.value,T=_.replace(/\s+/g,"");if(!_.trim()){$.value&&X($.value),at.value=null,Te.value="",v.value=!1;return}if(T===Te.value)return;try{const le=yield Ln(_,w,{signal:c,timeoutMs:z.value.worker});if(le.fullOk){yield He(),Et.value===r&&(at.value=(ne=(D=$.value)==null?void 0:D.innerHTML)!=null?ne:null,Te.value=T,v.value=!1);return}const Ot=At&&a<=At;if(le.prefixOk&&le.prefix&&rn()&&!Ot){yield _t(le.prefix);return}}catch(le){if((le==null?void 0:le.name)==="AbortError")return}if(Et.value!==r||v.value)return;const R=Ke.value[w];R&&$.value&&I($.value,R)})}function Qe(){yt&&(yt=!1,Ze=800,ft=!1,ze&&(ze.abort(),ze=null),qe&&(globalThis.clearTimeout(qe),qe=null),Oe&&(Re(Oe),Oe=null),At=Date.now())}function it(){if(Qe(),re){try{re.abort()}catch(a){}re=null}if(ze){try{ze.abort()}catch(a){}ze=null}Pn(),Fe(),rt=0}function Ft(a=800){yt&&(qe&&globalThis.clearTimeout(qe),qe=globalThis.setTimeout(()=>{Oe=kt(()=>L(null,null,function*(){if(!yt)return;if(F.value||Q.value){Qe();return}const r=n.isDark?"dark":"light",c=G.value;if(!c.trim()){Ft(Ze);return}ze&&ze.abort(),ze=new AbortController;try{if((yield Nt(c,r,{signal:ze.signal,timeoutMs:z.value.worker}))&&(yield He(),Q.value)){Qe();return}}catch(w){}Ze=Math.min(Math.floor(Ze*1.5),4e3),Ft(Ze)}),{timeout:500})},a))}function Kt(){yt||F.value||Q.value||(yt=!0,At=0,ft=!0,Ft(500))}e.watch(()=>G.value,()=>{Q.value=!1,Ke.value={},Ye(),!F.value&&m.value&&Kt(),xn()}),e.watch(()=>n.isDark,()=>L(null,null,function*(){if(!Q.value||v.value)return;const a=n.isDark?"dark":"light",r=Ke.value[a];if(r){$.value&&I($.value,r);return}const c={zoom:C.value,translateX:O.value,translateY:j.value,containerHeight:W.value},w=C.value!==1||O.value!==0||j.value!==0;pe.value=!0,w&&(C.value=1,O.value=0,j.value=0,yield e.nextTick()),yield He(),w&&(yield e.nextTick(),C.value=c.zoom,O.value=c.translateX,j.value=c.translateY,W.value=c.containerHeight,k.value=c)})),e.watch(()=>F.value,a=>L(null,null,function*(){if(a)Qe(),Q.value&&(k.value={zoom:C.value,translateX:O.value,translateY:j.value,containerHeight:W.value});else{if(v.value)return;const r=n.isDark?"dark":"light";if(Q.value&&Ke.value[r]){yield e.nextTick(),$.value&&I($.value,Ke.value[r]),C.value=k.value.zoom,O.value=k.value.translateX,j.value=k.value.translateY,W.value=k.value.containerHeight;return}if(yield e.nextTick(),!m.value)return;yield St(),Kt()}})),e.watch(()=>n.loading,(a,r)=>L(null,null,function*(){if(r===!0&&a===!1){const c=G.value.trim();if(!c)return it();const w=n.isDark?"dark":"light",_=c.replace(/\s+/g,"");if(Q.value&&_===Te.value){yield e.nextTick(),$.value&&!$.value.querySelector("svg")&&Ke.value[w]&&I($.value,Ke.value[w]),it();return}try{yield Nt(c,w,{timeoutMs:z.value.worker}),yield He(),Te.value=_,v.value=!1,it()}catch(T){it(),Tt(T)}}})),e.watch(te,a=>{ce&&ce.disconnect(),a&&!Q.value&&!pe.value&&(ce=new ResizeObserver(r=>{r&&r.length>0&&!Q.value&&!pe.value&&yo(()=>{const c=r[0].contentRect.width;jt(c)})}),ce.observe(a))},{immediate:!0}),e.onMounted(()=>L(null,null,function*(){yield e.nextTick(),oe.value||(F.value=!m.value),A.value&&(Ye(),ot.value=G.value.length)})),e.watch(()=>m.value,a=>{oe.value||(F.value=!a)}),e.watch(()=>A.value,a=>{a&&(Q.value||(Ye(),ot.value=G.value.length),!n.loading&&!Q.value&&Ye())},{immediate:!1}),e.onUnmounted(()=>{ie&&clearTimeout(ie),ce&&ce.disconnect(),re&&(re.abort(),re=null),Pn(),Qe(),Fe()}),e.watch(()=>Y.value,a=>L(null,null,function*(){a?(Qe(),re&&re.abort()):Q.value||(yield e.nextTick(),Ye(),F.value||Kt())}),{immediate:!1});const It=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(a,r)=>(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"])},[a.$slots["header-left"]?(e.openBlock(),e.createElementBlock("div",ba,[e.renderSlot(a.$slots,"header-left",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",Ba,[e.createElementVNode("img",{src:e.unref(sa),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,Ma),e.createElementVNode("span",{class:e.normalizeClass(["text-sm font-medium font-mono truncate",n.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),a.$slots["header-center"]?(e.openBlock(),e.createElementBlock("div",Ca,[e.renderSlot(a.$slots,"header-center",{},void 0,!0)])):n.showModeToggle&&m.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",[F.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:r[0]||(r[0]=()=>bt("preview")),onMouseenter:r[1]||(r[1]=c=>ae(c,e.unref(b)("common.preview")||"Preview")),onFocus:r[2]||(r[2]=c=>ae(c,e.unref(b)("common.preview")||"Preview")),onMouseleave:U,onBlur:U},[e.createElementVNode("div",Ea,[r[21]||(r[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(b)("common.preview")||"Preview"),1)])],34),e.createElementVNode("button",{class:e.normalizeClass(["px-2.5 py-1 text-xs rounded transition-colors",[F.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:r[3]||(r[3]=()=>bt("source")),onMouseenter:r[4]||(r[4]=c=>ae(c,e.unref(b)("common.source")||"Source")),onFocus:r[5]||(r[5]=c=>ae(c,e.unref(b)("common.source")||"Source")),onMouseleave:U,onBlur:U},[e.createElementVNode("div",Ta,[r[22]||(r[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(b)("common.source")||"Source"),1)])],34)],2)):e.createCommentVNode("",!0),a.$slots["header-right"]?(e.openBlock(),e.createElementBlock("div",Na,[e.renderSlot(a.$slots,"header-right",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",_a,[n.showCollapseButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(It.value),"aria-pressed":Y.value,onClick:r[6]||(r[6]=c=>Y.value=!Y.value),onMouseenter:r[7]||(r[7]=c=>ae(c,Y.value?e.unref(b)("common.expand")||"Expand":e.unref(b)("common.collapse")||"Collapse")),onFocus:r[8]||(r[8]=c=>ae(c,Y.value?e.unref(b)("common.expand")||"Expand":e.unref(b)("common.collapse")||"Collapse")),onMouseleave:U,onBlur:U},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:Y.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"},[...r[23]||(r[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,Sa)):e.createCommentVNode("",!0),n.showCopyButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(It.value),onClick:Ae,onMouseenter:r[9]||(r[9]=c=>gn(c)),onFocus:r[10]||(r[10]=c=>gn(c)),onMouseleave:U,onBlur:U},[K.value?(e.openBlock(),e.createElementBlock("svg",$a,[...r[25]||(r[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",Ia,[...r[24]||(r[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&&m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(`${It.value} ${Ht.value?"opacity-50 cursor-not-allowed":""}`),disabled:Ht.value,onClick:Ne,onMouseenter:r[11]||(r[11]=c=>ae(c,e.unref(b)("common.export")||"Export")),onFocus:r[12]||(r[12]=c=>ae(c,e.unref(b)("common.export")||"Export")),onMouseleave:U,onBlur:U},[...r[26]||(r[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,Va)):e.createCommentVNode("",!0),n.showFullscreenButton&&m.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(`${It.value} ${Ht.value?"opacity-50 cursor-not-allowed":""}`),disabled:Ht.value,onClick:Xe,onMouseenter:r[13]||(r[13]=c=>ae(c,Je.value?e.unref(b)("common.minimize")||"Minimize":e.unref(b)("common.open")||"Open")),onFocus:r[14]||(r[14]=c=>ae(c,Je.value?e.unref(b)("common.minimize")||"Minimize":e.unref(b)("common.open")||"Open")),onMouseleave:U,onBlur:U},[Je.value?(e.openBlock(),e.createElementBlock("svg",Ra,[...r[28]||(r[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",Da,[...r[27]||(r[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,La)):e.createCommentVNode("",!0)]))],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"modeContainerRef",ref:wt},[F.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(G.value),3)],2)):(e.openBlock(),e.createElementBlock("div",za,[n.showZoomControls?(e.openBlock(),e.createElementBlock("div",Aa,[e.createElementVNode("div",Ha,[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:i,onMouseenter:r[15]||(r[15]=c=>ae(c,e.unref(b)("common.zoomIn")||"Zoom in")),onFocus:r[16]||(r[16]=c=>ae(c,e.unref(b)("common.zoomIn")||"Zoom in")),onMouseleave:U,onBlur:U},[...r[29]||(r[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:d,onMouseenter:r[17]||(r[17]=c=>ae(c,e.unref(b)("common.zoomOut")||"Zoom out")),onFocus:r[18]||(r[18]=c=>ae(c,e.unref(b)("common.zoomOut")||"Zoom out")),onMouseleave:U,onBlur:U},[...r[30]||(r[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:p,onMouseenter:r[19]||(r[19]=c=>ae(c,e.unref(b)("common.resetZoom")||"Reset zoom")),onFocus:r[20]||(r[20]=c=>ae(c,e.unref(b)("common.resetZoom")||"Reset zoom")),onMouseleave:U,onBlur:U},e.toDisplayString(Math.round(C.value*100))+"% ",35)])])):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({ref_key:"mermaidContainer",ref:te,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",n.isDark?"bg-gray-900":"bg-gray-50"],style:{height:W.value}},e.toHandlers(M.value,!0),{onMousedown:N,onMousemove:B,onMouseup:H,onMouseleave:H,onTouchstartPassive:N,onTouchmovePassive:B,onTouchendPassive:H}),[e.createElementVNode("div",{"data-mermaid-wrapper":"",class:e.normalizeClass(["absolute inset-0 cursor-grab",{"cursor-grabbing":Ee.value}]),style:e.normalizeStyle(ln.value)},[e.createElementVNode("div",{ref_key:"mermaidContent",ref:$,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"mermaid-dialog",appear:""},{default:e.withCtx(()=>[Je.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(Pt,["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",ja,[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:i},[...r[31]||(r[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:d},[...r[32]||(r[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:p},e.toDisplayString(Math.round(C.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:Pt},[...r[33]||(r[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",e.mergeProps({ref_key:"modalContent",ref:Le,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},e.toHandlers(M.value,!0),{onMousedown:N,onMousemove:B,onMouseup:H,onMouseleave:H,onTouchstartPassive:N,onTouchmovePassive:B,onTouchendPassive:H}),null,16)],2)])):e.createCommentVNode("",!0)]),_:1})]))]))],512),[[e.vShow,!Y.value]])],2))}}),Dt=P(Oa,[["__scopeId","data-v-3636e700"]]);Dt.install=t=>{t.component(Dt.__name,Dt)};const Wa={dir:"auto",class:"paragraph-node"},Xa=e.defineComponent({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(t){const o=t,n=tt(o.customId),s=q({inline_code:ye,image:gt,link:Me,hardbreak:Bt,emphasis:Pe,strong:be,strikethrough:Be,highlight:Ve,insert:$e,subscript:Ie,superscript:Se,html_inline:ke,emoji:ge,checkbox:et,math_inline:ut,checkbox_input:et,reference:xe,footnote_anchor:Lt,footnote_reference:we},n),l=ko();return(m,u)=>(e.openBlock(),e.createElementBlock("p",Wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.children,(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${t.indexKey||"paragraph"}-${g}`},[f.type!=="text"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[f.type]),{key:0,node:f,"index-key":`${t.indexKey}-${g}`,"custom-id":o.customId},null,8,["node","index-key","custom-id"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([[e.unref(l)&&f.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},e.toDisplayString(f.content),3))],64))),128))]))}}),Qt=P(Xa,[["__scopeId","data-v-0117537a"]]);Qt.install=t=>{t.component(Qt.__name,Qt)};const Ua=["aria-busy","aria-label","data-language"],Ya=["textContent"],Rt=e.defineComponent({__name:"PreCodeNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{var g,h,y;const m=String((h=(g=o.node)==null?void 0:g.language)!=null?h:"");return String((y=String(m).split(/\s+/g)[0])!=null?y:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=e.computed(()=>`language-${n.value}`),l=e.computed(()=>{const m=n.value;return m?`Code block: ${m}`:"Code block"});return(m,u)=>(e.openBlock(),e.createElementBlock("pre",{class:e.normalizeClass([s.value]),"aria-busy":t.node.loading===!0,"aria-label":l.value,"data-language":n.value,tabindex:"0"},[e.createElementVNode("code",{translate:"no",textContent:e.toDisplayString(t.node.code)},null,8,Ya)],10,Ua))}});Rt.install=t=>{t.component(Rt.__name,Rt)};const qa={class:"table-node-wrapper"},Za=["aria-busy"],Ga={class:"border-[var(--table-border,#cbd5e1)]"},Ja={class:"border-b"},Qa={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},el=e.defineComponent({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t){const o=t,n=e.computed(()=>{var u,f,g,h;return(h=(g=(f=(u=o.node)==null?void 0:u.header)==null?void 0:f.cells)==null?void 0:g.length)!=null?h:0}),s=e.computed(()=>{const u=n.value||1,f=Math.floor(100/u);return Array.from({length:u}).map((g,h)=>h===u-1?`${100-f*(u-1)}%`:`${f}%`)}),l=e.computed(()=>{var u;return(u=o.node.loading)!=null?u:!1}),m=e.computed(()=>{var u;return(u=o.node.rows)!=null?u:[]});return(u,f)=>(e.openBlock(),e.createElementBlock("div",qa,[e.createElementVNode("table",{class:e.normalizeClass(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(g,h)=>(e.openBlock(),e.createElementBlock("col",{key:`col-${h}`,style:e.normalizeStyle({width:g})},null,4))),128))]),e.createElementVNode("thead",Ga,[e.createElementVNode("tr",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.node.header.cells,(g,h)=>(e.openBlock(),e.createElementBlock("th",{key:`header-${h}`,dir:"auto",class:e.normalizeClass(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",[g.align==="right"?"text-right":g.align==="center"?"text-center":"text-left"]])},[e.createVNode(e.unref(je),{nodes:g.children,"index-key":`table-th-${o.indexKey}`,"custom-id":o.customId,typewriter:o.typewriter,onCopy:f[0]||(f[0]=y=>u.$emit("copy",y))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(g,h)=>(e.openBlock(),e.createElementBlock("tr",{key:`row-${h}`,class:e.normalizeClass(["border-[var(--table-border,#cbd5e1)]",[h<m.value.length-1?"border-b":""]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.cells,(y,x)=>(e.openBlock(),e.createElementBlock("td",{key:`cell-${h}-${x}`,class:e.normalizeClass(["p-[calc(4/7*1em)] overflow-x-auto",[y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"]]),dir:"auto"},[e.createVNode(e.unref(je),{nodes:y.children,"index-key":`table-td-${o.indexKey}`,"custom-id":o.customId,typewriter:o.typewriter,onCopy:f[1]||(f[1]=S=>u.$emit("copy",S))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,Za),e.createVNode(e.Transition,{name:"table-node-fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Qa,[e.renderSlot(u.$slots,"loading",{isLoading:l.value},()=>[f[2]||(f[2]=e.createElementVNode("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),f[3]||(f[3]=e.createElementVNode("span",{class:"sr-only"},"Loading",-1))],!0)])):e.createCommentVNode("",!0)]),_:3})]))}}),en=P(el,[["__scopeId","data-v-a874491c"]]);en.install=t=>{t.component(en.__name,en)};const tl={},nl={class:"hr-node"};function ol(t,o){return e.openBlock(),e.createElementBlock("hr",nl)}const tn=P(tl,[["render",ol],["__scopeId","data-v-639cbad9"]]);tn.install=t=>{t.component(tn.__name,tn)};const rl={key:1,class:"html-block-node__placeholder"},al=e.defineComponent({__name:"HtmlBlockNode",props:{node:{}},setup(t){const o=t,n=e.computed(()=>{const h=o.node.attrs;if(h){if(Array.isArray(h)){const y={};for(const x of h){if(!x||x.length<2)continue;const[S,V]=x;S!=null&&(y[String(S)]=V==null?"":String(V))}return y}return h}}),s=e.ref(null),l=e.ref(typeof window=="undefined"),m=e.ref(o.node.content),u=Sn(),f=e.ref(null),g=!!o.node.loading;return typeof window!="undefined"?(e.watch(s,h=>{var x,S;if((S=(x=f.value)==null?void 0:x.destroy)==null||S.call(x),f.value=null,!g){l.value=!0,m.value=o.node.content;return}if(!h){l.value=!1;return}const y=u(h,{rootMargin:"400px"});f.value=y,l.value=y.isVisible.value,y.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),e.watch(()=>o.node.content,h=>{(!g||l.value)&&(m.value=h)})):l.value=!0,e.onBeforeUnmount(()=>{var h,y;(y=(h=f.value)==null?void 0:h.destroy)==null||y.call(h),f.value=null}),(h,y)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"htmlRef",ref:s,class:"html-block-node"},n.value),[l.value?e.withMemo([m.value],()=>(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:m.value},null,8,["innerHTML"])),y,0):(e.openBlock(),e.createElementBlock("div",rl,[e.renderSlot(h.$slots,"placeholder",{node:t.node},()=>[y[1]||(y[1]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar"},null,-1)),y[2]||(y[2]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),y[3]||(y[3]=e.createElementVNode("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),ll=P(al,[["__scopeId","data-v-ed22b926"]]),il={class:"unknown-node"},ro=e.defineComponent({__name:"FallbackComponent",props:{node:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",il,e.toDisplayString(t.node.raw),1))}}),sl=["data-node-index","data-node-type"],cl=900,ul=640,dl=200,ml=1800,fl=e.defineComponent({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},customHtmlTags:{},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 Pt,yn,xn;const n=t,s=o,l=e.ref(),m=e.ref(!1),u=/auto|scroll|overlay/i;function f(i){if(typeof window=="undefined")return null;const d=i!=null?i:l.value;if(!d)return null;const p=d.ownerDocument||document,N=p.scrollingElement||p.documentElement;let B=d;for(;B&&!(B===p.body||B===N);){const H=window.getComputedStyle(B),fe=(H.overflowY||"").toLowerCase(),Ae=(H.overflow||"").toLowerCase();if(u.test(fe)||u.test(Ae))return B;B=B.parentElement}return null}const g=n.customId?`renderer-${n.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,h=Bn.getMarkdown(g),y=e.computed(()=>{const i=n.customHtmlTags;return!i||i.length===0?h:Bn.getMarkdown(g,{customHtmlTags:i})}),x=e.computed(()=>{const i=y.value;return n.customMarkdownIt?n.customMarkdownIt(i):i});function S(i){const d=String(i!=null?i:"").trim();if(!d)return"";const p=d.match(/^[<\s/]*([A-Z][\w-]*)/i);return p?p[1].toLowerCase():""}const V=e.computed(()=>{var B,H,fe;const i=(B=n.parseOptions)!=null?B:{},d=(H=n.customHtmlTags)!=null?H:[],p=(fe=i.customHtmlTags)!=null?fe:[],N=[...d,...p].map(S).filter(Boolean);return N.length?st(q({},i),{customHtmlTags:Array.from(new Set(N))}):i}),E=e.computed(()=>{var i;if((i=n.nodes)!=null&&i.length)return e.markRaw(n.nodes.slice());if(n.content){const d=Bn.parseMarkdownToStructure(n.content,x.value,V.value);return e.markRaw(d)}return[]}),X=e.computed(()=>{var i;return Math.max(1,(i=n.maxLiveNodes)!=null?i:320)}),I=e.computed(()=>{var i;return((i=n.maxLiveNodes)!=null?i:0)<=0?!1:E.value.length>X.value}),b=e.computed(()=>!(n.viewportPriority===!1||m.value||n.deferNodesUntilVisible===!1||I.value||E.value.length>cl)),Z=gr(i=>{var d;return f((d=i!=null?i:l.value)!=null?d:null)},b),K=typeof window!="undefined",Y=K&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,te=K&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,$=typeof globalThis!="undefined"&&typeof globalThis.process!="undefined"&&((yn=(Pt=globalThis.process)==null?void 0:Pt.env)==null?void 0:yn.NODE_ENV)==="test",Le=K&&typeof window.requestIdleCallback=="function",ee=e.computed(()=>{var d;const i=Math.trunc((d=n.renderBatchSize)!=null?d:80);return Number.isFinite(i)?Math.max(0,i):0}),Ce=e.computed(()=>{var d;const i=Math.trunc((d=n.initialRenderBatchSize)!=null?d:ee.value);return Number.isFinite(i)?Math.max(0,i):ee.value}),nt=e.computed(()=>n.batchRendering!==!1&&ee.value>0&&K&&!$),A=e.ref(0),wt=e.ref({key:n.indexKey,total:0}),G=e.ref(Math.max(1,ee.value||1)),ve=e.reactive({}),C=new Map,O=new Map,j=new Map,Ee=e.ref(null);let De=null,F=null;const oe=e.computed(()=>!1),J=e.computed(()=>{var i;return nt.value&&((i=n.maxLiveNodes)!=null?i:0)<=0}),dt=e.ref({batchSize:ee.value,initial:Ce.value,delay:(xn=n.renderBatchDelay)!=null?xn:16,enabled:J.value}),ot=e.computed(()=>!!Z&&(oe.value||I.value)),mt=e.computed(()=>{var i;return Math.max(0,(i=n.liveNodeBuffer)!=null?i:60)}),ie=e.ref(0),me=e.reactive({start:0,end:0}),rt=new Map,kt=e.computed(()=>{if(!I.value)return E.value.length;const i=mt.value,d=Math.max(me.end+i,Ce.value),p=Math.min(E.value.length,d);return Math.max(A.value,p)});function Ye(i){var N,B,H;const d=f((N=l.value)!=null?N:null);if(d)return d;const p=(H=(B=l.value)==null?void 0:B.ownerDocument)!=null?H:typeof document!="undefined"?document:null;return(p==null?void 0:p.scrollingElement)||(p==null?void 0:p.documentElement)||null}function Fe(){De&&(De(),De=null),Ee.value=null}function se(){if(!K||!I.value)return;const i=Ye();if(!i||Ee.value===i)return;Fe();const d=()=>ce();i.addEventListener("scroll",d,{passive:!0}),Ee.value=i,De=()=>{i.removeEventListener("scroll",d)}}function W(){var d,p,N;if(!F)return;const i=(N=(p=(d=l.value)==null?void 0:d.ownerDocument)==null?void 0:p.defaultView)!=null?N:typeof window!="undefined"?window:null;F.viaTimeout?i?i.clearTimeout(F.id):clearTimeout(F.id):te==null||te(F.id),F=null}function ce(i={}){var p,N,B;if(!I.value)return;if(!K){Q(!0);return}if(i.immediate){W(),Q(!0);return}if(F)return;const d=()=>{F=null,Q()};if(Y)F={id:Y(d),viaTimeout:!1};else{const H=(B=(N=(p=l.value)==null?void 0:p.ownerDocument)==null?void 0:N.defaultView)!=null?B:typeof window!="undefined"?window:null;F={id:H?H.setTimeout(d,16):setTimeout(d,16),viaTimeout:!0}}}function Q(i=!1){var lt,He,_t,St,Qe,it,Ft,Kt,It,sn,cn;if(!I.value)return;const d=Ee.value||Ye();if(!d)return;const p=d.ownerDocument||((lt=l.value)==null?void 0:lt.ownerDocument)||document,N=(p==null?void 0:p.defaultView)||(typeof window!="undefined"?window:null),B=d===(p==null?void 0:p.documentElement)||d===(p==null?void 0:p.body),H=B?null:d.getBoundingClientRect(),fe=B?0:H.top,Ae=B?(_t=(He=N==null?void 0:N.innerHeight)!=null?He:d.clientHeight)!=null?_t:0:H.bottom,We=Array.from(j.entries()).sort((a,r)=>a[0]-r[0]);let Ne=null,Xe=null;for(const[a,r]of We){if(!r)continue;const c=r.getBoundingClientRect();c.bottom<=fe||c.top>=Ae||(Ne==null&&(Ne=a),Xe=a)}if(Ne==null||Xe==null){const a=l.value;if(!a)return;const r=B?{top:0}:d.getBoundingClientRect(),c=a.getBoundingClientRect(),w=B?(Ft=(it=(St=p==null?void 0:p.documentElement)==null?void 0:St.scrollTop)!=null?it:(Qe=p==null?void 0:p.body)==null?void 0:Qe.scrollTop)!=null?Ft:0:d.scrollTop,_=c.top-(B?0:r.top)+w,T=Math.max(0,w-_),R=B?(cn=(sn=(It=N==null?void 0:N.innerHeight)!=null?It:(Kt=p==null?void 0:p.documentElement)==null?void 0:Kt.clientHeight)!=null?sn:d.clientHeight)!=null?cn:0:d.clientHeight,D=T+Math.max(0,R)*.5,ne=Re(D);ie.value=pe(ne,0,Math.max(0,E.value.length-1));return}const bt=Math.round((Ne+Xe)/2);!i&&Math.abs(bt-ie.value)<=1||(ie.value=pe(bt,0,Math.max(0,E.value.length-1)))}function pe(i,d,p){return Math.min(Math.max(i,d),p)}function Ke(){const i=E.value.length;if(!I.value||i===0){me.start=0,me.end=i;return}const d=Math.min(X.value,i),p=mt.value,N=pe(ie.value-p,0,Math.max(0,i-d));me.start=N,me.end=Math.min(i,N+d)}const at=e.reactive({}),Te=e.reactive({total:0,count:0});function Et(i,d){if(!Number.isFinite(d)||d<=0)return;const p=at[i];at[i]=d,p?Te.total+=d-p:(Te.total+=d,Te.count++)}const re=e.computed(()=>Te.count>0?Math.max(12,Te.total/Te.count):32);function v(i,d){var N;if(i>=d)return 0;let p=0;for(let B=i;B<d;B++)p+=(N=at[B])!=null?N:re.value;return p}const k=e.computed(()=>{if(!I.value)return E.value.map((N,B)=>({node:N,index:B}));const i=E.value.length,d=pe(me.start,0,i),p=pe(me.end,d,i);return E.value.slice(d,p).map((N,B)=>({node:N,index:d+B}))}),M=e.computed(()=>I.value?v(0,Math.min(me.start,E.value.length)):0),z=e.computed(()=>{if(!I.value)return 0;const i=E.value.length,d=Math.min(me.end,i);return v(d,i)});function Re(i){var N;if(i<=0)return 0;let d=i;const p=E.value;for(let B=0;B<p.length;B++){const H=(N=at[B])!=null?N:re.value;if(d<=H)return B;d-=H}return Math.max(0,p.length-1)}function qe(i){if(C.size&&I.value)for(const[d,p]of C)d>=i&&(p.destroy(),C.delete(d),oe.value&&delete ve[d],U(d),j.delete(d))}function Oe(i,d){oe.value&&(ve[i]=d),d&&(I.value?ce():ie.value=pe(i,0,Math.max(0,E.value.length-1)))}function yt(i){return J.value&&i>=A.value?!1:!oe.value||i<Ce.value?!0:ve[i]===!0}function Ze(i){const d=C.get(i);d&&(d.destroy(),C.delete(i)),U(i)}function ze(i,d){if(d?j.set(i,d):j.delete(i),d||U(i),!ot.value||!Z){Ze(i),d?Oe(i,!0):oe.value&&delete ve[i];return}if(!I.value&&oe.value&&!m.value&&C.size>=ul&&(wn(),!ot.value||!Z)){Ze(i),d?Oe(i,!0):oe.value&&delete ve[i];return}if(i<Ce.value&&!I.value){Ze(i),Oe(i,!0);return}if(!d){Ze(i),oe.value&&delete ve[i];return}Ze(i);const p=Z(d,{rootMargin:"400px"});p&&(C.set(i,p),Oe(i,p.isVisible.value),oe.value&&gn(i),p.whenVisible.then(()=>{U(i),Oe(i,!0)}).catch(()=>{}).finally(()=>{C.get(i)===p&&C.delete(i);try{p.destroy()}catch(N){}}),I.value&&ce())}function At(i,d){if(!d){rt.delete(i);return}rt.set(i,d),queueMicrotask(()=>{Et(i,d.offsetHeight)})}let ft=null,Ge=null,Tt=!1,ht=null,xt=null;function ae(){K&&(ft!=null&&(te==null||te(ft),ft=null),Ge!=null&&(window.clearTimeout(Ge),Ge=null),xt!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(xt),xt=null),Tt=!1,ht=null)}function U(i){if(!K)return;const d=O.get(i);d!=null&&(window.clearTimeout(d),O.delete(i))}function gn(i){if(!K||!oe.value)return;U(i);const d=window.setTimeout(()=>{O.delete(i),Oe(i,!0)},ml);O.set(i,d)}function wn(i){if(!m.value){m.value=!0;for(const d of C.values())d.destroy();if(C.clear(),K)for(const d of O.values())window.clearTimeout(d);O.clear();for(const d of Object.keys(ve))delete ve[d]}}function rn(i,d={}){var fe,Ae;if(!J.value)return;const p=kt.value;if(A.value>=p)return;const N=Math.max(1,i),B=We=>{var He;ft=null,Ge=null,xt=null,Tt=!1;const Ne=ht!=null?ht:N;ht=null;const Xe=Math.max(2,(He=n.renderBatchBudgetMs)!=null?He:6),bt=_t=>{const St=typeof performance!="undefined"?performance.now():Date.now();A.value=Math.min(p,A.value+Math.max(1,_t)),qe(A.value);const it=(typeof performance!="undefined"?performance.now():Date.now())-St;return Vn(it),it};let lt=Ne;for(;bt(lt),!(A.value>=p||!We||(typeof We.timeRemaining=="function"?We.timeRemaining():0)<=Xe*.5);)lt=Math.max(1,Math.round(G.value));A.value<p&&an()};if(!K||d.immediate){B();return}const H=Math.max(0,(fe=n.renderBatchDelay)!=null?fe:16);if(ht=ht!=null?Math.max(ht,N):N,!Tt){if(Tt=!0,!$&&Le&&window.requestIdleCallback){const We=Math.max(0,(Ae=n.renderBatchIdleTimeoutMs)!=null?Ae:120);xt=window.requestIdleCallback(Ne=>{B(Ne)},{timeout:We});return}if(!Y||$){Ge=window.setTimeout(()=>B(),H);return}ft=Y(()=>{if(H===0){B();return}Ge=window.setTimeout(()=>B(),H)})}}function an(){if(!J.value)return;const i=nt.value?Math.max(1,Math.round(G.value)):Math.max(1,ee.value);rn(i)}function Vn(i){var B;if(!J.value)return;const d=Math.max(2,(B=n.renderBatchBudgetMs)!=null?B:6),p=Math.max(1,ee.value||1),N=Math.max(1,Math.floor(p/4));i>d*1.2?G.value=Math.max(N,Math.floor(G.value*.7)):i<d*.5&&G.value<p&&(G.value=Math.min(p,Math.ceil(G.value*1.2)))}e.watch([()=>E.value,()=>E.value.length,()=>J.value,()=>ee.value,()=>Ce.value,()=>n.renderBatchDelay,()=>n.indexKey],()=>{var He;const d=E.value.length,p=wt.value,N=n.indexKey,B=N!==void 0&&N!==p.key,H=d!==p.total,fe=B||H;wt.value={key:N,total:d};const Ae=dt.value,We=(He=n.renderBatchDelay)!=null?He:16,Ne=Ae.batchSize!==ee.value||Ae.initial!==Ce.value||Ae.delay!==We||Ae.enabled!==J.value;dt.value={batchSize:ee.value,initial:Ce.value,delay:We,enabled:J.value},(fe||Ne||!J.value)&&ae(),(fe||Ne)&&(G.value=Math.max(1,ee.value||1)),fe&&I.value&&ce({immediate:!0});const Xe=kt.value;if(!d){A.value=0,qe(0);return}if(!J.value){A.value=Xe,qe(A.value);return}B||p.total===0||Ne?A.value=Math.min(Xe,Ce.value):A.value=Math.min(A.value,Xe);const lt=Math.max(1,Ce.value||ee.value||d);A.value<Xe?rn(lt,{immediate:!K}):qe(A.value)},{immediate:!0}),e.watch(()=>I.value,i=>{if(!i){Fe(),W();return}se(),ce({immediate:!0})},{immediate:!0}),e.watch(()=>l.value,()=>{I.value&&(se(),ce({immediate:!0}))}),e.watch(()=>E.value.length,()=>{I.value&&ce({immediate:!0})}),e.watch(()=>oe.value,i=>{if(!i){for(const d of C.values())d.destroy();C.clear();for(const d of Array.from(O.keys()))U(d);for(const d of Object.keys(ve))delete ve[d];for(const[d,p]of j)p&&Oe(d,!0);return}for(const[d,p]of j)ze(d,p)},{immediate:!1}),e.watch([()=>n.viewportPriority,()=>E.value.length],([i,d])=>{if(i===!1){m.value=!1;return}m.value&&d<=dl&&(m.value=!1)}),e.watch(()=>A.value,()=>{I.value&&ce({immediate:!0})}),e.watch([ie,X,mt,()=>E.value.length,I],()=>{Ke()},{immediate:!0}),e.watch(()=>kt.value,(i,d)=>{J.value&&(typeof d=="number"&&i<=d||i>A.value&&an())}),e.onBeforeUnmount(()=>{ae();for(const i of C.values())i.destroy();C.clear();for(const i of Array.from(O.keys()))U(i);Fe(),W()});const Nt=e.defineAsyncComponent(()=>L(null,null,function*(){try{return(yield Promise.resolve().then(()=>require("./index-BOwgCLNK.cjs"))).default}catch(i){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".',i),Rt}})),Ln=e.computed(()=>n.renderCodeBlocksAsPre?Rt:Nt),Ht={text:de,paragraph:Qt,heading:$n,code_block:Nt,list:Jt,blockquote:Yt,table:en,definition_list:qt,footnote:Zt,footnote_reference:we,footnote_anchor:Lt,admonition:nn,hardbreak:Bt,link:Me,image:gt,thematic_break:tn,math_inline:ut,math_block:Sr,strong:be,emphasis:Pe,strikethrough:Be,highlight:Ve,insert:$e,subscript:Ie,superscript:Se,emoji:ge,checkbox:et,checkbox_input:et,inline_code:ye,html_inline:ke,reference:xe,html_block:ll};function jt(i){var N;if(!i)return ro;const d=tt(n.customId),p=d[String(i.type)];if(i.type==="code_block"){if(String((N=i.language)!=null?N:"").trim().toLowerCase()==="mermaid")return d.mermaid||Dt;if(p)return p;const H=d.code_block;return H||Ln.value}return p||Ht[String(i.type)]||ro}function Je(i){var d;return(i==null?void 0:i.type)==="code_block"&&String((d=i.language)!=null?d:"").trim().toLowerCase()==="mermaid"?{}:i.type==="code_block"?q({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 ln(i){s("click",i)}function kn(i){var p;(p=i.target)!=null&&p.closest("[data-node-index]")&&s("mouseover",i)}function Dn(i){var p;(p=i.target)!=null&&p.closest("[data-node-index]")&&s("mouseout",i)}return(i,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:l,class:e.normalizeClass(["markstream-vue markdown-renderer",[{dark:n.isDark}]]),onClick:ln,onMouseover:kn,onMouseout:Dn},[I.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"node-spacer",style:e.normalizeStyle({height:`${M.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,p=>{var N;return e.openBlock(),e.createElementBlock("div",{key:p.index,ref_for:!0,ref:B=>ze(p.index,B),class:"node-slot","data-node-index":p.index,"data-node-type":p.node.type},[yt(p.index)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_for:!0,ref:B=>At(p.index,B),class:"node-content"},[p.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(jt(p.node)),e.mergeProps({node:p.node,loading:p.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${p.index}`},{ref_for:!0},Je(p.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:d[0]||(d[0]=B=>s("copy",B)),onHandleArtifactClick:d[1]||(d[1]=B=>s("handleArtifactClick",B))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(jt(p.node)),e.mergeProps({key:1,node:p.node,loading:p.node.loading,"index-key":`${t.indexKey||"markdown-renderer"}-${p.index}`},{ref_for:!0},Je(p.node),{"custom-id":n.customId,"is-dark":n.isDark,onCopy:d[2]||(d[2]=B=>s("copy",B)),onHandleArtifactClick:d[3]||(d[3]=B=>s("handleArtifactClick",B))}),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:`${(N=at[p.index])!=null?N:re.value}px`})},null,4))],8,sl)}),128)),I.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"node-spacer",style:e.normalizeStyle({height:`${z.value}px`}),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0)],34))}}),je=P(fl,[["__scopeId","data-v-ec150609"]]);je.install=t=>{var n,s;const o=(s=(n=je.__name)!=null?n:je.name)!=null?s:"NodeRenderer";t.component(o,je)};const hl={key:0,class:"admonition-icon"},pl={class:"admonition-title"},vl=["aria-expanded","aria-controls","title"],gl={key:0},wl={key:1},kl=["id"],yl=e.defineComponent({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(t,{emit:o}){var h;const n=t,s=o,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},m=e.computed(()=>{if(n.node.title&&n.node.title.trim().length)return n.node.title;const y=n.node.kind||"note";return y.charAt(0).toUpperCase()+y.slice(1)}),u=e.ref(n.node.collapsible?!((h=n.node.open)==null||h):!1);function f(){n.node.collapsible&&(u.value=!u.value)}const g=`admonition-${Math.random().toString(36).slice(2,9)}`;return(y,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["admonition",[`admonition-${n.node.kind}`,n.isDark?"is-dark":""]])},[e.createElementVNode("div",{id:g,class:"admonition-header"},[l[n.node.kind]?(e.openBlock(),e.createElementBlock("span",hl,e.toDisplayString(l[n.node.kind]),1)):e.createCommentVNode("",!0),e.createElementVNode("span",pl,e.toDisplayString(m.value),1),n.node.collapsible?(e.openBlock(),e.createElementBlock("button",{key:1,class:"admonition-toggle","aria-expanded":!u.value,"aria-controls":`${g}-content`,title:u.value?"Expand":"Collapse",onClick:f},[u.value?(e.openBlock(),e.createElementBlock("span",gl,"▶")):(e.openBlock(),e.createElementBlock("span",wl,"▼"))],8,vl)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("div",{id:`${g}-content`,class:"admonition-content","aria-labelledby":g},[e.withMemo([n.node.children],()=>e.createVNode(e.unref(je),{"index-key":`admonition-${t.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:x[0]||(x[0]=S=>s("copy",S))},null,8,["index-key","nodes","custom-id","typewriter"]),x,1)],8,kl),[[e.vShow,!u.value]])],2))}}),nn=P(yl,[["__scopeId","data-v-5e95c2b7"]]);nn.install=t=>{t.component(nn.__name,nn)};let ao=!1;function xl(t){return L(this,null,function*(){if(!ao)return ao=!0,t.preloadMonacoWorkers()})}let un=null,lo=!1;function bl(){return L(this,null,function*(){if(un)return un;if(lo)return null;try{return un=yield import("stream-monaco"),yield xl(un),un}catch(t){return lo=!0,null}})}const Bl='<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>',Ml=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
5
5
|
<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" />
|
|
6
6
|
</svg>
|
|
7
7
|
`,Cl=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
@@ -196,10 +196,10 @@
|
|
|
196
196
|
<path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />
|
|
197
197
|
</g>
|
|
198
198
|
</svg>
|
|
199
|
-
`,
|
|
199
|
+
`,hi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
200
200
|
<path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m3 11.5 2.5 4 2.5-4 2.5 4 2.5-4-2.5-4-2.5 4m2.5 4h-5m7.5-4H3m10-7-2.5-4-2.5 4-2.5-4-2.5 4 2.5 4 2.5-4M5.5.5h5M3 4.5h10" />
|
|
201
201
|
</svg>
|
|
202
|
-
`,
|
|
202
|
+
`,pi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
203
203
|
<path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />
|
|
204
204
|
</svg>
|
|
205
205
|
`,vi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>',gi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
@@ -243,4 +243,4 @@
|
|
|
243
243
|
`,Ei=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
244
244
|
<path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />
|
|
245
245
|
</svg>
|
|
246
|
-
`;let Fn=null;function To(t){Fn=t!=null?t:null}const Ti={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Ni(t){if(!t)return"";const o=t.trim();if(!o)return"";const[n]=o.split(/\s+/),[s]=n.split(":");return s.toLowerCase()}function Jn(t){var n;const o=Ni(t);return(n=Ti[o])!=null?n:o}function _i(t){const o=Jn(t);if(!o)return"plaintext";switch(o){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return o}}function No(t){if(Fn){const n=Fn(t);if(n!=null&&n!=="")return n}switch(Jn(t)){case"javascript":case"js":return Wl;case"typescript":case"ts":return bi;case"jsx":return Ol;case"tsx":return xi;case"html":return Fl;case"css":return $l;case"scss":return di;case"json":return Xl;case"python":case"py":return ii;case"ruby":case"rb":return ci;case"go":case"golang":return Hl;case"r":return si;case"java":return Kl;case"kotlin":case"kt":return Yl;case"c":return El;case"cpp":case"c++":return _l;case"cs":case"csharp":return Il;case"php":return ai;case"scala":return mi;case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return fi;case"sql":return hi;case"yaml":case"yml":return Ei;case"markdown":case"md":return Gl;case"xml":return Ci;case"rust":case"rs":return ui;case"swift":return wi;case"perl":return ri;case"lua":return Zl;case"haskell":return Pl;case"erlang":return zl;case"clojure":return Tl;case"vue":return Mi;case"svg":return gi;case"mermaid":return Ql;case"dart":return Vl;case"assembly":return Cl;case"dockerfile":return Dl;case"fortran":return Al;case"lisp":return ql;case"ocaml":return oi;case"prolog":return li;case"groovy":return jl;case"matlab":return Jl;case"cobol":return Nl;case"ada":return Bl;case"julia":return Ul;case"elixir":return Rl;case"vb.net":return Bi;case"nim":return ei;case"crystal":return Sl;case"d":return Ll;case"applescript":return Ml;case"solidity":return pi;case"objectivec":return ti;case"objectivecpp":return ni;case"terraform":return ki;case"plain":case"text":case"":return yi;default:return vi}}const _o={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown","":"Plain Text",plain:"Plain Text"},Si={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)"}},Ii={class:"flex items-center space-x-2"},$i=["innerHTML"],Vi={class:"text-sm font-medium font-mono"},Li={class:"flex items-center space-x-2"},Di=["aria-pressed"],Ri=["disabled"],zi=["disabled"],Ai=["disabled"],Hi=["aria-label"],ji={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"},Pi={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"},Fi=["aria-pressed"],Ki={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"},Oi={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"},Wi=["aria-label"],Xi=["innerHTML"],Ui={class:"code-loading-placeholder"},io=10,so=36,co=1,Yi=e.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(t,{emit:o}){var re;const n=t,s=o,{t:l}=_n(),m=e.ref(String((re=n.node.language)!=null?re:"")),u=e.ref(!1),f=e.ref(!1),g=e.ref(!1),p=e.ref(null),y=e.ref(null),x=e.ref(""),S=e.ref(!1);let V;const E=e.ref(!0),X=e.ref(0),I=e.ref(14),b=e.ref(I.value),Z=e.computed(()=>{const v=I.value,k=b.value;return typeof v=="number"&&Number.isFinite(v)&&v>0&&typeof k=="number"&&Number.isFinite(k)&&k>0}),K=e.computed(()=>{const v=m.value.trim().toLowerCase();return _o[v]||v.charAt(0).toUpperCase()+v.slice(1)}),Y=e.computed(()=>m.value.trim().toLowerCase()==="mermaid"),te=e.computed(()=>{const v=m.value.trim().toLowerCase();return No(v.split(":")[0])}),$=e.computed(()=>{const v=m.value.trim().toLowerCase();return n.isShowPreview&&(v==="html"||v==="svg")}),Ve=e.computed(()=>{const v={},k=De=>{if(De!=null)return typeof De=="number"?`${De}px`:String(De)},M=k(n.minWidth),z=k(n.maxWidth);return M&&(v.minWidth=M),z&&(v.maxWidth=z),v}),ee=e.computed(()=>({fontSize:`${b.value}px`}));function Me(){return n.isDark?n.darkTheme:n.lightTheme}function tt(v){return v.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function A(v){if(V==null||V.disconnect(),V=void 0,!v){x.value="",S.value=!1;return}x.value=`<pre class="shiki shiki-fallback"><code>${tt(v)}</code></pre>`,S.value=!1}function gt(){x.value="",S.value=!0}function G(){var k;const v=y.value;return v?v.childNodes.length>0?!0:!!((k=v.textContent)!=null&&k.trim().length):!1}function ve(){return L(this,null,function*(){if(yield e.nextTick(),G()){gt();return}const v=y.value;v&&(V==null||V.disconnect(),V=new MutationObserver(()=>{G()&&(gt(),V==null||V.disconnect(),V=void 0)}),V.observe(v,{childList:!0,subtree:!0}))})}let C,O,j,Ce=()=>{},Le;const F=new Set,oe=new Set,J=typeof{url:typeof document=="undefined"?require("url").pathToFileURL(__filename).href:zn&&zn.tagName.toUpperCase()==="SCRIPT"&&zn.src||new URL("exports-1obt4rfJ.cjs",document.baseURI).href}!="undefined"&&!1;function ut(v,k=!1){var De;const[M]=String(v!=null?v:"").split(":"),z=(De=M==null?void 0:M.trim().toLowerCase())!=null?De:"";return z?!Le||Le.has(z)?z:(k&&J&&!F.has(z)&&(F.add(z),console.warn(`[MarkdownCodeBlockNode] Language "${z}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}function nt(v,k){return L(this,null,function*(){if(!C)return;const M=ut(k,!!(v&&v.length));try{yield C.updateCode(v,M)}catch(z){M!=="plaintext"?(J&&!oe.has(M)&&(oe.add(M),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${M}", retrying as plaintext.`,z)),yield C.updateCode(v,"plaintext")):J&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",z)}})}function dt(){return L(this,null,function*(){if(!O)try{const v=yield import("stream-markdown");O=v.createShikiStreamRenderer,j=v.registerHighlight,Ce=v.disposeHighlighter;const k=Array.isArray(v.defaultLanguages)?v.defaultLanguages:void 0;Le=k?new Set(k.map(M=>M.toLowerCase())):void 0,j==null||j({themes:n.themes})}catch(v){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",v)}})}function ie(){return L(this,null,function*(){if(Y.value){Ce(),C==null||C.dispose(),C=void 0,S.value=!1;return}if(yield dt(),!p.value||!y.value){A(n.node.code);return}if(j==null||j({themes:n.themes}),!C&&O&&(C=O(y.value,{theme:Me()}),S.value=!0),!C){A(n.node.code);return}if(n.stream===!1&&n.loading){A(n.node.code);return}A(n.node.code),yield nt(n.node.code,m.value),yield ve()})}ie(),e.onMounted(()=>{ie()}),e.watch(()=>n.themes,()=>L(null,null,function*(){j&&j({themes:n.themes})})),e.watch(()=>n.loading,v=>{v||ie()}),e.watch(()=>[n.node.code,n.node.language],M=>L(null,[M],function*([v,k]){if(k!==m.value&&(m.value=k.trim()),!p.value||!y.value){A(v);return}if(Y.value){Ce(),C==null||C.dispose();return}C||(A(v),yield ie()),!(!C||!v)&&(n.stream===!1&&n.loading||(A(v),yield nt(v,k),yield ve()))}));const me=e.watch(()=>[n.darkTheme,n.lightTheme],()=>L(null,null,function*(){if(!(!p.value||!y.value)){if(Y.value)return Ce(),C==null||C.dispose(),me();C||(yield ie()),C==null||C.setTheme(Me())}}));e.watch(()=>n.node.code,()=>L(null,null,function*(){if(f.value||!E.value)return;yield e.nextTick();const v=p.value;v&&v.scrollHeight>v.clientHeight&&(v.scrollTop=v.scrollHeight)}));function ot(v,k=50){return v.scrollHeight-v.scrollTop-v.clientHeight<=k}function wt(){const v=p.value;if(!v||f.value)return;const k=v.scrollTop;k<X.value?E.value=!1:ot(v)&&(E.value=!0),X.value=k}function Ue(){return L(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n.node.code)),u.value=!0,s("copy",n.node.code),setTimeout(()=>{u.value=!1},1e3)}catch(v){console.error("Copy failed:",v)}})}function Pe(v){const k=v;return!k||k.disabled}function se(v,k,M="top"){if(Pe(v.currentTarget))return;const z=v,De=(z==null?void 0:z.clientX)!=null&&(z==null?void 0:z.clientY)!=null?{x:z.clientX,y:z.clientY}:void 0;on(v.currentTarget,k,M,!1,De,n.isDark)}function W(){Nn()}function ce(v){if(Pe(v.currentTarget))return;const k=u.value?l("common.copied")||"Copied":l("common.copy")||"Copy",M=v,z=(M==null?void 0:M.clientX)!=null&&(M==null?void 0:M.clientY)!=null?{x:M.clientX,y:M.clientY}:void 0;on(v.currentTarget,k,"top",!1,z,n.isDark)}function Q(){f.value=!f.value;const v=p.value;v&&(f.value?(v.style.maxHeight="none",v.style.overflow="visible"):(v.style.maxHeight="500px",v.style.overflow="auto",E.value=!0,e.nextTick(()=>{v.scrollHeight>v.clientHeight&&(v.scrollTop=v.scrollHeight)})))}function he(){g.value=!g.value}function Fe(){const v=Math.min(so,b.value+co);b.value=v}function rt(){const v=Math.max(io,b.value-co);b.value=v}function Ee(){b.value=I.value}function Ct(){if(!$.value)return;const v=(m.value||n.node.language).toLowerCase(),k=v==="html"?"text/html":"image/svg+xml",M=v==="html"?"HTML Preview":"SVG Preview";s("previewCode",{type:k,content:n.node.code,title:M})}return(v,k)=>Y.value?(e.openBlock(),e.createBlock(e.unref(Lt),{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(Ve.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",Si,[e.renderSlot(v.$slots,"header-left",{},()=>[e.createElementVNode("div",Ii,[e.createElementVNode("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:te.value},null,8,$i),e.createElementVNode("span",Vi,e.toDisplayString(K.value),1)])],!0),e.renderSlot(v.$slots,"header-right",{},()=>[e.createElementVNode("div",Li,[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":g.value,onClick:he,onMouseenter:k[0]||(k[0]=M=>se(M,g.value?e.unref(l)("common.expand")||"Expand":e.unref(l)("common.collapse")||"Collapse")),onFocus:k[1]||(k[1]=M=>se(M,g.value?e.unref(l)("common.expand")||"Expand":e.unref(l)("common.collapse")||"Collapse")),onMouseleave:W,onBlur:W},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:g.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,Di),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(b.value)?b.value<=io:!1,onClick:k[2]||(k[2]=M=>rt()),onMouseenter:k[3]||(k[3]=M=>se(M,e.unref(l)("common.decrease")||"Decrease")),onFocus:k[4]||(k[4]=M=>se(M,e.unref(l)("common.decrease")||"Decrease")),onMouseleave:W,onBlur:W},[...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,Ri),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!Z.value||b.value===I.value,onClick:k[5]||(k[5]=M=>Ee()),onMouseenter:k[6]||(k[6]=M=>se(M,e.unref(l)("common.reset")||"Reset")),onFocus:k[7]||(k[7]=M=>se(M,e.unref(l)("common.reset")||"Reset")),onMouseleave:W,onBlur:W},[...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,zi),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(b.value)?b.value>=so:!1,onClick:k[8]||(k[8]=M=>Fe()),onMouseenter:k[9]||(k[9]=M=>se(M,e.unref(l)("common.increase")||"Increase")),onFocus:k[10]||(k[10]=M=>se(M,e.unref(l)("common.increase")||"Increase")),onMouseleave:W,onBlur:W},[...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,Ai)],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":u.value?e.unref(l)("common.copied")||"Copied":e.unref(l)("common.copy")||"Copy",onClick:Ue,onMouseenter:k[11]||(k[11]=M=>ce(M)),onFocus:k[12]||(k[12]=M=>ce(M)),onMouseleave:W,onBlur:W},[u.value?(e.openBlock(),e.createElementBlock("svg",Pi,[...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",ji,[...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,Hi)):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":f.value,onClick:Q,onMouseenter:k[13]||(k[13]=M=>se(M,f.value?e.unref(l)("common.collapse")||"Collapse":e.unref(l)("common.expand")||"Expand")),onFocus:k[14]||(k[14]=M=>se(M,f.value?e.unref(l)("common.collapse")||"Collapse":e.unref(l)("common.expand")||"Expand")),onMouseleave:W,onBlur:W},[f.value?(e.openBlock(),e.createElementBlock("svg",Ki,[...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",Oi,[...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,Fi)):e.createCommentVNode("",!0),$.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(l)("common.preview")||"Preview",onClick:Ct,onMouseenter:k[15]||(k[15]=M=>se(M,e.unref(l)("common.preview")||"Preview")),onFocus:k[16]||(k[16]=M=>se(M,e.unref(l)("common.preview")||"Preview")),onMouseleave:W,onBlur:W},[...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,Wi)):e.createCommentVNode("",!0)])],!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"codeBlockContent",ref:p,class:"code-block-content",style:e.normalizeStyle(ee.value),onScroll:wt},[e.createElementVNode("div",{ref_key:"rendererTarget",ref:y,class:"code-block-render"},null,512),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"code-fallback-plain",innerHTML:x.value},null,8,Xi))],36),[[e.vShow,!g.value&&(t.stream?!0:!t.loading)]]),e.withDirectives(e.createElementVNode("div",Ui,[e.renderSlot(v.$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))}}),fn=P(Yi,[["__scopeId","data-v-34bf55f7"]]);fn.install=t=>{t.component(fn.__name,fn)};let Xe=null,Mt=null,uo=!1;const Ne=new Map,pt=new Map,So=200;let zt=5;const It=new Set;function vn(){if(Ne.size<zt&&It.size){const t=Array.from(It);It.clear();for(const o of t)try{o()}catch(n){}}}let st=null;function qi(t){Xe=t,Mt=null,Xe.onmessage=o=>{const{id:n,html:s,error:l}=o.data,m=Ne.get(n);if(m)if(Ne.delete(n),clearTimeout(m.timeoutId),vn(),l)m.reject(new Error(l));else{const{content:u,displayMode:f}=o.data;if(u){const g=`${f?"d":"i"}:${u}`;if(pt.set(g,s),pt.size>So){const p=pt.keys().next().value;pt.delete(p)}}m.resolve(s)}},Xe.onerror=o=>{console.error("[katexWorkerClient] Worker error:",o);for(const[n,s]of Ne.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${o.message}`));Ne.clear(),vn()}}function Zi(){var t;Xe&&((t=Xe.terminate)==null||t.call(Xe)),Xe=null,Mt=null}function Gi(){return Xe||(Mt=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Mt.name="WorkerInitError",Mt.code="WORKER_INIT_ERROR",null)}function Ji(t){uo=!!t,Xe&&Xe.postMessage({type:"init",debug:uo})}function Io(t,o=!0,n=2e3,s){return L(this,null,function*(){const l=performance.now();if(!Yn()){const g=new Error("KaTeX rendering disabled");return g.name="KaTeXDisabled",g.code="KATEX_DISABLED",Promise.reject(g)}if(Mt)return Promise.reject(Mt);const m=`${o?"d":"i"}:${t}`,u=pt.get(m);if(u)return st&&st.recordRender({type:"cache-hit",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!0}),Promise.resolve(u);const f=Gi();if(!f)return Promise.reject(Mt);if(Ne.size>=zt){const g=new Error("Worker busy");return g.name="WorkerBusy",g.code="WORKER_BUSY",g.busy=!0,g.inFlight=Ne.size,g.max=zt,st&&st.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(g)}return new Promise((g,p)=>{if(s!=null&&s.aborted){const b=new Error("Aborted");b.name="AbortError",p(b);return}const y=Math.random().toString(36).slice(2),x=globalThis.setTimeout(()=>{Ne.delete(y);const b=new Error("Worker render timed out");b.name="WorkerTimeout",b.code="WORKER_TIMEOUT",st&&st.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"timeout"}),p(b),vn()},n),S=()=>{globalThis.clearTimeout(x),Ne.has(y)&&Ne.delete(y);const b=new Error("Aborted");b.name="AbortError",p(b),vn()};s&&s.addEventListener("abort",S,{once:!0});const V=g,E=p,X=b=>{st&&st.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!0}),V(b)},I=b=>{st&&st.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!1,error:(b==null?void 0:b.message)||String(b)}),E(b)};Ne.set(y,{resolve:X,reject:I,timeoutId:x}),f.postMessage({id:y,content:t,displayMode:o})})})}function Qi(t,o=!0,n){const s=`${o?"d":"i"}:${t}`;if(pt.set(s,n),pt.size>So){const l=pt.keys().next().value;pt.delete(l)}}function es(){return{inFlight:Ne.size,max:zt}}function ts(t){Number.isFinite(t)&&t>0&&(zt=Math.floor(t))}const $o="WORKER_BUSY";function ns(){return Ne.size>=zt}function Vo(t=2e3,o){return Ne.size<zt?Promise.resolve():new Promise((n,s)=>{let l=!1,m;const u=()=>{l||(l=!0,m&&globalThis.clearTimeout(m),It.delete(u),n())};if(It.add(u),m=globalThis.setTimeout(()=>{if(l)return;l=!0,It.delete(u);const f=new Error("Wait for worker slot timed out");f.name="WorkerBusyTimeout",f.code="WORKER_BUSY_TIMEOUT",s(f)},t),queueMicrotask(()=>vn()),o){const f=()=>{if(l)return;l=!0,m&&globalThis.clearTimeout(m),It.delete(u);const g=new Error("Aborted");g.name="AbortError",s(g)};o.aborted?f():o.addEventListener("abort",f,{once:!0})}})}const ht={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function os(t){t.timeout!=null&&(ht.timeout=Math.max(0,Math.floor(t.timeout))),t.waitTimeout!=null&&(ht.waitTimeout=Math.max(0,Math.floor(t.waitTimeout))),t.backoffMs!=null&&(ht.backoffMs=Math.max(0,Math.floor(t.backoffMs))),t.maxRetries!=null&&(ht.maxRetries=Math.max(0,Math.floor(t.maxRetries)))}function rs(){return q({},ht)}function as(s){return L(this,arguments,function*(t,o=!0,n={}){var y,x,S,V;if(!Yn()){const E=new Error("KaTeX rendering disabled");throw E.name="KaTeXDisabled",E.code="KATEX_DISABLED",E}const l=(y=n.timeout)!=null?y:ht.timeout,m=(x=n.waitTimeout)!=null?x:ht.waitTimeout,u=(S=n.backoffMs)!=null?S:ht.backoffMs,f=(V=n.maxRetries)!=null?V:ht.maxRetries,g=n.signal;let p=0;for(;;){if(g!=null&&g.aborted){const E=new Error("Aborted");throw E.name="AbortError",E}try{return yield Io(t,o,l,g)}catch(E){if((E==null?void 0:E.code)!==$o||p>=f)throw E;if(p++,yield Vo(m,g).catch(()=>{}),g!=null&&g.aborted){const X=new Error("Aborted");throw X.name="AbortError",X}u>0&&(yield new Promise(X=>globalThis.setTimeout(X,u*p)))}}})}const Lo=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BS4IAchB.cjs"))),Do=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-KPngPBen.cjs"))),Ro=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DD2YWdWI.cjs"))),ls={AdmonitionNode:nn,BlockquoteNode:Yt,CheckboxNode:Qe,CodeBlockNode:Lo,DefinitionListNode:qt,EmojiNode:ge,FootnoteNode:Zt,FootnoteReferenceNode:we,FootnoteAnchorNode:Vt,HardBreakNode:bt,HeadingNode:$n,HtmlInlineNode:Dt,HighlightNode:$e,ImageNode:vt,InlineCodeNode:ke,PreCodeNode:Rt,InsertNode:Ie,LinkNode:Be,ListItemNode:Gt,ListNode:Jt,MathBlockNode:Do,MathInlineNode:Ro,MermaidBlockNode:Lt,ParagraphNode:Qt,StrikethroughNode:be,StrongNode:xe,SubscriptNode:Se,SuperscriptNode:_e,TableNode:en,TextNode:de,ThematicBreakNode:tn,ReferenceNode:ye,MarkdownCodeBlockNode:fn},is={install(t,o){Object.entries(ls).forEach(([n,s])=>{t.component(n,s)}),o!=null&&o.getLanguageIcon&&To(o.getLanguageIcon),o!=null&&o.mathOptions&&Bn.setDefaultMathOptions(o.mathOptions)}};exports.AdmonitionNode=nn;exports.BlockquoteNode=Yt;exports.CheckboxNode=Qe;exports.CodeBlockNode=Lo;exports.DefinitionListNode=qt;exports.EmojiNode=ge;exports.FootnoteAnchorNode=Vt;exports.FootnoteReferenceNode=we;exports.HardBreakNode=bt;exports.HighlightNode=$e;exports.HtmlInlineNode=Dt;exports.ImageNode=vt;exports.InsertNode=Ie;exports.LinkNode=Be;exports.ListItemNode=Gt;exports.ListNode=Jt;exports.MERMAID_DISABLED_CODE=Bo;exports.MERMAID_WORKER_BUSY_CODE=bo;exports.MarkdownCodeBlockNode=fn;exports.MathBlockNode=Do;exports.MathInlineNode=Ro;exports.MermaidBlockNode=Lt;exports.NodeRenderer=He;exports.ParagraphNode=Qt;exports.StrikethroughNode=be;exports.StrongNode=xe;exports.SubscriptNode=Se;exports.SuperscriptNode=_e;exports.TableNode=en;exports.TextNode=de;exports.ThematicBreakNode=tn;exports.VueRendererMarkdown=is;exports.WORKER_BUSY_CODE=$o;exports._HeadingNode=$n;exports._export_sfc=P;exports._sfc_main=Rt;exports._sfc_main$1=Zt;exports._sfc_main$2=ke;exports._sfc_main$3=ye;exports.canParseOffthread=Co;exports.clearGlobalCustomComponents=ar;exports.clearKaTeXWorker=Zi;exports.clearMermaidWorker=ka;exports.disableKatex=Tr;exports.disableMermaid=ua;exports.enableKatex=Er;exports.enableMermaid=ca;exports.findPrefixOffthread=Eo;exports.getCustomNodeComponents=et;exports.getKaTeXBackpressureDefaults=rs;exports.getKaTeXWorkerLoad=es;exports.getKatex=In;exports.getLanguageIcon=No;exports.getMermaidWorkerLoad=ga;exports.getUseMonaco=bl;exports.hideTooltip=Nn;exports.isKaTeXWorkerBusy=ns;exports.isKatexEnabled=Yn;exports.isMermaidEnabled=xo;exports.languageMap=_o;exports.normalizeLanguageIdentifier=Jn;exports.removeCustomComponents=rr;exports.renderKaTeXInWorker=Io;exports.renderKaTeXWithBackpressure=as;exports.resolveMonacoLanguageId=_i;exports.safeRaf=yo;exports.setCustomComponents=or;exports.setDefaultI18nMap=hr;exports.setKaTeXBackpressureDefaults=os;exports.setKaTeXCache=Qi;exports.setKaTeXWorker=qi;exports.setKaTeXWorkerDebug=Ji;exports.setKaTeXWorkerMaxConcurrency=ts;exports.setKatexLoader=Un;exports.setLanguageIconResolver=To;exports.setMermaidLoader=Gn;exports.setMermaidWorker=wa;exports.setMermaidWorkerClientDebug=ha;exports.setMermaidWorkerMaxConcurrency=va;exports.showTooltipForAnchor=on;exports.terminateWorker=Pn;exports.useSafeI18n=_n;exports.useViewportPriority=Sn;exports.waitForKaTeXWorkerSlot=Vo;
|
|
246
|
+
`;let Fn=null;function To(t){Fn=t!=null?t:null}const Ti={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Ni(t){if(!t)return"";const o=t.trim();if(!o)return"";const[n]=o.split(/\s+/),[s]=n.split(":");return s.toLowerCase()}function Jn(t){var n;const o=Ni(t);return(n=Ti[o])!=null?n:o}function _i(t){const o=Jn(t);if(!o)return"plaintext";switch(o){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return o}}function No(t){if(Fn){const n=Fn(t);if(n!=null&&n!=="")return n}switch(Jn(t)){case"javascript":case"js":return Wl;case"typescript":case"ts":return bi;case"jsx":return Ol;case"tsx":return xi;case"html":return Fl;case"css":return $l;case"scss":return di;case"json":return Xl;case"python":case"py":return ii;case"ruby":case"rb":return ci;case"go":case"golang":return Hl;case"r":return si;case"java":return Kl;case"kotlin":case"kt":return Yl;case"c":return El;case"cpp":case"c++":return _l;case"cs":case"csharp":return Il;case"php":return ai;case"scala":return mi;case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return fi;case"sql":return pi;case"yaml":case"yml":return Ei;case"markdown":case"md":return Gl;case"xml":return Ci;case"rust":case"rs":return ui;case"swift":return wi;case"perl":return ri;case"lua":return Zl;case"haskell":return Pl;case"erlang":return zl;case"clojure":return Tl;case"vue":return Mi;case"svg":return gi;case"mermaid":return Ql;case"dart":return Vl;case"assembly":return Cl;case"dockerfile":return Dl;case"fortran":return Al;case"lisp":return ql;case"ocaml":return oi;case"prolog":return li;case"groovy":return jl;case"matlab":return Jl;case"cobol":return Nl;case"ada":return Bl;case"julia":return Ul;case"elixir":return Rl;case"vb.net":return Bi;case"nim":return ei;case"crystal":return Sl;case"d":return Ll;case"applescript":return Ml;case"solidity":return hi;case"objectivec":return ti;case"objectivecpp":return ni;case"terraform":return ki;case"plain":case"text":case"":return yi;default:return vi}}const _o={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown","":"Plain Text",plain:"Plain Text"},Si={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)"}},Ii={class:"flex items-center space-x-2"},$i=["innerHTML"],Vi={class:"text-sm font-medium font-mono"},Li={class:"flex items-center space-x-2"},Di=["aria-pressed"],Ri=["disabled"],zi=["disabled"],Ai=["disabled"],Hi=["aria-label"],ji={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"},Pi={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"},Fi=["aria-pressed"],Ki={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"},Oi={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"},Wi=["aria-label"],Xi=["innerHTML"],Ui={class:"code-loading-placeholder"},io=10,so=36,co=1,Yi=e.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(t,{emit:o}){var re;const n=t,s=o,{t:l}=_n(),m=e.ref(String((re=n.node.language)!=null?re:"")),u=e.ref(!1),f=e.ref(!1),g=e.ref(!1),h=e.ref(null),y=e.ref(null),x=e.ref(""),S=e.ref(!1);let V;const E=e.ref(!0),X=e.ref(0),I=e.ref(14),b=e.ref(I.value),Z=e.computed(()=>{const v=I.value,k=b.value;return typeof v=="number"&&Number.isFinite(v)&&v>0&&typeof k=="number"&&Number.isFinite(k)&&k>0}),K=e.computed(()=>{const v=m.value.trim().toLowerCase();return _o[v]||v.charAt(0).toUpperCase()+v.slice(1)}),Y=e.computed(()=>m.value.trim().toLowerCase()==="mermaid"),te=e.computed(()=>{const v=m.value.trim().toLowerCase();return No(v.split(":")[0])}),$=e.computed(()=>{const v=m.value.trim().toLowerCase();return n.isShowPreview&&(v==="html"||v==="svg")}),Le=e.computed(()=>{const v={},k=Re=>{if(Re!=null)return typeof Re=="number"?`${Re}px`:String(Re)},M=k(n.minWidth),z=k(n.maxWidth);return M&&(v.minWidth=M),z&&(v.maxWidth=z),v}),ee=e.computed(()=>({fontSize:`${b.value}px`}));function Ce(){return n.isDark?n.darkTheme:n.lightTheme}function nt(v){return v.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function A(v){if(V==null||V.disconnect(),V=void 0,!v){x.value="",S.value=!1;return}x.value=`<pre class="shiki shiki-fallback"><code>${nt(v)}</code></pre>`,S.value=!1}function wt(){x.value="",S.value=!0}function G(){var k;const v=y.value;return v?v.childNodes.length>0?!0:!!((k=v.textContent)!=null&&k.trim().length):!1}function ve(){return L(this,null,function*(){if(yield e.nextTick(),G()){wt();return}const v=y.value;v&&(V==null||V.disconnect(),V=new MutationObserver(()=>{G()&&(wt(),V==null||V.disconnect(),V=void 0)}),V.observe(v,{childList:!0,subtree:!0}))})}let C,O,j,Ee=()=>{},De;const F=new Set,oe=new Set,J=typeof{url:typeof document=="undefined"?require("url").pathToFileURL(__filename).href:zn&&zn.tagName.toUpperCase()==="SCRIPT"&&zn.src||new URL("exports-ISf5W5H7.cjs",document.baseURI).href}!="undefined"&&!1;function dt(v,k=!1){var Re;const[M]=String(v!=null?v:"").split(":"),z=(Re=M==null?void 0:M.trim().toLowerCase())!=null?Re:"";return z?!De||De.has(z)?z:(k&&J&&!F.has(z)&&(F.add(z),console.warn(`[MarkdownCodeBlockNode] Language "${z}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}function ot(v,k){return L(this,null,function*(){if(!C)return;const M=dt(k,!!(v&&v.length));try{yield C.updateCode(v,M)}catch(z){M!=="plaintext"?(J&&!oe.has(M)&&(oe.add(M),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${M}", retrying as plaintext.`,z)),yield C.updateCode(v,"plaintext")):J&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",z)}})}function mt(){return L(this,null,function*(){if(!O)try{const v=yield import("stream-markdown");O=v.createShikiStreamRenderer,j=v.registerHighlight,Ee=v.disposeHighlighter;const k=Array.isArray(v.defaultLanguages)?v.defaultLanguages:void 0;De=k?new Set(k.map(M=>M.toLowerCase())):void 0,j==null||j({themes:n.themes})}catch(v){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",v)}})}function ie(){return L(this,null,function*(){if(Y.value){Ee(),C==null||C.dispose(),C=void 0,S.value=!1;return}if(yield mt(),!h.value||!y.value){A(n.node.code);return}if(j==null||j({themes:n.themes}),!C&&O&&(C=O(y.value,{theme:Ce()}),S.value=!0),!C){A(n.node.code);return}if(n.stream===!1&&n.loading){A(n.node.code);return}A(n.node.code),yield ot(n.node.code,m.value),yield ve()})}ie(),e.onMounted(()=>{ie()}),e.watch(()=>n.themes,()=>L(null,null,function*(){j&&j({themes:n.themes})})),e.watch(()=>n.loading,v=>{v||ie()}),e.watch(()=>[n.node.code,n.node.language],M=>L(null,[M],function*([v,k]){if(k!==m.value&&(m.value=k.trim()),!h.value||!y.value){A(v);return}if(Y.value){Ee(),C==null||C.dispose();return}C||(A(v),yield ie()),!(!C||!v)&&(n.stream===!1&&n.loading||(A(v),yield ot(v,k),yield ve()))}));const me=e.watch(()=>[n.darkTheme,n.lightTheme],()=>L(null,null,function*(){if(!(!h.value||!y.value)){if(Y.value)return Ee(),C==null||C.dispose(),me();C||(yield ie()),C==null||C.setTheme(Ce())}}));e.watch(()=>n.node.code,()=>L(null,null,function*(){if(f.value||!E.value)return;yield e.nextTick();const v=h.value;v&&v.scrollHeight>v.clientHeight&&(v.scrollTop=v.scrollHeight)}));function rt(v,k=50){return v.scrollHeight-v.scrollTop-v.clientHeight<=k}function kt(){const v=h.value;if(!v||f.value)return;const k=v.scrollTop;k<X.value?E.value=!1:rt(v)&&(E.value=!0),X.value=k}function Ye(){return L(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n.node.code)),u.value=!0,s("copy",n.node.code),setTimeout(()=>{u.value=!1},1e3)}catch(v){console.error("Copy failed:",v)}})}function Fe(v){const k=v;return!k||k.disabled}function se(v,k,M="top"){if(Fe(v.currentTarget))return;const z=v,Re=(z==null?void 0:z.clientX)!=null&&(z==null?void 0:z.clientY)!=null?{x:z.clientX,y:z.clientY}:void 0;on(v.currentTarget,k,M,!1,Re,n.isDark)}function W(){Nn()}function ce(v){if(Fe(v.currentTarget))return;const k=u.value?l("common.copied")||"Copied":l("common.copy")||"Copy",M=v,z=(M==null?void 0:M.clientX)!=null&&(M==null?void 0:M.clientY)!=null?{x:M.clientX,y:M.clientY}:void 0;on(v.currentTarget,k,"top",!1,z,n.isDark)}function Q(){f.value=!f.value;const v=h.value;v&&(f.value?(v.style.maxHeight="none",v.style.overflow="visible"):(v.style.maxHeight="500px",v.style.overflow="auto",E.value=!0,e.nextTick(()=>{v.scrollHeight>v.clientHeight&&(v.scrollTop=v.scrollHeight)})))}function pe(){g.value=!g.value}function Ke(){const v=Math.min(so,b.value+co);b.value=v}function at(){const v=Math.max(io,b.value-co);b.value=v}function Te(){b.value=I.value}function Et(){if(!$.value)return;const v=(m.value||n.node.language).toLowerCase(),k=v==="html"?"text/html":"image/svg+xml",M=v==="html"?"HTML Preview":"SVG Preview";s("previewCode",{type:k,content:n.node.code,title:M})}return(v,k)=>Y.value?(e.openBlock(),e.createBlock(e.unref(Dt),{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(Le.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",Si,[e.renderSlot(v.$slots,"header-left",{},()=>[e.createElementVNode("div",Ii,[e.createElementVNode("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:te.value},null,8,$i),e.createElementVNode("span",Vi,e.toDisplayString(K.value),1)])],!0),e.renderSlot(v.$slots,"header-right",{},()=>[e.createElementVNode("div",Li,[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":g.value,onClick:pe,onMouseenter:k[0]||(k[0]=M=>se(M,g.value?e.unref(l)("common.expand")||"Expand":e.unref(l)("common.collapse")||"Collapse")),onFocus:k[1]||(k[1]=M=>se(M,g.value?e.unref(l)("common.expand")||"Expand":e.unref(l)("common.collapse")||"Collapse")),onMouseleave:W,onBlur:W},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:g.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,Di),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(b.value)?b.value<=io:!1,onClick:k[2]||(k[2]=M=>at()),onMouseenter:k[3]||(k[3]=M=>se(M,e.unref(l)("common.decrease")||"Decrease")),onFocus:k[4]||(k[4]=M=>se(M,e.unref(l)("common.decrease")||"Decrease")),onMouseleave:W,onBlur:W},[...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,Ri),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!Z.value||b.value===I.value,onClick:k[5]||(k[5]=M=>Te()),onMouseenter:k[6]||(k[6]=M=>se(M,e.unref(l)("common.reset")||"Reset")),onFocus:k[7]||(k[7]=M=>se(M,e.unref(l)("common.reset")||"Reset")),onMouseleave:W,onBlur:W},[...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,zi),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(b.value)?b.value>=so:!1,onClick:k[8]||(k[8]=M=>Ke()),onMouseenter:k[9]||(k[9]=M=>se(M,e.unref(l)("common.increase")||"Increase")),onFocus:k[10]||(k[10]=M=>se(M,e.unref(l)("common.increase")||"Increase")),onMouseleave:W,onBlur:W},[...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,Ai)],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":u.value?e.unref(l)("common.copied")||"Copied":e.unref(l)("common.copy")||"Copy",onClick:Ye,onMouseenter:k[11]||(k[11]=M=>ce(M)),onFocus:k[12]||(k[12]=M=>ce(M)),onMouseleave:W,onBlur:W},[u.value?(e.openBlock(),e.createElementBlock("svg",Pi,[...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",ji,[...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,Hi)):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":f.value,onClick:Q,onMouseenter:k[13]||(k[13]=M=>se(M,f.value?e.unref(l)("common.collapse")||"Collapse":e.unref(l)("common.expand")||"Expand")),onFocus:k[14]||(k[14]=M=>se(M,f.value?e.unref(l)("common.collapse")||"Collapse":e.unref(l)("common.expand")||"Expand")),onMouseleave:W,onBlur:W},[f.value?(e.openBlock(),e.createElementBlock("svg",Ki,[...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",Oi,[...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,Fi)):e.createCommentVNode("",!0),$.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(l)("common.preview")||"Preview",onClick:Et,onMouseenter:k[15]||(k[15]=M=>se(M,e.unref(l)("common.preview")||"Preview")),onFocus:k[16]||(k[16]=M=>se(M,e.unref(l)("common.preview")||"Preview")),onMouseleave:W,onBlur:W},[...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,Wi)):e.createCommentVNode("",!0)])],!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"codeBlockContent",ref:h,class:"code-block-content",style:e.normalizeStyle(ee.value),onScroll:kt},[e.createElementVNode("div",{ref_key:"rendererTarget",ref:y,class:"code-block-render"},null,512),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"code-fallback-plain",innerHTML:x.value},null,8,Xi))],36),[[e.vShow,!g.value&&(t.stream?!0:!t.loading)]]),e.withDirectives(e.createElementVNode("div",Ui,[e.renderSlot(v.$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))}}),fn=P(Yi,[["__scopeId","data-v-34bf55f7"]]);fn.install=t=>{t.component(fn.__name,fn)};let Ue=null,Ct=null,uo=!1;const _e=new Map,pt=new Map,So=200;let zt=5;const $t=new Set;function vn(){if(_e.size<zt&&$t.size){const t=Array.from($t);$t.clear();for(const o of t)try{o()}catch(n){}}}let ct=null;function qi(t){Ue=t,Ct=null,Ue.onmessage=o=>{const{id:n,html:s,error:l}=o.data,m=_e.get(n);if(m)if(_e.delete(n),clearTimeout(m.timeoutId),vn(),l)m.reject(new Error(l));else{const{content:u,displayMode:f}=o.data;if(u){const g=`${f?"d":"i"}:${u}`;if(pt.set(g,s),pt.size>So){const h=pt.keys().next().value;pt.delete(h)}}m.resolve(s)}},Ue.onerror=o=>{console.error("[katexWorkerClient] Worker error:",o);for(const[n,s]of _e.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${o.message}`));_e.clear(),vn()}}function Zi(){var t;Ue&&((t=Ue.terminate)==null||t.call(Ue)),Ue=null,Ct=null}function Gi(){return Ue||(Ct=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ct.name="WorkerInitError",Ct.code="WORKER_INIT_ERROR",null)}function Ji(t){uo=!!t,Ue&&Ue.postMessage({type:"init",debug:uo})}function Io(t,o=!0,n=2e3,s){return L(this,null,function*(){const l=performance.now();if(!Yn()){const g=new Error("KaTeX rendering disabled");return g.name="KaTeXDisabled",g.code="KATEX_DISABLED",Promise.reject(g)}if(Ct)return Promise.reject(Ct);const m=`${o?"d":"i"}:${t}`,u=pt.get(m);if(u)return ct&&ct.recordRender({type:"cache-hit",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!0}),Promise.resolve(u);const f=Gi();if(!f)return Promise.reject(Ct);if(_e.size>=zt){const g=new Error("Worker busy");return g.name="WorkerBusy",g.code="WORKER_BUSY",g.busy=!0,g.inFlight=_e.size,g.max=zt,ct&&ct.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(g)}return new Promise((g,h)=>{if(s!=null&&s.aborted){const b=new Error("Aborted");b.name="AbortError",h(b);return}const y=Math.random().toString(36).slice(2),x=globalThis.setTimeout(()=>{_e.delete(y);const b=new Error("Worker render timed out");b.name="WorkerTimeout",b.code="WORKER_TIMEOUT",ct&&ct.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!1,error:"timeout"}),h(b),vn()},n),S=()=>{globalThis.clearTimeout(x),_e.has(y)&&_e.delete(y);const b=new Error("Aborted");b.name="AbortError",h(b),vn()};s&&s.addEventListener("abort",S,{once:!0});const V=g,E=h,X=b=>{ct&&ct.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!0}),V(b)},I=b=>{ct&&ct.recordRender({type:"worker",duration:performance.now()-l,formulaLength:t.length,timestamp:Date.now(),success:!1,error:(b==null?void 0:b.message)||String(b)}),E(b)};_e.set(y,{resolve:X,reject:I,timeoutId:x}),f.postMessage({id:y,content:t,displayMode:o})})})}function Qi(t,o=!0,n){const s=`${o?"d":"i"}:${t}`;if(pt.set(s,n),pt.size>So){const l=pt.keys().next().value;pt.delete(l)}}function es(){return{inFlight:_e.size,max:zt}}function ts(t){Number.isFinite(t)&&t>0&&(zt=Math.floor(t))}const $o="WORKER_BUSY";function ns(){return _e.size>=zt}function Vo(t=2e3,o){return _e.size<zt?Promise.resolve():new Promise((n,s)=>{let l=!1,m;const u=()=>{l||(l=!0,m&&globalThis.clearTimeout(m),$t.delete(u),n())};if($t.add(u),m=globalThis.setTimeout(()=>{if(l)return;l=!0,$t.delete(u);const f=new Error("Wait for worker slot timed out");f.name="WorkerBusyTimeout",f.code="WORKER_BUSY_TIMEOUT",s(f)},t),queueMicrotask(()=>vn()),o){const f=()=>{if(l)return;l=!0,m&&globalThis.clearTimeout(m),$t.delete(u);const g=new Error("Aborted");g.name="AbortError",s(g)};o.aborted?f():o.addEventListener("abort",f,{once:!0})}})}const vt={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function os(t){t.timeout!=null&&(vt.timeout=Math.max(0,Math.floor(t.timeout))),t.waitTimeout!=null&&(vt.waitTimeout=Math.max(0,Math.floor(t.waitTimeout))),t.backoffMs!=null&&(vt.backoffMs=Math.max(0,Math.floor(t.backoffMs))),t.maxRetries!=null&&(vt.maxRetries=Math.max(0,Math.floor(t.maxRetries)))}function rs(){return q({},vt)}function as(s){return L(this,arguments,function*(t,o=!0,n={}){var y,x,S,V;if(!Yn()){const E=new Error("KaTeX rendering disabled");throw E.name="KaTeXDisabled",E.code="KATEX_DISABLED",E}const l=(y=n.timeout)!=null?y:vt.timeout,m=(x=n.waitTimeout)!=null?x:vt.waitTimeout,u=(S=n.backoffMs)!=null?S:vt.backoffMs,f=(V=n.maxRetries)!=null?V:vt.maxRetries,g=n.signal;let h=0;for(;;){if(g!=null&&g.aborted){const E=new Error("Aborted");throw E.name="AbortError",E}try{return yield Io(t,o,l,g)}catch(E){if((E==null?void 0:E.code)!==$o||h>=f)throw E;if(h++,yield Vo(m,g).catch(()=>{}),g!=null&&g.aborted){const X=new Error("Aborted");throw X.name="AbortError",X}u>0&&(yield new Promise(X=>globalThis.setTimeout(X,u*h)))}}})}const Lo=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BOwgCLNK.cjs"))),Do=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Bjfg9_i9.cjs"))),Ro=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BqQOMeNc.cjs"))),ls={AdmonitionNode:nn,BlockquoteNode:Yt,CheckboxNode:et,CodeBlockNode:Lo,DefinitionListNode:qt,EmojiNode:ge,FootnoteNode:Zt,FootnoteReferenceNode:we,FootnoteAnchorNode:Lt,HardBreakNode:Bt,HeadingNode:$n,HtmlInlineNode:ke,HighlightNode:Ve,ImageNode:gt,InlineCodeNode:ye,PreCodeNode:Rt,InsertNode:$e,LinkNode:Me,ListItemNode:Gt,ListNode:Jt,MathBlockNode:Do,MathInlineNode:Ro,MermaidBlockNode:Dt,ParagraphNode:Qt,StrikethroughNode:Be,StrongNode:be,SubscriptNode:Ie,SuperscriptNode:Se,TableNode:en,TextNode:de,ThematicBreakNode:tn,ReferenceNode:xe,MarkdownCodeBlockNode:fn},is={install(t,o){Object.entries(ls).forEach(([n,s])=>{t.component(n,s)}),o!=null&&o.getLanguageIcon&&To(o.getLanguageIcon),o!=null&&o.mathOptions&&Bn.setDefaultMathOptions(o.mathOptions)}};exports.AdmonitionNode=nn;exports.BlockquoteNode=Yt;exports.CheckboxNode=et;exports.CodeBlockNode=Lo;exports.DefinitionListNode=qt;exports.EmojiNode=ge;exports.FootnoteAnchorNode=Lt;exports.FootnoteReferenceNode=we;exports.HardBreakNode=Bt;exports.HighlightNode=Ve;exports.HtmlInlineNode=ke;exports.ImageNode=gt;exports.InsertNode=$e;exports.LinkNode=Me;exports.ListItemNode=Gt;exports.ListNode=Jt;exports.MERMAID_DISABLED_CODE=Bo;exports.MERMAID_WORKER_BUSY_CODE=bo;exports.MarkdownCodeBlockNode=fn;exports.MathBlockNode=Do;exports.MathInlineNode=Ro;exports.MermaidBlockNode=Dt;exports.NodeRenderer=je;exports.ParagraphNode=Qt;exports.StrikethroughNode=Be;exports.StrongNode=be;exports.SubscriptNode=Ie;exports.SuperscriptNode=Se;exports.TableNode=en;exports.TextNode=de;exports.ThematicBreakNode=tn;exports.VueRendererMarkdown=is;exports.WORKER_BUSY_CODE=$o;exports._HeadingNode=$n;exports._export_sfc=P;exports._sfc_main=Rt;exports._sfc_main$1=Zt;exports._sfc_main$2=ye;exports._sfc_main$3=xe;exports.canParseOffthread=Co;exports.clearGlobalCustomComponents=ar;exports.clearKaTeXWorker=Zi;exports.clearMermaidWorker=ya;exports.disableKatex=Nr;exports.disableMermaid=da;exports.enableKatex=Tr;exports.enableMermaid=ua;exports.findPrefixOffthread=Eo;exports.getCustomNodeComponents=tt;exports.getKaTeXBackpressureDefaults=rs;exports.getKaTeXWorkerLoad=es;exports.getKatex=In;exports.getLanguageIcon=No;exports.getMermaidWorkerLoad=wa;exports.getUseMonaco=bl;exports.hideTooltip=Nn;exports.isKaTeXWorkerBusy=ns;exports.isKatexEnabled=Yn;exports.isMermaidEnabled=xo;exports.languageMap=_o;exports.normalizeLanguageIdentifier=Jn;exports.removeCustomComponents=rr;exports.renderKaTeXInWorker=Io;exports.renderKaTeXWithBackpressure=as;exports.resolveMonacoLanguageId=_i;exports.safeRaf=yo;exports.setCustomComponents=or;exports.setDefaultI18nMap=vr;exports.setKaTeXBackpressureDefaults=os;exports.setKaTeXCache=Qi;exports.setKaTeXWorker=qi;exports.setKaTeXWorkerDebug=Ji;exports.setKaTeXWorkerMaxConcurrency=ts;exports.setKatexLoader=Un;exports.setLanguageIconResolver=To;exports.setMermaidLoader=Gn;exports.setMermaidWorker=ka;exports.setMermaidWorkerClientDebug=va;exports.setMermaidWorkerMaxConcurrency=ga;exports.showTooltipForAnchor=on;exports.terminateWorker=Pn;exports.useSafeI18n=_n;exports.useViewportPriority=Sn;exports.waitForKaTeXWorkerSlot=Vo;
|