markstream-vue2 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +377 -346
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.create;var e,t=Object.defineProperty,n=Object.defineProperties,o=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),r=(Object.getOwnPropertyNames,Object.getOwnPropertySymbols),l=(Object.getPrototypeOf,Object.prototype.hasOwnProperty),i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,u=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,o(t)),d=(e,t,n)=>new Promise((o,r)=>{var l=e=>{try{a(n.next(e))}catch(t){r(t)}},i=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((n=n.apply(e,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("stream-markdown-parser"),m=require("vue-demi"),f=require("@floating-ui/dom");var h="undefined"!=typeof document?document.currentScript:null;function v(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const g=v(m);function y(e,t){if(null==e)return!1;const n=typeof e;return("object"===n||"function"===n)&&t in e}function w(e){return function(e){const t=function(e){const t="string"==typeof e?e:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}(e);return null!=t&&t<7}(function(e){var t,n,o,r,l,i,a,s,u;const c=null==(n=null==(t=null==e?void 0:e.$options)?void 0:t._base)?void 0:n.version;if("string"==typeof c&&c)return c;const d=null==(l=null==(r=null==(o=null==e?void 0:e.$root)?void 0:o.$options)?void 0:r._base)?void 0:l.version;if("string"==typeof d&&d)return d;if(y(e,"$")){const t=null==(s=null==(a=null==(i=e.$)?void 0:i.appContext)?void 0:a.app)?void 0:s.version;if("string"==typeof t&&t)return t}if(y(e,"constructor")){const t=null==(u=e.constructor)?void 0:u.version;if("string"==typeof t&&t)return t}if(y(e,"version")){const t=e.version;if("string"==typeof t&&t)return t}return""}(e))}function x(e){return e.slice(2).replace(/^[A-Z]/,e=>e.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase()}function M(e){if(y(e,"$listeners")){const t=e.$listeners;if(t&&"object"==typeof t)return t}if(!y(e,"$attrs"))return{};const t=e.$attrs;if(!t||"object"!=typeof t)return{};const n={};for(const[o,r]of Object.entries(t))/^on[A-Z]/.test(o)&&("function"==typeof r||Array.isArray(r)&&r.every(e=>"function"==typeof e))&&(n[x(o)]=r);return n}function k(e,t,n,o,r,l,i,a){var s,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=s):r&&(s=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(u.functional){u._injectStyles=s;var c=u.render;u.render=function(e,t){return s.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:u}}const b=k(m.defineComponent({__name:"CheckboxNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"checkbox-node"},[t("input",{staticClass:"checkbox-input",attrs:{type:"checkbox",disabled:""},domProps:{checked:e.node.checked}})])},[],!1,null,"8dc6c46f",null,null).exports,C=k(m.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?lt:ot),r=m.computed(()=>t.node.items.flatMap((e,n)=>[{key:`definition-term-${t.indexKey}-${n}`,tag:"dt",className:"definition-term",nodes:e.term},{key:`definition-desc-${t.indexKey}-${n}`,tag:"dd",className:"definition-desc",nodes:e.definition}]));return{__sfc:!0,props:t,instance:n,nestedRenderer:o,definitionEntries:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},e._l(n.definitionEntries,function(o){return t(o.tag,{key:o.key,tag:"component",class:o.className},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":o.key,nodes:o.nodes,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),1)},[],!1,null,"c519ad1b",null,null).exports,T=k(m.defineComponent({__name:"EmojiNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"emoji-node"},[e._v(e._s(e.node.name))])},[],!1,null,"de55dc97",null,null).exports,N="__global__",D="__MARKSTREAM_VUE2_CUSTOM_COMPONENTS_STORE__",_=(()=>{const e=globalThis;if(e[D])return e[D];const t={scopedCustomComponents:{},revision:m.shallowRef(0)};return e[D]=t,t})(),j=_.revision;function I(e){const t=_.scopedCustomComponents[N]||{};if(!e)return t;const n=_.scopedCustomComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?u(u({},t),n):t:n}const E=k(m.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#footnote-${t.node.id}`;return{__sfc:!0,props:t,href:n,handleScroll:function(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"footnote-reference",attrs:{id:`fnref-${e.node.id}`},on:{click:n.handleScroll}},[t("span",{staticClass:"footnote-link cursor-pointer",attrs:{href:n.href,title:`查看脚注 ${e.node.id}`}},[e._v("["+e._s(e.node.id)+"]")])])},[],!1,null,"01af0fee",null,null).exports,L=function(){var e,t,n;const o=g,r=e=>"function"==typeof e&&"function"==typeof e.extend,l=[o,null==o?void 0:o.default,null==(e=null==o?void 0:o.default)?void 0:e.default,null==(n=null!=(t=null==o?void 0:o.default)?t:o)?void 0:n.default,null==o?void 0:o.Vue2,null==o?void 0:o.Vue];for(const a of l){const e=r(a)?a:r(null==a?void 0:a.default)?a.default:null;if(e)try{const t=new e;if("function"==typeof t.$createElement)return t.$createElement.bind(t)}catch(i){}}return null}();function S(e,t,n,o){if(e)return e(t,n,o);try{return m.h(t,n,o)}catch(r){}try{return m.h(t,n,o)}catch(r){}return L?L(t,n,o):null}const B=new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),A=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),O=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),z=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,P=new Set(["script"]),R=new Set(["href","src","srcset","xlink:href","formaction"]),$=(()=>{var e;try{return Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV)}catch(t){}return!1})();function H(e){$&&console.warn(e)}function U(e){const t=function(e){let t="";for(const n of e){const e=n.charCodeAt(0);e<=31||127===e||/\s/u.test(n)||(t+=n)}return t}(e).toLowerCase();return!(!t.startsWith("javascript:")&&!t.startsWith("vbscript:"))||!!t.startsWith("data:")&&!(t.startsWith("data:image/")||t.startsWith("data:video/")||t.startsWith("data:audio/"))}function F(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Y(e,t){const n=e.toLowerCase();return!O.has(n)&&(F(t,n)||F(t,e))}function W(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return"true"===e||""===e||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const t=Number(e);if(""!==e&&!Number.isNaN(t))return t}return e}function Q(e){return e.trim().length>0}function K(e,t,n,o,a){if(P.has(e.toLowerCase()))return null;const s=function(e){const t={};for(const[n,o]of Object.entries(e)){const e=n.toLowerCase();B.has(e)||R.has(e)&&o&&U(o)||(t[n]=o)}return t}(t);if(Y(e,o)){const t=o[e]||o[e.toLowerCase()],r=function(e){const t={};for(const[n,o]of Object.entries(e))t[n]=W(o,n);return t}(s);return S(a,t,r,n.length>0?n:void 0)}{const t=s,{innerHTML:o}=t;return S(a,e,((e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&i.call(e,o)&&(n[o]=e[o]);return n})(t,["innerHTML"]),n.length>0?n:void 0)}}function V(e,t){if(!e||!e.includes("<"))return!1;if(!t||0===Object.keys(t).length)return!1;let n;for(z.lastIndex=0;null!==(n=z.exec(e));)if(Y(n[1],t))return!0;return!1}function X(e,t,n){if(!e)return[];try{const o=function(e,t,n){const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=K(l.tagName,l.attrs||{},[],t,n),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let i=-1;for(let t=o.length-1;t>=0;t--)if(o[t].tagName.toLowerCase()===e){i=t;break}if(-1!==i)for(;o.length>i;){const l=o.pop(),a=K(l.tagName,l.attrs||{},l.children,t,n);o.length>0?null!=a&&o[o.length-1].children.push(a):null!=a&&r.push(a),l.tagName.toLowerCase()!==e&&o.length>i&&H(`Auto-closing unclosed tag: <${l.tagName}>`)}else H(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),l=K(e.tagName,e.attrs||{},e.children,t,n);null!=l&&r.push(l),H(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var t,n,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const t=e.indexOf("--\x3e",l);if(-1!==t){l=t+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const t=e.slice(l);Q(t)&&r.push({type:"text",content:t})}break}if(i>l){const t=e.slice(l,i);Q(t)&&r.push({type:"text",content:t})}if(e.startsWith("![CDATA[",i+1)){const t=e.indexOf("]]>",i);if(-1!==t){r.push({type:"text",content:e.slice(i,t+3)}),l=t+3;continue}break}if(e.startsWith("!",i+1)){const t=e.indexOf(">",i);if(-1!==t){l=t+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),u=s.startsWith("/"),c=s.endsWith("/");if(u){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=c?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(n=null!=(t=r[2])?t:r[3])?n:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:c||A.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),t,n);return o}catch(r){return o=r,$&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const q=k(m.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null},setup(e){const t=e,n=m.computed(()=>I(t.customId)),o=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0}},render(){return X(this.content,this.customComponents)||[]}}),r=m.computed(()=>{const e=t.node.content;return e?V(e,n.value)?{mode:"dynamic",content:e}:{mode:"html",content:e}:{mode:"html",content:""}}),l=m.ref(null),i="undefined"!=typeof window,a=m.ref({mode:"",content:"",el:null});let s=null;function u(){return!s&&i&&(s=document.createElement("template")),s}function c(e,t){if(!i||!l.value)return;const n=l.value,o=a.value;if(o.el!==n||o.mode!==e||o.content!==t){if("text"===e)n.textContent=t;else{const e=u();if(e){e.innerHTML=t;const o=e.content.cloneNode(!0);"function"==typeof n.replaceChildren?n.replaceChildren(o):(n.innerHTML="",n.appendChild(o))}else n.innerHTML=t}a.value={mode:e,content:t,el:n}}}function d(){c("html",t.node.content)}function p(){c("text",t.node.content)}return m.onMounted(()=>{"html"===r.value.mode&&(t.node.loading&&!t.node.autoClosed?p():d())}),m.watch(()=>[t.node.content,t.node.loading,t.node.autoClosed],()=>{"html"===r.value.mode&&(t.node.loading&&!t.node.autoClosed?p():d())}),m.onBeforeUnmount(()=>{l.value&&(l.value.innerHTML="",a.value={mode:"",content:"",el:null})}),{__sfc:!0,props:t,customComponents:n,DynamicRenderer:o,renderMode:r,containerRef:l,isClient:i,lastDomRender:a,templateEl:s,getTemplateEl:u,commitDomRender:c,renderHtmlContent:d,renderLoadingContent:p}}}),function(){var e=this._self._c,t=this._self._setupProxy;return"dynamic"===t.renderMode.mode?e("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":t.props.node.loading}},[e(t.DynamicRenderer,{attrs:{content:t.renderMode.content,"custom-components":t.customComponents}})],1):e("span",{ref:"containerRef",staticClass:"html-inline-node",class:{"html-inline-node--loading":t.props.node.loading}})},[],!1,null,"7aa2ed27",null,null).exports,Z=k(m.defineComponent({__name:"InlineCodeNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},[e._v(e._s(e.node.code))])},[],!1,null,null,null,null).exports,G=m.ref(!1),J=m.ref(""),ee=m.ref("top"),te=m.ref(null),ne=m.ref(null),oe=m.ref(null),re=m.ref(null),le=m.ref(null);let ie=null,ae=null;function se(){ie&&(clearTimeout(ie),ie=null),ae&&(clearTimeout(ae),ae=null)}let ue=!1,ce=null;function de(){return ue||"undefined"==typeof document?Promise.resolve():ce||(ce=Promise.resolve().then(()=>ao).then(e=>{var t;ue=!0;const n=null!=(t=null==e?void 0:e.default)?t:e,o=document.createElement("div");o.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(o);const r=function(){var e,t,n,o;const r=g,l=e=>"function"==typeof e&&"function"==typeof e.extend,i=[r,null==r?void 0:r.default,null==(e=null==r?void 0:r.default)?void 0:e.default,null==(n=null!=(t=null==r?void 0:r.default)?t:r)?void 0:n.default,null==r?void 0:r.Vue2,null==r?void 0:r.Vue];for(const a of i){if(l(a))return a;if(l(null==a?void 0:a.default))return a.default}return null!=(o=null==r?void 0:r.default)?o:r}();(new(r.extend({render(e){var t;return e(n,{props:{visible:G.value,anchorEl:te.value,content:J.value,placement:ee.value,id:ne.value,originX:oe.value,originY:re.value,isDark:null!=(t=le.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{ce=null,ue=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),ce)}function pe(e,t,n="top",o=!1,r,l){if(!e)return;de(),se();const i=()=>{var o,i;ne.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,te.value=e,J.value=t,ee.value=n,oe.value=null!=(o=null==r?void 0:r.x)?o:null,re.value=null!=(i=null==r?void 0:r.y)?i:null,le.value="boolean"==typeof l?l:null,G.value=!0;try{e.setAttribute("aria-describedby",ne.value)}catch(a){}};o?i():ie=setTimeout(i,80)}function me(e=!1){se();const t=()=>{if(te.value&&ne.value)try{te.value.removeAttribute("aria-describedby")}catch(e){}G.value=!1,te.value=null,ne.value=null,oe.value=null,re.value=null};e?t():ae=setTimeout(t,120)}const fe={"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 he(){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{t:e=>{var t;return null!=(t=fe[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 ve=Symbol("ViewportPriority");function ge(){const e=m.inject(ve,void 0);if(e)return e;const t=new WeakMap;let n=null;return e=>{const o=m.ref(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!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 r of e){const e=t.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(r.target),t.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const ye=k(m.defineComponent({__name:"ImageNode",props:{node:null,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=m.ref(!1),r=m.ref(!1),l=m.ref(!1),i=m.ref(null),a=ge();let s=null;const u=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>i.value,e=>{if(null==s||s.destroy(),s=null,!e)return void(u.value=!1);const t=a(e,{rootMargin:"400px"});s=t,u.value=t.isVisible.value,t.whenVisible.then(()=>{u.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==s||s.destroy(),s=null});const c=m.computed(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),d=m.computed(()=>!n.lazy||u.value),p=m.computed(()=>/\.svg(?:\?|$)/i.test(c.value)),{t:f}=he();return m.watch(c,()=>{o.value=!1,r.value=!1}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,fallbackTried:l,figureRef:i,registerVisibility:a,visibilityHandle:s,isVisible:u,displaySrc:c,canRenderImage:d,isSvg:p,handleImageError:function(){n.fallbackSrc&&!l.value?(l.value=!0,r.value=!0):(r.value=!0,t("error",n.node.src))},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",c.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,c.value])},t:f}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("figure",{ref:"figureRef",staticClass:"text-center my-8"},[i("div",{staticClass:"relative inline-block"},[i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[l.node.loading||a.hasError||!a.canRenderImage?a.hasError?l.node.loading||a.props.fallbackSrc?l._e():i("div",{key:"error",staticClass:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},[l._t("error",function(){return[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"}},[i("path",{attrs:{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"}})]),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loadError")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy,isSvg:a.isSvg})],2):i("div",{key:"placeholder",staticClass:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:a.isSvg?{minHeight:a.props.svgMinHeight,width:"100%"}:{minHeight:"6rem"}},[a.props.usePlaceholder?[l._t("placeholder",function(){return[i("div",{staticClass:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin",attrs:{"aria-hidden":"true"}}),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loading")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy,isSvg:a.isSvg})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):i("img",{key:"image",staticClass:"max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},style:a.isSvg?{minHeight:a.props.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0,attrs:{src:a.displaySrc,alt:String(null!=(t=null!=(e=a.props.node.alt)?e:a.props.node.title)?t:""),title:String(null!=(o=null!=(n=a.props.node.title)?n:a.props.node.alt)?o:""),loading:a.props.lazy?"lazy":"eager",decoding:"async",tabindex:a.imageLoaded?0:-1,"aria-label":null!=(r=a.props.node.alt)?r:a.t("image.preview")},on:{error:a.handleImageError,load:a.handleImageLoad,click:a.handleClick}})])],1),a.props.showCaption&&a.props.node.alt?i("figcaption",{staticClass:"mt-2 text-sm text-gray-500 italic"},[l._v(" "+l._s(a.props.node.alt)+" ")]):l._e()])},[],!1,null,"2b49bba9",null,null).exports;let we=null,xe=!1,Me=Ce;function ke(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function be(){try{const e=globalThis;return ke(null==e?void 0:e.katex)}catch(e){return null}}function Ce(){return(()=>d(this,null,function*(){const e=be();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./mhchem.js"))}catch(n){}return ke(t)}))()}function Te(e){Me=e,we=null,xe=!1}function Ne(){return"function"==typeof Me}function De(){return d(this,null,function*(){var e;const t=be();if(t)return we=t,we;if(we)return we;if(xe)return null;const n=Me;if(!n)return xe=!0,null;try{const t=yield n();if(t)return we=null!=(e=ke(t))?e:t,we}catch(o){}return xe=!0,null})}const _e=m.shallowRef(!1);let je=null;function Ie(){return je||(je=De().then(e=>{_e.value=!!e}).catch(()=>{_e.value=!1})),m.readonly(_e)}const Ee=k(m.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup:e=>({__sfc:!0,katexReady:Ie()})}),function(){var e=this;return(0,e._self._c)("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[e._self._setupProxy.katexReady&&e.node.center?"text-node-center":""]},[e._v(" "+e._s(e.node.content)+" ")])},[],!1,null,"56f30838",null,null).exports;function Le(e){return t=>{var n,o;return m.h(Ee,c(u({},t),{node:c(u({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function Se(){return d(this,null,function*(){var e,t,n;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 Le(e=>`$${e}$`);try{if(yield De()){const e=yield Promise.resolve().then(()=>require("./index.js"));return null!=(n=e.default)?n:e}}catch(o){console.warn('[markstream-vue2] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',o)}return Le(e=>`$${e}$`)})}function Be(){return d(this,null,function*(){var e;try{if(yield De()){const t=yield Promise.resolve().then(()=>require("./index2.js"));return null!=(e=t.default)?e:t}}catch(t){console.warn('[markstream-vue2] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return Le(e=>`$$${e}$$`)})}const Ae=k(m.defineComponent({__name:"ReferenceNode",props:{node:null,messageId:null,threadId:null},emits:["click","mouseEnter","mouseLeave"],setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",attrs:{role:"button",tabindex:"0"},on:{click:function(t){return e.$emit("click",t,e.node.id,e.messageId,e.threadId)},mouseenter:function(t){return e.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)},mouseleave:function(t){return e.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId)}}},[e._v(" "+e._s(e.node.id)+" ")])},[],!1,null,null,null,null).exports,Oe=k(m.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,strong:Pe,emphasis:Fe,footnote_reference:E,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,emoji:T,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"superscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"superscript"}-${r}`,staticClass:"superscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"ef2512b4",null,null).exports,ze=k(m.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,strong:Pe,emphasis:Fe,footnote_reference:E,strikethrough:Re,highlight:Ue,insert:He,superscript:Oe,emoji:T,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sub",{staticClass:"subscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"subscript"}-${r}`,staticClass:"subscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"3d49d031",null,null).exports,Pe=k(m.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,emphasis:Fe,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,superscript:Oe,emoji:T,footnote_reference:E,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("strong",{staticClass:"strong-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strong"}-${r}`,tag:"component",attrs:{"index-key":`${e.indexKey||"strong"}-${r}`,node:o,"custom-id":n.props.customId}})}),1)},[],!1,null,"af3ce037",null,null).exports,Re=k(m.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,strong:Pe,emphasis:Fe,highlight:Ue,insert:He,subscript:ze,superscript:Oe,emoji:T,footnote_reference:E,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("del",{staticClass:"strikethrough-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strikethrough"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`}})}),1)},[],!1,null,"904d5bd1",null,null).exports,$e=k(m.defineComponent({__name:"LinkNode",props:{node:null,indexKey:null,customId:null,showTooltip:{type:Boolean,default:!0},color:null,underlineHeight:null,underlineBottom:null,animationDuration:null,animationOpacity:null,animationTiming:null,animationIteration:null},setup(e){const t=e,n={x:0,y:0,hasValue:!1};let o=0,r=null;function l(){if(r||"undefined"==typeof window)return;const e=e=>{"number"==typeof e.clientX&&"number"==typeof e.clientY&&(n.x=e.clientX,n.y=e.clientY,n.hasValue=!0)};window.addEventListener("pointermove",e,!0),window.addEventListener("mousemove",e,!0),r=()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("mousemove",e,!0)}}function i(){l(),o+=1}function a(){o=Math.max(0,o-1),!o&&r&&(r(),r=null)}const s=m.computed(()=>{var e,n,o,r,l,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!=(r=t.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),c={text:Ee,strong:Pe,strikethrough:Re,emphasis:Fe,image:ye,html_inline:q},d=m.useAttrs(),p=m.ref(null),f=m.ref(!1),h=m.computed(()=>{const e=u({},d);return delete e.title,e});function v(){var e,n,o;return(null==(e=t.node)?void 0:e.title)||(null==(n=t.node)?void 0:n.href)||(null==(o=t.node)?void 0:o.text)||""}function g(e){if(!e||!n.hasValue)return!1;const t=e.getBoundingClientRect();return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function y(){t.showTooltip&&p.value&&g(p.value)&&(f.value=!0,pe(p.value,v(),"top",!0,{x:n.x,y:n.y}))}const w=m.computed(()=>{var e,n,o;const r=null==(e=t.node)?void 0:e.title;return"string"==typeof r&&r.trim().length>0?r:String(null!=(o=null==(n=t.node)?void 0:n.href)?o:"")});return m.onMounted(()=>{i(),t.showTooltip&&de(),m.nextTick(()=>{y()})}),m.onUpdated(()=>{y()}),m.onBeforeUnmount(()=>{a(),f.value&&(f.value=!1,me(!0))}),{__sfc:!0,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,props:t,cssVars:s,nodeComponents:c,attrs:d,anchorEl:p,isHovering:f,anchorAttrs:h,getTooltipText:v,isPointerInsideAnchor:g,syncTooltipForHoveredAnchor:y,onAnchorEnter:function(e){if(!t.showTooltip)return;f.value=!0;const 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;pe(p.value||e.currentTarget,v(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(f.value=!1,me())},title:w}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return e.node.loading?t("span",e._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:n.cssVars,attrs:{"aria-hidden":e.node.loading?"false":"true"}},"span",n.attrs,!1),[t("span",{staticClass:"link-text-wrapper relative inline-flex"},[t("span",{staticClass:"leading-[normal] link-text"},[t("span",{staticClass:"leading-[normal] link-text"},[e._v(e._s(e.node.text))])]),t("span",{staticClass:"underline-anim",attrs:{"aria-hidden":"true"}})])]):t("a",e._b({ref:"anchorEl",staticClass:"link-node",style:n.cssVars,attrs:{href:e.node.href,title:e.showTooltip?"":n.title,"aria-label":`Link: ${n.title}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},on:{mouseenter:e=>n.onAnchorEnter(e),mouseleave:n.onAnchorLeave}},"a",n.anchorAttrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"link-text"}-${r}`}})}),1)},[],!1,null,"20c73484",null,null).exports,He=k(m.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,strong:Pe,emphasis:Fe,strikethrough:Re,highlight:Ue,subscript:ze,superscript:Oe,emoji:T,footnote_reference:E,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("ins",{staticClass:"insert-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"insert"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"insert"}-${r}`}})}),1)},[],!1,null,"ab1ec9bc",null,null).exports,Ue=k(m.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,strong:Pe,emphasis:Fe,strikethrough:Re,insert:He,subscript:ze,superscript:Oe,emoji:T,footnote_reference:E,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("mark",{staticClass:"highlight-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"highlight"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"highlight"}-${r}`}})}),1)},[],!1,null,"38e31bf6",null,null).exports,Fe=k(m.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,html_inline:q,strong:Pe,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,superscript:Oe,emoji:T,footnote_reference:E,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("em",{staticClass:"emphasis-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`}})}),1)},[],!1,null,"8264674d",null,null).exports,Ye=k(m.defineComponent({__name:"FootnoteAnchorNode",props:{node:null},setup(e){const t=e;return{__sfc:!0,props:t,scrollToReference:function(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("a",{staticClass:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4756ce0d",null,null).exports,We=k(m.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?lt:ot);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`footnote-${n.props.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)])},[],!1,null,null,null,null).exports,Qe=k(m.defineComponent({__name:"HardBreakNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("br",{staticClass:"hard-break"})},[],!1,null,"50c58f70",null,null).exports,Ke=k(m.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Ee,inline_code:Z,link:$e,image:ye,strong:Pe,emphasis:Fe,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,superscript:Oe,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:E,hardbreak:Qe,math_inline:Se,reference:Ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,e._b({tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},"component",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"heading"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"heading"}-${r}`}})}),1)},[],!1,null,"ffb7cf51",null,null).exports,Ve=k(m.defineComponent({__name:"ListItemNode",props:{node:null,item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=m.computed(()=>null==t.value?{}:{value:t.value}),r=m.getCurrentInstance(),l=m.computed(()=>w(null==r?void 0:r.proxy)?lt:ot);return{__sfc:!0,props:t,itemNode:n,liValueAttr:o,instance:r,nestedRenderer:l}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return o("li",n._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",r.liValueAttr,!1),[o(r.nestedRenderer,n._b({tag:"component",attrs:{"index-key":`list-item-${r.props.indexKey}`,nodes:null!=(t=null==(e=r.itemNode)?void 0:e.children)?t:[],"custom-id":r.props.customId,typewriter:r.props.typewriter,"batch-rendering":!1},on:{copy:function(e){return n.$emit("copy",e)}}},"component",{showTooltips:r.props.showTooltips},!1))],1)},[],!1,null,"c8bfe64d",null,null).exports,Xe=k(m.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const{node:t,customId:n,indexKey:o,typewriter:r,showTooltips:l}=e;return{__sfc:!0,listItemComponent:m.computed(()=>(j.value,I(n).list_item||Ve))}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(e.node.ordered?"ol":"ul",{tag:"component",staticClass:"list-node",class:{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}},e._l(e.node.items,function(o,r){var l;return t(n.listItemComponent,e._b({key:`${e.indexKey||"list"}-${r}`,tag:"component",attrs:{node:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(l=e.node.start)?l:1)+r:void 0},on:{copy:function(t){return e.$emit("copy",t)}}},"component",{showTooltips:e.showTooltips},!1))}),1)},[],!1,null,"91e6dafc",null,null).exports,qe=k(m.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null},setup(e){const t=e,n=m.computed(()=>{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=m.computed(()=>I(t.customId)),r=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0}},render(){return X(this.content,this.customComponents)||[]}}),l=m.computed(()=>{const e=t.node.content;return e?V(e,o.value)?{mode:"dynamic",content:e}:{mode:"html",content:e}:{mode:"html",content:""}}),i=m.ref(null),a=m.ref("undefined"==typeof window),s=m.ref(t.node.content),u=ge();let c=null;const d=!!t.node.loading;return"undefined"!=typeof window?(m.watch(i,e=>{var n;if(null==(n=null==c?void 0:c.destroy)||n.call(c),c=null,!d)return a.value=!0,void(s.value=t.node.content);if(!e)return void(a.value=!1);const o=u(e,{rootMargin:"400px"});c=o,a.value=o.isVisible.value,o.whenVisible.then(()=>{a.value=!0})},{immediate:!0}),m.watch(()=>t.node.content,e=>{d&&!a.value||(s.value=e)})):a.value=!0,m.onBeforeUnmount(()=>{var e;null==(e=null==c?void 0:c.destroy)||e.call(c),c=null}),{__sfc:!0,props:t,boundAttrs:n,customComponents:o,DynamicRenderer:r,renderMode:l,htmlRef:i,shouldRender:a,renderContent:s,registerVisibility:u,visibilityHandle:c,isDeferred:d}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({ref:"htmlRef",staticClass:"html-block-node"},"div",n.boundAttrs,!1),[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents}}):t("div",{domProps:{innerHTML:e._s(n.renderContent)}})]:t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)],2)},[],!1,null,"53b53d7c",null,null).exports,Ze=k(m.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({inline_code:Z,image:ye,link:$e,hardbreak:Qe,emphasis:Fe,strong:Pe,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,superscript:Oe,html_inline:q,html_block:qe,emoji:T,checkbox:b,math_inline:Se,checkbox_input:b,reference:Ae,footnote_anchor:Ye,footnote_reference:E},n),katexReady:Ie()}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},e._l(e.node.children,function(o,r){var l;return t("span",{key:`${e.indexKey||"paragraph"}-${r}`,staticClass:"paragraph-child"},["text"!==o.type&&n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"index-key":`${null!=(l=e.indexKey)?l:"paragraph"}-${r}`,"custom-id":n.props.customId}}):t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&o.center?"text-node-center":""]},[e._v(" "+e._s(o.content||o.raw||"")+" ")])],1)}),0)},[],!1,null,"3b03e3af",null,null).exports,Ge=k(m.defineComponent({__name:"PreCodeNode",props:{node:null},setup(e){const t=e,n=m.computed(()=>{var e,n,o;const r=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=m.computed(()=>`language-${n.value}`),r=m.computed(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return{__sfc:!0,props:t,normalizedLanguage:n,languageClass:o,ariaLabel:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("pre",{class:[n.languageClass],attrs:{"aria-busy":!0===e.node.loading,"aria-label":n.ariaLabel,"data-language":n.normalizedLanguage,tabindex:"0"}},[t("code",{attrs:{translate:"no"},domProps:{textContent:e._s(e.node.code)}})])},[],!1,null,null,null,null).exports,Je=k(m.defineComponent({__name:"TableNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node.loading)&&e}),o=m.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=m.getCurrentInstance(),l=m.computed(()=>w(null==r?void 0:r.proxy)?lt:ot);return{__sfc:!0,props:t,isLoading:n,bodyRows:o,instance:r,nestedRenderer:l}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[t("thead",{staticClass:"border-[var(--table-border,#cbd5e1)] border-solid"},[t("tr",{staticClass:"border-b border-solid"},e._l(e.node.header.cells,function(o,r){return t("th",{key:`header-${r}`,staticClass:"font-semibold p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-th-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)]),t("tbody",e._l(n.bodyRows,function(o,r){return t("tr",{key:`row-${r}`,staticClass:"border-[var(--table-border,#cbd5e1)] border-solid",class:[r<n.bodyRows.length-1?"border-b":""]},e._l(o.cells,function(o,l){return t("td",{key:`cell-${r}-${l}`,staticClass:"p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-td-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)}),0)]),t("transition",{attrs:{name:"table-node-fade"}},[n.isLoading?t("div",{staticClass:"table-node__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"table-node__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.isLoading})],2):e._e()])],1)},[],!1,null,"07f7775d",null,null).exports,et=k(m.defineComponent({__name:"ThematicBreakNode",setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("hr",{staticClass:"hr-node"})},[],!1,null,"639cbad9",null,null).exports,tt=k(m.defineComponent({__name:"FallbackComponent",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"unknown-node"},[e._v(" "+e._s(e.node.raw)+" ")])},[],!1,null,"89aff01f",null,null).exports,nt=k(m.defineComponent({__name:"VmrContainerNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.computed(()=>`vmr-container vmr-container-${t.node.name}`),o=I(t.customId),r=u({text:Ee,paragraph:Ze,heading:Ke,inline_code:Z,link:$e,image:ye,strong:Pe,emphasis:Fe,strikethrough:Re,insert:He,subscript:ze,superscript:Oe,checkbox:b,checkbox_input:b,hardbreak:Qe,math_inline:Se,reference:Ae,list:Xe,math_block:Be,table:Je},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||tt}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({class:n.containerClass},"div",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.getNodeComponent(o.type),{key:`${e.indexKey||"vmr-container"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"vmr-container"}-${r}`}})}),1)},[],!1,null,"3cd2aff2",null,null).exports,ot=k(m.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,showTooltips:{type:Boolean,default:!0},themes:null,isDark:{type:Boolean},customId:null,indexKey:null,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,r;const l=e,i=m.ref(),a=m.ref(!1),s=/auto|scroll|overlay/i,f="undefined"!=typeof window,v=m.computed(()=>l.debugPerformance&&f&&"undefined"!=typeof console);function g(e,t){v.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function y(e){if("undefined"==typeof window)return null;const t=null!=e?e:i.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let r=t;for(;r&&r!==n.body&&r!==o;){const e=window.getComputedStyle(r),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(s.test(t)||s.test(n))return r;r=r.parentElement}return null}const x=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,M=p.getMarkdown(x),k=new Map,N=m.markRaw([]),D=m.computed(()=>{const{key:e,tags:t}=S(l.customHtmlTags);if(!e)return M;const n=k.get(e);if(n)return n;const o=p.getMarkdown(x,{customHtmlTags:t});return k.set(e,o),o}),_=m.computed(()=>{const e=D.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function L(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():""}function S(e){if(!e||0===e.length)return{key:"",tags:[]};const t=new Set,n=[];for(const o of e){const e=L(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return 0===n.length?{key:"",tags:[]}:{key:n.join(","),tags:n}}function B(e){if(Array.isArray(e))return Object.freeze(e.map(e=>B(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=B(o);return Object.freeze(t)}function A(e){return e.map(e=>B(e))}const O=m.computed(()=>{var e,t,n,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(t=l.final)?t:r.final,a=[...null!=(n=l.customHtmlTags)?n:[],...null!=(o=r.customHtmlTags)?o:[]].map(L).filter(Boolean),s=null!=i,c=a.length>0;return s||c?u(u(u({},r),s?{final:i}:{}),c?{customHtmlTags:Array.from(new Set(a))}:{}):r}),z=m.computed(()=>{var e;if(ke.value)return N;if(null==(e=l.nodes)?void 0:e.length)return m.markRaw(A(l.nodes));if(l.content){const e=v.value?performance.now():0,t=p.parseMarkdownToStructure(l.content,_.value,O.value);return v.value&&g("parse(sync)",{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:l.content.length}),m.markRaw(A(t))}return[]}),P=m.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),R=m.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&z.value.length>P.value}),$=m.computed(()=>!1!==l.viewportPriority&&!a.value),H=function(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?m.ref(t):t;let r=null,l=null;const i=new WeakMap,a=(t,a)=>{const s=m.ref(!1);let c,d=!1;const p=new Promise(e=>{c=()=>{d||(d=!0,e())}}),f=()=>{try{null==r||r.unobserve(t)}catch(e){}i.delete(t)};if(!n||!o.value)return s.value=!0,c(),{isVisible:s,whenVisible:p,destroy:f};!l&&a&&(l=u({},a));const h=function(t){var o,a,s;if(r||!n)return r;if("undefined"==typeof IntersectionObserver)return null;const u=null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,c=l||{};return r=new IntersectionObserver(e=>{for(const n of e){const e=i.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(t){}}null==r||r.unobserve(n.target),i.delete(n.target)}}},{root:u,rootMargin:null!=(a=c.rootMargin)?a:"300px",threshold:null!=(s=c.threshold)?s:0}),r}(t);return h?(i.set(t,{resolve:c,visible:s}),h.observe(t),{isVisible:s,whenVisible:p,destroy:f}):(s.value=!0,c(),{isVisible:s,whenVisible:p,destroy:f})};return m.provide(ve,a),a}(e=>{var t;return y(null!=(t=null!=e?e:i.value)?t:null)},$),U=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,F=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,Y="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),W=f&&"function"==typeof window.requestIdleCallback,Q=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),K=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:Q.value);return Number.isFinite(t)?Math.max(0,t):Q.value}),V=m.computed(()=>!1!==l.batchRendering&&Q.value>0&&f&&!Y),X=m.ref(0),G=m.ref({key:l.indexKey,total:0}),J=m.ref(Math.max(1,Q.value||1)),ee=m.reactive({}),te=new Map,ne=new Map,oe=new Map,re=m.ref(0),le=m.computed(()=>(re.value,Array.from(oe.entries()).sort((e,t)=>e[0]-t[0]))),ie=m.ref(null);let ae=null,se=null;const ue=m.reactive({start:0,end:0}),ce=m.computed(()=>{if(!R.value)return z.value.map((e,t)=>({node:e,index:t}));const e=z.value.length,t=ct(ue.start,0,e),n=ct(ue.end,t,e);return z.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),de=m.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!R.value&&!(z.value.length>900)&&$.value}),pe=m.computed(()=>{var e;return V.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),me=m.ref({batchSize:Q.value,initial:K.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:pe.value}),fe=m.computed(()=>!!H&&(de.value||R.value)),he=m.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),ge=m.ref(0),we=new Map,xe=m.getCurrentInstance(),Me=m.computed(()=>w(null==xe?void 0:xe.proxy)),ke=m.computed(()=>Me.value&&!l.content&&Array.isArray(l.nodes)),be=m.computed(()=>ke.value?m.markRaw(A(l.nodes||[])):N);function Ce(){var e,t;const n=null==xe?void 0:xe.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of ce.value){const n=Te(o[`node-slot-${l.index}`]),i=Te(o[`node-content-${l.index}`]);(null!=(e=oe.get(l.index))?e:null)!==n&&Et(l.index,n),(null!=(t=we.get(l.index))?t:null)!==i&&St(l.index,i),r.add(l.index)}for(const l of Array.from(oe.keys()))r.has(l)||Et(l,null);for(const l of Array.from(we.keys()))r.has(l)||St(l,null)}function Te(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const Ne=m.computed(()=>{if(!R.value)return z.value.length;const e=he.value,t=Math.max(ue.end+e,K.value),n=Math.min(z.value.length,t);return Math.max(X.value,n)});function De(e){var t,n,o,r;const l=y(null!=(t=null!=e?e:i.value)?t:null);if(l)return l;const a=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(n=i.value)?void 0:n.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==a?void 0:a.scrollingElement)||(null==a?void 0:a.documentElement)||null}function _e(e){if(!f)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function je(e,t,n){var o,r,l,i,a,s;if(n)return null!=(i=null!=(l=null==(o=null==t?void 0:t.documentElement)?void 0:o.scrollTop)?l:null==(r=null==t?void 0:t.body)?void 0:r.scrollTop)?i:0;const u=e.scrollTop;if(!_e(e))return u;const c=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-c}function Ie(e,t){let n=e,o=0,r=0;for(;n&&n!==t&&r++<64;)o+=n.offsetTop||0,n=n.offsetParent;return o}function Le(){ae&&(ae(),ae=null),ie.value=null}function ot(){if(!f||!R.value)return;const e=De();if(!e||ie.value===e)return;Le();const t=()=>st();e.addEventListener("scroll",t,{passive:!0}),ie.value=e,ae=()=>{e.removeEventListener("scroll",t)}}function at(){var e,t,n;if(!se)return;const o=null!=(n=null==(t=null==(e=i.value)?void 0:e.ownerDocument)?void 0:t.defaultView)?n:"undefined"!=typeof window?window:null;se.viaTimeout?o?o.clearTimeout(se.id):clearTimeout(se.id):null==F||F(se.id),se=null}function st(e={}){var t,n,o;if(!R.value)return;if(!f)return void ut(!0);if(e.immediate)return at(),void ut(!0);if(se)return;const r=()=>{se=null,ut()};if(U)se={id:U(r),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=i.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);se={id:l,viaTimeout:!0}}}function ut(e=!1){var t,n,o,r,l,a,s;if(!R.value)return;const u=ie.value||De();if(!u)return;const c=u.ownerDocument||(null==(t=i.value)?void 0:t.ownerDocument)||document,d=(null==c?void 0:c.defaultView)||("undefined"!=typeof window?window:null),p=u===(null==c?void 0:c.documentElement)||u===(null==c?void 0:c.body),m=z.value.length;if(!p&&m>0&&_e(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=ct(Dt(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,m-1));return void((e||Math.abs(r-ge.value)>1)&&(ge.value=r))}const f=p?null:u.getBoundingClientRect(),h=p?0:f.top,v=p?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=le.value;let y=null,w=null;for(const[i,M]of g){if(!M)continue;const e=M.getBoundingClientRect();e.bottom<=h||e.top>=v||(null==y&&(y=i),w=i)}if(null==y||null==w){const e=i.value;if(!e)return;const t=p?{top:0}:u.getBoundingClientRect(),n=je(u,c,p),o=p?(()=>{const n=e.getBoundingClientRect(),o=(p?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=Ie(e,u);return Math.max(0,n-t)})(),m=p?null!=(s=null!=(a=null!=(l=null==d?void 0:d.innerHeight)?l:null==(r=null==c?void 0:c.documentElement)?void 0:r.clientHeight)?a:u.clientHeight)?s:0:u.clientHeight,f=Nt(o+.5*Math.max(0,m));return void(ge.value=ct(f,0,Math.max(0,z.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-ge.value)<=1||(ge.value=ct(x,0,Math.max(0,z.value.length-1)))}function ct(e,t,n){return Math.min(Math.max(e,t),n)}function dt(){const e=z.value.length;if(!R.value||0===e)return ue.start=0,void(ue.end=e);const t=Math.min(P.value,e),n=he.value,o=ct(ge.value-n,0,Math.max(0,e-t));ue.start=o,ue.end=Math.min(e,o+t)}const pt=m.reactive({}),mt=m.reactive({total:0,count:0}),ft=m.ref(0),ht=m.ref([]),vt=m.ref([]);function gt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function yt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function wt(e,t,n){if(n<=t)return 0;const o=yt(e,n-1);return t<=0?o:o-yt(e,t-1)}function xt(e){ft.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(pt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(gt(t,l,i),gt(n,l,1))}ht.value=t,vt.value=n}function Mt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=pt[e];if(pt[e]=t,n?mt.total+=t-n:(mt.total+=t,mt.count++),ft.value>e){const o=ht.value,r=vt.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&>(o,e,r)}else gt(o,e,t),gt(r,e,1)}}const kt=m.computed(()=>mt.count>0?Math.max(12,mt.total/mt.count):32);function bt(e,t){var n,o;if(e>=t)return 0;if(ft.value!==z.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=pt[r])?n:kt.value;return o}const r=ht.value,l=vt.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=pt[r])?o:kt.value;return n}return wt(r,e,t)+(t-e-wt(l,e,t))*kt.value}m.watch(()=>z.value.length,e=>{if(e<=0)return ft.value=0,ht.value=[],void(vt.value=[]);e!==ft.value&&xt(e)},{immediate:!0});const Ct=m.computed(()=>R.value?bt(0,Math.min(ue.start,z.value.length)):0),Tt=m.computed(()=>{if(!R.value)return 0;const e=z.value.length;return bt(Math.min(ue.end,e),e)});function Nt(e){var t;if(e<=0)return 0;const n=z.value;if(ft.value===n.length&&ht.value.length&&vt.value.length){const t=kt.value,o=ht.value,r=vt.value,l=e=>e<=0?0:yt(o,e-1)+(e-yt(r,e-1))*t;let i=0,a=n.length-1,s=n.length-1;for(;i<=a;){const t=i+a>>1;l(t+1)>=e?(s=t,a=t-1):i=t+1}return s}let o=e;for(let r=0;r<n.length;r++){const e=null!=(t=pt[r])?t:kt.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function Dt(e){var t;const n=z.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(ft.value===n.length){const t=bt(0,n.length);return Nt(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=pt[r])?t:kt.value;if(o<=e)return r;o-=e}return 0}function _t(e){if(!te.size)return;if(!R.value)return;let t=!1;for(const[n,o]of te)n>=e&&(o.destroy(),te.delete(n),de.value&&delete ee[n],$t(n),oe.delete(n)&&(t=!0));t&&Lt()}function jt(e,t){de.value&&(ee[e]=t),t&&(R.value?st():ge.value=ct(e,0,Math.max(0,z.value.length-1)))}function It(e){const t=te.get(e);t&&(t.destroy(),te.delete(e)),$t(e)}function Et(e,t){let n=!1;if(t){const o=oe.get(e);oe.set(e,t),o!==t&&(n=!0)}else oe.delete(e)&&(n=!0);if(n&&Lt(),t||$t(e),!fe.value||!H)return It(e),void(t?jt(e,!0):de.value&&delete ee[e]);if(!R.value&&de.value&&!a.value&&te.size>=640&&(Ut("too-many-targets"),!fe.value||!H))return It(e),void(t?jt(e,!0):de.value&&delete ee[e]);if(e<K.value&&!R.value)return It(e),void jt(e,!0);if(!t)return It(e),void(de.value&&delete ee[e]);It(e);const o=H(t,{rootMargin:"400px"});o&&(te.set(e,o),jt(e,o.isVisible.value),de.value&&Ht(e),o.whenVisible.then(()=>{$t(e),jt(e,!0)}).catch(()=>{}).finally(()=>{te.get(e)===o&&te.delete(e);try{o.destroy()}catch(t){}}),R.value&&st())}function Lt(){re.value+=1}function St(e,t){t?(we.set(e,t),queueMicrotask(()=>{Mt(e,t.offsetHeight)})):we.delete(e)}m.onMounted(()=>{f&&m.nextTick(Ce)}),m.watch(ce,()=>{f&&m.nextTick(Ce)}),m.watch(X,()=>{f&&m.nextTick(Ce)}),m.watch(R,()=>{f&&m.nextTick(Ce)});let Bt=null,At=null,Ot=!1,zt=null,Pt=null;function Rt(){f&&(null!=Bt&&(null==F||F(Bt),Bt=null),null!=At&&(window.clearTimeout(At),At=null),null!=Pt&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Pt),Pt=null),Ot=!1,zt=null)}function $t(e){if(!f)return;const t=ne.get(e);null!=t&&(window.clearTimeout(t),ne.delete(e))}function Ht(e){if(!f||!de.value)return;$t(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(ne.delete(e),!de.value)return;if(!0===ee[e])return;const o=oe.get(e);if(!o)return void delete ee[e];const r=De(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,u=a?0:s.top,c=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,d=o.getBoundingClientRect();d.bottom>=u-500&&d.top<=c+500&&jt(e,!0)},1800+t);ne.set(e,n)}function Ut(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&"undefined"!=typeof console&&console.warn("[markstream-vue2] viewportPriority auto-disabled:",e);for(const e of te.values())e.destroy();if(te.clear(),f)for(const e of ne.values())window.clearTimeout(e);ne.clear();for(const e of Object.keys(ee))delete ee[e]}}function Ft(e,t={}){var n,o;if(!pe.value)return;const r=Ne.value;if(X.value>=r)return;const i=Math.max(1,e),a=e=>{var t;Bt=null,At=null,Pt=null,Ot=!1;const n=null!=zt?zt:i;zt=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();X.value=Math.min(r,X.value+Math.max(1,e)),_t(X.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return Wt(n),n};let s=n;for(;(a(s),!(X.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(J.value));X.value<r&&Yt()};if(!f||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(zt=null!=zt?Math.max(zt,i):i,!Ot){if(Ot=!0,!Y&&W&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(Pt=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}U&&!Y?Bt=U(()=>{0!==s?At=window.setTimeout(()=>a(),s):a()}):At=window.setTimeout(()=>a(),s)}}function Yt(){pe.value&&Ft(V.value?Math.max(1,Math.round(J.value)):Math.max(1,Q.value))}function Wt(e){var t;if(!pe.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,Q.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?J.value=Math.max(r,Math.floor(.7*J.value)):e<.5*n&&J.value<o&&(J.value=Math.min(o,Math.ceil(1.2*J.value)))}function Qt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./index3.js"));return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] 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".',t),Ge}})}function Kt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./index4.js"));return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',t),Ge}})}function Vt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./index5.js"));return null!=(e=t.default)?e:t}catch(t){return console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",t),Ge}})}function Xt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>dn);return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',t),Ge}})}m.watch([()=>z.value,()=>z.value.length,()=>pe.value,()=>Q.value,()=>K.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=z.value.length,n=G.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;G.value={key:o,total:t};const s=me.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==Q.value||s.initial!==K.value||s.delay!==u||s.enabled!==pe.value;me.value={batchSize:Q.value,initial:K.value,delay:u,enabled:pe.value},(a||c||!pe.value)&&Rt(),(a||c)&&(J.value=Math.max(1,Q.value||1)),a&&R.value&&st({immediate:!0});const d=Ne.value;if(!t)return 0!==X.value&&(X.value=0),void _t(0);if(!pe.value)return X.value!==d&&(X.value=d),void _t(X.value);if(r||0===n.total||c){const e=Math.min(d,K.value);X.value!==e&&(X.value=e)}else{const e=Math.min(X.value,d);X.value!==e&&(X.value=e)}const p=Math.max(1,K.value||Q.value||t);X.value<d?Ft(p,{immediate:!f}):_t(X.value)},{immediate:!0}),m.watch(()=>R.value,e=>{if(!e)return Le(),void at();ot(),st({immediate:!0})},{immediate:!0}),m.watch([()=>z.value.length,()=>R.value],e=>d(this,[e],function*([e,t]){t&&e&&f&&(yield m.nextTick(),st({immediate:!0}))}),{flush:"post"}),m.watch(()=>i.value,()=>{R.value&&(ot(),st({immediate:!0}))}),m.watch(()=>z.value.length,()=>{R.value&&st({immediate:!0})}),m.watch(()=>de.value,e=>{if(e)for(const[t,n]of oe)Et(t,n);else{for(const e of te.values())e.destroy();te.clear();for(const e of Array.from(ne.keys()))$t(e);for(const e of Object.keys(ee))delete ee[e];for(const[e,t]of oe)t&&jt(e,!0)}},{immediate:!1}),m.watch([()=>l.viewportPriority,()=>z.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),m.watch(()=>X.value,()=>{R.value&&st({immediate:!0})}),m.watch([ge,P,he,()=>z.value.length,R],()=>{dt()},{immediate:!0}),m.watch([()=>z.value.length,R,P,he,()=>ue.start,()=>ue.end],([e,t,n,o,r,l])=>{v.value&&g("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:ge.value,scroll:t?(()=>{const e=ie.value||De();return e?{reverse:_e(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:X.value})}),m.watch(()=>Ne.value,(e,t)=>{pe.value&&("number"==typeof t&&e<=t||e>X.value&&Yt())}),m.onBeforeUnmount(()=>{Rt();for(const e of te.values())e.destroy();te.clear();for(const e of Array.from(ne.keys()))$t(e);Le(),at()});const qt=m.computed(()=>l.renderCodeBlocksAsPre?Ge:Qt),Zt={text:Ee,paragraph:Ze,heading:Ke,code_block:Qt,list:Xe,list_item:Ve,blockquote:rt,table:Je,definition_list:C,footnote:We,footnote_reference:E,footnote_anchor:Ye,admonition:it,vmr_container:nt,hardbreak:Qe,link:$e,image:ye,thematic_break:et,math_inline:Se,math_block:Be,strong:Pe,emphasis:Fe,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,superscript:Oe,emoji:T,checkbox:b,checkbox_input:b,inline_code:Z,html_inline:q,reference:Ae,html_block:qe},Gt=m.computed(()=>(j.value,I(l.customId))),Jt=m.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),en={},tn=m.computed(()=>u(u({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{}),l.codeBlockProps||{})),nn=m.computed(()=>({typewriter:l.typewriter})),on=m.computed(()=>u(u({},nn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),rn=m.computed(()=>u(u({},nn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),ln=m.computed(()=>be.value.map((e,t)=>{const n=un(e);return{node:e,component:mn(e,n),bindings:fn(e,n),isCodeBlock:"code_block"===e.type,index:t,indexKey:`${Jt.value}-${t}`,renderKey:pn(e,t)}})),an=m.computed(()=>!(!Me.value||!l.content)&&z.value.some(e=>cn(e))),sn=m.computed(()=>ce.value.map(e=>{const t=e.node,n=un(t);return c(u({},e),{node:t,component:mn(t,n),bindings:fn(t,n),isCodeBlock:"code_block"===t.type,indexKey:`${Jt.value}-${e.index}`,renderKey:pn(t,e.index)})}));function un(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function cn(e){if(!e)return!1;const t=String(e.type||"");return!!["blockquote","list","list_item","table","definition_list","footnote","admonition"].includes(t)||Array.isArray(e.items)||Array.isArray(e.rows)||Array.isArray(e.children)&&!1===["paragraph","heading","text"].includes(t)}function pn(e,t){const n=`${Jt.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown"),r=!0===e.loading,l="string"==typeof e.raw?e.raw.length:0,i="string"==typeof e.content?e.content.length:0,a=Array.isArray(e.children)?e.children.length:0,s=Array.isArray(e.items)?e.items.length:0,u=Array.isArray(e.rows)?e.rows.length:0;return(Me.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function mn(e,t){if(!e)return tt;const n=Gt.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:un(e);if("mermaid"===r)return n.mermaid||Kt;if("infographic"===r)return n.infographic||Vt;if("d2"===r||"d2lang"===r)return n.d2||Xt;if(o)return o;return n.code_block||qt.value}return o||Zt[String(e.type)]||tt}function fn(e,t){const n=null!=t?t:un(e);return"mermaid"===n||"infographic"===n||"d2"===n||"d2lang"===n?en:"link"===e.type?on.value:"list"===e.type?rn.value:"code_block"===e.type?tn.value:nn.value}return{__sfc:!0,props:l,emit:t,MAX_DEFERRED_NODE_COUNT:900,MAX_VIEWPORT_OBSERVER_TARGETS:640,VIEWPORT_PRIORITY_RECOVERY_COUNT:200,containerRef:i,viewportPriorityAutoDisabled:a,SCROLL_PARENT_OVERFLOW_RE:s,isClient:f,debugPerformanceEnabled:v,logPerf:g,resolveViewportRoot:y,instanceMsgId:x,defaultMd:M,customTagCache:k,EMPTY_PARSED_NODES:N,mdBase:D,mdInstance:_,normalizeCustomTag:L,resolveCustomHtmlTags:S,cloneNodeValue:B,cloneParsedNodeList:A,mergedParseOptions:O,parsedNodes:z,maxLiveNodesResolved:P,virtualizationEnabled:R,viewportPriorityEnabled:$,registerNodeVisibility:H,requestFrame:U,cancelFrame:F,isTestEnv:Y,hasIdleCallback:W,resolvedBatchSize:Q,resolvedInitialBatch:K,batchingEnabled:V,renderedCount:X,previousRenderContext:G,adaptiveBatchSize:J,nodeVisibilityState:ee,nodeVisibilityHandles:te,nodeVisibilityFallbackTimers:ne,nodeSlotElements:oe,nodeSlotVersion:re,sortedNodeSlots:le,scrollRootElement:ie,detachScrollHandler:ae,pendingFocusSync:se,liveRange:ue,visibleNodes:ce,deferNodes:de,incrementalRenderingActive:pe,previousBatchConfig:me,shouldObserveSlots:fe,liveNodeBufferResolved:he,focusIndex:ge,nodeContentElements:we,instance:xe,legacyVue26:Me,legacyNodesMode:ke,legacyNodeItems:be,syncNodeRefs:Ce,resolveTemplateRef:Te,desiredRenderedCount:Ne,resolveScrollContainer:De,isReverseFlexScrollRoot:_e,getNormalizedScrollTop:je,getOffsetTopWithinRoot:Ie,cleanupScrollListener:Le,setupScrollListener:ot,cancelScheduledFocusSync:at,scheduleFocusSync:st,syncFocusToScroll:ut,clamp:ct,updateLiveRange:dt,nodeHeights:pt,heightStats:mt,heightTreeSize:ft,heightSumTree:ht,heightKnownTree:vt,fenwickUpdate:gt,fenwickQuery:yt,fenwickRangeSum:wt,rebuildHeightTrees:xt,recordNodeHeight:Mt,averageNodeHeight:kt,estimateHeightRange:bt,topSpacerHeight:Ct,bottomSpacerHeight:Tt,estimateIndexForOffset:Nt,estimateIndexForOffsetFromEnd:Dt,cleanupNodeVisibility:_t,markNodeVisible:jt,shouldRenderNode:function(e){return!(pe.value&&e>=X.value)&&(!de.value||e<K.value||!0===ee[e])},destroyNodeHandle:It,setNodeSlotElement:Et,bumpNodeSlotVersion:Lt,setNodeContentRef:St,batchRaf:Bt,batchTimeout:At,batchPending:Ot,pendingIncrement:zt,batchIdle:Pt,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:Rt,clearVisibilityFallback:$t,scheduleVisibilityFallback:Ht,autoDisableViewportPriority:Ut,scheduleBatch:Ft,queueNextBatch:Yt,adjustAdaptiveBatchSize:Wt,CodeBlockNodeAsync:Qt,MermaidBlockNodeAsync:Kt,InfographicBlockNodeAsync:Vt,D2BlockNodeAsync:Xt,codeBlockComponent:qt,nodeComponents:Zt,customComponentsMap:Gt,indexPrefix:Jt,emptyBindings:en,codeBlockBindings:tn,nonCodeBindings:nn,linkBindings:on,listBindings:rn,legacyRenderedItems:ln,legacyStructuredContentMode:an,renderedItems:sn,getCodeBlockLanguage:un,isLegacyStructuredNode:cn,getRenderKey:pn,getNodeComponent:mn,getBindingsFor:fn,handleContainerClick:function(e){t("click",e)},handleContainerMouseover:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseover",e)},handleContainerMouseout:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseout",e)},LegacyNodesRenderer:lt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue2 markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],attrs:{"data-custom-id":n.props.customId},on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.legacyNodesMode?e._l(n.legacyRenderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[o.isCodeBlock||!1===n.props.typewriter?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"typewriter",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1)])}):n.legacyStructuredContentMode?t(n.LegacyNodesRenderer,{attrs:{nodes:n.parsedNodes,"custom-id":n.props.customId,"index-key":n.props.indexKey,typewriter:n.props.typewriter,"show-tooltips":n.props.showTooltips,"code-block-stream":n.props.codeBlockStream,"code-block-dark-theme":n.props.codeBlockDarkTheme,"code-block-light-theme":n.props.codeBlockLightTheme,"code-block-monaco-options":n.props.codeBlockMonacoOptions,"render-code-blocks-as-pre":n.props.renderCodeBlocksAsPre,"code-block-min-width":n.props.codeBlockMinWidth,"code-block-max-width":n.props.codeBlockMaxWidth,"code-block-props":n.props.codeBlockProps,themes:n.props.themes,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}}):[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.renderedItems,function(o){var r;return t("div",{key:o.renderKey,ref:`node-slot-${o.index}`,refInFor:!0,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[n.shouldRenderNode(o.index)?t("div",{ref:`node-content-${o.index}`,refInFor:!0,staticClass:"node-content"},[o.isCodeBlock||!1===n.props.typewriter?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"typewriter",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1):t("div",{staticClass:"node-placeholder",style:{height:`${null!=(r=n.nodeHeights[o.index])?r:n.averageNodeHeight}px`}})])}),n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.bottomSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e()]],2)},[],!1,null,"3bcac249",null,null).exports,rt=k(m.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?lt:ot);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("blockquote",{staticClass:"blockquote",attrs:{dir:"auto",cite:e.node.cite}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`blockquote-${n.props.indexKey}`,nodes:n.props.node.children||[],"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)},[],!1,null,"457eddc3",null,null).exports,lt=k(m.defineComponent({__name:"LegacyNodesRenderer",props:{nodes:null,customId:null,indexKey:null,typewriter:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,renderCodeBlocksAsPre:{type:Boolean},themes:null,isDark:{type:Boolean}},emits:["copy","handleArtifactClick"],setup(e,{emit:t}){const n=e,o={text:Ee,paragraph:Ze,heading:Ke,code_block:Ge,list:Xe,list_item:Ve,blockquote:rt,table:Je,definition_list:C,footnote:We,footnote_reference:E,footnote_anchor:Ye,admonition:it,vmr_container:nt,hardbreak:Qe,link:$e,image:ye,thematic_break:et,math_inline:Se,math_block:Be,strong:Pe,emphasis:Fe,strikethrough:Re,highlight:Ue,insert:He,subscript:ze,superscript:Oe,emoji:T,checkbox:b,checkbox_input:b,inline_code:Z,html_inline:q,html_block:qe,reference:Ae},r=m.computed(()=>(j.value,I(n.customId))),l=m.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),i=m.computed(()=>u({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,monacoOptions:n.codeBlockMonacoOptions,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},n.codeBlockProps||{})),a=m.computed(()=>({typewriter:n.typewriter})),s=m.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),c=m.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),d=m.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{const n=e,o=p(n),r=String((null==n?void 0:n.type)||"unknown");return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===r?`${l.value}-${t}-${r}`:`${l.value}-${t}-${r}-${String((null==n?void 0:n.raw)||"").length}`,node:n,isCodeBlock:"code_block"===(null==n?void 0:n.type),component:f(n,o),bindings:h(n,o)}}));function p(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function f(e,t){if(!e)return tt;const l=r.value,i=l[String(e.type)];if("code_block"===e.type){const o=null!=t?t:p(e);return"mermaid"===o?l.mermaid||Ge:"infographic"===o?l.infographic||Ge:"d2"===o||"d2lang"===o?l.d2||Ge:i||(l.code_block||(n.renderCodeBlocksAsPre,Ge))}return i||o[String(e.type)]||tt}function h(e,t){const n=null!=t?t:p(e);return"mermaid"===n||"infographic"===n||"d2"===n||"d2lang"===n?{}:"link"===e.type?s.value:"list"===e.type?c.value:"code_block"===e.type?i.value:a.value}return{__sfc:!0,props:n,emit:t,nodeComponents:o,customComponentsMap:r,indexPrefix:l,codeBlockBindings:i,nonCodeBindings:a,linkBindings:s,listBindings:c,renderedItems:d,getCodeBlockLanguage:p,getNodeComponent:f,getBindingsFor:h,handleClick:function(e){t("handleArtifactClick",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"markstream-vue2 markdown-renderer legacy-nodes-renderer",class:{dark:n.props.isDark},on:{click:n.handleClick}},e._l(n.renderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)])}),0)},[],!1,null,null,null,null).exports,it=k(m.defineComponent({__name:"AdmonitionNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e,{emit:t}){var n;const o=e,r=m.computed(()=>{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)}),l=m.ref(!!o.node.collapsible&&!(null==(n=o.node.open)||n)),i=`admonition-${Math.random().toString(36).slice(2,9)}`,a=m.getCurrentInstance(),s=m.computed(()=>w(null==a?void 0:a.proxy)?lt:ot);return{__sfc:!0,props:o,emit:t,iconMap:{note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},displayTitle:r,collapsed:l,toggleCollapse:function(){o.node.collapsible&&(l.value=!l.value)},headerId:i,instance:a,nestedRenderer:s}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"admonition",class:[`admonition-${n.props.node.kind}`,n.props.isDark?"is-dark":""]},[t("div",{staticClass:"admonition-header",attrs:{id:n.headerId}},[n.iconMap[n.props.node.kind]?t("span",{staticClass:"admonition-icon"},[e._v(e._s(n.iconMap[n.props.node.kind]))]):e._e(),t("span",{staticClass:"admonition-title"},[e._v(e._s(n.displayTitle))]),n.props.node.collapsible?t("button",{staticClass:"admonition-toggle",attrs:{"aria-expanded":!n.collapsed,"aria-controls":`${n.headerId}-content`,title:n.collapsed?"Expand":"Collapse"},on:{click:n.toggleCollapse}},[n.collapsed?t("span",[e._v("▶")]):t("span",[e._v("▼")])]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.collapsed,expression:"!collapsed"}],staticClass:"admonition-content",attrs:{id:`${n.headerId}-content`,"aria-labelledby":n.headerId}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`admonition-${e.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(e){return n.emit("copy",e)}}})],1)])},[],!1,null,"b5b5446b",null,null).exports;let at=!1,st=null,ut=!1;function ct(){return d(this,null,function*(){var e;if(st)return st;if(ut)return null;try{const t=yield Promise.resolve().then(()=>require("./index.legacy.js"));return st=null!=(e=null==t?void 0:t.default)?e:t,yield function(e){return d(this,null,function*(){if(at)return;at=!0;const t=null==globalThis?void 0:globalThis.MonacoEnvironment;return!t||"function"!=typeof t.getWorker&&"function"!=typeof t.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(st),(yield function(e){return d(this,null,function*(){const t=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof t)return!0;try{const e=yield t(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(n){return console.warn("[markstream-vue2] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",n),!1}})}(st))?st:(st=null,ut=!0,null)}catch(t){return ut=!0,null}})}const dt='<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',pt='<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',mt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';let ft=null,ht=null,vt=null;const gt=m.ref(0),yt={"":mt,plain:mt,text:mt,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n',typescript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n',cs:dt,csharp:dt,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n',shell:pt,powershell:pt,sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n',svg:'<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'},wt={"":"",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",d:"dlang",vbnet:"vb.net"};function xt(){return d(this,null,function*(){return ht||(vt||(vt=Promise.resolve().then(()=>require("./languageIconExtended.js")).then(e=>(ht=e.EXTENDED_LANGUAGE_ICON_MAP,gt.value++,ht)).catch(()=>null)),vt)})}function Mt(e){ft=null!=e?e:null}function kt(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=wt[n])?t:n}function bt(e){const t=kt(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ct(e){if(ft){const t=ft(e);if(null!=t&&""!==t)return t}const t=kt(e),n=yt[t];if(n)return n;return(null==ht?void 0:ht[t])||(xt(),'<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 Tt={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},Nt=new Map,Dt=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","hardbreak","heading","highlight","html_block","html_inline","image","inline_code","insert","link","list","list_item","math_block","math_inline","paragraph","reference","strikethrough","strong","subscript","superscript","table","table_cell","table_row","text","thematic_break"]);function _t(e){const t=function(e){if(!e||0===e.length)return[];const t=new Set,n=[];for(const o of e){const e=Rt(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return n}(e.customHtmlTags),n=`${e.cacheKey||"markstream-vue2-nested-html"}::${t.join(",")}`;let o=Nt.get(n);return o||(o=p.getMarkdown(n,{customHtmlTags:t}),Nt.set(n,o)),{markdown:o,options:{allowHtml:!1!==e.allowHtml,customNodeTag:Rt(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function jt(e,t){return(Array.isArray(e)?e:[]).map(e=>It(e,t)).join("")}function It(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return Ut(Pt(e.content));case"paragraph":return`<p>${jt(zt(e.children),t)}</p>`;case"strong":return`<strong>${jt(zt(e.children),t)}</strong>`;case"emphasis":return`<em>${jt(zt(e.children),t)}</em>`;case"strikethrough":return`<del>${jt(zt(e.children),t)}</del>`;case"highlight":return`<mark>${jt(zt(e.children),t)}</mark>`;case"insert":return`<ins>${jt(zt(e.children),t)}</ins>`;case"subscript":return`<sub>${jt(zt(e.children),t)}</sub>`;case"superscript":return`<sup>${jt(zt(e.children),t)}</sup>`;case"inline_code":return`<code>${Ut(Pt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=Pt(e.href),o=Pt(e.title),r=zt(e.children).length>0?jt(zt(e.children),t):Ut(Pt(e.text||n)),l=o?` title="${Ft(o)}"`:"";return`<a${n?` href="${Ft(n)}"`:""}${l} target="_blank" rel="noreferrer noopener">${r}</a>`}(e,t);case"image":return function(e){const t=Pt(e.src),n=Pt(e.alt),o=Pt(e.title),r=o?` title="${Ft(o)}"`:"";return`<img src="${Ft(t)}" alt="${Ft(n)}"${r}>`}(e);case"list":return function(e,t){const n=e.ordered?"ol":"ul";return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:""}>${jt(zt(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${jt(zt(e.children),t)}</li>`;case"blockquote":return`<blockquote>${jt(zt(e.children),t)}</blockquote>`;case"heading":return function(e,t){const n=function(e){const t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}(e.level);return`<h${n}>${jt(zt(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=Ht(Pt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${Ut(Pt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?Et(e.header,t,!0):"",o=jt(zt(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return Et(e,t);case"table_cell":return Lt(e,t);case"definition_list":return function(e,t){return`<dl>${zt(e.items).map(e=>St(e,t)).join("")}</dl>`}(e,t);case"definition_item":return St(e,t);case"footnote":return function(e,t){return`<div id="fnref--${Ft(Pt(e.id))}" class="markstream-nested-footnote">${jt(zt(e.children),t)}</div>`}(e,t);case"footnote_reference":return function(e){const t=Ut(Pt(e.id));return`<sup class="markstream-nested-footnote-ref"><a href="#fnref--${Ft(Pt(e.id))}">[${t}]</a></sup>`}(e);case"admonition":return function(e,t){const n=Ht(Pt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${Ut(Pt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${jt(zt(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return Ut(Pt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${Ut(Pt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${Ut(Pt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${Ut(Pt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=Pt(e.content);return n?t.options.allowHtml?e.loading&&!e.autoClosed?Ut(n):n:Ut(n):""}(e,t);default:return function(e,t){const n=Pt(e.tag||e.type);if(!n||Dt.has(n))return Ut(Pt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${Ht(n)||"node"}`,At(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=function(e,t=""){const n=function(e){if(!e)return[];if(Array.isArray(e)){if(0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}(e),o=[],r=[t];for(const[i,a]of n)$t(i)&&("class"!==i?!0===a?o.push(` ${i}`):o.push(` ${i}="${Ft(String(a))}"`):r.push(String(a)));const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${Ft(l)}"`),o.join("")}(e.attrs,o),l=function(e,t){const n=zt(e.children);if(n.length>0)return jt(n,t);const o=Pt(e.content);return o?Bt(o,t):Ut(Pt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${Ft(n)}">${l}</${i}>`}(e,t)}}function Et(e,t,n=!1){return`<tr>${zt(e.cells).map(e=>Lt(e,t,n)).join("")}</tr>`}function Lt(e,t,n=!1){const o=n||e.header?"th":"td",r=Pt(e.align);return`<${o}${r?` style="text-align:${Ft(r)}"`:""}>${jt(zt(e.children),t)}</${o}>`}function St(e,t){return`<dt>${jt(zt(e.term),t)}</dt><dd>${jt(zt(e.definition),t)}</dd>`}function Bt(e,t){return e?t.markdown.render(e):""}function At(e,t){return t?Ot("function"==typeof t?t(e):t):""}function Ot(e){return Array.isArray(e)?e.map(e=>Ot(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function zt(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function Pt(e){return"string"==typeof e?e:null==e?"":String(e)}function Rt(e){const t=Pt(e).trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Za-z][\w:-]*)/);return n?n[1].toLowerCase():""}function $t(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Ht(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ut(e){return Pt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ft(e){return Ut(e).replace(/`/g,"`")}const Yt=new Map;function Wt(e,t={}){if(Array.isArray(e.nodes))return e.nodes.slice();const n=e.node;if(n){const e=(o=n.children,Array.isArray(o)?o:[]);if(e.length>0)return e.slice()}var o;const r=function(e){var t;return"string"==typeof e.content?e.content:"string"==typeof(null==(t=e.node)?void 0:t.content)?e.node.content:""}(e);if(!r)return[];const l=function(e,t){var n,o;const r=null!=(n=t.parseOptions)?n:{},l=null!=(o=t.final)?o:(a=e.node)&&"object"==typeof a&&"boolean"==typeof a.loading?!a.loading:void 0,i=Qt(t.customHtmlTags,r.customHtmlTags);var a;return null==l&&0===i.length?r:u(u(u({},r),null==l?{}:{final:l}),0===i.length?{}:{customHtmlTags:i})}(e,t),i=function(e){const t=Qt(e.customHtmlTags),n=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${t.join(",")}`;let o=Yt.get(n);return o||(o=p.getMarkdown(n,{customHtmlTags:t}),Yt.set(n,o)),e.customMarkdownIt?e.customMarkdownIt(o):o}(t);return p.parseMarkdownToStructure(r,i,l)}function Qt(...e){const t=new Set,n=[];for(const o of e)for(const e of o||[]){const o=Kt(e);o&&!t.has(o)&&(t.add(o),n.push(o))}return n}function Kt(e){const t=String(null!=e?e:"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Za-z][\w:-]*)/);return n?n[1].toLowerCase():""}function Vt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const Xt=k(m.defineComponent({__name:"Portal",props:{to:null},setup(e){const t=e,n=m.ref(null);function o(){return"undefined"==typeof document?null:t.to&&"body"!==t.to?document.querySelector(t.to):document.body}function r(){const e=n.value;if(!e)return;const t=o();t&&e.parentElement!==t&&t.appendChild(e)}return m.onMounted(()=>{r()}),m.watch(()=>t.to,()=>{r()}),m.onBeforeUnmount(()=>{}),{__sfc:!0,props:t,rootRef:n,resolveTarget:o,moveToTarget:r}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"rootRef",staticClass:"portal-root"},[e._t("default")],2)},[],!1,null,"5b7455c5",null,null).exports,qt=k(m.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},onClose:null,title:null},setup(e){const t=e,{t:n}=he(),o=m.computed(()=>{const e=t.code||"",n=e.trim().toLowerCase();return n.startsWith("<!doctype")||n.startsWith("<html")||n.startsWith("<body")?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${t.isDark?"#020617":"#ffffff"};\n color: ${t.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`});function r(e){var n;"Escape"!==e.key&&"Esc"!==e.key||null==(n=t.onClose)||n.call(t)}return m.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",r)}),m.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",r)}),{__sfc:!0,props:t,t:n,srcdoc:o,handleKeydown:r,Portal:Xt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("div",{staticClass:"html-preview-frame__backdrop",class:{"html-preview-frame__backdrop--dark":n.props.isDark},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[t("div",{staticClass:"html-preview-frame",class:{"html-preview-frame--dark":n.props.isDark},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"html-preview-frame__header"},[t("div",{staticClass:"html-preview-frame__title"},[t("span",{staticClass:"html-preview-frame__dot"}),t("span",{staticClass:"html-preview-frame__label"},[e._v(e._s(n.props.title||n.t("common.preview")||"Preview"))])]),t("button",{staticClass:"html-preview-frame__close",class:{"html-preview-frame__close--dark":n.props.isDark},attrs:{type:"button"},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[e._v(" × ")])]),t("iframe",{staticClass:"html-preview-frame__iframe",attrs:{sandbox:"allow-scripts allow-same-origin",srcdoc:n.srcdoc}})])])])])},[],!1,null,"a5364041",null,null).exports;let Zt=null,Gt=null,Jt=null,en=null,tn=null;const nn=new WeakMap;let on=0;const rn=k(m.defineComponent({__name:"CodeBlockNode",props:{node:{type:Object,required:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{type:[Object,String],default:void 0},lightTheme:{type:[Object,String],default:void 0},isShowPreview:{type:Boolean,default:!0},monacoOptions:{type:Object,default:void 0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0},customId:{type:String,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,l="__markstreamMonacoPassiveTouch__";function i(){var e;try{const t=window;if(t[l])return;const n=null==(e=window.Element)?void 0:e.prototype,o=null==n?void 0:n.addEventListener;if(!n||!o)return;n.addEventListener=function(e,t,n){return"touchstart"===e&&a(this,n)?o.call(this,e,t,s(n)):o.call(this,e,t,n)},t[l]=!0}catch(t){}}function a(e,t){if(!e)return!1;const n=e;return!("function"!=typeof n.closest||!n.closest(".monaco-editor, .monaco-diff-editor")||t&&"object"==typeof t&&"passive"in t)}function s(e){return null==e?{passive:!0}:"boolean"==typeof e?{capture:e,passive:!0}:"object"==typeof e?"passive"in e?e:c(u({},e),{passive:!0}):{passive:!0}}"undefined"!=typeof window&&i();const p=m.getCurrentInstance(),f=m.computed(()=>{var e,t,n,o,r,l,i,a,s,u;const c=null==p?void 0:p.proxy,d=null!=(e=null==c?void 0:c.$listeners)?e:{};if(d.previewCode||d["preview-code"])return!0;const m=null!=(i=null!=(l=null==(n=null==(t=null==c?void 0:c.$vnode)?void 0:t.data)?void 0:n.on)?l:null==(r=null==(o=null==c?void 0:c.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?i:{};if(m.previewCode||m["preview-code"])return!0;const f=null!=(u=null==(a=null==c?void 0:c.$vnode)?void 0:a.props)?u:null==(s=null==p?void 0:p.vnode)?void 0:s.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:v}=he(),g=m.ref(null),y=m.ref(null),w=m.ref(!1),x=m.ref(kt(r.node.language)),M=m.computed(()=>bt(x.value)),k=m.ref(!1),b=m.ref(!1),C=m.ref(!1),T=m.ref(!1),N=m.ref(null);let D=0;const _=ge();let j=null;const I=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>y.value,e=>{if(null==j||j.destroy(),j=null,!e)return void(I.value=!1);const t=_(e,{rootMargin:"400px"});j=t,I.value=t.isVisible.value,t.whenVisible.then(()=>{I.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==j||j.destroy(),j=null});let E=null,L=null,S=()=>{},B=()=>{},A=()=>null,O=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),P=()=>{},R=()=>{},$=null,H=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},U=()=>d(this,null,function*(){});const F=m.computed(()=>r.node.diff),Y=m.computed(()=>F.value?"diff":"single"),W=m.ref(Y.value),Q=m.ref(!1),K=m.ref(!1),V=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV);"undefined"!=typeof window&&(()=>{d(this,null,function*(){try{const e=yield ct();if(!e)return V&&console.warn("[markstream-vue2] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(Q.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&(H=n),"function"==typeof t){const e=Me();if(e&&r.themes&&Array.isArray(r.themes)&&!r.themes.includes(e))throw new Error("Preferred theme not in provided themes array");const n=t(c(u({wordWrap:"on",wrappingIndent:"same",themes:r.themes,theme:e},r.monacoOptions||{}),{onThemeChange(){oe()}}));E=n.createEditor||E,L=n.createDiffEditor||L,S=n.updateCode||S,B=n.updateDiff||B,A=n.getEditor||A,O=n.getEditorView||O,z=n.getDiffEditorView||z,P=n.cleanupEditor||P,R=n.safeClean||n.cleanupEditor||R,U=n.setTheme||U,T.value=!0,g.value&&(yield we(g.value))}}catch(e){V&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),Q.value=!0}})})();const X=m.ref("number"==typeof(null==(o=r.monacoOptions)?void 0:o.fontSize)?r.monacoOptions.fontSize:Number.NaN),q=m.ref(X.value),Z=m.computed(()=>{const e=X.value,t=q.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function G(){try{const e=g.value;if(!e)return null;const t=e.querySelector(".view-lines .view-line");if(t){const e=Math.ceil(t.getBoundingClientRect().height);if(e>0)return e}}catch(e){}return null}function J(){var e,t,n,o,r;try{const l=F.value?null!=(n=null==(t=null==(e=z())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:z():O(),i=A(),a=null==(o=null==i?void 0:i.EditorOption)?void 0:o.fontInfo;if(l&&null!=a){const e=null==(r=l.getOption)?void 0:r.call(l,a),t=null==e?void 0:e.fontSize;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t}}catch(l){}try{const e=g.value;if(e){const t=e.querySelector(".view-lines .view-line");if(t)try{if("undefined"!=typeof window&&"function"==typeof window.getComputedStyle){const e=window.getComputedStyle(t).fontSize,n=e&&e.match(/^(\d+(?:\.\d+)?)/);if(n)return Number.parseFloat(n[1])}}catch(l){}}}catch(l){}return null}function ee(e){var t,n;try{const o=A(),r=null==(t=null==o?void 0:o.EditorOption)?void 0:t.lineHeight;if(null!=r){const t=null==(n=null==e?void 0:e.getOption)?void 0:n.call(e,r);if("number"==typeof t&&t>0)return t}}catch(l){}const o=G();if(o&&o>0)return o;const r=Number.isFinite(q.value)&&q.value>0?q.value:12;return Math.max(12,Math.round(1.35*r))}function te(){var e;if(Number.isFinite(q.value)&&q.value>0&&Number.isFinite(X.value))return q.value;const t=J();return"number"==typeof(null==(e=r.monacoOptions)?void 0:e.fontSize)?(X.value=r.monacoOptions.fontSize,q.value=r.monacoOptions.fontSize,q.value):t&&t>0?(X.value=t,q.value=t,t):(X.value=12,q.value=12,12)}function ne(){var e,t,n,o,r,l,i,a,s,u,c,d,p,m;try{const f=F.value?z():O();if(!f)return null;if(F.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const p=null==(e=f.getOriginalEditor)?void 0:e.call(f),m=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==p?void 0:p.layout)||n.call(p),null==(o=null==m?void 0:m.layout)||o.call(m);const h=(null==(r=null==p?void 0:p.getContentHeight)?void 0:r.call(p))||0,v=(null==(l=null==m?void 0:m.getContentHeight)?void 0:l.call(m))||0,g=Math.max(h,v);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==p?void 0:p.getModel)?void 0:i.call(p))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(d=null==(c=null==(u=null==m?void 0:m.getModel)?void 0:u.call(m))?void 0:c.getLineCount)?void 0:d.call(c))||1,x=Math.max(y,w),M=Math.max(ee(p),ee(m));return Math.ceil(x*(M+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(p=null==f?void 0:f.layout)||p.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const h=null==(m=null==f?void 0:f.getModel)?void 0:m.call(f);let v=1;h&&"function"==typeof h.getLineCount&&(v=h.getLineCount());const g=ee(f);return Math.ceil(v*(g+1.5)+0+1)}catch(f){return null}}function oe(){var e,t,n,o,r,l,i,a;const s=g.value,u=y.value;if(!s||!u)return;const c=s.querySelector(".monaco-editor")||s,d=c.querySelector(".monaco-editor-background")||c,p=c.querySelector(".view-lines")||c;let m=null,f=null,h=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(m=window.getComputedStyle(c),f=d===c?m:window.getComputedStyle(d),h=p===c?m:window.getComputedStyle(p))}catch(b){m=null,f=null,h=null}const v=String(null!=(e=null==m?void 0:m.getPropertyValue("--vscode-editor-foreground"))?e:"").trim(),w=String(null!=(t=null==m?void 0:m.getPropertyValue("--vscode-editor-background"))?t:"").trim(),x=String(null!=(o=null!=(n=null==m?void 0:m.getPropertyValue("--vscode-editor-selectionBackground"))?n:null==m?void 0:m.getPropertyValue("--vscode-editor-hoverHighlightBackground"))?o:"").trim(),M=v||String(null!=(l=null!=(r=null==h?void 0:h.color)?r:null==m?void 0:m.color)?l:"").trim(),k=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==m?void 0:m.backgroundColor)?a:"").trim();M&&u.style.setProperty("--vscode-editor-foreground",M),k&&u.style.setProperty("--vscode-editor-background",k),x&&u.style.setProperty("--vscode-editor-selectionBackground",x)}function re(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect(),n=window.scrollY+t.top,o=ne();if(null!=o&&o>0){const r=t.height;e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight="none";const l=Math.ceil(o)-r;0!==l&&n<window.scrollY&&window.scrollBy(0,l)}}catch(e){}}function le(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect(),o=window.scrollY+n.top,r=n.height,l=ie();if(D>0&&(D--,null!=N.value)){const e=Math.min(N.value,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}const i=ne();if(null!=i&&i>0){const e=Math.min(i,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}if(null!=N.value){const e=Math.min(N.value,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}const a=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(a>0){const e=Math.min(a,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}const s=Number.parseFloat(t.style.height);if(!Number.isNaN(s)&&s>0){const e=Math.ceil(Math.min(s,l));t.style.height=`${e}px`;const n=e-r;0!==n&&o<window.scrollY&&window.scrollBy(0,n)}else{const e=Math.ceil(l);t.style.height=`${e}px`;const n=e-r;0!==n&&o<window.scrollY&&window.scrollBy(0,n)}t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto"}catch(t){}}function ie(){var e,t;const n=null!=(t=null==(e=r.monacoOptions)?void 0:e.MAX_HEIGHT)?t:500;if("number"==typeof n)return n;const o=String(n).match(/^(\d+(?:\.\d+)?)/);return o?Number.parseFloat(o[1]):500}const ae=m.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));m.watch(()=>r.node.language,e=>{x.value=kt(e)}),m.watch(()=>r.node.code,e=>d(this,null,function*(){var t,n;if(!1!==r.stream){if(x.value||(x.value=kt(H(e))),E&&!C.value&&g.value)try{yield we(g.value)}catch(o){}F.value?B(String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),M.value):S(e,M.value),k.value&&Vt(()=>re())}}));const se=m.computed(()=>{const e=x.value;return e?Tt[e]||e.charAt(0).toUpperCase()+e.slice(1):Tt[""]||"Plain Text"}),ue=m.computed(()=>(gt.value,Ct(x.value||""))),ce=m.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e}),de=m.computed(()=>!1!==r.showTooltips);function fe(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function ve(e){var t,n;try{if(F.value){const n=z();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=O();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function ye(e){return d(this,null,function*(){var t,n,o;if(!E)return;F.value?(R(),L?yield L(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),M.value):yield E(e,r.node.code,M.value)):yield E(e,r.node.code,M.value);const l=F.value?z():O();if("number"==typeof(null==(o=r.monacoOptions)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:r.monacoOptions.fontSize,automaticLayout:!1}),X.value=r.monacoOptions.fontSize,q.value=r.monacoOptions.fontSize;else{const e=J();e&&e>0?(X.value=e,q.value=e):(X.value=12,q.value=12)}k.value||b.value||le(),!1===r.loading&&(yield m.nextTick(),Vt(()=>{k.value&&!b.value?re():b.value||le()}))})}function we(e){if(!E)return null;if($)return $;C.value=!0;const t=(()=>d(this,null,function*(){yield ye(e)}))();return $=t.finally(()=>{$=null}),$}m.watch(de,e=>{e||me()}),m.watch(()=>q.value,(e,t)=>{const n=F.value?z():O();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),k.value&&!b.value&&re())},{flush:"post",immediate:!1});const xe=m.watch(()=>[g.value,F.value,r.stream,r.loading,T.value,I.value],e=>d(this,[e],function*([e,t,n,o,r,l]){if(!e||!E)return;if(!l)return;if(!1===n&&!1!==o)return;const i=we(e);i&&(yield i,xe())}));function Me(){return r.isDark?r.darkTheme:r.lightTheme}function ke(){const e=Me();e&&function(e,t){const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&e&&"name"in e)return String(e.name);if("object"==typeof e){const n=nn.get(e);if(n)return n;try{const t=JSON.stringify(e);if(t)return nn.set(e,t),t}catch(t){}const o="__theme_"+ ++on;return nn.set(e,o),o}return String(e)}(t);return n?(tn=e,Zt||en!==n?(Gt=t,Jt=n,Zt||(Zt=(()=>d(this,null,function*(){for(;Jt&&null!=Gt;){const n=Gt,o=Jt;if(Gt=null,Jt=null,en!==o)try{yield(null!=tn?tn:e)(n),en=o}catch(t){}}}))().finally(()=>{Zt=null}),Zt)):Promise.resolve()):Promise.resolve()}(U,e).then(()=>{Vt(()=>oe())})}m.watch(Y,(e,t)=>d(this,null,function*(){if(e!==t&&(W.value=e,E&&g.value&&C.value&&(!1!==r.stream||!1===r.loading)&&I.value))try{C.value=!1,$=null,R(),yield m.nextTick(),yield we(g.value)}catch(n){C.value=!1}})),m.watch(()=>[r.isDark,r.darkTheme,r.lightTheme,T.value],()=>{T.value&&ke()}),m.watch(()=>[r.monacoOptions,I.value],()=>{var e,t;if(!E||!I.value)return;const n=F.value?z():O(),o="number"==typeof(null==(e=r.monacoOptions)?void 0:e.fontSize)?r.monacoOptions.fontSize:Number.isFinite(q.value)?q.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),k.value&&!b.value?re():b.value||le()},{deep:!0});const be=m.watch(()=>[r.loading,I.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield m.nextTick(),Vt(()=>{b.value||(k.value?re():le()),be()})))}),{immediate:!0,flush:"post"});return m.onUnmounted(()=>{P()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:p,hasPreviewListener:f,t:v,codeEditor:g,container:y,copyText:w,codeLanguage:x,monacoLanguage:M,isExpanded:k,isCollapsed:b,editorCreated:C,monacoReady:T,expandRafId:null,heightBeforeCollapse:N,resumeGuardFrames:D,registerVisibility:_,viewportHandle:j,viewportReady:I,createEditor:E,createDiffEditor:L,updateCode:S,updateDiffCode:B,getEditor:A,getEditorView:O,getDiffEditorView:z,cleanupEditor:P,safeClean:R,createEditorPromise:$,detectLanguage:H,setTheme:U,isDiff:F,desiredEditorKind:Y,currentEditorKind:W,usePreCodeRender:Q,showInlinePreview:K,isDevEnv:V,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:X,codeFontSize:q,fontBaselineReady:Z,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:G,readActualFontSizeFromEditor:J,getLineHeightSafe:ee,ensureFontBaseline:te,increaseCodeFont:function(){const e=te(),t=Math.min(36,e+1);q.value=t},decreaseCodeFont:function(){const e=te(),t=Math.max(10,e-1);q.value=t},resetCodeFont:function(){te(),Number.isFinite(X.value)&&(q.value=X.value)},computeContentHeight:ne,syncEditorCssVars:oe,resizeSyncHandler:null,updateExpandedHeight:re,updateCollapsedHeight:le,getMaxHeightValue:ie,isPreviewable:ae,displayLanguage:se,languageIcon:ue,containerStyle:ce,tooltipsEnabled:de,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),w.value=!0,t("copy",r.node.code),setTimeout(()=>{w.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},resolveTooltipTarget:fe,onBtnHover:function(e,t,n="top"){if(!de.value)return;const o=fe(e);if(!o)return;const l=e;pe(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){de.value&&me()},onCopyHover:function(e){if(!de.value)return;const t=fe(e);if(!t)return;const n=e;pe(t,w.value?v("common.copied")||"Copied":v("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(){k.value=!k.value;const e=F.value?z():O(),t=g.value;e&&t&&(k.value?(ve(!0),t.style.maxHeight="none",t.style.overflow="visible",re()):(ve(!1),t.style.overflow="auto",le()))},toggleHeaderCollapse:function(){var e,t,n;if(b.value=!b.value,b.value){if(g.value){const n=Math.ceil((null==(t=(e=g.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(N.value=n)}ve(!1)}else{k.value&&ve(!0),g.value&&null!=N.value&&(g.value.style.height=`${N.value}px`);const e=F.value?z():O();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}D=2,Vt(()=>{k.value?re():le()})}},previewCode:function(){if(!ae.value)return;const e=x.value;if(f.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?v("artifacts.htmlPreviewTitle")||"HTML Preview":v("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(K.value=!K.value)},setAutomaticLayout:ve,runEditorCreation:ye,ensureEditorCreation:we,stopCreateEditorWatch:xe,getPreferredColorScheme:Me,themeUpdate:ke,stopLoadingWatch:be,stopExpandAutoResize:function(){},PreCodeNode:Ge,HtmlPreviewFrame:qt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.usePreCodeRender?t(n.PreCodeNode,{attrs:{node:e.node,loading:n.props.loading}}):t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.props.isDark}],style:n.containerStyle},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},[e._t("header-left",function(){return[t("div",{staticClass:"flex items-center space-x-2 flex-1 overflow-hidden"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("span",{staticClass:"text-sm font-medium font-mono truncate"},[e._v(e._s(n.displayLanguage))])])]}),e._t("header-right",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[n.props.showCollapseButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:n.toggleExpand,mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"}},[t("path",{attrs:{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}}),t("path",{attrs:{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],ref:"codeEditor",staticClass:"code-editor-container",class:[e.stream?"":"code-height-placeholder"]}),n.showInlinePreview&&!n.hasPreviewListener&&n.isPreviewable&&"html"===n.codeLanguage?t(n.HtmlPreviewFrame,{attrs:{code:e.node.code,"is-dark":n.props.isDark,"on-close":()=>n.showInlinePreview=!1}}):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[t("div",{staticClass:"loading-skeleton"},[t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line short"})])]},{loading:e.loading,stream:e.stream})],2),t("span",{staticClass:"sr-only",attrs:{"aria-live":"polite",role:"status"}},[e._v(e._s(n.copyText?n.t("common.copied")||"Copied":""))])],1)},[],!1,null,"bdb41f08",null,null).exports,ln=()=>import("@terrastruct/d2");let an=null,sn=ln;function un(e){sn=e,an=null}const cn=k(m.defineComponent({__name:"D2BlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:null,darkThemeId:null,showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(e){const t=e,{t:n}=he(),o=m.ref(!1),r=m.ref(!1),l=m.ref(!1),i=m.ref(!1),a=m.ref(null),s=m.ref(!1),c=m.ref(""),p=m.ref(0),f=m.ref(null),h=m.ref(null),v=m.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=m.computed(()=>l.value||!i.value||!c.value),y=m.computed(()=>!!c.value),w=m.computed(()=>{if(h.value)return{minHeight:`${h.value}px`}}),x=m.computed(()=>{if(t.maxHeight)return{maxHeight:"number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight)}}),M="undefined"!=typeof window;let k=null,b=!1,C=!1,T=0,N=null,D=!1,_=null;const j={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function I(e){return!e||e.disabled}const E=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],L=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function S(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function B(e){if(!e)return"";const t=e.trim();return L.test(t)?t:""}function A(e){const t=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(E.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=B(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function O(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";if(!e)return"";const t=S(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return"";const o=n;return A(o),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function P(){c.value=""}function R(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function $(){return d(this,null,function*(){if(k)return k;const e=yield function(){return d(this,null,function*(){if(an)return an;const e=sn;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===ln)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(an=function(e){var t;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const n=null!=(t=e.default)?t:e;return"function"==typeof n?n:(null==n?void 0:n.D2)&&"function"==typeof n.D2?n.D2:n}(t),an):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?k=t:"function"==typeof e.compile&&(k=e),k}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(k=new e.D2,k):("function"==typeof e.compile&&(k=e),k)})}function H(){return d(this,null,function*(){var e,n,o,r,c;if(!M||C)return;if(t.loading&&!t.progressiveRender)return;const d=v.value;if(!d)return P(),void(a.value=null);const m=++p.value;s.value=!0,a.value=null;try{const s=yield $();if(!s)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof s.compile||"function"!=typeof s.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const f=yield s.compile(d);if(m!==p.value)return;const h=null!=(e=null==f?void 0:f.diagram)?e:f,v=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:v.themeID,y=null!=(c=t.darkThemeId)?c:v.darkThemeID,w=u({},v);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=v.themeOverrides&&"object"==typeof v.themeOverrides?v.themeOverrides:null;w.themeOverrides=u(u({},j),e||{})}const x=yield s.render(h,w);if(m!==p.value)return;const M=R(x);if(!M)throw new Error("D2 render returned empty output.");z(M),t.loading&&(l.value=!1),a.value=null}catch(f){if(m!==p.value)return;const e=(null==f?void 0:f.message)?String(f.message):"D2 render failed.";t.loading||(a.value=e),e.includes("@terrastruct/d2")&&(i.value=!1,l.value=!0)}finally{m===p.value&&(s.value=!1,D&&(D=!1,U()))}})}function U(e=!1){if(b)return;if(!M)return;if(C)return;if(s.value)return void(D=!0);const n=Math.max(120,Number(t.progressiveIntervalMs)||0),o=Date.now()-T;if(!e&&o<n)return D=!0,void(null==N&&(N=window.setTimeout(()=>{N=null,D&&(D=!1,U(!0))},Math.max(0,n-o))));b=!0;const r=()=>{b=!1,T=Date.now(),H()};"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,0)}function F(){const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height;t>0&&(h.value=t)}return m.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),m.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),m.watch(()=>[g.value,c.value,v.value],()=>{m.nextTick(()=>{F()})}),m.onMounted(()=>{U(),m.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(_=new ResizeObserver(()=>{F()}),f.value&&_.observe(f.value))}),m.onBeforeUnmount(()=>{C=!0,null!=N&&(clearTimeout(N),N=null),null==_||_.disconnect(),_=null}),{__sfc:!0,props:t,t:n,copyText:o,isCollapsed:r,showSource:l,d2Available:i,renderError:a,isRendering:s,svgMarkup:c,renderToken:p,bodyRef:f,bodyMinHeight:h,baseCode:v,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:M,d2Instance:k,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:D,bodyObserver:_,DARK_THEME_OVERRIDES:j,shouldSkipEventTarget:I,onBtnHover:function(e,n,o="top"){if(I(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;pe(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){me()},onCopyHover:function(e){if(I(e.currentTarget))return;const r=o.value?n("common.copied")||"Copied":n("common.copy")||"Copy",l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;pe(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=v.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),o.value=!0,setTimeout(()=>{o.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},toggleCollapse:function(){r.value=!r.value},handleSwitchMode:function(e){l.value="source"===e},DISALLOWED_STYLE_PATTERNS:E,SAFE_URL_PROTOCOLS:L,neutralizeScriptProtocols:S,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:P,extractSvg:R,ensureD2Instance:$,renderDiagram:H,scheduleRender:U,exportSvg:function(){if(c.value)try{const e=new Blob([c.value],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e);if("undefined"!=typeof document){const e=document.createElement("a");e.href=t,e.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}URL.revokeObjectURL(t)}catch(e){console.error("Failed to export SVG:",e)}},updateBodyMinHeight:F}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"d2-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:n.props.isDark?"border-gray-700/30 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"},[n.props.showHeader?t("div",{staticClass:"d2-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},[e._m(0),t("div",{staticClass:"flex items-center gap-x-2"},[n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"":"is-active",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("preview")},mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.preview")||"Preview")+" ")]),t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"is-active":"",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("source")},mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.source")||"Source")+" ")])]):e._e(),n.props.showCopyButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.svgMarkup?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.export")||"Export"},on:{click:n.exportSvg,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"}})])]):e._e(),n.props.showCollapseButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"bodyRef",staticClass:"d2-block-body",style:n.bodyStyle},[n.props.loading&&!n.hasPreview?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",[n.showSourceFallback?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",{staticClass:"d2-render",style:n.renderStyle},[t("div",{staticClass:"d2-svg",domProps:{innerHTML:e._s(n.svgMarkup)}}),n.renderError?t("p",{staticClass:"d2-error px-4 pb-3 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()])])])])},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"flex items-center gap-x-2"},[t("span",{staticClass:"text-sm font-medium font-mono"},[e._v("D2")])])}],!1,null,"bc9f707f",null,null).exports;cn.install=e=>{e.component(cn.__name,cn)};const dn=Object.freeze(Object.defineProperty({__proto__:null,default:cn},Symbol.toStringTag,{value:"Module"}));let pn=null,mn=null;const fn=k(m.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal"],setup(e,{emit:t}){const n=e,{t:o}=he(),r=m.ref(!1),l=m.ref(!1),i=m.ref(),a=m.ref(!1),s=m.ref("360px"),u=m.ref(!1),c=m.ref(),p=m.ref(null),f=m.ref(1),h=m.ref(0),v=m.ref(0),g=m.ref(!1),y=m.ref({x:0,y:0}),w=m.computed(()=>n.node.code);function x(e){return!e||e.disabled}function M(e){return d(this,null,function*(){try{const n=(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function k(e){"Escape"===e.key&&u.value&&C()}function b(){if(u.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",k)}catch(e){}m.nextTick(()=>{if(i.value&&c.value){c.value.innerHTML="";const e=document.createElement("div");e.style.transition="transform 0.1s ease",e.style.transformOrigin="center center",e.style.width="100%",e.style.height="100%",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center";const t=i.value.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),c.value.appendChild(e),p.value=e,e.style.transform=`translate(${h.value}px, ${v.value}px) scale(${f.value})`}})}function C(){if(u.value=!1,c.value&&(c.value.innerHTML=""),p.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",k)}catch(e){}}let T=null;function N(){return d(this,null,function*(){var e;if(i.value)try{const t=yield function(){return d(this,null,function*(){return mn||pn||(pn=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),mn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),pn)})}();if(!t)return void console.warn("Infographic library failed to load.");T&&(null==(e=T.destroy)||e.call(T),T=null),i.value.innerHTML="",T=new t({container:i.value,width:"100%",height:"100%"}),T.render(w.value),m.nextTick(()=>{if(i.value){const e=i.value.scrollHeight;e>0&&(s.value=`${Math.min(e,800)}px`)}})}catch(t){console.error("Failed to render infographic:",t),i.value&&(i.value.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${t instanceof Error?t.message:"Unknown error"}</div>`)}})}m.watch(()=>w.value,()=>{a.value||l.value||m.nextTick(()=>{N()})}),m.watch(()=>a.value,e=>{e||l.value||m.nextTick(()=>{N()})}),m.watch(()=>l.value,e=>{e||a.value||m.nextTick(()=>{N()})}),m.onMounted(()=>{a.value||l.value||m.nextTick(()=>{N()})}),m.onBeforeUnmount(()=>{var e;if(T&&(null==(e=T.destroy)||e.call(T),T=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",k)}catch(t){}});const D=m.computed(()=>n.isDark?"infographic-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"infographic-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700"),_=m.computed(()=>a.value||l.value),j=m.computed(()=>({transform:`translate(${h.value}px, ${v.value}px) scale(${f.value})`}));return m.watch(j,e=>{u.value&&p.value&&(p.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,containerHeight:s,isModalOpen:u,modalContent:c,modalCloneWrapper:p,zoom:f,translateX:h,translateY:v,isDragging:g,dragStart:y,baseCode:w,shouldSkipEventTarget:x,onBtnHover:function(e,t,o="top"){if(x(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;pe(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){me()},onCopyHover:function(e){if(x(e.currentTarget))return;const t=r.value?o("common.copied")||"Copied":o("common.copy")||"Copy",l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;pe(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=w.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),r.value=!0,setTimeout(()=>{r.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},handleSwitchMode:function(e){a.value="source"===e},handleExportClick:function(){var e;const t=null==(e=i.value)?void 0:e.querySelector("svg");t?M(t):console.error("SVG element not found")},exportSvg:M,handleKeydown:k,openModal:b,closeModal:C,handleOpenModalClick:function(){b()},zoomIn:function(){f.value<3&&(f.value+=.1)},zoomOut:function(){f.value>.5&&(f.value-=.1)},resetZoom:function(){f.value=1,h.value=0,v.value=0},startDrag:function(e){g.value=!0,e instanceof MouseEvent?y.value={x:e.clientX-h.value,y:e.clientY-v.value}:y.value={x:e.touches[0].clientX-h.value,y:e.touches[0].clientY-v.value}},onDrag:function(e){if(!g.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),h.value=t-y.value.x,v.value=n-y.value.y},stopDrag:function(){g.value=!1},infographicInstance:T,renderInfographic:N,computedButtonStyle:D,isFullscreenDisabled:_,transformStyle:j,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Xt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}]},[n.props.showHeader?t("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.infographicIconUrl,alt:"Infographic"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Infographic")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center gap-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center gap-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center gap-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}]},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",{staticClass:"min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:n.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:n.containerHeight},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle},[t("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue"},[t("transition",{attrs:{name:"infographic-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!n.isDragging,"cursor-grabbing":n.isDragging},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}})])]):e._e()])],1)])],1)},[],!1,null,"1589dd71",null,null).exports,hn=k(m.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{type:Object,required:!0},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{type:String,default:"vitesse-dark"},lightTheme:{type:String,default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,{t:l}=he(),i=m.ref(kt(String(null!=(n=r.node.language)?n:""))),s=m.ref(!1),u=m.ref(!1),c=m.ref(!1),p=m.ref(null),f=m.ref(null),v=m.ref(null),g=m.ref(""),y=m.ref(!1),w=m.ref(!1);let x;const M=m.ref(!0),k=m.ref(0),b=m.ref(14),C=m.ref(b.value),T=m.computed(()=>{const e=b.value,t=C.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),N=m.computed(()=>{const e=i.value.trim().toLowerCase();return e?Tt[e]||e.charAt(0).toUpperCase()+e.slice(1):Tt[""]||"Plain Text"}),D=m.computed(()=>(gt.value,Ct(i.value.trim().toLowerCase().split(":")[0]))),_=m.computed(()=>{const e=i.value.trim().toLowerCase();return r.isShowPreview&&("html"===e||"svg"===e)}),j=m.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e}),I=m.computed(()=>({fontSize:`${C.value}px`})),E=m.computed(()=>!1!==r.showTooltips);function L(){return r.isDark?r.darkTheme:r.lightTheme}function S(){return r.themes}function B(e){const t=e.match(/\d+(\.\d+)?/g);return!t||t.length<3?null:t.slice(0,3).map(Number)}function A(e){const t=B(e);if(!t)return null;const n=t.map(e=>{const t=e/255;return t<=.03928?t/12.92:a((t+.055)/1.055,2.4)});return.2126*n[0]+.7152*n[1]+.0722*n[2]}function O(e,t){const n=A(e),o=A(t);return null==n||null==o?null:(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function z(e){const t=B(e);if(!t)return r.isDark;const[n,o,l]=t;return.2126*n+.7152*o+.0722*l<140}function P(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=p.value,n=v.value;if(!t||!n)return;const o=n.querySelector(".shiki")||n.querySelector("pre");if(!o)return;const l=window.getComputedStyle(o),i=o.querySelector("code")||o,a=window.getComputedStyle(i),s=String(l.backgroundColor||"").trim(),u=String(a.color||l.color||"").trim();s&&t.style.setProperty("--vscode-editor-background",s);const c=s?z(s):r.isDark,d=c?"rgb(229, 231, 235)":"rgb(17, 24, 39)",m=s&&u&&(null!=(e=O(u,s))?e:0)>=3?u:d;t.style.setProperty("--vscode-editor-foreground",m),t.style.setProperty("--markstream-code-fallback-selection-bg",c?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.06)"),t.style.setProperty("--vscode-editor-selectionBackground","var(--markstream-code-fallback-selection-bg)")}function R(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $(e,t=!1){return null==x||x.disconnect(),x=void 0,!t&&w.value?(g.value="",void(y.value=!0)):e?(g.value=`<pre class="shiki shiki-fallback"><code>${R(e)}</code></pre>`,void(y.value=!1)):(g.value="",y.value=!1,void(w.value=!1))}function H(){g.value="",y.value=!0,w.value=!0,m.nextTick().then(()=>{P()})}function U(){null==x||x.disconnect(),x=void 0,w.value&&(g.value="",y.value=!0)}function F(){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 d(this,null,function*(){if(yield m.nextTick(),F())return void H();const e=v.value;e&&(null==x||x.disconnect(),x=new MutationObserver(()=>{F()&&(H(),null==x||x.disconnect(),x=void 0)}),x.observe(e,{childList:!0,subtree:!0}))})}let W,Q,K,V;const X=new Set,q=new Set,Z=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(o={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:o.DEV);function G(e,t=!1){const n=kt(String(null!=e?e:""));return n?!V||V.has(n)?n:(t&&Z&&!X.has(n)&&(X.add(n),console.warn(`[MarkdownCodeBlockNode] Language "${n}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}function J(e,t){return d(this,null,function*(){if(!W)return!1;const n=G(t,Boolean(e&&e.length));try{return yield W.updateCode(e,n),!0}catch(o){if("plaintext"!==n){Z&&!q.has(n)&&(q.add(n),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${n}", retrying as plaintext.`,o));try{return yield W.updateCode(e,"plaintext"),!0}catch(r){return Z&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",r),!1}}else Z&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o);return!1}})}function ee(){return d(this,null,function*(){if(!Q)try{const e=yield import("stream-markdown");Q=e.createShikiStreamRenderer,K=e.registerHighlight;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;V=t?new Set(t.map(e=>e.toLowerCase())):void 0,null==K||K({themes:S()})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}function te(){return d(this,null,function*(){yield ee(),f.value&&v.value?(null==K||K({themes:S()}),!W&&Q&&(W=Q(v.value,{theme:L(),themes:S()}),y.value=!0),W?!1===r.stream&&r.loading?$(r.node.code,!w.value):($(r.node.code,!w.value),(yield J(r.node.code,i.value))?w.value?U():yield Y():U()):$(r.node.code,!0)):$(r.node.code,!0)})}function ne(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function oe(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}return te(),m.onMounted(()=>{te()}),m.onBeforeUnmount(()=>{null==x||x.disconnect(),x=void 0}),m.watch(()=>r.themes,()=>d(this,null,function*(){K&&K({themes:S()})})),m.watch(()=>r.loading,e=>{e||te()}),m.watch(E,e=>{e||me()}),m.watch(()=>[r.node.code,r.node.language],e=>d(this,[e],function*([e,t]){const n=kt(String(null!=t?t:""));if(n!==i.value&&(i.value=n),f.value&&v.value)return e?(W||($(e,!w.value),yield te()),void(W&&e&&(!1===r.stream&&r.loading||($(e,!w.value),(yield J(e,n))?w.value?U():yield Y():U())))):(null==x||x.disconnect(),x=void 0,v.value.innerHTML="",g.value="",y.value=!1,void(w.value=!1));$(e,!0)})),m.watch(()=>[r.darkTheme,r.lightTheme],()=>d(this,null,function*(){f.value&&v.value&&(W||(yield te()),yield null==W?void 0:W.setTheme(L()),P())})),m.watch(()=>r.node.code,()=>d(this,null,function*(){if(u.value||!M.value)return;yield m.nextTick();const e=f.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),{__sfc:!0,props:r,emits:t,t:l,codeLanguage:i,copyText:s,isExpanded:u,isCollapsed:c,container:p,codeBlockContent:f,rendererTarget:v,fallbackHtml:g,rendererReady:y,hasStableRender:w,renderObserver:x,autoScrollEnabled:M,lastScrollTop:k,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:b,codeFontSize:C,fontBaselineReady:T,displayLanguage:N,languageIcon:D,isPreviewable:_,containerStyle:j,contentStyle:I,tooltipsEnabled:E,getPreferredColorScheme:L,getResolvedThemes:S,getColorChannels:B,getRelativeLuminance:A,getContrastRatio:O,isDarkBackgroundColor:z,syncRenderedCssVars:P,escapeHtml:R,renderFallback:$,clearFallback:H,keepLastSuccessfulRender:U,hasRendererContent:F,clearFallbackWhenRendererReady:Y,renderer:W,createShikiRenderer:Q,registerHighlight:K,registeredHighlightLanguages:V,warnedMissingLanguages:X,warnedRendererErrors:q,isDevEnv:Z,normalizeRendererLanguage:G,updateRendererWithFallback:J,ensureStreamMarkdownLoaded:ee,initRenderer:te,isAtBottom:ne,handleScroll:function(){const e=f.value;if(!e||u.value)return;const t=e.scrollTop;t<k.value?M.value=!1:ne(e)&&(M.value=!0),k.value=t},copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),s.value=!0,t("copy",r.node.code),setTimeout(()=>{s.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},resolveTooltipTarget:oe,onBtnHover:function(e,t,n="top"){if(!E.value)return;const o=oe(e);if(!o)return;const l=e;pe(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){E.value&&me()},onCopyHover:function(e){if(!E.value)return;const t=oe(e);if(!t)return;const n=e;pe(t,s.value?l("common.copied")||"Copied":l("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(){u.value=!u.value;const e=f.value;e&&(u.value?(e.style.maxHeight="none",e.style["overflow-y"]="visible",e.style["overflow-x"]="auto"):(e.style.maxHeight="500px",e.style.overflow="auto",M.value=!0,m.nextTick(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))},toggleHeaderCollapse:function(){c.value=!c.value},increaseCodeFont:function(){const e=Math.min(36,C.value+1);C.value=e},decreaseCodeFont:function(){const e=Math.max(10,C.value-1);C.value=e},resetCodeFont:function(){C.value=b.value},previewCode:function(){if(!_.value)return;const e=kt(String(i.value||r.node.language)).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";t("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:r.node.code,title:n})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",n.props.isDark?"is-dark":""],style:c(u({},n.containerStyle),{backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))",color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))"})},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},[e._t("header-left",function(){return[t("div",{staticClass:"flex items-center space-x-2 flex-1 overflow-hidden"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("span",{staticClass:"text-sm font-medium font-mono truncate"},[e._v(e._s(n.displayLanguage))])])]}),e._t("header-right",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[n.props.showCollapseButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:n.toggleExpand,mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{"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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],ref:"codeBlockContent",staticClass:"code-block-content",style:n.contentStyle,on:{scroll:n.handleScroll}},[t("div",{ref:"rendererTarget",staticClass:"code-block-render"}),n.rendererReady?e._e():t("div",{staticClass:"code-fallback-plain",domProps:{innerHTML:e._s(n.fallbackHtml)}})]),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[e._m(0)]},{loading:e.loading,stream:e.stream})],2)])},[function(){var e=this._self._c;return this._self._setupProxy,e("div",{staticClass:"loading-skeleton"},[e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line short"})])}],!1,null,"4d6c1c17",null,null).exports,vn=new Map;function gn(e,t){if(vn.delete(e),vn.set(e,t),vn.size>200){const e=vn.keys().next().value;e&&vn.delete(e)}}function yn(e){if(!e)return null;const t=vn.get(e)||null;return t&&gn(e,t),t}function wn(e,t){e&&t&&gn(e,{html:t})}let xn=null,Mn=null,kn=!1;const bn=new Map,Cn=new Map;let Tn=5;const Nn=new Set;function Dn(){if(bn.size<Tn&&Nn.size){const t=Array.from(Nn);Nn.clear();for(const n of t)try{n()}catch(e){}}}let _n=null;const jn=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&jn&&Promise.resolve().then(()=>require("./performance-monitor.js")).then(e=>{_n=e.perfMonitor})}catch(vo){}function In(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now();if(!Ne()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Mn)return Promise.reject(Mn);const l=`${t?"d":"i"}:${e}`,i=Cn.get(l);if(i)return _n&&_n.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),Promise.resolve(i);const a=xn||(Mn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Mn.name="WorkerInitError",Mn.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(Mn);if(bn.size>=Tn){const t=new Error("Worker busy");return t.name="WorkerBusy",t.code="WORKER_BUSY",t.busy=!0,t.inFlight=bn.size,t.max=Tn,_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(t)}return new Promise((l,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const s=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{bn.delete(s);const t=new Error("Worker render timed out");t.name="WorkerTimeout",t.code="WORKER_TIMEOUT",_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(t),Dn()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),bn.has(s)&&bn.delete(s);const e=new Error("Aborted");e.name="AbortError",i(e),Dn()},{once:!0});const c=l,d=i;bn.set(s,{resolve:t=>{_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),c(t)},reject:t=>{_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:(null==t?void 0:t.message)||String(t)}),d(t)},timeoutId:u}),a.postMessage({id:s,content:e,displayMode:t})})})}function En(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(Cn.set(o,n),Cn.size>200){const e=Cn.keys().next().value;Cn.delete(e)}}const Ln="WORKER_BUSY";function Sn(e=2e3,t){return bn.size<Tn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),Nn.delete(i),n())};if(Nn.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,Nn.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>Dn()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),Nn.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Bn={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function An(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!Ne()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Bn.timeout,s=null!=(r=n.waitTimeout)?r:Bn.waitTimeout,u=null!=(l=n.backoffMs)?l:Bn.backoffMs,c=null!=(i=n.maxRetries)?i:Bn.maxRetries,d=Number.isFinite(c)?Math.max(0,Math.min(Math.floor(c),8)):Bn.maxRetries,p=n.signal;let m=0;for(;;){if(null==p?void 0:p.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield In(e,t,a,p)}catch(f){if((null==f?void 0:f.code)!==Ln||m>=d)throw f;if(m++,yield Sn(s,p).catch(()=>{}),null==p?void 0:p.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*m)))}}})}const On=k(m.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=ge();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),u=yn(s.value),c=m.ref((null==u?void 0:u.html)||""),p=m.ref(""),f=m.ref(!(null==u?void 0:u.html));let h=Boolean(null==u?void 0:u.html);function v(){return d(this,null,function*(){const e=yield De();if(!e)return!1;try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:!0});return g(n),En(t.node.content,!0,n),!0}catch(vo){return!1}})}function g(e){c.value=e,p.value="",f.value=!1,h=!0,wn(s.value,e)}function y(){c.value="",p.value=t.node.raw,f.value=!1}function w(){return d(this,null,function*(){if(i)return;if(!t.node.content)return y(),void(h=!0);const e=yn(s.value);if((null==e?void 0:e.html)&&!c.value&&(c.value=e.html,h=!0,f.value=!1),!h){f.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(vo){}}a&&(a.abort(),a=null);const u=++l,d=new AbortController;a=d;try{const e=yield An(t.node.content,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:d.signal});if(i||u!==l)return;g(e)}catch(p){if(i||u!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===Ln||"WORKER_TIMEOUT"===e)&&(yield v()))return;if(h||c.value)return;n||!t.node.loading?y():f.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>w()),m.onMounted(()=>{w()}),m.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,cacheKey:s,initialCached:u,renderedHtml:c,fallbackText:p,renderingLoading:f,hasRenderedOnce:h,renderWithMainThreadFallback:v,applySuccessfulRender:g,applyRawFallback:y,renderMath:w}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerEl",staticClass:"math-block text-center overflow-x-auto relative min-h-[40px]"},[n.renderedHtml?t("div",{staticClass:"math-block__content",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("div",{staticClass:"math-block__fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})])])},[],!1,null,"e3517392",null,null).exports,zn=k(m.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=ge();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>"$$"===t.node.markup),u=m.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),c=yn(u.value),p=m.ref((null==c?void 0:c.html)||""),f=m.ref(""),h=m.ref(!(null==c?void 0:c.html));let v=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield De();if(!e)return!1;try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:s.value});return y(n),En(t.node.content,s.value,n),!0}catch(vo){return!1}})}function y(e){p.value=e,f.value="",h.value=!1,v=!0,wn(u.value,e)}function w(){p.value="",f.value=t.node.raw,h.value=!1}function x(){return d(this,null,function*(){if(i)return;if(!t.node.content)return w(),void(v=!0);const e=yn(u.value);(null==e?void 0:e.html)&&!p.value&&(p.value=e.html,v=!0,h.value=!1),a&&(a.abort(),a=null);const c=++l,d=new AbortController;if(a=d,!v){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(vo){}}try{const e=yield An(t.node.content,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:d.signal});if(i||c!==l)return;y(e)}catch(m){if(i||c!==l)return;if("AbortError"===(null==m?void 0:m.name))return;const e=(null==m?void 0:m.code)||(null==m?void 0:m.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==m?void 0:m.fallbackToRenderer)||e===Ln||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(v||p.value)return;n||!t.node.loading?w():h.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>x()),m.onMounted(()=>{x()}),m.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,displayMode:s,cacheKey:u,initialCached:c,renderedHtml:p,fallbackText:f,renderingLoading:h,hasRenderedOnce:v,renderWithMainThreadFallback:g,applySuccessfulRender:y,applyRawFallback:w,renderMath:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[n.renderedHtml?t("span",{staticClass:"math-inline",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("span",{staticClass:"math-inline math-inline--fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("span",{staticClass:"math-inline__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"math-inline__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.renderingLoading})],2)])},[],!1,null,"d1ef86a8",null,null).exports,Pn=()=>import("mermaid");let Rn=null,$n=Pn;function Hn(e){$n=e,Rn=null}function Un(){return"function"==typeof $n}function Fn(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 c(u({},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}function Yn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=u({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(vo){}}let Wn=null,Qn=null;const Kn=new Map;let Vn=5,Xn=!1;const qn="WORKER_BUSY",Zn="MERMAID_DISABLED";function Gn(e,t,n=1400){if(!Un()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Zn,Promise.reject(e)}if(Qn)return Promise.reject(Qn);const o=Wn||(Qn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Qn.name="WorkerInitError",Qn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Qn);if(Kn.size>=Vn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=qn,e.inFlight=Kn.size,e.max=Vn,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Kn.delete(i))},c={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};Kn.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Kn.delete(i),void l(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Kn.get(i);t&&t.reject(e)},n)})}function Jn(e,t,n=1400){return d(this,null,function*(){try{return yield Gn("canParse",{code:e,theme:t},n)}catch(vo){return Promise.reject(vo)}})}function eo(e,t,n=1400){return d(this,null,function*(){try{return yield Gn("findPrefix",{code:e,theme:t},n)}catch(vo){return Promise.reject(vo)}})}function to(){if(Wn)try{for(const[e,t]of Kn.entries())t.reject(new Error("Worker terminated"));Kn.clear(),Wn.terminate()}finally{Wn=null}}const no=k(m.defineComponent({__name:"MermaidBlockNode",props:{node:null,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 r=e,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},i=m.ref(!1),a=m.computed(()=>r.isStrict?"strict":"loose"),s=m.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function p(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}const f=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],v=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return v.test(t)?t:""}function y(e){const t=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(f.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)}}}}}function w(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const t=p(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const o=n;return y(o),o}function x(e,t){if(!e)return"";try{e.replaceChildren()}catch(vo){e.innerHTML=""}const n=w(t);return n?(e.appendChild(n),e.innerHTML):""}function M(e){if(e)try{e.replaceChildren()}catch(vo){e.innerHTML=""}}function k(e,t){if(!e)return"";if("strict"===a.value)return x(e,t);try{e.replaceChildren()}catch(vo){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(vo){e.innerHTML=t}return e.innerHTML}const{t:b}=he();function C(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Rn)return Rn;const e=function(){try{const e=globalThis;return Fn(null==e?void 0:e.mermaid)}catch(vo){return null}}();if(e)return Rn=e,Yn(Rn),Rn;const t=$n;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===Pn)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Rn=Fn(n),Yn(Rn),Rn):null})}();return i.value=!!e,e}catch(e){throw i.value=!1,e}})}"undefined"!=typeof window&&(()=>{d(this,null,function*(){var e;try{const t=yield C();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,u({},s.value))}catch(t){i.value=!1,console.warn("[markstream-vue2] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const T=m.ref(!1),N=m.ref(!1),D=m.ref(),_=m.ref(),j=m.ref(),I=m.ref(null),E=ge();let L=null;const S=m.ref("undefined"==typeof window),B=m.ref(),A=m.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function O(e,t=A.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}const z=m.ref(1),P=m.ref(0),R=m.ref(0),$=m.ref(!1),H=m.ref({x:0,y:0}),U=m.ref(!1),F=m.ref(!1),Y=m.ref(!1),W=m.ref(null),Q=m.ref(0),K=m.ref(!1);let V=null,X=null,q=0;const Z=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16),G=Ye(()=>{Z(()=>{Ze()},{timeout:500})},300);function J(){null!=X&&(globalThis.clearTimeout(X),X=null)}function ee(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);J(),X=globalThis.setTimeout(()=>{X=null,r.loading||Y.value||!S.value?ee(Math.min(1200,Math.max(300,1.2*t))):G()},t)}const te=m.ref("360px");let ne=null;const oe=m.ref(!1),re=m.ref(!1),le=m.ref({}),ie=m.ref(null),ae=m.ref(""),se=m.ref(0);let ue=null;const ce=m.ref(!1),de=m.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),fe=m.computed(()=>r.enableWheelZoom?{wheel:Qe}:{}),ve=m.computed(()=>{var e,t,n,o;return{worker:null!=(e=r.workerTimeoutMs)?e:1400,parse:null!=(t=r.parseTimeoutMs)?t:1800,render:null!=(n=r.renderTimeoutMs)?n:2500,fullRender:null!=(o=r.fullRenderTimeoutMs)?o:4e3}}),ye=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let we=null,xe=null,Me=!1,ke=800,be=null,Ce=0,Te=!0,Ne=0;function De(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 r=null,l=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=r&&clearTimeout(r),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(r=globalThis.setTimeout(()=>{l||(l=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{l||(l=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{l||(l=!0,s(),t(e))}).catch(e=>{l||(l=!0,s(),a(e))})})}function _e(e){if("undefined"==typeof document)return;if(!_.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),M(_.value),_.value.appendChild(t),te.value="360px",ce.value=!0,Ge()}function je(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)}function Ie(e){return!e||e.disabled}function Ee(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Le(){return Te&&!U.value&&!oe.value&&!ce.value}function Se(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 Be(e,t,n){return d(this,null,function*(){var o,r;const l=yield C();if(!l)return;const i=l,a=Ee(e,t);if("function"==typeof i.parse)return yield De(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:ve.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield De(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:ve.value.render,signal:null==n?void 0:n.signal}),!0})}function Ae(e,t,n){return d(this,null,function*(){var o;try{return yield Jn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ve.value.worker)}catch(vo){return yield Be(e,t,n)}})}function Oe(e,t,n){return d(this,null,function*(){var o;try{if(yield Ae(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))throw vo}let r=Se(e);if(r&&r.trim()&&r!==e)try{try{const l=yield eo(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ve.value.worker);l&&l.trim()&&(r=l)}catch(vo){}if(yield Ae(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))throw vo}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&m.watch(()=>D.value,e=>{if(null==L||L.destroy(),L=null,!e)return void(S.value=!1);const t=E(e,{rootMargin:"400px"});L=t,S.value=t.isVisible.value,t.whenVisible.then(()=>{S.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==L||L.destroy(),L=null});const ze=m.computed(()=>U.value||Y.value||N.value);function Pe(e){if(!D.value||!_.value)return;const t=_.value.querySelector("svg");if(!t)return;let n=0,o=0;const r=t.getAttribute("viewBox"),l=t.getAttribute("width"),i=t.getAttribute("height");if(r){const e=r.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||l&&i&&(n=Number.parseFloat(l),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(vo){return void console.error("Failed to get SVG BBox:",vo)}if(n>0&&o>0){const t=o/n;let r=(null!=e?e:D.value.clientWidth)*t;r>o&&(r=o),te.value=`${r}px`}}const Re=m.ref(!1),$e=m.computed(()=>({transform:`translate(${P.value}px, ${R.value}px) scale(${z.value})`}));function He(e){"Escape"===e.key&&Re.value&&Fe()}function Ue(){if(Re.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(vo){}if("undefined"!=typeof window)try{window.addEventListener("keydown",He)}catch(vo){}m.nextTick(()=>{if(D.value&&j.value){const e=D.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(I.value=t,t.style.transform=$e.value.transform),M(j.value),j.value.appendChild(e)}})}function Fe(){if(Re.value=!1,j.value&&M(j.value),I.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(vo){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",He)}catch(vo){}}function Ye(e,t){let n=null;return(...o)=>{n&&clearTimeout(n),n=setTimeout(()=>e(...o),t)}}function We(){if(!U.value)return;if(!i.value)return;const e=A.value.length;e!==Q.value&&(K.value=!0,Q.value=e,V&&clearTimeout(V),V=setTimeout(()=>{K.value&&U.value&&A.value.trim()&&(K.value=!1,Ve("preview"))},500))}function Qe(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!D.value)return;const t=D.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-P.value)/z.value,a=(l-R.value)/z.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(z.value+u,.5),3);c!==z.value&&(P.value=r-i*c,R.value=l-a*c,z.value=c)}}function Ke(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);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(vo){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function Ve(e){return d(this,null,function*(){const t=B.value;if(!t)return F.value=!0,void(U.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",F.value=!0,U.value="source"===e,yield m.nextTick();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const r=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",l)};function l(){r()}t.addEventListener("transitionend",l),setTimeout(()=>r(),220)})}function Xe(){return d(this,null,function*(){return Y.value?W.value:_.value||(yield m.nextTick(),_.value)?(Y.value=!0,W.value=(()=>d(this,null,function*(){var e,t;_.value&&(_.value.style.opacity="0");try{const t=yield C();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;oe.value||re.value||null==(e=t.initialize)||e.call(t,c(u({},s.value),{dompurifyConfig:u({},l)}));const o=O(r.isDark?"dark":"light"),i=yield De(()=>t.render(n,o),{timeoutMs:ve.value.fullRender}),a=null==i?void 0:i.svg;if(_.value){const e=k(_.value,a);oe.value||re.value||(Pe(),oe.value=!0,de.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:te.value});const t=r.isDark?"dark":"light";e&&(le.value[t]=e),re.value&&(re.value=!1),ce.value=!1,q=0,J()}}catch(n){const e=je(n),o=q+1;e&&o<=3?(q=o,ee(Math.min(1200,600*o)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&console.warn("[markstream-vue2] Mermaid render timed out, retry scheduled:",o)):(q=0,J(),console.error("Failed to render mermaid diagram:",n),!1===r.loading&&_e(n))}finally{yield m.nextTick(),_.value&&(_.value.style.opacity="1"),Y.value=!1,W.value=null}}))(),W.value):void console.warn("Mermaid container not ready")})}function qe(e){return d(this,null,function*(){if(Le()&&(_.value||(yield m.nextTick(),_.value))&&!Y.value){Y.value=!0;try{const t=yield C();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=r.isDark?"dark":"light",l=Se(e),i=Ee(l&&l.trim()?l:e,o);_.value&&(_.value.style.opacity="0");const a=yield De(()=>t.render(n,i),{timeoutMs:ve.value.render}),s=null==a?void 0:a.svg;_.value&&s&&(k(_.value,s),Pe())}catch(vo){}finally{yield m.nextTick(),_.value&&(_.value.style.opacity="1"),Y.value=!1}}})}function Ze(){return d(this,null,function*(){var e,t;const n=Date.now(),o=++se.value;ue&&ue.abort(),ue=new AbortController;const l=ue.signal,i=r.isDark?"dark":"light",a=A.value,s=a.replace(/\s+/g,"");if(!a.trim())return _.value&&M(_.value),ie.value=null,ae.value="",void(ce.value=!1);if(s===ae.value)return;try{const r=yield Oe(a,i,{signal:l,timeoutMs:ve.value.worker});if(r.fullOk)return yield Xe(),void(se.value===o&&(ie.value=null!=(t=null==(e=_.value)?void 0:e.innerHTML)?t:null,ae.value=s,ce.value=!1));const u=Ce&&n<=Ce;if(r.prefixOk&&r.prefix&&Le()&&!u)return void(yield qe(r.prefix))}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))return}if(se.value!==o)return;if(ce.value)return;const u=le.value[i];u&&_.value&&k(_.value,u)})}function Ge(){Me&&(Me=!1,ke=800,Te=!1,be&&(be.abort(),be=null),we&&(globalThis.clearTimeout(we),we=null),xe&&(ye(xe),xe=null),Ce=Date.now())}function Je(){if(Ge(),ue){try{ue.abort()}catch(vo){}ue=null}if(be){try{be.abort()}catch(vo){}be=null}to(),J(),q=0}function et(e=800){Me&&(Ne>=12?Ge():(we&&globalThis.clearTimeout(we),we=globalThis.setTimeout(()=>{xe=Z(()=>d(this,null,function*(){if(!Me)return;if(U.value||oe.value)return void Ge();const e=r.isDark?"dark":"light",t=A.value;if(!t.trim())return!1===r.loading?void Ge():void et(ke);if(Ne++,Ne>12)Ge();else{be&&be.abort(),be=new AbortController;try{if((yield Ae(t,e,{signal:be.signal,timeoutMs:ve.value.worker}))&&(yield Xe(),oe.value))return void Ge()}catch(vo){}ke=Math.min(Math.floor(1.5*ke),4e3),et(ke)}}),{timeout:500})},e)))}function tt(){Me||U.value||oe.value||(Me=!0,Ce=0,Te=!0,Ne=0,et(500))}m.watch($e,e=>{Re.value&&I.value&&(I.value.style.transform=e.transform)},{immediate:!0}),m.watch(()=>A.value,()=>{oe.value=!1,le.value={},G(),!U.value&&i.value&&tt(),We()}),m.watch(()=>r.isDark,()=>d(this,null,function*(){if(!oe.value)return;if(ce.value)return;const e=r.isDark?"dark":"light",t=le.value[e];if(t)return void(_.value&&k(_.value,t));const n={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:te.value},o=1!==z.value||0!==P.value||0!==R.value;re.value=!0,o&&(z.value=1,P.value=0,R.value=0,yield m.nextTick()),yield Xe(),o&&(yield m.nextTick(),z.value=n.zoom,P.value=n.translateX,R.value=n.translateY,te.value=n.containerHeight,de.value=n)})),m.watch(()=>U.value,e=>d(this,null,function*(){if(e)Ge(),oe.value&&(de.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:te.value});else{if(ce.value)return;const e=r.isDark?"dark":"light";if(oe.value&&le.value[e])return yield m.nextTick(),_.value&&k(_.value,le.value[e]),z.value=de.value.zoom,P.value=de.value.translateX,R.value=de.value.translateY,void(te.value=de.value.containerHeight);if(yield m.nextTick(),!i.value)return;yield Ze(),tt()}})),m.watch(()=>r.loading,(e,t)=>d(this,null,function*(){if(!0===t&&!1===e){const e=A.value.trim();if(!e)return Je();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(oe.value&&o===ae.value)return yield m.nextTick(),_.value&&!_.value.querySelector("svg")&&le.value[t]&&k(_.value,le.value[t]),void Je();try{yield Ae(e,t,{timeoutMs:ve.value.worker}),yield Xe(),ae.value=o,ce.value=!1,Je()}catch(n){Je(),_e(n)}}})),m.watch(D,e=>{ne&&ne.disconnect(),!e||oe.value||re.value||(ne=new ResizeObserver(e=>{e&&e.length>0&&!oe.value&&!re.value&&Vt(()=>{Pe(e[0].contentRect.width)})}),ne.observe(e))},{immediate:!0}),m.onMounted(()=>d(this,null,function*(){yield m.nextTick(),F.value||(U.value=!i.value),S.value&&(G(),Q.value=A.value.length)})),m.watch(()=>i.value,e=>{F.value||(U.value=!e)}),m.watch(()=>S.value,e=>{e&&(oe.value||(G(),Q.value=A.value.length),r.loading||oe.value||G())},{immediate:!1}),m.onUnmounted(()=>{V&&clearTimeout(V),ne&&ne.disconnect(),ue&&(ue.abort(),ue=null),to(),Ge(),J()}),m.watch(()=>N.value,e=>d(this,null,function*(){e?(Ge(),ue&&ue.abort()):oe.value||(yield m.nextTick(),G(),U.value||tt())}),{immediate:!1});const nt=m.computed(()=>r.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{__sfc:!0,props:r,emits:t,DOMPURIFY_CONFIG:l,mermaidAvailable:i,mermaidSecurityLevel:a,mermaidInitConfig:s,neutralizeScriptProtocols:p,DISALLOWED_STYLE_PATTERNS:f,SAFE_URL_PROTOCOLS:v,sanitizeUrl:g,scrubSvgElement:y,toSafeSvgElement:w,setSafeSvg:x,clearElement:M,renderSvgToTarget:k,t:b,resolveMermaidInstance:C,copyText:T,isCollapsed:N,mermaidContainer:D,mermaidContent:_,modalContent:j,modalCloneWrapper:I,registerViewport:E,viewportHandle:L,viewportReady:S,modeContainerRef:B,baseFixedCode:A,getCodeWithTheme:O,zoom:z,translateX:P,translateY:R,isDragging:$,dragStart:H,showSource:U,userToggledShowSource:F,isRendering:Y,renderQueue:W,RENDER_DEBOUNCE_DELAY:300,CONTENT_STABLE_DELAY:500,lastContentLength:Q,isContentGenerating:K,contentStableTimer:V,renderRetryTimer:X,consecutiveRenderTimeouts:q,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:Z,debouncedProgressiveRender:G,clearRenderRetryTimer:J,scheduleRenderRetry:ee,containerHeight:te,resizeObserver:ne,hasRenderedOnce:oe,isThemeRendering:re,svgCache:le,lastSvgSnapshot:ie,lastRenderedCode:ae,renderToken:se,currentWorkController:ue,hasRenderError:ce,savedTransformState:de,wheelListeners:fe,timeouts:ve,cancelIdle:ye,previewPollTimeoutId:we,previewPollIdleId:xe,isPreviewPolling:Me,previewPollDelay:ke,previewPollController:be,lastPreviewStopAt:Ce,allowPartialPreview:Te,PREVIEW_POLL_MAX_ATTEMPTS:12,previewPollAttempts:Ne,withTimeoutSignal:De,renderErrorToContainer:_e,isTimeoutError:je,shouldSkipEventTarget:Ie,onBtnHover:function(e,t,n="top"){if(Ie(e.currentTarget))return;const o=e,l=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;pe(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){me()},onCopyHover:function(e){if(Ie(e.currentTarget))return;const t=T.value?b("common.copied")||"Copied":b("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;pe(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Ee,canApplyPartialPreview:Le,getSafePrefixCandidate:Se,canParseOnMain:Be,canParseOffthread:Ae,canParseOrPrefix:Oe,isFullscreenDisabled:ze,updateContainerHeight:Pe,isModalOpen:Re,transformStyle:$e,handleKeydown:He,openModal:Ue,closeModal:Fe,debounce:Ye,checkContentStability:We,zoomIn:function(){z.value<3&&(z.value+=.1)},zoomOut:function(){z.value>.5&&(z.value-=.1)},resetZoom:function(){z.value=1,P.value=0,R.value=0},startDrag:function(e){$.value=!0,e instanceof MouseEvent?H.value={x:e.clientX-P.value,y:e.clientY-R.value}:H.value={x:e.touches[0].clientX-P.value,y:e.touches[0].clientY-R.value}},onDrag:function(e){if(!$.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),P.value=t-H.value.x,R.value=n-H.value.y},stopDrag:function(){$.value=!1},handleWheel:Qe,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(A.value)),T.value=!0,t("copy",A.value),setTimeout(()=>{T.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:Ke,handleExportClick:function(){var e;const n=null==(e=_.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const o=(new XMLSerializer).serializeToString(n),r={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};t("export",r),r.defaultPrevented||Ke(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=_.value)?void 0:e.querySelector("svg"))?n:null,r=o?(new XMLSerializer).serializeToString(o):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:o,svgString:r};t("openModal",l),l.defaultPrevented||Ue()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||Ve(e)},switchMode:Ve,initMermaid:Xe,renderPartial:qe,progressiveRender:Ze,stopPreviewPolling:Ge,cleanupAfterLoadingSettled:Je,scheduleNextPreviewPoll:et,startPreviewPolling:tt,computedButtonStyle:nt,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Xt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}]},[n.props.showHeader?t("div",{staticClass:"mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center space-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.mermaidIconUrl,alt:"Mermaid"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Mermaid")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle&&n.mermaidAvailable?t("div",{staticClass:"flex items-center space-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center space-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"modeContainerRef"},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseFixedCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",e._g({ref:"mermaidContainer",staticClass:"min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:n.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:n.containerHeight},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},n.wheelListeners),[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle,attrs:{"data-mermaid-wrapper":""}},[t("div",{ref:"mermaidContent",staticClass:"_mermaid w-full text-center flex items-center justify-center min-h-full"})])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"mermaid-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",e._g({ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},n.wheelListeners))])]):e._e()])],1)])],1)])])},[],!1,null,"f459048d",null,null).exports;function oo(e){const t=String(null!=e?e:"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Za-z][\w:-]*)/);return n?n[1].toLowerCase():""}const ro=k(m.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:lt,NodeRenderer:ot},props:{content:String,nodes:Array,final:Boolean,parseOptions:Object,customMarkdownIt:Function,debugPerformance:Boolean,customHtmlTags:Array,viewportPriority:Boolean,codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:Object,renderCodeBlocksAsPre:Boolean,codeBlockMinWidth:[String,Number],codeBlockMaxWidth:[String,Number],codeBlockProps:Object,showTooltips:Boolean,themes:Array,isDark:Boolean,customId:[String,Number],indexKey:[String,Number],typewriter:Boolean,batchRendering:Boolean,initialRenderBatchSize:Number,renderBatchSize:Number,renderBatchDelay:Number,renderBatchBudgetMs:Number,renderBatchIdleTimeoutMs:Number,deferNodesUntilVisible:Boolean,maxLiveNodes:Number,liveNodeBuffer:Number},data(){return{instanceMsgId:this.customId?`renderer-${this.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`}},computed:{legacyVue26(){return w(this)},mergedParseOptions(){var e,t,n,o;const r=null!=(e=this.parseOptions)?e:{},l=null!=(t=this.final)?t:r.final,i=[...null!=(n=this.customHtmlTags)?n:[],...null!=(o=r.customHtmlTags)?o:[]].map(oo).filter(Boolean),a=null!=l,s=i.length>0;return a||s?u(u(u({},r),a?{final:l}:{}),s?{customHtmlTags:Array.from(new Set(i))}:{}):r},parsedLegacyNodes(){if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:e,tags:t}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const t=new Set,n=[];for(const o of e){const e=oo(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return{key:n.join(","),tags:n}}(this.customHtmlTags),n=p.getMarkdown(e?`${this.instanceMsgId}:${e}`:this.instanceMsgId,{customHtmlTags:t}),o=this.customMarkdownIt?this.customMarkdownIt(n):n;return p.parseMarkdownToStructure(this.content,o,this.mergedParseOptions)},forwardedProps(){return{content:this.content,nodes:this.nodes,final:this.final,parseOptions:this.parseOptions,customMarkdownIt:this.customMarkdownIt,debugPerformance:this.debugPerformance,customHtmlTags:this.customHtmlTags,viewportPriority:this.viewportPriority,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,showTooltips:this.showTooltips,themes:this.themes,isDark:this.isDark,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,batchRendering:this.batchRendering,initialRenderBatchSize:this.initialRenderBatchSize,renderBatchSize:this.renderBatchSize,renderBatchDelay:this.renderBatchDelay,renderBatchBudgetMs:this.renderBatchBudgetMs,renderBatchIdleTimeoutMs:this.renderBatchIdleTimeoutMs,deferNodesUntilVisible:this.deferNodesUntilVisible,maxLiveNodes:this.maxLiveNodes,liveNodeBuffer:this.liveNodeBuffer}}},render(e){const t=M(this);return this.legacyVue26?e(lt,u({props:{nodes:this.parsedLegacyNodes,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,showTooltips:this.showTooltips,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,themes:this.themes,isDark:this.isDark}},Object.keys(t).length>0?{on:t}:{})):e(ot,u({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,lo=k(m.defineComponent({name:"NestedRenderer",components:{MarkdownRender:ro},inheritAttrs:!1,props:{node:Object,nodes:Array,content:String,loading:Boolean,final:Boolean,cacheKey:String,parseOptions:Object,customHtmlTags:Array,customMarkdownIt:Function},setup(e){const t=m.getCurrentInstance(),n=m.computed(()=>{var t;return null!=e.final?e.final:"boolean"==typeof e.loading?!e.loading:"boolean"==typeof(null==(t=e.node)?void 0:t.loading)?!e.node.loading:void 0}),o=m.computed(()=>Wt({node:e.node,nodes:e.nodes,content:e.content},{cacheKey:e.cacheKey,final:n.value,parseOptions:e.parseOptions,customHtmlTags:e.customHtmlTags,customMarkdownIt:e.customMarkdownIt}));return{forwardedListeners:m.computed(()=>M(null==t?void 0:t.proxy)),resolvedFinal:n,resolvedNodes:o}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("MarkdownRender",e._g(e._b({attrs:{nodes:e.resolvedNodes,final:e.resolvedFinal,"custom-html-tags":e.customHtmlTags}},"MarkdownRender",e.$attrs,!1),e.forwardedListeners))},[],!1,null,null,null,null).exports,io=k(m.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:null,content:null,placement:null,offset:null,originX:null,originY:null,id:null,isDark:{type:[Boolean,null]}},setup(e){const t=e,n=m.computed(()=>{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(vo){}return!1}),o=m.ref(null),r=m.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=m.ref(!1);let i=null;function a(){return d(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[f.offset(null!=(e=t.offset)?e:8),f.flip(),f.shift({padding:8})],{x:i,y:a}=yield f.computePosition(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return m.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield m.nextTick(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield a();const n=r.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?(r.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield m.nextTick(),l.value=!0,yield m.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=f.autoUpdate(t.anchorEl,o.value,a)}catch(vo){yield a(),l.value=!0,i=f.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),m.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield m.nextTick(),yield a())})),m.onBeforeUnmount(()=>{i&&i()}),{__sfc:!0,props:t,isDarkEffective:n,tooltip:o,style:r,ready:l,cleanupAutoUpdate:i,updatePosition:a,Portal:Xt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"tooltip",appear:""}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible&&n.ready,expression:"visible && ready"}],ref:"tooltip",staticClass:"z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",class:[n.isDarkEffective?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"],style:{position:"fixed",left:n.style.left,top:n.style.top,transform:n.style.transform},attrs:{id:n.props.id,role:"tooltip"}},[e._v(" "+e._s(e.content)+" ")])])],1)])},[],!1,null,"703da293",null,null).exports,ao=Object.freeze(Object.defineProperty({__proto__:null,default:io},Symbol.toStringTag,{value:"Module"}));function so(e){return JSON.stringify(e)}function uo(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=so(u({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=so(o),a=r?so(r):'""';return"module"===n?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function co(e){return JSON.stringify(e)}function po(e){var t;const n=null!=(t=e.mode)?t:"module",o=co(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${co(u({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===n?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function mo(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const fo={AdmonitionNode:it,BlockquoteNode:rt,CheckboxNode:b,CodeBlockNode:rn,DefinitionListNode:C,EmojiNode:T,EmphasisNode:Fe,FootnoteNode:We,FootnoteReferenceNode:E,FootnoteAnchorNode:Ye,HardBreakNode:Qe,HeadingNode:Ke,HtmlBlockNode:qe,HtmlInlineNode:q,HighlightNode:Ue,ImageNode:ye,D2BlockNode:cn,InlineCodeNode:Z,PreCodeNode:Ge,InsertNode:He,LinkNode:$e,ListItemNode:Ve,ListNode:Xe,MarkdownCodeBlockNode:hn,MathBlockNode:On,MathInlineNode:zn,MermaidBlockNode:no,NestedRenderer:lo,InfographicBlockNode:fn,ParagraphNode:Ze,StrikethroughNode:Re,StrongNode:Pe,SubscriptNode:ze,SuperscriptNode:Oe,TableNode:Je,TextNode:Ee,ThematicBreakNode:et,VmrContainerNode:nt,ReferenceNode:Ae},ho={install(e,t){!function(e){const t=mo(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=mo(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(vo){}}})}(e),Object.entries(fo).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",ro),e.component("NodeRenderer",ro),(null==t?void 0:t.getLanguageIcon)&&Mt(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&p.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>p.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>p.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>p.setDefaultMathOptions}),exports.AdmonitionNode=it,exports.BlockquoteNode=rt,exports.CheckboxNode=b,exports.CodeBlockNode=rn,exports.D2BlockNode=cn,exports.DefinitionListNode=C,exports.EmojiNode=T,exports.EmphasisNode=Fe,exports.FootnoteAnchorNode=Ye,exports.FootnoteNode=We,exports.FootnoteReferenceNode=E,exports.HardBreakNode=Qe,exports.HeadingNode=Ke,exports.HighlightNode=Ue,exports.HtmlBlockNode=qe,exports.HtmlInlineNode=q,exports.ImageNode=ye,exports.InfographicBlockNode=fn,exports.InlineCodeNode=Z,exports.InsertNode=He,exports.LinkNode=$e,exports.ListItemNode=Ve,exports.ListNode=Xe,exports.MERMAID_DISABLED_CODE=Zn,exports.MERMAID_WORKER_BUSY_CODE=qn,exports.MarkdownCodeBlockNode=hn,exports.MarkdownRender=ro,exports.MathBlockNode=On,exports.MathInlineNode=zn,exports.MermaidBlockNode=no,exports.NestedRenderer=lo,exports.ParagraphNode=Ze,exports.PreCodeNode=Ge,exports.ReferenceNode=Ae,exports.StrikethroughNode=Re,exports.StrongNode=Pe,exports.SubscriptNode=ze,exports.SuperscriptNode=Oe,exports.TableNode=Je,exports.TextNode=Ee,exports.ThematicBreakNode=et,exports.Tooltip=io,exports.VmrContainerNode=nt,exports.VueRendererMarkdown=ho,exports.WORKER_BUSY_CODE=Ln,exports.buildKaTeXCDNWorkerSource=uo,exports.buildMermaidCDNWorkerSource=po,exports.canParseOffthread=Jn,exports.clearGlobalCustomComponents=function(){delete _.scopedCustomComponents[N],j.value++},exports.clearKaTeXWorker=function(){var e;xn&&(null==(e=xn.terminate)||e.call(xn)),xn=null,Mn=null},exports.clearMermaidWorker=function(){var e;if(Wn)try{for(const[e,t]of Kn.entries())t.reject(new Error("Worker cleared"));Kn.clear(),null==(e=Wn.terminate)||e.call(Wn)}catch(vo){}Wn=null,Qn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=uo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"classic")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(vo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(vo){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=po(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"module")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(vo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(vo){}}},source:o}},exports.default=ro,exports.disableD2=function(){un(null)},exports.disableKatex=function(){Te(null)},exports.disableMermaid=function(){Hn(null)},exports.enableD2=function(e){un(null!=e?e:ln)},exports.enableKatex=function(e){Te(null!=e?e:Ce)},exports.enableMermaid=function(e){Hn(null!=e?e:Pn)},exports.findPrefixOffthread=eo,exports.getCustomNodeComponents=I,exports.getKaTeXBackpressureDefaults=function(){return u({},Bn)},exports.getKaTeXWorkerLoad=function(){return{inFlight:bn.size,max:Tn}},exports.getLanguageIcon=Ct,exports.getMermaidWorkerLoad=function(){return{inFlight:Kn.size,max:Vn}},exports.getUseMonaco=ct,exports.isD2Enabled=function(){return"function"==typeof sn},exports.isKaTeXWorkerBusy=function(){return bn.size>=Tn},exports.isKatexEnabled=Ne,exports.isMermaidEnabled=Un,exports.languageIconsRevision=gt,exports.languageMap=Tt,exports.normalizeLanguageIdentifier=kt,exports.parseNestedMarkdownToNodes=Wt,exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield xt()})},exports.removeCustomComponents=function(e){if(e===N)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete _.scopedCustomComponents[e],j.value++},exports.renderKaTeXInWorker=In,exports.renderKaTeXWithBackpressure=An,exports.renderMarkdownNodeToHtml=function(e,t={}){return It(e,_t(t))},exports.renderMarkdownNodesToHtml=function(e,t={}){return jt(e,_t(t))},exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return jt(e.nodes,t);const n=e.node;if(n){const e=zt(n.children);if(e.length>0)return jt(e,t);const o=Pt(n.content);if(o)return Bt(o,t);if(null!=n.raw)return Ut(Pt(n.raw))}return e.content?Bt(Pt(e.content),t):""}(e,_t(t))},exports.resolveMonacoLanguageId=bt,exports.setCustomComponents=function(e,t){"string"==typeof e?_.scopedCustomComponents[e]=t||{}:_.scopedCustomComponents[N]=e||{},j.value++},exports.setD2Loader=un,exports.setDefaultI18nMap=function(e){Object.assign(fe,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(Bn.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Bn.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Bn.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Bn.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=En,exports.setKaTeXWorker=function(e){xn=e,Mn=null,xn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=bn.get(t);if(r)if(bn.delete(t),clearTimeout(r.timeoutId),Dn(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Cn.set(e,n),Cn.size>200){const e=Cn.keys().next().value;Cn.delete(e)}}r.resolve(n)}},xn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of bn.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));bn.clear(),Dn()}},exports.setKaTeXWorkerDebug=function(e){kn=!!e,xn&&xn.postMessage({type:"init",debug:kn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Tn=Math.floor(e))},exports.setKatexLoader=Te,exports.setLanguageIconResolver=Mt,exports.setMermaidLoader=Hn,exports.setMermaidWorker=function(e){Wn=e,Qn=null;const t=e;Wn.onmessage=e=>{if(Wn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Kn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Wn.onerror=e=>{var n,o;if(Wn===t)if(0!==Kn.size){try{Xn?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[t,n]of Kn.entries())n.reject(new Error(`Worker error: ${e.message}`));Kn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Wn.onmessageerror=e=>{var n,o;if(Wn===t)if(0!==Kn.size){try{Xn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(vo){}for(const[e,t]of Kn.entries())t.reject(new Error("Worker messageerror"));Kn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Xn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Vn=Math.floor(e))},exports.terminateWorker=to,exports.waitForKaTeXWorkerSlot=Sn,Object.keys(p).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>p[e]})});
|
|
1
|
+
"use strict";Object.create;var e,t=Object.defineProperty,n=Object.defineProperties,o=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),r=(Object.getOwnPropertyNames,Object.getOwnPropertySymbols),l=(Object.getPrototypeOf,Object.prototype.hasOwnProperty),i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,u=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,o(t)),d=(e,t,n)=>new Promise((o,r)=>{var l=e=>{try{a(n.next(e))}catch(t){r(t)}},i=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((n=n.apply(e,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("stream-markdown-parser"),m=require("vue-demi"),f=require("@floating-ui/dom");var h="undefined"!=typeof document?document.currentScript:null;function v(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const g=v(m);function y(e,t){if(null==e)return!1;const n=typeof e;return("object"===n||"function"===n)&&t in e}function w(e){return function(e){const t=function(e){const t="string"==typeof e?e:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}(e);return null!=t&&t<7}(function(e){var t,n,o,r,l,i,a,s,u;const c=null==(n=null==(t=null==e?void 0:e.$options)?void 0:t._base)?void 0:n.version;if("string"==typeof c&&c)return c;const d=null==(l=null==(r=null==(o=null==e?void 0:e.$root)?void 0:o.$options)?void 0:r._base)?void 0:l.version;if("string"==typeof d&&d)return d;if(y(e,"$")){const t=null==(s=null==(a=null==(i=e.$)?void 0:i.appContext)?void 0:a.app)?void 0:s.version;if("string"==typeof t&&t)return t}if(y(e,"constructor")){const t=null==(u=e.constructor)?void 0:u.version;if("string"==typeof t&&t)return t}if(y(e,"version")){const t=e.version;if("string"==typeof t&&t)return t}return""}(e))}function x(e){return e.slice(2).replace(/^[A-Z]/,e=>e.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase()}function M(e){if(y(e,"$listeners")){const t=e.$listeners;if(t&&"object"==typeof t)return t}if(!y(e,"$attrs"))return{};const t=e.$attrs;if(!t||"object"!=typeof t)return{};const n={};for(const[o,r]of Object.entries(t))/^on[A-Z]/.test(o)&&("function"==typeof r||Array.isArray(r)&&r.every(e=>"function"==typeof e))&&(n[x(o)]=r);return n}function k(e,t,n,o,r,l,i,a){var s,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=s):r&&(s=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(u.functional){u._injectStyles=s;var c=u.render;u.render=function(e,t){return s.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:u}}const b=k(m.defineComponent({__name:"CheckboxNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"checkbox-node"},[t("input",{staticClass:"checkbox-input",attrs:{type:"checkbox",disabled:""},domProps:{checked:e.node.checked}})])},[],!1,null,"8dc6c46f",null,null).exports,C=k(m.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?rt:it),r=m.computed(()=>t.node.items.flatMap((e,n)=>[{key:`definition-term-${t.indexKey}-${n}`,tag:"dt",className:"definition-term",nodes:e.term},{key:`definition-desc-${t.indexKey}-${n}`,tag:"dd",className:"definition-desc",nodes:e.definition}]));return{__sfc:!0,props:t,instance:n,nestedRenderer:o,definitionEntries:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},e._l(n.definitionEntries,function(o){return t(o.tag,{key:o.key,tag:"component",class:o.className},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":o.key,nodes:o.nodes,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),1)},[],!1,null,"b089ea12",null,null).exports,T=k(m.defineComponent({__name:"EmojiNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"emoji-node"},[e._v(e._s(e.node.name))])},[],!1,null,"de55dc97",null,null).exports,N="__global__",D="__MARKSTREAM_VUE2_CUSTOM_COMPONENTS_STORE__",_=(()=>{const e=globalThis;if(e[D])return e[D];const t={scopedCustomComponents:{},revision:m.shallowRef(0)};return e[D]=t,t})(),j=_.revision;function I(e){const t=_.scopedCustomComponents[N]||{};if(!e)return t;const n=_.scopedCustomComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?u(u({},t),n):t:n}const E=k(m.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#footnote-${t.node.id}`;return{__sfc:!0,props:t,href:n,handleScroll:function(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"footnote-reference",attrs:{id:`fnref-${e.node.id}`},on:{click:n.handleScroll}},[t("span",{staticClass:"footnote-link cursor-pointer",attrs:{href:n.href,title:`查看脚注 ${e.node.id}`}},[e._v("["+e._s(e.node.id)+"]")])])},[],!1,null,"01af0fee",null,null).exports,S=function(){var e,t,n;const o=g,r=e=>"function"==typeof e&&"function"==typeof e.extend,l=[o,null==o?void 0:o.default,null==(e=null==o?void 0:o.default)?void 0:e.default,null==(n=null!=(t=null==o?void 0:o.default)?t:o)?void 0:n.default,null==o?void 0:o.Vue2,null==o?void 0:o.Vue];for(const a of l){const e=r(a)?a:r(null==a?void 0:a.default)?a.default:null;if(e)try{const t=new e;if("function"==typeof t.$createElement)return t.$createElement.bind(t)}catch(i){}}return null}();function L(e,t,n,o){if(e)return e(t,n,o);try{return m.h(t,n,o)}catch(r){}try{return m.h(t,n,o)}catch(r){}return S?S(t,n,o):null}const B=new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),A=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),O=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),z=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,P=new Set(["script"]),R=new Set(["href","src","srcset","xlink:href","formaction"]),H=(()=>{var e;try{return Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV)}catch(t){}return!1})();function $(e){H&&console.warn(e)}function U(e){const t=function(e){let t="";for(const n of e){const e=n.charCodeAt(0);e<=31||127===e||/\s/u.test(n)||(t+=n)}return t}(e).toLowerCase();return!(!t.startsWith("javascript:")&&!t.startsWith("vbscript:"))||!!t.startsWith("data:")&&!(t.startsWith("data:image/")||t.startsWith("data:video/")||t.startsWith("data:audio/"))}function F(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Y(e,t){const n=e.toLowerCase();return!O.has(n)&&(F(t,n)||F(t,e))}function W(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return"true"===e||""===e||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const t=Number(e);if(""!==e&&!Number.isNaN(t))return t}return e}function Q(e){return e.trim().length>0}function K(e,t,n,o,a){if(P.has(e.toLowerCase()))return null;const s=function(e){const t={};for(const[n,o]of Object.entries(e)){const e=n.toLowerCase();B.has(e)||R.has(e)&&o&&U(o)||(t[n]=o)}return t}(t);if(Y(e,o)){const t=o[e]||o[e.toLowerCase()],r=function(e){const t={};for(const[n,o]of Object.entries(e))t[n]=W(o,n);return t}(s);return L(a,t,r,n.length>0?n:void 0)}{const t=s,{innerHTML:o}=t;return L(a,e,((e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&i.call(e,o)&&(n[o]=e[o]);return n})(t,["innerHTML"]),n.length>0?n:void 0)}}function V(e,t){if(!e||!e.includes("<"))return!1;if(!t||0===Object.keys(t).length)return!1;let n;for(z.lastIndex=0;null!==(n=z.exec(e));)if(Y(n[1],t))return!0;return!1}function X(e,t,n){if(!e)return[];try{const o=function(e,t,n){const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=K(l.tagName,l.attrs||{},[],t,n),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let i=-1;for(let t=o.length-1;t>=0;t--)if(o[t].tagName.toLowerCase()===e){i=t;break}if(-1!==i)for(;o.length>i;){const l=o.pop(),a=K(l.tagName,l.attrs||{},l.children,t,n);o.length>0?null!=a&&o[o.length-1].children.push(a):null!=a&&r.push(a),l.tagName.toLowerCase()!==e&&o.length>i&&$(`Auto-closing unclosed tag: <${l.tagName}>`)}else $(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),l=K(e.tagName,e.attrs||{},e.children,t,n);null!=l&&r.push(l),$(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var t,n,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const t=e.indexOf("--\x3e",l);if(-1!==t){l=t+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const t=e.slice(l);Q(t)&&r.push({type:"text",content:t})}break}if(i>l){const t=e.slice(l,i);Q(t)&&r.push({type:"text",content:t})}if(e.startsWith("![CDATA[",i+1)){const t=e.indexOf("]]>",i);if(-1!==t){r.push({type:"text",content:e.slice(i,t+3)}),l=t+3;continue}break}if(e.startsWith("!",i+1)){const t=e.indexOf(">",i);if(-1!==t){l=t+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),u=s.startsWith("/"),c=s.endsWith("/");if(u){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=c?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(n=null!=(t=r[2])?t:r[3])?n:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:c||A.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),t,n);return o}catch(r){return o=r,H&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const q=k(m.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null},setup(e){const t=e,n=m.computed(()=>I(t.customId)),o=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0}},render(){return X(this.content,this.customComponents)||[]}}),r=m.computed(()=>{const e=t.node.content;return e?V(e,n.value)?{mode:"dynamic",content:e}:{mode:"html",content:e}:{mode:"html",content:""}}),l=m.ref(null),i="undefined"!=typeof window,a=m.ref({mode:"",content:"",el:null});let s=null;function u(){return!s&&i&&(s=document.createElement("template")),s}function c(e,t){if(!i||!l.value)return;const n=l.value,o=a.value;if(o.el!==n||o.mode!==e||o.content!==t){if("text"===e)n.textContent=t;else{const e=u();if(e){e.innerHTML=t;const o=e.content.cloneNode(!0);"function"==typeof n.replaceChildren?n.replaceChildren(o):(n.innerHTML="",n.appendChild(o))}else n.innerHTML=t}a.value={mode:e,content:t,el:n}}}function d(){c("html",t.node.content)}function p(){c("text",t.node.content)}return m.onMounted(()=>{"html"===r.value.mode&&(t.node.loading&&!t.node.autoClosed?p():d())}),m.watch(()=>[t.node.content,t.node.loading,t.node.autoClosed],()=>{"html"===r.value.mode&&(t.node.loading&&!t.node.autoClosed?p():d())}),m.onBeforeUnmount(()=>{l.value&&(l.value.innerHTML="",a.value={mode:"",content:"",el:null})}),{__sfc:!0,props:t,customComponents:n,DynamicRenderer:o,renderMode:r,containerRef:l,isClient:i,lastDomRender:a,templateEl:s,getTemplateEl:u,commitDomRender:c,renderHtmlContent:d,renderLoadingContent:p}}}),function(){var e=this._self._c,t=this._self._setupProxy;return"dynamic"===t.renderMode.mode?e("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":t.props.node.loading}},[e(t.DynamicRenderer,{attrs:{content:t.renderMode.content,"custom-components":t.customComponents}})],1):e("span",{ref:"containerRef",staticClass:"html-inline-node",class:{"html-inline-node--loading":t.props.node.loading}})},[],!1,null,"7aa2ed27",null,null).exports,Z=k(m.defineComponent({__name:"InlineCodeNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},[e._v(e._s(e.node.code))])},[],!1,null,null,null,null).exports,G=m.ref(!1),J=m.ref(""),ee=m.ref("top"),te=m.ref(null),ne=m.ref(null),oe=m.ref(null),re=m.ref(null),le=m.ref(null);let ie=null,ae=null;function se(){ie&&(clearTimeout(ie),ie=null),ae&&(clearTimeout(ae),ae=null)}let ue=!1,ce=null;function de(){return ue||"undefined"==typeof document?Promise.resolve():ce||(ce=Promise.resolve().then(()=>so).then(e=>{var t;ue=!0;const n=null!=(t=null==e?void 0:e.default)?t:e,o=document.createElement("div");o.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(o);const r=function(){var e,t,n,o;const r=g,l=e=>"function"==typeof e&&"function"==typeof e.extend,i=[r,null==r?void 0:r.default,null==(e=null==r?void 0:r.default)?void 0:e.default,null==(n=null!=(t=null==r?void 0:r.default)?t:r)?void 0:n.default,null==r?void 0:r.Vue2,null==r?void 0:r.Vue];for(const a of i){if(l(a))return a;if(l(null==a?void 0:a.default))return a.default}return null!=(o=null==r?void 0:r.default)?o:r}();(new(r.extend({render(e){var t;return e(n,{props:{visible:G.value,anchorEl:te.value,content:J.value,placement:ee.value,id:ne.value,originX:oe.value,originY:re.value,isDark:null!=(t=le.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{ce=null,ue=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),ce)}function pe(e,t,n="top",o=!1,r,l){if(!e)return;de(),se();const i=()=>{var o,i;ne.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,te.value=e,J.value=t,ee.value=n,oe.value=null!=(o=null==r?void 0:r.x)?o:null,re.value=null!=(i=null==r?void 0:r.y)?i:null,le.value="boolean"==typeof l?l:null,G.value=!0;try{e.setAttribute("aria-describedby",ne.value)}catch(a){}};o?i():ie=setTimeout(i,80)}function me(e=!1){se();const t=()=>{if(te.value&&ne.value)try{te.value.removeAttribute("aria-describedby")}catch(e){}G.value=!1,te.value=null,ne.value=null,oe.value=null,re.value=null};e?t():ae=setTimeout(t,120)}const fe={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function he(){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{t:e=>{var t;return null!=(t=fe[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 ve=Symbol("ViewportPriority");function ge(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?m.ref(t):t;let r=null,l=null;const i=new Map;const a=(t,a)=>{const s=m.ref(!1);let u,c=!1;const d=new Promise(e=>{u=()=>{c||(c=!0,e())}}),p=()=>{try{null==r||r.unobserve(t)}catch(e){}if(i.delete(t),!i.size){try{null==r||r.disconnect()}catch(e){}r=null,l=null}};if(!n||!o.value)return s.value=!0,u(),{isVisible:s,whenVisible:d,destroy:p};const f=function(t,o){if(!n)return r;if("undefined"==typeof IntersectionObserver)return null;const a=function(t,n){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,rootMargin:null!=(r=null==n?void 0:n.rootMargin)?r:"300px",threshold:null!=(l=null==n?void 0:n.threshold)?l:0}}(t,o);if(r&&(u=a,(s=l)&&s.root===u.root&&s.rootMargin===u.rootMargin&&s.threshold===u.threshold))return r;var s,u;if(r)try{r.disconnect()}catch(c){}r=new IntersectionObserver(e=>{for(const t of e){const e=i.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(c){}}null==r||r.unobserve(t.target),i.delete(t.target)}}},{root:a.root,rootMargin:a.rootMargin,threshold:a.threshold}),l=a;for(const e of i.keys())r.observe(e);return r}(t,a);return f?(i.set(t,{resolve:u,visible:s}),f.observe(t),{isVisible:s,whenVisible:d,destroy:p}):(s.value=!0,u(),{isVisible:s,whenVisible:d,destroy:p})};return m.provide(ve,a),a}function ye(){const e=m.inject(ve,void 0);if(e)return e;const t=new WeakMap;let n=null;return e=>{const o=m.ref(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!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 r of e){const e=t.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(r.target),t.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const we=k(m.defineComponent({__name:"ImageNode",props:{node:null,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=m.ref(!1),r=m.ref(!1),l=m.ref(!1),i=m.ref(null),a=ye();let s=null;const u=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>i.value,e=>{if(null==s||s.destroy(),s=null,!e)return void(u.value=!1);const t=a(e,{rootMargin:"400px"});s=t,u.value=t.isVisible.value,t.whenVisible.then(()=>{u.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==s||s.destroy(),s=null});const c=m.computed(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),d=m.computed(()=>!n.lazy||u.value),p=m.computed(()=>/\.svg(?:\?|$)/i.test(c.value)),{t:f}=he();return m.watch(c,()=>{o.value=!1,r.value=!1}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,fallbackTried:l,figureRef:i,registerVisibility:a,visibilityHandle:s,isVisible:u,displaySrc:c,canRenderImage:d,isSvg:p,handleImageError:function(){n.fallbackSrc&&!l.value?(l.value=!0,r.value=!0):(r.value=!0,t("error",n.node.src))},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",c.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,c.value])},t:f}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("figure",{ref:"figureRef",staticClass:"text-center my-8"},[i("div",{staticClass:"relative inline-block"},[i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[l.node.loading||a.hasError||!a.canRenderImage?a.hasError?l.node.loading||a.props.fallbackSrc?l._e():i("div",{key:"error",staticClass:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},[l._t("error",function(){return[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"}},[i("path",{attrs:{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"}})]),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loadError")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy,isSvg:a.isSvg})],2):i("div",{key:"placeholder",staticClass:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:a.isSvg?{minHeight:a.props.svgMinHeight,width:"100%"}:{minHeight:"6rem"}},[a.props.usePlaceholder?[l._t("placeholder",function(){return[i("div",{staticClass:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin",attrs:{"aria-hidden":"true"}}),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loading")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy,isSvg:a.isSvg})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):i("img",{key:"image",staticClass:"max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},style:a.isSvg?{minHeight:a.props.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0,attrs:{src:a.displaySrc,alt:String(null!=(t=null!=(e=a.props.node.alt)?e:a.props.node.title)?t:""),title:String(null!=(o=null!=(n=a.props.node.title)?n:a.props.node.alt)?o:""),loading:a.props.lazy?"lazy":"eager",decoding:"async",tabindex:a.imageLoaded?0:-1,"aria-label":null!=(r=a.props.node.alt)?r:a.t("image.preview")},on:{error:a.handleImageError,load:a.handleImageLoad,click:a.handleClick}})])],1),a.props.showCaption&&a.props.node.alt?i("figcaption",{staticClass:"mt-2 text-sm text-gray-500 italic"},[l._v(" "+l._s(a.props.node.alt)+" ")]):l._e()])},[],!1,null,"2b49bba9",null,null).exports;let xe=null,Me=!1,ke=Te;function be(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function Ce(){try{const e=globalThis;return be(null==e?void 0:e.katex)}catch(e){return null}}function Te(){return(()=>d(this,null,function*(){const e=Ce();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./mhchem.js"))}catch(n){}return be(t)}))()}function Ne(e){ke=e,xe=null,Me=!1}function De(){return"function"==typeof ke}function _e(){return d(this,null,function*(){var e;const t=Ce();if(t)return xe=t,xe;if(xe)return xe;if(Me)return null;const n=ke;if(!n)return Me=!0,null;try{const t=yield n();if(t)return xe=null!=(e=be(t))?e:t,xe}catch(o){}return Me=!0,null})}const je=m.shallowRef(!1);let Ie=null;function Ee(){return Ie||(Ie=_e().then(e=>{je.value=!!e}).catch(()=>{je.value=!1})),m.readonly(je)}const Se=k(m.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup:e=>({__sfc:!0,katexReady:Ee()})}),function(){var e=this;return(0,e._self._c)("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[e._self._setupProxy.katexReady&&e.node.center?"text-node-center":""]},[e._v(" "+e._s(e.node.content)+" ")])},[],!1,null,"56f30838",null,null).exports;function Le(e){return t=>{var n,o;return m.h(Se,c(u({},t),{node:c(u({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function Be(){return d(this,null,function*(){var e,t,n;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 Le(e=>`$${e}$`);try{if(yield _e()){const e=yield Promise.resolve().then(()=>require("./index.js"));return null!=(n=e.default)?n:e}}catch(o){console.warn('[markstream-vue2] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',o)}return Le(e=>`$${e}$`)})}function Ae(){return d(this,null,function*(){var e;try{if(yield _e()){const t=yield Promise.resolve().then(()=>require("./index2.js"));return null!=(e=t.default)?e:t}}catch(t){console.warn('[markstream-vue2] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return Le(e=>`$$${e}$$`)})}const Oe=k(m.defineComponent({__name:"ReferenceNode",props:{node:null,messageId:null,threadId:null},emits:["click","mouseEnter","mouseLeave"],setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",attrs:{role:"button",tabindex:"0"},on:{click:function(t){return e.$emit("click",t,e.node.id,e.messageId,e.threadId)},mouseenter:function(t){return e.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)},mouseleave:function(t){return e.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId)}}},[e._v(" "+e._s(e.node.id)+" ")])},[],!1,null,null,null,null).exports,ze=k(m.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,strong:Re,emphasis:Ye,footnote_reference:E,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,emoji:T,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"superscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"superscript"}-${r}`,staticClass:"superscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"ef2512b4",null,null).exports,Pe=k(m.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,strong:Re,emphasis:Ye,footnote_reference:E,strikethrough:He,highlight:Fe,insert:Ue,superscript:ze,emoji:T,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sub",{staticClass:"subscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"subscript"}-${r}`,staticClass:"subscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"3d49d031",null,null).exports,Re=k(m.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,emoji:T,footnote_reference:E,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("strong",{staticClass:"strong-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strong"}-${r}`,tag:"component",attrs:{"index-key":`${e.indexKey||"strong"}-${r}`,node:o,"custom-id":n.props.customId}})}),1)},[],!1,null,"af3ce037",null,null).exports,He=k(m.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,strong:Re,emphasis:Ye,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,emoji:T,footnote_reference:E,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("del",{staticClass:"strikethrough-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strikethrough"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`}})}),1)},[],!1,null,"904d5bd1",null,null).exports,$e=k(m.defineComponent({__name:"LinkNode",props:{node:null,indexKey:null,customId:null,showTooltip:{type:Boolean,default:!0},color:null,underlineHeight:null,underlineBottom:null,animationDuration:null,animationOpacity:null,animationTiming:null,animationIteration:null},setup(e){const t=e,n={x:0,y:0,hasValue:!1};let o=0,r=null;function l(){if(r||"undefined"==typeof window)return;const e=e=>{"number"==typeof e.clientX&&"number"==typeof e.clientY&&(n.x=e.clientX,n.y=e.clientY,n.hasValue=!0)};window.addEventListener("pointermove",e,!0),window.addEventListener("mousemove",e,!0),r=()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("mousemove",e,!0)}}function i(){l(),o+=1}function a(){o=Math.max(0,o-1),!o&&r&&(r(),r=null)}const s=m.computed(()=>{var e,n,o,r,l,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!=(r=t.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),c={text:Se,strong:Re,strikethrough:He,emphasis:Ye,image:we,html_inline:q},d=m.useAttrs(),p=m.ref(null),f=m.ref(!1),h=m.computed(()=>{const e=u({},d);return delete e.title,e});function v(){var e,n,o;return(null==(e=t.node)?void 0:e.title)||(null==(n=t.node)?void 0:n.href)||(null==(o=t.node)?void 0:o.text)||""}function g(e){if(!e||!n.hasValue)return!1;const t=e.getBoundingClientRect();return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function y(){t.showTooltip&&p.value&&g(p.value)&&(f.value=!0,pe(p.value,v(),"top",!0,{x:n.x,y:n.y}))}const w=m.computed(()=>{var e,n,o;const r=null==(e=t.node)?void 0:e.title;return"string"==typeof r&&r.trim().length>0?r:String(null!=(o=null==(n=t.node)?void 0:n.href)?o:"")});return m.onMounted(()=>{i(),t.showTooltip&&de(),m.nextTick(()=>{y()})}),m.onUpdated(()=>{y()}),m.onBeforeUnmount(()=>{a(),f.value&&(f.value=!1,me(!0))}),{__sfc:!0,props:t,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,cssVars:s,nodeComponents:c,attrs:d,anchorEl:p,isHovering:f,anchorAttrs:h,getTooltipText:v,isPointerInsideAnchor:g,syncTooltipForHoveredAnchor:y,onAnchorEnter:function(e){if(!t.showTooltip)return;f.value=!0;const 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;pe(p.value||e.currentTarget,v(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(f.value=!1,me())},title:w}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return e.node.loading?t("span",e._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:n.cssVars,attrs:{"aria-hidden":e.node.loading?"false":"true"}},"span",n.attrs,!1),[t("span",{staticClass:"link-text-wrapper relative inline-flex"},[t("span",{staticClass:"leading-[normal] link-text"},[t("span",{staticClass:"leading-[normal] link-text"},[e._v(e._s(e.node.text))])]),t("span",{staticClass:"underline-anim",attrs:{"aria-hidden":"true"}})])]):t("a",e._b({ref:"anchorEl",staticClass:"link-node",style:n.cssVars,attrs:{href:e.node.href,title:e.showTooltip?"":n.title,"aria-label":`Link: ${n.title}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},on:{mouseenter:e=>n.onAnchorEnter(e),mouseleave:n.onAnchorLeave}},"a",n.anchorAttrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"link-text"}-${r}`}})}),1)},[],!1,null,"899c00e4",null,null).exports,Ue=k(m.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,strong:Re,emphasis:Ye,strikethrough:He,highlight:Fe,subscript:Pe,superscript:ze,emoji:T,footnote_reference:E,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("ins",{staticClass:"insert-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"insert"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"insert"}-${r}`}})}),1)},[],!1,null,"ab1ec9bc",null,null).exports,Fe=k(m.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,strong:Re,emphasis:Ye,strikethrough:He,insert:Ue,subscript:Pe,superscript:ze,emoji:T,footnote_reference:E,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("mark",{staticClass:"highlight-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"highlight"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"highlight"}-${r}`}})}),1)},[],!1,null,"38e31bf6",null,null).exports,Ye=k(m.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,html_inline:q,strong:Re,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,emoji:T,footnote_reference:E,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("em",{staticClass:"emphasis-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`}})}),1)},[],!1,null,"8264674d",null,null).exports,We=k(m.defineComponent({__name:"FootnoteAnchorNode",props:{node:null},setup(e){const t=e;return{__sfc:!0,props:t,scrollToReference:function(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("a",{staticClass:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4756ce0d",null,null).exports,Qe=k(m.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?rt:it);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`footnote-${n.props.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)])},[],!1,null,null,null,null).exports,Ke=k(m.defineComponent({__name:"HardBreakNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("br",{staticClass:"hard-break"})},[],!1,null,"50c58f70",null,null).exports,Ve=k(m.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Se,inline_code:Z,link:$e,image:we,strong:Re,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:E,hardbreak:Ke,math_inline:Be,reference:Oe},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,e._b({tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},"component",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"heading"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"heading"}-${r}`}})}),1)},[],!1,null,"ffb7cf51",null,null).exports,Xe=k(m.defineComponent({__name:"ListItemNode",props:{node:null,item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=m.computed(()=>null==t.value?{}:{value:t.value}),r=m.getCurrentInstance(),l=m.computed(()=>w(null==r?void 0:r.proxy)?rt:it);return{__sfc:!0,props:t,itemNode:n,liValueAttr:o,instance:r,nestedRenderer:l}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return o("li",n._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",r.liValueAttr,!1),[o(r.nestedRenderer,n._b({tag:"component",attrs:{"index-key":`list-item-${r.props.indexKey}`,nodes:null!=(t=null==(e=r.itemNode)?void 0:e.children)?t:[],"custom-id":r.props.customId,typewriter:r.props.typewriter,"batch-rendering":!1},on:{copy:function(e){return n.$emit("copy",e)}}},"component",{showTooltips:r.props.showTooltips},!1))],1)},[],!1,null,"5c58ad56",null,null).exports,qe=k(m.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const{node:t,customId:n,indexKey:o,typewriter:r,showTooltips:l}=e;return{__sfc:!0,listItemComponent:m.computed(()=>(j.value,I(n).list_item||Xe))}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(e.node.ordered?"ol":"ul",{tag:"component",staticClass:"list-node",class:{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}},e._l(e.node.items,function(o,r){var l;return t(n.listItemComponent,e._b({key:`${e.indexKey||"list"}-${r}`,tag:"component",attrs:{node:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(l=e.node.start)?l:1)+r:void 0},on:{copy:function(t){return e.$emit("copy",t)}}},"component",{showTooltips:e.showTooltips},!1))}),1)},[],!1,null,"91e6dafc",null,null).exports,Ze=k(m.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null},setup(e){const t=e,n=m.computed(()=>{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=m.computed(()=>I(t.customId)),r=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0}},render(){return X(this.content,this.customComponents)||[]}}),l=m.computed(()=>{const e=t.node.content;return e?V(e,o.value)?{mode:"dynamic",content:e}:{mode:"html",content:e}:{mode:"html",content:""}}),i=m.ref(null),a=m.ref("undefined"==typeof window),s=m.ref(t.node.content),u=ye();let c=null;const d=!!t.node.loading;return"undefined"!=typeof window?(m.watch(i,e=>{var n;if(null==(n=null==c?void 0:c.destroy)||n.call(c),c=null,!d)return a.value=!0,void(s.value=t.node.content);if(!e)return void(a.value=!1);const o=u(e,{rootMargin:"400px"});c=o,a.value=o.isVisible.value,o.whenVisible.then(()=>{a.value=!0})},{immediate:!0}),m.watch(()=>t.node.content,e=>{d&&!a.value||(s.value=e)})):a.value=!0,m.onBeforeUnmount(()=>{var e;null==(e=null==c?void 0:c.destroy)||e.call(c),c=null}),{__sfc:!0,props:t,boundAttrs:n,customComponents:o,DynamicRenderer:r,renderMode:l,htmlRef:i,shouldRender:a,renderContent:s,registerVisibility:u,visibilityHandle:c,isDeferred:d}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({ref:"htmlRef",staticClass:"html-block-node"},"div",n.boundAttrs,!1),[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents}}):t("div",{domProps:{innerHTML:e._s(n.renderContent)}})]:t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)],2)},[],!1,null,"53b53d7c",null,null).exports,Ge=k(m.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=I(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({inline_code:Z,image:we,link:$e,hardbreak:Ke,emphasis:Ye,strong:Re,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,html_inline:q,html_block:Ze,emoji:T,checkbox:b,math_inline:Be,checkbox_input:b,reference:Oe,footnote_anchor:We,footnote_reference:E},n),katexReady:Ee()}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},e._l(e.node.children,function(o,r){var l;return t("span",{key:`${e.indexKey||"paragraph"}-${r}`,staticClass:"paragraph-child"},["text"!==o.type&&n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"index-key":`${null!=(l=e.indexKey)?l:"paragraph"}-${r}`,"custom-id":n.props.customId}}):t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&o.center?"text-node-center":""]},[e._v(" "+e._s(o.content||o.raw||"")+" ")])],1)}),0)},[],!1,null,"3b03e3af",null,null).exports,Je=k(m.defineComponent({__name:"PreCodeNode",props:{node:null},setup(e){const t=e,n=m.computed(()=>{var e,n,o;const r=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=m.computed(()=>`language-${n.value}`),r=m.computed(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return{__sfc:!0,props:t,normalizedLanguage:n,languageClass:o,ariaLabel:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("pre",{class:[n.languageClass],attrs:{"aria-busy":!0===e.node.loading,"aria-label":n.ariaLabel,"data-language":n.normalizedLanguage,tabindex:"0"}},[t("code",{attrs:{translate:"no"},domProps:{textContent:e._s(e.node.code)}})])},[],!1,null,null,null,null).exports,et=k(m.defineComponent({__name:"TableNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node.loading)&&e}),o=m.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=m.getCurrentInstance(),l=m.computed(()=>w(null==r?void 0:r.proxy)?rt:it);return{__sfc:!0,props:t,isLoading:n,bodyRows:o,instance:r,nestedRenderer:l}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[t("thead",{staticClass:"border-[var(--table-border,#cbd5e1)] border-solid"},[t("tr",{staticClass:"border-b border-solid"},e._l(e.node.header.cells,function(o,r){return t("th",{key:`header-${r}`,staticClass:"font-semibold p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-th-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)]),t("tbody",e._l(n.bodyRows,function(o,r){return t("tr",{key:`row-${r}`,staticClass:"border-[var(--table-border,#cbd5e1)] border-solid",class:[r<n.bodyRows.length-1?"border-b":""]},e._l(o.cells,function(o,l){return t("td",{key:`cell-${r}-${l}`,staticClass:"p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-td-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)}),0)]),t("transition",{attrs:{name:"table-node-fade"}},[n.isLoading?t("div",{staticClass:"table-node__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"table-node__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.isLoading})],2):e._e()])],1)},[],!1,null,"60ab705d",null,null).exports,tt=k(m.defineComponent({__name:"ThematicBreakNode",setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("hr",{staticClass:"hr-node"})},[],!1,null,"639cbad9",null,null).exports,nt=k(m.defineComponent({__name:"FallbackComponent",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"unknown-node"},[e._v(" "+e._s(e.node.raw)+" ")])},[],!1,null,"89aff01f",null,null).exports,ot=k(m.defineComponent({__name:"VmrContainerNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.computed(()=>`vmr-container vmr-container-${t.node.name}`),o=I(t.customId),r=u({text:Se,paragraph:Ge,heading:Ve,inline_code:Z,link:$e,image:we,strong:Re,emphasis:Ye,strikethrough:He,insert:Ue,subscript:Pe,superscript:ze,checkbox:b,checkbox_input:b,hardbreak:Ke,math_inline:Be,reference:Oe,list:qe,math_block:Ae,table:et},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||nt}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({class:n.containerClass},"div",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.getNodeComponent(o.type),{key:`${e.indexKey||"vmr-container"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"vmr-container"}-${r}`}})}),1)},[],!1,null,"3cd2aff2",null,null).exports,rt=k(m.defineComponent({__name:"LegacyNodesRenderer",props:{nodes:null,customId:null,indexKey:null,typewriter:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,renderCodeBlocksAsPre:{type:Boolean},themes:null,isDark:{type:Boolean}},emits:["copy","handleArtifactClick"],setup(e,{emit:t}){const n=e,o={text:Se,paragraph:Ge,heading:Ve,code_block:Je,list:qe,list_item:Xe,blockquote:lt,table:et,definition_list:C,footnote:Qe,footnote_reference:E,footnote_anchor:We,admonition:at,vmr_container:ot,hardbreak:Ke,link:$e,image:we,thematic_break:tt,math_inline:Be,math_block:Ae,strong:Re,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,emoji:T,checkbox:b,checkbox_input:b,inline_code:Z,html_inline:q,html_block:Ze,reference:Oe},r=m.computed(()=>(j.value,I(n.customId))),l=m.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),i=m.computed(()=>u({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,monacoOptions:n.codeBlockMonacoOptions,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},n.codeBlockProps||{})),a=m.computed(()=>({typewriter:n.typewriter})),s=m.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),c=m.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),d=m.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{const n=e,o=p(n),r=String((null==n?void 0:n.type)||"unknown");return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===r?`${l.value}-${t}-${r}`:`${l.value}-${t}-${r}-${String((null==n?void 0:n.raw)||"").length}`,node:n,isCodeBlock:"code_block"===(null==n?void 0:n.type),component:f(n,o),bindings:h(n,o)}}));function p(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function f(e,t){if(!e)return nt;const l=r.value,i=l[String(e.type)];if("code_block"===e.type){const o=null!=t?t:p(e);return"mermaid"===o?l.mermaid||Je:"infographic"===o?l.infographic||Je:"d2"===o||"d2lang"===o?l.d2||Je:i||(l.code_block||(n.renderCodeBlocksAsPre,Je))}return i||o[String(e.type)]||nt}function h(e,t){const n=null!=t?t:p(e);return"mermaid"===n||"infographic"===n||"d2"===n||"d2lang"===n?{}:"link"===e.type?s.value:"list"===e.type?c.value:"code_block"===e.type?i.value:a.value}return{__sfc:!0,props:n,emit:t,nodeComponents:o,customComponentsMap:r,indexPrefix:l,codeBlockBindings:i,nonCodeBindings:a,linkBindings:s,listBindings:c,renderedItems:d,getCodeBlockLanguage:p,getNodeComponent:f,getBindingsFor:h,handleClick:function(e){t("handleArtifactClick",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"markstream-vue2 markdown-renderer legacy-nodes-renderer",class:{dark:n.props.isDark},on:{click:n.handleClick}},e._l(n.renderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)])}),0)},[],!1,null,null,null,null).exports,lt=k(m.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?rt:it);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("blockquote",{staticClass:"blockquote",attrs:{dir:"auto",cite:e.node.cite}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`blockquote-${n.props.indexKey}`,nodes:n.props.node.children||[],"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)},[],!1,null,"0bfb818f",null,null).exports,it=k(m.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,mermaidProps:null,d2Props:null,infographicProps:null,showTooltips:{type:Boolean,default:!0},themes:null,isDark:{type:Boolean},customId:null,indexKey:null,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,r;const l=e,i=m.ref(),a=m.ref(!1),s=/auto|scroll|overlay/i,f="undefined"!=typeof window,v=m.getCurrentInstance(),g=m.computed(()=>l.debugPerformance&&f&&"undefined"!=typeof console);function y(e,t){g.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function x(e){if("undefined"==typeof window)return null;const t=null!=e?e:i.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let r=t;for(;r&&r!==n.body&&r!==o;){const e=window.getComputedStyle(r),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(s.test(t)||s.test(n))return r;r=r.parentElement}return null}const M=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,k=p.getMarkdown(M),N=new Map,D=m.markRaw([]),_=m.computed(()=>{const{key:e,tags:t}=B(l.customHtmlTags);if(!e)return k;const n=N.get(e);if(n)return n;const o=p.getMarkdown(M,{customHtmlTags:t});return N.set(e,o),o}),S=m.computed(()=>{const e=_.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function L(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():""}function B(e){if(!e||0===e.length)return{key:"",tags:[]};const t=new Set,n=[];for(const o of e){const e=L(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return 0===n.length?{key:"",tags:[]}:{key:n.join(","),tags:n}}function A(e){if(Array.isArray(e))return Object.freeze(e.map(e=>A(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=A(o);return Object.freeze(t)}function O(e){return e.map(e=>A(e))}const z=m.computed(()=>{var e,t,n,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(t=l.final)?t:r.final,a=[...null!=(n=l.customHtmlTags)?n:[],...null!=(o=r.customHtmlTags)?o:[]].map(L).filter(Boolean),s=null!=i,c=a.length>0;return s||c?u(u(u({},r),s?{final:i}:{}),c?{customHtmlTags:Array.from(new Set(a))}:{}):r}),P=m.computed(()=>{var e;if(w(null==v?void 0:v.proxy)&&!l.content&&Array.isArray(l.nodes))return D;if(null==(e=l.nodes)?void 0:e.length)return m.markRaw(O(l.nodes));if(l.content){const e=g.value?performance.now():0,t=p.parseMarkdownToStructure(l.content,S.value,z.value);return g.value&&y("parse(sync)",{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:l.content.length}),m.markRaw(O(t))}return[]}),R=m.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),H=m.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&P.value.length>R.value}),$=m.computed(()=>!1!==l.viewportPriority&&!a.value),U=ge(e=>{var t;return x(null!=(t=null!=e?e:i.value)?t:null)},$),F=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,Y=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,W="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),Q=f&&"function"==typeof window.requestIdleCallback,K=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),V=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:K.value);return Number.isFinite(t)?Math.max(0,t):K.value}),X=m.computed(()=>!1!==l.batchRendering&&K.value>0&&f&&!W),G=m.ref(0),J=m.ref({key:l.indexKey,total:0}),ee=m.ref(Math.max(1,K.value||1)),te=m.reactive({}),ne=new Map,oe=new Map,re=new Map,le=new WeakMap,ie=m.ref(0),ae=m.computed(()=>(ie.value,Array.from(re.entries()).sort((e,t)=>e[0]-t[0]))),se=m.ref(null);let ue=null,ce=null;const de=m.reactive({start:0,end:0}),pe=m.computed(()=>{if(!H.value)return P.value.map((e,t)=>({node:e,index:t}));const e=P.value.length,t=dt(de.start,0,e),n=dt(de.end,t,e);return P.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),me=m.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!H.value&&!(P.value.length>900)&&$.value}),fe=m.computed(()=>{var e;return X.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),he=m.ref({batchSize:K.value,initial:V.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:fe.value}),ve=m.computed(()=>!!U&&(me.value||H.value)),ye=m.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),xe=m.ref(0),Me=new Map,ke=m.computed(()=>w(null==v?void 0:v.proxy)),be=m.computed(()=>ke.value&&!l.content&&Array.isArray(l.nodes)),Ce=m.computed(()=>be.value?m.markRaw(O(l.nodes||[])):D);function Te(){var e,t;const n=null==v?void 0:v.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of pe.value){const n=Ne(o[`node-slot-${l.index}`]),i=Ne(o[`node-content-${l.index}`]);(null!=(e=re.get(l.index))?e:null)!==n&&Bt(l.index,n),(null!=(t=Me.get(l.index))?t:null)!==i&&Ot(l.index,i),r.add(l.index)}for(const l of Array.from(re.keys()))r.has(l)||Bt(l,null);for(const l of Array.from(Me.keys()))r.has(l)||Ot(l,null)}function Ne(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const De=m.computed(()=>{if(!H.value)return P.value.length;const e=ye.value,t=Math.max(de.end+e,V.value),n=Math.min(P.value.length,t);return Math.max(G.value,n)});function _e(e){var t,n,o,r;const l=x(null!=(t=null!=e?e:i.value)?t:null);if(l)return l;const a=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(n=i.value)?void 0:n.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==a?void 0:a.scrollingElement)||(null==a?void 0:a.documentElement)||null}function je(e){if(!f)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function Ie(e,t,n){var o,r,l,i,a,s;if(n)return null!=(i=null!=(l=null==(o=null==t?void 0:t.documentElement)?void 0:o.scrollTop)?l:null==(r=null==t?void 0:t.body)?void 0:r.scrollTop)?i:0;const u=e.scrollTop;if(!je(e))return u;const c=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-c}function Ee(e,t){let n=e,o=0,r=0;for(;n&&n!==t&&r++<64;)o+=n.offsetTop||0,n=n.offsetParent;return o}function Le(){ue&&(ue(),ue=null),se.value=null}function it(){if(!f||!H.value)return;const e=_e();if(!e||se.value===e)return;Le();const t=()=>ut();e.addEventListener("scroll",t,{passive:!0}),se.value=e,ue=()=>{e.removeEventListener("scroll",t)}}function st(){var e,t,n;if(!ce)return;const o=null!=(n=null==(t=null==(e=i.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==Y||Y(ce.id),ce=null}function ut(e={}){var t,n,o;if(!H.value)return;if(!f)return void ct(!0);if(e.immediate)return st(),void ct(!0);if(ce)return;const r=()=>{ce=null,ct()};if(F)ce={id:F(r),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=i.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);ce={id:l,viaTimeout:!0}}}function ct(e=!1){var t,n,o,r,l,a,s;if(!H.value)return;const u=se.value||_e();if(!u)return;const c=u.ownerDocument||(null==(t=i.value)?void 0:t.ownerDocument)||document,d=(null==c?void 0:c.defaultView)||("undefined"!=typeof window?window:null),p=u===(null==c?void 0:c.documentElement)||u===(null==c?void 0:c.body),m=P.value.length;if(!p&&m>0&&je(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=dt(It(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,m-1));return void((e||Math.abs(r-xe.value)>1)&&(xe.value=r))}const f=p?null:u.getBoundingClientRect(),h=p?0:f.top,v=p?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=ae.value;let y=null,w=null;for(const[i,M]of g){if(!M)continue;const e=M.getBoundingClientRect();e.bottom<=h||e.top>=v||(null==y&&(y=i),w=i)}if(null==y||null==w){const e=i.value;if(!e)return;const t=p?{top:0}:u.getBoundingClientRect(),n=Ie(u,c,p),o=p?(()=>{const n=e.getBoundingClientRect(),o=(p?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=Ee(e,u);return Math.max(0,n-t)})(),m=p?null!=(s=null!=(a=null!=(l=null==d?void 0:d.innerHeight)?l:null==(r=null==c?void 0:c.documentElement)?void 0:r.clientHeight)?a:u.clientHeight)?s:0:u.clientHeight,f=jt(o+.5*Math.max(0,m));return void(xe.value=dt(f,0,Math.max(0,P.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-xe.value)<=1||(xe.value=dt(x,0,Math.max(0,P.value.length-1)))}function dt(e,t,n){return Math.min(Math.max(e,t),n)}function pt(){const e=P.value.length;if(!H.value||0===e)return de.start=0,void(de.end=e);const t=Math.min(R.value,e),n=ye.value,o=dt(xe.value-n,0,Math.max(0,e-t));de.start=o,de.end=Math.min(e,o+t)}const mt=m.reactive({}),ft=m.reactive({total:0,count:0}),ht=m.ref(0),vt=m.ref([]),gt=m.ref([]);function yt(){for(const e of Object.keys(mt))delete mt[Number(e)];ft.total=0,ft.count=0,ht.value=0,vt.value=[],gt.value=[]}function wt(e){if(e<=0)return void yt();let t=0,n=0;for(const[o,r]of Object.entries(mt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete mt[l]:(t+=i,n++)}ft.total=t,ft.count=n}function xt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Mt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function kt(e,t,n){if(n<=t)return 0;const o=Mt(e,n-1);return t<=0?o:o-Mt(e,t-1)}function bt(e){ht.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(mt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(xt(t,l,i),xt(n,l,1))}vt.value=t,gt.value=n}function Ct(e,t){if(!Number.isFinite(t)||t<=0)return;const n=mt[e];if(mt[e]=t,n?ft.total+=t-n:(ft.total+=t,ft.count++),ht.value>e){const o=vt.value,r=gt.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&xt(o,e,r)}else xt(o,e,t),xt(r,e,1)}}const Tt=m.computed(()=>ft.count>0?Math.max(12,ft.total/ft.count):32);function Nt(e,t){var n,o;if(e>=t)return 0;if(ht.value!==P.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=mt[r])?n:Tt.value;return o}const r=vt.value,l=gt.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=mt[r])?o:Tt.value;return n}return kt(r,e,t)+(t-e-kt(l,e,t))*Tt.value}m.watch(()=>P.value.length,e=>{e<=0?yt():(e<ht.value&&wt(e),e!==ht.value&&bt(e))},{immediate:!0});const Dt=m.computed(()=>H.value?Nt(0,Math.min(de.start,P.value.length)):0),_t=m.computed(()=>{if(!H.value)return 0;const e=P.value.length;return Nt(Math.min(de.end,e),e)});function jt(e){var t;if(e<=0)return 0;const n=P.value;if(ht.value===n.length&&vt.value.length&>.value.length){const t=Tt.value,o=vt.value,r=gt.value,l=e=>e<=0?0:Mt(o,e-1)+(e-Mt(r,e-1))*t;let i=0,a=n.length-1,s=n.length-1;for(;i<=a;){const t=i+a>>1;l(t+1)>=e?(s=t,a=t-1):i=t+1}return s}let o=e;for(let r=0;r<n.length;r++){const e=null!=(t=mt[r])?t:Tt.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function It(e){var t;const n=P.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(ht.value===n.length){const t=Nt(0,n.length);return jt(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=mt[r])?t:Tt.value;if(o<=e)return r;o-=e}return 0}function Et(e){if(!ne.size)return;if(!H.value)return;let t=!1;for(const[n,o]of ne)n>=e&&(o.destroy(),ne.delete(n),me.value&&delete te[n],Ft(n),re.delete(n)&&(t=!0));t&&At()}function St(e,t){me.value&&(te[e]=t),t&&(H.value?ut():xe.value=dt(e,0,Math.max(0,P.value.length-1)))}function Lt(e){const t=ne.get(e);t&&(t.destroy(),ne.delete(e)),Ft(e)}function Bt(e,t){let n=!1;if(t){const o=re.get(e);re.set(e,t),o!==t&&(n=!0)}else re.delete(e)&&(n=!0);if(n&&At(),t||Ft(e),!ve.value||!U)return Lt(e),void(t?St(e,!0):me.value&&delete te[e]);if(!H.value&&me.value&&!a.value&&ne.size>=640&&(Wt("too-many-targets"),!ve.value||!U))return Lt(e),void(t?St(e,!0):me.value&&delete te[e]);if(e<V.value&&!H.value)return Lt(e),void St(e,!0);if(!t)return Lt(e),void(me.value&&delete te[e]);Lt(e);const o=U(t,{rootMargin:"400px"});o&&(ne.set(e,o),St(e,o.isVisible.value),me.value&&Yt(e),o.whenVisible.then(()=>{Ft(e),St(e,!0)}).catch(()=>{}).finally(()=>{ne.get(e)===o&&ne.delete(e);try{o.destroy()}catch(t){}}),H.value&&ut())}function At(){ie.value+=1}function Ot(e,t){t?(Me.set(e,t),queueMicrotask(()=>{Ct(e,t.offsetHeight)})):Me.delete(e)}m.onMounted(()=>{f&&m.nextTick(Te)}),m.watch(pe,()=>{f&&m.nextTick(Te)}),m.watch(G,()=>{f&&m.nextTick(Te)}),m.watch(H,()=>{f&&m.nextTick(Te)});let zt=null,Pt=null,Rt=!1,Ht=null,$t=null;function Ut(){f&&(null!=zt&&(null==Y||Y(zt),zt=null),null!=Pt&&(window.clearTimeout(Pt),Pt=null),null!=$t&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback($t),$t=null),Rt=!1,Ht=null)}function Ft(e){if(!f)return;const t=oe.get(e);null!=t&&(window.clearTimeout(t),oe.delete(e))}function Yt(e){if(!f||!me.value)return;Ft(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(oe.delete(e),!me.value)return;if(!0===te[e])return;const o=re.get(e);if(!o)return void delete te[e];const r=_e(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,u=a?0:s.top,c=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,d=o.getBoundingClientRect();d.bottom>=u-500&&d.top<=c+500&&St(e,!0)},1800+t);oe.set(e,n)}function Wt(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&"undefined"!=typeof console&&console.warn("[markstream-vue2] viewportPriority auto-disabled:",e);for(const e of ne.values())e.destroy();if(ne.clear(),f)for(const e of oe.values())window.clearTimeout(e);oe.clear();for(const e of Object.keys(te))delete te[e]}}function Qt(e,t={}){var n,o;if(!fe.value)return;const r=De.value;if(G.value>=r)return;const i=Math.max(1,e),a=e=>{var t;zt=null,Pt=null,$t=null,Rt=!1;const n=null!=Ht?Ht:i;Ht=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();G.value=Math.min(r,G.value+Math.max(1,e)),Et(G.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return Vt(n),n};let s=n;for(;(a(s),!(G.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ee.value));G.value<r&&Kt()};if(!f||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(Ht=null!=Ht?Math.max(Ht,i):i,!Rt){if(Rt=!0,!W&&Q&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void($t=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}F&&!W?zt=F(()=>{0!==s?Pt=window.setTimeout(()=>a(),s):a()}):Pt=window.setTimeout(()=>a(),s)}}function Kt(){fe.value&&Qt(X.value?Math.max(1,Math.round(ee.value)):Math.max(1,K.value))}function Vt(e){var t;if(!fe.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,K.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?ee.value=Math.max(r,Math.floor(.7*ee.value)):e<.5*n&&ee.value<o&&(ee.value=Math.min(o,Math.ceil(1.2*ee.value)))}function Xt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./index3.js"));return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] 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".',t),Je}})}function qt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./index4.js"));return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',t),Je}})}function Zt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./index5.js"));return null!=(e=t.default)?e:t}catch(t){return console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",t),Je}})}function Gt(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>pn);return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',t),Je}})}m.watch([()=>P.value,()=>P.value.length,()=>fe.value,()=>K.value,()=>V.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=P.value.length,n=J.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;J.value={key:o,total:t};const s=he.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==K.value||s.initial!==V.value||s.delay!==u||s.enabled!==fe.value;he.value={batchSize:K.value,initial:V.value,delay:u,enabled:fe.value},(a||c||!fe.value)&&Ut(),(a||c)&&(ee.value=Math.max(1,K.value||1)),a&&H.value&&ut({immediate:!0});const d=De.value;if(!t)return 0!==G.value&&(G.value=0),void Et(0);if(!fe.value)return G.value!==d&&(G.value=d),void Et(G.value);if(r||0===n.total||c){const e=Math.min(d,V.value);G.value!==e&&(G.value=e)}else{const e=Math.min(G.value,d);G.value!==e&&(G.value=e)}const p=Math.max(1,V.value||K.value||t);G.value<d?Qt(p,{immediate:!f}):Et(G.value)},{immediate:!0}),m.watch(()=>H.value,e=>{if(!e)return Le(),void st();it(),ut({immediate:!0})},{immediate:!0}),m.watch([()=>P.value.length,()=>H.value],e=>d(this,[e],function*([e,t]){t&&e&&f&&(yield m.nextTick(),ut({immediate:!0}))}),{flush:"post"}),m.watch(()=>i.value,()=>{H.value&&(it(),ut({immediate:!0}))}),m.watch(()=>P.value.length,()=>{H.value&&ut({immediate:!0})}),m.watch(()=>me.value,e=>{if(e)for(const[t,n]of re)Bt(t,n);else{for(const e of ne.values())e.destroy();ne.clear();for(const e of Array.from(oe.keys()))Ft(e);for(const e of Object.keys(te))delete te[e];for(const[e,t]of re)t&&St(e,!0)}},{immediate:!1}),m.watch([()=>l.viewportPriority,()=>P.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),m.watch(()=>G.value,()=>{H.value&&ut({immediate:!0})}),m.watch([xe,R,ye,()=>P.value.length,H],()=>{pt()},{immediate:!0}),m.watch([()=>P.value.length,H,R,ye,()=>de.start,()=>de.end],([e,t,n,o,r,l])=>{g.value&&y("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:xe.value,scroll:t?(()=>{const e=se.value||_e();return e?{reverse:je(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:G.value})}),m.watch(()=>De.value,(e,t)=>{fe.value&&("number"==typeof t&&e<=t||e>G.value&&Kt())}),m.onBeforeUnmount(()=>{Ut();for(const e of ne.values())e.destroy();ne.clear();for(const e of Array.from(oe.keys()))Ft(e);Le(),st()});const Jt=m.computed(()=>l.renderCodeBlocksAsPre?Je:Xt),en={text:Se,paragraph:Ge,heading:Ve,code_block:Xt,list:qe,list_item:Xe,blockquote:lt,table:et,definition_list:C,footnote:Qe,footnote_reference:E,footnote_anchor:We,admonition:at,vmr_container:ot,hardbreak:Ke,link:$e,image:we,thematic_break:tt,math_inline:Be,math_block:Ae,strong:Re,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Pe,superscript:ze,emoji:T,checkbox:b,checkbox_input:b,inline_code:Z,html_inline:q,reference:Oe,html_block:Ze},tn=m.computed(()=>(j.value,I(l.customId))),nn=m.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),on=m.computed(()=>u(u({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{}),l.codeBlockProps||{})),rn=m.computed(()=>u({},l.mermaidProps||{})),ln=m.computed(()=>u({},l.d2Props||{})),an=m.computed(()=>u({},l.infographicProps||{})),sn=m.computed(()=>({typewriter:l.typewriter})),un=m.computed(()=>u(u({},sn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),cn=m.computed(()=>u(u({},sn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),dn=m.computed(()=>Ce.value.map((e,t)=>{const n=vn(e);return{node:e,component:wn(e,n),bindings:xn(e,n),isCodeBlock:"code_block"===e.type,index:t,indexKey:`${nn.value}-${t}`,renderKey:yn(e,t)}})),mn=m.computed(()=>!(!ke.value||!l.content)&&P.value.some(e=>gn(e))),fn=m.computed(()=>pe.value.map(e=>{const t=hn(e.node),n=vn(t);return c(u({},e),{node:t,component:wn(t,n),bindings:xn(t,n),isCodeBlock:"code_block"===t.type,indexKey:`${nn.value}-${e.index}`,renderKey:yn(t,e.index)})}));function hn(e){var t,n,o,r,l,i,a;if("code_block"!==e.type)return e;const s=e,c=[String(null!=(t=s.language)?t:""),String(null!=(n=s.loading)?n:""),String(null!=(o=s.diff)?o:""),String(null!=(r=s.code)?r:""),String(null!=(l=s.originalCode)?l:""),String(null!=(i=s.updatedCode)?i:""),String(null!=(a=s.raw)?a:"")].join("\0"),d=le.get(s);if(d&&d.signature===c)return d.node;const p=u({},s);return le.set(s,{signature:c,node:p}),p}function vn(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function gn(e){if(!e)return!1;const t=String(e.type||"");return!!["blockquote","list","list_item","table","definition_list","footnote","admonition"].includes(t)||Array.isArray(e.items)||Array.isArray(e.rows)||Array.isArray(e.children)&&!1===["paragraph","heading","text"].includes(t)}function yn(e,t){const n=`${nn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown"),r=!0===e.loading,l="string"==typeof e.raw?e.raw.length:0,i="string"==typeof e.content?e.content.length:0,a=Array.isArray(e.children)?e.children.length:0,s=Array.isArray(e.items)?e.items.length:0,u=Array.isArray(e.rows)?e.rows.length:0;return(ke.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function wn(e,t){if(!e)return nt;const n=tn.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:vn(e);if("mermaid"===r)return n.mermaid||qt;if("infographic"===r)return n.infographic||Zt;if("d2"===r||"d2lang"===r)return n.d2||Gt;if(o)return o;return n.code_block||Jt.value}return o||en[String(e.type)]||nt}function xn(e,t){const n=null!=t?t:vn(e);return"mermaid"===n?rn.value:"infographic"===n?an.value:"d2"===n||"d2lang"===n?ln.value:"link"===e.type?un.value:"list"===e.type?cn.value:"code_block"===e.type?on.value:sn.value}return{__sfc:!0,props:l,emit:t,MAX_DEFERRED_NODE_COUNT:900,MAX_VIEWPORT_OBSERVER_TARGETS:640,VIEWPORT_PRIORITY_RECOVERY_COUNT:200,containerRef:i,viewportPriorityAutoDisabled:a,SCROLL_PARENT_OVERFLOW_RE:s,isClient:f,instance:v,debugPerformanceEnabled:g,logPerf:y,resolveViewportRoot:x,instanceMsgId:M,defaultMd:k,customTagCache:N,EMPTY_PARSED_NODES:D,mdBase:_,mdInstance:S,normalizeCustomTag:L,resolveCustomHtmlTags:B,cloneNodeValue:A,cloneParsedNodeList:O,mergedParseOptions:z,parsedNodes:P,maxLiveNodesResolved:R,virtualizationEnabled:H,viewportPriorityEnabled:$,registerNodeVisibility:U,requestFrame:F,cancelFrame:Y,isTestEnv:W,hasIdleCallback:Q,resolvedBatchSize:K,resolvedInitialBatch:V,batchingEnabled:X,renderedCount:G,previousRenderContext:J,adaptiveBatchSize:ee,nodeVisibilityState:te,nodeVisibilityHandles:ne,nodeVisibilityFallbackTimers:oe,nodeSlotElements:re,codeBlockRenderCache:le,nodeSlotVersion:ie,sortedNodeSlots:ae,scrollRootElement:se,detachScrollHandler:ue,pendingFocusSync:ce,liveRange:de,visibleNodes:pe,deferNodes:me,incrementalRenderingActive:fe,previousBatchConfig:he,shouldObserveSlots:ve,liveNodeBufferResolved:ye,focusIndex:xe,nodeContentElements:Me,legacyVue26:ke,legacyNodesMode:be,legacyNodeItems:Ce,syncNodeRefs:Te,resolveTemplateRef:Ne,desiredRenderedCount:De,resolveScrollContainer:_e,isReverseFlexScrollRoot:je,getNormalizedScrollTop:Ie,getOffsetTopWithinRoot:Ee,cleanupScrollListener:Le,setupScrollListener:it,cancelScheduledFocusSync:st,scheduleFocusSync:ut,syncFocusToScroll:ct,clamp:dt,updateLiveRange:pt,nodeHeights:mt,heightStats:ft,heightTreeSize:ht,heightSumTree:vt,heightKnownTree:gt,resetHeightMeasurements:yt,pruneHeightMeasurements:wt,fenwickUpdate:xt,fenwickQuery:Mt,fenwickRangeSum:kt,rebuildHeightTrees:bt,recordNodeHeight:Ct,averageNodeHeight:Tt,estimateHeightRange:Nt,topSpacerHeight:Dt,bottomSpacerHeight:_t,estimateIndexForOffset:jt,estimateIndexForOffsetFromEnd:It,cleanupNodeVisibility:Et,markNodeVisible:St,shouldRenderNode:function(e){return!(fe.value&&e>=G.value)&&(!me.value||e<V.value||!0===te[e])},destroyNodeHandle:Lt,setNodeSlotElement:Bt,bumpNodeSlotVersion:At,setNodeContentRef:Ot,batchRaf:zt,batchTimeout:Pt,batchPending:Rt,pendingIncrement:Ht,batchIdle:$t,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:Ut,clearVisibilityFallback:Ft,scheduleVisibilityFallback:Yt,autoDisableViewportPriority:Wt,scheduleBatch:Qt,queueNextBatch:Kt,adjustAdaptiveBatchSize:Vt,CodeBlockNodeAsync:Xt,MermaidBlockNodeAsync:qt,InfographicBlockNodeAsync:Zt,D2BlockNodeAsync:Gt,codeBlockComponent:Jt,nodeComponents:en,customComponentsMap:tn,indexPrefix:nn,codeBlockBindings:on,mermaidBindings:rn,d2Bindings:ln,infographicBindings:an,nonCodeBindings:sn,linkBindings:un,listBindings:cn,legacyRenderedItems:dn,legacyStructuredContentMode:mn,renderedItems:fn,getCodeBlockRenderNode:hn,getCodeBlockLanguage:vn,isLegacyStructuredNode:gn,getRenderKey:yn,getNodeComponent:wn,getBindingsFor:xn,handleContainerClick:function(e){t("click",e)},handleContainerMouseover:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseover",e)},handleContainerMouseout:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseout",e)},LegacyNodesRenderer:rt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue2 markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],attrs:{"data-custom-id":n.props.customId},on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.legacyNodesMode?e._l(n.legacyRenderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[o.isCodeBlock||!1===n.props.typewriter?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"typewriter",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1)])}):n.legacyStructuredContentMode?t(n.LegacyNodesRenderer,{attrs:{nodes:n.parsedNodes,"custom-id":n.props.customId,"index-key":n.props.indexKey,typewriter:n.props.typewriter,"show-tooltips":n.props.showTooltips,"code-block-stream":n.props.codeBlockStream,"code-block-dark-theme":n.props.codeBlockDarkTheme,"code-block-light-theme":n.props.codeBlockLightTheme,"code-block-monaco-options":n.props.codeBlockMonacoOptions,"render-code-blocks-as-pre":n.props.renderCodeBlocksAsPre,"code-block-min-width":n.props.codeBlockMinWidth,"code-block-max-width":n.props.codeBlockMaxWidth,"code-block-props":n.props.codeBlockProps,themes:n.props.themes,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}}):[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.renderedItems,function(o){var r;return t("div",{key:o.renderKey,ref:`node-slot-${o.index}`,refInFor:!0,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[n.shouldRenderNode(o.index)?t("div",{ref:`node-content-${o.index}`,refInFor:!0,staticClass:"node-content"},[o.isCodeBlock||!1===n.props.typewriter?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"typewriter",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1):t("div",{staticClass:"node-placeholder",style:{height:`${null!=(r=n.nodeHeights[o.index])?r:n.averageNodeHeight}px`}})])}),n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.bottomSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e()]],2)},[],!1,null,"231833c7",null,null).exports,at=k(m.defineComponent({__name:"AdmonitionNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e,{emit:t}){var n;const o=e,r=m.computed(()=>{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)}),l=m.ref(!!o.node.collapsible&&!(null==(n=o.node.open)||n)),i=`admonition-${Math.random().toString(36).slice(2,9)}`,a=m.getCurrentInstance(),s=m.computed(()=>w(null==a?void 0:a.proxy)?rt:it);return{__sfc:!0,props:o,emit:t,iconMap:{note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},displayTitle:r,collapsed:l,toggleCollapse:function(){o.node.collapsible&&(l.value=!l.value)},headerId:i,instance:a,nestedRenderer:s}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"admonition",class:[`admonition-${n.props.node.kind}`,n.props.isDark?"is-dark":""]},[t("div",{staticClass:"admonition-header",attrs:{id:n.headerId}},[n.iconMap[n.props.node.kind]?t("span",{staticClass:"admonition-icon"},[e._v(e._s(n.iconMap[n.props.node.kind]))]):e._e(),t("span",{staticClass:"admonition-title"},[e._v(e._s(n.displayTitle))]),n.props.node.collapsible?t("button",{staticClass:"admonition-toggle",attrs:{"aria-expanded":!n.collapsed,"aria-controls":`${n.headerId}-content`,title:n.collapsed?"Expand":"Collapse"},on:{click:n.toggleCollapse}},[n.collapsed?t("span",[e._v("▶")]):t("span",[e._v("▼")])]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.collapsed,expression:"!collapsed"}],staticClass:"admonition-content",attrs:{id:`${n.headerId}-content`,"aria-labelledby":n.headerId}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`admonition-${e.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(e){return n.emit("copy",e)}}})],1)])},[],!1,null,"f9c1d6b9",null,null).exports;let st=!1,ut=null,ct=!1;function dt(){return d(this,null,function*(){var e;if(ut)return ut;if(ct)return null;try{const t=yield Promise.resolve().then(()=>require("./index.legacy.js"));return ut=null!=(e=null==t?void 0:t.default)?e:t,yield function(e){return d(this,null,function*(){if(st)return;st=!0;const t=null==globalThis?void 0:globalThis.MonacoEnvironment;return!t||"function"!=typeof t.getWorker&&"function"!=typeof t.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(ut),(yield function(e){return d(this,null,function*(){const t=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof t)return!0;try{const e=yield t(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(n){return console.warn("[markstream-vue2] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",n),!1}})}(ut))?ut:(ut=null,ct=!0,null)}catch(t){return ct=!0,null}})}const pt='<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',mt='<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',ft='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';let ht=null,vt=null,gt=null;const yt=m.ref(0),wt={"":ft,plain:ft,text:ft,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n',typescript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n',cs:pt,csharp:pt,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n',shell:mt,powershell:mt,sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n',svg:'<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'},xt={"":"",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",d:"dlang",vbnet:"vb.net"};function Mt(){return d(this,null,function*(){return vt||(gt||(gt=Promise.resolve().then(()=>require("./languageIconExtended.js")).then(e=>(vt=e.EXTENDED_LANGUAGE_ICON_MAP,yt.value++,vt)).catch(()=>null)),gt)})}function kt(e){ht=null!=e?e:null}function bt(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=xt[n])?t:n}function Ct(e){const t=bt(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Tt(e){if(ht){const t=ht(e);if(null!=t&&""!==t)return t}const t=bt(e),n=wt[t];if(n)return n;return(null==vt?void 0:vt[t])||(Mt(),'<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 Nt={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},Dt=new Map,_t=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","hardbreak","heading","highlight","html_block","html_inline","image","inline_code","insert","link","list","list_item","math_block","math_inline","paragraph","reference","strikethrough","strong","subscript","superscript","table","table_cell","table_row","text","thematic_break"]);function jt(e){const t=function(e){if(!e||0===e.length)return[];const t=new Set,n=[];for(const o of e){const e=Ht(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return n}(e.customHtmlTags),n=`${e.cacheKey||"markstream-vue2-nested-html"}::${t.join(",")}`;let o=Dt.get(n);return o||(o=p.getMarkdown(n,{customHtmlTags:t}),Dt.set(n,o)),{markdown:o,options:{allowHtml:!1!==e.allowHtml,customNodeTag:Ht(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function It(e,t){return(Array.isArray(e)?e:[]).map(e=>Et(e,t)).join("")}function Et(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return Ft(Rt(e.content));case"paragraph":return`<p>${It(Pt(e.children),t)}</p>`;case"strong":return`<strong>${It(Pt(e.children),t)}</strong>`;case"emphasis":return`<em>${It(Pt(e.children),t)}</em>`;case"strikethrough":return`<del>${It(Pt(e.children),t)}</del>`;case"highlight":return`<mark>${It(Pt(e.children),t)}</mark>`;case"insert":return`<ins>${It(Pt(e.children),t)}</ins>`;case"subscript":return`<sub>${It(Pt(e.children),t)}</sub>`;case"superscript":return`<sup>${It(Pt(e.children),t)}</sup>`;case"inline_code":return`<code>${Ft(Rt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=Rt(e.href),o=Rt(e.title),r=Pt(e.children).length>0?It(Pt(e.children),t):Ft(Rt(e.text||n)),l=o?` title="${Yt(o)}"`:"";return`<a${n?` href="${Yt(n)}"`:""}${l} target="_blank" rel="noreferrer noopener">${r}</a>`}(e,t);case"image":return function(e){const t=Rt(e.src),n=Rt(e.alt),o=Rt(e.title),r=o?` title="${Yt(o)}"`:"";return`<img src="${Yt(t)}" alt="${Yt(n)}"${r}>`}(e);case"list":return function(e,t){const n=e.ordered?"ol":"ul";return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:""}>${It(Pt(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${It(Pt(e.children),t)}</li>`;case"blockquote":return`<blockquote>${It(Pt(e.children),t)}</blockquote>`;case"heading":return function(e,t){const n=function(e){const t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}(e.level);return`<h${n}>${It(Pt(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=Ut(Rt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${Ft(Rt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?St(e.header,t,!0):"",o=It(Pt(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return St(e,t);case"table_cell":return Lt(e,t);case"definition_list":return function(e,t){return`<dl>${Pt(e.items).map(e=>Bt(e,t)).join("")}</dl>`}(e,t);case"definition_item":return Bt(e,t);case"footnote":return function(e,t){return`<div id="fnref--${Yt(Rt(e.id))}" class="markstream-nested-footnote">${It(Pt(e.children),t)}</div>`}(e,t);case"footnote_reference":return function(e){const t=Ft(Rt(e.id));return`<sup class="markstream-nested-footnote-ref"><a href="#fnref--${Yt(Rt(e.id))}">[${t}]</a></sup>`}(e);case"admonition":return function(e,t){const n=Ut(Rt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${Ft(Rt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${It(Pt(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return Ft(Rt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${Ft(Rt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${Ft(Rt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${Ft(Rt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=Rt(e.content);return n?t.options.allowHtml?e.loading&&!e.autoClosed?Ft(n):n:Ft(n):""}(e,t);default:return function(e,t){const n=Rt(e.tag||e.type);if(!n||_t.has(n))return Ft(Rt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${Ut(n)||"node"}`,Ot(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=function(e,t=""){const n=function(e){if(!e)return[];if(Array.isArray(e)){if(0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}(e),o=[],r=[t];for(const[i,a]of n)$t(i)&&("class"!==i?!0===a?o.push(` ${i}`):o.push(` ${i}="${Yt(String(a))}"`):r.push(String(a)));const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${Yt(l)}"`),o.join("")}(e.attrs,o),l=function(e,t){const n=Pt(e.children);if(n.length>0)return It(n,t);const o=Rt(e.content);return o?At(o,t):Ft(Rt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${Yt(n)}">${l}</${i}>`}(e,t)}}function St(e,t,n=!1){return`<tr>${Pt(e.cells).map(e=>Lt(e,t,n)).join("")}</tr>`}function Lt(e,t,n=!1){const o=n||e.header?"th":"td",r=Rt(e.align);return`<${o}${r?` style="text-align:${Yt(r)}"`:""}>${It(Pt(e.children),t)}</${o}>`}function Bt(e,t){return`<dt>${It(Pt(e.term),t)}</dt><dd>${It(Pt(e.definition),t)}</dd>`}function At(e,t){return e?t.markdown.render(e):""}function Ot(e,t){return t?zt("function"==typeof t?t(e):t):""}function zt(e){return Array.isArray(e)?e.map(e=>zt(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function Pt(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function Rt(e){return"string"==typeof e?e:null==e?"":String(e)}function Ht(e){const t=Rt(e).trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w:-]*)/i);return n?n[1].toLowerCase():""}function $t(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Ut(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ft(e){return Rt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Yt(e){return Ft(e).replace(/`/g,"`")}const Wt=new Map;function Qt(e,t={}){if(Array.isArray(e.nodes))return e.nodes.slice();const n=e.node;if(n){const e=(o=n.children,Array.isArray(o)?o:[]);if(e.length>0)return e.slice()}var o;const r=function(e){var t;return"string"==typeof e.content?e.content:"string"==typeof(null==(t=e.node)?void 0:t.content)?e.node.content:""}(e);if(!r)return[];const l=function(e,t){var n,o;const r=null!=(n=t.parseOptions)?n:{},l=null!=(o=t.final)?o:(a=e.node)&&"object"==typeof a&&"boolean"==typeof a.loading?!a.loading:void 0,i=Kt(t.customHtmlTags,r.customHtmlTags);var a;return null==l&&0===i.length?r:u(u(u({},r),null==l?{}:{final:l}),0===i.length?{}:{customHtmlTags:i})}(e,t),i=function(e){const t=Kt(e.customHtmlTags),n=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${t.join(",")}`;let o=Wt.get(n);return o||(o=p.getMarkdown(n,{customHtmlTags:t}),Wt.set(n,o)),e.customMarkdownIt?e.customMarkdownIt(o):o}(t);return p.parseMarkdownToStructure(r,i,l)}function Kt(...e){const t=new Set,n=[];for(const o of e)for(const e of o||[]){const o=Vt(e);o&&!t.has(o)&&(t.add(o),n.push(o))}return n}function Vt(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():""}function Xt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const qt=k(m.defineComponent({__name:"Portal",props:{to:null},setup(e){const t=e,n=m.ref(null);function o(){return"undefined"==typeof document?null:t.to&&"body"!==t.to?document.querySelector(t.to):document.body}function r(){const e=n.value;if(!e)return;const t=o();t&&e.parentElement!==t&&t.appendChild(e)}return m.onMounted(()=>{r()}),m.watch(()=>t.to,()=>{r()}),m.onBeforeUnmount(()=>{}),{__sfc:!0,props:t,rootRef:n,resolveTarget:o,moveToTarget:r}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"rootRef",staticClass:"portal-root"},[e._t("default")],2)},[],!1,null,"5b7455c5",null,null).exports,Zt=k(m.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},onClose:null,title:null},setup(e){const t=e,{t:n}=he(),o=m.computed(()=>{const e=t.code||"",n=e.trim().toLowerCase();return n.startsWith("<!doctype")||n.startsWith("<html")||n.startsWith("<body")?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${t.isDark?"#020617":"#ffffff"};\n color: ${t.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`});function r(e){var n;"Escape"!==e.key&&"Esc"!==e.key||null==(n=t.onClose)||n.call(t)}return m.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",r)}),m.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",r)}),{__sfc:!0,props:t,t:n,srcdoc:o,handleKeydown:r,Portal:qt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("div",{staticClass:"html-preview-frame__backdrop",class:{"html-preview-frame__backdrop--dark":n.props.isDark},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[t("div",{staticClass:"html-preview-frame",class:{"html-preview-frame--dark":n.props.isDark},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"html-preview-frame__header"},[t("div",{staticClass:"html-preview-frame__title"},[t("span",{staticClass:"html-preview-frame__dot"}),t("span",{staticClass:"html-preview-frame__label"},[e._v(e._s(n.props.title||n.t("common.preview")||"Preview"))])]),t("button",{staticClass:"html-preview-frame__close",class:{"html-preview-frame__close--dark":n.props.isDark},attrs:{type:"button"},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[e._v(" × ")])]),t("iframe",{staticClass:"html-preview-frame__iframe",attrs:{sandbox:"allow-scripts allow-same-origin",srcdoc:n.srcdoc}})])])])])},[],!1,null,"a5364041",null,null).exports;let Gt=null,Jt=null,en=null,tn=null,nn=null;const on=new WeakMap;let rn=0;const ln=k(m.defineComponent({__name:"CodeBlockNode",props:{node:{type:Object,required:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{type:[Object,String],default:void 0},lightTheme:{type:[Object,String],default:void 0},isShowPreview:{type:Boolean,default:!0},monacoOptions:{type:Object,default:void 0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0},customId:{type:String,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,l="__markstreamMonacoPassiveTouch__";function i(){var e;try{const t=window;if(t[l])return;const n=null==(e=window.Element)?void 0:e.prototype,o=null==n?void 0:n.addEventListener;if(!n||!o)return;n.addEventListener=function(e,t,n){return"touchstart"===e&&a(this,n)?o.call(this,e,t,s(n)):o.call(this,e,t,n)},t[l]=!0}catch(t){}}function a(e,t){if(!e)return!1;const n=e;return!("function"!=typeof n.closest||!n.closest(".monaco-editor, .monaco-diff-editor")||t&&"object"==typeof t&&"passive"in t)}function s(e){return null==e?{passive:!0}:"boolean"==typeof e?{capture:e,passive:!0}:"object"==typeof e?"passive"in e?e:c(u({},e),{passive:!0}):{passive:!0}}"undefined"!=typeof window&&i();const p=m.getCurrentInstance(),f=m.computed(()=>{var e,t,n,o,r,l,i,a,s,u;const c=null==p?void 0:p.proxy,d=null!=(e=null==c?void 0:c.$listeners)?e:{};if(d.previewCode||d["preview-code"])return!0;const m=null!=(i=null!=(l=null==(n=null==(t=null==c?void 0:c.$vnode)?void 0:t.data)?void 0:n.on)?l:null==(r=null==(o=null==c?void 0:c.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?i:{};if(m.previewCode||m["preview-code"])return!0;const f=null!=(u=null==(a=null==c?void 0:c.$vnode)?void 0:a.props)?u:null==(s=null==p?void 0:p.vnode)?void 0:s.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:v}=he(),g=m.ref(null),y=m.ref(null),w=m.ref(!1),x=m.ref(bt(r.node.language)),M=m.computed(()=>Ct(x.value)),k=m.ref(!1),b=m.ref(!1),C=m.ref(!1),T=m.ref(!1),N=m.ref(null);let D=0;const _=ye();let j=null;const I=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>y.value,e=>{if(null==j||j.destroy(),j=null,!e)return void(I.value=!1);const t=_(e,{rootMargin:"400px"});j=t,I.value=t.isVisible.value,t.whenVisible.then(()=>{I.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==j||j.destroy(),j=null});let E=null,S=null,L=()=>{},B=()=>{},A=()=>null,O=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),P=()=>{},R=()=>{},H=null,$=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},U=()=>d(this,null,function*(){});const F=m.computed(()=>r.node.diff),Y=m.computed(()=>F.value?"diff":"single"),W=m.ref(Y.value),Q=m.ref(!1),K=m.ref(!1),V=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV);"undefined"!=typeof window&&(()=>{d(this,null,function*(){try{const e=yield dt();if(!e)return V&&console.warn("[markstream-vue2] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(Q.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&($=n),"function"==typeof t){const e=Te();if(e&&r.themes&&Array.isArray(r.themes)&&!r.themes.includes(e))throw new Error("Preferred theme not in provided themes array");const n=t(c(u({wordWrap:"on",wrappingIndent:"same",themes:r.themes,theme:e},r.monacoOptions||{}),{onThemeChange(){oe()}}));E=n.createEditor||E,S=n.createDiffEditor||S,L=n.updateCode||L,B=n.updateDiff||B,A=n.getEditor||A,O=n.getEditorView||O,z=n.getDiffEditorView||z,P=n.cleanupEditor||P,R=n.safeClean||n.cleanupEditor||R,U=n.setTheme||U,T.value=!0,g.value&&(yield be(g.value))}}catch(e){V&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),Q.value=!0}})})();const X=m.ref("number"==typeof(null==(o=r.monacoOptions)?void 0:o.fontSize)?r.monacoOptions.fontSize:Number.NaN),q=m.ref(X.value),Z=m.computed(()=>{const e=X.value,t=q.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function G(){try{const e=g.value;if(!e)return null;const t=e.querySelector(".view-lines .view-line");if(t){const e=Math.ceil(t.getBoundingClientRect().height);if(e>0)return e}}catch(e){}return null}function J(){var e,t,n,o,r;try{const l=F.value?null!=(n=null==(t=null==(e=z())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:z():O(),i=A(),a=null==(o=null==i?void 0:i.EditorOption)?void 0:o.fontInfo;if(l&&null!=a){const e=null==(r=l.getOption)?void 0:r.call(l,a),t=null==e?void 0:e.fontSize;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t}}catch(l){}try{const e=g.value;if(e){const t=e.querySelector(".view-lines .view-line");if(t)try{if("undefined"!=typeof window&&"function"==typeof window.getComputedStyle){const e=window.getComputedStyle(t).fontSize,n=e&&e.match(/^(\d+(?:\.\d+)?)/);if(n)return Number.parseFloat(n[1])}}catch(l){}}}catch(l){}return null}function ee(e){var t,n;try{const o=A(),r=null==(t=null==o?void 0:o.EditorOption)?void 0:t.lineHeight;if(null!=r){const t=null==(n=null==e?void 0:e.getOption)?void 0:n.call(e,r);if("number"==typeof t&&t>0)return t}}catch(l){}const o=G();if(o&&o>0)return o;const r=Number.isFinite(q.value)&&q.value>0?q.value:12;return Math.max(12,Math.round(1.35*r))}function te(){var e;if(Number.isFinite(q.value)&&q.value>0&&Number.isFinite(X.value))return q.value;const t=J();return"number"==typeof(null==(e=r.monacoOptions)?void 0:e.fontSize)?(X.value=r.monacoOptions.fontSize,q.value=r.monacoOptions.fontSize,q.value):t&&t>0?(X.value=t,q.value=t,t):(X.value=12,q.value=12,12)}function ne(){var e,t,n,o,r,l,i,a,s,u,c,d,p,m;try{const f=F.value?z():O();if(!f)return null;if(F.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const p=null==(e=f.getOriginalEditor)?void 0:e.call(f),m=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==p?void 0:p.layout)||n.call(p),null==(o=null==m?void 0:m.layout)||o.call(m);const h=(null==(r=null==p?void 0:p.getContentHeight)?void 0:r.call(p))||0,v=(null==(l=null==m?void 0:m.getContentHeight)?void 0:l.call(m))||0,g=Math.max(h,v);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==p?void 0:p.getModel)?void 0:i.call(p))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(d=null==(c=null==(u=null==m?void 0:m.getModel)?void 0:u.call(m))?void 0:c.getLineCount)?void 0:d.call(c))||1,x=Math.max(y,w),M=Math.max(ee(p),ee(m));return Math.ceil(x*(M+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(p=null==f?void 0:f.layout)||p.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const h=null==(m=null==f?void 0:f.getModel)?void 0:m.call(f);let v=1;h&&"function"==typeof h.getLineCount&&(v=h.getLineCount());const g=ee(f);return Math.ceil(v*(g+1.5)+0+1)}catch(f){return null}}function oe(){var e,t,n,o,r,l,i,a;const s=g.value,u=y.value;if(!s||!u)return;const c=s.querySelector(".monaco-editor")||s,d=c.querySelector(".monaco-editor-background")||c,p=c.querySelector(".view-lines")||c;let m=null,f=null,h=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(m=window.getComputedStyle(c),f=d===c?m:window.getComputedStyle(d),h=p===c?m:window.getComputedStyle(p))}catch(b){m=null,f=null,h=null}const v=String(null!=(e=null==m?void 0:m.getPropertyValue("--vscode-editor-foreground"))?e:"").trim(),w=String(null!=(t=null==m?void 0:m.getPropertyValue("--vscode-editor-background"))?t:"").trim(),x=String(null!=(o=null!=(n=null==m?void 0:m.getPropertyValue("--vscode-editor-selectionBackground"))?n:null==m?void 0:m.getPropertyValue("--vscode-editor-hoverHighlightBackground"))?o:"").trim(),M=v||String(null!=(l=null!=(r=null==h?void 0:h.color)?r:null==m?void 0:m.color)?l:"").trim(),k=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==m?void 0:m.backgroundColor)?a:"").trim();M&&u.style.setProperty("--vscode-editor-foreground",M),k&&u.style.setProperty("--vscode-editor-background",k),x&&u.style.setProperty("--vscode-editor-selectionBackground",x)}const re=/auto|scroll|overlay/i;function le(e){var t,n;if("undefined"==typeof window)return null;const o=null!=(t=null==e?void 0:e.ownerDocument)?t:document,r=o.scrollingElement||o.documentElement||o.body;let l=null!=(n=null==e?void 0:e.parentElement)?n:null;for(;l&&l!==o.body&&l!==r;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(re.test(t)||re.test(n))return l;l=l.parentElement}return r}function ie(e,t,n){var o;if("undefined"==typeof window)return;const r=Math.ceil(t),l=Math.ceil(n)-r;if(!l)return;const i=le(e);if(!i)return;const a=null!=(o=e.ownerDocument)?o:document,s=i===a.body||i===a.documentElement||i===a.scrollingElement,u=s?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-u>=0||(s&&"function"==typeof window.scrollBy?window.scrollBy(0,l):i.scrollTop+=l)}function ae(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect().height,n=ne();if(null!=n&&n>0){const o=Math.ceil(n);e.style.minHeight="0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",ie(e,t,o)}}catch(e){}}function se(e,t,n){const o=Math.min(t,n),r=t>n+1;return e.style.minHeight="0px",e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=r?"auto":"hidden",Math.ceil(o)}function ue(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect().height,o=ce();if(D>0&&(D--,null!=N.value))return void ie(t,n,se(t,N.value,o));const r=ne();if(null!=r&&r>0)return void ie(t,n,se(t,r,o));if(null!=N.value)return void ie(t,n,se(t,N.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void ie(t,n,se(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?ie(t,n,se(t,i,o)):ie(t,n,se(t,o,o))}catch(t){}}function ce(){var e,t;const n=null!=(t=null==(e=r.monacoOptions)?void 0:e.MAX_HEIGHT)?t:500;if("number"==typeof n)return n;const o=String(n).match(/^(\d+(?:\.\d+)?)/);return o?Number.parseFloat(o[1]):500}const de=m.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));m.watch(()=>r.node.language,e=>{x.value=bt(e)}),m.watch(()=>r.node.code,e=>d(this,null,function*(){var t,n;if(!1!==r.stream){if(x.value||(x.value=bt($(e))),E&&!C.value&&g.value)try{yield be(g.value)}catch(o){}F.value?B(String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),M.value):L(e,M.value),k.value&&Xt(()=>ae())}}));const fe=m.computed(()=>{const e=x.value;return e?Nt[e]||e.charAt(0).toUpperCase()+e.slice(1):Nt[""]||"Plain Text"}),ve=m.computed(()=>(yt.value,Tt(x.value||""))),ge=m.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e}),we=m.computed(()=>!1!==r.showTooltips);function xe(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Me(e){var t,n;try{if(F.value){const n=z();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=O();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function ke(e){return d(this,null,function*(){var t,n,o;if(!E)return;F.value?(R(),S?yield S(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),M.value):yield E(e,r.node.code,M.value)):yield E(e,r.node.code,M.value);const l=F.value?z():O();if("number"==typeof(null==(o=r.monacoOptions)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:r.monacoOptions.fontSize,automaticLayout:!1}),X.value=r.monacoOptions.fontSize,q.value=r.monacoOptions.fontSize;else{const e=J();e&&e>0?(X.value=e,q.value=e):(X.value=12,q.value=12)}k.value||b.value||ue(),!1===r.loading&&(yield m.nextTick(),Xt(()=>{k.value&&!b.value?ae():b.value||ue()}))})}function be(e){if(!E)return null;if(H)return H;C.value=!0;const t=(()=>d(this,null,function*(){yield ke(e)}))();return H=t.finally(()=>{H=null}),H}m.watch(we,e=>{e||me()}),m.watch(()=>q.value,(e,t)=>{const n=F.value?z():O();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),k.value&&!b.value&&ae())},{flush:"post",immediate:!1});const Ce=m.watch(()=>[g.value,F.value,r.stream,r.loading,T.value,I.value],e=>d(this,[e],function*([e,t,n,o,r,l]){if(!e||!E)return;if(!l)return;if(!1===n&&!1!==o)return;const i=be(e);i&&(yield i,Ce())}));function Te(){return r.isDark?r.darkTheme:r.lightTheme}function Ne(){const e=Te();e&&function(e,t){const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&e&&"name"in e)return String(e.name);if("object"==typeof e){const n=on.get(e);if(n)return n;try{const t=JSON.stringify(e);if(t)return on.set(e,t),t}catch(t){}const o="__theme_"+ ++rn;return on.set(e,o),o}return String(e)}(t);return n?(nn=e,Gt||tn!==n?(Jt=t,en=n,Gt||(Gt=(()=>d(this,null,function*(){for(;en&&null!=Jt;){const n=Jt,o=en;if(Jt=null,en=null,tn!==o)try{yield(null!=nn?nn:e)(n),tn=o}catch(t){}}}))().finally(()=>{Gt=null}),Gt)):Promise.resolve()):Promise.resolve()}(U,e).then(()=>{Xt(()=>oe())})}m.watch(Y,(e,t)=>d(this,null,function*(){if(e!==t&&(W.value=e,E&&g.value&&C.value&&(!1!==r.stream||!1===r.loading)&&I.value))try{C.value=!1,H=null,R(),yield m.nextTick(),yield be(g.value)}catch(n){C.value=!1}})),m.watch(()=>[r.isDark,r.darkTheme,r.lightTheme,T.value],()=>{T.value&&Ne()}),m.watch(()=>[r.monacoOptions,I.value],()=>{var e,t;if(!E||!I.value)return;const n=F.value?z():O(),o="number"==typeof(null==(e=r.monacoOptions)?void 0:e.fontSize)?r.monacoOptions.fontSize:Number.isFinite(q.value)?q.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),k.value&&!b.value?ae():b.value||ue()},{deep:!0});const De=m.watch(()=>[r.loading,I.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield m.nextTick(),Xt(()=>{b.value||(k.value?ae():ue()),De()})))}),{immediate:!0,flush:"post"});return m.onUnmounted(()=>{P()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:p,hasPreviewListener:f,t:v,codeEditor:g,container:y,copyText:w,codeLanguage:x,monacoLanguage:M,isExpanded:k,isCollapsed:b,editorCreated:C,monacoReady:T,expandRafId:null,heightBeforeCollapse:N,resumeGuardFrames:D,registerVisibility:_,viewportHandle:j,viewportReady:I,createEditor:E,createDiffEditor:S,updateCode:L,updateDiffCode:B,getEditor:A,getEditorView:O,getDiffEditorView:z,cleanupEditor:P,safeClean:R,createEditorPromise:H,detectLanguage:$,setTheme:U,isDiff:F,desiredEditorKind:Y,currentEditorKind:W,usePreCodeRender:Q,showInlinePreview:K,isDevEnv:V,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:X,codeFontSize:q,fontBaselineReady:Z,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:G,readActualFontSizeFromEditor:J,getLineHeightSafe:ee,ensureFontBaseline:te,increaseCodeFont:function(){const e=te(),t=Math.min(36,e+1);q.value=t},decreaseCodeFont:function(){const e=te(),t=Math.max(10,e-1);q.value=t},resetCodeFont:function(){te(),Number.isFinite(X.value)&&(q.value=X.value)},computeContentHeight:ne,syncEditorCssVars:oe,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:re,resolveScrollRootElement:le,adjustScrollAfterHeightChange:ie,updateExpandedHeight:ae,applyCollapsedContainerHeight:se,updateCollapsedHeight:ue,getMaxHeightValue:ce,isPreviewable:de,displayLanguage:fe,languageIcon:ve,containerStyle:ge,tooltipsEnabled:we,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),w.value=!0,t("copy",r.node.code),setTimeout(()=>{w.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},resolveTooltipTarget:xe,onBtnHover:function(e,t,n="top"){if(!we.value)return;const o=xe(e);if(!o)return;const l=e;pe(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){we.value&&me()},onCopyHover:function(e){if(!we.value)return;const t=xe(e);if(!t)return;const n=e;pe(t,w.value?v("common.copied")||"Copied":v("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(){k.value=!k.value;const e=F.value?z():O(),t=g.value;e&&t&&(k.value?(Me(!0),t.style.maxHeight="none",t.style.overflow="visible",ae()):(Me(!1),t.style.overflow="auto",ue()))},toggleHeaderCollapse:function(){var e,t,n;if(b.value=!b.value,b.value){if(g.value){const n=Math.ceil((null==(t=(e=g.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(N.value=n)}Me(!1)}else{k.value&&Me(!0),g.value&&null!=N.value&&(g.value.style.height=`${N.value}px`);const e=F.value?z():O();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}D=2,Xt(()=>{k.value?ae():ue()})}},previewCode:function(){if(!de.value)return;const e=x.value;if(f.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?v("artifacts.htmlPreviewTitle")||"HTML Preview":v("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(K.value=!K.value)},setAutomaticLayout:Me,runEditorCreation:ke,ensureEditorCreation:be,stopCreateEditorWatch:Ce,getPreferredColorScheme:Te,themeUpdate:Ne,stopLoadingWatch:De,stopExpandAutoResize:function(){},PreCodeNode:Je,HtmlPreviewFrame:Zt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.usePreCodeRender?t(n.PreCodeNode,{attrs:{node:e.node,loading:n.props.loading}}):t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.props.isDark}],style:n.containerStyle},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},[e._t("header-left",function(){return[t("div",{staticClass:"flex items-center space-x-2 flex-1 overflow-hidden"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("span",{staticClass:"text-sm font-medium font-mono truncate"},[e._v(e._s(n.displayLanguage))])])]}),e._t("header-right",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[n.props.showCollapseButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:n.toggleExpand,mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"}},[t("path",{attrs:{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}}),t("path",{attrs:{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],ref:"codeEditor",staticClass:"code-editor-container",class:[e.stream?"":"code-height-placeholder"]}),n.showInlinePreview&&!n.hasPreviewListener&&n.isPreviewable&&"html"===n.codeLanguage?t(n.HtmlPreviewFrame,{attrs:{code:e.node.code,"is-dark":n.props.isDark,"on-close":()=>n.showInlinePreview=!1}}):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[t("div",{staticClass:"loading-skeleton"},[t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line short"})])]},{loading:e.loading,stream:e.stream})],2),t("span",{staticClass:"sr-only",attrs:{"aria-live":"polite",role:"status"}},[e._v(e._s(n.copyText?n.t("common.copied")||"Copied":""))])],1)},[],!1,null,"46ef9165",null,null).exports,an=()=>import("@terrastruct/d2");let sn=null,un=an;function cn(e){un=e,sn=null}const dn=k(m.defineComponent({__name:"D2BlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:null,darkThemeId:null,showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(e){const t=e,{t:n}=he(),o=m.ref(!1),r=m.ref(!1),l=m.ref(!1),i=m.ref(!1),a=m.ref(null),s=m.ref(!1),c=m.ref(""),p=m.ref(0),f=m.ref(null),h=m.ref(null),v=m.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=m.computed(()=>l.value||!i.value||!c.value),y=m.computed(()=>!!c.value),w=m.computed(()=>{if(h.value)return{minHeight:`${h.value}px`}}),x=m.computed(()=>{if(t.maxHeight)return{maxHeight:"number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight)}}),M="undefined"!=typeof window;let k=null,b=!1,C=!1,T=0,N=null,D=!1,_=null;const j={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function I(e){return!e||e.disabled}const E=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],S=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function L(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function B(e){if(!e)return"";const t=e.trim();return S.test(t)?t:""}function A(e){const t=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(E.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=B(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function O(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";if(!e)return"";const t=L(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return"";const o=n;return A(o),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function P(){c.value=""}function R(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function H(){return d(this,null,function*(){if(k)return k;const e=yield function(){return d(this,null,function*(){if(sn)return sn;const e=un;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===an)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(sn=function(e){var t;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const n=null!=(t=e.default)?t:e;return"function"==typeof n?n:(null==n?void 0:n.D2)&&"function"==typeof n.D2?n.D2:n}(t),sn):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?k=t:"function"==typeof e.compile&&(k=e),k}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(k=new e.D2,k):("function"==typeof e.compile&&(k=e),k)})}function $(){return d(this,null,function*(){var e,n,o,r,c;if(!M||C)return;if(t.loading&&!t.progressiveRender)return;const d=v.value;if(!d)return P(),void(a.value=null);const m=++p.value;s.value=!0,a.value=null;try{const s=yield H();if(!s)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof s.compile||"function"!=typeof s.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const f=yield s.compile(d);if(m!==p.value)return;const h=null!=(e=null==f?void 0:f.diagram)?e:f,v=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:v.themeID,y=null!=(c=t.darkThemeId)?c:v.darkThemeID,w=u({},v);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=v.themeOverrides&&"object"==typeof v.themeOverrides?v.themeOverrides:null;w.themeOverrides=u(u({},j),e||{})}const x=yield s.render(h,w);if(m!==p.value)return;const M=R(x);if(!M)throw new Error("D2 render returned empty output.");z(M),t.loading&&(l.value=!1),a.value=null}catch(f){if(m!==p.value)return;const e=(null==f?void 0:f.message)?String(f.message):"D2 render failed.";t.loading||(a.value=e),e.includes("@terrastruct/d2")&&(i.value=!1,l.value=!0)}finally{m===p.value&&(s.value=!1,D&&(D=!1,U()))}})}function U(e=!1){if(b)return;if(!M)return;if(C)return;if(s.value)return void(D=!0);const n=Math.max(120,Number(t.progressiveIntervalMs)||0),o=Date.now()-T;if(!e&&o<n)return D=!0,void(null==N&&(N=window.setTimeout(()=>{N=null,D&&(D=!1,U(!0))},Math.max(0,n-o))));b=!0;const r=()=>{b=!1,T=Date.now(),$()};"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,0)}function F(){const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height;t>0&&(h.value=t)}return m.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),m.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),m.watch(()=>[g.value,c.value,v.value],()=>{m.nextTick(()=>{F()})}),m.onMounted(()=>{U(),m.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(_=new ResizeObserver(()=>{F()}),f.value&&_.observe(f.value))}),m.onBeforeUnmount(()=>{C=!0,null!=N&&(clearTimeout(N),N=null),null==_||_.disconnect(),_=null}),{__sfc:!0,props:t,t:n,copyText:o,isCollapsed:r,showSource:l,d2Available:i,renderError:a,isRendering:s,svgMarkup:c,renderToken:p,bodyRef:f,bodyMinHeight:h,baseCode:v,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:M,d2Instance:k,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:D,bodyObserver:_,DARK_THEME_OVERRIDES:j,shouldSkipEventTarget:I,onBtnHover:function(e,n,o="top"){if(I(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;pe(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){me()},onCopyHover:function(e){if(I(e.currentTarget))return;const r=o.value?n("common.copied")||"Copied":n("common.copy")||"Copy",l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;pe(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=v.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),o.value=!0,setTimeout(()=>{o.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},toggleCollapse:function(){r.value=!r.value},handleSwitchMode:function(e){l.value="source"===e},DISALLOWED_STYLE_PATTERNS:E,SAFE_URL_PROTOCOLS:S,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:P,extractSvg:R,ensureD2Instance:H,renderDiagram:$,scheduleRender:U,exportSvg:function(){if(c.value)try{const e=new Blob([c.value],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e);if("undefined"!=typeof document){const e=document.createElement("a");e.href=t,e.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}URL.revokeObjectURL(t)}catch(e){console.error("Failed to export SVG:",e)}},updateBodyMinHeight:F}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"d2-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:n.props.isDark?"border-gray-700/30 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"},[n.props.showHeader?t("div",{staticClass:"d2-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},[e._m(0),t("div",{staticClass:"flex items-center gap-x-2"},[n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"":"is-active",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("preview")},mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.preview")||"Preview")+" ")]),t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"is-active":"",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("source")},mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.source")||"Source")+" ")])]):e._e(),n.props.showCopyButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.svgMarkup?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.export")||"Export"},on:{click:n.exportSvg,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"}})])]):e._e(),n.props.showCollapseButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"bodyRef",staticClass:"d2-block-body",style:n.bodyStyle},[n.props.loading&&!n.hasPreview?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",[n.showSourceFallback?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",{staticClass:"d2-render",style:n.renderStyle},[t("div",{staticClass:"d2-svg",domProps:{innerHTML:e._s(n.svgMarkup)}}),n.renderError?t("p",{staticClass:"d2-error px-4 pb-3 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()])])])])},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"flex items-center gap-x-2"},[t("span",{staticClass:"text-sm font-medium font-mono"},[e._v("D2")])])}],!1,null,"bc9f707f",null,null).exports;dn.install=e=>{e.component(dn.__name,dn)};const pn=Object.freeze(Object.defineProperty({__proto__:null,default:dn},Symbol.toStringTag,{value:"Module"}));let mn=null,fn=null;const hn=k(m.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal"],setup(e,{emit:t}){const n=e,{t:o}=he(),r=m.ref(!1),l=m.ref(!1),i=m.ref(),a=m.ref(!1),s=m.ref("360px"),u=m.ref(!1),c=m.ref(),p=m.ref(null),f=m.ref(1),h=m.ref(0),v=m.ref(0),g=m.ref(!1),y=m.ref({x:0,y:0}),w=m.computed(()=>n.node.code);function x(e){return!e||e.disabled}function M(e){return d(this,null,function*(){try{const n=(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function k(e){"Escape"===e.key&&u.value&&C()}function b(){if(u.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",k)}catch(e){}m.nextTick(()=>{if(i.value&&c.value){c.value.innerHTML="";const e=document.createElement("div");e.style.transition="transform 0.1s ease",e.style.transformOrigin="center center",e.style.width="100%",e.style.height="100%",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center";const t=i.value.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),c.value.appendChild(e),p.value=e,e.style.transform=`translate(${h.value}px, ${v.value}px) scale(${f.value})`}})}function C(){if(u.value=!1,c.value&&(c.value.innerHTML=""),p.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",k)}catch(e){}}let T=null;function N(){return d(this,null,function*(){var e;if(i.value)try{const t=yield function(){return d(this,null,function*(){return fn||mn||(mn=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),fn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),mn)})}();if(!t)return void console.warn("Infographic library failed to load.");T&&(null==(e=T.destroy)||e.call(T),T=null),i.value.innerHTML="",T=new t({container:i.value,width:"100%",height:"100%"}),T.render(w.value),m.nextTick(()=>{if(i.value){const e=i.value.scrollHeight;e>0&&(s.value=`${Math.min(e,800)}px`)}})}catch(t){console.error("Failed to render infographic:",t),i.value&&(i.value.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${t instanceof Error?t.message:"Unknown error"}</div>`)}})}m.watch(()=>w.value,()=>{a.value||l.value||m.nextTick(()=>{N()})}),m.watch(()=>a.value,e=>{e||l.value||m.nextTick(()=>{N()})}),m.watch(()=>l.value,e=>{e||a.value||m.nextTick(()=>{N()})}),m.onMounted(()=>{a.value||l.value||m.nextTick(()=>{N()})}),m.onBeforeUnmount(()=>{var e;if(T&&(null==(e=T.destroy)||e.call(T),T=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",k)}catch(t){}});const D=m.computed(()=>n.isDark?"infographic-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"infographic-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700"),_=m.computed(()=>a.value||l.value),j=m.computed(()=>({transform:`translate(${h.value}px, ${v.value}px) scale(${f.value})`}));return m.watch(j,e=>{u.value&&p.value&&(p.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,containerHeight:s,isModalOpen:u,modalContent:c,modalCloneWrapper:p,zoom:f,translateX:h,translateY:v,isDragging:g,dragStart:y,baseCode:w,shouldSkipEventTarget:x,onBtnHover:function(e,t,o="top"){if(x(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;pe(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){me()},onCopyHover:function(e){if(x(e.currentTarget))return;const t=r.value?o("common.copied")||"Copied":o("common.copy")||"Copy",l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;pe(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=w.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),r.value=!0,setTimeout(()=>{r.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},handleSwitchMode:function(e){a.value="source"===e},handleExportClick:function(){var e;const t=null==(e=i.value)?void 0:e.querySelector("svg");t?M(t):console.error("SVG element not found")},exportSvg:M,handleKeydown:k,openModal:b,closeModal:C,handleOpenModalClick:function(){b()},zoomIn:function(){f.value<3&&(f.value+=.1)},zoomOut:function(){f.value>.5&&(f.value-=.1)},resetZoom:function(){f.value=1,h.value=0,v.value=0},startDrag:function(e){g.value=!0,e instanceof MouseEvent?y.value={x:e.clientX-h.value,y:e.clientY-v.value}:y.value={x:e.touches[0].clientX-h.value,y:e.touches[0].clientY-v.value}},onDrag:function(e){if(!g.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),h.value=t-y.value.x,v.value=n-y.value.y},stopDrag:function(){g.value=!1},infographicInstance:T,renderInfographic:N,computedButtonStyle:D,isFullscreenDisabled:_,transformStyle:j,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:qt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}]},[n.props.showHeader?t("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.infographicIconUrl,alt:"Infographic"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Infographic")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center gap-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center gap-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center gap-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}]},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",{staticClass:"min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:n.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:n.containerHeight},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle},[t("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue"},[t("transition",{attrs:{name:"infographic-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!n.isDragging,"cursor-grabbing":n.isDragging},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}})])]):e._e()])],1)])],1)},[],!1,null,"1589dd71",null,null).exports,vn=k(m.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{type:Object,required:!0},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{type:String,default:"vitesse-dark"},lightTheme:{type:String,default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,{t:l}=he(),i=m.ref(bt(String(null!=(n=r.node.language)?n:""))),s=m.ref(!1),u=m.ref(!1),c=m.ref(!1),p=m.ref(null),f=m.ref(null),v=m.ref(null),g=m.ref(""),y=m.ref(!1),w=m.ref(!1);let x;const M=m.ref(!0),k=m.ref(0),b=m.ref(14),C=m.ref(b.value),T=m.computed(()=>{const e=b.value,t=C.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),N=m.computed(()=>{const e=i.value.trim().toLowerCase();return e?Nt[e]||e.charAt(0).toUpperCase()+e.slice(1):Nt[""]||"Plain Text"}),D=m.computed(()=>(yt.value,Tt(i.value.trim().toLowerCase().split(":")[0]))),_=m.computed(()=>{const e=i.value.trim().toLowerCase();return r.isShowPreview&&("html"===e||"svg"===e)}),j=m.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e}),I=m.computed(()=>({fontSize:`${C.value}px`})),E=m.computed(()=>!1!==r.showTooltips);function S(){return r.isDark?r.darkTheme:r.lightTheme}function L(){return r.themes}function B(e){const t=e.match(/\d+(\.\d+)?/g);return!t||t.length<3?null:t.slice(0,3).map(Number)}function A(e){const t=B(e);if(!t)return null;const n=t.map(e=>{const t=e/255;return t<=.03928?t/12.92:a((t+.055)/1.055,2.4)});return.2126*n[0]+.7152*n[1]+.0722*n[2]}function O(e,t){const n=A(e),o=A(t);return null==n||null==o?null:(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function z(e){const t=B(e);if(!t)return r.isDark;const[n,o,l]=t;return.2126*n+.7152*o+.0722*l<140}function P(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=p.value,n=v.value;if(!t||!n)return;const o=n.querySelector(".shiki")||n.querySelector("pre");if(!o)return;const l=window.getComputedStyle(o),i=o.querySelector("code")||o,a=window.getComputedStyle(i),s=String(l.backgroundColor||"").trim(),u=String(a.color||l.color||"").trim();s&&t.style.setProperty("--vscode-editor-background",s);const c=s?z(s):r.isDark,d=c?"rgb(229, 231, 235)":"rgb(17, 24, 39)",m=s&&u&&(null!=(e=O(u,s))?e:0)>=3?u:d;t.style.setProperty("--vscode-editor-foreground",m),t.style.setProperty("--markstream-code-fallback-selection-bg",c?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.06)"),t.style.setProperty("--vscode-editor-selectionBackground","var(--markstream-code-fallback-selection-bg)")}function R(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function H(e,t=!1){return null==x||x.disconnect(),x=void 0,!t&&w.value?(g.value="",void(y.value=!0)):e?(g.value=`<pre class="shiki shiki-fallback"><code>${R(e)}</code></pre>`,void(y.value=!1)):(g.value="",y.value=!1,void(w.value=!1))}function $(){g.value="",y.value=!0,w.value=!0,m.nextTick().then(()=>{P()})}function U(){null==x||x.disconnect(),x=void 0,w.value&&(g.value="",y.value=!0)}function F(){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 d(this,null,function*(){if(yield m.nextTick(),F())return void $();const e=v.value;e&&(null==x||x.disconnect(),x=new MutationObserver(()=>{F()&&($(),null==x||x.disconnect(),x=void 0)}),x.observe(e,{childList:!0,subtree:!0}))})}let W,Q,K,V;const X=new Set,q=new Set,Z=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(o={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:o.DEV);function G(e,t=!1){const n=bt(String(null!=e?e:""));return n?!V||V.has(n)?n:(t&&Z&&!X.has(n)&&(X.add(n),console.warn(`[MarkdownCodeBlockNode] Language "${n}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}function J(e,t){return d(this,null,function*(){if(!W)return!1;const n=G(t,Boolean(e&&e.length));try{return yield W.updateCode(e,n),!0}catch(o){if("plaintext"!==n){Z&&!q.has(n)&&(q.add(n),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${n}", retrying as plaintext.`,o));try{return yield W.updateCode(e,"plaintext"),!0}catch(r){return Z&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",r),!1}}else Z&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o);return!1}})}function ee(){return d(this,null,function*(){if(!Q)try{const e=yield import("stream-markdown");Q=e.createShikiStreamRenderer,K=e.registerHighlight;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;V=t?new Set(t.map(e=>e.toLowerCase())):void 0,null==K||K({themes:L()})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}function te(){return d(this,null,function*(){yield ee(),f.value&&v.value?(null==K||K({themes:L()}),!W&&Q&&(W=Q(v.value,{theme:S(),themes:L()}),y.value=!0),W?!1===r.stream&&r.loading?H(r.node.code,!w.value):(H(r.node.code,!w.value),(yield J(r.node.code,i.value))?w.value?U():yield Y():U()):H(r.node.code,!0)):H(r.node.code,!0)})}function ne(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function oe(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}return te(),m.onMounted(()=>{te()}),m.onBeforeUnmount(()=>{null==x||x.disconnect(),x=void 0}),m.watch(()=>r.themes,()=>d(this,null,function*(){K&&K({themes:L()})})),m.watch(()=>r.loading,e=>{e||te()}),m.watch(E,e=>{e||me()}),m.watch(()=>[r.node.code,r.node.language],e=>d(this,[e],function*([e,t]){const n=bt(String(null!=t?t:""));if(n!==i.value&&(i.value=n),f.value&&v.value)return e?(W||(H(e,!w.value),yield te()),void(W&&e&&(!1===r.stream&&r.loading||(H(e,!w.value),(yield J(e,n))?w.value?U():yield Y():U())))):(null==x||x.disconnect(),x=void 0,v.value.innerHTML="",g.value="",y.value=!1,void(w.value=!1));H(e,!0)})),m.watch(()=>[r.darkTheme,r.lightTheme],()=>d(this,null,function*(){f.value&&v.value&&(W||(yield te()),yield null==W?void 0:W.setTheme(S()),P())})),m.watch(()=>r.node.code,()=>d(this,null,function*(){if(u.value||!M.value)return;yield m.nextTick();const e=f.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),{__sfc:!0,props:r,emits:t,t:l,codeLanguage:i,copyText:s,isExpanded:u,isCollapsed:c,container:p,codeBlockContent:f,rendererTarget:v,fallbackHtml:g,rendererReady:y,hasStableRender:w,renderObserver:x,autoScrollEnabled:M,lastScrollTop:k,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:b,codeFontSize:C,fontBaselineReady:T,displayLanguage:N,languageIcon:D,isPreviewable:_,containerStyle:j,contentStyle:I,tooltipsEnabled:E,getPreferredColorScheme:S,getResolvedThemes:L,getColorChannels:B,getRelativeLuminance:A,getContrastRatio:O,isDarkBackgroundColor:z,syncRenderedCssVars:P,escapeHtml:R,renderFallback:H,clearFallback:$,keepLastSuccessfulRender:U,hasRendererContent:F,clearFallbackWhenRendererReady:Y,renderer:W,createShikiRenderer:Q,registerHighlight:K,registeredHighlightLanguages:V,warnedMissingLanguages:X,warnedRendererErrors:q,isDevEnv:Z,normalizeRendererLanguage:G,updateRendererWithFallback:J,ensureStreamMarkdownLoaded:ee,initRenderer:te,isAtBottom:ne,handleScroll:function(){const e=f.value;if(!e||u.value)return;const t=e.scrollTop;t<k.value?M.value=!1:ne(e)&&(M.value=!0),k.value=t},copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),s.value=!0,t("copy",r.node.code),setTimeout(()=>{s.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},resolveTooltipTarget:oe,onBtnHover:function(e,t,n="top"){if(!E.value)return;const o=oe(e);if(!o)return;const l=e;pe(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){E.value&&me()},onCopyHover:function(e){if(!E.value)return;const t=oe(e);if(!t)return;const n=e;pe(t,s.value?l("common.copied")||"Copied":l("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(){u.value=!u.value;const e=f.value;e&&(u.value?(e.style.maxHeight="none",e.style["overflow-y"]="visible",e.style["overflow-x"]="auto"):(e.style.maxHeight="500px",e.style.overflow="auto",M.value=!0,m.nextTick(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))},toggleHeaderCollapse:function(){c.value=!c.value},increaseCodeFont:function(){const e=Math.min(36,C.value+1);C.value=e},decreaseCodeFont:function(){const e=Math.max(10,C.value-1);C.value=e},resetCodeFont:function(){C.value=b.value},previewCode:function(){if(!_.value)return;const e=bt(String(i.value||r.node.language)).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";t("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:r.node.code,title:n})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",n.props.isDark?"is-dark":""],style:c(u({},n.containerStyle),{backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))",color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))"})},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},[e._t("header-left",function(){return[t("div",{staticClass:"flex items-center space-x-2 flex-1 overflow-hidden"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("span",{staticClass:"text-sm font-medium font-mono truncate"},[e._v(e._s(n.displayLanguage))])])]}),e._t("header-right",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[n.props.showCollapseButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:n.toggleExpand,mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{"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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],ref:"codeBlockContent",staticClass:"code-block-content",style:n.contentStyle,on:{scroll:n.handleScroll}},[t("div",{ref:"rendererTarget",staticClass:"code-block-render"}),n.rendererReady?e._e():t("div",{staticClass:"code-fallback-plain",domProps:{innerHTML:e._s(n.fallbackHtml)}})]),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[e._m(0)]},{loading:e.loading,stream:e.stream})],2)])},[function(){var e=this._self._c;return this._self._setupProxy,e("div",{staticClass:"loading-skeleton"},[e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line short"})])}],!1,null,"185fd902",null,null).exports;function gn(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 yn=k(m.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:rt,NodeRenderer:it},props:{content:String,nodes:Array,final:Boolean,parseOptions:Object,customMarkdownIt:Function,debugPerformance:Boolean,customHtmlTags:Array,viewportPriority:Boolean,codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:Object,renderCodeBlocksAsPre:Boolean,codeBlockMinWidth:[String,Number],codeBlockMaxWidth:[String,Number],codeBlockProps:Object,showTooltips:Boolean,themes:Array,isDark:Boolean,customId:[String,Number],indexKey:[String,Number],typewriter:Boolean,batchRendering:Boolean,initialRenderBatchSize:Number,renderBatchSize:Number,renderBatchDelay:Number,renderBatchBudgetMs:Number,renderBatchIdleTimeoutMs:Number,deferNodesUntilVisible:Boolean,maxLiveNodes:Number,liveNodeBuffer:Number},data(){return{instanceMsgId:this.customId?`renderer-${this.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`}},computed:{legacyVue26(){return w(this)},mergedParseOptions(){var e,t,n,o;const r=null!=(e=this.parseOptions)?e:{},l=null!=(t=this.final)?t:r.final,i=[...null!=(n=this.customHtmlTags)?n:[],...null!=(o=r.customHtmlTags)?o:[]].map(gn).filter(Boolean),a=null!=l,s=i.length>0;return a||s?u(u(u({},r),a?{final:l}:{}),s?{customHtmlTags:Array.from(new Set(i))}:{}):r},parsedLegacyNodes(){if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:e,tags:t}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const t=new Set,n=[];for(const o of e){const e=gn(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return{key:n.join(","),tags:n}}(this.customHtmlTags),n=p.getMarkdown(e?`${this.instanceMsgId}:${e}`:this.instanceMsgId,{customHtmlTags:t}),o=this.customMarkdownIt?this.customMarkdownIt(n):n;return p.parseMarkdownToStructure(this.content,o,this.mergedParseOptions)},forwardedProps(){return{content:this.content,nodes:this.nodes,final:this.final,parseOptions:this.parseOptions,customMarkdownIt:this.customMarkdownIt,debugPerformance:this.debugPerformance,customHtmlTags:this.customHtmlTags,viewportPriority:this.viewportPriority,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,showTooltips:this.showTooltips,themes:this.themes,isDark:this.isDark,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,batchRendering:this.batchRendering,initialRenderBatchSize:this.initialRenderBatchSize,renderBatchSize:this.renderBatchSize,renderBatchDelay:this.renderBatchDelay,renderBatchBudgetMs:this.renderBatchBudgetMs,renderBatchIdleTimeoutMs:this.renderBatchIdleTimeoutMs,deferNodesUntilVisible:this.deferNodesUntilVisible,maxLiveNodes:this.maxLiveNodes,liveNodeBuffer:this.liveNodeBuffer}}},render(e){const t=M(this);return this.legacyVue26?e(rt,u({props:{nodes:this.parsedLegacyNodes,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,showTooltips:this.showTooltips,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,themes:this.themes,isDark:this.isDark}},Object.keys(t).length>0?{on:t}:{})):e(it,u({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,wn=new Map;function xn(e,t){if(wn.delete(e),wn.set(e,t),wn.size>200){const e=wn.keys().next().value;e&&wn.delete(e)}}function Mn(e){if(!e)return null;const t=wn.get(e)||null;return t&&xn(e,t),t}function kn(e,t){e&&t&&xn(e,{html:t})}let bn=null,Cn=null,Tn=!1;const Nn=new Map,Dn=new Map;let _n=5;const jn=new Set;function In(){if(Nn.size<_n&&jn.size){const t=Array.from(jn);jn.clear();for(const n of t)try{n()}catch(e){}}}let En=null;const Sn=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&Sn&&Promise.resolve().then(()=>require("./performance-monitor.js")).then(e=>{En=e.perfMonitor})}catch(go){}function Ln(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now();if(!De()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Cn)return Promise.reject(Cn);const l=`${t?"d":"i"}:${e}`,i=Dn.get(l);if(i)return En&&En.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),Promise.resolve(i);const a=bn||(Cn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Cn.name="WorkerInitError",Cn.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(Cn);if(Nn.size>=_n){const t=new Error("Worker busy");return t.name="WorkerBusy",t.code="WORKER_BUSY",t.busy=!0,t.inFlight=Nn.size,t.max=_n,En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(t)}return new Promise((l,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const s=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{Nn.delete(s);const t=new Error("Worker render timed out");t.name="WorkerTimeout",t.code="WORKER_TIMEOUT",En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(t),In()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),Nn.has(s)&&Nn.delete(s);const e=new Error("Aborted");e.name="AbortError",i(e),In()},{once:!0});const c=l,d=i;Nn.set(s,{resolve:t=>{En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),c(t)},reject:t=>{En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:(null==t?void 0:t.message)||String(t)}),d(t)},timeoutId:u}),a.postMessage({id:s,content:e,displayMode:t})})})}function Bn(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(Dn.set(o,n),Dn.size>200){const e=Dn.keys().next().value;Dn.delete(e)}}const An="WORKER_BUSY";function On(e=2e3,t){return Nn.size<_n?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),jn.delete(i),n())};if(jn.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,jn.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>In()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),jn.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const zn={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Pn(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!De()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:zn.timeout,s=null!=(r=n.waitTimeout)?r:zn.waitTimeout,u=null!=(l=n.backoffMs)?l:zn.backoffMs,c=null!=(i=n.maxRetries)?i:zn.maxRetries,d=Number.isFinite(c)?Math.max(0,Math.min(Math.floor(c),8)):zn.maxRetries,p=n.signal;let m=0;for(;;){if(null==p?void 0:p.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Ln(e,t,a,p)}catch(f){if((null==f?void 0:f.code)!==An||m>=d)throw f;if(m++,yield On(s,p).catch(()=>{}),null==p?void 0:p.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*m)))}}})}const Rn=k(m.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=ye();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),u=Mn(s.value),c=m.ref((null==u?void 0:u.html)||""),p=m.ref(""),f=m.ref(!(null==u?void 0:u.html));let h=Boolean(null==u?void 0:u.html);function v(){return d(this,null,function*(){const e=yield _e();if(!e)return!1;try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:!0});return g(n),Bn(t.node.content,!0,n),!0}catch(go){return!1}})}function g(e){c.value=e,p.value="",f.value=!1,h=!0,kn(s.value,e)}function y(){c.value="",p.value=t.node.raw,f.value=!1}function w(){return d(this,null,function*(){if(i)return;if(!t.node.content)return y(),void(h=!0);const e=Mn(s.value);if((null==e?void 0:e.html)&&!c.value&&(c.value=e.html,h=!0,f.value=!1),!h){f.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(go){}}a&&(a.abort(),a=null);const u=++l,d=new AbortController;a=d;try{const e=yield Pn(t.node.content,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:d.signal});if(i||u!==l)return;g(e)}catch(p){if(i||u!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===An||"WORKER_TIMEOUT"===e)&&(yield v()))return;if(h||c.value)return;n||!t.node.loading?y():f.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>w()),m.onMounted(()=>{w()}),m.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,cacheKey:s,initialCached:u,renderedHtml:c,fallbackText:p,renderingLoading:f,hasRenderedOnce:h,renderWithMainThreadFallback:v,applySuccessfulRender:g,applyRawFallback:y,renderMath:w}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerEl",staticClass:"math-block text-center overflow-x-auto relative min-h-[40px]"},[n.renderedHtml?t("div",{staticClass:"math-block__content",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("div",{staticClass:"math-block__fallback"},[e._v(" "+e._s(n.fallbackText)+" ")]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})])])},[],!1,null,"a643b55f",null,null).exports,Hn=k(m.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=ye();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>"$$"===t.node.markup),u=m.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),c=Mn(u.value),p=m.ref((null==c?void 0:c.html)||""),f=m.ref(""),h=m.ref(!(null==c?void 0:c.html));let v=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield _e();if(!e)return!1;try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:s.value});return y(n),Bn(t.node.content,s.value,n),!0}catch(go){return!1}})}function y(e){p.value=e,f.value="",h.value=!1,v=!0,kn(u.value,e)}function w(){p.value="",f.value=t.node.raw,h.value=!1}function x(){return d(this,null,function*(){if(i)return;if(!t.node.content)return w(),void(v=!0);const e=Mn(u.value);(null==e?void 0:e.html)&&!p.value&&(p.value=e.html,v=!0,h.value=!1),a&&(a.abort(),a=null);const c=++l,d=new AbortController;if(a=d,!v){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(go){}}try{const e=yield Pn(t.node.content,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:d.signal});if(i||c!==l)return;y(e)}catch(m){if(i||c!==l)return;if("AbortError"===(null==m?void 0:m.name))return;const e=(null==m?void 0:m.code)||(null==m?void 0:m.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==m?void 0:m.fallbackToRenderer)||e===An||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(v||p.value)return;n||!t.node.loading?w():h.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>x()),m.onMounted(()=>{x()}),m.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,displayMode:s,cacheKey:u,initialCached:c,renderedHtml:p,fallbackText:f,renderingLoading:h,hasRenderedOnce:v,renderWithMainThreadFallback:g,applySuccessfulRender:y,applyRawFallback:w,renderMath:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[n.renderedHtml?t("span",{staticClass:"math-inline",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("span",{staticClass:"math-inline math-inline--fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("span",{staticClass:"math-inline__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"math-inline__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.renderingLoading})],2)])},[],!1,null,"d1ef86a8",null,null).exports,$n=()=>import("mermaid");let Un=null,Fn=$n;function Yn(e){Fn=e,Un=null}function Wn(){return"function"==typeof Fn}function Qn(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 c(u({},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}function Kn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=u({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(go){}}let Vn=null,Xn=null;const qn=new Map;let Zn=5,Gn=!1;const Jn="WORKER_BUSY",eo="MERMAID_DISABLED";function to(e,t,n=1400){if(!Wn()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=eo,Promise.reject(e)}if(Xn)return Promise.reject(Xn);const o=Vn||(Xn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Xn.name="WorkerInitError",Xn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Xn);if(qn.size>=Zn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Jn,e.inFlight=qn.size,e.max=Zn,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),qn.delete(i))},c={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};qn.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return qn.delete(i),void l(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=qn.get(i);t&&t.reject(e)},n)})}function no(e,t,n=1400){return d(this,null,function*(){try{return yield to("canParse",{code:e,theme:t},n)}catch(go){return Promise.reject(go)}})}function oo(e,t,n=1400){return d(this,null,function*(){try{return yield to("findPrefix",{code:e,theme:t},n)}catch(go){return Promise.reject(go)}})}function ro(){if(Vn)try{for(const[e,t]of qn.entries())t.reject(new Error("Worker terminated"));qn.clear(),Vn.terminate()}finally{Vn=null}}const lo=k(m.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},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 r=e,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},i=m.ref(!1),a=m.computed(()=>r.isStrict?"strict":"loose"),s=m.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function p(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}const f=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],v=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return v.test(t)?t:""}function y(e){const t=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(f.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)}}}}}function w(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const t=p(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const o=n;return y(o),o}function x(e,t){if(!e)return"";try{e.replaceChildren()}catch(go){e.innerHTML=""}const n=w(t);return n?(e.appendChild(n),e.innerHTML):""}function M(e){if(e)try{e.replaceChildren()}catch(go){e.innerHTML=""}}function k(e,t){if(!e)return"";if("strict"===a.value)return x(e,t);try{e.replaceChildren()}catch(go){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(go){e.innerHTML=t}return e.innerHTML}const{t:b}=he();function C(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Un)return Un;const e=function(){try{const e=globalThis;return Qn(null==e?void 0:e.mermaid)}catch(go){return null}}();if(e)return Un=e,Kn(Un),Un;const t=Fn;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===$n)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Un=Qn(n),Kn(Un),Un):null})}();return i.value=!!e,e}catch(e){throw i.value=!1,e}})}"undefined"!=typeof window&&(()=>{d(this,null,function*(){var e;try{const t=yield C();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,u({},s.value))}catch(t){i.value=!1,console.warn("[markstream-vue2] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const T=m.ref(!1),N=m.ref(!1),D=m.ref(),_=m.ref(),j=m.ref(),I=m.ref(null),E=ye();let S=null;const L=m.ref("undefined"==typeof window),B=m.ref(),A=m.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function O(e,t=A.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}const z=m.ref(1),P=m.ref(0),R=m.ref(0),H=m.ref(!1),$=m.ref({x:0,y:0}),U=m.ref(!1),F=m.ref(!1),Y=m.ref(!1),W=m.ref(null),Q=m.ref(0),K=m.ref(!1),V=m.computed(()=>{var e;return Math.max(0,null!=(e=r.renderDebounceMs)?e:300)}),X=m.computed(()=>{var e;return Math.max(0,null!=(e=r.contentStableDelayMs)?e:500)}),q=m.computed(()=>{var e;return Math.max(120,null!=(e=r.previewPollDelayMs)?e:800)}),Z=m.computed(()=>{var e;return Math.max(q.value,null!=(e=r.previewPollMaxDelayMs)?e:4e3)}),G=m.computed(()=>{var e;return Math.max(1,Math.trunc(null!=(e=r.previewPollMaxAttempts)?e:12))});let J=null,ee=null,te=null,ne=0;const oe=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function re(){return L.value&&!N.value}function le(){null!=te&&(globalThis.clearTimeout(te),te=null)}function ie(){le(),te=globalThis.setTimeout(()=>{te=null,re()&&oe(()=>{re()&&rt()},{timeout:500})},V.value)}function ae(){null!=ee&&(globalThis.clearTimeout(ee),ee=null)}function se(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);ae(),ee=globalThis.setTimeout(()=>{ee=null,r.loading||Y.value||!re()?se(Math.min(1200,Math.max(300,1.2*t))):ie()},t)}const ue=m.ref("360px");let ce=null;const de=m.ref(!1),fe=m.ref(!1),ve=m.ref({}),ge=m.ref(null),we=m.ref(""),xe=m.ref(0);let Me=null;const ke=m.ref(!1),be=m.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),Ce=m.computed(()=>r.enableWheelZoom?{wheel:Je}:{}),Te=m.computed(()=>{var e,t,n,o;return{worker:null!=(e=r.workerTimeoutMs)?e:1400,parse:null!=(t=r.parseTimeoutMs)?t:1800,render:null!=(n=r.renderTimeoutMs)?n:2500,fullRender:null!=(o=r.fullRenderTimeoutMs)?o:4e3}}),Ne=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let De=null,_e=null,je=!1,Ie=q.value,Ee=null,Se=0,Le=!0,Be=0;function Ae(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 r=null,l=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=r&&clearTimeout(r),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(r=globalThis.setTimeout(()=>{l||(l=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{l||(l=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{l||(l=!0,s(),t(e))}).catch(e=>{l||(l=!0,s(),a(e))})})}function Oe(e){if("undefined"==typeof document)return;if(!_.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),M(_.value),_.value.appendChild(t),ue.value="360px",ke.value=!0,lt()}function ze(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)}function Pe(e){return!e||e.disabled}function Re(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function He(){return Le&&!U.value&&!de.value&&!ke.value}function $e(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 Ue(e,t,n){return d(this,null,function*(){var o,r;const l=yield C();if(!l)return;const i=l,a=Re(e,t);if("function"==typeof i.parse)return yield Ae(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:Te.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Ae(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:Te.value.render,signal:null==n?void 0:n.signal}),!0})}function Fe(e,t,n){return d(this,null,function*(){var o;try{return yield no(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Te.value.worker)}catch(go){return yield Ue(e,t,n)}})}function Ye(e,t,n){return d(this,null,function*(){var o;try{if(yield Fe(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(go){if("AbortError"===(null==go?void 0:go.name))throw go}let r=$e(e);if(r&&r.trim()&&r!==e)try{try{const l=yield oo(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Te.value.worker);l&&l.trim()&&(r=l)}catch(go){}if(yield Fe(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(go){if("AbortError"===(null==go?void 0:go.name))throw go}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&m.watch(()=>D.value,e=>{if(null==S||S.destroy(),S=null,!e)return void(L.value=!1);const t=E(e,{rootMargin:"400px"});S=t,L.value=t.isVisible.value,t.whenVisible.then(()=>{L.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==S||S.destroy(),S=null,le()});const We=m.computed(()=>U.value||Y.value||N.value);function Qe(e){if(!D.value||!_.value)return;const t=_.value.querySelector("svg");if(!t)return;let n=0,o=0;const r=t.getAttribute("viewBox"),l=t.getAttribute("width"),i=t.getAttribute("height");if(r){const e=r.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||l&&i&&(n=Number.parseFloat(l),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(go){return void console.error("Failed to get SVG BBox:",go)}if(n>0&&o>0){const t=o/n;let r=(null!=e?e:D.value.clientWidth)*t;r>o&&(r=o),ue.value=`${r}px`}}const Ke=m.ref(!1),Ve=m.computed(()=>({transform:`translate(${P.value}px, ${R.value}px) scale(${z.value})`}));function Xe(e){"Escape"===e.key&&Ke.value&&Ze()}function qe(){if(Ke.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(go){}if("undefined"!=typeof window)try{window.addEventListener("keydown",Xe)}catch(go){}m.nextTick(()=>{if(D.value&&j.value){const e=D.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(I.value=t,t.style.transform=Ve.value.transform),M(j.value),j.value.appendChild(e)}})}function Ze(){if(Ke.value=!1,j.value&&M(j.value),I.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(go){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",Xe)}catch(go){}}function Ge(){if(!U.value)return;if(!i.value)return;const e=A.value.length;e!==Q.value&&(K.value=!0,Q.value=e,J&&clearTimeout(J),J=setTimeout(()=>{K.value&&U.value&&A.value.trim()&&(K.value=!1,tt("preview"))},X.value))}function Je(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!D.value)return;const t=D.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-P.value)/z.value,a=(l-R.value)/z.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(z.value+u,.5),3);c!==z.value&&(P.value=r-i*c,R.value=l-a*c,z.value=c)}}function et(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);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(go){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function tt(e){return d(this,null,function*(){const t=B.value;if(!t)return F.value=!0,void(U.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",F.value=!0,U.value="source"===e,yield m.nextTick();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const r=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",l)};function l(){r()}t.addEventListener("transitionend",l),setTimeout(()=>r(),220)})}function nt(){return d(this,null,function*(){return Y.value?W.value:_.value||(yield m.nextTick(),_.value)?(Y.value=!0,W.value=(()=>d(this,null,function*(){var e,t;try{const t=yield C();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;de.value||fe.value||null==(e=t.initialize)||e.call(t,c(u({},s.value),{dompurifyConfig:u({},l)}));const o=O(r.isDark?"dark":"light"),i=yield Ae(()=>t.render(n,o),{timeoutMs:Te.value.fullRender}),a=null==i?void 0:i.svg;if(_.value){const e=k(_.value,a);de.value||fe.value||(Qe(),de.value=!0,be.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:ue.value});const t=r.isDark?"dark":"light";e&&(ve.value[t]=e),fe.value&&(fe.value=!1),ke.value=!1,ne=0,ae()}}catch(n){const e=ze(n),o=ne+1;e&&o<=3?(ne=o,se(Math.min(1200,600*o)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&console.warn("[markstream-vue2] Mermaid render timed out, retry scheduled:",o)):(ne=0,ae(),console.error("Failed to render mermaid diagram:",n),!1===r.loading&&Oe(n))}finally{Y.value=!1,W.value=null}}))(),W.value):void console.warn("Mermaid container not ready")})}function ot(e){return d(this,null,function*(){if(He()&&(_.value||(yield m.nextTick(),_.value))&&!Y.value){Y.value=!0;try{const t=yield C();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=r.isDark?"dark":"light",l=$e(e),i=Re(l&&l.trim()?l:e,o),a=yield Ae(()=>t.render(n,i),{timeoutMs:Te.value.render}),s=null==a?void 0:a.svg;_.value&&s&&(k(_.value,s),Qe())}catch(go){}finally{Y.value=!1}}})}function rt(){return d(this,null,function*(){var e,t;const n=Date.now(),o=++xe.value;Me&&Me.abort(),Me=new AbortController;const l=Me.signal,i=r.isDark?"dark":"light",a=A.value,s=a.replace(/\s+/g,"");if(!a.trim())return _.value&&M(_.value),ge.value=null,we.value="",void(ke.value=!1);if(s===we.value)return;try{const r=yield Ye(a,i,{signal:l,timeoutMs:Te.value.worker});if(r.fullOk)return yield nt(),void(xe.value===o&&(ge.value=null!=(t=null==(e=_.value)?void 0:e.innerHTML)?t:null,we.value=s,ke.value=!1));const u=Se&&n<=Se;if(r.prefixOk&&r.prefix&&He()&&!u)return void(yield ot(r.prefix))}catch(go){if("AbortError"===(null==go?void 0:go.name))return}if(xe.value!==o)return;if(ke.value)return;const u=ve.value[i];u&&_.value&&k(_.value,u)})}function lt(){je&&(je=!1,Ie=q.value,Le=!1,Ee&&(Ee.abort(),Ee=null),De&&(globalThis.clearTimeout(De),De=null),_e&&(Ne(_e),_e=null),Se=Date.now())}function it(){if(lt(),le(),Me){try{Me.abort()}catch(go){}Me=null}if(Ee){try{Ee.abort()}catch(go){}Ee=null}ro(),ae(),ne=0}function at(e=q.value){je&&(Be>=G.value?lt():(De&&globalThis.clearTimeout(De),De=globalThis.setTimeout(()=>{_e=oe(()=>d(this,null,function*(){if(!je)return;if(!re())return void lt();if(U.value||de.value)return void lt();const e=r.isDark?"dark":"light",t=A.value;if(!t.trim())return!1===r.loading?void lt():void at(Ie);if(Be++,Be>G.value)lt();else{Ee&&Ee.abort(),Ee=new AbortController;try{if((yield Fe(t,e,{signal:Ee.signal,timeoutMs:Te.value.worker}))&&(yield nt(),de.value))return void lt()}catch(go){}Ie=Math.min(Math.floor(1.5*Ie),Z.value),at(Ie)}}),{timeout:500})},e)))}function st(){je||i.value&&re()&&(U.value||de.value||(je=!0,Se=0,Le=!0,Be=0,Ie=q.value,at(Ie)))}m.watch(Ve,e=>{Ke.value&&I.value&&(I.value.style.transform=e.transform)},{immediate:!0}),m.watch(()=>A.value,()=>{de.value=!1,ve.value={},re()&&ie(),!U.value&&i.value&&re()?st():lt(),Ge()}),m.watch(()=>r.isDark,()=>d(this,null,function*(){if(!de.value)return;if(ke.value)return;const e=r.isDark?"dark":"light",t=ve.value[e];if(t)return void(_.value&&k(_.value,t));const n={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:ue.value},o=1!==z.value||0!==P.value||0!==R.value;fe.value=!0,o&&(z.value=1,P.value=0,R.value=0,yield m.nextTick()),yield nt(),o&&(yield m.nextTick(),z.value=n.zoom,P.value=n.translateX,R.value=n.translateY,ue.value=n.containerHeight,be.value=n)})),m.watch(()=>U.value,e=>d(this,null,function*(){if(e)lt(),de.value&&(be.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:ue.value});else{if(ke.value)return;const e=r.isDark?"dark":"light";if(de.value&&ve.value[e])return yield m.nextTick(),_.value&&k(_.value,ve.value[e]),z.value=be.value.zoom,P.value=be.value.translateX,R.value=be.value.translateY,void(ue.value=be.value.containerHeight);if(yield m.nextTick(),!i.value||!re())return;yield rt(),st()}})),m.watch(()=>r.loading,(e,t)=>d(this,null,function*(){if(!0===t&&!1===e){const e=A.value.trim();if(!e)return it();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(de.value&&o===we.value)return yield m.nextTick(),_.value&&!_.value.querySelector("svg")&&ve.value[t]&&k(_.value,ve.value[t]),void it();try{yield Fe(e,t,{timeoutMs:Te.value.worker}),yield nt(),we.value=o,ke.value=!1,it()}catch(n){it(),Oe(n)}}})),m.watch(D,e=>{ce&&ce.disconnect(),e&&(ce=new ResizeObserver(e=>{e&&e.length>0&&!U.value&&!N.value&&Xt(()=>{Qe(e[0].contentRect.width)})}),ce.observe(e))},{immediate:!0}),m.onMounted(()=>d(this,null,function*(){yield m.nextTick(),F.value||(U.value=!i.value),re()&&(ie(),Q.value=A.value.length)})),m.watch(()=>i.value,e=>{F.value||(U.value=!e)}),m.watch(()=>L.value,e=>{e&&(de.value||(ie(),Q.value=A.value.length),r.loading||de.value||ie(),!U.value&&i.value&&st())},{immediate:!1}),m.onUnmounted(()=>{J&&clearTimeout(J),le(),ce&&ce.disconnect(),Me&&(Me.abort(),Me=null),ro(),lt(),ae()}),m.watch(()=>N.value,e=>d(this,null,function*(){e?(lt(),Me&&Me.abort()):re()&&!de.value&&(yield m.nextTick(),ie(),U.value||st())}),{immediate:!1});const ut=m.computed(()=>r.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{__sfc:!0,props:r,emits:t,DOMPURIFY_CONFIG:l,mermaidAvailable:i,mermaidSecurityLevel:a,mermaidInitConfig:s,neutralizeScriptProtocols:p,DISALLOWED_STYLE_PATTERNS:f,SAFE_URL_PROTOCOLS:v,sanitizeUrl:g,scrubSvgElement:y,toSafeSvgElement:w,setSafeSvg:x,clearElement:M,renderSvgToTarget:k,t:b,resolveMermaidInstance:C,copyText:T,isCollapsed:N,mermaidContainer:D,mermaidContent:_,modalContent:j,modalCloneWrapper:I,registerViewport:E,viewportHandle:S,viewportReady:L,modeContainerRef:B,baseFixedCode:A,getCodeWithTheme:O,zoom:z,translateX:P,translateY:R,isDragging:H,dragStart:$,showSource:U,userToggledShowSource:F,isRendering:Y,renderQueue:W,lastContentLength:Q,isContentGenerating:K,renderDebounceDelay:V,contentStableDelay:X,previewPollInitialDelay:q,previewPollMaxDelay:Z,previewPollMaxAttempts:G,contentStableTimer:J,renderRetryTimer:ee,progressiveRenderDebounceTimer:te,consecutiveRenderTimeouts:ne,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:oe,canScheduleViewportWork:re,clearProgressiveRenderDebounceTimer:le,debouncedProgressiveRender:ie,clearRenderRetryTimer:ae,scheduleRenderRetry:se,containerHeight:ue,resizeObserver:ce,hasRenderedOnce:de,isThemeRendering:fe,svgCache:ve,lastSvgSnapshot:ge,lastRenderedCode:we,renderToken:xe,currentWorkController:Me,hasRenderError:ke,savedTransformState:be,wheelListeners:Ce,timeouts:Te,cancelIdle:Ne,previewPollTimeoutId:De,previewPollIdleId:_e,isPreviewPolling:je,previewPollDelay:Ie,previewPollController:Ee,lastPreviewStopAt:Se,allowPartialPreview:Le,previewPollAttempts:Be,withTimeoutSignal:Ae,renderErrorToContainer:Oe,isTimeoutError:ze,shouldSkipEventTarget:Pe,onBtnHover:function(e,t,n="top"){if(Pe(e.currentTarget))return;const o=e,l=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;pe(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){me()},onCopyHover:function(e){if(Pe(e.currentTarget))return;const t=T.value?b("common.copied")||"Copied":b("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;pe(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Re,canApplyPartialPreview:He,getSafePrefixCandidate:$e,canParseOnMain:Ue,canParseOffthread:Fe,canParseOrPrefix:Ye,isFullscreenDisabled:We,updateContainerHeight:Qe,isModalOpen:Ke,transformStyle:Ve,handleKeydown:Xe,openModal:qe,closeModal:Ze,checkContentStability:Ge,zoomIn:function(){z.value<3&&(z.value+=.1)},zoomOut:function(){z.value>.5&&(z.value-=.1)},resetZoom:function(){z.value=1,P.value=0,R.value=0},startDrag:function(e){H.value=!0,e instanceof MouseEvent?$.value={x:e.clientX-P.value,y:e.clientY-R.value}:$.value={x:e.touches[0].clientX-P.value,y:e.touches[0].clientY-R.value}},onDrag:function(e){if(!H.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),P.value=t-$.value.x,R.value=n-$.value.y},stopDrag:function(){H.value=!1},handleWheel:Je,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(A.value)),T.value=!0,t("copy",A.value),setTimeout(()=>{T.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:et,handleExportClick:function(){var e;const n=null==(e=_.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const o=(new XMLSerializer).serializeToString(n),r={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};t("export",r),r.defaultPrevented||et(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=_.value)?void 0:e.querySelector("svg"))?n:null,r=o?(new XMLSerializer).serializeToString(o):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:o,svgString:r};t("openModal",l),l.defaultPrevented||qe()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||tt(e)},switchMode:tt,initMermaid:nt,renderPartial:ot,progressiveRender:rt,stopPreviewPolling:lt,cleanupAfterLoadingSettled:it,scheduleNextPreviewPoll:at,startPreviewPolling:st,computedButtonStyle:ut,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:qt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}]},[n.props.showHeader?t("div",{staticClass:"mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center space-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.mermaidIconUrl,alt:"Mermaid"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Mermaid")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle&&n.mermaidAvailable?t("div",{staticClass:"flex items-center space-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center space-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"modeContainerRef"},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseFixedCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",e._g({ref:"mermaidContainer",staticClass:"min-h-[360px] relative overflow-hidden block transition-[height] duration-150 ease-out",class:n.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:n.containerHeight},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},n.wheelListeners),[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle,attrs:{"data-mermaid-wrapper":""}},[t("div",{ref:"mermaidContent",staticClass:"_mermaid w-full text-center flex items-center justify-center min-h-full"})])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"mermaid-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",e._g({ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},n.wheelListeners))])]):e._e()])],1)])],1)])])},[],!1,null,"483653b0",null,null).exports,io=k(m.defineComponent({name:"NestedRenderer",components:{MarkdownRender:yn},inheritAttrs:!1,props:{node:Object,nodes:Array,content:String,loading:Boolean,final:Boolean,cacheKey:String,parseOptions:Object,customHtmlTags:Array,customMarkdownIt:Function},setup(e){const t=m.getCurrentInstance(),n=m.computed(()=>{var t;return null!=e.final?e.final:"boolean"==typeof e.loading?!e.loading:"boolean"==typeof(null==(t=e.node)?void 0:t.loading)?!e.node.loading:void 0}),o=m.computed(()=>Qt({node:e.node,nodes:e.nodes,content:e.content},{cacheKey:e.cacheKey,final:n.value,parseOptions:e.parseOptions,customHtmlTags:e.customHtmlTags,customMarkdownIt:e.customMarkdownIt}));return{forwardedListeners:m.computed(()=>M(null==t?void 0:t.proxy)),resolvedFinal:n,resolvedNodes:o}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("MarkdownRender",e._g(e._b({attrs:{nodes:e.resolvedNodes,final:e.resolvedFinal,"custom-html-tags":e.customHtmlTags}},"MarkdownRender",e.$attrs,!1),e.forwardedListeners))},[],!1,null,null,null,null).exports,ao=k(m.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:null,content:null,placement:null,offset:null,originX:null,originY:null,id:null,isDark:{type:[Boolean,null]}},setup(e){const t=e,n=m.computed(()=>{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(go){}return!1}),o=m.ref(null),r=m.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=m.ref(!1);let i=null;function a(){return d(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[f.offset(null!=(e=t.offset)?e:8),f.flip(),f.shift({padding:8})],{x:i,y:a}=yield f.computePosition(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return m.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield m.nextTick(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield a();const n=r.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?(r.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield m.nextTick(),l.value=!0,yield m.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=f.autoUpdate(t.anchorEl,o.value,a)}catch(go){yield a(),l.value=!0,i=f.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),m.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield m.nextTick(),yield a())})),m.onBeforeUnmount(()=>{i&&i()}),{__sfc:!0,props:t,isDarkEffective:n,tooltip:o,style:r,ready:l,cleanupAutoUpdate:i,updatePosition:a,Portal:qt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"tooltip",appear:""}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible&&n.ready,expression:"visible && ready"}],ref:"tooltip",staticClass:"z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",class:[n.isDarkEffective?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"],style:{position:"fixed",left:n.style.left,top:n.style.top,transform:n.style.transform},attrs:{id:n.props.id,role:"tooltip"}},[e._v(" "+e._s(e.content)+" ")])])],1)])},[],!1,null,"703da293",null,null).exports,so=Object.freeze(Object.defineProperty({__proto__:null,default:ao},Symbol.toStringTag,{value:"Module"}));function uo(e){return JSON.stringify(e)}function co(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=uo(u({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=uo(o),a=r?uo(r):'""';return"module"===n?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function po(e){return JSON.stringify(e)}function mo(e){var t;const n=null!=(t=e.mode)?t:"module",o=po(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${po(u({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===n?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function fo(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const ho={AdmonitionNode:at,BlockquoteNode:lt,CheckboxNode:b,CodeBlockNode:ln,DefinitionListNode:C,EmojiNode:T,EmphasisNode:Ye,FootnoteNode:Qe,FootnoteReferenceNode:E,FootnoteAnchorNode:We,HardBreakNode:Ke,HeadingNode:Ve,HtmlBlockNode:Ze,HtmlInlineNode:q,HighlightNode:Fe,ImageNode:we,D2BlockNode:dn,InlineCodeNode:Z,PreCodeNode:Je,InsertNode:Ue,LinkNode:$e,ListItemNode:Xe,ListNode:qe,MarkdownCodeBlockNode:vn,MathBlockNode:Rn,MathInlineNode:Hn,MermaidBlockNode:lo,NestedRenderer:io,InfographicBlockNode:hn,ParagraphNode:Ge,StrikethroughNode:He,StrongNode:Re,SubscriptNode:Pe,SuperscriptNode:ze,TableNode:et,TextNode:Se,ThematicBreakNode:tt,VmrContainerNode:ot,ReferenceNode:Oe},vo={install(e,t){!function(e){const t=fo(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=fo(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(go){}}})}(e),Object.entries(ho).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",yn),e.component("NodeRenderer",yn),(null==t?void 0:t.getLanguageIcon)&&kt(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&p.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>p.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>p.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>p.setDefaultMathOptions}),exports.AdmonitionNode=at,exports.BlockquoteNode=lt,exports.CheckboxNode=b,exports.CodeBlockNode=ln,exports.D2BlockNode=dn,exports.DefinitionListNode=C,exports.EmojiNode=T,exports.EmphasisNode=Ye,exports.FootnoteAnchorNode=We,exports.FootnoteNode=Qe,exports.FootnoteReferenceNode=E,exports.HardBreakNode=Ke,exports.HeadingNode=Ve,exports.HighlightNode=Fe,exports.HtmlBlockNode=Ze,exports.HtmlInlineNode=q,exports.ImageNode=we,exports.InfographicBlockNode=hn,exports.InlineCodeNode=Z,exports.InsertNode=Ue,exports.LinkNode=$e,exports.ListItemNode=Xe,exports.ListNode=qe,exports.MERMAID_DISABLED_CODE=eo,exports.MERMAID_WORKER_BUSY_CODE=Jn,exports.MarkdownCodeBlockNode=vn,exports.MarkdownRender=yn,exports.MathBlockNode=Rn,exports.MathInlineNode=Hn,exports.MermaidBlockNode=lo,exports.NestedRenderer=io,exports.ParagraphNode=Ge,exports.PreCodeNode=Je,exports.ReferenceNode=Oe,exports.StrikethroughNode=He,exports.StrongNode=Re,exports.SubscriptNode=Pe,exports.SuperscriptNode=ze,exports.TableNode=et,exports.TextNode=Se,exports.ThematicBreakNode=tt,exports.Tooltip=ao,exports.VmrContainerNode=ot,exports.VueRendererMarkdown=vo,exports.WORKER_BUSY_CODE=An,exports.buildKaTeXCDNWorkerSource=co,exports.buildMermaidCDNWorkerSource=mo,exports.canParseOffthread=no,exports.clearGlobalCustomComponents=function(){delete _.scopedCustomComponents[N],j.value++},exports.clearKaTeXWorker=function(){var e;bn&&(null==(e=bn.terminate)||e.call(bn)),bn=null,Cn=null},exports.clearMermaidWorker=function(){var e;if(Vn)try{for(const[e,t]of qn.entries())t.reject(new Error("Worker cleared"));qn.clear(),null==(e=Vn.terminate)||e.call(Vn)}catch(go){}Vn=null,Xn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=co(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"classic")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(go){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(go){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=mo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"module")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(go){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(go){}}},source:o}},exports.default=yn,exports.disableD2=function(){cn(null)},exports.disableKatex=function(){Ne(null)},exports.disableMermaid=function(){Yn(null)},exports.enableD2=function(e){cn(null!=e?e:an)},exports.enableKatex=function(e){Ne(null!=e?e:Te)},exports.enableMermaid=function(e){Yn(null!=e?e:$n)},exports.findPrefixOffthread=oo,exports.getCustomNodeComponents=I,exports.getKaTeXBackpressureDefaults=function(){return u({},zn)},exports.getKaTeXWorkerLoad=function(){return{inFlight:Nn.size,max:_n}},exports.getLanguageIcon=Tt,exports.getMermaidWorkerLoad=function(){return{inFlight:qn.size,max:Zn}},exports.getUseMonaco=dt,exports.isD2Enabled=function(){return"function"==typeof un},exports.isKaTeXWorkerBusy=function(){return Nn.size>=_n},exports.isKatexEnabled=De,exports.isMermaidEnabled=Wn,exports.languageIconsRevision=yt,exports.languageMap=Nt,exports.normalizeLanguageIdentifier=bt,exports.parseNestedMarkdownToNodes=Qt,exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield Mt()})},exports.removeCustomComponents=function(e){if(e===N)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete _.scopedCustomComponents[e],j.value++},exports.renderKaTeXInWorker=Ln,exports.renderKaTeXWithBackpressure=Pn,exports.renderMarkdownNodeToHtml=function(e,t={}){return Et(e,jt(t))},exports.renderMarkdownNodesToHtml=function(e,t={}){return It(e,jt(t))},exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return It(e.nodes,t);const n=e.node;if(n){const e=Pt(n.children);if(e.length>0)return It(e,t);const o=Rt(n.content);if(o)return At(o,t);if(null!=n.raw)return Ft(Rt(n.raw))}return e.content?At(Rt(e.content),t):""}(e,jt(t))},exports.resolveMonacoLanguageId=Ct,exports.setCustomComponents=function(e,t){"string"==typeof e?_.scopedCustomComponents[e]=t||{}:_.scopedCustomComponents[N]=e||{},j.value++},exports.setD2Loader=cn,exports.setDefaultI18nMap=function(e){Object.assign(fe,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(zn.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(zn.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(zn.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(zn.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=Bn,exports.setKaTeXWorker=function(e){bn=e,Cn=null,bn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=Nn.get(t);if(r)if(Nn.delete(t),clearTimeout(r.timeoutId),In(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Dn.set(e,n),Dn.size>200){const e=Dn.keys().next().value;Dn.delete(e)}}r.resolve(n)}},bn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of Nn.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));Nn.clear(),In()}},exports.setKaTeXWorkerDebug=function(e){Tn=!!e,bn&&bn.postMessage({type:"init",debug:Tn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(_n=Math.floor(e))},exports.setKatexLoader=Ne,exports.setLanguageIconResolver=kt,exports.setMermaidLoader=Yn,exports.setMermaidWorker=function(e){Vn=e,Xn=null;const t=e;Vn.onmessage=e=>{if(Vn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=qn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Vn.onerror=e=>{var n,o;if(Vn===t)if(0!==qn.size){try{Gn?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[t,n]of qn.entries())n.reject(new Error(`Worker error: ${e.message}`));qn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Vn.onmessageerror=e=>{var n,o;if(Vn===t)if(0!==qn.size){try{Gn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(go){}for(const[e,t]of qn.entries())t.reject(new Error("Worker messageerror"));qn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Gn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Zn=Math.floor(e))},exports.terminateWorker=ro,exports.waitForKaTeXWorkerSlot=On,Object.keys(p).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>p[e]})});
|