markstream-vue 0.0.2-beta.8 → 0.0.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,4719 +0,0 @@
1
- var $o = Object.defineProperty, To = Object.defineProperties;
2
- var Io = Object.getOwnPropertyDescriptors;
3
- var Un = Object.getOwnPropertySymbols;
4
- var _o = Object.prototype.hasOwnProperty, So = Object.prototype.propertyIsEnumerable;
5
- var Zn = (e, n, t) => n in e ? $o(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, ie = (e, n) => {
6
- for (var t in n || (n = {}))
7
- _o.call(n, t) && Zn(e, t, n[t]);
8
- if (Un)
9
- for (var t of Un(n))
10
- So.call(n, t) && Zn(e, t, n[t]);
11
- return e;
12
- }, dt = (e, n) => To(e, Io(n));
13
- var j = (e, n, t) => new Promise((l, r) => {
14
- var a = (h) => {
15
- try {
16
- w(t.next(h));
17
- } catch (c) {
18
- r(c);
19
- }
20
- }, i = (h) => {
21
- try {
22
- w(t.throw(h));
23
- } catch (c) {
24
- r(c);
25
- }
26
- }, w = (h) => h.done ? l(h.value) : Promise.resolve(h.value).then(a, i);
27
- w((t = t.apply(e, n)).next());
28
- });
29
- import { getMarkdown as Eo, parseMarkdownToStructure as Lo, setDefaultMathOptions as No } from "stream-markdown-parser";
30
- import { defineComponent as V, createElementBlock as g, openBlock as d, withMemo as zt, createVNode as Ue, unref as $, createElementVNode as m, Fragment as re, renderList as pe, toDisplayString as ee, computed as L, ref as M, watch as U, nextTick as de, onBeforeUnmount as mn, createBlock as me, Teleport as mo, Transition as hn, withCtx as Tt, withDirectives as an, normalizeClass as A, normalizeStyle as ze, vShow as sn, createApp as Ho, h as Tn, inject as Ro, provide as jo, createCommentVNode as se, renderSlot as et, shallowRef as ho, readonly as zo, defineAsyncComponent as Dt, resolveDynamicComponent as He, useAttrs as Do, mergeProps as jt, isMemoSame as fo, onMounted as vo, onUnmounted as Ao, withModifiers as Po, createTextVNode as Gn, markRaw as Jn, reactive as bn } from "vue";
31
- import { autoUpdate as Qn, offset as Vo, flip as Wo, shift as Ko, computePosition as Oo } from "@floating-ui/dom";
32
- const Fo = ["cite"], Xo = /* @__PURE__ */ V({
33
- __name: "BlockquoteNode",
34
- props: {
35
- node: {},
36
- indexKey: {},
37
- typewriter: { type: Boolean }
38
- },
39
- emits: ["copy"],
40
- setup(e) {
41
- return (n, t) => (d(), g("blockquote", {
42
- class: "blockquote",
43
- dir: "auto",
44
- cite: e.node.cite
45
- }, [
46
- zt([e.node.children], () => Ue($(qe), {
47
- "index-key": `blockquote-${e.indexKey}`,
48
- nodes: e.node.children || [],
49
- typewriter: e.typewriter,
50
- onCopy: t[0] || (t[0] = (l) => n.$emit("copy", l))
51
- }, null, 8, ["index-key", "nodes", "typewriter"]), t, 1)
52
- ], 8, Fo));
53
- }
54
- }), X = (e, n) => {
55
- const t = e.__vccOpts || e;
56
- for (const [l, r] of n)
57
- t[l] = r;
58
- return t;
59
- }, Ut = /* @__PURE__ */ X(Xo, [["__scopeId", "data-v-adfdba00"]]);
60
- Ut.install = (e) => {
61
- e.component(Ut.__name, Ut);
62
- };
63
- const Yo = { class: "checkbox-node" }, qo = ["checked"], Uo = /* @__PURE__ */ V({
64
- __name: "CheckboxNode",
65
- props: {
66
- node: {}
67
- },
68
- setup(e) {
69
- return (n, t) => (d(), g("span", Yo, [
70
- m("input", {
71
- type: "checkbox",
72
- checked: e.node.checked,
73
- disabled: "",
74
- class: "checkbox-input"
75
- }, null, 8, qo)
76
- ]));
77
- }
78
- }), tt = /* @__PURE__ */ X(Uo, [["__scopeId", "data-v-8dc6c46f"]]);
79
- tt.install = (e) => {
80
- e.component(tt.__name, tt);
81
- };
82
- const Zo = { class: "definition-list" }, Go = { class: "definition-term" }, Jo = { class: "definition-desc" }, Qo = /* @__PURE__ */ V({
83
- __name: "DefinitionListNode",
84
- props: {
85
- node: {},
86
- indexKey: {},
87
- typewriter: { type: Boolean }
88
- },
89
- emits: ["copy"],
90
- setup(e) {
91
- return (n, t) => (d(), g("dl", Zo, [
92
- (d(!0), g(re, null, pe(e.node.items, (l, r) => (d(), g(re, { key: r }, [
93
- m("dt", Go, [
94
- Ue($(qe), {
95
- "index-key": `definition-term-${e.indexKey}-${r}`,
96
- nodes: l.term,
97
- typewriter: e.typewriter,
98
- onCopy: t[0] || (t[0] = (a) => n.$emit("copy", a))
99
- }, null, 8, ["index-key", "nodes", "typewriter"])
100
- ]),
101
- m("dd", Jo, [
102
- Ue($(qe), {
103
- "index-key": `definition-desc-${e.indexKey}-${r}`,
104
- nodes: l.definition,
105
- typewriter: e.typewriter,
106
- onCopy: t[1] || (t[1] = (a) => n.$emit("copy", a))
107
- }, null, 8, ["index-key", "nodes", "typewriter"])
108
- ])
109
- ], 64))), 128))
110
- ]));
111
- }
112
- }), Zt = /* @__PURE__ */ X(Qo, [["__scopeId", "data-v-5a21f288"]]);
113
- Zt.install = (e) => {
114
- e.component(Zt.__name, Zt);
115
- };
116
- const er = { class: "emoji-node" }, tr = /* @__PURE__ */ V({
117
- __name: "EmojiNode",
118
- props: {
119
- node: {}
120
- },
121
- setup(e) {
122
- return (n, t) => (d(), g("span", er, ee(e.node.name), 1));
123
- }
124
- }), Te = /* @__PURE__ */ X(tr, [["__scopeId", "data-v-de55dc97"]]);
125
- Te.install = (e) => {
126
- e.component(Te.__name, Te);
127
- };
128
- const ln = "__global__", Ct = {};
129
- function As(e, n) {
130
- typeof e == "string" ? Ct[e] = n || {} : Ct[ln] = e || {};
131
- }
132
- function Ze(e) {
133
- return e ? Ct[e] || Ct[ln] || {} : Ct[ln] || {};
134
- }
135
- function Ps(e) {
136
- if (e === ln)
137
- throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");
138
- delete Ct[e];
139
- }
140
- function Vs() {
141
- delete Ct[ln];
142
- }
143
- const nr = ["id"], or = ["title"], rr = /* @__PURE__ */ V({
144
- __name: "FootnoteReferenceNode",
145
- props: {
146
- node: {}
147
- },
148
- setup(e) {
149
- const t = `#footnote-${e.node.id}`;
150
- function l() {
151
- if (typeof document == "undefined")
152
- return;
153
- const r = document.querySelector(t);
154
- r ? r.scrollIntoView({ behavior: "smooth" }) : console.warn(`Element with href: ${t} not found`);
155
- }
156
- return (r, a) => (d(), g("sup", {
157
- id: `fnref-${e.node.id}`,
158
- class: "footnote-reference",
159
- onClick: l
160
- }, [
161
- m("span", {
162
- href: t,
163
- title: `查看脚注 ${e.node.id}`,
164
- class: "footnote-link cursor-pointer"
165
- }, "[" + ee(e.node.id) + "]", 9, or)
166
- ], 8, nr));
167
- }
168
- }), Ie = /* @__PURE__ */ X(rr, [["__scopeId", "data-v-01af0fee"]]);
169
- Ie.install = (e) => {
170
- e.component(Ie.__name, Ie);
171
- };
172
- const ar = { class: "inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']" }, _e = /* @__PURE__ */ V({
173
- __name: "InlineCodeNode",
174
- props: {
175
- node: {}
176
- },
177
- setup(e) {
178
- return (n, t) => (d(), g("code", ar, ee(e.node.code), 1));
179
- }
180
- });
181
- _e.install = (e) => {
182
- e.component(_e.__name, _e);
183
- };
184
- const ir = ["id"], sr = /* @__PURE__ */ V({
185
- __name: "Tooltip",
186
- props: {
187
- visible: { type: Boolean },
188
- anchorEl: {},
189
- content: {},
190
- placement: {},
191
- offset: {},
192
- originX: {},
193
- originY: {},
194
- id: {},
195
- isDark: { type: [Boolean, null] }
196
- },
197
- setup(e) {
198
- const n = e, t = L(() => {
199
- if (n.isDark !== void 0 && n.isDark !== null)
200
- return !!n.isDark;
201
- if (typeof document != "undefined")
202
- try {
203
- if (document.documentElement.classList.contains("dark") || window != null && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches)
204
- return !0;
205
- } catch (h) {
206
- }
207
- return !1;
208
- }), l = M(null), r = M({ transform: "translate3d(0px, 0px, 0px)", left: "0px", top: "0px" }), a = M(!1);
209
- let i = null;
210
- function w() {
211
- return j(this, null, function* () {
212
- var v, B;
213
- if (!n.anchorEl || !l.value)
214
- return;
215
- const h = [Vo((v = n.offset) != null ? v : 8), Wo(), Ko({ padding: 8 })], { x: c, y: k } = yield Oo(n.anchorEl, l.value, {
216
- placement: (B = n.placement) != null ? B : "top",
217
- middleware: h,
218
- strategy: "fixed"
219
- });
220
- r.value.transform = `translate3d(${Math.round(c)}px, ${Math.round(k)}px, 0)`, r.value.left = "0px", r.value.top = "0px";
221
- });
222
- }
223
- return U(
224
- () => n.visible,
225
- (h) => j(null, null, function* () {
226
- if (h)
227
- if (a.value = !1, yield de(), n.anchorEl && l.value)
228
- try {
229
- const c = n.anchorEl.getBoundingClientRect();
230
- yield w();
231
- const k = r.value.transform;
232
- if (n.originX != null && n.originY != null) {
233
- const v = Math.abs(Number(n.originX) - c.left), B = Math.abs(Number(n.originY) - c.top);
234
- Math.hypot(v, B) > 120 ? (r.value.transform = `translate3d(${Math.round(n.originX)}px, ${Math.round(n.originY)}px, 0)`, yield de(), a.value = !0, yield de(), r.value.transform = k) : a.value = !0;
235
- } else
236
- a.value = !0;
237
- i = Qn(n.anchorEl, l.value, w);
238
- } catch (c) {
239
- yield w(), a.value = !0, i = Qn(n.anchorEl, l.value, w);
240
- }
241
- else
242
- a.value = !0;
243
- else
244
- a.value = !1, i && (i(), i = null);
245
- })
246
- ), U([
247
- () => n.anchorEl,
248
- () => n.placement,
249
- () => n.content
250
- ], () => j(null, null, function* () {
251
- n.visible && n.anchorEl && l.value && (yield de(), yield w());
252
- })), mn(() => {
253
- i && i();
254
- }), (h, c) => (d(), me(mo, { to: "body" }, [
255
- Ue(hn, {
256
- name: "tooltip",
257
- appear: ""
258
- }, {
259
- default: Tt(() => [
260
- an(m("div", {
261
- id: n.id,
262
- ref_key: "tooltip",
263
- ref: l,
264
- style: ze({ position: "fixed", left: r.value.left, top: r.value.top, transform: r.value.transform }),
265
- class: A(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border", [t.value ? "bg-gray-900 text-white border-gray-700 border is-dark" : "bg-white text-gray-900 border-gray-200 border"]]),
266
- role: "tooltip"
267
- }, ee(e.content), 15, ir), [
268
- [sn, e.visible && a.value]
269
- ])
270
- ]),
271
- _: 1
272
- })
273
- ]));
274
- }
275
- }), lr = /* @__PURE__ */ X(sr, [["__scopeId", "data-v-993f63aa"]]), An = M(!1), go = M(""), po = M("top"), Gt = M(null), cn = M(null), Pn = M(null), Vn = M(null), wo = M(null);
276
- let Cn = null, Bn = null;
277
- function ko() {
278
- Cn && (clearTimeout(Cn), Cn = null), Bn && (clearTimeout(Bn), Bn = null);
279
- }
280
- let eo = !1;
281
- function cr() {
282
- if (eo || typeof document == "undefined")
283
- return;
284
- eo = !0;
285
- const e = document.createElement("div");
286
- e.setAttribute("data-singleton-tooltip", "1"), document.body.appendChild(e), Ho({
287
- setup() {
288
- return () => {
289
- var t;
290
- return Tn(lr, {
291
- visible: An.value,
292
- "anchor-el": Gt.value,
293
- content: go.value,
294
- placement: po.value,
295
- id: cn.value,
296
- originX: Pn.value,
297
- originY: Vn.value,
298
- isDark: (t = wo.value) != null ? t : void 0
299
- });
300
- };
301
- }
302
- }).mount(e);
303
- }
304
- function un(e, n, t = "top", l = !1, r, a) {
305
- if (!e)
306
- return;
307
- cr(), ko();
308
- const i = () => {
309
- var w, h;
310
- cn.value = `tooltip-${Date.now()}-${Math.floor(Math.random() * 1e3)}`, Gt.value = e, go.value = n, po.value = t, Pn.value = (w = r == null ? void 0 : r.x) != null ? w : null, Vn.value = (h = r == null ? void 0 : r.y) != null ? h : null, wo.value = typeof a == "boolean" ? a : null, An.value = !0;
311
- try {
312
- e.setAttribute("aria-describedby", cn.value);
313
- } catch (c) {
314
- }
315
- };
316
- l ? i() : Cn = setTimeout(i, 80);
317
- }
318
- function Wn(e = !1) {
319
- ko();
320
- const n = () => {
321
- if (Gt.value && cn.value)
322
- try {
323
- Gt.value.removeAttribute("aria-describedby");
324
- } catch (t) {
325
- }
326
- An.value = !1, Gt.value = null, cn.value = null, Pn.value = null, Vn.value = null;
327
- };
328
- e ? n() : Bn = setTimeout(n, 120);
329
- }
330
- function ur(e) {
331
- return (e.split(".").pop() || e).replace(/[_-]/g, " ").replace(/([A-Z])/g, " $1").replace(/\s+/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()).trim();
332
- }
333
- const yo = {
334
- "common.copy": "Copy",
335
- "common.copySuccess": "Copied",
336
- "common.decrease": "Decrease",
337
- "common.reset": "Reset",
338
- "common.increase": "Increase",
339
- "common.expand": "Expand",
340
- "common.collapse": "Collapse",
341
- "common.preview": "Preview",
342
- "common.source": "Source",
343
- "common.export": "Export",
344
- "common.open": "Open",
345
- "common.zoomIn": "Zoom in",
346
- "common.zoomOut": "Zoom out",
347
- "common.resetZoom": "Reset zoom",
348
- "image.loadError": "Image failed to load",
349
- "image.loading": "Loading image..."
350
- };
351
- function Ws(e) {
352
- Object.assign(yo, e);
353
- }
354
- function Kn() {
355
- try {
356
- const n = globalThis.$vueI18nUse || null;
357
- if (n && typeof n == "function")
358
- try {
359
- const t = n();
360
- if (t && typeof t.t == "function")
361
- return { t: t.t.bind(t) };
362
- } catch (t) {
363
- }
364
- } catch (n) {
365
- }
366
- const e = (n) => {
367
- var t;
368
- return (t = yo[n]) != null ? t : ur(n);
369
- };
370
- return j(null, null, function* () {
371
- try {
372
- const n = yield import("vue-i18n"), t = n.useI18n || n.default && n.default.useI18n;
373
- if (t && typeof t == "function")
374
- try {
375
- const l = t();
376
- if (l && typeof l.t == "function")
377
- try {
378
- globalThis.$vueI18nUse = () => l;
379
- } catch (r) {
380
- }
381
- } catch (l) {
382
- }
383
- } catch (n) {
384
- }
385
- }), { t: e };
386
- }
387
- const xo = Symbol("ViewportPriority");
388
- function dr(e, n) {
389
- const t = typeof window != "undefined" && typeof document != "undefined", l = typeof n == "boolean" ? M(n) : n;
390
- let r = null;
391
- const a = /* @__PURE__ */ new WeakMap();
392
- function i() {
393
- var c;
394
- if (r || !t)
395
- return r;
396
- if (typeof IntersectionObserver == "undefined")
397
- return null;
398
- const h = (c = e()) != null ? c : null;
399
- return r = new IntersectionObserver((k) => {
400
- for (const v of k) {
401
- const B = a.get(v.target);
402
- if (!B)
403
- continue;
404
- if (v.isIntersecting || v.intersectionRatio > 0) {
405
- if (!B.visible.value) {
406
- B.visible.value = !0;
407
- try {
408
- B.resolve();
409
- } catch (O) {
410
- }
411
- }
412
- r == null || r.unobserve(v.target), a.delete(v.target);
413
- }
414
- }
415
- }, {
416
- root: h,
417
- rootMargin: "300px",
418
- // prefetch slightly before entering viewport
419
- threshold: 0
420
- }), r;
421
- }
422
- const w = (h, c) => {
423
- const k = M(!1);
424
- let v = !1, B;
425
- const I = new Promise((K) => {
426
- B = () => {
427
- v || (v = !0, K());
428
- };
429
- }), O = () => {
430
- try {
431
- r == null || r.unobserve(h);
432
- } catch (K) {
433
- }
434
- a.delete(h);
435
- };
436
- if (!t || !l.value)
437
- return k.value = !0, B(), { isVisible: k, whenVisible: I, destroy: O };
438
- const D = i();
439
- return D ? (a.set(h, { resolve: B, visible: k }), D.observe(h), { isVisible: k, whenVisible: I, destroy: O }) : (k.value = !0, B(), { isVisible: k, whenVisible: I, destroy: O });
440
- };
441
- return jo(xo, w), w;
442
- }
443
- function On() {
444
- const e = Ro(xo, void 0);
445
- if (e)
446
- return e;
447
- const n = /* @__PURE__ */ new WeakMap();
448
- let t = null;
449
- const l = () => t || (typeof window == "undefined" || typeof IntersectionObserver == "undefined" ? null : (t = new IntersectionObserver((a) => {
450
- for (const i of a) {
451
- const w = n.get(i.target);
452
- if (!w)
453
- continue;
454
- if (i.isIntersecting || i.intersectionRatio > 0) {
455
- if (!w.visible.value) {
456
- w.visible.value = !0;
457
- try {
458
- w.resolve();
459
- } catch (c) {
460
- }
461
- }
462
- t == null || t.unobserve(i.target), n.delete(i.target);
463
- }
464
- }
465
- }, { root: null, rootMargin: "300px", threshold: 0 }), t));
466
- return (a) => {
467
- const i = M(!1);
468
- let w = !1, h;
469
- const c = new Promise((B) => {
470
- h = () => {
471
- w || (w = !0, B());
472
- };
473
- }), k = () => {
474
- try {
475
- t == null || t.unobserve(a);
476
- } catch (B) {
477
- }
478
- n.delete(a);
479
- }, v = l();
480
- return v ? (n.set(a, { resolve: h, visible: i }), v.observe(a), { isVisible: i, whenVisible: c, destroy: k }) : (i.value = !0, h(), { isVisible: i, whenVisible: c, destroy: k });
481
- };
482
- }
483
- const mr = { class: "relative inline-block" }, hr = ["src", "alt", "title", "loading", "tabindex", "aria-label"], fr = { class: "text-sm whitespace-nowrap" }, vr = {
484
- key: 1,
485
- class: "text-sm text-gray-500"
486
- }, gr = {
487
- key: "error",
488
- class: "px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"
489
- }, pr = { class: "text-sm whitespace-nowrap" }, wr = {
490
- key: 0,
491
- class: "mt-2 text-sm text-gray-500 italic"
492
- }, kr = /* @__PURE__ */ V({
493
- __name: "ImageNode",
494
- props: {
495
- node: {},
496
- fallbackSrc: { default: "" },
497
- showCaption: { type: Boolean, default: !1 },
498
- lazy: { type: Boolean, default: !0 },
499
- svgMinHeight: { default: "12rem" },
500
- usePlaceholder: { type: Boolean, default: !0 }
501
- },
502
- emits: ["load", "error", "click"],
503
- setup(e, { emit: n }) {
504
- const t = e, l = n, r = M(!1), a = M(!1), i = M(!1), w = M(null), h = On(), c = M(null), k = M(typeof window == "undefined");
505
- typeof window != "undefined" && U(
506
- () => w.value,
507
- (N) => {
508
- var W;
509
- if ((W = c.value) == null || W.destroy(), c.value = null, !N) {
510
- k.value = !1;
511
- return;
512
- }
513
- const ke = h(N, { rootMargin: "400px" });
514
- c.value = ke, k.value = ke.isVisible.value, ke.whenVisible.then(() => {
515
- k.value = !0;
516
- });
517
- },
518
- { immediate: !0 }
519
- ), mn(() => {
520
- var N;
521
- (N = c.value) == null || N.destroy(), c.value = null;
522
- });
523
- const v = L(() => a.value && t.fallbackSrc ? t.fallbackSrc : t.node.src), B = L(() => !t.lazy || k.value), I = L(() => /\.svg(?:\?|$)/i.test(v.value));
524
- function O() {
525
- t.fallbackSrc && !i.value ? (i.value = !0, a.value = !0) : (a.value = !0, l("error", t.node.src));
526
- }
527
- function D() {
528
- r.value = !0, a.value = !1, l("load", v.value);
529
- }
530
- function K(N) {
531
- N.preventDefault(), !(!r.value || a.value) && l("click", [N, v.value]);
532
- }
533
- const { t: H } = Kn();
534
- return U(v, () => {
535
- r.value = !1, a.value = !1;
536
- }), (N, ke) => (d(), g("figure", {
537
- ref_key: "figureRef",
538
- ref: w,
539
- class: "text-center my-8"
540
- }, [
541
- m("div", mr, [
542
- Ue(hn, {
543
- name: "img-switch",
544
- mode: "out-in"
545
- }, {
546
- default: Tt(() => {
547
- var W, Z, S, le, te;
548
- return [
549
- !e.node.loading && !a.value && B.value ? (d(), g("img", {
550
- key: "image",
551
- src: v.value,
552
- alt: String((Z = (W = t.node.alt) != null ? W : t.node.title) != null ? Z : ""),
553
- title: String((le = (S = t.node.title) != null ? S : t.node.alt) != null ? le : ""),
554
- class: A(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out", { "opacity-0": !r.value, "opacity-100": r.value, "cursor-pointer": r.value }]),
555
- style: ze(I.value ? { minHeight: t.svgMinHeight, width: "100%", height: "auto", objectFit: "contain" } : void 0),
556
- loading: t.lazy ? "lazy" : "eager",
557
- decoding: "async",
558
- tabindex: r.value ? 0 : -1,
559
- "aria-label": (te = t.node.alt) != null ? te : $(H)("image.preview"),
560
- onError: O,
561
- onLoad: D,
562
- onClick: K
563
- }, null, 46, hr)) : a.value ? !e.node.loading && !t.fallbackSrc ? (d(), g("div", gr, [
564
- et(N.$slots, "error", {
565
- node: t.node,
566
- displaySrc: v.value,
567
- imageLoaded: r.value,
568
- hasError: a.value,
569
- fallbackSrc: t.fallbackSrc,
570
- lazy: t.lazy,
571
- isSvg: I.value
572
- }, () => [
573
- ke[1] || (ke[1] = m("svg", {
574
- xmlns: "http://www.w3.org/2000/svg",
575
- width: "16",
576
- height: "16",
577
- viewBox: "0 0 24 24"
578
- }, [
579
- m("path", {
580
- fill: "currentColor",
581
- 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"
582
- })
583
- ], -1)),
584
- m("span", pr, ee($(H)("image.loadError")), 1)
585
- ], !0)
586
- ])) : se("", !0) : (d(), g("div", {
587
- key: "placeholder",
588
- class: "placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",
589
- style: ze(I.value ? { minHeight: t.svgMinHeight, width: "100%" } : { minHeight: "6rem" })
590
- }, [
591
- t.usePlaceholder ? et(N.$slots, "placeholder", {
592
- key: 0,
593
- node: t.node,
594
- displaySrc: v.value,
595
- imageLoaded: r.value,
596
- hasError: a.value,
597
- fallbackSrc: t.fallbackSrc,
598
- lazy: t.lazy,
599
- isSvg: I.value
600
- }, () => [
601
- ke[0] || (ke[0] = m("div", {
602
- class: "w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin",
603
- "aria-hidden": "true"
604
- }, null, -1)),
605
- m("span", fr, ee($(H)("image.loading")), 1)
606
- ], !0) : (d(), g("span", vr, ee(e.node.raw), 1))
607
- ], 4))
608
- ];
609
- }),
610
- _: 3
611
- })
612
- ]),
613
- t.showCaption && t.node.alt ? (d(), g("figcaption", wr, ee(t.node.alt), 1)) : se("", !0)
614
- ], 512));
615
- }
616
- }), mt = /* @__PURE__ */ X(kr, [["__scopeId", "data-v-7ca79b66"]]);
617
- mt.install = (e) => {
618
- e.component(mt.__name, mt);
619
- };
620
- let Mn = null, to = !1;
621
- function Fn() {
622
- return j(this, null, function* () {
623
- if (Mn)
624
- return Mn;
625
- if (to)
626
- return null;
627
- try {
628
- return Mn = yield import("katex"), yield import("katex/contrib/mhchem"), Mn;
629
- } catch (e) {
630
- return to = !0, null;
631
- }
632
- });
633
- }
634
- const Rn = ho(!1);
635
- let no = null;
636
- function bo() {
637
- return no || (no = Fn().then((e) => {
638
- Rn.value = !!e;
639
- }).catch(() => {
640
- Rn.value = !1;
641
- })), zo(Rn);
642
- }
643
- const yr = /* @__PURE__ */ V({
644
- __name: "TextNode",
645
- props: {
646
- node: {}
647
- },
648
- emits: ["copy"],
649
- setup(e) {
650
- const n = bo();
651
- return (t, l) => (d(), g("span", {
652
- class: A([[$(n) && e.node.center ? "text-node-center" : ""], "whitespace-pre-wrap break-words text-node"])
653
- }, ee(e.node.content), 3));
654
- }
655
- }), we = /* @__PURE__ */ X(yr, [["__scopeId", "data-v-56f30838"]]);
656
- we.install = (e) => {
657
- e.component(we.__name, we);
658
- };
659
- const nt = Dt(() => j(null, null, function* () {
660
- var n, t;
661
- if (typeof globalThis != "undefined" && typeof globalThis.process != "undefined" && ((t = (n = globalThis.process) == null ? void 0 : n.env) == null ? void 0 : t.NODE_ENV) === "test")
662
- return (l) => {
663
- var r, a;
664
- return Tn(we, dt(ie({}, l), {
665
- node: dt(ie({}, l.node), {
666
- content: (a = l.node.raw) != null ? a : `$${(r = l.node.content) != null ? r : ""}$`
667
- })
668
- }));
669
- };
670
- try {
671
- if (yield Fn())
672
- return (yield import("./index-Cc3u_ylp.js")).default;
673
- } catch (l) {
674
- console.warn(
675
- '[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',
676
- l
677
- );
678
- }
679
- return (l) => {
680
- var r, a;
681
- return Tn(we, dt(ie({}, l), {
682
- node: dt(ie({}, l.node), {
683
- content: (a = l.node.raw) != null ? a : `$${(r = l.node.content) != null ? r : ""}$`
684
- })
685
- }));
686
- };
687
- })), xr = Dt(() => j(null, null, function* () {
688
- try {
689
- if (yield Fn())
690
- return (yield import("./index-ELonlW3Z.js")).default;
691
- } catch (e) {
692
- console.warn(
693
- '[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',
694
- e
695
- );
696
- }
697
- return (e) => {
698
- var n, t;
699
- return Tn(we, dt(ie({}, e), {
700
- node: dt(ie({}, e.node), {
701
- content: (t = e.node.raw) != null ? t : `$$${(n = e.node.content) != null ? n : ""}$$`
702
- })
703
- }));
704
- };
705
- })), Se = /* @__PURE__ */ V({
706
- __name: "ReferenceNode",
707
- props: {
708
- node: {},
709
- messageId: {},
710
- threadId: {}
711
- },
712
- emits: ["click", "mouseEnter", "mouseLeave"],
713
- setup(e) {
714
- return (n, t) => (d(), g("span", {
715
- class: "reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",
716
- role: "button",
717
- tabindex: "0",
718
- onClick: t[0] || (t[0] = (l) => n.$emit("click", l, e.node.id, e.messageId, e.threadId)),
719
- onMouseenter: t[1] || (t[1] = (l) => n.$emit("mouseEnter", l, e.node.id, e.messageId, e.threadId)),
720
- onMouseleave: t[2] || (t[2] = (l) => n.$emit("mouseLeave", l, e.node.id, e.messageId, e.threadId))
721
- }, ee(e.node.id), 33));
722
- }
723
- });
724
- Se.install = (e) => {
725
- e.component(Se.__name, Se);
726
- };
727
- const br = { class: "superscript-node" }, Mr = { key: 1 }, Cr = /* @__PURE__ */ V({
728
- __name: "SuperscriptNode",
729
- props: {
730
- node: {},
731
- customId: {},
732
- indexKey: {}
733
- },
734
- setup(e) {
735
- const n = e, t = ie({
736
- text: we,
737
- inline_code: _e,
738
- link: Ne,
739
- strong: Ee,
740
- emphasis: We,
741
- footnote_reference: Ie,
742
- strikethrough: Le,
743
- highlight: Ve,
744
- insert: Pe,
745
- subscript: Ae,
746
- emoji: Te,
747
- math_inline: nt,
748
- reference: Se
749
- }, Ze(n.customId));
750
- return (l, r) => (d(), g("sup", br, [
751
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), g(re, {
752
- key: `${e.indexKey || "superscript"}-${i}`
753
- }, [
754
- t[a.type] ? (d(), me(He(t[a.type]), {
755
- key: 0,
756
- node: a,
757
- "custom-id": n.customId,
758
- "index-key": `${e.indexKey || "superscript"}-${i}`
759
- }, null, 8, ["node", "custom-id", "index-key"])) : (d(), g("span", Mr, ee(a.content || a.raw), 1))
760
- ], 64))), 128))
761
- ]));
762
- }
763
- }), De = /* @__PURE__ */ X(Cr, [["__scopeId", "data-v-0ca396bb"]]);
764
- De.install = (e) => {
765
- e.component(De.__name, De);
766
- };
767
- const Br = { class: "subscript-node" }, $r = { key: 1 }, Tr = /* @__PURE__ */ V({
768
- __name: "SubscriptNode",
769
- props: {
770
- node: {},
771
- customId: {},
772
- indexKey: {}
773
- },
774
- setup(e) {
775
- const n = e, t = ie({
776
- text: we,
777
- inline_code: _e,
778
- link: Ne,
779
- strong: Ee,
780
- emphasis: We,
781
- footnote_reference: Ie,
782
- strikethrough: Le,
783
- highlight: Ve,
784
- insert: Pe,
785
- superscript: De,
786
- emoji: Te,
787
- math_inline: nt,
788
- reference: Se
789
- }, Ze(n.customId));
790
- return (l, r) => (d(), g("sub", Br, [
791
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), g(re, {
792
- key: `${e.indexKey || "subscript"}-${i}`
793
- }, [
794
- t[a.type] ? (d(), me(He(t[a.type]), {
795
- key: 0,
796
- node: a,
797
- "custom-id": n.customId,
798
- "index-key": `${e.indexKey || "subscript"}-${i}`
799
- }, null, 8, ["node", "custom-id", "index-key"])) : (d(), g("span", $r, ee(a.content || a.raw), 1))
800
- ], 64))), 128))
801
- ]));
802
- }
803
- }), Ae = /* @__PURE__ */ X(Tr, [["__scopeId", "data-v-5e1f04df"]]);
804
- Ae.install = (e) => {
805
- e.component(Ae.__name, Ae);
806
- };
807
- const Ir = { class: "strong-node" }, _r = /* @__PURE__ */ V({
808
- __name: "StrongNode",
809
- props: {
810
- node: {},
811
- customId: {},
812
- indexKey: {}
813
- },
814
- setup(e) {
815
- const n = e, t = ie({
816
- text: we,
817
- inline_code: _e,
818
- link: Ne,
819
- emphasis: We,
820
- strikethrough: Le,
821
- highlight: Ve,
822
- insert: Pe,
823
- subscript: Ae,
824
- superscript: De,
825
- emoji: Te,
826
- footnote_reference: Ie,
827
- math_inline: nt,
828
- reference: Se
829
- }, Ze(n.customId));
830
- return (l, r) => (d(), g("strong", Ir, [
831
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), me(He(t[a.type]), {
832
- key: `${e.indexKey || "strong"}-${i}`,
833
- "index-key": `${e.indexKey || "strong"}-${i}`,
834
- node: a,
835
- "custom-id": n.customId
836
- }, null, 8, ["index-key", "node", "custom-id"]))), 128))
837
- ]));
838
- }
839
- }), Ee = /* @__PURE__ */ X(_r, [["__scopeId", "data-v-53b6c7df"]]);
840
- Ee.install = (e) => {
841
- e.component(Ee.__name, Ee);
842
- };
843
- const Sr = { class: "strikethrough-node" }, Er = /* @__PURE__ */ V({
844
- __name: "StrikethroughNode",
845
- props: {
846
- node: {},
847
- customId: {},
848
- indexKey: {}
849
- },
850
- setup(e) {
851
- const n = e, t = ie({
852
- text: we,
853
- inline_code: _e,
854
- link: Ne,
855
- strong: Ee,
856
- emphasis: We,
857
- highlight: Ve,
858
- insert: Pe,
859
- subscript: Ae,
860
- superscript: De,
861
- emoji: Te,
862
- footnote_reference: Ie,
863
- math_inline: nt,
864
- reference: Se
865
- }, Ze(n.customId));
866
- return (l, r) => (d(), g("del", Sr, [
867
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), me(He(t[a.type]), {
868
- key: `${e.indexKey || "strikethrough"}-${i}`,
869
- node: a,
870
- "custom-id": n.customId,
871
- "index-key": `${e.indexKey || "strikethrough"}-${i}`
872
- }, null, 8, ["node", "custom-id", "index-key"]))), 128))
873
- ]));
874
- }
875
- }), Le = /* @__PURE__ */ X(Er, [["__scopeId", "data-v-3716d25c"]]);
876
- Le.install = (e) => {
877
- e.component(Le.__name, Le);
878
- };
879
- const Lr = ["href", "title", "aria-label", "aria-hidden"], Nr = ["aria-hidden"], Hr = { class: "link-text-wrapper relative inline-flex" }, Rr = { class: "leading-[normal] link-text" }, jr = { class: "leading-[normal] link-text" }, zr = /* @__PURE__ */ V({
880
- __name: "LinkNode",
881
- props: {
882
- node: {},
883
- indexKey: {},
884
- customId: {},
885
- showTooltip: { type: Boolean, default: !0 },
886
- color: {},
887
- underlineHeight: {},
888
- underlineBottom: {},
889
- animationDuration: {},
890
- animationOpacity: {},
891
- animationTiming: {},
892
- animationIteration: {}
893
- },
894
- setup(e) {
895
- const n = e, t = L(() => {
896
- var c, k, v, B, I, O;
897
- const h = n.underlineBottom !== void 0 ? typeof n.underlineBottom == "number" ? `${n.underlineBottom}px` : String(n.underlineBottom) : "-3px";
898
- return {
899
- "--link-color": (c = n.color) != null ? c : "#0366d6",
900
- "--underline-height": `${(k = n.underlineHeight) != null ? k : 2}px`,
901
- "--underline-bottom": h,
902
- "--underline-opacity": String((v = n.animationOpacity) != null ? v : 0.9),
903
- "--underline-duration": `${(B = n.animationDuration) != null ? B : 0.8}s`,
904
- "--underline-timing": (I = n.animationTiming) != null ? I : "linear",
905
- "--underline-iteration": typeof n.animationIteration == "number" ? String(n.animationIteration) : (O = n.animationIteration) != null ? O : "infinite"
906
- };
907
- }), l = {
908
- text: we,
909
- strong: Ee,
910
- strikethrough: Le,
911
- emphasis: We,
912
- image: mt
913
- }, r = Do();
914
- function a(h) {
915
- var B, I, O, D, K, H;
916
- if (!n.showTooltip)
917
- return;
918
- const c = h, k = (c == null ? void 0 : c.clientX) != null && (c == null ? void 0 : c.clientY) != null ? { x: c.clientX, y: c.clientY } : void 0, v = (H = (K = (O = (B = n.node) == null ? void 0 : B.href) != null ? O : (I = n.node) == null ? void 0 : I.title) != null ? K : (D = n.node) == null ? void 0 : D.text) != null ? H : "";
919
- un(h.currentTarget, v, "top", !1, k);
920
- }
921
- function i() {
922
- n.showTooltip && Wn();
923
- }
924
- const w = L(() => {
925
- var h, c;
926
- return String((c = (h = n.node.title) != null ? h : n.node.href) != null ? c : "");
927
- });
928
- return (h, c) => e.node.loading ? (d(), g("span", jt({
929
- key: 1,
930
- class: "link-loading inline-flex items-baseline gap-1.5",
931
- "aria-hidden": e.node.loading ? "false" : "true"
932
- }, $(r), { style: t.value }), [
933
- m("span", Hr, [
934
- m("span", Rr, [
935
- m("span", jr, ee(e.node.text), 1)
936
- ]),
937
- c[1] || (c[1] = m("span", {
938
- class: "underline-anim",
939
- "aria-hidden": "true"
940
- }, null, -1))
941
- ])
942
- ], 16, Nr)) : (d(), g("a", jt({
943
- key: 0,
944
- class: "link-node",
945
- href: e.node.href,
946
- title: w.value,
947
- "aria-label": `Link: ${w.value}`,
948
- "aria-hidden": e.node.loading ? "true" : "false",
949
- target: "_blank",
950
- rel: "noopener noreferrer"
951
- }, $(r), {
952
- style: t.value,
953
- onMouseenter: c[0] || (c[0] = (k) => a(k)),
954
- onMouseleave: i
955
- }), [
956
- (d(!0), g(re, null, pe(e.node.children, (k, v) => (d(), me(He(l[k.type]), {
957
- key: `${e.indexKey || "emphasis"}-${v}`,
958
- node: k,
959
- "custom-id": n.customId,
960
- "index-key": `${e.indexKey || "link-text"}-${v}`
961
- }, null, 8, ["node", "custom-id", "index-key"]))), 128))
962
- ], 16, Lr));
963
- }
964
- }), Ne = /* @__PURE__ */ X(zr, [["__scopeId", "data-v-0ea92a03"]]);
965
- Ne.install = (e) => {
966
- e.component(Ne.__name, Ne);
967
- };
968
- const Dr = { class: "insert-node" }, Ar = /* @__PURE__ */ V({
969
- __name: "InsertNode",
970
- props: {
971
- node: {},
972
- customId: {},
973
- indexKey: {}
974
- },
975
- setup(e) {
976
- const n = e, t = ie({
977
- text: we,
978
- inline_code: _e,
979
- link: Ne,
980
- strong: Ee,
981
- emphasis: We,
982
- strikethrough: Le,
983
- highlight: Ve,
984
- subscript: Ae,
985
- superscript: De,
986
- emoji: Te,
987
- footnote_reference: Ie,
988
- math_inline: nt,
989
- reference: Se
990
- }, Ze(n.customId));
991
- return (l, r) => (d(), g("ins", Dr, [
992
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), me(He(t[a.type]), {
993
- key: `${e.indexKey || "insert"}-${i}`,
994
- node: a,
995
- "custom-id": n.customId,
996
- "index-key": `${e.indexKey || "insert"}-${i}`
997
- }, null, 8, ["node", "custom-id", "index-key"]))), 128))
998
- ]));
999
- }
1000
- }), Pe = /* @__PURE__ */ X(Ar, [["__scopeId", "data-v-b8737de3"]]);
1001
- Pe.install = (e) => {
1002
- e.component(Pe.__name, Pe);
1003
- };
1004
- const Pr = { class: "highlight-node" }, Vr = /* @__PURE__ */ V({
1005
- __name: "HighlightNode",
1006
- props: {
1007
- node: {},
1008
- customId: {},
1009
- indexKey: {}
1010
- },
1011
- setup(e) {
1012
- const n = e, t = ie({
1013
- text: we,
1014
- inline_code: _e,
1015
- link: Ne,
1016
- strong: Ee,
1017
- emphasis: We,
1018
- strikethrough: Le,
1019
- insert: Pe,
1020
- subscript: Ae,
1021
- superscript: De,
1022
- emoji: Te,
1023
- footnote_reference: Ie,
1024
- math_inline: nt,
1025
- reference: Se
1026
- }, Ze(n.customId));
1027
- return (l, r) => (d(), g("mark", Pr, [
1028
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), me(He(t[a.type]), {
1029
- key: `${e.indexKey || "highlight"}-${i}`,
1030
- node: a,
1031
- "custom-id": n.customId,
1032
- "index-key": `${e.indexKey || "highlight"}-${i}`
1033
- }, null, 8, ["node", "custom-id", "index-key"]))), 128))
1034
- ]));
1035
- }
1036
- }), Ve = /* @__PURE__ */ X(Vr, [["__scopeId", "data-v-fc52b444"]]);
1037
- Ve.install = (e) => {
1038
- e.component(Ve.__name, Ve);
1039
- };
1040
- const Wr = { class: "emphasis-node" }, Kr = /* @__PURE__ */ V({
1041
- __name: "EmphasisNode",
1042
- props: {
1043
- node: {},
1044
- customId: {},
1045
- indexKey: {}
1046
- },
1047
- setup(e) {
1048
- const n = e, t = ie({
1049
- text: we,
1050
- inline_code: _e,
1051
- link: Ne,
1052
- strong: Ee,
1053
- strikethrough: Le,
1054
- highlight: Ve,
1055
- insert: Pe,
1056
- subscript: Ae,
1057
- superscript: De,
1058
- emoji: Te,
1059
- footnote_reference: Ie,
1060
- math_inline: nt,
1061
- reference: Se
1062
- }, Ze(n.customId));
1063
- return (l, r) => (d(), g("em", Wr, [
1064
- (d(!0), g(re, null, pe(e.node.children, (a, i) => (d(), me(He(t[a.type]), {
1065
- key: `${e.indexKey || "emphasis"}-${i}`,
1066
- node: a,
1067
- "custom-id": n.customId,
1068
- "index-key": `${e.indexKey || "emphasis"}-${i}`
1069
- }, null, 8, ["node", "custom-id", "index-key"]))), 128))
1070
- ]));
1071
- }
1072
- }), We = /* @__PURE__ */ X(Kr, [["__scopeId", "data-v-c25e2822"]]);
1073
- We.install = (e) => {
1074
- e.component(We.__name, We);
1075
- };
1076
- const Or = ["href", "title"], Fr = /* @__PURE__ */ V({
1077
- __name: "FootnoteAnchorNode",
1078
- props: {
1079
- node: {}
1080
- },
1081
- setup(e) {
1082
- const n = e;
1083
- function t(l) {
1084
- var i;
1085
- if (l.preventDefault(), typeof document == "undefined")
1086
- return;
1087
- const r = `fnref-${String((i = n.node.id) != null ? i : "")}`, a = document.getElementById(r);
1088
- a && a.scrollIntoView({ behavior: "smooth" });
1089
- }
1090
- return (l, r) => (d(), g("a", {
1091
- class: "footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",
1092
- href: `#fnref-${e.node.id}`,
1093
- title: `返回引用 ${e.node.id}`,
1094
- onClick: t
1095
- }, " ↩︎ ", 8, Or));
1096
- }
1097
- }), Nt = /* @__PURE__ */ X(Fr, [["__scopeId", "data-v-4756ce0d"]]);
1098
- Nt.install = (e) => {
1099
- e.component(Nt.__name, Nt);
1100
- };
1101
- const Xr = ["id"], Yr = { class: "flex-1" }, Jt = /* @__PURE__ */ V({
1102
- __name: "FootnoteNode",
1103
- props: {
1104
- node: {},
1105
- indexKey: {},
1106
- typewriter: { type: Boolean }
1107
- },
1108
- emits: ["copy"],
1109
- setup(e) {
1110
- return (n, t) => (d(), g("div", {
1111
- id: `fnref--${e.node.id}`,
1112
- class: "flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"
1113
- }, [
1114
- m("div", Yr, [
1115
- zt([e.node.children], () => Ue($(qe), {
1116
- "index-key": `footnote-${e.indexKey}`,
1117
- nodes: e.node.children,
1118
- typewriter: e.typewriter,
1119
- onCopy: t[0] || (t[0] = (l) => n.$emit("copy", l))
1120
- }, null, 8, ["index-key", "nodes", "typewriter"]), t, 1)
1121
- ])
1122
- ], 8, Xr));
1123
- }
1124
- });
1125
- Jt.install = (e) => {
1126
- e.component(Jt.__name, Jt);
1127
- };
1128
- const qr = { class: "hard-break" }, Ur = /* @__PURE__ */ V({
1129
- __name: "HardBreakNode",
1130
- props: {
1131
- node: {}
1132
- },
1133
- setup(e) {
1134
- return (n, t) => (d(), g("br", qr));
1135
- }
1136
- }), Bt = /* @__PURE__ */ X(Ur, [["__scopeId", "data-v-50c58f70"]]);
1137
- Bt.install = (e) => {
1138
- e.component(Bt.__name, Bt);
1139
- };
1140
- const Zr = /* @__PURE__ */ V({
1141
- __name: "HeadingNode",
1142
- props: {
1143
- node: {},
1144
- customId: {},
1145
- indexKey: {}
1146
- },
1147
- setup(e) {
1148
- const n = e, t = ie({
1149
- text: we,
1150
- inline_code: _e,
1151
- link: Ne,
1152
- image: mt,
1153
- strong: Ee,
1154
- emphasis: We,
1155
- strikethrough: Le,
1156
- highlight: Ve,
1157
- insert: Pe,
1158
- subscript: Ae,
1159
- superscript: De,
1160
- emoji: Te,
1161
- checkbox: tt,
1162
- checkbox_input: tt,
1163
- footnote_reference: Ie,
1164
- hardbreak: Bt,
1165
- math_inline: nt,
1166
- reference: Se
1167
- }, Ze(n.customId));
1168
- return (l, r) => zt([e.node.children], () => (d(), me(He(`h${e.node.level}`), {
1169
- class: A(["heading-node", [`heading-${e.node.level}`]]),
1170
- dir: "auto"
1171
- }, {
1172
- default: Tt(() => [
1173
- (d(!0), g(re, null, pe(e.node.children, (a, i, w, h) => {
1174
- const c = [a];
1175
- if (h && h.key === `${e.indexKey || "heading"}-${i}` && fo(h, c)) return h;
1176
- const k = (d(), me(He(t[a.type]), {
1177
- key: `${e.indexKey || "heading"}-${i}`,
1178
- "custom-id": n.customId,
1179
- node: a,
1180
- "index-key": `${e.indexKey || "heading"}-${i}`
1181
- }, null, 8, ["custom-id", "node", "index-key"]));
1182
- return k.memo = c, k;
1183
- }, r, 0), 128))
1184
- ]),
1185
- _: 1
1186
- }, 8, ["class"])), r, 2);
1187
- }
1188
- }), jn = /* @__PURE__ */ X(Zr, [["__scopeId", "data-v-d8e179e9"]]), Xn = jn;
1189
- Xn.install = (e) => {
1190
- e.component(jn.__name, jn);
1191
- };
1192
- const Gr = /* @__PURE__ */ V({
1193
- __name: "ListItemNode",
1194
- props: {
1195
- item: {},
1196
- indexKey: {},
1197
- value: {},
1198
- typewriter: { type: Boolean }
1199
- },
1200
- emits: ["copy"],
1201
- setup(e) {
1202
- const n = e, t = L(
1203
- () => n.value == null ? {} : { value: n.value }
1204
- );
1205
- return (l, r) => (d(), g("li", jt({
1206
- class: "list-item pl-1.5 my-2",
1207
- dir: "auto"
1208
- }, t.value), [
1209
- zt([n.item.children], () => Ue($(qe), {
1210
- "index-key": `list-item-${n.indexKey}`,
1211
- nodes: n.item.children,
1212
- typewriter: n.typewriter,
1213
- "batch-rendering": !1,
1214
- onCopy: r[0] || (r[0] = (a) => l.$emit("copy", a))
1215
- }, null, 8, ["index-key", "nodes", "typewriter"]), r, 1)
1216
- ], 16));
1217
- }
1218
- }), Qt = /* @__PURE__ */ X(Gr, [["__scopeId", "data-v-e7aa2cc3"]]);
1219
- Qt.install = (e) => {
1220
- e.component(Qt.__name, Qt);
1221
- };
1222
- const Jr = /* @__PURE__ */ V({
1223
- __name: "ListNode",
1224
- props: {
1225
- node: {},
1226
- customId: {},
1227
- indexKey: {},
1228
- typewriter: { type: Boolean }
1229
- },
1230
- emits: ["copy"],
1231
- setup(e) {
1232
- return (n, t) => (d(), me(He(e.node.ordered ? "ol" : "ul"), {
1233
- class: A(["list-node", { "list-decimal": e.node.ordered, "list-disc": !e.node.ordered }])
1234
- }, {
1235
- default: Tt(() => [
1236
- (d(!0), g(re, null, pe(e.node.items, (l, r, a, i) => {
1237
- var c;
1238
- const w = [l];
1239
- if (i && i.key === `${e.indexKey || "list"}-${r}` && fo(i, w)) return i;
1240
- const h = (d(), me($(Qt), {
1241
- key: `${e.indexKey || "list"}-${r}`,
1242
- item: l,
1243
- "custom-id": e.customId,
1244
- "index-key": `${e.indexKey || "list"}-${r}`,
1245
- typewriter: e.typewriter,
1246
- value: e.node.ordered ? ((c = e.node.start) != null ? c : 1) + r : void 0,
1247
- onCopy: t[0] || (t[0] = (k) => n.$emit("copy", k))
1248
- }, null, 8, ["item", "custom-id", "index-key", "typewriter", "value"]));
1249
- return h.memo = w, h;
1250
- }, t, 1), 128))
1251
- ]),
1252
- _: 1
1253
- }, 8, ["class"]));
1254
- }
1255
- }), en = /* @__PURE__ */ X(Jr, [["__scopeId", "data-v-79057d57"]]);
1256
- en.install = (e) => {
1257
- e.component(en.__name, en);
1258
- };
1259
- const Qr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e";
1260
- function ea(e) {
1261
- try {
1262
- if (typeof globalThis != "undefined" && typeof globalThis.requestAnimationFrame == "function")
1263
- return globalThis.requestAnimationFrame(e);
1264
- } catch (n) {
1265
- }
1266
- return globalThis.setTimeout(e, 0);
1267
- }
1268
- let ge = null, ht = null;
1269
- const he = /* @__PURE__ */ new Map(), ta = 5;
1270
- let In = ta, zn = !1;
1271
- function Ks(e) {
1272
- zn = !!e;
1273
- }
1274
- function Os(e) {
1275
- Number.isFinite(e) && e > 0 && (In = Math.floor(e));
1276
- }
1277
- function Fs() {
1278
- return { inFlight: he.size, max: In };
1279
- }
1280
- const na = "WORKER_BUSY";
1281
- function Xs(e) {
1282
- ge = e, ht = null;
1283
- const n = e;
1284
- ge.onmessage = (t) => {
1285
- if (ge !== n)
1286
- return;
1287
- const { id: l, ok: r, result: a, error: i } = t.data, w = he.get(l);
1288
- w && (r === !1 || i ? w.reject(new Error(i || "Unknown error")) : w.resolve(a));
1289
- }, ge.onerror = (t) => {
1290
- var l, r;
1291
- if (ge === n) {
1292
- if (he.size === 0) {
1293
- (l = console.debug) == null || l.call(console, "[mermaidWorkerClient] Worker error (no pending):", (t == null ? void 0 : t.message) || t);
1294
- return;
1295
- }
1296
- try {
1297
- zn ? console.error("[mermaidWorkerClient] Worker error:", (t == null ? void 0 : t.message) || t) : (r = console.debug) == null || r.call(console, "[mermaidWorkerClient] Worker error:", (t == null ? void 0 : t.message) || t);
1298
- } catch (a) {
1299
- }
1300
- for (const [a, i] of he.entries())
1301
- i.reject(new Error(`Worker error: ${t.message}`));
1302
- he.clear();
1303
- }
1304
- }, ge.onmessageerror = (t) => {
1305
- var l, r;
1306
- if (ge === n) {
1307
- if (he.size === 0) {
1308
- (l = console.debug) == null || l.call(console, "[mermaidWorkerClient] Worker messageerror (no pending):", t);
1309
- return;
1310
- }
1311
- try {
1312
- zn ? console.error("[mermaidWorkerClient] Worker messageerror:", t) : (r = console.debug) == null || r.call(console, "[mermaidWorkerClient] Worker messageerror:", t);
1313
- } catch (a) {
1314
- }
1315
- for (const [a, i] of he.entries())
1316
- i.reject(new Error("Worker messageerror"));
1317
- he.clear();
1318
- }
1319
- };
1320
- }
1321
- function Ys() {
1322
- var e;
1323
- if (ge)
1324
- try {
1325
- for (const [n, t] of he.entries())
1326
- t.reject(new Error("Worker cleared"));
1327
- he.clear(), (e = ge.terminate) == null || e.call(ge);
1328
- } catch (n) {
1329
- }
1330
- ge = null, ht = null;
1331
- }
1332
- function oa() {
1333
- return ge || (ht = new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."), ht.name = "WorkerInitError", ht.code = "WORKER_INIT_ERROR", null);
1334
- }
1335
- function Mo(e, n, t = 1400) {
1336
- if (ht)
1337
- return Promise.reject(ht);
1338
- const l = oa();
1339
- if (!l)
1340
- return Promise.reject(ht);
1341
- if (he.size >= In) {
1342
- const r = new Error("Worker busy");
1343
- return r.name = "WorkerBusy", r.code = na, r.inFlight = he.size, r.max = In, Promise.reject(r);
1344
- }
1345
- return new Promise((r, a) => {
1346
- const i = Math.random().toString(36).slice(2);
1347
- let w = !1, h;
1348
- const c = () => {
1349
- w || (w = !0, h != null && globalThis.clearTimeout(h), he.delete(i));
1350
- }, k = {
1351
- resolve: (v) => {
1352
- c(), r(v);
1353
- },
1354
- reject: (v) => {
1355
- c(), a(v);
1356
- }
1357
- };
1358
- he.set(i, k);
1359
- try {
1360
- l.postMessage({ id: i, action: e, payload: n });
1361
- } catch (v) {
1362
- he.delete(i), a(v);
1363
- return;
1364
- }
1365
- h = globalThis.setTimeout(() => {
1366
- const v = new Error("Worker call timed out");
1367
- v.name = "WorkerTimeout", v.code = "WORKER_TIMEOUT";
1368
- const B = he.get(i);
1369
- B && B.reject(v);
1370
- }, t);
1371
- });
1372
- }
1373
- function ra(e, n, t = 1400) {
1374
- return j(this, null, function* () {
1375
- try {
1376
- return yield Mo("canParse", { code: e, theme: n }, t);
1377
- } catch (l) {
1378
- return Promise.reject(l);
1379
- }
1380
- });
1381
- }
1382
- function aa(e, n, t = 1400) {
1383
- return j(this, null, function* () {
1384
- try {
1385
- return yield Mo("findPrefix", { code: e, theme: n }, t);
1386
- } catch (l) {
1387
- return Promise.reject(l);
1388
- }
1389
- });
1390
- }
1391
- function oo() {
1392
- if (ge)
1393
- try {
1394
- for (const [e, n] of he.entries())
1395
- n.reject(new Error("Worker terminated"));
1396
- he.clear(), ge.terminate();
1397
- } finally {
1398
- ge = null;
1399
- }
1400
- }
1401
- let ve = null;
1402
- function ia() {
1403
- return j(this, null, function* () {
1404
- if (ve)
1405
- return ve;
1406
- try {
1407
- const e = yield import("mermaid"), n = e && e.default ? e.default : e;
1408
- if (n && (typeof n.render == "function" || typeof n.parse == "function" || typeof n.initialize == "function"))
1409
- ve = n;
1410
- else if (n && n.mermaidAPI && (typeof n.mermaidAPI.render == "function" || typeof n.mermaidAPI.parse == "function")) {
1411
- const t = n.mermaidAPI;
1412
- ve = dt(ie({}, n), {
1413
- render: t.render.bind(t),
1414
- parse: t.parse ? t.parse.bind(t) : void 0,
1415
- initialize: (l) => typeof n.initialize == "function" ? n.initialize(l) : t.initialize ? t.initialize(l) : void 0
1416
- });
1417
- } else e.mermaid && typeof e.mermaid.render == "function" ? ve = e.mermaid : ve = n;
1418
- } catch (e) {
1419
- throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');
1420
- }
1421
- try {
1422
- const e = ve == null ? void 0 : ve.initialize;
1423
- ve.initialize = (n) => {
1424
- const t = ie({ suppressErrorRendering: !0 }, n || {});
1425
- if (typeof e == "function")
1426
- return e.call(ve, t);
1427
- if (ve != null && ve.mermaidAPI && typeof ve.mermaidAPI.initialize == "function")
1428
- return ve.mermaidAPI.initialize(t);
1429
- };
1430
- } catch (e) {
1431
- }
1432
- return ve;
1433
- });
1434
- }
1435
- const sa = { key: 0 }, la = {
1436
- key: 1,
1437
- class: "flex items-center space-x-2 overflow-hidden"
1438
- }, ca = ["src"], ua = { key: 2 }, da = { class: "flex items-center space-x-1" }, ma = { class: "flex items-center space-x-1" }, ha = { key: 4 }, fa = {
1439
- key: 5,
1440
- class: "flex items-center space-x-1"
1441
- }, va = ["aria-pressed"], ga = {
1442
- key: 0,
1443
- xmlns: "http://www.w3.org/2000/svg",
1444
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1445
- "aria-hidden": "true",
1446
- role: "img",
1447
- width: "1em",
1448
- height: "1em",
1449
- viewBox: "0 0 24 24",
1450
- class: "w-3 h-3"
1451
- }, pa = {
1452
- key: 1,
1453
- xmlns: "http://www.w3.org/2000/svg",
1454
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1455
- "aria-hidden": "true",
1456
- role: "img",
1457
- width: "1em",
1458
- height: "1em",
1459
- viewBox: "0 0 24 24",
1460
- class: "w-3 h-3"
1461
- }, wa = ["disabled"], ka = ["disabled"], ya = {
1462
- key: 0,
1463
- xmlns: "http://www.w3.org/2000/svg",
1464
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1465
- "aria-hidden": "true",
1466
- role: "img",
1467
- width: "0.75rem",
1468
- height: "0.75rem",
1469
- viewBox: "0 0 24 24"
1470
- }, xa = {
1471
- key: 1,
1472
- xmlns: "http://www.w3.org/2000/svg",
1473
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1474
- "aria-hidden": "true",
1475
- role: "img",
1476
- width: "0.75rem",
1477
- height: "0.75rem",
1478
- viewBox: "0 0 24 24"
1479
- }, ba = {
1480
- key: 1,
1481
- class: "relative"
1482
- }, Ma = {
1483
- key: 0,
1484
- class: "absolute top-2 right-2 z-10 rounded-lg"
1485
- }, Ca = { class: "flex items-center gap-2 backdrop-blur rounded-lg" }, Ba = { class: "absolute top-6 right-6 z-50 flex items-center gap-2" }, $a = 300, Ta = 500, Ia = /* @__PURE__ */ V({
1486
- __name: "MermaidBlockNode",
1487
- props: {
1488
- node: {},
1489
- maxHeight: { default: "500px" },
1490
- loading: { type: Boolean, default: !0 },
1491
- isDark: { type: Boolean },
1492
- workerTimeoutMs: { default: 1400 },
1493
- parseTimeoutMs: { default: 1800 },
1494
- renderTimeoutMs: { default: 2500 },
1495
- fullRenderTimeoutMs: { default: 4e3 },
1496
- showHeader: { type: Boolean, default: !0 },
1497
- showModeToggle: { type: Boolean, default: !0 },
1498
- showCopyButton: { type: Boolean, default: !0 },
1499
- showExportButton: { type: Boolean, default: !0 },
1500
- showFullscreenButton: { type: Boolean, default: !0 },
1501
- showCollapseButton: { type: Boolean, default: !0 },
1502
- showZoomControls: { type: Boolean, default: !0 }
1503
- },
1504
- emits: ["copy", "export", "openModal", "toggleMode"],
1505
- setup(e, { emit: n }) {
1506
- var Yn, qn;
1507
- const t = e, l = n, { t: r } = Kn();
1508
- let a = null;
1509
- const i = M(!1);
1510
- typeof window != "undefined" && j(null, null, function* () {
1511
- var s;
1512
- a = yield ia(), i.value = !!a, (s = a == null ? void 0 : a.initialize) == null || s.call(a, { startOnLoad: !1, securityLevel: "loose" });
1513
- });
1514
- const w = M(!1), h = M(!1), c = M(), k = M(), v = M(), B = M(), I = M(null), O = On(), D = M(null), K = M(typeof window == "undefined"), H = M(), N = L(() => t.node.code.replace(/\]::([^:])/g, "]:::$1").replace(/:::subgraphNode$/gm, "::subgraphNode"));
1515
- function ke(s) {
1516
- const o = N.value, b = `%%{init: {"theme": "${s === "dark" ? "dark" : "default"}"}}%%
1517
- `;
1518
- return o.trim().startsWith("%%{") ? o : b + o;
1519
- }
1520
- const W = M(1), Z = M(0), S = M(0), le = M(!1), te = M({ x: 0, y: 0 }), Y = M(!1), be = M(!1), G = M(!1), ut = M(null), ot = M(0), rt = M(!1);
1521
- let Ke = null;
1522
- const ae = M("360px");
1523
- let ne = null;
1524
- const z = M(!1), ye = M(!1), Re = M({}), at = M(null), Me = M(""), vt = M(0);
1525
- let fe = null;
1526
- const Ce = M(!1), Oe = M({
1527
- zoom: 1,
1528
- translateX: 0,
1529
- translateY: 0,
1530
- containerHeight: "360px"
1531
- }), x = L(() => {
1532
- var s, o, u, b;
1533
- return {
1534
- worker: (s = t.workerTimeoutMs) != null ? s : 1400,
1535
- parse: (o = t.parseTimeoutMs) != null ? o : 1800,
1536
- render: (u = t.renderTimeoutMs) != null ? u : 2500,
1537
- fullRender: (b = t.fullRenderTimeoutMs) != null ? b : 4e3
1538
- };
1539
- }), y = (Yn = globalThis.cancelIdleCallback) != null ? Yn : ((s) => clearTimeout(s));
1540
- let T = null, oe = null, ce = !1, gt = 800, xe = null, pt = 0, At = !0;
1541
- typeof window != "undefined" && U(
1542
- () => c.value,
1543
- (s) => {
1544
- var u;
1545
- if ((u = D.value) == null || u.destroy(), D.value = null, !s) {
1546
- K.value = !1;
1547
- return;
1548
- }
1549
- const o = O(s, { rootMargin: "400px" });
1550
- D.value = o, K.value = o.isVisible.value, o.whenVisible.then(() => {
1551
- K.value = !0;
1552
- });
1553
- },
1554
- { immediate: !0 }
1555
- ), mn(() => {
1556
- var s;
1557
- (s = D.value) == null || s.destroy(), D.value = null;
1558
- });
1559
- function Ge(s, o) {
1560
- const u = o == null ? void 0 : o.timeoutMs, b = o == null ? void 0 : o.signal;
1561
- if (b != null && b.aborted)
1562
- return Promise.reject(new DOMException("Aborted", "AbortError"));
1563
- let E = null, _ = !1, P = null;
1564
- return new Promise((F, je) => {
1565
- const ue = () => {
1566
- E != null && clearTimeout(E), P && b && b.removeEventListener("abort", P);
1567
- };
1568
- u && u > 0 && (E = globalThis.setTimeout(() => {
1569
- _ || (_ = !0, ue(), je(new Error("Operation timed out")));
1570
- }, u)), b && (P = () => {
1571
- _ || (_ = !0, ue(), je(new DOMException("Aborted", "AbortError")));
1572
- }, b.addEventListener("abort", P)), s().then((Lt) => {
1573
- _ || (_ = !0, ue(), F(Lt));
1574
- }).catch((Lt) => {
1575
- _ || (_ = !0, ue(), je(Lt));
1576
- });
1577
- });
1578
- }
1579
- function it(s) {
1580
- if (typeof document == "undefined" || !v.value)
1581
- return;
1582
- const o = document.createElement("div");
1583
- o.className = "text-red-500 p-4", o.textContent = "Failed to render diagram: ";
1584
- const u = document.createElement("span");
1585
- u.textContent = s instanceof Error ? s.message : "Unknown error", o.appendChild(u), v.value.innerHTML = "", v.value.appendChild(o), ae.value = "360px", Ce.value = !0, bt();
1586
- }
1587
- function wt(s) {
1588
- const o = s;
1589
- return !o || o.disabled;
1590
- }
1591
- function J(s, o, u = "top") {
1592
- if (wt(s.currentTarget))
1593
- return;
1594
- const b = s, E = (b == null ? void 0 : b.clientX) != null && (b == null ? void 0 : b.clientY) != null ? { x: b.clientX, y: b.clientY } : void 0;
1595
- un(s.currentTarget, o, u, !1, E, t.isDark);
1596
- }
1597
- function Q() {
1598
- Wn();
1599
- }
1600
- function Pt(s) {
1601
- if (wt(s.currentTarget))
1602
- return;
1603
- const o = w.value ? r("common.copied") || "Copied" : r("common.copy") || "Copy", u = s, b = (u == null ? void 0 : u.clientX) != null && (u == null ? void 0 : u.clientY) != null ? { x: u.clientX, y: u.clientY } : void 0;
1604
- un(s.currentTarget, o, "top", !1, b, t.isDark);
1605
- }
1606
- function Vt(s, o) {
1607
- const b = `%%{init: {"theme": "${o === "dark" ? "dark" : "default"}"}}%%
1608
- `;
1609
- return s.trimStart().startsWith("%%{") ? s : b + s;
1610
- }
1611
- function Wt() {
1612
- return At && !Y.value && !z.value && !Ce.value;
1613
- }
1614
- function fn(s) {
1615
- const o = s.split(/\r?\n/);
1616
- for (; o.length > 0; ) {
1617
- const b = o[o.length - 1].trimEnd();
1618
- if (b === "") {
1619
- o.pop();
1620
- continue;
1621
- }
1622
- if (/^[-=~>|<\s]+$/.test(b.trim()) || /(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(b) || /[-|><]$/.test(b) || /(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(b)) {
1623
- o.pop();
1624
- continue;
1625
- }
1626
- break;
1627
- }
1628
- return o.join(`
1629
- `);
1630
- }
1631
- function vn(s, o, u) {
1632
- return j(this, null, function* () {
1633
- var P, F;
1634
- if (!a)
1635
- return;
1636
- const b = a, E = Vt(s, o);
1637
- if (typeof b.parse == "function")
1638
- return yield Ge(() => b.parse(E), {
1639
- timeoutMs: (P = u == null ? void 0 : u.timeoutMs) != null ? P : x.value.parse,
1640
- signal: u == null ? void 0 : u.signal
1641
- }), !0;
1642
- const _ = `mermaid-parse-${Math.random().toString(36).slice(2, 9)}`;
1643
- return yield Ge(() => a.render(_, E), {
1644
- timeoutMs: (F = u == null ? void 0 : u.timeoutMs) != null ? F : x.value.render,
1645
- signal: u == null ? void 0 : u.signal
1646
- }), !0;
1647
- });
1648
- }
1649
- function It(s, o, u) {
1650
- return j(this, null, function* () {
1651
- var b;
1652
- try {
1653
- return yield ra(s, o, (b = u == null ? void 0 : u.timeoutMs) != null ? b : x.value.worker);
1654
- } catch (E) {
1655
- return yield vn(s, o, u);
1656
- }
1657
- });
1658
- }
1659
- function _n(s, o, u) {
1660
- return j(this, null, function* () {
1661
- var E;
1662
- try {
1663
- if (yield It(s, o, u))
1664
- return { fullOk: !0, prefixOk: !1 };
1665
- } catch (_) {
1666
- if ((_ == null ? void 0 : _.name) === "AbortError")
1667
- throw _;
1668
- }
1669
- let b = fn(s);
1670
- if (b && b.trim() && b !== s)
1671
- try {
1672
- try {
1673
- const P = yield aa(s, o, (E = u == null ? void 0 : u.timeoutMs) != null ? E : x.value.worker);
1674
- P && P.trim() && (b = P);
1675
- } catch (P) {
1676
- }
1677
- if (yield It(b, o, u))
1678
- return { fullOk: !1, prefixOk: !0, prefix: b };
1679
- } catch (_) {
1680
- if ((_ == null ? void 0 : _.name) === "AbortError")
1681
- throw _;
1682
- }
1683
- return { fullOk: !1, prefixOk: !1 };
1684
- });
1685
- }
1686
- const kt = L(() => Y.value || G.value || h.value);
1687
- function _t(s) {
1688
- if (!c.value || !v.value)
1689
- return;
1690
- const o = v.value.querySelector("svg");
1691
- if (!o)
1692
- return;
1693
- let u = 0, b = 0;
1694
- const E = o.getAttribute("viewBox"), _ = o.getAttribute("width"), P = o.getAttribute("height");
1695
- if (E) {
1696
- const F = E.split(" ");
1697
- F.length === 4 && (u = Number.parseFloat(F[2]), b = Number.parseFloat(F[3]));
1698
- }
1699
- if ((!u || !b) && _ && P && (u = Number.parseFloat(_), b = Number.parseFloat(P)), Number.isNaN(u) || Number.isNaN(b) || u <= 0 || b <= 0)
1700
- try {
1701
- const F = o.getBBox();
1702
- F && F.width > 0 && F.height > 0 && (u = F.width, b = F.height);
1703
- } catch (F) {
1704
- console.error("Failed to get SVG BBox:", F);
1705
- return;
1706
- }
1707
- if (u > 0 && b > 0) {
1708
- const F = b / u;
1709
- let ue = (s != null ? s : c.value.clientWidth) * F;
1710
- ue > b && (ue = b), ae.value = `${ue}px`;
1711
- }
1712
- }
1713
- const Je = M(!1), Kt = L(() => ({
1714
- transform: `translate(${Z.value}px, ${S.value}px) scale(${W.value})`
1715
- }));
1716
- function gn(s) {
1717
- s.key === "Escape" && Je.value && St();
1718
- }
1719
- function pn() {
1720
- if (Je.value = !0, typeof document != "undefined")
1721
- try {
1722
- document.body.style.overflow = "hidden";
1723
- } catch (s) {
1724
- }
1725
- if (typeof window != "undefined")
1726
- try {
1727
- window.addEventListener("keydown", gn);
1728
- } catch (s) {
1729
- }
1730
- de(() => {
1731
- if (c.value && B.value) {
1732
- const s = c.value.cloneNode(!0);
1733
- s.classList.add("fullscreen");
1734
- const o = s.querySelector(
1735
- "[data-mermaid-wrapper]"
1736
- );
1737
- o && (I.value = o, o.style.transform = Kt.value.transform), B.value.innerHTML = "", B.value.appendChild(s);
1738
- }
1739
- });
1740
- }
1741
- function St() {
1742
- if (Je.value = !1, B.value && (B.value.innerHTML = ""), I.value = null, typeof document != "undefined")
1743
- try {
1744
- document.body.style.overflow = "";
1745
- } catch (s) {
1746
- }
1747
- if (typeof window != "undefined")
1748
- try {
1749
- window.removeEventListener("keydown", gn);
1750
- } catch (s) {
1751
- }
1752
- }
1753
- function wn(s, o) {
1754
- let u = null;
1755
- return (...b) => {
1756
- u && clearTimeout(u), u = setTimeout(() => s(...b), o);
1757
- };
1758
- }
1759
- function f() {
1760
- if (!Y.value || !i.value)
1761
- return;
1762
- const s = N.value.length;
1763
- s !== ot.value && (rt.value = !0, ot.value = s, Ke && clearTimeout(Ke), Ke = setTimeout(() => {
1764
- rt.value && Y.value && N.value.trim() && (rt.value = !1, Ft("preview"));
1765
- }, Ta));
1766
- }
1767
- U(
1768
- Kt,
1769
- (s) => {
1770
- Je.value && I.value && (I.value.style.transform = s.transform);
1771
- },
1772
- { immediate: !0 }
1773
- );
1774
- function p() {
1775
- W.value < 3 && (W.value += 0.1);
1776
- }
1777
- function C() {
1778
- W.value > 0.5 && (W.value -= 0.1);
1779
- }
1780
- function q() {
1781
- W.value = 1, Z.value = 0, S.value = 0;
1782
- }
1783
- function R(s) {
1784
- le.value = !0, s instanceof MouseEvent ? te.value = {
1785
- x: s.clientX - Z.value,
1786
- y: s.clientY - S.value
1787
- } : te.value = {
1788
- x: s.touches[0].clientX - Z.value,
1789
- y: s.touches[0].clientY - S.value
1790
- };
1791
- }
1792
- function Be(s) {
1793
- if (!le.value)
1794
- return;
1795
- let o, u;
1796
- s instanceof MouseEvent ? (o = s.clientX, u = s.clientY) : (o = s.touches[0].clientX, u = s.touches[0].clientY), Z.value = o - te.value.x, S.value = u - te.value.y;
1797
- }
1798
- function Fe() {
1799
- le.value = !1;
1800
- }
1801
- function st(s) {
1802
- if (s.ctrlKey || s.metaKey) {
1803
- if (s.preventDefault(), !c.value)
1804
- return;
1805
- const o = c.value.getBoundingClientRect(), u = s.clientX - o.left, b = s.clientY - o.top, E = o.width / 2, _ = o.height / 2, P = u - E, F = b - _, je = (P - Z.value) / W.value, ue = (F - S.value) / W.value, Bo = -s.deltaY * 0.01, xn = Math.min(Math.max(W.value + Bo, 0.5), 3);
1806
- xn !== W.value && (Z.value = P - je * xn, S.value = F - ue * xn, W.value = xn);
1807
- }
1808
- }
1809
- function Xe() {
1810
- return j(this, null, function* () {
1811
- try {
1812
- typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && (yield navigator.clipboard.writeText(N.value)), w.value = !0, l("copy", N.value), setTimeout(() => {
1813
- w.value = !1;
1814
- }, 1e3);
1815
- } catch (s) {
1816
- console.error("Failed to copy:", s);
1817
- }
1818
- });
1819
- }
1820
- function yt(s, o = null) {
1821
- return j(this, null, function* () {
1822
- try {
1823
- const u = o != null ? o : new XMLSerializer().serializeToString(s), b = new Blob([u], { type: "image/svg+xml;charset=utf-8" }), E = URL.createObjectURL(b);
1824
- if (typeof document != "undefined") {
1825
- const _ = document.createElement("a");
1826
- _.href = E, _.download = `mermaid-diagram-${Date.now()}.svg`;
1827
- try {
1828
- document.body.appendChild(_), _.click(), document.body.removeChild(_);
1829
- } catch (P) {
1830
- }
1831
- URL.revokeObjectURL(E);
1832
- }
1833
- } catch (u) {
1834
- console.error("Failed to export SVG:", u);
1835
- }
1836
- });
1837
- }
1838
- function Et() {
1839
- var b;
1840
- const s = (b = v.value) == null ? void 0 : b.querySelector("svg");
1841
- if (!s) {
1842
- console.error("SVG element not found");
1843
- return;
1844
- }
1845
- const o = new XMLSerializer().serializeToString(s), u = {
1846
- payload: { type: "export" },
1847
- defaultPrevented: !1,
1848
- preventDefault() {
1849
- this.defaultPrevented = !0;
1850
- },
1851
- svgElement: s,
1852
- svgString: o
1853
- };
1854
- l("export", u), u.defaultPrevented || yt(s, o);
1855
- }
1856
- function Sn() {
1857
- var b, E;
1858
- const s = (E = (b = v.value) == null ? void 0 : b.querySelector("svg")) != null ? E : null, o = s ? new XMLSerializer().serializeToString(s) : null, u = {
1859
- payload: { type: "open-modal" },
1860
- defaultPrevented: !1,
1861
- preventDefault() {
1862
- this.defaultPrevented = !0;
1863
- },
1864
- svgElement: s,
1865
- svgString: o
1866
- };
1867
- l("openModal", u), u.defaultPrevented || pn();
1868
- }
1869
- function Ot(s) {
1870
- const o = {
1871
- payload: { type: "toggle-mode", target: s },
1872
- defaultPrevented: !1,
1873
- preventDefault() {
1874
- this.defaultPrevented = !0;
1875
- }
1876
- };
1877
- l("toggleMode", s, o), o.defaultPrevented || Ft(s);
1878
- }
1879
- function Ft(s) {
1880
- return j(this, null, function* () {
1881
- const o = H.value;
1882
- if (!o) {
1883
- be.value = !0, Y.value = s === "source";
1884
- return;
1885
- }
1886
- const u = o.getBoundingClientRect().height;
1887
- o.style.height = `${u}px`, o.style.overflow = "hidden", be.value = !0, Y.value = s === "source", yield de();
1888
- const b = o.scrollHeight;
1889
- o.style.transition = "height 180ms ease", o.offsetHeight, o.style.height = `${b}px`;
1890
- const E = () => {
1891
- o.style.transition = "", o.style.height = "", o.style.overflow = "", o.removeEventListener("transitionend", _);
1892
- };
1893
- function _() {
1894
- E();
1895
- }
1896
- o.addEventListener("transitionend", _), setTimeout(() => E(), 220);
1897
- });
1898
- }
1899
- function xt() {
1900
- return j(this, null, function* () {
1901
- if (G.value)
1902
- return ut.value;
1903
- if (!v.value && (yield de(), !v.value)) {
1904
- console.warn("Mermaid container not ready");
1905
- return;
1906
- }
1907
- return G.value = !0, ut.value = j(null, null, function* () {
1908
- var s;
1909
- if (a) {
1910
- v.value && (v.value.style.opacity = "0");
1911
- try {
1912
- const o = `mermaid-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
1913
- !z.value && !ye.value && ((s = a.initialize) == null || s.call(a, {
1914
- securityLevel: "loose",
1915
- startOnLoad: !1
1916
- }));
1917
- const u = t.isDark ? "dark" : "light", b = ke(u), E = yield Ge(
1918
- () => a.render(
1919
- o,
1920
- b
1921
- // mermaidContent.value,
1922
- ),
1923
- { timeoutMs: x.value.fullRender }
1924
- ), _ = E == null ? void 0 : E.svg, P = E == null ? void 0 : E.bindFunctions;
1925
- if (v.value) {
1926
- v.value.innerHTML = _, P == null || P(v.value), !z.value && !ye.value && (_t(), z.value = !0, Oe.value = {
1927
- zoom: W.value,
1928
- translateX: Z.value,
1929
- translateY: S.value,
1930
- containerHeight: ae.value
1931
- });
1932
- const F = t.isDark ? "dark" : "light";
1933
- Re.value[F] = _, ye.value && (ye.value = !1), Ce.value = !1;
1934
- }
1935
- } catch (o) {
1936
- console.error("Failed to render mermaid diagram:", o), t.loading === !1 && it(o);
1937
- } finally {
1938
- yield de(), v.value && (v.value.style.opacity = "1"), G.value = !1, ut.value = null;
1939
- }
1940
- }
1941
- }), ut.value;
1942
- });
1943
- }
1944
- function En(s) {
1945
- return j(this, null, function* () {
1946
- if (Wt() && !(!v.value && (yield de(), !v.value)) && !G.value) {
1947
- G.value = !0;
1948
- try {
1949
- if (!a)
1950
- return;
1951
- const o = `mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, u = t.isDark ? "dark" : "light", b = fn(s), E = b && b.trim() ? b : s, _ = Vt(E, u);
1952
- v.value && (v.value.style.opacity = "0");
1953
- const P = yield Ge(
1954
- () => a.render(o, _),
1955
- { timeoutMs: x.value.render }
1956
- ), F = P == null ? void 0 : P.svg, je = P == null ? void 0 : P.bindFunctions;
1957
- v.value && F && (v.value.innerHTML = F, je == null || je(v.value), _t());
1958
- } catch (o) {
1959
- } finally {
1960
- yield de(), v.value && (v.value.style.opacity = "1"), G.value = !1;
1961
- }
1962
- }
1963
- });
1964
- }
1965
- const Ln = (qn = globalThis.requestIdleCallback) != null ? qn : ((s, o) => setTimeout(() => s({ didTimeout: !0 }), 16));
1966
- function Xt() {
1967
- return j(this, null, function* () {
1968
- var F, je;
1969
- const s = Date.now(), o = ++vt.value;
1970
- fe && fe.abort(), fe = new AbortController();
1971
- const u = fe.signal, b = t.isDark ? "dark" : "light", E = N.value, _ = E.replace(/\s+/g, "");
1972
- if (!E.trim()) {
1973
- v.value && (v.value.innerHTML = ""), at.value = null, Me.value = "", Ce.value = !1;
1974
- return;
1975
- }
1976
- if (_ === Me.value)
1977
- return;
1978
- try {
1979
- const ue = yield _n(E, b, { signal: u, timeoutMs: x.value.worker });
1980
- if (ue.fullOk) {
1981
- yield xt(), vt.value === o && (at.value = (je = (F = v.value) == null ? void 0 : F.innerHTML) != null ? je : null, Me.value = _, Ce.value = !1);
1982
- return;
1983
- }
1984
- const Lt = pt && s <= pt;
1985
- if (ue.prefixOk && ue.prefix && Wt() && !Lt) {
1986
- yield En(ue.prefix);
1987
- return;
1988
- }
1989
- } catch (ue) {
1990
- if ((ue == null ? void 0 : ue.name) === "AbortError")
1991
- return;
1992
- }
1993
- if (vt.value !== o || Ce.value)
1994
- return;
1995
- const P = Re.value[b];
1996
- P && v.value && (v.value.innerHTML = P);
1997
- });
1998
- }
1999
- const Yt = wn(() => {
2000
- Ln(() => {
2001
- Xt();
2002
- }, { timeout: 500 });
2003
- }, $a);
2004
- function bt() {
2005
- ce && (ce = !1, gt = 800, At = !1, xe && (xe.abort(), xe = null), T && (globalThis.clearTimeout(T), T = null), oe && (y(oe), oe = null), pt = Date.now());
2006
- }
2007
- function kn() {
2008
- if (bt(), fe) {
2009
- try {
2010
- fe.abort();
2011
- } catch (s) {
2012
- }
2013
- fe = null;
2014
- }
2015
- if (xe) {
2016
- try {
2017
- xe.abort();
2018
- } catch (s) {
2019
- }
2020
- xe = null;
2021
- }
2022
- oo();
2023
- }
2024
- function Nn(s = 800) {
2025
- ce && (T && globalThis.clearTimeout(T), T = globalThis.setTimeout(() => {
2026
- oe = Ln(() => j(null, null, function* () {
2027
- if (!ce)
2028
- return;
2029
- if (Y.value || z.value) {
2030
- bt();
2031
- return;
2032
- }
2033
- const o = t.isDark ? "dark" : "light", u = N.value;
2034
- if (!u.trim()) {
2035
- Nn(gt);
2036
- return;
2037
- }
2038
- xe && xe.abort(), xe = new AbortController();
2039
- try {
2040
- if ((yield It(u, o, { signal: xe.signal, timeoutMs: x.value.worker })) && (yield xt(), z.value)) {
2041
- bt();
2042
- return;
2043
- }
2044
- } catch (b) {
2045
- }
2046
- gt = Math.min(Math.floor(gt * 1.5), 4e3), Nn(gt);
2047
- }), { timeout: 500 });
2048
- }, s));
2049
- }
2050
- function Hn() {
2051
- ce || Y.value || z.value || (ce = !0, pt = 0, At = !0, Nn(500));
2052
- }
2053
- U(
2054
- () => N.value,
2055
- () => {
2056
- z.value = !1, Re.value = {}, Yt(), !Y.value && i.value && Hn(), f();
2057
- }
2058
- ), U(() => t.isDark, () => j(null, null, function* () {
2059
- if (!z.value || Ce.value)
2060
- return;
2061
- const s = t.isDark ? "dark" : "light";
2062
- if (Re.value[s]) {
2063
- v.value && (v.value.innerHTML = Re.value[s]);
2064
- return;
2065
- }
2066
- const o = {
2067
- zoom: W.value,
2068
- translateX: Z.value,
2069
- translateY: S.value,
2070
- containerHeight: ae.value
2071
- }, u = W.value !== 1 || Z.value !== 0 || S.value !== 0;
2072
- ye.value = !0, u && (W.value = 1, Z.value = 0, S.value = 0, yield de()), yield xt(), u && (yield de(), W.value = o.zoom, Z.value = o.translateX, S.value = o.translateY, ae.value = o.containerHeight, Oe.value = o);
2073
- })), U(
2074
- () => Y.value,
2075
- (s) => j(null, null, function* () {
2076
- if (s)
2077
- bt(), z.value && (Oe.value = {
2078
- zoom: W.value,
2079
- translateX: Z.value,
2080
- translateY: S.value,
2081
- containerHeight: ae.value
2082
- });
2083
- else {
2084
- if (Ce.value)
2085
- return;
2086
- const o = t.isDark ? "dark" : "light";
2087
- if (z.value && Re.value[o]) {
2088
- yield de(), v.value && (v.value.innerHTML = Re.value[o]), W.value = Oe.value.zoom, Z.value = Oe.value.translateX, S.value = Oe.value.translateY, ae.value = Oe.value.containerHeight;
2089
- return;
2090
- }
2091
- if (yield de(), !i.value)
2092
- return;
2093
- yield Xt(), Hn();
2094
- }
2095
- })
2096
- ), U(
2097
- () => t.loading,
2098
- (s, o) => j(null, null, function* () {
2099
- if (o === !0 && s === !1) {
2100
- const u = N.value.trim();
2101
- if (!u)
2102
- return kn();
2103
- const b = t.isDark ? "dark" : "light", E = u.replace(/\s+/g, "");
2104
- if (z.value && E === Me.value) {
2105
- yield de(), v.value && !v.value.querySelector("svg") && Re.value[b] && (v.value.innerHTML = Re.value[b]), kn();
2106
- return;
2107
- }
2108
- try {
2109
- yield It(u, b, { timeoutMs: x.value.worker }), yield xt(), Me.value = E, Ce.value = !1, kn();
2110
- } catch (_) {
2111
- kn(), it(_);
2112
- }
2113
- }
2114
- })
2115
- ), U(
2116
- c,
2117
- (s) => {
2118
- ne && ne.disconnect(), s && !z.value && !ye.value && (ne = new ResizeObserver((o) => {
2119
- o && o.length > 0 && !z.value && !ye.value && ea(() => {
2120
- const u = o[0].contentRect.width;
2121
- _t(u);
2122
- });
2123
- }), ne.observe(s));
2124
- },
2125
- { immediate: !0 }
2126
- ), vo(() => j(null, null, function* () {
2127
- yield de(), be.value || (Y.value = !i.value), K.value && (Yt(), ot.value = N.value.length);
2128
- })), U(
2129
- () => i.value,
2130
- (s) => {
2131
- be.value || (Y.value = !s);
2132
- }
2133
- ), U(
2134
- () => K.value,
2135
- (s) => {
2136
- s && (z.value || (Yt(), ot.value = N.value.length), !t.loading && !z.value && Yt());
2137
- },
2138
- { immediate: !1 }
2139
- ), Ao(() => {
2140
- Ke && clearTimeout(Ke), ne && ne.disconnect(), fe && (fe.abort(), fe = null), oo(), bt();
2141
- }), U(
2142
- () => h.value,
2143
- (s) => j(null, null, function* () {
2144
- s ? (bt(), fe && fe.abort()) : z.value || (yield de(), Yt(), Y.value || Hn());
2145
- }),
2146
- { immediate: !1 }
2147
- );
2148
- const yn = L(() => t.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");
2149
- return (s, o) => (d(), g("div", {
2150
- class: A(["my-4 rounded-lg border overflow-hidden shadow-sm", [
2151
- t.isDark ? "border-gray-700/30" : "border-gray-200",
2152
- { "is-rendering": t.loading }
2153
- ]])
2154
- }, [
2155
- t.showHeader ? (d(), g("div", {
2156
- key: 0,
2157
- class: A(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b", t.isDark ? "bg-gray-800 border-gray-700/30" : "bg-gray-50 border-gray-200"])
2158
- }, [
2159
- s.$slots["header-left"] ? (d(), g("div", sa, [
2160
- et(s.$slots, "header-left", {}, void 0, !0)
2161
- ])) : (d(), g("div", la, [
2162
- m("img", {
2163
- src: $(Qr),
2164
- class: "w-4 h-4 my-0",
2165
- alt: "Mermaid"
2166
- }, null, 8, ca),
2167
- m("span", {
2168
- class: A(["text-sm font-medium font-mono truncate", t.isDark ? "text-gray-400" : "text-gray-600"])
2169
- }, "Mermaid", 2)
2170
- ])),
2171
- s.$slots["header-center"] ? (d(), g("div", ua, [
2172
- et(s.$slots, "header-center", {}, void 0, !0)
2173
- ])) : t.showModeToggle && i.value ? (d(), g("div", {
2174
- key: 3,
2175
- class: A(["flex items-center space-x-1 rounded-md p-0.5", t.isDark ? "bg-gray-700" : "bg-gray-100"])
2176
- }, [
2177
- m("button", {
2178
- class: A(["px-2.5 py-1 text-xs rounded transition-colors", [
2179
- Y.value ? t.isDark ? "text-gray-400 hover:text-gray-200" : "text-gray-500 hover:text-gray-700" : t.isDark ? "bg-gray-600 text-gray-200 shadow-sm" : "bg-white text-gray-700 shadow-sm"
2180
- ]]),
2181
- onClick: o[0] || (o[0] = () => Ot("preview")),
2182
- onMouseenter: o[1] || (o[1] = (u) => J(u, $(r)("common.preview") || "Preview")),
2183
- onFocus: o[2] || (o[2] = (u) => J(u, $(r)("common.preview") || "Preview")),
2184
- onMouseleave: Q,
2185
- onBlur: Q
2186
- }, [
2187
- m("div", da, [
2188
- o[21] || (o[21] = m("svg", {
2189
- xmlns: "http://www.w3.org/2000/svg",
2190
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2191
- "aria-hidden": "true",
2192
- role: "img",
2193
- width: "1em",
2194
- height: "1em",
2195
- viewBox: "0 0 24 24",
2196
- class: "w-3 h-3"
2197
- }, [
2198
- m("g", {
2199
- fill: "none",
2200
- stroke: "currentColor",
2201
- "stroke-linecap": "round",
2202
- "stroke-linejoin": "round",
2203
- "stroke-width": "2"
2204
- }, [
2205
- m("path", { 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" }),
2206
- m("circle", {
2207
- cx: "12",
2208
- cy: "12",
2209
- r: "3"
2210
- })
2211
- ])
2212
- ], -1)),
2213
- m("span", null, ee($(r)("common.preview") || "Preview"), 1)
2214
- ])
2215
- ], 34),
2216
- m("button", {
2217
- class: A(["px-2.5 py-1 text-xs rounded transition-colors", [
2218
- Y.value ? t.isDark ? "bg-gray-600 text-gray-200 shadow-sm" : "bg-white text-gray-700 shadow-sm" : t.isDark ? "text-gray-400 hover:text-gray-200" : "text-gray-500 hover:text-gray-700"
2219
- ]]),
2220
- onClick: o[3] || (o[3] = () => Ot("source")),
2221
- onMouseenter: o[4] || (o[4] = (u) => J(u, $(r)("common.source") || "Source")),
2222
- onFocus: o[5] || (o[5] = (u) => J(u, $(r)("common.source") || "Source")),
2223
- onMouseleave: Q,
2224
- onBlur: Q
2225
- }, [
2226
- m("div", ma, [
2227
- o[22] || (o[22] = m("svg", {
2228
- xmlns: "http://www.w3.org/2000/svg",
2229
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2230
- "aria-hidden": "true",
2231
- role: "img",
2232
- width: "1em",
2233
- height: "1em",
2234
- viewBox: "0 0 24 24",
2235
- class: "w-3 h-3"
2236
- }, [
2237
- m("path", {
2238
- fill: "none",
2239
- stroke: "currentColor",
2240
- "stroke-linecap": "round",
2241
- "stroke-linejoin": "round",
2242
- "stroke-width": "2",
2243
- d: "m16 18l6-6l-6-6M8 6l-6 6l6 6"
2244
- })
2245
- ], -1)),
2246
- m("span", null, ee($(r)("common.source") || "Source"), 1)
2247
- ])
2248
- ], 34)
2249
- ], 2)) : se("", !0),
2250
- s.$slots["header-right"] ? (d(), g("div", ha, [
2251
- et(s.$slots, "header-right", {}, void 0, !0)
2252
- ])) : (d(), g("div", fa, [
2253
- t.showCollapseButton ? (d(), g("button", {
2254
- key: 0,
2255
- class: A(yn.value),
2256
- "aria-pressed": h.value,
2257
- onClick: o[6] || (o[6] = (u) => h.value = !h.value),
2258
- onMouseenter: o[7] || (o[7] = (u) => J(u, h.value ? $(r)("common.expand") || "Expand" : $(r)("common.collapse") || "Collapse")),
2259
- onFocus: o[8] || (o[8] = (u) => J(u, h.value ? $(r)("common.expand") || "Expand" : $(r)("common.collapse") || "Collapse")),
2260
- onMouseleave: Q,
2261
- onBlur: Q
2262
- }, [
2263
- (d(), g("svg", {
2264
- style: ze({ rotate: h.value ? "0deg" : "90deg" }),
2265
- xmlns: "http://www.w3.org/2000/svg",
2266
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2267
- "aria-hidden": "true",
2268
- role: "img",
2269
- width: "1em",
2270
- height: "1em",
2271
- viewBox: "0 0 24 24",
2272
- class: "w-3 h-3"
2273
- }, [...o[23] || (o[23] = [
2274
- m("path", {
2275
- fill: "none",
2276
- stroke: "currentColor",
2277
- "stroke-linecap": "round",
2278
- "stroke-linejoin": "round",
2279
- "stroke-width": "2",
2280
- d: "m9 18l6-6l-6-6"
2281
- }, null, -1)
2282
- ])], 4))
2283
- ], 42, va)) : se("", !0),
2284
- t.showCopyButton ? (d(), g("button", {
2285
- key: 1,
2286
- class: A(yn.value),
2287
- onClick: Xe,
2288
- onMouseenter: o[9] || (o[9] = (u) => Pt(u)),
2289
- onFocus: o[10] || (o[10] = (u) => Pt(u)),
2290
- onMouseleave: Q,
2291
- onBlur: Q
2292
- }, [
2293
- w.value ? (d(), g("svg", pa, [...o[25] || (o[25] = [
2294
- m("path", {
2295
- fill: "none",
2296
- stroke: "currentColor",
2297
- "stroke-linecap": "round",
2298
- "stroke-linejoin": "round",
2299
- "stroke-width": "2",
2300
- d: "M20 6L9 17l-5-5"
2301
- }, null, -1)
2302
- ])])) : (d(), g("svg", ga, [...o[24] || (o[24] = [
2303
- m("g", {
2304
- fill: "none",
2305
- stroke: "currentColor",
2306
- "stroke-linecap": "round",
2307
- "stroke-linejoin": "round",
2308
- "stroke-width": "2"
2309
- }, [
2310
- m("rect", {
2311
- width: "14",
2312
- height: "14",
2313
- x: "8",
2314
- y: "8",
2315
- rx: "2",
2316
- ry: "2"
2317
- }),
2318
- m("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
2319
- ], -1)
2320
- ])]))
2321
- ], 34)) : se("", !0),
2322
- t.showExportButton && i.value ? (d(), g("button", {
2323
- key: 2,
2324
- class: A(`${yn.value} ${kt.value ? "opacity-50 cursor-not-allowed" : ""}`),
2325
- disabled: kt.value,
2326
- onClick: Et,
2327
- onMouseenter: o[11] || (o[11] = (u) => J(u, $(r)("common.export") || "Export")),
2328
- onFocus: o[12] || (o[12] = (u) => J(u, $(r)("common.export") || "Export")),
2329
- onMouseleave: Q,
2330
- onBlur: Q
2331
- }, [...o[26] || (o[26] = [
2332
- m("svg", {
2333
- xmlns: "http://www.w3.org/2000/svg",
2334
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2335
- "aria-hidden": "true",
2336
- role: "img",
2337
- width: "1em",
2338
- height: "1em",
2339
- viewBox: "0 0 24 24",
2340
- class: "w-3 h-3"
2341
- }, [
2342
- m("g", {
2343
- fill: "none",
2344
- stroke: "currentColor",
2345
- "stroke-linecap": "round",
2346
- "stroke-linejoin": "round",
2347
- "stroke-width": "2"
2348
- }, [
2349
- m("path", { d: "M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2350
- m("path", { d: "m7 10l5 5l5-5" })
2351
- ])
2352
- ], -1)
2353
- ])], 42, wa)) : se("", !0),
2354
- t.showFullscreenButton && i.value ? (d(), g("button", {
2355
- key: 3,
2356
- class: A(`${yn.value} ${kt.value ? "opacity-50 cursor-not-allowed" : ""}`),
2357
- disabled: kt.value,
2358
- onClick: Sn,
2359
- onMouseenter: o[13] || (o[13] = (u) => J(u, Je.value ? $(r)("common.minimize") || "Minimize" : $(r)("common.open") || "Open")),
2360
- onFocus: o[14] || (o[14] = (u) => J(u, Je.value ? $(r)("common.minimize") || "Minimize" : $(r)("common.open") || "Open")),
2361
- onMouseleave: Q,
2362
- onBlur: Q
2363
- }, [
2364
- Je.value ? (d(), g("svg", xa, [...o[28] || (o[28] = [
2365
- m("path", {
2366
- fill: "none",
2367
- stroke: "currentColor",
2368
- "stroke-linecap": "round",
2369
- "stroke-linejoin": "round",
2370
- "stroke-width": "2",
2371
- d: "m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"
2372
- }, null, -1)
2373
- ])])) : (d(), g("svg", ya, [...o[27] || (o[27] = [
2374
- m("path", {
2375
- fill: "none",
2376
- stroke: "currentColor",
2377
- "stroke-linecap": "round",
2378
- "stroke-linejoin": "round",
2379
- "stroke-width": "2",
2380
- d: "M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"
2381
- }, null, -1)
2382
- ])]))
2383
- ], 42, ka)) : se("", !0)
2384
- ]))
2385
- ], 2)) : se("", !0),
2386
- an(m("div", {
2387
- ref_key: "modeContainerRef",
2388
- ref: H
2389
- }, [
2390
- Y.value ? (d(), g("div", {
2391
- key: 0,
2392
- class: A(["p-4", t.isDark ? "bg-gray-900" : "bg-gray-50"])
2393
- }, [
2394
- m("pre", {
2395
- class: A(["text-sm font-mono whitespace-pre-wrap", t.isDark ? "text-gray-300" : "text-gray-700"])
2396
- }, ee(N.value), 3)
2397
- ], 2)) : (d(), g("div", ba, [
2398
- t.showZoomControls ? (d(), g("div", Ma, [
2399
- m("div", Ca, [
2400
- m("button", {
2401
- class: A(["p-2 text-xs rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2402
- onClick: p,
2403
- onMouseenter: o[15] || (o[15] = (u) => J(u, $(r)("common.zoomIn") || "Zoom in")),
2404
- onFocus: o[16] || (o[16] = (u) => J(u, $(r)("common.zoomIn") || "Zoom in")),
2405
- onMouseleave: Q,
2406
- onBlur: Q
2407
- }, [...o[29] || (o[29] = [
2408
- m("svg", {
2409
- xmlns: "http://www.w3.org/2000/svg",
2410
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2411
- "aria-hidden": "true",
2412
- role: "img",
2413
- width: "1em",
2414
- height: "1em",
2415
- viewBox: "0 0 24 24",
2416
- class: "w-3 h-3"
2417
- }, [
2418
- m("g", {
2419
- fill: "none",
2420
- stroke: "currentColor",
2421
- "stroke-linecap": "round",
2422
- "stroke-linejoin": "round",
2423
- "stroke-width": "2"
2424
- }, [
2425
- m("circle", {
2426
- cx: "11",
2427
- cy: "11",
2428
- r: "8"
2429
- }),
2430
- m("path", { d: "m21 21l-4.35-4.35M11 8v6m-3-3h6" })
2431
- ])
2432
- ], -1)
2433
- ])], 34),
2434
- m("button", {
2435
- class: A(["p-2 text-xs rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2436
- onClick: C,
2437
- onMouseenter: o[17] || (o[17] = (u) => J(u, $(r)("common.zoomOut") || "Zoom out")),
2438
- onFocus: o[18] || (o[18] = (u) => J(u, $(r)("common.zoomOut") || "Zoom out")),
2439
- onMouseleave: Q,
2440
- onBlur: Q
2441
- }, [...o[30] || (o[30] = [
2442
- m("svg", {
2443
- xmlns: "http://www.w3.org/2000/svg",
2444
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2445
- "aria-hidden": "true",
2446
- role: "img",
2447
- width: "1em",
2448
- height: "1em",
2449
- viewBox: "0 0 24 24",
2450
- class: "w-3 h-3"
2451
- }, [
2452
- m("g", {
2453
- fill: "none",
2454
- stroke: "currentColor",
2455
- "stroke-linecap": "round",
2456
- "stroke-linejoin": "round",
2457
- "stroke-width": "2"
2458
- }, [
2459
- m("circle", {
2460
- cx: "11",
2461
- cy: "11",
2462
- r: "8"
2463
- }),
2464
- m("path", { d: "m21 21l-4.35-4.35M8 11h6" })
2465
- ])
2466
- ], -1)
2467
- ])], 34),
2468
- m("button", {
2469
- class: A(["p-2 text-xs rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2470
- onClick: q,
2471
- onMouseenter: o[19] || (o[19] = (u) => J(u, $(r)("common.resetZoom") || "Reset zoom")),
2472
- onFocus: o[20] || (o[20] = (u) => J(u, $(r)("common.resetZoom") || "Reset zoom")),
2473
- onMouseleave: Q,
2474
- onBlur: Q
2475
- }, ee(Math.round(W.value * 100)) + "% ", 35)
2476
- ])
2477
- ])) : se("", !0),
2478
- m("div", {
2479
- ref_key: "mermaidContainer",
2480
- ref: c,
2481
- class: A(["min-h-[360px] relative transition-all duration-100 overflow-hidden block", t.isDark ? "bg-gray-900" : "bg-gray-50"]),
2482
- style: ze({ height: ae.value }),
2483
- onWheel: st,
2484
- onMousedown: R,
2485
- onMousemove: Be,
2486
- onMouseup: Fe,
2487
- onMouseleave: Fe,
2488
- onTouchstartPassive: R,
2489
- onTouchmovePassive: Be,
2490
- onTouchendPassive: Fe
2491
- }, [
2492
- m("div", {
2493
- ref_key: "mermaidWrapper",
2494
- ref: k,
2495
- "data-mermaid-wrapper": "",
2496
- class: A(["absolute inset-0 cursor-grab", { "cursor-grabbing": le.value }]),
2497
- style: ze(Kt.value)
2498
- }, [
2499
- m("div", {
2500
- ref_key: "mermaidContent",
2501
- ref: v,
2502
- class: "_mermaid w-full text-center flex items-center justify-center min-h-full"
2503
- }, null, 512)
2504
- ], 6)
2505
- ], 38),
2506
- (d(), me(mo, { to: "body" }, [
2507
- Ue(hn, {
2508
- name: "mermaid-dialog",
2509
- appear: ""
2510
- }, {
2511
- default: Tt(() => [
2512
- Je.value ? (d(), g("div", {
2513
- key: 0,
2514
- class: "fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",
2515
- onClick: Po(St, ["self"])
2516
- }, [
2517
- m("div", {
2518
- class: A(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden", t.isDark ? "bg-gray-900" : "bg-white"])
2519
- }, [
2520
- m("div", Ba, [
2521
- m("button", {
2522
- class: A(["p-2 text-xs rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2523
- onClick: p
2524
- }, [...o[31] || (o[31] = [
2525
- m("svg", {
2526
- xmlns: "http://www.w3.org/2000/svg",
2527
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2528
- "aria-hidden": "true",
2529
- role: "img",
2530
- width: "1em",
2531
- height: "1em",
2532
- viewBox: "0 0 24 24",
2533
- class: "w-3 h-3"
2534
- }, [
2535
- m("g", {
2536
- fill: "none",
2537
- stroke: "currentColor",
2538
- "stroke-linecap": "round",
2539
- "stroke-linejoin": "round",
2540
- "stroke-width": "2"
2541
- }, [
2542
- m("circle", {
2543
- cx: "11",
2544
- cy: "11",
2545
- r: "8"
2546
- }),
2547
- m("path", { d: "m21 21l-4.35-4.35M11 8v6m-3-3h6" })
2548
- ])
2549
- ], -1)
2550
- ])], 2),
2551
- m("button", {
2552
- class: A(["p-2 text-xs rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2553
- onClick: C
2554
- }, [...o[32] || (o[32] = [
2555
- m("svg", {
2556
- xmlns: "http://www.w3.org/2000/svg",
2557
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2558
- "aria-hidden": "true",
2559
- role: "img",
2560
- width: "1em",
2561
- height: "1em",
2562
- viewBox: "0 0 24 24",
2563
- class: "w-3 h-3"
2564
- }, [
2565
- m("g", {
2566
- fill: "none",
2567
- stroke: "currentColor",
2568
- "stroke-linecap": "round",
2569
- "stroke-linejoin": "round",
2570
- "stroke-width": "2"
2571
- }, [
2572
- m("circle", {
2573
- cx: "11",
2574
- cy: "11",
2575
- r: "8"
2576
- }),
2577
- m("path", { d: "m21 21l-4.35-4.35M8 11h6" })
2578
- ])
2579
- ], -1)
2580
- ])], 2),
2581
- m("button", {
2582
- class: A(["p-2 text-xs rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2583
- onClick: q
2584
- }, ee(Math.round(W.value * 100)) + "% ", 3),
2585
- m("button", {
2586
- class: A(["inline-flex items-center justify-center p-2 rounded transition-colors", [t.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"]]),
2587
- onClick: St
2588
- }, [...o[33] || (o[33] = [
2589
- m("svg", {
2590
- xmlns: "http://www.w3.org/2000/svg",
2591
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
2592
- "aria-hidden": "true",
2593
- role: "img",
2594
- width: "1em",
2595
- height: "1em",
2596
- viewBox: "0 0 24 24",
2597
- class: "w-3 h-3"
2598
- }, [
2599
- m("path", {
2600
- fill: "none",
2601
- stroke: "currentColor",
2602
- "stroke-linecap": "round",
2603
- "stroke-linejoin": "round",
2604
- "stroke-width": "2",
2605
- d: "M18 6L6 18M6 6l12 12"
2606
- })
2607
- ], -1)
2608
- ])], 2)
2609
- ]),
2610
- m("div", {
2611
- ref_key: "modalContent",
2612
- ref: B,
2613
- class: "w-full h-full flex items-center justify-center p-4 overflow-hidden",
2614
- onWheel: st,
2615
- onMousedown: R,
2616
- onMousemove: Be,
2617
- onMouseup: Fe,
2618
- onMouseleave: Fe,
2619
- onTouchstart: R,
2620
- onTouchmove: Be,
2621
- onTouchend: Fe
2622
- }, null, 544)
2623
- ], 2)
2624
- ])) : se("", !0)
2625
- ]),
2626
- _: 1
2627
- })
2628
- ]))
2629
- ]))
2630
- ], 512), [
2631
- [sn, !h.value]
2632
- ])
2633
- ], 2));
2634
- }
2635
- }), Ht = /* @__PURE__ */ X(Ia, [["__scopeId", "data-v-68e87d14"]]);
2636
- Ht.install = (e) => {
2637
- e.component(Ht.__name, Ht);
2638
- };
2639
- const _a = {
2640
- dir: "auto",
2641
- class: "paragraph-node"
2642
- }, Sa = /* @__PURE__ */ V({
2643
- __name: "ParagraphNode",
2644
- props: {
2645
- node: {},
2646
- customId: {},
2647
- indexKey: {}
2648
- },
2649
- setup(e) {
2650
- const n = e, t = ie({
2651
- inline_code: _e,
2652
- image: mt,
2653
- link: Ne,
2654
- hardbreak: Bt,
2655
- emphasis: We,
2656
- strong: Ee,
2657
- strikethrough: Le,
2658
- highlight: Ve,
2659
- insert: Pe,
2660
- subscript: Ae,
2661
- superscript: De,
2662
- emoji: Te,
2663
- checkbox: tt,
2664
- math_inline: nt,
2665
- checkbox_input: tt,
2666
- reference: Se,
2667
- footnote_anchor: Nt,
2668
- footnote_reference: Ie
2669
- }, Ze(n.customId)), l = bo();
2670
- return (r, a) => (d(), g("p", _a, [
2671
- (d(!0), g(re, null, pe(e.node.children, (i, w) => (d(), g(re, {
2672
- key: `${e.indexKey || "paragraph"}-${w}`
2673
- }, [
2674
- i.type !== "text" ? (d(), me(He(t[i.type]), {
2675
- key: 0,
2676
- node: i,
2677
- "index-key": `${e.indexKey}-${w}`,
2678
- "custom-id": n.customId
2679
- }, null, 8, ["node", "index-key", "custom-id"])) : (d(), g("span", {
2680
- key: 1,
2681
- class: A([[$(l) && i.center ? "text-node-center" : ""], "whitespace-pre-wrap break-words text-node"])
2682
- }, ee(i.content), 3))
2683
- ], 64))), 128))
2684
- ]));
2685
- }
2686
- }), tn = /* @__PURE__ */ X(Sa, [["__scopeId", "data-v-e7323e31"]]);
2687
- tn.install = (e) => {
2688
- e.component(tn.__name, tn);
2689
- };
2690
- const Ea = ["aria-busy", "aria-label", "data-language"], La = ["textContent"], Rt = /* @__PURE__ */ V({
2691
- __name: "PreCodeNode",
2692
- props: {
2693
- node: {}
2694
- },
2695
- setup(e) {
2696
- const n = e, t = L(() => {
2697
- var h, c, k;
2698
- const a = String((c = (h = n.node) == null ? void 0 : h.language) != null ? c : "");
2699
- return String((k = String(a).split(/\s+/g)[0]) != null ? k : "").toLowerCase().replace(/[^\w-]/g, "") || "plaintext";
2700
- }), l = L(() => `language-${t.value}`), r = L(() => {
2701
- const a = t.value;
2702
- return a ? `Code block: ${a}` : "Code block";
2703
- });
2704
- return (a, i) => (d(), g("pre", {
2705
- class: A([l.value]),
2706
- "aria-busy": e.node.loading === !0,
2707
- "aria-label": r.value,
2708
- "data-language": t.value,
2709
- tabindex: "0"
2710
- }, [
2711
- i[0] || (i[0] = Gn(" ", -1)),
2712
- m("code", {
2713
- translate: "no",
2714
- textContent: ee(e.node.code)
2715
- }, null, 8, La),
2716
- i[1] || (i[1] = Gn(`
2717
- `, -1))
2718
- ], 10, Ea));
2719
- }
2720
- });
2721
- Rt.install = (e) => {
2722
- e.component(Rt.__name, Rt);
2723
- };
2724
- const Na = { class: "table-node-wrapper" }, Ha = ["aria-busy"], Ra = { class: "border-[var(--table-border,#cbd5e1)]" }, ja = { class: "border-b" }, za = {
2725
- key: 0,
2726
- class: "table-node__loading",
2727
- role: "status",
2728
- "aria-live": "polite"
2729
- }, Da = /* @__PURE__ */ V({
2730
- __name: "TableNode",
2731
- props: {
2732
- node: {},
2733
- indexKey: {},
2734
- isDark: { type: Boolean },
2735
- typewriter: { type: Boolean }
2736
- },
2737
- emits: ["copy"],
2738
- setup(e) {
2739
- const n = e, t = L(() => {
2740
- var i, w, h, c;
2741
- return (c = (h = (w = (i = n.node) == null ? void 0 : i.header) == null ? void 0 : w.cells) == null ? void 0 : h.length) != null ? c : 0;
2742
- }), l = L(() => {
2743
- const i = t.value || 1, w = Math.floor(100 / i);
2744
- return Array.from({ length: i }).map(
2745
- (h, c) => c === i - 1 ? `${100 - w * (i - 1)}%` : `${w}%`
2746
- );
2747
- }), r = L(() => {
2748
- var i;
2749
- return (i = n.node.loading) != null ? i : !1;
2750
- }), a = L(() => {
2751
- var i;
2752
- return (i = n.node.rows) != null ? i : [];
2753
- });
2754
- return (i, w) => (d(), g("div", Na, [
2755
- m("table", {
2756
- class: A(["w-full my-8 text-sm table-fixed table-node", { "table-node--loading": r.value }]),
2757
- "aria-busy": r.value
2758
- }, [
2759
- m("colgroup", null, [
2760
- (d(!0), g(re, null, pe(l.value, (h, c) => (d(), g("col", {
2761
- key: `col-${c}`,
2762
- style: ze({ width: h })
2763
- }, null, 4))), 128))
2764
- ]),
2765
- m("thead", Ra, [
2766
- m("tr", ja, [
2767
- (d(!0), g(re, null, pe(e.node.header.cells, (h, c) => (d(), g("th", {
2768
- key: `header-${c}`,
2769
- dir: "auto",
2770
- class: A(["font-semibold p-[calc(4/7*1em)] overflow-x-auto", [
2771
- h.align === "right" ? "text-right" : h.align === "center" ? "text-center" : "text-left"
2772
- ]])
2773
- }, [
2774
- Ue($(qe), {
2775
- nodes: h.children,
2776
- "index-key": `table-th-${e.indexKey}`,
2777
- typewriter: n.typewriter,
2778
- onCopy: w[0] || (w[0] = (k) => i.$emit("copy", k))
2779
- }, null, 8, ["nodes", "index-key", "typewriter"])
2780
- ], 2))), 128))
2781
- ])
2782
- ]),
2783
- m("tbody", null, [
2784
- (d(!0), g(re, null, pe(a.value, (h, c) => (d(), g("tr", {
2785
- key: `row-${c}`,
2786
- class: A(["border-[var(--table-border,#cbd5e1)]", [c < a.value.length - 1 ? "border-b" : ""]])
2787
- }, [
2788
- (d(!0), g(re, null, pe(h.cells, (k, v) => (d(), g("td", {
2789
- key: `cell-${c}-${v}`,
2790
- class: A(["p-[calc(4/7*1em)] overflow-x-auto", [
2791
- k.align === "right" ? "text-right" : k.align === "center" ? "text-center" : "text-left"
2792
- ]]),
2793
- dir: "auto"
2794
- }, [
2795
- Ue($(qe), {
2796
- nodes: k.children,
2797
- "index-key": `table-td-${e.indexKey}`,
2798
- typewriter: n.typewriter,
2799
- onCopy: w[1] || (w[1] = (B) => i.$emit("copy", B))
2800
- }, null, 8, ["nodes", "index-key", "typewriter"])
2801
- ], 2))), 128))
2802
- ], 2))), 128))
2803
- ])
2804
- ], 10, Ha),
2805
- Ue(hn, { name: "table-node-fade" }, {
2806
- default: Tt(() => [
2807
- r.value ? (d(), g("div", za, [
2808
- et(i.$slots, "loading", { isLoading: r.value }, () => [
2809
- w[2] || (w[2] = m("span", {
2810
- class: "table-node__spinner animate-spin",
2811
- "aria-hidden": "true"
2812
- }, null, -1)),
2813
- w[3] || (w[3] = m("span", { class: "sr-only" }, "Loading", -1))
2814
- ], !0)
2815
- ])) : se("", !0)
2816
- ]),
2817
- _: 3
2818
- })
2819
- ]));
2820
- }
2821
- }), nn = /* @__PURE__ */ X(Da, [["__scopeId", "data-v-50ef14ca"]]);
2822
- nn.install = (e) => {
2823
- e.component(nn.__name, nn);
2824
- };
2825
- const Aa = {}, Pa = { class: "hr-node" };
2826
- function Va(e, n) {
2827
- return d(), g("hr", Pa);
2828
- }
2829
- const on = /* @__PURE__ */ X(Aa, [["render", Va], ["__scopeId", "data-v-639cbad9"]]);
2830
- on.install = (e) => {
2831
- e.component(on.__name, on);
2832
- };
2833
- const Wa = {
2834
- key: 1,
2835
- class: "html-block-node__placeholder"
2836
- }, Ka = /* @__PURE__ */ V({
2837
- __name: "HtmlBlockNode",
2838
- props: {
2839
- node: {}
2840
- },
2841
- setup(e) {
2842
- const n = e, t = L(() => {
2843
- const c = n.node.attrs;
2844
- if (c) {
2845
- if (Array.isArray(c)) {
2846
- const k = {};
2847
- for (const v of c) {
2848
- if (!v || v.length < 2)
2849
- continue;
2850
- const [B, I] = v;
2851
- B != null && (k[String(B)] = I == null ? "" : String(I));
2852
- }
2853
- return k;
2854
- }
2855
- return c;
2856
- }
2857
- }), l = M(null), r = M(typeof window == "undefined"), a = M(n.node.content), i = On(), w = M(null), h = !!n.node.loading;
2858
- return typeof window != "undefined" ? (U(
2859
- l,
2860
- (c) => {
2861
- var v, B;
2862
- if ((B = (v = w.value) == null ? void 0 : v.destroy) == null || B.call(v), w.value = null, !h) {
2863
- r.value = !0, a.value = n.node.content;
2864
- return;
2865
- }
2866
- if (!c) {
2867
- r.value = !1;
2868
- return;
2869
- }
2870
- const k = i(c, { rootMargin: "400px" });
2871
- w.value = k, r.value = k.isVisible.value, k.whenVisible.then(() => {
2872
- r.value = !0;
2873
- });
2874
- },
2875
- { immediate: !0 }
2876
- ), U(
2877
- () => n.node.content,
2878
- (c) => {
2879
- (!h || r.value) && (a.value = c);
2880
- }
2881
- )) : r.value = !0, mn(() => {
2882
- var c, k;
2883
- (k = (c = w.value) == null ? void 0 : c.destroy) == null || k.call(c), w.value = null;
2884
- }), (c, k) => (d(), g("div", jt({
2885
- ref_key: "htmlRef",
2886
- ref: l,
2887
- class: "html-block-node"
2888
- }, t.value), [
2889
- r.value ? zt([a.value], () => (d(), g("div", {
2890
- key: 0,
2891
- innerHTML: a.value
2892
- }, null, 8, ["innerHTML"])), k, 0) : (d(), g("div", Wa, [
2893
- et(c.$slots, "placeholder", { node: e.node }, () => [
2894
- k[1] || (k[1] = m("span", { class: "html-block-node__placeholder-bar" }, null, -1)),
2895
- k[2] || (k[2] = m("span", { class: "html-block-node__placeholder-bar w-4/5" }, null, -1)),
2896
- k[3] || (k[3] = m("span", { class: "html-block-node__placeholder-bar w-2/3" }, null, -1))
2897
- ], !0)
2898
- ]))
2899
- ], 16));
2900
- }
2901
- }), Oa = /* @__PURE__ */ X(Ka, [["__scopeId", "data-v-ed22b926"]]), Fa = { class: "unknown-node" }, ro = /* @__PURE__ */ V({
2902
- __name: "FallbackComponent",
2903
- props: {
2904
- node: {}
2905
- },
2906
- setup(e) {
2907
- return (n, t) => (d(), g("div", Fa, ee(e.node.raw), 1));
2908
- }
2909
- }), Xa = ["data-node-index", "data-node-type"], Ya = /* @__PURE__ */ V({
2910
- __name: "NodeRenderer",
2911
- props: {
2912
- content: {},
2913
- nodes: {},
2914
- parseOptions: {},
2915
- customMarkdownIt: {},
2916
- viewportPriority: { type: Boolean },
2917
- codeBlockStream: { type: Boolean, default: !0 },
2918
- codeBlockDarkTheme: {},
2919
- codeBlockLightTheme: {},
2920
- codeBlockMonacoOptions: {},
2921
- renderCodeBlocksAsPre: { type: Boolean },
2922
- codeBlockMinWidth: {},
2923
- codeBlockMaxWidth: {},
2924
- codeBlockProps: {},
2925
- themes: {},
2926
- isDark: { type: Boolean },
2927
- customId: {},
2928
- indexKey: {},
2929
- typewriter: { type: Boolean, default: !0 },
2930
- batchRendering: { type: Boolean, default: !0 },
2931
- initialRenderBatchSize: { default: 40 },
2932
- renderBatchSize: { default: 80 },
2933
- renderBatchDelay: { default: 16 },
2934
- renderBatchBudgetMs: { default: 6 },
2935
- renderBatchIdleTimeoutMs: { default: 120 },
2936
- deferNodesUntilVisible: { type: Boolean, default: !0 },
2937
- maxLiveNodes: { default: 320 },
2938
- liveNodeBuffer: { default: 60 }
2939
- },
2940
- emits: ["copy", "handleArtifactClick", "click", "mouseover", "mouseout"],
2941
- setup(e, { emit: n }) {
2942
- var pn, St, wn;
2943
- const t = e, l = n, r = M(), a = M(t.viewportPriority !== !1), i = dr(() => r.value, a), w = Eo(), h = L(() => t.customMarkdownIt ? t.customMarkdownIt(w) : w), c = L(() => {
2944
- var f;
2945
- if ((f = t.nodes) != null && f.length)
2946
- return Jn(t.nodes.slice());
2947
- if (t.content) {
2948
- const p = Lo(t.content, h.value, t.parseOptions);
2949
- return Jn(p);
2950
- }
2951
- return [];
2952
- }), k = typeof window != "undefined", v = k && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame.bind(window) : null, B = k && typeof window.cancelAnimationFrame == "function" ? window.cancelAnimationFrame.bind(window) : null, I = typeof globalThis != "undefined" && typeof globalThis.process != "undefined" && ((St = (pn = globalThis.process) == null ? void 0 : pn.env) == null ? void 0 : St.NODE_ENV) === "test", O = k && typeof window.requestIdleCallback == "function", D = L(() => {
2953
- var p;
2954
- const f = Math.trunc((p = t.renderBatchSize) != null ? p : 80);
2955
- return Number.isFinite(f) ? Math.max(0, f) : 0;
2956
- }), K = L(() => {
2957
- var p;
2958
- const f = Math.trunc((p = t.initialRenderBatchSize) != null ? p : D.value);
2959
- return Number.isFinite(f) ? Math.max(0, f) : D.value;
2960
- }), H = L(() => t.batchRendering !== !1 && D.value > 0 && k && !I), N = M(0), ke = M({
2961
- key: t.indexKey,
2962
- total: 0
2963
- }), W = M({
2964
- batchSize: D.value,
2965
- initial: K.value,
2966
- delay: (wn = t.renderBatchDelay) != null ? wn : 16,
2967
- enabled: H.value
2968
- }), Z = ho([]), S = M(Math.max(1, D.value || 1)), le = bn({}), te = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), be = L(() => t.deferNodesUntilVisible !== !1 && a.value !== !1), G = L(() => {
2969
- var f;
2970
- return ((f = t.maxLiveNodes) != null ? f : 0) > 0;
2971
- }), ut = L(() => !!i && (be.value || G.value)), ot = L(() => {
2972
- var f;
2973
- return Math.max(1, (f = t.maxLiveNodes) != null ? f : 320);
2974
- }), rt = L(() => {
2975
- var f;
2976
- return Math.max(0, (f = t.liveNodeBuffer) != null ? f : 60);
2977
- }), Ke = M(0), ae = bn({ start: 0, end: 0 }), ne = /* @__PURE__ */ new Map(), z = L(() => {
2978
- if (!G.value)
2979
- return c.value.length;
2980
- const f = rt.value, p = Math.max(ae.end + f, K.value), C = Math.min(c.value.length, p);
2981
- return Math.max(N.value, C);
2982
- });
2983
- function ye(f, p, C) {
2984
- return Math.min(Math.max(f, p), C);
2985
- }
2986
- function Re() {
2987
- const f = c.value.length;
2988
- if (!G.value || f === 0) {
2989
- ae.start = 0, ae.end = f;
2990
- return;
2991
- }
2992
- const p = Math.min(ot.value, f), C = rt.value, q = ye(Ke.value - C, 0, Math.max(0, f - p));
2993
- ae.start = q, ae.end = Math.min(f, q + p);
2994
- }
2995
- const at = bn({}), Me = bn({ total: 0, count: 0 });
2996
- function vt(f, p) {
2997
- if (!Number.isFinite(p) || p <= 0)
2998
- return;
2999
- const C = at[f];
3000
- at[f] = p, C ? Me.total += p - C : (Me.total += p, Me.count++);
3001
- }
3002
- const fe = L(() => Me.count > 0 ? Math.max(12, Me.total / Me.count) : 32);
3003
- function Ce(f, p) {
3004
- var q;
3005
- if (f >= p)
3006
- return 0;
3007
- let C = 0;
3008
- for (let R = f; R < p; R++)
3009
- C += (q = at[R]) != null ? q : fe.value;
3010
- return C;
3011
- }
3012
- const Oe = L(() => {
3013
- if (!G.value)
3014
- return c.value.map((q, R) => ({ node: q, index: R }));
3015
- const f = c.value.length, p = ye(ae.start, 0, f), C = ye(ae.end, p, f);
3016
- return c.value.slice(p, C).map((q, R) => ({
3017
- node: q,
3018
- index: p + R
3019
- }));
3020
- }), x = L(() => G.value ? Ce(0, Math.min(ae.start, c.value.length)) : 0), y = L(() => {
3021
- if (!G.value)
3022
- return 0;
3023
- const f = c.value.length, p = Math.min(ae.end, f);
3024
- return Ce(p, f);
3025
- });
3026
- function T() {
3027
- const f = c.value.length, p = Math.min(f, N.value);
3028
- if (p <= 0) {
3029
- Z.value = [], oe(0);
3030
- return;
3031
- }
3032
- if (p >= f) {
3033
- Z.value = c.value, oe(p);
3034
- return;
3035
- }
3036
- Z.value = c.value.slice(0, p), oe(p);
3037
- }
3038
- function oe(f) {
3039
- if (te.size)
3040
- for (const [p, C] of te)
3041
- p >= f && (C.destroy(), te.delete(p), be.value && delete le[p], Y.delete(p));
3042
- }
3043
- function ce(f, p) {
3044
- be.value && (le[f] = p), p && (Ke.value = ye(f, 0, Math.max(0, c.value.length - 1)));
3045
- }
3046
- function gt(f) {
3047
- return !be.value || f < K.value ? !0 : le[f] === !0;
3048
- }
3049
- function xe(f) {
3050
- const p = te.get(f);
3051
- p && (p.destroy(), te.delete(f));
3052
- }
3053
- function pt(f, p) {
3054
- if (p ? Y.set(f, p) : Y.delete(f), !ut.value || !i) {
3055
- xe(f), p ? ce(f, !0) : be.value && delete le[f];
3056
- return;
3057
- }
3058
- if (f < K.value && !G.value) {
3059
- xe(f), ce(f, !0);
3060
- return;
3061
- }
3062
- if (!p) {
3063
- xe(f), be.value && delete le[f];
3064
- return;
3065
- }
3066
- xe(f);
3067
- const C = i(p, { rootMargin: "400px" });
3068
- C && (te.set(f, C), ce(f, C.isVisible.value), C.whenVisible.then(() => {
3069
- ce(f, !0);
3070
- }).catch(() => {
3071
- }));
3072
- }
3073
- function At(f, p) {
3074
- if (!p) {
3075
- ne.delete(f);
3076
- return;
3077
- }
3078
- ne.set(f, p), queueMicrotask(() => {
3079
- vt(f, p.offsetHeight);
3080
- });
3081
- }
3082
- let Ge = null, it = null, wt = !1, J = null, Q = null;
3083
- function Pt() {
3084
- k && (Ge != null && (B == null || B(Ge), Ge = null), it != null && (window.clearTimeout(it), it = null), Q != null && typeof window.cancelIdleCallback == "function" && (window.cancelIdleCallback(Q), Q = null), wt = !1, J = null);
3085
- }
3086
- function Vt(f, p = {}) {
3087
- var Fe, st;
3088
- if (!H.value)
3089
- return;
3090
- const C = z.value;
3091
- if (N.value >= C)
3092
- return;
3093
- const q = Math.max(1, f), R = (Xe) => {
3094
- var Ft;
3095
- Ge = null, it = null, Q = null, wt = !1;
3096
- const yt = J != null ? J : q;
3097
- J = null;
3098
- const Et = Math.max(2, (Ft = t.renderBatchBudgetMs) != null ? Ft : 6), Sn = (xt) => {
3099
- const En = typeof performance != "undefined" ? performance.now() : Date.now();
3100
- N.value = Math.min(C, N.value + Math.max(1, xt)), T();
3101
- const Xt = (typeof performance != "undefined" ? performance.now() : Date.now()) - En;
3102
- return fn(Xt), Xt;
3103
- };
3104
- let Ot = yt;
3105
- for (; Sn(Ot), !(N.value >= C || !Xe || (typeof Xe.timeRemaining == "function" ? Xe.timeRemaining() : 0) <= Et * 0.5); )
3106
- Ot = Math.max(1, Math.round(S.value));
3107
- N.value < C && Wt();
3108
- };
3109
- if (!k || p.immediate) {
3110
- R();
3111
- return;
3112
- }
3113
- const Be = Math.max(0, (Fe = t.renderBatchDelay) != null ? Fe : 16);
3114
- if (J = J != null ? Math.max(J, q) : q, !wt) {
3115
- if (wt = !0, !I && O && window.requestIdleCallback) {
3116
- const Xe = Math.max(0, (st = t.renderBatchIdleTimeoutMs) != null ? st : 120);
3117
- Q = window.requestIdleCallback((yt) => {
3118
- R(yt);
3119
- }, { timeout: Xe });
3120
- return;
3121
- }
3122
- if (!v || I) {
3123
- it = window.setTimeout(() => R(), Be);
3124
- return;
3125
- }
3126
- Ge = v(() => {
3127
- if (Be === 0) {
3128
- R();
3129
- return;
3130
- }
3131
- it = window.setTimeout(() => R(), Be);
3132
- });
3133
- }
3134
- }
3135
- function Wt() {
3136
- const f = H.value ? Math.max(1, Math.round(S.value)) : Math.max(1, D.value);
3137
- Vt(f);
3138
- }
3139
- function fn(f) {
3140
- var R;
3141
- if (!H.value)
3142
- return;
3143
- const p = Math.max(2, (R = t.renderBatchBudgetMs) != null ? R : 6), C = Math.max(1, D.value || 1), q = Math.max(1, Math.floor(C / 4));
3144
- f > p * 1.2 ? S.value = Math.max(q, Math.floor(S.value * 0.7)) : f < p * 0.5 && S.value < C && (S.value = Math.min(C, Math.ceil(S.value * 1.2)));
3145
- }
3146
- U(
3147
- [
3148
- () => c.value,
3149
- () => c.value.length,
3150
- () => H.value,
3151
- () => D.value,
3152
- () => K.value,
3153
- () => t.renderBatchDelay,
3154
- () => t.indexKey
3155
- ],
3156
- () => {
3157
- var Et;
3158
- const p = c.value.length, C = ke.value, q = t.indexKey, R = q !== void 0 ? q !== C.key : p !== C.total;
3159
- ke.value = { key: q, total: p };
3160
- const Be = W.value, Fe = (Et = t.renderBatchDelay) != null ? Et : 16, st = Be.batchSize !== D.value || Be.initial !== K.value || Be.delay !== Fe || Be.enabled !== H.value;
3161
- W.value = {
3162
- batchSize: D.value,
3163
- initial: K.value,
3164
- delay: Fe,
3165
- enabled: H.value
3166
- }, (R || st || !H.value) && Pt(), (R || st) && (S.value = Math.max(1, D.value || 1));
3167
- const Xe = z.value;
3168
- if (!p) {
3169
- N.value = 0, T();
3170
- return;
3171
- }
3172
- if (!H.value) {
3173
- N.value = Xe, T();
3174
- return;
3175
- }
3176
- R || st ? N.value = Math.min(Xe, K.value) : N.value = Math.min(N.value, Xe);
3177
- const yt = Math.max(1, K.value || D.value || p);
3178
- N.value < Xe ? Vt(yt, { immediate: !k }) : T();
3179
- },
3180
- { immediate: !0 }
3181
- ), U(
3182
- () => be.value,
3183
- (f) => {
3184
- if (!f) {
3185
- for (const p of te.values())
3186
- p.destroy();
3187
- te.clear();
3188
- for (const p of Object.keys(le))
3189
- delete le[p];
3190
- for (const [p, C] of Y)
3191
- C && ce(p, !0);
3192
- return;
3193
- }
3194
- for (const [p, C] of Y)
3195
- pt(p, C);
3196
- },
3197
- { immediate: !1 }
3198
- ), U(
3199
- () => N.value,
3200
- (f, p) => {
3201
- G.value && (typeof p == "number" && f <= p || f > 0 && (Ke.value = f - 1));
3202
- }
3203
- ), U(
3204
- [Ke, ot, rt, () => c.value.length, G],
3205
- () => {
3206
- Re();
3207
- },
3208
- { immediate: !0 }
3209
- ), U(
3210
- () => z.value,
3211
- (f, p) => {
3212
- H.value && (typeof p == "number" && f <= p || f > N.value && Wt());
3213
- }
3214
- ), mn(() => {
3215
- Pt();
3216
- for (const f of te.values())
3217
- f.destroy();
3218
- te.clear();
3219
- });
3220
- const vn = Dt(() => j(null, null, function* () {
3221
- try {
3222
- return (yield import("./index-BM9Oro93.js")).default;
3223
- } catch (f) {
3224
- return console.warn(
3225
- '[markstream-vue] 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".',
3226
- f
3227
- ), Rt;
3228
- }
3229
- })), It = L(() => t.renderCodeBlocksAsPre ? Rt : vn), _n = {
3230
- text: we,
3231
- paragraph: tn,
3232
- heading: Xn,
3233
- code_block: vn,
3234
- list: en,
3235
- blockquote: Ut,
3236
- table: nn,
3237
- definition_list: Zt,
3238
- footnote: Jt,
3239
- footnote_reference: Ie,
3240
- footnote_anchor: Nt,
3241
- admonition: rn,
3242
- hardbreak: Bt,
3243
- link: Ne,
3244
- image: mt,
3245
- thematic_break: on,
3246
- math_inline: nt,
3247
- math_block: xr,
3248
- strong: Ee,
3249
- emphasis: We,
3250
- strikethrough: Le,
3251
- highlight: Ve,
3252
- insert: Pe,
3253
- subscript: Ae,
3254
- superscript: De,
3255
- emoji: Te,
3256
- checkbox: tt,
3257
- checkbox_input: tt,
3258
- inline_code: _e,
3259
- reference: Se,
3260
- html_block: Oa
3261
- // 可以添加更多节点类型
3262
- // 例如:custom_node: CustomNode,
3263
- };
3264
- function kt(f) {
3265
- var C;
3266
- if (!f)
3267
- return ro;
3268
- const p = Ze(t.customId)[String(f.type)];
3269
- if (p)
3270
- return p;
3271
- if (f.type === "code_block") {
3272
- if (String((C = f.language) != null ? C : "").trim().toLowerCase() === "mermaid")
3273
- return Ze(t.customId).mermaid || Ht;
3274
- const R = Ze(t.customId).code_block;
3275
- return R || It.value;
3276
- }
3277
- return _n[String(f.type)] || ro;
3278
- }
3279
- function _t(f) {
3280
- var p;
3281
- return (f == null ? void 0 : f.type) === "code_block" && String((p = f.language) != null ? p : "").trim().toLowerCase() === "mermaid" ? {} : f.type === "code_block" ? ie({
3282
- // streaming behavior control for CodeBlockNode
3283
- stream: t.codeBlockStream,
3284
- darkTheme: t.codeBlockDarkTheme,
3285
- lightTheme: t.codeBlockLightTheme,
3286
- monacoOptions: t.codeBlockMonacoOptions,
3287
- themes: t.themes,
3288
- minWidth: t.codeBlockMinWidth,
3289
- maxWidth: t.codeBlockMaxWidth
3290
- }, t.codeBlockProps || {}) : {
3291
- // Forward `typewriter` flag to non-code node components so they can
3292
- // opt in/out of enter transitions or other typewriter-like behaviour.
3293
- typewriter: t.typewriter
3294
- };
3295
- }
3296
- function Je(f) {
3297
- l("click", f);
3298
- }
3299
- function Kt(f) {
3300
- var C;
3301
- (C = f.target) != null && C.closest("[data-node-index]") && l("mouseover", f);
3302
- }
3303
- function gn(f) {
3304
- var C;
3305
- (C = f.target) != null && C.closest("[data-node-index]") && l("mouseout", f);
3306
- }
3307
- return (f, p) => (d(), g("div", {
3308
- ref_key: "containerRef",
3309
- ref: r,
3310
- class: "markdown-renderer",
3311
- onClick: Je,
3312
- onMouseover: Kt,
3313
- onMouseout: gn
3314
- }, [
3315
- G.value ? (d(), g("div", {
3316
- key: 0,
3317
- class: "node-spacer",
3318
- style: ze({ height: `${x.value}px` }),
3319
- "aria-hidden": "true"
3320
- }, null, 4)) : se("", !0),
3321
- (d(!0), g(re, null, pe(Oe.value, (C) => {
3322
- var q;
3323
- return d(), g("div", {
3324
- key: C.index,
3325
- ref_for: !0,
3326
- ref: (R) => pt(C.index, R),
3327
- class: "node-slot",
3328
- "data-node-index": C.index,
3329
- "data-node-type": C.node.type
3330
- }, [
3331
- gt(C.index) ? (d(), g("div", {
3332
- key: 0,
3333
- ref_for: !0,
3334
- ref: (R) => At(C.index, R),
3335
- class: "node-content"
3336
- }, [
3337
- C.node.type !== "code_block" && t.typewriter !== !1 ? (d(), me(hn, {
3338
- key: 0,
3339
- name: "typewriter",
3340
- appear: ""
3341
- }, {
3342
- default: Tt(() => [
3343
- (d(), me(He(kt(C.node)), jt({
3344
- node: C.node,
3345
- loading: C.node.loading,
3346
- "index-key": `${e.indexKey || "markdown-renderer"}-${C.index}`
3347
- }, { ref_for: !0 }, _t(C.node), {
3348
- "custom-id": t.customId,
3349
- "is-dark": t.isDark,
3350
- onCopy: p[0] || (p[0] = (R) => l("copy", R)),
3351
- onHandleArtifactClick: p[1] || (p[1] = (R) => l("handleArtifactClick", R))
3352
- }), null, 16, ["node", "loading", "index-key", "custom-id", "is-dark"]))
3353
- ]),
3354
- _: 2
3355
- }, 1024)) : (d(), me(He(kt(C.node)), jt({
3356
- key: 1,
3357
- node: C.node,
3358
- loading: C.node.loading,
3359
- "index-key": `${e.indexKey || "markdown-renderer"}-${C.index}`
3360
- }, { ref_for: !0 }, _t(C.node), {
3361
- "custom-id": t.customId,
3362
- "is-dark": t.isDark,
3363
- onCopy: p[2] || (p[2] = (R) => l("copy", R)),
3364
- onHandleArtifactClick: p[3] || (p[3] = (R) => l("handleArtifactClick", R))
3365
- }), null, 16, ["node", "loading", "index-key", "custom-id", "is-dark"]))
3366
- ], 512)) : (d(), g("div", {
3367
- key: 1,
3368
- class: "node-placeholder",
3369
- style: ze({ height: `${(q = at[C.index]) != null ? q : fe.value}px` })
3370
- }, null, 4))
3371
- ], 8, Xa);
3372
- }), 128)),
3373
- G.value ? (d(), g("div", {
3374
- key: 1,
3375
- class: "node-spacer",
3376
- style: ze({ height: `${y.value}px` }),
3377
- "aria-hidden": "true"
3378
- }, null, 4)) : se("", !0)
3379
- ], 544));
3380
- }
3381
- }), qe = /* @__PURE__ */ X(Ya, [["__scopeId", "data-v-67bd5de6"]]);
3382
- qe.install = (e) => {
3383
- var t, l;
3384
- const n = (l = (t = qe.__name) != null ? t : qe.name) != null ? l : "NodeRenderer";
3385
- e.component(n, qe);
3386
- };
3387
- const qa = {
3388
- key: 0,
3389
- class: "admonition-icon"
3390
- }, Ua = { class: "admonition-title" }, Za = ["aria-expanded", "aria-controls", "title"], Ga = { key: 0 }, Ja = { key: 1 }, Qa = ["id"], ei = /* @__PURE__ */ V({
3391
- __name: "AdmonitionNode",
3392
- props: {
3393
- node: {},
3394
- indexKey: {},
3395
- isDark: { type: Boolean },
3396
- typewriter: { type: Boolean }
3397
- },
3398
- emits: ["copy"],
3399
- setup(e, { emit: n }) {
3400
- var c;
3401
- const t = e, l = n, r = {
3402
- note: "ℹ️",
3403
- info: "ℹ️",
3404
- tip: "💡",
3405
- warning: "⚠️",
3406
- danger: "❗",
3407
- // 'error' is a common alias for 'danger' in some markdown flavors
3408
- error: "⛔",
3409
- caution: "⚠️"
3410
- }, a = L(() => {
3411
- if (t.node.title && t.node.title.trim().length)
3412
- return t.node.title;
3413
- const k = t.node.kind || "note";
3414
- return k.charAt(0).toUpperCase() + k.slice(1);
3415
- }), i = M(t.node.collapsible ? !((c = t.node.open) == null || c) : !1);
3416
- function w() {
3417
- t.node.collapsible && (i.value = !i.value);
3418
- }
3419
- const h = `admonition-${Math.random().toString(36).slice(2, 9)}`;
3420
- return (k, v) => (d(), g("div", {
3421
- class: A(["admonition", [`admonition-${t.node.kind}`, t.isDark ? "is-dark" : ""]])
3422
- }, [
3423
- m("div", {
3424
- id: h,
3425
- class: "admonition-header"
3426
- }, [
3427
- r[t.node.kind] ? (d(), g("span", qa, ee(r[t.node.kind]), 1)) : se("", !0),
3428
- m("span", Ua, ee(a.value), 1),
3429
- t.node.collapsible ? (d(), g("button", {
3430
- key: 1,
3431
- class: "admonition-toggle",
3432
- "aria-expanded": !i.value,
3433
- "aria-controls": `${h}-content`,
3434
- title: i.value ? "Expand" : "Collapse",
3435
- onClick: w
3436
- }, [
3437
- i.value ? (d(), g("span", Ga, "▶")) : (d(), g("span", Ja, "▼"))
3438
- ], 8, Za)) : se("", !0)
3439
- ]),
3440
- an(m("div", {
3441
- id: `${h}-content`,
3442
- class: "admonition-content",
3443
- "aria-labelledby": h
3444
- }, [
3445
- zt([t.node.children], () => Ue($(qe), {
3446
- "index-key": `admonition-${e.indexKey}`,
3447
- nodes: t.node.children,
3448
- typewriter: t.typewriter,
3449
- onCopy: v[0] || (v[0] = (B) => l("copy", B))
3450
- }, null, 8, ["index-key", "nodes", "typewriter"]), v, 1)
3451
- ], 8, Qa), [
3452
- [sn, !i.value]
3453
- ])
3454
- ], 2));
3455
- }
3456
- }), rn = /* @__PURE__ */ X(ei, [["__scopeId", "data-v-578c25d2"]]);
3457
- rn.install = (e) => {
3458
- e.component(rn.__name, rn);
3459
- };
3460
- let ao = !1;
3461
- function ti(e) {
3462
- return j(this, null, function* () {
3463
- if (!ao)
3464
- return ao = !0, e.preloadMonacoWorkers();
3465
- });
3466
- }
3467
- let qt = null, io = !1;
3468
- function qs() {
3469
- return j(this, null, function* () {
3470
- if (qt)
3471
- return qt;
3472
- if (io)
3473
- return null;
3474
- try {
3475
- return qt = yield import("stream-monaco"), yield ti(qt), qt;
3476
- } catch (e) {
3477
- return io = !0, null;
3478
- }
3479
- });
3480
- }
3481
- const ni = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>', oi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3482
- <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M14.4561802 11.3673353C13.0276218 14.1261537 11.8858593 15.5 10.8437759 15.5 10.3588459 15.5 9.88231005 15.3491298 9.41749082 15.0543006 8.74000639 14.6241577 7.8668418 14.6059458 7.17068967 15.0074382 6.60881451 15.3319356 6.07177167 15.5 5.56305868 15.5 4.02887542 15.5 1.5 10.9491129 1.5 8.45090396 1.5 5.78581061 2.95006811 3.551507 5.15647301 3.551507 6.19383481 3.551507 7.09007204 4.20001691 7.84308619 4.497206 8.16210316 4.62512517 8.52255587 4.61592787 8.83410596 4.47192 9.44477141 4.18872223 10.2497236 3.551507 11.2503615 3.551507 12.4715175 3.551507 13.5338865 4.33779342 14.4184071 5.47479877 14.5532906 5.64778615 14.5172013 5.89341518 14.3377895 6.02349446 13.3500923 6.736546 12.8746057 7.53893969 12.8746057 8.45090396 12.8746057 9.36404821 13.3502672 10.1652619 14.3377895 10.8793249 14.4946576 10.992887 14.5445377 11.1984946 14.4561802 11.3673353ZM8.5 3C8.5 3 8.3468635 1.3936039 10 1" />
3483
- </svg>
3484
- `, ri = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3485
- <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />
3486
- <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />
3487
- </svg>
3488
- `, ai = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3489
- <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" />
3490
- </svg>
3491
- `, ii = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3492
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3493
- <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />
3494
- <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />
3495
- <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />
3496
- <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />
3497
- <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />
3498
- <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />
3499
- </g>
3500
- </svg>
3501
- `, si = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3502
- <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />
3503
- </svg>
3504
- `, li = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3505
- <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" />
3506
- <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" />
3507
- </svg>
3508
- `, ci = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3509
- <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />
3510
- </svg>
3511
- `, ui = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3512
- <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" />
3513
- </svg>
3514
- `, di = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3515
- <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">
3516
- <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" />
3517
- <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" />
3518
- </g>
3519
- </svg>
3520
- `, mi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3521
- <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">
3522
- <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />
3523
- <path d="M3.5 11V3.5H11m-7.5 0 8 8" />
3524
- </g>
3525
- </svg>
3526
- `, hi = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>', fi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3527
- <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />
3528
- </svg>
3529
- `, vi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3530
- <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />
3531
- </svg>
3532
- `, gi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3533
- <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">
3534
- <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />
3535
- <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />
3536
- </g>
3537
- </svg>
3538
- `, pi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3539
- <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />
3540
- </svg>
3541
- `, wi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3542
- <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" />
3543
- </svg>
3544
- `, ki = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3545
- <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">
3546
- <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />
3547
- <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />
3548
- </g>
3549
- </svg>
3550
- `, yi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3551
- <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />
3552
- </svg>
3553
- `, xi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3554
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3555
- <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />
3556
- <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />
3557
- </g>
3558
- </svg>
3559
- `, bi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3560
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3561
- <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" />
3562
- <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" />
3563
- <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" />
3564
- </g>
3565
- </svg>
3566
- `, Mi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3567
- <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">
3568
- <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" />
3569
- <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" />
3570
- <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" />
3571
- <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" />
3572
- </g>
3573
- </svg>
3574
- `, Ci = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3575
- <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">
3576
- <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" />
3577
- <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" />
3578
- </g>
3579
- </svg>
3580
- `, Bi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3581
- <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" />
3582
- </svg>
3583
- `, $i = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3584
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3585
- <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />
3586
- <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />
3587
- <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />
3588
- </g>
3589
- </svg>
3590
- `, Ti = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3591
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3592
- <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />
3593
- <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />
3594
- <path stroke="#e78284" d="M2.5 13.5V8" />
3595
- <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />
3596
- </g>
3597
- </svg>
3598
- `, Ii = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3599
- <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">
3600
- <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />
3601
- <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />
3602
- </g>
3603
- </svg>
3604
- `, _i = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3605
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3606
- <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />
3607
- <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />
3608
- </g>
3609
- </svg>
3610
- `, Si = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3611
- <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" />
3612
- </svg>
3613
- `, Ei = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3614
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3615
- <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />
3616
- <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />
3617
- </g>
3618
- </svg>
3619
- `, Li = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3620
- <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" />
3621
- </svg>
3622
- `, Ni = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3623
- <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />
3624
- </svg>
3625
- `, Hi = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>', Ri = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>', ji = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3626
- <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">
3627
- <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />
3628
- <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />
3629
- <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />
3630
- </g>
3631
- </svg>
3632
- `, zi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3633
- <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />
3634
- </svg>
3635
- `, Di = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3636
- <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" />
3637
- </svg>
3638
- `, Ai = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3639
- <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />
3640
- </svg>
3641
- `, Pi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3642
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3643
- <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" />
3644
- <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" />
3645
- <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />
3646
- <path stroke="#e5c890" d="m 8.5,12.5 v 0" />
3647
- </g>
3648
- </svg>
3649
- `, Vi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3650
- <g fill="none" stroke-linecap="round" stroke-linejoin="round">
3651
- <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />
3652
- <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />
3653
- </g>
3654
- </svg>
3655
- `, Wi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3656
- <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" />
3657
- </svg>
3658
- `, Ki = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3659
- <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">
3660
- <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" />
3661
- <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" />
3662
- </g>
3663
- </svg>
3664
- `, Oi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3665
- <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" />
3666
- </svg>
3667
- `, Fi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3668
- <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />
3669
- </svg>
3670
- `, Xi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3671
- <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">
3672
- <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" />
3673
- <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" />
3674
- </g>
3675
- </svg>
3676
- `, Yi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3677
- <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m3 11.5 2.5 4 2.5-4 2.5 4 2.5-4-2.5-4-2.5 4m2.5 4h-5m7.5-4H3m10-7-2.5-4-2.5 4-2.5-4-2.5 4 2.5 4 2.5-4M5.5.5h5M3 4.5h10" />
3678
- </svg>
3679
- `, qi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3680
- <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" />
3681
- </svg>
3682
- `, Ui = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><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>', Zi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3683
- <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" />
3684
- </svg>
3685
- `, Gi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3686
- <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />
3687
- </svg>
3688
- `, Ji = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3689
- <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />
3690
- </svg>
3691
- `, Qi = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3692
- <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">
3693
- <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" />
3694
- <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />
3695
- </g>
3696
- </svg>
3697
- `, es = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3698
- <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">
3699
- <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" />
3700
- <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" />
3701
- <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" />
3702
- <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" />
3703
- </g>
3704
- </svg>
3705
- `, ts = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3706
- <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">
3707
- <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" />
3708
- <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" />
3709
- </g>
3710
- </svg>
3711
- `, ns = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>', os = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3712
- <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">
3713
- <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />
3714
- <path d="M12.05 1.73 8 9.28 3.95 1.73" />
3715
- </g>
3716
- </svg>
3717
- `, rs = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3718
- <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" />
3719
- </svg>
3720
- `, as = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
3721
- <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />
3722
- </svg>
3723
- `;
3724
- let Dn = null;
3725
- function is(e) {
3726
- Dn = e != null ? e : null;
3727
- }
3728
- function ss(e) {
3729
- if (Dn) {
3730
- const n = Dn(e);
3731
- if (n != null && n !== "")
3732
- return n;
3733
- }
3734
- switch (e) {
3735
- case "javascript":
3736
- case "js":
3737
- return Ci;
3738
- case "typescript":
3739
- case "ts":
3740
- return ts;
3741
- case "jsx":
3742
- return Mi;
3743
- case "tsx":
3744
- return es;
3745
- case "html":
3746
- return xi;
3747
- case "css":
3748
- return di;
3749
- case "scss":
3750
- return Oi;
3751
- case "json":
3752
- return Bi;
3753
- case "python":
3754
- case "py":
3755
- return Pi;
3756
- case "ruby":
3757
- case "rb":
3758
- return Wi;
3759
- case "go":
3760
- case "golang":
3761
- return wi;
3762
- case "r":
3763
- return Vi;
3764
- case "java":
3765
- return bi;
3766
- case "kotlin":
3767
- case "kt":
3768
- return Ti;
3769
- case "c":
3770
- return ai;
3771
- case "cpp":
3772
- case "c++":
3773
- return li;
3774
- case "cs":
3775
- case "csharp":
3776
- return ui;
3777
- case "php":
3778
- return Di;
3779
- case "scala":
3780
- return Fi;
3781
- case "shell":
3782
- case "sh":
3783
- case "bash":
3784
- case "zsh":
3785
- case "powershell":
3786
- case "ps1":
3787
- case "bat":
3788
- case "batch":
3789
- case "shellscript":
3790
- return Xi;
3791
- case "sql":
3792
- return qi;
3793
- case "yaml":
3794
- case "yml":
3795
- return as;
3796
- case "markdown":
3797
- case "md":
3798
- return Si;
3799
- case "xml":
3800
- return rs;
3801
- case "rust":
3802
- case "rs":
3803
- return Ki;
3804
- case "swift":
3805
- return Gi;
3806
- case "perl":
3807
- return zi;
3808
- case "lua":
3809
- return _i;
3810
- case "haskell":
3811
- return yi;
3812
- case "erlang":
3813
- return gi;
3814
- case "clojure":
3815
- return ii;
3816
- case "vue":
3817
- return os;
3818
- case "svg":
3819
- return Zi;
3820
- case "mermaid":
3821
- return Li;
3822
- case "dart":
3823
- return mi;
3824
- case "assembly":
3825
- return ri;
3826
- case "dockerfile":
3827
- return fi;
3828
- case "fortran":
3829
- return pi;
3830
- case "lisp":
3831
- return Ii;
3832
- case "ocaml":
3833
- return ji;
3834
- case "prolog":
3835
- return Ai;
3836
- case "groovy":
3837
- return ki;
3838
- case "matlab":
3839
- return Ei;
3840
- case "cobol":
3841
- return si;
3842
- case "ada":
3843
- return ni;
3844
- case "julia":
3845
- return $i;
3846
- case "elixir":
3847
- return vi;
3848
- case "vb.net":
3849
- return ns;
3850
- case "nim":
3851
- return Ni;
3852
- case "crystal":
3853
- return ci;
3854
- case "d":
3855
- return hi;
3856
- case "applescript":
3857
- return oi;
3858
- case "solidity":
3859
- return Yi;
3860
- case "objectivec":
3861
- return Hi;
3862
- case "objectivecpp":
3863
- return Ri;
3864
- case "terraform":
3865
- return Ji;
3866
- case "plain":
3867
- case "text":
3868
- return Qi;
3869
- default:
3870
- return Ui;
3871
- }
3872
- }
3873
- const ls = {
3874
- js: "JavaScript",
3875
- ts: "TypeScript",
3876
- jsx: "JSX",
3877
- tsx: "TSX",
3878
- html: "HTML",
3879
- css: "CSS",
3880
- scss: "SCSS",
3881
- json: "JSON",
3882
- py: "Python",
3883
- python: "Python",
3884
- rb: "Ruby",
3885
- go: "Go",
3886
- java: "Java",
3887
- c: "C",
3888
- cpp: "C++",
3889
- cs: "C#",
3890
- php: "PHP",
3891
- sh: "Shell",
3892
- bash: "Bash",
3893
- sql: "SQL",
3894
- yaml: "YAML",
3895
- md: "Markdown",
3896
- "": "Plain Text",
3897
- plain: "Plain Text"
3898
- }, cs = {
3899
- key: 0,
3900
- class: "code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",
3901
- style: { color: "var(--vscode-editor-foreground)", "background-color": "var(--vscode-editor-background)" }
3902
- }, us = { class: "flex items-center space-x-2" }, ds = ["innerHTML"], ms = { class: "text-sm font-medium font-mono" }, hs = { class: "flex items-center space-x-2" }, fs = ["aria-pressed"], vs = ["disabled"], gs = ["disabled"], ps = ["disabled"], ws = ["aria-label"], ks = {
3903
- key: 0,
3904
- xmlns: "http://www.w3.org/2000/svg",
3905
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
3906
- "aria-hidden": "true",
3907
- role: "img",
3908
- width: "1em",
3909
- height: "1em",
3910
- viewBox: "0 0 24 24",
3911
- class: "w-3 h-3"
3912
- }, ys = {
3913
- key: 1,
3914
- xmlns: "http://www.w3.org/2000/svg",
3915
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
3916
- "aria-hidden": "true",
3917
- role: "img",
3918
- width: "1em",
3919
- height: "1em",
3920
- viewBox: "0 0 24 24",
3921
- class: "w-3 h-3"
3922
- }, xs = ["aria-pressed"], bs = {
3923
- key: 0,
3924
- xmlns: "http://www.w3.org/2000/svg",
3925
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
3926
- "aria-hidden": "true",
3927
- role: "img",
3928
- width: "0.75rem",
3929
- height: "0.75rem",
3930
- viewBox: "0 0 24 24"
3931
- }, Ms = {
3932
- key: 1,
3933
- xmlns: "http://www.w3.org/2000/svg",
3934
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
3935
- "aria-hidden": "true",
3936
- role: "img",
3937
- width: "0.75rem",
3938
- height: "0.75rem",
3939
- viewBox: "0 0 24 24"
3940
- }, Cs = ["aria-label"], Bs = { class: "code-loading-placeholder" }, so = 10, lo = 36, co = 1, $s = /* @__PURE__ */ V({
3941
- __name: "MarkdownCodeBlockNode",
3942
- props: {
3943
- node: {},
3944
- loading: { type: Boolean, default: !0 },
3945
- stream: { type: Boolean, default: !0 },
3946
- darkTheme: { default: void 0 },
3947
- lightTheme: { default: void 0 },
3948
- isDark: { type: Boolean },
3949
- isShowPreview: { type: Boolean, default: !0 },
3950
- enableFontSizeControl: { type: Boolean, default: !0 },
3951
- minWidth: { default: void 0 },
3952
- maxWidth: { default: void 0 },
3953
- themes: {},
3954
- showHeader: { type: Boolean, default: !0 },
3955
- showCopyButton: { type: Boolean, default: !0 },
3956
- showExpandButton: { type: Boolean, default: !0 },
3957
- showPreviewButton: { type: Boolean, default: !0 },
3958
- showFontSizeButtons: { type: Boolean, default: !0 }
3959
- },
3960
- emits: ["previewCode", "copy"],
3961
- setup(e, { emit: n }) {
3962
- var Oe;
3963
- const t = e, l = n, { t: r } = Kn(), a = M(String((Oe = t.node.language) != null ? Oe : "")), i = M(!1), w = M(!1), h = M(!1), c = M(null), k = M(!0), v = M(0), B = M(14), I = M(B.value), O = L(() => {
3964
- const x = B.value, y = I.value;
3965
- return typeof x == "number" && Number.isFinite(x) && x > 0 && typeof y == "number" && Number.isFinite(y) && y > 0;
3966
- }), D = L(() => {
3967
- const x = a.value.trim().toLowerCase();
3968
- return ls[x] || x.charAt(0).toUpperCase() + x.slice(1);
3969
- }), K = L(
3970
- () => a.value.trim().toLowerCase() === "mermaid"
3971
- ), H = L(() => {
3972
- const x = a.value.trim().toLowerCase();
3973
- return ss(x.split(":")[0]);
3974
- }), N = L(() => {
3975
- const x = a.value.trim().toLowerCase();
3976
- return t.isShowPreview && (x === "html" || x === "svg");
3977
- }), ke = L(() => {
3978
- const x = {}, y = (ce) => {
3979
- if (ce != null)
3980
- return typeof ce == "number" ? `${ce}px` : String(ce);
3981
- }, T = y(t.minWidth), oe = y(t.maxWidth);
3982
- return T && (x.minWidth = T), oe && (x.maxWidth = oe), x;
3983
- }), W = L(() => ({
3984
- fontSize: `${I.value}px`
3985
- }));
3986
- function Z() {
3987
- return t.isDark ? t.darkTheme : t.lightTheme;
3988
- }
3989
- let S, le, te, Y = () => {
3990
- };
3991
- function be() {
3992
- return j(this, null, function* () {
3993
- if (!le)
3994
- try {
3995
- const x = yield import("stream-markdown");
3996
- if (le = x.createShikiStreamRenderer, te = x.registerHighlight, Y = x.disposeHighlighter, te({ themes: t.themes }), S = le(c.value, {
3997
- theme: Z()
3998
- }), !t.loading) {
3999
- const y = a.value.split(":")[0].toLocaleLowerCase().trim();
4000
- S.updateCode(t.node.code, y);
4001
- }
4002
- } catch (x) {
4003
- console.warn("[MarkdownCodeBlockNode] stream-markdown not available:", x);
4004
- }
4005
- });
4006
- }
4007
- function G() {
4008
- return j(this, null, function* () {
4009
- if (K.value) {
4010
- Y(), S == null || S.dispose();
4011
- return;
4012
- }
4013
- be();
4014
- });
4015
- }
4016
- G(), vo(() => {
4017
- G();
4018
- }), U(() => t.themes, () => j(null, null, function* () {
4019
- te && te({ themes: t.themes });
4020
- })), U(() => [t.node.code, t.node.language], (T) => j(null, [T], function* ([x, y]) {
4021
- if (y !== a.value && (a.value = y.trim()), !!c.value) {
4022
- if (K.value) {
4023
- Y(), S == null || S.dispose();
4024
- return;
4025
- }
4026
- S || (yield G()), !(!S || !x) && (t.stream === !1 && t.loading || (y = y.split(":")[0].toLocaleLowerCase().trim(), S.updateCode(x, y)));
4027
- }
4028
- }));
4029
- const ut = U(
4030
- () => [t.darkTheme, t.lightTheme],
4031
- () => j(null, null, function* () {
4032
- if (c.value) {
4033
- if (K.value)
4034
- return Y(), S == null || S.dispose(), ut();
4035
- S || (yield G()), S == null || S.setTheme(Z());
4036
- }
4037
- })
4038
- );
4039
- U(() => t.node.code, () => j(null, null, function* () {
4040
- if (w.value || !k.value)
4041
- return;
4042
- yield de();
4043
- const x = c.value;
4044
- x && x.scrollHeight > x.clientHeight && (x.scrollTop = x.scrollHeight);
4045
- }));
4046
- function ot(x, y = 50) {
4047
- return x.scrollHeight - x.scrollTop - x.clientHeight <= y;
4048
- }
4049
- function rt() {
4050
- const x = c.value;
4051
- if (!x || w.value)
4052
- return;
4053
- const y = x.scrollTop;
4054
- y < v.value ? k.value = !1 : ot(x) && (k.value = !0), v.value = y;
4055
- }
4056
- function Ke() {
4057
- return j(this, null, function* () {
4058
- try {
4059
- typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && (yield navigator.clipboard.writeText(t.node.code)), i.value = !0, l("copy", t.node.code), setTimeout(() => {
4060
- i.value = !1;
4061
- }, 1e3);
4062
- } catch (x) {
4063
- console.error("Copy failed:", x);
4064
- }
4065
- });
4066
- }
4067
- function ae(x) {
4068
- const y = x;
4069
- return !y || y.disabled;
4070
- }
4071
- function ne(x, y, T = "top") {
4072
- if (ae(x.currentTarget))
4073
- return;
4074
- const oe = x, ce = (oe == null ? void 0 : oe.clientX) != null && (oe == null ? void 0 : oe.clientY) != null ? { x: oe.clientX, y: oe.clientY } : void 0;
4075
- un(x.currentTarget, y, T, !1, ce, t.isDark);
4076
- }
4077
- function z() {
4078
- Wn();
4079
- }
4080
- function ye(x) {
4081
- if (ae(x.currentTarget))
4082
- return;
4083
- const y = i.value ? r("common.copied") || "Copied" : r("common.copy") || "Copy", T = x, oe = (T == null ? void 0 : T.clientX) != null && (T == null ? void 0 : T.clientY) != null ? { x: T.clientX, y: T.clientY } : void 0;
4084
- un(x.currentTarget, y, "top", !1, oe, t.isDark);
4085
- }
4086
- function Re() {
4087
- w.value = !w.value;
4088
- const x = c.value;
4089
- x && (w.value ? (x.style.maxHeight = "none", x.style.overflow = "visible") : (x.style.maxHeight = "500px", x.style.overflow = "auto", k.value = !0, de(() => {
4090
- x.scrollHeight > x.clientHeight && (x.scrollTop = x.scrollHeight);
4091
- })));
4092
- }
4093
- function at() {
4094
- h.value = !h.value;
4095
- }
4096
- function Me() {
4097
- const x = Math.min(lo, I.value + co);
4098
- I.value = x;
4099
- }
4100
- function vt() {
4101
- const x = Math.max(so, I.value - co);
4102
- I.value = x;
4103
- }
4104
- function fe() {
4105
- I.value = B.value;
4106
- }
4107
- function Ce() {
4108
- if (!N.value)
4109
- return;
4110
- const x = (a.value || t.node.language).toLowerCase(), y = x === "html" ? "text/html" : "image/svg+xml", T = x === "html" ? "HTML Preview" : "SVG Preview";
4111
- l("previewCode", {
4112
- type: y,
4113
- content: t.node.code,
4114
- title: T
4115
- });
4116
- }
4117
- return (x, y) => K.value ? (d(), me($(Ht), {
4118
- key: 0,
4119
- node: e.node,
4120
- "is-dark": t.isDark,
4121
- loading: t.loading
4122
- }, null, 8, ["node", "is-dark", "loading"])) : (d(), g("div", {
4123
- key: 1,
4124
- style: ze(ke.value),
4125
- class: A(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm", [t.isDark ? "border-gray-700/30 bg-gray-900" : "border-gray-200 bg-white", t.isDark ? "is-dark" : ""]])
4126
- }, [
4127
- t.showHeader ? (d(), g("div", cs, [
4128
- et(x.$slots, "header-left", {}, () => [
4129
- m("div", us, [
4130
- m("span", {
4131
- class: "icon-slot h-4 w-4 flex-shrink-0",
4132
- innerHTML: H.value
4133
- }, null, 8, ds),
4134
- m("span", ms, ee(D.value), 1)
4135
- ])
4136
- ], !0),
4137
- et(x.$slots, "header-right", {}, () => [
4138
- m("div", hs, [
4139
- m("button", {
4140
- type: "button",
4141
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4142
- "aria-pressed": h.value,
4143
- onClick: at,
4144
- onMouseenter: y[0] || (y[0] = (T) => ne(T, h.value ? $(r)("common.expand") || "Expand" : $(r)("common.collapse") || "Collapse")),
4145
- onFocus: y[1] || (y[1] = (T) => ne(T, h.value ? $(r)("common.expand") || "Expand" : $(r)("common.collapse") || "Collapse")),
4146
- onMouseleave: z,
4147
- onBlur: z
4148
- }, [
4149
- (d(), g("svg", {
4150
- style: ze({ rotate: h.value ? "0deg" : "90deg" }),
4151
- xmlns: "http://www.w3.org/2000/svg",
4152
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
4153
- "aria-hidden": "true",
4154
- role: "img",
4155
- width: "1em",
4156
- height: "1em",
4157
- viewBox: "0 0 24 24",
4158
- class: "w-3 h-3"
4159
- }, [...y[17] || (y[17] = [
4160
- m("path", {
4161
- fill: "none",
4162
- stroke: "currentColor",
4163
- "stroke-linecap": "round",
4164
- "stroke-linejoin": "round",
4165
- "stroke-width": "2",
4166
- d: "m9 18l6-6l-6-6"
4167
- }, null, -1)
4168
- ])], 4))
4169
- ], 40, fs),
4170
- t.showFontSizeButtons && t.enableFontSizeControl ? (d(), g(re, { key: 0 }, [
4171
- m("button", {
4172
- type: "button",
4173
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4174
- disabled: Number.isFinite(I.value) ? I.value <= so : !1,
4175
- onClick: y[2] || (y[2] = (T) => vt()),
4176
- onMouseenter: y[3] || (y[3] = (T) => ne(T, $(r)("common.decrease") || "Decrease")),
4177
- onFocus: y[4] || (y[4] = (T) => ne(T, $(r)("common.decrease") || "Decrease")),
4178
- onMouseleave: z,
4179
- onBlur: z
4180
- }, [...y[18] || (y[18] = [
4181
- m("svg", {
4182
- xmlns: "http://www.w3.org/2000/svg",
4183
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
4184
- "aria-hidden": "true",
4185
- role: "img",
4186
- width: "1em",
4187
- height: "1em",
4188
- viewBox: "0 0 24 24",
4189
- class: "w-3 h-3"
4190
- }, [
4191
- m("path", {
4192
- fill: "none",
4193
- stroke: "currentColor",
4194
- "stroke-linecap": "round",
4195
- "stroke-linejoin": "round",
4196
- "stroke-width": "2",
4197
- d: "M5 12h14"
4198
- })
4199
- ], -1)
4200
- ])], 40, vs),
4201
- m("button", {
4202
- type: "button",
4203
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4204
- disabled: !O.value || I.value === B.value,
4205
- onClick: y[5] || (y[5] = (T) => fe()),
4206
- onMouseenter: y[6] || (y[6] = (T) => ne(T, $(r)("common.reset") || "Reset")),
4207
- onFocus: y[7] || (y[7] = (T) => ne(T, $(r)("common.reset") || "Reset")),
4208
- onMouseleave: z,
4209
- onBlur: z
4210
- }, [...y[19] || (y[19] = [
4211
- m("svg", {
4212
- xmlns: "http://www.w3.org/2000/svg",
4213
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
4214
- "aria-hidden": "true",
4215
- role: "img",
4216
- width: "1em",
4217
- height: "1em",
4218
- viewBox: "0 0 24 24",
4219
- class: "w-3 h-3"
4220
- }, [
4221
- m("g", {
4222
- fill: "none",
4223
- stroke: "currentColor",
4224
- "stroke-linecap": "round",
4225
- "stroke-linejoin": "round",
4226
- "stroke-width": "2"
4227
- }, [
4228
- m("path", { d: "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }),
4229
- m("path", { d: "M3 3v5h5" })
4230
- ])
4231
- ], -1)
4232
- ])], 40, gs),
4233
- m("button", {
4234
- type: "button",
4235
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4236
- disabled: Number.isFinite(I.value) ? I.value >= lo : !1,
4237
- onClick: y[8] || (y[8] = (T) => Me()),
4238
- onMouseenter: y[9] || (y[9] = (T) => ne(T, $(r)("common.increase") || "Increase")),
4239
- onFocus: y[10] || (y[10] = (T) => ne(T, $(r)("common.increase") || "Increase")),
4240
- onMouseleave: z,
4241
- onBlur: z
4242
- }, [...y[20] || (y[20] = [
4243
- m("svg", {
4244
- xmlns: "http://www.w3.org/2000/svg",
4245
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
4246
- "aria-hidden": "true",
4247
- role: "img",
4248
- width: "1em",
4249
- height: "1em",
4250
- viewBox: "0 0 24 24",
4251
- class: "w-3 h-3"
4252
- }, [
4253
- m("path", {
4254
- fill: "none",
4255
- stroke: "currentColor",
4256
- "stroke-linecap": "round",
4257
- "stroke-linejoin": "round",
4258
- "stroke-width": "2",
4259
- d: "M5 12h14m-7-7v14"
4260
- })
4261
- ], -1)
4262
- ])], 40, ps)
4263
- ], 64)) : se("", !0),
4264
- t.showCopyButton ? (d(), g("button", {
4265
- key: 1,
4266
- type: "button",
4267
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4268
- "aria-label": i.value ? $(r)("common.copied") || "Copied" : $(r)("common.copy") || "Copy",
4269
- onClick: Ke,
4270
- onMouseenter: y[11] || (y[11] = (T) => ye(T)),
4271
- onFocus: y[12] || (y[12] = (T) => ye(T)),
4272
- onMouseleave: z,
4273
- onBlur: z
4274
- }, [
4275
- i.value ? (d(), g("svg", ys, [...y[22] || (y[22] = [
4276
- m("path", {
4277
- fill: "none",
4278
- stroke: "currentColor",
4279
- "stroke-linecap": "round",
4280
- "stroke-linejoin": "round",
4281
- "stroke-width": "2",
4282
- d: "M20 6L9 17l-5-5"
4283
- }, null, -1)
4284
- ])])) : (d(), g("svg", ks, [...y[21] || (y[21] = [
4285
- m("g", {
4286
- fill: "none",
4287
- stroke: "currentColor",
4288
- "stroke-linecap": "round",
4289
- "stroke-linejoin": "round",
4290
- "stroke-width": "2"
4291
- }, [
4292
- m("rect", {
4293
- width: "14",
4294
- height: "14",
4295
- x: "8",
4296
- y: "8",
4297
- rx: "2",
4298
- ry: "2"
4299
- }),
4300
- m("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
4301
- ], -1)
4302
- ])]))
4303
- ], 40, ws)) : se("", !0),
4304
- t.showExpandButton ? (d(), g("button", {
4305
- key: 2,
4306
- type: "button",
4307
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4308
- "aria-pressed": w.value,
4309
- onClick: Re,
4310
- onMouseenter: y[13] || (y[13] = (T) => ne(T, w.value ? $(r)("common.collapse") || "Collapse" : $(r)("common.expand") || "Expand")),
4311
- onFocus: y[14] || (y[14] = (T) => ne(T, w.value ? $(r)("common.collapse") || "Collapse" : $(r)("common.expand") || "Expand")),
4312
- onMouseleave: z,
4313
- onBlur: z
4314
- }, [
4315
- w.value ? (d(), g("svg", bs, [...y[23] || (y[23] = [
4316
- m("path", {
4317
- fill: "none",
4318
- stroke: "currentColor",
4319
- "stroke-linecap": "round",
4320
- "stroke-linejoin": "round",
4321
- "stroke-width": "2",
4322
- d: "M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"
4323
- }, null, -1)
4324
- ])])) : (d(), g("svg", Ms, [...y[24] || (y[24] = [
4325
- m("path", {
4326
- fill: "none",
4327
- stroke: "currentColor",
4328
- "stroke-linecap": "round",
4329
- "stroke-linejoin": "round",
4330
- "stroke-width": "2",
4331
- d: "m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"
4332
- }, null, -1)
4333
- ])]))
4334
- ], 40, xs)) : se("", !0),
4335
- N.value && t.showPreviewButton ? (d(), g("button", {
4336
- key: 3,
4337
- type: "button",
4338
- class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
4339
- "aria-label": $(r)("common.preview") || "Preview",
4340
- onClick: Ce,
4341
- onMouseenter: y[15] || (y[15] = (T) => ne(T, $(r)("common.preview") || "Preview")),
4342
- onFocus: y[16] || (y[16] = (T) => ne(T, $(r)("common.preview") || "Preview")),
4343
- onMouseleave: z,
4344
- onBlur: z
4345
- }, [...y[25] || (y[25] = [
4346
- m("svg", {
4347
- "data-v-3d59cc65": "",
4348
- xmlns: "http://www.w3.org/2000/svg",
4349
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
4350
- "aria-hidden": "true",
4351
- role: "img",
4352
- width: "1em",
4353
- height: "1em",
4354
- viewBox: "0 0 24 24",
4355
- class: "w-3 h-3"
4356
- }, [
4357
- m("g", {
4358
- fill: "none",
4359
- stroke: "currentColor",
4360
- "stroke-linecap": "round",
4361
- "stroke-linejoin": "round",
4362
- "stroke-width": "2"
4363
- }, [
4364
- m("path", { 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" }),
4365
- m("circle", {
4366
- cx: "12",
4367
- cy: "12",
4368
- r: "3"
4369
- })
4370
- ])
4371
- ], -1)
4372
- ])], 40, Cs)) : se("", !0)
4373
- ])
4374
- ], !0)
4375
- ])) : se("", !0),
4376
- an(m("div", {
4377
- ref_key: "codeBlockContent",
4378
- ref: c,
4379
- class: "code-block-content",
4380
- style: ze(W.value),
4381
- onScroll: rt
4382
- }, null, 36), [
4383
- [sn, !h.value && (e.stream ? !0 : !e.loading)]
4384
- ]),
4385
- an(m("div", Bs, [
4386
- et(x.$slots, "loading", {
4387
- loading: e.loading,
4388
- stream: e.stream
4389
- }, () => [
4390
- y[26] || (y[26] = m("div", { class: "loading-skeleton" }, [
4391
- m("div", { class: "skeleton-line" }),
4392
- m("div", { class: "skeleton-line" }),
4393
- m("div", { class: "skeleton-line short" })
4394
- ], -1))
4395
- ], !0)
4396
- ], 512), [
4397
- [sn, !e.stream && e.loading]
4398
- ])
4399
- ], 6));
4400
- }
4401
- }), $n = /* @__PURE__ */ X($s, [["__scopeId", "data-v-9201c1b9"]]);
4402
- $n.install = (e) => {
4403
- e.component($n.__name, $n);
4404
- };
4405
- let Ye = null, ft = null, uo = !1;
4406
- const $e = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Map(), Co = 200;
4407
- let $t = 5;
4408
- const Mt = /* @__PURE__ */ new Set();
4409
- function dn() {
4410
- if ($e.size < $t && Mt.size) {
4411
- const e = Array.from(Mt);
4412
- Mt.clear();
4413
- for (const n of e)
4414
- try {
4415
- n();
4416
- } catch (t) {
4417
- }
4418
- }
4419
- }
4420
- let Qe = null;
4421
- function Us(e) {
4422
- Ye = e, ft = null, Ye.onmessage = (n) => {
4423
- const { id: t, html: l, error: r } = n.data, a = $e.get(t);
4424
- if (a)
4425
- if ($e.delete(t), clearTimeout(a.timeoutId), dn(), r)
4426
- a.reject(new Error(r));
4427
- else {
4428
- const { content: i, displayMode: w } = n.data;
4429
- if (i) {
4430
- const h = `${w ? "d" : "i"}:${i}`;
4431
- if (lt.set(h, l), lt.size > Co) {
4432
- const c = lt.keys().next().value;
4433
- lt.delete(c);
4434
- }
4435
- }
4436
- a.resolve(l);
4437
- }
4438
- }, Ye.onerror = (n) => {
4439
- console.error("[katexWorkerClient] Worker error:", n);
4440
- for (const [t, l] of $e.entries())
4441
- clearTimeout(l.timeoutId), l.reject(new Error(`Worker error: ${n.message}`));
4442
- $e.clear(), dn();
4443
- };
4444
- }
4445
- function Zs() {
4446
- var e;
4447
- Ye && ((e = Ye.terminate) == null || e.call(Ye)), Ye = null, ft = null;
4448
- }
4449
- function Ts() {
4450
- return Ye || (ft = new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."), ft.name = "WorkerInitError", ft.code = "WORKER_INIT_ERROR", null);
4451
- }
4452
- function Gs(e) {
4453
- uo = !!e, Ye && Ye.postMessage({ type: "init", debug: uo });
4454
- }
4455
- function Is(e, n = !0, t = 2e3, l) {
4456
- return j(this, null, function* () {
4457
- const r = performance.now();
4458
- if (ft)
4459
- return Promise.reject(ft);
4460
- const a = `${n ? "d" : "i"}:${e}`, i = lt.get(a);
4461
- if (i)
4462
- return Qe && Qe.recordRender({
4463
- type: "cache-hit",
4464
- duration: performance.now() - r,
4465
- formulaLength: e.length,
4466
- timestamp: Date.now(),
4467
- success: !0
4468
- }), Promise.resolve(i);
4469
- const w = Ts();
4470
- if (!w)
4471
- return Promise.reject(ft);
4472
- if ($e.size >= $t) {
4473
- const h = new Error("Worker busy");
4474
- return h.name = "WorkerBusy", h.code = "WORKER_BUSY", h.busy = !0, h.inFlight = $e.size, h.max = $t, Qe && Qe.recordRender({
4475
- type: "worker",
4476
- duration: performance.now() - r,
4477
- formulaLength: e.length,
4478
- timestamp: Date.now(),
4479
- success: !1,
4480
- error: "busy"
4481
- }), Promise.reject(h);
4482
- }
4483
- return new Promise((h, c) => {
4484
- if (l != null && l.aborted) {
4485
- const H = new Error("Aborted");
4486
- H.name = "AbortError", c(H);
4487
- return;
4488
- }
4489
- const k = Math.random().toString(36).slice(2), v = globalThis.setTimeout(() => {
4490
- $e.delete(k);
4491
- const H = new Error("Worker render timed out");
4492
- H.name = "WorkerTimeout", H.code = "WORKER_TIMEOUT", Qe && Qe.recordRender({
4493
- type: "worker",
4494
- duration: performance.now() - r,
4495
- formulaLength: e.length,
4496
- timestamp: Date.now(),
4497
- success: !1,
4498
- error: "timeout"
4499
- }), c(H), dn();
4500
- }, t), B = () => {
4501
- globalThis.clearTimeout(v), $e.has(k) && $e.delete(k);
4502
- const H = new Error("Aborted");
4503
- H.name = "AbortError", c(H), dn();
4504
- };
4505
- l && l.addEventListener("abort", B, { once: !0 });
4506
- const I = h, O = c, D = (H) => {
4507
- Qe && Qe.recordRender({
4508
- type: "worker",
4509
- duration: performance.now() - r,
4510
- formulaLength: e.length,
4511
- timestamp: Date.now(),
4512
- success: !0
4513
- }), I(H);
4514
- }, K = (H) => {
4515
- Qe && Qe.recordRender({
4516
- type: "worker",
4517
- duration: performance.now() - r,
4518
- formulaLength: e.length,
4519
- timestamp: Date.now(),
4520
- success: !1,
4521
- error: (H == null ? void 0 : H.message) || String(H)
4522
- }), O(H);
4523
- };
4524
- $e.set(k, { resolve: D, reject: K, timeoutId: v }), w.postMessage({ id: k, content: e, displayMode: n });
4525
- });
4526
- });
4527
- }
4528
- function Js(e, n = !0, t) {
4529
- const l = `${n ? "d" : "i"}:${e}`;
4530
- if (lt.set(l, t), lt.size > Co) {
4531
- const r = lt.keys().next().value;
4532
- lt.delete(r);
4533
- }
4534
- }
4535
- function Qs() {
4536
- return { inFlight: $e.size, max: $t };
4537
- }
4538
- function el(e) {
4539
- Number.isFinite(e) && e > 0 && ($t = Math.floor(e));
4540
- }
4541
- const _s = "WORKER_BUSY";
4542
- function tl() {
4543
- return $e.size >= $t;
4544
- }
4545
- function Ss(e = 2e3, n) {
4546
- return $e.size < $t ? Promise.resolve() : new Promise((t, l) => {
4547
- let r = !1, a;
4548
- const i = () => {
4549
- r || (r = !0, a && globalThis.clearTimeout(a), Mt.delete(i), t());
4550
- };
4551
- if (Mt.add(i), a = globalThis.setTimeout(() => {
4552
- if (r)
4553
- return;
4554
- r = !0, Mt.delete(i);
4555
- const w = new Error("Wait for worker slot timed out");
4556
- w.name = "WorkerBusyTimeout", w.code = "WORKER_BUSY_TIMEOUT", l(w);
4557
- }, e), queueMicrotask(() => dn()), n) {
4558
- const w = () => {
4559
- if (r)
4560
- return;
4561
- r = !0, a && globalThis.clearTimeout(a), Mt.delete(i);
4562
- const h = new Error("Aborted");
4563
- h.name = "AbortError", l(h);
4564
- };
4565
- n.aborted ? w() : n.addEventListener("abort", w, { once: !0 });
4566
- }
4567
- });
4568
- }
4569
- const ct = {
4570
- timeout: 2e3,
4571
- waitTimeout: 1500,
4572
- backoffMs: 30,
4573
- maxRetries: 1
4574
- };
4575
- function nl(e) {
4576
- e.timeout != null && (ct.timeout = Math.max(0, Math.floor(e.timeout))), e.waitTimeout != null && (ct.waitTimeout = Math.max(0, Math.floor(e.waitTimeout))), e.backoffMs != null && (ct.backoffMs = Math.max(0, Math.floor(e.backoffMs))), e.maxRetries != null && (ct.maxRetries = Math.max(0, Math.floor(e.maxRetries)));
4577
- }
4578
- function ol() {
4579
- return ie({}, ct);
4580
- }
4581
- function rl(l) {
4582
- return j(this, arguments, function* (e, n = !0, t = {}) {
4583
- var k, v, B, I;
4584
- const r = (k = t.timeout) != null ? k : ct.timeout, a = (v = t.waitTimeout) != null ? v : ct.waitTimeout, i = (B = t.backoffMs) != null ? B : ct.backoffMs, w = (I = t.maxRetries) != null ? I : ct.maxRetries, h = t.signal;
4585
- let c = 0;
4586
- for (; ; ) {
4587
- if (h != null && h.aborted) {
4588
- const O = new Error("Aborted");
4589
- throw O.name = "AbortError", O;
4590
- }
4591
- try {
4592
- return yield Is(e, n, r, h);
4593
- } catch (O) {
4594
- if ((O == null ? void 0 : O.code) !== _s || c >= w)
4595
- throw O;
4596
- if (c++, yield Ss(a, h).catch(() => {
4597
- }), h != null && h.aborted) {
4598
- const D = new Error("Aborted");
4599
- throw D.name = "AbortError", D;
4600
- }
4601
- i > 0 && (yield new Promise((D) => globalThis.setTimeout(D, i * c)));
4602
- }
4603
- }
4604
- });
4605
- }
4606
- const Es = Dt(() => import("./index-BM9Oro93.js")), Ls = Dt(() => import("./index-ELonlW3Z.js")), Ns = Dt(() => import("./index-Cc3u_ylp.js")), Hs = {
4607
- AdmonitionNode: rn,
4608
- BlockquoteNode: Ut,
4609
- CheckboxNode: tt,
4610
- CodeBlockNode: Es,
4611
- DefinitionListNode: Zt,
4612
- EmojiNode: Te,
4613
- FootnoteNode: Jt,
4614
- FootnoteReferenceNode: Ie,
4615
- FootnoteAnchorNode: Nt,
4616
- HardBreakNode: Bt,
4617
- HeadingNode: Xn,
4618
- HighlightNode: Ve,
4619
- ImageNode: mt,
4620
- InlineCodeNode: _e,
4621
- PreCodeNode: Rt,
4622
- InsertNode: Pe,
4623
- LinkNode: Ne,
4624
- ListItemNode: Qt,
4625
- ListNode: en,
4626
- MathBlockNode: Ls,
4627
- MathInlineNode: Ns,
4628
- MermaidBlockNode: Ht,
4629
- ParagraphNode: tn,
4630
- StrikethroughNode: Le,
4631
- StrongNode: Ee,
4632
- SubscriptNode: Ae,
4633
- SuperscriptNode: De,
4634
- TableNode: nn,
4635
- TextNode: we,
4636
- ThematicBreakNode: on,
4637
- ReferenceNode: Se,
4638
- MarkdownCodeBlockNode: $n
4639
- }, al = {
4640
- install(e, n) {
4641
- Object.entries(Hs).forEach(([t, l]) => {
4642
- e.component(t, l);
4643
- }), n != null && n.getLanguageIcon && is(n.getLanguageIcon), n != null && n.mathOptions && No(n.mathOptions);
4644
- }
4645
- };
4646
- export {
4647
- Us as $,
4648
- rn as A,
4649
- Ut as B,
4650
- tt as C,
4651
- Zt as D,
4652
- Te as E,
4653
- Nt as F,
4654
- Se as G,
4655
- Bt as H,
4656
- mt as I,
4657
- Ps as J,
4658
- As as K,
4659
- Ne as L,
4660
- $n as M,
4661
- qe as N,
4662
- Ws as O,
4663
- tn as P,
4664
- Ee as Q,
4665
- Ae as R,
4666
- Le as S,
4667
- De as T,
4668
- nn as U,
4669
- we as V,
4670
- _s as W,
4671
- on as X,
4672
- al as Y,
4673
- is as Z,
4674
- Rt as _,
4675
- On as a,
4676
- Zs as a0,
4677
- Gs as a1,
4678
- Is as a2,
4679
- Qs as a3,
4680
- el as a4,
4681
- tl as a5,
4682
- Ss as a6,
4683
- nl as a7,
4684
- ol as a8,
4685
- Ks as a9,
4686
- Os as aa,
4687
- Fs as ab,
4688
- na as ac,
4689
- Xs as ad,
4690
- Ys as ae,
4691
- ra as af,
4692
- aa as ag,
4693
- oo as ah,
4694
- ss as b,
4695
- un as c,
4696
- X as d,
4697
- Fn as e,
4698
- Js as f,
4699
- qs as g,
4700
- Wn as h,
4701
- Vs as i,
4702
- Es as j,
4703
- Jt as k,
4704
- ls as l,
4705
- Ie as m,
4706
- Ze as n,
4707
- Xn as o,
4708
- Ve as p,
4709
- _e as q,
4710
- rl as r,
4711
- ea as s,
4712
- Pe as t,
4713
- Kn as u,
4714
- Qt as v,
4715
- en as w,
4716
- Ls as x,
4717
- Ns as y,
4718
- Ht as z
4719
- };