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

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.
@@ -1,22 +0,0 @@
1
- "use strict";var at=Object.defineProperty,st=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var Me=Object.getOwnPropertySymbols;var ut=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var Ne=(m,c,i)=>c in m?at(m,c,{enumerable:!0,configurable:!0,writable:!0,value:i}):m[c]=i,Se=(m,c)=>{for(var i in c||(c={}))ut.call(c,i)&&Ne(m,i,c[i]);if(Me)for(var i of Me(c))dt.call(c,i)&&Ne(m,i,c[i]);return m},Ve=(m,c)=>st(m,ct(c));var $=(m,c,i)=>new Promise((R,P)=>{var M=y=>{try{v(i.next(y))}catch(D){P(D)}},a=y=>{try{v(i.throw(y))}catch(D){P(D)}},v=y=>y.done?R(y.value):Promise.resolve(y.value).then(M,a);v((i=i.apply(m,c)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),g=require("./exports-ByrWvfQh.cjs"),mt={class:"html-preview-frame__header"},ft={class:"html-preview-frame__title"},vt={class:"html-preview-frame__label"},ht=["srcdoc"],pt=e.defineComponent({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},onClose:{type:Function},title:{}},setup(m){const c=m,{t:i}=g.useSafeI18n(),R=e.computed(()=>{const M=c.code||"",a=M.trim().toLowerCase();if(a.startsWith("<!doctype")||a.startsWith("<html")||a.startsWith("<body"))return M;const v=c.isDark?"#020617":"#ffffff",y=c.isDark?"#e5e7eb":"#020617";return`<!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <style>
7
- html, body {
8
- margin: 0;
9
- padding: 0;
10
- height: 100%;
11
- background-color: ${v};
12
- color: ${y};
13
- }
14
- body {
15
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
16
- }
17
- </style>
18
- </head>
19
- <body>
20
- ${M}
21
- </body>
22
- </html>`});function P(M){var a;(M.key==="Escape"||M.key==="Esc")&&((a=c.onClose)==null||a.call(c))}return e.onMounted(()=>{typeof window!="undefined"&&window.addEventListener("keydown",P)}),e.onUnmounted(()=>{typeof window!="undefined"&&window.removeEventListener("keydown",P)}),(M,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{class:e.normalizeClass(["html-preview-frame__backdrop",{"html-preview-frame__backdrop--dark":c.isDark}]),onClick:a[2]||(a[2]=v=>{var y;return(y=c.onClose)==null?void 0:y.call(c)})},[e.createElementVNode("div",{class:e.normalizeClass(["html-preview-frame",{"html-preview-frame--dark":c.isDark}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",mt,[e.createElementVNode("div",ft,[a[3]||(a[3]=e.createElementVNode("span",{class:"html-preview-frame__dot"},null,-1)),e.createElementVNode("span",vt,e.toDisplayString(c.title||e.unref(i)("common.preview")||"Preview"),1)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["html-preview-frame__close",{"html-preview-frame__close--dark":c.isDark}]),onClick:a[0]||(a[0]=v=>{var y;return(y=c.onClose)==null?void 0:y.call(c)})}," × ",2)]),e.createElementVNode("iframe",{class:"html-preview-frame__iframe",sandbox:"allow-scripts allow-same-origin",srcdoc:R.value},null,8,ht)],2)],2)]))}}),gt=g._export_sfc(pt,[["__scopeId","data-v-3cf0ed56"]]),wt={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},yt={class:"flex items-center space-x-2 flex-1 overflow-hidden"},kt=["innerHTML"],xt={class:"text-sm font-medium font-mono truncate"},bt={class:"flex items-center space-x-2"},Et=["aria-pressed"],Ct=["disabled"],Bt=["disabled"],Mt=["disabled"],Nt=["aria-label"],St={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Vt={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Ft=["aria-pressed"],Tt={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Dt={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Ht=["aria-label"],Pt={class:"code-loading-placeholder"},Lt={class:"sr-only","aria-live":"polite",role:"status"},Fe=10,Te=36,De=1,He=0,Pe=1.5,Z=1,Ot=e.defineComponent({__name:"CodeBlockNode",props:{node:{},isDark:{type:Boolean},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:void 0},lightTheme:{default:void 0},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},customId:{}},emits:["previewCode","copy"],setup(m,{emit:c}){var ke;const i=m,R=c,P=e.getCurrentInstance(),M=e.computed(()=>{const o=P==null?void 0:P.vnode.props;return!!(o&&(o.onPreviewCode||o.onPreviewCode))}),{t:a}=g.useSafeI18n(),v=e.ref(null),y=e.ref(null),D=e.ref(!1),F=e.ref(g.normalizeLanguageIdentifier(i.node.language)),Y=e.computed(()=>g.resolveMonacoLanguageId(F.value)),E=e.ref(!1),C=e.ref(!1),q=e.ref(!1),me=e.ref(!1),z=e.ref(null);let te=0;const Le=g.useViewportPriority(),A=e.ref(null),L=e.ref(typeof window=="undefined");typeof window!="undefined"&&e.watch(()=>y.value,o=>{var n;if((n=A.value)==null||n.destroy(),A.value=null,!o){L.value=!1;return}const t=Le(o,{rootMargin:"400px"});A.value=t,L.value=t.isVisible.value,t.whenVisible.then(()=>{L.value=!0})},{immediate:!0}),e.onBeforeUnmount(()=>{var o;(o=A.value)==null||o.destroy(),A.value=null});let O=null,X=null,oe=()=>{},ne=()=>{},U=()=>null,H=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),T=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),G=()=>{},le=()=>{},j=null,fe=()=>{var o;return String((o=i.node.language)!=null?o:"plaintext")},ie=()=>$(null,null,function*(){});const N=e.computed(()=>i.node.diff),re=e.ref(!1),K=e.ref(!1);typeof window!="undefined"&&$(null,null,function*(){try{const o=yield g.getUseMonaco();if(!o){re.value=!0;return}const t=o.useMonaco,n=o.detectLanguage;if(typeof n=="function"&&(fe=n),typeof t=="function"){const l=ye();if(l&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(l))throw new Error("Preferred theme not in provided themes array");const r=t(Ve(Se({wordWrap:"on",wrappingIndent:"same",themes:i.themes,theme:l},i.monacoOptions||{}),{onThemeChange(){_e()}}));O=r.createEditor||O,X=r.createDiffEditor||X,oe=r.updateCode||oe,ne=r.updateDiff||ne,U=r.getEditor||U,H=r.getEditorView||H,T=r.getDiffEditorView||T,G=r.cleanupEditor||G,le=r.safeClean||r.cleanupEditor||le,ie=r.setTheme||ie,me.value=!0,v.value&&(yield ue(v.value))}}catch(o){re.value=!0}});const S=e.ref(typeof((ke=i.monacoOptions)==null?void 0:ke.fontSize)=="number"?i.monacoOptions.fontSize:Number.NaN),f=e.ref(S.value),Oe=e.computed(()=>{const o=S.value,t=f.value;return typeof o=="number"&&Number.isFinite(o)&&o>0&&typeof t=="number"&&Number.isFinite(t)&&t>0});function $e(){try{const o=v.value;if(!o)return null;const t=o.querySelector(".view-lines .view-line");if(t){const n=Math.ceil(t.getBoundingClientRect().height);if(n>0)return n}}catch(o){}return null}function ve(){var o,t,n,l,r;try{const s=N.value?(n=(t=(o=T())==null?void 0:o.getModifiedEditor)==null?void 0:t.call(o))!=null?n:T():H(),w=U(),p=(l=w==null?void 0:w.EditorOption)==null?void 0:l.fontInfo;if(s&&p!=null){const k=(r=s.getOption)==null?void 0:r.call(s,p),d=k==null?void 0:k.fontSize;if(typeof d=="number"&&Number.isFinite(d)&&d>0)return d}}catch(s){}try{const s=v.value;if(s){const w=s.querySelector(".view-lines .view-line");if(w)try{if(typeof window!="undefined"&&typeof window.getComputedStyle=="function"){const p=window.getComputedStyle(w).fontSize,k=p&&p.match(/^(\d+(?:\.\d+)?)/);if(k)return Number.parseFloat(k[1])}}catch(p){}}}catch(s){}return null}function ae(o){var l,r;try{const s=U(),w=(l=s==null?void 0:s.EditorOption)==null?void 0:l.lineHeight;if(w!=null){const p=(r=o==null?void 0:o.getOption)==null?void 0:r.call(o,w);if(typeof p=="number"&&p>0)return p}}catch(s){}const t=$e();if(t&&t>0)return t;const n=Number.isFinite(f.value)&&f.value>0?f.value:12;return Math.max(12,Math.round(n*1.35))}function se(){var t;if(Number.isFinite(f.value)&&f.value>0&&Number.isFinite(S.value))return f.value;const o=ve();return typeof((t=i.monacoOptions)==null?void 0:t.fontSize)=="number"?(S.value=i.monacoOptions.fontSize,f.value=i.monacoOptions.fontSize,f.value):o&&o>0?(S.value=o,f.value=o,o):(S.value=12,f.value=12,12)}function ze(){const o=se(),t=Math.min(Te,o+De);f.value=t}function Ie(){const o=se(),t=Math.max(Fe,o-De);f.value=t}function Re(){se(),Number.isFinite(S.value)&&(f.value=S.value)}function he(){var o,t,n,l,r,s,w,p,k,d,h,xe,be,Ee;try{const u=N.value?T():H();if(!u)return null;if(N.value&&(u!=null&&u.getOriginalEditor)&&(u!=null&&u.getModifiedEditor)){const x=(o=u.getOriginalEditor)==null?void 0:o.call(u),b=(t=u.getModifiedEditor)==null?void 0:t.call(u);(n=x==null?void 0:x.layout)==null||n.call(x),(l=b==null?void 0:b.layout)==null||l.call(b);const tt=((r=x==null?void 0:x.getContentHeight)==null?void 0:r.call(x))||0,ot=((s=b==null?void 0:b.getContentHeight)==null?void 0:s.call(b))||0,Be=Math.max(tt,ot);if(Be>0)return Math.ceil(Be+Z);const nt=((k=(p=(w=x==null?void 0:x.getModel)==null?void 0:w.call(x))==null?void 0:p.getLineCount)==null?void 0:k.call(p))||1,lt=((xe=(h=(d=b==null?void 0:b.getModel)==null?void 0:d.call(b))==null?void 0:h.getLineCount)==null?void 0:xe.call(h))||1,it=Math.max(nt,lt),rt=Math.max(ae(x),ae(b));return Math.ceil(it*(rt+Pe)+He+Z)}else if(u!=null&&u.getContentHeight){(be=u==null?void 0:u.layout)==null||be.call(u);const x=u.getContentHeight();if(x>0)return Math.ceil(x+Z)}const de=(Ee=u==null?void 0:u.getModel)==null?void 0:Ee.call(u);let Ce=1;de&&typeof de.getLineCount=="function"&&(Ce=de.getLineCount());const et=ae(u);return Math.ceil(Ce*(et+Pe)+He+Z)}catch(u){return null}}function _e(){var p,k,d;const o=v.value,t=y.value;if(!o||!t)return;const n=o.querySelector(".monaco-editor")||o;let l=null;try{typeof window!="undefined"&&typeof window.getComputedStyle=="function"&&(l=window.getComputedStyle(n))}catch(h){l=null}const r=String((p=l==null?void 0:l.getPropertyValue("--vscode-editor-foreground"))!=null?p:""),s=String((k=l==null?void 0:l.getPropertyValue("--vscode-editor-background"))!=null?k:""),w=String((d=l==null?void 0:l.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?d:"");if(r&&s)return t.style.setProperty("--vscode-editor-foreground",r.trim()),t.style.setProperty("--vscode-editor-background",s.trim()),t.style.setProperty("--vscode-editor-selectionBackground",w.trim()),!0}function I(){try{const o=v.value;if(!o)return;const t=o.getBoundingClientRect(),n=window.scrollY+t.top,l=he();if(l!=null&&l>0){const r=t.height;o.style.height=`${Math.ceil(l)}px`,o.style.maxHeight="none";const s=Math.ceil(l)-r;s!==0&&n<window.scrollY&&window.scrollBy(0,s)}}catch(o){}}function _(){var o;try{const t=v.value;if(!t)return;const n=t.getBoundingClientRect(),l=window.scrollY+n.top,r=n.height,s=Ye();if(te>0&&(te--,z.value!=null)){const d=Math.min(z.value,s);t.style.height=`${Math.ceil(d)}px`,t.style.maxHeight=`${Math.ceil(s)}px`,t.style.overflow="auto";const h=Math.ceil(d)-r;h!==0&&l<window.scrollY&&window.scrollBy(0,h);return}const w=he();if(w!=null&&w>0){const d=Math.min(w,s);t.style.height=`${Math.ceil(d)}px`,t.style.maxHeight=`${Math.ceil(s)}px`,t.style.overflow="auto";const h=Math.ceil(d)-r;h!==0&&l<window.scrollY&&window.scrollBy(0,h);return}if(z.value!=null){const d=Math.min(z.value,s);t.style.height=`${Math.ceil(d)}px`,t.style.maxHeight=`${Math.ceil(s)}px`,t.style.overflow="auto";const h=Math.ceil(d)-r;h!==0&&l<window.scrollY&&window.scrollBy(0,h);return}const p=Math.ceil(((o=t.getBoundingClientRect)==null?void 0:o.call(t).height)||0);if(p>0){const d=Math.min(p,s);t.style.height=`${Math.ceil(d)}px`,t.style.maxHeight=`${Math.ceil(s)}px`,t.style.overflow="auto";const h=Math.ceil(d)-r;h!==0&&l<window.scrollY&&window.scrollBy(0,h);return}const k=Number.parseFloat(t.style.height);if(!Number.isNaN(k)&&k>0){const d=Math.ceil(Math.min(k,s));t.style.height=`${d}px`;const h=d-r;h!==0&&l<window.scrollY&&window.scrollBy(0,h)}else{const d=Math.ceil(s);t.style.height=`${d}px`;const h=d-r;h!==0&&l<window.scrollY&&window.scrollBy(0,h)}t.style.maxHeight=`${Math.ceil(s)}px`,t.style.overflow="auto"}catch(t){}}function Ye(){var n,l;const o=(l=(n=i.monacoOptions)==null?void 0:n.MAX_HEIGHT)!=null?l:500;if(typeof o=="number")return o;const t=String(o).match(/^(\d+(?:\.\d+)?)/);return t?Number.parseFloat(t[1]):500}const ce=e.computed(()=>i.isShowPreview&&(F.value==="html"||F.value==="svg")),W=e.computed(()=>F.value==="mermaid");e.watch(()=>i.node.language,o=>{F.value=g.normalizeLanguageIdentifier(o)}),e.watch(()=>i.node.code,o=>$(null,null,function*(){var t,n;if(i.stream!==!1){if(F.value||(F.value=g.normalizeLanguageIdentifier(fe(o))),O&&!q.value&&v.value)try{yield ue(v.value)}catch(l){}N.value?ne(String((t=i.node.originalCode)!=null?t:""),String((n=i.node.updatedCode)!=null?n:""),Y.value):oe(o,Y.value),E.value&&g.safeRaf(()=>I())}}));const Ae=e.computed(()=>{const o=F.value;return o?g.languageMap[o]||o.charAt(0).toUpperCase()+o.slice(1):g.languageMap[""]||"Plain Text"}),je=e.computed(()=>g.getLanguageIcon(F.value||"")),We=e.computed(()=>{const o={},t=r=>{if(r!=null)return typeof r=="number"?`${r}px`:String(r)},n=t(i.minWidth),l=t(i.maxWidth);return n&&(o.minWidth=n),l&&(o.maxWidth=l),o});function qe(){return $(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(i.node.code)),D.value=!0,R("copy",i.node.code),setTimeout(()=>{D.value=!1},1e3)}catch(o){console.error("复制失败:",o)}})}function pe(o){const t=o;return!t||t.disabled}function V(o,t,n="top"){if(pe(o.currentTarget))return;const l=o,r=(l==null?void 0:l.clientX)!=null&&(l==null?void 0:l.clientY)!=null?{x:l.clientX,y:l.clientY}:void 0;g.showTooltipForAnchor(o.currentTarget,t,n,!1,r,i.isDark)}function B(){g.hideTooltip()}function ge(o){if(pe(o.currentTarget))return;const t=D.value?a("common.copied")||"Copied":a("common.copy")||"Copy",n=o,l=(n==null?void 0:n.clientX)!=null&&(n==null?void 0:n.clientY)!=null?{x:n.clientX,y:n.clientY}:void 0;g.showTooltipForAnchor(o.currentTarget,t,"top",!1,l,i.isDark)}function Xe(){E.value=!E.value;const o=N.value?T():H(),t=v.value;!o||!t||(E.value?(J(!0),t.style.maxHeight="none",t.style.overflow="visible",I()):(J(!1),t.style.overflow="auto",_()))}function Ue(){var o,t,n;if(C.value=!C.value,C.value){if(v.value){const l=Math.ceil(((t=(o=v.value).getBoundingClientRect)==null?void 0:t.call(o).height)||0);l>0&&(z.value=l)}J(!1)}else{E.value&&J(!0),v.value&&z.value!=null&&(v.value.style.height=`${z.value}px`);const l=N.value?T():H();try{(n=l==null?void 0:l.layout)==null||n.call(l)}catch(r){}te=2,g.safeRaf(()=>{E.value?I():_()})}}e.watch(()=>f.value,(o,t)=>{const n=N.value?T():H();n&&typeof o=="number"&&Number.isFinite(o)&&o>0&&(n.updateOptions({fontSize:o}),E.value&&!C.value&&I())},{flush:"post",immediate:!1});function Ge(){if(!ce.value)return;const o=F.value;if(M.value){const t=o==="html"?"text/html":"image/svg+xml",n=o==="html"?a("artifacts.htmlPreviewTitle")||"HTML Preview":a("artifacts.svgPreviewTitle")||"SVG Preview";R("previewCode",{node:i.node,artifactType:t,artifactTitle:n,id:`temp-${o}-${Date.now()}`});return}o==="html"&&(K.value=!K.value)}function J(o){var t,n;try{if(N.value){const l=T();(t=l==null?void 0:l.updateOptions)==null||t.call(l,{automaticLayout:o})}else{const l=H();(n=l==null?void 0:l.updateOptions)==null||n.call(l,{automaticLayout:o})}}catch(l){}}function Ke(o){return $(this,null,function*(){var n,l,r;if(!O)return;N.value?(le(),X?yield X(o,String((n=i.node.originalCode)!=null?n:""),String((l=i.node.updatedCode)!=null?l:""),Y.value):yield O(o,i.node.code,Y.value)):yield O(o,i.node.code,Y.value);const t=N.value?T():H();if(typeof((r=i.monacoOptions)==null?void 0:r.fontSize)=="number")t==null||t.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),S.value=i.monacoOptions.fontSize,f.value=i.monacoOptions.fontSize;else{const s=ve();s&&s>0?(S.value=s,f.value=s):(S.value=12,f.value=12)}!E.value&&!C.value&&_(),i.loading===!1&&(yield e.nextTick(),g.safeRaf(()=>{E.value&&!C.value?I():C.value||_()}))})}function ue(o){return O?j||(q.value=!0,j=$(null,null,function*(){yield Ke(o)}).finally(()=>{j=null}),j):null}const we=e.watch(()=>[v.value,W.value,N.value,i.stream,i.loading,me.value,L.value],p=>$(null,[p],function*([o,t,n,l,r,s,w]){if(!o||!O||!w||l===!1&&r!==!1)return;if(W.value){G(),we();return}const k=ue(o);k&&(yield k,we())})),Je=e.watch(()=>[i.darkTheme,i.lightTheme,q.value,L.value],()=>{if(!(!q.value||!L.value)){if(W.value)return Je();Qe()}});function ye(){return i.isDark?i.darkTheme:i.lightTheme}function Qe(){const o=ye();o&&ie(o)}const Ze=e.watch(()=>[i.monacoOptions,L.value],()=>{var n,l;if(!O||!L.value)return;if(W.value)return Ze();const o=N.value?T():H(),t=typeof((n=i.monacoOptions)==null?void 0:n.fontSize)=="number"?i.monacoOptions.fontSize:Number.isFinite(f.value)?f.value:void 0;typeof t=="number"&&Number.isFinite(t)&&t>0&&((l=o==null?void 0:o.updateOptions)==null||l.call(o,{fontSize:t})),E.value&&!C.value?I():C.value||_()},{deep:!0}),Q=e.watch(()=>[i.loading,L.value],n=>$(null,[n],function*([o,t]){if(t){if(W.value){e.nextTick(()=>{Q==null||Q()});return}o||(yield e.nextTick(),g.safeRaf(()=>{C.value||(E.value?I():_()),Q()}))}}),{immediate:!0,flush:"post"});return e.onUnmounted(()=>{G()}),(o,t)=>re.value?(e.openBlock(),e.createBlock(e.unref(g._sfc_main),{key:0,node:m.node,loading:i.loading},null,8,["node","loading"])):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"container",ref:y,style:e.normalizeStyle(We.value),class:e.normalizeClass(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[i.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":i.loading,"is-dark":i.isDark}]])},[i.showHeader?(e.openBlock(),e.createElementBlock("div",wt,[e.renderSlot(o.$slots,"header-left",{},()=>[e.createElementVNode("div",yt,[e.createElementVNode("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:je.value},null,8,kt),e.createElementVNode("span",xt,e.toDisplayString(Ae.value),1)])],!0),e.renderSlot(o.$slots,"header-right",{},()=>[e.createElementVNode("div",bt,[e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":C.value,onClick:Ue,onMouseenter:t[0]||(t[0]=n=>V(n,C.value?e.unref(a)("common.expand")||"Expand":e.unref(a)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=n=>V(n,C.value?e.unref(a)("common.expand")||"Expand":e.unref(a)("common.collapse")||"Collapse")),onMouseleave:B,onBlur:B},[(e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle({rotate:C.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...t[17]||(t[17]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Et),i.showFontSizeButtons&&i.enableFontSizeControl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:Number.isFinite(f.value)?f.value<=Fe:!1,onClick:t[2]||(t[2]=n=>Ie()),onMouseenter:t[3]||(t[3]=n=>V(n,e.unref(a)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=n=>V(n,e.unref(a)("common.decrease")||"Decrease")),onMouseleave:B,onBlur:B},[...t[18]||(t[18]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,Ct),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!Oe.value||f.value===S.value,onClick:t[5]||(t[5]=n=>Re()),onMouseenter:t[6]||(t[6]=n=>V(n,e.unref(a)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=n=>V(n,e.unref(a)("common.reset")||"Reset")),onMouseleave:B,onBlur:B},[...t[19]||(t[19]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),e.createElementVNode("path",{d:"M3 3v5h5"})])],-1)])],40,Bt),e.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:Number.isFinite(f.value)?f.value>=Te:!1,onClick:t[8]||(t[8]=n=>ze()),onMouseenter:t[9]||(t[9]=n=>V(n,e.unref(a)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=n=>V(n,e.unref(a)("common.increase")||"Increase")),onMouseleave:B,onBlur:B},[...t[20]||(t[20]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Mt)],64)):e.createCommentVNode("",!0),i.showCopyButton?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":D.value?e.unref(a)("common.copied")||"Copied":e.unref(a)("common.copy")||"Copy",onClick:qe,onMouseenter:t[11]||(t[11]=n=>ge(n)),onFocus:t[12]||(t[12]=n=>ge(n)),onMouseleave:B,onBlur:B},[D.value?(e.openBlock(),e.createElementBlock("svg",Vt,[...t[22]||(t[22]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",St,[...t[21]||(t[21]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),e.createElementVNode("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Nt)):e.createCommentVNode("",!0),i.showExpandButton?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":E.value,onClick:Xe,onMouseenter:t[13]||(t[13]=n=>V(n,E.value?e.unref(a)("common.collapse")||"Collapse":e.unref(a)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=n=>V(n,E.value?e.unref(a)("common.collapse")||"Collapse":e.unref(a)("common.expand")||"Expand")),onMouseleave:B,onBlur:B},[E.value?(e.openBlock(),e.createElementBlock("svg",Tt,[...t[23]||(t[23]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Dt,[...t[24]||(t[24]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])]))],40,Ft)):e.createCommentVNode("",!0),ce.value&&i.showPreviewButton?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":e.unref(a)("common.preview")||"Preview",onClick:Ge,onMouseenter:t[15]||(t[15]=n=>V(n,e.unref(a)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=n=>V(n,e.unref(a)("common.preview")||"Preview")),onMouseleave:B,onBlur:B},[...t[25]||(t[25]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"},[e.createElementVNode("g",{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"},[e.createElementVNode("path",{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"}),e.createElementVNode("path",{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"})])],-1)])],40,Ht)):e.createCommentVNode("",!0)])],!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"codeEditor",ref:v,class:e.normalizeClass(["code-editor-container",[m.stream?"":"code-height-placeholder"]])},null,2),[[e.vShow,!C.value&&(m.stream?!0:!m.loading)]]),K.value&&!M.value&&ce.value&&F.value==="html"?(e.openBlock(),e.createBlock(gt,{key:1,code:m.node.code,"is-dark":i.isDark,"on-close":()=>K.value=!1},null,8,["code","is-dark","on-close"])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",Pt,[e.renderSlot(o.$slots,"loading",{loading:m.loading,stream:m.stream},()=>[t[26]||(t[26]=e.createElementVNode("div",{class:"loading-skeleton"},[e.createElementVNode("div",{class:"skeleton-line"}),e.createElementVNode("div",{class:"skeleton-line"}),e.createElementVNode("div",{class:"skeleton-line short"})],-1))],!0)],512),[[e.vShow,!m.stream&&m.loading]]),e.createElementVNode("span",Lt,e.toDisplayString(D.value?e.unref(a)("common.copied")||"Copied":""),1)],6))}}),ee=g._export_sfc(Ot,[["__scopeId","data-v-f37961ae"]]);ee.install=m=>{m.component(ee.__name,ee)};exports.default=ee;