markstream-vue 0.0.2-beta.8 → 0.0.2-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/dist/exports-CyoL-8XF.js +4827 -0
- package/dist/exports-DADWwNRQ.cjs +246 -0
- package/dist/exports.js +1 -1
- package/dist/index-Br7IvHNe.cjs +1 -0
- package/dist/index-CDRkq20z.js +958 -0
- package/dist/index-CcqRGphH.cjs +22 -0
- package/dist/index-DdtMPiwH.js +113 -0
- package/dist/index-DoRl8S3_.js +122 -0
- package/dist/index-OTPe0l-Z.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +71 -62
- package/dist/index.tailwind.css +1 -1
- package/dist/index2.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index4.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +7 -7
- package/dist/exports-BD7Y_TjZ.cjs +0 -247
- package/dist/exports-BreegGo9.js +0 -4719
- package/dist/index-BM9Oro93.js +0 -860
- package/dist/index-Cc3u_ylp.js +0 -117
- package/dist/index-CoB_G9GJ.cjs +0 -1
- package/dist/index-DbbC_URx.cjs +0 -1
- package/dist/index-Dq586yJ8.cjs +0 -1
- package/dist/index-ELonlW3Z.js +0 -108
package/dist/index-Cc3u_ylp.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
var v = (d, o, r) => new Promise((f, l) => {
|
|
2
|
-
var c = (e) => {
|
|
3
|
-
try {
|
|
4
|
-
s(r.next(e));
|
|
5
|
-
} catch (t) {
|
|
6
|
-
l(t);
|
|
7
|
-
}
|
|
8
|
-
}, m = (e) => {
|
|
9
|
-
try {
|
|
10
|
-
s(r.throw(e));
|
|
11
|
-
} catch (t) {
|
|
12
|
-
l(t);
|
|
13
|
-
}
|
|
14
|
-
}, s = (e) => e.done ? f(e.value) : Promise.resolve(e.value).then(c, m);
|
|
15
|
-
s((r = r.apply(d, o)).next());
|
|
16
|
-
});
|
|
17
|
-
import { defineComponent as k, ref as g, watch as I, onMounted as O, onBeforeUnmount as y, createElementBlock as C, openBlock as R, withDirectives as B, createBlock as M, createCommentVNode as x, createElementVNode as p, vShow as W, Transition as K, withCtx as b, renderSlot as L } from "vue";
|
|
18
|
-
import { a as N, r as V, e as S, f as U, W as A, d as D } from "./exports-BreegGo9.js";
|
|
19
|
-
const F = {
|
|
20
|
-
class: "math-inline__loading",
|
|
21
|
-
role: "status",
|
|
22
|
-
"aria-live": "polite"
|
|
23
|
-
}, X = /* @__PURE__ */ k({
|
|
24
|
-
__name: "MathInlineNode",
|
|
25
|
-
props: {
|
|
26
|
-
node: {}
|
|
27
|
-
},
|
|
28
|
-
setup(d) {
|
|
29
|
-
const o = d;
|
|
30
|
-
let r = null;
|
|
31
|
-
const f = g(null), l = g(null);
|
|
32
|
-
let c = !1, m = 0, s = !1, e = null;
|
|
33
|
-
const t = g(!0), T = N();
|
|
34
|
-
let a = null;
|
|
35
|
-
function E() {
|
|
36
|
-
return v(this, null, function* () {
|
|
37
|
-
if (!o.node.content || !l.value || s)
|
|
38
|
-
return;
|
|
39
|
-
e && (e.abort(), e = null);
|
|
40
|
-
const i = ++m, u = new AbortController();
|
|
41
|
-
if (e = u, !c)
|
|
42
|
-
try {
|
|
43
|
-
!a && f.value && (a = T(f.value)), yield a == null ? void 0 : a.whenVisible;
|
|
44
|
-
} catch (n) {
|
|
45
|
-
}
|
|
46
|
-
V(o.node.content, !1, {
|
|
47
|
-
// Inline math should not wait on worker slots; fallback to sync render immediately
|
|
48
|
-
timeout: 1500,
|
|
49
|
-
waitTimeout: 0,
|
|
50
|
-
maxRetries: 0,
|
|
51
|
-
signal: u.signal
|
|
52
|
-
}).then((n) => {
|
|
53
|
-
s || i !== m || l.value && (l.value.innerHTML = n, t.value = !1, c = !0);
|
|
54
|
-
}).catch((n) => v(null, null, function* () {
|
|
55
|
-
if (s || i !== m || !l.value)
|
|
56
|
-
return;
|
|
57
|
-
const h = (n == null ? void 0 : n.code) || (n == null ? void 0 : n.name);
|
|
58
|
-
if ((h === "WORKER_INIT_ERROR" || (n == null ? void 0 : n.fallbackToRenderer) || (h === A || h === "WORKER_TIMEOUT")) && (r || (r = yield S()), r)) {
|
|
59
|
-
try {
|
|
60
|
-
const _ = r.renderToString(o.node.content, { throwOnError: o.node.loading, displayMode: !1 });
|
|
61
|
-
t.value = !1, l.value.innerHTML = _, c = !0, U(o.node.content, !1, _);
|
|
62
|
-
} catch (_) {
|
|
63
|
-
}
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
c || (t.value = !0), o.node.loading || (t.value = !1, l.value.textContent = o.node.raw);
|
|
67
|
-
}));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return I(
|
|
71
|
-
() => o.node.content,
|
|
72
|
-
() => {
|
|
73
|
-
E();
|
|
74
|
-
}
|
|
75
|
-
), O(() => {
|
|
76
|
-
E();
|
|
77
|
-
}), y(() => {
|
|
78
|
-
var i;
|
|
79
|
-
s = !0, e && (e.abort(), e = null), (i = a == null ? void 0 : a.destroy) == null || i.call(a), a = null;
|
|
80
|
-
}), (i, u) => (R(), C("span", {
|
|
81
|
-
ref_key: "containerEl",
|
|
82
|
-
ref: f,
|
|
83
|
-
class: "math-inline-wrapper"
|
|
84
|
-
}, [
|
|
85
|
-
B(p("span", {
|
|
86
|
-
ref_key: "mathElement",
|
|
87
|
-
ref: l,
|
|
88
|
-
class: "math-inline"
|
|
89
|
-
}, null, 512), [
|
|
90
|
-
[W, !t.value]
|
|
91
|
-
]),
|
|
92
|
-
t.value ? (R(), M(K, {
|
|
93
|
-
key: 0,
|
|
94
|
-
name: "table-node-fade"
|
|
95
|
-
}, {
|
|
96
|
-
default: b(() => [
|
|
97
|
-
p("span", F, [
|
|
98
|
-
L(i.$slots, "loading", { isLoading: t.value }, () => [
|
|
99
|
-
u[0] || (u[0] = p("span", {
|
|
100
|
-
class: "math-inline__spinner animate-spin",
|
|
101
|
-
"aria-hidden": "true"
|
|
102
|
-
}, null, -1)),
|
|
103
|
-
u[1] || (u[1] = p("span", { class: "sr-only" }, "Loading", -1))
|
|
104
|
-
], !0)
|
|
105
|
-
])
|
|
106
|
-
]),
|
|
107
|
-
_: 3
|
|
108
|
-
})) : x("", !0)
|
|
109
|
-
], 512));
|
|
110
|
-
}
|
|
111
|
-
}), w = /* @__PURE__ */ D(X, [["__scopeId", "data-v-6b23009e"]]);
|
|
112
|
-
w.install = (d) => {
|
|
113
|
-
d.component(w.__name, w);
|
|
114
|
-
};
|
|
115
|
-
export {
|
|
116
|
-
w as default
|
|
117
|
-
};
|
package/dist/index-CoB_G9GJ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var g=(m,l,s)=>new Promise((p,r)=>{var d=n=>{try{i(s.next(n))}catch(o){r(o)}},h=n=>{try{i(s.throw(n))}catch(o){r(o)}},i=n=>n.done?p(n.value):Promise.resolve(n.value).then(d,h);i((s=s.apply(m,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("./exports-BD7Y_TjZ.cjs"),y={class:"math-inline__loading",role:"status","aria-live":"polite"},O=e.defineComponent({__name:"MathInlineNode",props:{node:{}},setup(m){const l=m;let s=null;const p=e.ref(null),r=e.ref(null);let d=!1,h=0,i=!1,n=null;const o=e.ref(!0),R=f.useViewportPriority();let a=null;function w(){return g(this,null,function*(){if(!l.node.content||!r.value||i)return;n&&(n.abort(),n=null);const u=++h,c=new AbortController;if(n=c,!d)try{!a&&p.value&&(a=R(p.value)),yield a==null?void 0:a.whenVisible}catch(t){}f.renderKaTeXWithBackpressure(l.node.content,!1,{timeout:1500,waitTimeout:0,maxRetries:0,signal:c.signal}).then(t=>{i||u!==h||r.value&&(r.value.innerHTML=t,o.value=!1,d=!0)}).catch(t=>g(null,null,function*(){if(i||u!==h||!r.value)return;const v=(t==null?void 0:t.code)||(t==null?void 0:t.name),T=v==="WORKER_INIT_ERROR"||(t==null?void 0:t.fallbackToRenderer),k=v===f.WORKER_BUSY_CODE||v==="WORKER_TIMEOUT";if((T||k)&&(s||(s=yield f.getKatex()),s)){try{const E=s.renderToString(l.node.content,{throwOnError:l.node.loading,displayMode:!1});o.value=!1,r.value.innerHTML=E,d=!0,f.setKaTeXCache(l.node.content,!1,E)}catch(E){}return}d||(o.value=!0),l.node.loading||(o.value=!1,r.value.textContent=l.node.raw)}))})}return e.watch(()=>l.node.content,()=>{w()}),e.onMounted(()=>{w()}),e.onBeforeUnmount(()=>{var u;i=!0,n&&(n.abort(),n=null),(u=a==null?void 0:a.destroy)==null||u.call(a),a=null}),(u,c)=>(e.openBlock(),e.createElementBlock("span",{ref_key:"containerEl",ref:p,class:"math-inline-wrapper"},[e.withDirectives(e.createElementVNode("span",{ref_key:"mathElement",ref:r,class:"math-inline"},null,512),[[e.vShow,!o.value]]),o.value?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"table-node-fade"},{default:e.withCtx(()=>[e.createElementVNode("span",y,[e.renderSlot(u.$slots,"loading",{isLoading:o.value},()=>[c[0]||(c[0]=e.createElementVNode("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),c[1]||(c[1]=e.createElementVNode("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):e.createCommentVNode("",!0)],512))}}),_=f._export_sfc(O,[["__scopeId","data-v-6b23009e"]]);_.install=m=>{m.component(_.__name,_)};exports.default=_;
|
package/dist/index-DbbC_URx.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var g=(f,a,r)=>new Promise((m,l)=>{var u=t=>{try{c(r.next(t))}catch(_){l(_)}},h=t=>{try{c(r.throw(t))}catch(_){l(_)}},c=t=>t.done?m(t.value):Promise.resolve(t.value).then(u,h);c((r=r.apply(f,a)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./exports-BD7Y_TjZ.cjs"),w={key:0,class:"math-loading-overlay"},x=e.defineComponent({__name:"MathBlockNode",props:{node:{}},setup(f){const a=f;let r=null;const m=e.ref(null),l=e.ref(null);let u=!1,h=0,c=!1,t=null;const _=d.useViewportPriority();let o=null;const s=e.ref(!0);function R(){return g(this,null,function*(){if(!a.node.content||!l.value||c)return;if(!u)try{!o&&m.value&&(o=_(m.value)),yield o==null?void 0:o.whenVisible}catch(n){}t&&(t.abort(),t=null);const i=++h,v=new AbortController;t=v,d.renderKaTeXWithBackpressure(a.node.content,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:v.signal}).then(n=>{c||i!==h||l.value&&(l.value.innerHTML=n,u=!0,s.value=!1)}).catch(n=>g(null,null,function*(){if(c||i!==h||!l.value)return;const k=(n==null?void 0:n.code)||(n==null?void 0:n.name),T=k==="WORKER_INIT_ERROR"||(n==null?void 0:n.fallbackToRenderer),B=k===d.WORKER_BUSY_CODE||k==="WORKER_TIMEOUT";if((T||B)&&(r||(r=yield d.getKatex()),r)){try{const E=r.renderToString(a.node.content,{throwOnError:a.node.loading,displayMode:!0});l.value.innerHTML=E,u=!0,s.value=!1,d.setKaTeXCache(a.node.content,!0,E)}catch(E){}return}u||(s.value=!0),a.node.loading||(s.value=!1,l.value.textContent=a.node.raw)}))})}return e.watch(()=>a.node.content,()=>{R()}),e.onMounted(()=>{R()}),e.onBeforeUnmount(()=>{var i;c=!0,t&&(t.abort(),t=null),(i=o==null?void 0:o.destroy)==null||i.call(o),o=null}),(i,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerEl",ref:m,class:"math-block text-center overflow-x-auto relative min-h-[40px]"},[e.createVNode(e.Transition,{name:"math-fade"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",w,[...v[0]||(v[0]=[e.createElementVNode("div",{class:"math-loading-spinner"},null,-1)])])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",{ref_key:"mathBlockElement",ref:l,class:e.normalizeClass({"math-rendering":s.value})},null,2)],512))}}),p=d._export_sfc(x,[["__scopeId","data-v-2e076ab9"]]);p.install=f=>{f.component(p.__name,p)};exports.default=p;
|
package/dist/index-Dq586yJ8.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var tt=Object.defineProperty,ot=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var ke=Object.getOwnPropertySymbols;var it=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable;var xe=(m,k,l)=>k in m?tt(m,k,{enumerable:!0,configurable:!0,writable:!0,value:l}):m[k]=l,be=(m,k)=>{for(var l in k||(k={}))it.call(k,l)&&xe(m,l,k[l]);if(ke)for(var l of ke(k))lt.call(k,l)&&xe(m,l,k[l]);return m},Ce=(m,k)=>ot(m,nt(k));var L=(m,k,l)=>new Promise((A,u)=>{var y=f=>{try{F(l.next(f))}catch(p){u(p)}},$=f=>{try{F(l.throw(f))}catch(p){u(p)}},F=f=>f.done?A(f.value):Promise.resolve(f.value).then(y,$);F((l=l.apply(m,k)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),E=require("./exports-BD7Y_TjZ.cjs"),rt={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)"}},at={class:"flex items-center space-x-2 flex-1 overflow-hidden"},st=["innerHTML"],ut={class:"text-sm font-medium font-mono truncate"},ct={class:"flex items-center space-x-2"},dt=["aria-pressed"],mt=["disabled"],ft=["disabled"],vt=["disabled"],ht=["aria-label"],gt={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"},pt={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"},wt=["aria-pressed"],yt={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"},kt={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"},xt=["aria-label"],bt={class:"code-loading-placeholder"},Ct={class:"sr-only","aria-live":"polite",role:"status"},Ee=10,Be=36,Me=1,Ne=0,Se=1.5,J=1,Et=o.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:k}){var ge,pe;const l=m,A=k,{t:u}=E.useSafeI18n(),y=o.ref(null),$=o.ref(null),F=o.ref(!1),f=o.ref(String((ge=l.node.language)!=null?ge:"")),p=o.ref(!1),x=o.ref(!1),j=o.ref(!1),ae=o.ref(!1),D=o.ref(null);let Q=0;const Ve=E.useViewportPriority(),R=o.ref(null),H=o.ref(typeof window=="undefined");typeof window!="undefined"&&o.watch(()=>$.value,t=>{var n;if((n=R.value)==null||n.destroy(),R.value=null,!t){H.value=!1;return}const e=Ve(t,{rootMargin:"400px"});R.value=e,H.value=e.isVisible.value,e.whenVisible.then(()=>{H.value=!0})},{immediate:!0}),o.onBeforeUnmount(()=>{var t;(t=R.value)==null||t.destroy(),R.value=null});let O=null,q=null,Z=()=>{},_=()=>{},W=()=>null,T=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),S=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),X=()=>{},ee=()=>{},I=null,se=()=>{var t;return String((t=l.node.language)!=null?t:"plaintext")},te=()=>L(null,null,function*(){});const B=o.computed(()=>l.node.diff),oe=o.ref(!1);typeof window!="undefined"&&L(null,null,function*(){try{const t=yield E.getUseMonaco();if(!t){oe.value=!0;return}const e=t.useMonaco,n=t.detectLanguage;if(typeof n=="function"&&(se=n),typeof e=="function"){const i=he();if(i&&l.themes&&Array.isArray(l.themes)&&!l.themes.includes(i))throw new Error("Preferred theme not in provided themes array");const r=e(Ce(be({wordWrap:"on",wrappingIndent:"same",themes:l.themes,theme:i},l.monacoOptions||{}),{onThemeChange(){De()}}));O=r.createEditor||O,q=r.createDiffEditor||q,Z=r.updateCode||Z,_=r.updateDiff||_,W=r.getEditor||W,T=r.getEditorView||T,S=r.getDiffEditorView||S,X=r.cleanupEditor||X,ee=r.safeClean||r.cleanupEditor||ee,te=r.setTheme||te,ae.value=!0,y.value&&(yield le(y.value))}}catch(t){oe.value=!0}});const M=o.ref(typeof((pe=l.monacoOptions)==null?void 0:pe.fontSize)=="number"?l.monacoOptions.fontSize:Number.NaN),c=o.ref(M.value),Fe=o.computed(()=>{const t=M.value,e=c.value;return typeof t=="number"&&Number.isFinite(t)&&t>0&&typeof e=="number"&&Number.isFinite(e)&&e>0});function Te(){try{const t=y.value;if(!t)return null;const e=t.querySelector(".view-lines .view-line");if(e){const n=Math.ceil(e.getBoundingClientRect().height);if(n>0)return n}}catch(t){}return null}function ue(){var t,e,n,i,r;try{const a=B.value?(n=(e=(t=S())==null?void 0:t.getModifiedEditor)==null?void 0:e.call(t))!=null?n:S():T(),g=W(),w=(i=g==null?void 0:g.EditorOption)==null?void 0:i.fontInfo;if(a&&w!=null){const v=(r=a.getOption)==null?void 0:r.call(a,w),s=v==null?void 0:v.fontSize;if(typeof s=="number"&&Number.isFinite(s)&&s>0)return s}}catch(a){}try{const a=y.value;if(a){const g=a.querySelector(".view-lines .view-line");if(g)try{if(typeof window!="undefined"&&typeof window.getComputedStyle=="function"){const w=window.getComputedStyle(g).fontSize,v=w&&w.match(/^(\d+(?:\.\d+)?)/);if(v)return Number.parseFloat(v[1])}}catch(w){}}}catch(a){}return null}function ne(t){var i,r;try{const a=W(),g=(i=a==null?void 0:a.EditorOption)==null?void 0:i.lineHeight;if(g!=null){const w=(r=t==null?void 0:t.getOption)==null?void 0:r.call(t,g);if(typeof w=="number"&&w>0)return w}}catch(a){}const e=Te();if(e&&e>0)return e;const n=Number.isFinite(c.value)&&c.value>0?c.value:12;return Math.max(12,Math.round(n*1.35))}function ie(){var e;if(Number.isFinite(c.value)&&c.value>0&&Number.isFinite(M.value))return c.value;const t=ue();return typeof((e=l.monacoOptions)==null?void 0:e.fontSize)=="number"?(M.value=l.monacoOptions.fontSize,c.value=l.monacoOptions.fontSize,c.value):t&&t>0?(M.value=t,c.value=t,t):(M.value=12,c.value=12,12)}function He(){const t=ie(),e=Math.min(Be,t+Me);c.value=e}function Oe(){const t=ie(),e=Math.max(Ee,t-Me);c.value=e}function Le(){ie(),Number.isFinite(M.value)&&(c.value=M.value)}function ce(){var t,e,n,i,r,a,g,w,v,s,h;try{const d=B.value?S():T();if(!d)return null;if(B.value&&(d!=null&&d.getOriginalEditor)&&(d!=null&&d.getModifiedEditor)){const C=(t=d.getOriginalEditor)==null?void 0:t.call(d),V=(e=d.getModifiedEditor)==null?void 0:e.call(d),Je=((n=C==null?void 0:C.getContentHeight)==null?void 0:n.call(C))||0,Ke=((i=V==null?void 0:V.getContentHeight)==null?void 0:i.call(V))||0,ye=Math.max(Je,Ke);if(ye>0)return Math.ceil(ye+J);const Qe=((g=(a=(r=C==null?void 0:C.getModel)==null?void 0:r.call(C))==null?void 0:a.getLineCount)==null?void 0:g.call(a))||1,Ze=((s=(v=(w=V==null?void 0:V.getModel)==null?void 0:w.call(V))==null?void 0:v.getLineCount)==null?void 0:s.call(v))||1,_e=Math.max(Qe,Ze),et=Math.max(ne(C),ne(V));return Math.ceil(_e*(et+Se)+Ne+J)}else if(d!=null&&d.getContentHeight){const C=d.getContentHeight();if(C>0)return Math.ceil(C+J)}const re=(h=d==null?void 0:d.getModel)==null?void 0:h.call(d);let we=1;re&&typeof re.getLineCount=="function"&&(we=re.getLineCount());const Ge=ne(d);return Math.ceil(we*(Ge+Se)+Ne+J)}catch(d){return null}}function De(){var w,v,s;const t=y.value,e=$.value;if(!t||!e)return;const n=t.querySelector(".monaco-editor")||t;let i=null;try{typeof window!="undefined"&&typeof window.getComputedStyle=="function"&&(i=window.getComputedStyle(n))}catch(h){i=null}const r=String((w=i==null?void 0:i.getPropertyValue("--vscode-editor-foreground"))!=null?w:""),a=String((v=i==null?void 0:i.getPropertyValue("--vscode-editor-background"))!=null?v:""),g=String((s=i==null?void 0:i.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?s:"");if(r&&a)return e.style.setProperty("--vscode-editor-foreground",r.trim()),e.style.setProperty("--vscode-editor-background",a.trim()),e.style.setProperty("--vscode-editor-selectionBackground",g.trim()),!0}function P(){try{const t=y.value;if(!t)return;const e=t.getBoundingClientRect(),n=window.scrollY+e.top,i=ce();if(i!=null&&i>0){const r=e.height;t.style.height=`${Math.ceil(i)}px`,t.style.maxHeight="none";const a=Math.ceil(i)-r;a!==0&&n<window.scrollY&&window.scrollBy(0,a)}}catch(t){}}function z(){var t;try{const e=y.value;if(!e)return;const n=e.getBoundingClientRect(),i=window.scrollY+n.top,r=n.height,a=Pe();if(Q>0&&(Q--,D.value!=null)){const s=Math.min(D.value,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const h=Math.ceil(s)-r;h!==0&&i<window.scrollY&&window.scrollBy(0,h);return}const g=ce();if(g!=null&&g>0){const s=Math.min(g,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const h=Math.ceil(s)-r;h!==0&&i<window.scrollY&&window.scrollBy(0,h);return}if(D.value!=null){const s=Math.min(D.value,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const h=Math.ceil(s)-r;h!==0&&i<window.scrollY&&window.scrollBy(0,h);return}const w=Math.ceil(((t=e.getBoundingClientRect)==null?void 0:t.call(e).height)||0);if(w>0){const s=Math.min(w,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const h=Math.ceil(s)-r;h!==0&&i<window.scrollY&&window.scrollBy(0,h);return}const v=Number.parseFloat(e.style.height);if(!Number.isNaN(v)&&v>0){const s=Math.ceil(Math.min(v,a));e.style.height=`${s}px`;const h=s-r;h!==0&&i<window.scrollY&&window.scrollBy(0,h)}else{const s=Math.ceil(a);e.style.height=`${s}px`;const h=s-r;h!==0&&i<window.scrollY&&window.scrollBy(0,h)}e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto"}catch(e){}}function Pe(){var n,i;const t=(i=(n=l.monacoOptions)==null?void 0:n.MAX_HEIGHT)!=null?i:500;if(typeof t=="number")return t;const e=String(t).match(/^(\d+(?:\.\d+)?)/);return e?Number.parseFloat(e[1]):500}const de=o.computed(()=>{const t=f.value.trim().toLowerCase();return l.isShowPreview&&(t==="html"||t==="svg")}),Y=o.computed(()=>f.value.trim().toLowerCase()==="mermaid");o.watch(()=>l.node.language,t=>{f.value=t}),o.watch(()=>l.node.code,t=>L(null,null,function*(){var e,n;if(l.stream!==!1){if(f.value||(f.value=se(t)),O&&!j.value&&y.value)try{yield le(y.value)}catch(i){}B.value?_(String((e=l.node.originalCode)!=null?e:""),String((n=l.node.updatedCode)!=null?n:""),f.value):Z(t,f.value),p.value&&E.safeRaf(()=>P())}}));const ze=o.computed(()=>{const t=f.value.trim().toLowerCase();return E.languageMap[t]||t.charAt(0).toUpperCase()+t.slice(1)}),$e=o.computed(()=>{const t=f.value.trim().toLowerCase();return E.getLanguageIcon(t.split(":")[0])}),Re=o.computed(()=>{const t={},e=r=>{if(r!=null)return typeof r=="number"?`${r}px`:String(r)},n=e(l.minWidth),i=e(l.maxWidth);return n&&(t.minWidth=n),i&&(t.maxWidth=i),t});function Ie(){return L(this,null,function*(){try{typeof navigator!="undefined"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(l.node.code)),F.value=!0,A("copy",l.node.code),setTimeout(()=>{F.value=!1},1e3)}catch(t){console.error("复制失败:",t)}})}function me(t){const e=t;return!e||e.disabled}function N(t,e,n="top"){if(me(t.currentTarget))return;const i=t,r=(i==null?void 0:i.clientX)!=null&&(i==null?void 0:i.clientY)!=null?{x:i.clientX,y:i.clientY}:void 0;E.showTooltipForAnchor(t.currentTarget,e,n,!1,r,l.isDark)}function b(){E.hideTooltip()}function fe(t){if(me(t.currentTarget))return;const e=F.value?u("common.copied")||"Copied":u("common.copy")||"Copy",n=t,i=(n==null?void 0:n.clientX)!=null&&(n==null?void 0:n.clientY)!=null?{x:n.clientX,y:n.clientY}:void 0;E.showTooltipForAnchor(t.currentTarget,e,"top",!1,i,l.isDark)}function Ye(){p.value=!p.value;const t=B.value?S():T(),e=y.value;!t||!e||(p.value?(U(!0),e.style.maxHeight="none",e.style.overflow="visible",P()):(U(!1),e.style.overflow="auto",z()))}function Ae(){var t,e,n;if(x.value=!x.value,x.value){if(y.value){const i=Math.ceil(((e=(t=y.value).getBoundingClientRect)==null?void 0:e.call(t).height)||0);i>0&&(D.value=i)}U(!1)}else{p.value&&U(!0),y.value&&D.value!=null&&(y.value.style.height=`${D.value}px`);const i=B.value?S():T();try{(n=i==null?void 0:i.layout)==null||n.call(i)}catch(r){}Q=2,E.safeRaf(()=>{p.value?P():z()})}}o.watch(()=>c.value,(t,e)=>{const n=B.value?S():T();n&&typeof t=="number"&&Number.isFinite(t)&&t>0&&(n.updateOptions({fontSize:t}),p.value&&!x.value&&P())},{flush:"post",immediate:!1});function je(){if(!de.value)return;const t=(f.value||l.node.language).toLowerCase(),e=t==="html"?"text/html":"image/svg+xml",n=t==="html"?u("artifacts.htmlPreviewTitle")||"HTML Preview":u("artifacts.svgPreviewTitle")||"SVG Preview";A("previewCode",{node:l.node,artifactType:e,artifactTitle:n,id:`temp-${t}-${Date.now()}`})}function U(t){var e,n;try{if(B.value){const i=S();(e=i==null?void 0:i.updateOptions)==null||e.call(i,{automaticLayout:t})}else{const i=T();(n=i==null?void 0:i.updateOptions)==null||n.call(i,{automaticLayout:t})}}catch(i){}}function qe(t){return L(this,null,function*(){var n,i,r;if(!O)return;B.value?(ee(),q?yield q(t,String((n=l.node.originalCode)!=null?n:""),String((i=l.node.updatedCode)!=null?i:""),f.value):yield O(t,l.node.code,f.value)):yield O(t,l.node.code,f.value);const e=B.value?S():T();if(typeof((r=l.monacoOptions)==null?void 0:r.fontSize)=="number")e==null||e.updateOptions({fontSize:l.monacoOptions.fontSize,automaticLayout:!1}),M.value=l.monacoOptions.fontSize,c.value=l.monacoOptions.fontSize;else{const a=ue();a&&a>0?(M.value=a,c.value=a):(M.value=12,c.value=12)}!p.value&&!x.value&&z(),l.loading===!1&&(yield o.nextTick(),E.safeRaf(()=>{p.value&&!x.value?P():x.value||z()}))})}function le(t){return O?I||(j.value=!0,I=L(null,null,function*(){yield qe(t)}).finally(()=>{I=null}),I):null}const ve=o.watch(()=>[y.value,Y.value,B.value,l.stream,l.loading,ae.value,H.value],w=>L(null,[w],function*([t,e,n,i,r,a,g]){if(!t||!O||!g||i===!1&&r!==!1)return;if(Y.value){X(),ve();return}const v=le(t);v&&(yield v,ve())})),We=o.watch(()=>[l.darkTheme,l.lightTheme,j.value,H.value],()=>{if(!(!j.value||!H.value)){if(Y.value)return We();Xe()}});function he(){return l.isDark?l.darkTheme:l.lightTheme}function Xe(){const t=he();t&&te(t)}const Ue=o.watch(()=>[l.monacoOptions,H.value],()=>{var n,i;if(!O||!H.value)return;if(Y.value)return Ue();const t=B.value?S():T(),e=typeof((n=l.monacoOptions)==null?void 0:n.fontSize)=="number"?l.monacoOptions.fontSize:Number.isFinite(c.value)?c.value:void 0;typeof e=="number"&&Number.isFinite(e)&&e>0&&((i=t==null?void 0:t.updateOptions)==null||i.call(t,{fontSize:e})),p.value&&!x.value?P():x.value||z()},{deep:!0}),G=o.watch(()=>[l.loading,H.value],n=>L(null,[n],function*([t,e]){if(e){if(Y.value){o.nextTick(()=>{G==null||G()});return}t||(yield o.nextTick(),E.safeRaf(()=>{x.value||(p.value?P():z()),G()}))}}),{immediate:!0,flush:"post"});return o.onUnmounted(()=>{X()}),(t,e)=>oe.value?(o.openBlock(),o.createBlock(o.unref(E._sfc_main),{key:0,node:m.node,loading:l.loading},null,8,["node","loading"])):(o.openBlock(),o.createElementBlock("div",{key:1,ref_key:"container",ref:$,style:o.normalizeStyle(Re.value),class:o.normalizeClass(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":l.loading,"is-dark":l.isDark}]])},[l.showHeader?(o.openBlock(),o.createElementBlock("div",rt,[o.renderSlot(t.$slots,"header-left",{},()=>[o.createElementVNode("div",at,[o.createElementVNode("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:$e.value},null,8,st),o.createElementVNode("span",ut,o.toDisplayString(ze.value),1)])],!0),o.renderSlot(t.$slots,"header-right",{},()=>[o.createElementVNode("div",ct,[o.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":x.value,onClick:Ae,onMouseenter:e[0]||(e[0]=n=>N(n,x.value?o.unref(u)("common.expand")||"Expand":o.unref(u)("common.collapse")||"Collapse")),onFocus:e[1]||(e[1]=n=>N(n,x.value?o.unref(u)("common.expand")||"Expand":o.unref(u)("common.collapse")||"Collapse")),onMouseleave:b,onBlur:b},[(o.openBlock(),o.createElementBlock("svg",{style:o.normalizeStyle({rotate:x.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"},[...e[17]||(e[17]=[o.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,dt),l.showFontSizeButtons&&l.enableFontSizeControl?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.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(c.value)?c.value<=Ee:!1,onClick:e[2]||(e[2]=n=>Oe()),onMouseenter:e[3]||(e[3]=n=>N(n,o.unref(u)("common.decrease")||"Decrease")),onFocus:e[4]||(e[4]=n=>N(n,o.unref(u)("common.decrease")||"Decrease")),onMouseleave:b,onBlur:b},[...e[18]||(e[18]=[o.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"},[o.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,mt),o.createElementVNode("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!Fe.value||c.value===M.value,onClick:e[5]||(e[5]=n=>Le()),onMouseenter:e[6]||(e[6]=n=>N(n,o.unref(u)("common.reset")||"Reset")),onFocus:e[7]||(e[7]=n=>N(n,o.unref(u)("common.reset")||"Reset")),onMouseleave:b,onBlur:b},[...e[19]||(e[19]=[o.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"},[o.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o.createElementVNode("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),o.createElementVNode("path",{d:"M3 3v5h5"})])],-1)])],40,ft),o.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(c.value)?c.value>=Be:!1,onClick:e[8]||(e[8]=n=>He()),onMouseenter:e[9]||(e[9]=n=>N(n,o.unref(u)("common.increase")||"Increase")),onFocus:e[10]||(e[10]=n=>N(n,o.unref(u)("common.increase")||"Increase")),onMouseleave:b,onBlur:b},[...e[20]||(e[20]=[o.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"},[o.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,vt)],64)):o.createCommentVNode("",!0),l.showCopyButton?(o.openBlock(),o.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":F.value?o.unref(u)("common.copied")||"Copied":o.unref(u)("common.copy")||"Copy",onClick:Ie,onMouseenter:e[11]||(e[11]=n=>fe(n)),onFocus:e[12]||(e[12]=n=>fe(n)),onMouseleave:b,onBlur:b},[F.value?(o.openBlock(),o.createElementBlock("svg",pt,[...e[22]||(e[22]=[o.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(o.openBlock(),o.createElementBlock("svg",gt,[...e[21]||(e[21]=[o.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),o.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,ht)):o.createCommentVNode("",!0),l.showExpandButton?(o.openBlock(),o.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":p.value,onClick:Ye,onMouseenter:e[13]||(e[13]=n=>N(n,p.value?o.unref(u)("common.collapse")||"Collapse":o.unref(u)("common.expand")||"Expand")),onFocus:e[14]||(e[14]=n=>N(n,p.value?o.unref(u)("common.collapse")||"Collapse":o.unref(u)("common.expand")||"Expand")),onMouseleave:b,onBlur:b},[p.value?(o.openBlock(),o.createElementBlock("svg",yt,[...e[23]||(e[23]=[o.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)])])):(o.openBlock(),o.createElementBlock("svg",kt,[...e[24]||(e[24]=[o.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,wt)):o.createCommentVNode("",!0),de.value&&l.showPreviewButton?(o.openBlock(),o.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":o.unref(u)("common.preview")||"Preview",onClick:je,onMouseenter:e[15]||(e[15]=n=>N(n,o.unref(u)("common.preview")||"Preview")),onFocus:e[16]||(e[16]=n=>N(n,o.unref(u)("common.preview")||"Preview")),onMouseleave:b,onBlur:b},[...e[25]||(e[25]=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"},[o.createElementVNode("g",{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"},[o.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"}),o.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,xt)):o.createCommentVNode("",!0)])],!0)])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{ref_key:"codeEditor",ref:y,class:o.normalizeClass(["code-editor-container",[m.stream?"":"code-height-placeholder"]])},null,2),[[o.vShow,!x.value&&(m.stream?!0:!m.loading)]]),o.withDirectives(o.createElementVNode("div",bt,[o.renderSlot(t.$slots,"loading",{loading:m.loading,stream:m.stream},()=>[e[26]||(e[26]=o.createElementVNode("div",{class:"loading-skeleton"},[o.createElementVNode("div",{class:"skeleton-line"}),o.createElementVNode("div",{class:"skeleton-line"}),o.createElementVNode("div",{class:"skeleton-line short"})],-1))],!0)],512),[[o.vShow,!m.stream&&m.loading]]),o.createElementVNode("span",Ct,o.toDisplayString(F.value?o.unref(u)("common.copied")||"Copied":""),1)],6))}}),K=E._export_sfc(Et,[["__scopeId","data-v-c3ca09d1"]]);K.install=m=>{m.component(K.__name,K)};exports.default=K;
|
package/dist/index-ELonlW3Z.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
var v = (i, o, r) => new Promise((d, a) => {
|
|
2
|
-
var s = (e) => {
|
|
3
|
-
try {
|
|
4
|
-
l(r.next(e));
|
|
5
|
-
} catch (m) {
|
|
6
|
-
a(m);
|
|
7
|
-
}
|
|
8
|
-
}, f = (e) => {
|
|
9
|
-
try {
|
|
10
|
-
l(r.throw(e));
|
|
11
|
-
} catch (m) {
|
|
12
|
-
a(m);
|
|
13
|
-
}
|
|
14
|
-
}, l = (e) => e.done ? d(e.value) : Promise.resolve(e.value).then(s, f);
|
|
15
|
-
l((r = r.apply(i, o)).next());
|
|
16
|
-
});
|
|
17
|
-
import { defineComponent as x, ref as k, watch as B, onMounted as C, onBeforeUnmount as O, createElementBlock as T, openBlock as g, createVNode as y, createElementVNode as w, Transition as I, withCtx as M, createCommentVNode as W, normalizeClass as K } from "vue";
|
|
18
|
-
import { a as N, r as V, e as b, f as U, W as L, d as A } from "./exports-BreegGo9.js";
|
|
19
|
-
const F = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "math-loading-overlay"
|
|
22
|
-
}, S = /* @__PURE__ */ x({
|
|
23
|
-
__name: "MathBlockNode",
|
|
24
|
-
props: {
|
|
25
|
-
node: {}
|
|
26
|
-
},
|
|
27
|
-
setup(i) {
|
|
28
|
-
const o = i;
|
|
29
|
-
let r = null;
|
|
30
|
-
const d = k(null), a = k(null);
|
|
31
|
-
let s = !1, f = 0, l = !1, e = null;
|
|
32
|
-
const m = N();
|
|
33
|
-
let n = null;
|
|
34
|
-
const u = k(!0);
|
|
35
|
-
function R() {
|
|
36
|
-
return v(this, null, function* () {
|
|
37
|
-
if (!o.node.content || !a.value || l)
|
|
38
|
-
return;
|
|
39
|
-
if (!s)
|
|
40
|
-
try {
|
|
41
|
-
!n && d.value && (n = m(d.value)), yield n == null ? void 0 : n.whenVisible;
|
|
42
|
-
} catch (t) {
|
|
43
|
-
}
|
|
44
|
-
e && (e.abort(), e = null);
|
|
45
|
-
const c = ++f, h = new AbortController();
|
|
46
|
-
e = h, V(o.node.content, !0, {
|
|
47
|
-
timeout: 3e3,
|
|
48
|
-
waitTimeout: 2e3,
|
|
49
|
-
maxRetries: 1,
|
|
50
|
-
signal: h.signal
|
|
51
|
-
}).then((t) => {
|
|
52
|
-
l || c !== f || a.value && (a.value.innerHTML = t, s = !0, u.value = !1);
|
|
53
|
-
}).catch((t) => v(null, null, function* () {
|
|
54
|
-
if (l || c !== f || !a.value)
|
|
55
|
-
return;
|
|
56
|
-
const _ = (t == null ? void 0 : t.code) || (t == null ? void 0 : t.name);
|
|
57
|
-
if ((_ === "WORKER_INIT_ERROR" || (t == null ? void 0 : t.fallbackToRenderer) || (_ === L || _ === "WORKER_TIMEOUT")) && (r || (r = yield b()), r)) {
|
|
58
|
-
try {
|
|
59
|
-
const p = r.renderToString(o.node.content, {
|
|
60
|
-
throwOnError: o.node.loading,
|
|
61
|
-
displayMode: !0
|
|
62
|
-
});
|
|
63
|
-
a.value.innerHTML = p, s = !0, u.value = !1, U(o.node.content, !0, p);
|
|
64
|
-
} catch (p) {
|
|
65
|
-
}
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
s || (u.value = !0), o.node.loading || (u.value = !1, a.value.textContent = o.node.raw);
|
|
69
|
-
}));
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return B(
|
|
73
|
-
() => o.node.content,
|
|
74
|
-
() => {
|
|
75
|
-
R();
|
|
76
|
-
}
|
|
77
|
-
), C(() => {
|
|
78
|
-
R();
|
|
79
|
-
}), O(() => {
|
|
80
|
-
var c;
|
|
81
|
-
l = !0, e && (e.abort(), e = null), (c = n == null ? void 0 : n.destroy) == null || c.call(n), n = null;
|
|
82
|
-
}), (c, h) => (g(), T("div", {
|
|
83
|
-
ref_key: "containerEl",
|
|
84
|
-
ref: d,
|
|
85
|
-
class: "math-block text-center overflow-x-auto relative min-h-[40px]"
|
|
86
|
-
}, [
|
|
87
|
-
y(I, { name: "math-fade" }, {
|
|
88
|
-
default: M(() => [
|
|
89
|
-
u.value ? (g(), T("div", F, [...h[0] || (h[0] = [
|
|
90
|
-
w("div", { class: "math-loading-spinner" }, null, -1)
|
|
91
|
-
])])) : W("", !0)
|
|
92
|
-
]),
|
|
93
|
-
_: 1
|
|
94
|
-
}),
|
|
95
|
-
w("div", {
|
|
96
|
-
ref_key: "mathBlockElement",
|
|
97
|
-
ref: a,
|
|
98
|
-
class: K({ "math-rendering": u.value })
|
|
99
|
-
}, null, 2)
|
|
100
|
-
], 512));
|
|
101
|
-
}
|
|
102
|
-
}), E = /* @__PURE__ */ A(S, [["__scopeId", "data-v-2e076ab9"]]);
|
|
103
|
-
E.install = (i) => {
|
|
104
|
-
i.component(E.__name, E);
|
|
105
|
-
};
|
|
106
|
-
export {
|
|
107
|
-
E as default
|
|
108
|
-
};
|