markstream-vue2 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +231 -330
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +1 -1
- package/dist/types/components/HeadingNode/HeadingNode.vue.d.ts +1 -1
- package/dist/types/components/ImageNode/ImageNode.vue.d.ts +3 -2
- package/dist/types/components/ParagraphNode/ParagraphNode.vue.d.ts +1 -1
- package/dist/types/components/SoftBreakNode/SoftBreakNode.vue.d.ts +17 -0
- package/dist/types/components/SoftBreakNode/index.d.ts +2 -0
- package/dist/types/exports.d.ts +2 -1
- package/dist/types/types/component-props.d.ts +1 -0
- package/dist/types/types/index.d.ts +5 -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 v="undefined"!=typeof document?document.currentScript:null;function h(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=h(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 k(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 M(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=M(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=M(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=M(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 S=M(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,E=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 E?E(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,R=new Set(["script"]),P=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 V(e){return e.trim().length>0}function K(e,t,n,o,a){if(R.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)||P.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 Q(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);V(t)&&r.push({type:"text",content:t})}break}if(i>l){const t=e.slice(l,i);V(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=M(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?Q(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;function Z({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}const G=M(m.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>{var e,t;return null!=(t=null==(e=null==n?void 0:n.proxy)?void 0:e.$attrs)?t:{}}),r=m.inject("markstreamTypewriter",void 0),l=m.inject("markstreamTextStreamState",void 0),i=m.computed(()=>{const e=o.value.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),a=m.computed(()=>"boolean"==typeof i.value?i.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),s=m.computed(()=>{var e;const t=null!=(e=o.value["index-key"])?e:o.value.indexKey;return null==t||""===t?"":String(t)}),u=m.ref(t.node.code),c=m.ref(""),d=m.ref(0);function p(){return u.value+c.value}function f(e){u.value=e,c.value=""}m.watch([()=>t.node.code,s,a],([e])=>{const t=String(null!=e?e:""),n=p(),o=s.value,r=o?null==l?void 0:l.get(o):void 0,i=Z({nextContent:t,previousContent:null!=r?r:n,typewriterEnabled:a.value});u.value=i.settledContent,c.value=i.streamedDelta,i.appended&&(d.value+=1),o&&(null==l||l.set(o,t))},{immediate:!0}),m.watch(a,e=>{e||f(p())});const v=m.computed(()=>d.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return{__sfc:!0,props:t,instance:n,attrs:o,inheritedTypewriter:r,inheritedTextStreamState:l,explicitTypewriter:i,typewriterEnabled:a,streamStateKey:s,settledCode:u,streamedDelta:c,streamFadeVersion:d,getRenderedContent:p,setFullContent:f,settleStreamedDelta:function(){c.value&&(u.value=p(),c.value="")},streamedDeltaClass:v}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return 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-['']"},[n.settledCode?t("span",[e._v(e._s(n.settledCode))]):e._e(),n.streamedDelta?t("span",{staticClass:"inline-code-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"38cc3b9f",null,null).exports,J=m.ref(!1),ee=m.ref(""),te=m.ref("top"),ne=m.ref(null),oe=m.ref(null),re=m.ref(null),le=m.ref(null),ie=m.ref(null);let ae=null,se=null;function ue(){ae&&(clearTimeout(ae),ae=null),se&&(clearTimeout(se),se=null)}let ce=!1,de=null;function pe(){return ce||"undefined"==typeof document?Promise.resolve():de||(de=Promise.resolve().then(()=>so).then(e=>{var t;ce=!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:J.value,anchorEl:ne.value,content:ee.value,placement:te.value,id:oe.value,originX:re.value,originY:le.value,isDark:null!=(t=ie.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{de=null,ce=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),de)}function me(e,t,n="top",o=!1,r,l){if(!e)return;pe(),ue();const i=()=>{var o,i;oe.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,ne.value=e,ee.value=t,te.value=n,re.value=null!=(o=null==r?void 0:r.x)?o:null,le.value=null!=(i=null==r?void 0:r.y)?i:null,ie.value="boolean"==typeof l?l:null,J.value=!0;try{e.setAttribute("aria-describedby",oe.value)}catch(a){}};o?i():ae=setTimeout(i,80)}function fe(e=!1){ue();const t=()=>{if(ne.value&&oe.value)try{ne.value.removeAttribute("aria-describedby")}catch(e){}J.value=!1,ne.value=null,oe.value=null,re.value=null,le.value=null};e?t():se=setTimeout(t,120)}const ve={"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=ve[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 ge=Symbol("ViewportPriority");function ye(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(ge,a),a}function we(){const e=m.inject(ge,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 xe=M(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=we();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 ke=null,Me=!1,be=Ne;function Ce(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function Te(){try{const e=globalThis;return Ce(null==e?void 0:e.katex)}catch(e){return null}}function Ne(){return(()=>d(this,null,function*(){const e=Te();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return Ce(t)}))()}function De(e){be=e,ke=null,Me=!1}function _e(){return"function"==typeof be}function je(){return d(this,null,function*(){var e;const t=Te();if(t)return ke=t,ke;if(ke)return ke;if(Me)return null;const n=be;if(!n)return Me=!0,null;try{const t=yield n();if(t)return ke=null!=(e=Ce(t))?e:t,ke}catch(o){}return Me=!0,null})}const Ie=m.shallowRef(!1);let Se=null;const Ee=M(m.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e,n=(Se||(Se=je().then(e=>{Ie.value=!!e}).catch(()=>{Ie.value=!1})),m.readonly(Ie)),o=m.getCurrentInstance(),r=m.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=m.inject("markstreamTypewriter",void 0),i=m.inject("markstreamTextStreamState",void 0),a=m.inject("markstreamStreamVersion",void 0),s=m.computed(()=>{const e=r.value.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),u=m.computed(()=>"boolean"==typeof s.value?s.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=m.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),d=m.ref(t.node.content),p=m.ref(""),f=m.ref(0);function v(){return d.value+p.value}function h(e){d.value=e,p.value=""}function g(){p.value&&(d.value=v(),p.value="")}m.watch([()=>t.node.content,c,u,()=>null==a?void 0:a.value],([e])=>{const t=String(null!=e?e:""),n=v(),o=c.value,r=o?null==i?void 0:i.get(o):void 0,l=null!=r?r:n;if(!u.value)return h(t),void(o&&(null==i||i.set(o,t)));if(t===l)return p.value?g():n!==t&&h(t),void(o&&(null==i||i.set(o,t)));const a=Z({nextContent:t,previousContent:l,typewriterEnabled:u.value});d.value=a.settledContent,p.value=a.streamedDelta,a.appended&&(f.value+=1),o&&(null==i||i.set(o,t))},{immediate:!0}),m.watch(u,e=>{e||h(v())});const y=m.computed(()=>f.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return{__sfc:!0,props:t,katexReady:n,instance:o,attrs:r,inheritedTypewriter:l,inheritedTextStreamState:i,inheritedStreamVersion:a,explicitTypewriter:s,typewriterEnabled:u,streamStateKey:c,settledContent:d,streamedDelta:p,streamFadeVersion:f,getRenderedContent:v,setFullContent:h,settleStreamedDelta:g,streamedDeltaClass:y}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&e.node.center?"text-node-center":""]},[n.settledContent?t("span",[e._v(e._s(n.settledContent))]):e._e(),n.streamedDelta?t("span",{staticClass:"text-node-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"356c331b",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 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 je()){const e=yield Promise.resolve().then(()=>require("./chunks/index-c6f74f2d.cjs"));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 je()){const t=yield Promise.resolve().then(()=>require("./chunks/index-e1315bc2.cjs"));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=M(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=M(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:G,link:$e,html_inline:q,strong:Pe,emphasis:Ye,footnote_reference:S,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,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,Re=M(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:G,link:$e,html_inline:q,strong:Pe,emphasis:Ye,footnote_reference:S,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,Pe=M(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:G,link:$e,html_inline:q,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,superscript:ze,emoji:T,footnote_reference:S,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=M(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:G,link:$e,html_inline:q,strong:Pe,emphasis:Ye,highlight:Fe,insert:Ue,subscript:Re,superscript:ze,emoji:T,footnote_reference:S,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=M(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",s=null!=(e=t.animationOpacity)?e:.35,u=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(n=t.color)?n:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(u),"--underline-duration":`${null!=(r=t.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),c={text:Ee,strong:Pe,strikethrough:He,emphasis:Ye,image:xe,html_inline:q},d=m.useAttrs(),p=m.ref(null),f=m.ref(!1),v=m.computed(()=>{const e=u({},d);return delete e.title,e});function h(){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,me(p.value,h(),"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&&pe(),m.nextTick(()=>{y()})}),m.onUpdated(()=>{y()}),m.onBeforeUnmount(()=>{a(),f.value&&(f.value=!1,fe(!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:v,getTooltipText:h,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;me(p.value||e.currentTarget,h(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(f.value=!1,fe())},title:w,TextNode:Ee}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return n.node.loading?o("span",n._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:r.cssVars,attrs:{"aria-hidden":n.node.loading?"false":"true"}},"span",r.attrs,!1),[o("span",{staticClass:"link-text-wrapper relative inline-flex"},[o("span",{staticClass:"leading-[normal] link-text"},[o(r.TextNode,{staticClass:"leading-[normal] link-text",attrs:{node:{type:"text",content:String(null!=(e=n.node.text)?e:""),raw:String(null!=(t=n.node.text)?t:"")},"index-key":`${n.indexKey||"link-text"}-loading`}})],1),o("span",{staticClass:"link-loading-indicator",attrs:{"aria-hidden":"true"}})])]):o("a",n._b({ref:"anchorEl",staticClass:"link-node",style:r.cssVars,attrs:{href:n.node.href,title:n.showTooltip?"":r.title,"aria-label":`Link: ${r.title}`,"aria-hidden":n.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},on:{mouseenter:e=>r.onAnchorEnter(e),mouseleave:r.onAnchorLeave}},"a",r.anchorAttrs,!1),n._l(n.node.children,function(e,t){return o(r.nodeComponents[e.type],{key:`${n.indexKey||"emphasis"}-${t}`,tag:"component",attrs:{node:e,"custom-id":r.props.customId,"index-key":`${n.indexKey||"link-text"}-${t}`}})}),1)},[],!1,null,"535a598a",null,null).exports,Ue=M(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:G,link:$e,html_inline:q,strong:Pe,emphasis:Ye,strikethrough:He,highlight:Fe,subscript:Re,superscript:ze,emoji:T,footnote_reference:S,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=M(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:G,link:$e,html_inline:q,strong:Pe,emphasis:Ye,strikethrough:He,insert:Ue,subscript:Re,superscript:ze,emoji:T,footnote_reference:S,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=M(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:G,link:$e,html_inline:q,strong:Pe,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,superscript:ze,emoji:T,footnote_reference:S,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=M(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,Ve=M(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=M(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,Qe=M(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:G,link:$e,image:xe,strong:Pe,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,superscript:ze,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:S,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=M(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=M(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=M(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?Q(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=we();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=M(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:G,image:xe,link:$e,hardbreak:Ke,emphasis:Ye,strong:Pe,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,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:S,text:Ee},n)}}}),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(n.nodeComponents[o.type],{key:`${e.indexKey||"paragraph"}-${r}`,tag:"component",attrs:{node:o,"index-key":`${null!=(l=e.indexKey)?l:"paragraph"}-${r}`,"custom-id":n.props.customId}})}),1)},[],!1,null,"0d09b107",null,null).exports,Je=M(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=M(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=M(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=M(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=M(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:Ge,heading:Qe,inline_code:G,link:$e,image:xe,strong:Pe,emphasis:Ye,strikethrough:He,insert:Ue,subscript:Re,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=M(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},customHtmlTags:null},emits:["copy","handleArtifactClick"],setup(e,{emit:t}){const n=e,o={text:Ee,paragraph:Ge,heading:Qe,code_block:Je,list:qe,list_item:Xe,blockquote:lt,table:et,definition_list:C,footnote:Ve,footnote_reference:S,footnote_anchor:We,admonition:at,vmr_container:ot,hardbreak:Ke,link:$e,image:xe,thematic_break:tt,math_inline:Be,math_block:Ae,strong:Pe,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,superscript:ze,emoji:T,checkbox:b,checkbox_input:b,inline_code:G,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}:{})),d=m.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),p=m.computed(()=>{var e;const t=null!=(e=n.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),f=m.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n;let i=e;const a=g(i),s=String((null==i?void 0:i.type)||"unknown");let d=y(i,a);if(("html_block"===i.type||"html_inline"===i.type)&&d===o[i.type]){const e=String(null!=(n=i.tag)?n:"").trim().toLowerCase()||v(i.content);if(e&&p.value.has(e)){const t=r.value[e];t&&(d=t,i=c(u({},i),{type:e,tag:e,content:h(i.content,e)}))}}return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===s?`${l.value}-${t}-${s}`:`${l.value}-${t}-${s}-${String((null==e?void 0:e.raw)||"").length}`,node:i,isCodeBlock:"code_block"===(null==i?void 0:i.type),component:d,bindings:w(i,a)}}));function v(e){const t=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return t?t[1].toLowerCase():""}function h(e,t){const n=String(null!=e?e:"");if(!t)return n;const o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(r,"").replace(l,"")}function g(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function y(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:g(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 w(e,t){const n=null!=t?t:g(e);return"mermaid"===n||"infographic"===n||"d2"===n||"d2lang"===n?{}:"link"===e.type?s.value:"list"===e.type?d.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:d,effectiveCustomHtmlTagsSet:p,renderedItems:f,getHtmlTagFromContent:v,stripCustomHtmlWrapper:h,getCodeBlockLanguage:g,getNodeComponent:y,getBindingsFor:w,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=M(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=M(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,h=m.getCurrentInstance(),g=m.computed(()=>l.debugPerformance&&f&&"undefined"!=typeof console),y=m.computed(()=>{var e,t;return null!=(t=null==(e=null==h?void 0:h.proxy)?void 0:e.$attrs)?t:{}}),x=new Map,k=m.ref(0),M=m.computed(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const t=null!=(e=y.value.showTooltips)?e:y.value["show-tooltips"];return""===t||!0===t||"true"===t||!1!==t&&"false"!==t&&void 0});function N(e,t){g.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function D(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}m.provide("markstreamShowTooltips",M),m.provide("markstreamTypewriter",m.computed(()=>!1!==l.typewriter)),m.provide("markstreamTextStreamState",x),m.provide("markstreamStreamVersion",k),m.watch([()=>l.content,()=>l.nodes],()=>{k.value+=1},{immediate:!0});const _=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,E=p.getMarkdown(_),L=new Map,B=m.markRaw([]),A=m.computed(()=>{const{key:e,tags:t}=R(l.customHtmlTags);if(!e)return E;const n=L.get(e);if(n)return n;const o=p.getMarkdown(_,{customHtmlTags:t});return L.set(e,o),o}),O=m.computed(()=>{const e=A.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function z(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 R(e){if(!e||0===e.length)return{key:"",tags:[]};const t=new Set,n=[];for(const o of e){const e=z(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return 0===n.length?{key:"",tags:[]}:{key:n.join(","),tags:n}}function P(e){if(Array.isArray(e))return Object.freeze(e.map(e=>P(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=P(o);return Object.freeze(t)}function H(e){return e.map(e=>P(e))}const $=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(z).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}),U=m.computed(()=>{var e;const t=null!=(e=$.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),F=m.computed(()=>{var e;if(w(null==h?void 0:h.proxy)&&!l.content&&Array.isArray(l.nodes))return B;if(null==(e=l.nodes)?void 0:e.length)return m.markRaw(H(l.nodes));if(l.content){const e=g.value?performance.now():0,t=p.parseMarkdownToStructure(l.content,O.value,$.value);return g.value&&N("parse(sync)",{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:l.content.length}),m.markRaw(H(t))}return[]}),Y=m.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),W=m.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&F.value.length>Y.value}),V=m.computed(()=>!1!==l.viewportPriority&&!a.value),K=ye(e=>{var t;return D(null!=(t=null!=e?e:i.value)?t:null)},V),Q=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,X=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,Z="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),J=f&&"function"==typeof window.requestIdleCallback,ee=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),te=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:ee.value);return Number.isFinite(t)?Math.max(0,t):ee.value}),ne=m.computed(()=>!1!==l.batchRendering&&ee.value>0&&f&&!Z),oe=m.ref(0),re=m.ref({key:l.indexKey,total:0}),le=m.ref(Math.max(1,ee.value||1)),ie=m.reactive({}),ae=new Map,se=new Map,ue=new Map,ce=new WeakMap,de=m.ref(0),pe=m.computed(()=>(de.value,Array.from(ue.entries()).sort((e,t)=>e[0]-t[0]))),me=m.ref(null);let fe=null,ve=null;const he=m.reactive({start:0,end:0}),ge=m.computed(()=>{if(!W.value)return F.value.map((e,t)=>({node:e,index:t}));const e=F.value.length,t=ht(he.start,0,e),n=ht(he.end,t,e);return F.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),we=m.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!W.value&&!(F.value.length>900)&&V.value}),ke=m.computed(()=>{var e;return ne.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Me=m.ref({batchSize:ee.value,initial:te.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:ke.value}),be=m.computed(()=>!!K&&(we.value||W.value)),Ce=m.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),Te=m.ref(0),Ne=new Map,De=m.computed(()=>w(null==h?void 0:h.proxy)),_e=m.computed(()=>De.value&&!l.content&&Array.isArray(l.nodes)),je=m.computed(()=>_e.value?m.markRaw(H(l.nodes||[])):B);function Ie(){var e,t;const n=null==h?void 0:h.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of ge.value){const n=Se(o[`node-slot-${l.index}`]),i=Se(o[`node-content-${l.index}`]);(null!=(e=ue.get(l.index))?e:null)!==n&&Pt(l.index,n),(null!=(t=Ne.get(l.index))?t:null)!==i&&$t(l.index,i),r.add(l.index)}for(const l of Array.from(ue.keys()))r.has(l)||Pt(l,null);for(const l of Array.from(Ne.keys()))r.has(l)||$t(l,null)}function Se(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const Le=m.computed(()=>{if(!W.value)return F.value.length;const e=Ce.value,t=Math.max(he.end+e,te.value),n=Math.min(F.value.length,t);return Math.max(oe.value,n)});function it(e){var t,n,o,r;const l=D(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 st(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 ut(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(!st(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 ct(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 dt(){fe&&(fe(),fe=null),me.value=null}function pt(){if(!f||!W.value)return;const e=it();if(!e||me.value===e)return;dt();const t=()=>ft();e.addEventListener("scroll",t,{passive:!0}),me.value=e,fe=()=>{e.removeEventListener("scroll",t)}}function mt(){var e,t,n;if(!ve)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;ve.viaTimeout?o?o.clearTimeout(ve.id):clearTimeout(ve.id):null==X||X(ve.id),ve=null}function ft(e={}){var t,n,o;if(!W.value)return;if(!f)return void vt(!0);if(e.immediate)return mt(),void vt(!0);if(ve)return;const r=()=>{ve=null,vt()};if(Q)ve={id:Q(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);ve={id:l,viaTimeout:!0}}}function vt(e=!1){var t,n,o,r,l,a,s;if(!W.value)return;const u=me.value||it();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=F.value.length;if(!p&&m>0&&st(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=ht(At(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,m-1));return void((e||Math.abs(r-Te.value)>1)&&(Te.value=r))}const f=p?null:u.getBoundingClientRect(),v=p?0:f.top,h=p?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=pe.value;let y=null,w=null;for(const[i,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=v||e.top>=h||(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=ut(u,c,p),o=p?(()=>{const n=e.getBoundingClientRect(),o=(p?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=ct(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=Bt(o+.5*Math.max(0,m));return void(Te.value=ht(f,0,Math.max(0,F.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-Te.value)<=1||(Te.value=ht(x,0,Math.max(0,F.value.length-1)))}function ht(e,t,n){return Math.min(Math.max(e,t),n)}function gt(){const e=F.value.length;if(!W.value||0===e)return he.start=0,void(he.end=e);const t=Math.min(Y.value,e),n=Ce.value,o=ht(Te.value-n,0,Math.max(0,e-t));he.start=o,he.end=Math.min(e,o+t)}const yt=m.reactive({}),wt=m.reactive({total:0,count:0}),xt=m.ref(0),kt=m.ref([]),Mt=m.ref([]);function bt(){for(const e of Object.keys(yt))delete yt[Number(e)];wt.total=0,wt.count=0,xt.value=0,kt.value=[],Mt.value=[]}function Ct(e){if(e<=0)return void bt();let t=0,n=0;for(const[o,r]of Object.entries(yt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete yt[l]:(t+=i,n++)}wt.total=t,wt.count=n}function Tt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Nt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function Dt(e,t,n){if(n<=t)return 0;const o=Nt(e,n-1);return t<=0?o:o-Nt(e,t-1)}function _t(e){xt.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(yt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(Tt(t,l,i),Tt(n,l,1))}kt.value=t,Mt.value=n}function jt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=yt[e];if(yt[e]=t,n?wt.total+=t-n:(wt.total+=t,wt.count++),xt.value>e){const o=kt.value,r=Mt.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&Tt(o,e,r)}else Tt(o,e,t),Tt(r,e,1)}}const It=m.computed(()=>wt.count>0?Math.max(12,wt.total/wt.count):32);function St(e,t){var n,o;if(e>=t)return 0;if(xt.value!==F.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=yt[r])?n:It.value;return o}const r=kt.value,l=Mt.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=yt[r])?o:It.value;return n}return Dt(r,e,t)+(t-e-Dt(l,e,t))*It.value}m.watch(()=>F.value.length,e=>{e<=0?bt():(e<xt.value&&Ct(e),e!==xt.value&&_t(e))},{immediate:!0});const Et=m.computed(()=>W.value?St(0,Math.min(he.start,F.value.length)):0),Lt=m.computed(()=>{if(!W.value)return 0;const e=F.value.length;return St(Math.min(he.end,e),e)});function Bt(e){var t;if(e<=0)return 0;const n=F.value;if(xt.value===n.length&&kt.value.length&&Mt.value.length){const t=It.value,o=kt.value,r=Mt.value,l=e=>e<=0?0:Nt(o,e-1)+(e-Nt(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=yt[r])?t:It.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function At(e){var t;const n=F.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(xt.value===n.length){const t=St(0,n.length);return Bt(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=yt[r])?t:It.value;if(o<=e)return r;o-=e}return 0}function Ot(e){if(!ae.size)return;if(!W.value)return;let t=!1;for(const[n,o]of ae)n>=e&&(o.destroy(),ae.delete(n),we.value&&delete ie[n],Qt(n),ue.delete(n)&&(t=!0));t&&Ht()}function zt(e,t){we.value&&(ie[e]=t),t&&(W.value?ft():Te.value=ht(e,0,Math.max(0,F.value.length-1)))}function Rt(e){const t=ae.get(e);t&&(t.destroy(),ae.delete(e)),Qt(e)}function Pt(e,t){let n=!1;if(t){const o=ue.get(e);ue.set(e,t),o!==t&&(n=!0)}else ue.delete(e)&&(n=!0);if(n&&Ht(),t||Qt(e),!be.value||!K)return Rt(e),void(t?zt(e,!0):we.value&&delete ie[e]);if(!W.value&&we.value&&!a.value&&ae.size>=640&&(qt("too-many-targets"),!be.value||!K))return Rt(e),void(t?zt(e,!0):we.value&&delete ie[e]);if(e<te.value&&!W.value)return Rt(e),void zt(e,!0);if(!t)return Rt(e),void(we.value&&delete ie[e]);Rt(e);const o=K(t,{rootMargin:"400px"});o&&(ae.set(e,o),zt(e,o.isVisible.value),we.value&&Xt(e),o.whenVisible.then(()=>{Qt(e),zt(e,!0)}).catch(()=>{}).finally(()=>{ae.get(e)===o&&ae.delete(e);try{o.destroy()}catch(t){}}),W.value&&ft())}function Ht(){de.value+=1}function $t(e,t){t?(Ne.set(e,t),queueMicrotask(()=>{jt(e,t.offsetHeight)})):Ne.delete(e)}m.onMounted(()=>{f&&m.nextTick(Ie)}),m.watch(ge,()=>{f&&m.nextTick(Ie)}),m.watch(oe,()=>{f&&m.nextTick(Ie)}),m.watch(W,()=>{f&&m.nextTick(Ie)});let Ut=null,Ft=null,Yt=!1,Wt=null,Vt=null;function Kt(){f&&(null!=Ut&&(null==X||X(Ut),Ut=null),null!=Ft&&(window.clearTimeout(Ft),Ft=null),null!=Vt&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Vt),Vt=null),Yt=!1,Wt=null)}function Qt(e){if(!f)return;const t=se.get(e);null!=t&&(window.clearTimeout(t),se.delete(e))}function Xt(e){if(!f||!we.value)return;Qt(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(se.delete(e),!we.value)return;if(!0===ie[e])return;const o=ue.get(e);if(!o)return void delete ie[e];const r=it(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&&zt(e,!0)},1800+t);se.set(e,n)}function qt(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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 ae.values())e.destroy();if(ae.clear(),f)for(const e of se.values())window.clearTimeout(e);se.clear();for(const e of Object.keys(ie))delete ie[e]}}function Zt(e,t={}){var n,o;if(!ke.value)return;const r=Le.value;if(oe.value>=r)return;const i=Math.max(1,e),a=e=>{var t;Ut=null,Ft=null,Vt=null,Yt=!1;const n=null!=Wt?Wt:i;Wt=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();oe.value=Math.min(r,oe.value+Math.max(1,e)),Ot(oe.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return Jt(n),n};let s=n;for(;(a(s),!(oe.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(le.value));oe.value<r&&Gt()};if(!f||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(Wt=null!=Wt?Math.max(Wt,i):i,!Yt){if(Yt=!0,!Z&&J&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(Vt=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}Q&&!Z?Ut=Q(()=>{0!==s?Ft=window.setTimeout(()=>a(),s):a()}):Ft=window.setTimeout(()=>a(),s)}}function Gt(){ke.value&&Zt(ne.value?Math.max(1,Math.round(le.value)):Math.max(1,ee.value))}function Jt(e){var t;if(!ke.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,ee.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?le.value=Math.max(r,Math.floor(.7*le.value)):e<.5*n&&le.value<o&&(le.value=Math.min(o,Math.ceil(1.2*le.value)))}function en(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-b8d5777d.cjs"));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 tn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-91325ae4.cjs"));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 nn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-8693b3db.cjs"));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 on(){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([()=>F.value,()=>F.value.length,()=>ke.value,()=>ee.value,()=>te.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=F.value.length,n=re.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;re.value={key:o,total:t};const s=Me.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==ee.value||s.initial!==te.value||s.delay!==u||s.enabled!==ke.value;Me.value={batchSize:ee.value,initial:te.value,delay:u,enabled:ke.value},(a||c||!ke.value)&&Kt(),(a||c)&&(le.value=Math.max(1,ee.value||1)),a&&W.value&&ft({immediate:!0});const d=Le.value;if(!t)return 0!==oe.value&&(oe.value=0),void Ot(0);if(!ke.value)return oe.value!==d&&(oe.value=d),void Ot(oe.value);if(r||0===n.total||c){const e=Math.min(d,te.value);oe.value!==e&&(oe.value=e)}else{const e=Math.min(oe.value,d);oe.value!==e&&(oe.value=e)}const p=Math.max(1,te.value||ee.value||t);oe.value<d?Zt(p,{immediate:!f}):Ot(oe.value)},{immediate:!0}),m.watch(()=>W.value,e=>{if(!e)return dt(),void mt();pt(),ft({immediate:!0})},{immediate:!0}),m.watch([()=>F.value.length,()=>W.value],e=>d(this,[e],function*([e,t]){t&&e&&f&&(yield m.nextTick(),ft({immediate:!0}))}),{flush:"post"}),m.watch(()=>i.value,()=>{W.value&&(pt(),ft({immediate:!0}))}),m.watch(()=>F.value.length,()=>{W.value&&ft({immediate:!0})}),m.watch(()=>we.value,e=>{if(e)for(const[t,n]of ue)Pt(t,n);else{for(const e of ae.values())e.destroy();ae.clear();for(const e of Array.from(se.keys()))Qt(e);for(const e of Object.keys(ie))delete ie[e];for(const[e,t]of ue)t&&zt(e,!0)}},{immediate:!1}),m.watch([()=>l.viewportPriority,()=>F.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),m.watch(()=>oe.value,()=>{W.value&&ft({immediate:!0})}),m.watch([Te,Y,Ce,()=>F.value.length,W],()=>{gt()},{immediate:!0}),m.watch([()=>F.value.length,W,Y,Ce,()=>he.start,()=>he.end],([e,t,n,o,r,l])=>{g.value&&N("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:Te.value,scroll:t?(()=>{const e=me.value||it();return e?{reverse:st(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:oe.value})}),m.watch(()=>Le.value,(e,t)=>{ke.value&&("number"==typeof t&&e<=t||e>oe.value&&Gt())}),m.onBeforeUnmount(()=>{Kt();for(const e of ae.values())e.destroy();ae.clear();for(const e of Array.from(se.keys()))Qt(e);dt(),mt()});const rn=m.computed(()=>l.renderCodeBlocksAsPre?Je:en),ln={text:Ee,paragraph:Ge,heading:Qe,code_block:en,list:qe,list_item:Xe,blockquote:lt,table:et,definition_list:C,footnote:Ve,footnote_reference:S,footnote_anchor:We,admonition:at,vmr_container:ot,hardbreak:Ke,link:$e,image:xe,thematic_break:tt,math_inline:Be,math_block:Ae,strong:Pe,emphasis:Ye,strikethrough:He,highlight:Fe,insert:Ue,subscript:Re,superscript:ze,emoji:T,checkbox:b,checkbox_input:b,inline_code:G,html_inline:q,reference:Oe,html_block:Ze},an=m.computed(()=>(j.value,I(l.customId))),sn=m.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),un=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||{})),cn=m.computed(()=>u({},l.mermaidProps||{})),dn=m.computed(()=>u({},l.d2Props||{})),mn=m.computed(()=>u({},l.infographicProps||{})),fn=m.computed(()=>({typewriter:l.typewriter})),vn=m.computed(()=>u(u({},fn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),hn=m.computed(()=>u(u({},fn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),gn=m.computed(()=>je.value.map((e,t)=>{var n;const o=bn(e);let r=e,l=Nn(e,o);if(("html_block"===e.type||"html_inline"===e.type)&&l===ln[e.type]){const t=String(null!=(n=e.tag)?n:"").trim().toLowerCase()||kn(e.content);if(t&&U.value.has(t)){const n=an.value[t];n&&(l=n,r=c(u({},e),{type:t,tag:t,content:Mn(e.content,t)}))}}return{node:r,component:l,bindings:Dn(r,o),isCodeBlock:"code_block"===r.type,index:t,indexKey:`${sn.value}-${t}`,renderKey:Tn(r,t)}})),yn=m.computed(()=>!(!De.value||!l.content)&&F.value.some(e=>Cn(e))),wn=m.computed(()=>ge.value.map(e=>{var t;let n=xn(e.node);const o=bn(n);let r=Nn(n,o);if(("html_block"===n.type||"html_inline"===n.type)&&r===ln[n.type]){const e=String(null!=(t=n.tag)?t:"").trim().toLowerCase()||kn(n.content);if(e&&U.value.has(e)){const t=an.value[e];t&&(r=t,n=c(u({},n),{type:e,tag:e,content:Mn(n.content,e)}))}}return c(u({},e),{node:n,component:r,bindings:Dn(n,o),isCodeBlock:"code_block"===n.type,indexKey:`${sn.value}-${e.index}`,renderKey:Tn(n,e.index)})}));function xn(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=ce.get(s);if(d&&d.signature===c)return d.node;const p=u({},s);return ce.set(s,{signature:c,node:p}),p}function kn(e){const t=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return t?t[1].toLowerCase():""}function Mn(e,t){const n=String(null!=e?e:"");if(!t)return n;const o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(r,"").replace(l,"")}function bn(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 Tn(e,t){const n=`${sn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown");if("code_block"===o)return n;const 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(De.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function Nn(e,t){if(!e)return nt;const n=an.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:bn(e);if("mermaid"===r)return n.mermaid||tn;if("infographic"===r)return n.infographic||nn;if("d2"===r||"d2lang"===r)return n.d2||on;if(o)return o;return n.code_block||rn.value}return o||ln[String(e.type)]||nt}function Dn(e,t){const n=null!=t?t:bn(e);return"mermaid"===n?cn.value:"infographic"===n?mn.value:"d2"===n||"d2lang"===n?dn.value:"link"===e.type?vn.value:"list"===e.type?hn.value:"code_block"===e.type?un.value:fn.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:h,debugPerformanceEnabled:g,attrs:y,textStreamState:x,streamRenderVersion:k,resolvedShowTooltips:M,logPerf:N,resolveViewportRoot:D,instanceMsgId:_,defaultMd:E,customTagCache:L,EMPTY_PARSED_NODES:B,mdBase:A,mdInstance:O,normalizeCustomTag:z,resolveCustomHtmlTags:R,cloneNodeValue:P,cloneParsedNodeList:H,mergedParseOptions:$,effectiveCustomHtmlTagsSet:U,parsedNodes:F,maxLiveNodesResolved:Y,virtualizationEnabled:W,viewportPriorityEnabled:V,registerNodeVisibility:K,requestFrame:Q,cancelFrame:X,isTestEnv:Z,hasIdleCallback:J,resolvedBatchSize:ee,resolvedInitialBatch:te,batchingEnabled:ne,renderedCount:oe,previousRenderContext:re,adaptiveBatchSize:le,nodeVisibilityState:ie,nodeVisibilityHandles:ae,nodeVisibilityFallbackTimers:se,nodeSlotElements:ue,codeBlockRenderCache:ce,nodeSlotVersion:de,sortedNodeSlots:pe,scrollRootElement:me,detachScrollHandler:fe,pendingFocusSync:ve,liveRange:he,visibleNodes:ge,deferNodes:we,incrementalRenderingActive:ke,previousBatchConfig:Me,shouldObserveSlots:be,liveNodeBufferResolved:Ce,focusIndex:Te,nodeContentElements:Ne,legacyVue26:De,legacyNodesMode:_e,legacyNodeItems:je,syncNodeRefs:Ie,resolveTemplateRef:Se,desiredRenderedCount:Le,resolveScrollContainer:it,isReverseFlexScrollRoot:st,getNormalizedScrollTop:ut,getOffsetTopWithinRoot:ct,cleanupScrollListener:dt,setupScrollListener:pt,cancelScheduledFocusSync:mt,scheduleFocusSync:ft,syncFocusToScroll:vt,clamp:ht,updateLiveRange:gt,nodeHeights:yt,heightStats:wt,heightTreeSize:xt,heightSumTree:kt,heightKnownTree:Mt,resetHeightMeasurements:bt,pruneHeightMeasurements:Ct,fenwickUpdate:Tt,fenwickQuery:Nt,fenwickRangeSum:Dt,rebuildHeightTrees:_t,recordNodeHeight:jt,averageNodeHeight:It,estimateHeightRange:St,topSpacerHeight:Et,bottomSpacerHeight:Lt,estimateIndexForOffset:Bt,estimateIndexForOffsetFromEnd:At,cleanupNodeVisibility:Ot,markNodeVisible:zt,shouldRenderNode:function(e){return!(ke.value&&e>=oe.value)&&(!we.value||e<te.value||!0===ie[e])},destroyNodeHandle:Rt,setNodeSlotElement:Pt,bumpNodeSlotVersion:Ht,setNodeContentRef:$t,batchRaf:Ut,batchTimeout:Ft,batchPending:Yt,pendingIncrement:Wt,batchIdle:Vt,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:Kt,clearVisibilityFallback:Qt,scheduleVisibilityFallback:Xt,autoDisableViewportPriority:qt,scheduleBatch:Zt,queueNextBatch:Gt,adjustAdaptiveBatchSize:Jt,CodeBlockNodeAsync:en,MermaidBlockNodeAsync:tn,InfographicBlockNodeAsync:nn,D2BlockNodeAsync:on,codeBlockComponent:rn,nodeComponents:ln,customComponentsMap:an,indexPrefix:sn,codeBlockBindings:un,mermaidBindings:cn,d2Bindings:dn,infographicBindings:mn,nonCodeBindings:fn,linkBindings:vn,listBindings:hn,legacyRenderedItems:gn,legacyStructuredContentMode:yn,renderedItems:wn,getCodeBlockRenderNode:xn,getHtmlTagFromContent:kn,stripCustomHtmlWrapper:Mn,getCodeBlockLanguage:bn,isLegacyStructuredNode:Cn,getRenderKey:Tn,getNodeComponent:Nn,getBindingsFor:Dn,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,"custom-html-tags":n.props.customHtmlTags},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,"e98920fd",null,null).exports,at=M(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("./chunks/index.legacy-70f0e155.cjs")).then(e=>e.index_legacy);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 vt=null,ht=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 kt(){return d(this,null,function*(){return ht||(gt||(gt=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(ht=e.EXTENDED_LANGUAGE_ICON_MAP,yt.value++,ht)).catch(()=>null)),gt)})}function Mt(e){vt=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(vt){const t=vt(e);if(null!=t&&""!==t)return t}const t=bt(e),n=wt[t];if(n)return n;return(null==ht?void 0:ht[t])||(kt(),'<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=>St(e,t)).join("")}function St(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return Ft(Pt(e.content));case"paragraph":return`<p>${It(Rt(e.children),t)}</p>`;case"strong":return`<strong>${It(Rt(e.children),t)}</strong>`;case"emphasis":return`<em>${It(Rt(e.children),t)}</em>`;case"strikethrough":return`<del>${It(Rt(e.children),t)}</del>`;case"highlight":return`<mark>${It(Rt(e.children),t)}</mark>`;case"insert":return`<ins>${It(Rt(e.children),t)}</ins>`;case"subscript":return`<sub>${It(Rt(e.children),t)}</sub>`;case"superscript":return`<sup>${It(Rt(e.children),t)}</sup>`;case"inline_code":return`<code>${Ft(Pt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=Pt(e.href),o=Pt(e.title),r=Rt(e.children).length>0?It(Rt(e.children),t):Ft(Pt(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=Pt(e.src),n=Pt(e.alt),o=Pt(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(Rt(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${It(Rt(e.children),t)}</li>`;case"blockquote":return`<blockquote>${It(Rt(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(Rt(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=Ut(Pt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${Ft(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=It(Rt(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>${Rt(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(Pt(e.id))}" class="markstream-nested-footnote">${It(Rt(e.children),t)}</div>`}(e,t);case"footnote_reference":return function(e){const t=Ft(Pt(e.id));return`<sup class="markstream-nested-footnote-ref"><a href="#fnref--${Yt(Pt(e.id))}">[${t}]</a></sup>`}(e);case"admonition":return function(e,t){const n=Ut(Pt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${Ft(Pt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${It(Rt(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return Ft(Pt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${Ft(Pt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${Ft(Pt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${Ft(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?Ft(n):n:Ft(n):""}(e,t);default:return function(e,t){const n=Pt(e.tag||e.type);if(!n||_t.has(n))return Ft(Pt(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=Rt(e.children);if(n.length>0)return It(n,t);const o=Pt(e.content);return o?At(o,t):Ft(Pt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${Yt(n)}">${l}</${i}>`}(e,t)}}function Et(e,t,n=!1){return`<tr>${Rt(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:${Yt(r)}"`:""}>${It(Rt(e.children),t)}</${o}>`}function Bt(e,t){return`<dt>${It(Rt(e.term),t)}</dt><dd>${It(Rt(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 Rt(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 Ht(e){const t=Pt(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 Pt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Yt(e){return Ft(e).replace(/`/g,"`")}const Wt=new Map;function Vt(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=Qt(e);o&&!t.has(o)&&(t.add(o),n.push(o))}return n}function Qt(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=M(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=M(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=M(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:h}=he(),g=m.ref(null),y=m.ref(null),w=m.ref(!1),x=m.ref(bt(r.node.language)),k=m.computed(()=>Ct(x.value)),M=m.computed(()=>"plaintext"===k.value),b=m.ref(!1),C=m.ref(!1),T=m.ref(!1),N=m.ref(!1),D=m.ref(null);let _=0;const j=we();let I=null;const S=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>y.value,e=>{if(null==I||I.destroy(),I=null,!e)return void(S.value=!1);const t=j(e,{rootMargin:"400px"});I=t,S.value=t.isVisible.value,t.whenVisible.then(()=>{S.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==I||I.destroy(),I=null});let E=null,L=null,B=()=>{},A=()=>{},O=()=>null,z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),R=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),P=()=>{},H=()=>{},$=()=>{},U=null,F=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},Y=()=>d(this,null,function*(){}),W=null;const V=[];let K=null;const Q=m.computed(()=>r.node.diff),X=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function q(e){var t;if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const n=e;return c(u(u({},X),n),{enabled:null==(t=n.enabled)||t})}return u({},X)}const Z=m.computed(()=>{var e;const t=r.monacoOptions?u({},r.monacoOptions):{};if(!Q.value)return t;const n=void 0===t.diffHideUnchangedRegions?u({},X):q(t.diffHideUnchangedRegions),o=void 0===t.hideUnchangedRegions?void 0:q(t.hideUnchangedRegions),l=null!=(e=t.diffUnchangedRegionStyle)?e:"line-info";return c(u(u(u({},{maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:12,lineNumbersMinChars:2,glyphMargin:!1,fontSize:13,lineHeight:30,renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,padding:{top:10,bottom:"line-info"===l||"line-info-basic"===l||"metadata"===l?22:14},diffHideUnchangedRegions:n,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:l,diffHunkActionsOnHover:!0,diffHunkHoverHideDelayMs:160}),t),void 0===o?{}:{hideUnchangedRegions:o}),{diffHideUnchangedRegions:n})}),G=m.computed(()=>Q.value?"diff":"single"),J=m.ref(G.value),ee=m.ref(!1),te=m.ref(!1),ne=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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 ne&&console.warn("[markstream-vue2] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(ee.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&(F=n),"function"==typeof t){const e=Ue();if(e&&r.themes&&Array.isArray(r.themes)&&!r.themes.includes(e))throw new Error("Preferred theme not in provided themes array");W=Qe();const n=t(W);E=n.createEditor||E,L=n.createDiffEditor||L,B=n.updateCode||B,A=n.updateDiff||A,O=n.getEditor||O,z=n.getEditorView||z,R=n.getDiffEditorView||R,P=n.cleanupEditor||P,H=n.safeClean||n.cleanupEditor||H,$=n.refreshDiffPresentation||$,Y=n.setTheme||Y,N.value=!0,g.value&&(yield Re(g.value))}}catch(e){ne&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),ee.value=!0}})})();const oe=m.ref("number"==typeof(null==(o=Z.value)?void 0:o.fontSize)?Z.value.fontSize:Number.NaN),re=m.ref(oe.value),le=m.computed(()=>{const e=oe.value,t=re.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function ie(){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 ae(){var e,t,n,o,r;try{const l=Q.value?null!=(n=null==(t=null==(e=R())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:R():z(),i=O(),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 se(e){var t,n;try{const o=O(),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=ie();if(o&&o>0)return o;const r=Number.isFinite(re.value)&&re.value>0?re.value:12;return Math.max(12,Math.round(1.35*r))}function ue(){var e;if(Number.isFinite(re.value)&&re.value>0&&Number.isFinite(oe.value))return re.value;const t=ae();return"number"==typeof(null==(e=Z.value)?void 0:e.fontSize)?(oe.value=Z.value.fontSize,re.value=Z.value.fontSize,re.value):t&&t>0?(oe.value=t,re.value=t,t):(oe.value=12,re.value=12,12)}function ce(){var e,t,n,o,r,l,i,a,s,u,c,d,p,m;try{const f=Q.value?R():z();if(!f)return null;if(Q.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 v=(null==(r=null==p?void 0:p.getContentHeight)?void 0:r.call(p))||0,h=(null==(l=null==m?void 0:m.getContentHeight)?void 0:l.call(m))||0,g=Math.max(v,h);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),k=Math.max(se(p),se(m));return Math.ceil(x*(k+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 v=null==(m=null==f?void 0:f.getModel)?void 0:m.call(f);let h=1;v&&"function"==typeof v.getLineCount&&(h=v.getLineCount());const g=se(f);return Math.ceil(h*(g+1.5)+0+1)}catch(f){return null}}function de(e){const t=String(null!=e?e:"").match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;const[n,o,r]=t.slice(0,3).map(Number);return.2126*n+.7152*o+.0722*r}function pe(e,t,n){if(!M.value)return!1;const o=de(e),r=de(t);return n?null!=o&&o>170||null!=r&&r<110:null!=o&&o<85||null!=r&&r>190}function ve(){var e,t,n,o,r,l,i,a;const s=g.value,u=y.value;if(!s||!u)return;if(Q.value)return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");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,v=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(m=window.getComputedStyle(c),f=d===c?m:window.getComputedStyle(d),v=p===c?m:window.getComputedStyle(p))}catch(b){m=null,f=null,v=null}const h=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(),k=h||String(null!=(l=null!=(r=null==v?void 0:v.color)?r:null==m?void 0:m.color)?l:"").trim(),M=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==m?void 0:m.backgroundColor)?a:"").trim();if(pe(M,k,u.classList.contains("is-dark")))return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");k&&u.style.setProperty("--vscode-editor-foreground",k),M&&u.style.setProperty("--vscode-editor-background",M),x&&u.style.setProperty("--vscode-editor-selectionBackground",x)}const ge=/auto|scroll|overlay/i;function ye(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(ge.test(t)||ge.test(n))return l;l=l.parentElement}return r}function xe(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=ye(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 ke(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect().height,n=ce();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",xe(e,t,o)}}catch(e){}}function Me(){for(var e;V.length>0;)try{null==(e=V.pop())||e()}catch(t){}}function be(){if(Me(),!Q.value)return;const e=g.value;if(!e)return;const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return;const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),o=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),r=Math.min(n.length,o.length);for(let l=0;l<r;l++){const e=n[l],t=o[l].querySelector("a"),r=e.querySelector(".center > div:first-child");if(!t||!r)continue;const i=document.createElement("button");i.type="button",i.className="markstream-inline-fold-proxy";const a=t.getAttribute("title")||"Show Unchanged Region";i.title=a,i.setAttribute("aria-label",a);const s=t.querySelector(".codicon"),u=document.createElement("span");u.className=(null==s?void 0:s.className)||"codicon codicon-unfold",i.append(u);const c=e=>{e.preventDefault(),e.stopPropagation()},d=e=>{e.preventDefault(),e.stopPropagation(),t.click()},p=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.click())};i.addEventListener("mousedown",c),i.addEventListener("click",d),i.addEventListener("keydown",p),r.replaceChildren(i),V.push(()=>{i.removeEventListener("mousedown",c),i.removeEventListener("click",d),i.removeEventListener("keydown",p),r.contains(i)&&r.replaceChildren()})}}function Ce(){null==K&&(K=Xt(()=>{K=null,Xt(()=>{Te(),be(),C.value||(b.value?ke():De(),Xt(()=>{Te(),be()}))})}))}function Te(){if(!Q.value)return;const e=g.value;if(!e)return;const t=Array.from(e.querySelectorAll(".stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal"));for(const n of t){if(!(n instanceof HTMLButtonElement))continue;const e="up"===n.dataset.direction?"up":"down",t=document.createElement("span");t.className=`codicon codicon-chevron-${e}`,n.replaceChildren(t)}}function Ne(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 De(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect().height,o=_e();if(_>0&&(_--,null!=D.value))return void xe(t,n,Ne(t,D.value,o));const r=ce();if(null!=r&&r>0)return void xe(t,n,Ne(t,r,o));if(null!=D.value)return void xe(t,n,Ne(t,D.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void xe(t,n,Ne(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?xe(t,n,Ne(t,i,o)):xe(t,n,Ne(t,o,o))}catch(t){}}function _e(){var e,t;const n=null!=(t=null==(e=Z.value)?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 je=m.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));m.watch(()=>r.node.language,e=>{x.value=bt(e)}),m.watch(()=>[r.node.originalCode,r.node.updatedCode,k.value,Q.value],e=>d(this,[e],function*([e,t,n,o]){if(!1!==r.stream&&o){if(E&&!T.value&&g.value)try{yield Re(g.value)}catch(l){}A(String(null!=e?e:""),String(null!=t?t:""),k.value),Ce()}})),m.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(x.value||(x.value=bt(F(e))),!Q.value)){if(E&&!T.value&&g.value)try{yield Re(g.value)}catch(t){}B(e,k.value),b.value&&Ce()}}));const Ie=m.computed(()=>{const e=x.value;return e?Nt[e]||e.charAt(0).toUpperCase()+e.slice(1):Nt[""]||"Plain Text"}),Se=m.computed(()=>(yt.value,Tt(x.value||""))),Ee=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),Q.value?(e.color="var(--markstream-diff-shell-fg)",e.borderColor="var(--markstream-diff-shell-border)"):(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),Le=m.computed(()=>{if(!Q.value)return{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}}),Be=m.computed(()=>!1!==r.showTooltips);function Ae(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Oe(e){var t,n;try{if(Q.value){const n=R();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=z();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function ze(e){return d(this,null,function*(){var t,n,o;if(!E)return;Xe(),Q.value?(H(),L?yield L(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),k.value):yield E(e,r.node.code,k.value)):yield E(e,r.node.code,k.value);const l=Q.value?R():z();if("number"==typeof(null==(o=Z.value)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:Z.value.fontSize,automaticLayout:!1}),oe.value=Z.value.fontSize,re.value=Z.value.fontSize;else{const e=ae();e&&e>0?(oe.value=e,re.value=e):(oe.value=12,re.value=12)}b.value||C.value||Ce(),!1===r.loading&&(yield m.nextTick(),Xt(()=>{Ce()}))})}function Re(e){if(!E)return null;if(U)return U;T.value=!0;const t=(()=>d(this,null,function*(){yield ze(e)}))();return U=t.finally(()=>{U=null}),U}m.watch(Be,e=>{e||fe()}),m.watch(()=>re.value,(e,t)=>{const n=Q.value?R():z();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!C.value&&Ce())},{flush:"post",immediate:!1});const Pe=m.watch(()=>[g.value,Q.value,r.stream,r.loading,N.value,S.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=Re(e);i&&(yield i,Pe())}));function He(){return r.isDark?r.darkTheme:r.lightTheme}function $e(e){return"string"==typeof e?e:e&&"object"==typeof e&&"name"in e?String(e.name):null}function Ue(){var e;const t=He(),n=null==(e=Z.value)?void 0:e.theme,o=null!=t?t:n,l=Array.isArray(r.themes)?r.themes:[];if(!l.length||null==o)return o;const i=$e(o),a=l.map(e=>$e(e)).filter(e=>!!e);if(!i||a.includes(i))return o;const s=$e(n);return null!=n&&s&&a.includes(s)?n:l[0]}function Fe(){Xe();const e=Ue(),t=()=>{Q.value&&$(),Xt(()=>{ve(),Ce()})};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()}(Y,e).then(t).catch(()=>{}):t()}function Ye(e){var t;const n=(null!=(t=$e(e))?t:"").toLowerCase();return n?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>n.includes(e))&&!["light","latte","dawn","lotus"].some(e=>n.includes(e)):!!r.isDark}m.watch(G,(e,t)=>d(this,null,function*(){if(e!==t&&(J.value=e,E&&g.value&&T.value&&(!1!==r.stream||!1===r.loading)&&S.value))try{T.value=!1,U=null,Me(),H(),yield m.nextTick(),yield Re(g.value)}catch(n){T.value=!1}}));const We=m.computed(()=>Ye(Ue())),Ve=m.computed(()=>{var e;if(!Q.value)return We.value?"dark":"light";const t=null==(e=Z.value)?void 0:e.diffAppearance;return"light"===t||"dark"===t?t:r.isDark?"dark":"light"}),Ke=m.computed(()=>Q.value?"dark"===Ve.value:We.value);function Qe(){return c(u(c(u({wordWrap:"on",wrappingIndent:"same",themes:r.themes},Z.value||{}),{theme:Ue()}),Q.value?{diffAppearance:Ve.value}:{}),{onThemeChange(){ve()}})}function Xe(){const e=Qe();if(!W)return W=e,W;for(const t of Object.keys(W))t in e||delete W[t];return Object.assign(W,e),W}const qe=m.computed(()=>{var e,t,n,o,r,l,i,a,s,u,c,d,p,m;return JSON.stringify({diffLineStyle:null!=(t=null==(e=Z.value)?void 0:e.diffLineStyle)?t:"background",diffUnchangedRegionStyle:null!=(o=null==(n=Z.value)?void 0:n.diffUnchangedRegionStyle)?o:"line-info",diffHideUnchangedRegions:null==(l=null==(r=Z.value)?void 0:r.diffHideUnchangedRegions)||l,renderSideBySide:null==(a=null==(i=Z.value)?void 0:i.renderSideBySide)||a,enableSplitViewResizing:null==(u=null==(s=Z.value)?void 0:s.enableSplitViewResizing)||u,ignoreTrimWhitespace:null==(d=null==(c=Z.value)?void 0:c.ignoreTrimWhitespace)||d,originalEditable:null!=(m=null==(p=Z.value)?void 0:p.originalEditable)&&m})});m.watch(()=>[r.monacoOptions,S.value],()=>{var e,t;if(Xe(),!E||!S.value)return;const n=Q.value?R():z(),o="number"==typeof(null==(e=Z.value)?void 0:e.fontSize)?Z.value.fontSize:Number.isFinite(re.value)?re.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),Ce()},{deep:!0}),m.watch(()=>{var e,t;return[r.isDark,r.darkTheme,r.lightTheme,r.themes,null==(e=Z.value)?void 0:e.theme,null==(t=Z.value)?void 0:t.diffAppearance,N.value,T.value,S.value]},()=>{N.value&&Fe()},{flush:"post"}),m.watch(()=>[qe.value,N.value,S.value],(e,t)=>d(this,[e,t],function*([e,t,n],[o]){if(Xe(),Q.value&&t&&n&&E&&g.value&&T.value&&e!==o&&(!1!==r.stream||!1===r.loading))try{T.value=!1,U=null,Me(),H(),yield m.nextTick(),yield Re(g.value)}catch(l){T.value=!1}}),{flush:"post"});const Ze=m.watch(()=>[r.loading,S.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield m.nextTick(),Xt(()=>{C.value||(b.value?ke():De()),Ze()})))}),{immediate:!0,flush:"post"});return m.onUnmounted(()=>{Me(),null!=K&&(function(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(t){}try{globalThis.clearTimeout(e)}catch(t){}}(K),K=null),P()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:p,hasPreviewListener:f,t:h,codeEditor:g,container:y,copyText:w,codeLanguage:x,monacoLanguage:k,isPlainTextLanguage:M,isExpanded:b,isCollapsed:C,editorCreated:T,monacoReady:N,expandRafId:null,heightBeforeCollapse:D,resumeGuardFrames:_,registerVisibility:j,viewportHandle:I,viewportReady:S,createEditor:E,createDiffEditor:L,updateCode:B,updateDiffCode:A,getEditor:O,getEditorView:z,getDiffEditorView:R,cleanupEditor:P,safeClean:H,refreshDiffPresentation:$,createEditorPromise:U,detectLanguage:F,setTheme:Y,runtimeMonacoOptions:W,inlineFoldProxyCleanups:V,deferredEditorVisualSyncRafId:K,isDiff:Q,defaultDiffHideUnchangedRegions:X,resolveDiffHideUnchangedRegionsOption:q,resolvedMonacoOptions:Z,desiredEditorKind:G,currentEditorKind:J,usePreCodeRender:ee,showInlinePreview:te,isDevEnv:ne,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:oe,codeFontSize:re,fontBaselineReady:le,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:ie,readActualFontSizeFromEditor:ae,getLineHeightSafe:se,ensureFontBaseline:ue,increaseCodeFont:function(){const e=ue(),t=Math.min(36,e+1);re.value=t},decreaseCodeFont:function(){const e=ue(),t=Math.max(10,e-1);re.value=t},resetCodeFont:function(){ue(),Number.isFinite(oe.value)&&(re.value=oe.value)},computeContentHeight:ce,getColorLuminance:de,shouldPreferPlainTextFallbackSurface:pe,syncEditorCssVars:ve,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:ge,resolveScrollRootElement:ye,adjustScrollAfterHeightChange:xe,updateExpandedHeight:ke,clearInlineFoldProxies:Me,syncInlineFoldProxies:be,scheduleEditorVisualSync:Ce,syncDiffRevealButtons:Te,applyCollapsedContainerHeight:Ne,updateCollapsedHeight:De,getMaxHeightValue:_e,isPreviewable:je,displayLanguage:Ie,languageIcon:Se,containerStyle:Ee,headerStyle:Le,tooltipsEnabled:Be,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:Ae,onBtnHover:function(e,t,n="top"){if(!Be.value)return;const o=Ae(e);if(!o)return;const l=e;me(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(){Be.value&&fe()},onCopyHover:function(e){if(!Be.value)return;const t=Ae(e);if(!t)return;const n=e;me(t,w.value?h("common.copied")||"Copied":h("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(e){if(b.value=!b.value,e&&Be.value){const t=Ae(e);t&&me(t,b.value?h("common.collapse")||"Collapse":h("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=Q.value?R():z(),n=g.value;t&&n&&(b.value?(Oe(!0),n.style.maxHeight="none",n.style.overflow="visible",ke()):(Oe(!1),n.style.overflow="auto",De()))},toggleHeaderCollapse:function(){var e,t,n;if(C.value=!C.value,C.value){if(g.value){const n=Math.ceil((null==(t=(e=g.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(D.value=n)}Oe(!1)}else{b.value&&Oe(!0),g.value&&null!=D.value&&(g.value.style.height=`${D.value}px`);const e=Q.value?R():z();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}_=2,Ce()}},previewCode:function(){if(!je.value)return;const e=x.value;if(f.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?h("artifacts.htmlPreviewTitle")||"HTML Preview":h("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(te.value=!te.value)},setAutomaticLayout:Oe,runEditorCreation:ze,ensureEditorCreation:Re,stopCreateEditorWatch:Pe,getPreferredColorScheme:He,getThemeName:$e,resolveRequestedTheme:Ue,themeUpdate:Fe,themeLooksDark:Ye,resolvedChromeIsDark:We,effectiveDiffAppearance:Ve,resolvedSurfaceIsDark:Ke,buildRuntimeMonacoOptions:Qe,syncRuntimeMonacoOptions:Xe,monacoStructuralSignature:qe,stopLoadingWatch:Ze,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.resolvedSurfaceIsDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.resolvedSurfaceIsDark,"is-diff":n.isDiff,"is-plain-text":n.isPlainTextLanguage}],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",style:n.headerStyle},[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:function(e){return n.toggleExpand(e)},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:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):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"}})])]):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)"}],staticClass:"code-editor-layer"},[t("div",{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,"22412502",null,null).exports,an=()=>import("@terrastruct/d2");let sn=null,un=an;function cn(e){un=e,sn=null}const dn=M(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),v=m.ref(null),h=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(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=m.computed(()=>{if(t.maxHeight)return{maxHeight:"number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight)}}),k="undefined"!=typeof window;let M=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 S=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],E=/^(?: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 E.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(S.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.classList.add("markstream-d2-root-svg"),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function R(){c.value=""}function P(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(M)return M;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?M=t:"function"==typeof e.compile&&(M=e),M}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(M=new e.D2,M):("function"==typeof e.compile&&(M=e),M)})}function $(){return d(this,null,function*(){var e,n,o,r,c;if(!k||C)return;if(t.loading&&!t.progressiveRender)return;const d=h.value;if(!d)return R(),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,R(),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 v=null!=(e=null==f?void 0:f.diagram)?e:f,h=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:h.themeID,y=null!=(c=t.darkThemeId)?c:h.darkThemeID,w=u({},h);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=h.themeOverrides&&"object"==typeof h.themeOverrides?h.themeOverrides:null;w.themeOverrides=u(u({},j),e||{})}const x=yield s.render(v,w);if(m!==p.value)return;const k=P(x);if(!k)throw new Error("D2 render returned empty output.");z(k),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(!k)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&&(v.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,h.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:v,baseCode:h,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:k,d2Instance:M,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;me(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){fe()},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;me(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=h.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:S,SAFE_URL_PROTOCOLS:E,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:R,extractSvg:P,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,"fdf24c90",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 vn=M(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);function f(e){if(!n.maxHeight||"none"===n.maxHeight)return`${e}px`;const t=Number.parseFloat(String(n.maxHeight));return Number.isFinite(t)?`${Math.min(e,t)}px`:`${e}px`}function v(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(s.value=f(e))}const h=m.ref(1),g=m.ref(0),y=m.ref(0),w=m.ref(!1),x=m.ref({x:0,y:0}),k=m.computed(()=>n.node.code);function M(e){return!e||e.disabled}function b(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 C(e){"Escape"===e.key&&u.value&&N()}function T(){if(u.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",C)}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(${g.value}px, ${y.value}px) scale(${h.value})`}})}function N(){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",C)}catch(e){}}let D=null;function _(){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.");D&&(null==(e=D.destroy)||e.call(D),D=null),i.value.innerHTML="",D=new t({container:i.value,width:"100%",height:"100%"}),D.render(k.value),m.nextTick(()=>{v()})}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(()=>k.value,()=>{a.value||l.value||m.nextTick(()=>{_()})}),m.watch(()=>a.value,e=>{e||l.value||m.nextTick(()=>{_()})}),m.watch(()=>l.value,e=>{e||a.value||m.nextTick(()=>{_()})}),m.watch(()=>n.maxHeight,()=>{a.value||l.value||m.nextTick(()=>{_()})}),m.onMounted(()=>{a.value||l.value||m.nextTick(()=>{_()})}),m.onBeforeUnmount(()=>{var e;if(D&&(null==(e=D.destroy)||e.call(D),D=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",C)}catch(t){}});const j=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"),I=m.computed(()=>a.value||l.value),S=m.computed(()=>({transform:`translate(${g.value}px, ${y.value}px) scale(${h.value})`}));return m.watch(S,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,resolveContainerHeight:f,updateContainerHeight:v,zoom:h,translateX:g,translateY:y,isDragging:w,dragStart:x,baseCode:k,shouldSkipEventTarget:M,onBtnHover:function(e,t,o="top"){if(M(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;me(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){fe()},onCopyHover:function(e){if(M(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;me(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=k.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?b(t):console.error("SVG element not found")},exportSvg:b,handleKeydown:C,openModal:T,closeModal:N,handleOpenModalClick:function(){T()},zoomIn:function(){h.value<3&&(h.value+=.1)},zoomOut:function(){h.value>.5&&(h.value-=.1)},resetZoom:function(){h.value=1,g.value=0,y.value=0},startDrag:function(e){w.value=!0,e instanceof MouseEvent?x.value={x:e.clientX-g.value,y:e.clientY-y.value}:x.value={x:e.touches[0].clientX-g.value,y:e.touches[0].clientY-y.value}},onDrag:function(e){if(!w.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),g.value=t-x.value.x,y.value=n-x.value.y},stopDrag:function(){w.value=!1},infographicInstance:D,renderInfographic:_,computedButtonStyle:j,isFullscreenDisabled:I,transformStyle:S,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,"f09aa514",null,null).exports,hn=M(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),h=m.ref(null),g=m.ref(""),y=m.ref(!1),w=m.ref(!1);let x;const k=m.ref(!0),M=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`})),S=m.computed(()=>!1!==r.showTooltips);function E(){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 R(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=p.value,n=h.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 P(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>${P(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(()=>{R()})}function U(){null==x||x.disconnect(),x=void 0,w.value&&(g.value="",y.value=!0)}function F(){var e;const t=h.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=h.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,V,K,Q;const X=new Set,q=new Set,Z=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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?!Q||Q.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(!V)try{const e=yield import("stream-markdown");V=e.createShikiStreamRenderer,K=e.registerHighlight;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Q=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&&h.value?(null==K||K({themes:L()}),!W&&V&&(W=V(h.value,{theme:E(),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(S,e=>{e||fe()}),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&&h.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,h.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&&h.value&&(W||(yield te()),yield null==W?void 0:W.setTheme(E()),R())})),m.watch(()=>r.node.code,()=>d(this,null,function*(){if(u.value||!k.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:h,fallbackHtml:g,rendererReady:y,hasStableRender:w,renderObserver:x,autoScrollEnabled:k,lastScrollTop:M,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:b,codeFontSize:C,fontBaselineReady:T,displayLanguage:N,languageIcon:D,isPreviewable:_,containerStyle:j,contentStyle:I,tooltipsEnabled:S,getPreferredColorScheme:E,getResolvedThemes:L,getColorChannels:B,getRelativeLuminance:A,getContrastRatio:O,isDarkBackgroundColor:z,syncRenderedCssVars:R,escapeHtml:P,renderFallback:H,clearFallback:$,keepLastSuccessfulRender:U,hasRendererContent:F,clearFallbackWhenRendererReady:Y,renderer:W,createShikiRenderer:V,registerHighlight:K,registeredHighlightLanguages:Q,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<M.value?k.value=!1:ne(e)&&(k.value=!0),M.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(!S.value)return;const o=oe(e);if(!o)return;const l=e;me(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(){S.value&&fe()},onCopyHover:function(e){if(!S.value)return;const t=oe(e);if(!t)return;const n=e;me(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(e){if(u.value=!u.value,e&&S.value){const t=oe(e);t&&me(t,u.value?l("common.collapse")||"Collapse":l("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=f.value;t&&(u.value?(t.style.maxHeight="none",t.style["overflow-y"]="visible",t.style["overflow-x"]="auto"):(t.style.maxHeight="500px",t.style.overflow="auto",k.value=!0,m.nextTick(()=>{t.scrollHeight>t.clientHeight&&(t.scrollTop=t.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:function(e){return n.toggleExpand(e)},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:"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(),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,"dfe9b17a",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=M(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=k(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 kn(e){if(!e)return null;const t=wn.get(e)||null;return t&&xn(e,t),t}function Mn(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 Sn=null;const En=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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&&En&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{Sn=e.perfMonitor})}catch(go){}function Ln(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now();if(!_e()){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 Sn&&Sn.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,Sn&&Sn.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",Sn&&Sn.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=>{Sn&&Sn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),c(t)},reject:t=>{Sn&&Sn.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 Rn(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!_e()){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 Pn=M(m.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=we();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),u=kn(s.value),c=m.ref((null==u?void 0:u.html)||""),p=m.ref(""),f=m.ref(!(null==u?void 0:u.html));let v=Boolean(null==u?void 0:u.html);function h(){return d(this,null,function*(){const e=yield je();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,v=!0,Mn(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(v=!0);const e=kn(s.value);if((null==e?void 0:e.html)&&!c.value&&(c.value=e.html,v=!0,f.value=!1),!v){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 Rn(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 h()))return;if(v||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:v,renderWithMainThreadFallback:h,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=M(m.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=we();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=kn(u.value),p=m.ref((null==c?void 0:c.html)||""),f=m.ref(""),v=m.ref(!(null==c?void 0:c.html));let h=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield je();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="",v.value=!1,h=!0,Mn(u.value,e)}function w(){p.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(i)return;if(!t.node.content)return w(),void(h=!0);const e=kn(u.value);(null==e?void 0:e.html)&&!p.value&&(p.value=e.html,h=!0,v.value=!1),a&&(a.abort(),a=null);const c=++l,d=new AbortController;if(a=d,!h){v.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(go){}}try{const e=yield Rn(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(h||p.value)return;n||!t.node.loading?w():v.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:v,hasRenderedOnce:h,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 Vn(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 Qn=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=Qn||(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(Qn)try{for(const[e,t]of qn.entries())t.reject(new Error("Worker terminated"));qn.clear(),Qn.terminate()}finally{Qn=null}}const lo=M(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},onRenderError:null},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],h=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return h.test(t)?t:""}function 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 k(e){if(e)try{e.replaceChildren()}catch(go){e.innerHTML=""}}function M(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 Vn(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=Vn(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),S=we();let E=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),R=m.ref(0),P=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),V=m.ref(0),K=m.ref(!1),Q=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()&<()},{timeout:500})},Q.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),pe=m.ref(!1),ve=m.ref({}),ge=m.ref(null),ye=m.ref(""),xe=m.ref(0);let ke=null;const Me=m.ref(!1),be=m.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),Ce=m.computed(()=>r.enableWheelZoom?{wheel:et}:{}),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,Se=null,Ee=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;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,A.value,_.value))return Me.value=!0,void it();const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),k(_.value),_.value.appendChild(t),ue.value="360px",Me.value=!0,it()}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 Re(e){return!e||e.disabled}function Pe(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&&!Me.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=Pe(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==E||E.destroy(),E=null,!e)return void(L.value=!1);const t=S(e,{rootMargin:"400px"});E=t,L.value=t.isVisible.value,t.whenVisible.then(()=>{L.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==E||E.destroy(),E=null,le()});const We=m.computed(()=>U.value||Y.value||N.value);function Ve(){if(!r.maxHeight||"none"===r.maxHeight)return null;const e=Number.parseFloat(String(r.maxHeight));return Number.isFinite(e)?e:null}function Ke(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,r=null!=e?e:D.value.clientWidth,l=Ve(),i=r*t,a=null==l?i:Math.min(i,l);ue.value=`${a}px`}}const Qe=m.ref(!1),Xe=m.computed(()=>({transform:`translate(${R.value}px, ${P.value}px) scale(${z.value})`}));function qe(e){"Escape"===e.key&&Qe.value&&Ge()}function Ze(){if(Qe.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(go){}if("undefined"!=typeof window)try{window.addEventListener("keydown",qe)}catch(go){}m.nextTick(()=>{if(D.value&&j.value){const e=D.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="100%",e.style.maxHeight="100%";const t=e.querySelector("[data-mermaid-wrapper]");t&&(I.value=t,t.style.transform=Xe.value.transform),k(j.value),j.value.appendChild(e)}})}function Ge(){if(Qe.value=!1,j.value&&k(j.value),I.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(go){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",qe)}catch(go){}}function Je(){if(!U.value)return;if(!i.value)return;const e=A.value.length;e!==V.value&&(K.value=!0,V.value=e,J&&clearTimeout(J),J=setTimeout(()=>{K.value&&U.value&&A.value.trim()&&(K.value=!1,nt("preview"))},X.value))}function et(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-R.value)/z.value,a=(l-P.value)/z.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(z.value+u,.5),3);c!==z.value&&(R.value=r-i*c,P.value=l-a*c,z.value=c)}}function tt(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 nt(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 ot(){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||pe.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=M(_.value,a);de.value||pe.value||(Ke(),de.value=!0,be.value={zoom:z.value,translateX:R.value,translateY:P.value,containerHeight:ue.value});const t=r.isDark?"dark":"light";e&&(ve.value[t]=e),pe.value&&(pe.value=!1),Me.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:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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 rt(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=Pe(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&&(M(_.value,s),Ke())}catch(go){}finally{Y.value=!1}}})}function lt(){return d(this,null,function*(){var e,t;const n=Date.now(),o=++xe.value;ke&&ke.abort(),ke=new AbortController;const l=ke.signal,i=r.isDark?"dark":"light",a=A.value,s=a.replace(/\s+/g,"");if(!a.trim())return _.value&&k(_.value),ge.value=null,ye.value="",void(Me.value=!1);if(s===ye.value)return;try{const r=yield Ye(a,i,{signal:l,timeoutMs:Te.value.worker});if(r.fullOk)return yield ot(),void(xe.value===o&&(ge.value=null!=(t=null==(e=_.value)?void 0:e.innerHTML)?t:null,ye.value=s,Me.value=!1));const u=Ee&&n<=Ee;if(r.prefixOk&&r.prefix&&He()&&!u)return void(yield rt(r.prefix))}catch(go){if("AbortError"===(null==go?void 0:go.name))return}if(xe.value!==o)return;if(Me.value)return;const u=ve.value[i];u&&_.value&&M(_.value,u)})}function it(){je&&(je=!1,Ie=q.value,Le=!1,Se&&(Se.abort(),Se=null),De&&(globalThis.clearTimeout(De),De=null),_e&&(Ne(_e),_e=null),Ee=Date.now())}function at(){if(it(),le(),ke){try{ke.abort()}catch(go){}ke=null}if(Se){try{Se.abort()}catch(go){}Se=null}ro(),ae(),ne=0}function st(e=q.value){je&&(Be>=G.value?it():(De&&globalThis.clearTimeout(De),De=globalThis.setTimeout(()=>{_e=oe(()=>d(this,null,function*(){if(!je)return;if(!re())return void it();if(U.value||de.value)return void it();const e=r.isDark?"dark":"light",t=A.value;if(!t.trim())return!1===r.loading?void it():void st(Ie);if(Be++,Be>G.value)it();else{Se&&Se.abort(),Se=new AbortController;try{if((yield Fe(t,e,{signal:Se.signal,timeoutMs:Te.value.worker}))&&(yield ot(),de.value))return void it()}catch(go){}Ie=Math.min(Math.floor(1.5*Ie),Z.value),st(Ie)}}),{timeout:500})},e)))}function ut(){je||i.value&&re()&&(U.value||de.value||(je=!0,Ee=0,Le=!0,Be=0,Ie=q.value,st(Ie)))}m.watch(Xe,e=>{Qe.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()?ut():it(),Je()}),m.watch(()=>r.isDark,()=>d(this,null,function*(){if(!de.value)return;if(Me.value)return;const e=r.isDark?"dark":"light",t=ve.value[e];if(t)return void(_.value&&M(_.value,t));const n={zoom:z.value,translateX:R.value,translateY:P.value,containerHeight:ue.value},o=1!==z.value||0!==R.value||0!==P.value;pe.value=!0,o&&(z.value=1,R.value=0,P.value=0,yield m.nextTick()),yield ot(),o&&(yield m.nextTick(),z.value=n.zoom,R.value=n.translateX,P.value=n.translateY,ue.value=n.containerHeight,be.value=n)})),m.watch(()=>U.value,e=>d(this,null,function*(){if(e)it(),de.value&&(be.value={zoom:z.value,translateX:R.value,translateY:P.value,containerHeight:ue.value});else{if(Me.value)return;const e=r.isDark?"dark":"light";if(de.value&&ve.value[e])return yield m.nextTick(),_.value&&M(_.value,ve.value[e]),z.value=be.value.zoom,R.value=be.value.translateX,P.value=be.value.translateY,void(ue.value=be.value.containerHeight);if(yield m.nextTick(),!i.value||!re())return;ut(),yield lt()}})),m.watch(()=>r.loading,(e,t)=>d(this,null,function*(){if(!0===t&&!1===e){const e=A.value.trim();if(!e)return at();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(de.value&&o===ye.value)return yield m.nextTick(),_.value&&!_.value.querySelector("svg")&&ve.value[t]&&M(_.value,ve.value[t]),void at();try{yield Fe(e,t,{timeoutMs:Te.value.worker}),yield ot(),ye.value=o,Me.value=!1,at()}catch(n){at(),Oe(n)}}})),m.watch(D,e=>{ce&&ce.disconnect(),e&&(ce=new ResizeObserver(e=>{e&&e.length>0&&!U.value&&!N.value&&Xt(()=>{Ke(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(),V.value=A.value.length)})),m.watch(()=>i.value,e=>{F.value||(U.value=!e)}),m.watch(()=>L.value,e=>{e&&(de.value||(ie(),V.value=A.value.length),r.loading||de.value||ie(),!U.value&&i.value&&ut())},{immediate:!1}),m.watch(()=>r.maxHeight,()=>{m.nextTick(()=>{Ke()})}),m.onUnmounted(()=>{J&&clearTimeout(J),le(),ce&&ce.disconnect(),ke&&(ke.abort(),ke=null),ro(),it(),ae()}),m.watch(()=>N.value,e=>d(this,null,function*(){e?(it(),ke&&ke.abort()):re()&&!de.value&&(yield m.nextTick(),ie(),U.value||ut())}),{immediate:!1});const ct=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:h,sanitizeUrl:g,scrubSvgElement:y,toSafeSvgElement:w,setSafeSvg:x,clearElement:k,renderSvgToTarget:M,t:b,resolveMermaidInstance:C,copyText:T,isCollapsed:N,mermaidContainer:D,mermaidContent:_,modalContent:j,modalCloneWrapper:I,registerViewport:S,viewportHandle:E,viewportReady:L,modeContainerRef:B,baseFixedCode:A,getCodeWithTheme:O,zoom:z,translateX:R,translateY:P,isDragging:H,dragStart:$,showSource:U,userToggledShowSource:F,isRendering:Y,renderQueue:W,lastContentLength:V,isContentGenerating:K,renderDebounceDelay:Q,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:pe,svgCache:ve,lastSvgSnapshot:ge,lastRenderedCode:ye,renderToken:xe,currentWorkController:ke,hasRenderError:Me,savedTransformState:be,wheelListeners:Ce,timeouts:Te,cancelIdle:Ne,previewPollTimeoutId:De,previewPollIdleId:_e,isPreviewPolling:je,previewPollDelay:Ie,previewPollController:Se,lastPreviewStopAt:Ee,allowPartialPreview:Le,previewPollAttempts:Be,withTimeoutSignal:Ae,renderErrorToContainer:Oe,isTimeoutError:ze,shouldSkipEventTarget:Re,onBtnHover:function(e,t,n="top"){if(Re(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;me(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){fe()},onCopyHover:function(e){if(Re(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;me(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Pe,canApplyPartialPreview:He,getSafePrefixCandidate:$e,canParseOnMain:Ue,canParseOffthread:Fe,canParseOrPrefix:Ye,isFullscreenDisabled:We,resolveMaxContainerHeight:Ve,updateContainerHeight:Ke,isModalOpen:Qe,transformStyle:Xe,handleKeydown:qe,openModal:Ze,closeModal:Ge,checkContentStability:Je,zoomIn:function(){z.value<3&&(z.value+=.1)},zoomOut:function(){z.value>.5&&(z.value-=.1)},resetZoom:function(){z.value=1,R.value=0,P.value=0},startDrag:function(e){H.value=!0,e instanceof MouseEvent?$.value={x:e.clientX-R.value,y:e.clientY-P.value}:$.value={x:e.touches[0].clientX-R.value,y:e.touches[0].clientY-P.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),R.value=t-$.value.x,P.value=n-$.value.y},stopDrag:function(){H.value=!1},handleWheel:et,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:tt,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||tt(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||Ze()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||nt(e)},switchMode:nt,initMermaid:ot,renderPartial:rt,progressiveRender:lt,stopPreviewPolling:it,cleanupAfterLoadingSettled:at,scheduleNextPreviewPoll:st,startPreviewPolling:ut,computedButtonStyle:ct,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,"80cb1008",null,null).exports,io=M(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(()=>Vt({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(()=>k(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=M(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 vo={AdmonitionNode:at,BlockquoteNode:lt,CheckboxNode:b,CodeBlockNode:ln,DefinitionListNode:C,EmojiNode:T,EmphasisNode:Ye,FootnoteNode:Ve,FootnoteReferenceNode:S,FootnoteAnchorNode:We,HardBreakNode:Ke,HeadingNode:Qe,HtmlBlockNode:Ze,HtmlInlineNode:q,HighlightNode:Fe,ImageNode:xe,D2BlockNode:dn,InlineCodeNode:G,PreCodeNode:Je,InsertNode:Ue,LinkNode:$e,ListItemNode:Xe,ListNode:qe,MarkdownCodeBlockNode:hn,MathBlockNode:Pn,MathInlineNode:Hn,MermaidBlockNode:lo,NestedRenderer:io,InfographicBlockNode:vn,ParagraphNode:Ge,StrikethroughNode:He,StrongNode:Pe,SubscriptNode:Re,SuperscriptNode:ze,TableNode:et,TextNode:Ee,ThematicBreakNode:tt,VmrContainerNode:ot,ReferenceNode:Oe},ho={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(vo).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",yn),e.component("NodeRenderer",yn),(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=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=Ve,exports.FootnoteReferenceNode=S,exports.HardBreakNode=Ke,exports.HeadingNode=Qe,exports.HighlightNode=Fe,exports.HtmlBlockNode=Ze,exports.HtmlInlineNode=q,exports.ImageNode=xe,exports.InfographicBlockNode=vn,exports.InlineCodeNode=G,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=hn,exports.MarkdownRender=yn,exports.MathBlockNode=Pn,exports.MathInlineNode=Hn,exports.MermaidBlockNode=lo,exports.NestedRenderer=io,exports.ParagraphNode=Ge,exports.PreCodeNode=Je,exports.ReferenceNode=Oe,exports.StrikethroughNode=He,exports.StrongNode=Pe,exports.SubscriptNode=Re,exports.SuperscriptNode=ze,exports.TableNode=et,exports.TextNode=Ee,exports.ThematicBreakNode=tt,exports.Tooltip=ao,exports.VmrContainerNode=ot,exports.VueRendererMarkdown=ho,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(Qn)try{for(const[e,t]of qn.entries())t.reject(new Error("Worker cleared"));qn.clear(),null==(e=Qn.terminate)||e.call(Qn)}catch(go){}Qn=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(){De(null)},exports.disableMermaid=function(){Yn(null)},exports.enableD2=function(e){cn(null!=e?e:an)},exports.enableKatex=function(e){De(null!=e?e:Ne)},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=_e,exports.isMermaidEnabled=Wn,exports.languageIconsRevision=yt,exports.languageMap=Nt,exports.normalizeLanguageIdentifier=bt,exports.parseNestedMarkdownToNodes=Vt,exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield kt()})},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=Rn,exports.renderMarkdownNodeToHtml=function(e,t={}){return St(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=Rt(n.children);if(e.length>0)return It(e,t);const o=Pt(n.content);if(o)return At(o,t);if(null!=n.raw)return Ft(Pt(n.raw))}return e.content?At(Pt(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(ve,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=De,exports.setLanguageIconResolver=Mt,exports.setMermaidLoader=Yn,exports.setMermaidWorker=function(e){Qn=e,Xn=null;const t=e;Qn.onmessage=e=>{if(Qn!==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))},Qn.onerror=e=>{var n,o;if(Qn===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)},Qn.onmessageerror=e=>{var n,o;if(Qn===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]})});
|
|
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 v="undefined"!=typeof document?document.currentScript:null;function h(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=h(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 k(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 M(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=M(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=M(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)?Je:tt),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=M(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})(),I=_.revision;function j(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 S=M(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,E=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 E?E(t,n,o):null}const B=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,A=(()=>{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 O(e){A&&console.warn(e)}function z(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function R(e,t){const n=e.toLowerCase();return!p.EXTENDED_STANDARD_HTML_TAGS.has(n)&&(z(t,n)||z(t,e))}function P(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 H(e){return e.trim().length>0}function $(e,t,n,o,a){if(p.BLOCKED_HTML_TAGS.has(e.toLowerCase()))return null;const s=function(e){const t={};for(const[n,o]of Object.entries(e)){const e=n.toLowerCase();p.DANGEROUS_HTML_ATTRS.has(e)||p.URL_HTML_ATTRS.has(e)&&o&&p.isUnsafeHtmlUrl(o)||(t[n]=o)}return t}(t);if(R(e,o)){const t=o[e]||o[e.toLowerCase()],r=function(e){const t={};for(const[n,o]of Object.entries(e))t[n]=P(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 U(e,t){if(!e||!e.includes("<"))return!1;if(!t||0===Object.keys(t).length)return!1;let n;for(B.lastIndex=0;null!==(n=B.exec(e));)if(R(n[1],t))return!0;return!1}function F(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=$(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=$(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&&O(`Auto-closing unclosed tag: <${l.tagName}>`)}else O(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),l=$(e.tagName,e.attrs||{},e.children,t,n);null!=l&&r.push(l),O(`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);H(t)&&r.push({type:"text",content:t})}break}if(i>l){const t=e.slice(l,i);H(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||p.VOID_HTML_TAGS.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,A&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const Y=M(m.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null},setup(e){const t=e,n=m.computed(()=>j(t.customId)),o=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0}},render(){return F(this.content,this.customComponents)||[]}}),r=m.computed(()=>{const e=t.node.content;return e?U(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;function W({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}const V=M(m.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>{var e,t;return null!=(t=null==(e=null==n?void 0:n.proxy)?void 0:e.$attrs)?t:{}}),r=m.inject("markstreamTypewriter",void 0),l=m.inject("markstreamTextStreamState",void 0),i=m.computed(()=>{const e=o.value.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),a=m.computed(()=>"boolean"==typeof i.value?i.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),s=m.computed(()=>{var e;const t=null!=(e=o.value["index-key"])?e:o.value.indexKey;return null==t||""===t?"":String(t)}),u=m.ref(t.node.code),c=m.ref(""),d=m.ref(0);function p(){return u.value+c.value}function f(e){u.value=e,c.value=""}m.watch([()=>t.node.code,s,a],([e])=>{const t=String(null!=e?e:""),n=p(),o=s.value,r=o?null==l?void 0:l.get(o):void 0,i=W({nextContent:t,previousContent:null!=r?r:n,typewriterEnabled:a.value});u.value=i.settledContent,c.value=i.streamedDelta,i.appended&&(d.value+=1),o&&(null==l||l.set(o,t))},{immediate:!0}),m.watch(a,e=>{e||f(p())});const v=m.computed(()=>d.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return{__sfc:!0,props:t,instance:n,attrs:o,inheritedTypewriter:r,inheritedTextStreamState:l,explicitTypewriter:i,typewriterEnabled:a,streamStateKey:s,settledCode:u,streamedDelta:c,streamFadeVersion:d,getRenderedContent:p,setFullContent:f,settleStreamedDelta:function(){c.value&&(u.value=p(),c.value="")},streamedDeltaClass:v}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return 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-['']"},[n.settledCode?t("span",[e._v(e._s(n.settledCode))]):e._e(),n.streamedDelta?t("span",{staticClass:"inline-code-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"38cc3b9f",null,null).exports,K=m.ref(!1),Q=m.ref(""),X=m.ref("top"),q=m.ref(null),Z=m.ref(null),G=m.ref(null),J=m.ref(null),ee=m.ref(null);let te=null,ne=null;function oe(){te&&(clearTimeout(te),te=null),ne&&(clearTimeout(ne),ne=null)}let re=!1,le=null;function ie(){return re||"undefined"==typeof document?Promise.resolve():le||(le=Promise.resolve().then(()=>oo).then(e=>{var t;re=!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:K.value,anchorEl:q.value,content:Q.value,placement:X.value,id:Z.value,originX:G.value,originY:J.value,isDark:null!=(t=ee.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{le=null,re=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),le)}function ae(e,t,n="top",o=!1,r,l){if(!e)return;ie(),oe();const i=()=>{var o,i;Z.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,q.value=e,Q.value=t,X.value=n,G.value=null!=(o=null==r?void 0:r.x)?o:null,J.value=null!=(i=null==r?void 0:r.y)?i:null,ee.value="boolean"==typeof l?l:null,K.value=!0;try{e.setAttribute("aria-describedby",Z.value)}catch(a){}};o?i():te=setTimeout(i,80)}function se(e=!1){oe();const t=()=>{if(q.value&&Z.value)try{q.value.removeAttribute("aria-describedby")}catch(e){}K.value=!1,q.value=null,Z.value=null,G.value=null,J.value=null};e?t():ne=setTimeout(t,120)}const ue={"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 ce(){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=ue[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 de=Symbol("ViewportPriority");function pe(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(de,a),a}function me(){const e=m.inject(de,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 fe=M(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},inline:{type:Boolean}},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=me();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.inject("markstreamInlineImages",void 0),f=m.getCurrentInstance(),v=m.computed(()=>{var e,t,n;const o=null==(e=null==f?void 0:f.vnode)?void 0:e.props;if(null!=o&&Object.prototype.hasOwnProperty.call(o,"inline"))return!0;const r=null==(n=null==(t=null==f?void 0:f.proxy)?void 0:t.$options)?void 0:n.propsData;return null!=r&&Object.prototype.hasOwnProperty.call(r,"inline")}),h=m.computed(()=>v.value?n.inline:!0===(null==p?void 0:p.value)),g=m.computed(()=>h.value?"span":"figure"),y=m.computed(()=>h.value?"image-node image-node--inline":"image-node image-node--block text-center my-8"),w=m.computed(()=>h.value?"span":"div"),x=m.computed(()=>h.value?"image-node__inner image-node__inner--inline":"relative inline-block"),k=m.computed(()=>h.value?"h-auto inline-block align-middle transition-opacity duration-200 ease-in-out":"max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out"),M=m.computed(()=>h.value?"placeholder-layer inline-flex items-center justify-center gap-1 align-middle":"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2"),b=m.computed(()=>h.value?T.value?{minHeight:n.svgMinHeight,width:"100%"}:void 0:T.value?{minHeight:n.svgMinHeight,width:"100%"}:{minHeight:"6rem"}),C=m.computed(()=>h.value?"image-node__error inline-flex items-center justify-center gap-1 text-red-500 align-middle":"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"),T=m.computed(()=>/\.svg(?:\?|$)/i.test(c.value)),{t:N}=ce();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,inheritedInlineImages:p,instance:f,hasInlineProp:v,inlineMode:h,rootTag:g,rootClass:y,innerTag:w,innerClass:x,imageClass:k,placeholderClass:M,placeholderStyle:b,errorClass:C,isSvg:T,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:N}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i(a.rootTag,{ref:"figureRef",tag:"component",class:a.rootClass},[i(a.innerTag,{tag:"component",class:a.innerClass},[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",class:a.errorClass},[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",class:a.placeholderClass,style:a.placeholderStyle},[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",class:[a.imageClass,{"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.inlineMode&&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)},[],!1,null,"bb7aa7f0",null,null).exports,ve=M(m.defineComponent({__name:"SoftBreakNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"soft-break",domProps:{textContent:e._s(" ")}})},[],!1,null,null,null,null).exports;let he=null,ge=!1,ye=ke;function we(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function xe(){try{const e=globalThis;return we(null==e?void 0:e.katex)}catch(e){return null}}function ke(){return(()=>d(this,null,function*(){const e=xe();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return we(t)}))()}function Me(e){ye=e,he=null,ge=!1}function be(){return"function"==typeof ye}function Ce(){return d(this,null,function*(){var e;const t=xe();if(t)return he=t,he;if(he)return he;if(ge)return null;const n=ye;if(!n)return ge=!0,null;try{const t=yield n();if(t)return he=null!=(e=we(t))?e:t,he}catch(o){}return ge=!0,null})}const Te=m.shallowRef(!1);let Ne=null;const De=M(m.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e,n=(Ne||(Ne=Ce().then(e=>{Te.value=!!e}).catch(()=>{Te.value=!1})),m.readonly(Te)),o=m.getCurrentInstance(),r=m.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=m.inject("markstreamTypewriter",void 0),i=m.inject("markstreamTextStreamState",void 0),a=m.inject("markstreamStreamVersion",void 0),s=m.computed(()=>{const e=r.value.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),u=m.computed(()=>"boolean"==typeof s.value?s.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=m.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),d=m.ref(t.node.content),p=m.ref(""),f=m.ref(0);function v(){return d.value+p.value}function h(e){d.value=e,p.value=""}function g(){p.value&&(d.value=v(),p.value="")}m.watch([()=>t.node.content,c,u,()=>null==a?void 0:a.value],([e])=>{const t=String(null!=e?e:""),n=v(),o=c.value,r=o?null==i?void 0:i.get(o):void 0,l=null!=r?r:n;if(!u.value)return h(t),void(o&&(null==i||i.set(o,t)));if(t===l)return p.value?g():n!==t&&h(t),void(o&&(null==i||i.set(o,t)));const a=W({nextContent:t,previousContent:l,typewriterEnabled:u.value});d.value=a.settledContent,p.value=a.streamedDelta,a.appended&&(f.value+=1),o&&(null==i||i.set(o,t))},{immediate:!0}),m.watch(u,e=>{e||h(v())});const y=m.computed(()=>f.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return{__sfc:!0,props:t,katexReady:n,instance:o,attrs:r,inheritedTypewriter:l,inheritedTextStreamState:i,inheritedStreamVersion:a,explicitTypewriter:s,typewriterEnabled:u,streamStateKey:c,settledContent:d,streamedDelta:p,streamFadeVersion:f,getRenderedContent:v,setFullContent:h,settleStreamedDelta:g,streamedDeltaClass:y}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&e.node.center?"text-node-center":""]},[n.settledContent?t("span",[e._v(e._s(n.settledContent))]):e._e(),n.streamedDelta?t("span",{staticClass:"text-node-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"356c331b",null,null).exports;function _e(e){return t=>{var n,o;return m.h(De,c(u({},t),{node:c(u({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function Ie(){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 _e(e=>`$${e}$`);try{if(yield Ce()){const e=yield Promise.resolve().then(()=>require("./chunks/index-c6f74f2d.cjs"));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 _e(e=>`$${e}$`)})}function je(){return d(this,null,function*(){var e;try{if(yield Ce()){const t=yield Promise.resolve().then(()=>require("./chunks/index-e1315bc2.cjs"));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 _e(e=>`$$${e}$$`)})}const Se=M(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,Ee=M(m.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,strong:Be,emphasis:Pe,footnote_reference:S,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,emoji:T,math_inline:Ie,reference:Se,softbreak:ve},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,"54fda8d4",null,null).exports,Le=M(m.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,strong:Be,emphasis:Pe,footnote_reference:S,strikethrough:Ae,highlight:Re,insert:ze,superscript:Ee,emoji:T,math_inline:Ie,reference:Se,softbreak:ve},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,"0740560a",null,null).exports,Be=M(m.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,emphasis:Pe,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,superscript:Ee,emoji:T,footnote_reference:S,math_inline:Ie,reference:Se,softbreak:ve},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,"27709563",null,null).exports,Ae=M(m.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,strong:Be,emphasis:Pe,highlight:Re,insert:ze,subscript:Le,superscript:Ee,emoji:T,footnote_reference:S,math_inline:Ie,reference:Se,softbreak:ve},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,"388291cf",null,null).exports,Oe=M(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",s=null!=(e=t.animationOpacity)?e:.35,u=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(n=t.color)?n:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(u),"--underline-duration":`${null!=(r=t.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}});m.provide("markstreamInlineImages",m.computed(()=>!0));const c={text:De,strong:Be,strikethrough:Ae,emphasis:Pe,image:fe,softbreak:ve,html_inline:Y,inline_code:V},d=m.useAttrs(),p=m.ref(null),f=m.ref(!1),v=m.computed(()=>{const e=u({},d);return delete e.title,e});function h(){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,ae(p.value,h(),"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&&ie(),m.nextTick(()=>{y()})}),m.onUpdated(()=>{y()}),m.onBeforeUnmount(()=>{a(),f.value&&(f.value=!1,se(!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:v,getTooltipText:h,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;ae(p.value||e.currentTarget,h(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(f.value=!1,se())},title:w,TextNode:De}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return n.node.loading?o("span",n._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:r.cssVars,attrs:{"aria-hidden":n.node.loading?"false":"true"}},"span",r.attrs,!1),[o("span",{staticClass:"link-text-wrapper relative inline-flex"},[o("span",{staticClass:"leading-[normal] link-text"},[o(r.TextNode,{staticClass:"leading-[normal] link-text",attrs:{node:{type:"text",content:String(null!=(e=n.node.text)?e:""),raw:String(null!=(t=n.node.text)?t:"")},"index-key":`${n.indexKey||"link-text"}-loading`}})],1),o("span",{staticClass:"link-loading-indicator",attrs:{"aria-hidden":"true"}})])]):o("a",n._b({ref:"anchorEl",staticClass:"link-node",style:r.cssVars,attrs:{href:n.node.href,title:n.showTooltip?"":r.title,"aria-label":`Link: ${r.title}`,"aria-hidden":n.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},on:{mouseenter:e=>r.onAnchorEnter(e),mouseleave:r.onAnchorLeave}},"a",r.anchorAttrs,!1),n._l(n.node.children,function(e,t){return o(r.nodeComponents[e.type],{key:`${n.indexKey||"emphasis"}-${t}`,tag:"component",attrs:{node:e,"custom-id":r.props.customId,"index-key":`${n.indexKey||"link-text"}-${t}`}})}),1)},[],!1,null,"62007177",null,null).exports,ze=M(m.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,strong:Be,emphasis:Pe,strikethrough:Ae,highlight:Re,subscript:Le,superscript:Ee,emoji:T,footnote_reference:S,math_inline:Ie,reference:Se,softbreak:ve},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,"88ac685e",null,null).exports,Re=M(m.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,strong:Be,emphasis:Pe,strikethrough:Ae,insert:ze,subscript:Le,superscript:Ee,emoji:T,footnote_reference:S,math_inline:Ie,reference:Se,softbreak:ve},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,"452c2d33",null,null).exports,Pe=M(m.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,html_inline:Y,strong:Be,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,superscript:Ee,emoji:T,footnote_reference:S,math_inline:Ie,reference:Se,softbreak:ve},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,"79d1ccf1",null,null).exports,He=M(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,$e=M(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)?Je:tt);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,Ue=M(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,Fe=M(m.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return m.provide("markstreamInlineImages",m.computed(()=>!0)),{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:De,inline_code:V,link:Oe,image:fe,strong:Be,emphasis:Pe,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,superscript:Ee,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:S,hardbreak:Ue,softbreak:ve,math_inline:Ie,reference:Se},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,"194f91db",null,null).exports,Ye=M(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)?Je:tt);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,We=M(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(()=>(I.value,j(n).list_item||Ye))}}}),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,Ve=M(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(()=>j(t.customId)),r=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0}},render(){return F(this.content,this.customComponents)||[]}}),l=m.computed(()=>{const e=t.node.content;return e?U(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=me();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,Ke=M(m.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId),o=m.computed(()=>0===t.node.children.length?"p":t.node.children.every(e=>{var t;return"image"===e.type||"softbreak"===e.type||"text"===e.type&&""===String(null!=(t=e.content)?t:"").trim()})?"div":"p");m.provide("markstreamInlineImages",m.computed(()=>"p"===o.value));const r=u({inline_code:V,image:fe,link:Oe,hardbreak:Ue,softbreak:ve,emphasis:Pe,strong:Be,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,superscript:Ee,html_inline:Y,html_block:Ve,emoji:T,checkbox:b,math_inline:Ie,checkbox_input:b,reference:Se,footnote_anchor:He,footnote_reference:S,text:De},n);return{__sfc:!0,props:t,overrides:n,paragraphTag:o,nodeComponents:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.paragraphTag,{tag:"component",staticClass:"paragraph-node",attrs:{dir:"auto"}},e._l(e.node.children,function(o,r){var l;return t(n.nodeComponents[o.type],{key:`${e.indexKey||"paragraph"}-${r}`,tag:"component",attrs:{node:o,"index-key":`${null!=(l=e.indexKey)?l:"paragraph"}-${r}`,"custom-id":n.props.customId}})}),1)},[],!1,null,"96096700",null,null).exports,Qe=M(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,Xe=M(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)?Je:tt);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,qe=M(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,Ze=M(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,Ge=M(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=j(t.customId),r=u({text:De,paragraph:Ke,heading:Fe,inline_code:V,link:Oe,image:fe,strong:Be,emphasis:Pe,strikethrough:Ae,insert:ze,subscript:Le,superscript:Ee,checkbox:b,checkbox_input:b,hardbreak:Ue,softbreak:ve,math_inline:Ie,reference:Se,list:We,math_block:je,table:Xe},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||Ze}}}}),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,"cb57a559",null,null).exports,Je=M(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},customHtmlTags:null},emits:["copy","handleArtifactClick"],setup(e,{emit:t}){const n=e,o={text:De,paragraph:Ke,heading:Fe,code_block:Qe,list:We,list_item:Ye,blockquote:et,table:Xe,definition_list:C,footnote:$e,footnote_reference:S,footnote_anchor:He,admonition:nt,vmr_container:Ge,hardbreak:Ue,softbreak:ve,link:Oe,image:fe,thematic_break:qe,math_inline:Ie,math_block:je,strong:Be,emphasis:Pe,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,superscript:Ee,emoji:T,checkbox:b,checkbox_input:b,inline_code:V,html_inline:Y,html_block:Ve,reference:Se},r=m.computed(()=>(I.value,j(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}:{})),d=m.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),p=m.computed(()=>{var e;const t=null!=(e=n.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),f=m.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n;let i=e;const a=g(i),s=String((null==i?void 0:i.type)||"unknown");let d=y(i,a);if(("html_block"===i.type||"html_inline"===i.type)&&d===o[i.type]){const e=String(null!=(n=i.tag)?n:"").trim().toLowerCase()||v(i.content);if(e&&p.value.has(e)){const t=r.value[e];t&&(d=t,i=c(u({},i),{type:e,tag:e,content:h(i.content,e)}))}}return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===s?`${l.value}-${t}-${s}`:`${l.value}-${t}-${s}-${String((null==e?void 0:e.raw)||"").length}`,node:i,isCodeBlock:"code_block"===(null==i?void 0:i.type),component:d,bindings:w(i,a)}}));function v(e){const t=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return t?t[1].toLowerCase():""}function h(e,t){const n=String(null!=e?e:"");if(!t)return n;const o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(r,"").replace(l,"")}function g(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function y(e,t){if(!e)return Ze;const l=r.value,i=l[String(e.type)];if("code_block"===e.type){const o=null!=t?t:g(e);return"mermaid"===o?l.mermaid||Qe:"infographic"===o?l.infographic||Qe:"d2"===o||"d2lang"===o?l.d2||Qe:i||(l.code_block||(n.renderCodeBlocksAsPre,Qe))}return i||o[String(e.type)]||Ze}function w(e,t){const n=null!=t?t:g(e);return"mermaid"===n||"infographic"===n||"d2"===n||"d2lang"===n?{}:"link"===e.type?s.value:"list"===e.type?d.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:d,effectiveCustomHtmlTagsSet:p,renderedItems:f,getHtmlTagFromContent:v,stripCustomHtmlWrapper:h,getCodeBlockLanguage:g,getNodeComponent:y,getBindingsFor:w,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,et=M(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)?Je:tt);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,tt=M(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,h=m.getCurrentInstance(),g=m.computed(()=>l.debugPerformance&&f&&"undefined"!=typeof console),y=m.computed(()=>{var e,t;return null!=(t=null==(e=null==h?void 0:h.proxy)?void 0:e.$attrs)?t:{}}),x=new Map,k=m.ref(0),M=m.computed(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const t=null!=(e=y.value.showTooltips)?e:y.value["show-tooltips"];return""===t||!0===t||"true"===t||!1!==t&&"false"!==t&&void 0});function N(e,t){g.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function D(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}m.provide("markstreamShowTooltips",M),m.provide("markstreamTypewriter",m.computed(()=>!1!==l.typewriter)),m.provide("markstreamTextStreamState",x),m.provide("markstreamStreamVersion",k),m.watch([()=>l.content,()=>l.nodes],()=>{k.value+=1},{immediate:!0});const _=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,E=p.getMarkdown(_),L=new Map,B=m.markRaw([]),A=m.computed(()=>{const{key:e,tags:t}=R(l.customHtmlTags);if(!e)return E;const n=L.get(e);if(n)return n;const o=p.getMarkdown(_,{customHtmlTags:t});return L.set(e,o),o}),O=m.computed(()=>{const e=A.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function z(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 R(e){if(!e||0===e.length)return{key:"",tags:[]};const t=new Set,n=[];for(const o of e){const e=z(o);e&&!t.has(e)&&(t.add(e),n.push(e))}return 0===n.length?{key:"",tags:[]}:{key:n.join(","),tags:n}}function P(e){if(Array.isArray(e))return Object.freeze(e.map(e=>P(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=P(o);return Object.freeze(t)}function H(e){return e.map(e=>P(e))}const $=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(z).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}),U=m.computed(()=>{var e;const t=null!=(e=$.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),F=m.computed(()=>{var e;if(w(null==h?void 0:h.proxy)&&!l.content&&Array.isArray(l.nodes))return B;if(null==(e=l.nodes)?void 0:e.length)return m.markRaw(H(l.nodes));if(l.content){const e=g.value?performance.now():0,t=p.parseMarkdownToStructure(l.content,O.value,$.value);return g.value&&N("parse(sync)",{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:l.content.length}),m.markRaw(H(t))}return[]}),W=m.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),K=m.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&F.value.length>W.value}),Q=m.computed(()=>!1!==l.viewportPriority&&!a.value),X=pe(e=>{var t;return D(null!=(t=null!=e?e:i.value)?t:null)},Q),q=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,Z=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,G="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),J=f&&"function"==typeof window.requestIdleCallback,ee=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),te=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:ee.value);return Number.isFinite(t)?Math.max(0,t):ee.value}),ne=m.computed(()=>!1!==l.batchRendering&&ee.value>0&&f&&!G),oe=m.ref(0),re=m.ref({key:l.indexKey,total:0}),le=m.ref(Math.max(1,ee.value||1)),ie=m.reactive({}),ae=new Map,se=new Map,ue=new Map,ce=new WeakMap,de=m.ref(0),me=m.computed(()=>(de.value,Array.from(ue.entries()).sort((e,t)=>e[0]-t[0]))),he=m.ref(null);let ge=null,ye=null;const we=m.reactive({start:0,end:0}),xe=m.computed(()=>{if(!K.value)return F.value.map((e,t)=>({node:e,index:t}));const e=F.value.length,t=gt(we.start,0,e),n=gt(we.end,t,e);return F.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),ke=m.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!K.value&&!(F.value.length>900)&&Q.value}),Me=m.computed(()=>{var e;return ne.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),be=m.ref({batchSize:ee.value,initial:te.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Me.value}),Ce=m.computed(()=>!!X&&(ke.value||K.value)),Te=m.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),Ne=m.ref(0),_e=new Map,tt=m.computed(()=>w(null==h?void 0:h.proxy)),ot=m.computed(()=>tt.value&&!l.content&&Array.isArray(l.nodes)),rt=m.computed(()=>ot.value?m.markRaw(H(l.nodes||[])):B);function lt(){var e,t;const n=null==h?void 0:h.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of xe.value){const n=it(o[`node-slot-${l.index}`]),i=it(o[`node-content-${l.index}`]);(null!=(e=ue.get(l.index))?e:null)!==n&&Ht(l.index,n),(null!=(t=_e.get(l.index))?t:null)!==i&&Ut(l.index,i),r.add(l.index)}for(const l of Array.from(ue.keys()))r.has(l)||Ht(l,null);for(const l of Array.from(_e.keys()))r.has(l)||Ut(l,null)}function it(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const at=m.computed(()=>{if(!K.value)return F.value.length;const e=Te.value,t=Math.max(we.end+e,te.value),n=Math.min(F.value.length,t);return Math.max(oe.value,n)});function st(e){var t,n,o,r;const l=D(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 ut(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 ct(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(!ut(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 dt(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 pt(){ge&&(ge(),ge=null),he.value=null}function mt(){if(!f||!K.value)return;const e=st();if(!e||he.value===e)return;pt();const t=()=>vt();e.addEventListener("scroll",t,{passive:!0}),he.value=e,ge=()=>{e.removeEventListener("scroll",t)}}function ft(){var e,t,n;if(!ye)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;ye.viaTimeout?o?o.clearTimeout(ye.id):clearTimeout(ye.id):null==Z||Z(ye.id),ye=null}function vt(e={}){var t,n,o;if(!K.value)return;if(!f)return void ht(!0);if(e.immediate)return ft(),void ht(!0);if(ye)return;const r=()=>{ye=null,ht()};if(q)ye={id:q(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);ye={id:l,viaTimeout:!0}}}function ht(e=!1){var t,n,o,r,l,a,s;if(!K.value)return;const u=he.value||st();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=F.value.length;if(!p&&m>0&&ut(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=gt(Ot(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,m-1));return void((e||Math.abs(r-Ne.value)>1)&&(Ne.value=r))}const f=p?null:u.getBoundingClientRect(),v=p?0:f.top,h=p?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=me.value;let y=null,w=null;for(const[i,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=v||e.top>=h||(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=ct(u,c,p),o=p?(()=>{const n=e.getBoundingClientRect(),o=(p?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=dt(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=At(o+.5*Math.max(0,m));return void(Ne.value=gt(f,0,Math.max(0,F.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-Ne.value)<=1||(Ne.value=gt(x,0,Math.max(0,F.value.length-1)))}function gt(e,t,n){return Math.min(Math.max(e,t),n)}function yt(){const e=F.value.length;if(!K.value||0===e)return we.start=0,void(we.end=e);const t=Math.min(W.value,e),n=Te.value,o=gt(Ne.value-n,0,Math.max(0,e-t));we.start=o,we.end=Math.min(e,o+t)}const wt=m.reactive({}),xt=m.reactive({total:0,count:0}),kt=m.ref(0),Mt=m.ref([]),bt=m.ref([]);function Ct(){for(const e of Object.keys(wt))delete wt[Number(e)];xt.total=0,xt.count=0,kt.value=0,Mt.value=[],bt.value=[]}function Tt(e){if(e<=0)return void Ct();let t=0,n=0;for(const[o,r]of Object.entries(wt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete wt[l]:(t+=i,n++)}xt.total=t,xt.count=n}function Nt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Dt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function _t(e,t,n){if(n<=t)return 0;const o=Dt(e,n-1);return t<=0?o:o-Dt(e,t-1)}function It(e){kt.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(wt)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(Nt(t,l,i),Nt(n,l,1))}Mt.value=t,bt.value=n}function jt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=wt[e];if(wt[e]=t,n?xt.total+=t-n:(xt.total+=t,xt.count++),kt.value>e){const o=Mt.value,r=bt.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&Nt(o,e,r)}else Nt(o,e,t),Nt(r,e,1)}}const St=m.computed(()=>xt.count>0?Math.max(12,xt.total/xt.count):32);function Et(e,t){var n,o;if(e>=t)return 0;if(kt.value!==F.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=wt[r])?n:St.value;return o}const r=Mt.value,l=bt.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=wt[r])?o:St.value;return n}return _t(r,e,t)+(t-e-_t(l,e,t))*St.value}m.watch(()=>F.value.length,e=>{e<=0?Ct():(e<kt.value&&Tt(e),e!==kt.value&&It(e))},{immediate:!0});const Lt=m.computed(()=>K.value?Et(0,Math.min(we.start,F.value.length)):0),Bt=m.computed(()=>{if(!K.value)return 0;const e=F.value.length;return Et(Math.min(we.end,e),e)});function At(e){var t;if(e<=0)return 0;const n=F.value;if(kt.value===n.length&&Mt.value.length&&bt.value.length){const t=St.value,o=Mt.value,r=bt.value,l=e=>e<=0?0:Dt(o,e-1)+(e-Dt(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=wt[r])?t:St.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function Ot(e){var t;const n=F.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(kt.value===n.length){const t=Et(0,n.length);return At(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=wt[r])?t:St.value;if(o<=e)return r;o-=e}return 0}function zt(e){if(!ae.size)return;if(!K.value)return;let t=!1;for(const[n,o]of ae)n>=e&&(o.destroy(),ae.delete(n),ke.value&&delete ie[n],Xt(n),ue.delete(n)&&(t=!0));t&&$t()}function Rt(e,t){ke.value&&(ie[e]=t),t&&(K.value?vt():Ne.value=gt(e,0,Math.max(0,F.value.length-1)))}function Pt(e){const t=ae.get(e);t&&(t.destroy(),ae.delete(e)),Xt(e)}function Ht(e,t){let n=!1;if(t){const o=ue.get(e);ue.set(e,t),o!==t&&(n=!0)}else ue.delete(e)&&(n=!0);if(n&&$t(),t||Xt(e),!Ce.value||!X)return Pt(e),void(t?Rt(e,!0):ke.value&&delete ie[e]);if(!K.value&&ke.value&&!a.value&&ae.size>=640&&(Zt("too-many-targets"),!Ce.value||!X))return Pt(e),void(t?Rt(e,!0):ke.value&&delete ie[e]);if(e<te.value&&!K.value)return Pt(e),void Rt(e,!0);if(!t)return Pt(e),void(ke.value&&delete ie[e]);Pt(e);const o=X(t,{rootMargin:"400px"});o&&(ae.set(e,o),Rt(e,o.isVisible.value),ke.value&&qt(e),o.whenVisible.then(()=>{Xt(e),Rt(e,!0)}).catch(()=>{}).finally(()=>{ae.get(e)===o&&ae.delete(e);try{o.destroy()}catch(t){}}),K.value&&vt())}function $t(){de.value+=1}function Ut(e,t){t?(_e.set(e,t),queueMicrotask(()=>{jt(e,t.offsetHeight)})):_e.delete(e)}m.onMounted(()=>{f&&m.nextTick(lt)}),m.watch(xe,()=>{f&&m.nextTick(lt)}),m.watch(oe,()=>{f&&m.nextTick(lt)}),m.watch(K,()=>{f&&m.nextTick(lt)});let Ft=null,Yt=null,Wt=!1,Vt=null,Kt=null;function Qt(){f&&(null!=Ft&&(null==Z||Z(Ft),Ft=null),null!=Yt&&(window.clearTimeout(Yt),Yt=null),null!=Kt&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Kt),Kt=null),Wt=!1,Vt=null)}function Xt(e){if(!f)return;const t=se.get(e);null!=t&&(window.clearTimeout(t),se.delete(e))}function qt(e){if(!f||!ke.value)return;Xt(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(se.delete(e),!ke.value)return;if(!0===ie[e])return;const o=ue.get(e);if(!o)return void delete ie[e];const r=st(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&&Rt(e,!0)},1800+t);se.set(e,n)}function Zt(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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 ae.values())e.destroy();if(ae.clear(),f)for(const e of se.values())window.clearTimeout(e);se.clear();for(const e of Object.keys(ie))delete ie[e]}}function Gt(e,t={}){var n,o;if(!Me.value)return;const r=at.value;if(oe.value>=r)return;const i=Math.max(1,e),a=e=>{var t;Ft=null,Yt=null,Kt=null,Wt=!1;const n=null!=Vt?Vt:i;Vt=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();oe.value=Math.min(r,oe.value+Math.max(1,e)),zt(oe.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return en(n),n};let s=n;for(;(a(s),!(oe.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(le.value));oe.value<r&&Jt()};if(!f||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(Vt=null!=Vt?Math.max(Vt,i):i,!Wt){if(Wt=!0,!G&&J&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(Kt=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}q&&!G?Ft=q(()=>{0!==s?Yt=window.setTimeout(()=>a(),s):a()}):Yt=window.setTimeout(()=>a(),s)}}function Jt(){Me.value&&Gt(ne.value?Math.max(1,Math.round(le.value)):Math.max(1,ee.value))}function en(e){var t;if(!Me.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,ee.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?le.value=Math.max(r,Math.floor(.7*le.value)):e<.5*n&&le.value<o&&(le.value=Math.min(o,Math.ceil(1.2*le.value)))}function tn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-b8d5777d.cjs"));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),Qe}})}function nn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-91325ae4.cjs"));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),Qe}})}function on(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-8693b3db.cjs"));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),Qe}})}function rn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>an);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),Qe}})}m.watch([()=>F.value,()=>F.value.length,()=>Me.value,()=>ee.value,()=>te.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=F.value.length,n=re.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;re.value={key:o,total:t};const s=be.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==ee.value||s.initial!==te.value||s.delay!==u||s.enabled!==Me.value;be.value={batchSize:ee.value,initial:te.value,delay:u,enabled:Me.value},(a||c||!Me.value)&&Qt(),(a||c)&&(le.value=Math.max(1,ee.value||1)),a&&K.value&&vt({immediate:!0});const d=at.value;if(!t)return 0!==oe.value&&(oe.value=0),void zt(0);if(!Me.value)return oe.value!==d&&(oe.value=d),void zt(oe.value);if(r||0===n.total||c){const e=Math.min(d,te.value);oe.value!==e&&(oe.value=e)}else{const e=Math.min(oe.value,d);oe.value!==e&&(oe.value=e)}const p=Math.max(1,te.value||ee.value||t);oe.value<d?Gt(p,{immediate:!f}):zt(oe.value)},{immediate:!0}),m.watch(()=>K.value,e=>{if(!e)return pt(),void ft();mt(),vt({immediate:!0})},{immediate:!0}),m.watch([()=>F.value.length,()=>K.value],e=>d(this,[e],function*([e,t]){t&&e&&f&&(yield m.nextTick(),vt({immediate:!0}))}),{flush:"post"}),m.watch(()=>i.value,()=>{K.value&&(mt(),vt({immediate:!0}))}),m.watch(()=>F.value.length,()=>{K.value&&vt({immediate:!0})}),m.watch(()=>ke.value,e=>{if(e)for(const[t,n]of ue)Ht(t,n);else{for(const e of ae.values())e.destroy();ae.clear();for(const e of Array.from(se.keys()))Xt(e);for(const e of Object.keys(ie))delete ie[e];for(const[e,t]of ue)t&&Rt(e,!0)}},{immediate:!1}),m.watch([()=>l.viewportPriority,()=>F.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),m.watch(()=>oe.value,()=>{K.value&&vt({immediate:!0})}),m.watch([Ne,W,Te,()=>F.value.length,K],()=>{yt()},{immediate:!0}),m.watch([()=>F.value.length,K,W,Te,()=>we.start,()=>we.end],([e,t,n,o,r,l])=>{g.value&&N("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:Ne.value,scroll:t?(()=>{const e=he.value||st();return e?{reverse:ut(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:oe.value})}),m.watch(()=>at.value,(e,t)=>{Me.value&&("number"==typeof t&&e<=t||e>oe.value&&Jt())}),m.onBeforeUnmount(()=>{Qt();for(const e of ae.values())e.destroy();ae.clear();for(const e of Array.from(se.keys()))Xt(e);pt(),ft()});const ln=m.computed(()=>l.renderCodeBlocksAsPre?Qe:tn),sn={text:De,paragraph:Ke,heading:Fe,code_block:tn,list:We,list_item:Ye,blockquote:et,table:Xe,definition_list:C,footnote:$e,footnote_reference:S,footnote_anchor:He,admonition:nt,vmr_container:Ge,hardbreak:Ue,softbreak:ve,link:Oe,image:fe,thematic_break:qe,math_inline:Ie,math_block:je,strong:Be,emphasis:Pe,strikethrough:Ae,highlight:Re,insert:ze,subscript:Le,superscript:Ee,emoji:T,checkbox:b,checkbox_input:b,inline_code:V,html_inline:Y,reference:Se,html_block:Ve},un=m.computed(()=>(I.value,j(l.customId))),cn=m.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),dn=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||{})),pn=m.computed(()=>u({},l.mermaidProps||{})),mn=m.computed(()=>u({},l.d2Props||{})),fn=m.computed(()=>u({},l.infographicProps||{})),vn=m.computed(()=>({typewriter:l.typewriter})),hn=m.computed(()=>u(u({},vn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),gn=m.computed(()=>u(u({},vn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),yn=m.computed(()=>rt.value.map((e,t)=>{var n;const o=Cn(e);let r=e,l=Dn(e,o);if(("html_block"===e.type||"html_inline"===e.type)&&l===sn[e.type]){const t=String(null!=(n=e.tag)?n:"").trim().toLowerCase()||Mn(e.content);if(t&&U.value.has(t)){const n=un.value[t];n&&(l=n,r=c(u({},e),{type:t,tag:t,content:bn(e.content,t)}))}}return{node:r,component:l,bindings:_n(r,o),isCodeBlock:"code_block"===r.type,index:t,indexKey:`${cn.value}-${t}`,renderKey:Nn(r,t)}})),wn=m.computed(()=>!(!tt.value||!l.content)&&F.value.some(e=>Tn(e))),xn=m.computed(()=>xe.value.map(e=>{var t;let n=kn(e.node);const o=Cn(n);let r=Dn(n,o);if(("html_block"===n.type||"html_inline"===n.type)&&r===sn[n.type]){const e=String(null!=(t=n.tag)?t:"").trim().toLowerCase()||Mn(n.content);if(e&&U.value.has(e)){const t=un.value[e];t&&(r=t,n=c(u({},n),{type:e,tag:e,content:bn(n.content,e)}))}}return c(u({},e),{node:n,component:r,bindings:_n(n,o),isCodeBlock:"code_block"===n.type,indexKey:`${cn.value}-${e.index}`,renderKey:Nn(n,e.index)})}));function kn(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=ce.get(s);if(d&&d.signature===c)return d.node;const p=u({},s);return ce.set(s,{signature:c,node:p}),p}function Mn(e){const t=String(null!=e?e:"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return t?t[1].toLowerCase():""}function bn(e,t){const n=String(null!=e?e:"");if(!t)return n;const o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),l=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(r,"").replace(l,"")}function Cn(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function Tn(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 Nn(e,t){const n=`${cn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown");if("code_block"===o)return n;const 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(tt.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function Dn(e,t){if(!e)return Ze;const n=un.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:Cn(e);if("mermaid"===r)return n.mermaid||nn;if("infographic"===r)return n.infographic||on;if("d2"===r||"d2lang"===r)return n.d2||rn;if(o)return o;return n.code_block||ln.value}return o||sn[String(e.type)]||Ze}function _n(e,t){const n=null!=t?t:Cn(e);return"mermaid"===n?pn.value:"infographic"===n?fn.value:"d2"===n||"d2lang"===n?mn.value:"link"===e.type?hn.value:"list"===e.type?gn.value:"code_block"===e.type?dn.value:vn.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:h,debugPerformanceEnabled:g,attrs:y,textStreamState:x,streamRenderVersion:k,resolvedShowTooltips:M,logPerf:N,resolveViewportRoot:D,instanceMsgId:_,defaultMd:E,customTagCache:L,EMPTY_PARSED_NODES:B,mdBase:A,mdInstance:O,normalizeCustomTag:z,resolveCustomHtmlTags:R,cloneNodeValue:P,cloneParsedNodeList:H,mergedParseOptions:$,effectiveCustomHtmlTagsSet:U,parsedNodes:F,maxLiveNodesResolved:W,virtualizationEnabled:K,viewportPriorityEnabled:Q,registerNodeVisibility:X,requestFrame:q,cancelFrame:Z,isTestEnv:G,hasIdleCallback:J,resolvedBatchSize:ee,resolvedInitialBatch:te,batchingEnabled:ne,renderedCount:oe,previousRenderContext:re,adaptiveBatchSize:le,nodeVisibilityState:ie,nodeVisibilityHandles:ae,nodeVisibilityFallbackTimers:se,nodeSlotElements:ue,codeBlockRenderCache:ce,nodeSlotVersion:de,sortedNodeSlots:me,scrollRootElement:he,detachScrollHandler:ge,pendingFocusSync:ye,liveRange:we,visibleNodes:xe,deferNodes:ke,incrementalRenderingActive:Me,previousBatchConfig:be,shouldObserveSlots:Ce,liveNodeBufferResolved:Te,focusIndex:Ne,nodeContentElements:_e,legacyVue26:tt,legacyNodesMode:ot,legacyNodeItems:rt,syncNodeRefs:lt,resolveTemplateRef:it,desiredRenderedCount:at,resolveScrollContainer:st,isReverseFlexScrollRoot:ut,getNormalizedScrollTop:ct,getOffsetTopWithinRoot:dt,cleanupScrollListener:pt,setupScrollListener:mt,cancelScheduledFocusSync:ft,scheduleFocusSync:vt,syncFocusToScroll:ht,clamp:gt,updateLiveRange:yt,nodeHeights:wt,heightStats:xt,heightTreeSize:kt,heightSumTree:Mt,heightKnownTree:bt,resetHeightMeasurements:Ct,pruneHeightMeasurements:Tt,fenwickUpdate:Nt,fenwickQuery:Dt,fenwickRangeSum:_t,rebuildHeightTrees:It,recordNodeHeight:jt,averageNodeHeight:St,estimateHeightRange:Et,topSpacerHeight:Lt,bottomSpacerHeight:Bt,estimateIndexForOffset:At,estimateIndexForOffsetFromEnd:Ot,cleanupNodeVisibility:zt,markNodeVisible:Rt,shouldRenderNode:function(e){return!(Me.value&&e>=oe.value)&&(!ke.value||e<te.value||!0===ie[e])},destroyNodeHandle:Pt,setNodeSlotElement:Ht,bumpNodeSlotVersion:$t,setNodeContentRef:Ut,batchRaf:Ft,batchTimeout:Yt,batchPending:Wt,pendingIncrement:Vt,batchIdle:Kt,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:Qt,clearVisibilityFallback:Xt,scheduleVisibilityFallback:qt,autoDisableViewportPriority:Zt,scheduleBatch:Gt,queueNextBatch:Jt,adjustAdaptiveBatchSize:en,CodeBlockNodeAsync:tn,MermaidBlockNodeAsync:nn,InfographicBlockNodeAsync:on,D2BlockNodeAsync:rn,codeBlockComponent:ln,nodeComponents:sn,customComponentsMap:un,indexPrefix:cn,codeBlockBindings:dn,mermaidBindings:pn,d2Bindings:mn,infographicBindings:fn,nonCodeBindings:vn,linkBindings:hn,listBindings:gn,legacyRenderedItems:yn,legacyStructuredContentMode:wn,renderedItems:xn,getCodeBlockRenderNode:kn,getHtmlTagFromContent:Mn,stripCustomHtmlWrapper:bn,getCodeBlockLanguage:Cn,isLegacyStructuredNode:Tn,getRenderKey:Nn,getNodeComponent:Dn,getBindingsFor:_n,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:Je}}}),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,"custom-html-tags":n.props.customHtmlTags},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,"7e238230",null,null).exports,nt=M(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)?Je:tt);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 ot=!1,rt=null,lt=!1;function it(){return d(this,null,function*(){var e;if(rt)return rt;if(lt)return null;try{const t=yield Promise.resolve().then(()=>require("./chunks/index.legacy-70f0e155.cjs")).then(e=>e.index_legacy);return rt=null!=(e=null==t?void 0:t.default)?e:t,yield function(e){return d(this,null,function*(){if(ot)return;ot=!0;const t=null==globalThis?void 0:globalThis.MonacoEnvironment;return!t||"function"!=typeof t.getWorker&&"function"!=typeof t.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(rt),(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}})}(rt))?rt:(rt=null,lt=!0,null)}catch(t){return lt=!0,null}})}const at='<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',st='<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',ut='<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 ct=null,dt=null,pt=null;const mt=m.ref(0),ft={"":ut,plain:ut,text:ut,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:at,csharp:at,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:st,powershell:st,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'},vt={"":"",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 ht(){return d(this,null,function*(){return dt||(pt||(pt=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(dt=e.EXTENDED_LANGUAGE_ICON_MAP,mt.value++,dt)).catch(()=>null)),pt)})}function gt(e){ct=null!=e?e:null}function yt(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=vt[n])?t:n}function wt(e){const t=yt(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function xt(e){if(ct){const t=ct(e);if(null!=t&&""!==t)return t}const t=yt(e),n=ft[t];if(n)return n;return(null==dt?void 0:dt[t])||(ht(),'<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 kt={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"},Mt=new Map,bt=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","hardbreak","softbreak","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 Ct(e){const t=function(e){if(!e||0===e.length)return[];const t=new Set,n=[];for(const o of e){const e=At(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=Mt.get(n);return o||(o=p.getMarkdown(n,{customHtmlTags:t}),Mt.set(n,o)),{markdown:o,options:{allowHtml:!1!==e.allowHtml,customNodeTag:At(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function Tt(e,t){return(Array.isArray(e)?e:[]).map(e=>Nt(e,t)).join("")}function Nt(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return Rt(Bt(e.content));case"paragraph":return`<p>${Tt(Lt(e.children),t)}</p>`;case"strong":return`<strong>${Tt(Lt(e.children),t)}</strong>`;case"emphasis":return`<em>${Tt(Lt(e.children),t)}</em>`;case"strikethrough":return`<del>${Tt(Lt(e.children),t)}</del>`;case"highlight":return`<mark>${Tt(Lt(e.children),t)}</mark>`;case"insert":return`<ins>${Tt(Lt(e.children),t)}</ins>`;case"subscript":return`<sub>${Tt(Lt(e.children),t)}</sub>`;case"superscript":return`<sup>${Tt(Lt(e.children),t)}</sup>`;case"inline_code":return`<code>${Rt(Bt(e.code))}</code>`;case"hardbreak":return"<br>";case"softbreak":return" ";case"link":return function(e,t){const n=Bt(e.href),o=Bt(e.title),r=Lt(e.children).length>0?Tt(Lt(e.children),t):Rt(Bt(e.text||n)),l=o?` title="${Pt(o)}"`:"";return`<a${n?` href="${Pt(n)}"`:""}${l} target="_blank" rel="noreferrer noopener">${r}</a>`}(e,t);case"image":return function(e){const t=Bt(e.src),n=Bt(e.alt),o=Bt(e.title),r=o?` title="${Pt(o)}"`:"";return`<img src="${Pt(t)}" alt="${Pt(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)}"`:""}>${Tt(Lt(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${Tt(Lt(e.children),t)}</li>`;case"blockquote":return`<blockquote>${Tt(Lt(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}>${Tt(Lt(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=zt(Bt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${Rt(Bt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?Dt(e.header,t,!0):"",o=Tt(Lt(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return Dt(e,t);case"table_cell":return _t(e,t);case"definition_list":return function(e,t){return`<dl>${Lt(e.items).map(e=>It(e,t)).join("")}</dl>`}(e,t);case"definition_item":return It(e,t);case"footnote":return function(e,t){return`<div id="fnref--${Pt(Bt(e.id))}" class="markstream-nested-footnote">${Tt(Lt(e.children),t)}</div>`}(e,t);case"footnote_reference":return function(e){const t=Rt(Bt(e.id));return`<sup class="markstream-nested-footnote-ref"><a href="#fnref--${Pt(Bt(e.id))}">[${t}]</a></sup>`}(e);case"admonition":return function(e,t){const n=zt(Bt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${Rt(Bt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${Tt(Lt(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return Rt(Bt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${Rt(Bt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${Rt(Bt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${Rt(Bt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=Bt(e.content);return n?t.options.allowHtml?e.loading&&!e.autoClosed?Rt(n):n:Rt(n):""}(e,t);default:return function(e,t){const n=Bt(e.tag||e.type);if(!n||bt.has(n))return Rt(Bt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${zt(n)||"node"}`,St(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)Ot(i)&&("class"!==i?!0===a?o.push(` ${i}`):o.push(` ${i}="${Pt(String(a))}"`):r.push(String(a)));const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${Pt(l)}"`),o.join("")}(e.attrs,o),l=function(e,t){const n=Lt(e.children);if(n.length>0)return Tt(n,t);const o=Bt(e.content);return o?jt(o,t):Rt(Bt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${Pt(n)}">${l}</${i}>`}(e,t)}}function Dt(e,t,n=!1){return`<tr>${Lt(e.cells).map(e=>_t(e,t,n)).join("")}</tr>`}function _t(e,t,n=!1){const o=n||e.header?"th":"td",r=Bt(e.align);return`<${o}${r?` style="text-align:${Pt(r)}"`:""}>${Tt(Lt(e.children),t)}</${o}>`}function It(e,t){return`<dt>${Tt(Lt(e.term),t)}</dt><dd>${Tt(Lt(e.definition),t)}</dd>`}function jt(e,t){return e?t.markdown.render(e):""}function St(e,t){return t?Et("function"==typeof t?t(e):t):""}function Et(e){return Array.isArray(e)?e.map(e=>Et(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function Lt(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function Bt(e){return"string"==typeof e?e:null==e?"":String(e)}function At(e){const t=Bt(e).trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w:-]*)/i);return n?n[1].toLowerCase():""}function Ot(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function zt(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Rt(e){return Bt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Pt(e){return Rt(e).replace(/`/g,"`")}const Ht=new Map;function $t(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=Ut(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=Ut(e.customHtmlTags),n=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${t.join(",")}`;let o=Ht.get(n);return o||(o=p.getMarkdown(n,{customHtmlTags:t}),Ht.set(n,o)),e.customMarkdownIt?e.customMarkdownIt(o):o}(t);return p.parseMarkdownToStructure(r,i,l)}function Ut(...e){const t=new Set,n=[];for(const o of e)for(const e of o||[]){const o=Ft(e);o&&!t.has(o)&&(t.add(o),n.push(o))}return n}function Ft(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 Yt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const Wt=M(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,Vt=M(m.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},onClose:null,title:null},setup(e){const t=e,{t:n}=ce(),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:Wt}}}),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 Kt=null,Qt=null,Xt=null,qt=null,Zt=null;const Gt=new WeakMap;let Jt=0;const en=M(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:h}=ce(),g=m.ref(null),y=m.ref(null),w=m.ref(!1),x=m.ref(yt(r.node.language)),k=m.computed(()=>wt(x.value)),M=m.computed(()=>"plaintext"===k.value),b=m.ref(!1),C=m.ref(!1),T=m.ref(!1),N=m.ref(!1),D=m.ref(null);let _=0;const I=me();let j=null;const S=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>y.value,e=>{if(null==j||j.destroy(),j=null,!e)return void(S.value=!1);const t=I(e,{rootMargin:"400px"});j=t,S.value=t.isVisible.value,t.whenVisible.then(()=>{S.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==j||j.destroy(),j=null});let E=null,L=null,B=()=>{},A=()=>{},O=()=>null,z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),R=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),P=()=>{},H=()=>{},$=()=>{},U=null,F=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},Y=()=>d(this,null,function*(){}),W=null;const V=[];let K=null;const Q=m.computed(()=>r.node.diff),X=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function q(e){var t;if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const n=e;return c(u(u({},X),n),{enabled:null==(t=n.enabled)||t})}return u({},X)}const Z=m.computed(()=>{var e;const t=r.monacoOptions?u({},r.monacoOptions):{};if(!Q.value)return t;const n=void 0===t.diffHideUnchangedRegions?u({},X):q(t.diffHideUnchangedRegions),o=void 0===t.hideUnchangedRegions?void 0:q(t.hideUnchangedRegions),l=null!=(e=t.diffUnchangedRegionStyle)?e:"line-info";return c(u(u(u({},{maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:12,lineNumbersMinChars:2,glyphMargin:!1,fontSize:13,lineHeight:30,renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,padding:{top:10,bottom:"line-info"===l||"line-info-basic"===l||"metadata"===l?22:14},diffHideUnchangedRegions:n,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:l,diffHunkActionsOnHover:!0,diffHunkHoverHideDelayMs:160}),t),void 0===o?{}:{hideUnchangedRegions:o}),{diffHideUnchangedRegions:n})}),G=m.computed(()=>Q.value?"diff":"single"),J=m.ref(G.value),ee=m.ref(!1),te=m.ref(!1),ne=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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 it();if(!e)return ne&&console.warn("[markstream-vue2] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(ee.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&(F=n),"function"==typeof t){const e=Ue();if(e&&r.themes&&Array.isArray(r.themes)&&!r.themes.includes(e))throw new Error("Preferred theme not in provided themes array");W=Xe();const n=t(W);E=n.createEditor||E,L=n.createDiffEditor||L,B=n.updateCode||B,A=n.updateDiff||A,O=n.getEditor||O,z=n.getEditorView||z,R=n.getDiffEditorView||R,P=n.cleanupEditor||P,H=n.safeClean||n.cleanupEditor||H,$=n.refreshDiffPresentation||$,Y=n.setTheme||Y,N.value=!0,g.value&&(yield Re(g.value))}}catch(e){ne&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),ee.value=!0}})})();const oe=m.ref("number"==typeof(null==(o=Z.value)?void 0:o.fontSize)?Z.value.fontSize:Number.NaN),re=m.ref(oe.value),le=m.computed(()=>{const e=oe.value,t=re.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function ie(){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 ue(){var e,t,n,o,r;try{const l=Q.value?null!=(n=null==(t=null==(e=R())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:R():z(),i=O(),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 de(e){var t,n;try{const o=O(),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=ie();if(o&&o>0)return o;const r=Number.isFinite(re.value)&&re.value>0?re.value:12;return Math.max(12,Math.round(1.35*r))}function pe(){var e;if(Number.isFinite(re.value)&&re.value>0&&Number.isFinite(oe.value))return re.value;const t=ue();return"number"==typeof(null==(e=Z.value)?void 0:e.fontSize)?(oe.value=Z.value.fontSize,re.value=Z.value.fontSize,re.value):t&&t>0?(oe.value=t,re.value=t,t):(oe.value=12,re.value=12,12)}function fe(){var e,t,n,o,r,l,i,a,s,u,c,d,p,m;try{const f=Q.value?R():z();if(!f)return null;if(Q.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 v=(null==(r=null==p?void 0:p.getContentHeight)?void 0:r.call(p))||0,h=(null==(l=null==m?void 0:m.getContentHeight)?void 0:l.call(m))||0,g=Math.max(v,h);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),k=Math.max(de(p),de(m));return Math.ceil(x*(k+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 v=null==(m=null==f?void 0:f.getModel)?void 0:m.call(f);let h=1;v&&"function"==typeof v.getLineCount&&(h=v.getLineCount());const g=de(f);return Math.ceil(h*(g+1.5)+0+1)}catch(f){return null}}function ve(e){const t=String(null!=e?e:"").match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;const[n,o,r]=t.slice(0,3).map(Number);return.2126*n+.7152*o+.0722*r}function he(e,t,n){if(!M.value)return!1;const o=ve(e),r=ve(t);return n?null!=o&&o>170||null!=r&&r<110:null!=o&&o<85||null!=r&&r>190}function ge(){var e,t,n,o,r,l,i,a;const s=g.value,u=y.value;if(!s||!u)return;if(Q.value)return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");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,v=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(m=window.getComputedStyle(c),f=d===c?m:window.getComputedStyle(d),v=p===c?m:window.getComputedStyle(p))}catch(b){m=null,f=null,v=null}const h=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(),k=h||String(null!=(l=null!=(r=null==v?void 0:v.color)?r:null==m?void 0:m.color)?l:"").trim(),M=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==m?void 0:m.backgroundColor)?a:"").trim();if(he(M,k,u.classList.contains("is-dark")))return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");k&&u.style.setProperty("--vscode-editor-foreground",k),M&&u.style.setProperty("--vscode-editor-background",M),x&&u.style.setProperty("--vscode-editor-selectionBackground",x)}const ye=/auto|scroll|overlay/i;function we(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(ye.test(t)||ye.test(n))return l;l=l.parentElement}return r}function xe(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=we(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 ke(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect().height,n=fe();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",xe(e,t,o)}}catch(e){}}function Me(){for(var e;V.length>0;)try{null==(e=V.pop())||e()}catch(t){}}function be(){if(Me(),!Q.value)return;const e=g.value;if(!e)return;const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return;const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),o=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),r=Math.min(n.length,o.length);for(let l=0;l<r;l++){const e=n[l],t=o[l].querySelector("a"),r=e.querySelector(".center > div:first-child");if(!t||!r)continue;const i=document.createElement("button");i.type="button",i.className="markstream-inline-fold-proxy";const a=t.getAttribute("title")||"Show Unchanged Region";i.title=a,i.setAttribute("aria-label",a);const s=t.querySelector(".codicon"),u=document.createElement("span");u.className=(null==s?void 0:s.className)||"codicon codicon-unfold",i.append(u);const c=e=>{e.preventDefault(),e.stopPropagation()},d=e=>{e.preventDefault(),e.stopPropagation(),t.click()},p=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.click())};i.addEventListener("mousedown",c),i.addEventListener("click",d),i.addEventListener("keydown",p),r.replaceChildren(i),V.push(()=>{i.removeEventListener("mousedown",c),i.removeEventListener("click",d),i.removeEventListener("keydown",p),r.contains(i)&&r.replaceChildren()})}}function Ce(){null==K&&(K=Yt(()=>{K=null,Yt(()=>{Te(),be(),C.value||(b.value?ke():De(),Yt(()=>{Te(),be()}))})}))}function Te(){if(!Q.value)return;const e=g.value;if(!e)return;const t=Array.from(e.querySelectorAll(".stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal"));for(const n of t){if(!(n instanceof HTMLButtonElement))continue;const e="up"===n.dataset.direction?"up":"down",t=document.createElement("span");t.className=`codicon codicon-chevron-${e}`,n.replaceChildren(t)}}function Ne(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 De(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect().height,o=_e();if(_>0&&(_--,null!=D.value))return void xe(t,n,Ne(t,D.value,o));const r=fe();if(null!=r&&r>0)return void xe(t,n,Ne(t,r,o));if(null!=D.value)return void xe(t,n,Ne(t,D.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void xe(t,n,Ne(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?xe(t,n,Ne(t,i,o)):xe(t,n,Ne(t,o,o))}catch(t){}}function _e(){var e,t;const n=null!=(t=null==(e=Z.value)?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 Ie=m.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));m.watch(()=>r.node.language,e=>{x.value=yt(e)}),m.watch(()=>[r.node.originalCode,r.node.updatedCode,k.value,Q.value],e=>d(this,[e],function*([e,t,n,o]){if(!1!==r.stream&&o){if(E&&!T.value&&g.value)try{yield Re(g.value)}catch(l){}A(String(null!=e?e:""),String(null!=t?t:""),k.value),Ce()}})),m.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(x.value||(x.value=yt(F(e))),!Q.value)){if(E&&!T.value&&g.value)try{yield Re(g.value)}catch(t){}B(e,k.value),b.value&&Ce()}}));const je=m.computed(()=>{const e=x.value;return e?kt[e]||e.charAt(0).toUpperCase()+e.slice(1):kt[""]||"Plain Text"}),Se=m.computed(()=>(mt.value,xt(x.value||""))),Ee=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),Q.value?(e.color="var(--markstream-diff-shell-fg)",e.borderColor="var(--markstream-diff-shell-border)"):(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),Le=m.computed(()=>{if(!Q.value)return{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}}),Be=m.computed(()=>!1!==r.showTooltips);function Ae(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Oe(e){var t,n;try{if(Q.value){const n=R();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=z();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function ze(e){return d(this,null,function*(){var t,n,o;if(!E)return;qe(),Q.value?(H(),L?yield L(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),k.value):yield E(e,r.node.code,k.value)):yield E(e,r.node.code,k.value);const l=Q.value?R():z();if("number"==typeof(null==(o=Z.value)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:Z.value.fontSize,automaticLayout:!1}),oe.value=Z.value.fontSize,re.value=Z.value.fontSize;else{const e=ue();e&&e>0?(oe.value=e,re.value=e):(oe.value=12,re.value=12)}b.value||C.value||Ce(),!1===r.loading&&(yield m.nextTick(),Yt(()=>{Ce()}))})}function Re(e){if(!E)return null;if(U)return U;T.value=!0;const t=(()=>d(this,null,function*(){yield ze(e)}))();return U=t.finally(()=>{U=null}),U}m.watch(Be,e=>{e||se()}),m.watch(()=>re.value,(e,t)=>{const n=Q.value?R():z();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!C.value&&Ce())},{flush:"post",immediate:!1});const Pe=m.watch(()=>[g.value,Q.value,r.stream,r.loading,N.value,S.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=Re(e);i&&(yield i,Pe())}));function He(){return r.isDark?r.darkTheme:r.lightTheme}function $e(e){return"string"==typeof e?e:e&&"object"==typeof e&&"name"in e?String(e.name):null}function Ue(){var e;const t=He(),n=null==(e=Z.value)?void 0:e.theme,o=null!=t?t:n,l=Array.isArray(r.themes)?r.themes:[];if(!l.length||null==o)return o;const i=$e(o),a=l.map(e=>$e(e)).filter(e=>!!e);if(!i||a.includes(i))return o;const s=$e(n);return null!=n&&s&&a.includes(s)?n:l[0]}function Fe(){qe();const e=Ue(),t=()=>{Q.value&&$(),Yt(()=>{ge(),Ce()})};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=Gt.get(e);if(n)return n;try{const t=JSON.stringify(e);if(t)return Gt.set(e,t),t}catch(t){}const o="__theme_"+ ++Jt;return Gt.set(e,o),o}return String(e)}(t);return n?(Zt=e,Kt||qt!==n?(Qt=t,Xt=n,Kt||(Kt=(()=>d(this,null,function*(){for(;Xt&&null!=Qt;){const n=Qt,o=Xt;if(Qt=null,Xt=null,qt!==o)try{yield(null!=Zt?Zt:e)(n),qt=o}catch(t){}}}))().finally(()=>{Kt=null}),Kt)):Promise.resolve()):Promise.resolve()}(Y,e).then(t).catch(()=>{}):t()}function Ye(e){var t;const n=(null!=(t=$e(e))?t:"").toLowerCase();return n?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>n.includes(e))&&!["light","latte","dawn","lotus"].some(e=>n.includes(e)):!!r.isDark}m.watch(G,(e,t)=>d(this,null,function*(){if(e!==t&&(J.value=e,E&&g.value&&T.value&&(!1!==r.stream||!1===r.loading)&&S.value))try{T.value=!1,U=null,Me(),H(),yield m.nextTick(),yield Re(g.value)}catch(n){T.value=!1}}));const We=m.computed(()=>Ye(Ue())),Ve=m.computed(()=>{var e;if(!Q.value)return We.value?"dark":"light";const t=null==(e=Z.value)?void 0:e.diffAppearance;return"light"===t||"dark"===t?t:r.isDark?"dark":"light"}),Ke=m.computed(()=>Q.value?"dark"===Ve.value:We.value);function Xe(){return c(u(c(u({wordWrap:"on",wrappingIndent:"same",themes:r.themes},Z.value||{}),{theme:Ue()}),Q.value?{diffAppearance:Ve.value}:{}),{onThemeChange(){ge()}})}function qe(){const e=Xe();if(!W)return W=e,W;for(const t of Object.keys(W))t in e||delete W[t];return Object.assign(W,e),W}const Ze=m.computed(()=>{var e,t,n,o,r,l,i,a,s,u,c,d,p,m;return JSON.stringify({diffLineStyle:null!=(t=null==(e=Z.value)?void 0:e.diffLineStyle)?t:"background",diffUnchangedRegionStyle:null!=(o=null==(n=Z.value)?void 0:n.diffUnchangedRegionStyle)?o:"line-info",diffHideUnchangedRegions:null==(l=null==(r=Z.value)?void 0:r.diffHideUnchangedRegions)||l,renderSideBySide:null==(a=null==(i=Z.value)?void 0:i.renderSideBySide)||a,enableSplitViewResizing:null==(u=null==(s=Z.value)?void 0:s.enableSplitViewResizing)||u,ignoreTrimWhitespace:null==(d=null==(c=Z.value)?void 0:c.ignoreTrimWhitespace)||d,originalEditable:null!=(m=null==(p=Z.value)?void 0:p.originalEditable)&&m})});m.watch(()=>[r.monacoOptions,S.value],()=>{var e,t;if(qe(),!E||!S.value)return;const n=Q.value?R():z(),o="number"==typeof(null==(e=Z.value)?void 0:e.fontSize)?Z.value.fontSize:Number.isFinite(re.value)?re.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),Ce()},{deep:!0}),m.watch(()=>{var e,t;return[r.isDark,r.darkTheme,r.lightTheme,r.themes,null==(e=Z.value)?void 0:e.theme,null==(t=Z.value)?void 0:t.diffAppearance,N.value,T.value,S.value]},()=>{N.value&&Fe()},{flush:"post"}),m.watch(()=>[Ze.value,N.value,S.value],(e,t)=>d(this,[e,t],function*([e,t,n],[o]){if(qe(),Q.value&&t&&n&&E&&g.value&&T.value&&e!==o&&(!1!==r.stream||!1===r.loading))try{T.value=!1,U=null,Me(),H(),yield m.nextTick(),yield Re(g.value)}catch(l){T.value=!1}}),{flush:"post"});const Ge=m.watch(()=>[r.loading,S.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield m.nextTick(),Yt(()=>{C.value||(b.value?ke():De()),Ge()})))}),{immediate:!0,flush:"post"});return m.onUnmounted(()=>{Me(),null!=K&&(function(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(t){}try{globalThis.clearTimeout(e)}catch(t){}}(K),K=null),P()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:p,hasPreviewListener:f,t:h,codeEditor:g,container:y,copyText:w,codeLanguage:x,monacoLanguage:k,isPlainTextLanguage:M,isExpanded:b,isCollapsed:C,editorCreated:T,monacoReady:N,expandRafId:null,heightBeforeCollapse:D,resumeGuardFrames:_,registerVisibility:I,viewportHandle:j,viewportReady:S,createEditor:E,createDiffEditor:L,updateCode:B,updateDiffCode:A,getEditor:O,getEditorView:z,getDiffEditorView:R,cleanupEditor:P,safeClean:H,refreshDiffPresentation:$,createEditorPromise:U,detectLanguage:F,setTheme:Y,runtimeMonacoOptions:W,inlineFoldProxyCleanups:V,deferredEditorVisualSyncRafId:K,isDiff:Q,defaultDiffHideUnchangedRegions:X,resolveDiffHideUnchangedRegionsOption:q,resolvedMonacoOptions:Z,desiredEditorKind:G,currentEditorKind:J,usePreCodeRender:ee,showInlinePreview:te,isDevEnv:ne,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:oe,codeFontSize:re,fontBaselineReady:le,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:ie,readActualFontSizeFromEditor:ue,getLineHeightSafe:de,ensureFontBaseline:pe,increaseCodeFont:function(){const e=pe(),t=Math.min(36,e+1);re.value=t},decreaseCodeFont:function(){const e=pe(),t=Math.max(10,e-1);re.value=t},resetCodeFont:function(){pe(),Number.isFinite(oe.value)&&(re.value=oe.value)},computeContentHeight:fe,getColorLuminance:ve,shouldPreferPlainTextFallbackSurface:he,syncEditorCssVars:ge,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:ye,resolveScrollRootElement:we,adjustScrollAfterHeightChange:xe,updateExpandedHeight:ke,clearInlineFoldProxies:Me,syncInlineFoldProxies:be,scheduleEditorVisualSync:Ce,syncDiffRevealButtons:Te,applyCollapsedContainerHeight:Ne,updateCollapsedHeight:De,getMaxHeightValue:_e,isPreviewable:Ie,displayLanguage:je,languageIcon:Se,containerStyle:Ee,headerStyle:Le,tooltipsEnabled:Be,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:Ae,onBtnHover:function(e,t,n="top"){if(!Be.value)return;const o=Ae(e);if(!o)return;const l=e;ae(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(){Be.value&&se()},onCopyHover:function(e){if(!Be.value)return;const t=Ae(e);if(!t)return;const n=e;ae(t,w.value?h("common.copied")||"Copied":h("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(e){if(b.value=!b.value,e&&Be.value){const t=Ae(e);t&&ae(t,b.value?h("common.collapse")||"Collapse":h("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=Q.value?R():z(),n=g.value;t&&n&&(b.value?(Oe(!0),n.style.maxHeight="none",n.style.overflow="visible",ke()):(Oe(!1),n.style.overflow="auto",De()))},toggleHeaderCollapse:function(){var e,t,n;if(C.value=!C.value,C.value){if(g.value){const n=Math.ceil((null==(t=(e=g.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(D.value=n)}Oe(!1)}else{b.value&&Oe(!0),g.value&&null!=D.value&&(g.value.style.height=`${D.value}px`);const e=Q.value?R():z();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}_=2,Ce()}},previewCode:function(){if(!Ie.value)return;const e=x.value;if(f.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?h("artifacts.htmlPreviewTitle")||"HTML Preview":h("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(te.value=!te.value)},setAutomaticLayout:Oe,runEditorCreation:ze,ensureEditorCreation:Re,stopCreateEditorWatch:Pe,getPreferredColorScheme:He,getThemeName:$e,resolveRequestedTheme:Ue,themeUpdate:Fe,themeLooksDark:Ye,resolvedChromeIsDark:We,effectiveDiffAppearance:Ve,resolvedSurfaceIsDark:Ke,buildRuntimeMonacoOptions:Xe,syncRuntimeMonacoOptions:qe,monacoStructuralSignature:Ze,stopLoadingWatch:Ge,stopExpandAutoResize:function(){},PreCodeNode:Qe,HtmlPreviewFrame:Vt}}}),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.resolvedSurfaceIsDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.resolvedSurfaceIsDark,"is-diff":n.isDiff,"is-plain-text":n.isPlainTextLanguage}],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",style:n.headerStyle},[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:function(e){return n.toggleExpand(e)},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:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):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"}})])]):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)"}],staticClass:"code-editor-layer"},[t("div",{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,"22412502",null,null).exports,tn=()=>import("@terrastruct/d2");let nn=null,on=tn;function rn(e){on=e,nn=null}const ln=M(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}=ce(),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),v=m.ref(null),h=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(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=m.computed(()=>{if(t.maxHeight)return{maxHeight:"number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight)}}),k="undefined"!=typeof window;let M=null,b=!1,C=!1,T=0,N=null,D=!1,_=null;const I={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 j(e){return!e||e.disabled}const S=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],E=/^(?: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 E.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(S.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.classList.add("markstream-d2-root-svg"),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function R(){c.value=""}function P(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(M)return M;const e=yield function(){return d(this,null,function*(){if(nn)return nn;const e=on;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===tn)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(nn=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),nn):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?M=t:"function"==typeof e.compile&&(M=e),M}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(M=new e.D2,M):("function"==typeof e.compile&&(M=e),M)})}function $(){return d(this,null,function*(){var e,n,o,r,c;if(!k||C)return;if(t.loading&&!t.progressiveRender)return;const d=h.value;if(!d)return R(),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,R(),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 v=null!=(e=null==f?void 0:f.diagram)?e:f,h=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:h.themeID,y=null!=(c=t.darkThemeId)?c:h.darkThemeID,w=u({},h);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=h.themeOverrides&&"object"==typeof h.themeOverrides?h.themeOverrides:null;w.themeOverrides=u(u({},I),e||{})}const x=yield s.render(v,w);if(m!==p.value)return;const k=P(x);if(!k)throw new Error("D2 render returned empty output.");z(k),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(!k)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&&(v.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,h.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:v,baseCode:h,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:k,d2Instance:M,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:D,bodyObserver:_,DARK_THEME_OVERRIDES:I,shouldSkipEventTarget:j,onBtnHover:function(e,n,o="top"){if(j(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;ae(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){se()},onCopyHover:function(e){if(j(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;ae(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=h.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:S,SAFE_URL_PROTOCOLS:E,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:R,extractSvg:P,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,"fdf24c90",null,null).exports;ln.install=e=>{e.component(ln.__name,ln)};const an=Object.freeze(Object.defineProperty({__proto__:null,default:ln},Symbol.toStringTag,{value:"Module"}));let sn=null,un=null;const cn=M(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}=ce(),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);function f(e){if(!n.maxHeight||"none"===n.maxHeight)return`${e}px`;const t=Number.parseFloat(String(n.maxHeight));return Number.isFinite(t)?`${Math.min(e,t)}px`:`${e}px`}function v(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(s.value=f(e))}const h=m.ref(1),g=m.ref(0),y=m.ref(0),w=m.ref(!1),x=m.ref({x:0,y:0}),k=m.computed(()=>n.node.code);function M(e){return!e||e.disabled}function b(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 C(e){"Escape"===e.key&&u.value&&N()}function T(){if(u.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",C)}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(${g.value}px, ${y.value}px) scale(${h.value})`}})}function N(){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",C)}catch(e){}}let D=null;function _(){return d(this,null,function*(){var e;if(i.value)try{const t=yield function(){return d(this,null,function*(){return un||sn||(sn=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),un=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),sn)})}();if(!t)return void console.warn("Infographic library failed to load.");D&&(null==(e=D.destroy)||e.call(D),D=null),i.value.innerHTML="",D=new t({container:i.value,width:"100%",height:"100%"}),D.render(k.value),m.nextTick(()=>{v()})}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(()=>k.value,()=>{a.value||l.value||m.nextTick(()=>{_()})}),m.watch(()=>a.value,e=>{e||l.value||m.nextTick(()=>{_()})}),m.watch(()=>l.value,e=>{e||a.value||m.nextTick(()=>{_()})}),m.watch(()=>n.maxHeight,()=>{a.value||l.value||m.nextTick(()=>{_()})}),m.onMounted(()=>{a.value||l.value||m.nextTick(()=>{_()})}),m.onBeforeUnmount(()=>{var e;if(D&&(null==(e=D.destroy)||e.call(D),D=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",C)}catch(t){}});const I=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"),j=m.computed(()=>a.value||l.value),S=m.computed(()=>({transform:`translate(${g.value}px, ${y.value}px) scale(${h.value})`}));return m.watch(S,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,resolveContainerHeight:f,updateContainerHeight:v,zoom:h,translateX:g,translateY:y,isDragging:w,dragStart:x,baseCode:k,shouldSkipEventTarget:M,onBtnHover:function(e,t,o="top"){if(M(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;ae(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){se()},onCopyHover:function(e){if(M(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;ae(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=k.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?b(t):console.error("SVG element not found")},exportSvg:b,handleKeydown:C,openModal:T,closeModal:N,handleOpenModalClick:function(){T()},zoomIn:function(){h.value<3&&(h.value+=.1)},zoomOut:function(){h.value>.5&&(h.value-=.1)},resetZoom:function(){h.value=1,g.value=0,y.value=0},startDrag:function(e){w.value=!0,e instanceof MouseEvent?x.value={x:e.clientX-g.value,y:e.clientY-y.value}:x.value={x:e.touches[0].clientX-g.value,y:e.touches[0].clientY-y.value}},onDrag:function(e){if(!w.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),g.value=t-x.value.x,y.value=n-x.value.y},stopDrag:function(){w.value=!1},infographicInstance:D,renderInfographic:_,computedButtonStyle:I,isFullscreenDisabled:j,transformStyle:S,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Wt}}}),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,"f09aa514",null,null).exports,dn=M(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}=ce(),i=m.ref(yt(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),h=m.ref(null),g=m.ref(""),y=m.ref(!1),w=m.ref(!1);let x;const k=m.ref(!0),M=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?kt[e]||e.charAt(0).toUpperCase()+e.slice(1):kt[""]||"Plain Text"}),D=m.computed(()=>(mt.value,xt(i.value.trim().toLowerCase().split(":")[0]))),_=m.computed(()=>{const e=i.value.trim().toLowerCase();return r.isShowPreview&&("html"===e||"svg"===e)}),I=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}),j=m.computed(()=>({fontSize:`${C.value}px`})),S=m.computed(()=>!1!==r.showTooltips);function E(){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 R(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=p.value,n=h.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 P(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>${P(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(()=>{R()})}function U(){null==x||x.disconnect(),x=void 0,w.value&&(g.value="",y.value=!0)}function F(){var e;const t=h.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=h.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,V,K,Q;const X=new Set,q=new Set,Z=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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=yt(String(null!=e?e:""));return n?!Q||Q.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(!V)try{const e=yield import("stream-markdown");V=e.createShikiStreamRenderer,K=e.registerHighlight;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Q=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&&h.value?(null==K||K({themes:L()}),!W&&V&&(W=V(h.value,{theme:E(),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(S,e=>{e||se()}),m.watch(()=>[r.node.code,r.node.language],e=>d(this,[e],function*([e,t]){const n=yt(String(null!=t?t:""));if(n!==i.value&&(i.value=n),f.value&&h.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,h.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&&h.value&&(W||(yield te()),yield null==W?void 0:W.setTheme(E()),R())})),m.watch(()=>r.node.code,()=>d(this,null,function*(){if(u.value||!k.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:h,fallbackHtml:g,rendererReady:y,hasStableRender:w,renderObserver:x,autoScrollEnabled:k,lastScrollTop:M,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:b,codeFontSize:C,fontBaselineReady:T,displayLanguage:N,languageIcon:D,isPreviewable:_,containerStyle:I,contentStyle:j,tooltipsEnabled:S,getPreferredColorScheme:E,getResolvedThemes:L,getColorChannels:B,getRelativeLuminance:A,getContrastRatio:O,isDarkBackgroundColor:z,syncRenderedCssVars:R,escapeHtml:P,renderFallback:H,clearFallback:$,keepLastSuccessfulRender:U,hasRendererContent:F,clearFallbackWhenRendererReady:Y,renderer:W,createShikiRenderer:V,registerHighlight:K,registeredHighlightLanguages:Q,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<M.value?k.value=!1:ne(e)&&(k.value=!0),M.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(!S.value)return;const o=oe(e);if(!o)return;const l=e;ae(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(){S.value&&se()},onCopyHover:function(e){if(!S.value)return;const t=oe(e);if(!t)return;const n=e;ae(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(e){if(u.value=!u.value,e&&S.value){const t=oe(e);t&&ae(t,u.value?l("common.collapse")||"Collapse":l("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=f.value;t&&(u.value?(t.style.maxHeight="none",t.style["overflow-y"]="visible",t.style["overflow-x"]="auto"):(t.style.maxHeight="500px",t.style.overflow="auto",k.value=!0,m.nextTick(()=>{t.scrollHeight>t.clientHeight&&(t.scrollTop=t.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=yt(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:function(e){return n.toggleExpand(e)},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:"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(),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,"dfe9b17a",null,null).exports;function pn(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 mn=M(m.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:Je,NodeRenderer:tt},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(pn).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=pn(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=k(this);return this.legacyVue26?e(Je,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(tt,u({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,fn=new Map;function vn(e,t){if(fn.delete(e),fn.set(e,t),fn.size>200){const e=fn.keys().next().value;e&&fn.delete(e)}}function hn(e){if(!e)return null;const t=fn.get(e)||null;return t&&vn(e,t),t}function gn(e,t){e&&t&&vn(e,{html:t})}let yn=null,wn=null,xn=!1;const kn=new Map,Mn=new Map;let bn=5;const Cn=new Set;function Tn(){if(kn.size<bn&&Cn.size){const t=Array.from(Cn);Cn.clear();for(const n of t)try{n()}catch(e){}}}let Nn=null;const Dn=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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&&Dn&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{Nn=e.perfMonitor})}catch(po){}function _n(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now();if(!be()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(wn)return Promise.reject(wn);const l=`${t?"d":"i"}:${e}`,i=Mn.get(l);if(i)return Nn&&Nn.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),Promise.resolve(i);const a=yn||(wn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),wn.name="WorkerInitError",wn.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(wn);if(kn.size>=bn){const t=new Error("Worker busy");return t.name="WorkerBusy",t.code="WORKER_BUSY",t.busy=!0,t.inFlight=kn.size,t.max=bn,Nn&&Nn.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(()=>{kn.delete(s);const t=new Error("Worker render timed out");t.name="WorkerTimeout",t.code="WORKER_TIMEOUT",Nn&&Nn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(t),Tn()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),kn.has(s)&&kn.delete(s);const e=new Error("Aborted");e.name="AbortError",i(e),Tn()},{once:!0});const c=l,d=i;kn.set(s,{resolve:t=>{Nn&&Nn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),c(t)},reject:t=>{Nn&&Nn.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 In(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(Mn.set(o,n),Mn.size>200){const e=Mn.keys().next().value;Mn.delete(e)}}const jn="WORKER_BUSY";function Sn(e=2e3,t){return kn.size<bn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),Cn.delete(i),n())};if(Cn.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,Cn.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>Tn()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),Cn.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const En={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Ln(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!be()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:En.timeout,s=null!=(r=n.waitTimeout)?r:En.waitTimeout,u=null!=(l=n.backoffMs)?l:En.backoffMs,c=null!=(i=n.maxRetries)?i:En.maxRetries,d=Number.isFinite(c)?Math.max(0,Math.min(Math.floor(c),8)):En.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 _n(e,t,a,p)}catch(f){if((null==f?void 0:f.code)!==jn||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 Bn=M(m.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=me();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),u=hn(s.value),c=m.ref((null==u?void 0:u.html)||""),p=m.ref(""),f=m.ref(!(null==u?void 0:u.html));let v=Boolean(null==u?void 0:u.html);function h(){return d(this,null,function*(){const e=yield Ce();if(!e)return!1;try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:!0});return g(n),In(t.node.content,!0,n),!0}catch(po){return!1}})}function g(e){c.value=e,p.value="",f.value=!1,v=!0,gn(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(v=!0);const e=hn(s.value);if((null==e?void 0:e.html)&&!c.value&&(c.value=e.html,v=!0,f.value=!1),!v){f.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(po){}}a&&(a.abort(),a=null);const u=++l,d=new AbortController;a=d;try{const e=yield Ln(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===jn||"WORKER_TIMEOUT"===e)&&(yield h()))return;if(v||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:v,renderWithMainThreadFallback:h,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,An=M(m.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=me();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=hn(u.value),p=m.ref((null==c?void 0:c.html)||""),f=m.ref(""),v=m.ref(!(null==c?void 0:c.html));let h=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield Ce();if(!e)return!1;try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:s.value});return y(n),In(t.node.content,s.value,n),!0}catch(po){return!1}})}function y(e){p.value=e,f.value="",v.value=!1,h=!0,gn(u.value,e)}function w(){p.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(i)return;if(!t.node.content)return w(),void(h=!0);const e=hn(u.value);(null==e?void 0:e.html)&&!p.value&&(p.value=e.html,h=!0,v.value=!1),a&&(a.abort(),a=null);const c=++l,d=new AbortController;if(a=d,!h){v.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(po){}}try{const e=yield Ln(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===jn||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(h||p.value)return;n||!t.node.loading?w():v.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:v,hasRenderedOnce:h,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,On=()=>import("mermaid");let zn=null,Rn=On;function Pn(e){Rn=e,zn=null}function Hn(){return"function"==typeof Rn}function $n(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 Un(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(po){}}let Fn=null,Yn=null;const Wn=new Map;let Vn=5,Kn=!1;const Qn="WORKER_BUSY",Xn="MERMAID_DISABLED";function qn(e,t,n=1400){if(!Hn()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Xn,Promise.reject(e)}if(Yn)return Promise.reject(Yn);const o=Fn||(Yn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Yn.name="WorkerInitError",Yn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Yn);if(Wn.size>=Vn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Qn,e.inFlight=Wn.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),Wn.delete(i))},c={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};Wn.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Wn.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=Wn.get(i);t&&t.reject(e)},n)})}function Zn(e,t,n=1400){return d(this,null,function*(){try{return yield qn("canParse",{code:e,theme:t},n)}catch(po){return Promise.reject(po)}})}function Gn(e,t,n=1400){return d(this,null,function*(){try{return yield qn("findPrefix",{code:e,theme:t},n)}catch(po){return Promise.reject(po)}})}function Jn(){if(Fn)try{for(const[e,t]of Wn.entries())t.reject(new Error("Worker terminated"));Wn.clear(),Fn.terminate()}finally{Fn=null}}const eo=M(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},onRenderError:null},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],h=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return h.test(t)?t:""}function 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(po){e.innerHTML=""}const n=w(t);return n?(e.appendChild(n),e.innerHTML):""}function k(e){if(e)try{e.replaceChildren()}catch(po){e.innerHTML=""}}function M(e,t){if(!e)return"";if("strict"===a.value)return x(e,t);try{e.replaceChildren()}catch(po){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(po){e.innerHTML=t}return e.innerHTML}const{t:b}=ce();function C(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(zn)return zn;const e=function(){try{const e=globalThis;return $n(null==e?void 0:e.mermaid)}catch(po){return null}}();if(e)return zn=e,Un(zn),zn;const t=Rn;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===On)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(zn=$n(n),Un(zn),zn):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(),I=m.ref(),j=m.ref(null),S=me();let E=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),R=m.ref(0),P=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),V=m.ref(0),K=m.ref(!1),Q=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()&<()},{timeout:500})},Q.value)}function ue(){null!=ee&&(globalThis.clearTimeout(ee),ee=null)}function de(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);ue(),ee=globalThis.setTimeout(()=>{ee=null,r.loading||Y.value||!re()?de(Math.min(1200,Math.max(300,1.2*t))):ie()},t)}const pe=m.ref("360px");let fe=null;const ve=m.ref(!1),he=m.ref(!1),ge=m.ref({}),ye=m.ref(null),we=m.ref(""),xe=m.ref(0);let ke=null;const Me=m.ref(!1),be=m.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),Ce=m.computed(()=>r.enableWheelZoom?{wheel:et}:{}),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,Ie=!1,je=q.value,Se=null,Ee=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;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,A.value,_.value))return Me.value=!0,void it();const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),k(_.value),_.value.appendChild(t),pe.value="360px",Me.value=!0,it()}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 Re(e){return!e||e.disabled}function Pe(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function He(){return Le&&!U.value&&!ve.value&&!Me.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=Pe(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 Zn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Te.value.worker)}catch(po){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(po){if("AbortError"===(null==po?void 0:po.name))throw po}let r=$e(e);if(r&&r.trim()&&r!==e)try{try{const l=yield Gn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Te.value.worker);l&&l.trim()&&(r=l)}catch(po){}if(yield Fe(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(po){if("AbortError"===(null==po?void 0:po.name))throw po}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&m.watch(()=>D.value,e=>{if(null==E||E.destroy(),E=null,!e)return void(L.value=!1);const t=S(e,{rootMargin:"400px"});E=t,L.value=t.isVisible.value,t.whenVisible.then(()=>{L.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==E||E.destroy(),E=null,le()});const We=m.computed(()=>U.value||Y.value||N.value);function Ve(){if(!r.maxHeight||"none"===r.maxHeight)return null;const e=Number.parseFloat(String(r.maxHeight));return Number.isFinite(e)?e:null}function Ke(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(po){return void console.error("Failed to get SVG BBox:",po)}if(n>0&&o>0){const t=o/n,r=null!=e?e:D.value.clientWidth,l=Ve(),i=r*t,a=null==l?i:Math.min(i,l);pe.value=`${a}px`}}const Qe=m.ref(!1),Xe=m.computed(()=>({transform:`translate(${R.value}px, ${P.value}px) scale(${z.value})`}));function qe(e){"Escape"===e.key&&Qe.value&&Ge()}function Ze(){if(Qe.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(po){}if("undefined"!=typeof window)try{window.addEventListener("keydown",qe)}catch(po){}m.nextTick(()=>{if(D.value&&I.value){const e=D.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="100%",e.style.maxHeight="100%";const t=e.querySelector("[data-mermaid-wrapper]");t&&(j.value=t,t.style.transform=Xe.value.transform),k(I.value),I.value.appendChild(e)}})}function Ge(){if(Qe.value=!1,I.value&&k(I.value),j.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(po){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",qe)}catch(po){}}function Je(){if(!U.value)return;if(!i.value)return;const e=A.value.length;e!==V.value&&(K.value=!0,V.value=e,J&&clearTimeout(J),J=setTimeout(()=>{K.value&&U.value&&A.value.trim()&&(K.value=!1,nt("preview"))},X.value))}function et(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-R.value)/z.value,a=(l-P.value)/z.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(z.value+u,.5),3);c!==z.value&&(R.value=r-i*c,P.value=l-a*c,z.value=c)}}function tt(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(po){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function nt(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 ot(){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)}`;ve.value||he.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=M(_.value,a);ve.value||he.value||(Ke(),ve.value=!0,be.value={zoom:z.value,translateX:R.value,translateY:P.value,containerHeight:pe.value});const t=r.isDark?"dark":"light";e&&(ge.value[t]=e),he.value&&(he.value=!1),Me.value=!1,ne=0,ue()}}catch(n){const e=ze(n),o=ne+1;e&&o<=3?(ne=o,de(Math.min(1200,600*o)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.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,ue(),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 rt(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=Pe(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&&(M(_.value,s),Ke())}catch(po){}finally{Y.value=!1}}})}function lt(){return d(this,null,function*(){var e,t;const n=Date.now(),o=++xe.value;ke&&ke.abort(),ke=new AbortController;const l=ke.signal,i=r.isDark?"dark":"light",a=A.value,s=a.replace(/\s+/g,"");if(!a.trim())return _.value&&k(_.value),ye.value=null,we.value="",void(Me.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 ot(),void(xe.value===o&&(ye.value=null!=(t=null==(e=_.value)?void 0:e.innerHTML)?t:null,we.value=s,Me.value=!1));const u=Ee&&n<=Ee;if(r.prefixOk&&r.prefix&&He()&&!u)return void(yield rt(r.prefix))}catch(po){if("AbortError"===(null==po?void 0:po.name))return}if(xe.value!==o)return;if(Me.value)return;const u=ge.value[i];u&&_.value&&M(_.value,u)})}function it(){Ie&&(Ie=!1,je=q.value,Le=!1,Se&&(Se.abort(),Se=null),De&&(globalThis.clearTimeout(De),De=null),_e&&(Ne(_e),_e=null),Ee=Date.now())}function at(){if(it(),le(),ke){try{ke.abort()}catch(po){}ke=null}if(Se){try{Se.abort()}catch(po){}Se=null}Jn(),ue(),ne=0}function st(e=q.value){Ie&&(Be>=G.value?it():(De&&globalThis.clearTimeout(De),De=globalThis.setTimeout(()=>{_e=oe(()=>d(this,null,function*(){if(!Ie)return;if(!re())return void it();if(U.value||ve.value)return void it();const e=r.isDark?"dark":"light",t=A.value;if(!t.trim())return!1===r.loading?void it():void st(je);if(Be++,Be>G.value)it();else{Se&&Se.abort(),Se=new AbortController;try{if((yield Fe(t,e,{signal:Se.signal,timeoutMs:Te.value.worker}))&&(yield ot(),ve.value))return void it()}catch(po){}je=Math.min(Math.floor(1.5*je),Z.value),st(je)}}),{timeout:500})},e)))}function ut(){Ie||i.value&&re()&&(U.value||ve.value||(Ie=!0,Ee=0,Le=!0,Be=0,je=q.value,st(je)))}m.watch(Xe,e=>{Qe.value&&j.value&&(j.value.style.transform=e.transform)},{immediate:!0}),m.watch(()=>A.value,()=>{ve.value=!1,ge.value={},re()&&ie(),!U.value&&i.value&&re()?ut():it(),Je()}),m.watch(()=>r.isDark,()=>d(this,null,function*(){if(!ve.value)return;if(Me.value)return;const e=r.isDark?"dark":"light",t=ge.value[e];if(t)return void(_.value&&M(_.value,t));const n={zoom:z.value,translateX:R.value,translateY:P.value,containerHeight:pe.value},o=1!==z.value||0!==R.value||0!==P.value;he.value=!0,o&&(z.value=1,R.value=0,P.value=0,yield m.nextTick()),yield ot(),o&&(yield m.nextTick(),z.value=n.zoom,R.value=n.translateX,P.value=n.translateY,pe.value=n.containerHeight,be.value=n)})),m.watch(()=>U.value,e=>d(this,null,function*(){if(e)it(),ve.value&&(be.value={zoom:z.value,translateX:R.value,translateY:P.value,containerHeight:pe.value});else{if(Me.value)return;const e=r.isDark?"dark":"light";if(ve.value&&ge.value[e])return yield m.nextTick(),_.value&&M(_.value,ge.value[e]),z.value=be.value.zoom,R.value=be.value.translateX,P.value=be.value.translateY,void(pe.value=be.value.containerHeight);if(yield m.nextTick(),!i.value||!re())return;ut(),yield lt()}})),m.watch(()=>r.loading,(e,t)=>d(this,null,function*(){if(!0===t&&!1===e){const e=A.value.trim();if(!e)return at();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(ve.value&&o===we.value)return yield m.nextTick(),_.value&&!_.value.querySelector("svg")&&ge.value[t]&&M(_.value,ge.value[t]),void at();try{yield Fe(e,t,{timeoutMs:Te.value.worker}),yield ot(),we.value=o,Me.value=!1,at()}catch(n){at(),Oe(n)}}})),m.watch(D,e=>{fe&&fe.disconnect(),e&&(fe=new ResizeObserver(e=>{e&&e.length>0&&!U.value&&!N.value&&Yt(()=>{Ke(e[0].contentRect.width)})}),fe.observe(e))},{immediate:!0}),m.onMounted(()=>d(this,null,function*(){yield m.nextTick(),F.value||(U.value=!i.value),re()&&(ie(),V.value=A.value.length)})),m.watch(()=>i.value,e=>{F.value||(U.value=!e)}),m.watch(()=>L.value,e=>{e&&(ve.value||(ie(),V.value=A.value.length),r.loading||ve.value||ie(),!U.value&&i.value&&ut())},{immediate:!1}),m.watch(()=>r.maxHeight,()=>{m.nextTick(()=>{Ke()})}),m.onUnmounted(()=>{J&&clearTimeout(J),le(),fe&&fe.disconnect(),ke&&(ke.abort(),ke=null),Jn(),it(),ue()}),m.watch(()=>N.value,e=>d(this,null,function*(){e?(it(),ke&&ke.abort()):re()&&!ve.value&&(yield m.nextTick(),ie(),U.value||ut())}),{immediate:!1});const ct=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:h,sanitizeUrl:g,scrubSvgElement:y,toSafeSvgElement:w,setSafeSvg:x,clearElement:k,renderSvgToTarget:M,t:b,resolveMermaidInstance:C,copyText:T,isCollapsed:N,mermaidContainer:D,mermaidContent:_,modalContent:I,modalCloneWrapper:j,registerViewport:S,viewportHandle:E,viewportReady:L,modeContainerRef:B,baseFixedCode:A,getCodeWithTheme:O,zoom:z,translateX:R,translateY:P,isDragging:H,dragStart:$,showSource:U,userToggledShowSource:F,isRendering:Y,renderQueue:W,lastContentLength:V,isContentGenerating:K,renderDebounceDelay:Q,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:ue,scheduleRenderRetry:de,containerHeight:pe,resizeObserver:fe,hasRenderedOnce:ve,isThemeRendering:he,svgCache:ge,lastSvgSnapshot:ye,lastRenderedCode:we,renderToken:xe,currentWorkController:ke,hasRenderError:Me,savedTransformState:be,wheelListeners:Ce,timeouts:Te,cancelIdle:Ne,previewPollTimeoutId:De,previewPollIdleId:_e,isPreviewPolling:Ie,previewPollDelay:je,previewPollController:Se,lastPreviewStopAt:Ee,allowPartialPreview:Le,previewPollAttempts:Be,withTimeoutSignal:Ae,renderErrorToContainer:Oe,isTimeoutError:ze,shouldSkipEventTarget:Re,onBtnHover:function(e,t,n="top"){if(Re(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;ae(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){se()},onCopyHover:function(e){if(Re(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;ae(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Pe,canApplyPartialPreview:He,getSafePrefixCandidate:$e,canParseOnMain:Ue,canParseOffthread:Fe,canParseOrPrefix:Ye,isFullscreenDisabled:We,resolveMaxContainerHeight:Ve,updateContainerHeight:Ke,isModalOpen:Qe,transformStyle:Xe,handleKeydown:qe,openModal:Ze,closeModal:Ge,checkContentStability:Je,zoomIn:function(){z.value<3&&(z.value+=.1)},zoomOut:function(){z.value>.5&&(z.value-=.1)},resetZoom:function(){z.value=1,R.value=0,P.value=0},startDrag:function(e){H.value=!0,e instanceof MouseEvent?$.value={x:e.clientX-R.value,y:e.clientY-P.value}:$.value={x:e.touches[0].clientX-R.value,y:e.touches[0].clientY-P.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),R.value=t-$.value.x,P.value=n-$.value.y},stopDrag:function(){H.value=!1},handleWheel:et,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:tt,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||tt(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||Ze()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||nt(e)},switchMode:nt,initMermaid:ot,renderPartial:rt,progressiveRender:lt,stopPreviewPolling:it,cleanupAfterLoadingSettled:at,scheduleNextPreviewPoll:st,startPreviewPolling:ut,computedButtonStyle:ct,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Wt}}}),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,"80cb1008",null,null).exports,to=M(m.defineComponent({name:"NestedRenderer",components:{MarkdownRender:mn},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(()=>$t({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(()=>k(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,no=M(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(po){}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(po){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:Wt}}}),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,oo=Object.freeze(Object.defineProperty({__proto__:null,default:no},Symbol.toStringTag,{value:"Module"}));function ro(e){return JSON.stringify(e)}function lo(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=ro(u({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=ro(o),a=r?ro(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 io(e){return JSON.stringify(e)}function ao(e){var t;const n=null!=(t=e.mode)?t:"module",o=io(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(${io(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 so(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 uo={AdmonitionNode:nt,BlockquoteNode:et,CheckboxNode:b,CodeBlockNode:en,DefinitionListNode:C,EmojiNode:T,EmphasisNode:Pe,FootnoteNode:$e,FootnoteReferenceNode:S,FootnoteAnchorNode:He,HardBreakNode:Ue,HeadingNode:Fe,HtmlBlockNode:Ve,HtmlInlineNode:Y,HighlightNode:Re,ImageNode:fe,D2BlockNode:ln,InlineCodeNode:V,PreCodeNode:Qe,InsertNode:ze,LinkNode:Oe,ListItemNode:Ye,ListNode:We,MarkdownCodeBlockNode:dn,MathBlockNode:Bn,MathInlineNode:An,MermaidBlockNode:eo,NestedRenderer:to,InfographicBlockNode:cn,ParagraphNode:Ke,StrikethroughNode:Ae,StrongNode:Be,SubscriptNode:Le,SuperscriptNode:Ee,TableNode:Xe,TextNode:De,ThematicBreakNode:qe,VmrContainerNode:Ge,ReferenceNode:Se,SoftBreakNode:ve},co={install(e,t){!function(e){const t=so(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=so(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(po){}}})}(e),Object.entries(uo).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",mn),e.component("NodeRenderer",mn),(null==t?void 0:t.getLanguageIcon)&>(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=nt,exports.BlockquoteNode=et,exports.CheckboxNode=b,exports.CodeBlockNode=en,exports.D2BlockNode=ln,exports.DefinitionListNode=C,exports.EmojiNode=T,exports.EmphasisNode=Pe,exports.FootnoteAnchorNode=He,exports.FootnoteNode=$e,exports.FootnoteReferenceNode=S,exports.HardBreakNode=Ue,exports.HeadingNode=Fe,exports.HighlightNode=Re,exports.HtmlBlockNode=Ve,exports.HtmlInlineNode=Y,exports.ImageNode=fe,exports.InfographicBlockNode=cn,exports.InlineCodeNode=V,exports.InsertNode=ze,exports.LinkNode=Oe,exports.ListItemNode=Ye,exports.ListNode=We,exports.MERMAID_DISABLED_CODE=Xn,exports.MERMAID_WORKER_BUSY_CODE=Qn,exports.MarkdownCodeBlockNode=dn,exports.MarkdownRender=mn,exports.MathBlockNode=Bn,exports.MathInlineNode=An,exports.MermaidBlockNode=eo,exports.NestedRenderer=to,exports.ParagraphNode=Ke,exports.PreCodeNode=Qe,exports.ReferenceNode=Se,exports.SoftBreakNode=ve,exports.StrikethroughNode=Ae,exports.StrongNode=Be,exports.SubscriptNode=Le,exports.SuperscriptNode=Ee,exports.TableNode=Xe,exports.TextNode=De,exports.ThematicBreakNode=qe,exports.Tooltip=no,exports.VmrContainerNode=Ge,exports.VueRendererMarkdown=co,exports.WORKER_BUSY_CODE=jn,exports.buildKaTeXCDNWorkerSource=lo,exports.buildMermaidCDNWorkerSource=ao,exports.canParseOffthread=Zn,exports.clearGlobalCustomComponents=function(){delete _.scopedCustomComponents[N],I.value++},exports.clearKaTeXWorker=function(){var e;yn&&(null==(e=yn.terminate)||e.call(yn)),yn=null,wn=null},exports.clearMermaidWorker=function(){var e;if(Fn)try{for(const[e,t]of Wn.entries())t.reject(new Error("Worker cleared"));Wn.clear(),null==(e=Fn.terminate)||e.call(Fn)}catch(po){}Fn=null,Yn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=lo(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(po){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(po){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=ao(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(po){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(po){}}},source:o}},exports.default=mn,exports.disableD2=function(){rn(null)},exports.disableKatex=function(){Me(null)},exports.disableMermaid=function(){Pn(null)},exports.enableD2=function(e){rn(null!=e?e:tn)},exports.enableKatex=function(e){Me(null!=e?e:ke)},exports.enableMermaid=function(e){Pn(null!=e?e:On)},exports.findPrefixOffthread=Gn,exports.getCustomNodeComponents=j,exports.getKaTeXBackpressureDefaults=function(){return u({},En)},exports.getKaTeXWorkerLoad=function(){return{inFlight:kn.size,max:bn}},exports.getLanguageIcon=xt,exports.getMermaidWorkerLoad=function(){return{inFlight:Wn.size,max:Vn}},exports.getUseMonaco=it,exports.isD2Enabled=function(){return"function"==typeof on},exports.isKaTeXWorkerBusy=function(){return kn.size>=bn},exports.isKatexEnabled=be,exports.isMermaidEnabled=Hn,exports.languageIconsRevision=mt,exports.languageMap=kt,exports.normalizeLanguageIdentifier=yt,exports.parseNestedMarkdownToNodes=$t,exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield ht()})},exports.removeCustomComponents=function(e){if(e===N)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete _.scopedCustomComponents[e],I.value++},exports.renderKaTeXInWorker=_n,exports.renderKaTeXWithBackpressure=Ln,exports.renderMarkdownNodeToHtml=function(e,t={}){return Nt(e,Ct(t))},exports.renderMarkdownNodesToHtml=function(e,t={}){return Tt(e,Ct(t))},exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return Tt(e.nodes,t);const n=e.node;if(n){const e=Lt(n.children);if(e.length>0)return Tt(e,t);const o=Bt(n.content);if(o)return jt(o,t);if(null!=n.raw)return Rt(Bt(n.raw))}return e.content?jt(Bt(e.content),t):""}(e,Ct(t))},exports.resolveMonacoLanguageId=wt,exports.setCustomComponents=function(e,t){"string"==typeof e?_.scopedCustomComponents[e]=t||{}:_.scopedCustomComponents[N]=e||{},I.value++},exports.setD2Loader=rn,exports.setDefaultI18nMap=function(e){Object.assign(ue,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(En.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(En.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(En.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(En.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=In,exports.setKaTeXWorker=function(e){yn=e,wn=null,yn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=kn.get(t);if(r)if(kn.delete(t),clearTimeout(r.timeoutId),Tn(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Mn.set(e,n),Mn.size>200){const e=Mn.keys().next().value;Mn.delete(e)}}r.resolve(n)}},yn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of kn.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));kn.clear(),Tn()}},exports.setKaTeXWorkerDebug=function(e){xn=!!e,yn&&yn.postMessage({type:"init",debug:xn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(bn=Math.floor(e))},exports.setKatexLoader=Me,exports.setLanguageIconResolver=gt,exports.setMermaidLoader=Pn,exports.setMermaidWorker=function(e){Fn=e,Yn=null;const t=e;Fn.onmessage=e=>{if(Fn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Wn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Fn.onerror=e=>{var n,o;if(Fn===t)if(0!==Wn.size){try{Kn?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 Wn.entries())n.reject(new Error(`Worker error: ${e.message}`));Wn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Fn.onmessageerror=e=>{var n,o;if(Fn===t)if(0!==Wn.size){try{Kn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(po){}for(const[e,t]of Wn.entries())t.reject(new Error("Worker messageerror"));Wn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Kn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Vn=Math.floor(e))},exports.terminateWorker=Jn,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]})});
|