markstream-vue 0.0.3-beta.2 → 0.0.3-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/exports.js CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&i(e,n,t[n]);return e},s=(e,o)=>t(e,n(o)),u=(e,t)=>{var n={};for(var i in e)l.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&o)for(var i of o(e))t.indexOf(i)<0&&r.call(e,i)&&(n[i]=e[i]);return n},c=(e,t,n)=>new Promise((o,l)=>{var r=e=>{try{a(n.next(e))}catch(t){l(t)}},i=e=>{try{a(n.throw(e))}catch(t){l(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,i);a((n=n.apply(e,t)).next())});import{getMarkdown as d,parseMarkdownToStructure as v,setDefaultMathOptions as m}from"stream-markdown-parser";import{defineComponent as h,createElementBlock as p,openBlock as f,withMemo as g,createVNode as w,unref as y,createElementVNode as x,Fragment as k,renderList as b,toDisplayString as M,computed as _,ref as C,watch as B,nextTick as T,onBeforeUnmount as L,createBlock as S,Teleport as I,Transition as j,withCtx as E,withDirectives as $,normalizeClass as H,normalizeStyle as A,vShow as N,createApp as D,h as R,inject as z,provide as P,createCommentVNode as V,renderSlot as O,shallowRef as F,readonly as W,defineAsyncComponent as K,resolveDynamicComponent as X,useAttrs as q,mergeProps as Y,isMemoSame as Z,onMounted as U,onUnmounted as G,toHandlers as J,withModifiers as Q,markRaw as ee,reactive as te}from"vue";const ne=["cite"],oe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,l]of t)n[o]=l;return n},le=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(f(),p("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([t.node.children],()=>w(y(Cl),{"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=e=>n.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,ne))}}),[["__scopeId","data-v-eeadc8a3"]]);le.install=e=>{e.component(le.__name,le)};const re={class:"checkbox-node"},ie=["checked"],ae=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",re,[x("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,ie)]))}),[["__scopeId","data-v-8dc6c46f"]]);ae.install=e=>{e.component(ae.__name,ae)};const se={class:"definition-list"},ue={class:"definition-term"},ce={class:"definition-desc"},de=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(e,n)=>(f(),p("dl",se,[(f(!0),p(k,null,b(t.node.items,(o,l)=>(f(),p(k,{key:l},[x("dt",ue,[w(y(Cl),{"index-key":`definition-term-${t.indexKey}-${l}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,onCopy:n[0]||(n[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"])]),x("dd",ce,[w(y(Cl),{"index-key":`definition-desc-${t.indexKey}-${l}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,onCopy:n[1]||(n[1]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);de.install=e=>{e.component(de.__name,de)};const ve={class:"emoji-node"},me=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",ve,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);me.install=e=>{e.component(me.__name,me)};const he="__global__",pe={};function fe(e,t){"string"==typeof e?pe[e]=t||{}:pe[he]=e||{}}function ge(e){return e?pe[e]||pe[he]||{}:pe[he]||{}}function we(e){if(e===he)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete pe[e]}function ye(){delete pe[he]}const xe=["id"],ke=["title"],be=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#footnote-${e.node.id}`;function n(){if("undefined"==typeof document)return;const e=document.querySelector(t);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,l)=>(f(),p("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[x("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+M(e.node.id)+"]",9,ke)],8,xe))}}),[["__scopeId","data-v-01af0fee"]]);be.install=e=>{e.component(be.__name,be)};const Me={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-['']"},_e=/* @__PURE__ */h({__name:"InlineCodeNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("code",Me,M(e.node.code),1))});_e.install=e=>{e.component(_e.__name,_e)};const Ce=Math.min,Be=Math.max,Te=Math.round,Le=Math.floor,Se=e=>({x:e,y:e}),Ie={left:"right",right:"left",bottom:"top",top:"bottom"},je={start:"end",end:"start"};function Ee(e,t,n){return Be(e,Ce(t,n))}function $e(e,t){return"function"==typeof e?e(t):e}function He(e){return e.split("-")[0]}function Ae(e){return e.split("-")[1]}function Ne(e){return"x"===e?"y":"x"}function De(e){return"y"===e?"height":"width"}const Re=/* @__PURE__ */new Set(["top","bottom"]);function ze(e){return Re.has(He(e))?"y":"x"}function Pe(e){return Ne(ze(e))}function Ve(e){return e.replace(/start|end/g,e=>je[e])}const Oe=["left","right"],Fe=["right","left"],We=["top","bottom"],Ke=["bottom","top"];function Xe(e){return e.replace(/left|right|bottom|top/g,e=>Ie[e])}function qe(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function Ye(e,t,n){let{reference:o,floating:l}=e;const r=ze(t),i=Pe(t),a=De(i),s=He(t),u="y"===r,c=o.x+o.width/2-l.width/2,d=o.y+o.height/2-l.height/2,v=o[a]/2-l[a]/2;let m;switch(s){case"top":m={x:c,y:o.y-l.height};break;case"bottom":m={x:c,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-l.width,y:d};break;default:m={x:o.x,y:o.y}}switch(Ae(t)){case"start":m[i]-=v*(n&&u?-1:1);break;case"end":m[i]+=v*(n&&u?-1:1)}return m}function Ze(e,t){return c(this,null,function*(){var n;void 0===t&&(t={});const{x:o,y:l,platform:r,rects:i,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:v="floating",altBoundary:m=!1,padding:h=0}=$e(t,e),p=function(e){return"number"!=typeof e?function(e){return a({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}(h),f=s[m?"floating"===v?"reference":"floating":v],g=qe(yield r.getClippingRect({element:null==(n=yield null==r.isElement?void 0:r.isElement(f))||n?f:f.contextElement||(yield null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),w="floating"===v?{x:o,y:l,width:i.floating.width,height:i.floating.height}:i.reference,y=yield null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating),x=(yield null==r.isElement?void 0:r.isElement(y))&&(yield null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},k=qe(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:u}):w);return{top:(g.top-k.top+p.top)/x.y,bottom:(k.bottom-g.bottom+p.bottom)/x.y,left:(g.left-k.left+p.left)/x.x,right:(k.right-g.right+p.right)/x.x}})}const Ue=/* @__PURE__ */new Set(["left","top"]);function Ge(){return"undefined"!=typeof window}function Je(e){return tt(e)?(e.nodeName||"").toLowerCase():"#document"}function Qe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function et(e){var t;return null==(t=(tt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function tt(e){return!!Ge()&&(e instanceof Node||e instanceof Qe(e).Node)}function nt(e){return!!Ge()&&(e instanceof Element||e instanceof Qe(e).Element)}function ot(e){return!!Ge()&&(e instanceof HTMLElement||e instanceof Qe(e).HTMLElement)}function lt(e){return!(!Ge()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qe(e).ShadowRoot)}const rt=/* @__PURE__ */new Set(["inline","contents"]);function it(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!rt.has(l)}const at=/* @__PURE__ */new Set(["table","td","th"]);function st(e){return at.has(Je(e))}const ut=[":popover-open",":modal"];function ct(e){return ut.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const dt=["transform","translate","scale","rotate","perspective"],vt=["transform","translate","scale","rotate","perspective","filter"],mt=["paint","layout","strict","content"];function ht(e){const t=pt(),n=nt(e)?wt(e):e;return dt.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||vt.some(e=>(n.willChange||"").includes(e))||mt.some(e=>(n.contain||"").includes(e))}function pt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ft=/* @__PURE__ */new Set(["html","body","#document"]);function gt(e){return ft.has(Je(e))}function wt(e){return Qe(e).getComputedStyle(e)}function yt(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if("html"===Je(e))return e;const t=e.assignedSlot||e.parentNode||lt(e)&&e.host||et(e);return lt(t)?t.host:t}function kt(e){const t=xt(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ot(t)&&it(t)?t:kt(t)}function bt(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const l=kt(e),r=l===(null==(o=e.ownerDocument)?void 0:o.body),i=Qe(l);if(r){const e=Mt(i);return t.concat(i,i.visualViewport||[],it(l)?l:[],e&&n?bt(e):[])}return t.concat(l,bt(l,[],n))}function Mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _t(e){const t=wt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=ot(e),r=l?e.offsetWidth:n,i=l?e.offsetHeight:o,a=Te(n)!==r||Te(o)!==i;return a&&(n=r,o=i),{width:n,height:o,$:a}}function Ct(e){return nt(e)?e:e.contextElement}function Bt(e){const t=Ct(e);if(!ot(t))return Se(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:r}=_t(t);let i=(r?Te(n.width):n.width)/o,a=(r?Te(n.height):n.height)/l;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Tt=/* @__PURE__ */Se(0);function Lt(e){const t=Qe(e);return pt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Tt}function St(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),r=Ct(e);let i=Se(1);t&&(o?nt(o)&&(i=Bt(o)):i=Bt(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Qe(e))&&t}(r,n,o)?Lt(r):Se(0);let s=(l.left+a.x)/i.x,u=(l.top+a.y)/i.y,c=l.width/i.x,d=l.height/i.y;if(r){const e=Qe(r),t=o&&nt(o)?Qe(o):o;let n=e,l=Mt(n);for(;l&&o&&t!==n;){const e=Bt(l),t=l.getBoundingClientRect(),o=wt(l),r=t.left+(l.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(l.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,u*=e.y,c*=e.x,d*=e.y,s+=r,u+=i,n=Qe(l),l=Mt(n)}}return qe({width:c,height:d,x:s,y:u})}function It(e,t){const n=yt(e).scrollLeft;return t?t.left+n:St(et(e)).left+n}function jt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-It(e,n),y:n.top+t.scrollTop}}const Et=/* @__PURE__ */new Set(["absolute","fixed"]);function $t(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Qe(e),o=et(e),l=n.visualViewport;let r=o.clientWidth,i=o.clientHeight,a=0,s=0;if(l){r=l.width,i=l.height;const e=pt();(!e||e&&"fixed"===t)&&(a=l.offsetLeft,s=l.offsetTop)}const u=It(o);if(u<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),l="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-l);i<=25&&(r-=i)}else u<=25&&(r+=u);return{width:r,height:i,x:a,y:s}}(e,n);else if("document"===t)o=function(e){const t=et(e),n=yt(e),o=e.ownerDocument.body,l=Be(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Be(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+It(e);const a=-n.scrollTop;return"rtl"===wt(o).direction&&(i+=Be(t.clientWidth,o.clientWidth)-l),{width:l,height:r,x:i,y:a}}(et(e));else if(nt(t))o=function(e,t){const n=St(e,!0,"fixed"===t),o=n.top+e.clientTop,l=n.left+e.clientLeft,r=ot(e)?Bt(e):Se(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:l*r.x,y:o*r.y}}(t,n);else{const n=Lt(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qe(o)}function Ht(e,t){const n=xt(e);return!(n===t||!nt(n)||gt(n))&&("fixed"===wt(n).position||Ht(n,t))}function At(e,t,n){const o=ot(t),l=et(t),r="fixed"===n,i=St(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const s=Se(0);function u(){s.x=It(l)}if(o||!o&&!r)if(("body"!==Je(t)||it(l))&&(a=yt(t)),o){const e=St(t,!0,r,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else l&&u();r&&!o&&l&&u();const c=!l||o||r?Se(0):jt(l,a);return{x:i.left+a.scrollLeft-s.x-c.x,y:i.top+a.scrollTop-s.y-c.y,width:i.width,height:i.height}}function Nt(e){return"static"===wt(e).position}function Dt(e,t){if(!ot(e)||"fixed"===wt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return et(e)===n&&(n=n.ownerDocument.body),n}function Rt(e,t){const n=Qe(e);if(ct(e))return n;if(!ot(e)){let t=xt(e);for(;t&&!gt(t);){if(nt(t)&&!Nt(t))return t;t=xt(t)}return n}let o=Dt(e,t);for(;o&&st(o)&&Nt(o);)o=Dt(o,t);return o&&gt(o)&&Nt(o)&&!ht(o)?n:o||function(e){let t=xt(e);for(;ot(t)&&!gt(t);){if(ht(t))return t;if(ct(t))return null;t=xt(t)}return null}(e)||n}const zt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const r="fixed"===l,i=et(o),a=!!t&&ct(t.floating);if(o===i||a&&r)return n;let s={scrollLeft:0,scrollTop:0},u=Se(1);const c=Se(0),d=ot(o);if((d||!d&&!r)&&(("body"!==Je(o)||it(i))&&(s=yt(o)),ot(o))){const e=St(o);u=Bt(o),c.x=e.x+o.clientLeft,c.y=e.y+o.clientTop}const v=!i||d||r?Se(0):jt(i,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+v.x,y:n.y*u.y-s.scrollTop*u.y+c.y+v.y}},getDocumentElement:et,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const r=[..."clippingAncestors"===n?ct(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=bt(e,[],!1).filter(e=>nt(e)&&"body"!==Je(e)),l=null;const r="fixed"===wt(e).position;let i=r?xt(e):e;for(;nt(i)&&!gt(i);){const t=wt(i),n=ht(i);n||"fixed"!==t.position||(l=null),(r?!n&&!l:!n&&"static"===t.position&&l&&Et.has(l.position)||it(i)&&!n&&Ht(e,i))?o=o.filter(e=>e!==i):l=t,i=xt(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=r[0],a=r.reduce((e,n)=>{const o=$t(t,n,l);return e.top=Be(o.top,e.top),e.right=Ce(o.right,e.right),e.bottom=Ce(o.bottom,e.bottom),e.left=Be(o.left,e.left),e},$t(t,i,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Rt,getElementRects:function(e){return c(this,null,function*(){const t=this.getOffsetParent||Rt,n=this.getDimensions,o=yield n(e.floating);return{reference:At(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=_t(e);return{width:t,height:n}},getScale:Bt,isElement:nt,isRTL:function(e){return"rtl"===wt(e).direction}};function Pt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vt(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,d=Ct(e),v=l||r?[...d?bt(d):[],...bt(t)]:[];v.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)});const m=d&&u?function(e,t){let n,o=null;const l=et(e);function r(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(u,c){void 0===u&&(u=!1),void 0===c&&(c=1),r();const d=e.getBoundingClientRect(),{left:v,top:m,width:h,height:p}=d;if(u||t(),!h||!p)return;const f={rootMargin:-Le(m)+"px "+-Le(l.clientWidth-(v+h))+"px "+-Le(l.clientHeight-(m+p))+"px "+-Le(v)+"px",threshold:Be(0,Ce(1,c))||1};let g=!0;function w(t){const o=t[0].intersectionRatio;if(o!==c){if(!g)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Pt(d,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},f),{root:l.ownerDocument}))}catch(y){o=new IntersectionObserver(w,f)}o.observe(e)}(!0),r}(d,n):null;let h,p=-1,f=null;i&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),d&&!c&&f.observe(d),f.observe(t));let g=c?St(e):null;return c&&function t(){const o=St(e);g&&!Pt(g,o)&&n(),g=o,h=requestAnimationFrame(t)}(),n(),()=>{var e;v.forEach(e=>{l&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(h)}}const Ot=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(t){return c(this,null,function*(){const{x:n,y:o,placement:l}=t,r=$e(e,t),{mainAxis:i=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=r,v=u(r,["mainAxis","crossAxis","limiter"]),m={x:n,y:o},h=yield Ze(t,v),p=ze(He(l)),f=Ne(p);let g=m[f],w=m[p];if(i){const e="y"===f?"bottom":"right";g=Ee(g+h["y"===f?"top":"left"],g,g-h[e])}if(c){const e="y"===p?"bottom":"right";w=Ee(w+h["y"===p?"top":"left"],w,w-h[e])}const y=d.fn(s(a({},t),{[f]:g,[p]:w}));return s(a({},y),{data:{x:y.x-n,y:y.y-o,enabled:{[f]:i,[p]:c}}})})}}},Ft=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(t){return c(this,null,function*(){var n,o;const{placement:l,middlewareData:r,rects:i,initialPlacement:a,platform:s,elements:c}=t,d=$e(e,t),{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0}=d,w=u(d,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=He(l),x=ze(a),k=He(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(c.floating),M=h||(k||!g?[Xe(a)]:function(e){const t=Xe(e);return[Ve(e),t,Ve(t)]}(a)),_="none"!==f;!h&&_&&M.push(...function(e,t,n,o){const l=Ae(e);let r=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Fe:Oe:t?Oe:Fe;case"left":case"right":return t?We:Ke;default:return[]}}(He(e),"start"===n,o);return l&&(r=r.map(e=>e+"-"+l),t&&(r=r.concat(r.map(Ve)))),r}(a,g,f,b));const C=[a,...M],B=yield Ze(t,w),T=[];let L=(null==(o=r.flip)?void 0:o.overflows)||[];if(v&&T.push(B[y]),m){const e=function(e,t,n){void 0===n&&(n=!1);const o=Ae(e),l=Pe(e),r=De(l);let i="x"===l?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Xe(i)),[i,Xe(i)]}(l,i,b);T.push(B[e[0]],B[e[1]])}if(L=[...L,{placement:l,overflows:T}],!T.every(e=>e<=0)){var S,I;const e=((null==(S=r.flip)?void 0:S.index)||0)+1,t=C[e];if(t&&("alignment"!==m||x===ze(t)||L.every(e=>ze(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(I=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(p){case"bestFit":{var j;const e=null==(j=L.filter(e=>{if(_){const t=ze(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:j[0];e&&(n=e);break}case"initialPlacement":n=a}if(l!==n)return{reset:{placement:n}}}return{}})}}},Wt=["id"],Kt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const t=e,n=_(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=C(null),l=C({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),r=C(!1);let i=null;function u(){return c(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const r=[(d=null!=(e=t.offset)?e:8,void 0===d&&(d=0),{name:"offset",options:d,fn(e){return c(this,null,function*(){var t,n;const{x:o,y:l,placement:r,middlewareData:i}=e,u=yield function(e,t){return c(this,null,function*(){const{placement:n,platform:o,elements:l}=e,r=yield null==o.isRTL?void 0:o.isRTL(l.floating),i=He(n),a=Ae(n),s="y"===ze(n),u=Ue.has(i)?-1:1,c=r&&s?-1:1,d=$e(t,e);let{mainAxis:v,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(m="end"===a?-1*h:h),s?{x:m*c,y:v*u}:{x:v*u,y:m*c}})}(e,d);return r===(null==(t=i.offset)?void 0:t.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:o+u.x,y:l+u.y,data:s(a({},u),{placement:r})}})}}),Ft(),Ot({padding:8})],{x:i,y:u}=yield((e,t,n)=>{const o=/* @__PURE__ */new Map,l=a({platform:zt},n),r=s(a({},l.platform),{_c:o});return((e,t,n)=>c(null,null,function*(){const{placement:o="bottom",strategy:l="absolute",middleware:r=[],platform:i}=n,u=r.filter(Boolean),c=yield null==i.isRTL?void 0:i.isRTL(t);let d=yield i.getElementRects({reference:e,floating:t,strategy:l}),{x:v,y:m}=Ye(d,o,c),h=o,p={},f=0;for(let n=0;n<u.length;n++){const{name:r,fn:g}=u[n],{x:w,y,data:x,reset:k}=yield g({x:v,y:m,initialPlacement:o,placement:h,strategy:l,middlewareData:p,rects:d,platform:i,elements:{reference:e,floating:t}});v=null!=w?w:v,m=null!=y?y:m,p=s(a({},p),{[r]:a(a({},p[r]),x)}),k&&f<=50&&(f++,"object"==typeof k&&(k.placement&&(h=k.placement),k.rects&&(d=!0===k.rects?yield i.getElementRects({reference:e,floating:t,strategy:l}):k.rects),({x:v,y:m}=Ye(d,h,c))),n=-1)}return{x:v,y:m,placement:h,strategy:l,middlewareData:p}}))(e,t,s(a({},l),{platform:r}))})(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:r,strategy:"fixed"});var d;l.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(u)}px, 0)`,l.value.left="0px",l.value.top="0px"})}return B(()=>t.visible,e=>c(null,null,function*(){if(e)if(r.value=!1,yield T(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield u();const n=l.value.transform;if(null!=t.originX&&null!=t.originY){const o=Math.abs(Number(t.originX)-e.left),i=Math.abs(Number(t.originY)-e.top);Math.hypot(o,i)>120?(l.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield T(),r.value=!0,yield T(),l.value.transform=n):r.value=!0}else r.value=!0;i=Vt(t.anchorEl,o.value,u)}catch(n){yield u(),r.value=!0,i=Vt(t.anchorEl,o.value,u)}else r.value=!0;else r.value=!1,i&&(i(),i=null)})),B([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>c(null,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield T(),yield u())})),L(()=>{i&&i()}),(i,a)=>(f(),S(I,{to:"body"},[w(j,{name:"tooltip",appear:""},{default:E(()=>[$(x("div",{id:t.id,ref_key:"tooltip",ref:o,style:A({position:"fixed",left:l.value.left,top:l.value.top,transform:l.value.transform}),class:H(["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"},M(e.content),15,Wt),[[N,e.visible&&r.value]])]),_:1})]))}}),[["__scopeId","data-v-993f63aa"]]),Xt=C(!1),qt=C(""),Yt=C("top"),Zt=C(null),Ut=C(null),Gt=C(null),Jt=C(null),Qt=C(null);let en=null,tn=null;function nn(){en&&(clearTimeout(en),en=null),tn&&(clearTimeout(tn),tn=null)}let on=!1;function ln(e,t,n="top",o=!1,l,r){if(!e)return;!function(){if(on)return;if("undefined"==typeof document)return;on=!0;const e=document.createElement("div");e.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(e),D({setup:()=>()=>{var e;return R(Kt,{visible:Xt.value,"anchor-el":Zt.value,content:qt.value,placement:Yt.value,id:Ut.value,originX:Gt.value,originY:Jt.value,isDark:null!=(e=Qt.value)?e:void 0})}}).mount(e)}(),nn();const i=()=>{var o,i;Ut.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Zt.value=e,qt.value=t,Yt.value=n,Gt.value=null!=(o=null==l?void 0:l.x)?o:null,Jt.value=null!=(i=null==l?void 0:l.y)?i:null,Qt.value="boolean"==typeof r?r:null,Xt.value=!0;try{e.setAttribute("aria-describedby",Ut.value)}catch(a){}};o?i():en=setTimeout(i,80)}function rn(e=!1){nn();const t=()=>{if(Zt.value&&Ut.value)try{Zt.value.removeAttribute("aria-describedby")}catch(e){}Xt.value=!1,Zt.value=null,Ut.value=null,Gt.value=null,Jt.value=null};e?t():tn=setTimeout(t,120)}const an={"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 sn(e){Object.assign(an,e)}function un(){try{const t=globalThis.$vueI18nUse||null;if(t&&"function"==typeof t)try{const e=t();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return c(null,null,function*(){try{const t=yield import("vue-i18n"),n=t.useI18n||t.default&&t.default.useI18n;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)try{globalThis.$vueI18nUse=()=>t}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var t;return null!=(t=an[e])?t:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const cn=Symbol("ViewportPriority");function dn(){const e=z(cn,void 0);if(e)return e;const t=/* @__PURE__ */new WeakMap;let n=null;return e=>{const o=C(!1);let l,r=!1;const i=new Promise(e=>{l=()=>{r||(r=!0,e())}}),a=()=>{try{null==n||n.unobserve(e)}catch(o){}t.delete(e)},s=n||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(n=new IntersectionObserver(e=>{for(const l of e){const e=t.get(l.target);if(e&&(l.isIntersecting||l.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(l.target),t.delete(l.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.set(e,{resolve:l,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,l(),{isVisible:o,whenVisible:i,destroy:a})}}const vn={class:"relative inline-block"},mn=["src","alt","title","loading","tabindex","aria-label"],hn={class:"text-sm whitespace-nowrap"},pn={key:1,class:"text-sm text-gray-500"},fn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},gn={class:"text-sm whitespace-nowrap"},wn={key:0,class:"mt-2 text-sm text-gray-500 italic"},yn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,l=C(!1),r=C(!1),i=C(!1),a=C(null),s=dn(),u=C(null),c=C("undefined"==typeof window);"undefined"!=typeof window&&B(()=>a.value,e=>{var t;if(null==(t=u.value)||t.destroy(),u.value=null,!e)return void(c.value=!1);const n=s(e,{rootMargin:"400px"});u.value=n,c.value=n.isVisible.value,n.whenVisible.then(()=>{c.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=u.value)||e.destroy(),u.value=null});const d=_(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),v=_(()=>!n.lazy||c.value),m=_(()=>/\.svg(?:\?|$)/i.test(d.value));function h(){n.fallbackSrc&&!i.value?(i.value=!0,r.value=!0):(r.value=!0,o("error",n.node.src))}function g(){l.value=!0,r.value=!1,o("load",d.value)}function k(e){e.preventDefault(),l.value&&!r.value&&o("click",[e,d.value])}const{t:b}=un();return B(d,()=>{l.value=!1,r.value=!1}),(t,o)=>(f(),p("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[x("div",vn,[w(j,{name:"img-switch",mode:"out-in"},{default:E(()=>{var i,a,s,u,c;return[e.node.loading||r.value||!v.value?r.value?e.node.loading||n.fallbackSrc?V("",!0):(f(),p("div",fn,[O(t.$slots,"error",{node:n.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:m.value},()=>[o[1]||(o[1]=x("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[x("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)),x("span",gn,M(y(b)("image.loadError")),1)],!0)])):(f(),p("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:A(m.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?O(t.$slots,"placeholder",{key:0,node:n.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:m.value},()=>[o[0]||(o[0]=x("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),x("span",hn,M(y(b)("image.loading")),1)],!0):(f(),p("span",pn,M(e.node.raw),1))],4)):(f(),p("img",{key:"image",src:d.value,alt:String(null!=(a=null!=(i=n.node.alt)?i:n.node.title)?a:""),title:String(null!=(u=null!=(s=n.node.title)?s:n.node.alt)?u:""),class:H(["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:A(m.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":null!=(c=n.node.alt)?c:y(b)("image.preview"),onError:h,onLoad:g,onClick:k},null,46,mn))]}),_:3})]),n.showCaption&&n.node.alt?(f(),p("figcaption",wn,M(n.node.alt),1)):V("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);yn.install=e=>{e.component(yn.__name,yn)};let xn=null,kn=!1,bn=Mn;function Mn(){return c(null,null,function*(){const e=yield import("katex");return yield import("katex/contrib/mhchem"),e})}function _n(e){bn=e,xn=null,kn=!1}function Cn(e){_n(null!=e?e:Mn)}function Bn(){_n(null)}function Tn(){return"function"==typeof bn}function Ln(){return c(this,null,function*(){if(xn)return xn;if(kn)return null;const e=bn;if(!e)return kn=!0,null;try{const t=yield e();if(t)return xn=t,xn}catch(t){}return kn=!0,null})}const Sn=F(!1);let In=null;function jn(){return In||(In=Ln().then(e=>{Sn.value=!!e}).catch(()=>{Sn.value=!1})),W(Sn)}const En=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=jn();return(n,o)=>(f(),p("span",{class:H([[y(t)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);En.install=e=>{e.component(En.__name,En)};const $n=K(()=>c(null,null,function*(){var e,t;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(t=null==(e=globalThis.process)?void 0:e.env)?void 0:t.NODE_ENV))return e=>{var t,n;return R(En,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))};try{if(yield Ln())return(yield import("./index2.js")).default}catch(n){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".',n)}return e=>{var t,n;return R(En,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))}})),Hn=K(()=>c(null,null,function*(){try{if(yield Ln())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n;return R(En,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$$${null!=(t=e.node.content)?t:""}$$`})}))}})),An=/* @__PURE__ */h({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(f(),p("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]=n=>t.$emit("click",n,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=n=>t.$emit("mouseEnter",n,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=n=>t.$emit("mouseLeave",n,e.node.id,e.messageId,e.threadId))},M(e.node.id),33))});An.install=e=>{e.component(An.__name,An)};const Nn={class:"superscript-node"},Dn={key:1},Rn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,footnote_reference:be,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,emoji:me,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("sup",Nn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),p(k,{key:`${e.indexKey||"superscript"}-${l}`},[o[n.type]?(f(),S(X(o[n.type]),{key:0,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`},null,8,["node","custom-id","index-key"])):(f(),p("span",Dn,M(n.content||n.raw),1))],64))),128))]))}}),[["__scopeId","data-v-9ae5549f"]]);Rn.install=e=>{e.component(Rn.__name,Rn)};const zn={class:"subscript-node"},Pn={key:1},Vn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,footnote_reference:be,strikethrough:Kn,highlight:to,insert:Qn,superscript:Rn,emoji:me,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("sub",zn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),p(k,{key:`${e.indexKey||"subscript"}-${l}`},[o[n.type]?(f(),S(X(o[n.type]),{key:0,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`},null,8,["node","custom-id","index-key"])):(f(),p("span",Pn,M(n.content||n.raw),1))],64))),128))]))}}),[["__scopeId","data-v-37438707"]]);Vn.install=e=>{e.component(Vn.__name,Vn)};const On={class:"strong-node"},Fn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,emphasis:oo,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("strong",On,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"strong"}-${l}`,"index-key":`${e.indexKey||"strong"}-${l}`,node:n,"custom-id":t.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-3f61dca6"]]);Fn.install=e=>{e.component(Fn.__name,Fn)};const Wn={class:"strikethrough-node"},Kn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("del",Wn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"strikethrough"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8236f64d"]]);Kn.install=e=>{e.component(Kn.__name,Kn)};const Xn=["href","title","aria-label","aria-hidden"],qn=["aria-hidden"],Yn={class:"link-text-wrapper relative inline-flex"},Zn={class:"leading-[normal] link-text"},Un={class:"leading-[normal] link-text"},Gn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=_(()=>{var e,n,o,l,r,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px";return{"--link-color":null!=(e=t.color)?e:"#0366d6","--underline-height":`${null!=(n=t.underlineHeight)?n:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=t.animationOpacity)?o:.9),"--underline-duration":`${null!=(l=t.animationDuration)?l:.8}s`,"--underline-timing":null!=(r=t.animationTiming)?r:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),o={text:En,strong:Fn,strikethrough:Kn,emphasis:oo,image:yn},l=q();function r(){t.showTooltip&&rn()}const i=_(()=>{var e,n;return String(null!=(n=null!=(e=t.node.title)?e:t.node.href)?n:"")});return(a,s)=>e.node.loading?(f(),p("span",Y({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:n.value}),[x("span",Yn,[x("span",Zn,[x("span",Un,M(e.node.text),1)]),s[1]||(s[1]=x("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,qn)):(f(),p("a",Y({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":i.value,"aria-label":`Link: ${i.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},y(l),{style:n.value,onMouseenter:s[0]||(s[0]=e=>function(e){var n,o,l;if(!t.showTooltip)return;const r=e,i=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0,a=(null==(n=t.node)?void 0:n.title)||(null==(o=t.node)?void 0:o.href)||(null==(l=t.node)?void 0:l.text)||"";ln(e.currentTarget,a,"top",!1,i)}(e)),onMouseleave:r}),[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,Xn))}}),[["__scopeId","data-v-80b69735"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Jn={class:"insert-node"},Qn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,strikethrough:Kn,highlight:to,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("ins",Jn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"insert"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-0b4b6459"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const eo={class:"highlight-node"},to=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,strikethrough:Kn,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("mark",eo,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"highlight"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-fbe5e4f2"]]);to.install=e=>{e.component(to.__name,to)};const no={class:"emphasis-node"},oo=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,strong:Fn,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:$n,reference:An},n);return(n,l)=>(f(),p("em",no,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8723e015"]]);oo.install=e=>{e.component(oo.__name,oo)};const lo=["href","title"],ro=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})}return(t,o)=>(f(),p("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,lo))}}),[["__scopeId","data-v-4756ce0d"]]);ro.install=e=>{e.component(ro.__name,ro)};const io=["id"],ao={class:"flex-1"},so=/* @__PURE__ */h({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(f(),p("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[x("div",ao,[g([t.node.children],()=>w(y(Cl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=e=>n.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,io))}});so.install=e=>{e.component(so.__name,so)};const uo={class:"hard-break"},co=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,t)=>(f(),p("br",uo))}),[["__scopeId","data-v-50c58f70"]]);co.install=e=>{e.component(co.__name,co)};const vo=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:En,inline_code:_e,link:Gn,image:yn,strong:Fn,emphasis:oo,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,checkbox:ae,checkbox_input:ae,footnote_reference:be,hardbreak:co,math_inline:$n,reference:An},n);return(n,l)=>g([e.node.children],()=>(f(),S(X(`h${e.node.level}`),{class:H(["heading-node",[`heading-${e.node.level}`]]),dir:"auto"},{default:E(()=>[(f(!0),p(k,null,b(e.node.children,(n,l,r,i)=>{const a=[n];if(i&&i.key===`${e.indexKey||"heading"}-${l}`&&Z(i,a))return i;const s=(f(),S(X(o[n.type]),{key:`${e.indexKey||"heading"}-${l}`,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||"heading"}-${l}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},l,0),128))]),_:1},8,["class"])),l,2)}}),[["__scopeId","data-v-e3e7e2ce"]]),mo=vo;mo.install=e=>{e.component(vo.__name,vo)};const ho=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=_(()=>null==t.value?{}:{value:t.value});return(e,o)=>(f(),p("li",Y({class:"list-item pl-1.5 my-2",dir:"auto"},n.value),[g([t.item.children],()=>w(y(Cl),{"index-key":`list-item-${t.indexKey}`,nodes:t.item.children,"custom-id":t.customId,typewriter:t.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],16))}}),[["__scopeId","data-v-7a618746"]]);ho.install=e=>{e.component(ho.__name,ho)};const po=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),S(X(e.node.ordered?"ol":"ul"),{class:H(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:E(()=>[(f(!0),p(k,null,b(e.node.items,(o,l,r,i)=>{var a;const s=[o];if(i&&i.key===`${e.indexKey||"list"}-${l}`&&Z(i,s))return i;const u=(f(),S(y(ho),{key:`${e.indexKey||"list"}-${l}`,item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(a=e.node.start)?a:1)+l:void 0,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["item","custom-id","index-key","typewriter","value"]));return u.memo=s,u},n,1),128))]),_:1},8,["class"]))}),[["__scopeId","data-v-79057d57"]]);function fo(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}po.install=e=>{e.component(po.__name,po)};const go=()=>import("mermaid");let wo=null,yo=go;function xo(e){yo=e,wo=null}function ko(e){xo(null!=e?e:go)}function bo(){xo(null)}function Mo(){return"function"==typeof yo}let _o=null,Co=null;const Bo=/* @__PURE__ */new Map;let To=5,Lo=!1;function So(e){Lo=!!e}function Io(e){Number.isFinite(e)&&e>0&&(To=Math.floor(e))}function jo(){return{inFlight:Bo.size,max:To}}const Eo="WORKER_BUSY",$o="MERMAID_DISABLED";function Ho(e){_o=e,Co=null;const t=e;_o.onmessage=e=>{if(_o!==t)return;const{id:n,ok:o,result:l,error:r}=e.data,i=Bo.get(n);i&&(!1===o||r?i.reject(new Error(r||"Unknown error")):i.resolve(l))},_o.onerror=e=>{var n,o;if(_o===t)if(0!==Bo.size){try{Lo?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(l){}for(const[t,n]of Bo.entries())n.reject(new Error(`Worker error: ${e.message}`));Bo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},_o.onmessageerror=e=>{var n,o;if(_o===t)if(0!==Bo.size){try{Lo?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(l){}for(const[e,t]of Bo.entries())t.reject(new Error("Worker messageerror"));Bo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Ao(){var e;if(_o)try{for(const[e,t]of Bo.entries())t.reject(new Error("Worker cleared"));Bo.clear(),null==(e=_o.terminate)||e.call(_o)}catch(t){}_o=null,Co=null}function No(e,t,n=1400){if(!Mo()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=$o,Promise.reject(e)}if(Co)return Promise.reject(Co);const o=_o||(Co=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Co.name="WorkerInitError",Co.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Co);if(Bo.size>=To){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Eo,e.inFlight=Bo.size,e.max=To,Promise.reject(e)}return new Promise((l,r)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Bo.delete(i))},c={resolve:e=>{u(),l(e)},reject:e=>{u(),r(e)}};Bo.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Bo.delete(i),void r(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Bo.get(i);t&&t.reject(e)},n)})}function Do(e,t,n=1400){return c(this,null,function*(){try{return yield No("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function Ro(e,t,n=1400){return c(this,null,function*(){try{return yield No("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function zo(){if(_o)try{for(const[e,t]of Bo.entries())t.reject(new Error("Worker terminated"));Bo.clear(),_o.terminate()}finally{_o=null}}const Po={key:0},Vo={key:1,class:"flex items-center space-x-2 overflow-hidden"},Oo=["src"],Fo={key:2},Wo={class:"flex items-center space-x-1"},Ko={class:"flex items-center space-x-1"},Xo={key:4},qo={key:5,class:"flex items-center space-x-1"},Yo=["aria-pressed"],Zo={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"},Uo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Go=["disabled"],Jo=["disabled"],Qo={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"},el={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"},tl={key:1,class:"relative"},nl={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},ol={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ll={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},rl=/* @__PURE__ */oe(/* @__PURE__ */h({__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(e,{emit:t}){var n,o;const l=e,r=t,i={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},u=C(!1),d=_(()=>l.isStrict?"strict":"loose"),v=_(()=>({startOnLoad:!1,securityLevel:d.value,dompurifyConfig:"strict"===d.value?i:void 0,flowchart:"strict"===d.value?{htmlLabels:!1}:void 0})),m=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],h=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return h.test(t)?t:""}function k(e){if(e)try{e.replaceChildren()}catch(t){e.innerHTML=""}}function b(e,t){if(!e)return"";if("strict"===d.value)return function(e,t){if(!e)return"";try{e.replaceChildren()}catch(o){e.innerHTML=""}const n=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const t=e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const o=n;return function(e){const t=/* @__PURE__ */new Set(["script"]),n=[e,...Array.from(e.querySelectorAll("*"))];for(const o of n){if(t.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const t of e){const e=t.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&t.value){const n=t.value;if(m.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=g(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}(o),o}(t);return n?(e.appendChild(n),e.innerHTML):""}(e,t);try{e.replaceChildren()}catch(n){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(n){e.innerHTML=t}return e.innerHTML}const{t:D}=un();function R(){return c(this,null,function*(){try{const e=yield function(){return c(this,null,function*(){if(wo)return wo;const e=yo;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===go)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw n}return t?(wo=function(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&("function"==typeof t.render||"function"==typeof t.parse||"function"==typeof t.initialize))return t;if(t&&t.mermaidAPI&&("function"==typeof t.mermaidAPI.render||"function"==typeof t.mermaidAPI.parse)){const e=t.mermaidAPI;return s(a({},t),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>"function"==typeof t.initialize?t.initialize(n):e.initialize?e.initialize(n):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:t}(t),function(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=a({suppressErrorRendering:!0},n||{});return"function"==typeof t?t.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(t){}}(wo),wo):null})}();return u.value=!!e,e}catch(e){throw u.value=!1,e}})}"undefined"!=typeof window&&c(null,null,function*(){var e;try{const t=yield R();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,a({},v.value))}catch(t){u.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}});const z=C(!1),P=C(!1),F=C(),W=C(),K=C(),X=C(null),q=dn(),Z=C(null),ee=C("undefined"==typeof window),te=C(),ne=_(()=>l.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),oe=C(1),le=C(0),re=C(0),ie=C(!1),ae=C({x:0,y:0}),se=C(!1),ue=C(!1),ce=C(!1),de=C(null),ve=C(0),me=C(!1);let he=null,pe=null,fe=0;const ge=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16),we=function(){let e=null;return(...t)=>{e&&clearTimeout(e),e=setTimeout(()=>(()=>{ge(()=>{gt()},{timeout:500})})(...t),300)}}();function ye(){null!=pe&&(globalThis.clearTimeout(pe),pe=null)}function xe(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);ye(),pe=globalThis.setTimeout(()=>{pe=null,l.loading||ce.value||!ee.value?xe(Math.min(1200,Math.max(300,1.2*t))):we()},t)}const ke=C("360px");let be=null;const Me=C(!1),_e=C(!1),Ce=C({}),Be=C(null),Te=C(""),Le=C(0);let Se=null;const Ie=C(!1),je=C({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),Ee=_(()=>l.enableWheelZoom?{wheel:ct}:{}),$e=_(()=>{var e,t,n,o;return{worker:null!=(e=l.workerTimeoutMs)?e:1400,parse:null!=(t=l.parseTimeoutMs)?t:1800,render:null!=(n=l.renderTimeoutMs)?n:2500,fullRender:null!=(o=l.fullRenderTimeoutMs)?o:4e3}}),He=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ae=null,Ne=null,De=!1,Re=800,ze=null,Pe=0,Ve=!0;function Oe(e,t){const n=null==t?void 0:t.timeoutMs,o=null==t?void 0:t.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let l=null,r=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=l&&clearTimeout(l),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(l=globalThis.setTimeout(()=>{r||(r=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{r||(r=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{r||(r=!0,s(),t(e))}).catch(e=>{r||(r=!0,s(),a(e))})})}function Fe(e){if("undefined"==typeof document)return;if(!W.value)return;const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),k(W.value),W.value.appendChild(t),ke.value="360px",Ie.value=!0,wt()}function We(e){return!e||e.disabled}function Ke(e,t,n="top"){if(We(e.currentTarget))return;const o=e,r=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;ln(e.currentTarget,t,n,!1,r,l.isDark)}function Xe(){rn()}function qe(e){if(We(e.currentTarget))return;const t=z.value?D("common.copied")||"Copied":D("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;ln(e.currentTarget,t,"top",!1,o,l.isDark)}function Ye(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ze(){return Ve&&!se.value&&!Me.value&&!Ie.value}function Ue(e){const t=e.split(/\r?\n/);for(;t.length>0;){const e=t[t.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join("\n")}function Ge(e,t,n){return c(this,null,function*(){var o;try{return yield Do(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:$e.value.worker)}catch(l){return yield function(e,t,n){return c(this,null,function*(){var o,l;const r=yield R();if(!r)return;const i=r,a=Ye(e,t);if("function"==typeof i.parse)return yield Oe(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:$e.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Oe(()=>r.render(s,a),{timeoutMs:null!=(l=null==n?void 0:n.timeoutMs)?l:$e.value.render,signal:null==n?void 0:n.signal}),!0})}(e,t,n)}})}"undefined"!=typeof window&&B(()=>F.value,e=>{var t;if(null==(t=Z.value)||t.destroy(),Z.value=null,!e)return void(ee.value=!1);const n=q(e,{rootMargin:"400px"});Z.value=n,ee.value=n.isVisible.value,n.whenVisible.then(()=>{ee.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=Z.value)||e.destroy(),Z.value=null});const Je=_(()=>se.value||ce.value||P.value);function Qe(e){if(!F.value||!W.value)return;const t=W.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),r=t.getAttribute("width"),i=t.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||r&&i&&(n=Number.parseFloat(r),o=Number.parseFloat(i)),Number.isNaN(n)||Number.isNaN(o)||n<=0||o<=0)try{const e=t.getBBox();e&&e.width>0&&e.height>0&&(n=e.width,o=e.height)}catch(a){return void console.error("Failed to get SVG BBox:",a)}if(n>0&&o>0){const t=o/n;let l=(null!=e?e:F.value.clientWidth)*t;l>o&&(l=o),ke.value=`${l}px`}}const et=C(!1),tt=_(()=>({transform:`translate(${le.value}px, ${re.value}px) scale(${oe.value})`}));function nt(e){"Escape"===e.key&&et.value&&ot()}function ot(){if(et.value=!1,K.value&&k(K.value),X.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",nt)}catch(e){}}function lt(){oe.value<3&&(oe.value+=.1)}function rt(){oe.value>.5&&(oe.value-=.1)}function it(){oe.value=1,le.value=0,re.value=0}function at(e){ie.value=!0,e instanceof MouseEvent?ae.value={x:e.clientX-le.value,y:e.clientY-re.value}:ae.value={x:e.touches[0].clientX-le.value,y:e.touches[0].clientY-re.value}}function st(e){if(!ie.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),le.value=t-ae.value.x,re.value=n-ae.value.y}function ut(){ie.value=!1}function ct(e){if(l.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!F.value)return;const t=F.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,l=n-t.width/2,r=o-t.height/2,i=(l-le.value)/oe.value,a=(r-re.value)/oe.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(oe.value+u,.5),3);c!==oe.value&&(le.value=l-i*c,re.value=r-a*c,oe.value=c)}}function dt(){return c(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(ne.value)),z.value=!0,r("copy",ne.value),setTimeout(()=>{z.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})}function vt(){var e;const t=null==(e=W.value)?void 0:e.querySelector("svg");if(!t)return void console.error("SVG element not found");const n=(new XMLSerializer).serializeToString(t),o={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:t,svgString:n};r("export",o),o.defaultPrevented||function(e,t=null){c(this,null,function*(){try{const o=null!=t?t:(new XMLSerializer).serializeToString(e),l=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(l);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(n){}URL.revokeObjectURL(r)}}catch(o){console.error("Failed to export SVG:",o)}})}(t,n)}function mt(){var e,t;const n=null!=(t=null==(e=W.value)?void 0:e.querySelector("svg"))?t:null,o=n?(new XMLSerializer).serializeToString(n):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};r("openModal",l),l.defaultPrevented||function(){if(et.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",nt)}catch(e){}T(()=>{if(F.value&&K.value){const e=F.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(X.value=t,t.style.transform=tt.value.transform),k(K.value),K.value.appendChild(e)}})}()}function ht(e){const t={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};r("toggleMode",e,t),t.defaultPrevented||pt(e)}function pt(e){return c(this,null,function*(){const t=te.value;if(!t)return ue.value=!0,void(se.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",ue.value=!0,se.value="source"===e,yield T();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const l=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",r)};function r(){l()}t.addEventListener("transitionend",r),setTimeout(()=>l(),220)})}function ft(){return c(this,null,function*(){return ce.value?de.value:W.value||(yield T(),W.value)?(ce.value=!0,de.value=c(null,null,function*(){var e;W.value&&(W.value.style.opacity="0");try{const t=yield R();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;Me.value||_e.value||null==(e=t.initialize)||e.call(t,s(a({},v.value),{dompurifyConfig:a({},i)}));const o=function(e,t=ne.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}(l.isDark?"dark":"light"),r=yield Oe(()=>t.render(n,o),{timeoutMs:$e.value.fullRender}),u=null==r?void 0:r.svg;if(W.value){const e=b(W.value,u);Me.value||_e.value||(Qe(),Me.value=!0,je.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:ke.value});const t=l.isDark?"dark":"light";e&&(Ce.value[t]=e),_e.value&&(_e.value=!1),Ie.value=!1,fe=0,ye()}}catch(t){const e=function(e){const t="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof t&&/timed out/i.test(t)}(t),n=fe+1;e&&n<=3?(fe=n,xe(Math.min(1200,600*n))):(fe=0,ye(),console.error("Failed to render mermaid diagram:",t),!1===l.loading&&Fe(t))}finally{yield T(),W.value&&(W.value.style.opacity="1"),ce.value=!1,de.value=null}}),de.value):void console.warn("Mermaid container not ready")})}function gt(){return c(this,null,function*(){var e,t;const n=Date.now(),o=++Le.value;Se&&Se.abort(),Se=new AbortController;const r=Se.signal,i=l.isDark?"dark":"light",a=ne.value,s=a.replace(/\s+/g,"");if(!a.trim())return W.value&&k(W.value),Be.value=null,Te.value="",void(Ie.value=!1);if(s===Te.value)return;try{const u=yield function(e,t,n){return c(this,null,function*(){var o;try{if(yield Ge(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}let l=Ue(e);if(l&&l.trim()&&l!==e)try{try{const r=yield Ro(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:$e.value.worker);r&&r.trim()&&(l=r)}catch(r){}if(yield Ge(l,t,n))return{fullOk:!1,prefixOk:!0,prefix:l}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}return{fullOk:!1,prefixOk:!1}})}(a,i,{signal:r,timeoutMs:$e.value.worker});if(u.fullOk)return yield ft(),void(Le.value===o&&(Be.value=null!=(t=null==(e=W.value)?void 0:e.innerHTML)?t:null,Te.value=s,Ie.value=!1));const d=Pe&&n<=Pe;if(u.prefixOk&&u.prefix&&Ze()&&!d)return void(yield function(e){return c(this,null,function*(){if(Ze()&&(W.value||(yield T(),W.value))&&!ce.value){ce.value=!0;try{const t=yield R();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=l.isDark?"dark":"light",r=Ue(e),i=Ye(r&&r.trim()?r:e,o);W.value&&(W.value.style.opacity="0");const a=yield Oe(()=>t.render(n,i),{timeoutMs:$e.value.render}),s=null==a?void 0:a.svg;W.value&&s&&(b(W.value,s),Qe())}catch(t){}finally{yield T(),W.value&&(W.value.style.opacity="1"),ce.value=!1}}})}(u.prefix))}catch(d){if("AbortError"===(null==d?void 0:d.name))return}if(Le.value!==o)return;if(Ie.value)return;const u=Ce.value[i];u&&W.value&&b(W.value,u)})}function wt(){De&&(De=!1,Re=800,Ve=!1,ze&&(ze.abort(),ze=null),Ae&&(globalThis.clearTimeout(Ae),Ae=null),Ne&&(He(Ne),Ne=null),Pe=Date.now())}function yt(){if(wt(),Se){try{Se.abort()}catch(e){}Se=null}if(ze){try{ze.abort()}catch(e){}ze=null}zo(),ye(),fe=0}function xt(e=800){De&&(Ae&&globalThis.clearTimeout(Ae),Ae=globalThis.setTimeout(()=>{Ne=ge(()=>c(null,null,function*(){if(!De)return;if(se.value||Me.value)return void wt();const e=l.isDark?"dark":"light",t=ne.value;if(t.trim()){ze&&ze.abort(),ze=new AbortController;try{if((yield Ge(t,e,{signal:ze.signal,timeoutMs:$e.value.worker}))&&(yield ft(),Me.value))return void wt()}catch(n){}Re=Math.min(Math.floor(1.5*Re),4e3),xt(Re)}else xt(Re)}),{timeout:500})},e))}function kt(){De||se.value||Me.value||(De=!0,Pe=0,Ve=!0,xt(500))}B(tt,e=>{et.value&&X.value&&(X.value.style.transform=e.transform)},{immediate:!0}),B(()=>ne.value,()=>{Me.value=!1,Ce.value={},we(),!se.value&&u.value&&kt(),function(){if(!se.value)return;if(!u.value)return;const e=ne.value.length;e!==ve.value&&(me.value=!0,ve.value=e,he&&clearTimeout(he),he=setTimeout(()=>{me.value&&se.value&&ne.value.trim()&&(me.value=!1,pt("preview"))},500))}()}),B(()=>l.isDark,()=>c(null,null,function*(){if(!Me.value)return;if(Ie.value)return;const e=l.isDark?"dark":"light",t=Ce.value[e];if(t)return void(W.value&&b(W.value,t));const n={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:ke.value},o=1!==oe.value||0!==le.value||0!==re.value;_e.value=!0,o&&(oe.value=1,le.value=0,re.value=0,yield T()),yield ft(),o&&(yield T(),oe.value=n.zoom,le.value=n.translateX,re.value=n.translateY,ke.value=n.containerHeight,je.value=n)})),B(()=>se.value,e=>c(null,null,function*(){if(e)wt(),Me.value&&(je.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:ke.value});else{if(Ie.value)return;const e=l.isDark?"dark":"light";if(Me.value&&Ce.value[e])return yield T(),W.value&&b(W.value,Ce.value[e]),oe.value=je.value.zoom,le.value=je.value.translateX,re.value=je.value.translateY,void(ke.value=je.value.containerHeight);if(yield T(),!u.value)return;yield gt(),kt()}})),B(()=>l.loading,(e,t)=>c(null,null,function*(){if(!0===t&&!1===e){const e=ne.value.trim();if(!e)return yt();const t=l.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(Me.value&&o===Te.value)return yield T(),W.value&&!W.value.querySelector("svg")&&Ce.value[t]&&b(W.value,Ce.value[t]),void yt();try{yield Ge(e,t,{timeoutMs:$e.value.worker}),yield ft(),Te.value=o,Ie.value=!1,yt()}catch(n){yt(),Fe(n)}}})),B(F,e=>{be&&be.disconnect(),!e||Me.value||_e.value||(be=new ResizeObserver(e=>{e&&e.length>0&&!Me.value&&!_e.value&&fo(()=>{Qe(e[0].contentRect.width)})}),be.observe(e))},{immediate:!0}),U(()=>c(null,null,function*(){yield T(),ue.value||(se.value=!u.value),ee.value&&(we(),ve.value=ne.value.length)})),B(()=>u.value,e=>{ue.value||(se.value=!e)}),B(()=>ee.value,e=>{e&&(Me.value||(we(),ve.value=ne.value.length),l.loading||Me.value||we())},{immediate:!1}),G(()=>{he&&clearTimeout(he),be&&be.disconnect(),Se&&(Se.abort(),Se=null),zo(),wt(),ye()}),B(()=>P.value,e=>c(null,null,function*(){e?(wt(),Se&&Se.abort()):Me.value||(yield T(),we(),se.value||kt())}),{immediate:!1});const bt=_(()=>l.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(e,t)=>(f(),p("div",{class:H(["my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":l.loading}]])},[l.showHeader?(f(),p("div",{key:0,class:H(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",l.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[e.$slots["header-left"]?(f(),p("div",Po,[O(e.$slots,"header-left",{},void 0,!0)])):(f(),p("div",Vo,[x("img",{src:y("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"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,Oo),x("span",{class:H(["text-sm font-medium font-mono truncate",l.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),e.$slots["header-center"]?(f(),p("div",Fo,[O(e.$slots,"header-center",{},void 0,!0)])):l.showModeToggle&&u.value?(f(),p("div",{key:3,class:H(["flex items-center space-x-1 rounded-md p-0.5",l.isDark?"bg-gray-700":"bg-gray-100"])},[x("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:t[0]||(t[0]=()=>ht("preview")),onMouseenter:t[1]||(t[1]=e=>Ke(e,y(D)("common.preview")||"Preview")),onFocus:t[2]||(t[2]=e=>Ke(e,y(D)("common.preview")||"Preview")),onMouseleave:Xe,onBlur:Xe},[x("div",Wo,[t[21]||(t[21]=x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("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"}),x("circle",{cx:"12",cy:"12",r:"3"})])],-1)),x("span",null,M(y(D)("common.preview")||"Preview"),1)])],34),x("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:t[3]||(t[3]=()=>ht("source")),onMouseenter:t[4]||(t[4]=e=>Ke(e,y(D)("common.source")||"Source")),onFocus:t[5]||(t[5]=e=>Ke(e,y(D)("common.source")||"Source")),onMouseleave:Xe,onBlur:Xe},[x("div",Ko,[t[22]||(t[22]=x("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"},[x("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)),x("span",null,M(y(D)("common.source")||"Source"),1)])],34)],2)):V("",!0),e.$slots["header-right"]?(f(),p("div",Xo,[O(e.$slots,"header-right",{},void 0,!0)])):(f(),p("div",qo,[l.showCollapseButton?(f(),p("button",{key:0,class:H(bt.value),"aria-pressed":P.value,onClick:t[6]||(t[6]=e=>P.value=!P.value),onMouseenter:t[7]||(t[7]=e=>Ke(e,P.value?y(D)("common.expand")||"Expand":y(D)("common.collapse")||"Collapse")),onFocus:t[8]||(t[8]=e=>Ke(e,P.value?y(D)("common.expand")||"Expand":y(D)("common.collapse")||"Collapse")),onMouseleave:Xe,onBlur:Xe},[(f(),p("svg",{style:A({rotate:P.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"},[...t[23]||(t[23]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,Yo)):V("",!0),l.showCopyButton?(f(),p("button",{key:1,class:H(bt.value),onClick:dt,onMouseenter:t[9]||(t[9]=e=>qe(e)),onFocus:t[10]||(t[10]=e=>qe(e)),onMouseleave:Xe,onBlur:Xe},[z.value?(f(),p("svg",Uo,[...t[25]||(t[25]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",Zo,[...t[24]||(t[24]=[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),x("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)):V("",!0),l.showExportButton&&u.value?(f(),p("button",{key:2,class:H(`${bt.value} ${Je.value?"opacity-50 cursor-not-allowed":""}`),disabled:Je.value,onClick:vt,onMouseenter:t[11]||(t[11]=e=>Ke(e,y(D)("common.export")||"Export")),onFocus:t[12]||(t[12]=e=>Ke(e,y(D)("common.export")||"Export")),onMouseleave:Xe,onBlur:Xe},[...t[26]||(t[26]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),x("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,Go)):V("",!0),l.showFullscreenButton&&u.value?(f(),p("button",{key:3,class:H(`${bt.value} ${Je.value?"opacity-50 cursor-not-allowed":""}`),disabled:Je.value,onClick:mt,onMouseenter:t[13]||(t[13]=e=>Ke(e,et.value?y(D)("common.minimize")||"Minimize":y(D)("common.open")||"Open")),onFocus:t[14]||(t[14]=e=>Ke(e,et.value?y(D)("common.minimize")||"Minimize":y(D)("common.open")||"Open")),onMouseleave:Xe,onBlur:Xe},[et.value?(f(),p("svg",el,[...t[28]||(t[28]=[x("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)])])):(f(),p("svg",Qo,[...t[27]||(t[27]=[x("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,Jo)):V("",!0)]))],2)):V("",!0),$(x("div",{ref_key:"modeContainerRef",ref:te},[se.value?(f(),p("div",{key:0,class:H(["p-4",l.isDark?"bg-gray-900":"bg-gray-50"])},[x("pre",{class:H(["text-sm font-mono whitespace-pre-wrap",l.isDark?"text-gray-300":"text-gray-700"])},M(ne.value),3)],2)):(f(),p("div",tl,[l.showZoomControls?(f(),p("div",nl,[x("div",ol,[x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:lt,onMouseenter:t[15]||(t[15]=e=>Ke(e,y(D)("common.zoomIn")||"Zoom in")),onFocus:t[16]||(t[16]=e=>Ke(e,y(D)("common.zoomIn")||"Zoom in")),onMouseleave:Xe,onBlur:Xe},[...t[29]||(t[29]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:rt,onMouseenter:t[17]||(t[17]=e=>Ke(e,y(D)("common.zoomOut")||"Zoom out")),onFocus:t[18]||(t[18]=e=>Ke(e,y(D)("common.zoomOut")||"Zoom out")),onMouseleave:Xe,onBlur:Xe},[...t[30]||(t[30]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:it,onMouseenter:t[19]||(t[19]=e=>Ke(e,y(D)("common.resetZoom")||"Reset zoom")),onFocus:t[20]||(t[20]=e=>Ke(e,y(D)("common.resetZoom")||"Reset zoom")),onMouseleave:Xe,onBlur:Xe},M(Math.round(100*oe.value))+"% ",35)])])):V("",!0),x("div",Y({ref_key:"mermaidContainer",ref:F,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",l.isDark?"bg-gray-900":"bg-gray-50"],style:{height:ke.value}},J(Ee.value,!0),{onMousedown:at,onMousemove:st,onMouseup:ut,onMouseleave:ut,onTouchstartPassive:at,onTouchmovePassive:st,onTouchendPassive:ut}),[x("div",{"data-mermaid-wrapper":"",class:H(["absolute inset-0 cursor-grab",{"cursor-grabbing":ie.value}]),style:A(tt.value)},[x("div",{ref_key:"mermaidContent",ref:W,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(f(),S(I,{to:"body"},[w(j,{name:"mermaid-dialog",appear:""},{default:E(()=>[et.value?(f(),p("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:Q(ot,["self"])},[x("div",{class:H(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",l.isDark?"bg-gray-900":"bg-white"])},[x("div",ll,[x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:lt},[...t[31]||(t[31]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:rt},[...t[32]||(t[32]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:it},M(Math.round(100*oe.value))+"% ",3),x("button",{class:H(["inline-flex items-center justify-center p-2 rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ot},[...t[33]||(t[33]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),x("div",Y({ref_key:"modalContent",ref:K,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},J(Ee.value,!0),{onMousedown:at,onMousemove:st,onMouseup:ut,onMouseleave:ut,onTouchstartPassive:at,onTouchmovePassive:st,onTouchendPassive:ut}),null,16)],2)])):V("",!0)]),_:1})]))]))],512),[[N,!P.value]])],2))}}),[["__scopeId","data-v-3636e700"]]);rl.install=e=>{e.component(rl.__name,rl)};const il=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HtmlInlineNode",props:{node:{}},setup(e){const t=e,n=C(null),o="undefined"!=typeof window;function l(){if(!o||!n.value)return;const e=n.value;e.innerHTML="";const l=document.createElement("template");l.innerHTML=t.node.content,e.appendChild(l.content.cloneNode(!0))}function r(){if(!n.value)return;const e=n.value;e.innerHTML="",e.textContent=t.node.content}return U(()=>{t.node.loading?r():l()}),B(()=>[t.node.content,t.node.loading],()=>{t.node.loading?r():l()}),L(()=>{n.value&&(n.value.innerHTML="")}),(e,o)=>(f(),p("span",{ref_key:"containerRef",ref:n,class:H(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},null,2))}}),[["__scopeId","data-v-ce01f326"]]);il.install=e=>{e.component(il.__name,il)};const al={dir:"auto",class:"paragraph-node"},sl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({inline_code:_e,image:yn,link:Gn,hardbreak:co,emphasis:oo,strong:Fn,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,html_inline:il,emoji:me,checkbox:ae,math_inline:$n,checkbox_input:ae,reference:An,footnote_anchor:ro,footnote_reference:be},n),l=jn();return(n,r)=>(f(),p("p",al,[(f(!0),p(k,null,b(e.node.children,(n,r)=>(f(),p(k,{key:`${e.indexKey||"paragraph"}-${r}`},["text"!==n.type?(f(),S(X(o[n.type]),{key:0,node:n,"index-key":`${e.indexKey}-${r}`,"custom-id":t.customId},null,8,["node","index-key","custom-id"])):(f(),p("span",{key:1,class:H([[y(l)&&n.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(n.content),3))],64))),128))]))}}),[["__scopeId","data-v-0117537a"]]);sl.install=e=>{e.component(sl.__name,sl)};const ul=["aria-busy","aria-label","data-language"],cl=["textContent"],dl=/* @__PURE__ */h({__name:"PreCodeNode",props:{node:{}},setup(e){const t=e,n=_(()=>{var e,n,o;const l=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(l).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=_(()=>`language-${n.value}`),l=_(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return(t,r)=>(f(),p("pre",{class:H([o.value]),"aria-busy":!0===e.node.loading,"aria-label":l.value,"data-language":n.value,tabindex:"0"},[x("code",{translate:"no",textContent:M(e.node.code)},null,8,cl)],10,ul))}});dl.install=e=>{e.component(dl.__name,dl)};const vl={class:"table-node-wrapper"},ml=["aria-busy"],hl={class:"border-[var(--table-border,#cbd5e1)]"},pl={class:"border-b"},fl={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},gl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e,n=_(()=>{var e,n,o,l;return null!=(l=null==(o=null==(n=null==(e=t.node)?void 0:e.header)?void 0:n.cells)?void 0:o.length)?l:0}),o=_(()=>{const e=n.value||1,t=Math.floor(100/e);return Array.from({length:e}).map((n,o)=>o===e-1?100-t*(e-1)+"%":`${t}%`)}),l=_(()=>{var e;return null!=(e=t.node.loading)&&e}),r=_(()=>{var e;return null!=(e=t.node.rows)?e:[]});return(n,i)=>(f(),p("div",vl,[x("table",{class:H(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[x("colgroup",null,[(f(!0),p(k,null,b(o.value,(e,t)=>(f(),p("col",{key:`col-${t}`,style:A({width:e})},null,4))),128))]),x("thead",hl,[x("tr",pl,[(f(!0),p(k,null,b(e.node.header.cells,(e,o)=>(f(),p("th",{key:`header-${o}`,dir:"auto",class:H(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[w(y(Cl),{nodes:e.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:i[0]||(i[0]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),x("tbody",null,[(f(!0),p(k,null,b(r.value,(e,o)=>(f(),p("tr",{key:`row-${o}`,class:H(["border-[var(--table-border,#cbd5e1)]",[o<r.value.length-1?"border-b":""]])},[(f(!0),p(k,null,b(e.cells,(e,l)=>(f(),p("td",{key:`cell-${o}-${l}`,class:H(["p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[w(y(Cl),{nodes:e.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:i[1]||(i[1]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,ml),w(j,{name:"table-node-fade"},{default:E(()=>[l.value?(f(),p("div",fl,[O(n.$slots,"loading",{isLoading:l.value},()=>[i[2]||(i[2]=x("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),i[3]||(i[3]=x("span",{class:"sr-only"},"Loading",-1))],!0)])):V("",!0)]),_:3})]))}}),[["__scopeId","data-v-a874491c"]]);gl.install=e=>{e.component(gl.__name,gl)};const wl={class:"hr-node"},yl=/* @__PURE__ */oe({},[["render",function(e,t){return f(),p("hr",wl)}],["__scopeId","data-v-639cbad9"]]);yl.install=e=>{e.component(yl.__name,yl)};const xl={key:1,class:"html-block-node__placeholder"},kl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HtmlBlockNode",props:{node:{}},setup(e){const t=e,n=_(()=>{const e=t.node.attrs;if(e){if(Array.isArray(e)){const t={};for(const n of e){if(!n||n.length<2)continue;const[e,o]=n;null!=e&&(t[String(e)]=null==o?"":String(o))}return t}return e}}),o=C(null),l=C("undefined"==typeof window),r=C(t.node.content),i=dn(),a=C(null),s=!!t.node.loading;return"undefined"!=typeof window?(B(o,e=>{var n,o;if(null==(o=null==(n=a.value)?void 0:n.destroy)||o.call(n),a.value=null,!s)return l.value=!0,void(r.value=t.node.content);if(!e)return void(l.value=!1);const u=i(e,{rootMargin:"400px"});a.value=u,l.value=u.isVisible.value,u.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),B(()=>t.node.content,e=>{s&&!l.value||(r.value=e)})):l.value=!0,L(()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.destroy)||t.call(e),a.value=null}),(t,i)=>(f(),p("div",Y({ref_key:"htmlRef",ref:o,class:"html-block-node"},n.value),[l.value?g([r.value],()=>(f(),p("div",{key:0,innerHTML:r.value},null,8,["innerHTML"])),i,0):(f(),p("div",xl,[O(t.$slots,"placeholder",{node:e.node},()=>[i[1]||(i[1]=x("span",{class:"html-block-node__placeholder-bar"},null,-1)),i[2]||(i[2]=x("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),i[3]||(i[3]=x("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-ed22b926"]]),bl={class:"unknown-node"},Ml=/* @__PURE__ */h({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(f(),p("div",bl,M(e.node.raw),1))}),_l=["data-node-index","data-node-type"],Cl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:t}){var n,o,l;const r=e,i=t,s=C(),u=C(!1),m=/auto|scroll|overlay/i;function h(e){if("undefined"==typeof window)return null;const t=null!=e?e:s.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let l=t;for(;l&&l!==n.body&&l!==o;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(m.test(t)||m.test(n))return l;l=l.parentElement}return null}const g=d(),w=_(()=>r.customMarkdownIt?r.customMarkdownIt(g):g),y=_(()=>{var e;if(null==(e=r.nodes)?void 0:e.length)return ee(r.nodes.slice());if(r.content){const e=v(r.content,w.value,r.parseOptions);return ee(e)}return[]}),x=_(()=>{var e;return Math.max(1,null!=(e=r.maxLiveNodes)?e:320)}),M=_(()=>{var e;return!((null!=(e=r.maxLiveNodes)?e:0)<=0)&&y.value.length>x.value}),T=function(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?C(t):t;let l=null,r=null;const i=/* @__PURE__ */new WeakMap,s=(t,s)=>{const u=C(!1);let c,d=!1;const v=new Promise(e=>{c=()=>{d||(d=!0,e())}}),m=()=>{try{null==l||l.unobserve(t)}catch(e){}i.delete(t)};if(!n||!o.value)return u.value=!0,c(),{isVisible:u,whenVisible:v,destroy:m};!r&&s&&(r=a({},s));const h=function(t){var o,a,s;if(l||!n)return l;if("undefined"==typeof IntersectionObserver)return null;const u=null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,c=r||{};return l=new IntersectionObserver(e=>{for(const n of e){const e=i.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(t){}}null==l||l.unobserve(n.target),i.delete(n.target)}}},{root:u,rootMargin:null!=(a=c.rootMargin)?a:"300px",threshold:null!=(s=c.threshold)?s:0}),l}(t);return h?(i.set(t,{resolve:c,visible:u}),h.observe(t),{isVisible:u,whenVisible:v,destroy:m}):(u.value=!0,c(),{isVisible:u,whenVisible:v,destroy:m})};return P(cn,s),s}(e=>{var t;return h(null!=(t=null!=e?e:s.value)?t:null)},_(()=>!(!1===r.viewportPriority||u.value||!1===r.deferNodesUntilVisible||M.value||y.value.length>900))),I="undefined"!=typeof window,$=I&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,H=I&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,N="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),D=I&&"function"==typeof window.requestIdleCallback,R=_(()=>{var e;const t=Math.trunc(null!=(e=r.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),z=_(()=>{var e;const t=Math.trunc(null!=(e=r.initialRenderBatchSize)?e:R.value);return Number.isFinite(t)?Math.max(0,t):R.value}),O=_(()=>!1!==r.batchRendering&&R.value>0&&I&&!N),F=C(0),W=C({key:r.indexKey,total:0}),q=C(Math.max(1,R.value||1)),Z=te({}),U=/* @__PURE__ */new Map,G=/* @__PURE__ */new Map,J=/* @__PURE__ */new Map,Q=C(null);let ne=null,oe=null;const re=_(()=>!1),ie=_(()=>{var e;return O.value&&(null!=(e=r.maxLiveNodes)?e:0)<=0}),se=C({batchSize:R.value,initial:z.value,delay:null!=(l=r.renderBatchDelay)?l:16,enabled:ie.value}),ue=_(()=>!!T&&(re.value||M.value)),ce=_(()=>{var e;return Math.max(0,null!=(e=r.liveNodeBuffer)?e:60)}),ve=C(0),he=te({start:0,end:0}),pe=/* @__PURE__ */new Map,fe=_(()=>{if(!M.value)return y.value.length;const e=ce.value,t=Math.max(he.end+e,z.value),n=Math.min(y.value.length,t);return Math.max(F.value,n)});function we(e){var t,n,o;const l=h(null!=(t=s.value)?t:null);if(l)return l;const r=null!=(o=null==(n=s.value)?void 0:n.ownerDocument)?o:"undefined"!=typeof document?document:null;return(null==r?void 0:r.scrollingElement)||(null==r?void 0:r.documentElement)||null}function ye(){ne&&(ne(),ne=null),Q.value=null}function xe(){if(!I||!M.value)return;const e=we();if(!e||Q.value===e)return;ye();const t=()=>Me();e.addEventListener("scroll",t,{passive:!0}),Q.value=e,ne=()=>{e.removeEventListener("scroll",t)}}function ke(){var e,t,n;if(!oe)return;const o=null!=(n=null==(t=null==(e=s.value)?void 0:e.ownerDocument)?void 0:t.defaultView)?n:"undefined"!=typeof window?window:null;oe.viaTimeout?o?o.clearTimeout(oe.id):clearTimeout(oe.id):null==H||H(oe.id),oe=null}function Me(e={}){var t,n,o;if(!M.value)return;if(!I)return void Ce(!0);if(e.immediate)return ke(),void Ce(!0);if(oe)return;const l=()=>{oe=null,Ce()};if($)oe={id:$(l),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=s.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,r=e?e.setTimeout(l,16):setTimeout(l,16);oe={id:r,viaTimeout:!0}}}function Ce(e=!1){var t,n,o,l,r,i,a,u,c,d,v;if(!M.value)return;const m=Q.value||we();if(!m)return;const h=m.ownerDocument||(null==(t=s.value)?void 0:t.ownerDocument)||document,p=(null==h?void 0:h.defaultView)||("undefined"!=typeof window?window:null),f=m===(null==h?void 0:h.documentElement)||m===(null==h?void 0:h.body),g=f?null:m.getBoundingClientRect(),w=f?0:g.top,x=f?null!=(o=null!=(n=null==p?void 0:p.innerHeight)?n:m.clientHeight)?o:0:g.bottom,k=Array.from(J.entries()).sort((e,t)=>e[0]-t[0]);let b=null,_=null;for(const[s,y]of k){if(!y)continue;const e=y.getBoundingClientRect();e.bottom<=w||e.top>=x||(null==b&&(b=s),_=s)}if(null==b||null==_){const e=s.value;if(!e)return;const t=f?{top:0}:m.getBoundingClientRect(),n=e.getBoundingClientRect(),o=f?null!=(a=null!=(i=null==(l=null==h?void 0:h.documentElement)?void 0:l.scrollTop)?i:null==(r=null==h?void 0:h.body)?void 0:r.scrollTop)?a:0:m.scrollTop,g=n.top-(f?0:t.top)+o,w=Math.max(0,o-g),x=f?null!=(v=null!=(d=null!=(c=null==p?void 0:p.innerHeight)?c:null==(u=null==h?void 0:h.documentElement)?void 0:u.clientHeight)?d:m.clientHeight)?v:0:m.clientHeight,k=function(e){var t;if(e<=0)return 0;let n=e;const o=y.value;for(let l=0;l<o.length;l++){const e=null!=(t=Te[l])?t:Se.value;if(n<=e)return l;n-=e}return Math.max(0,o.length-1)}(w+.5*Math.max(0,x));return void(ve.value=Be(k,0,Math.max(0,y.value.length-1)))}const C=Math.round((b+_)/2);!e&&Math.abs(C-ve.value)<=1||(ve.value=Be(C,0,Math.max(0,y.value.length-1)))}function Be(e,t,n){return Math.min(Math.max(e,t),n)}const Te=te({}),Le=te({total:0,count:0}),Se=_(()=>Le.count>0?Math.max(12,Le.total/Le.count):32);function Ie(e,t){var n;if(e>=t)return 0;let o=0;for(let l=e;l<t;l++)o+=null!=(n=Te[l])?n:Se.value;return o}const je=_(()=>{if(!M.value)return y.value.map((e,t)=>({node:e,index:t}));const e=y.value.length,t=Be(he.start,0,e),n=Be(he.end,t,e);return y.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Ee=_(()=>M.value?Ie(0,Math.min(he.start,y.value.length)):0),$e=_(()=>{if(!M.value)return 0;const e=y.value.length;return Ie(Math.min(he.end,e),e)});function He(e){if(U.size&&M.value)for(const[t,n]of U)t>=e&&(n.destroy(),U.delete(t),re.value&&delete Z[t],We(t),J.delete(t))}function Ae(e,t){re.value&&(Z[e]=t),t&&(M.value?Me():ve.value=Be(e,0,Math.max(0,y.value.length-1)))}function Ne(e){const t=U.get(e);t&&(t.destroy(),U.delete(e)),We(e)}function De(e,t){if(t?J.set(e,t):J.delete(e),t||We(e),!ue.value||!T)return Ne(e),void(t?Ae(e,!0):re.value&&delete Z[e]);if(!M.value&&re.value&&!u.value&&U.size>=640&&(function(){if(!u.value){u.value=!0;for(const e of U.values())e.destroy();if(U.clear(),I)for(const e of G.values())window.clearTimeout(e);G.clear();for(const e of Object.keys(Z))delete Z[e]}}(),!ue.value||!T))return Ne(e),void(t?Ae(e,!0):re.value&&delete Z[e]);if(e<z.value&&!M.value)return Ne(e),void Ae(e,!0);if(!t)return Ne(e),void(re.value&&delete Z[e]);Ne(e);const n=T(t,{rootMargin:"400px"});n&&(U.set(e,n),Ae(e,n.isVisible.value),re.value&&function(e){if(!I||!re.value)return;We(e);const t=window.setTimeout(()=>{G.delete(e),Ae(e,!0)},1800);G.set(e,t)}(e),n.whenVisible.then(()=>{We(e),Ae(e,!0)}).catch(()=>{}).finally(()=>{U.get(e)===n&&U.delete(e);try{n.destroy()}catch(t){}}),M.value&&Me())}let Re=null,ze=null,Pe=!1,Ve=null,Oe=null;function Fe(){I&&(null!=Re&&(null==H||H(Re),Re=null),null!=ze&&(window.clearTimeout(ze),ze=null),null!=Oe&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Oe),Oe=null),Pe=!1,Ve=null)}function We(e){if(!I)return;const t=G.get(e);null!=t&&(window.clearTimeout(t),G.delete(e))}function Ke(e,t={}){var n,o;if(!ie.value)return;const l=fe.value;if(F.value>=l)return;const i=Math.max(1,e),a=e=>{var t;Re=null,ze=null,Oe=null,Pe=!1;const n=null!=Ve?Ve:i;Ve=null;const o=Math.max(2,null!=(t=r.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();F.value=Math.min(l,F.value+Math.max(1,e)),He(F.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return function(e){var t;if(!ie.value)return;const n=Math.max(2,null!=(t=r.renderBatchBudgetMs)?t:6),o=Math.max(1,R.value||1),l=Math.max(1,Math.floor(o/4));e>1.2*n?q.value=Math.max(l,Math.floor(.7*q.value)):e<.5*n&&q.value<o&&(q.value=Math.min(o,Math.ceil(1.2*q.value)))}(n),n};let s=n;for(;(a(s),!(F.value>=l)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(q.value));F.value<l&&Xe()};if(!I||t.immediate)return void a();const s=Math.max(0,null!=(n=r.renderBatchDelay)?n:16);if(Ve=null!=Ve?Math.max(Ve,i):i,!Pe){if(Pe=!0,!N&&D&&window.requestIdleCallback){const e=Math.max(0,null!=(o=r.renderBatchIdleTimeoutMs)?o:120);return void(Oe=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}$&&!N?Re=$(()=>{0!==s?ze=window.setTimeout(()=>a(),s):a()}):ze=window.setTimeout(()=>a(),s)}}function Xe(){ie.value&&Ke(O.value?Math.max(1,Math.round(q.value)):Math.max(1,R.value))}B([()=>y.value,()=>y.value.length,()=>ie.value,()=>R.value,()=>z.value,()=>r.renderBatchDelay,()=>r.indexKey],()=>{var e;const t=y.value.length,n=W.value,o=r.indexKey,l=void 0!==o&&o!==n.key,i=t!==n.total,a=l||i;W.value={key:o,total:t};const s=se.value,u=null!=(e=r.renderBatchDelay)?e:16,c=s.batchSize!==R.value||s.initial!==z.value||s.delay!==u||s.enabled!==ie.value;se.value={batchSize:R.value,initial:z.value,delay:u,enabled:ie.value},(a||c||!ie.value)&&Fe(),(a||c)&&(q.value=Math.max(1,R.value||1)),a&&M.value&&Me({immediate:!0});const d=fe.value;if(!t)return F.value=0,void He(0);if(!ie.value)return F.value=d,void He(F.value);const v=l||0===n.total;F.value=v||c?Math.min(d,z.value):Math.min(F.value,d);const m=Math.max(1,z.value||R.value||t);F.value<d?Ke(m,{immediate:!I}):He(F.value)},{immediate:!0}),B(()=>M.value,e=>{if(!e)return ye(),void ke();xe(),Me({immediate:!0})},{immediate:!0}),B(()=>s.value,()=>{M.value&&(xe(),Me({immediate:!0}))}),B(()=>y.value.length,()=>{M.value&&Me({immediate:!0})}),B(()=>re.value,e=>{if(e)for(const[t,n]of J)De(t,n);else{for(const e of U.values())e.destroy();U.clear();for(const e of Array.from(G.keys()))We(e);for(const e of Object.keys(Z))delete Z[e];for(const[e,t]of J)t&&Ae(e,!0)}},{immediate:!1}),B([()=>r.viewportPriority,()=>y.value.length],([e,t])=>{!1!==e?u.value&&t<=200&&(u.value=!1):u.value=!1}),B(()=>F.value,()=>{M.value&&Me({immediate:!0})}),B([ve,x,ce,()=>y.value.length,M],()=>{!function(){const e=y.value.length;if(!M.value||0===e)return he.start=0,void(he.end=e);const t=Math.min(x.value,e),n=ce.value,o=Be(ve.value-n,0,Math.max(0,e-t));he.start=o,he.end=Math.min(e,o+t)}()},{immediate:!0}),B(()=>fe.value,(e,t)=>{ie.value&&("number"==typeof t&&e<=t||e>F.value&&Xe())}),L(()=>{Fe();for(const e of U.values())e.destroy();U.clear();for(const e of Array.from(G.keys()))We(e);ye(),ke()});const qe=K(()=>c(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),dl}})),Ye=_(()=>r.renderCodeBlocksAsPre?dl:qe),Ze={text:En,paragraph:sl,heading:mo,code_block:qe,list:po,blockquote:le,table:gl,definition_list:de,footnote:so,footnote_reference:be,footnote_anchor:ro,admonition:El,hardbreak:co,link:Gn,image:yn,thematic_break:yl,math_inline:$n,math_block:Hn,strong:Fn,emphasis:oo,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,checkbox:ae,checkbox_input:ae,inline_code:_e,html_inline:il,reference:An,html_block:kl};function Ue(e){var t;if(!e)return Ml;const n=ge(r.customId),o=n[String(e.type)];if("code_block"===e.type){if("mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase())return n.mermaid||rl;if(o)return o;return n.code_block||Ye.value}return o||Ze[String(e.type)]||Ml}function Ge(e){var t;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase()?{}:"code_block"===e.type?a({stream:r.codeBlockStream,darkTheme:r.codeBlockDarkTheme,lightTheme:r.codeBlockLightTheme,monacoOptions:r.codeBlockMonacoOptions,themes:r.themes,minWidth:r.codeBlockMinWidth,maxWidth:r.codeBlockMaxWidth},r.codeBlockProps||{}):{typewriter:r.typewriter}}function Je(e){i("click",e)}function Qe(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseover",e)}function et(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseout",e)}return(t,n)=>(f(),p("div",{ref_key:"containerRef",ref:s,class:"markdown-renderer",onClick:Je,onMouseover:Qe,onMouseout:et},[M.value?(f(),p("div",{key:0,class:"node-spacer",style:A({height:`${Ee.value}px`}),"aria-hidden":"true"},null,4)):V("",!0),(f(!0),p(k,null,b(je.value,t=>{var o,l;return f(),p("div",{key:t.index,ref_for:!0,ref:e=>De(t.index,e),class:"node-slot","data-node-index":t.index,"data-node-type":t.node.type},[(l=t.index,ie.value&&l>=F.value||re.value&&!(l<z.value)&&!0!==Z[l]?(f(),p("div",{key:1,class:"node-placeholder",style:A({height:`${null!=(o=Te[t.index])?o:Se.value}px`})},null,4)):(f(),p("div",{key:0,ref_for:!0,ref:e=>function(e,t){t?(pe.set(e,t),queueMicrotask(()=>{!function(e,t){if(!Number.isFinite(t)||t<=0)return;const n=Te[e];Te[e]=t,n?Le.total+=t-n:(Le.total+=t,Le.count++)}(e,t.offsetHeight)})):pe.delete(e)}(t.index,e),class:"node-content"},["code_block"!==t.node.type&&!1!==r.typewriter?(f(),S(j,{key:0,name:"typewriter",appear:""},{default:E(()=>[(f(),S(X(Ue(t.node)),Y({node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},Ge(t.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(f(),S(X(Ue(t.node)),Y({key:1,node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},Ge(t.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)))],8,_l)}),128)),M.value?(f(),p("div",{key:1,class:"node-spacer",style:A({height:`${$e.value}px`}),"aria-hidden":"true"},null,4)):V("",!0)],544))}}),[["__scopeId","data-v-33b6808c"]]);Cl.install=e=>{var t,n;const o=null!=(n=null!=(t=Cl.__name)?t:Cl.name)?n:"NodeRenderer";e.component(o,Cl)};const Bl={key:0,class:"admonition-icon"},Tl={class:"admonition-title"},Ll=["aria-expanded","aria-controls","title"],Sl={key:0},Il={key:1},jl=["id"],El=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,l=t,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=_(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),a=C(!!o.node.collapsible&&!(null==(n=o.node.open)||n));function s(){o.node.collapsible&&(a.value=!a.value)}const u=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,n)=>(f(),p("div",{class:H(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[x("div",{id:u,class:"admonition-header"},[r[o.node.kind]?(f(),p("span",Bl,M(r[o.node.kind]),1)):V("",!0),x("span",Tl,M(i.value),1),o.node.collapsible?(f(),p("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${u}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(f(),p("span",Sl,"▶")):(f(),p("span",Il,"▼"))],8,Ll)):V("",!0)]),$(x("div",{id:`${u}-content`,class:"admonition-content","aria-labelledby":u},[g([o.node.children],()=>w(y(Cl),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:n[0]||(n[0]=e=>l("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),n,1)],8,jl),[[N,!a.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);El.install=e=>{e.component(El.__name,El)};let $l=!1,Hl=null,Al=!1;function Nl(){return c(this,null,function*(){if(Hl)return Hl;if(Al)return null;try{return Hl=yield import("stream-monaco"),yield function(e){return c(this,null,function*(){if(!$l)return $l=!0,e.preloadMonacoWorkers()})}(Hl),Hl}catch(e){return Al=!0,null}})}let Dl=null;function Rl(e){Dl=null!=e?e:null}const zl={"":"",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 Pl(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[o]=n.split(":");return o.toLowerCase()}(e);return null!=(t=zl[n])?t:n}function Vl(e){const t=Pl(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ol(e){if(Dl){const t=Dl(e);if(null!=t&&""!==t)return t}switch(Pl(e)){case"javascript":case"js":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n';case"typescript":case"ts":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n';case"scss":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n';case"python":case"py":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n';case"ruby":case"rb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n';case"go":case"golang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n';case"r":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />\n <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />\n </g>\n</svg>\n';case"java":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n';case"kotlin":case"kt":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n';case"c":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n';case"cpp":case"c++":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n';case"cs":case"csharp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n';case"php":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n';case"scala":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />\n</svg>\n';case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n';case"sql":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n';case"yaml":case"yml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n';case"markdown":case"md":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n';case"xml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n';case"rust":case"rs":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n';case"swift":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />\n</svg>\n';case"perl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />\n</svg>\n';case"lua":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />\n <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />\n </g>\n</svg>\n';case"haskell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />\n</svg>\n';case"erlang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />\n <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />\n </g>\n</svg>\n';case"clojure":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />\n <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />\n <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />\n <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />\n <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />\n <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />\n </g>\n</svg>\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n';case"dart":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />\n <path d="M3.5 11V3.5H11m-7.5 0 8 8" />\n </g>\n</svg>\n';case"assembly":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />\n</svg>\n';case"dockerfile":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />\n</svg>\n';case"fortran":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />\n</svg>\n';case"lisp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />\n <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />\n </g>\n</svg>\n';case"ocaml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />\n <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />\n <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />\n </g>\n</svg>\n';case"prolog":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />\n</svg>\n';case"groovy":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />\n <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />\n </g>\n</svg>\n';case"matlab":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />\n <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />\n </g>\n</svg>\n';case"cobol":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />\n</svg>\n';case"ada":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<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>';case"julia":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n </g>\n</svg>\n';case"elixir":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />\n</svg>\n';case"vb.net":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>';case"nim":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />\n</svg>\n';case"crystal":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />\n</svg>\n';case"d":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>';case"applescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <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" />\n</svg>\n';case"solidity":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="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" />\n</svg>\n';case"objectivec":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>';case"objectivecpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>';case"terraform":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />\n</svg>\n';case"plain":case"text":case"":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>'}}const Fl={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"},Wl={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)"}},Kl={class:"flex items-center space-x-2"},Xl=["innerHTML"],ql={class:"text-sm font-medium font-mono"},Yl={class:"flex items-center space-x-2"},Zl=["aria-pressed"],Ul=["disabled"],Gl=["disabled"],Jl=["disabled"],Ql=["aria-label"],er={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"},tr={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"},nr=["aria-pressed"],or={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"},lr={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"},rr=["aria-label"],ir=["innerHTML"],ar={class:"code-loading-placeholder"},sr=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n;const o=e,l=t,{t:r}=un(),i=C(String(null!=(n=o.node.language)?n:"")),a=C(!1),s=C(!1),u=C(!1),d=C(null),v=C(null),m=C(""),h=C(!1);let g;const w=C(!0),b=C(0),L=C(14),I=C(L.value),j=_(()=>{const e=L.value,t=I.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),E=_(()=>{const e=i.value.trim().toLowerCase();return Fl[e]||e.charAt(0).toUpperCase()+e.slice(1)}),D=_(()=>"mermaid"===i.value.trim().toLowerCase()),R=_(()=>Ol(i.value.trim().toLowerCase().split(":")[0])),z=_(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),P=_(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(o.minWidth),l=t(o.maxWidth);return n&&(e.minWidth=n),l&&(e.maxWidth=l),e}),F=_(()=>({fontSize:`${I.value}px`}));function W(){return o.isDark?o.darkTheme:o.lightTheme}function K(e){if(null==g||g.disconnect(),g=void 0,!e)return m.value="",void(h.value=!1);var t;m.value=`<pre class="shiki shiki-fallback"><code>${t=e,t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,h.value=!1}function X(){m.value="",h.value=!0}function q(){var e;const t=v.value;return!!t&&(t.childNodes.length>0||Boolean(null==(e=t.textContent)?void 0:e.trim().length))}function Y(){return c(this,null,function*(){if(yield T(),q())return void X();const e=v.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{q()&&(X(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let Z,G,J,Q,ee=()=>{};const te=/* @__PURE__ */new Set,ne=/* @__PURE__ */new Set,oe=void 0!==import.meta&&Boolean(!1);function le(e,t){return c(this,null,function*(){if(!Z)return;const n=function(e,t=!1){var n;const[o]=String(null!=e?e:"").split(":"),l=null!=(n=null==o?void 0:o.trim().toLowerCase())?n:"";return l?!Q||Q.has(l)?l:(t&&oe&&!te.has(l)&&(te.add(l),console.warn(`[MarkdownCodeBlockNode] Language "${l}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(t,Boolean(e&&e.length));try{yield Z.updateCode(e,n)}catch(o){"plaintext"!==n?(oe&&!ne.has(n)&&(ne.add(n),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${n}", retrying as plaintext.`,o)),yield Z.updateCode(e,"plaintext")):oe&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function re(){return c(this,null,function*(){if(D.value)return ee(),null==Z||Z.dispose(),Z=void 0,void(h.value=!1);yield function(){return c(this,null,function*(){if(!G)try{const e=yield import("stream-markdown");G=e.createShikiStreamRenderer,J=e.registerHighlight,ee=e.disposeHighlighter;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Q=t?new Set(t.map(e=>e.toLowerCase())):void 0,null==J||J({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),d.value&&v.value?(null==J||J({themes:o.themes}),!Z&&G&&(Z=G(v.value,{theme:W()}),h.value=!0),Z?!1===o.stream&&o.loading?K(o.node.code):(K(o.node.code),yield le(o.node.code,i.value),yield Y()):K(o.node.code)):K(o.node.code)})}re(),U(()=>{re()}),B(()=>o.themes,()=>c(null,null,function*(){J&&J({themes:o.themes})})),B(()=>o.loading,e=>{e||re()}),B(()=>[o.node.code,o.node.language],e=>c(null,[e],function*([e,t]){if(t!==i.value&&(i.value=t.trim()),d.value&&v.value){if(D.value)return ee(),void(null==Z||Z.dispose());Z||(K(e),yield re()),Z&&e&&(!1===o.stream&&o.loading||(K(e),yield le(e,t),yield Y()))}else K(e)}));const ie=B(()=>[o.darkTheme,o.lightTheme],()=>c(null,null,function*(){if(d.value&&v.value){if(D.value)return ee(),null==Z||Z.dispose(),ie();Z||(yield re()),null==Z||Z.setTheme(W())}}));function ae(){const e=d.value;if(!e||s.value)return;const t=e.scrollTop;t<b.value?w.value=!1:function(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}(e)&&(w.value=!0),b.value=t}function se(){return c(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),a.value=!0,l("copy",o.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ue(e){return!e||e.disabled}function ce(e,t,n="top"){if(ue(e.currentTarget))return;const l=e,r=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;ln(e.currentTarget,t,n,!1,r,o.isDark)}function de(){rn()}function ve(e){if(ue(e.currentTarget))return;const t=a.value?r("common.copied")||"Copied":r("common.copy")||"Copy",n=e,l=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;ln(e.currentTarget,t,"top",!1,l,o.isDark)}function me(){s.value=!s.value;const e=d.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",w.value=!0,T(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function he(){u.value=!u.value}function pe(){if(!z.value)return;const e=(i.value||o.node.language).toLowerCase(),t="html"===e?"HTML Preview":"SVG Preview";l("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:t})}return B(()=>o.node.code,()=>c(null,null,function*(){if(s.value||!w.value)return;yield T();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(t,n)=>D.value?(f(),S(y(rl),{key:0,node:e.node,"is-dark":o.isDark,loading:o.loading},null,8,["node","is-dark","loading"])):(f(),p("div",{key:1,style:A(P.value),class:H(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",o.isDark?"is-dark":""]])},[o.showHeader?(f(),p("div",Wl,[O(t.$slots,"header-left",{},()=>[x("div",Kl,[x("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:R.value},null,8,Xl),x("span",ql,M(E.value),1)])],!0),O(t.$slots,"header-right",{},()=>[x("div",Yl,[x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":u.value,onClick:he,onMouseenter:n[0]||(n[0]=e=>ce(e,u.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onFocus:n[1]||(n[1]=e=>ce(e,u.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onMouseleave:de,onBlur:de},[(f(),p("svg",{style:A({rotate:u.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"},[...n[17]||(n[17]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Zl),o.showFontSizeButtons&&o.enableFontSizeControl?(f(),p(k,{key:0},[x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(I.value)&&I.value<=10,onClick:n[2]||(n[2]=e=>function(){const e=Math.max(10,I.value-1);I.value=e}()),onMouseenter:n[3]||(n[3]=e=>ce(e,y(r)("common.decrease")||"Decrease")),onFocus:n[4]||(n[4]=e=>ce(e,y(r)("common.decrease")||"Decrease")),onMouseleave:de,onBlur:de},[...n[18]||(n[18]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Ul),x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!j.value||I.value===L.value,onClick:n[5]||(n[5]=e=>{I.value=L.value}),onMouseenter:n[6]||(n[6]=e=>ce(e,y(r)("common.reset")||"Reset")),onFocus:n[7]||(n[7]=e=>ce(e,y(r)("common.reset")||"Reset")),onMouseleave:de,onBlur:de},[...n[19]||(n[19]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),x("path",{d:"M3 3v5h5"})])],-1)])],40,Gl),x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(I.value)&&I.value>=36,onClick:n[8]||(n[8]=e=>function(){const e=Math.min(36,I.value+1);I.value=e}()),onMouseenter:n[9]||(n[9]=e=>ce(e,y(r)("common.increase")||"Increase")),onFocus:n[10]||(n[10]=e=>ce(e,y(r)("common.increase")||"Increase")),onMouseleave:de,onBlur:de},[...n[20]||(n[20]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Jl)],64)):V("",!0),o.showCopyButton?(f(),p("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":a.value?y(r)("common.copied")||"Copied":y(r)("common.copy")||"Copy",onClick:se,onMouseenter:n[11]||(n[11]=e=>ve(e)),onFocus:n[12]||(n[12]=e=>ve(e)),onMouseleave:de,onBlur:de},[a.value?(f(),p("svg",tr,[...n[22]||(n[22]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",er,[...n[21]||(n[21]=[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),x("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,Ql)):V("",!0),o.showExpandButton?(f(),p("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":s.value,onClick:me,onMouseenter:n[13]||(n[13]=e=>ce(e,s.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onFocus:n[14]||(n[14]=e=>ce(e,s.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onMouseleave:de,onBlur:de},[s.value?(f(),p("svg",or,[...n[23]||(n[23]=[x("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)])])):(f(),p("svg",lr,[...n[24]||(n[24]=[x("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,nr)):V("",!0),z.value&&o.showPreviewButton?(f(),p("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":y(r)("common.preview")||"Preview",onClick:pe,onMouseenter:n[15]||(n[15]=e=>ce(e,y(r)("common.preview")||"Preview")),onFocus:n[16]||(n[16]=e=>ce(e,y(r)("common.preview")||"Preview")),onMouseleave:de,onBlur:de},[...n[25]||(n[25]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("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"}),x("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,rr)):V("",!0)])],!0)])):V("",!0),$(x("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:A(F.value),onScroll:ae},[x("div",{ref_key:"rendererTarget",ref:v,class:"code-block-render"},null,512),h.value?V("",!0):(f(),p("div",{key:0,class:"code-fallback-plain",innerHTML:m.value},null,8,ir))],36),[[N,!(u.value||!e.stream&&e.loading)]]),$(x("div",ar,[O(t.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[n[26]||(n[26]=x("div",{class:"loading-skeleton"},[x("div",{class:"skeleton-line"}),x("div",{class:"skeleton-line"}),x("div",{class:"skeleton-line short"})],-1))],!0)],512),[[N,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-34bf55f7"]]);sr.install=e=>{e.component(sr.__name,sr)};let ur=null,cr=null,dr=!1;const vr=/* @__PURE__ */new Map,mr=/* @__PURE__ */new Map;let hr=5;const pr=/* @__PURE__ */new Set;function fr(){if(vr.size<hr&&pr.size){const t=Array.from(pr);pr.clear();for(const n of t)try{n()}catch(e){}}}function gr(e){ur=e,cr=null,ur.onmessage=e=>{const{id:t,html:n,error:o}=e.data,l=vr.get(t);if(l)if(vr.delete(t),clearTimeout(l.timeoutId),fr(),o)l.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(mr.set(e,n),mr.size>200){const e=mr.keys().next().value;mr.delete(e)}}l.resolve(n)}},ur.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of vr.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));vr.clear(),fr()}}function wr(){var e;ur&&(null==(e=ur.terminate)||e.call(ur)),ur=null,cr=null}function yr(e){dr=!!e,ur&&ur.postMessage({type:"init",debug:dr})}function xr(e,t=!0,n=2e3,o){return c(this,null,function*(){if(performance.now(),!Tn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(cr)return Promise.reject(cr);const l=`${t?"d":"i"}:${e}`,r=mr.get(l);if(r)return Promise.resolve(r);const i=ur||(cr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),cr.name="WorkerInitError",cr.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(cr);if(vr.size>=hr){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=vr.size,e.max=hr,Promise.reject(e)}return new Promise((l,r)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{vr.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",r(e),fr()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),vr.has(a)&&vr.delete(a);const e=new Error("Aborted");e.name="AbortError",r(e),fr()},{once:!0});const u=l,c=r;vr.set(a,{resolve:e=>{u(e)},reject:e=>{c(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:t})})})}function kr(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(mr.set(o,n),mr.size>200){const e=mr.keys().next().value;mr.delete(e)}}function br(){return{inFlight:vr.size,max:hr}}function Mr(e){Number.isFinite(e)&&e>0&&(hr=Math.floor(e))}const _r="WORKER_BUSY";function Cr(){return vr.size>=hr}function Br(e=2e3,t){return vr.size<hr?Promise.resolve():new Promise((n,o)=>{let l,r=!1;const i=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),pr.delete(i),n())};if(pr.add(i),l=globalThis.setTimeout(()=>{if(r)return;r=!0,pr.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>fr()),t){const e=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),pr.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Tr={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Lr(e){null!=e.timeout&&(Tr.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Tr.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Tr.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Tr.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Sr(){return a({},Tr)}function Ir(e){return c(this,arguments,function*(e,t=!0,n={}){var o,l,r,i;if(!Tn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Tr.timeout,s=null!=(l=n.waitTimeout)?l:Tr.waitTimeout,u=null!=(r=n.backoffMs)?r:Tr.backoffMs,c=null!=(i=n.maxRetries)?i:Tr.maxRetries,d=n.signal;let v=0;for(;;){if(null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield xr(e,t,a,d)}catch(m){if((null==m?void 0:m.code)!==_r||v>=c)throw m;if(v++,yield Br(s,d).catch(()=>{}),null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*v)))}}})}const jr=K(()=>import("./index4.js")),Er=K(()=>import("./index3.js")),$r=K(()=>import("./index2.js")),Hr={AdmonitionNode:El,BlockquoteNode:le,CheckboxNode:ae,CodeBlockNode:jr,DefinitionListNode:de,EmojiNode:me,FootnoteNode:so,FootnoteReferenceNode:be,FootnoteAnchorNode:ro,HardBreakNode:co,HeadingNode:mo,HtmlInlineNode:il,HighlightNode:to,ImageNode:yn,InlineCodeNode:_e,PreCodeNode:dl,InsertNode:Qn,LinkNode:Gn,ListItemNode:ho,ListNode:po,MathBlockNode:Er,MathInlineNode:$r,MermaidBlockNode:rl,ParagraphNode:sl,StrikethroughNode:Kn,StrongNode:Fn,SubscriptNode:Vn,SuperscriptNode:Rn,TableNode:gl,TextNode:En,ThematicBreakNode:yl,ReferenceNode:An,MarkdownCodeBlockNode:sr},Ar={install(e,t){Object.entries(Hr).forEach(([t,n])=>{e.component(t,n)}),(null==t?void 0:t.getLanguageIcon)&&Rl(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&m(t.mathOptions)}};export{_n as $,El as A,le as B,ae as C,de as D,me as E,ro as F,_e as G,co as H,yn as I,Qn as J,Tn as K,Mo as L,Gn as M,ho as N,po as O,sr as P,Cl as Q,Er as R,$r as S,rl as T,sl as U,An as V,_r as W,we as X,fe as Y,sn as Z,oe as _,dn as a,xo as a0,Kn as a1,Fn as a2,Vn as a3,Rn as a4,gl as a5,En as a6,yl as a7,Ar as a8,Rl as a9,gr as aa,wr as ab,yr as ac,xr as ad,br as ae,Mr as af,Cr as ag,Br as ah,Lr as ai,Sr as aj,So as ak,Io as al,jo as am,Eo as an,$o as ao,Ho as ap,Ao as aq,Do as ar,Ro as as,zo as at,Ol as b,dl as c,ln as d,Ir as e,Ln as f,Nl as g,rn as h,kr as i,ye as j,jr as k,Fl as l,Bn as m,Pl as n,bo as o,Cn as p,ko as q,Vl as r,fo as s,so as t,un as u,be as v,ge as w,mo as x,to as y,il as z};
1
+ var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&i(e,n,t[n]);return e},s=(e,o)=>t(e,n(o)),u=(e,t)=>{var n={};for(var i in e)l.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&o)for(var i of o(e))t.indexOf(i)<0&&r.call(e,i)&&(n[i]=e[i]);return n},c=(e,t,n)=>new Promise((o,l)=>{var r=e=>{try{a(n.next(e))}catch(t){l(t)}},i=e=>{try{a(n.throw(e))}catch(t){l(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,i);a((n=n.apply(e,t)).next())});import{getMarkdown as d,parseMarkdownToStructure as v,setDefaultMathOptions as m}from"stream-markdown-parser";import{defineComponent as h,createElementBlock as p,openBlock as f,withMemo as g,createVNode as w,unref as y,createElementVNode as x,Fragment as k,renderList as b,toDisplayString as M,computed as _,ref as C,watch as B,nextTick as T,onBeforeUnmount as L,createBlock as S,Teleport as I,Transition as j,withCtx as $,withDirectives as E,normalizeClass as H,normalizeStyle as A,vShow as N,createApp as D,h as R,inject as z,provide as P,createCommentVNode as V,renderSlot as O,shallowRef as F,readonly as W,defineAsyncComponent as K,resolveDynamicComponent as X,useAttrs as q,mergeProps as Y,isMemoSame as Z,onMounted as U,onUnmounted as G,toHandlers as J,withModifiers as Q,markRaw as ee,reactive as te}from"vue";const ne=["cite"],oe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,l]of t)n[o]=l;return n},le=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(f(),p("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([t.node.children],()=>w(y(Cl),{"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=e=>n.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,ne))}}),[["__scopeId","data-v-eeadc8a3"]]);le.install=e=>{e.component(le.__name,le)};const re={class:"checkbox-node"},ie=["checked"],ae=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",re,[x("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,ie)]))}),[["__scopeId","data-v-8dc6c46f"]]);ae.install=e=>{e.component(ae.__name,ae)};const se={class:"definition-list"},ue={class:"definition-term"},ce={class:"definition-desc"},de=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(e,n)=>(f(),p("dl",se,[(f(!0),p(k,null,b(t.node.items,(o,l)=>(f(),p(k,{key:l},[x("dt",ue,[w(y(Cl),{"index-key":`definition-term-${t.indexKey}-${l}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,onCopy:n[0]||(n[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"])]),x("dd",ce,[w(y(Cl),{"index-key":`definition-desc-${t.indexKey}-${l}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,onCopy:n[1]||(n[1]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);de.install=e=>{e.component(de.__name,de)};const ve={class:"emoji-node"},me=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("span",ve,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);me.install=e=>{e.component(me.__name,me)};const he="__global__",pe={};function fe(e,t){"string"==typeof e?pe[e]=t||{}:pe[he]=e||{}}function ge(e){return e?pe[e]||pe[he]||{}:pe[he]||{}}function we(e){if(e===he)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete pe[e]}function ye(){delete pe[he]}const xe=["id"],ke=["title"],be=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#footnote-${e.node.id}`;function n(){if("undefined"==typeof document)return;const e=document.querySelector(t);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,l)=>(f(),p("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[x("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+M(e.node.id)+"]",9,ke)],8,xe))}}),[["__scopeId","data-v-01af0fee"]]);be.install=e=>{e.component(be.__name,be)};const Me={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-['']"},_e=/* @__PURE__ */h({__name:"InlineCodeNode",props:{node:{}},setup:e=>(t,n)=>(f(),p("code",Me,M(e.node.code),1))});_e.install=e=>{e.component(_e.__name,_e)};const Ce=Math.min,Be=Math.max,Te=Math.round,Le=Math.floor,Se=e=>({x:e,y:e}),Ie={left:"right",right:"left",bottom:"top",top:"bottom"},je={start:"end",end:"start"};function $e(e,t,n){return Be(e,Ce(t,n))}function Ee(e,t){return"function"==typeof e?e(t):e}function He(e){return e.split("-")[0]}function Ae(e){return e.split("-")[1]}function Ne(e){return"x"===e?"y":"x"}function De(e){return"y"===e?"height":"width"}const Re=/* @__PURE__ */new Set(["top","bottom"]);function ze(e){return Re.has(He(e))?"y":"x"}function Pe(e){return Ne(ze(e))}function Ve(e){return e.replace(/start|end/g,e=>je[e])}const Oe=["left","right"],Fe=["right","left"],We=["top","bottom"],Ke=["bottom","top"];function Xe(e){return e.replace(/left|right|bottom|top/g,e=>Ie[e])}function qe(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function Ye(e,t,n){let{reference:o,floating:l}=e;const r=ze(t),i=Pe(t),a=De(i),s=He(t),u="y"===r,c=o.x+o.width/2-l.width/2,d=o.y+o.height/2-l.height/2,v=o[a]/2-l[a]/2;let m;switch(s){case"top":m={x:c,y:o.y-l.height};break;case"bottom":m={x:c,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-l.width,y:d};break;default:m={x:o.x,y:o.y}}switch(Ae(t)){case"start":m[i]-=v*(n&&u?-1:1);break;case"end":m[i]+=v*(n&&u?-1:1)}return m}function Ze(e,t){return c(this,null,function*(){var n;void 0===t&&(t={});const{x:o,y:l,platform:r,rects:i,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:v="floating",altBoundary:m=!1,padding:h=0}=Ee(t,e),p=function(e){return"number"!=typeof e?function(e){return a({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}(h),f=s[m?"floating"===v?"reference":"floating":v],g=qe(yield r.getClippingRect({element:null==(n=yield null==r.isElement?void 0:r.isElement(f))||n?f:f.contextElement||(yield null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),w="floating"===v?{x:o,y:l,width:i.floating.width,height:i.floating.height}:i.reference,y=yield null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating),x=(yield null==r.isElement?void 0:r.isElement(y))&&(yield null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},k=qe(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:u}):w);return{top:(g.top-k.top+p.top)/x.y,bottom:(k.bottom-g.bottom+p.bottom)/x.y,left:(g.left-k.left+p.left)/x.x,right:(k.right-g.right+p.right)/x.x}})}const Ue=/* @__PURE__ */new Set(["left","top"]);function Ge(){return"undefined"!=typeof window}function Je(e){return tt(e)?(e.nodeName||"").toLowerCase():"#document"}function Qe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function et(e){var t;return null==(t=(tt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function tt(e){return!!Ge()&&(e instanceof Node||e instanceof Qe(e).Node)}function nt(e){return!!Ge()&&(e instanceof Element||e instanceof Qe(e).Element)}function ot(e){return!!Ge()&&(e instanceof HTMLElement||e instanceof Qe(e).HTMLElement)}function lt(e){return!(!Ge()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qe(e).ShadowRoot)}const rt=/* @__PURE__ */new Set(["inline","contents"]);function it(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!rt.has(l)}const at=/* @__PURE__ */new Set(["table","td","th"]);function st(e){return at.has(Je(e))}const ut=[":popover-open",":modal"];function ct(e){return ut.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const dt=["transform","translate","scale","rotate","perspective"],vt=["transform","translate","scale","rotate","perspective","filter"],mt=["paint","layout","strict","content"];function ht(e){const t=pt(),n=nt(e)?wt(e):e;return dt.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||vt.some(e=>(n.willChange||"").includes(e))||mt.some(e=>(n.contain||"").includes(e))}function pt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ft=/* @__PURE__ */new Set(["html","body","#document"]);function gt(e){return ft.has(Je(e))}function wt(e){return Qe(e).getComputedStyle(e)}function yt(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if("html"===Je(e))return e;const t=e.assignedSlot||e.parentNode||lt(e)&&e.host||et(e);return lt(t)?t.host:t}function kt(e){const t=xt(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ot(t)&&it(t)?t:kt(t)}function bt(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const l=kt(e),r=l===(null==(o=e.ownerDocument)?void 0:o.body),i=Qe(l);if(r){const e=Mt(i);return t.concat(i,i.visualViewport||[],it(l)?l:[],e&&n?bt(e):[])}return t.concat(l,bt(l,[],n))}function Mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _t(e){const t=wt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=ot(e),r=l?e.offsetWidth:n,i=l?e.offsetHeight:o,a=Te(n)!==r||Te(o)!==i;return a&&(n=r,o=i),{width:n,height:o,$:a}}function Ct(e){return nt(e)?e:e.contextElement}function Bt(e){const t=Ct(e);if(!ot(t))return Se(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:r}=_t(t);let i=(r?Te(n.width):n.width)/o,a=(r?Te(n.height):n.height)/l;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Tt=/* @__PURE__ */Se(0);function Lt(e){const t=Qe(e);return pt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Tt}function St(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),r=Ct(e);let i=Se(1);t&&(o?nt(o)&&(i=Bt(o)):i=Bt(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Qe(e))&&t}(r,n,o)?Lt(r):Se(0);let s=(l.left+a.x)/i.x,u=(l.top+a.y)/i.y,c=l.width/i.x,d=l.height/i.y;if(r){const e=Qe(r),t=o&&nt(o)?Qe(o):o;let n=e,l=Mt(n);for(;l&&o&&t!==n;){const e=Bt(l),t=l.getBoundingClientRect(),o=wt(l),r=t.left+(l.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(l.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,u*=e.y,c*=e.x,d*=e.y,s+=r,u+=i,n=Qe(l),l=Mt(n)}}return qe({width:c,height:d,x:s,y:u})}function It(e,t){const n=yt(e).scrollLeft;return t?t.left+n:St(et(e)).left+n}function jt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-It(e,n),y:n.top+t.scrollTop}}const $t=/* @__PURE__ */new Set(["absolute","fixed"]);function Et(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Qe(e),o=et(e),l=n.visualViewport;let r=o.clientWidth,i=o.clientHeight,a=0,s=0;if(l){r=l.width,i=l.height;const e=pt();(!e||e&&"fixed"===t)&&(a=l.offsetLeft,s=l.offsetTop)}const u=It(o);if(u<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),l="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-l);i<=25&&(r-=i)}else u<=25&&(r+=u);return{width:r,height:i,x:a,y:s}}(e,n);else if("document"===t)o=function(e){const t=et(e),n=yt(e),o=e.ownerDocument.body,l=Be(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Be(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+It(e);const a=-n.scrollTop;return"rtl"===wt(o).direction&&(i+=Be(t.clientWidth,o.clientWidth)-l),{width:l,height:r,x:i,y:a}}(et(e));else if(nt(t))o=function(e,t){const n=St(e,!0,"fixed"===t),o=n.top+e.clientTop,l=n.left+e.clientLeft,r=ot(e)?Bt(e):Se(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:l*r.x,y:o*r.y}}(t,n);else{const n=Lt(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qe(o)}function Ht(e,t){const n=xt(e);return!(n===t||!nt(n)||gt(n))&&("fixed"===wt(n).position||Ht(n,t))}function At(e,t,n){const o=ot(t),l=et(t),r="fixed"===n,i=St(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const s=Se(0);function u(){s.x=It(l)}if(o||!o&&!r)if(("body"!==Je(t)||it(l))&&(a=yt(t)),o){const e=St(t,!0,r,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else l&&u();r&&!o&&l&&u();const c=!l||o||r?Se(0):jt(l,a);return{x:i.left+a.scrollLeft-s.x-c.x,y:i.top+a.scrollTop-s.y-c.y,width:i.width,height:i.height}}function Nt(e){return"static"===wt(e).position}function Dt(e,t){if(!ot(e)||"fixed"===wt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return et(e)===n&&(n=n.ownerDocument.body),n}function Rt(e,t){const n=Qe(e);if(ct(e))return n;if(!ot(e)){let t=xt(e);for(;t&&!gt(t);){if(nt(t)&&!Nt(t))return t;t=xt(t)}return n}let o=Dt(e,t);for(;o&&st(o)&&Nt(o);)o=Dt(o,t);return o&&gt(o)&&Nt(o)&&!ht(o)?n:o||function(e){let t=xt(e);for(;ot(t)&&!gt(t);){if(ht(t))return t;if(ct(t))return null;t=xt(t)}return null}(e)||n}const zt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const r="fixed"===l,i=et(o),a=!!t&&ct(t.floating);if(o===i||a&&r)return n;let s={scrollLeft:0,scrollTop:0},u=Se(1);const c=Se(0),d=ot(o);if((d||!d&&!r)&&(("body"!==Je(o)||it(i))&&(s=yt(o)),ot(o))){const e=St(o);u=Bt(o),c.x=e.x+o.clientLeft,c.y=e.y+o.clientTop}const v=!i||d||r?Se(0):jt(i,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+v.x,y:n.y*u.y-s.scrollTop*u.y+c.y+v.y}},getDocumentElement:et,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const r=[..."clippingAncestors"===n?ct(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=bt(e,[],!1).filter(e=>nt(e)&&"body"!==Je(e)),l=null;const r="fixed"===wt(e).position;let i=r?xt(e):e;for(;nt(i)&&!gt(i);){const t=wt(i),n=ht(i);n||"fixed"!==t.position||(l=null),(r?!n&&!l:!n&&"static"===t.position&&l&&$t.has(l.position)||it(i)&&!n&&Ht(e,i))?o=o.filter(e=>e!==i):l=t,i=xt(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=r[0],a=r.reduce((e,n)=>{const o=Et(t,n,l);return e.top=Be(o.top,e.top),e.right=Ce(o.right,e.right),e.bottom=Ce(o.bottom,e.bottom),e.left=Be(o.left,e.left),e},Et(t,i,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Rt,getElementRects:function(e){return c(this,null,function*(){const t=this.getOffsetParent||Rt,n=this.getDimensions,o=yield n(e.floating);return{reference:At(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=_t(e);return{width:t,height:n}},getScale:Bt,isElement:nt,isRTL:function(e){return"rtl"===wt(e).direction}};function Pt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vt(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,d=Ct(e),v=l||r?[...d?bt(d):[],...bt(t)]:[];v.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)});const m=d&&u?function(e,t){let n,o=null;const l=et(e);function r(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(u,c){void 0===u&&(u=!1),void 0===c&&(c=1),r();const d=e.getBoundingClientRect(),{left:v,top:m,width:h,height:p}=d;if(u||t(),!h||!p)return;const f={rootMargin:-Le(m)+"px "+-Le(l.clientWidth-(v+h))+"px "+-Le(l.clientHeight-(m+p))+"px "+-Le(v)+"px",threshold:Be(0,Ce(1,c))||1};let g=!0;function w(t){const o=t[0].intersectionRatio;if(o!==c){if(!g)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Pt(d,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},f),{root:l.ownerDocument}))}catch(y){o=new IntersectionObserver(w,f)}o.observe(e)}(!0),r}(d,n):null;let h,p=-1,f=null;i&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),d&&!c&&f.observe(d),f.observe(t));let g=c?St(e):null;return c&&function t(){const o=St(e);g&&!Pt(g,o)&&n(),g=o,h=requestAnimationFrame(t)}(),n(),()=>{var e;v.forEach(e=>{l&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(h)}}const Ot=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(t){return c(this,null,function*(){const{x:n,y:o,placement:l}=t,r=Ee(e,t),{mainAxis:i=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=r,v=u(r,["mainAxis","crossAxis","limiter"]),m={x:n,y:o},h=yield Ze(t,v),p=ze(He(l)),f=Ne(p);let g=m[f],w=m[p];if(i){const e="y"===f?"bottom":"right";g=$e(g+h["y"===f?"top":"left"],g,g-h[e])}if(c){const e="y"===p?"bottom":"right";w=$e(w+h["y"===p?"top":"left"],w,w-h[e])}const y=d.fn(s(a({},t),{[f]:g,[p]:w}));return s(a({},y),{data:{x:y.x-n,y:y.y-o,enabled:{[f]:i,[p]:c}}})})}}},Ft=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(t){return c(this,null,function*(){var n,o;const{placement:l,middlewareData:r,rects:i,initialPlacement:a,platform:s,elements:c}=t,d=Ee(e,t),{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0}=d,w=u(d,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=He(l),x=ze(a),k=He(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(c.floating),M=h||(k||!g?[Xe(a)]:function(e){const t=Xe(e);return[Ve(e),t,Ve(t)]}(a)),_="none"!==f;!h&&_&&M.push(...function(e,t,n,o){const l=Ae(e);let r=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Fe:Oe:t?Oe:Fe;case"left":case"right":return t?We:Ke;default:return[]}}(He(e),"start"===n,o);return l&&(r=r.map(e=>e+"-"+l),t&&(r=r.concat(r.map(Ve)))),r}(a,g,f,b));const C=[a,...M],B=yield Ze(t,w),T=[];let L=(null==(o=r.flip)?void 0:o.overflows)||[];if(v&&T.push(B[y]),m){const e=function(e,t,n){void 0===n&&(n=!1);const o=Ae(e),l=Pe(e),r=De(l);let i="x"===l?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Xe(i)),[i,Xe(i)]}(l,i,b);T.push(B[e[0]],B[e[1]])}if(L=[...L,{placement:l,overflows:T}],!T.every(e=>e<=0)){var S,I;const e=((null==(S=r.flip)?void 0:S.index)||0)+1,t=C[e];if(t&&("alignment"!==m||x===ze(t)||L.every(e=>ze(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(I=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(p){case"bestFit":{var j;const e=null==(j=L.filter(e=>{if(_){const t=ze(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:j[0];e&&(n=e);break}case"initialPlacement":n=a}if(l!==n)return{reset:{placement:n}}}return{}})}}},Wt=["id"],Kt=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const t=e,n=_(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=C(null),l=C({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),r=C(!1);let i=null;function u(){return c(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const r=[(d=null!=(e=t.offset)?e:8,void 0===d&&(d=0),{name:"offset",options:d,fn(e){return c(this,null,function*(){var t,n;const{x:o,y:l,placement:r,middlewareData:i}=e,u=yield function(e,t){return c(this,null,function*(){const{placement:n,platform:o,elements:l}=e,r=yield null==o.isRTL?void 0:o.isRTL(l.floating),i=He(n),a=Ae(n),s="y"===ze(n),u=Ue.has(i)?-1:1,c=r&&s?-1:1,d=Ee(t,e);let{mainAxis:v,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(m="end"===a?-1*h:h),s?{x:m*c,y:v*u}:{x:v*u,y:m*c}})}(e,d);return r===(null==(t=i.offset)?void 0:t.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:o+u.x,y:l+u.y,data:s(a({},u),{placement:r})}})}}),Ft(),Ot({padding:8})],{x:i,y:u}=yield((e,t,n)=>{const o=/* @__PURE__ */new Map,l=a({platform:zt},n),r=s(a({},l.platform),{_c:o});return((e,t,n)=>c(null,null,function*(){const{placement:o="bottom",strategy:l="absolute",middleware:r=[],platform:i}=n,u=r.filter(Boolean),c=yield null==i.isRTL?void 0:i.isRTL(t);let d=yield i.getElementRects({reference:e,floating:t,strategy:l}),{x:v,y:m}=Ye(d,o,c),h=o,p={},f=0;for(let n=0;n<u.length;n++){const{name:r,fn:g}=u[n],{x:w,y,data:x,reset:k}=yield g({x:v,y:m,initialPlacement:o,placement:h,strategy:l,middlewareData:p,rects:d,platform:i,elements:{reference:e,floating:t}});v=null!=w?w:v,m=null!=y?y:m,p=s(a({},p),{[r]:a(a({},p[r]),x)}),k&&f<=50&&(f++,"object"==typeof k&&(k.placement&&(h=k.placement),k.rects&&(d=!0===k.rects?yield i.getElementRects({reference:e,floating:t,strategy:l}):k.rects),({x:v,y:m}=Ye(d,h,c))),n=-1)}return{x:v,y:m,placement:h,strategy:l,middlewareData:p}}))(e,t,s(a({},l),{platform:r}))})(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:r,strategy:"fixed"});var d;l.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(u)}px, 0)`,l.value.left="0px",l.value.top="0px"})}return B(()=>t.visible,e=>c(null,null,function*(){if(e)if(r.value=!1,yield T(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield u();const n=l.value.transform;if(null!=t.originX&&null!=t.originY){const o=Math.abs(Number(t.originX)-e.left),i=Math.abs(Number(t.originY)-e.top);Math.hypot(o,i)>120?(l.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield T(),r.value=!0,yield T(),l.value.transform=n):r.value=!0}else r.value=!0;i=Vt(t.anchorEl,o.value,u)}catch(n){yield u(),r.value=!0,i=Vt(t.anchorEl,o.value,u)}else r.value=!0;else r.value=!1,i&&(i(),i=null)})),B([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>c(null,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield T(),yield u())})),L(()=>{i&&i()}),(i,a)=>(f(),S(I,{to:"body"},[w(j,{name:"tooltip",appear:""},{default:$(()=>[E(x("div",{id:t.id,ref_key:"tooltip",ref:o,style:A({position:"fixed",left:l.value.left,top:l.value.top,transform:l.value.transform}),class:H(["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"},M(e.content),15,Wt),[[N,e.visible&&r.value]])]),_:1})]))}}),[["__scopeId","data-v-993f63aa"]]),Xt=C(!1),qt=C(""),Yt=C("top"),Zt=C(null),Ut=C(null),Gt=C(null),Jt=C(null),Qt=C(null);let en=null,tn=null;function nn(){en&&(clearTimeout(en),en=null),tn&&(clearTimeout(tn),tn=null)}let on=!1;function ln(e,t,n="top",o=!1,l,r){if(!e)return;!function(){if(on)return;if("undefined"==typeof document)return;on=!0;const e=document.createElement("div");e.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(e),D({setup:()=>()=>{var e;return R(Kt,{visible:Xt.value,"anchor-el":Zt.value,content:qt.value,placement:Yt.value,id:Ut.value,originX:Gt.value,originY:Jt.value,isDark:null!=(e=Qt.value)?e:void 0})}}).mount(e)}(),nn();const i=()=>{var o,i;Ut.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Zt.value=e,qt.value=t,Yt.value=n,Gt.value=null!=(o=null==l?void 0:l.x)?o:null,Jt.value=null!=(i=null==l?void 0:l.y)?i:null,Qt.value="boolean"==typeof r?r:null,Xt.value=!0;try{e.setAttribute("aria-describedby",Ut.value)}catch(a){}};o?i():en=setTimeout(i,80)}function rn(e=!1){nn();const t=()=>{if(Zt.value&&Ut.value)try{Zt.value.removeAttribute("aria-describedby")}catch(e){}Xt.value=!1,Zt.value=null,Ut.value=null,Gt.value=null,Jt.value=null};e?t():tn=setTimeout(t,120)}const an={"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 sn(e){Object.assign(an,e)}function un(){try{const t=globalThis.$vueI18nUse||null;if(t&&"function"==typeof t)try{const e=t();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return c(null,null,function*(){try{const t=yield import("vue-i18n"),n=t.useI18n||t.default&&t.default.useI18n;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)try{globalThis.$vueI18nUse=()=>t}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var t;return null!=(t=an[e])?t:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const cn=Symbol("ViewportPriority");function dn(){const e=z(cn,void 0);if(e)return e;const t=/* @__PURE__ */new WeakMap;let n=null;return e=>{const o=C(!1);let l,r=!1;const i=new Promise(e=>{l=()=>{r||(r=!0,e())}}),a=()=>{try{null==n||n.unobserve(e)}catch(o){}t.delete(e)},s=n||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(n=new IntersectionObserver(e=>{for(const l of e){const e=t.get(l.target);if(e&&(l.isIntersecting||l.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(l.target),t.delete(l.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.set(e,{resolve:l,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,l(),{isVisible:o,whenVisible:i,destroy:a})}}const vn={class:"relative inline-block"},mn=["src","alt","title","loading","tabindex","aria-label"],hn={class:"text-sm whitespace-nowrap"},pn={key:1,class:"text-sm text-gray-500"},fn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},gn={class:"text-sm whitespace-nowrap"},wn={key:0,class:"mt-2 text-sm text-gray-500 italic"},yn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,l=C(!1),r=C(!1),i=C(!1),a=C(null),s=dn(),u=C(null),c=C("undefined"==typeof window);"undefined"!=typeof window&&B(()=>a.value,e=>{var t;if(null==(t=u.value)||t.destroy(),u.value=null,!e)return void(c.value=!1);const n=s(e,{rootMargin:"400px"});u.value=n,c.value=n.isVisible.value,n.whenVisible.then(()=>{c.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=u.value)||e.destroy(),u.value=null});const d=_(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),v=_(()=>!n.lazy||c.value),m=_(()=>/\.svg(?:\?|$)/i.test(d.value));function h(){n.fallbackSrc&&!i.value?(i.value=!0,r.value=!0):(r.value=!0,o("error",n.node.src))}function g(){l.value=!0,r.value=!1,o("load",d.value)}function k(e){e.preventDefault(),l.value&&!r.value&&o("click",[e,d.value])}const{t:b}=un();return B(d,()=>{l.value=!1,r.value=!1}),(t,o)=>(f(),p("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[x("div",vn,[w(j,{name:"img-switch",mode:"out-in"},{default:$(()=>{var i,a,s,u,c;return[e.node.loading||r.value||!v.value?r.value?e.node.loading||n.fallbackSrc?V("",!0):(f(),p("div",fn,[O(t.$slots,"error",{node:n.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:m.value},()=>[o[1]||(o[1]=x("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[x("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)),x("span",gn,M(y(b)("image.loadError")),1)],!0)])):(f(),p("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:A(m.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[n.usePlaceholder?O(t.$slots,"placeholder",{key:0,node:n.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy,isSvg:m.value},()=>[o[0]||(o[0]=x("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),x("span",hn,M(y(b)("image.loading")),1)],!0):(f(),p("span",pn,M(e.node.raw),1))],4)):(f(),p("img",{key:"image",src:d.value,alt:String(null!=(a=null!=(i=n.node.alt)?i:n.node.title)?a:""),title:String(null!=(u=null!=(s=n.node.title)?s:n.node.alt)?u:""),class:H(["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:A(m.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":null!=(c=n.node.alt)?c:y(b)("image.preview"),onError:h,onLoad:g,onClick:k},null,46,mn))]}),_:3})]),n.showCaption&&n.node.alt?(f(),p("figcaption",wn,M(n.node.alt),1)):V("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);yn.install=e=>{e.component(yn.__name,yn)};let xn=null,kn=!1,bn=Mn;function Mn(){return c(null,null,function*(){const e=yield import("katex");return yield import("katex/contrib/mhchem"),e})}function _n(e){bn=e,xn=null,kn=!1}function Cn(e){_n(null!=e?e:Mn)}function Bn(){_n(null)}function Tn(){return"function"==typeof bn}function Ln(){return c(this,null,function*(){if(xn)return xn;if(kn)return null;const e=bn;if(!e)return kn=!0,null;try{const t=yield e();if(t)return xn=t,xn}catch(t){}return kn=!0,null})}const Sn=F(!1);let In=null;function jn(){return In||(In=Ln().then(e=>{Sn.value=!!e}).catch(()=>{Sn.value=!1})),W(Sn)}const $n=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=jn();return(n,o)=>(f(),p("span",{class:H([[y(t)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);$n.install=e=>{e.component($n.__name,$n)};const En=K(()=>c(null,null,function*(){var e,t;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(t=null==(e=globalThis.process)?void 0:e.env)?void 0:t.NODE_ENV))return e=>{var t,n;return R($n,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))};try{if(yield Ln())return(yield import("./index2.js")).default}catch(n){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".',n)}return e=>{var t,n;return R($n,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$${null!=(t=e.node.content)?t:""}$`})}))}})),Hn=K(()=>c(null,null,function*(){try{if(yield Ln())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n;return R($n,s(a({},e),{node:s(a({},e.node),{content:null!=(n=e.node.raw)?n:`$$${null!=(t=e.node.content)?t:""}$$`})}))}})),An=/* @__PURE__ */h({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(f(),p("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]=n=>t.$emit("click",n,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=n=>t.$emit("mouseEnter",n,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=n=>t.$emit("mouseLeave",n,e.node.id,e.messageId,e.threadId))},M(e.node.id),33))});An.install=e=>{e.component(An.__name,An)};const Nn={class:"superscript-node"},Dn={key:1},Rn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,footnote_reference:be,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,emoji:me,math_inline:En,reference:An},n);return(n,l)=>(f(),p("sup",Nn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),p(k,{key:`${e.indexKey||"superscript"}-${l}`},[o[n.type]?(f(),S(X(o[n.type]),{key:0,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`},null,8,["node","custom-id","index-key"])):(f(),p("span",Dn,M(n.content||n.raw),1))],64))),128))]))}}),[["__scopeId","data-v-9ae5549f"]]);Rn.install=e=>{e.component(Rn.__name,Rn)};const zn={class:"subscript-node"},Pn={key:1},Vn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,footnote_reference:be,strikethrough:Kn,highlight:to,insert:Qn,superscript:Rn,emoji:me,math_inline:En,reference:An},n);return(n,l)=>(f(),p("sub",zn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),p(k,{key:`${e.indexKey||"subscript"}-${l}`},[o[n.type]?(f(),S(X(o[n.type]),{key:0,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`},null,8,["node","custom-id","index-key"])):(f(),p("span",Pn,M(n.content||n.raw),1))],64))),128))]))}}),[["__scopeId","data-v-37438707"]]);Vn.install=e=>{e.component(Vn.__name,Vn)};const On={class:"strong-node"},Fn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,emphasis:oo,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:En,reference:An},n);return(n,l)=>(f(),p("strong",On,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"strong"}-${l}`,"index-key":`${e.indexKey||"strong"}-${l}`,node:n,"custom-id":t.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-3f61dca6"]]);Fn.install=e=>{e.component(Fn.__name,Fn)};const Wn={class:"strikethrough-node"},Kn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:En,reference:An},n);return(n,l)=>(f(),p("del",Wn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"strikethrough"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8236f64d"]]);Kn.install=e=>{e.component(Kn.__name,Kn)};const Xn=["href","title","aria-label","aria-hidden"],qn=["aria-hidden"],Yn={class:"link-text-wrapper relative inline-flex"},Zn={class:"leading-[normal] link-text"},Un={class:"leading-[normal] link-text"},Gn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=_(()=>{var e,n,o,l,r,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px";return{"--link-color":null!=(e=t.color)?e:"#0366d6","--underline-height":`${null!=(n=t.underlineHeight)?n:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=t.animationOpacity)?o:.9),"--underline-duration":`${null!=(l=t.animationDuration)?l:.8}s`,"--underline-timing":null!=(r=t.animationTiming)?r:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),o={text:$n,strong:Fn,strikethrough:Kn,emphasis:oo,image:yn},l=q();function r(){t.showTooltip&&rn()}const i=_(()=>{var e,n;return String(null!=(n=null!=(e=t.node.title)?e:t.node.href)?n:"")});return(a,s)=>e.node.loading?(f(),p("span",Y({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:n.value}),[x("span",Yn,[x("span",Zn,[x("span",Un,M(e.node.text),1)]),s[1]||(s[1]=x("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,qn)):(f(),p("a",Y({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":i.value,"aria-label":`Link: ${i.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},y(l),{style:n.value,onMouseenter:s[0]||(s[0]=e=>function(e){var n,o,l;if(!t.showTooltip)return;const r=e,i=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0,a=(null==(n=t.node)?void 0:n.title)||(null==(o=t.node)?void 0:o.href)||(null==(l=t.node)?void 0:l.text)||"";ln(e.currentTarget,a,"top",!1,i)}(e)),onMouseleave:r}),[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,Xn))}}),[["__scopeId","data-v-80b69735"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Jn={class:"insert-node"},Qn=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,strikethrough:Kn,highlight:to,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:En,reference:An},n);return(n,l)=>(f(),p("ins",Jn,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"insert"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-0b4b6459"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const eo={class:"highlight-node"},to=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,strong:Fn,emphasis:oo,strikethrough:Kn,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:En,reference:An},n);return(n,l)=>(f(),p("mark",eo,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"highlight"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-fbe5e4f2"]]);to.install=e=>{e.component(to.__name,to)};const no={class:"emphasis-node"},oo=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,strong:Fn,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,footnote_reference:be,math_inline:En,reference:An},n);return(n,l)=>(f(),p("em",no,[(f(!0),p(k,null,b(e.node.children,(n,l)=>(f(),S(X(o[n.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8723e015"]]);oo.install=e=>{e.component(oo.__name,oo)};const lo=["href","title"],ro=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})}return(t,o)=>(f(),p("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,lo))}}),[["__scopeId","data-v-4756ce0d"]]);ro.install=e=>{e.component(ro.__name,ro)};const io=["id"],ao={class:"flex-1"},so=/* @__PURE__ */h({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(f(),p("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[x("div",ao,[g([t.node.children],()=>w(y(Cl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=e=>n.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,io))}});so.install=e=>{e.component(so.__name,so)};const uo={class:"hard-break"},co=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,t)=>(f(),p("br",uo))}),[["__scopeId","data-v-50c58f70"]]);co.install=e=>{e.component(co.__name,co)};const vo=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({text:$n,inline_code:_e,link:Gn,image:yn,strong:Fn,emphasis:oo,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,checkbox:ae,checkbox_input:ae,footnote_reference:be,hardbreak:co,math_inline:En,reference:An},n);return(n,l)=>g([e.node.children],()=>(f(),S(X(`h${e.node.level}`),{class:H(["heading-node",[`heading-${e.node.level}`]]),dir:"auto"},{default:$(()=>[(f(!0),p(k,null,b(e.node.children,(n,l,r,i)=>{const a=[n];if(i&&i.key===`${e.indexKey||"heading"}-${l}`&&Z(i,a))return i;const s=(f(),S(X(o[n.type]),{key:`${e.indexKey||"heading"}-${l}`,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||"heading"}-${l}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},l,0),128))]),_:1},8,["class"])),l,2)}}),[["__scopeId","data-v-e3e7e2ce"]]),mo=vo;mo.install=e=>{e.component(vo.__name,vo)};const ho=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=_(()=>null==t.value?{}:{value:t.value});return(e,o)=>(f(),p("li",Y({class:"list-item pl-1.5 my-2",dir:"auto"},n.value),[g([t.item.children],()=>w(y(Cl),{"index-key":`list-item-${t.indexKey}`,nodes:t.item.children,"custom-id":t.customId,typewriter:t.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=t=>e.$emit("copy",t))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],16))}}),[["__scopeId","data-v-7a618746"]]);ho.install=e=>{e.component(ho.__name,ho)};const po=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(t,n)=>(f(),S(X(e.node.ordered?"ol":"ul"),{class:H(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:$(()=>[(f(!0),p(k,null,b(e.node.items,(o,l,r,i)=>{var a;const s=[o];if(i&&i.key===`${e.indexKey||"list"}-${l}`&&Z(i,s))return i;const u=(f(),S(y(ho),{key:`${e.indexKey||"list"}-${l}`,item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(a=e.node.start)?a:1)+l:void 0,onCopy:n[0]||(n[0]=e=>t.$emit("copy",e))},null,8,["item","custom-id","index-key","typewriter","value"]));return u.memo=s,u},n,1),128))]),_:1},8,["class"]))}),[["__scopeId","data-v-79057d57"]]);function fo(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}po.install=e=>{e.component(po.__name,po)};const go=()=>import("mermaid");let wo=null,yo=go;function xo(e){yo=e,wo=null}function ko(e){xo(null!=e?e:go)}function bo(){xo(null)}function Mo(){return"function"==typeof yo}let _o=null,Co=null;const Bo=/* @__PURE__ */new Map;let To=5,Lo=!1;function So(e){Lo=!!e}function Io(e){Number.isFinite(e)&&e>0&&(To=Math.floor(e))}function jo(){return{inFlight:Bo.size,max:To}}const $o="WORKER_BUSY",Eo="MERMAID_DISABLED";function Ho(e){_o=e,Co=null;const t=e;_o.onmessage=e=>{if(_o!==t)return;const{id:n,ok:o,result:l,error:r}=e.data,i=Bo.get(n);i&&(!1===o||r?i.reject(new Error(r||"Unknown error")):i.resolve(l))},_o.onerror=e=>{var n,o;if(_o===t)if(0!==Bo.size){try{Lo?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(l){}for(const[t,n]of Bo.entries())n.reject(new Error(`Worker error: ${e.message}`));Bo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},_o.onmessageerror=e=>{var n,o;if(_o===t)if(0!==Bo.size){try{Lo?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(l){}for(const[e,t]of Bo.entries())t.reject(new Error("Worker messageerror"));Bo.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Ao(){var e;if(_o)try{for(const[e,t]of Bo.entries())t.reject(new Error("Worker cleared"));Bo.clear(),null==(e=_o.terminate)||e.call(_o)}catch(t){}_o=null,Co=null}function No(e,t,n=1400){if(!Mo()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Eo,Promise.reject(e)}if(Co)return Promise.reject(Co);const o=_o||(Co=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Co.name="WorkerInitError",Co.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Co);if(Bo.size>=To){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=$o,e.inFlight=Bo.size,e.max=To,Promise.reject(e)}return new Promise((l,r)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Bo.delete(i))},c={resolve:e=>{u(),l(e)},reject:e=>{u(),r(e)}};Bo.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Bo.delete(i),void r(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Bo.get(i);t&&t.reject(e)},n)})}function Do(e,t,n=1400){return c(this,null,function*(){try{return yield No("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function Ro(e,t,n=1400){return c(this,null,function*(){try{return yield No("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function zo(){if(_o)try{for(const[e,t]of Bo.entries())t.reject(new Error("Worker terminated"));Bo.clear(),_o.terminate()}finally{_o=null}}const Po={key:0},Vo={key:1,class:"flex items-center space-x-2 overflow-hidden"},Oo=["src"],Fo={key:2},Wo={class:"flex items-center space-x-1"},Ko={class:"flex items-center space-x-1"},Xo={key:4},qo={key:5,class:"flex items-center space-x-1"},Yo=["aria-pressed"],Zo={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"},Uo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Go=["disabled"],Jo=["disabled"],Qo={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"},el={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"},tl={key:1,class:"relative"},nl={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},ol={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ll={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},rl=/* @__PURE__ */oe(/* @__PURE__ */h({__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(e,{emit:t}){var n,o;const l=e,r=t,i={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},u=C(!1),d=_(()=>l.isStrict?"strict":"loose"),v=_(()=>({startOnLoad:!1,securityLevel:d.value,dompurifyConfig:"strict"===d.value?i:void 0,flowchart:"strict"===d.value?{htmlLabels:!1}:void 0})),m=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],h=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return h.test(t)?t:""}function k(e){if(e)try{e.replaceChildren()}catch(t){e.innerHTML=""}}function b(e,t){if(!e)return"";if("strict"===d.value)return function(e,t){if(!e)return"";try{e.replaceChildren()}catch(o){e.innerHTML=""}const n=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const t=e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const o=n;return function(e){const t=/* @__PURE__ */new Set(["script"]),n=[e,...Array.from(e.querySelectorAll("*"))];for(const o of n){if(t.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const t of e){const e=t.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&t.value){const n=t.value;if(m.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=g(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}(o),o}(t);return n?(e.appendChild(n),e.innerHTML):""}(e,t);try{e.replaceChildren()}catch(n){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(n){e.innerHTML=t}return e.innerHTML}const{t:D}=un();function R(){return c(this,null,function*(){try{const e=yield function(){return c(this,null,function*(){if(wo)return wo;const e=yo;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===go)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw n}return t?(wo=function(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&("function"==typeof t.render||"function"==typeof t.parse||"function"==typeof t.initialize))return t;if(t&&t.mermaidAPI&&("function"==typeof t.mermaidAPI.render||"function"==typeof t.mermaidAPI.parse)){const e=t.mermaidAPI;return s(a({},t),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>"function"==typeof t.initialize?t.initialize(n):e.initialize?e.initialize(n):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:t}(t),function(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=a({suppressErrorRendering:!0},n||{});return"function"==typeof t?t.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(t){}}(wo),wo):null})}();return u.value=!!e,e}catch(e){throw u.value=!1,e}})}"undefined"!=typeof window&&c(null,null,function*(){var e;try{const t=yield R();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,a({},v.value))}catch(t){u.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}});const z=C(!1),P=C(!1),F=C(),W=C(),K=C(),X=C(null),q=dn(),Z=C(null),ee=C("undefined"==typeof window),te=C(),ne=_(()=>l.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),oe=C(1),le=C(0),re=C(0),ie=C(!1),ae=C({x:0,y:0}),se=C(!1),ue=C(!1),ce=C(!1),de=C(null),ve=C(0),me=C(!1);let he=null,pe=null,fe=0;const ge=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16),we=function(){let e=null;return(...t)=>{e&&clearTimeout(e),e=setTimeout(()=>(()=>{ge(()=>{gt()},{timeout:500})})(...t),300)}}();function ye(){null!=pe&&(globalThis.clearTimeout(pe),pe=null)}function xe(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);ye(),pe=globalThis.setTimeout(()=>{pe=null,l.loading||ce.value||!ee.value?xe(Math.min(1200,Math.max(300,1.2*t))):we()},t)}const ke=C("360px");let be=null;const Me=C(!1),_e=C(!1),Ce=C({}),Be=C(null),Te=C(""),Le=C(0);let Se=null;const Ie=C(!1),je=C({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),$e=_(()=>l.enableWheelZoom?{wheel:ct}:{}),Ee=_(()=>{var e,t,n,o;return{worker:null!=(e=l.workerTimeoutMs)?e:1400,parse:null!=(t=l.parseTimeoutMs)?t:1800,render:null!=(n=l.renderTimeoutMs)?n:2500,fullRender:null!=(o=l.fullRenderTimeoutMs)?o:4e3}}),He=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ae=null,Ne=null,De=!1,Re=800,ze=null,Pe=0,Ve=!0;function Oe(e,t){const n=null==t?void 0:t.timeoutMs,o=null==t?void 0:t.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let l=null,r=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=l&&clearTimeout(l),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(l=globalThis.setTimeout(()=>{r||(r=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{r||(r=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{r||(r=!0,s(),t(e))}).catch(e=>{r||(r=!0,s(),a(e))})})}function Fe(e){if("undefined"==typeof document)return;if(!W.value)return;const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),k(W.value),W.value.appendChild(t),ke.value="360px",Ie.value=!0,wt()}function We(e){return!e||e.disabled}function Ke(e,t,n="top"){if(We(e.currentTarget))return;const o=e,r=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;ln(e.currentTarget,t,n,!1,r,l.isDark)}function Xe(){rn()}function qe(e){if(We(e.currentTarget))return;const t=z.value?D("common.copied")||"Copied":D("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;ln(e.currentTarget,t,"top",!1,o,l.isDark)}function Ye(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ze(){return Ve&&!se.value&&!Me.value&&!Ie.value}function Ue(e){const t=e.split(/\r?\n/);for(;t.length>0;){const e=t[t.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join("\n")}function Ge(e,t,n){return c(this,null,function*(){var o;try{return yield Do(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Ee.value.worker)}catch(l){return yield function(e,t,n){return c(this,null,function*(){var o,l;const r=yield R();if(!r)return;const i=r,a=Ye(e,t);if("function"==typeof i.parse)return yield Oe(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:Ee.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Oe(()=>r.render(s,a),{timeoutMs:null!=(l=null==n?void 0:n.timeoutMs)?l:Ee.value.render,signal:null==n?void 0:n.signal}),!0})}(e,t,n)}})}"undefined"!=typeof window&&B(()=>F.value,e=>{var t;if(null==(t=Z.value)||t.destroy(),Z.value=null,!e)return void(ee.value=!1);const n=q(e,{rootMargin:"400px"});Z.value=n,ee.value=n.isVisible.value,n.whenVisible.then(()=>{ee.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=Z.value)||e.destroy(),Z.value=null});const Je=_(()=>se.value||ce.value||P.value);function Qe(e){if(!F.value||!W.value)return;const t=W.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),r=t.getAttribute("width"),i=t.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||r&&i&&(n=Number.parseFloat(r),o=Number.parseFloat(i)),Number.isNaN(n)||Number.isNaN(o)||n<=0||o<=0)try{const e=t.getBBox();e&&e.width>0&&e.height>0&&(n=e.width,o=e.height)}catch(a){return void console.error("Failed to get SVG BBox:",a)}if(n>0&&o>0){const t=o/n;let l=(null!=e?e:F.value.clientWidth)*t;l>o&&(l=o),ke.value=`${l}px`}}const et=C(!1),tt=_(()=>({transform:`translate(${le.value}px, ${re.value}px) scale(${oe.value})`}));function nt(e){"Escape"===e.key&&et.value&&ot()}function ot(){if(et.value=!1,K.value&&k(K.value),X.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",nt)}catch(e){}}function lt(){oe.value<3&&(oe.value+=.1)}function rt(){oe.value>.5&&(oe.value-=.1)}function it(){oe.value=1,le.value=0,re.value=0}function at(e){ie.value=!0,e instanceof MouseEvent?ae.value={x:e.clientX-le.value,y:e.clientY-re.value}:ae.value={x:e.touches[0].clientX-le.value,y:e.touches[0].clientY-re.value}}function st(e){if(!ie.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),le.value=t-ae.value.x,re.value=n-ae.value.y}function ut(){ie.value=!1}function ct(e){if(l.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!F.value)return;const t=F.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,l=n-t.width/2,r=o-t.height/2,i=(l-le.value)/oe.value,a=(r-re.value)/oe.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(oe.value+u,.5),3);c!==oe.value&&(le.value=l-i*c,re.value=r-a*c,oe.value=c)}}function dt(){return c(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(ne.value)),z.value=!0,r("copy",ne.value),setTimeout(()=>{z.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})}function vt(){var e;const t=null==(e=W.value)?void 0:e.querySelector("svg");if(!t)return void console.error("SVG element not found");const n=(new XMLSerializer).serializeToString(t),o={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:t,svgString:n};r("export",o),o.defaultPrevented||function(e,t=null){c(this,null,function*(){try{const o=null!=t?t:(new XMLSerializer).serializeToString(e),l=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(l);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(n){}URL.revokeObjectURL(r)}}catch(o){console.error("Failed to export SVG:",o)}})}(t,n)}function mt(){var e,t;const n=null!=(t=null==(e=W.value)?void 0:e.querySelector("svg"))?t:null,o=n?(new XMLSerializer).serializeToString(n):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};r("openModal",l),l.defaultPrevented||function(){if(et.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",nt)}catch(e){}T(()=>{if(F.value&&K.value){const e=F.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(X.value=t,t.style.transform=tt.value.transform),k(K.value),K.value.appendChild(e)}})}()}function ht(e){const t={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};r("toggleMode",e,t),t.defaultPrevented||pt(e)}function pt(e){return c(this,null,function*(){const t=te.value;if(!t)return ue.value=!0,void(se.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",ue.value=!0,se.value="source"===e,yield T();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const l=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",r)};function r(){l()}t.addEventListener("transitionend",r),setTimeout(()=>l(),220)})}function ft(){return c(this,null,function*(){return ce.value?de.value:W.value||(yield T(),W.value)?(ce.value=!0,de.value=c(null,null,function*(){var e;W.value&&(W.value.style.opacity="0");try{const t=yield R();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;Me.value||_e.value||null==(e=t.initialize)||e.call(t,s(a({},v.value),{dompurifyConfig:a({},i)}));const o=function(e,t=ne.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}(l.isDark?"dark":"light"),r=yield Oe(()=>t.render(n,o),{timeoutMs:Ee.value.fullRender}),u=null==r?void 0:r.svg;if(W.value){const e=b(W.value,u);Me.value||_e.value||(Qe(),Me.value=!0,je.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:ke.value});const t=l.isDark?"dark":"light";e&&(Ce.value[t]=e),_e.value&&(_e.value=!1),Ie.value=!1,fe=0,ye()}}catch(t){const e=function(e){const t="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof t&&/timed out/i.test(t)}(t),n=fe+1;e&&n<=3?(fe=n,xe(Math.min(1200,600*n))):(fe=0,ye(),console.error("Failed to render mermaid diagram:",t),!1===l.loading&&Fe(t))}finally{yield T(),W.value&&(W.value.style.opacity="1"),ce.value=!1,de.value=null}}),de.value):void console.warn("Mermaid container not ready")})}function gt(){return c(this,null,function*(){var e,t;const n=Date.now(),o=++Le.value;Se&&Se.abort(),Se=new AbortController;const r=Se.signal,i=l.isDark?"dark":"light",a=ne.value,s=a.replace(/\s+/g,"");if(!a.trim())return W.value&&k(W.value),Be.value=null,Te.value="",void(Ie.value=!1);if(s===Te.value)return;try{const u=yield function(e,t,n){return c(this,null,function*(){var o;try{if(yield Ge(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}let l=Ue(e);if(l&&l.trim()&&l!==e)try{try{const r=yield Ro(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Ee.value.worker);r&&r.trim()&&(l=r)}catch(r){}if(yield Ge(l,t,n))return{fullOk:!1,prefixOk:!0,prefix:l}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}return{fullOk:!1,prefixOk:!1}})}(a,i,{signal:r,timeoutMs:Ee.value.worker});if(u.fullOk)return yield ft(),void(Le.value===o&&(Be.value=null!=(t=null==(e=W.value)?void 0:e.innerHTML)?t:null,Te.value=s,Ie.value=!1));const d=Pe&&n<=Pe;if(u.prefixOk&&u.prefix&&Ze()&&!d)return void(yield function(e){return c(this,null,function*(){if(Ze()&&(W.value||(yield T(),W.value))&&!ce.value){ce.value=!0;try{const t=yield R();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=l.isDark?"dark":"light",r=Ue(e),i=Ye(r&&r.trim()?r:e,o);W.value&&(W.value.style.opacity="0");const a=yield Oe(()=>t.render(n,i),{timeoutMs:Ee.value.render}),s=null==a?void 0:a.svg;W.value&&s&&(b(W.value,s),Qe())}catch(t){}finally{yield T(),W.value&&(W.value.style.opacity="1"),ce.value=!1}}})}(u.prefix))}catch(d){if("AbortError"===(null==d?void 0:d.name))return}if(Le.value!==o)return;if(Ie.value)return;const u=Ce.value[i];u&&W.value&&b(W.value,u)})}function wt(){De&&(De=!1,Re=800,Ve=!1,ze&&(ze.abort(),ze=null),Ae&&(globalThis.clearTimeout(Ae),Ae=null),Ne&&(He(Ne),Ne=null),Pe=Date.now())}function yt(){if(wt(),Se){try{Se.abort()}catch(e){}Se=null}if(ze){try{ze.abort()}catch(e){}ze=null}zo(),ye(),fe=0}function xt(e=800){De&&(Ae&&globalThis.clearTimeout(Ae),Ae=globalThis.setTimeout(()=>{Ne=ge(()=>c(null,null,function*(){if(!De)return;if(se.value||Me.value)return void wt();const e=l.isDark?"dark":"light",t=ne.value;if(t.trim()){ze&&ze.abort(),ze=new AbortController;try{if((yield Ge(t,e,{signal:ze.signal,timeoutMs:Ee.value.worker}))&&(yield ft(),Me.value))return void wt()}catch(n){}Re=Math.min(Math.floor(1.5*Re),4e3),xt(Re)}else xt(Re)}),{timeout:500})},e))}function kt(){De||se.value||Me.value||(De=!0,Pe=0,Ve=!0,xt(500))}B(tt,e=>{et.value&&X.value&&(X.value.style.transform=e.transform)},{immediate:!0}),B(()=>ne.value,()=>{Me.value=!1,Ce.value={},we(),!se.value&&u.value&&kt(),function(){if(!se.value)return;if(!u.value)return;const e=ne.value.length;e!==ve.value&&(me.value=!0,ve.value=e,he&&clearTimeout(he),he=setTimeout(()=>{me.value&&se.value&&ne.value.trim()&&(me.value=!1,pt("preview"))},500))}()}),B(()=>l.isDark,()=>c(null,null,function*(){if(!Me.value)return;if(Ie.value)return;const e=l.isDark?"dark":"light",t=Ce.value[e];if(t)return void(W.value&&b(W.value,t));const n={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:ke.value},o=1!==oe.value||0!==le.value||0!==re.value;_e.value=!0,o&&(oe.value=1,le.value=0,re.value=0,yield T()),yield ft(),o&&(yield T(),oe.value=n.zoom,le.value=n.translateX,re.value=n.translateY,ke.value=n.containerHeight,je.value=n)})),B(()=>se.value,e=>c(null,null,function*(){if(e)wt(),Me.value&&(je.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:ke.value});else{if(Ie.value)return;const e=l.isDark?"dark":"light";if(Me.value&&Ce.value[e])return yield T(),W.value&&b(W.value,Ce.value[e]),oe.value=je.value.zoom,le.value=je.value.translateX,re.value=je.value.translateY,void(ke.value=je.value.containerHeight);if(yield T(),!u.value)return;yield gt(),kt()}})),B(()=>l.loading,(e,t)=>c(null,null,function*(){if(!0===t&&!1===e){const e=ne.value.trim();if(!e)return yt();const t=l.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(Me.value&&o===Te.value)return yield T(),W.value&&!W.value.querySelector("svg")&&Ce.value[t]&&b(W.value,Ce.value[t]),void yt();try{yield Ge(e,t,{timeoutMs:Ee.value.worker}),yield ft(),Te.value=o,Ie.value=!1,yt()}catch(n){yt(),Fe(n)}}})),B(F,e=>{be&&be.disconnect(),!e||Me.value||_e.value||(be=new ResizeObserver(e=>{e&&e.length>0&&!Me.value&&!_e.value&&fo(()=>{Qe(e[0].contentRect.width)})}),be.observe(e))},{immediate:!0}),U(()=>c(null,null,function*(){yield T(),ue.value||(se.value=!u.value),ee.value&&(we(),ve.value=ne.value.length)})),B(()=>u.value,e=>{ue.value||(se.value=!e)}),B(()=>ee.value,e=>{e&&(Me.value||(we(),ve.value=ne.value.length),l.loading||Me.value||we())},{immediate:!1}),G(()=>{he&&clearTimeout(he),be&&be.disconnect(),Se&&(Se.abort(),Se=null),zo(),wt(),ye()}),B(()=>P.value,e=>c(null,null,function*(){e?(wt(),Se&&Se.abort()):Me.value||(yield T(),we(),se.value||kt())}),{immediate:!1});const bt=_(()=>l.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(e,t)=>(f(),p("div",{class:H(["my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":l.loading}]])},[l.showHeader?(f(),p("div",{key:0,class:H(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",l.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[e.$slots["header-left"]?(f(),p("div",Po,[O(e.$slots,"header-left",{},void 0,!0)])):(f(),p("div",Vo,[x("img",{src:y("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"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,Oo),x("span",{class:H(["text-sm font-medium font-mono truncate",l.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),e.$slots["header-center"]?(f(),p("div",Fo,[O(e.$slots,"header-center",{},void 0,!0)])):l.showModeToggle&&u.value?(f(),p("div",{key:3,class:H(["flex items-center space-x-1 rounded-md p-0.5",l.isDark?"bg-gray-700":"bg-gray-100"])},[x("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:t[0]||(t[0]=()=>ht("preview")),onMouseenter:t[1]||(t[1]=e=>Ke(e,y(D)("common.preview")||"Preview")),onFocus:t[2]||(t[2]=e=>Ke(e,y(D)("common.preview")||"Preview")),onMouseleave:Xe,onBlur:Xe},[x("div",Wo,[t[21]||(t[21]=x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("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"}),x("circle",{cx:"12",cy:"12",r:"3"})])],-1)),x("span",null,M(y(D)("common.preview")||"Preview"),1)])],34),x("button",{class:H(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:t[3]||(t[3]=()=>ht("source")),onMouseenter:t[4]||(t[4]=e=>Ke(e,y(D)("common.source")||"Source")),onFocus:t[5]||(t[5]=e=>Ke(e,y(D)("common.source")||"Source")),onMouseleave:Xe,onBlur:Xe},[x("div",Ko,[t[22]||(t[22]=x("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"},[x("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)),x("span",null,M(y(D)("common.source")||"Source"),1)])],34)],2)):V("",!0),e.$slots["header-right"]?(f(),p("div",Xo,[O(e.$slots,"header-right",{},void 0,!0)])):(f(),p("div",qo,[l.showCollapseButton?(f(),p("button",{key:0,class:H(bt.value),"aria-pressed":P.value,onClick:t[6]||(t[6]=e=>P.value=!P.value),onMouseenter:t[7]||(t[7]=e=>Ke(e,P.value?y(D)("common.expand")||"Expand":y(D)("common.collapse")||"Collapse")),onFocus:t[8]||(t[8]=e=>Ke(e,P.value?y(D)("common.expand")||"Expand":y(D)("common.collapse")||"Collapse")),onMouseleave:Xe,onBlur:Xe},[(f(),p("svg",{style:A({rotate:P.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"},[...t[23]||(t[23]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,Yo)):V("",!0),l.showCopyButton?(f(),p("button",{key:1,class:H(bt.value),onClick:dt,onMouseenter:t[9]||(t[9]=e=>qe(e)),onFocus:t[10]||(t[10]=e=>qe(e)),onMouseleave:Xe,onBlur:Xe},[z.value?(f(),p("svg",Uo,[...t[25]||(t[25]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",Zo,[...t[24]||(t[24]=[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),x("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)):V("",!0),l.showExportButton&&u.value?(f(),p("button",{key:2,class:H(`${bt.value} ${Je.value?"opacity-50 cursor-not-allowed":""}`),disabled:Je.value,onClick:vt,onMouseenter:t[11]||(t[11]=e=>Ke(e,y(D)("common.export")||"Export")),onFocus:t[12]||(t[12]=e=>Ke(e,y(D)("common.export")||"Export")),onMouseleave:Xe,onBlur:Xe},[...t[26]||(t[26]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),x("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,Go)):V("",!0),l.showFullscreenButton&&u.value?(f(),p("button",{key:3,class:H(`${bt.value} ${Je.value?"opacity-50 cursor-not-allowed":""}`),disabled:Je.value,onClick:mt,onMouseenter:t[13]||(t[13]=e=>Ke(e,et.value?y(D)("common.minimize")||"Minimize":y(D)("common.open")||"Open")),onFocus:t[14]||(t[14]=e=>Ke(e,et.value?y(D)("common.minimize")||"Minimize":y(D)("common.open")||"Open")),onMouseleave:Xe,onBlur:Xe},[et.value?(f(),p("svg",el,[...t[28]||(t[28]=[x("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)])])):(f(),p("svg",Qo,[...t[27]||(t[27]=[x("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,Jo)):V("",!0)]))],2)):V("",!0),E(x("div",{ref_key:"modeContainerRef",ref:te},[se.value?(f(),p("div",{key:0,class:H(["p-4",l.isDark?"bg-gray-900":"bg-gray-50"])},[x("pre",{class:H(["text-sm font-mono whitespace-pre-wrap",l.isDark?"text-gray-300":"text-gray-700"])},M(ne.value),3)],2)):(f(),p("div",tl,[l.showZoomControls?(f(),p("div",nl,[x("div",ol,[x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:lt,onMouseenter:t[15]||(t[15]=e=>Ke(e,y(D)("common.zoomIn")||"Zoom in")),onFocus:t[16]||(t[16]=e=>Ke(e,y(D)("common.zoomIn")||"Zoom in")),onMouseleave:Xe,onBlur:Xe},[...t[29]||(t[29]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:rt,onMouseenter:t[17]||(t[17]=e=>Ke(e,y(D)("common.zoomOut")||"Zoom out")),onFocus:t[18]||(t[18]=e=>Ke(e,y(D)("common.zoomOut")||"Zoom out")),onMouseleave:Xe,onBlur:Xe},[...t[30]||(t[30]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:it,onMouseenter:t[19]||(t[19]=e=>Ke(e,y(D)("common.resetZoom")||"Reset zoom")),onFocus:t[20]||(t[20]=e=>Ke(e,y(D)("common.resetZoom")||"Reset zoom")),onMouseleave:Xe,onBlur:Xe},M(Math.round(100*oe.value))+"% ",35)])])):V("",!0),x("div",Y({ref_key:"mermaidContainer",ref:F,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",l.isDark?"bg-gray-900":"bg-gray-50"],style:{height:ke.value}},J($e.value,!0),{onMousedown:at,onMousemove:st,onMouseup:ut,onMouseleave:ut,onTouchstartPassive:at,onTouchmovePassive:st,onTouchendPassive:ut}),[x("div",{"data-mermaid-wrapper":"",class:H(["absolute inset-0 cursor-grab",{"cursor-grabbing":ie.value}]),style:A(tt.value)},[x("div",{ref_key:"mermaidContent",ref:W,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(f(),S(I,{to:"body"},[w(j,{name:"mermaid-dialog",appear:""},{default:$(()=>[et.value?(f(),p("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:Q(ot,["self"])},[x("div",{class:H(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",l.isDark?"bg-gray-900":"bg-white"])},[x("div",ll,[x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:lt},[...t[31]||(t[31]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:rt},[...t[32]||(t[32]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("circle",{cx:"11",cy:"11",r:"8"}),x("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),x("button",{class:H(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:it},M(Math.round(100*oe.value))+"% ",3),x("button",{class:H(["inline-flex items-center justify-center p-2 rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ot},[...t[33]||(t[33]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),x("div",Y({ref_key:"modalContent",ref:K,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},J($e.value,!0),{onMousedown:at,onMousemove:st,onMouseup:ut,onMouseleave:ut,onTouchstartPassive:at,onTouchmovePassive:st,onTouchendPassive:ut}),null,16)],2)])):V("",!0)]),_:1})]))]))],512),[[N,!P.value]])],2))}}),[["__scopeId","data-v-3636e700"]]);rl.install=e=>{e.component(rl.__name,rl)};const il=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HtmlInlineNode",props:{node:{}},setup(e){const t=e,n=C(null),o="undefined"!=typeof window;function l(){if(!o||!n.value)return;const e=n.value;e.innerHTML="";const l=document.createElement("template");l.innerHTML=t.node.content,e.appendChild(l.content.cloneNode(!0))}function r(){if(!n.value)return;const e=n.value;e.innerHTML="",e.textContent=t.node.content}return U(()=>{t.node.loading&&!t.node.autoClosed?r():l()}),B(()=>[t.node.content,t.node.loading,t.node.autoClosed],()=>{t.node.loading&&!t.node.autoClosed?r():l()}),L(()=>{n.value&&(n.value.innerHTML="")}),(e,o)=>(f(),p("span",{ref_key:"containerRef",ref:n,class:H(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},null,2))}}),[["__scopeId","data-v-e632756e"]]);il.install=e=>{e.component(il.__name,il)};const al={dir:"auto",class:"paragraph-node"},sl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ge(t.customId),o=a({inline_code:_e,image:yn,link:Gn,hardbreak:co,emphasis:oo,strong:Fn,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,html_inline:il,emoji:me,checkbox:ae,math_inline:En,checkbox_input:ae,reference:An,footnote_anchor:ro,footnote_reference:be},n),l=jn();return(n,r)=>(f(),p("p",al,[(f(!0),p(k,null,b(e.node.children,(n,r)=>(f(),p(k,{key:`${e.indexKey||"paragraph"}-${r}`},["text"!==n.type?(f(),S(X(o[n.type]),{key:0,node:n,"index-key":`${e.indexKey}-${r}`,"custom-id":t.customId},null,8,["node","index-key","custom-id"])):(f(),p("span",{key:1,class:H([[y(l)&&n.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(n.content),3))],64))),128))]))}}),[["__scopeId","data-v-0117537a"]]);sl.install=e=>{e.component(sl.__name,sl)};const ul=["aria-busy","aria-label","data-language"],cl=["textContent"],dl=/* @__PURE__ */h({__name:"PreCodeNode",props:{node:{}},setup(e){const t=e,n=_(()=>{var e,n,o;const l=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(l).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=_(()=>`language-${n.value}`),l=_(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return(t,r)=>(f(),p("pre",{class:H([o.value]),"aria-busy":!0===e.node.loading,"aria-label":l.value,"data-language":n.value,tabindex:"0"},[x("code",{translate:"no",textContent:M(e.node.code)},null,8,cl)],10,ul))}});dl.install=e=>{e.component(dl.__name,dl)};const vl={class:"table-node-wrapper"},ml=["aria-busy"],hl={class:"border-[var(--table-border,#cbd5e1)]"},pl={class:"border-b"},fl={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},gl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e,n=_(()=>{var e,n,o,l;return null!=(l=null==(o=null==(n=null==(e=t.node)?void 0:e.header)?void 0:n.cells)?void 0:o.length)?l:0}),o=_(()=>{const e=n.value||1,t=Math.floor(100/e);return Array.from({length:e}).map((n,o)=>o===e-1?100-t*(e-1)+"%":`${t}%`)}),l=_(()=>{var e;return null!=(e=t.node.loading)&&e}),r=_(()=>{var e;return null!=(e=t.node.rows)?e:[]});return(n,i)=>(f(),p("div",vl,[x("table",{class:H(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[x("colgroup",null,[(f(!0),p(k,null,b(o.value,(e,t)=>(f(),p("col",{key:`col-${t}`,style:A({width:e})},null,4))),128))]),x("thead",hl,[x("tr",pl,[(f(!0),p(k,null,b(e.node.header.cells,(e,o)=>(f(),p("th",{key:`header-${o}`,dir:"auto",class:H(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[w(y(Cl),{nodes:e.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:i[0]||(i[0]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),x("tbody",null,[(f(!0),p(k,null,b(r.value,(e,o)=>(f(),p("tr",{key:`row-${o}`,class:H(["border-[var(--table-border,#cbd5e1)]",[o<r.value.length-1?"border-b":""]])},[(f(!0),p(k,null,b(e.cells,(e,l)=>(f(),p("td",{key:`cell-${o}-${l}`,class:H(["p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[w(y(Cl),{nodes:e.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:i[1]||(i[1]=e=>n.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,ml),w(j,{name:"table-node-fade"},{default:$(()=>[l.value?(f(),p("div",fl,[O(n.$slots,"loading",{isLoading:l.value},()=>[i[2]||(i[2]=x("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),i[3]||(i[3]=x("span",{class:"sr-only"},"Loading",-1))],!0)])):V("",!0)]),_:3})]))}}),[["__scopeId","data-v-a874491c"]]);gl.install=e=>{e.component(gl.__name,gl)};const wl={class:"hr-node"},yl=/* @__PURE__ */oe({},[["render",function(e,t){return f(),p("hr",wl)}],["__scopeId","data-v-639cbad9"]]);yl.install=e=>{e.component(yl.__name,yl)};const xl={key:1,class:"html-block-node__placeholder"},kl=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"HtmlBlockNode",props:{node:{}},setup(e){const t=e,n=_(()=>{const e=t.node.attrs;if(e){if(Array.isArray(e)){const t={};for(const n of e){if(!n||n.length<2)continue;const[e,o]=n;null!=e&&(t[String(e)]=null==o?"":String(o))}return t}return e}}),o=C(null),l=C("undefined"==typeof window),r=C(t.node.content),i=dn(),a=C(null),s=!!t.node.loading;return"undefined"!=typeof window?(B(o,e=>{var n,o;if(null==(o=null==(n=a.value)?void 0:n.destroy)||o.call(n),a.value=null,!s)return l.value=!0,void(r.value=t.node.content);if(!e)return void(l.value=!1);const u=i(e,{rootMargin:"400px"});a.value=u,l.value=u.isVisible.value,u.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),B(()=>t.node.content,e=>{s&&!l.value||(r.value=e)})):l.value=!0,L(()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.destroy)||t.call(e),a.value=null}),(t,i)=>(f(),p("div",Y({ref_key:"htmlRef",ref:o,class:"html-block-node"},n.value),[l.value?g([r.value],()=>(f(),p("div",{key:0,innerHTML:r.value},null,8,["innerHTML"])),i,0):(f(),p("div",xl,[O(t.$slots,"placeholder",{node:e.node},()=>[i[1]||(i[1]=x("span",{class:"html-block-node__placeholder-bar"},null,-1)),i[2]||(i[2]=x("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),i[3]||(i[3]=x("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-ed22b926"]]),bl={class:"unknown-node"},Ml=/* @__PURE__ */h({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(f(),p("div",bl,M(e.node.raw),1))}),_l=["data-node-index","data-node-type"],Cl=/* @__PURE__ */oe(/* @__PURE__ */h({__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(e,{emit:t}){var n,o,l;const r=e,i=t,u=C(),m=C(!1),h=/auto|scroll|overlay/i;function g(e){if("undefined"==typeof window)return null;const t=null!=e?e:u.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let l=t;for(;l&&l!==n.body&&l!==o;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(h.test(t)||h.test(n))return l;l=l.parentElement}return null}const w=r.customId?`renderer-${r.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,y=d(w),x=_(()=>{const e=r.customHtmlTags;return e&&0!==e.length?d(w,{customHtmlTags:e}):y}),M=_(()=>{const e=x.value;return r.customMarkdownIt?r.customMarkdownIt(e):e});function T(e){const t=String(null!=e?e:"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w-]*)/i);return n?n[1].toLowerCase():""}const I=_(()=>{var e,t,n;const o=null!=(e=r.parseOptions)?e:{},l=[...null!=(t=r.customHtmlTags)?t:[],...null!=(n=o.customHtmlTags)?n:[]].map(T).filter(Boolean);return l.length?s(a({},o),{customHtmlTags:Array.from(new Set(l))}):o}),E=_(()=>{var e;if(null==(e=r.nodes)?void 0:e.length)return ee(r.nodes.slice());if(r.content){const e=v(r.content,M.value,I.value);return ee(e)}return[]}),H=_(()=>{var e;return Math.max(1,null!=(e=r.maxLiveNodes)?e:320)}),N=_(()=>{var e;return!((null!=(e=r.maxLiveNodes)?e:0)<=0)&&E.value.length>H.value}),D=function(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?C(t):t;let l=null,r=null;const i=/* @__PURE__ */new WeakMap,s=(t,s)=>{const u=C(!1);let c,d=!1;const v=new Promise(e=>{c=()=>{d||(d=!0,e())}}),m=()=>{try{null==l||l.unobserve(t)}catch(e){}i.delete(t)};if(!n||!o.value)return u.value=!0,c(),{isVisible:u,whenVisible:v,destroy:m};!r&&s&&(r=a({},s));const h=function(t){var o,a,s;if(l||!n)return l;if("undefined"==typeof IntersectionObserver)return null;const u=null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,c=r||{};return l=new IntersectionObserver(e=>{for(const n of e){const e=i.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(t){}}null==l||l.unobserve(n.target),i.delete(n.target)}}},{root:u,rootMargin:null!=(a=c.rootMargin)?a:"300px",threshold:null!=(s=c.threshold)?s:0}),l}(t);return h?(i.set(t,{resolve:c,visible:u}),h.observe(t),{isVisible:u,whenVisible:v,destroy:m}):(u.value=!0,c(),{isVisible:u,whenVisible:v,destroy:m})};return P(cn,s),s}(e=>{var t;return g(null!=(t=null!=e?e:u.value)?t:null)},_(()=>!(!1===r.viewportPriority||m.value||!1===r.deferNodesUntilVisible||N.value||E.value.length>900))),R="undefined"!=typeof window,z=R&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,O=R&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,F="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),W=R&&"function"==typeof window.requestIdleCallback,q=_(()=>{var e;const t=Math.trunc(null!=(e=r.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),Z=_(()=>{var e;const t=Math.trunc(null!=(e=r.initialRenderBatchSize)?e:q.value);return Number.isFinite(t)?Math.max(0,t):q.value}),U=_(()=>!1!==r.batchRendering&&q.value>0&&R&&!F),G=C(0),J=C({key:r.indexKey,total:0}),Q=C(Math.max(1,q.value||1)),ne=te({}),oe=/* @__PURE__ */new Map,re=/* @__PURE__ */new Map,ie=/* @__PURE__ */new Map,se=C(null);let ue=null,ce=null;const ve=_(()=>!1),he=_(()=>{var e;return U.value&&(null!=(e=r.maxLiveNodes)?e:0)<=0}),pe=C({batchSize:q.value,initial:Z.value,delay:null!=(l=r.renderBatchDelay)?l:16,enabled:he.value}),fe=_(()=>!!D&&(ve.value||N.value)),we=_(()=>{var e;return Math.max(0,null!=(e=r.liveNodeBuffer)?e:60)}),ye=C(0),xe=te({start:0,end:0}),ke=/* @__PURE__ */new Map,Me=_(()=>{if(!N.value)return E.value.length;const e=we.value,t=Math.max(xe.end+e,Z.value),n=Math.min(E.value.length,t);return Math.max(G.value,n)});function Ce(e){var t,n,o;const l=g(null!=(t=u.value)?t:null);if(l)return l;const r=null!=(o=null==(n=u.value)?void 0:n.ownerDocument)?o:"undefined"!=typeof document?document:null;return(null==r?void 0:r.scrollingElement)||(null==r?void 0:r.documentElement)||null}function Be(){ue&&(ue(),ue=null),se.value=null}function Te(){if(!R||!N.value)return;const e=Ce();if(!e||se.value===e)return;Be();const t=()=>Se();e.addEventListener("scroll",t,{passive:!0}),se.value=e,ue=()=>{e.removeEventListener("scroll",t)}}function Le(){var e,t,n;if(!ce)return;const o=null!=(n=null==(t=null==(e=u.value)?void 0:e.ownerDocument)?void 0:t.defaultView)?n:"undefined"!=typeof window?window:null;ce.viaTimeout?o?o.clearTimeout(ce.id):clearTimeout(ce.id):null==O||O(ce.id),ce=null}function Se(e={}){var t,n,o;if(!N.value)return;if(!R)return void Ie(!0);if(e.immediate)return Le(),void Ie(!0);if(ce)return;const l=()=>{ce=null,Ie()};if(z)ce={id:z(l),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=u.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,r=e?e.setTimeout(l,16):setTimeout(l,16);ce={id:r,viaTimeout:!0}}}function Ie(e=!1){var t,n,o,l,r,i,a,s,c,d,v;if(!N.value)return;const m=se.value||Ce();if(!m)return;const h=m.ownerDocument||(null==(t=u.value)?void 0:t.ownerDocument)||document,p=(null==h?void 0:h.defaultView)||("undefined"!=typeof window?window:null),f=m===(null==h?void 0:h.documentElement)||m===(null==h?void 0:h.body),g=f?null:m.getBoundingClientRect(),w=f?0:g.top,y=f?null!=(o=null!=(n=null==p?void 0:p.innerHeight)?n:m.clientHeight)?o:0:g.bottom,x=Array.from(ie.entries()).sort((e,t)=>e[0]-t[0]);let k=null,b=null;for(const[u,_]of x){if(!_)continue;const e=_.getBoundingClientRect();e.bottom<=w||e.top>=y||(null==k&&(k=u),b=u)}if(null==k||null==b){const e=u.value;if(!e)return;const t=f?{top:0}:m.getBoundingClientRect(),n=e.getBoundingClientRect(),o=f?null!=(a=null!=(i=null==(l=null==h?void 0:h.documentElement)?void 0:l.scrollTop)?i:null==(r=null==h?void 0:h.body)?void 0:r.scrollTop)?a:0:m.scrollTop,g=n.top-(f?0:t.top)+o,w=Math.max(0,o-g),y=f?null!=(v=null!=(d=null!=(c=null==p?void 0:p.innerHeight)?c:null==(s=null==h?void 0:h.documentElement)?void 0:s.clientHeight)?d:m.clientHeight)?v:0:m.clientHeight,x=function(e){var t;if(e<=0)return 0;let n=e;const o=E.value;for(let l=0;l<o.length;l++){const e=null!=(t=$e[l])?t:He.value;if(n<=e)return l;n-=e}return Math.max(0,o.length-1)}(w+.5*Math.max(0,y));return void(ye.value=je(x,0,Math.max(0,E.value.length-1)))}const M=Math.round((k+b)/2);!e&&Math.abs(M-ye.value)<=1||(ye.value=je(M,0,Math.max(0,E.value.length-1)))}function je(e,t,n){return Math.min(Math.max(e,t),n)}const $e=te({}),Ee=te({total:0,count:0}),He=_(()=>Ee.count>0?Math.max(12,Ee.total/Ee.count):32);function Ae(e,t){var n;if(e>=t)return 0;let o=0;for(let l=e;l<t;l++)o+=null!=(n=$e[l])?n:He.value;return o}const Ne=_(()=>{if(!N.value)return E.value.map((e,t)=>({node:e,index:t}));const e=E.value.length,t=je(xe.start,0,e),n=je(xe.end,t,e);return E.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),De=_(()=>N.value?Ae(0,Math.min(xe.start,E.value.length)):0),Re=_(()=>{if(!N.value)return 0;const e=E.value.length;return Ae(Math.min(xe.end,e),e)});function ze(e){if(oe.size&&N.value)for(const[t,n]of oe)t>=e&&(n.destroy(),oe.delete(t),ve.value&&delete ne[t],Ze(t),ie.delete(t))}function Pe(e,t){ve.value&&(ne[e]=t),t&&(N.value?Se():ye.value=je(e,0,Math.max(0,E.value.length-1)))}function Ve(e){const t=oe.get(e);t&&(t.destroy(),oe.delete(e)),Ze(e)}function Oe(e,t){if(t?ie.set(e,t):ie.delete(e),t||Ze(e),!fe.value||!D)return Ve(e),void(t?Pe(e,!0):ve.value&&delete ne[e]);if(!N.value&&ve.value&&!m.value&&oe.size>=640&&(function(){if(!m.value){m.value=!0;for(const e of oe.values())e.destroy();if(oe.clear(),R)for(const e of re.values())window.clearTimeout(e);re.clear();for(const e of Object.keys(ne))delete ne[e]}}(),!fe.value||!D))return Ve(e),void(t?Pe(e,!0):ve.value&&delete ne[e]);if(e<Z.value&&!N.value)return Ve(e),void Pe(e,!0);if(!t)return Ve(e),void(ve.value&&delete ne[e]);Ve(e);const n=D(t,{rootMargin:"400px"});n&&(oe.set(e,n),Pe(e,n.isVisible.value),ve.value&&function(e){if(!R||!ve.value)return;Ze(e);const t=window.setTimeout(()=>{re.delete(e),Pe(e,!0)},1800);re.set(e,t)}(e),n.whenVisible.then(()=>{Ze(e),Pe(e,!0)}).catch(()=>{}).finally(()=>{oe.get(e)===n&&oe.delete(e);try{n.destroy()}catch(t){}}),N.value&&Se())}let Fe=null,We=null,Ke=!1,Xe=null,qe=null;function Ye(){R&&(null!=Fe&&(null==O||O(Fe),Fe=null),null!=We&&(window.clearTimeout(We),We=null),null!=qe&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(qe),qe=null),Ke=!1,Xe=null)}function Ze(e){if(!R)return;const t=re.get(e);null!=t&&(window.clearTimeout(t),re.delete(e))}function Ue(e,t={}){var n,o;if(!he.value)return;const l=Me.value;if(G.value>=l)return;const i=Math.max(1,e),a=e=>{var t;Fe=null,We=null,qe=null,Ke=!1;const n=null!=Xe?Xe:i;Xe=null;const o=Math.max(2,null!=(t=r.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();G.value=Math.min(l,G.value+Math.max(1,e)),ze(G.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return function(e){var t;if(!he.value)return;const n=Math.max(2,null!=(t=r.renderBatchBudgetMs)?t:6),o=Math.max(1,q.value||1),l=Math.max(1,Math.floor(o/4));e>1.2*n?Q.value=Math.max(l,Math.floor(.7*Q.value)):e<.5*n&&Q.value<o&&(Q.value=Math.min(o,Math.ceil(1.2*Q.value)))}(n),n};let s=n;for(;(a(s),!(G.value>=l)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(Q.value));G.value<l&&Ge()};if(!R||t.immediate)return void a();const s=Math.max(0,null!=(n=r.renderBatchDelay)?n:16);if(Xe=null!=Xe?Math.max(Xe,i):i,!Ke){if(Ke=!0,!F&&W&&window.requestIdleCallback){const e=Math.max(0,null!=(o=r.renderBatchIdleTimeoutMs)?o:120);return void(qe=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}z&&!F?Fe=z(()=>{0!==s?We=window.setTimeout(()=>a(),s):a()}):We=window.setTimeout(()=>a(),s)}}function Ge(){he.value&&Ue(U.value?Math.max(1,Math.round(Q.value)):Math.max(1,q.value))}B([()=>E.value,()=>E.value.length,()=>he.value,()=>q.value,()=>Z.value,()=>r.renderBatchDelay,()=>r.indexKey],()=>{var e;const t=E.value.length,n=J.value,o=r.indexKey,l=void 0!==o&&o!==n.key,i=t!==n.total,a=l||i;J.value={key:o,total:t};const s=pe.value,u=null!=(e=r.renderBatchDelay)?e:16,c=s.batchSize!==q.value||s.initial!==Z.value||s.delay!==u||s.enabled!==he.value;pe.value={batchSize:q.value,initial:Z.value,delay:u,enabled:he.value},(a||c||!he.value)&&Ye(),(a||c)&&(Q.value=Math.max(1,q.value||1)),a&&N.value&&Se({immediate:!0});const d=Me.value;if(!t)return G.value=0,void ze(0);if(!he.value)return G.value=d,void ze(G.value);const v=l||0===n.total;G.value=v||c?Math.min(d,Z.value):Math.min(G.value,d);const m=Math.max(1,Z.value||q.value||t);G.value<d?Ue(m,{immediate:!R}):ze(G.value)},{immediate:!0}),B(()=>N.value,e=>{if(!e)return Be(),void Le();Te(),Se({immediate:!0})},{immediate:!0}),B(()=>u.value,()=>{N.value&&(Te(),Se({immediate:!0}))}),B(()=>E.value.length,()=>{N.value&&Se({immediate:!0})}),B(()=>ve.value,e=>{if(e)for(const[t,n]of ie)Oe(t,n);else{for(const e of oe.values())e.destroy();oe.clear();for(const e of Array.from(re.keys()))Ze(e);for(const e of Object.keys(ne))delete ne[e];for(const[e,t]of ie)t&&Pe(e,!0)}},{immediate:!1}),B([()=>r.viewportPriority,()=>E.value.length],([e,t])=>{!1!==e?m.value&&t<=200&&(m.value=!1):m.value=!1}),B(()=>G.value,()=>{N.value&&Se({immediate:!0})}),B([ye,H,we,()=>E.value.length,N],()=>{!function(){const e=E.value.length;if(!N.value||0===e)return xe.start=0,void(xe.end=e);const t=Math.min(H.value,e),n=we.value,o=je(ye.value-n,0,Math.max(0,e-t));xe.start=o,xe.end=Math.min(e,o+t)}()},{immediate:!0}),B(()=>Me.value,(e,t)=>{he.value&&("number"==typeof t&&e<=t||e>G.value&&Ge())}),L(()=>{Ye();for(const e of oe.values())e.destroy();oe.clear();for(const e of Array.from(re.keys()))Ze(e);Be(),Le()});const Je=K(()=>c(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),dl}})),Qe=_(()=>r.renderCodeBlocksAsPre?dl:Je),et={text:$n,paragraph:sl,heading:mo,code_block:Je,list:po,blockquote:le,table:gl,definition_list:de,footnote:so,footnote_reference:be,footnote_anchor:ro,admonition:$l,hardbreak:co,link:Gn,image:yn,thematic_break:yl,math_inline:En,math_block:Hn,strong:Fn,emphasis:oo,strikethrough:Kn,highlight:to,insert:Qn,subscript:Vn,superscript:Rn,emoji:me,checkbox:ae,checkbox_input:ae,inline_code:_e,html_inline:il,reference:An,html_block:kl};function tt(e){var t;if(!e)return Ml;const n=ge(r.customId),o=n[String(e.type)];if("code_block"===e.type){if("mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase())return n.mermaid||rl;if(o)return o;return n.code_block||Qe.value}return o||et[String(e.type)]||Ml}function nt(e){var t;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase()?{}:"code_block"===e.type?a({stream:r.codeBlockStream,darkTheme:r.codeBlockDarkTheme,lightTheme:r.codeBlockLightTheme,monacoOptions:r.codeBlockMonacoOptions,themes:r.themes,minWidth:r.codeBlockMinWidth,maxWidth:r.codeBlockMaxWidth},r.codeBlockProps||{}):{typewriter:r.typewriter}}function ot(e){i("click",e)}function lt(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseover",e)}function rt(e){var t;(null==(t=e.target)?void 0:t.closest("[data-node-index]"))&&i("mouseout",e)}return(t,n)=>(f(),p("div",{ref_key:"containerRef",ref:u,class:"markdown-renderer",onClick:ot,onMouseover:lt,onMouseout:rt},[N.value?(f(),p("div",{key:0,class:"node-spacer",style:A({height:`${De.value}px`}),"aria-hidden":"true"},null,4)):V("",!0),(f(!0),p(k,null,b(Ne.value,t=>{var o,l;return f(),p("div",{key:t.index,ref_for:!0,ref:e=>Oe(t.index,e),class:"node-slot","data-node-index":t.index,"data-node-type":t.node.type},[(l=t.index,he.value&&l>=G.value||ve.value&&!(l<Z.value)&&!0!==ne[l]?(f(),p("div",{key:1,class:"node-placeholder",style:A({height:`${null!=(o=$e[t.index])?o:He.value}px`})},null,4)):(f(),p("div",{key:0,ref_for:!0,ref:e=>function(e,t){t?(ke.set(e,t),queueMicrotask(()=>{!function(e,t){if(!Number.isFinite(t)||t<=0)return;const n=$e[e];$e[e]=t,n?Ee.total+=t-n:(Ee.total+=t,Ee.count++)}(e,t.offsetHeight)})):ke.delete(e)}(t.index,e),class:"node-content"},["code_block"!==t.node.type&&!1!==r.typewriter?(f(),S(j,{key:0,name:"typewriter",appear:""},{default:$(()=>[(f(),S(X(tt(t.node)),Y({node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},nt(t.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(f(),S(X(tt(t.node)),Y({key:1,node:t.node,loading:t.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${t.index}`},{ref_for:!0},nt(t.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)))],8,_l)}),128)),N.value?(f(),p("div",{key:1,class:"node-spacer",style:A({height:`${Re.value}px`}),"aria-hidden":"true"},null,4)):V("",!0)],544))}}),[["__scopeId","data-v-0327402f"]]);Cl.install=e=>{var t,n;const o=null!=(n=null!=(t=Cl.__name)?t:Cl.name)?n:"NodeRenderer";e.component(o,Cl)};const Bl={key:0,class:"admonition-icon"},Tl={class:"admonition-title"},Ll=["aria-expanded","aria-controls","title"],Sl={key:0},Il={key:1},jl=["id"],$l=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,l=t,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=_(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),a=C(!!o.node.collapsible&&!(null==(n=o.node.open)||n));function s(){o.node.collapsible&&(a.value=!a.value)}const u=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,n)=>(f(),p("div",{class:H(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[x("div",{id:u,class:"admonition-header"},[r[o.node.kind]?(f(),p("span",Bl,M(r[o.node.kind]),1)):V("",!0),x("span",Tl,M(i.value),1),o.node.collapsible?(f(),p("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${u}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(f(),p("span",Sl,"▶")):(f(),p("span",Il,"▼"))],8,Ll)):V("",!0)]),E(x("div",{id:`${u}-content`,class:"admonition-content","aria-labelledby":u},[g([o.node.children],()=>w(y(Cl),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:n[0]||(n[0]=e=>l("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),n,1)],8,jl),[[N,!a.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);$l.install=e=>{e.component($l.__name,$l)};let El=!1,Hl=null,Al=!1;function Nl(){return c(this,null,function*(){if(Hl)return Hl;if(Al)return null;try{return Hl=yield import("stream-monaco"),yield function(e){return c(this,null,function*(){if(!El)return El=!0,e.preloadMonacoWorkers()})}(Hl),Hl}catch(e){return Al=!0,null}})}let Dl=null;function Rl(e){Dl=null!=e?e:null}const zl={"":"",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 Pl(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[o]=n.split(":");return o.toLowerCase()}(e);return null!=(t=zl[n])?t:n}function Vl(e){const t=Pl(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ol(e){if(Dl){const t=Dl(e);if(null!=t&&""!==t)return t}switch(Pl(e)){case"javascript":case"js":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n';case"typescript":case"ts":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n';case"scss":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n';case"python":case"py":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n';case"ruby":case"rb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n';case"go":case"golang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n';case"r":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />\n <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />\n </g>\n</svg>\n';case"java":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n';case"kotlin":case"kt":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n';case"c":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n';case"cpp":case"c++":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n';case"cs":case"csharp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n';case"php":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n';case"scala":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />\n</svg>\n';case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n';case"sql":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n';case"yaml":case"yml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n';case"markdown":case"md":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n';case"xml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n';case"rust":case"rs":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n';case"swift":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />\n</svg>\n';case"perl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />\n</svg>\n';case"lua":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />\n <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />\n </g>\n</svg>\n';case"haskell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />\n</svg>\n';case"erlang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />\n <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />\n </g>\n</svg>\n';case"clojure":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />\n <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />\n <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />\n <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />\n <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />\n <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />\n </g>\n</svg>\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n';case"dart":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />\n <path d="M3.5 11V3.5H11m-7.5 0 8 8" />\n </g>\n</svg>\n';case"assembly":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />\n</svg>\n';case"dockerfile":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />\n</svg>\n';case"fortran":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />\n</svg>\n';case"lisp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />\n <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />\n </g>\n</svg>\n';case"ocaml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />\n <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />\n <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />\n </g>\n</svg>\n';case"prolog":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />\n</svg>\n';case"groovy":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />\n <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />\n </g>\n</svg>\n';case"matlab":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />\n <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />\n </g>\n</svg>\n';case"cobol":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />\n</svg>\n';case"ada":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<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>';case"julia":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n </g>\n</svg>\n';case"elixir":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />\n</svg>\n';case"vb.net":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>';case"nim":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />\n</svg>\n';case"crystal":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />\n</svg>\n';case"d":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>';case"applescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <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" />\n</svg>\n';case"solidity":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="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" />\n</svg>\n';case"objectivec":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>';case"objectivecpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>';case"terraform":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />\n</svg>\n';case"plain":case"text":case"":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>'}}const Fl={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"},Wl={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)"}},Kl={class:"flex items-center space-x-2"},Xl=["innerHTML"],ql={class:"text-sm font-medium font-mono"},Yl={class:"flex items-center space-x-2"},Zl=["aria-pressed"],Ul=["disabled"],Gl=["disabled"],Jl=["disabled"],Ql=["aria-label"],er={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"},tr={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"},nr=["aria-pressed"],or={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"},lr={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"},rr=["aria-label"],ir=["innerHTML"],ar={class:"code-loading-placeholder"},sr=/* @__PURE__ */oe(/* @__PURE__ */h({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n;const o=e,l=t,{t:r}=un(),i=C(String(null!=(n=o.node.language)?n:"")),a=C(!1),s=C(!1),u=C(!1),d=C(null),v=C(null),m=C(""),h=C(!1);let g;const w=C(!0),b=C(0),L=C(14),I=C(L.value),j=_(()=>{const e=L.value,t=I.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),$=_(()=>{const e=i.value.trim().toLowerCase();return Fl[e]||e.charAt(0).toUpperCase()+e.slice(1)}),D=_(()=>"mermaid"===i.value.trim().toLowerCase()),R=_(()=>Ol(i.value.trim().toLowerCase().split(":")[0])),z=_(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),P=_(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(o.minWidth),l=t(o.maxWidth);return n&&(e.minWidth=n),l&&(e.maxWidth=l),e}),F=_(()=>({fontSize:`${I.value}px`}));function W(){return o.isDark?o.darkTheme:o.lightTheme}function K(e){if(null==g||g.disconnect(),g=void 0,!e)return m.value="",void(h.value=!1);var t;m.value=`<pre class="shiki shiki-fallback"><code>${t=e,t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,h.value=!1}function X(){m.value="",h.value=!0}function q(){var e;const t=v.value;return!!t&&(t.childNodes.length>0||Boolean(null==(e=t.textContent)?void 0:e.trim().length))}function Y(){return c(this,null,function*(){if(yield T(),q())return void X();const e=v.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{q()&&(X(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let Z,G,J,Q,ee=()=>{};const te=/* @__PURE__ */new Set,ne=/* @__PURE__ */new Set,oe=void 0!==import.meta&&Boolean(!1);function le(e,t){return c(this,null,function*(){if(!Z)return;const n=function(e,t=!1){var n;const[o]=String(null!=e?e:"").split(":"),l=null!=(n=null==o?void 0:o.trim().toLowerCase())?n:"";return l?!Q||Q.has(l)?l:(t&&oe&&!te.has(l)&&(te.add(l),console.warn(`[MarkdownCodeBlockNode] Language "${l}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(t,Boolean(e&&e.length));try{yield Z.updateCode(e,n)}catch(o){"plaintext"!==n?(oe&&!ne.has(n)&&(ne.add(n),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${n}", retrying as plaintext.`,o)),yield Z.updateCode(e,"plaintext")):oe&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function re(){return c(this,null,function*(){if(D.value)return ee(),null==Z||Z.dispose(),Z=void 0,void(h.value=!1);yield function(){return c(this,null,function*(){if(!G)try{const e=yield import("stream-markdown");G=e.createShikiStreamRenderer,J=e.registerHighlight,ee=e.disposeHighlighter;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Q=t?new Set(t.map(e=>e.toLowerCase())):void 0,null==J||J({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),d.value&&v.value?(null==J||J({themes:o.themes}),!Z&&G&&(Z=G(v.value,{theme:W()}),h.value=!0),Z?!1===o.stream&&o.loading?K(o.node.code):(K(o.node.code),yield le(o.node.code,i.value),yield Y()):K(o.node.code)):K(o.node.code)})}re(),U(()=>{re()}),B(()=>o.themes,()=>c(null,null,function*(){J&&J({themes:o.themes})})),B(()=>o.loading,e=>{e||re()}),B(()=>[o.node.code,o.node.language],e=>c(null,[e],function*([e,t]){if(t!==i.value&&(i.value=t.trim()),d.value&&v.value){if(D.value)return ee(),void(null==Z||Z.dispose());Z||(K(e),yield re()),Z&&e&&(!1===o.stream&&o.loading||(K(e),yield le(e,t),yield Y()))}else K(e)}));const ie=B(()=>[o.darkTheme,o.lightTheme],()=>c(null,null,function*(){if(d.value&&v.value){if(D.value)return ee(),null==Z||Z.dispose(),ie();Z||(yield re()),null==Z||Z.setTheme(W())}}));function ae(){const e=d.value;if(!e||s.value)return;const t=e.scrollTop;t<b.value?w.value=!1:function(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}(e)&&(w.value=!0),b.value=t}function se(){return c(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),a.value=!0,l("copy",o.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ue(e){return!e||e.disabled}function ce(e,t,n="top"){if(ue(e.currentTarget))return;const l=e,r=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;ln(e.currentTarget,t,n,!1,r,o.isDark)}function de(){rn()}function ve(e){if(ue(e.currentTarget))return;const t=a.value?r("common.copied")||"Copied":r("common.copy")||"Copy",n=e,l=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;ln(e.currentTarget,t,"top",!1,l,o.isDark)}function me(){s.value=!s.value;const e=d.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",w.value=!0,T(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function he(){u.value=!u.value}function pe(){if(!z.value)return;const e=(i.value||o.node.language).toLowerCase(),t="html"===e?"HTML Preview":"SVG Preview";l("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:t})}return B(()=>o.node.code,()=>c(null,null,function*(){if(s.value||!w.value)return;yield T();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(t,n)=>D.value?(f(),S(y(rl),{key:0,node:e.node,"is-dark":o.isDark,loading:o.loading},null,8,["node","is-dark","loading"])):(f(),p("div",{key:1,style:A(P.value),class:H(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",o.isDark?"is-dark":""]])},[o.showHeader?(f(),p("div",Wl,[O(t.$slots,"header-left",{},()=>[x("div",Kl,[x("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:R.value},null,8,Xl),x("span",ql,M($.value),1)])],!0),O(t.$slots,"header-right",{},()=>[x("div",Yl,[x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":u.value,onClick:he,onMouseenter:n[0]||(n[0]=e=>ce(e,u.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onFocus:n[1]||(n[1]=e=>ce(e,u.value?y(r)("common.expand")||"Expand":y(r)("common.collapse")||"Collapse")),onMouseleave:de,onBlur:de},[(f(),p("svg",{style:A({rotate:u.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"},[...n[17]||(n[17]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Zl),o.showFontSizeButtons&&o.enableFontSizeControl?(f(),p(k,{key:0},[x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(I.value)&&I.value<=10,onClick:n[2]||(n[2]=e=>function(){const e=Math.max(10,I.value-1);I.value=e}()),onMouseenter:n[3]||(n[3]=e=>ce(e,y(r)("common.decrease")||"Decrease")),onFocus:n[4]||(n[4]=e=>ce(e,y(r)("common.decrease")||"Decrease")),onMouseleave:de,onBlur:de},[...n[18]||(n[18]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Ul),x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!j.value||I.value===L.value,onClick:n[5]||(n[5]=e=>{I.value=L.value}),onMouseenter:n[6]||(n[6]=e=>ce(e,y(r)("common.reset")||"Reset")),onFocus:n[7]||(n[7]=e=>ce(e,y(r)("common.reset")||"Reset")),onMouseleave:de,onBlur:de},[...n[19]||(n[19]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),x("path",{d:"M3 3v5h5"})])],-1)])],40,Gl),x("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(I.value)&&I.value>=36,onClick:n[8]||(n[8]=e=>function(){const e=Math.min(36,I.value+1);I.value=e}()),onMouseenter:n[9]||(n[9]=e=>ce(e,y(r)("common.increase")||"Increase")),onFocus:n[10]||(n[10]=e=>ce(e,y(r)("common.increase")||"Increase")),onMouseleave:de,onBlur:de},[...n[20]||(n[20]=[x("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"},[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Jl)],64)):V("",!0),o.showCopyButton?(f(),p("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":a.value?y(r)("common.copied")||"Copied":y(r)("common.copy")||"Copy",onClick:se,onMouseenter:n[11]||(n[11]=e=>ve(e)),onFocus:n[12]||(n[12]=e=>ve(e)),onMouseleave:de,onBlur:de},[a.value?(f(),p("svg",tr,[...n[22]||(n[22]=[x("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(f(),p("svg",er,[...n[21]||(n[21]=[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),x("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,Ql)):V("",!0),o.showExpandButton?(f(),p("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":s.value,onClick:me,onMouseenter:n[13]||(n[13]=e=>ce(e,s.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onFocus:n[14]||(n[14]=e=>ce(e,s.value?y(r)("common.collapse")||"Collapse":y(r)("common.expand")||"Expand")),onMouseleave:de,onBlur:de},[s.value?(f(),p("svg",or,[...n[23]||(n[23]=[x("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)])])):(f(),p("svg",lr,[...n[24]||(n[24]=[x("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,nr)):V("",!0),z.value&&o.showPreviewButton?(f(),p("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":y(r)("common.preview")||"Preview",onClick:pe,onMouseenter:n[15]||(n[15]=e=>ce(e,y(r)("common.preview")||"Preview")),onFocus:n[16]||(n[16]=e=>ce(e,y(r)("common.preview")||"Preview")),onMouseleave:de,onBlur:de},[...n[25]||(n[25]=[x("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"},[x("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[x("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"}),x("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,rr)):V("",!0)])],!0)])):V("",!0),E(x("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:A(F.value),onScroll:ae},[x("div",{ref_key:"rendererTarget",ref:v,class:"code-block-render"},null,512),h.value?V("",!0):(f(),p("div",{key:0,class:"code-fallback-plain",innerHTML:m.value},null,8,ir))],36),[[N,!(u.value||!e.stream&&e.loading)]]),E(x("div",ar,[O(t.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[n[26]||(n[26]=x("div",{class:"loading-skeleton"},[x("div",{class:"skeleton-line"}),x("div",{class:"skeleton-line"}),x("div",{class:"skeleton-line short"})],-1))],!0)],512),[[N,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-34bf55f7"]]);sr.install=e=>{e.component(sr.__name,sr)};let ur=null,cr=null,dr=!1;const vr=/* @__PURE__ */new Map,mr=/* @__PURE__ */new Map;let hr=5;const pr=/* @__PURE__ */new Set;function fr(){if(vr.size<hr&&pr.size){const t=Array.from(pr);pr.clear();for(const n of t)try{n()}catch(e){}}}function gr(e){ur=e,cr=null,ur.onmessage=e=>{const{id:t,html:n,error:o}=e.data,l=vr.get(t);if(l)if(vr.delete(t),clearTimeout(l.timeoutId),fr(),o)l.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(mr.set(e,n),mr.size>200){const e=mr.keys().next().value;mr.delete(e)}}l.resolve(n)}},ur.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of vr.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));vr.clear(),fr()}}function wr(){var e;ur&&(null==(e=ur.terminate)||e.call(ur)),ur=null,cr=null}function yr(e){dr=!!e,ur&&ur.postMessage({type:"init",debug:dr})}function xr(e,t=!0,n=2e3,o){return c(this,null,function*(){if(performance.now(),!Tn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(cr)return Promise.reject(cr);const l=`${t?"d":"i"}:${e}`,r=mr.get(l);if(r)return Promise.resolve(r);const i=ur||(cr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),cr.name="WorkerInitError",cr.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(cr);if(vr.size>=hr){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=vr.size,e.max=hr,Promise.reject(e)}return new Promise((l,r)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{vr.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",r(e),fr()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),vr.has(a)&&vr.delete(a);const e=new Error("Aborted");e.name="AbortError",r(e),fr()},{once:!0});const u=l,c=r;vr.set(a,{resolve:e=>{u(e)},reject:e=>{c(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:t})})})}function kr(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(mr.set(o,n),mr.size>200){const e=mr.keys().next().value;mr.delete(e)}}function br(){return{inFlight:vr.size,max:hr}}function Mr(e){Number.isFinite(e)&&e>0&&(hr=Math.floor(e))}const _r="WORKER_BUSY";function Cr(){return vr.size>=hr}function Br(e=2e3,t){return vr.size<hr?Promise.resolve():new Promise((n,o)=>{let l,r=!1;const i=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),pr.delete(i),n())};if(pr.add(i),l=globalThis.setTimeout(()=>{if(r)return;r=!0,pr.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>fr()),t){const e=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),pr.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Tr={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Lr(e){null!=e.timeout&&(Tr.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Tr.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Tr.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Tr.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Sr(){return a({},Tr)}function Ir(e){return c(this,arguments,function*(e,t=!0,n={}){var o,l,r,i;if(!Tn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Tr.timeout,s=null!=(l=n.waitTimeout)?l:Tr.waitTimeout,u=null!=(r=n.backoffMs)?r:Tr.backoffMs,c=null!=(i=n.maxRetries)?i:Tr.maxRetries,d=n.signal;let v=0;for(;;){if(null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield xr(e,t,a,d)}catch(m){if((null==m?void 0:m.code)!==_r||v>=c)throw m;if(v++,yield Br(s,d).catch(()=>{}),null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*v)))}}})}const jr=K(()=>import("./index4.js")),$r=K(()=>import("./index3.js")),Er=K(()=>import("./index2.js")),Hr={AdmonitionNode:$l,BlockquoteNode:le,CheckboxNode:ae,CodeBlockNode:jr,DefinitionListNode:de,EmojiNode:me,FootnoteNode:so,FootnoteReferenceNode:be,FootnoteAnchorNode:ro,HardBreakNode:co,HeadingNode:mo,HtmlInlineNode:il,HighlightNode:to,ImageNode:yn,InlineCodeNode:_e,PreCodeNode:dl,InsertNode:Qn,LinkNode:Gn,ListItemNode:ho,ListNode:po,MathBlockNode:$r,MathInlineNode:Er,MermaidBlockNode:rl,ParagraphNode:sl,StrikethroughNode:Kn,StrongNode:Fn,SubscriptNode:Vn,SuperscriptNode:Rn,TableNode:gl,TextNode:$n,ThematicBreakNode:yl,ReferenceNode:An,MarkdownCodeBlockNode:sr},Ar={install(e,t){Object.entries(Hr).forEach(([t,n])=>{e.component(t,n)}),(null==t?void 0:t.getLanguageIcon)&&Rl(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&m(t.mathOptions)}};export{_n as $,$l as A,le as B,ae as C,de as D,me as E,ro as F,_e as G,co as H,yn as I,Qn as J,Tn as K,Mo as L,Gn as M,ho as N,po as O,sr as P,Cl as Q,$r as R,Er as S,rl as T,sl as U,An as V,_r as W,we as X,fe as Y,sn as Z,oe as _,dn as a,xo as a0,Kn as a1,Fn as a2,Vn as a3,Rn as a4,gl as a5,$n as a6,yl as a7,Ar as a8,Rl as a9,gr as aa,wr as ab,yr as ac,xr as ad,br as ae,Mr as af,Cr as ag,Br as ah,Lr as ai,Sr as aj,So as ak,Io as al,jo as am,$o as an,Eo as ao,Ho as ap,Ao as aq,Do as ar,Ro as as,zo as at,Ol as b,dl as c,ln as d,Ir as e,Ln as f,Nl as g,rn as h,kr as i,ye as j,jr as k,Fl as l,Bn as m,Pl as n,bo as o,Cn as p,ko as q,Vl as r,fo as s,so as t,un as u,be as v,ge as w,mo as x,to as y,il as z};