@omg-dev/app 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist-lib/{ChangelogPage-tITBP5A1.js → ChangelogPage-8lbvM9Pz.js} +109 -1
  2. package/dist-lib/{File-BszRWhXA.js → File-B-qYa2zY.js} +1 -1
  3. package/dist-lib/{FileEditor-ByMnm-sa.js → FileEditor-BIz0qCyW.js} +2 -2
  4. package/dist-lib/{FileViewer-DgjR_OJp.js → FileViewer-Clmf04v1.js} +1 -1
  5. package/dist-lib/{SessionFilesPanel-T3CkIp2a.js → SessionFilesPanel-BKcTU57t.js} +2 -2
  6. package/dist-lib/{TermView-BJiSY2oC.js → TermView-gazV6UMU.js} +1 -1
  7. package/dist-lib/{chat-engine-ChrOJLdY.js → chat-engine-83mwx0z2.js} +1 -1
  8. package/dist-lib/{streamdown-response-Bt7VM-cZ.js → chunk-BO2N2NFS-kYiI5SD9.js} +5006 -6023
  9. package/dist-lib/{coding-agents-page-Bsy-dsUo.js → coding-agents-page-8Nf-IuE2.js} +80 -80
  10. package/dist-lib/embedded-BmrQsEvQ.js +32771 -0
  11. package/dist-lib/engine-compile-BeDRSL6Y.js +9199 -0
  12. package/dist-lib/{highlighted-body-OFNGDK62-bfel3kiX.js → highlighted-body-OFNGDK62-C2DGVKV8.js} +4 -4
  13. package/dist-lib/index-BXzud6tj.js +1247 -0
  14. package/dist-lib/{index-BNac_jIC.js → index-DWkBvb-9.js} +27 -27
  15. package/dist-lib/{index-Bw4EY_Nm.js → index-DcwavxA1.js} +3 -3
  16. package/dist-lib/index-Dtkd4mEk.js +29 -0
  17. package/dist-lib/index.js +1 -1
  18. package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +4 -0
  19. package/dist-lib/{resume-session-sheet-CsBKi_wb.js → resume-session-sheet-Dr_81Gfm.js} +1 -1
  20. package/dist-lib/{session-token-usage-CTQR54Yk.js → session-token-usage-CGhHZ3lT.js} +1 -1
  21. package/dist-lib/{shipped-page-B46DR9zS.js → shipped-page-p3oulUiM.js} +1 -1
  22. package/dist-lib/streamdown-response-Dbn0PKUH.js +1051 -0
  23. package/dist-lib/styles.css +1 -1
  24. package/package.json +4 -2
  25. package/dist-lib/embedded-cpSkU0tg.js +0 -28023
  26. package/dist-lib/engine-compile-BeZvvx0I.js +0 -10442
  27. package/dist-lib/mermaid-GHXKKRXX-CTlo5kzO.js +0 -4
@@ -0,0 +1,1051 @@
1
+ var Ve = Object.defineProperty;
2
+ var Ue = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var ae = (e, t, n) => Ue(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { jsx as B, jsxs as ce } from "react/jsx-runtime";
5
+ import { useMemo as He, useState as xe, useEffect as be, useRef as Qe } from "react";
6
+ import { B as Je, C as T, m as Xe, E as je, F as G, G as Ye, Q as Ze } from "./chunk-BO2N2NFS-kYiI5SD9.js";
7
+ import { b as Ke, c as et, a as tt, d as nt } from "./engine-compile-BeDRSL6Y.js";
8
+ import { cn as we } from "cnfast";
9
+ import { a8 as rt, x as it, a9 as ot } from "./embedded-BmrQsEvQ.js";
10
+ const d = (
11
+ /** @type {const} */
12
+ {
13
+ eof: null,
14
+ asterisk: 42,
15
+ // `*`
16
+ underscore: 95,
17
+ // `_`
18
+ tilde: 126
19
+ }
20
+ ), v = (
21
+ /** @type {const} */
22
+ {
23
+ attentionSideAfter: 2,
24
+ // Symbol to mark an attention sequence as after content: `a*`
25
+ characterGroupPunctuation: 2,
26
+ // Symbol used to indicate a character is punctuation
27
+ characterGroupWhitespace: 1
28
+ }
29
+ ), x = (
30
+ /** @type {const} */
31
+ {
32
+ // Generic type for data, such as in a title, a destination, etc.
33
+ data: "data",
34
+ // A whole character escape (`\-`).
35
+ // Includes `escapeMarker` and `characterEscapeValue`.
36
+ characterEscape: "characterEscape",
37
+ // Emphasis (`*alpha*`).
38
+ // Includes `emphasisSequence` and `emphasisText`.
39
+ emphasis: "emphasis",
40
+ // Sequence of emphasis markers (`*` or `_`).
41
+ emphasisSequence: "emphasisSequence",
42
+ // Emphasis text (`alpha`).
43
+ // Includes text.
44
+ emphasisText: "emphasisText",
45
+ // Strong (`**alpha**`).
46
+ // Includes `strongSequence` and `strongText`.
47
+ strong: "strong",
48
+ // Sequence of strong markers (`**` or `__`).
49
+ strongSequence: "strongSequence",
50
+ // Strong text (`alpha`).
51
+ // Includes text.
52
+ strongText: "strongText"
53
+ }
54
+ ), ut = 161, st = 1114109, at = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109], ct = 12288, lt = 65510, ft = [12288, 12288, 65281, 65376, 65504, 65510], dt = 8361, pt = 65518, ht = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518], gt = 32, mt = 10630, kt = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630], yt = 4352, St = 262141, Pe = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141], N = (e, t) => {
55
+ let n = 0, r = Math.floor(e.length / 2) - 1;
56
+ for (; n <= r; ) {
57
+ const o = Math.floor((n + r) / 2), i = o * 2;
58
+ if (t < e[i])
59
+ r = o - 1;
60
+ else if (t > e[i + 1])
61
+ n = o + 1;
62
+ else
63
+ return !0;
64
+ }
65
+ return !1;
66
+ }, le = 19968, [Ct, xt] = /* @__PURE__ */ bt(Pe);
67
+ function bt(e) {
68
+ let t = e[0], n = e[1];
69
+ for (let r = 0; r < e.length; r += 2) {
70
+ const o = e[r], i = e[r + 1];
71
+ if (le >= o && le <= i)
72
+ return [o, i];
73
+ i - o > n - t && (t = o, n = i);
74
+ }
75
+ return [t, n];
76
+ }
77
+ const jt = (e) => e < ut || e > st ? !1 : N(at, e), wt = (e) => e < ct || e > lt ? !1 : N(ft, e), Pt = (e) => e < dt || e > pt ? !1 : N(ht, e), At = (e) => e < gt || e > mt ? !1 : N(kt, e), $t = (e) => e >= Ct && e <= xt ? !0 : e < yt || e > St ? !1 : N(Pe, e);
78
+ function Bt(e) {
79
+ return jt(e) ? "ambiguous" : wt(e) ? "fullwidth" : Pt(e) ? "halfwidth" : At(e) ? "narrow" : $t(e) ? "wide" : "neutral";
80
+ }
81
+ function vt(e) {
82
+ if (!Number.isSafeInteger(e))
83
+ throw new TypeError(`Expected a code point, got \`${typeof e}\`.`);
84
+ }
85
+ function Ft(e) {
86
+ return vt(e), Bt(e);
87
+ }
88
+ function Tt(e) {
89
+ return new RegExp("^\\p{Emoji_Presentation}", "u").test(String.fromCodePoint(e));
90
+ }
91
+ function Et(e) {
92
+ if (!e || e < 4352) return !1;
93
+ switch (Ft(e)) {
94
+ case "fullwidth":
95
+ case "halfwidth":
96
+ return !0;
97
+ case "wide":
98
+ return !Tt(e);
99
+ case "narrow":
100
+ return !1;
101
+ case "ambiguous":
102
+ return 917760 <= e && e <= 917999 ? null : !1;
103
+ case "neutral":
104
+ return new RegExp("^\\p{sc=Hangul}", "u").test(String.fromCodePoint(e));
105
+ }
106
+ }
107
+ function It(e, t) {
108
+ return t !== 65025 || !e || e < 8216 ? !1 : e === 8216 || e === 8217 || e === 8220 || e === 8221;
109
+ }
110
+ function Nt(e) {
111
+ return e !== null && e >= 65024 && e <= 65038;
112
+ }
113
+ const Ot = Ae(new RegExp("\\p{P}|\\p{S}", "u")), qt = Ae(/\s/);
114
+ function Ae(e) {
115
+ return t;
116
+ function t(n) {
117
+ return n !== null && n > -1 && e.test(String.fromCodePoint(n));
118
+ }
119
+ }
120
+ function g(e) {
121
+ return !!(e & v.characterGroupWhitespace);
122
+ }
123
+ function b(e) {
124
+ return (e & S.cjkPunctuation) === v.characterGroupPunctuation;
125
+ }
126
+ function I(e) {
127
+ return !!(e & S.cjk);
128
+ }
129
+ function _t(e) {
130
+ return e === S.ivs;
131
+ }
132
+ function P(e) {
133
+ return !!(e & S.cjkOrIvs);
134
+ }
135
+ function O(e) {
136
+ return e === S.nonEmojiGeneralUseVS;
137
+ }
138
+ function R(e) {
139
+ return !!(e & S.spaceOrPunctuation);
140
+ }
141
+ let S;
142
+ (function(e) {
143
+ e.spaceOrPunctuation = 3, e.cjk = 4096, e.cjkPunctuation = 4098, e.ivs = 8192, e.cjkOrIvs = 12288, e.nonEmojiGeneralUseVS = 16384, e.variationSelector = 24576, e.ivsToCjkRightShift = 1;
144
+ })(S || (S = {}));
145
+ function k(e) {
146
+ if (e === d.eof || Je(e) || qt(e)) return v.characterGroupWhitespace;
147
+ let t = 0;
148
+ if (e >= 4352) {
149
+ if (Nt(e)) return S.nonEmojiGeneralUseVS;
150
+ switch (Et(e)) {
151
+ case null:
152
+ return S.ivs;
153
+ case !0:
154
+ t |= S.cjk;
155
+ break;
156
+ }
157
+ }
158
+ return Ot(e) && (t |= v.characterGroupPunctuation), t;
159
+ }
160
+ function V(e, t, n) {
161
+ if (!O(e)) return e;
162
+ const r = t(), o = k(r);
163
+ return !r || g(o) ? e : It(r, n) ? S.cjkPunctuation : Mt(o);
164
+ }
165
+ function Mt(e) {
166
+ return e & ~S.ivs;
167
+ }
168
+ function $e(e) {
169
+ return !!(e && e >= 55296 && e <= 56319);
170
+ }
171
+ function Be(e) {
172
+ return !!(e && e >= 56320 && e <= 57343);
173
+ }
174
+ function ve(e, t, n) {
175
+ if (t._bufferIndex < 2) return e;
176
+ const r = n({
177
+ start: {
178
+ ...t,
179
+ _bufferIndex: t._bufferIndex - 2
180
+ },
181
+ end: t
182
+ }).codePointAt(0);
183
+ return r && r >= 65536 ? r : e;
184
+ }
185
+ function Gt(e, t, n) {
186
+ const r = e >= 65536 ? 2 : 1;
187
+ if (t._bufferIndex < 1 + r) return null;
188
+ const o = t._bufferIndex - r - 2, i = n({
189
+ start: {
190
+ ...t,
191
+ _bufferIndex: o >= 0 ? o : 0
192
+ },
193
+ end: {
194
+ ...t,
195
+ _bufferIndex: t._bufferIndex - r
196
+ }
197
+ }), u = i.charCodeAt(i.length - 1);
198
+ if (Number.isNaN(u)) return null;
199
+ if (i.length < 2 || u < 56320 || 57343 < u) return u;
200
+ const s = i.codePointAt(0);
201
+ return s && s >= 65536 ? s : u;
202
+ }
203
+ var Fe = class {
204
+ /**
205
+ * @see {@link tryGetCodeTwoBefore}
206
+ *
207
+ * @param previousCode a previous code point. Should be greater than 65,535 if it represents a [Supplementary Character](https://www.unicode.org/glossary/#supplementary_character).
208
+ * @param nowPoint `this.now()` (`this` = `TokenizeContext`)
209
+ * @param sliceSerialize `this.sliceSerialize` (`this` = `TokenizeContext`)
210
+ */
211
+ constructor(e, t, n) {
212
+ ae(this, "cachedValue");
213
+ this.previousCode = e, this.nowPoint = t, this.sliceSerialize = n;
214
+ }
215
+ /**
216
+ * Returns the return value of {@link tryGetCodeTwoBefore}.
217
+ *
218
+ * If the value has not been computed yet, it will be computed and cached.
219
+ *
220
+ * @see {@link tryGetCodeTwoBefore}
221
+ *
222
+ * @returns a value greater than 65,535 if the code point two positions before represents a [Supplementary Character](https://www.unicode.org/glossary/#supplementary_character), a value less than 65,536 for a [BMP Character](https://www.unicode.org/glossary/#bmp_character), or `null` if not found
223
+ */
224
+ value() {
225
+ return this.cachedValue === void 0 && (this.cachedValue = Gt(this.previousCode, this.nowPoint, this.sliceSerialize)), this.cachedValue;
226
+ }
227
+ };
228
+ function Te(e, t, n) {
229
+ const r = n({
230
+ start: t,
231
+ end: {
232
+ ...t,
233
+ _bufferIndex: t._bufferIndex + 2
234
+ }
235
+ }).codePointAt(0);
236
+ return r && r >= 65536 ? r : e;
237
+ }
238
+ const U = {
239
+ name: "attention",
240
+ resolveAll: Lt,
241
+ tokenize: Rt
242
+ };
243
+ function Lt(e, t) {
244
+ let n = -1, r, o, i, u, s, a, c, l;
245
+ for (; ++n < e.length; ) if (e[n][0] === "enter" && e[n][1].type === "attentionSequence" && e[n][1]._close) {
246
+ for (r = n; r--; ) if (e[r][0] === "exit" && e[r][1].type === "attentionSequence" && e[r][1]._open && t.sliceSerialize(e[r][1]).charCodeAt(0) === t.sliceSerialize(e[n][1]).charCodeAt(0)) {
247
+ if ((e[r][1]._close || e[n][1]._open) && (e[n][1].end.offset - e[n][1].start.offset) % 3 && !((e[r][1].end.offset - e[r][1].start.offset + e[n][1].end.offset - e[n][1].start.offset) % 3)) continue;
248
+ a = e[r][1].end.offset - e[r][1].start.offset > 1 && e[n][1].end.offset - e[n][1].start.offset > 1 ? 2 : 1;
249
+ const f = { ...e[r][1].end }, p = { ...e[n][1].start };
250
+ fe(f, -a), fe(p, a), u = {
251
+ type: a > 1 ? x.strongSequence : x.emphasisSequence,
252
+ start: f,
253
+ end: { ...e[r][1].end }
254
+ }, s = {
255
+ type: a > 1 ? x.strongSequence : x.emphasisSequence,
256
+ start: { ...e[n][1].start },
257
+ end: p
258
+ }, i = {
259
+ type: a > 1 ? x.strongText : x.emphasisText,
260
+ start: { ...e[r][1].end },
261
+ end: { ...e[n][1].start }
262
+ }, o = {
263
+ type: a > 1 ? x.strong : x.emphasis,
264
+ start: { ...u.start },
265
+ end: { ...s.end }
266
+ }, e[r][1].end = { ...u.start }, e[n][1].start = { ...s.end }, c = [], e[r][1].end.offset - e[r][1].start.offset && (c = T(c, [[
267
+ "enter",
268
+ e[r][1],
269
+ t
270
+ ], [
271
+ "exit",
272
+ e[r][1],
273
+ t
274
+ ]])), c = T(c, [
275
+ [
276
+ "enter",
277
+ o,
278
+ t
279
+ ],
280
+ [
281
+ "enter",
282
+ u,
283
+ t
284
+ ],
285
+ [
286
+ "exit",
287
+ u,
288
+ t
289
+ ],
290
+ [
291
+ "enter",
292
+ i,
293
+ t
294
+ ]
295
+ ]), Xe(t.parser.constructs.insideSpan.null), c = T(c, je(t.parser.constructs.insideSpan.null, e.slice(r + 1, n), t)), c = T(c, [
296
+ [
297
+ "exit",
298
+ i,
299
+ t
300
+ ],
301
+ [
302
+ "enter",
303
+ s,
304
+ t
305
+ ],
306
+ [
307
+ "exit",
308
+ s,
309
+ t
310
+ ],
311
+ [
312
+ "exit",
313
+ o,
314
+ t
315
+ ]
316
+ ]), e[n][1].end.offset - e[n][1].start.offset ? (l = 2, c = T(c, [[
317
+ "enter",
318
+ e[n][1],
319
+ t
320
+ ], [
321
+ "exit",
322
+ e[n][1],
323
+ t
324
+ ]])) : l = 0, G(e, r - 1, n - r + 3, c), n = r + c.length - l - 2;
325
+ break;
326
+ }
327
+ }
328
+ for (n = -1; ++n < e.length; ) e[n][1].type === "attentionSequence" && (e[n][1].type = "data");
329
+ return e;
330
+ }
331
+ function Rt(e, t) {
332
+ const n = this.parser.constructs.attentionMarkers.null, { now: r, sliceSerialize: o, previous: i } = this, u = Be(i) ? ve(i, r(), o) : i, s = k(u), a = new Fe(u, r(), o), c = V(s, a.value.bind(a), u);
333
+ let l;
334
+ return f;
335
+ function f(h) {
336
+ return l = h, e.enter("attentionSequence"), p(h);
337
+ }
338
+ function p(h) {
339
+ if (h === l)
340
+ return e.consume(h), p;
341
+ const m = e.exit("attentionSequence"), C = k($e(h) ? Te(h, r(), o) : h), j = b(c), q = j || g(c), F = b(C), y = F || g(C), _ = P(c), A = !y || F && (q || _) || n.includes(h), w = !q || j && (y || I(C)) || n.includes(u);
342
+ return m._open = !!(l === d.asterisk ? A : A && (R(c) || !w)), m._close = !!(l === d.asterisk ? w : w && (R(C) || !A)), t(h);
343
+ }
344
+ }
345
+ function fe(e, t) {
346
+ e.column += t, e.offset += t, e._bufferIndex += t;
347
+ }
348
+ function zt() {
349
+ return {
350
+ text: {
351
+ [d.asterisk]: U,
352
+ [d.underscore]: U
353
+ },
354
+ insideSpan: { null: [U] }
355
+ };
356
+ }
357
+ function Dt() {
358
+ const e = this.data();
359
+ (e.micromarkExtensions || (e.micromarkExtensions = [])).push(zt());
360
+ }
361
+ const Wt = ";".codePointAt(0) ?? d.eof, Vt = "&".codePointAt(0) ?? d.eof;
362
+ function Ut() {
363
+ return { handlers: {
364
+ emphasis: Ee,
365
+ strong: Ie,
366
+ text: Ht
367
+ } };
368
+ }
369
+ Ee.peek = Ne;
370
+ Ie.peek = Oe;
371
+ function Ee(e, t, n, r) {
372
+ return qe(e, t, n, r, Ne(e, t, n), 1);
373
+ }
374
+ function Ie(e, t, n, r) {
375
+ return qe(e, t, n, r, Oe(e, t, n), 2);
376
+ }
377
+ function Ne(e, t, n) {
378
+ return n.options.emphasis || "*";
379
+ }
380
+ function Oe(e, t, n) {
381
+ return n.options.strong || "*";
382
+ }
383
+ function qe(e, t, n, r, o, i) {
384
+ const u = o.repeat(i), s = n.enter(i === 1 ? "emphasis" : "strong"), a = n.createTracker(r), c = a.move(u);
385
+ let l = a.move(n.containerPhrasing(e, {
386
+ after: o,
387
+ before: c,
388
+ ...a.current()
389
+ }));
390
+ const f = Xt(e, t, n, r.before), p = Yt(e, t, n, r.after), h = de(f, z(l), o, "open");
391
+ h.inside && l && (l = nn(l));
392
+ const m = de({
393
+ current: Z(l),
394
+ previous: Y(l)
395
+ }, p, o, "close");
396
+ m.inside && l && (l = rn(l));
397
+ const C = a.move(u);
398
+ s();
399
+ const j = m.outside && tn(t, n);
400
+ return n.attentionEncodeSurroundingInfo = {
401
+ after: m.outside && !j,
402
+ before: h.outside
403
+ }, n.cjkFriendlyEncodeAfterSupplementaryText = j, c + l + C;
404
+ }
405
+ function Ht(e, t, n, r) {
406
+ const o = n;
407
+ if (!o.cjkFriendlyEncodeAfterSupplementaryText) return n.safe(e.value, r);
408
+ o.cjkFriendlyEncodeAfterSupplementaryText = !1;
409
+ const [i = ""] = [...e.value], u = e.value.slice(i.length);
410
+ return `${re(i.codePointAt(0) ?? d.eof)}${n.safe(u, {
411
+ ...r,
412
+ before: ";"
413
+ })}`;
414
+ }
415
+ function de(e, t, n, r) {
416
+ const o = ne(e), i = k(t);
417
+ if (!P(o) && !P(i)) return r === "open" ? pe(o, i, n) : pe(i, o, n);
418
+ const u = {
419
+ inside: !1,
420
+ outside: !1
421
+ }, s = {
422
+ inside: !0,
423
+ outside: !1
424
+ }, a = {
425
+ inside: !1,
426
+ outside: !0
427
+ }, c = {
428
+ inside: !0,
429
+ outside: !0
430
+ };
431
+ for (const l of [
432
+ u,
433
+ s,
434
+ a,
435
+ c
436
+ ]) {
437
+ const f = r === "open" ? l.outside ? he : e : l.inside ? he : e, p = r === "open" ? l.inside ? ge : t : l.outside ? ge : t;
438
+ if (r === "open" ? Qt(n, f, p) : Jt(n, f, p)) return l;
439
+ }
440
+ return c;
441
+ }
442
+ function pe(e, t, n) {
443
+ return H(e) ? H(t) ? n === "_" ? {
444
+ inside: !0,
445
+ outside: !0
446
+ } : {
447
+ inside: !1,
448
+ outside: !1
449
+ } : g(t) ? {
450
+ inside: !0,
451
+ outside: !0
452
+ } : {
453
+ inside: !1,
454
+ outside: !0
455
+ } : g(e) ? H(t) ? {
456
+ inside: !1,
457
+ outside: !1
458
+ } : g(t) ? {
459
+ inside: !0,
460
+ outside: !0
461
+ } : {
462
+ inside: !1,
463
+ outside: !1
464
+ } : g(t) ? {
465
+ inside: !0,
466
+ outside: !1
467
+ } : {
468
+ inside: !1,
469
+ outside: !1
470
+ };
471
+ }
472
+ function Qt(e, t, n) {
473
+ const r = ne(t), { close: o, open: i } = _e(r, k(n));
474
+ return e === "_" ? i && (R(r) || !o) : i;
475
+ }
476
+ function Jt(e, t, n) {
477
+ const r = k(n), { close: o, open: i } = _e(ne(t), r);
478
+ return e === "_" ? o && (R(r) || !i) : o;
479
+ }
480
+ function _e(e, t) {
481
+ const n = b(e), r = n || g(e), o = b(t), i = o || g(t);
482
+ return {
483
+ open: !i || o && (r || P(e)),
484
+ close: !r || n && (i || I(t))
485
+ };
486
+ }
487
+ function H(e) {
488
+ return !g(e) && !b(e);
489
+ }
490
+ function ne(e) {
491
+ const t = k(e.current);
492
+ return e.current === null || !O(t) ? t : V(t, () => e.previous, e.current);
493
+ }
494
+ function Xt(e, t, n, r) {
495
+ let o = Z(r), i = Y(r);
496
+ if (Zt(o) || en(o, i)) {
497
+ const u = Me(e, t, n, -1);
498
+ u && (o = Z(u), i = Y(u));
499
+ }
500
+ return {
501
+ current: o,
502
+ previous: i
503
+ };
504
+ }
505
+ function Yt(e, t, n, r) {
506
+ const o = z(r);
507
+ if (!Kt(o)) return o;
508
+ const i = Me(e, t, n, 1);
509
+ return i ? z(i) : o;
510
+ }
511
+ function Zt(e) {
512
+ return e !== null && 56320 <= e && e <= 57343;
513
+ }
514
+ function Kt(e) {
515
+ return e !== null && 55296 <= e && e <= 56319;
516
+ }
517
+ function en(e, t) {
518
+ return O(k(e)) && (t === null || t === d.eof);
519
+ }
520
+ function Me(e, t, n, r) {
521
+ if (!t) return;
522
+ const o = n.indexStack.at(-1), i = t.children, u = typeof o == "number" ? o : i.indexOf(e);
523
+ if (u < 0) return;
524
+ const s = i[u + r];
525
+ return Ge(s) || void 0;
526
+ }
527
+ function tn(e, t) {
528
+ if (!e) return !1;
529
+ const n = t.indexStack.at(-1);
530
+ if (typeof n != "number") return !1;
531
+ const r = e.children[n + 1];
532
+ return (r == null ? void 0 : r.type) === "text" && (z(r.value) ?? 0) > 65535;
533
+ }
534
+ function Ge(e) {
535
+ return !e || typeof e != "object" ? "" : "value" in e && typeof e.value == "string" ? e.value : "alt" in e && typeof e.alt == "string" ? e.alt : "children" in e && Array.isArray(e.children) ? e.children.map(Ge).join("") : "";
536
+ }
537
+ function re(e) {
538
+ return `&#x${(e ?? 0).toString(16).toUpperCase()};`;
539
+ }
540
+ function nn(e) {
541
+ const [t = ""] = [...e];
542
+ return re(t.codePointAt(0) ?? d.eof) + e.slice(t.length);
543
+ }
544
+ function rn(e) {
545
+ const t = [...e], n = t.pop();
546
+ return `${t.join("")}${re((n == null ? void 0 : n.codePointAt(0)) ?? d.eof)}`;
547
+ }
548
+ function Y(e) {
549
+ var n;
550
+ const t = [...e];
551
+ return t.pop(), ((n = t.at(-1)) == null ? void 0 : n.codePointAt(0)) ?? d.eof;
552
+ }
553
+ function z(e) {
554
+ return e.codePointAt(0) ?? d.eof;
555
+ }
556
+ function Z(e) {
557
+ var t;
558
+ return ((t = [...e].at(-1)) == null ? void 0 : t.codePointAt(0)) ?? d.eof;
559
+ }
560
+ const he = {
561
+ current: Wt,
562
+ previous: d.eof
563
+ }, ge = Vt;
564
+ function on() {
565
+ const e = this.data();
566
+ (e.toMarkdownExtensions || (e.toMarkdownExtensions = [])).push(Ut());
567
+ }
568
+ function un() {
569
+ Dt.call(this), on.call(this);
570
+ }
571
+ var sn = un;
572
+ function an(e) {
573
+ let t = (e || {}).singleTilde;
574
+ const n = {
575
+ name: "strikethrough",
576
+ tokenize: o,
577
+ resolveAll: r
578
+ };
579
+ return t == null && (t = !0), {
580
+ text: { [d.tilde]: n },
581
+ insideSpan: { null: [n] },
582
+ attentionMarkers: { null: [d.tilde] }
583
+ };
584
+ function r(i, u) {
585
+ let s = -1;
586
+ for (; ++s < i.length; ) if (i[s][0] === "enter" && i[s][1].type === "strikethroughSequenceTemporary" && i[s][1]._close) {
587
+ let a = s;
588
+ for (; a--; ) if (i[a][0] === "exit" && i[a][1].type === "strikethroughSequenceTemporary" && i[a][1]._open && i[s][1].end.offset - i[s][1].start.offset === i[a][1].end.offset - i[a][1].start.offset) {
589
+ i[s][1].type = "strikethroughSequence", i[a][1].type = "strikethroughSequence";
590
+ const c = {
591
+ type: "strikethrough",
592
+ start: Object.assign({}, i[a][1].start),
593
+ end: Object.assign({}, i[s][1].end)
594
+ }, l = {
595
+ type: "strikethroughText",
596
+ start: Object.assign({}, i[a][1].end),
597
+ end: Object.assign({}, i[s][1].start)
598
+ }, f = [
599
+ [
600
+ "enter",
601
+ c,
602
+ u
603
+ ],
604
+ [
605
+ "enter",
606
+ i[a][1],
607
+ u
608
+ ],
609
+ [
610
+ "exit",
611
+ i[a][1],
612
+ u
613
+ ],
614
+ [
615
+ "enter",
616
+ l,
617
+ u
618
+ ]
619
+ ], p = u.parser.constructs.insideSpan.null;
620
+ p && G(f, f.length, 0, je(p, i.slice(a + 1, s), u)), G(f, f.length, 0, [
621
+ [
622
+ "exit",
623
+ l,
624
+ u
625
+ ],
626
+ [
627
+ "enter",
628
+ i[s][1],
629
+ u
630
+ ],
631
+ [
632
+ "exit",
633
+ i[s][1],
634
+ u
635
+ ],
636
+ [
637
+ "exit",
638
+ c,
639
+ u
640
+ ]
641
+ ]), G(i, a - 1, s - a + 3, f), s = a + f.length - 2;
642
+ break;
643
+ }
644
+ }
645
+ for (s = -1; ++s < i.length; ) i[s][1].type === "strikethroughSequenceTemporary" && (i[s][1].type = x.data);
646
+ return i;
647
+ }
648
+ function o(i, u, s) {
649
+ const { now: a, sliceSerialize: c, previous: l } = this, f = Be(l) ? ve(l, a(), c) : l, p = k(f), h = new Fe(f, a(), c), m = V(p, h.value.bind(h), f), C = this.events;
650
+ let j = 0;
651
+ return q;
652
+ function q(y) {
653
+ return f === d.tilde && C[C.length - 1][1].type !== x.characterEscape ? s(y) : (i.enter("strikethroughSequenceTemporary"), F(y));
654
+ }
655
+ function F(y) {
656
+ const _ = k(f);
657
+ if (y === d.tilde)
658
+ return j > 1 ? s(y) : (i.consume(y), j++, F);
659
+ if (j < 2 && !t) return s(y);
660
+ const A = i.exit("strikethroughSequenceTemporary"), w = k($e(y) ? Te(y, a(), c) : y), ue = b(m) || g(m), se = b(w) || g(w), We = I(m) || _t(_);
661
+ return A._open = !se || w === v.attentionSideAfter && (ue || We), A._close = !ue || _ === v.attentionSideAfter && (se || I(w)), u(y);
662
+ }
663
+ }
664
+ }
665
+ function cn(e) {
666
+ const t = this.data();
667
+ (t.micromarkExtensions || (t.micromarkExtensions = [])).push(an(e));
668
+ }
669
+ const ln = [
670
+ "autolink",
671
+ "destinationLiteral",
672
+ "destinationRaw",
673
+ "reference",
674
+ "titleQuote",
675
+ "titleApostrophe"
676
+ ], fn = ";".codePointAt(0) ?? d.eof, dn = "&".codePointAt(0) ?? d.eof;
677
+ function pn() {
678
+ return {
679
+ unsafe: [{
680
+ character: "~",
681
+ inConstruct: "phrasing",
682
+ notInConstruct: ln
683
+ }],
684
+ handlers: {
685
+ delete: Le,
686
+ text: hn
687
+ }
688
+ };
689
+ }
690
+ Le.peek = gn;
691
+ function Le(e, t, n, r) {
692
+ const i = n.enter("strikethrough"), u = n.createTracker(r), s = u.move("~~");
693
+ let a = u.move(n.containerPhrasing(e, {
694
+ after: "~",
695
+ before: s,
696
+ ...u.current()
697
+ }));
698
+ const c = yn(e, t, n, r.before), l = Sn(e, t, n, r.after), f = me(c, D(a), "open");
699
+ f.inside && a && (a = wn(a));
700
+ const p = me({
701
+ current: ee(a),
702
+ previous: K(a)
703
+ }, l, "close");
704
+ p.inside && a && (a = Pn(a));
705
+ const h = u.move("~~");
706
+ i();
707
+ const m = p.outside && jn(t, n);
708
+ return n.attentionEncodeSurroundingInfo = {
709
+ after: p.outside && !m,
710
+ before: f.outside
711
+ }, n.cjkFriendlyEncodeAfterSupplementaryText = m, s + a + h;
712
+ }
713
+ function hn(e, t, n, r) {
714
+ const o = n;
715
+ if (!o.cjkFriendlyEncodeAfterSupplementaryText) return n.safe(e.value, r);
716
+ o.cjkFriendlyEncodeAfterSupplementaryText = !1;
717
+ const [i = ""] = [...e.value], u = e.value.slice(i.length);
718
+ return `${oe(i.codePointAt(0) ?? d.eof)}${n.safe(u, {
719
+ ...r,
720
+ before: ";"
721
+ })}`;
722
+ }
723
+ function gn() {
724
+ return "~";
725
+ }
726
+ function me(e, t, n) {
727
+ const r = ie(e), o = k(t);
728
+ if (!P(r) && !P(o)) return n === "open" ? ke(r, o) : ke(o, r);
729
+ const i = {
730
+ inside: !1,
731
+ outside: !1
732
+ }, u = {
733
+ inside: !0,
734
+ outside: !1
735
+ }, s = {
736
+ inside: !1,
737
+ outside: !0
738
+ }, a = {
739
+ inside: !0,
740
+ outside: !0
741
+ };
742
+ for (const c of [
743
+ i,
744
+ u,
745
+ s,
746
+ a
747
+ ]) {
748
+ const l = n === "open" ? c.outside ? ye : e : c.inside ? ye : e, f = n === "open" ? c.inside ? Se : t : c.outside ? Se : t;
749
+ if (n === "open" ? mn(l, f) : kn(l, f)) return c;
750
+ }
751
+ return a;
752
+ }
753
+ function ke(e, t) {
754
+ return Q(e) ? Q(t) ? {
755
+ inside: !1,
756
+ outside: !1
757
+ } : g(t) ? {
758
+ inside: !0,
759
+ outside: !0
760
+ } : {
761
+ inside: !1,
762
+ outside: !0
763
+ } : g(e) ? Q(t) ? {
764
+ inside: !1,
765
+ outside: !1
766
+ } : g(t) ? {
767
+ inside: !0,
768
+ outside: !0
769
+ } : {
770
+ inside: !1,
771
+ outside: !1
772
+ } : g(t) ? {
773
+ inside: !0,
774
+ outside: !1
775
+ } : {
776
+ inside: !1,
777
+ outside: !1
778
+ };
779
+ }
780
+ function mn(e, t) {
781
+ const { open: n } = Re(ie(e), k(t));
782
+ return n;
783
+ }
784
+ function kn(e, t) {
785
+ const n = k(t), { close: r } = Re(ie(e), n);
786
+ return r;
787
+ }
788
+ function Re(e, t) {
789
+ const n = b(e), r = n || g(e), o = b(t), i = o || g(t);
790
+ return {
791
+ open: !i || o && (r || P(e)),
792
+ close: !r || n && (i || I(t))
793
+ };
794
+ }
795
+ function Q(e) {
796
+ return !g(e) && !b(e);
797
+ }
798
+ function ie(e) {
799
+ const t = k(e.current);
800
+ return e.current === null || !O(t) ? t : V(t, () => e.previous, e.current);
801
+ }
802
+ function yn(e, t, n, r) {
803
+ let o = ee(r), i = K(r);
804
+ if (Cn(o) || bn(o, i)) {
805
+ const u = ze(e, t, n, -1);
806
+ u && (o = ee(u), i = K(u));
807
+ }
808
+ return {
809
+ current: o,
810
+ previous: i
811
+ };
812
+ }
813
+ function Sn(e, t, n, r) {
814
+ const o = D(r);
815
+ if (!xn(o)) return o;
816
+ const i = ze(e, t, n, 1);
817
+ return i ? D(i) : o;
818
+ }
819
+ function Cn(e) {
820
+ return e !== null && 56320 <= e && e <= 57343;
821
+ }
822
+ function xn(e) {
823
+ return e !== null && 55296 <= e && e <= 56319;
824
+ }
825
+ function bn(e, t) {
826
+ return O(k(e)) && (t === null || t === d.eof);
827
+ }
828
+ function ze(e, t, n, r) {
829
+ if (!t) return;
830
+ const o = n.indexStack.at(-1), i = t.children, u = typeof o == "number" ? o : i.indexOf(e);
831
+ if (u < 0) return;
832
+ const s = i[u + r];
833
+ return De(s) || void 0;
834
+ }
835
+ function jn(e, t) {
836
+ if (!e) return !1;
837
+ const n = t.indexStack.at(-1);
838
+ if (typeof n != "number") return !1;
839
+ const r = e.children[n + 1];
840
+ return (r == null ? void 0 : r.type) === "text" && (D(r.value) ?? 0) > 65535;
841
+ }
842
+ function De(e) {
843
+ return !e || typeof e != "object" ? "" : "value" in e && typeof e.value == "string" ? e.value : "alt" in e && typeof e.alt == "string" ? e.alt : "children" in e && Array.isArray(e.children) ? e.children.map(De).join("") : "";
844
+ }
845
+ function oe(e) {
846
+ return `&#x${(e ?? 0).toString(16).toUpperCase()};`;
847
+ }
848
+ function wn(e) {
849
+ const [t = ""] = [...e];
850
+ return oe(t.codePointAt(0) ?? d.eof) + e.slice(t.length);
851
+ }
852
+ function Pn(e) {
853
+ const t = [...e], n = t.pop();
854
+ return `${t.join("")}${oe((n == null ? void 0 : n.codePointAt(0)) ?? d.eof)}`;
855
+ }
856
+ function K(e) {
857
+ var n;
858
+ const t = [...e];
859
+ return t.pop(), ((n = t.at(-1)) == null ? void 0 : n.codePointAt(0)) ?? d.eof;
860
+ }
861
+ function D(e) {
862
+ return e.codePointAt(0) ?? d.eof;
863
+ }
864
+ function ee(e) {
865
+ var t;
866
+ return ((t = [...e].at(-1)) == null ? void 0 : t.codePointAt(0)) ?? d.eof;
867
+ }
868
+ const ye = {
869
+ current: fn,
870
+ previous: d.eof
871
+ }, Se = dn;
872
+ function An() {
873
+ const e = this.data();
874
+ (e.toMarkdownExtensions || (e.toMarkdownExtensions = [])).push(pn());
875
+ }
876
+ function $n(e) {
877
+ cn.call(this, e), An.call(this);
878
+ }
879
+ var Bn = $n, vn = /* @__PURE__ */ new Set(["。", ".", ",", "、", "?", "!", ":", ";", "(", ")", "【", "】", "「", "」", "『", "』", "〈", "〉", "《", "》"]), Fn = /^(https?:\/\/|mailto:|www\.)/i, Tn = (e) => {
880
+ if (e.children.length !== 1) return !1;
881
+ let t = e.children[0];
882
+ return t.type === "text" && t.value === e.url;
883
+ }, En = (e) => {
884
+ let t = 0;
885
+ for (let n of e) {
886
+ if (vn.has(n)) return t;
887
+ t += n.length;
888
+ }
889
+ return null;
890
+ }, In = (e, t) => ({ ...t, url: e, children: [{ type: "text", value: e }] }), Nn = (e) => ({ type: "text", value: e }), On = () => (e) => {
891
+ Ye(e, "link", (t, n, r) => {
892
+ if (!r || typeof n != "number" || !Tn(t) || !Fn.test(t.url)) return;
893
+ let o = En(t.url);
894
+ if (o === null || o === 0) return;
895
+ let i = t.url.slice(0, o), u = t.url.slice(o), s = In(i, t), a = Nn(u);
896
+ return r.children.splice(n, 1, s, a), n + 1;
897
+ });
898
+ };
899
+ function qn() {
900
+ let e = [sn], t = [On, Bn], n = [...e, ...t];
901
+ return { name: "cjk", type: "cjk", remarkPluginsBefore: e, remarkPluginsAfter: t, remarkPlugins: n };
902
+ }
903
+ var _n = qn(), Mn = nt({ forgiving: !0 }), Gn = Object.fromEntries(tt.flatMap((e) => {
904
+ var t;
905
+ return ((t = e.aliases) != null ? t : []).map((n) => [n, e.id]);
906
+ })), L = new Set(Object.keys(Ke)), Ce = (e) => {
907
+ let t = e.trim().toLowerCase();
908
+ return Gn[t] || (L.has(t), t);
909
+ }, J = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), W = (e) => {
910
+ var t;
911
+ return typeof e == "string" ? e : (t = e.name) != null ? t : "custom";
912
+ }, Ln = (e, t) => `${e}-${W(t[0])}-${W(t[1])}`, Rn = (e, t, n) => {
913
+ let r = e.slice(0, 100), o = e.length > 100 ? e.slice(-100) : "";
914
+ return `${t}:${n[0]}:${n[1]}:${e.length}:${r}:${o}`;
915
+ }, zn = (e, t) => {
916
+ let n = Ln(e, t);
917
+ if (J.has(n)) return J.get(n);
918
+ let r = et({ themes: t, langs: [e], engine: Mn });
919
+ return J.set(n, r), r;
920
+ };
921
+ function Dn(e = {}) {
922
+ var t;
923
+ let n = (t = e.themes) != null ? t : ["github-light", "github-dark"];
924
+ return { name: "shiki", type: "code-highlighter", supportsLanguage(r) {
925
+ let o = Ce(r);
926
+ return L.has(o);
927
+ }, getSupportedLanguages() {
928
+ return Array.from(L);
929
+ }, getThemes() {
930
+ return n;
931
+ }, highlight({ code: r, language: o, themes: i }, u) {
932
+ let s = Ce(o), a = [W(i[0]), W(i[1])], c = Rn(r, s, a);
933
+ if (X.has(c)) return X.get(c);
934
+ u && ($.has(c) || $.set(c, /* @__PURE__ */ new Set()), $.get(c).add(u));
935
+ let l = L.has(s) ? s : "text";
936
+ return zn(l, i).then((f) => {
937
+ let p = f.getLoadedLanguages().includes(s) ? s : "text", h = f.codeToTokens(r, { lang: p, themes: { light: a[0], dark: a[1] } });
938
+ X.set(c, h);
939
+ let m = $.get(c);
940
+ if (m) {
941
+ for (let C of m) C(h);
942
+ $.delete(c);
943
+ }
944
+ }).catch((f) => {
945
+ console.error("[Streamdown Code] Failed to highlight code:", f), $.delete(c);
946
+ }), null;
947
+ } };
948
+ }
949
+ var Wn = Dn();
950
+ let E = null, M = null;
951
+ const te = /* @__PURE__ */ new Set();
952
+ function Vn(e) {
953
+ return typeof e != "string" ? !1 : /```(?:mermaid|graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|gitGraph|mindmap|timeline|quadrantChart|xychart|block-beta|architecture-beta|packet-beta)\b/i.test(e) || /(^|\n)\s*(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|gitGraph|mindmap|timeline|quadrantChart)\b/.test(e) || /(^|[^\\])(\$\$|\\\(|\\\[)/.test(e);
954
+ }
955
+ function Un() {
956
+ return M || (M = Promise.all([
957
+ import("./index-DWkBvb-9.js"),
958
+ import("./index-JkCQXUYs.js").then((e) => e.bp)
959
+ ]).then(([e, t]) => {
960
+ E = { math: e.math, mermaid: t.mermaid };
961
+ for (const n of te) n();
962
+ }).catch(() => {
963
+ M = null;
964
+ })), M;
965
+ }
966
+ function Hn(e) {
967
+ const t = Vn(e), [n, r] = xe(
968
+ t ? E : null
969
+ );
970
+ return be(() => {
971
+ if (!t) {
972
+ r(null);
973
+ return;
974
+ }
975
+ if (E) {
976
+ r(E);
977
+ return;
978
+ }
979
+ const o = () => r(E);
980
+ return te.add(o), Un(), () => {
981
+ te.delete(o);
982
+ };
983
+ }, [t]), { cjk: _n, code: Wn, ...n ?? {} };
984
+ }
985
+ async function Qn(e) {
986
+ try {
987
+ await navigator.clipboard.writeText(e);
988
+ return;
989
+ } catch {
990
+ }
991
+ const t = document.createElement("textarea");
992
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.left = "-9999px", document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
993
+ }
994
+ function Jn({ children: e, className: t, href: n, node: r, ...o }) {
995
+ const [i, u] = xe(!1), s = Qe(null), a = typeof n == "string" && n.length > 0;
996
+ be(() => () => {
997
+ s.current != null && window.clearTimeout(s.current);
998
+ }, []);
999
+ const c = async () => {
1000
+ a && (await Qn(n), u(!0), s.current != null && window.clearTimeout(s.current), s.current = window.setTimeout(() => u(!1), 1200));
1001
+ };
1002
+ return a ? /* @__PURE__ */ ce("span", { className: "inline", children: [
1003
+ /* @__PURE__ */ ce(
1004
+ "a",
1005
+ {
1006
+ className: we("break-all font-medium text-primary underline underline-offset-4", t),
1007
+ href: n,
1008
+ target: "_blank",
1009
+ rel: "noreferrer noopener",
1010
+ ...o,
1011
+ children: [
1012
+ e,
1013
+ /* @__PURE__ */ B(rt, { className: "ml-0.5 inline size-3 align-[-0.125em]", "aria-hidden": "true" })
1014
+ ]
1015
+ }
1016
+ ),
1017
+ /* @__PURE__ */ B(
1018
+ "button",
1019
+ {
1020
+ type: "button",
1021
+ onClick: (l) => {
1022
+ l.preventDefault(), l.stopPropagation(), c();
1023
+ },
1024
+ title: i ? "Copied" : "Copy link",
1025
+ "aria-label": i ? "Copied" : "Copy link",
1026
+ className: "ml-1 inline-grid size-5 place-items-center rounded text-muted-foreground align-[-0.25em] hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1027
+ children: i ? /* @__PURE__ */ B(it, { className: "size-3.5" }) : /* @__PURE__ */ B(ot, { className: "size-3.5" })
1028
+ }
1029
+ )
1030
+ ] }) : /* @__PURE__ */ B("a", { className: t, ...o, children: e });
1031
+ }
1032
+ function rr({ className: e, mode: t = "static", children: n, components: r, ...o }) {
1033
+ const i = Hn(n), u = He(
1034
+ () => ({ a: Jn, ...r }),
1035
+ [r]
1036
+ );
1037
+ return /* @__PURE__ */ B(
1038
+ Ze,
1039
+ {
1040
+ className: we("markdown msg-text size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", e),
1041
+ components: u,
1042
+ mode: t,
1043
+ plugins: i,
1044
+ ...o,
1045
+ children: n
1046
+ }
1047
+ );
1048
+ }
1049
+ export {
1050
+ rr as StreamdownResponse
1051
+ };