markstream-vue2 0.0.44 → 0.0.45

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.
Files changed (51) hide show
  1. package/dist/chunks/{cssMode-86e8d6e4.cjs → cssMode-58e68511.cjs} +1 -1
  2. package/dist/chunks/{cssMode-32774a06.js → cssMode-60d93f28.js} +1 -1
  3. package/dist/chunks/{htmlMode-f84c7583.cjs → htmlMode-87a75897.cjs} +1 -1
  4. package/dist/chunks/{htmlMode-076e483c.js → htmlMode-8d468223.js} +1 -1
  5. package/dist/chunks/{index.legacy-1c6de434.js → index.legacy-010f0006.js} +2318 -1507
  6. package/dist/chunks/index.legacy-e02dc92b.cjs +1 -0
  7. package/dist/chunks/{jsonMode-e60229b9.cjs → jsonMode-2a97b947.cjs} +1 -1
  8. package/dist/chunks/{jsonMode-186d141c.js → jsonMode-307a9a02.js} +1 -1
  9. package/dist/chunks/{tsMode-6444eb2b.js → tsMode-4f227d36.js} +1 -1
  10. package/dist/chunks/{tsMode-5b9a0ba1.cjs → tsMode-b1f6e7cb.cjs} +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.css +1 -1
  13. package/dist/index.d.ts +23 -7
  14. package/dist/index.js +3973 -3634
  15. package/dist/index.px.css +1 -1
  16. package/dist/index.tailwind.css +1 -1
  17. package/dist/tailwind.ts +1 -1
  18. package/dist/types/components/CodeBlockNode/CodeBlockNode.vue.d.ts +27 -8
  19. package/dist/types/components/CodeBlockNode/HtmlPreviewFrame.vue.d.ts +2 -0
  20. package/dist/types/components/D2BlockNode/D2BlockNode.vue.d.ts +3 -3
  21. package/dist/types/components/D2BlockNode/d2.d.ts +13 -2
  22. package/dist/types/components/HeadingNode/HeadingNode.vue.d.ts +1 -1
  23. package/dist/types/components/HtmlBlockNode/HtmlBlockNode.vue.d.ts +19 -1
  24. package/dist/types/components/HtmlInlineNode/HtmlInlineNode.vue.d.ts +2 -0
  25. package/dist/types/components/ImageNode/ImageNode.vue.d.ts +2 -15
  26. package/dist/types/components/InfographicBlockNode/InfographicBlockNode.vue.d.ts +4 -3
  27. package/dist/types/components/InfographicBlockNode/infographic.d.ts +13 -1
  28. package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.vue.d.ts +8 -7
  29. package/dist/types/components/MathInlineNode/katex.d.ts +5 -2
  30. package/dist/types/components/MermaidBlockNode/MermaidBlockNode.vue.d.ts +4 -3
  31. package/dist/types/components/MermaidBlockNode/mermaid.d.ts +16 -2
  32. package/dist/types/components/NestedRenderer/NestedRenderer.vue.d.ts +1 -1
  33. package/dist/types/components/NodeRenderer/LegacyNodesRenderer.vue.d.ts +11 -8
  34. package/dist/types/components/NodeRenderer/NodeRenderer.vue.d.ts +16 -15
  35. package/dist/types/components/ParagraphNode/ParagraphNode.vue.d.ts +1 -0
  36. package/dist/types/components/TableNode/TableNode.vue.d.ts +3 -1
  37. package/dist/types/composables/useSafeI18n.d.ts +3 -3
  38. package/dist/types/composables/viewportPriority.d.ts +4 -3
  39. package/dist/types/exports.d.ts +23 -7
  40. package/dist/types/types/component-props.d.ts +20 -7
  41. package/dist/types/types/index.d.ts +2 -6
  42. package/dist/types/utils/diagramHeight.d.ts +11 -0
  43. package/dist/types/utils/htmlRenderer.d.ts +5 -27
  44. package/dist/types/utils/nestedHtml.d.ts +2 -1
  45. package/dist/types/utils/nestedNodes.d.ts +6 -1
  46. package/dist/types/utils/normalizeKaTeXRenderInput.d.ts +1 -0
  47. package/dist/workers/mermaidParser.worker.js +1 -1
  48. package/package.json +2 -2
  49. package/dist/chunks/index.legacy-70f0e155.cjs +0 -1
  50. package/dist/types/components/SoftBreakNode/SoftBreakNode.vue.d.ts +0 -17
  51. package/dist/types/components/SoftBreakNode/index.d.ts +0 -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)?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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Pt(e){return Rt(e).replace(/`/g,"&#96;")}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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}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()&&lt()},{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)&&gt(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]})});
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 m=require("stream-markdown-parser"),p=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(p);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(p.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(p.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>w(null==n?void 0:n.proxy)?ht:Ct),r=p.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(p.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:p.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(p.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#fnref--${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,"4da20e16",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 p.h(t,n,o)}catch(r){}try{return p.h(t,n,o)}catch(r){}return E?E(t,n,o):null}const B=(()=>{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 A(e){B&&console.warn(e)}function O(e){return m.sanitizeHtmlAttrs(e)}function z(e,t,n=!1){const o=Object.entries(null!=t?t:{}),r=o.length>0?o.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function P(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function H(e,t,n,o,a,s="safe",u=!1){const c=function(e,t){return m.isCustomHtmlComponentTag(e,t)}(e,o);if(m.BLOCKED_HTML_TAGS.has(e.toLowerCase())||!c&&m.isHtmlTagHardBlocked(e,s))return null;if(!c&&m.isHtmlTagBlocked(e,s))return u?[z(e,t,!0)]:[z(e,t),...n,`</${e}>`];const d=m.sanitizeHtmlAttrs(t,s,e);if(c){const t=o[e]||o[e.toLowerCase()],r=function(e){return m.convertHtmlAttrsToProps(e)}(d);return L(a,t,r,n.length>0?n:void 0)}{const t=d,{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 R(e,t){return m.hasCustomHtmlComponents(e,t)}function $(e,t,n,o="safe"){if(!e)return[];try{const r=function(e,t,n,o="safe"){const r=[],l=[];for(const i of e)if("text"===i.type)(r.length>0?r[r.length-1].children:l).push(i.content);else if("self_closing"===i.type){const e=H(i.tagName,i.attrs||{},[],t,n,o,!0);P(r.length>0?r[r.length-1].children:l,e)}else if("tag_open"===i.type)r.push({tagName:i.tagName,children:[],attrs:i.attrs});else if("tag_close"===i.type){const e=i.tagName.toLowerCase();let a=-1;for(let t=r.length-1;t>=0;t--)if(r[t].tagName.toLowerCase()===e){a=t;break}if(-1!==a)for(;r.length>a;){const i=r.pop(),s=H(i.tagName,i.attrs||{},i.children,t,n,o);r.length>0?P(r[r.length-1].children,s):P(l,s),i.tagName.toLowerCase()!==e&&r.length>a&&A(`Auto-closing unclosed tag: <${i.tagName}>`)}else A(`Ignoring closing tag with no matching opening tag: </${i.tagName}>`)}for(;r.length>0;){const e=r.pop();P(l,H(e.tagName,e.attrs||{},e.children,t,n,o)),A(`Auto-closing unclosed tag: <${e.tagName}>`)}return l}(m.tokenizeHtml(e),t,n,o);return r}catch(l){return r=l,B&&console.error("Failed to parse HTML to VNodes:",r),null}var r}const U=M(p.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=p.inject("markstreamHtmlPolicy",void 0),o=p.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=p.computed(()=>j(t.customId)),l=p.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return $(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),i=p.computed(()=>{const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:t.node.loading&&!t.node.autoClosed?{mode:"text",content:e}:R(e,r.value)?{mode:"dynamic",content:e}:{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}});return{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,customComponents:r,DynamicRenderer:l,renderMode:i}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"dynamic"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}})],1):"text"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[e._v(e._s(n.renderMode.content))]):t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading},domProps:{innerHTML:e._s(n.renderMode.content)}})},[],!1,null,"e6ed4c9f",null,null).exports;function F({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 Y=M(p.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>{var e,t;return null!=(t=null==(e=null==n?void 0:n.proxy)?void 0:e.$attrs)?t:{}}),r=p.inject("markstreamTypewriter",void 0),l=p.inject("markstreamTextStreamState",void 0),i=p.computed(()=>{const e=o.value.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),a=p.computed(()=>"boolean"==typeof i.value?i.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),s=p.computed(()=>{var e;const t=null!=(e=o.value["index-key"])?e:o.value.indexKey;return null==t||""===t?"":String(t)}),u=p.ref(t.node.code),c=p.ref(""),d=p.ref(0);function m(){return u.value+c.value}function f(e){u.value=e,c.value=""}p.watch([()=>t.node.code,s,a],([e])=>{const t=String(null!=e?e:""),n=m(),o=s.value,r=o?null==l?void 0:l.get(o):void 0,i=F({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}),p.watch(a,e=>{e||f(m())});const v=p.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:m,setFullContent:f,settleStreamedDelta:function(){c.value&&(u.value=m(),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,W=p.ref(!1),V=p.ref(""),K=p.ref("top"),Q=p.ref(null),X=p.ref(null),q=p.ref(null),G=p.ref(null),Z=p.ref(null);let J=null,ee=null;function te(){J&&(clearTimeout(J),J=null),ee&&(clearTimeout(ee),ee=null)}let ne=!1,oe=null;function re(){return ne||"undefined"==typeof document?Promise.resolve():oe||(oe=Promise.resolve().then(()=>io).then(e=>{var t;ne=!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:W.value,anchorEl:Q.value,content:V.value,placement:K.value,id:X.value,originX:q.value,originY:G.value,isDark:null!=(t=Z.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{oe=null,ne=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),oe)}function le(e,t,n="top",o=!1,r,l){if(!e)return;re(),te();const i=()=>{var o,i;X.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Q.value=e,V.value=t,K.value=n,q.value=null!=(o=null==r?void 0:r.x)?o:null,G.value=null!=(i=null==r?void 0:r.y)?i:null,Z.value="boolean"==typeof l?l:null,W.value=!0;try{e.setAttribute("aria-describedby",X.value)}catch(a){}};o?i():J=setTimeout(i,80)}function ie(e=!1){te();const t=()=>{if(Q.value&&X.value)try{Q.value.removeAttribute("aria-describedby")}catch(e){}W.value=!1,Q.value=null,X.value=null,q.value=null,G.value=null};e?t():ee=setTimeout(t,120)}const ae={"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.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},se=e=>{var t;return null!=(t=ae[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)};function ue(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)return e={t:t.t.bind(t),te:"function"==typeof t.te?t.te.bind(t):void 0},{t(t){if(e.te&&ae[t]&&!e.te(t))return se(t);const n=e.t(t);return n===t&&ae[t]?se(t):n}}}catch(t){}}catch(t){}var e;return{t:se}}const ce=M(p.defineComponent({__name:"ImageNode",props:{node:null,fallbackSrc:{default:""},lazy:{type:Boolean,default:!0},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=p.ref(!1),r=p.ref(!1),l=p.ref(!1),i=p.computed(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),{t:a}=ue();return p.watch(i,()=>{o.value=!1,r.value=!1}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,fallbackTried:l,displaySrc:i,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",i.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,i.value])},t:a}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[l.node.loading||a.hasError?a.hasError?l.node.loading||a.props.fallbackSrc?l._e():i("span",{key:"error",staticClass:"image-node__error image-node__error--inline 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})],2):i("span",{key:"placeholder",staticClass:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},[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})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):i("img",{key:"image",staticClass:"image-node__img h-auto rounded-lg transition-opacity duration-200 ease-in-out image-node__img--inline",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},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,null,"0d6967c3",null,null).exports;let de=null,me=!1,pe=he;function fe(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function ve(){try{const e=globalThis;return fe(null==e?void 0:e.katex)}catch(e){return null}}function he(){return(()=>d(this,null,function*(){const e=ve();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return fe(t)}))()}function ge(e){pe=e,de=null,me=!1}function ye(){return"function"==typeof pe}function we(){return d(this,null,function*(){var e;const t=ve();if(t)return de=t,de;if(de)return de;if(me)return null;const n=pe;if(!n)return me=!0,null;try{const t=yield n();if(t)return de=null!=(e=fe(t))?e:t,de}catch(o){}return me=!0,null})}const xe=p.shallowRef(!1);let ke=null;const Me=M(p.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e,n=(ke||(ke=we().then(e=>{xe.value=!!e}).catch(()=>{xe.value=!1})),p.readonly(xe)),o=p.getCurrentInstance(),r=p.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=p.inject("markstreamTypewriter",void 0),i=p.inject("markstreamTextStreamState",void 0),a=p.inject("markstreamStreamVersion",void 0),s=p.computed(()=>{const e=r.value.typewriter;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),u=p.computed(()=>"boolean"==typeof s.value?s.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=p.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),d=p.ref(t.node.content),m=p.ref(""),f=p.ref(0);function v(){return d.value+m.value}function h(e){d.value=e,m.value=""}function g(){m.value&&(d.value=v(),m.value="")}p.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 m.value?g():n!==t&&h(t),void(o&&(null==i||i.set(o,t)));const a=F({nextContent:t,previousContent:l,typewriterEnabled:u.value});d.value=a.settledContent,m.value=a.streamedDelta,a.appended&&(f.value+=1),o&&(null==i||i.set(o,t))},{immediate:!0}),p.watch(u,e=>{e||h(v())});const y=p.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:m,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 be(e){return t=>{var n,o;return p.h(Me,c(u({},t),{node:c(u({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function Ce(){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 be(e=>`$${e}$`);try{if(yield we()){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 be(e=>`$${e}$`)})}function Te(){return d(this,null,function*(){var e;try{if(yield we()){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 be(e=>`$$${e}$$`)})}const Ne=M(p.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,De=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,strong:Ie,emphasis:Be,footnote_reference:S,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,emoji:T,math_inline:Ce,reference:Ne},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,_e=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,strong:Ie,emphasis:Be,footnote_reference:S,strikethrough:je,highlight:Le,insert:Ee,superscript:De,emoji:T,math_inline:Ce,reference:Ne},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,Ie=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,emphasis:Be,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,superscript:De,emoji:T,footnote_reference:S,math_inline:Ce,reference:Ne},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,je=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,strong:Ie,emphasis:Be,highlight:Le,insert:Ee,subscript:_e,superscript:De,emoji:T,footnote_reference:S,math_inline:Ce,reference:Ne},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,Se=M(p.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=p.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:Me,strong:Ie,strikethrough:je,emphasis:Be,image:ce,html_inline:U},d=p.useAttrs(),m=p.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const t of o)Array.isArray(t)&&t[0]&&(r[String(t[0])]=String(null!=(n=t[1])?n:""));else for(const[t,l]of Object.entries(o))t&&null!=l&&!1!==l&&(r[t]=!0===l?"":String(l));return O(r)}),f=p.ref(null),v=p.ref(!1),h=p.computed(()=>{const e=u(u({},d),m.value);return delete e.title,delete e.href,e}),g=p.computed(()=>{var e,n;return O({href:String(null!=(n=null==(e=t.node)?void 0:e.href)?n:"")}).href});function y(){var e,n;return(null==(e=t.node)?void 0:e.title)||g.value||(null==(n=t.node)?void 0:n.text)||""}function w(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 x(){t.showTooltip&&f.value&&w(f.value)&&(v.value=!0,le(f.value,y(),"top",!0,{x:n.x,y:n.y}))}const k=p.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.title;return"string"==typeof o&&o.trim().length>0?o:String(null!=(n=g.value)?n:"")});return p.onMounted(()=>{i(),t.showTooltip&&re(),p.nextTick(()=>{x()})}),p.onUpdated(()=>{x()}),p.onBeforeUnmount(()=>{a(),v.value&&(v.value=!1,ie(!0))}),{__sfc:!0,props:t,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,cssVars:s,nodeComponents:c,attrs:d,nodeAttrs:m,anchorEl:f,isHovering:v,anchorAttrs:h,safeHref:g,getTooltipText:y,isPointerInsideAnchor:w,syncTooltipForHoveredAnchor:x,onAnchorEnter:function(e){if(!t.showTooltip)return;v.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;le(f.value||e.currentTarget,y(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(v.value=!1,ie())},title:k,TextNode:Me}}}),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:r.safeHref,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,"ae37fdb2",null,null).exports,Ee=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,strong:Ie,emphasis:Be,strikethrough:je,highlight:Le,subscript:_e,superscript:De,emoji:T,footnote_reference:S,math_inline:Ce,reference:Ne},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,Le=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,strong:Ie,emphasis:Be,strikethrough:je,insert:Ee,subscript:_e,superscript:De,emoji:T,footnote_reference:S,math_inline:Ce,reference:Ne},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,Be=M(p.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:Me,inline_code:Y,link:Se,html_inline:U,strong:Ie,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,superscript:De,emoji:T,footnote_reference:S,math_inline:Ce,reference:Ne},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,Ae=M(p.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 hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4a90fe82",null,null).exports,Oe=M(p.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>w(null==n?void 0:n.proxy)?ht:Ct);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:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-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,ze=M(p.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,Pe=M(p.defineComponent({__name:"HeadingNode",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:Me,inline_code:Y,link:Se,image:ce,strong:Ie,emphasis:Be,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,superscript:De,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:S,hardbreak:ze,math_inline:Ce,reference:Ne},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,He=M(p.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=p.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=p.computed(()=>null==t.value?{}:{value:t.value}),r=p.getCurrentInstance(),l=p.computed(()=>w(null==r?void 0:r.proxy)?ht:Ct);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,Re=M(p.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:p.computed(()=>(I.value,j(n).list_item||He))}}}),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,$e=Symbol("ViewportPriority");function Ue(e,t){var n,o;const r="undefined"!=typeof window&&"undefined"!=typeof document,l="boolean"==typeof t?p.ref(t):t,i=r?null!=(n=window.requestIdleCallback)?n:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,a=r?null!=(o=window.cancelIdleCallback)?o:e=>window.clearTimeout(e):null;let s=null,u=null;const c=new Map,d=new Set;let m=null;function f(){if(!c.size){try{null==s||s.disconnect()}catch(e){}s=null,u=null,d.size||function(){if(null!=m){try{null==a||a(m)}catch(e){}m=null}}()}}function v(e){const t=c.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==s||s.unobserve(e)}catch(n){}c.delete(e),d.delete(e),f()}}function h(){i&&null==m&&d.size&&(m=i(()=>{m=null;const e=d.values().next().value;e&&(d.delete(e),v(e),d.size&&h())},{timeout:1200}))}const g=(t,n)=>{const o=p.ref(!1);let i,a=!1;const m=new Promise(e=>{i=()=>{a||(a=!0,e())}}),g=()=>{try{null==s||s.unobserve(t)}catch(e){}c.delete(t),d.delete(t),f()};if(!r||!l.value)return o.value=!0,i(),{isVisible:o,whenVisible:m,destroy:g};const y=function(t,n){if(!r)return s;if("undefined"==typeof IntersectionObserver)return null;const o=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,n);if(s&&(i=o,(l=u)&&l.root===i.root&&l.rootMargin===i.rootMargin&&l.threshold===i.threshold))return s;var l,i;if(s)try{s.disconnect()}catch(a){}s=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&v(t.target)},{root:o.root,rootMargin:o.rootMargin,threshold:o.threshold}),u=o;for(const e of c.keys())s.observe(e);return s}(t,n);return y?(c.set(t,{resolve:i,visible:o}),y.observe(t),d.add(t),h(),{isVisible:o,whenVisible:m,destroy:g}):(o.value=!0,i(),{isVisible:o,whenVisible:m,destroy:g})};return p.provide($e,g),g}function Fe(){var e,t;const n=p.inject($e,void 0);if(n)return n;const o=new WeakMap;let r=null;const l=new Set;let i=null;const a="undefined"!=typeof window?null!=(e=window.requestIdleCallback)?e:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,s="undefined"!=typeof window?null!=(t=window.cancelIdleCallback)?t:e=>window.clearTimeout(e):null,u=()=>{if(null!=i){try{null==s||s(i)}catch(e){}i=null}},c=e=>{const t=o.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==r||r.unobserve(e)}catch(n){}o.delete(e),l.delete(e),l.size||u()}},d=()=>{a&&null==i&&l.size&&(i=a(()=>{i=null;const e=l.values().next().value;e&&(l.delete(e),c(e),l.size&&d())},{timeout:1200}))};return e=>{const t=p.ref(!1);let n,i=!1;const a=new Promise(e=>{n=()=>{i||(i=!0,e())}}),s=()=>{try{null==r||r.unobserve(e)}catch(t){}o.delete(e),l.delete(e),l.size||u()},m=r||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(r=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&c(t.target)},{root:null,rootMargin:"300px",threshold:0}),r));return m?(o.set(e,{resolve:n,visible:t}),m.observe(e),l.add(e),d(),{isVisible:t,whenVisible:a,destroy:s}):(t.value=!0,n(),{isVisible:t,whenVisible:a,destroy:s})}}const Ye=new Map,We=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","footnote_anchor","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 Ve(e,t={}){return Qe(e,Ke(t))}function Ke(e){var t;const n=m.normalizeCustomHtmlTags(e.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-html"}::${n.join(",")}`;let r=Ye.get(o);return r||(r=m.getMarkdown(o,{customHtmlTags:n}),Ye.set(o,r)),{markdown:r,options:{allowHtml:!1!==e.allowHtml,htmlPolicy:null!=(t=e.htmlPolicy)?t:"safe",customNodeTag:m.normalizeCustomHtmlTagName(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function Qe(e,t){return(Array.isArray(e)?e:[]).map(e=>Xe(e,t)).join("")}function Xe(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return at(rt(e.content));case"paragraph":return`<p>${Qe(ot(e.children),t)}</p>`;case"strong":return`<strong>${Qe(ot(e.children),t)}</strong>`;case"emphasis":return`<em>${Qe(ot(e.children),t)}</em>`;case"strikethrough":return`<del>${Qe(ot(e.children),t)}</del>`;case"highlight":return`<mark>${Qe(ot(e.children),t)}</mark>`;case"insert":return`<ins>${Qe(ot(e.children),t)}</ins>`;case"subscript":return`<sub>${Qe(ot(e.children),t)}</sub>`;case"superscript":return`<sup>${Qe(ot(e.children),t)}</sup>`;case"inline_code":return`<code>${at(rt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=rt(e.href),o=rt(e.title),r=ot(e.children).length>0?Qe(ot(e.children),t):at(rt(e.text||n)),l=o?` title="${st(o)}"`:"";return`<a${n&&!m.isUnsafeHtmlUrl(n)?` href="${st(n)}"`:""}${l} target="_blank" rel="noreferrer noopener">${r}</a>`}(e,t);case"image":return function(e){const t=rt(e.src),n=rt(e.alt),o=rt(e.title),r=o?` title="${st(o)}"`:"";return`<img src="${st(t)}" alt="${st(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)}"`:""}>${Qe(ot(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${Qe(ot(e.children),t)}</li>`;case"blockquote":return`<blockquote>${Qe(ot(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}>${Qe(ot(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=it(rt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${at(rt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?qe(e.header,t,!0):"",o=Qe(ot(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return qe(e,t);case"table_cell":return Ge(e,t);case"definition_list":return function(e,t){return`<dl>${ot(e.items).map(e=>Ze(e,t)).join("")}</dl>`}(e,t);case"definition_item":return Ze(e,t);case"footnote":return function(e,t){return`<div id="fnref--${st(rt(e.id))}" class="footnote-node markstream-nested-footnote"><div class="footnote-node__content">${Qe(ot(e.children),t)}</div></div>`}(e,t);case"footnote_reference":return function(e){const t=at(rt(e.id)),n=st(rt(e.id));return`<sup id="fnref-${n}" class="footnote-reference markstream-nested-footnote-ref"><span href="#fnref--${n}" title="查看脚注 ${n}" class="footnote-link cursor-pointer">[${t}]</span></sup>`}(e);case"footnote_anchor":return function(e){const t=st(rt(e.id));return`<a class="footnote-anchor" href="#fnref-${t}" title="返回引用 ${t}" aria-label="返回引用 ${t}">↩︎</a>`}(e);case"admonition":return function(e,t){const n=it(rt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${at(rt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${Qe(ot(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return at(rt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${at(rt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${at(rt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${at(rt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=rt(e.content)||rt(e.raw),o=rt(e.tag).trim().toLowerCase(),r=ot(e.children);return t.options.allowHtml?"escape"===t.options.htmlPolicy||e.loading&&!e.autoClosed?at(n):o&&r.length>0&&!m.NON_STRUCTURING_HTML_TAGS.has(o)&&!m.isHtmlTagBlocked(o,t.options.htmlPolicy)?`<${o}${nt(e.attrs)}>${Qe(r,t)}</${o}>`:m.sanitizeHtmlContent(n,t.options.htmlPolicy):at(n)}(e,t);default:return function(e,t){const n=rt(e.tag||e.type);if(!n||We.has(n))return at(rt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${it(n)||"node"}`,et(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=nt(e.attrs,o),l=function(e,t){const n=ot(e.children);if(n.length>0)return Qe(n,t);const o=rt(e.content);return o?Je(o,t):at(rt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${st(n)}">${l}</${i}>`}(e,t)}}function qe(e,t,n=!1){return`<tr>${ot(e.cells).map(e=>Ge(e,t,n)).join("")}</tr>`}function Ge(e,t,n=!1){const o=n||e.header?"th":"td",r=rt(e.align);return`<${o}${r?` style="text-align:${st(r)}"`:""}>${Qe(ot(e.children),t)}</${o}>`}function Ze(e,t){return`<dt>${Qe(ot(e.term),t)}</dt><dd>${Qe(ot(e.definition),t)}</dd>`}function Je(e,t){return e?t.markdown.render(e):""}function et(e,t){return t?tt("function"==typeof t?t(e):t):""}function tt(e){return Array.isArray(e)?e.map(e=>tt(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function nt(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){const e=String(i).trim(),t=e.toLowerCase();e&&lt(e)&&(m.DANGEROUS_HTML_ATTRS.has(t)||!0!==a&&m.URL_HTML_ATTRS.has(t)&&a&&m.isUnsafeHtmlUrl(String(a))||("class"!==t?!0===a?o.push(` ${e}`):o.push(` ${e}="${st(String(a))}"`):r.push(String(a))))}const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${st(l)}"`),o.join("")}function ot(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function rt(e){return"string"==typeof e?e:null==e?"":String(e)}function lt(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function it(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function at(e){return rt(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function st(e){return at(e).replace(/`/g,"&#96;")}const ut=M(p.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=p.inject("markstreamHtmlPolicy",void 0),o=p.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=p.computed(()=>{const e=m.sanitizeHtmlTokenAttrs(t.node.attrs,o.value);if(!e)return;const n=m.tokenAttrsToRecord(e);return Object.keys(n).length>0?n:void 0}),l=p.computed(()=>{const e=String(t.node.tag||"").trim(),n=m.sanitizeHtmlTokenAttrs(t.node.attrs,o.value,e);if(!n)return;const r=m.tokenAttrsToRecord(n);return Object.keys(r).length>0?r:void 0}),i=p.computed(()=>j(t.customId)),a=p.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return $(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),s=p.computed(()=>Array.isArray(t.node.children)?t.node.children:[]),u=p.computed(()=>String(t.node.tag||"div")),c=p.computed(()=>{const e=u.value.trim().toLowerCase();return m.NON_STRUCTURING_HTML_TAGS.has(e)||m.isHtmlTagBlocked(e,o.value)}),d=p.computed(()=>0===s.value.length||!t.node.tag||c.value?"":Ve(s.value,{htmlPolicy:o.value})),f=p.computed(()=>{if(s.value.length>0&&t.node.tag&&!c.value)return{mode:"structured"};const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:R(e,i.value)?{mode:"dynamic",content:e}:{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}}),v=p.ref(null),h=p.ref("undefined"==typeof window),g=p.ref(t.node.content),y=Fe();let w=null;const x=!!t.node.loading;return"undefined"!=typeof window?(p.watch(v,e=>{var n;if(null==(n=null==w?void 0:w.destroy)||n.call(w),w=null,!x)return h.value=!0,void(g.value=t.node.content);if(!e)return void(h.value=!1);const o=y(e,{rootMargin:"400px"});w=o,h.value=o.isVisible.value,o.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),p.watch(()=>t.node.content,e=>{x&&!h.value||(g.value=e)})):h.value=!0,p.onBeforeUnmount(()=>{var e;null==(e=null==w?void 0:w.destroy)||e.call(w),w=null}),{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,boundAttrs:r,structuredBoundAttrs:l,customComponents:i,DynamicRenderer:a,structuredChildren:s,structuredTag:u,isBlockedStructuredTag:c,structuredHtml:d,renderMode:f,htmlRef:v,shouldRender:h,renderContent:g,registerVisibility:y,visibilityHandle:w,isDeferred:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"structured"===n.renderMode.mode&&n.shouldRender?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node",domProps:{innerHTML:e._s(n.structuredHtml)}},"component",n.structuredBoundAttrs,!1)):"structured"===n.renderMode.mode?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node"},"component",n.structuredBoundAttrs,!1),[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)]):t("div",{ref:"htmlRef",staticClass:"html-block-node"},[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}}):t("div",e._b({domProps:{innerHTML:e._s(n.renderMode.content)}},"div",n.boundAttrs,!1))]: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,"83cd7b66",null,null).exports,ct=M(p.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null,customHtmlTags:null},setup(e){const t=e,n=j(t.customId);function o(e){var t;return"text"===e.type&&""===String(null!=(t=e.content)?t:"").trim()}function r(e){return"link"===e.type&&Array.isArray(e.children)?e.children.filter(e=>!o(e)):[]}function l(e){var t;const n=r(e);return 1===n.length&&"image"===(null==(t=n[0])?void 0:t.type)}const i=p.computed(()=>t.node.children.filter(e=>!o(e))),a=p.computed(()=>i.value.length>0&&i.value.every(e=>"image"===e.type||l(e))),s=p.computed(()=>new Set(m.normalizeCustomHtmlTags(t.customHtmlTags))),d=p.computed(()=>{if(!a.value||i.value.length<=1)return t.node.children;const e=[];for(let n=0;n<t.node.children.length;n++){const r=t.node.children[n];if(!o(r)){e.push(r);continue}const l=e.length>0,i=t.node.children.slice(n+1).some(e=>!o(e));l&&i&&e.push(c(u({},r),{content:" ",raw:" "}))}return e}),f=u({inline_code:Y,image:ce,link:Se,hardbreak:ze,emphasis:Be,strong:Ie,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,superscript:De,html_inline:U,html_block:ut,emoji:T,checkbox:b,math_inline:Ce,checkbox_input:b,reference:Ne,footnote_anchor:Ae,footnote_reference:S,text:Me},n);return{__sfc:!0,props:t,overrides:n,isWhitespaceText:o,getTextContent:function(e){var t;return String(null!=(t=e.content)?t:"")},getMeaningfulLinkChildren:r,isImageOnlyLink:l,meaningfulChildren:i,isMediaOnlyParagraph:a,customHtmlTagsSet:s,renderedChildren:d,getChildProps:function(e,n){var o;return{node:e,"index-key":`${null!=(o=t.indexKey)?o:"paragraph"}-${n}`,"custom-id":t.customId,"custom-html-tags":t.customHtmlTags}},nodeComponents:f,processChild:function(e){var t,n,o,r;if("html_block"===e.type||"html_inline"===e.type){const l=String(null!=(t=e.tag)?t:"").trim().toLowerCase()||m.getHtmlTagFromContent(e.content);if(l&&!s.value.has(l)&&m.shouldRenderUnknownHtmlTagAsText(null!=(n=e.content)?n:e.raw,l)){const t=String(null!=(r=null!=(o=e.content)?o:e.raw)?r:"");return{child:{type:"text",content:t,raw:t},component:Me}}}return{child:e,component:f[e.type]}}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},[e._l(n.renderedChildren,function(o,r){return[n.isMediaOnlyParagraph&&n.isWhitespaceText(o)?[e._v(" "+e._s(n.getTextContent(o))+" ")]:t(n.processChild(o).component,e._b({key:`${e.indexKey||"paragraph"}-${r}`,tag:"component"},"component",n.getChildProps(n.processChild(o).child,r),!1))]})],2)},[],!1,null,"3275cbf4",null,null).exports,dt=M(p.defineComponent({__name:"PreCodeNode",props:{node:null},setup(e){const t=e,n=p.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=p.computed(()=>`language-${n.value}`),r=p.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,mt=M(p.defineComponent({__name:"TableNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.computed(()=>{var e;return null!=(e=t.node.loading)&&e}),o=p.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=p.ref(null),l=p.ref([]),i=p.getCurrentInstance(),a=p.computed(()=>w(null==i?void 0:i.proxy)?ht:Ct);let s=null;const u=p.computed(()=>l.value.map(e=>e>0?{width:`${e}px`}:void 0)),c=p.computed(()=>l.value.length>0);function d(){var e;const t=null==(e=r.value)?void 0:e.querySelectorAll("thead th");return Array.from(null!=t?t:[],e=>Math.round(e.getBoundingClientRect().width))}function m(e){if(!s)return;e.preventDefault();const t=s.startWidth+s.nextStartWidth,n=Math.min(48,Math.floor(t/2)),o=Math.max(n,Math.min(t-n,Math.round(s.startWidth+e.clientX-s.startX))),r=[...s.widths];r[s.index]=o,r[s.index+1]=t-o,l.value=r}function f(){s&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),s=null)}return p.watch(()=>t.node.header.cells.length,()=>{f(),l.value=[]}),p.onBeforeUnmount(f),{__sfc:!0,props:t,isLoading:n,bodyRows:o,tableRef:r,columnWidths:l,instance:i,nestedRenderer:a,MIN_COLUMN_WIDTH:48,resizeState:s,columnStyles:u,hasColumnWidths:c,measureHeaderWidths:d,onColumnResizeMove:m,stopColumnResize:f,startColumnResize:function(e,t){if(0!==t.button)return;const n=d(),o=n[e],r=n[e+1];o&&r&&(t.preventDefault(),s={index:e,startX:t.clientX,startWidth:o,nextStartWidth:r,widths:n},l.value=n,window.addEventListener("pointermove",m),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f))}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{ref:"tableRef",staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[n.hasColumnWidths?t("colgroup",e._l(e.node.header.cells,function(e,o){return t("col",{key:`col-${o}`,style:n.columnStyles[o]})}),0):e._e(),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)}}}),r<e.node.header.cells.length-1?t("button",{staticClass:"table-node__resize-handle",attrs:{type:"button","aria-label":`Resize columns ${r+1} and ${r+2}`},on:{pointerdown:function(e){return n.startColumnResize(r,e)}}}):e._e()],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,"11208a21",null,null).exports,pt=M(p.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,ft=M(p.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,vt=M(p.defineComponent({__name:"VmrContainerNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=p.computed(()=>`vmr-container vmr-container-${t.node.name}`),o=j(t.customId),r=u({text:Me,paragraph:ct,heading:Pe,inline_code:Y,link:Se,image:ce,strong:Ie,emphasis:Be,strikethrough:je,insert:Ee,subscript:_e,superscript:De,checkbox:b,checkbox_input:b,hardbreak:ze,math_inline:Ce,reference:Ne,list:Re,math_block:Te,table:mt},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||ft}}}}),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,ht=M(p.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,htmlPolicy:null},emits:["copy","handleArtifactClick","click"],setup(e,{emit:t}){const n=e,o={text:Me,paragraph:ct,heading:Pe,code_block:dt,list:Re,list_item:He,blockquote:gt,table:mt,definition_list:C,footnote:Oe,footnote_reference:S,footnote_anchor:Ae,admonition:Tt,vmr_container:vt,hardbreak:ze,link:Se,image:ce,thematic_break:pt,math_inline:Ce,math_block:Te,strong:Ie,emphasis:Be,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,superscript:De,emoji:T,checkbox:b,checkbox_input:b,inline_code:Y,html_inline:U,html_block:ut,reference:Ne},r=p.computed(()=>(I.value,j(n.customId))),l=p.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),i=p.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=p.computed(()=>{var e;return{typewriter:n.typewriter,htmlPolicy:null!=(e=n.htmlPolicy)?e:"safe"}}),s=p.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),d=p.computed(()=>u(u({},a.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),f=p.computed(()=>new Set(m.normalizeCustomHtmlTags(n.customHtmlTags))),v=p.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n,i,a,s;let d=e;const p=h(d),v=String((null==d?void 0:d.type)||"unknown");let w=g(d,p);if(("html_block"===d.type||"html_inline"===d.type)&&w===o[d.type]){const e=String(null!=(n=d.tag)?n:"").trim().toLowerCase()||m.getHtmlTagFromContent(d.content);if(e)if(f.value.has(e)){const t=r.value[e];t&&(w=t,d=c(u({},d),{type:e,tag:e,content:m.stripCustomHtmlWrapper(d.content,e)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(i=d.content)?i:d.raw,e)){const e=String(null!=(s=null!=(a=d.content)?a:d.raw)?s:"");"html_inline"===d.type?(w=Me,d={type:"text",content:e,raw:e}):(w=ct,d={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===v?`${l.value}-${t}-${v}`:`${l.value}-${t}-${v}-${String((null==e?void 0:e.raw)||"").length}`,node:d,isCodeBlock:"code_block"===(null==d?void 0:d.type),component:w,bindings:y(d,p)}}));function h(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function g(e,t){if(!e)return ft;const l=r.value,i=l[String(e.type)];if("code_block"===e.type){const o=null!=t?t:h(e),r=o?l[o]:void 0;return r||("mermaid"===o?l.mermaid||dt:"infographic"===o?l.infographic||dt:"d2"===o||"d2lang"===o?l.d2||dt:i||(l.code_block||(n.renderCodeBlocksAsPre,dt)))}return i||o[String(e.type)]||ft}function y(e,t){const n=null!=t?t:h(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:f,renderedItems:v,getCodeBlockLanguage:h,getNodeComponent:g,getBindingsFor:y,handleClick:function(e){t("click",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,gt=M(p.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>w(null==n?void 0:n.proxy)?ht:Ct);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;function yt(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function wt(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),o=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===o?220+28*n:"sequencediagram"===o?180+26*n:"classdiagram"===o||"statediagram"===o||"erdiagram"===o?180+24*n:"flowchart"===o||"graph"===o?170+28*n:200+22*n}function xt(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function kt(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function Mt(e,t=360,n=500){return kt(e,t,n)}function bt(e,t=360,n=500){return kt(e,t,n)}const Ct=M(p.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,htmlPolicy: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=p.ref(),a=p.ref(!1),s=/auto|scroll|overlay/i,f="undefined"!=typeof window,h=p.getCurrentInstance(),g=p.computed(()=>l.debugPerformance&&f&&"undefined"!=typeof console),y=p.computed(()=>{var e,t;return null!=(t=null==(e=null==h?void 0:h.proxy)?void 0:e.$attrs)?t:{}}),x=new Map,k=p.ref(0),M=p.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}),N=p.inject("markstreamHtmlPolicy",void 0),D=p.computed(()=>{var e,t;return null!=(t=null!=(e=l.htmlPolicy)?e:null==N?void 0:N.value)?t:"safe"});function _(e,t){g.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function E(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}p.provide("markstreamShowTooltips",M),p.provide("markstreamHtmlPolicy",D),p.provide("markstreamTypewriter",p.computed(()=>!1!==l.typewriter)),p.provide("markstreamTextStreamState",x),p.provide("markstreamStreamVersion",k),p.watch([()=>l.content,()=>l.nodes],()=>{k.value+=1},{immediate:!0});const L=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,B=m.getMarkdown(L),A=new Map,O=p.markRaw([]),z=p.computed(()=>(I.value,j(l.customId))),P=p.computed(()=>{var e;return m.mergeCustomHtmlTags(l.customHtmlTags,null==(e=l.parseOptions)?void 0:e.customHtmlTags)}),H=p.computed(()=>{const{key:e,tags:t}=m.resolveCustomHtmlTags(P.value);if(!e)return B;const n=A.get(e);if(n)return n;const o=m.getMarkdown(L,{customHtmlTags:t});return A.set(e,o),o}),R=p.computed(()=>{const e=H.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function $(e){if(Array.isArray(e))return Object.freeze(e.map(e=>$(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=$(o);return Object.freeze(t)}function F(e){return e.map(e=>$(e))}const W=p.computed(()=>{var e,t;const n=null!=(e=l.parseOptions)?e:{},o=null!=(t=l.final)?t:n.final,r=P.value,i=null!=o,a=r.length>0;return i||a?u(u(u({},n),i?{final:o}:{}),a?{customHtmlTags:r}:{}):n}),V=p.computed(()=>{var e;const t=null!=(e=W.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),K=p.computed(()=>{var e;if(w(null==h?void 0:h.proxy)&&!l.content&&Array.isArray(l.nodes))return O;if(null==(e=l.nodes)?void 0:e.length)return p.markRaw(F(l.nodes));if(l.content){const e=g.value?performance.now():0,t=m.parseMarkdownToStructure(l.content,R.value,W.value);return g.value&&_("parse(sync)",{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:l.content.length}),p.markRaw(F(t))}return[]}),Q=p.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),X=p.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&K.value.length>Q.value}),q=p.computed(()=>!1!==l.viewportPriority&&!a.value),G=Ue(e=>{var t;return E(null!=(t=null!=e?e:i.value)?t:null)},q),Z=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,J=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,ee="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),te=f&&"function"==typeof window.requestIdleCallback,ne=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),oe=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:ne.value);return Number.isFinite(t)?Math.max(0,t):ne.value}),re=p.computed(()=>!1!==l.batchRendering&&ne.value>0&&f&&!ee),le=p.ref(0),ie=p.ref({key:l.indexKey,total:0}),ae=p.ref(Math.max(1,ne.value||1)),se=p.reactive({}),ue=new Map,de=new Map,me=new Map,pe=new WeakMap,fe=p.ref(0),ve=p.computed(()=>(fe.value,Array.from(me.entries()).sort((e,t)=>e[0]-t[0]))),he=p.ref(null);let ge=null,ye=null;const we=p.reactive({start:0,end:0}),xe=p.computed(()=>{if(!X.value)return K.value.map((e,t)=>({node:e,index:t}));const e=K.value.length,t=st(we.start,0,e),n=st(we.end,t,e);return K.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),ke=p.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!X.value&&!(K.value.length>900)&&q.value}),be=p.computed(()=>{var e;return re.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),$e=p.ref({batchSize:ne.value,initial:oe.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:be.value}),Fe=p.computed(()=>!!G&&(ke.value||X.value)),Ye=p.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),We=p.ref(0),Ve=new Map,Ke=p.computed(()=>w(null==h?void 0:h.proxy)),Qe=p.computed(()=>Ke.value&&!l.content&&Array.isArray(l.nodes)),Xe=p.computed(()=>Qe.value?p.markRaw(F(l.nodes||[])):O);function qe(){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=Ge(o[`node-slot-${l.index}`]),i=Ge(o[`node-content-${l.index}`]);(null!=(e=me.get(l.index))?e:null)!==n&&Vt(l.index,n),(null!=(t=Ve.get(l.index))?t:null)!==i&&Qt(l.index,i),r.add(l.index)}for(const l of Array.from(me.keys()))r.has(l)||Vt(l,null);for(const l of Array.from(Ve.keys()))r.has(l)||Qt(l,null)}function Ge(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const Ze=p.computed(()=>{if(!X.value)return K.value.length;const e=Ye.value,t=Math.max(we.end+e,oe.value),n=Math.min(K.value.length,t);return Math.max(le.value,n)});function Je(e){var t,n,o,r;const l=E(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 et(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 tt(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(!et(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 nt(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 ot(){ge&&(ge(),ge=null),he.value=null}function rt(){if(!f||!X.value)return;const e=Je();if(!e||he.value===e)return;ot();const t=()=>it();e.addEventListener("scroll",t,{passive:!0}),he.value=e,ge=()=>{e.removeEventListener("scroll",t)}}function lt(){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==J||J(ye.id),ye=null}function it(e={}){var t,n,o;if(!X.value)return;if(!f)return void at(!0);if(e.immediate)return lt(),void at(!0);if(ye)return;const r=()=>{ye=null,at()};if(Z)ye={id:Z(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 at(e=!1){var t,n,o,r,l,a,s;if(!X.value)return;const u=he.value||Je();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),m=u===(null==c?void 0:c.documentElement)||u===(null==c?void 0:c.body),p=K.value.length;if(!m&&p>0&&et(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=st(Ut(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,p-1));return void((e||Math.abs(r-We.value)>1)&&(We.value=r))}const f=m?null:u.getBoundingClientRect(),v=m?0:f.top,h=m?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=ve.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=m?{top:0}:u.getBoundingClientRect(),n=tt(u,c,m),o=m?(()=>{const n=e.getBoundingClientRect(),o=(m?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=nt(e,u);return Math.max(0,n-t)})(),p=m?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=$t(o+.5*Math.max(0,p));return void(We.value=st(f,0,Math.max(0,K.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-We.value)<=1||(We.value=st(x,0,Math.max(0,K.value.length-1)))}function st(e,t,n){return Math.min(Math.max(e,t),n)}function kt(){const e=K.value.length;if(!X.value||0===e)return we.start=0,void(we.end=e);const t=Math.min(Q.value,e),n=Ye.value,o=st(We.value-n,0,Math.max(0,e-t));we.start=o,we.end=Math.min(e,o+t)}const Ct=p.reactive({}),Nt=p.reactive({total:0,count:0}),Dt=p.ref(0),_t=p.ref([]),It=p.ref([]);function jt(){for(const e of Object.keys(Ct))delete Ct[Number(e)];Nt.total=0,Nt.count=0,Dt.value=0,_t.value=[],It.value=[]}function St(e){if(e<=0)return void jt();let t=0,n=0;for(const[o,r]of Object.entries(Ct)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete Ct[l]:(t+=i,n++)}Nt.total=t,Nt.count=n}function Et(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Lt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function Bt(e,t,n){if(n<=t)return 0;const o=Lt(e,n-1);return t<=0?o:o-Lt(e,t-1)}function At(e){Dt.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(Ct)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(Et(t,l,i),Et(n,l,1))}_t.value=t,It.value=n}function Ot(e,t){if(!Number.isFinite(t)||t<=0)return;const n=Ct[e];if(Ct[e]=t,n?Nt.total+=t-n:(Nt.total+=t,Nt.count++),Dt.value>e){const o=_t.value,r=It.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&Et(o,e,r)}else Et(o,e,t),Et(r,e,1)}}const zt=p.computed(()=>Nt.count>0?Math.max(12,Nt.total/Nt.count):32);function Pt(e,t){var n,o;if(e>=t)return 0;if(Dt.value!==K.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=Ct[r])?n:zt.value;return o}const r=_t.value,l=It.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=Ct[r])?o:zt.value;return n}return Bt(r,e,t)+(t-e-Bt(l,e,t))*zt.value}p.watch(()=>K.value.length,e=>{e<=0?jt():(e<Dt.value&&St(e),e!==Dt.value&&At(e))},{immediate:!0});const Ht=p.computed(()=>X.value?Pt(0,Math.min(we.start,K.value.length)):0),Rt=p.computed(()=>{if(!X.value)return 0;const e=K.value.length;return Pt(Math.min(we.end,e),e)});function $t(e){var t;if(e<=0)return 0;const n=K.value;if(Dt.value===n.length&&_t.value.length&&It.value.length){const t=zt.value,o=_t.value,r=It.value,l=e=>e<=0?0:Lt(o,e-1)+(e-Lt(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=Ct[r])?t:zt.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function Ut(e){var t;const n=K.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(Dt.value===n.length){const t=Pt(0,n.length);return $t(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=Ct[r])?t:zt.value;if(o<=e)return r;o-=e}return 0}function Ft(e){if(!ue.size)return;if(!X.value)return;let t=!1;for(const[n,o]of ue)n>=e&&(o.destroy(),ue.delete(n),ke.value&&delete se[n],tn(n),me.delete(n)&&(t=!0));t&&Kt()}function Yt(e,t){ke.value&&(se[e]=t),t&&(X.value?it():We.value=st(e,0,Math.max(0,K.value.length-1)))}function Wt(e){const t=ue.get(e);t&&(t.destroy(),ue.delete(e)),tn(e)}function Vt(e,t){let n=!1;if(t){const o=me.get(e);me.set(e,t),o!==t&&(n=!0)}else me.delete(e)&&(n=!0);if(n&&Kt(),t||tn(e),!Fe.value||!G)return Wt(e),void(t?Yt(e,!0):ke.value&&delete se[e]);if(!X.value&&ke.value&&!a.value&&ue.size>=640&&(on("too-many-targets"),!Fe.value||!G))return Wt(e),void(t?Yt(e,!0):ke.value&&delete se[e]);if(e<oe.value&&!X.value)return Wt(e),void Yt(e,!0);if(!t)return Wt(e),void(ke.value&&delete se[e]);Wt(e);const o=G(t,{rootMargin:"400px"});o&&(ue.set(e,o),Yt(e,o.isVisible.value),ke.value&&nn(e),o.whenVisible.then(()=>{tn(e),Yt(e,!0)}).catch(()=>{}).finally(()=>{ue.get(e)===o&&ue.delete(e);try{o.destroy()}catch(t){}}),X.value&&it())}function Kt(){fe.value+=1}function Qt(e,t){t?(Ve.set(e,t),queueMicrotask(()=>{Ot(e,t.offsetHeight)})):Ve.delete(e)}p.onMounted(()=>{f&&p.nextTick(qe)}),p.watch(xe,()=>{f&&p.nextTick(qe)}),p.watch(le,()=>{f&&p.nextTick(qe)}),p.watch(X,()=>{f&&p.nextTick(qe)});let Xt=null,qt=null,Gt=!1,Zt=null,Jt=null;function en(){f&&(null!=Xt&&(null==J||J(Xt),Xt=null),null!=qt&&(window.clearTimeout(qt),qt=null),null!=Jt&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(Jt),Jt=null),Gt=!1,Zt=null)}function tn(e){if(!f)return;const t=de.get(e);null!=t&&(window.clearTimeout(t),de.delete(e))}function nn(e){if(!f||!ke.value)return;tn(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(de.delete(e),!ke.value)return;if(!0===se[e])return;const o=me.get(e);if(!o)return void delete se[e];const r=Je(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&&Yt(e,!0)},1800+t);de.set(e,n)}function on(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 ue.values())e.destroy();if(ue.clear(),f)for(const e of de.values())window.clearTimeout(e);de.clear();for(const e of Object.keys(se))delete se[e]}}function rn(e,t={}){var n,o;if(!be.value)return;const r=Ze.value;if(le.value>=r)return;const i=Math.max(1,e),a=e=>{var t;Xt=null,qt=null,Jt=null,Gt=!1;const n=null!=Zt?Zt:i;Zt=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();le.value=Math.min(r,le.value+Math.max(1,e)),Ft(le.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return an(n),n};let s=n;for(;(a(s),!(le.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ae.value));le.value<r&&ln()};if(!f||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(Zt=null!=Zt?Math.max(Zt,i):i,!Gt){if(Gt=!0,!ee&&te&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(Jt=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}Z&&!ee?Xt=Z(()=>{0!==s?qt=window.setTimeout(()=>a(),s):a()}):qt=window.setTimeout(()=>a(),s)}}function ln(){be.value&&rn(re.value?Math.max(1,Math.round(ae.value)):Math.max(1,ne.value))}function an(e){var t;if(!be.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,ne.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?ae.value=Math.max(r,Math.floor(.7*ae.value)):e<.5*n&&ae.value<o&&(ae.value=Math.min(o,Math.ceil(1.2*ae.value)))}function sn(){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),dt}})}p.watch([()=>K.value,()=>K.value.length,()=>be.value,()=>ne.value,()=>oe.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=K.value.length,n=ie.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;ie.value={key:o,total:t};const s=$e.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==ne.value||s.initial!==oe.value||s.delay!==u||s.enabled!==be.value;$e.value={batchSize:ne.value,initial:oe.value,delay:u,enabled:be.value},(a||c||!be.value)&&en(),(a||c)&&(ae.value=Math.max(1,ne.value||1)),a&&X.value&&it({immediate:!0});const d=Ze.value;if(!t)return 0!==le.value&&(le.value=0),void Ft(0);if(!be.value)return le.value!==d&&(le.value=d),void Ft(le.value);if(r||0===n.total||c){const e=Math.min(d,oe.value);le.value!==e&&(le.value=e)}else{const e=Math.min(le.value,d);le.value!==e&&(le.value=e)}const m=Math.max(1,oe.value||ne.value||t);le.value<d?rn(m,{immediate:!f}):Ft(le.value)},{immediate:!0}),p.watch(()=>X.value,e=>{if(!e)return ot(),void lt();rt(),it({immediate:!0})},{immediate:!0}),p.watch([()=>K.value.length,()=>X.value],e=>d(this,[e],function*([e,t]){t&&e&&f&&(yield p.nextTick(),it({immediate:!0}))}),{flush:"post"}),p.watch(()=>i.value,()=>{X.value&&(rt(),it({immediate:!0}))}),p.watch(()=>K.value.length,()=>{X.value&&it({immediate:!0})}),p.watch(()=>ke.value,e=>{if(e)for(const[t,n]of me)Vt(t,n);else{for(const e of ue.values())e.destroy();ue.clear();for(const e of Array.from(de.keys()))tn(e);for(const e of Object.keys(se))delete se[e];for(const[e,t]of me)t&&Yt(e,!0)}},{immediate:!1}),p.watch([()=>l.viewportPriority,()=>K.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),p.watch(()=>le.value,()=>{X.value&&it({immediate:!0})}),p.watch([We,Q,Ye,()=>K.value.length,X],()=>{kt()},{immediate:!0}),p.watch([()=>K.value.length,X,Q,Ye,()=>we.start,()=>we.end],([e,t,n,o,r,l])=>{g.value&&_("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:We.value,scroll:t?(()=>{const e=he.value||Je();return e?{reverse:et(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:le.value})}),p.watch(()=>Ze.value,(e,t)=>{be.value&&("number"==typeof t&&e<=t||e>le.value&&ln())}),p.onBeforeUnmount(()=>{en();for(const e of ue.values())e.destroy();ue.clear();for(const e of Array.from(de.keys()))tn(e);ot(),lt()});const un={name:"MermaidBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:p.h,o="function"==typeof e?{attrs:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"}}:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"},r=`${null!=(t=yt(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",c(u({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Mermaid")])]),n("div",{class:["mermaid-preview-area min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},dn=p.ref(null);let mn=null;function pn(){dn.value||mn||(mn=Promise.resolve().then(()=>require("./chunks/index-91325ae4.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{dn.value=e}).catch(e=>{console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),dn.value=dt}))}function fn(){return pn(),dn.value||un}const vn={name:"InfographicBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:p.h,o="function"==typeof e?{attrs:{"data-markstream-infographic":"1","data-markstream-mode":"pending"}}:{"data-markstream-infographic":"1","data-markstream-mode":"pending"},r=`${null!=(t=yt(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",c(u({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Infographic")])]),n("div",{class:["infographic-preview min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},hn=p.ref(null);let gn=null;function yn(){hn.value||gn||(gn=Promise.resolve().then(()=>require("./chunks/index-8693b3db.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{hn.value=e}).catch(e=>{console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",e),hn.value=dt}))}function wn(){return yn(),hn.value||vn}function xn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>cn);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),dt}})}const kn=p.computed(()=>l.renderCodeBlocksAsPre?dt:sn),Mn={text:Me,paragraph:ct,heading:Pe,code_block:sn,list:Re,list_item:He,blockquote:gt,table:mt,definition_list:C,footnote:Oe,footnote_reference:S,footnote_anchor:Ae,admonition:Tt,vmr_container:vt,hardbreak:ze,link:Se,image:ce,thematic_break:pt,math_inline:Ce,math_block:Te,strong:Ie,emphasis:Be,strikethrough:je,highlight:Le,insert:Ee,subscript:_e,superscript:De,emoji:T,checkbox:b,checkbox_input:b,inline_code:Y,html_inline:U,reference:Ne,html_block:ut},bn=p.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Cn=p.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||{})),Tn=p.computed(()=>u({},l.mermaidProps||{})),Nn=p.computed(()=>u({},l.d2Props||{})),Dn=p.computed(()=>u({},l.infographicProps||{})),_n=p.computed(()=>({typewriter:l.typewriter,customHtmlTags:W.value.customHtmlTags,htmlPolicy:D.value})),In=p.computed(()=>u(u({},_n.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),jn=p.computed(()=>u(u({},_n.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),Sn=p.computed(()=>Xe.value.map((e,t)=>{var n,o,r,l;const i=An(e);let a=e,s=Rn(e,i);if(("html_block"===e.type||"html_inline"===e.type)&&s===Mn[e.type]){const t=String(null!=(n=e.tag)?n:"").trim().toLowerCase()||m.getHtmlTagFromContent(e.content);if(t)if(V.value.has(t)){const n=z.value[t];n&&(s=n,a=c(u({},e),{type:t,tag:t,content:m.stripCustomHtmlWrapper(e.content,t)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(o=e.content)?o:e.raw,t)){const t=String(null!=(l=null!=(r=e.content)?r:e.raw)?l:"");"html_inline"===e.type?(s=Me,a={type:"text",content:t,raw:t}):(s=ct,a={type:"paragraph",children:[{type:"text",content:t,raw:t}],raw:t})}}return{node:a,component:s,bindings:$n(a,i),isCodeBlock:"code_block"===a.type,index:t,indexKey:`${bn.value}-${t}`,renderKey:zn(a,t)}})),En=p.computed(()=>!(!Ke.value||!l.content)&&K.value.some(e=>On(e))),Ln=p.computed(()=>xe.value.map(e=>{var t,n,o,r;let l=Bn(e.node);const i=An(l);let a=Rn(l,i);if(("html_block"===l.type||"html_inline"===l.type)&&a===Mn[l.type]){const e=String(null!=(t=l.tag)?t:"").trim().toLowerCase()||m.getHtmlTagFromContent(l.content);if(e)if(V.value.has(e)){const t=z.value[e];t&&(a=t,l=c(u({},l),{type:e,tag:e,content:m.stripCustomHtmlWrapper(l.content,e)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(n=l.content)?n:l.raw,e)){const e=String(null!=(r=null!=(o=l.content)?o:l.raw)?r:"");"html_inline"===l.type?(a=Me,l={type:"text",content:e,raw:e}):(a=ct,l={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return c(u({},e),{node:l,component:a,bindings:$n(l,i),isCodeBlock:"code_block"===l.type,indexKey:`${bn.value}-${e.index}`,renderKey:zn(l,e.index)})}));function Bn(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=pe.get(s);if(d&&d.signature===c)return d.node;const m=u({},s);return pe.set(s,{signature:c,node:m}),m}function An(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function On(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 zn(e,t){const n=`${bn.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(Ke.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function Pn(e){var t,n;const o=u({},Tn.value);return null==yt(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Mt(wt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=yt(o.maxHeight))?n:void 0)),o}function Hn(e){var t,n;const o=u({},Dn.value);return null==yt(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=bt(xt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=yt(o.maxHeight))?n:void 0)),o}function Rn(e,t){if(!e)return ft;const n=z.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:An(e),l=r?n[r]:void 0;if(l)return l;if("mermaid"===r)return n.mermaid||fn();if("infographic"===r)return n.infographic||wn();if("d2"===r||"d2lang"===r)return n.d2||xn;if(o)return o;return n.code_block||kn.value}return o||Mn[String(e.type)]||ft}function $n(e,t){const n=null!=t?t:An(e);return"mermaid"===n?Pn(e):"infographic"===n?Hn(e):"d2"===n||"d2lang"===n?Nn.value:"link"===e.type?In.value:"list"===e.type?jn.value:"code_block"===e.type?Cn.value:_n.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,inheritedHtmlPolicy:N,resolvedHtmlPolicy:D,logPerf:_,resolveViewportRoot:E,instanceMsgId:L,defaultMd:B,customTagCache:A,EMPTY_PARSED_NODES:O,customComponentsMap:z,effectiveCustomHtmlTags:P,mdBase:H,mdInstance:R,cloneNodeValue:$,cloneParsedNodeList:F,mergedParseOptions:W,effectiveCustomHtmlTagsSet:V,parsedNodes:K,maxLiveNodesResolved:Q,virtualizationEnabled:X,viewportPriorityEnabled:q,registerNodeVisibility:G,requestFrame:Z,cancelFrame:J,isTestEnv:ee,hasIdleCallback:te,resolvedBatchSize:ne,resolvedInitialBatch:oe,batchingEnabled:re,renderedCount:le,previousRenderContext:ie,adaptiveBatchSize:ae,nodeVisibilityState:se,nodeVisibilityHandles:ue,nodeVisibilityFallbackTimers:de,nodeSlotElements:me,codeBlockRenderCache:pe,nodeSlotVersion:fe,sortedNodeSlots:ve,scrollRootElement:he,detachScrollHandler:ge,pendingFocusSync:ye,liveRange:we,visibleNodes:xe,deferNodes:ke,incrementalRenderingActive:be,previousBatchConfig:$e,shouldObserveSlots:Fe,liveNodeBufferResolved:Ye,focusIndex:We,nodeContentElements:Ve,legacyVue26:Ke,legacyNodesMode:Qe,legacyNodeItems:Xe,syncNodeRefs:qe,resolveTemplateRef:Ge,desiredRenderedCount:Ze,resolveScrollContainer:Je,isReverseFlexScrollRoot:et,getNormalizedScrollTop:tt,getOffsetTopWithinRoot:nt,cleanupScrollListener:ot,setupScrollListener:rt,cancelScheduledFocusSync:lt,scheduleFocusSync:it,syncFocusToScroll:at,clamp:st,updateLiveRange:kt,nodeHeights:Ct,heightStats:Nt,heightTreeSize:Dt,heightSumTree:_t,heightKnownTree:It,resetHeightMeasurements:jt,pruneHeightMeasurements:St,fenwickUpdate:Et,fenwickQuery:Lt,fenwickRangeSum:Bt,rebuildHeightTrees:At,recordNodeHeight:Ot,averageNodeHeight:zt,estimateHeightRange:Pt,topSpacerHeight:Ht,bottomSpacerHeight:Rt,estimateIndexForOffset:$t,estimateIndexForOffsetFromEnd:Ut,cleanupNodeVisibility:Ft,markNodeVisible:Yt,shouldRenderNode:function(e){return!(be.value&&e>=le.value)&&(!ke.value||e<oe.value||!0===se[e])},destroyNodeHandle:Wt,setNodeSlotElement:Vt,bumpNodeSlotVersion:Kt,setNodeContentRef:Qt,batchRaf:Xt,batchTimeout:qt,batchPending:Gt,pendingIncrement:Zt,batchIdle:Jt,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:en,clearVisibilityFallback:tn,scheduleVisibilityFallback:nn,autoDisableViewportPriority:on,scheduleBatch:rn,queueNextBatch:ln,adjustAdaptiveBatchSize:an,CodeBlockNodeAsync:sn,MermaidBlockNodeLoading:un,mermaidBlockNodeComponent:dn,mermaidBlockNodeImport:mn,loadMermaidBlockNode:pn,resolveMermaidBlockNodeComponent:fn,InfographicBlockNodeLoading:vn,infographicBlockNodeComponent:hn,infographicBlockNodeImport:gn,loadInfographicBlockNode:yn,resolveInfographicBlockNodeComponent:wn,D2BlockNodeAsync:xn,codeBlockComponent:kn,nodeComponents:Mn,indexPrefix:bn,codeBlockBindings:Cn,mermaidBindings:Tn,d2Bindings:Nn,infographicBindings:Dn,nonCodeBindings:_n,linkBindings:In,listBindings:jn,legacyRenderedItems:Sn,legacyStructuredContentMode:En,renderedItems:Ln,getCodeBlockRenderNode:Bn,getCodeBlockLanguage:An,isLegacyStructuredNode:On,getRenderKey:zn,getMermaidBindingsFor:Pn,getInfographicBindingsFor:Hn,getNodeComponent:Rn,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:ht}}}),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.mergedParseOptions.customHtmlTags,"html-policy":n.resolvedHtmlPolicy},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,"f972faa5",null,null).exports,Tt=M(p.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=p.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=p.ref(!!o.node.collapsible&&!(null==(n=o.node.open)||n)),i=`admonition-${Math.random().toString(36).slice(2,9)}`,a=p.getCurrentInstance(),s=p.computed(()=>w(null==a?void 0:a.proxy)?ht:Ct);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 Nt=!1,Dt=null,_t=!1;function It(){return d(this,null,function*(){var e;if(Dt)return Dt;if(_t)return null;try{const t=yield Promise.resolve().then(()=>require("./chunks/index.legacy-e02dc92b.cjs")).then(e=>e.index_legacy);return Dt=null!=(e=null==t?void 0:t.default)?e:t,yield function(e){return d(this,null,function*(){if(Nt)return;Nt=!0;const t=null==globalThis?void 0:globalThis.MonacoEnvironment;return!t||"function"!=typeof t.getWorker&&"function"!=typeof t.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(Dt),(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}})}(Dt))?Dt:(Dt=null,_t=!0,null)}catch(t){return _t=!0,null}})}const jt='<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',Et='<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 Lt=null,Bt=null,At=null;const Ot=p.ref(0),zt={"":Et,plain:Et,text:Et,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:jt,csharp:jt,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'},Pt={"":"",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 Bt||(At||(At=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(Bt=e.EXTENDED_LANGUAGE_ICON_MAP,Ot.value++,Bt)).catch(()=>null)),At)})}function Rt(e){Lt=null!=e?e:null}function $t(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=Pt[n])?t:n}function Ut(e){const t=$t(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ft(e){if(Lt){const t=Lt(e);if(null!=t&&""!==t)return t}const t=$t(e),n=zt[t];if(n)return n;return(null==Bt?void 0:Bt[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 Yt={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"},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=m.mergeCustomHtmlTags(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){var t;const n=m.mergeCustomHtmlTags(e.customHtmlTags,null==(t=e.parseOptions)?void 0:t.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${n.join(",")}`;let r=Wt.get(o);return r||(r=m.getMarkdown(o,{customHtmlTags:n}),Wt.set(o,r)),e.customMarkdownIt?e.customMarkdownIt(r):r}(t);return m.parseMarkdownToStructure(r,i,l)}function Kt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const Qt=M(p.defineComponent({__name:"Portal",props:{to:null},setup(e){const t=e,n=p.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 p.onMounted(()=>{r()}),p.watch(()=>t.to,()=>{r()}),p.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,Xt=M(p.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:null,onClose:null,title:null},setup(e){var t;const n=e,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}&&Boolean(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV);let r=null;function l(e){return new Set(e.trim().toLowerCase().split(/\s+/).filter(Boolean))}function i(e){if(!o||"undefined"==typeof console||r===e)return;const t=l(e);t.has("allow-scripts")&&t.has("allow-same-origin")&&(r=e,console.warn("[markstream-vue2] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))}function a(e,t){return"string"==typeof e?(i(e),e):void 0!==e?"":!0===t?"allow-scripts":""}const{t:s}=ue(),u=p.computed(()=>{const e=n.code||"",t=e.trim().toLowerCase();return t.startsWith("<!doctype")||t.startsWith("<html")||t.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: ${n.isDark?"#020617":"#ffffff"};\n color: ${n.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>`}),c=p.computed(()=>a(n.htmlPreviewSandbox,n.htmlPreviewAllowScripts));function d(e){var t;"Escape"!==e.key&&"Esc"!==e.key||null==(t=n.onClose)||t.call(n)}return p.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",d)}),p.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",d)}),{__sfc:!0,props:n,isDevEnv:o,lastWarnedDangerousSandbox:r,normalizeSandboxTokens:l,warnDangerousHtmlPreviewSandbox:i,resolveHtmlPreviewSandboxValue:a,t:s,srcdoc:u,sandboxValue:c,handleKeydown:d,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:n.sandboxValue,referrerpolicy:"no-referrer",srcdoc:n.srcdoc}})])])])])},[],!1,null,"56f5a269",null,null).exports;let qt=null,Gt=null,Zt=null,Jt=null,en=null;const tn=new WeakMap;let nn=0;const on=M(p.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},htmlPreviewAllowScripts:{type:Boolean,default:void 0},htmlPreviewSandbox:{type:String,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 m=p.getCurrentInstance(),f=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u;const c=null==m?void 0:m.proxy,d=null!=(e=null==c?void 0:c.$listeners)?e:{};if(d.previewCode||d["preview-code"])return!0;const p=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(p.previewCode||p["preview-code"])return!0;const f=null!=(u=null==(a=null==c?void 0:c.$vnode)?void 0:a.props)?u:null==(s=null==m?void 0:m.vnode)?void 0:s.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:h}=ue(),g=p.ref(null),y=p.ref(null),w=p.ref(!1),x=p.ref($t(r.node.language)),k=p.computed(()=>Ut(x.value)),M=p.computed(()=>"plaintext"===k.value),b=p.ref(!1),C=p.ref(!1),T=p.ref(!1),N=p.ref(!1),D=p.ref(null);let _=0;const I=Fe();let j=null;const S=p.ref("undefined"==typeof window);"undefined"!=typeof window&&p.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}),p.onBeforeUnmount(()=>{null==j||j.destroy(),j=null});let E=null,L=null,B=()=>{},A=()=>{},O=()=>null,z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),P=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),H=()=>{},R=()=>{},$=()=>{},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=p.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 G=p.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})}),Z=p.computed(()=>Q.value?"diff":"single"),J=p.ref(Z.value),ee=p.ref(!1),te=p.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=$e();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,P=n.getDiffEditorView||P,H=n.cleanupEditor||H,R=n.safeClean||n.cleanupEditor||R,$=n.refreshDiffPresentation||$,Y=n.setTheme||Y,N.value=!0,g.value&&(yield ze(g.value))}}catch(e){ne&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),ee.value=!0}})})();const oe=p.ref("number"==typeof(null==(o=G.value)?void 0:o.fontSize)?G.value.fontSize:Number.NaN),re=p.ref(oe.value),ae=p.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 se(){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 ce(){var e,t,n,o,r;try{const l=Q.value?null!=(n=null==(t=null==(e=P())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:P():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=se();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 me(){var e;if(Number.isFinite(re.value)&&re.value>0&&Number.isFinite(oe.value))return re.value;const t=ce();return"number"==typeof(null==(e=G.value)?void 0:e.fontSize)?(oe.value=G.value.fontSize,re.value=G.value.fontSize,re.value):t&&t>0?(oe.value=t,re.value=t,t):(oe.value=12,re.value=12,12)}function pe(){var e,t,n,o,r,l,i,a,s,u,c,d,m,p;try{const f=Q.value?P():z();if(!f)return null;if(Q.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const m=null==(e=f.getOriginalEditor)?void 0:e.call(f),p=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==m?void 0:m.layout)||n.call(m),null==(o=null==p?void 0:p.layout)||o.call(p);const v=(null==(r=null==m?void 0:m.getContentHeight)?void 0:r.call(m))||0,h=(null==(l=null==p?void 0:p.getContentHeight)?void 0:l.call(p))||0,g=Math.max(v,h);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==m?void 0:m.getModel)?void 0:i.call(m))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(d=null==(c=null==(u=null==p?void 0:p.getModel)?void 0:u.call(p))?void 0:c.getLineCount)?void 0:d.call(c))||1,x=Math.max(y,w),k=Math.max(de(m),de(p));return Math.ceil(x*(k+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(m=null==f?void 0:f.layout)||m.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const v=null==(p=null==f?void 0:f.getModel)?void 0:p.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 fe(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 ve(e,t,n){if(!M.value)return!1;const o=fe(e),r=fe(t);return n?null!=o&&o>170||null!=r&&r<110:null!=o&&o<85||null!=r&&r>190}function he(){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,m=c.querySelector(".view-lines")||c;let p=null,f=null,v=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(p=window.getComputedStyle(c),f=d===c?p:window.getComputedStyle(d),v=m===c?p:window.getComputedStyle(m))}catch(b){p=null,f=null,v=null}const h=String(null!=(e=null==p?void 0:p.getPropertyValue("--vscode-editor-foreground"))?e:"").trim(),w=String(null!=(t=null==p?void 0:p.getPropertyValue("--vscode-editor-background"))?t:"").trim(),x=String(null!=(o=null!=(n=null==p?void 0:p.getPropertyValue("--vscode-editor-selectionBackground"))?n:null==p?void 0:p.getPropertyValue("--vscode-editor-hoverHighlightBackground"))?o:"").trim(),k=h||String(null!=(l=null!=(r=null==v?void 0:v.color)?r:null==p?void 0:p.color)?l:"").trim(),M=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==p?void 0:p.backgroundColor)?a:"").trim();if(ve(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 we(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 xe(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect().height,n=pe();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",we(e,t,o)}}catch(e){}}function ke(){for(var e;V.length>0;)try{null==(e=V.pop())||e()}catch(t){}}function Me(){if(ke(),!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()},m=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.click())};i.addEventListener("mousedown",c),i.addEventListener("click",d),i.addEventListener("keydown",m),r.replaceChildren(i),V.push(()=>{i.removeEventListener("mousedown",c),i.removeEventListener("click",d),i.removeEventListener("keydown",m),r.contains(i)&&r.replaceChildren()})}}function be(){null==K&&(K=Kt(()=>{K=null,Kt(()=>{Ce(),Me(),C.value||(b.value?xe():Ne(),Kt(()=>{Ce(),Me()}))})}))}function Ce(){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 Te(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 Ne(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect().height,o=De();if(_>0&&(_--,null!=D.value))return void we(t,n,Te(t,D.value,o));const r=pe();if(null!=r&&r>0)return void we(t,n,Te(t,r,o));if(null!=D.value)return void we(t,n,Te(t,D.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void we(t,n,Te(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?we(t,n,Te(t,i,o)):we(t,n,Te(t,o,o))}catch(t){}}function De(){var e,t;const n=null!=(t=null==(e=G.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 _e=p.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));p.watch(()=>r.node.language,e=>{x.value=$t(e)}),p.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 ze(g.value)}catch(l){}A(String(null!=e?e:""),String(null!=t?t:""),k.value),be()}})),p.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(x.value||(x.value=$t(F(e))),!Q.value)){if(E&&!T.value&&g.value)try{yield ze(g.value)}catch(t){}B(e,k.value),b.value&&be()}}));const Ie=p.computed(()=>{const e=x.value;return e?Yt[e]||e.charAt(0).toUpperCase()+e.slice(1):Yt[""]||"Plain Text"}),je=p.computed(()=>(Ot.value,Ft(x.value||""))),Se=p.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}),Ee=p.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))"}}),Le=p.computed(()=>!1!==r.showTooltips);function Be(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Ae(e){var t,n;try{if(Q.value){const n=P();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 Oe(e){return d(this,null,function*(){var t,n,o;if(!E)return;Xe(),Q.value?(R(),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?P():z();if("number"==typeof(null==(o=G.value)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:G.value.fontSize,automaticLayout:!1}),oe.value=G.value.fontSize,re.value=G.value.fontSize;else{const e=ce();e&&e>0?(oe.value=e,re.value=e):(oe.value=12,re.value=12)}b.value||C.value||be(),!1===r.loading&&(yield p.nextTick(),Kt(()=>{be()}))})}function ze(e){if(!E)return null;if(U)return U;T.value=!0;const t=(()=>d(this,null,function*(){yield Oe(e)}))();return U=t.finally(()=>{U=null}),U}p.watch(Le,e=>{e||ie()}),p.watch(()=>re.value,(e,t)=>{const n=Q.value?P():z();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!C.value&&be())},{flush:"post",immediate:!1});const Pe=p.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=ze(e);i&&(yield i,Pe())}));function He(){return r.isDark?r.darkTheme:r.lightTheme}function Re(e){return"string"==typeof e?e:e&&"object"==typeof e&&"name"in e?String(e.name):null}function $e(){var e;const t=He(),n=null==(e=G.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=Re(o),a=l.map(e=>Re(e)).filter(e=>!!e);if(!i||a.includes(i))return o;const s=Re(n);return null!=n&&s&&a.includes(s)?n:l[0]}function Ue(){Xe();const e=$e(),t=()=>{Q.value&&$(),Kt(()=>{he(),be()})};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=tn.get(e);if(n)return n;try{const t=JSON.stringify(e);if(t)return tn.set(e,t),t}catch(t){}const o="__theme_"+ ++nn;return tn.set(e,o),o}return String(e)}(t);return n?(en=e,qt||Jt!==n?(Gt=t,Zt=n,qt||(qt=(()=>d(this,null,function*(){for(;Zt&&null!=Gt;){const n=Gt,o=Zt;if(Gt=null,Zt=null,Jt!==o)try{yield(null!=en?en:e)(n),Jt=o}catch(t){}}}))().finally(()=>{qt=null}),qt)):Promise.resolve()):Promise.resolve()}(Y,e).then(t).catch(()=>{}):t()}function Ye(e){var t;const n=(null!=(t=Re(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}p.watch(Z,(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,ke(),R(),yield p.nextTick(),yield ze(g.value)}catch(n){T.value=!1}}));const We=p.computed(()=>Ye($e())),Ve=p.computed(()=>{var e;if(!Q.value)return We.value?"dark":"light";const t=null==(e=G.value)?void 0:e.diffAppearance;return"light"===t||"dark"===t?t:r.isDark?"dark":"light"}),Ke=p.computed(()=>Q.value?"dark"===Ve.value:We.value);function Qe(){return c(u(c(u({wordWrap:"on",wrappingIndent:"same",themes:r.themes},G.value||{}),{theme:$e()}),Q.value?{diffAppearance:Ve.value}:{}),{onThemeChange(){he()}})}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=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u,c,d,m,p;return JSON.stringify({diffLineStyle:null!=(t=null==(e=G.value)?void 0:e.diffLineStyle)?t:"background",diffUnchangedRegionStyle:null!=(o=null==(n=G.value)?void 0:n.diffUnchangedRegionStyle)?o:"line-info",diffHideUnchangedRegions:null==(l=null==(r=G.value)?void 0:r.diffHideUnchangedRegions)||l,renderSideBySide:null==(a=null==(i=G.value)?void 0:i.renderSideBySide)||a,enableSplitViewResizing:null==(u=null==(s=G.value)?void 0:s.enableSplitViewResizing)||u,ignoreTrimWhitespace:null==(d=null==(c=G.value)?void 0:c.ignoreTrimWhitespace)||d,originalEditable:null!=(p=null==(m=G.value)?void 0:m.originalEditable)&&p})});p.watch(()=>[r.monacoOptions,S.value],()=>{var e,t;if(Xe(),!E||!S.value)return;const n=Q.value?P():z(),o="number"==typeof(null==(e=G.value)?void 0:e.fontSize)?G.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})),be()},{deep:!0}),p.watch(()=>{var e,t;return[r.isDark,r.darkTheme,r.lightTheme,r.themes,null==(e=G.value)?void 0:e.theme,null==(t=G.value)?void 0:t.diffAppearance,N.value,T.value,S.value]},()=>{N.value&&Ue()},{flush:"post"}),p.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,ke(),R(),yield p.nextTick(),yield ze(g.value)}catch(l){T.value=!1}}),{flush:"post"});const Ge=p.watch(()=>[r.loading,S.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield p.nextTick(),Kt(()=>{C.value||(b.value?xe():Ne()),Ge()})))}),{immediate:!0,flush:"post"});return p.onUnmounted(()=>{ke(),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),H()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:m,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:P,cleanupEditor:H,safeClean:R,refreshDiffPresentation:$,createEditorPromise:U,detectLanguage:F,setTheme:Y,runtimeMonacoOptions:W,inlineFoldProxyCleanups:V,deferredEditorVisualSyncRafId:K,isDiff:Q,defaultDiffHideUnchangedRegions:X,resolveDiffHideUnchangedRegionsOption:q,resolvedMonacoOptions:G,desiredEditorKind:Z,currentEditorKind:J,usePreCodeRender:ee,showInlinePreview:te,isDevEnv:ne,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:oe,codeFontSize:re,fontBaselineReady:ae,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:se,readActualFontSizeFromEditor:ce,getLineHeightSafe:de,ensureFontBaseline:me,increaseCodeFont:function(){const e=me(),t=Math.min(36,e+1);re.value=t},decreaseCodeFont:function(){const e=me(),t=Math.max(10,e-1);re.value=t},resetCodeFont:function(){me(),Number.isFinite(oe.value)&&(re.value=oe.value)},computeContentHeight:pe,getColorLuminance:fe,shouldPreferPlainTextFallbackSurface:ve,syncEditorCssVars:he,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:ge,resolveScrollRootElement:ye,adjustScrollAfterHeightChange:we,updateExpandedHeight:xe,clearInlineFoldProxies:ke,syncInlineFoldProxies:Me,scheduleEditorVisualSync:be,syncDiffRevealButtons:Ce,applyCollapsedContainerHeight:Te,updateCollapsedHeight:Ne,getMaxHeightValue:De,isPreviewable:_e,displayLanguage:Ie,languageIcon:je,containerStyle:Se,headerStyle:Ee,tooltipsEnabled:Le,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:Be,onBtnHover:function(e,t,n="top"){if(!Le.value)return;const o=Be(e);if(!o)return;const l=e;le(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(){Le.value&&ie()},onCopyHover:function(e){if(!Le.value)return;const t=Be(e);if(!t)return;const n=e;le(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&&Le.value){const t=Be(e);t&&le(t,b.value?h("common.collapse")||"Collapse":h("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=Q.value?P():z(),n=g.value;t&&n&&(b.value?(Ae(!0),n.style.maxHeight="none",n.style.overflow="visible",xe()):(Ae(!1),n.style.overflow="auto",Ne()))},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)}Ae(!1)}else{b.value&&Ae(!0),g.value&&null!=D.value&&(g.value.style.height=`${D.value}px`);const e=Q.value?P():z();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}_=2,be()}},previewCode:function(){if(!_e.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:Ae,runEditorCreation:Oe,ensureEditorCreation:ze,stopCreateEditorWatch:Pe,getPreferredColorScheme:He,getThemeName:Re,resolveRequestedTheme:$e,themeUpdate:Ue,themeLooksDark:Ye,resolvedChromeIsDark:We,effectiveDiffAppearance:Ve,resolvedSurfaceIsDark:Ke,buildRuntimeMonacoOptions:Qe,syncRuntimeMonacoOptions:Xe,monacoStructuralSignature:qe,stopLoadingWatch:Ge,stopExpandAutoResize:function(){},PreCodeNode:dt,HtmlPreviewFrame:Xt}}}),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,"html-preview-allow-scripts":n.props.htmlPreviewAllowScripts,"html-preview-sandbox":n.props.htmlPreviewSandbox,"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,"f73cb5ae",null,null).exports,rn=()=>import("@terrastruct/d2");let ln=null,an=rn;function sn(e){an=e,ln=null}const un=M(p.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}=ue(),o=p.ref(!1),r=p.ref(!1),l=p.ref(!1),i=p.ref(!1),a=p.ref(null),s=p.ref(!1),c=p.ref(""),m=p.ref(0),f=p.ref(null),v=p.ref(null),h=p.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=p.computed(()=>l.value||!i.value||!c.value),y=p.computed(()=>!!c.value),w=p.computed(()=>{if(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=p.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 P(){c.value=""}function H(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function R(){return d(this,null,function*(){if(M)return M;const e=yield function(){return d(this,null,function*(){if(ln)return ln;const e=an;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===rn)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(ln=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),ln):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 P(),void(a.value=null);const p=++m.value;s.value=!0,a.value=null;try{const s=yield R();if(!s)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof s.compile||"function"!=typeof s.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const f=yield s.compile(d);if(p!==m.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(p!==m.value)return;const k=H(x);if(!k)throw new Error("D2 render returned empty output.");z(k),t.loading&&(l.value=!1),a.value=null}catch(f){if(p!==m.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{p===m.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 p.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),p.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),p.watch(()=>[g.value,c.value,h.value],()=>{p.nextTick(()=>{F()})}),p.onMounted(()=>{U(),p.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(_=new ResizeObserver(()=>{F()}),f.value&&_.observe(f.value))}),p.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:m,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;le(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){ie()},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;le(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:P,extractSvg:H,ensureD2Instance:R,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;un.install=e=>{e.component(un.__name,un)};const cn=Object.freeze(Object.defineProperty({__proto__:null,default:un},Symbol.toStringTag,{value:"Module"}));let dn=null,mn=null;const pn=M(p.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,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}=ue(),r=p.ref(!1),l=p.ref(!1),i=p.ref(),a=p.ref(!1),s=p.ref(!1),u=p.ref(),c=p.ref(null),m=p.computed(()=>n.node.code),f=p.computed(()=>n.maxHeight&&"none"!==n.maxHeight?yt(n.maxHeight):null),v=p.computed(()=>{var e;return bt(null!=(e=yt(n.estimatedPreviewHeightPx))?e:xt(m.value),void 0,f.value)}),h=p.ref(`${v.value}px`);function g(e){if(!n.maxHeight||"none"===n.maxHeight)return`${Math.max(e,v.value)}px`;const t=f.value;return null==t?`${Math.max(e,v.value)}px`:`${Math.max(Math.min(e,t),v.value)}px`}function y(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(h.value=g(e))}const w=p.ref(1),x=p.ref(0),k=p.ref(0),M=p.ref(!1),b=p.ref({x:0,y:0});function C(e){return!e||e.disabled}function T(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 N(e){"Escape"===e.key&&s.value&&_()}function D(){if(s.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",N)}catch(e){}p.nextTick(()=>{if(i.value&&u.value){u.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),u.value.appendChild(e),c.value=e,e.style.transform=`translate(${x.value}px, ${k.value}px) scale(${w.value})`}})}function _(){if(s.value=!1,u.value&&(u.value.innerHTML=""),c.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",N)}catch(e){}}p.watch(v,e=>{if(a.value||l.value)return;const t=yt(h.value);(null==t||t<e)&&(h.value=`${e}px`)});let I=null;function j(){return d(this,null,function*(){var e;if(i.value)try{const t=yield function(){return d(this,null,function*(){return mn||dn||(dn=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),mn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),dn)})}();if(!t)return void console.warn("Infographic library failed to load.");I&&(null==(e=I.destroy)||e.call(I),I=null),i.value.innerHTML="",I=new t({container:i.value,width:"100%",height:"100%"}),I.render(m.value),p.nextTick(()=>{y()})}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>`)}})}p.watch(()=>m.value,()=>{a.value||l.value||p.nextTick(()=>{j()})}),p.watch(()=>a.value,e=>{e||l.value||p.nextTick(()=>{j()})}),p.watch(()=>l.value,e=>{e||a.value||p.nextTick(()=>{j()})}),p.watch(()=>n.maxHeight,()=>{a.value||l.value||p.nextTick(()=>{j()})}),p.onMounted(()=>{a.value||l.value||p.nextTick(()=>{j()})}),p.onBeforeUnmount(()=>{var e;if(I&&(null==(e=I.destroy)||e.call(I),I=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",N)}catch(t){}});const S=p.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"),E=p.computed(()=>a.value||l.value),L=p.computed(()=>({transform:`translate(${x.value}px, ${k.value}px) scale(${w.value})`}));return p.watch(L,e=>{s.value&&c.value&&(c.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,isModalOpen:s,modalContent:u,modalCloneWrapper:c,baseCode:m,maxPreviewHeight:f,estimatedPreviewHeight:v,containerHeight:h,resolveContainerHeight:g,updateContainerHeight:y,zoom:w,translateX:x,translateY:k,isDragging:M,dragStart:b,shouldSkipEventTarget:C,onBtnHover:function(e,t,o="top"){if(C(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;le(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(C(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;le(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=m.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?T(t):console.error("SVG element not found")},exportSvg:T,handleKeydown:N,openModal:D,closeModal:_,handleOpenModalClick:function(){D()},zoomIn:function(){w.value<3&&(w.value+=.1)},zoomOut:function(){w.value>.5&&(w.value-=.1)},resetZoom:function(){w.value=1,x.value=0,k.value=0},startDrag:function(e){M.value=!0,e instanceof MouseEvent?b.value={x:e.clientX-x.value,y:e.clientY-k.value}:b.value={x:e.touches[0].clientX-x.value,y:e.touches[0].clientY-k.value}},onDrag:function(e){if(!M.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),x.value=t-b.value.x,k.value=n-b.value.y},stopDrag:function(){M.value=!1},infographicInstance:I,renderInfographic:j,computedButtonStyle:S,isFullscreenDisabled:E,transformStyle:L,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Qt}}}),function(){var e,t=this,n=t._self._c,o=t._self._setupProxy;return n("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[o.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":o.props.loading}],attrs:{"data-markstream-infographic":"1","data-markstream-mode":o.showSource?"source":o.infographicInstance?"preview":"pending"}},[o.props.showHeader?n("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:o.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[t.$slots["header-left"]?n("div",[t._t("header-left")],2):n("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[n("img",{staticClass:"w-4 h-4 my-0",attrs:{src:o.infographicIconUrl,alt:"Infographic"}}),n("span",{staticClass:"text-sm font-medium font-mono truncate",class:o.props.isDark?"text-gray-400":"text-gray-600"},[t._v("Infographic")])]),t.$slots["header-center"]?n("div",[t._t("header-center")],2):o.props.showModeToggle?n("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:o.props.isDark?"bg-gray-700":"bg-gray-100"},[n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>o.handleSwitchMode("preview"),mouseenter:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},focus:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("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"}}),n("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),n("span",[t._v(t._s(o.t("common.preview")||"Preview"))])])]),n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>o.handleSwitchMode("source"),mouseenter:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},focus:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("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"}},[n("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"}})]),n("span",[t._v(t._s(o.t("common.source")||"Source"))])])])]):t._e(),t.$slots["header-right"]?n("div",[t._t("header-right")],2):n("div",{staticClass:"flex items-center gap-x-1"},[o.props.showCollapseButton?n("button",{class:o.computedButtonStyle,attrs:{"aria-pressed":o.isCollapsed},on:{click:function(e){o.isCollapsed=!o.isCollapsed},mouseenter:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},focus:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",style:{rotate:o.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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):t._e(),o.props.showCopyButton?n("button",{class:o.computedButtonStyle,on:{click:o.copy,mouseenter:function(e){return o.onCopyHover(e)},focus:function(e){return o.onCopyHover(e)},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.copyText?n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),n("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):t._e(),o.props.showExportButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleExportClick,mouseenter:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},focus:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),n("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):t._e(),o.props.showFullscreenButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleOpenModalClick,mouseenter:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},focus:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.isModalOpen?n("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"}},[n("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"}})]):n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):t._e()])]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:!o.isCollapsed,expression:"!isCollapsed"}]},[o.showSource?n("div",{staticClass:"p-4",class:o.props.isDark?"bg-gray-900":"bg-gray-50"},[n("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:o.props.isDark?"text-gray-300":"text-gray-700"},[t._v(t._s(o.baseCode))])]):n("div",{staticClass:"relative"},[o.props.showZoomControls?n("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[n("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},focus:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},focus:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom,mouseenter:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},focus:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")])])]):t._e(),n("div",{staticClass:"infographic-preview min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:o.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:o.containerHeight,maxHeight:null!=(e=o.props.maxHeight)?e:void 0},on:{mousedown:o.startDrag,mousemove:o.onDrag,mouseup:o.stopDrag,mouseleave:o.stopDrag,"&touchstart":function(e){return o.startDrag.apply(null,arguments)},"&touchmove":function(e){return o.onDrag.apply(null,arguments)},"&touchend":function(e){return o.stopDrag.apply(null,arguments)}}},[n("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":o.isDragging},style:o.transformStyle},[n("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),n(o.Portal,{attrs:{to:"body"}},[n("div",{staticClass:"markstream-vue"},[n("transition",{attrs:{name:"infographic-dialog",appear:""}},[o.isModalOpen?n("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:o.closeModal.apply(null,arguments)}}},[n("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:o.props.isDark?"bg-gray-900":"bg-white"},[n("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")]),n("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.closeModal}},[n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),n("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!o.isDragging,"cursor-grabbing":o.isDragging},on:{mousedown:o.startDrag,mousemove:o.onDrag,mouseup:o.stopDrag,mouseleave:o.stopDrag,"&touchstart":function(e){return o.startDrag.apply(null,arguments)},"&touchmove":function(e){return o.onDrag.apply(null,arguments)},"&touchend":function(e){return o.stopDrag.apply(null,arguments)}}})])]):t._e()])],1)])],1)},[],!1,null,"4fbaa9a8",null,null).exports,fn=M(p.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}=ue(),i=p.ref($t(String(null!=(n=r.node.language)?n:""))),s=p.ref(!1),u=p.ref(!1),c=p.ref(!1),m=p.ref(null),f=p.ref(null),h=p.ref(null),g=p.ref(""),y=p.ref(!1),w=p.ref(!1);let x;const k=p.ref(!0),M=p.ref(0),b=p.ref(14),C=p.ref(b.value),T=p.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=p.computed(()=>{const e=i.value.trim().toLowerCase();return e?Yt[e]||e.charAt(0).toUpperCase()+e.slice(1):Yt[""]||"Plain Text"}),D=p.computed(()=>(Ot.value,Ft(i.value.trim().toLowerCase().split(":")[0]))),_=p.computed(()=>{const e=i.value.trim().toLowerCase();return r.isShowPreview&&("html"===e||"svg"===e)}),I=p.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=p.computed(()=>({fontSize:`${C.value}px`})),S=p.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 P(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=m.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)",p=s&&u&&(null!=(e=O(u,s))?e:0)>=3?u:d;t.style.setProperty("--vscode-editor-foreground",p),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 H(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function R(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>${H(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,p.nextTick().then(()=>{P()})}function U(){null==x||x.disconnect(),x=void 0,w.value&&(g.value="",y.value=!0)}function F(){var e;const t=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 p.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,G=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 Z(e,t=!1){const n=$t(String(null!=e?e:""));return n?!Q||Q.has(n)?n:(t&&G&&!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=Z(t,Boolean(e&&e.length));try{return yield W.updateCode(e,n),!0}catch(o){if("plaintext"!==n){G&&!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 G&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",r),!1}}else G&&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?R(r.node.code,!w.value):(R(r.node.code,!w.value),(yield J(r.node.code,i.value))?w.value?U():yield Y():U()):R(r.node.code,!0)):R(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(),p.onMounted(()=>{te()}),p.onBeforeUnmount(()=>{null==x||x.disconnect(),x=void 0}),p.watch(()=>r.themes,()=>d(this,null,function*(){K&&K({themes:L()})})),p.watch(()=>r.loading,e=>{e||te()}),p.watch(S,e=>{e||ie()}),p.watch(()=>[r.node.code,r.node.language],e=>d(this,[e],function*([e,t]){const n=$t(String(null!=t?t:""));if(n!==i.value&&(i.value=n),f.value&&h.value)return e?(W||(R(e,!w.value),yield te()),void(W&&e&&(!1===r.stream&&r.loading||(R(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));R(e,!0)})),p.watch(()=>[r.darkTheme,r.lightTheme],()=>d(this,null,function*(){f.value&&h.value&&(W||(yield te()),yield null==W?void 0:W.setTheme(E()),P())})),p.watch(()=>r.node.code,()=>d(this,null,function*(){if(u.value||!k.value)return;yield p.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:m,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:P,escapeHtml:H,renderFallback:R,clearFallback:$,keepLastSuccessfulRender:U,hasRendererContent:F,clearFallbackWhenRendererReady:Y,renderer:W,createShikiRenderer:V,registerHighlight:K,registeredHighlightLanguages:Q,warnedMissingLanguages:X,warnedRendererErrors:q,isDevEnv:G,normalizeRendererLanguage:Z,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;le(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&&ie()},onCopyHover:function(e){if(!S.value)return;const t=oe(e);if(!t)return;const n=e;le(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&&le(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,p.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=$t(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,"67f44524",null,null).exports,vn=M(p.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:ht,NodeRenderer:Ct},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;const n=null!=(e=this.parseOptions)?e:{},o=null!=(t=this.final)?t:n.final,r=m.mergeCustomHtmlTags(this.customHtmlTags,n.customHtmlTags),l=null!=o,i=r.length>0;return l||i?u(u(u({},n),l?{final:o}:{}),i?{customHtmlTags:r}:{}):n},parsedLegacyNodes(){var e;if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:t,tags:n}=m.resolveCustomHtmlTags(null==(e=this.mergedParseOptions)?void 0:e.customHtmlTags),o=m.getMarkdown(t?`${this.instanceMsgId}:${t}`:this.instanceMsgId,{customHtmlTags:n}),r=this.customMarkdownIt?this.customMarkdownIt(o):o;return m.parseMarkdownToStructure(this.content,r,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(ht,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(Ct,u({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,hn=new Map;function gn(e,t){if(hn.delete(e),hn.set(e,t),hn.size>200){const e=hn.keys().next().value;e&&hn.delete(e)}}function yn(e){if(!e)return null;const t=hn.get(e)||null;return t&&gn(e,t),t}function wn(e,t){e&&t&&gn(e,{html:t})}function xn(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let kn=null,Mn=null,bn=!1;const Cn=new Map,Tn=new Map;let Nn=5;const Dn=new Set;function _n(){if(Cn.size<Nn&&Dn.size){const t=Array.from(Dn);Dn.clear();for(const n of t)try{n()}catch(e){}}}let In=null;const jn=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&&jn&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{In=e.perfMonitor})}catch(vo){}function Sn(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now(),l=xn(e);if(!ye()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Mn)return Promise.reject(Mn);const i=`${t?"d":"i"}:${l}`,a=Tn.get(i);if(a)return In&&In.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),Promise.resolve(a);const s=kn||(Mn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Mn.name="WorkerInitError",Mn.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Mn);if(Cn.size>=Nn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=Cn.size,e.max=Nn,In&&In.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(e)}return new Promise((e,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{Cn.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",In&&In.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(e),_n()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),Cn.has(a)&&Cn.delete(a);const e=new Error("Aborted");e.name="AbortError",i(e),_n()},{once:!0});const c=e,d=i;Cn.set(a,{resolve:e=>{In&&In.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),c(e)},reject:e=>{In&&In.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:(null==e?void 0:e.message)||String(e)}),d(e)},timeoutId:u}),s.postMessage({id:a,content:l,displayMode:t})})})}function En(e,t=!0,n){const o=`${t?"d":"i"}:${xn(e)}`;if(Tn.set(o,n),Tn.size>200){const e=Tn.keys().next().value;Tn.delete(e)}}const Ln="WORKER_BUSY";function Bn(e=2e3,t){return Cn.size<Nn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),Dn.delete(i),n())};if(Dn.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,Dn.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>_n()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),Dn.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const An={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function On(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!ye()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:An.timeout,s=null!=(r=n.waitTimeout)?r:An.waitTimeout,u=null!=(l=n.backoffMs)?l:An.backoffMs,c=null!=(i=n.maxRetries)?i:An.maxRetries,d=Number.isFinite(c)?Math.max(0,Math.min(Math.floor(c),8)):An.maxRetries,m=n.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Sn(e,t,a,m)}catch(f){if((null==f?void 0:f.code)!==Ln||p>=d)throw f;if(p++,yield Bn(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*p)))}}})}const zn=M(p.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=p.computed(()=>xn(t.node.content)),o=p.ref(null),r=Fe();let l=null,i=0,a=!1,s=null;const u=p.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),c=yn(u.value),m=p.ref((null==c?void 0:c.html)||""),f=p.ref(""),v=p.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 we();if(!e)return!1;try{const o=e.renderToString(n.value,{throwOnError:t.node.loading,displayMode:!0});return y(o),En(n.value,!0,o),!0}catch(vo){return!1}})}function y(e){m.value=e,f.value="",v.value=!1,h=!0,wn(u.value,e)}function w(){m.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(a)return;if(!t.node.content)return w(),void(h=!0);const e=yn(u.value);if((null==e?void 0:e.html)&&!m.value&&(m.value=e.html,h=!0,v.value=!1),!h){v.value=!0;try{!l&&o.value&&(l=r(o.value)),yield null==l?void 0:l.whenVisible}catch(vo){}}s&&(s.abort(),s=null);const c=++i,d=new AbortController;s=d;try{const e=yield On(n.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:d.signal});if(a||c!==i)return;y(e)}catch(p){if(a||c!==i)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===Ln||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(h||m.value)return;n||!t.node.loading?w():v.value=!0}})}return p.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>x()),p.onMounted(()=>{x()}),p.onBeforeUnmount(()=>{var e;a=!0,s&&(s.abort(),s=null),null==(e=null==l?void 0:l.destroy)||e.call(l),l=null}),{__sfc:!0,props:t,mathContent:n,containerEl:o,registerVisibility:r,visibilityHandle:l,currentRenderId:i,isUnmounted:a,currentAbortController:s,cacheKey:u,initialCached:c,renderedHtml:m,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("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,"50fb5666",null,null).exports,Pn=M(p.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=p.ref(null),o=Fe();let r=null,l=0,i=!1,a=null;const s=p.computed(()=>"$$"===t.node.markup),u=p.computed(()=>xn(t.node.content)),c=p.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),m=yn(c.value),f=p.ref((null==m?void 0:m.html)||""),v=p.ref(""),h=p.ref(!(null==m?void 0:m.html));let g=Boolean(null==m?void 0:m.html);function y(){return d(this,null,function*(){const e=yield we();if(!e)return!1;try{const n=e.renderToString(u.value,{throwOnError:t.node.loading,displayMode:s.value});return w(n),En(u.value,s.value,n),!0}catch(vo){return!1}})}function w(e){f.value=e,v.value="",h.value=!1,g=!0,wn(c.value,e)}function x(){f.value="",v.value=t.node.raw,h.value=!1}function k(){return d(this,null,function*(){if(i)return;if(!t.node.content)return x(),void(g=!0);const e=yn(c.value);(null==e?void 0:e.html)&&!f.value&&(f.value=e.html,g=!0,h.value=!1),a&&(a.abort(),a=null);const d=++l,m=new AbortController;if(a=m,!g){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(vo){}}try{const e=yield On(u.value,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:m.signal});if(i||d!==l)return;w(e)}catch(p){if(i||d!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===Ln||"WORKER_TIMEOUT"===e)&&(yield y()))return;if(g||f.value)return;n||!t.node.loading?x():h.value=!0}})}return p.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>k()),p.onMounted(()=>{k()}),p.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,mathContent:u,cacheKey:c,initialCached:m,renderedHtml:f,fallbackText:v,renderingLoading:h,hasRenderedOnce:g,renderWithMainThreadFallback:y,applySuccessfulRender:w,applyRawFallback:x,renderMath:k}}}),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,"d2f0cfa6",null,null).exports,Hn=()=>import("mermaid");let Rn=null,$n=Hn;function Un(e){$n=e,Rn=null}function Fn(){return"function"==typeof $n}function Yn(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 Wn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=u({suppressErrorRendering:!0},n||{});return"function"==typeof t?t.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(vo){}}let Vn=null,Kn=null;const Qn=new Map;let Xn=5,qn=!1;const Gn="WORKER_BUSY",Zn="MERMAID_DISABLED";function Jn(e,t,n=1400){if(!Fn()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Zn,Promise.reject(e)}if(Kn)return Promise.reject(Kn);const o=Vn||(Kn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Kn.name="WorkerInitError",Kn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Kn);if(Qn.size>=Xn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Gn,e.inFlight=Qn.size,e.max=Xn,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 eo(e,t,n=1400){return d(this,null,function*(){try{return yield Jn("canParse",{code:e,theme:t},n)}catch(vo){return Promise.reject(vo)}})}function to(e,t,n=1400){return d(this,null,function*(){try{return yield Jn("findPrefix",{code:e,theme:t},n)}catch(vo){return Promise.reject(vo)}})}function no(){if(Vn)try{for(const[e,t]of Qn.entries())t.reject(new Error("Worker terminated"));Qn.clear(),Vn.terminate()}finally{Vn=null}}const oo=M(p.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,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:!0},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=p.ref(!1),a=p.computed(()=>r.isStrict?"strict":"loose"),s=p.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function m(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=m(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const o=n;return y(o),o}function x(e,t){if(!e)return"";try{e.replaceChildren()}catch(vo){e.innerHTML=""}const n=w(t);return n?(e.appendChild(n),e.innerHTML):""}function k(e){if(e)try{e.replaceChildren()}catch(vo){e.innerHTML=""}}function M(e,t){if(!e)return"";if("strict"===a.value)return x(e,t);try{e.replaceChildren()}catch(vo){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(vo){e.innerHTML=t}return e.innerHTML}function b(e){if(!e||"undefined"==typeof DOMParser)return!e;const t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!t||"svg"!==t.nodeName.toLowerCase())return!0;const n=t.getAttribute("viewBox");if(n){const e=n.trim().split(/[\s,]+/);if(4===e.length){const t=Number.parseFloat(e[2]||""),n=Number.parseFloat(e[3]||"");if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return!0}}const o=[t,...Array.from(t.querySelectorAll("*"))];for(const r of o)for(const e of Array.from(r.attributes)){if(/\bNaN\b/i.test(e.value))return!0;if("style"===e.name&&/max-width:\s*0(?:px)?/i.test(e.value))return!0}return!1}const{t:C}=ue();function T(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Rn)return Rn;const e=function(){try{const e=globalThis;return Yn(null==e?void 0:e.mermaid)}catch(vo){return null}}();if(e)return Rn=e,Wn(Rn),Rn;const t=$n;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===Hn)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Rn=Yn(n),Wn(Rn),Rn):null})}();return i.value=!!e,e}catch(e){throw i.value=!1,e}})}"undefined"!=typeof window&&(()=>{d(this,null,function*(){var e;try{const t=yield T();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 N=p.ref(!1),D=p.ref(!1),_=p.ref(),I=p.ref(),j=p.ref(),S=p.ref(null),E=Fe();let L=null;const B=p.ref("undefined"==typeof window),A=p.ref(),O=p.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),z=p.computed(()=>r.maxHeight&&"none"!==r.maxHeight?yt(r.maxHeight):null),P=p.computed(()=>{var e;return Mt(null!=(e=yt(r.estimatedPreviewHeightPx))?e:wt(O.value),void 0,z.value)});function H(e,t=O.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}function R(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}const $=p.ref(1),U=p.ref(0),F=p.ref(0),Y=p.ref(!1),W=p.ref({x:0,y:0}),V=p.ref("undefined"==typeof window),K=p.ref(!1),Q=p.ref(!1),X=p.ref(null),q=p.ref(0),G=p.ref(!1),Z=p.computed(()=>{var e;return Math.max(0,null!=(e=r.renderDebounceMs)?e:300)}),J=p.computed(()=>{var e;return Math.max(0,null!=(e=r.contentStableDelayMs)?e:500)}),ee=p.computed(()=>{var e;return Math.max(120,null!=(e=r.previewPollDelayMs)?e:800)}),te=p.computed(()=>{var e;return Math.max(ee.value,null!=(e=r.previewPollMaxDelayMs)?e:4e3)}),ne=p.computed(()=>{var e;return Math.max(1,Math.trunc(null!=(e=r.previewPollMaxAttempts)?e:12))});let oe=null,re=null,ae=null,se=0;const ce=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function de(){return B.value&&!D.value}function me(){null!=ae&&(globalThis.clearTimeout(ae),ae=null)}function pe(){me(),ae=globalThis.setTimeout(()=>{ae=null,de()&&ce(()=>{de()&&dt()},{timeout:500})},Z.value)}function fe(){null!=re&&(globalThis.clearTimeout(re),re=null)}function ve(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);fe(),re=globalThis.setTimeout(()=>{re=null,r.loading||Q.value||!de()?ve(Math.min(1200,Math.max(300,1.2*t))):pe()},t)}const he=p.ref(`${P.value}px`);let ge=null;p.watch(P,e=>{if(V.value||D.value)return;const t=yt(he.value);(null==t||t<e)&&(he.value=`${e}px`)});const ye=p.ref(!1),we=p.ref(!1),xe=p.ref({}),ke=p.ref(null),Me=p.ref(""),be=p.ref(0);let Ce=null;const Te=p.ref(!1),Ne=p.ref({zoom:1,translateX:0,translateY:0,containerHeight:`${P.value}px`}),De=p.computed(()=>r.enableWheelZoom?{wheel:it}:{}),_e=p.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}}),Ie=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let je=null,Se=null,Ee=!1,Le=ee.value,Be=null,Ae=0,Oe=!0,ze=0;function Pe(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 He(e){if("undefined"==typeof document)return;if(!I.value)return;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,O.value,I.value))return Te.value=!0,void mt();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(I.value),I.value.appendChild(t),he.value=`${P.value}px`,Te.value=!0,mt()}function Re(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 $e(e){return!e||e.disabled}function Ue(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ye(){return Oe&&!V.value&&!ye.value&&!Te.value}function We(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function Ve(e){var t;const n=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&n.length>0&&n.pop();n.length>0;){const e=null==(t=n[n.length-1])?void 0:t.trim();if(e&&!e.startsWith("%%")){if(We(e))break;n.pop()}else n.pop()}return n.some(We)?n.join("\n"):""}function Ke(e){if("gantt"===R(e))return Ve(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 Qe(e,t,n){return d(this,null,function*(){var o,r;const l=yield T();if(!l)return;const i=l,a=Ue(e,t);if("function"==typeof i.parse)return yield Pe(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Pe(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:_e.value.render,signal:null==n?void 0:n.signal}),!0})}function Xe(e,t,n){return d(this,null,function*(){var o;try{return yield eo(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.worker)}catch(vo){return yield Qe(e,t,n)}})}function qe(e,t,n){return d(this,null,function*(){var o;if("gantt"===R(e)){const o=Ke(e);if(!o.trim())return{fullOk:!1,prefixOk:!1};try{if(yield Xe(o,t,n))return o===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:o}}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))throw vo}return{fullOk:!1,prefixOk:!1}}try{if(yield Xe(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))throw vo}let r=Ke(e);if(r&&r.trim()&&r!==e)try{try{const l=yield to(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.worker);l&&l.trim()&&(r=l)}catch(vo){}if(yield Xe(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))throw vo}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&p.watch(()=>_.value,e=>{if(null==L||L.destroy(),L=null,!e)return void(B.value=!1);const t=E(e,{rootMargin:"400px"});L=t,B.value=t.isVisible.value,t.whenVisible.then(()=>{B.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==L||L.destroy(),L=null,me()});const Ge=p.computed(()=>V.value||Q.value||D.value);function Ze(){return z.value}function Je(e){if(!_.value||!I.value)return;const t=I.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),i=t.getAttribute("width"),a=t.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||i&&a&&(n=Number.parseFloat(i),o=Number.parseFloat(a)),Number.isNaN(n)||Number.isNaN(o)||n<=0||o<=0)try{const e=t.getBBox();e&&e.width>0&&e.height>0&&(n=e.width,o=e.height)}catch(vo){return void console.error("Failed to get SVG BBox:",vo)}if(n>0&&o>0){const t=o/n,l=null!=e?e:_.value.clientWidth,i=Ze(),a=l*t,s=null==i?a:Math.min(a,i);he.value=`${"none"===r.maxHeight?s:Math.max(s,P.value)}px`}}const et=p.ref(!1),tt=p.computed(()=>({transform:`translate(${U.value}px, ${F.value}px) scale(${$.value})`}));function nt(e){"Escape"===e.key&&et.value&&rt()}function ot(){if(et.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(vo){}if("undefined"!=typeof window)try{window.addEventListener("keydown",nt)}catch(vo){}p.nextTick(()=>{if(_.value&&j.value){const e=_.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="100%",e.style.maxHeight="100%";const t=e.querySelector("[data-mermaid-wrapper]");t&&(S.value=t,t.style.transform=tt.value.transform),k(j.value),j.value.appendChild(e)}})}function rt(){if(et.value=!1,j.value&&k(j.value),S.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(vo){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",nt)}catch(vo){}}function lt(){if(!V.value)return;if(!i.value)return;const e=O.value.length;e!==q.value&&(G.value=!0,q.value=e,oe&&clearTimeout(oe),oe=setTimeout(()=>{G.value&&V.value&&O.value.trim()&&(G.value=!1,st("preview"))},J.value))}function it(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!_.value)return;const t=_.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-U.value)/$.value,a=(l-F.value)/$.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max($.value+u,.5),3);c!==$.value&&(U.value=r-i*c,F.value=l-a*c,$.value=c)}}function at(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(vo){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function st(e){return d(this,null,function*(){const t=A.value;if(!t)return K.value=!0,void(V.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",K.value=!0,V.value="source"===e,yield p.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 ut(){return d(this,null,function*(){return Q.value?X.value:I.value||(yield p.nextTick(),I.value)?(Q.value=!0,X.value=(()=>d(this,null,function*(){var e,t;try{const t=yield T();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;ye.value||we.value||null==(e=t.initialize)||e.call(t,c(u({},s.value),{dompurifyConfig:u({},l)}));const o=H(r.isDark?"dark":"light"),i=yield Pe(()=>t.render(n,o),{timeoutMs:_e.value.fullRender}),a=null==i?void 0:i.svg;if(b(a))throw new Error("Mermaid produced invalid SVG during preview");if(I.value){const e=M(I.value,a);ye.value||we.value||(Je(),ye.value=!0,Ne.value={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:he.value});const t=r.isDark?"dark":"light";e&&(xe.value[t]=e),we.value&&(we.value=!1),Te.value=!1,se=0,fe()}return!0}catch(n){const e=Re(n),o=se+1;return e&&o<=3?(se=o,ve(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)):(se=0,fe(),!1===r.loading&&console.error("Failed to render mermaid diagram:",n),!1===r.loading&&He(n)),!1}finally{Q.value=!1,X.value=null}}))(),X.value):void console.warn("Mermaid container not ready")})}function ct(e){return d(this,null,function*(){if(Ye()&&(I.value||(yield p.nextTick(),I.value))&&!Q.value){Q.value=!0;try{const t=yield T();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=r.isDark?"dark":"light",l=Ke(e),i=Ue(l&&l.trim()?l:e,o),a=yield Pe(()=>t.render(n,i),{timeoutMs:_e.value.render}),s=null==a?void 0:a.svg;I.value&&s&&!b(s)&&(M(I.value,s),Je())}catch(vo){}finally{Q.value=!1}}})}function dt(){return d(this,null,function*(){var e,t;const n=Date.now(),o=++be.value;Ce&&Ce.abort(),Ce=new AbortController;const l=Ce.signal,i=r.isDark?"dark":"light",a=O.value,s=a.replace(/\s+/g,"");if(!a.trim())return I.value&&k(I.value),ke.value=null,Me.value="",void(Te.value=!1);if(s===Me.value)return;try{const r=yield qe(a,i,{signal:l,timeoutMs:_e.value.worker});if(r.fullOk){if(!(yield ut()))return;return void(be.value===o&&(ke.value=null!=(t=null==(e=I.value)?void 0:e.innerHTML)?t:null,Me.value=s,Te.value=!1))}const u=Ae&&n<=Ae;if(r.prefixOk&&r.prefix&&Ye()&&!u)return void(yield ct(r.prefix))}catch(vo){if("AbortError"===(null==vo?void 0:vo.name))return}if(be.value!==o)return;if(Te.value)return;const u=xe.value[i];u&&I.value&&M(I.value,u)})}function mt(){Ee&&(Ee=!1,Le=ee.value,Oe=!1,Be&&(Be.abort(),Be=null),je&&(globalThis.clearTimeout(je),je=null),Se&&(Ie(Se),Se=null),Ae=Date.now())}function pt(){if(mt(),me(),Ce){try{Ce.abort()}catch(vo){}Ce=null}if(Be){try{Be.abort()}catch(vo){}Be=null}no(),fe(),se=0}function ft(e=ee.value){Ee&&(ze>=ne.value?mt():(je&&globalThis.clearTimeout(je),je=globalThis.setTimeout(()=>{Se=ce(()=>d(this,null,function*(){if(!Ee)return;if(!de())return void mt();if(V.value||ye.value)return void mt();const e=r.isDark?"dark":"light",t=O.value;if(!t.trim())return!1===r.loading?void mt():void ft(Le);if(ze++,ze>ne.value)mt();else{Be&&Be.abort(),Be=new AbortController;try{const n=yield qe(t,e,{signal:Be.signal,timeoutMs:_e.value.worker});if(n.fullOk){if((yield ut())&&ye.value)return void mt()}else n.prefixOk&&n.prefix&&Ye()&&(yield ct(n.prefix))}catch(vo){}Le=Math.min(Math.floor(1.5*Le),te.value),ft(Le)}}),{timeout:500})},e)))}function vt(){Ee||i.value&&de()&&(V.value||ye.value||(Ee=!0,Ae=0,Oe=!0,ze=0,Le=ee.value,ft(Le)))}p.watch(tt,e=>{et.value&&S.value&&(S.value.style.transform=e.transform)},{immediate:!0}),p.watch(()=>O.value,()=>{ye.value=!1,xe.value={},de()&&pe(),!V.value&&i.value&&de()?vt():mt(),lt()}),p.watch(()=>r.isDark,()=>d(this,null,function*(){if(!ye.value)return;if(Te.value)return;const e=r.isDark?"dark":"light",t=xe.value[e];if(t)return void(I.value&&M(I.value,t));const n={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:he.value},o=1!==$.value||0!==U.value||0!==F.value;we.value=!0,o&&($.value=1,U.value=0,F.value=0,yield p.nextTick()),(yield ut())&&o&&(yield p.nextTick(),$.value=n.zoom,U.value=n.translateX,F.value=n.translateY,he.value=n.containerHeight,Ne.value=n)})),p.watch(()=>V.value,e=>d(this,null,function*(){if(e)mt(),ye.value&&(Ne.value={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:he.value});else{if(Te.value)return;const e=r.isDark?"dark":"light";if(ye.value&&xe.value[e])return yield p.nextTick(),I.value&&M(I.value,xe.value[e]),$.value=Ne.value.zoom,U.value=Ne.value.translateX,F.value=Ne.value.translateY,void(he.value=Ne.value.containerHeight);if(yield p.nextTick(),!i.value||!de())return;vt(),yield dt()}})),p.watch(()=>r.loading,(e,t)=>d(this,null,function*(){if(!0===t&&!1===e){const e=O.value.trim();if(!e)return pt();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(ye.value&&o===Me.value)return yield p.nextTick(),I.value&&!I.value.querySelector("svg")&&xe.value[t]&&M(I.value,xe.value[t]),void pt();try{if(yield Xe(e,t,{timeoutMs:_e.value.worker}),!(yield ut()))return;Me.value=o,Te.value=!1,pt()}catch(n){pt(),He(n)}}})),p.watch(_,e=>{ge&&ge.disconnect(),e&&(ge=new ResizeObserver(e=>{e&&e.length>0&&!V.value&&!D.value&&Kt(()=>{Je(e[0].contentRect.width)})}),ge.observe(e))},{immediate:!0}),p.onMounted(()=>d(this,null,function*(){yield p.nextTick(),K.value||(V.value=!i.value),de()&&(pe(),q.value=O.value.length)})),p.watch(()=>i.value,e=>{K.value||(V.value=!e)}),p.watch(()=>B.value,e=>{e&&(ye.value||(pe(),q.value=O.value.length),r.loading||ye.value||pe(),!V.value&&i.value&&vt())},{immediate:!1}),p.watch(()=>r.maxHeight,()=>{p.nextTick(()=>{Je()})}),p.onUnmounted(()=>{oe&&clearTimeout(oe),me(),ge&&ge.disconnect(),Ce&&(Ce.abort(),Ce=null),no(),mt(),fe()}),p.watch(()=>D.value,e=>d(this,null,function*(){e?(mt(),Ce&&Ce.abort()):de()&&!ye.value&&(yield p.nextTick(),pe(),V.value||vt())}),{immediate:!1});const ht=p.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:m,DISALLOWED_STYLE_PATTERNS:f,SAFE_URL_PROTOCOLS:h,sanitizeUrl:g,scrubSvgElement:y,toSafeSvgElement:w,setSafeSvg:x,clearElement:k,renderSvgToTarget:M,isBrokenMermaidSvg:b,t:C,resolveMermaidInstance:T,copyText:N,isCollapsed:D,mermaidContainer:_,mermaidContent:I,modalContent:j,modalCloneWrapper:S,registerViewport:E,viewportHandle:L,viewportReady:B,modeContainerRef:A,baseFixedCode:O,maxPreviewHeight:z,estimatedPreviewHeight:P,getCodeWithTheme:H,getMermaidDiagramKind:R,zoom:$,translateX:U,translateY:F,isDragging:Y,dragStart:W,showSource:V,userToggledShowSource:K,isRendering:Q,renderQueue:X,lastContentLength:q,isContentGenerating:G,renderDebounceDelay:Z,contentStableDelay:J,previewPollInitialDelay:ee,previewPollMaxDelay:te,previewPollMaxAttempts:ne,contentStableTimer:oe,renderRetryTimer:re,progressiveRenderDebounceTimer:ae,consecutiveRenderTimeouts:se,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:ce,canScheduleViewportWork:de,clearProgressiveRenderDebounceTimer:me,debouncedProgressiveRender:pe,clearRenderRetryTimer:fe,scheduleRenderRetry:ve,containerHeight:he,resizeObserver:ge,hasRenderedOnce:ye,isThemeRendering:we,svgCache:xe,lastSvgSnapshot:ke,lastRenderedCode:Me,renderToken:be,currentWorkController:Ce,hasRenderError:Te,savedTransformState:Ne,wheelListeners:De,timeouts:_e,cancelIdle:Ie,previewPollTimeoutId:je,previewPollIdleId:Se,isPreviewPolling:Ee,previewPollDelay:Le,previewPollController:Be,lastPreviewStopAt:Ae,allowPartialPreview:Oe,previewPollAttempts:ze,withTimeoutSignal:Pe,renderErrorToContainer:He,isTimeoutError:Re,shouldSkipEventTarget:$e,onBtnHover:function(e,t,n="top"){if($e(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;le(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if($e(e.currentTarget))return;const t=N.value?C("common.copied")||"Copied":C("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;le(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Ue,canApplyPartialPreview:Ye,isGanttTaskLine:We,getSafeGanttPreviewCandidate:Ve,getSafePrefixCandidate:Ke,canParseOnMain:Qe,canParseOffthread:Xe,canParseOrPrefix:qe,isFullscreenDisabled:Ge,resolveMaxContainerHeight:Ze,updateContainerHeight:Je,isModalOpen:et,transformStyle:tt,handleKeydown:nt,openModal:ot,closeModal:rt,checkContentStability:lt,zoomIn:function(){$.value<3&&($.value+=.1)},zoomOut:function(){$.value>.5&&($.value-=.1)},resetZoom:function(){$.value=1,U.value=0,F.value=0},startDrag:function(e){Y.value=!0,e instanceof MouseEvent?W.value={x:e.clientX-U.value,y:e.clientY-F.value}:W.value={x:e.touches[0].clientX-U.value,y:e.touches[0].clientY-F.value}},onDrag:function(e){if(!Y.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),U.value=t-W.value.x,F.value=n-W.value.y},stopDrag:function(){Y.value=!1},handleWheel:it,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(O.value)),N.value=!0,t("copy",O.value),setTimeout(()=>{N.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:at,handleExportClick:function(){var e;const n=null==(e=I.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||at(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=I.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||ot()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||st(e)},switchMode:st,initMermaid:ut,renderPartial:ct,progressiveRender:dt,stopPreviewPolling:mt,cleanupAfterLoadingSettled:pt,scheduleNextPreviewPoll:ft,startPreviewPolling:vt,computedButtonStyle:ht,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}],attrs:{"data-markstream-mermaid":"1","data-markstream-mode":n.showSource?"source":n.hasRenderedOnce?"preview":"pending"}},[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,"44df5452",null,null).exports,ro=M(p.defineComponent({name:"NestedRenderer",components:{MarkdownRender:vn},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=p.getCurrentInstance(),n=p.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=p.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:p.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,lo=M(p.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=p.computed(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(vo){}return!1}),o=p.ref(null),r=p.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=p.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 p.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield p.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 p.nextTick(),l.value=!0,yield p.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=f.autoUpdate(t.anchorEl,o.value,a)}catch(vo){yield a(),l.value=!0,i=f.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),p.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield p.nextTick(),yield a())})),p.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,io=Object.freeze(Object.defineProperty({__proto__:null,default:lo},Symbol.toStringTag,{value:"Module"}));function ao(e){return JSON.stringify(e)}function so(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=ao(u({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=ao(o),a=r?ao(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 uo(e){return JSON.stringify(e)}function co(e){var t;const n=null!=(t=e.mode)?t:"module",o=uo(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(${uo(u({startOnLoad:!1,securityLevel:"strict",flowchart:{htmlLabels:!1}},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===n?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function mo(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const po={AdmonitionNode:Tt,BlockquoteNode:gt,CheckboxNode:b,CodeBlockNode:on,DefinitionListNode:C,EmojiNode:T,EmphasisNode:Be,FootnoteNode:Oe,FootnoteReferenceNode:S,FootnoteAnchorNode:Ae,HardBreakNode:ze,HeadingNode:Pe,HtmlBlockNode:ut,HtmlInlineNode:U,HighlightNode:Le,ImageNode:ce,D2BlockNode:un,InlineCodeNode:Y,PreCodeNode:dt,InsertNode:Ee,LinkNode:Se,ListItemNode:He,ListNode:Re,MarkdownCodeBlockNode:fn,MathBlockNode:zn,MathInlineNode:Pn,MermaidBlockNode:oo,NestedRenderer:ro,InfographicBlockNode:pn,ParagraphNode:ct,StrikethroughNode:je,StrongNode:Ie,SubscriptNode:_e,SuperscriptNode:De,TableNode:mt,TextNode:Me,ThematicBreakNode:pt,VmrContainerNode:vt,ReferenceNode:Ne},fo={install(e,t){!function(e){const t=mo(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=mo(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(vo){}}})}(e),Object.entries(po).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",vn),e.component("NodeRenderer",vn),(null==t?void 0:t.getLanguageIcon)&&Rt(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&m.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>m.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>m.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>m.setDefaultMathOptions}),exports.AdmonitionNode=Tt,exports.BlockquoteNode=gt,exports.CheckboxNode=b,exports.CodeBlockNode=on,exports.D2BlockNode=un,exports.DefinitionListNode=C,exports.EmojiNode=T,exports.EmphasisNode=Be,exports.FootnoteAnchorNode=Ae,exports.FootnoteNode=Oe,exports.FootnoteReferenceNode=S,exports.HardBreakNode=ze,exports.HeadingNode=Pe,exports.HighlightNode=Le,exports.HtmlBlockNode=ut,exports.HtmlInlineNode=U,exports.ImageNode=ce,exports.InfographicBlockNode=pn,exports.InlineCodeNode=Y,exports.InsertNode=Ee,exports.LinkNode=Se,exports.ListItemNode=He,exports.ListNode=Re,exports.MERMAID_DISABLED_CODE=Zn,exports.MERMAID_WORKER_BUSY_CODE=Gn,exports.MarkdownCodeBlockNode=fn,exports.MarkdownRender=vn,exports.MathBlockNode=zn,exports.MathInlineNode=Pn,exports.MermaidBlockNode=oo,exports.NestedRenderer=ro,exports.ParagraphNode=ct,exports.PreCodeNode=dt,exports.ReferenceNode=Ne,exports.StrikethroughNode=je,exports.StrongNode=Ie,exports.SubscriptNode=_e,exports.SuperscriptNode=De,exports.TableNode=mt,exports.TextNode=Me,exports.ThematicBreakNode=pt,exports.Tooltip=lo,exports.VmrContainerNode=vt,exports.VueRendererMarkdown=fo,exports.WORKER_BUSY_CODE=Ln,exports.buildKaTeXCDNWorkerSource=so,exports.buildMermaidCDNWorkerSource=co,exports.canParseOffthread=eo,exports.clearGlobalCustomComponents=function(){delete _.scopedCustomComponents[N],I.value++},exports.clearKaTeXWorker=function(){var e;kn&&(null==(e=kn.terminate)||e.call(kn)),kn=null,Mn=null},exports.clearMermaidWorker=function(){var e;if(Vn)try{for(const[e,t]of Qn.entries())t.reject(new Error("Worker cleared"));Qn.clear(),null==(e=Vn.terminate)||e.call(Vn)}catch(vo){}Vn=null,Kn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=so(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"classic")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(vo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(vo){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=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:"module")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(vo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(vo){}}},source:o}},exports.default=vn,exports.disableD2=function(){sn(null)},exports.disableKatex=function(){ge(null)},exports.disableMermaid=function(){Un(null)},exports.enableD2=function(e){sn(null!=e?e:rn)},exports.enableKatex=function(e){ge(null!=e?e:he)},exports.enableMermaid=function(e){Un(null!=e?e:Hn)},exports.findPrefixOffthread=to,exports.getCustomNodeComponents=j,exports.getKaTeXBackpressureDefaults=function(){return u({},An)},exports.getKaTeXWorkerLoad=function(){return{inFlight:Cn.size,max:Nn}},exports.getLanguageIcon=Ft,exports.getMermaidWorkerLoad=function(){return{inFlight:Qn.size,max:Xn}},exports.getUseMonaco=It,exports.isD2Enabled=function(){return"function"==typeof an},exports.isKaTeXWorkerBusy=function(){return Cn.size>=Nn},exports.isKatexEnabled=ye,exports.isMermaidEnabled=Fn,exports.languageIconsRevision=Ot,exports.languageMap=Yt,exports.normalizeLanguageIdentifier=$t,exports.parseNestedMarkdownToNodes=Vt,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=Sn,exports.renderKaTeXWithBackpressure=On,exports.renderMarkdownNodeToHtml=function(e,t={}){return Xe(e,Ke(t))},exports.renderMarkdownNodesToHtml=Ve,exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return Qe(e.nodes,t);const n=e.node;if(n){const e=ot(n.children);if(e.length>0)return Qe(e,t);const o=rt(n.content);if(o)return Je(o,t);if(null!=n.raw)return at(rt(n.raw))}return e.content?Je(rt(e.content),t):""}(e,Ke(t))},exports.resolveMonacoLanguageId=Ut,exports.setCustomComponents=function(e,t){"string"==typeof e?_.scopedCustomComponents[e]=t||{}:_.scopedCustomComponents[N]=e||{},I.value++},exports.setD2Loader=sn,exports.setDefaultI18nMap=function(e){Object.assign(ae,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(An.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(An.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(An.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(An.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=En,exports.setKaTeXWorker=function(e){kn=e,Mn=null,kn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=Cn.get(t);if(r)if(Cn.delete(t),clearTimeout(r.timeoutId),_n(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Tn.set(e,n),Tn.size>200){const e=Tn.keys().next().value;Tn.delete(e)}}r.resolve(n)}},kn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of Cn.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));Cn.clear(),_n()}},exports.setKaTeXWorkerDebug=function(e){bn=!!e,kn&&kn.postMessage({type:"init",debug:bn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Nn=Math.floor(e))},exports.setKatexLoader=ge,exports.setLanguageIconResolver=Rt,exports.setMermaidLoader=Un,exports.setMermaidWorker=function(e){Vn=e,Kn=null;const t=e;Vn.onmessage=e=>{if(Vn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Qn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Vn.onerror=e=>{var n,o;if(Vn===t)if(0!==Qn.size){try{qn?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(r){}for(const[t,n]of Qn.entries())n.reject(new Error(`Worker error: ${e.message}`));Qn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Vn.onmessageerror=e=>{var n,o;if(Vn===t)if(0!==Qn.size){try{qn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(vo){}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){qn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Xn=Math.floor(e))},exports.terminateWorker=no,exports.waitForKaTeXWorkerSlot=Bn,Object.keys(m).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>m[e]})});