markstream-react 0.0.1 → 0.0.3-beta.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.
- package/dist/index.js +1407 -1387
- package/package.json +16 -15
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Ct, { useMemo as H, useState as P, createContext as Ur, useContext as Kr, useRef as R, useEffect as W, useCallback as D, useLayoutEffect as Yr, useSyncExternalStore as qr } from "react";
|
|
2
2
|
import { getMarkdown as Jt, parseMarkdownToStructure as Gr } from "stream-markdown-parser";
|
|
3
3
|
import { autoUpdate as Mr, computePosition as Er, offset as Tr, flip as Rr, shift as Sr } from "@floating-ui/dom";
|
|
4
4
|
import { createPortal as ir } from "react-dom";
|
|
@@ -7,13 +7,13 @@ var dr;
|
|
|
7
7
|
function Jr() {
|
|
8
8
|
if (dr) return Rt;
|
|
9
9
|
dr = 1;
|
|
10
|
-
var t =
|
|
11
|
-
function c(
|
|
10
|
+
var t = Ct, e = /* @__PURE__ */ Symbol.for("react.element"), r = /* @__PURE__ */ Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
11
|
+
function c(m, s, g) {
|
|
12
12
|
var f, h = {}, C = null, w = null;
|
|
13
13
|
g !== void 0 && (C = "" + g), s.key !== void 0 && (C = "" + s.key), s.ref !== void 0 && (w = s.ref);
|
|
14
|
-
for (f in s) o.call(s, f) && !
|
|
15
|
-
if (
|
|
16
|
-
return { $$typeof: e, type:
|
|
14
|
+
for (f in s) o.call(s, f) && !u.hasOwnProperty(f) && (h[f] = s[f]);
|
|
15
|
+
if (m && m.defaultProps) for (f in s = m.defaultProps, s) h[f] === void 0 && (h[f] = s[f]);
|
|
16
|
+
return { $$typeof: e, type: m, key: C, ref: w, props: h, _owner: a.current };
|
|
17
17
|
}
|
|
18
18
|
return Rt.Fragment = r, Rt.jsx = c, Rt.jsxs = c, Rt;
|
|
19
19
|
}
|
|
@@ -21,48 +21,48 @@ var St = {};
|
|
|
21
21
|
var mr;
|
|
22
22
|
function Zr() {
|
|
23
23
|
return mr || (mr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
24
|
-
var t =
|
|
25
|
-
function
|
|
24
|
+
var t = Ct, e = /* @__PURE__ */ Symbol.for("react.element"), r = /* @__PURE__ */ Symbol.for("react.portal"), o = /* @__PURE__ */ Symbol.for("react.fragment"), a = /* @__PURE__ */ Symbol.for("react.strict_mode"), u = /* @__PURE__ */ Symbol.for("react.profiler"), c = /* @__PURE__ */ Symbol.for("react.provider"), m = /* @__PURE__ */ Symbol.for("react.context"), s = /* @__PURE__ */ Symbol.for("react.forward_ref"), g = /* @__PURE__ */ Symbol.for("react.suspense"), f = /* @__PURE__ */ Symbol.for("react.suspense_list"), h = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), w = /* @__PURE__ */ Symbol.for("react.offscreen"), x = Symbol.iterator, S = "@@iterator";
|
|
25
|
+
function O(i) {
|
|
26
26
|
if (i === null || typeof i != "object")
|
|
27
27
|
return null;
|
|
28
|
-
var p =
|
|
28
|
+
var p = x && i[x] || i[S];
|
|
29
29
|
return typeof p == "function" ? p : null;
|
|
30
30
|
}
|
|
31
31
|
var L = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
32
32
|
function M(i) {
|
|
33
33
|
{
|
|
34
|
-
for (var p = arguments.length, k = new Array(p > 1 ? p - 1 : 0),
|
|
35
|
-
k[
|
|
34
|
+
for (var p = arguments.length, k = new Array(p > 1 ? p - 1 : 0), _ = 1; _ < p; _++)
|
|
35
|
+
k[_ - 1] = arguments[_];
|
|
36
36
|
I("error", i, k);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
function I(i, p, k) {
|
|
40
40
|
{
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
return String(
|
|
41
|
+
var _ = L.ReactDebugCurrentFrame, ee = _.getStackAddendum();
|
|
42
|
+
ee !== "" && (p += "%s", k = k.concat([ee]));
|
|
43
|
+
var se = k.map(function(G) {
|
|
44
|
+
return String(G);
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
se.unshift("Warning: " + p), Function.prototype.apply.call(console[i], console, se);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
var
|
|
50
|
-
|
|
49
|
+
var $ = !1, te = !1, ue = !1, ie = !1, de = !1, ce;
|
|
50
|
+
ce = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
51
51
|
function Se(i) {
|
|
52
|
-
return !!(typeof i == "string" || typeof i == "function" || i === o || i ===
|
|
52
|
+
return !!(typeof i == "string" || typeof i == "function" || i === o || i === u || de || i === a || i === g || i === f || ie || i === w || $ || te || ue || typeof i == "object" && i !== null && (i.$$typeof === C || i.$$typeof === h || i.$$typeof === c || i.$$typeof === m || i.$$typeof === s || // This needs to include all possible module reference object
|
|
53
53
|
// types supported by any Flight configuration anywhere since
|
|
54
54
|
// we don't know which Flight build this will end up being used
|
|
55
55
|
// with.
|
|
56
|
-
i.$$typeof ===
|
|
56
|
+
i.$$typeof === ce || i.getModuleId !== void 0));
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
var
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
62
|
-
var
|
|
63
|
-
return
|
|
58
|
+
function V(i, p, k) {
|
|
59
|
+
var _ = i.displayName;
|
|
60
|
+
if (_)
|
|
61
|
+
return _;
|
|
62
|
+
var ee = p.displayName || p.name || "";
|
|
63
|
+
return ee !== "" ? k + "(" + ee + ")" : k;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function re(i) {
|
|
66
66
|
return i.displayName || "Context";
|
|
67
67
|
}
|
|
68
68
|
function we(i) {
|
|
@@ -77,7 +77,7 @@ function Zr() {
|
|
|
77
77
|
return "Fragment";
|
|
78
78
|
case r:
|
|
79
79
|
return "Portal";
|
|
80
|
-
case
|
|
80
|
+
case u:
|
|
81
81
|
return "Profiler";
|
|
82
82
|
case a:
|
|
83
83
|
return "StrictMode";
|
|
@@ -88,21 +88,21 @@ function Zr() {
|
|
|
88
88
|
}
|
|
89
89
|
if (typeof i == "object")
|
|
90
90
|
switch (i.$$typeof) {
|
|
91
|
-
case
|
|
91
|
+
case m:
|
|
92
92
|
var p = i;
|
|
93
|
-
return
|
|
93
|
+
return re(p) + ".Consumer";
|
|
94
94
|
case c:
|
|
95
95
|
var k = i;
|
|
96
|
-
return
|
|
96
|
+
return re(k._context) + ".Provider";
|
|
97
97
|
case s:
|
|
98
|
-
return
|
|
98
|
+
return V(i, i.render, "ForwardRef");
|
|
99
99
|
case h:
|
|
100
|
-
var
|
|
101
|
-
return
|
|
100
|
+
var _ = i.displayName || null;
|
|
101
|
+
return _ !== null ? _ : we(i.type) || "Memo";
|
|
102
102
|
case C: {
|
|
103
|
-
var
|
|
103
|
+
var ee = i, se = ee._payload, G = ee._init;
|
|
104
104
|
try {
|
|
105
|
-
return we(
|
|
105
|
+
return we(G(se));
|
|
106
106
|
} catch {
|
|
107
107
|
return null;
|
|
108
108
|
}
|
|
@@ -110,18 +110,18 @@ function Zr() {
|
|
|
110
110
|
}
|
|
111
111
|
return null;
|
|
112
112
|
}
|
|
113
|
-
var
|
|
114
|
-
function
|
|
113
|
+
var q = Object.assign, ye = 0, $e, oe, Ne, X, ne, ve, Fe;
|
|
114
|
+
function ae() {
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
ae.__reactDisabledLog = !0;
|
|
117
117
|
function st() {
|
|
118
118
|
{
|
|
119
|
-
if (
|
|
120
|
-
|
|
119
|
+
if (ye === 0) {
|
|
120
|
+
$e = console.log, oe = console.info, Ne = console.warn, X = console.error, ne = console.group, ve = console.groupCollapsed, Fe = console.groupEnd;
|
|
121
121
|
var i = {
|
|
122
122
|
configurable: !0,
|
|
123
123
|
enumerable: !0,
|
|
124
|
-
value:
|
|
124
|
+
value: ae,
|
|
125
125
|
writable: !0
|
|
126
126
|
};
|
|
127
127
|
Object.defineProperties(console, {
|
|
@@ -134,229 +134,229 @@ function Zr() {
|
|
|
134
134
|
groupEnd: i
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
ye++;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function Je() {
|
|
141
141
|
{
|
|
142
|
-
if (
|
|
142
|
+
if (ye--, ye === 0) {
|
|
143
143
|
var i = {
|
|
144
144
|
configurable: !0,
|
|
145
145
|
enumerable: !0,
|
|
146
146
|
writable: !0
|
|
147
147
|
};
|
|
148
148
|
Object.defineProperties(console, {
|
|
149
|
-
log:
|
|
150
|
-
value:
|
|
149
|
+
log: q({}, i, {
|
|
150
|
+
value: $e
|
|
151
151
|
}),
|
|
152
|
-
info:
|
|
153
|
-
value:
|
|
152
|
+
info: q({}, i, {
|
|
153
|
+
value: oe
|
|
154
154
|
}),
|
|
155
|
-
warn:
|
|
156
|
-
value:
|
|
155
|
+
warn: q({}, i, {
|
|
156
|
+
value: Ne
|
|
157
157
|
}),
|
|
158
|
-
error:
|
|
159
|
-
value:
|
|
158
|
+
error: q({}, i, {
|
|
159
|
+
value: X
|
|
160
160
|
}),
|
|
161
|
-
group:
|
|
161
|
+
group: q({}, i, {
|
|
162
162
|
value: ne
|
|
163
163
|
}),
|
|
164
|
-
groupCollapsed:
|
|
165
|
-
value:
|
|
164
|
+
groupCollapsed: q({}, i, {
|
|
165
|
+
value: ve
|
|
166
166
|
}),
|
|
167
|
-
groupEnd:
|
|
168
|
-
value:
|
|
167
|
+
groupEnd: q({}, i, {
|
|
168
|
+
value: Fe
|
|
169
169
|
})
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
ye < 0 && M("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
var
|
|
176
|
-
function
|
|
175
|
+
var We = L.ReactCurrentDispatcher, y;
|
|
176
|
+
function De(i, p, k) {
|
|
177
177
|
{
|
|
178
|
-
if (
|
|
178
|
+
if (y === void 0)
|
|
179
179
|
try {
|
|
180
180
|
throw Error();
|
|
181
|
-
} catch (
|
|
182
|
-
var
|
|
183
|
-
|
|
181
|
+
} catch (ee) {
|
|
182
|
+
var _ = ee.stack.trim().match(/\n( *(at )?)/);
|
|
183
|
+
y = _ && _[1] || "";
|
|
184
184
|
}
|
|
185
185
|
return `
|
|
186
|
-
` +
|
|
186
|
+
` + y + i;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
var be = !1,
|
|
189
|
+
var be = !1, _e;
|
|
190
190
|
{
|
|
191
|
-
var
|
|
192
|
-
|
|
191
|
+
var He = typeof WeakMap == "function" ? WeakMap : Map;
|
|
192
|
+
_e = new He();
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function ut(i, p) {
|
|
195
195
|
if (!i || be)
|
|
196
196
|
return "";
|
|
197
197
|
{
|
|
198
|
-
var k =
|
|
198
|
+
var k = _e.get(i);
|
|
199
199
|
if (k !== void 0)
|
|
200
200
|
return k;
|
|
201
201
|
}
|
|
202
|
-
var
|
|
202
|
+
var _;
|
|
203
203
|
be = !0;
|
|
204
|
-
var
|
|
204
|
+
var ee = Error.prepareStackTrace;
|
|
205
205
|
Error.prepareStackTrace = void 0;
|
|
206
|
-
var
|
|
207
|
-
|
|
206
|
+
var se;
|
|
207
|
+
se = We.current, We.current = null, st();
|
|
208
208
|
try {
|
|
209
209
|
if (p) {
|
|
210
|
-
var
|
|
210
|
+
var G = function() {
|
|
211
211
|
throw Error();
|
|
212
212
|
};
|
|
213
|
-
if (Object.defineProperty(
|
|
213
|
+
if (Object.defineProperty(G.prototype, "props", {
|
|
214
214
|
set: function() {
|
|
215
215
|
throw Error();
|
|
216
216
|
}
|
|
217
217
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
218
218
|
try {
|
|
219
|
-
Reflect.construct(
|
|
220
|
-
} catch (
|
|
221
|
-
|
|
219
|
+
Reflect.construct(G, []);
|
|
220
|
+
} catch (Qe) {
|
|
221
|
+
_ = Qe;
|
|
222
222
|
}
|
|
223
|
-
Reflect.construct(i, [],
|
|
223
|
+
Reflect.construct(i, [], G);
|
|
224
224
|
} else {
|
|
225
225
|
try {
|
|
226
|
-
|
|
227
|
-
} catch (
|
|
228
|
-
|
|
226
|
+
G.call();
|
|
227
|
+
} catch (Qe) {
|
|
228
|
+
_ = Qe;
|
|
229
229
|
}
|
|
230
|
-
i.call(
|
|
230
|
+
i.call(G.prototype);
|
|
231
231
|
}
|
|
232
232
|
} else {
|
|
233
233
|
try {
|
|
234
234
|
throw Error();
|
|
235
|
-
} catch (
|
|
236
|
-
|
|
235
|
+
} catch (Qe) {
|
|
236
|
+
_ = Qe;
|
|
237
237
|
}
|
|
238
238
|
i();
|
|
239
239
|
}
|
|
240
|
-
} catch (
|
|
241
|
-
if (
|
|
242
|
-
for (var
|
|
243
|
-
`),
|
|
244
|
-
`),
|
|
245
|
-
|
|
246
|
-
for (;
|
|
247
|
-
if (
|
|
248
|
-
if (
|
|
240
|
+
} catch (Qe) {
|
|
241
|
+
if (Qe && _ && typeof Qe.stack == "string") {
|
|
242
|
+
for (var K = Qe.stack.split(`
|
|
243
|
+
`), Ae = _.stack.split(`
|
|
244
|
+
`), ke = K.length - 1, Ce = Ae.length - 1; ke >= 1 && Ce >= 0 && K[ke] !== Ae[Ce]; )
|
|
245
|
+
Ce--;
|
|
246
|
+
for (; ke >= 1 && Ce >= 0; ke--, Ce--)
|
|
247
|
+
if (K[ke] !== Ae[Ce]) {
|
|
248
|
+
if (ke !== 1 || Ce !== 1)
|
|
249
249
|
do
|
|
250
|
-
if (
|
|
251
|
-
var
|
|
252
|
-
` +
|
|
253
|
-
return i.displayName &&
|
|
250
|
+
if (ke--, Ce--, Ce < 0 || K[ke] !== Ae[Ce]) {
|
|
251
|
+
var Ye = `
|
|
252
|
+
` + K[ke].replace(" at new ", " at ");
|
|
253
|
+
return i.displayName && Ye.includes("<anonymous>") && (Ye = Ye.replace("<anonymous>", i.displayName)), typeof i == "function" && _e.set(i, Ye), Ye;
|
|
254
254
|
}
|
|
255
|
-
while (
|
|
255
|
+
while (ke >= 1 && Ce >= 0);
|
|
256
256
|
break;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
} finally {
|
|
260
|
-
be = !1,
|
|
260
|
+
be = !1, We.current = se, Je(), Error.prepareStackTrace = ee;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
return typeof i == "function" &&
|
|
262
|
+
var ot = i ? i.displayName || i.name : "", tt = ot ? De(ot) : "";
|
|
263
|
+
return typeof i == "function" && _e.set(i, tt), tt;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
return
|
|
265
|
+
function xe(i, p, k) {
|
|
266
|
+
return ut(i, !1);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function vt(i) {
|
|
269
269
|
var p = i.prototype;
|
|
270
270
|
return !!(p && p.isReactComponent);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function fe(i, p, k) {
|
|
273
273
|
if (i == null)
|
|
274
274
|
return "";
|
|
275
275
|
if (typeof i == "function")
|
|
276
|
-
return
|
|
276
|
+
return ut(i, vt(i));
|
|
277
277
|
if (typeof i == "string")
|
|
278
|
-
return
|
|
278
|
+
return De(i);
|
|
279
279
|
switch (i) {
|
|
280
280
|
case g:
|
|
281
|
-
return
|
|
281
|
+
return De("Suspense");
|
|
282
282
|
case f:
|
|
283
|
-
return
|
|
283
|
+
return De("SuspenseList");
|
|
284
284
|
}
|
|
285
285
|
if (typeof i == "object")
|
|
286
286
|
switch (i.$$typeof) {
|
|
287
287
|
case s:
|
|
288
|
-
return
|
|
288
|
+
return xe(i.render);
|
|
289
289
|
case h:
|
|
290
|
-
return
|
|
290
|
+
return fe(i.type, p, k);
|
|
291
291
|
case C: {
|
|
292
|
-
var
|
|
292
|
+
var _ = i, ee = _._payload, se = _._init;
|
|
293
293
|
try {
|
|
294
|
-
return
|
|
294
|
+
return fe(se(ee), p, k);
|
|
295
295
|
} catch {
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
return "";
|
|
300
300
|
}
|
|
301
|
-
var
|
|
302
|
-
function
|
|
301
|
+
var Xe = Object.prototype.hasOwnProperty, Le = {}, Ie = L.ReactDebugCurrentFrame;
|
|
302
|
+
function U(i) {
|
|
303
303
|
if (i) {
|
|
304
|
-
var p = i._owner, k =
|
|
305
|
-
|
|
304
|
+
var p = i._owner, k = fe(i.type, i._source, p ? p.type : null);
|
|
305
|
+
Ie.setExtraStackFrame(k);
|
|
306
306
|
} else
|
|
307
|
-
|
|
307
|
+
Ie.setExtraStackFrame(null);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Ue(i, p, k, _, ee) {
|
|
310
310
|
{
|
|
311
|
-
var
|
|
312
|
-
for (var
|
|
313
|
-
if (
|
|
314
|
-
var
|
|
311
|
+
var se = Function.call.bind(Xe);
|
|
312
|
+
for (var G in i)
|
|
313
|
+
if (se(i, G)) {
|
|
314
|
+
var K = void 0;
|
|
315
315
|
try {
|
|
316
|
-
if (typeof i[
|
|
317
|
-
var
|
|
318
|
-
throw
|
|
316
|
+
if (typeof i[G] != "function") {
|
|
317
|
+
var Ae = Error((_ || "React class") + ": " + k + " type `" + G + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[G] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
318
|
+
throw Ae.name = "Invariant Violation", Ae;
|
|
319
319
|
}
|
|
320
|
-
|
|
321
|
-
} catch (
|
|
322
|
-
|
|
320
|
+
K = i[G](p, G, _, k, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
321
|
+
} catch (ke) {
|
|
322
|
+
K = ke;
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
K && !(K instanceof Error) && (U(ee), M("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", k, G, typeof K), U(null)), K instanceof Error && !(K.message in Le) && (Le[K.message] = !0, U(ee), M("Failed %s type: %s", k, K.message), U(null));
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
var
|
|
329
|
-
function
|
|
330
|
-
return
|
|
328
|
+
var bt = Array.isArray;
|
|
329
|
+
function Ge(i) {
|
|
330
|
+
return bt(i);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function et(i) {
|
|
333
333
|
{
|
|
334
334
|
var p = typeof Symbol == "function" && Symbol.toStringTag, k = p && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
335
335
|
return k;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Me(i) {
|
|
339
339
|
try {
|
|
340
|
-
return
|
|
340
|
+
return ze(i), !1;
|
|
341
341
|
} catch {
|
|
342
342
|
return !0;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function ze(i) {
|
|
346
346
|
return "" + i;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
if (
|
|
350
|
-
return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
348
|
+
function dt(i) {
|
|
349
|
+
if (Me(i))
|
|
350
|
+
return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(i)), ze(i);
|
|
351
351
|
}
|
|
352
|
-
var
|
|
352
|
+
var ct = L.ReactCurrentOwner, Ke = {
|
|
353
353
|
key: !0,
|
|
354
354
|
ref: !0,
|
|
355
355
|
__self: !0,
|
|
356
356
|
__source: !0
|
|
357
|
-
},
|
|
358
|
-
function
|
|
359
|
-
if (
|
|
357
|
+
}, mt, le;
|
|
358
|
+
function rt(i) {
|
|
359
|
+
if (Xe.call(i, "ref")) {
|
|
360
360
|
var p = Object.getOwnPropertyDescriptor(i, "ref").get;
|
|
361
361
|
if (p && p.isReactWarning)
|
|
362
362
|
return !1;
|
|
@@ -364,7 +364,7 @@ function Zr() {
|
|
|
364
364
|
return i.ref !== void 0;
|
|
365
365
|
}
|
|
366
366
|
function b(i) {
|
|
367
|
-
if (
|
|
367
|
+
if (Xe.call(i, "key")) {
|
|
368
368
|
var p = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
369
369
|
if (p && p.isReactWarning)
|
|
370
370
|
return !1;
|
|
@@ -372,12 +372,12 @@ function Zr() {
|
|
|
372
372
|
return i.key !== void 0;
|
|
373
373
|
}
|
|
374
374
|
function j(i, p) {
|
|
375
|
-
typeof i.ref == "string" &&
|
|
375
|
+
typeof i.ref == "string" && ct.current;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function N(i, p) {
|
|
378
378
|
{
|
|
379
379
|
var k = function() {
|
|
380
|
-
|
|
380
|
+
mt || (mt = !0, M("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
381
381
|
};
|
|
382
382
|
k.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
383
383
|
get: k,
|
|
@@ -385,10 +385,10 @@ function Zr() {
|
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function z(i, p) {
|
|
389
389
|
{
|
|
390
390
|
var k = function() {
|
|
391
|
-
|
|
391
|
+
le || (le = !0, M("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
392
392
|
};
|
|
393
393
|
k.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
394
394
|
get: k,
|
|
@@ -396,70 +396,70 @@ function Zr() {
|
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
var
|
|
400
|
-
var
|
|
399
|
+
var Z = function(i, p, k, _, ee, se, G) {
|
|
400
|
+
var K = {
|
|
401
401
|
// This tag allows us to uniquely identify this as a React Element
|
|
402
402
|
$$typeof: e,
|
|
403
403
|
// Built-in properties that belong on the element
|
|
404
404
|
type: i,
|
|
405
405
|
key: p,
|
|
406
406
|
ref: k,
|
|
407
|
-
props:
|
|
407
|
+
props: G,
|
|
408
408
|
// Record the component responsible for creating this element.
|
|
409
|
-
_owner:
|
|
409
|
+
_owner: se
|
|
410
410
|
};
|
|
411
|
-
return
|
|
411
|
+
return K._store = {}, Object.defineProperty(K._store, "validated", {
|
|
412
412
|
configurable: !1,
|
|
413
413
|
enumerable: !1,
|
|
414
414
|
writable: !0,
|
|
415
415
|
value: !1
|
|
416
|
-
}), Object.defineProperty(
|
|
416
|
+
}), Object.defineProperty(K, "_self", {
|
|
417
417
|
configurable: !1,
|
|
418
418
|
enumerable: !1,
|
|
419
419
|
writable: !1,
|
|
420
|
-
value:
|
|
421
|
-
}), Object.defineProperty(
|
|
420
|
+
value: _
|
|
421
|
+
}), Object.defineProperty(K, "_source", {
|
|
422
422
|
configurable: !1,
|
|
423
423
|
enumerable: !1,
|
|
424
424
|
writable: !1,
|
|
425
|
-
value:
|
|
426
|
-
}), Object.freeze && (Object.freeze(
|
|
425
|
+
value: ee
|
|
426
|
+
}), Object.freeze && (Object.freeze(K.props), Object.freeze(K)), K;
|
|
427
427
|
};
|
|
428
|
-
function
|
|
428
|
+
function Q(i, p, k, _, ee) {
|
|
429
429
|
{
|
|
430
|
-
var
|
|
431
|
-
k !== void 0 && (
|
|
432
|
-
for (
|
|
433
|
-
|
|
430
|
+
var se, G = {}, K = null, Ae = null;
|
|
431
|
+
k !== void 0 && (dt(k), K = "" + k), b(p) && (dt(p.key), K = "" + p.key), rt(p) && (Ae = p.ref, j(p, ee));
|
|
432
|
+
for (se in p)
|
|
433
|
+
Xe.call(p, se) && !Ke.hasOwnProperty(se) && (G[se] = p[se]);
|
|
434
434
|
if (i && i.defaultProps) {
|
|
435
|
-
var
|
|
436
|
-
for (
|
|
437
|
-
|
|
435
|
+
var ke = i.defaultProps;
|
|
436
|
+
for (se in ke)
|
|
437
|
+
G[se] === void 0 && (G[se] = ke[se]);
|
|
438
438
|
}
|
|
439
|
-
if (
|
|
440
|
-
var
|
|
441
|
-
|
|
439
|
+
if (K || Ae) {
|
|
440
|
+
var Ce = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
441
|
+
K && N(G, Ce), Ae && z(G, Ce);
|
|
442
442
|
}
|
|
443
|
-
return
|
|
443
|
+
return Z(i, K, Ae, ee, _, ct.current, G);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
var
|
|
447
|
-
function
|
|
446
|
+
var je = L.ReactCurrentOwner, Be = L.ReactDebugCurrentFrame;
|
|
447
|
+
function Te(i) {
|
|
448
448
|
if (i) {
|
|
449
|
-
var p = i._owner, k =
|
|
450
|
-
|
|
449
|
+
var p = i._owner, k = fe(i.type, i._source, p ? p.type : null);
|
|
450
|
+
Be.setExtraStackFrame(k);
|
|
451
451
|
} else
|
|
452
|
-
|
|
452
|
+
Be.setExtraStackFrame(null);
|
|
453
453
|
}
|
|
454
|
-
var
|
|
455
|
-
|
|
456
|
-
function
|
|
454
|
+
var he;
|
|
455
|
+
he = !1;
|
|
456
|
+
function J(i) {
|
|
457
457
|
return typeof i == "object" && i !== null && i.$$typeof === e;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function Ze() {
|
|
460
460
|
{
|
|
461
|
-
if (
|
|
462
|
-
var i = we(
|
|
461
|
+
if (je.current) {
|
|
462
|
+
var i = we(je.current.type);
|
|
463
463
|
if (i)
|
|
464
464
|
return `
|
|
465
465
|
|
|
@@ -468,13 +468,13 @@ Check the render method of \`` + i + "`.";
|
|
|
468
468
|
return "";
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function ft(i) {
|
|
472
472
|
return "";
|
|
473
473
|
}
|
|
474
|
-
var
|
|
475
|
-
function
|
|
474
|
+
var nt = {};
|
|
475
|
+
function d(i) {
|
|
476
476
|
{
|
|
477
|
-
var p =
|
|
477
|
+
var p = Ze();
|
|
478
478
|
if (!p) {
|
|
479
479
|
var k = typeof i == "string" ? i : i.displayName || i.name;
|
|
480
480
|
k && (p = `
|
|
@@ -484,39 +484,39 @@ Check the top-level render call using <` + k + ">.");
|
|
|
484
484
|
return p;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function E(i, p) {
|
|
488
488
|
{
|
|
489
489
|
if (!i._store || i._store.validated || i.key != null)
|
|
490
490
|
return;
|
|
491
491
|
i._store.validated = !0;
|
|
492
|
-
var k =
|
|
493
|
-
if (
|
|
492
|
+
var k = d(p);
|
|
493
|
+
if (nt[k])
|
|
494
494
|
return;
|
|
495
|
-
|
|
496
|
-
var
|
|
497
|
-
i && i._owner && i._owner !==
|
|
495
|
+
nt[k] = !0;
|
|
496
|
+
var _ = "";
|
|
497
|
+
i && i._owner && i._owner !== je.current && (_ = " It was passed a child from " + we(i._owner.type) + "."), Te(i), M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', k, _), Te(null);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function B(i, p) {
|
|
501
501
|
{
|
|
502
502
|
if (typeof i != "object")
|
|
503
503
|
return;
|
|
504
|
-
if (
|
|
504
|
+
if (Ge(i))
|
|
505
505
|
for (var k = 0; k < i.length; k++) {
|
|
506
|
-
var
|
|
507
|
-
|
|
506
|
+
var _ = i[k];
|
|
507
|
+
J(_) && E(_, p);
|
|
508
508
|
}
|
|
509
|
-
else if (
|
|
509
|
+
else if (J(i))
|
|
510
510
|
i._store && (i._store.validated = !0);
|
|
511
511
|
else if (i) {
|
|
512
|
-
var
|
|
513
|
-
if (typeof
|
|
514
|
-
for (var
|
|
515
|
-
|
|
512
|
+
var ee = O(i);
|
|
513
|
+
if (typeof ee == "function" && ee !== i.entries)
|
|
514
|
+
for (var se = ee.call(i), G; !(G = se.next()).done; )
|
|
515
|
+
J(G.value) && E(G.value, p);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function l(i) {
|
|
520
520
|
{
|
|
521
521
|
var p = i.type;
|
|
522
522
|
if (p == null || typeof p == "string")
|
|
@@ -531,12 +531,12 @@ Check the top-level render call using <` + k + ">.");
|
|
|
531
531
|
else
|
|
532
532
|
return;
|
|
533
533
|
if (k) {
|
|
534
|
-
var
|
|
535
|
-
|
|
536
|
-
} else if (p.PropTypes !== void 0 && !
|
|
537
|
-
|
|
538
|
-
var
|
|
539
|
-
M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
534
|
+
var _ = we(p);
|
|
535
|
+
Ue(k, i.props, "prop", _, i);
|
|
536
|
+
} else if (p.PropTypes !== void 0 && !he) {
|
|
537
|
+
he = !0;
|
|
538
|
+
var ee = we(p);
|
|
539
|
+
M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ee || "Unknown");
|
|
540
540
|
}
|
|
541
541
|
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
542
542
|
}
|
|
@@ -544,68 +544,68 @@ Check the top-level render call using <` + k + ">.");
|
|
|
544
544
|
function v(i) {
|
|
545
545
|
{
|
|
546
546
|
for (var p = Object.keys(i.props), k = 0; k < p.length; k++) {
|
|
547
|
-
var
|
|
548
|
-
if (
|
|
549
|
-
|
|
547
|
+
var _ = p[k];
|
|
548
|
+
if (_ !== "children" && _ !== "key") {
|
|
549
|
+
Te(i), M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), Te(null);
|
|
550
550
|
break;
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
i.ref !== null && (
|
|
553
|
+
i.ref !== null && (Te(i), M("Invalid attribute `ref` supplied to `React.Fragment`."), Te(null));
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
var
|
|
557
|
-
function
|
|
556
|
+
var F = {};
|
|
557
|
+
function A(i, p, k, _, ee, se) {
|
|
558
558
|
{
|
|
559
|
-
var
|
|
560
|
-
if (!
|
|
561
|
-
var
|
|
562
|
-
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (
|
|
563
|
-
var
|
|
564
|
-
|
|
565
|
-
var
|
|
566
|
-
i === null ?
|
|
559
|
+
var G = Se(i);
|
|
560
|
+
if (!G) {
|
|
561
|
+
var K = "";
|
|
562
|
+
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (K += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
563
|
+
var Ae = ft();
|
|
564
|
+
Ae ? K += Ae : K += Ze();
|
|
565
|
+
var ke;
|
|
566
|
+
i === null ? ke = "null" : Ge(i) ? ke = "array" : i !== void 0 && i.$$typeof === e ? (ke = "<" + (we(i.type) || "Unknown") + " />", K = " Did you accidentally export a JSX literal instead of a component?") : ke = typeof i, M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ke, K);
|
|
567
567
|
}
|
|
568
|
-
var
|
|
569
|
-
if (
|
|
570
|
-
return
|
|
571
|
-
if (
|
|
572
|
-
var
|
|
573
|
-
if (
|
|
574
|
-
if (
|
|
575
|
-
if (
|
|
576
|
-
for (var
|
|
577
|
-
|
|
578
|
-
Object.freeze && Object.freeze(
|
|
568
|
+
var Ce = Q(i, p, k, ee, se);
|
|
569
|
+
if (Ce == null)
|
|
570
|
+
return Ce;
|
|
571
|
+
if (G) {
|
|
572
|
+
var Ye = p.children;
|
|
573
|
+
if (Ye !== void 0)
|
|
574
|
+
if (_)
|
|
575
|
+
if (Ge(Ye)) {
|
|
576
|
+
for (var ot = 0; ot < Ye.length; ot++)
|
|
577
|
+
B(Ye[ot], i);
|
|
578
|
+
Object.freeze && Object.freeze(Ye);
|
|
579
579
|
} else
|
|
580
580
|
M("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
581
581
|
else
|
|
582
|
-
|
|
582
|
+
B(Ye, i);
|
|
583
583
|
}
|
|
584
|
-
if (
|
|
585
|
-
var
|
|
584
|
+
if (Xe.call(p, "key")) {
|
|
585
|
+
var tt = we(i), Qe = Object.keys(p).filter(function(Xr) {
|
|
586
586
|
return Xr !== "key";
|
|
587
|
-
}), Yt =
|
|
588
|
-
if (!
|
|
589
|
-
var Vr =
|
|
587
|
+
}), Yt = Qe.length > 0 ? "{key: someKey, " + Qe.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
588
|
+
if (!F[tt + Yt]) {
|
|
589
|
+
var Vr = Qe.length > 0 ? "{" + Qe.join(": ..., ") + ": ...}" : "{}";
|
|
590
590
|
M(`A props object containing a "key" prop is being spread into JSX:
|
|
591
591
|
let props = %s;
|
|
592
592
|
<%s {...props} />
|
|
593
593
|
React keys must be passed directly to JSX without using spread:
|
|
594
594
|
let props = %s;
|
|
595
|
-
<%s key={someKey} {...props} />`, Yt,
|
|
595
|
+
<%s key={someKey} {...props} />`, Yt, tt, Vr, tt), F[tt + Yt] = !0;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
return i === o ? v(
|
|
598
|
+
return i === o ? v(Ce) : l(Ce), Ce;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
function
|
|
602
|
-
return
|
|
601
|
+
function T(i, p, k) {
|
|
602
|
+
return A(i, p, k, !0);
|
|
603
603
|
}
|
|
604
|
-
function
|
|
605
|
-
return
|
|
604
|
+
function Y(i, p, k) {
|
|
605
|
+
return A(i, p, k, !1);
|
|
606
606
|
}
|
|
607
|
-
var
|
|
608
|
-
St.Fragment = o, St.jsx =
|
|
607
|
+
var me = Y, ge = T;
|
|
608
|
+
St.Fragment = o, St.jsx = me, St.jsxs = ge;
|
|
609
609
|
})()), St;
|
|
610
610
|
}
|
|
611
611
|
var fr;
|
|
@@ -640,34 +640,34 @@ function ar(t) {
|
|
|
640
640
|
return e[a] = o != null ? o : !0, e;
|
|
641
641
|
}, {});
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function qe(t, e, r, o) {
|
|
644
644
|
if (!Array.isArray(t) || t.length === 0)
|
|
645
645
|
return null;
|
|
646
646
|
const a = [];
|
|
647
|
-
for (let
|
|
648
|
-
const c = t[
|
|
647
|
+
for (let u = 0; u < t.length; u++) {
|
|
648
|
+
const c = t[u];
|
|
649
649
|
if (c) {
|
|
650
650
|
if (c.type === "label_open") {
|
|
651
|
-
const
|
|
652
|
-
for (
|
|
653
|
-
const g = t[
|
|
651
|
+
const m = [];
|
|
652
|
+
for (u++; u < t.length; ) {
|
|
653
|
+
const g = t[u];
|
|
654
654
|
if ((g == null ? void 0 : g.type) === "label_close")
|
|
655
655
|
break;
|
|
656
|
-
g &&
|
|
656
|
+
g && m.push(g), u++;
|
|
657
657
|
}
|
|
658
|
-
const s = `${r}-label-${
|
|
658
|
+
const s = `${r}-label-${u}`;
|
|
659
659
|
a.push(
|
|
660
|
-
/* @__PURE__ */ n.jsx("label", { ...ar(c.attrs), children:
|
|
660
|
+
/* @__PURE__ */ n.jsx("label", { ...ar(c.attrs), children: qe(m, e, `${s}-child`, o) }, s)
|
|
661
661
|
);
|
|
662
662
|
continue;
|
|
663
663
|
}
|
|
664
|
-
c.type !== "label_close" && a.push(o(c, `${r}-${
|
|
664
|
+
c.type !== "label_close" && a.push(o(c, `${r}-${u}`, e));
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
667
|
return a;
|
|
668
668
|
}
|
|
669
669
|
function Ht(t, e, r, o) {
|
|
670
|
-
return /* @__PURE__ */ n.jsx(n.Fragment, { children:
|
|
670
|
+
return /* @__PURE__ */ n.jsx(n.Fragment, { children: qe(t, e, `${r}-inline`, o) });
|
|
671
671
|
}
|
|
672
672
|
const hr = {
|
|
673
673
|
note: "ℹ️",
|
|
@@ -679,14 +679,14 @@ const hr = {
|
|
|
679
679
|
caution: "⚠️"
|
|
680
680
|
};
|
|
681
681
|
function tn(t) {
|
|
682
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a, isDark:
|
|
682
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a, isDark: u } = t, c = String(e.kind || "note"), m = H(() => e.title && String(e.title).trim().length ? String(e.title) : c.charAt(0).toUpperCase() + c.slice(1), [c, e.title]), [s, g] = P(() => {
|
|
683
683
|
var h;
|
|
684
684
|
return e.collapsible ? !((h = e.open) == null || h) : !1;
|
|
685
|
-
}), f =
|
|
686
|
-
return /* @__PURE__ */ n.jsxs("div", { className: `admonition admonition-${c}${
|
|
685
|
+
}), f = H(() => `admonition-${Math.random().toString(36).slice(2, 9)}`, []);
|
|
686
|
+
return /* @__PURE__ */ n.jsxs("div", { className: `admonition admonition-${c}${u ? " is-dark" : ""}`, "data-index-key": a, children: [
|
|
687
687
|
/* @__PURE__ */ n.jsxs("div", { id: f, className: "admonition-header", children: [
|
|
688
688
|
hr[c] && /* @__PURE__ */ n.jsx("span", { className: "admonition-icon", children: hr[c] }),
|
|
689
|
-
/* @__PURE__ */ n.jsx("span", { className: "admonition-title", children:
|
|
689
|
+
/* @__PURE__ */ n.jsx("span", { className: "admonition-title", children: m }),
|
|
690
690
|
e.collapsible && /* @__PURE__ */ n.jsx(
|
|
691
691
|
"button",
|
|
692
692
|
{
|
|
@@ -700,16 +700,16 @@ function tn(t) {
|
|
|
700
700
|
}
|
|
701
701
|
)
|
|
702
702
|
] }),
|
|
703
|
-
!s && /* @__PURE__ */ n.jsx("div", { id: `${f}-content`, className: "admonition-content", "aria-labelledby": f, children: r && o ?
|
|
703
|
+
!s && /* @__PURE__ */ n.jsx("div", { id: `${f}-content`, className: "admonition-content", "aria-labelledby": f, children: r && o ? qe(e.children, r, String(a != null ? a : f), o) : null })
|
|
704
704
|
] });
|
|
705
705
|
}
|
|
706
706
|
const Nr = Ur(null);
|
|
707
707
|
function _r(t, e) {
|
|
708
|
-
const r = typeof window != "undefined" && typeof document != "undefined", o = /* @__PURE__ */ new Map(), a = (c,
|
|
709
|
-
var
|
|
708
|
+
const r = typeof window != "undefined" && typeof document != "undefined", o = /* @__PURE__ */ new Map(), a = (c, m) => {
|
|
709
|
+
var x, S;
|
|
710
710
|
if (!r || typeof IntersectionObserver == "undefined")
|
|
711
711
|
return null;
|
|
712
|
-
const s = (
|
|
712
|
+
const s = (x = t()) != null ? x : null, g = `${c}::${m}`, f = o.get(g);
|
|
713
713
|
if (f && f.root === s)
|
|
714
714
|
return f;
|
|
715
715
|
if (f) {
|
|
@@ -719,8 +719,8 @@ function _r(t, e) {
|
|
|
719
719
|
}
|
|
720
720
|
o.delete(g);
|
|
721
721
|
}
|
|
722
|
-
const h = (
|
|
723
|
-
for (const L of
|
|
722
|
+
const h = (S = f == null ? void 0 : f.targets) != null ? S : /* @__PURE__ */ new Map(), C = new IntersectionObserver((O) => {
|
|
723
|
+
for (const L of O) {
|
|
724
724
|
const M = h.get(L.target);
|
|
725
725
|
if (!(!M || !(L.isIntersecting || L.intersectionRatio > 0))) {
|
|
726
726
|
M.state.current = !0;
|
|
@@ -738,15 +738,15 @@ function _r(t, e) {
|
|
|
738
738
|
}, {
|
|
739
739
|
root: s,
|
|
740
740
|
rootMargin: c,
|
|
741
|
-
threshold:
|
|
742
|
-
}), w = { observer: C, root: s, rootMargin: c, threshold:
|
|
741
|
+
threshold: m
|
|
742
|
+
}), w = { observer: C, root: s, rootMargin: c, threshold: m, targets: h };
|
|
743
743
|
o.set(g, w);
|
|
744
|
-
for (const
|
|
745
|
-
C.observe(
|
|
744
|
+
for (const O of h.keys())
|
|
745
|
+
C.observe(O);
|
|
746
746
|
return w;
|
|
747
747
|
};
|
|
748
|
-
return (c,
|
|
749
|
-
var
|
|
748
|
+
return (c, m) => {
|
|
749
|
+
var O, L;
|
|
750
750
|
const s = { current: !1 };
|
|
751
751
|
let g = !1, f;
|
|
752
752
|
const h = new Promise((M) => {
|
|
@@ -769,8 +769,8 @@ function _r(t, e) {
|
|
|
769
769
|
whenVisible: h,
|
|
770
770
|
destroy: C
|
|
771
771
|
};
|
|
772
|
-
const w = (
|
|
773
|
-
return
|
|
772
|
+
const w = (O = m == null ? void 0 : m.rootMargin) != null ? O : "300px", x = (L = m == null ? void 0 : m.threshold) != null ? L : 0, S = a(w, x);
|
|
773
|
+
return S ? (S.targets.set(c, { resolve: f, state: s }), S.observer.observe(c), {
|
|
774
774
|
isVisible: () => s.current,
|
|
775
775
|
whenVisible: h,
|
|
776
776
|
destroy: C
|
|
@@ -783,15 +783,15 @@ function _r(t, e) {
|
|
|
783
783
|
}
|
|
784
784
|
const rn = _r(() => null, () => !0);
|
|
785
785
|
function nn({ getRoot: t, enabled: e = !0, children: r }) {
|
|
786
|
-
const o =
|
|
786
|
+
const o = R(e);
|
|
787
787
|
o.current = e;
|
|
788
|
-
const a =
|
|
788
|
+
const a = R(t);
|
|
789
789
|
a.current = t;
|
|
790
|
-
const
|
|
791
|
-
var c,
|
|
792
|
-
return (
|
|
790
|
+
const u = H(() => _r(() => {
|
|
791
|
+
var c, m;
|
|
792
|
+
return (m = (c = a.current) == null ? void 0 : c.call(a)) != null ? m : null;
|
|
793
793
|
}, () => o.current), []);
|
|
794
|
-
return /* @__PURE__ */ n.jsx(Nr.Provider, { value:
|
|
794
|
+
return /* @__PURE__ */ n.jsx(Nr.Provider, { value: u, children: r });
|
|
795
795
|
}
|
|
796
796
|
function It() {
|
|
797
797
|
var t;
|
|
@@ -888,7 +888,7 @@ function lr() {
|
|
|
888
888
|
return (r = Lr[e]) != null ? r : sn(e);
|
|
889
889
|
} };
|
|
890
890
|
}
|
|
891
|
-
let pe = null, Mt = null,
|
|
891
|
+
let pe = null, Mt = null, jt = null, Ft = null, Wt = null, Bt = null;
|
|
892
892
|
function Br() {
|
|
893
893
|
Ft && (clearTimeout(Ft), Ft = null), Wt && (clearTimeout(Wt), Wt = null);
|
|
894
894
|
}
|
|
@@ -921,25 +921,25 @@ async function pr(t) {
|
|
|
921
921
|
});
|
|
922
922
|
pe.style.transform = `translate3d(${Math.round(e)}px, ${Math.round(r)}px, 0)`;
|
|
923
923
|
}
|
|
924
|
-
function Ut(t, e, r = "top", o = !1, a,
|
|
924
|
+
function Ut(t, e, r = "top", o = !1, a, u) {
|
|
925
925
|
if (!t || typeof document == "undefined" || (cn(), !pe))
|
|
926
926
|
return;
|
|
927
927
|
Br();
|
|
928
928
|
const c = async () => {
|
|
929
929
|
if (pe) {
|
|
930
|
-
Mt = t, pe.textContent = e, pe.dataset.placement = r, pe.dataset.dark = ln(
|
|
930
|
+
Mt = t, pe.textContent = e, pe.dataset.placement = r, pe.dataset.dark = ln(u) ? "true" : "false", pe.dataset.visible = "false", Bt = `tooltip-${Date.now()}-${Math.random().toString(36).slice(2)}`, pe.id = Bt;
|
|
931
931
|
try {
|
|
932
932
|
t.setAttribute("aria-describedby", Bt);
|
|
933
933
|
} catch {
|
|
934
934
|
}
|
|
935
|
-
await pr(r), pe.dataset.visible = "true",
|
|
935
|
+
await pr(r), pe.dataset.visible = "true", jt == null || jt(), jt = Mr(t, pe, () => {
|
|
936
936
|
pr(r);
|
|
937
937
|
});
|
|
938
938
|
}
|
|
939
939
|
};
|
|
940
940
|
o ? c() : Ft = setTimeout(c, 80);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function Oe(t = !1) {
|
|
943
943
|
if (!pe)
|
|
944
944
|
return;
|
|
945
945
|
Br();
|
|
@@ -950,7 +950,7 @@ function We(t = !1) {
|
|
|
950
950
|
Mt.removeAttribute("aria-describedby");
|
|
951
951
|
} catch {
|
|
952
952
|
}
|
|
953
|
-
Mt = null, Bt = null,
|
|
953
|
+
Mt = null, Bt = null, jt && (jt(), jt = null);
|
|
954
954
|
}
|
|
955
955
|
};
|
|
956
956
|
t ? e() : Wt = setTimeout(e, 120);
|
|
@@ -1089,13 +1089,13 @@ function Tn(t) {
|
|
|
1089
1089
|
const [r] = e.split(/\s+/), [o] = r.split(":");
|
|
1090
1090
|
return o.toLowerCase();
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function pt(t) {
|
|
1093
1093
|
var r;
|
|
1094
1094
|
const e = Tn(t);
|
|
1095
1095
|
return (r = En[e]) != null ? r : e;
|
|
1096
1096
|
}
|
|
1097
1097
|
function wr(t) {
|
|
1098
|
-
const e =
|
|
1098
|
+
const e = pt(t);
|
|
1099
1099
|
if (!e)
|
|
1100
1100
|
return "plaintext";
|
|
1101
1101
|
switch (e) {
|
|
@@ -1115,7 +1115,7 @@ function ur(t) {
|
|
|
1115
1115
|
if (r != null && r !== "")
|
|
1116
1116
|
return r;
|
|
1117
1117
|
}
|
|
1118
|
-
switch (
|
|
1118
|
+
switch (pt(t)) {
|
|
1119
1119
|
case "javascript":
|
|
1120
1120
|
return hn;
|
|
1121
1121
|
case "typescript":
|
|
@@ -1169,11 +1169,11 @@ const Qt = {
|
|
|
1169
1169
|
mermaid: "Mermaid"
|
|
1170
1170
|
};
|
|
1171
1171
|
function Rn(t) {
|
|
1172
|
-
const e =
|
|
1172
|
+
const e = H(() => {
|
|
1173
1173
|
const r = t.code || "", o = r.trim().toLowerCase();
|
|
1174
1174
|
if (o.startsWith("<!doctype") || o.startsWith("<html") || o.startsWith("<body"))
|
|
1175
1175
|
return r;
|
|
1176
|
-
const a = t.isDark ? "#020617" : "#ffffff",
|
|
1176
|
+
const a = t.isDark ? "#020617" : "#ffffff", u = t.isDark ? "#e5e7eb" : "#020617";
|
|
1177
1177
|
return `<!doctype html>
|
|
1178
1178
|
<html lang="en">
|
|
1179
1179
|
<head>
|
|
@@ -1185,7 +1185,7 @@ function Rn(t) {
|
|
|
1185
1185
|
padding: 0;
|
|
1186
1186
|
height: 100%;
|
|
1187
1187
|
background-color: ${a};
|
|
1188
|
-
color: ${
|
|
1188
|
+
color: ${u};
|
|
1189
1189
|
}
|
|
1190
1190
|
body {
|
|
1191
1191
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
|
|
@@ -1197,7 +1197,7 @@ function Rn(t) {
|
|
|
1197
1197
|
</body>
|
|
1198
1198
|
</html>`;
|
|
1199
1199
|
}, [t.code, t.isDark]);
|
|
1200
|
-
return
|
|
1200
|
+
return W(() => {
|
|
1201
1201
|
const r = (o) => {
|
|
1202
1202
|
var a;
|
|
1203
1203
|
(o.key === "Escape" || o.key === "Esc") && ((a = t.onClose) == null || a.call(t));
|
|
@@ -1263,7 +1263,7 @@ function Nn(t) {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
function er({ node: t }) {
|
|
1265
1265
|
var a;
|
|
1266
|
-
const e =
|
|
1266
|
+
const e = H(() => Nn(t == null ? void 0 : t.language), [t]), r = `language-${e}`, o = e ? `Code block: ${e}` : "Code block";
|
|
1267
1267
|
return /* @__PURE__ */ n.jsx(
|
|
1268
1268
|
"pre",
|
|
1269
1269
|
{
|
|
@@ -1327,325 +1327,345 @@ const _n = [
|
|
|
1327
1327
|
showFontSizeButtons: !0
|
|
1328
1328
|
};
|
|
1329
1329
|
function Bn(t) {
|
|
1330
|
-
var
|
|
1330
|
+
var nt;
|
|
1331
1331
|
const e = { ...Ln, ...t }, {
|
|
1332
1332
|
node: r,
|
|
1333
1333
|
isDark: o,
|
|
1334
1334
|
loading: a,
|
|
1335
|
-
stream:
|
|
1335
|
+
stream: u,
|
|
1336
1336
|
isShowPreview: c,
|
|
1337
|
-
enableFontSizeControl:
|
|
1337
|
+
enableFontSizeControl: m,
|
|
1338
1338
|
darkTheme: s,
|
|
1339
1339
|
lightTheme: g,
|
|
1340
1340
|
monacoOptions: f,
|
|
1341
1341
|
themes: h,
|
|
1342
1342
|
minWidth: C,
|
|
1343
1343
|
maxWidth: w,
|
|
1344
|
-
showHeader:
|
|
1345
|
-
showCopyButton:
|
|
1346
|
-
showExpandButton:
|
|
1344
|
+
showHeader: x,
|
|
1345
|
+
showCopyButton: S,
|
|
1346
|
+
showExpandButton: O,
|
|
1347
1347
|
showPreviewButton: L,
|
|
1348
1348
|
showFontSizeButtons: M
|
|
1349
|
-
} = e, I =
|
|
1350
|
-
const
|
|
1351
|
-
return Number.isFinite(
|
|
1352
|
-
}), [
|
|
1353
|
-
var
|
|
1354
|
-
const
|
|
1355
|
-
if (typeof
|
|
1356
|
-
return Math.max(80,
|
|
1357
|
-
const E = String(
|
|
1358
|
-
return Number.isFinite(
|
|
1359
|
-
}, []),
|
|
1360
|
-
var
|
|
1361
|
-
if (
|
|
1349
|
+
} = e, I = R(null), $ = R(null), te = R(null), ue = R(null), ie = R(null), de = R(null), ce = R(null), Se = R(0), V = R(null), re = R(null), we = It(), q = R(f), ye = R(h), $e = R(f), [oe, Ne] = P(!1), [X, ne] = P(() => typeof window == "undefined"), [ve, Fe] = P(!1), [ae, st] = P(!1), [Je, We] = P(!1), [y, De] = P(() => r.language || "plaintext"), [be, _e] = P(() => pt(r.language)), [He, ut] = P(!1), [xe, vt] = P(!1), [fe, Xe] = P(!1), [Le, Ie] = P(!1), { t: U } = lr(), [Ue, bt] = P(() => {
|
|
1350
|
+
const d = Number(f == null ? void 0 : f.fontSize);
|
|
1351
|
+
return Number.isFinite(d) && d > 0 ? d : 14;
|
|
1352
|
+
}), [Ge, et] = P(Ue), Me = D(() => {
|
|
1353
|
+
var l, v;
|
|
1354
|
+
const d = (v = (l = q.current) == null ? void 0 : l.MAX_HEIGHT) != null ? v : 500;
|
|
1355
|
+
if (typeof d == "number" && Number.isFinite(d))
|
|
1356
|
+
return Math.max(80, d);
|
|
1357
|
+
const E = String(d).match(/^(\d+(?:\.\d+)?)/), B = E ? Number.parseFloat(E[1]) : 500;
|
|
1358
|
+
return Number.isFinite(B) ? Math.max(80, B) : 500;
|
|
1359
|
+
}, []), ze = D((d) => {
|
|
1360
|
+
var F, A, T, Y;
|
|
1361
|
+
if (oe)
|
|
1362
1362
|
return;
|
|
1363
|
-
const E = I.current,
|
|
1364
|
-
if (!E || !
|
|
1363
|
+
const E = I.current, B = te.current;
|
|
1364
|
+
if (!E || !B)
|
|
1365
1365
|
return;
|
|
1366
|
-
const
|
|
1367
|
-
if (!
|
|
1366
|
+
const l = de.current === "diff" ? (F = B.getDiffEditorView) == null ? void 0 : F.call(B) : (A = B.getEditorView) == null ? void 0 : A.call(B);
|
|
1367
|
+
if (!l)
|
|
1368
1368
|
return;
|
|
1369
|
-
const
|
|
1369
|
+
const v = Me();
|
|
1370
1370
|
try {
|
|
1371
|
-
(
|
|
1371
|
+
(T = l.updateOptions) == null || T.call(l, { automaticLayout: d });
|
|
1372
1372
|
} catch {
|
|
1373
1373
|
}
|
|
1374
|
-
|
|
1374
|
+
d ? (E.style.maxHeight = "none", E.style.overflow = "visible") : (E.style.maxHeight = `${Math.ceil(v)}px`, E.style.overflow = "auto");
|
|
1375
1375
|
try {
|
|
1376
|
-
const
|
|
1377
|
-
if (typeof
|
|
1378
|
-
return
|
|
1379
|
-
if (
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1382
|
-
return
|
|
1376
|
+
const ge = Number((() => {
|
|
1377
|
+
if (typeof l.getContentHeight == "function")
|
|
1378
|
+
return l.getContentHeight();
|
|
1379
|
+
if (de.current === "diff" && typeof l.getModifiedEditor == "function") {
|
|
1380
|
+
const i = l.getModifiedEditor();
|
|
1381
|
+
if (i && typeof i.getContentHeight == "function")
|
|
1382
|
+
return i.getContentHeight();
|
|
1383
1383
|
}
|
|
1384
1384
|
})());
|
|
1385
|
-
if (Number.isFinite(
|
|
1386
|
-
const
|
|
1387
|
-
E.style.height = `${Math.ceil(Math.max(120,
|
|
1385
|
+
if (Number.isFinite(ge) && ge > 0) {
|
|
1386
|
+
const i = d ? ge : Math.min(ge, v);
|
|
1387
|
+
E.style.height = `${Math.ceil(Math.max(120, i))}px`;
|
|
1388
1388
|
}
|
|
1389
|
+
(Y = l.layout) == null || Y.call(l);
|
|
1389
1390
|
} catch {
|
|
1390
1391
|
}
|
|
1391
|
-
}, [
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}, [f]),
|
|
1395
|
-
_e(
|
|
1392
|
+
}, [Me, oe]);
|
|
1393
|
+
W(() => {
|
|
1394
|
+
q.current = f;
|
|
1395
|
+
}, [f]), W(() => {
|
|
1396
|
+
_e(pt(r.language));
|
|
1396
1397
|
}, [r.language]);
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
-
const
|
|
1400
|
-
var
|
|
1401
|
-
|
|
1402
|
-
|
|
1398
|
+
const dt = R(r);
|
|
1399
|
+
dt.current = r;
|
|
1400
|
+
const ct = D(() => {
|
|
1401
|
+
var d;
|
|
1402
|
+
Se.current += 1;
|
|
1403
|
+
try {
|
|
1404
|
+
(d = ue.current) == null || d.call(ue);
|
|
1405
|
+
} catch {
|
|
1406
|
+
}
|
|
1407
|
+
ie.current = null, de.current = null, ce.current = null, We(!1), st(!1);
|
|
1408
|
+
}, []), Ke = D(() => {
|
|
1409
|
+
var l, v, F, A;
|
|
1410
|
+
const d = I.current, E = $.current;
|
|
1411
|
+
if (!d || !E)
|
|
1403
1412
|
return;
|
|
1404
|
-
const
|
|
1413
|
+
const B = (l = d.querySelector(".monaco-editor")) != null ? l : d;
|
|
1405
1414
|
try {
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1415
|
+
const T = typeof window != "undefined" && window.getComputedStyle ? window.getComputedStyle(B) : null, Y = String((v = T == null ? void 0 : T.getPropertyValue("--vscode-editor-foreground")) != null ? v : "").trim(), me = String((F = T == null ? void 0 : T.getPropertyValue("--vscode-editor-background")) != null ? F : "").trim(), ge = String((A = T == null ? void 0 : T.getPropertyValue("--vscode-editor-selectionBackground")) != null ? A : "").trim();
|
|
1416
|
+
Y && E.style.setProperty("--vscode-editor-foreground", Y), me && E.style.setProperty("--vscode-editor-background", me), ge && E.style.setProperty("--vscode-editor-selectionBackground", ge);
|
|
1408
1417
|
} catch {
|
|
1409
1418
|
}
|
|
1410
1419
|
}, []);
|
|
1411
|
-
|
|
1412
|
-
var
|
|
1413
|
-
(
|
|
1414
|
-
}, []),
|
|
1415
|
-
var
|
|
1416
|
-
if (typeof window == "undefined" ||
|
|
1420
|
+
W(() => () => {
|
|
1421
|
+
var d, E, B;
|
|
1422
|
+
Se.current += 1, (d = ue.current) == null || d.call(ue), ue.current = null, ie.current = null, de.current = null, ce.current = null, V.current = null, (B = (E = re.current) == null ? void 0 : E.destroy) == null || B.call(E), re.current = null;
|
|
1423
|
+
}, []), W(() => {
|
|
1424
|
+
var B, l;
|
|
1425
|
+
if (typeof window == "undefined" || X)
|
|
1417
1426
|
return;
|
|
1418
|
-
const
|
|
1419
|
-
if (!
|
|
1427
|
+
const d = $.current;
|
|
1428
|
+
if (!d)
|
|
1420
1429
|
return;
|
|
1421
|
-
(
|
|
1422
|
-
const E =
|
|
1423
|
-
return
|
|
1424
|
-
E.destroy(),
|
|
1430
|
+
(l = (B = re.current) == null ? void 0 : B.destroy) == null || l.call(B);
|
|
1431
|
+
const E = we(d, { rootMargin: "400px" });
|
|
1432
|
+
return re.current = E, E.isVisible() && ne(!0), E.whenVisible.then(() => ne(!0)), () => {
|
|
1433
|
+
E.destroy(), re.current === E && (re.current = null);
|
|
1425
1434
|
};
|
|
1426
|
-
}, [
|
|
1427
|
-
let
|
|
1435
|
+
}, [we, X]), W(() => {
|
|
1436
|
+
let d = !0;
|
|
1428
1437
|
return typeof window == "undefined" ? () => {
|
|
1429
|
-
|
|
1438
|
+
d = !1;
|
|
1430
1439
|
} : ((async () => {
|
|
1431
1440
|
try {
|
|
1432
1441
|
const E = await Pr();
|
|
1433
|
-
if (!
|
|
1442
|
+
if (!d)
|
|
1434
1443
|
return;
|
|
1435
1444
|
if (!E) {
|
|
1436
1445
|
Ne(!0);
|
|
1437
1446
|
return;
|
|
1438
1447
|
}
|
|
1439
|
-
const
|
|
1440
|
-
if (typeof
|
|
1448
|
+
const B = E.useMonaco, l = E.detectLanguage;
|
|
1449
|
+
if (typeof l == "function" && (V.current = l), typeof B != "function") {
|
|
1441
1450
|
Ne(!0);
|
|
1442
1451
|
return;
|
|
1443
1452
|
}
|
|
1444
|
-
const
|
|
1445
|
-
if (
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1453
|
+
const v = o ? s : g, F = { ...$e.current || {} };
|
|
1454
|
+
if (pt(r == null ? void 0 : r.language) === "shell") {
|
|
1455
|
+
const Y = Array.isArray(F.languages) ? F.languages.map(String) : null, me = Y != null ? Y : _n;
|
|
1456
|
+
F.languages = Array.from(/* @__PURE__ */ new Set([...me, "shell"]));
|
|
1448
1457
|
}
|
|
1449
|
-
const
|
|
1458
|
+
const T = B({
|
|
1450
1459
|
wordWrap: "on",
|
|
1451
1460
|
wrappingIndent: "same",
|
|
1452
|
-
themes:
|
|
1453
|
-
theme:
|
|
1454
|
-
...
|
|
1461
|
+
themes: ye.current,
|
|
1462
|
+
theme: v,
|
|
1463
|
+
...F,
|
|
1455
1464
|
onThemeChange() {
|
|
1456
|
-
|
|
1465
|
+
Ke();
|
|
1457
1466
|
}
|
|
1458
1467
|
});
|
|
1459
|
-
|
|
1468
|
+
te.current = T, ue.current = typeof T.safeClean == "function" ? () => T.safeClean() : typeof T.cleanupEditor == "function" ? () => T.cleanupEditor() : null, Fe(!0);
|
|
1460
1469
|
} catch {
|
|
1461
|
-
|
|
1470
|
+
d && Ne(!0);
|
|
1462
1471
|
}
|
|
1463
1472
|
})(), () => {
|
|
1464
|
-
|
|
1473
|
+
d = !1;
|
|
1465
1474
|
});
|
|
1466
|
-
}, []),
|
|
1467
|
-
var
|
|
1468
|
-
if (!r.language && !
|
|
1475
|
+
}, []), W(() => {
|
|
1476
|
+
var d;
|
|
1477
|
+
if (!r.language && !be && V.current)
|
|
1469
1478
|
try {
|
|
1470
|
-
const E =
|
|
1471
|
-
E &&
|
|
1479
|
+
const E = V.current(String((d = r.code) != null ? d : ""));
|
|
1480
|
+
E && De(E);
|
|
1472
1481
|
} catch {
|
|
1473
1482
|
}
|
|
1474
|
-
}, [
|
|
1475
|
-
const
|
|
1476
|
-
const
|
|
1477
|
-
return
|
|
1478
|
-
}, [
|
|
1479
|
-
var
|
|
1480
|
-
return r.diff ? (E = (
|
|
1481
|
-
}, [r.code, r.diff, r.updatedCode]),
|
|
1482
|
-
const
|
|
1483
|
-
if (
|
|
1484
|
-
return typeof
|
|
1485
|
-
}, E = {},
|
|
1486
|
-
return
|
|
1487
|
-
}, [C, w]),
|
|
1488
|
-
|
|
1489
|
-
if (
|
|
1483
|
+
}, [be, r.code, r.language]);
|
|
1484
|
+
const mt = H(() => String(r.language || be || y || "plaintext"), [be, y, r.language]), le = H(() => pt(mt), [mt]), rt = H(() => wr(le), [le]), b = H(() => ur(le), [le]), j = H(() => c ? le === "html" || le === "svg" : !1, [le, c]), N = H(() => {
|
|
1485
|
+
const d = le;
|
|
1486
|
+
return d ? Qt[d] || d.charAt(0).toUpperCase() + d.slice(1) : Qt[""] || "Plain Text";
|
|
1487
|
+
}, [le]), z = H(() => {
|
|
1488
|
+
var d, E, B;
|
|
1489
|
+
return r.diff ? (E = (d = r.updatedCode) != null ? d : r.code) != null ? E : "" : (B = r.code) != null ? B : "";
|
|
1490
|
+
}, [r.code, r.diff, r.updatedCode]), Z = H(() => {
|
|
1491
|
+
const d = (v) => {
|
|
1492
|
+
if (v != null)
|
|
1493
|
+
return typeof v == "number" ? `${v}px` : String(v);
|
|
1494
|
+
}, E = {}, B = d(C), l = d(w);
|
|
1495
|
+
return B && (E.minWidth = B), l && (E.maxWidth = l), E;
|
|
1496
|
+
}, [C, w]), Q = u === !1 && a, je = H(() => o ? s : g, [s, o, g]);
|
|
1497
|
+
W(() => {
|
|
1498
|
+
if (oe || !ae || !X)
|
|
1490
1499
|
return;
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1500
|
+
const d = te.current;
|
|
1501
|
+
d != null && d.setTheme && je && Promise.resolve(d.setTheme(je)).then(() => Ke()).catch(() => {
|
|
1493
1502
|
});
|
|
1494
|
-
}, [
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1503
|
+
}, [ae, je, Ke, oe, X]);
|
|
1504
|
+
const Be = D(async () => {
|
|
1505
|
+
var ge, i;
|
|
1506
|
+
if (oe || !X || fe || Q)
|
|
1497
1507
|
return null;
|
|
1498
|
-
const
|
|
1499
|
-
if (!
|
|
1508
|
+
const d = te.current, E = I.current;
|
|
1509
|
+
if (!d || !E || !d.createEditor)
|
|
1500
1510
|
return null;
|
|
1501
|
-
const
|
|
1502
|
-
if (
|
|
1511
|
+
const B = dt.current, l = B.diff ? "diff" : "single", v = ce.current, F = l === "diff" ? !!((ge = d.getDiffEditorView) != null && ge.call(d)) : !!((i = d.getEditorView) != null && i.call(d));
|
|
1512
|
+
if (!(de.current !== l || v !== E || !F))
|
|
1503
1513
|
return null;
|
|
1504
|
-
if (
|
|
1505
|
-
return
|
|
1506
|
-
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1514
|
+
if (ie.current)
|
|
1515
|
+
return ie.current;
|
|
1516
|
+
Se.current += 1;
|
|
1517
|
+
const T = Se.current;
|
|
1518
|
+
st(!0);
|
|
1519
|
+
const me = (async () => {
|
|
1520
|
+
var p, k, _, ee, se, G, K, Ae, ke, Ce;
|
|
1509
1521
|
try {
|
|
1510
|
-
(
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1522
|
+
(p = ue.current) == null || p.call(ue), de.current = null, ce.current = null, We(!1);
|
|
1523
|
+
const Ye = rt;
|
|
1524
|
+
if (B.diff ? typeof d.createDiffEditor == "function" ? (de.current = "diff", await d.createDiffEditor(
|
|
1513
1525
|
E,
|
|
1514
|
-
String((
|
|
1515
|
-
String((
|
|
1516
|
-
|
|
1517
|
-
)) : (
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1526
|
+
String((k = B.originalCode) != null ? k : ""),
|
|
1527
|
+
String((_ = B.updatedCode) != null ? _ : ""),
|
|
1528
|
+
Ye
|
|
1529
|
+
)) : (de.current = "single", await d.createEditor(E, String((se = (ee = B.updatedCode) != null ? ee : B.code) != null ? se : ""), Ye)) : (de.current = "single", await d.createEditor(E, String((G = B.code) != null ? G : ""), Ye)), ce.current = E, Se.current !== T)
|
|
1530
|
+
return;
|
|
1531
|
+
const ot = Number((K = q.current) == null ? void 0 : K.fontSize);
|
|
1532
|
+
if (Number.isFinite(ot) && ot > 0) {
|
|
1533
|
+
bt(ot), et(ot);
|
|
1521
1534
|
try {
|
|
1522
|
-
const
|
|
1523
|
-
(
|
|
1535
|
+
const tt = de.current === "diff" ? (Ae = d.getDiffEditorView) == null ? void 0 : Ae.call(d) : (ke = d.getEditorView) == null ? void 0 : ke.call(d);
|
|
1536
|
+
(Ce = tt == null ? void 0 : tt.updateOptions) == null || Ce.call(tt, { fontSize: ot, automaticLayout: !1 });
|
|
1524
1537
|
} catch {
|
|
1525
1538
|
}
|
|
1526
1539
|
}
|
|
1527
|
-
|
|
1540
|
+
Ke(), !xe && !fe && ze(!1), We(!0);
|
|
1528
1541
|
} catch {
|
|
1529
|
-
Ne(!0);
|
|
1542
|
+
Se.current === T && Ne(!0);
|
|
1530
1543
|
}
|
|
1531
|
-
})()
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
}, [
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
(u = ue.current) == null || u.call(ue);
|
|
1544
|
+
})().finally(() => {
|
|
1545
|
+
ie.current === me && (ie.current = null);
|
|
1546
|
+
});
|
|
1547
|
+
return ie.current = me, me;
|
|
1548
|
+
}, [ze, fe, xe, rt, Q, Ke, oe, X]), Te = le === "mermaid";
|
|
1549
|
+
W(() => {
|
|
1550
|
+
if (!oe && ve && X) {
|
|
1551
|
+
if (fe || Q || Te) {
|
|
1552
|
+
ct();
|
|
1541
1553
|
return;
|
|
1542
1554
|
}
|
|
1543
|
-
|
|
1555
|
+
Be();
|
|
1544
1556
|
}
|
|
1545
|
-
}, [
|
|
1546
|
-
var
|
|
1547
|
-
if (
|
|
1557
|
+
}, [fe, Be, Te, ve, ct, Q, oe, X]), W(() => {
|
|
1558
|
+
var l;
|
|
1559
|
+
if (oe || !ve || !X || fe || Q || Te)
|
|
1548
1560
|
return;
|
|
1549
|
-
const
|
|
1550
|
-
if (!
|
|
1561
|
+
const d = te.current;
|
|
1562
|
+
if (!d)
|
|
1551
1563
|
return;
|
|
1552
|
-
const E = String((
|
|
1564
|
+
const E = String((l = r.code) != null ? l : "");
|
|
1553
1565
|
(async () => {
|
|
1554
|
-
var
|
|
1555
|
-
let
|
|
1556
|
-
if (!
|
|
1566
|
+
var A, T;
|
|
1567
|
+
let v = be;
|
|
1568
|
+
if (!v && V.current)
|
|
1557
1569
|
try {
|
|
1558
|
-
|
|
1570
|
+
v = pt(V.current(E)), v && _e(v);
|
|
1559
1571
|
} catch {
|
|
1560
1572
|
}
|
|
1561
|
-
const
|
|
1562
|
-
if (
|
|
1573
|
+
const F = wr(v || le);
|
|
1574
|
+
if (d.createEditor && I.current) {
|
|
1563
1575
|
try {
|
|
1564
|
-
await
|
|
1576
|
+
await Promise.resolve(Be());
|
|
1565
1577
|
} catch {
|
|
1566
1578
|
}
|
|
1579
|
+
const Y = ie.current;
|
|
1580
|
+
if (Y)
|
|
1581
|
+
try {
|
|
1582
|
+
await Y;
|
|
1583
|
+
} catch {
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1567
1586
|
try {
|
|
1568
|
-
r.diff &&
|
|
1587
|
+
r.diff && d.updateDiff ? await Promise.resolve(d.updateDiff(String((A = r.originalCode) != null ? A : ""), String((T = r.updatedCode) != null ? T : ""), F)) : d.updateCode && await Promise.resolve(d.updateCode(E, F));
|
|
1569
1588
|
} catch {
|
|
1570
1589
|
}
|
|
1571
|
-
|
|
1590
|
+
xe && ze(!0);
|
|
1572
1591
|
})();
|
|
1573
1592
|
}, [
|
|
1574
|
-
|
|
1575
|
-
he,
|
|
1576
|
-
x,
|
|
1577
|
-
ve,
|
|
1578
|
-
xe,
|
|
1579
|
-
Y,
|
|
1580
|
-
fe,
|
|
1593
|
+
ze,
|
|
1581
1594
|
le,
|
|
1582
|
-
|
|
1595
|
+
be,
|
|
1596
|
+
fe,
|
|
1597
|
+
ae,
|
|
1598
|
+
Be,
|
|
1599
|
+
xe,
|
|
1600
|
+
Te,
|
|
1601
|
+
ve,
|
|
1583
1602
|
r.code,
|
|
1584
1603
|
r.diff,
|
|
1585
1604
|
r.originalCode,
|
|
1586
1605
|
r.updatedCode,
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1606
|
+
Q,
|
|
1607
|
+
oe,
|
|
1608
|
+
X
|
|
1609
|
+
]), W(() => {
|
|
1610
|
+
if (oe || !ve || !X || fe || Q || !xe && a)
|
|
1591
1611
|
return;
|
|
1592
|
-
const
|
|
1593
|
-
return
|
|
1594
|
-
|
|
1612
|
+
const d = typeof window != "undefined" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => ze(xe)) : null;
|
|
1613
|
+
return d == null && ze(xe), () => {
|
|
1614
|
+
d != null && typeof window != "undefined" && typeof window.cancelAnimationFrame == "function" && window.cancelAnimationFrame(d);
|
|
1595
1615
|
};
|
|
1596
|
-
}, [
|
|
1597
|
-
var E,
|
|
1598
|
-
if (!
|
|
1616
|
+
}, [ze, fe, xe, a, ve, Q, oe, X]), W(() => {
|
|
1617
|
+
var E, B, l;
|
|
1618
|
+
if (!m || oe)
|
|
1599
1619
|
return;
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1620
|
+
const d = te.current;
|
|
1621
|
+
if (d) {
|
|
1602
1622
|
try {
|
|
1603
|
-
const
|
|
1604
|
-
(
|
|
1623
|
+
const v = de.current === "diff" ? (E = d.getDiffEditorView) == null ? void 0 : E.call(d) : (B = d.getEditorView) == null ? void 0 : B.call(d);
|
|
1624
|
+
(l = v == null ? void 0 : v.updateOptions) == null || l.call(v, { fontSize: Ge });
|
|
1605
1625
|
} catch {
|
|
1606
1626
|
}
|
|
1607
|
-
|
|
1608
|
-
}
|
|
1609
|
-
}, [
|
|
1610
|
-
const
|
|
1611
|
-
const
|
|
1612
|
-
Ut(
|
|
1613
|
-
}, [o]),
|
|
1614
|
-
|
|
1615
|
-
}, []),
|
|
1616
|
-
var
|
|
1627
|
+
ze(xe);
|
|
1628
|
+
}
|
|
1629
|
+
}, [ze, m, xe, Ge, r.diff, oe]);
|
|
1630
|
+
const he = D((d, E) => {
|
|
1631
|
+
const B = d.currentTarget;
|
|
1632
|
+
Ut(B, E, "top", !1, { x: d.clientX, y: d.clientY }, o);
|
|
1633
|
+
}, [o]), J = D(() => {
|
|
1634
|
+
Oe();
|
|
1635
|
+
}, []), Ze = D(async () => {
|
|
1636
|
+
var d;
|
|
1617
1637
|
try {
|
|
1618
|
-
typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && await navigator.clipboard.writeText(String(
|
|
1638
|
+
typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && await navigator.clipboard.writeText(String(z)), ut(!0), (d = e.onCopy) == null || d.call(e, String(z)), setTimeout(() => ut(!1), 1e3);
|
|
1619
1639
|
} catch {
|
|
1620
1640
|
}
|
|
1621
|
-
}, [e,
|
|
1622
|
-
if (!
|
|
1641
|
+
}, [e, z]), ft = D(() => {
|
|
1642
|
+
if (!j)
|
|
1623
1643
|
return;
|
|
1624
|
-
const
|
|
1644
|
+
const d = le === "html" ? "text/html" : "image/svg+xml", E = le === "html" ? U("artifacts.htmlPreviewTitle") || "HTML Preview" : U("artifacts.svgPreviewTitle") || "SVG Preview";
|
|
1625
1645
|
if (typeof e.onPreviewCode == "function") {
|
|
1626
1646
|
e.onPreviewCode({
|
|
1627
1647
|
node: r,
|
|
1628
|
-
artifactType:
|
|
1648
|
+
artifactType: d,
|
|
1629
1649
|
artifactTitle: E,
|
|
1630
|
-
id: `temp-${
|
|
1650
|
+
id: `temp-${le}-${Date.now()}`
|
|
1631
1651
|
});
|
|
1632
1652
|
return;
|
|
1633
1653
|
}
|
|
1634
|
-
|
|
1635
|
-
}, [
|
|
1636
|
-
return
|
|
1654
|
+
le === "html" && Ie((B) => !B);
|
|
1655
|
+
}, [le, j, r, e, U]);
|
|
1656
|
+
return oe ? /* @__PURE__ */ n.jsx(er, { node: r }) : /* @__PURE__ */ n.jsxs(
|
|
1637
1657
|
"div",
|
|
1638
1658
|
{
|
|
1639
|
-
ref:
|
|
1659
|
+
ref: $,
|
|
1640
1660
|
className: [
|
|
1641
1661
|
"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",
|
|
1642
1662
|
o ? "border-gray-700/30 bg-gray-900" : "border-gray-200 bg-white",
|
|
1643
1663
|
a ? "is-rendering" : "",
|
|
1644
1664
|
o ? "is-dark" : ""
|
|
1645
1665
|
].join(" "),
|
|
1646
|
-
style:
|
|
1666
|
+
style: Z,
|
|
1647
1667
|
children: [
|
|
1648
|
-
|
|
1668
|
+
x && /* @__PURE__ */ n.jsxs(
|
|
1649
1669
|
"div",
|
|
1650
1670
|
{
|
|
1651
1671
|
className: "code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",
|
|
@@ -1656,10 +1676,10 @@ function Bn(t) {
|
|
|
1656
1676
|
"span",
|
|
1657
1677
|
{
|
|
1658
1678
|
className: "icon-slot h-4 w-4 flex-shrink-0",
|
|
1659
|
-
dangerouslySetInnerHTML: { __html:
|
|
1679
|
+
dangerouslySetInnerHTML: { __html: b }
|
|
1660
1680
|
}
|
|
1661
1681
|
),
|
|
1662
|
-
/* @__PURE__ */ n.jsx("span", { className: "text-sm font-medium font-mono truncate", children:
|
|
1682
|
+
/* @__PURE__ */ n.jsx("span", { className: "text-sm font-medium font-mono truncate", children: N })
|
|
1663
1683
|
] }),
|
|
1664
1684
|
/* @__PURE__ */ n.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1665
1685
|
/* @__PURE__ */ n.jsx(
|
|
@@ -1667,16 +1687,16 @@ function Bn(t) {
|
|
|
1667
1687
|
{
|
|
1668
1688
|
type: "button",
|
|
1669
1689
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1670
|
-
"aria-pressed":
|
|
1671
|
-
onClick: () =>
|
|
1672
|
-
onMouseEnter: (
|
|
1673
|
-
onFocus: (
|
|
1674
|
-
onMouseLeave:
|
|
1675
|
-
onBlur:
|
|
1690
|
+
"aria-pressed": fe,
|
|
1691
|
+
onClick: () => Xe((d) => !d),
|
|
1692
|
+
onMouseEnter: (d) => he(d, fe ? U("common.expand") || "Expand" : U("common.collapse") || "Collapse"),
|
|
1693
|
+
onFocus: (d) => he(d, fe ? U("common.expand") || "Expand" : U("common.collapse") || "Collapse"),
|
|
1694
|
+
onMouseLeave: J,
|
|
1695
|
+
onBlur: J,
|
|
1676
1696
|
children: /* @__PURE__ */ n.jsx(
|
|
1677
1697
|
"svg",
|
|
1678
1698
|
{
|
|
1679
|
-
style: { rotate:
|
|
1699
|
+
style: { rotate: fe ? "0deg" : "90deg" },
|
|
1680
1700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1681
1701
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1682
1702
|
"aria-hidden": "true",
|
|
@@ -1690,18 +1710,18 @@ function Bn(t) {
|
|
|
1690
1710
|
)
|
|
1691
1711
|
}
|
|
1692
1712
|
),
|
|
1693
|
-
M &&
|
|
1713
|
+
M && m && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1694
1714
|
/* @__PURE__ */ n.jsx(
|
|
1695
1715
|
"button",
|
|
1696
1716
|
{
|
|
1697
1717
|
type: "button",
|
|
1698
1718
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1699
|
-
disabled:
|
|
1700
|
-
onClick: () =>
|
|
1701
|
-
onMouseEnter: (
|
|
1702
|
-
onFocus: (
|
|
1703
|
-
onMouseLeave:
|
|
1704
|
-
onBlur:
|
|
1719
|
+
disabled: Ge <= 10,
|
|
1720
|
+
onClick: () => et((d) => Math.max(10, d - 1)),
|
|
1721
|
+
onMouseEnter: (d) => he(d, U("common.decrease") || "Decrease"),
|
|
1722
|
+
onFocus: (d) => he(d, U("common.decrease") || "Decrease"),
|
|
1723
|
+
onMouseLeave: J,
|
|
1724
|
+
onBlur: J,
|
|
1705
1725
|
children: /* @__PURE__ */ n.jsx(
|
|
1706
1726
|
"svg",
|
|
1707
1727
|
{
|
|
@@ -1723,12 +1743,12 @@ function Bn(t) {
|
|
|
1723
1743
|
{
|
|
1724
1744
|
type: "button",
|
|
1725
1745
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1726
|
-
disabled:
|
|
1727
|
-
onClick: () =>
|
|
1728
|
-
onMouseEnter: (
|
|
1729
|
-
onFocus: (
|
|
1730
|
-
onMouseLeave:
|
|
1731
|
-
onBlur:
|
|
1746
|
+
disabled: Ge === Ue,
|
|
1747
|
+
onClick: () => et(Ue),
|
|
1748
|
+
onMouseEnter: (d) => he(d, U("common.reset") || "Reset"),
|
|
1749
|
+
onFocus: (d) => he(d, U("common.reset") || "Reset"),
|
|
1750
|
+
onMouseLeave: J,
|
|
1751
|
+
onBlur: J,
|
|
1732
1752
|
children: /* @__PURE__ */ n.jsx(
|
|
1733
1753
|
"svg",
|
|
1734
1754
|
{
|
|
@@ -1753,12 +1773,12 @@ function Bn(t) {
|
|
|
1753
1773
|
{
|
|
1754
1774
|
type: "button",
|
|
1755
1775
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1756
|
-
disabled:
|
|
1757
|
-
onClick: () =>
|
|
1758
|
-
onMouseEnter: (
|
|
1759
|
-
onFocus: (
|
|
1760
|
-
onMouseLeave:
|
|
1761
|
-
onBlur:
|
|
1776
|
+
disabled: Ge >= 36,
|
|
1777
|
+
onClick: () => et((d) => Math.min(36, d + 1)),
|
|
1778
|
+
onMouseEnter: (d) => he(d, U("common.increase") || "Increase"),
|
|
1779
|
+
onFocus: (d) => he(d, U("common.increase") || "Increase"),
|
|
1780
|
+
onMouseLeave: J,
|
|
1781
|
+
onBlur: J,
|
|
1762
1782
|
children: /* @__PURE__ */ n.jsx(
|
|
1763
1783
|
"svg",
|
|
1764
1784
|
{
|
|
@@ -1776,18 +1796,18 @@ function Bn(t) {
|
|
|
1776
1796
|
}
|
|
1777
1797
|
)
|
|
1778
1798
|
] }),
|
|
1779
|
-
|
|
1799
|
+
S && /* @__PURE__ */ n.jsx(
|
|
1780
1800
|
"button",
|
|
1781
1801
|
{
|
|
1782
1802
|
type: "button",
|
|
1783
1803
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1784
|
-
"aria-label":
|
|
1785
|
-
onClick:
|
|
1786
|
-
onMouseEnter: (
|
|
1787
|
-
onFocus: (
|
|
1788
|
-
onMouseLeave:
|
|
1789
|
-
onBlur:
|
|
1790
|
-
children:
|
|
1804
|
+
"aria-label": He ? U("common.copied") || "Copied" : U("common.copy") || "Copy",
|
|
1805
|
+
onClick: Ze,
|
|
1806
|
+
onMouseEnter: (d) => he(d, He ? U("common.copied") || "Copied" : U("common.copy") || "Copy"),
|
|
1807
|
+
onFocus: (d) => he(d, He ? U("common.copied") || "Copied" : U("common.copy") || "Copy"),
|
|
1808
|
+
onMouseLeave: J,
|
|
1809
|
+
onBlur: J,
|
|
1810
|
+
children: He ? /* @__PURE__ */ n.jsx(
|
|
1791
1811
|
"svg",
|
|
1792
1812
|
{
|
|
1793
1813
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1819,18 +1839,18 @@ function Bn(t) {
|
|
|
1819
1839
|
)
|
|
1820
1840
|
}
|
|
1821
1841
|
),
|
|
1822
|
-
|
|
1842
|
+
O && /* @__PURE__ */ n.jsx(
|
|
1823
1843
|
"button",
|
|
1824
1844
|
{
|
|
1825
1845
|
type: "button",
|
|
1826
1846
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1827
|
-
"aria-pressed":
|
|
1828
|
-
onClick: () =>
|
|
1829
|
-
onMouseEnter: (
|
|
1830
|
-
onFocus: (
|
|
1831
|
-
onMouseLeave:
|
|
1832
|
-
onBlur:
|
|
1833
|
-
children:
|
|
1847
|
+
"aria-pressed": xe,
|
|
1848
|
+
onClick: () => vt((d) => !d),
|
|
1849
|
+
onMouseEnter: (d) => he(d, xe ? U("common.collapse") || "Collapse" : U("common.expand") || "Expand"),
|
|
1850
|
+
onFocus: (d) => he(d, xe ? U("common.collapse") || "Collapse" : U("common.expand") || "Expand"),
|
|
1851
|
+
onMouseLeave: J,
|
|
1852
|
+
onBlur: J,
|
|
1853
|
+
children: xe ? /* @__PURE__ */ n.jsx(
|
|
1834
1854
|
"svg",
|
|
1835
1855
|
{
|
|
1836
1856
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1859,17 +1879,17 @@ function Bn(t) {
|
|
|
1859
1879
|
)
|
|
1860
1880
|
}
|
|
1861
1881
|
),
|
|
1862
|
-
|
|
1882
|
+
j && L && /* @__PURE__ */ n.jsx(
|
|
1863
1883
|
"button",
|
|
1864
1884
|
{
|
|
1865
1885
|
type: "button",
|
|
1866
1886
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
1867
|
-
"aria-label":
|
|
1868
|
-
onClick:
|
|
1869
|
-
onMouseEnter: (
|
|
1870
|
-
onFocus: (
|
|
1871
|
-
onMouseLeave:
|
|
1872
|
-
onBlur:
|
|
1887
|
+
"aria-label": U("common.preview") || "Preview",
|
|
1888
|
+
onClick: ft,
|
|
1889
|
+
onMouseEnter: (d) => he(d, U("common.preview") || "Preview"),
|
|
1890
|
+
onFocus: (d) => he(d, U("common.preview") || "Preview"),
|
|
1891
|
+
onMouseLeave: J,
|
|
1892
|
+
onBlur: J,
|
|
1873
1893
|
children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", children: /* @__PURE__ */ n.jsxs("g", { fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd", children: [
|
|
1874
1894
|
/* @__PURE__ */ n.jsx("path", { d: "M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496" }),
|
|
1875
1895
|
/* @__PURE__ */ n.jsx("path", { d: "M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23" })
|
|
@@ -1880,18 +1900,18 @@ function Bn(t) {
|
|
|
1880
1900
|
]
|
|
1881
1901
|
}
|
|
1882
1902
|
),
|
|
1883
|
-
/* @__PURE__ */ n.jsxs("div", { className: `code-block-body${
|
|
1884
|
-
!
|
|
1903
|
+
/* @__PURE__ */ n.jsxs("div", { className: `code-block-body${xe ? " code-block-body--expanded" : ""}`, children: [
|
|
1904
|
+
!fe && (u ? !0 : !a) && (oe ? /* @__PURE__ */ n.jsx(er, { node: r }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1885
1905
|
/* @__PURE__ */ n.jsx(
|
|
1886
1906
|
"div",
|
|
1887
1907
|
{
|
|
1888
1908
|
ref: I,
|
|
1889
|
-
className: `code-editor-container${
|
|
1890
|
-
style: { visibility:
|
|
1891
|
-
"aria-hidden": !
|
|
1909
|
+
className: `code-editor-container${u ? "" : " code-height-placeholder"}`,
|
|
1910
|
+
style: { visibility: Je ? "visible" : "hidden" },
|
|
1911
|
+
"aria-hidden": !Je
|
|
1892
1912
|
}
|
|
1893
1913
|
),
|
|
1894
|
-
!
|
|
1914
|
+
!Je && /* @__PURE__ */ n.jsx(
|
|
1895
1915
|
"div",
|
|
1896
1916
|
{
|
|
1897
1917
|
style: {
|
|
@@ -1905,39 +1925,39 @@ function Bn(t) {
|
|
|
1905
1925
|
{
|
|
1906
1926
|
className: "code-fallback-plain m-0",
|
|
1907
1927
|
"aria-busy": a,
|
|
1908
|
-
"aria-label": `Code block: ${
|
|
1928
|
+
"aria-label": `Code block: ${N}`,
|
|
1909
1929
|
tabIndex: 0,
|
|
1910
|
-
children: /* @__PURE__ */ n.jsx("code", { translate: "no", children: String(
|
|
1930
|
+
children: /* @__PURE__ */ n.jsx("code", { translate: "no", children: String(z) })
|
|
1911
1931
|
}
|
|
1912
1932
|
)
|
|
1913
1933
|
}
|
|
1914
1934
|
)
|
|
1915
1935
|
] })),
|
|
1916
|
-
!
|
|
1936
|
+
!u && a && /* @__PURE__ */ n.jsx("div", { className: "code-loading-placeholder", children: /* @__PURE__ */ n.jsxs("div", { className: "loading-skeleton", children: [
|
|
1917
1937
|
/* @__PURE__ */ n.jsx("div", { className: "skeleton-line" }),
|
|
1918
1938
|
/* @__PURE__ */ n.jsx("div", { className: "skeleton-line" }),
|
|
1919
1939
|
/* @__PURE__ */ n.jsx("div", { className: "skeleton-line short" })
|
|
1920
1940
|
] }) })
|
|
1921
1941
|
] }),
|
|
1922
|
-
|
|
1942
|
+
Le && !e.onPreviewCode && j && le === "html" && /* @__PURE__ */ n.jsx(
|
|
1923
1943
|
Rn,
|
|
1924
1944
|
{
|
|
1925
|
-
code: String((
|
|
1945
|
+
code: String((nt = r.code) != null ? nt : ""),
|
|
1926
1946
|
isDark: o,
|
|
1927
|
-
onClose: () =>
|
|
1947
|
+
onClose: () => Ie(!1)
|
|
1928
1948
|
}
|
|
1929
1949
|
),
|
|
1930
|
-
/* @__PURE__ */ n.jsx("span", { className: "sr-only", "aria-live": "polite", role: "status", children:
|
|
1950
|
+
/* @__PURE__ */ n.jsx("span", { className: "sr-only", "aria-live": "polite", role: "status", children: He ? U("common.copied") || "Copied" : "" })
|
|
1931
1951
|
]
|
|
1932
1952
|
}
|
|
1933
1953
|
);
|
|
1934
1954
|
}
|
|
1935
1955
|
function Pn(t) {
|
|
1936
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a } = t,
|
|
1937
|
-
return /* @__PURE__ */ n.jsx("dl", { className: "definition-list", "data-index-key": a, children:
|
|
1938
|
-
/* @__PURE__ */ n.jsx("dt", { className: "definition-term font-semibold", children: r && o ? Ht(c.term, r, `${String(a != null ? a : "definition")}-term-${
|
|
1939
|
-
/* @__PURE__ */ n.jsx("dd", { className: "definition-desc ml-4", children: r && o ? Ht(c.definition, r, `${String(a != null ? a : "definition")}-desc-${
|
|
1940
|
-
] }, `${String(a != null ? a : "definition")}-${
|
|
1956
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a } = t, u = Array.isArray(e.items) ? e.items : [];
|
|
1957
|
+
return /* @__PURE__ */ n.jsx("dl", { className: "definition-list", "data-index-key": a, children: u.map((c, m) => /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
|
|
1958
|
+
/* @__PURE__ */ n.jsx("dt", { className: "definition-term font-semibold", children: r && o ? Ht(c.term, r, `${String(a != null ? a : "definition")}-term-${m}`, o) : null }),
|
|
1959
|
+
/* @__PURE__ */ n.jsx("dd", { className: "definition-desc ml-4", children: r && o ? Ht(c.definition, r, `${String(a != null ? a : "definition")}-desc-${m}`, o) : null })
|
|
1960
|
+
] }, `${String(a != null ? a : "definition")}-${m}`)) });
|
|
1941
1961
|
}
|
|
1942
1962
|
function Dn(t) {
|
|
1943
1963
|
var r;
|
|
@@ -1949,10 +1969,10 @@ function In(t) {
|
|
|
1949
1969
|
}
|
|
1950
1970
|
function An(t) {
|
|
1951
1971
|
const { node: e } = t, r = D((o) => {
|
|
1952
|
-
var
|
|
1972
|
+
var u;
|
|
1953
1973
|
if (o.preventDefault(), typeof document == "undefined")
|
|
1954
1974
|
return;
|
|
1955
|
-
const a = document.getElementById(`fnref-${String((
|
|
1975
|
+
const a = document.getElementById(`fnref-${String((u = e.id) != null ? u : "")}`);
|
|
1956
1976
|
a && a.scrollIntoView({ behavior: "smooth" });
|
|
1957
1977
|
}, [e.id]);
|
|
1958
1978
|
return /* @__PURE__ */ n.jsx(
|
|
@@ -1968,14 +1988,14 @@ function An(t) {
|
|
|
1968
1988
|
}
|
|
1969
1989
|
function On(t) {
|
|
1970
1990
|
const { node: e, ctx: r, renderNode: o, indexKey: a } = t;
|
|
1971
|
-
return /* @__PURE__ */ n.jsx("div", { id: `footnote-${e.id}`, className: "footnote-node flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2", children: /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: r && o ?
|
|
1991
|
+
return /* @__PURE__ */ n.jsx("div", { id: `footnote-${e.id}`, className: "footnote-node flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2", children: /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: r && o ? qe(e.children, r, String(a != null ? a : `footnote-${e.id}`), o) : null }) });
|
|
1972
1992
|
}
|
|
1973
1993
|
function $n(t) {
|
|
1974
|
-
const { node: e } = t, r =
|
|
1994
|
+
const { node: e } = t, r = H(() => `#footnote-${e.id}`, [e.id]), o = D((a) => {
|
|
1975
1995
|
if (a.preventDefault(), typeof document == "undefined")
|
|
1976
1996
|
return;
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1997
|
+
const u = document.querySelector(r);
|
|
1998
|
+
u && u.scrollIntoView({ behavior: "smooth" });
|
|
1979
1999
|
}, [r]);
|
|
1980
2000
|
return /* @__PURE__ */ n.jsx("sup", { id: `fnref-${e.id}`, className: "footnote-reference", onClick: o, children: /* @__PURE__ */ n.jsxs("a", { href: r, title: `View footnote ${e.id}`, className: "footnote-link cursor-pointer", children: [
|
|
1981
2001
|
"[",
|
|
@@ -1995,18 +2015,18 @@ function Dr(t) {
|
|
|
1995
2015
|
} else for (r in t) t[r] && (o && (o += " "), o += r);
|
|
1996
2016
|
return o;
|
|
1997
2017
|
}
|
|
1998
|
-
function
|
|
2018
|
+
function Ee() {
|
|
1999
2019
|
for (var t, e, r = 0, o = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (e = Dr(t)) && (o && (o += " "), o += e);
|
|
2000
2020
|
return o;
|
|
2001
2021
|
}
|
|
2002
2022
|
function Wn(t) {
|
|
2003
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a, children:
|
|
2023
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a, children: u } = t, c = Math.min(6, Math.max(1, Number(e.level) || 1)), m = `h${c}`;
|
|
2004
2024
|
return /* @__PURE__ */ n.jsx(
|
|
2005
|
-
|
|
2025
|
+
m,
|
|
2006
2026
|
{
|
|
2007
2027
|
dir: "auto",
|
|
2008
|
-
className:
|
|
2009
|
-
children:
|
|
2028
|
+
className: Ee("heading-node font-semibold", `heading-${c}`),
|
|
2029
|
+
children: u != null ? u : r && o ? qe(e.children, r, String(a != null ? a : `heading-${c}`), o) : null
|
|
2010
2030
|
}
|
|
2011
2031
|
);
|
|
2012
2032
|
}
|
|
@@ -2014,14 +2034,14 @@ function Hn(t) {
|
|
|
2014
2034
|
return /* @__PURE__ */ n.jsx("mark", { className: "highlight-node", children: t.children });
|
|
2015
2035
|
}
|
|
2016
2036
|
function zn(t) {
|
|
2017
|
-
const { node: e, placeholder: r } = t, o = It(), [a,
|
|
2018
|
-
|
|
2019
|
-
var
|
|
2037
|
+
const { node: e, placeholder: r } = t, o = It(), [a, u] = P(null), c = R(null), [m, s] = P(() => typeof window == "undefined"), [g, f] = P(e.content), h = !!e.loading;
|
|
2038
|
+
W(() => {
|
|
2039
|
+
var x;
|
|
2020
2040
|
if (typeof window == "undefined") {
|
|
2021
2041
|
s(!0);
|
|
2022
2042
|
return;
|
|
2023
2043
|
}
|
|
2024
|
-
if ((
|
|
2044
|
+
if ((x = c.current) == null || x.destroy(), c.current = null, !h) {
|
|
2025
2045
|
s(!0), f(e.content);
|
|
2026
2046
|
return;
|
|
2027
2047
|
}
|
|
@@ -2034,17 +2054,17 @@ function zn(t) {
|
|
|
2034
2054
|
}), () => {
|
|
2035
2055
|
w.destroy(), c.current = null;
|
|
2036
2056
|
};
|
|
2037
|
-
}, [a, h, e.content, o]),
|
|
2057
|
+
}, [a, h, e.content, o]), W(() => () => {
|
|
2038
2058
|
var w;
|
|
2039
2059
|
(w = c.current) == null || w.destroy(), c.current = null;
|
|
2040
|
-
}, []),
|
|
2041
|
-
(!h ||
|
|
2042
|
-
}, [h, e.content,
|
|
2043
|
-
const C =
|
|
2060
|
+
}, []), W(() => {
|
|
2061
|
+
(!h || m) && f(e.content);
|
|
2062
|
+
}, [h, e.content, m]);
|
|
2063
|
+
const C = H(() => {
|
|
2044
2064
|
var w;
|
|
2045
2065
|
return ar((w = e.attrs) != null ? w : void 0);
|
|
2046
2066
|
}, [e.attrs]);
|
|
2047
|
-
return /* @__PURE__ */ n.jsx("div", { ref:
|
|
2067
|
+
return /* @__PURE__ */ n.jsx("div", { ref: u, className: "html-block-node", ...C, children: m ? /* @__PURE__ */ n.jsx("div", { dangerouslySetInnerHTML: { __html: g != null ? g : "" } }) : /* @__PURE__ */ n.jsx("div", { className: "html-block-node__placeholder", children: r != null ? r : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
2048
2068
|
/* @__PURE__ */ n.jsx("span", { className: "html-block-node__placeholder-bar" }),
|
|
2049
2069
|
/* @__PURE__ */ n.jsx("span", { className: "html-block-node__placeholder-bar w-4/5" }),
|
|
2050
2070
|
/* @__PURE__ */ n.jsx("span", { className: "html-block-node__placeholder-bar w-2/3" })
|
|
@@ -2069,55 +2089,55 @@ const Xn = {
|
|
|
2069
2089
|
usePlaceholder: !0
|
|
2070
2090
|
};
|
|
2071
2091
|
function Un(t) {
|
|
2072
|
-
var
|
|
2073
|
-
const e = { ...Xn, ...t }, r = It(), [o, a] =
|
|
2074
|
-
|
|
2075
|
-
var
|
|
2092
|
+
var te, ue, ie, de, ce, Se;
|
|
2093
|
+
const e = { ...Xn, ...t }, r = It(), [o, a] = P(null), u = R(null), [c, m] = P(() => typeof window == "undefined" || e.lazy === !1), [s, g] = P(!1), [f, h] = P(!1), [C, w] = P(!1);
|
|
2094
|
+
W(() => {
|
|
2095
|
+
var q;
|
|
2076
2096
|
if (!e.lazy)
|
|
2077
2097
|
return;
|
|
2078
|
-
const
|
|
2079
|
-
if ((
|
|
2080
|
-
|
|
2098
|
+
const V = o;
|
|
2099
|
+
if ((q = u.current) == null || q.destroy(), u.current = null, !V) {
|
|
2100
|
+
m(!1);
|
|
2081
2101
|
return;
|
|
2082
2102
|
}
|
|
2083
|
-
const
|
|
2084
|
-
return
|
|
2103
|
+
const re = r(V, { rootMargin: "400px" });
|
|
2104
|
+
return u.current = re, re.isVisible() && m(!0), re.whenVisible.then(() => m(!0)).catch(() => {
|
|
2085
2105
|
}), () => {
|
|
2086
|
-
|
|
2106
|
+
re.destroy(), u.current = null;
|
|
2087
2107
|
};
|
|
2088
|
-
}, [o, r, e.lazy]),
|
|
2089
|
-
var
|
|
2090
|
-
(
|
|
2108
|
+
}, [o, r, e.lazy]), W(() => () => {
|
|
2109
|
+
var V;
|
|
2110
|
+
(V = u.current) == null || V.destroy(), u.current = null;
|
|
2091
2111
|
}, []);
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2112
|
+
const x = H(() => f && e.fallbackSrc ? e.fallbackSrc : e.node.src, [f, e.fallbackSrc, e.node.src]);
|
|
2113
|
+
W(() => {
|
|
2094
2114
|
g(!1), h(!1);
|
|
2095
|
-
}, [
|
|
2115
|
+
}, [x]), W(() => {
|
|
2096
2116
|
w(!1);
|
|
2097
2117
|
}, [e.node.src]);
|
|
2098
|
-
const
|
|
2099
|
-
var
|
|
2100
|
-
e.fallbackSrc && !C ? (w(!0), h(!0)) : (h(!0), (
|
|
2118
|
+
const S = H(() => /\.svg(?:\?|$)/i.test(String(x)), [x]), O = !e.lazy || c, L = () => {
|
|
2119
|
+
var V;
|
|
2120
|
+
e.fallbackSrc && !C ? (w(!0), h(!0)) : (h(!0), (V = e.onError) == null || V.call(e, e.node.src));
|
|
2101
2121
|
}, M = () => {
|
|
2102
|
-
var
|
|
2103
|
-
g(!0), h(!1), (
|
|
2104
|
-
}, I = (
|
|
2105
|
-
var
|
|
2106
|
-
|
|
2107
|
-
},
|
|
2122
|
+
var V;
|
|
2123
|
+
g(!0), h(!1), (V = e.onLoad) == null || V.call(e, x);
|
|
2124
|
+
}, I = (V) => {
|
|
2125
|
+
var re;
|
|
2126
|
+
V.preventDefault(), !(!s || f) && ((re = e.onClick) == null || re.call(e, [V, x]));
|
|
2127
|
+
}, $ = S ? { minHeight: e.svgMinHeight, width: "100%" } : { minHeight: "6rem" };
|
|
2108
2128
|
return /* @__PURE__ */ n.jsxs("figure", { ref: a, className: "image-node", children: [
|
|
2109
|
-
/* @__PURE__ */ n.jsx("div", { className: "image-node__inner", children: !e.node.loading && !f &&
|
|
2129
|
+
/* @__PURE__ */ n.jsx("div", { className: "image-node__inner", children: !e.node.loading && !f && O ? /* @__PURE__ */ n.jsx(
|
|
2110
2130
|
"img",
|
|
2111
2131
|
{
|
|
2112
|
-
src:
|
|
2113
|
-
alt: String((ue = (
|
|
2114
|
-
title: String((
|
|
2132
|
+
src: x,
|
|
2133
|
+
alt: String((ue = (te = e.node.alt) != null ? te : e.node.title) != null ? ue : ""),
|
|
2134
|
+
title: String((de = (ie = e.node.title) != null ? ie : e.node.alt) != null ? de : ""),
|
|
2115
2135
|
className: `image-node__img${s ? " is-loaded" : ""}`,
|
|
2116
|
-
style:
|
|
2136
|
+
style: S ? { minHeight: e.svgMinHeight, width: "100%", height: "auto", objectFit: "contain" } : void 0,
|
|
2117
2137
|
loading: e.lazy ? "lazy" : "eager",
|
|
2118
2138
|
decoding: "async",
|
|
2119
2139
|
tabIndex: s ? 0 : -1,
|
|
2120
|
-
"aria-label": (
|
|
2140
|
+
"aria-label": (ce = e.node.alt) != null ? ce : "Preview image",
|
|
2121
2141
|
onError: L,
|
|
2122
2142
|
onLoad: M,
|
|
2123
2143
|
onClick: I
|
|
@@ -2146,7 +2166,7 @@ function Un(t) {
|
|
|
2146
2166
|
"div",
|
|
2147
2167
|
{
|
|
2148
2168
|
className: "image-node__placeholder",
|
|
2149
|
-
style:
|
|
2169
|
+
style: $,
|
|
2150
2170
|
children: e.usePlaceholder ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
2151
2171
|
/* @__PURE__ */ n.jsx("span", { className: "image-node__spinner", "aria-hidden": "true" }),
|
|
2152
2172
|
/* @__PURE__ */ n.jsx("span", { className: "image-node__placeholder-text", children: "Loading image..." })
|
|
@@ -2165,17 +2185,17 @@ function Yn(t) {
|
|
|
2165
2185
|
return /* @__PURE__ */ n.jsx("ins", { className: "insert-node", children: t.children });
|
|
2166
2186
|
}
|
|
2167
2187
|
function qn(t) {
|
|
2168
|
-
var h, C, w,
|
|
2169
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a } = t,
|
|
2170
|
-
var L, M, I,
|
|
2171
|
-
const
|
|
2188
|
+
var h, C, w, x, S;
|
|
2189
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a } = t, u = t.showTooltip !== !1, c = (h = t.isDark) != null ? h : r == null ? void 0 : r.isDark, m = H(() => {
|
|
2190
|
+
var L, M, I, $, te, ue;
|
|
2191
|
+
const O = t.underlineBottom !== void 0 ? typeof t.underlineBottom == "number" ? `${t.underlineBottom}px` : String(t.underlineBottom) : "-3px";
|
|
2172
2192
|
return {
|
|
2173
2193
|
"--link-color": (L = t.color) != null ? L : "#0366d6",
|
|
2174
2194
|
"--underline-height": `${(M = t.underlineHeight) != null ? M : 2}px`,
|
|
2175
|
-
"--underline-bottom":
|
|
2195
|
+
"--underline-bottom": O,
|
|
2176
2196
|
"--underline-opacity": String((I = t.animationOpacity) != null ? I : 0.9),
|
|
2177
|
-
"--underline-duration": `${(
|
|
2178
|
-
"--underline-timing": (
|
|
2197
|
+
"--underline-duration": `${($ = t.animationDuration) != null ? $ : 0.8}s`,
|
|
2198
|
+
"--underline-timing": (te = t.animationTiming) != null ? te : "linear",
|
|
2179
2199
|
"--underline-iteration": typeof t.animationIteration == "number" ? String(t.animationIteration) : (ue = t.animationIteration) != null ? ue : "infinite"
|
|
2180
2200
|
};
|
|
2181
2201
|
}, [
|
|
@@ -2186,22 +2206,22 @@ function qn(t) {
|
|
|
2186
2206
|
t.color,
|
|
2187
2207
|
t.underlineBottom,
|
|
2188
2208
|
t.underlineHeight
|
|
2189
|
-
]), s = String((w = (C = e.title) != null ? C : e.href) != null ? w : ""), g = D((
|
|
2190
|
-
if (!
|
|
2209
|
+
]), s = String((w = (C = e.title) != null ? C : e.href) != null ? w : ""), g = D((O) => {
|
|
2210
|
+
if (!u)
|
|
2191
2211
|
return;
|
|
2192
|
-
const L =
|
|
2193
|
-
Ut(L, M, "top", !1, { x:
|
|
2194
|
-
}, [c, e.href, e.text, e.title,
|
|
2195
|
-
|
|
2196
|
-
}, [
|
|
2212
|
+
const L = O.currentTarget, M = String(e.title || e.href || e.text || "");
|
|
2213
|
+
Ut(L, M, "top", !1, { x: O.clientX, y: O.clientY }, c);
|
|
2214
|
+
}, [c, e.href, e.text, e.title, u]), f = D(() => {
|
|
2215
|
+
u && Oe();
|
|
2216
|
+
}, [u]);
|
|
2197
2217
|
return e.loading ? /* @__PURE__ */ n.jsx(
|
|
2198
2218
|
"span",
|
|
2199
2219
|
{
|
|
2200
2220
|
className: "link-loading inline-flex items-baseline gap-1.5",
|
|
2201
2221
|
"aria-hidden": "false",
|
|
2202
|
-
style:
|
|
2222
|
+
style: m,
|
|
2203
2223
|
children: /* @__PURE__ */ n.jsxs("span", { className: "link-text-wrapper relative inline-flex", children: [
|
|
2204
|
-
/* @__PURE__ */ n.jsx("span", { className: "leading-[normal] link-text", children: /* @__PURE__ */ n.jsx("span", { className: "leading-[normal] link-text", children: (
|
|
2224
|
+
/* @__PURE__ */ n.jsx("span", { className: "leading-[normal] link-text", children: /* @__PURE__ */ n.jsx("span", { className: "leading-[normal] link-text", children: (x = e.text) != null ? x : "" }) }),
|
|
2205
2225
|
/* @__PURE__ */ n.jsx("span", { className: "underline-anim", "aria-hidden": "true" })
|
|
2206
2226
|
] })
|
|
2207
2227
|
}
|
|
@@ -2210,33 +2230,33 @@ function qn(t) {
|
|
|
2210
2230
|
{
|
|
2211
2231
|
className: "link-node",
|
|
2212
2232
|
href: e.href,
|
|
2213
|
-
title:
|
|
2233
|
+
title: u ? "" : s,
|
|
2214
2234
|
"aria-label": `Link: ${s}`,
|
|
2215
2235
|
target: "_blank",
|
|
2216
2236
|
rel: "noopener noreferrer",
|
|
2217
|
-
style:
|
|
2237
|
+
style: m,
|
|
2218
2238
|
onMouseEnter: g,
|
|
2219
2239
|
onMouseLeave: f,
|
|
2220
|
-
children: r && o ?
|
|
2240
|
+
children: r && o ? qe(e.children, r, String(a != null ? a : "link"), o) : (S = e.text) != null ? S : null
|
|
2221
2241
|
}
|
|
2222
2242
|
);
|
|
2223
2243
|
}
|
|
2224
2244
|
function Ir(t) {
|
|
2225
|
-
const { node: e, ctx: r, renderNode: o, value: a, indexKey:
|
|
2226
|
-
return /* @__PURE__ */ n.jsx("li", { className: "list-item pl-1.5 my-2", dir: "auto", value:
|
|
2245
|
+
const { node: e, ctx: r, renderNode: o, value: a, indexKey: u, children: c } = t, m = a == null ? void 0 : a;
|
|
2246
|
+
return /* @__PURE__ */ n.jsx("li", { className: "list-item pl-1.5 my-2", dir: "auto", value: m, children: c != null ? c : r && o ? qe(e.children, r, String(u != null ? u : "list-item"), o) : null });
|
|
2227
2247
|
}
|
|
2228
2248
|
function Gn(t) {
|
|
2229
|
-
var
|
|
2230
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a } = t,
|
|
2249
|
+
var m;
|
|
2250
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a } = t, u = e.ordered ? "ol" : "ul", c = e.ordered && e.start ? e.start : void 0;
|
|
2231
2251
|
return /* @__PURE__ */ n.jsx(
|
|
2232
|
-
|
|
2252
|
+
u,
|
|
2233
2253
|
{
|
|
2234
|
-
className:
|
|
2254
|
+
className: Ee(
|
|
2235
2255
|
"list-node my-5 pl-[calc(13/8*1em)]",
|
|
2236
2256
|
e.ordered ? "list-decimal" : "list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]"
|
|
2237
2257
|
),
|
|
2238
2258
|
start: c,
|
|
2239
|
-
children: (
|
|
2259
|
+
children: (m = e.items) == null ? void 0 : m.map((s, g) => {
|
|
2240
2260
|
var f;
|
|
2241
2261
|
return /* @__PURE__ */ n.jsx(
|
|
2242
2262
|
Ir,
|
|
@@ -2253,8 +2273,8 @@ function Gn(t) {
|
|
|
2253
2273
|
}
|
|
2254
2274
|
);
|
|
2255
2275
|
}
|
|
2256
|
-
let at = null,
|
|
2257
|
-
const it = /* @__PURE__ */ new Map(),
|
|
2276
|
+
let at = null, kt = null, tr = !1;
|
|
2277
|
+
const it = /* @__PURE__ */ new Map(), wt = /* @__PURE__ */ new Map(), Ar = 200;
|
|
2258
2278
|
let Dt = 5;
|
|
2259
2279
|
const Et = /* @__PURE__ */ new Set();
|
|
2260
2280
|
function Tt() {
|
|
@@ -2268,23 +2288,23 @@ function Tt() {
|
|
|
2268
2288
|
}
|
|
2269
2289
|
}
|
|
2270
2290
|
}
|
|
2271
|
-
let
|
|
2291
|
+
let ht = null;
|
|
2272
2292
|
function oi(t) {
|
|
2273
|
-
at = t,
|
|
2274
|
-
const { id: r, html: o, error: a } = e.data,
|
|
2275
|
-
if (
|
|
2276
|
-
if (it.delete(r), clearTimeout(
|
|
2277
|
-
|
|
2293
|
+
at = t, kt = null, at.onmessage = (e) => {
|
|
2294
|
+
const { id: r, html: o, error: a } = e.data, u = it.get(r);
|
|
2295
|
+
if (u)
|
|
2296
|
+
if (it.delete(r), clearTimeout(u.timeoutId), Tt(), a)
|
|
2297
|
+
u.reject(new Error(a));
|
|
2278
2298
|
else {
|
|
2279
|
-
const { content: c, displayMode:
|
|
2299
|
+
const { content: c, displayMode: m } = e.data;
|
|
2280
2300
|
if (c) {
|
|
2281
|
-
const s = `${
|
|
2282
|
-
if (
|
|
2283
|
-
const g =
|
|
2284
|
-
|
|
2301
|
+
const s = `${m ? "d" : "i"}:${c}`;
|
|
2302
|
+
if (wt.set(s, o), wt.size > Ar) {
|
|
2303
|
+
const g = wt.keys().next().value;
|
|
2304
|
+
wt.delete(g);
|
|
2285
2305
|
}
|
|
2286
2306
|
}
|
|
2287
|
-
|
|
2307
|
+
u.resolve(o);
|
|
2288
2308
|
}
|
|
2289
2309
|
}, at.onerror = (e) => {
|
|
2290
2310
|
console.error("[katexWorkerClient] Worker error:", e);
|
|
@@ -2295,10 +2315,10 @@ function oi(t) {
|
|
|
2295
2315
|
}
|
|
2296
2316
|
function ii() {
|
|
2297
2317
|
var t;
|
|
2298
|
-
at && ((t = at.terminate) == null || t.call(at)), at = null,
|
|
2318
|
+
at && ((t = at.terminate) == null || t.call(at)), at = null, kt = null;
|
|
2299
2319
|
}
|
|
2300
2320
|
function Jn() {
|
|
2301
|
-
return at || (
|
|
2321
|
+
return at || (kt = new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."), kt.name = "WORKER_INIT_ERROR", kt.code = "WORKER_INIT_ERROR", null);
|
|
2302
2322
|
}
|
|
2303
2323
|
function ai(t) {
|
|
2304
2324
|
tr = !!t, at && at.postMessage({ type: "init", debug: tr });
|
|
@@ -2306,23 +2326,23 @@ function ai(t) {
|
|
|
2306
2326
|
const Kt = "WORKER_BUSY";
|
|
2307
2327
|
async function Zn(t, e = !0, r = 2e3, o) {
|
|
2308
2328
|
const a = performance.now();
|
|
2309
|
-
if (
|
|
2310
|
-
return Promise.reject(
|
|
2311
|
-
const
|
|
2329
|
+
if (kt)
|
|
2330
|
+
return Promise.reject(kt);
|
|
2331
|
+
const u = `${e ? "d" : "i"}:${t}`, c = wt.get(u);
|
|
2312
2332
|
if (c)
|
|
2313
|
-
return
|
|
2333
|
+
return ht && ht.recordRender({
|
|
2314
2334
|
type: "cache-hit",
|
|
2315
2335
|
duration: performance.now() - a,
|
|
2316
2336
|
formulaLength: t.length,
|
|
2317
2337
|
timestamp: Date.now(),
|
|
2318
2338
|
success: !0
|
|
2319
2339
|
}), Promise.resolve(c);
|
|
2320
|
-
const
|
|
2321
|
-
if (!
|
|
2322
|
-
return Promise.reject(
|
|
2340
|
+
const m = Jn();
|
|
2341
|
+
if (!m)
|
|
2342
|
+
return Promise.reject(kt);
|
|
2323
2343
|
if (it.size >= Dt) {
|
|
2324
2344
|
const s = new Error("Worker busy");
|
|
2325
|
-
return s.name = "WorkerBusy", s.code = Kt, s.busy = !0, s.inFlight = it.size, s.max = Dt,
|
|
2345
|
+
return s.name = "WorkerBusy", s.code = Kt, s.busy = !0, s.inFlight = it.size, s.max = Dt, ht && ht.recordRender({
|
|
2326
2346
|
type: "worker",
|
|
2327
2347
|
duration: performance.now() - a,
|
|
2328
2348
|
formulaLength: t.length,
|
|
@@ -2333,65 +2353,65 @@ async function Zn(t, e = !0, r = 2e3, o) {
|
|
|
2333
2353
|
}
|
|
2334
2354
|
return new Promise((s, g) => {
|
|
2335
2355
|
if (o != null && o.aborted) {
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2356
|
+
const x = new Error("Aborted");
|
|
2357
|
+
x.name = "AbortError", g(x);
|
|
2338
2358
|
return;
|
|
2339
2359
|
}
|
|
2340
2360
|
const f = Math.random().toString(36).slice(2), h = setTimeout(() => {
|
|
2341
2361
|
it.delete(f);
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2362
|
+
const x = new Error("Worker render timed out");
|
|
2363
|
+
x.name = "WorkerTimeout", x.code = "WORKER_TIMEOUT", ht && ht.recordRender({
|
|
2344
2364
|
type: "worker",
|
|
2345
2365
|
duration: performance.now() - a,
|
|
2346
2366
|
formulaLength: t.length,
|
|
2347
2367
|
timestamp: Date.now(),
|
|
2348
2368
|
success: !1,
|
|
2349
2369
|
error: "timeout"
|
|
2350
|
-
}), g(
|
|
2370
|
+
}), g(x), Tt();
|
|
2351
2371
|
}, r), C = () => {
|
|
2352
2372
|
}, w = () => {
|
|
2353
2373
|
it.delete(f), clearTimeout(h), Et.delete(C);
|
|
2354
|
-
const
|
|
2355
|
-
|
|
2374
|
+
const x = new Error("Aborted");
|
|
2375
|
+
x.name = "AbortError", g(x), Tt();
|
|
2356
2376
|
};
|
|
2357
2377
|
o && o.addEventListener("abort", w, { once: !0 }), it.set(f, {
|
|
2358
|
-
resolve: (
|
|
2359
|
-
o && o.removeEventListener("abort", w),
|
|
2378
|
+
resolve: (x) => {
|
|
2379
|
+
o && o.removeEventListener("abort", w), ht && ht.recordRender({
|
|
2360
2380
|
type: "worker",
|
|
2361
2381
|
duration: performance.now() - a,
|
|
2362
2382
|
formulaLength: t.length,
|
|
2363
2383
|
timestamp: Date.now(),
|
|
2364
2384
|
success: !0
|
|
2365
|
-
}), s(
|
|
2385
|
+
}), s(x);
|
|
2366
2386
|
},
|
|
2367
|
-
reject: (
|
|
2368
|
-
o && o.removeEventListener("abort", w),
|
|
2387
|
+
reject: (x) => {
|
|
2388
|
+
o && o.removeEventListener("abort", w), ht && ht.recordRender({
|
|
2369
2389
|
type: "worker",
|
|
2370
2390
|
duration: performance.now() - a,
|
|
2371
2391
|
formulaLength: t.length,
|
|
2372
2392
|
timestamp: Date.now(),
|
|
2373
2393
|
success: !1,
|
|
2374
|
-
error: (
|
|
2375
|
-
}), g(
|
|
2394
|
+
error: (x == null ? void 0 : x.code) || (x == null ? void 0 : x.message)
|
|
2395
|
+
}), g(x);
|
|
2376
2396
|
},
|
|
2377
2397
|
timeoutId: h
|
|
2378
2398
|
});
|
|
2379
2399
|
try {
|
|
2380
|
-
|
|
2381
|
-
} catch (
|
|
2382
|
-
it.delete(f), clearTimeout(h), o && o.removeEventListener("abort", w), g(
|
|
2400
|
+
m.postMessage({ id: f, content: t, displayMode: e, debug: tr });
|
|
2401
|
+
} catch (x) {
|
|
2402
|
+
it.delete(f), clearTimeout(h), o && o.removeEventListener("abort", w), g(x), Tt();
|
|
2383
2403
|
}
|
|
2384
2404
|
});
|
|
2385
2405
|
}
|
|
2386
2406
|
function Or(t, e, r) {
|
|
2387
2407
|
const o = `${e ? "d" : "i"}:${t}`;
|
|
2388
|
-
if (
|
|
2389
|
-
const a =
|
|
2390
|
-
|
|
2408
|
+
if (wt.set(o, r), wt.size > Ar) {
|
|
2409
|
+
const a = wt.keys().next().value;
|
|
2410
|
+
wt.delete(a);
|
|
2391
2411
|
}
|
|
2392
2412
|
}
|
|
2393
2413
|
function si() {
|
|
2394
|
-
|
|
2414
|
+
wt.clear();
|
|
2395
2415
|
}
|
|
2396
2416
|
function ci(t) {
|
|
2397
2417
|
Dt = Math.max(1, Math.floor(t)), Tt();
|
|
@@ -2404,54 +2424,54 @@ function Qn(t = 1500, e) {
|
|
|
2404
2424
|
return;
|
|
2405
2425
|
}
|
|
2406
2426
|
let a = null;
|
|
2407
|
-
function
|
|
2408
|
-
Et.delete(c), a != null && clearTimeout(a), e && e.removeEventListener("abort",
|
|
2427
|
+
function u() {
|
|
2428
|
+
Et.delete(c), a != null && clearTimeout(a), e && e.removeEventListener("abort", m);
|
|
2409
2429
|
}
|
|
2410
2430
|
function c() {
|
|
2411
|
-
|
|
2431
|
+
u(), r();
|
|
2412
2432
|
}
|
|
2413
|
-
function
|
|
2414
|
-
|
|
2433
|
+
function m() {
|
|
2434
|
+
u();
|
|
2415
2435
|
const s = new Error("Aborted");
|
|
2416
2436
|
s.name = "AbortError", o(s);
|
|
2417
2437
|
}
|
|
2418
2438
|
a = t > 0 ? setTimeout(() => {
|
|
2419
|
-
|
|
2420
|
-
}, t) : null, e && e.addEventListener("abort",
|
|
2439
|
+
u(), o(new Error("Timeout waiting for worker slot"));
|
|
2440
|
+
}, t) : null, e && e.addEventListener("abort", m, { once: !0 }), Et.add(c);
|
|
2421
2441
|
});
|
|
2422
2442
|
}
|
|
2423
|
-
const
|
|
2443
|
+
const xt = {
|
|
2424
2444
|
timeout: 2e3,
|
|
2425
2445
|
waitTimeout: 1500,
|
|
2426
2446
|
backoffMs: 30,
|
|
2427
2447
|
maxRetries: 1
|
|
2428
2448
|
};
|
|
2429
2449
|
function li(t) {
|
|
2430
|
-
t.timeout != null && (
|
|
2450
|
+
t.timeout != null && (xt.timeout = Math.max(0, Math.floor(t.timeout))), t.waitTimeout != null && (xt.waitTimeout = Math.max(0, Math.floor(t.waitTimeout))), t.backoffMs != null && (xt.backoffMs = Math.max(0, Math.floor(t.backoffMs))), t.maxRetries != null && (xt.maxRetries = Math.max(0, Math.floor(t.maxRetries)));
|
|
2431
2451
|
}
|
|
2432
2452
|
function ui() {
|
|
2433
|
-
return { ...
|
|
2453
|
+
return { ...xt };
|
|
2434
2454
|
}
|
|
2435
2455
|
async function $r(t, e = !0, r = {}) {
|
|
2436
2456
|
var g, f, h, C;
|
|
2437
|
-
const o = (g = r.timeout) != null ? g :
|
|
2457
|
+
const o = (g = r.timeout) != null ? g : xt.timeout, a = (f = r.waitTimeout) != null ? f : xt.waitTimeout, u = (h = r.backoffMs) != null ? h : xt.backoffMs, c = (C = r.maxRetries) != null ? C : xt.maxRetries, m = r.signal;
|
|
2438
2458
|
let s = 0;
|
|
2439
2459
|
for (; ; ) {
|
|
2440
|
-
if (
|
|
2460
|
+
if (m != null && m.aborted) {
|
|
2441
2461
|
const w = new Error("Aborted");
|
|
2442
2462
|
throw w.name = "AbortError", w;
|
|
2443
2463
|
}
|
|
2444
2464
|
try {
|
|
2445
|
-
return await Zn(t, e, o,
|
|
2465
|
+
return await Zn(t, e, o, m);
|
|
2446
2466
|
} catch (w) {
|
|
2447
2467
|
if ((w == null ? void 0 : w.code) !== Kt || s >= c)
|
|
2448
2468
|
throw w;
|
|
2449
|
-
if (s++, await Qn(a,
|
|
2450
|
-
}),
|
|
2451
|
-
const
|
|
2452
|
-
throw
|
|
2469
|
+
if (s++, await Qn(a, m).catch(() => {
|
|
2470
|
+
}), m != null && m.aborted) {
|
|
2471
|
+
const x = new Error("Aborted");
|
|
2472
|
+
throw x.name = "AbortError", x;
|
|
2453
2473
|
}
|
|
2454
|
-
|
|
2474
|
+
u > 0 && await new Promise((x) => setTimeout(x, u * s));
|
|
2455
2475
|
}
|
|
2456
2476
|
}
|
|
2457
2477
|
}
|
|
@@ -2468,75 +2488,75 @@ async function Fr() {
|
|
|
2468
2488
|
}
|
|
2469
2489
|
}
|
|
2470
2490
|
function eo({ node: t }) {
|
|
2471
|
-
const e =
|
|
2472
|
-
return
|
|
2491
|
+
const e = R(null), [r, o] = P(!0), a = R(0);
|
|
2492
|
+
return W(() => {
|
|
2473
2493
|
var g;
|
|
2474
|
-
let
|
|
2475
|
-
const c = new AbortController(),
|
|
2494
|
+
let u = !1;
|
|
2495
|
+
const c = new AbortController(), m = ++a.current, s = (g = t.content) != null ? g : "";
|
|
2476
2496
|
return s ? ($r(s, !0, {
|
|
2477
2497
|
timeout: 3e3,
|
|
2478
2498
|
waitTimeout: 2e3,
|
|
2479
2499
|
maxRetries: 1,
|
|
2480
2500
|
signal: c.signal
|
|
2481
2501
|
}).then((f) => {
|
|
2482
|
-
|
|
2502
|
+
u || m !== a.current || (e.current && (e.current.innerHTML = f), o(!1));
|
|
2483
2503
|
}).catch(async (f) => {
|
|
2484
|
-
if (
|
|
2504
|
+
if (u || m !== a.current || !e.current)
|
|
2485
2505
|
return;
|
|
2486
2506
|
const h = (f == null ? void 0 : f.code) || (f == null ? void 0 : f.name);
|
|
2487
2507
|
if (h === "WORKER_INIT_ERROR" || (f == null ? void 0 : f.fallbackToRenderer) || (h === Kt || h === "WORKER_TIMEOUT")) {
|
|
2488
|
-
const
|
|
2489
|
-
if (
|
|
2508
|
+
const x = await Fr();
|
|
2509
|
+
if (x)
|
|
2490
2510
|
try {
|
|
2491
|
-
const
|
|
2511
|
+
const S = x.renderToString(s, {
|
|
2492
2512
|
throwOnError: t.loading,
|
|
2493
2513
|
displayMode: !0
|
|
2494
2514
|
});
|
|
2495
|
-
!
|
|
2515
|
+
!u && m === a.current && e.current && (e.current.innerHTML = S, o(!1), Or(s, !0, S));
|
|
2496
2516
|
return;
|
|
2497
2517
|
} catch {
|
|
2498
2518
|
}
|
|
2499
2519
|
}
|
|
2500
2520
|
t.loading || (e.current.textContent = t.raw, o(!1));
|
|
2501
2521
|
}), () => {
|
|
2502
|
-
|
|
2522
|
+
u = !0, c.abort();
|
|
2503
2523
|
}) : (o(!1), () => c.abort());
|
|
2504
2524
|
}, [t.content, t.loading, t.raw]), /* @__PURE__ */ n.jsx("div", { className: "math-block text-center overflow-x-auto relative min-h-[40px]", children: /* @__PURE__ */ n.jsx("div", { ref: e, className: r ? "math-rendering" : void 0 }) });
|
|
2505
2525
|
}
|
|
2506
2526
|
function to({ node: t }) {
|
|
2507
|
-
const e =
|
|
2508
|
-
return
|
|
2527
|
+
const e = R(null), r = R(null), [o, a] = P(!0), u = R(0);
|
|
2528
|
+
return W(() => {
|
|
2509
2529
|
var f;
|
|
2510
2530
|
let c = !1;
|
|
2511
|
-
const
|
|
2531
|
+
const m = new AbortController(), s = ++u.current, g = (f = t.content) != null ? f : "";
|
|
2512
2532
|
return g ? ($r(g, !1, {
|
|
2513
2533
|
timeout: 1500,
|
|
2514
2534
|
waitTimeout: 0,
|
|
2515
2535
|
maxRetries: 0,
|
|
2516
|
-
signal:
|
|
2536
|
+
signal: m.signal
|
|
2517
2537
|
}).then((h) => {
|
|
2518
|
-
c || s !==
|
|
2538
|
+
c || s !== u.current || r.current && (r.current.innerHTML = h, a(!1));
|
|
2519
2539
|
}).catch(async (h) => {
|
|
2520
|
-
if (c || s !==
|
|
2540
|
+
if (c || s !== u.current || !r.current)
|
|
2521
2541
|
return;
|
|
2522
2542
|
const C = (h == null ? void 0 : h.code) || (h == null ? void 0 : h.name);
|
|
2523
2543
|
if (C === "WORKER_INIT_ERROR" || (h == null ? void 0 : h.fallbackToRenderer) || (C === Kt || C === "WORKER_TIMEOUT")) {
|
|
2524
|
-
const
|
|
2525
|
-
if (
|
|
2544
|
+
const S = await Fr();
|
|
2545
|
+
if (S)
|
|
2526
2546
|
try {
|
|
2527
|
-
const
|
|
2547
|
+
const O = S.renderToString(g, {
|
|
2528
2548
|
throwOnError: t.loading,
|
|
2529
2549
|
displayMode: !1
|
|
2530
2550
|
});
|
|
2531
|
-
!c && s ===
|
|
2551
|
+
!c && s === u.current && r.current && (r.current.innerHTML = O, a(!1), Or(g, !1, O));
|
|
2532
2552
|
return;
|
|
2533
2553
|
} catch {
|
|
2534
2554
|
}
|
|
2535
2555
|
}
|
|
2536
2556
|
t.loading || (r.current.textContent = t.raw, a(!1));
|
|
2537
2557
|
}), () => {
|
|
2538
|
-
c = !0,
|
|
2539
|
-
}) : (a(!1), () =>
|
|
2558
|
+
c = !0, m.abort();
|
|
2559
|
+
}) : (a(!1), () => m.abort());
|
|
2540
2560
|
}, [t.content, t.loading, t.raw]), /* @__PURE__ */ n.jsxs("span", { ref: e, className: "math-inline-wrapper", children: [
|
|
2541
2561
|
/* @__PURE__ */ n.jsx("span", { ref: r, className: `math-inline${o ? " math-inline--hidden" : ""}` }),
|
|
2542
2562
|
o && /* @__PURE__ */ n.jsxs("span", { className: "math-inline__loading", role: "status", "aria-live": "polite", children: [
|
|
@@ -2553,7 +2573,7 @@ function ro(t) {
|
|
|
2553
2573
|
}
|
|
2554
2574
|
return globalThis.setTimeout(t, 0);
|
|
2555
2575
|
}
|
|
2556
|
-
let Pe = null,
|
|
2576
|
+
let Pe = null, yt = null;
|
|
2557
2577
|
const Ve = /* @__PURE__ */ new Map(), no = 5;
|
|
2558
2578
|
let zt = no, rr = !1;
|
|
2559
2579
|
function di(t) {
|
|
@@ -2567,13 +2587,13 @@ function fi() {
|
|
|
2567
2587
|
}
|
|
2568
2588
|
const oo = "WORKER_BUSY";
|
|
2569
2589
|
function hi(t) {
|
|
2570
|
-
Pe = t,
|
|
2590
|
+
Pe = t, yt = null;
|
|
2571
2591
|
const e = t;
|
|
2572
2592
|
Pe.onmessage = (r) => {
|
|
2573
2593
|
if (Pe !== e)
|
|
2574
2594
|
return;
|
|
2575
|
-
const { id: o, ok: a, result:
|
|
2576
|
-
|
|
2595
|
+
const { id: o, ok: a, result: u, error: c } = r.data, m = Ve.get(o);
|
|
2596
|
+
m && (a === !1 || c ? m.reject(new Error(c || "Unknown error")) : m.resolve(u));
|
|
2577
2597
|
}, Pe.onerror = (r) => {
|
|
2578
2598
|
var o, a;
|
|
2579
2599
|
if (Pe === e) {
|
|
@@ -2585,7 +2605,7 @@ function hi(t) {
|
|
|
2585
2605
|
rr ? console.error("[mermaidWorkerClient] Worker error:", (r == null ? void 0 : r.message) || r) : (a = console.debug) == null || a.call(console, "[mermaidWorkerClient] Worker error:", (r == null ? void 0 : r.message) || r);
|
|
2586
2606
|
} catch {
|
|
2587
2607
|
}
|
|
2588
|
-
for (const [
|
|
2608
|
+
for (const [u, c] of Ve.entries())
|
|
2589
2609
|
c.reject(new Error(`Worker error: ${r.message}`));
|
|
2590
2610
|
Ve.clear();
|
|
2591
2611
|
}
|
|
@@ -2600,7 +2620,7 @@ function hi(t) {
|
|
|
2600
2620
|
rr ? console.error("[mermaidWorkerClient] Worker messageerror:", r) : (a = console.debug) == null || a.call(console, "[mermaidWorkerClient] Worker messageerror:", r);
|
|
2601
2621
|
} catch {
|
|
2602
2622
|
}
|
|
2603
|
-
for (const [
|
|
2623
|
+
for (const [u, c] of Ve.entries())
|
|
2604
2624
|
c.reject(new Error("Worker messageerror"));
|
|
2605
2625
|
Ve.clear();
|
|
2606
2626
|
}
|
|
@@ -2615,39 +2635,39 @@ function gi() {
|
|
|
2615
2635
|
Ve.clear(), (t = Pe.terminate) == null || t.call(Pe);
|
|
2616
2636
|
} catch {
|
|
2617
2637
|
}
|
|
2618
|
-
Pe = null,
|
|
2638
|
+
Pe = null, yt = null;
|
|
2619
2639
|
}
|
|
2620
2640
|
function io() {
|
|
2621
|
-
return Pe || (
|
|
2641
|
+
return Pe || (yt = new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."), yt.name = "WORKER_INIT_ERROR", yt.code = "WORKER_INIT_ERROR", null);
|
|
2622
2642
|
}
|
|
2623
2643
|
function Wr(t, e, r = 1400) {
|
|
2624
|
-
if (
|
|
2625
|
-
return Promise.reject(
|
|
2644
|
+
if (yt)
|
|
2645
|
+
return Promise.reject(yt);
|
|
2626
2646
|
const o = io();
|
|
2627
2647
|
if (!o)
|
|
2628
|
-
return Promise.reject(
|
|
2648
|
+
return Promise.reject(yt);
|
|
2629
2649
|
if (Ve.size >= zt) {
|
|
2630
2650
|
const a = new Error("Worker busy");
|
|
2631
2651
|
return a.name = "WorkerBusy", a.code = oo, a.inFlight = Ve.size, a.max = zt, Promise.reject(a);
|
|
2632
2652
|
}
|
|
2633
|
-
return new Promise((a,
|
|
2653
|
+
return new Promise((a, u) => {
|
|
2634
2654
|
const c = Math.random().toString(36).slice(2);
|
|
2635
|
-
let
|
|
2655
|
+
let m = !1, s = null;
|
|
2636
2656
|
const g = () => {
|
|
2637
|
-
|
|
2657
|
+
m || (m = !0, s != null && clearTimeout(s), Ve.delete(c));
|
|
2638
2658
|
}, f = {
|
|
2639
2659
|
resolve: (h) => {
|
|
2640
2660
|
g(), a(h);
|
|
2641
2661
|
},
|
|
2642
2662
|
reject: (h) => {
|
|
2643
|
-
g(),
|
|
2663
|
+
g(), u(h);
|
|
2644
2664
|
}
|
|
2645
2665
|
};
|
|
2646
2666
|
Ve.set(c, f);
|
|
2647
2667
|
try {
|
|
2648
2668
|
o.postMessage({ id: c, action: t, payload: e });
|
|
2649
2669
|
} catch (h) {
|
|
2650
|
-
Ve.delete(c),
|
|
2670
|
+
Ve.delete(c), u(h);
|
|
2651
2671
|
return;
|
|
2652
2672
|
}
|
|
2653
2673
|
s = setTimeout(() => {
|
|
@@ -2666,9 +2686,9 @@ async function so(t, e, r = 2400) {
|
|
|
2666
2686
|
}
|
|
2667
2687
|
function co() {
|
|
2668
2688
|
var t;
|
|
2669
|
-
(t = Pe == null ? void 0 : Pe.terminate) == null || t.call(Pe), Pe = null,
|
|
2689
|
+
(t = Pe == null ? void 0 : Pe.terminate) == null || t.call(Pe), Pe = null, yt = null, Ve.clear();
|
|
2670
2690
|
}
|
|
2671
|
-
let
|
|
2691
|
+
let gt = null, br = !1, kr = null, _t = null;
|
|
2672
2692
|
function lo(t) {
|
|
2673
2693
|
var o, a;
|
|
2674
2694
|
const e = String((o = t == null ? void 0 : t.securityLevel) != null ? o : "loose"), r = (a = t == null ? void 0 : t.flowchart) == null ? void 0 : a.htmlLabels;
|
|
@@ -2686,8 +2706,8 @@ function $t(t, e) {
|
|
|
2686
2706
|
}
|
|
2687
2707
|
}
|
|
2688
2708
|
async function uo(t) {
|
|
2689
|
-
if (
|
|
2690
|
-
return $t(
|
|
2709
|
+
if (gt)
|
|
2710
|
+
return $t(gt, t), gt;
|
|
2691
2711
|
if (_t) {
|
|
2692
2712
|
const e = await _t;
|
|
2693
2713
|
return e && $t(e, t), e;
|
|
@@ -2698,9 +2718,9 @@ async function uo(t) {
|
|
|
2698
2718
|
br = !0, _t = (async () => {
|
|
2699
2719
|
try {
|
|
2700
2720
|
const r = await import("mermaid"), o = (r == null ? void 0 : r.default) || r;
|
|
2701
|
-
if (o != null && o.default ?
|
|
2721
|
+
if (o != null && o.default ? gt = o.default : o != null && o.mermaidAPI ? gt = o : o != null && o.mermaid ? gt = o.mermaid : gt = o, !gt)
|
|
2702
2722
|
throw new Error("Mermaid module did not export expected API");
|
|
2703
|
-
return $t(
|
|
2723
|
+
return $t(gt, t != null ? t : { startOnLoad: !1, securityLevel: "loose" }), gt;
|
|
2704
2724
|
} catch (r) {
|
|
2705
2725
|
return console.warn("[markstream-react] Failed to load mermaid:", r), null;
|
|
2706
2726
|
} finally {
|
|
@@ -2713,7 +2733,7 @@ async function uo(t) {
|
|
|
2713
2733
|
return null;
|
|
2714
2734
|
}
|
|
2715
2735
|
}
|
|
2716
|
-
const mo = typeof window != "undefined" ? Yr :
|
|
2736
|
+
const mo = typeof window != "undefined" ? Yr : W, fo = {
|
|
2717
2737
|
USE_PROFILES: { svg: !0 },
|
|
2718
2738
|
FORBID_TAGS: ["script"],
|
|
2719
2739
|
FORBID_ATTR: [/^on/i],
|
|
@@ -2739,26 +2759,26 @@ function vo(t) {
|
|
|
2739
2759
|
continue;
|
|
2740
2760
|
}
|
|
2741
2761
|
const a = Array.from(o.attributes);
|
|
2742
|
-
for (const
|
|
2743
|
-
const c =
|
|
2762
|
+
for (const u of a) {
|
|
2763
|
+
const c = u.name;
|
|
2744
2764
|
if (/^on/i.test(c)) {
|
|
2745
2765
|
o.removeAttribute(c);
|
|
2746
2766
|
continue;
|
|
2747
2767
|
}
|
|
2748
|
-
if (c === "style" &&
|
|
2749
|
-
const
|
|
2750
|
-
if (go.some((s) => s.test(
|
|
2768
|
+
if (c === "style" && u.value) {
|
|
2769
|
+
const m = u.value;
|
|
2770
|
+
if (go.some((s) => s.test(m))) {
|
|
2751
2771
|
o.removeAttribute(c);
|
|
2752
2772
|
continue;
|
|
2753
2773
|
}
|
|
2754
2774
|
}
|
|
2755
|
-
if ((c === "href" || c === "xlink:href") &&
|
|
2756
|
-
const
|
|
2757
|
-
if (!
|
|
2775
|
+
if ((c === "href" || c === "xlink:href") && u.value) {
|
|
2776
|
+
const m = wo(u.value);
|
|
2777
|
+
if (!m) {
|
|
2758
2778
|
o.removeAttribute(c);
|
|
2759
2779
|
continue;
|
|
2760
2780
|
}
|
|
2761
|
-
|
|
2781
|
+
m !== u.value && o.setAttribute(c, m);
|
|
2762
2782
|
}
|
|
2763
2783
|
}
|
|
2764
2784
|
}
|
|
@@ -2818,13 +2838,13 @@ const Lt = {
|
|
|
2818
2838
|
isStrict: !1
|
|
2819
2839
|
};
|
|
2820
2840
|
function Hr(t) {
|
|
2821
|
-
var
|
|
2822
|
-
const e = { ...Lt, ...t }, { t: r } = lr(), o =
|
|
2841
|
+
var Te, he, J, Ze, ft, nt, d, E, B;
|
|
2842
|
+
const e = { ...Lt, ...t }, { t: r } = lr(), o = H(() => ur("mermaid"), []), a = (he = (Te = e.node) == null ? void 0 : Te.code) != null ? he : "", u = H(() => a.replace(/\]::([^:])/g, "]:::$1").replace(/:::subgraphNode$/gm, "::subgraphNode"), [a]), c = (J = e.workerTimeoutMs) != null ? J : Lt.workerTimeoutMs, m = (Ze = e.parseTimeoutMs) != null ? Ze : Lt.parseTimeoutMs, s = (ft = e.renderTimeoutMs) != null ? ft : Lt.renderTimeoutMs, g = (nt = e.fullRenderTimeoutMs) != null ? nt : Lt.fullRenderTimeoutMs, [f, h] = P(!1), [C, w] = P(!1), [x, S] = P(!1), [O, L] = P(!1), [M, I] = P(1), [$, te] = P({ x: 0, y: 0 }), [ue, ie] = P(!1), [de, ce] = P(!1), [Se, V] = P(!1), [re, we] = P(null), [q, ye] = P(!1), [$e, oe] = P(() => e.maxHeight == null ? "360px" : e.maxHeight), [Ne, X] = P(typeof window == "undefined"), ne = R(null), ve = R(null), Fe = R(null), ae = R(null), st = R(null), Je = R(null), We = R(null), y = R({ x: 0, y: 0 }), De = R(0), be = R({}), _e = R(""), He = R(!1), ut = R(null), xe = R(!1), vt = R({
|
|
2823
2843
|
zoom: 1,
|
|
2824
2844
|
translateX: 0,
|
|
2825
2845
|
translateY: 0,
|
|
2826
|
-
containerHeight:
|
|
2827
|
-
}),
|
|
2846
|
+
containerHeight: $e || "360px"
|
|
2847
|
+
}), fe = It(), Xe = !!((E = (d = e.node) == null ? void 0 : d.loading) != null ? E : e.loading), Le = e.isDark ? "dark" : "light", Ie = !!e.isStrict, U = H(() => Ie ? {
|
|
2828
2848
|
startOnLoad: !1,
|
|
2829
2849
|
securityLevel: "strict",
|
|
2830
2850
|
dompurifyConfig: fo,
|
|
@@ -2832,284 +2852,284 @@ function Hr(t) {
|
|
|
2832
2852
|
} : {
|
|
2833
2853
|
startOnLoad: !1,
|
|
2834
2854
|
securityLevel: "loose"
|
|
2835
|
-
}, [
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
}, [Se]),
|
|
2855
|
+
}, [Ie]);
|
|
2856
|
+
W(() => {
|
|
2857
|
+
xe.current = Se;
|
|
2858
|
+
}, [Se]), W(() => {
|
|
2839
2859
|
be.current = {};
|
|
2840
|
-
}, [
|
|
2841
|
-
let
|
|
2860
|
+
}, [Le, u, Ie]), W(() => {
|
|
2861
|
+
let l = !1;
|
|
2842
2862
|
return (async () => {
|
|
2843
|
-
const v = await uo(
|
|
2844
|
-
|
|
2863
|
+
const v = await uo(U);
|
|
2864
|
+
l || (ne.current = v, h(!!v), He.current || w(!v));
|
|
2845
2865
|
})(), () => {
|
|
2846
|
-
|
|
2866
|
+
l = !0;
|
|
2847
2867
|
};
|
|
2848
|
-
}, [
|
|
2849
|
-
const
|
|
2850
|
-
if (!
|
|
2868
|
+
}, [U]), W(() => {
|
|
2869
|
+
const l = ve.current;
|
|
2870
|
+
if (!l)
|
|
2851
2871
|
return;
|
|
2852
|
-
const v =
|
|
2853
|
-
return
|
|
2854
|
-
v.destroy(),
|
|
2872
|
+
const v = fe(l, { rootMargin: "400px" });
|
|
2873
|
+
return ut.current = v, v.isVisible() && X(!0), v.whenVisible.then(() => X(!0)), () => {
|
|
2874
|
+
v.destroy(), ut.current = null;
|
|
2855
2875
|
};
|
|
2856
|
-
}, [
|
|
2857
|
-
if (typeof document == "undefined" || !
|
|
2876
|
+
}, [fe]), W(() => {
|
|
2877
|
+
if (typeof document == "undefined" || !q)
|
|
2858
2878
|
return;
|
|
2859
|
-
const
|
|
2879
|
+
const l = document.body.style.overflow;
|
|
2860
2880
|
return document.body.style.overflow = "hidden", () => {
|
|
2861
|
-
document.body.style.overflow =
|
|
2881
|
+
document.body.style.overflow = l;
|
|
2862
2882
|
};
|
|
2863
|
-
}, [
|
|
2864
|
-
const
|
|
2865
|
-
const v =
|
|
2866
|
-
if (!v || !
|
|
2883
|
+
}, [q]);
|
|
2884
|
+
const Ue = D((l) => {
|
|
2885
|
+
const v = ve.current, F = ae.current;
|
|
2886
|
+
if (!v || !F)
|
|
2867
2887
|
return;
|
|
2868
|
-
const
|
|
2869
|
-
if (!
|
|
2888
|
+
const A = F.querySelector("svg");
|
|
2889
|
+
if (!A)
|
|
2870
2890
|
return;
|
|
2871
|
-
let
|
|
2872
|
-
const
|
|
2873
|
-
if (
|
|
2874
|
-
const
|
|
2875
|
-
|
|
2891
|
+
let T = 0, Y = 0;
|
|
2892
|
+
const me = A.getAttribute("viewBox");
|
|
2893
|
+
if (me) {
|
|
2894
|
+
const _ = me.split(" ");
|
|
2895
|
+
_.length === 4 && (T = Number.parseFloat(_[2]), Y = Number.parseFloat(_[3]));
|
|
2876
2896
|
}
|
|
2877
|
-
if ((!
|
|
2897
|
+
if ((!T || !Y) && A.hasAttribute("width") && A.hasAttribute("height") && (T = Number.parseFloat(A.getAttribute("width") || "0"), Y = Number.parseFloat(A.getAttribute("height") || "0")), !T || !Y || Number.isNaN(T) || Number.isNaN(Y))
|
|
2878
2898
|
try {
|
|
2879
|
-
const
|
|
2880
|
-
|
|
2899
|
+
const _ = A.getBBox();
|
|
2900
|
+
T = _.width, Y = _.height;
|
|
2881
2901
|
} catch {
|
|
2882
2902
|
return;
|
|
2883
2903
|
}
|
|
2884
|
-
if (!(
|
|
2904
|
+
if (!(T > 0 && Y > 0))
|
|
2885
2905
|
return;
|
|
2886
|
-
const
|
|
2887
|
-
|
|
2906
|
+
const ge = l != null ? l : v.clientWidth, i = Y / T, p = ge * i, k = Number.isFinite(p) && p > 0 ? p : Y;
|
|
2907
|
+
oe(`${Math.min(k, Y)}px`);
|
|
2888
2908
|
}, []);
|
|
2889
|
-
|
|
2890
|
-
if (!
|
|
2909
|
+
W(() => {
|
|
2910
|
+
if (!ve.current || typeof ResizeObserver == "undefined")
|
|
2891
2911
|
return;
|
|
2892
|
-
const
|
|
2912
|
+
const l = new ResizeObserver((v) => {
|
|
2893
2913
|
if (!v.length)
|
|
2894
2914
|
return;
|
|
2895
|
-
const
|
|
2896
|
-
ro(() =>
|
|
2915
|
+
const F = v[0].contentRect.width;
|
|
2916
|
+
ro(() => Ue(F));
|
|
2897
2917
|
});
|
|
2898
|
-
return
|
|
2899
|
-
}, [
|
|
2918
|
+
return l.observe(ve.current), () => l.disconnect();
|
|
2919
|
+
}, [Ue]), W(() => () => {
|
|
2900
2920
|
co();
|
|
2901
2921
|
}, []);
|
|
2902
|
-
const
|
|
2903
|
-
var
|
|
2904
|
-
if (!ne.current || !
|
|
2922
|
+
const bt = D(async (l, v, F) => {
|
|
2923
|
+
var A;
|
|
2924
|
+
if (!ne.current || !ae.current)
|
|
2905
2925
|
return !1;
|
|
2906
|
-
|
|
2926
|
+
ce(!0);
|
|
2907
2927
|
try {
|
|
2908
|
-
const
|
|
2909
|
-
() => ne.current.render(
|
|
2910
|
-
{ timeoutMs: g, signal:
|
|
2928
|
+
const T = `mermaid-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, Y = nr(l, v), me = await Vt(
|
|
2929
|
+
() => ne.current.render(T, Y),
|
|
2930
|
+
{ timeoutMs: g, signal: F }
|
|
2911
2931
|
);
|
|
2912
|
-
if (!(
|
|
2932
|
+
if (!(me != null && me.svg))
|
|
2913
2933
|
return !1;
|
|
2914
|
-
const
|
|
2915
|
-
return (
|
|
2916
|
-
} catch (
|
|
2917
|
-
return
|
|
2934
|
+
const ge = jr(ae.current, me.svg, Ie);
|
|
2935
|
+
return (A = me.bindFunctions) == null || A.call(me, ae.current), Ue(), be.current[v] = ge, V(!0), we(null), !0;
|
|
2936
|
+
} catch (T) {
|
|
2937
|
+
return Xe || we(T instanceof Error ? T.message : String(T)), !1;
|
|
2918
2938
|
} finally {
|
|
2919
|
-
|
|
2939
|
+
ce(!1);
|
|
2920
2940
|
}
|
|
2921
|
-
}, [g,
|
|
2922
|
-
var
|
|
2923
|
-
if (!(!ne.current || !
|
|
2924
|
-
|
|
2941
|
+
}, [g, Xe, Ie, Ue]), Ge = D(async (l, v, F) => {
|
|
2942
|
+
var A;
|
|
2943
|
+
if (!(!ne.current || !ae.current)) {
|
|
2944
|
+
ce(!0);
|
|
2925
2945
|
try {
|
|
2926
|
-
const
|
|
2927
|
-
() => ne.current.render(
|
|
2928
|
-
{ timeoutMs: s, signal:
|
|
2946
|
+
const T = `mermaid-preview-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, Y = zr(l), me = nr(Y || l, v), ge = await Vt(
|
|
2947
|
+
() => ne.current.render(T, me),
|
|
2948
|
+
{ timeoutMs: s, signal: F }
|
|
2929
2949
|
);
|
|
2930
|
-
|
|
2950
|
+
ge != null && ge.svg && (jr(ae.current, ge.svg, Ie), (A = ge.bindFunctions) == null || A.call(ge, ae.current), Ue());
|
|
2931
2951
|
} catch {
|
|
2932
2952
|
} finally {
|
|
2933
|
-
|
|
2953
|
+
ce(!1);
|
|
2934
2954
|
}
|
|
2935
2955
|
}
|
|
2936
|
-
}, [s,
|
|
2937
|
-
if (!
|
|
2938
|
-
Pt(
|
|
2956
|
+
}, [s, Xe, Ie, Ue]), et = D(async (l, v) => {
|
|
2957
|
+
if (!l.trim()) {
|
|
2958
|
+
Pt(ae.current), V(!1), _e.current = "";
|
|
2939
2959
|
return;
|
|
2940
2960
|
}
|
|
2941
|
-
const
|
|
2942
|
-
if (
|
|
2961
|
+
const F = l.replace(/\s+/g, "");
|
|
2962
|
+
if (F === _e.current && xe.current)
|
|
2943
2963
|
return;
|
|
2944
|
-
const
|
|
2964
|
+
const A = ++De.current;
|
|
2945
2965
|
try {
|
|
2946
|
-
if (await bo(
|
|
2966
|
+
if (await bo(l, Le, {
|
|
2947
2967
|
workerTimeout: c,
|
|
2948
|
-
parseTimeout:
|
|
2968
|
+
parseTimeout: m,
|
|
2949
2969
|
mermaid: ne.current,
|
|
2950
2970
|
signal: v
|
|
2951
|
-
}), v != null && v.aborted ||
|
|
2971
|
+
}), v != null && v.aborted || De.current !== A)
|
|
2952
2972
|
return;
|
|
2953
|
-
await
|
|
2973
|
+
await bt(l, Le, v) && (_e.current = F);
|
|
2954
2974
|
return;
|
|
2955
|
-
} catch (
|
|
2956
|
-
if ((
|
|
2975
|
+
} catch (T) {
|
|
2976
|
+
if ((T == null ? void 0 : T.name) === "AbortError")
|
|
2957
2977
|
return;
|
|
2958
2978
|
}
|
|
2959
2979
|
try {
|
|
2960
|
-
const
|
|
2961
|
-
if (!
|
|
2980
|
+
const T = await ko(l, Le, { workerTimeout: c, signal: v });
|
|
2981
|
+
if (!T || v != null && v.aborted || De.current !== A)
|
|
2962
2982
|
return;
|
|
2963
|
-
await
|
|
2983
|
+
await Ge(T, Le, v);
|
|
2964
2984
|
} catch {
|
|
2965
2985
|
}
|
|
2966
|
-
}, [
|
|
2967
|
-
|
|
2968
|
-
if (!
|
|
2986
|
+
}, [m, bt, Ge, Le, c]);
|
|
2987
|
+
W(() => {
|
|
2988
|
+
if (!Ne || C || x)
|
|
2969
2989
|
return;
|
|
2970
|
-
const
|
|
2971
|
-
return
|
|
2972
|
-
}, [
|
|
2973
|
-
const
|
|
2974
|
-
const
|
|
2975
|
-
Ut(
|
|
2976
|
-
}, [e.isDark]),
|
|
2977
|
-
var
|
|
2990
|
+
const l = new AbortController();
|
|
2991
|
+
return et(u, l.signal), () => l.abort();
|
|
2992
|
+
}, [u, x, et, C, Ne]);
|
|
2993
|
+
const Me = D((l, v) => {
|
|
2994
|
+
const F = { x: l.clientX, y: l.clientY };
|
|
2995
|
+
Ut(l.currentTarget, v, "top", !1, F, e.isDark);
|
|
2996
|
+
}, [e.isDark]), ze = D(async () => {
|
|
2997
|
+
var l, v;
|
|
2978
2998
|
try {
|
|
2979
|
-
await ((
|
|
2999
|
+
await ((l = navigator.clipboard) == null ? void 0 : l.writeText(u)), L(!0), (v = e.onCopy) == null || v.call(e, u), setTimeout(() => L(!1), 1e3);
|
|
2980
3000
|
} catch {
|
|
2981
3001
|
}
|
|
2982
|
-
}, [
|
|
2983
|
-
var
|
|
2984
|
-
const
|
|
2985
|
-
if (!
|
|
3002
|
+
}, [u, e]), dt = D(() => {
|
|
3003
|
+
var A, T, Y;
|
|
3004
|
+
const l = (T = (A = ae.current) == null ? void 0 : A.querySelector("svg")) != null ? T : null;
|
|
3005
|
+
if (!l)
|
|
2986
3006
|
return;
|
|
2987
|
-
const v = or(
|
|
3007
|
+
const v = or(l), F = {
|
|
2988
3008
|
payload: { type: "export" },
|
|
2989
3009
|
defaultPrevented: !1,
|
|
2990
3010
|
preventDefault() {
|
|
2991
3011
|
this.defaultPrevented = !0;
|
|
2992
3012
|
},
|
|
2993
|
-
svgElement:
|
|
3013
|
+
svgElement: l,
|
|
2994
3014
|
svgString: v
|
|
2995
3015
|
};
|
|
2996
|
-
(
|
|
2997
|
-
}, [e]),
|
|
2998
|
-
|
|
2999
|
-
}, []),
|
|
3000
|
-
|
|
3001
|
-
}, [
|
|
3002
|
-
var
|
|
3003
|
-
const
|
|
3016
|
+
(Y = e.onExport) == null || Y.call(e, F), F.defaultPrevented || jo(l, v);
|
|
3017
|
+
}, [e]), ct = D(() => {
|
|
3018
|
+
We.current = null, Pt(Je.current);
|
|
3019
|
+
}, []), Ke = D(() => {
|
|
3020
|
+
ye(!1), ct();
|
|
3021
|
+
}, [ct]), mt = D(() => {
|
|
3022
|
+
var A, T, Y;
|
|
3023
|
+
const l = (T = (A = ae.current) == null ? void 0 : A.querySelector("svg")) != null ? T : null, v = l ? or(l) : null, F = {
|
|
3004
3024
|
payload: { type: "open-modal" },
|
|
3005
3025
|
defaultPrevented: !1,
|
|
3006
3026
|
preventDefault() {
|
|
3007
3027
|
this.defaultPrevented = !0;
|
|
3008
3028
|
},
|
|
3009
|
-
svgElement:
|
|
3029
|
+
svgElement: l,
|
|
3010
3030
|
svgString: v
|
|
3011
3031
|
};
|
|
3012
|
-
(
|
|
3032
|
+
(Y = e.onOpenModal) == null || Y.call(e, F), !F.defaultPrevented && ye(!0);
|
|
3013
3033
|
}, [e]);
|
|
3014
|
-
|
|
3015
|
-
if (!
|
|
3034
|
+
W(() => {
|
|
3035
|
+
if (!q || typeof window == "undefined")
|
|
3016
3036
|
return;
|
|
3017
|
-
const
|
|
3018
|
-
v.key === "Escape" &&
|
|
3037
|
+
const l = (v) => {
|
|
3038
|
+
v.key === "Escape" && Ke();
|
|
3019
3039
|
};
|
|
3020
3040
|
try {
|
|
3021
|
-
window.addEventListener("keydown",
|
|
3041
|
+
window.addEventListener("keydown", l);
|
|
3022
3042
|
} catch {
|
|
3023
3043
|
}
|
|
3024
3044
|
return () => {
|
|
3025
3045
|
try {
|
|
3026
|
-
window.removeEventListener("keydown",
|
|
3046
|
+
window.removeEventListener("keydown", l);
|
|
3027
3047
|
} catch {
|
|
3028
3048
|
}
|
|
3029
3049
|
};
|
|
3030
|
-
}, [
|
|
3031
|
-
if (!
|
|
3050
|
+
}, [Ke, q]), mo(() => {
|
|
3051
|
+
if (!q)
|
|
3032
3052
|
return;
|
|
3033
|
-
const
|
|
3034
|
-
if (!
|
|
3053
|
+
const l = Je.current, v = ve.current;
|
|
3054
|
+
if (!l || !v)
|
|
3035
3055
|
return;
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3038
|
-
const
|
|
3039
|
-
|
|
3040
|
-
}, [
|
|
3041
|
-
|
|
3042
|
-
}, [
|
|
3043
|
-
const
|
|
3044
|
-
var
|
|
3056
|
+
const F = `translate(${$.x}px, ${$.y}px) scale(${M})`, A = v.cloneNode(!0);
|
|
3057
|
+
A.classList.add("fullscreen");
|
|
3058
|
+
const T = A.querySelector("[data-mermaid-wrapper]");
|
|
3059
|
+
T && (We.current = T, T.style.transform = F), Pt(l), l.appendChild(A);
|
|
3060
|
+
}, [q]), W(() => {
|
|
3061
|
+
q && We.current && (We.current.style.transform = `translate(${$.x}px, ${$.y}px) scale(${M})`);
|
|
3062
|
+
}, [q, $.x, $.y, M]);
|
|
3063
|
+
const le = C || de || x, rt = H(() => e.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", [e.isDark]), b = D((l) => {
|
|
3064
|
+
var F;
|
|
3045
3065
|
const v = {
|
|
3046
|
-
payload: { type: "toggle-mode", target:
|
|
3066
|
+
payload: { type: "toggle-mode", target: l },
|
|
3047
3067
|
defaultPrevented: !1,
|
|
3048
3068
|
preventDefault() {
|
|
3049
3069
|
this.defaultPrevented = !0;
|
|
3050
3070
|
}
|
|
3051
3071
|
};
|
|
3052
|
-
if ((
|
|
3053
|
-
if (
|
|
3072
|
+
if ((F = e.onToggleMode) == null || F.call(e, l, v), !v.defaultPrevented)
|
|
3073
|
+
if (He.current = !0, l === "preview") {
|
|
3054
3074
|
w(!1);
|
|
3055
|
-
const
|
|
3056
|
-
I(
|
|
3075
|
+
const A = vt.current;
|
|
3076
|
+
I(A.zoom), te({ x: A.translateX, y: A.translateY }), oe(A.containerHeight), xe.current && be.current[Le] && ae.current ? (ae.current.innerHTML = be.current[Le], Ue()) : et(u);
|
|
3057
3077
|
} else
|
|
3058
|
-
|
|
3078
|
+
vt.current = {
|
|
3059
3079
|
zoom: M,
|
|
3060
|
-
translateX:
|
|
3061
|
-
translateY:
|
|
3062
|
-
containerHeight:
|
|
3080
|
+
translateX: $.x,
|
|
3081
|
+
translateY: $.y,
|
|
3082
|
+
containerHeight: $e
|
|
3063
3083
|
}, w(!0);
|
|
3064
3084
|
}, [
|
|
3065
|
-
|
|
3066
|
-
Ne,
|
|
3085
|
+
u,
|
|
3067
3086
|
$e,
|
|
3087
|
+
et,
|
|
3068
3088
|
e,
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3089
|
+
Le,
|
|
3090
|
+
$.x,
|
|
3091
|
+
$.y,
|
|
3092
|
+
Ue,
|
|
3073
3093
|
M
|
|
3074
|
-
]), j = D((
|
|
3075
|
-
if (e.enableWheelZoom === !1 || !
|
|
3094
|
+
]), j = D((l) => {
|
|
3095
|
+
if (e.enableWheelZoom === !1 || !l.ctrlKey && !l.metaKey)
|
|
3076
3096
|
return;
|
|
3077
|
-
|
|
3078
|
-
const v =
|
|
3097
|
+
l.preventDefault();
|
|
3098
|
+
const v = ve.current;
|
|
3079
3099
|
if (!v)
|
|
3080
3100
|
return;
|
|
3081
|
-
const
|
|
3082
|
-
if (
|
|
3101
|
+
const F = v.getBoundingClientRect(), A = l.clientX - F.left - $.x, T = l.clientY - F.top - $.y, Y = -l.deltaY * 0.01, me = Gt(M + Y, 0.5, 3);
|
|
3102
|
+
if (me === M)
|
|
3083
3103
|
return;
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3086
|
-
x:
|
|
3087
|
-
y:
|
|
3088
|
-
}), I(
|
|
3089
|
-
}, [
|
|
3090
|
-
|
|
3091
|
-
x:
|
|
3092
|
-
y: v -
|
|
3104
|
+
const ge = me / M;
|
|
3105
|
+
te({
|
|
3106
|
+
x: $.x - A * (ge - 1),
|
|
3107
|
+
y: $.y - T * (ge - 1)
|
|
3108
|
+
}), I(me);
|
|
3109
|
+
}, [$, M]), N = D((l, v) => {
|
|
3110
|
+
ie(!0), y.current = {
|
|
3111
|
+
x: l - $.x,
|
|
3112
|
+
y: v - $.y
|
|
3093
3113
|
};
|
|
3094
|
-
}, [
|
|
3095
|
-
ue &&
|
|
3096
|
-
x:
|
|
3097
|
-
y: v -
|
|
3114
|
+
}, [$.x, $.y]), z = D((l, v) => {
|
|
3115
|
+
ue && te({
|
|
3116
|
+
x: l - y.current.x,
|
|
3117
|
+
y: v - y.current.y
|
|
3098
3118
|
});
|
|
3099
|
-
}, [ue]),
|
|
3100
|
-
|
|
3101
|
-
}, []),
|
|
3119
|
+
}, [ue]), Z = D(() => {
|
|
3120
|
+
ie(!1);
|
|
3121
|
+
}, []), Q = /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
3102
3122
|
e.showZoomControls && /* @__PURE__ */ n.jsx("div", { className: "absolute top-2 right-2 z-10 rounded-lg", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 backdrop-blur rounded-lg", children: [
|
|
3103
3123
|
/* @__PURE__ */ n.jsx(
|
|
3104
3124
|
"button",
|
|
3105
3125
|
{
|
|
3106
3126
|
type: "button",
|
|
3107
|
-
className:
|
|
3127
|
+
className: Ee(
|
|
3108
3128
|
"p-2 text-xs rounded transition-colors",
|
|
3109
3129
|
e.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"
|
|
3110
3130
|
),
|
|
3111
|
-
onMouseEnter: (
|
|
3112
|
-
onMouseLeave: () =>
|
|
3131
|
+
onMouseEnter: (l) => Me(l, r("common.zoomIn")),
|
|
3132
|
+
onMouseLeave: () => Oe(),
|
|
3113
3133
|
onClick: () => I(Gt(M + 0.1, 0.5, 3)),
|
|
3114
3134
|
children: "+"
|
|
3115
3135
|
}
|
|
@@ -3118,12 +3138,12 @@ function Hr(t) {
|
|
|
3118
3138
|
"button",
|
|
3119
3139
|
{
|
|
3120
3140
|
type: "button",
|
|
3121
|
-
className:
|
|
3141
|
+
className: Ee(
|
|
3122
3142
|
"p-2 text-xs rounded transition-colors",
|
|
3123
3143
|
e.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"
|
|
3124
3144
|
),
|
|
3125
|
-
onMouseEnter: (
|
|
3126
|
-
onMouseLeave: () =>
|
|
3145
|
+
onMouseEnter: (l) => Me(l, r("common.zoomOut")),
|
|
3146
|
+
onMouseLeave: () => Oe(),
|
|
3127
3147
|
onClick: () => I(Gt(M - 0.1, 0.5, 3)),
|
|
3128
3148
|
children: "−"
|
|
3129
3149
|
}
|
|
@@ -3132,14 +3152,14 @@ function Hr(t) {
|
|
|
3132
3152
|
"button",
|
|
3133
3153
|
{
|
|
3134
3154
|
type: "button",
|
|
3135
|
-
className:
|
|
3155
|
+
className: Ee(
|
|
3136
3156
|
"p-2 text-xs rounded transition-colors",
|
|
3137
3157
|
e.isDark ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-200"
|
|
3138
3158
|
),
|
|
3139
|
-
onMouseEnter: (
|
|
3140
|
-
onMouseLeave: () =>
|
|
3159
|
+
onMouseEnter: (l) => Me(l, r("common.resetZoom")),
|
|
3160
|
+
onMouseLeave: () => Oe(),
|
|
3141
3161
|
onClick: () => {
|
|
3142
|
-
I(1),
|
|
3162
|
+
I(1), te({ x: 0, y: 0 });
|
|
3143
3163
|
},
|
|
3144
3164
|
children: [
|
|
3145
3165
|
Math.round(M * 100),
|
|
@@ -3151,56 +3171,56 @@ function Hr(t) {
|
|
|
3151
3171
|
/* @__PURE__ */ n.jsxs(
|
|
3152
3172
|
"div",
|
|
3153
3173
|
{
|
|
3154
|
-
ref:
|
|
3155
|
-
className:
|
|
3174
|
+
ref: ve,
|
|
3175
|
+
className: Ee(
|
|
3156
3176
|
"min-h-[360px] relative transition-all duration-100 overflow-hidden block",
|
|
3157
3177
|
e.isDark ? "bg-gray-900" : "bg-gray-50"
|
|
3158
3178
|
),
|
|
3159
|
-
style: { height:
|
|
3179
|
+
style: { height: $e, maxHeight: (B = e.maxHeight) != null ? B : void 0 },
|
|
3160
3180
|
onWheel: j,
|
|
3161
|
-
onMouseDown: (
|
|
3162
|
-
|
|
3181
|
+
onMouseDown: (l) => {
|
|
3182
|
+
l.button === 0 && (l.preventDefault(), N(l.clientX, l.clientY));
|
|
3163
3183
|
},
|
|
3164
|
-
onMouseMove: (
|
|
3165
|
-
onMouseUp:
|
|
3166
|
-
onMouseLeave:
|
|
3167
|
-
onTouchStart: (
|
|
3168
|
-
const v =
|
|
3169
|
-
v &&
|
|
3184
|
+
onMouseMove: (l) => z(l.clientX, l.clientY),
|
|
3185
|
+
onMouseUp: Z,
|
|
3186
|
+
onMouseLeave: Z,
|
|
3187
|
+
onTouchStart: (l) => {
|
|
3188
|
+
const v = l.touches[0];
|
|
3189
|
+
v && N(v.clientX, v.clientY);
|
|
3170
3190
|
},
|
|
3171
|
-
onTouchMove: (
|
|
3172
|
-
const v =
|
|
3173
|
-
v &&
|
|
3191
|
+
onTouchMove: (l) => {
|
|
3192
|
+
const v = l.touches[0];
|
|
3193
|
+
v && z(v.clientX, v.clientY);
|
|
3174
3194
|
},
|
|
3175
|
-
onTouchEnd:
|
|
3195
|
+
onTouchEnd: Z,
|
|
3176
3196
|
children: [
|
|
3177
3197
|
/* @__PURE__ */ n.jsx(
|
|
3178
3198
|
"div",
|
|
3179
3199
|
{
|
|
3180
|
-
ref:
|
|
3200
|
+
ref: Fe,
|
|
3181
3201
|
"data-mermaid-wrapper": !0,
|
|
3182
|
-
className:
|
|
3183
|
-
style: { transform: `translate(${
|
|
3202
|
+
className: Ee("absolute inset-0 cursor-grab", { "cursor-grabbing": ue }),
|
|
3203
|
+
style: { transform: `translate(${$.x}px, ${$.y}px) scale(${M})` },
|
|
3184
3204
|
children: /* @__PURE__ */ n.jsx(
|
|
3185
3205
|
"div",
|
|
3186
3206
|
{
|
|
3187
|
-
ref:
|
|
3207
|
+
ref: ae,
|
|
3188
3208
|
className: "_mermaid w-full text-center flex items-center justify-center min-h-full"
|
|
3189
3209
|
}
|
|
3190
3210
|
)
|
|
3191
3211
|
}
|
|
3192
3212
|
),
|
|
3193
|
-
(
|
|
3213
|
+
(de || Xe) && /* @__PURE__ */ n.jsxs("div", { className: "mermaid-loading", children: [
|
|
3194
3214
|
/* @__PURE__ */ n.jsx("span", { className: "mermaid-spinner" }),
|
|
3195
3215
|
/* @__PURE__ */ n.jsx("span", { children: "Rendering diagram…" })
|
|
3196
3216
|
] })
|
|
3197
3217
|
]
|
|
3198
3218
|
}
|
|
3199
3219
|
)
|
|
3200
|
-
] }),
|
|
3220
|
+
] }), je = e.showHeader && /* @__PURE__ */ n.jsxs(
|
|
3201
3221
|
"div",
|
|
3202
3222
|
{
|
|
3203
|
-
className:
|
|
3223
|
+
className: Ee(
|
|
3204
3224
|
"mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",
|
|
3205
3225
|
e.isDark ? "bg-gray-800 border-gray-700/30" : "bg-gray-50 border-gray-200"
|
|
3206
3226
|
),
|
|
@@ -3213,22 +3233,22 @@ function Hr(t) {
|
|
|
3213
3233
|
dangerouslySetInnerHTML: { __html: o }
|
|
3214
3234
|
}
|
|
3215
3235
|
),
|
|
3216
|
-
/* @__PURE__ */ n.jsx("span", { className:
|
|
3236
|
+
/* @__PURE__ */ n.jsx("span", { className: Ee("text-sm font-medium font-mono truncate", e.isDark ? "text-gray-400" : "text-gray-600"), children: "Mermaid" })
|
|
3217
3237
|
] }),
|
|
3218
|
-
e.showModeToggle && f && /* @__PURE__ */ n.jsxs("div", { className:
|
|
3238
|
+
e.showModeToggle && f && /* @__PURE__ */ n.jsxs("div", { className: Ee("flex items-center space-x-1 rounded-md p-0.5", e.isDark ? "bg-gray-700" : "bg-gray-100"), children: [
|
|
3219
3239
|
/* @__PURE__ */ n.jsx(
|
|
3220
3240
|
"button",
|
|
3221
3241
|
{
|
|
3222
3242
|
type: "button",
|
|
3223
|
-
className:
|
|
3243
|
+
className: Ee(
|
|
3224
3244
|
"px-2.5 py-1 text-xs rounded transition-colors",
|
|
3225
3245
|
C ? e.isDark ? "text-gray-400 hover:text-gray-200" : "text-gray-500 hover:text-gray-700" : e.isDark ? "bg-gray-600 text-gray-200 shadow-sm" : "bg-white text-gray-700 shadow-sm"
|
|
3226
3246
|
),
|
|
3227
3247
|
onClick: () => b("preview"),
|
|
3228
|
-
onMouseEnter: (
|
|
3229
|
-
onFocus: (
|
|
3230
|
-
onMouseLeave: () =>
|
|
3231
|
-
onBlur: () =>
|
|
3248
|
+
onMouseEnter: (l) => Me(l, r("common.preview")),
|
|
3249
|
+
onFocus: (l) => Me(l, r("common.preview")),
|
|
3250
|
+
onMouseLeave: () => Oe(),
|
|
3251
|
+
onBlur: () => Oe(),
|
|
3232
3252
|
children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center space-x-1", children: [
|
|
3233
3253
|
/* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsxs("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", children: [
|
|
3234
3254
|
/* @__PURE__ */ n.jsx("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" }),
|
|
@@ -3242,15 +3262,15 @@ function Hr(t) {
|
|
|
3242
3262
|
"button",
|
|
3243
3263
|
{
|
|
3244
3264
|
type: "button",
|
|
3245
|
-
className:
|
|
3265
|
+
className: Ee(
|
|
3246
3266
|
"px-2.5 py-1 text-xs rounded transition-colors",
|
|
3247
3267
|
C ? e.isDark ? "bg-gray-600 text-gray-200 shadow-sm" : "bg-white text-gray-700 shadow-sm" : e.isDark ? "text-gray-400 hover:text-gray-200" : "text-gray-500 hover:text-gray-700"
|
|
3248
3268
|
),
|
|
3249
3269
|
onClick: () => b("source"),
|
|
3250
|
-
onMouseEnter: (
|
|
3251
|
-
onFocus: (
|
|
3252
|
-
onMouseLeave: () =>
|
|
3253
|
-
onBlur: () =>
|
|
3270
|
+
onMouseEnter: (l) => Me(l, r("common.source")),
|
|
3271
|
+
onFocus: (l) => Me(l, r("common.source")),
|
|
3272
|
+
onMouseLeave: () => Oe(),
|
|
3273
|
+
onBlur: () => Oe(),
|
|
3254
3274
|
children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center space-x-1", children: [
|
|
3255
3275
|
/* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m16 18l6-6l-6-6M8 6l-6 6l6 6" }) }),
|
|
3256
3276
|
/* @__PURE__ */ n.jsx("span", { children: r("common.source") })
|
|
@@ -3263,17 +3283,17 @@ function Hr(t) {
|
|
|
3263
3283
|
"button",
|
|
3264
3284
|
{
|
|
3265
3285
|
type: "button",
|
|
3266
|
-
className:
|
|
3267
|
-
"aria-pressed":
|
|
3268
|
-
onClick: () =>
|
|
3269
|
-
onMouseEnter: (
|
|
3270
|
-
onFocus: (
|
|
3271
|
-
onMouseLeave: () =>
|
|
3272
|
-
onBlur: () =>
|
|
3286
|
+
className: rt,
|
|
3287
|
+
"aria-pressed": x,
|
|
3288
|
+
onClick: () => S((l) => !l),
|
|
3289
|
+
onMouseEnter: (l) => Me(l, r(x ? "common.expand" : "common.collapse")),
|
|
3290
|
+
onFocus: (l) => Me(l, r(x ? "common.expand" : "common.collapse")),
|
|
3291
|
+
onMouseLeave: () => Oe(),
|
|
3292
|
+
onBlur: () => Oe(),
|
|
3273
3293
|
children: /* @__PURE__ */ n.jsx(
|
|
3274
3294
|
"svg",
|
|
3275
3295
|
{
|
|
3276
|
-
style: { rotate:
|
|
3296
|
+
style: { rotate: x ? "0deg" : "90deg" },
|
|
3277
3297
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3278
3298
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
3279
3299
|
"aria-hidden": "true",
|
|
@@ -3291,13 +3311,13 @@ function Hr(t) {
|
|
|
3291
3311
|
"button",
|
|
3292
3312
|
{
|
|
3293
3313
|
type: "button",
|
|
3294
|
-
className:
|
|
3295
|
-
onClick:
|
|
3296
|
-
onMouseEnter: (
|
|
3297
|
-
onFocus: (
|
|
3298
|
-
onMouseLeave: () =>
|
|
3299
|
-
onBlur: () =>
|
|
3300
|
-
children:
|
|
3314
|
+
className: rt,
|
|
3315
|
+
onClick: ze,
|
|
3316
|
+
onMouseEnter: (l) => Me(l, r(O ? "common.copySuccess" : "common.copy")),
|
|
3317
|
+
onFocus: (l) => Me(l, r(O ? "common.copySuccess" : "common.copy")),
|
|
3318
|
+
onMouseLeave: () => Oe(),
|
|
3319
|
+
onBlur: () => Oe(),
|
|
3320
|
+
children: O ? /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M20 6L9 17l-5-5" }) }) : /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsxs("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", children: [
|
|
3301
3321
|
/* @__PURE__ */ n.jsx("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
3302
3322
|
/* @__PURE__ */ n.jsx("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
3303
3323
|
] }) })
|
|
@@ -3307,13 +3327,13 @@ function Hr(t) {
|
|
|
3307
3327
|
"button",
|
|
3308
3328
|
{
|
|
3309
3329
|
type: "button",
|
|
3310
|
-
className:
|
|
3311
|
-
disabled:
|
|
3312
|
-
onClick:
|
|
3313
|
-
onMouseEnter: (
|
|
3314
|
-
onFocus: (
|
|
3315
|
-
onMouseLeave: () =>
|
|
3316
|
-
onBlur: () =>
|
|
3330
|
+
className: Ee(rt, le ? "opacity-50 cursor-not-allowed" : ""),
|
|
3331
|
+
disabled: le,
|
|
3332
|
+
onClick: dt,
|
|
3333
|
+
onMouseEnter: (l) => Me(l, r("common.export")),
|
|
3334
|
+
onFocus: (l) => Me(l, r("common.export")),
|
|
3335
|
+
onMouseLeave: () => Oe(),
|
|
3336
|
+
onBlur: () => Oe(),
|
|
3317
3337
|
children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsxs("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", children: [
|
|
3318
3338
|
/* @__PURE__ */ n.jsx("path", { d: "M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
3319
3339
|
/* @__PURE__ */ n.jsx("path", { d: "m7 10l5 5l5-5" })
|
|
@@ -3324,57 +3344,57 @@ function Hr(t) {
|
|
|
3324
3344
|
"button",
|
|
3325
3345
|
{
|
|
3326
3346
|
type: "button",
|
|
3327
|
-
className:
|
|
3328
|
-
disabled:
|
|
3329
|
-
onClick:
|
|
3330
|
-
onMouseEnter: (
|
|
3331
|
-
onFocus: (
|
|
3332
|
-
onMouseLeave: () =>
|
|
3333
|
-
onBlur: () =>
|
|
3334
|
-
children:
|
|
3347
|
+
className: Ee(rt, le ? "opacity-50 cursor-not-allowed" : ""),
|
|
3348
|
+
disabled: le,
|
|
3349
|
+
onClick: q ? Ke : mt,
|
|
3350
|
+
onMouseEnter: (l) => Me(l, r(q ? "common.minimize" : "common.open")),
|
|
3351
|
+
onFocus: (l) => Me(l, r(q ? "common.minimize" : "common.open")),
|
|
3352
|
+
onMouseLeave: () => Oe(),
|
|
3353
|
+
onBlur: () => Oe(),
|
|
3354
|
+
children: q ? /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6" }) }) : /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", className: "w-3 h-3", children: /* @__PURE__ */ n.jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6" }) })
|
|
3335
3355
|
}
|
|
3336
3356
|
)
|
|
3337
3357
|
] })
|
|
3338
3358
|
]
|
|
3339
3359
|
}
|
|
3340
|
-
),
|
|
3341
|
-
C ? /* @__PURE__ */ n.jsx("div", { className:
|
|
3342
|
-
|
|
3360
|
+
), Be = /* @__PURE__ */ n.jsxs("div", { children: [
|
|
3361
|
+
C ? /* @__PURE__ */ n.jsx("div", { className: Ee("p-4", e.isDark ? "bg-gray-900 text-gray-300" : "bg-gray-50 text-gray-700"), children: /* @__PURE__ */ n.jsx("pre", { className: "text-sm font-mono whitespace-pre-wrap", children: u }) }) : Q,
|
|
3362
|
+
re && /* @__PURE__ */ n.jsx("div", { className: "mermaid-error", children: re })
|
|
3343
3363
|
] });
|
|
3344
3364
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
3345
3365
|
/* @__PURE__ */ n.jsxs(
|
|
3346
3366
|
"div",
|
|
3347
3367
|
{
|
|
3348
|
-
className:
|
|
3368
|
+
className: Ee(
|
|
3349
3369
|
"my-4 rounded-lg border overflow-hidden shadow-sm mermaid-block",
|
|
3350
3370
|
e.isDark ? "border-gray-700/30" : "border-gray-200",
|
|
3351
|
-
{ "is-rendering":
|
|
3371
|
+
{ "is-rendering": Xe }
|
|
3352
3372
|
),
|
|
3353
3373
|
children: [
|
|
3354
|
-
|
|
3355
|
-
!
|
|
3374
|
+
je,
|
|
3375
|
+
!x && /* @__PURE__ */ n.jsx("div", { ref: st, children: Be })
|
|
3356
3376
|
]
|
|
3357
3377
|
}
|
|
3358
3378
|
),
|
|
3359
|
-
|
|
3379
|
+
q && typeof document != "undefined" && ir(
|
|
3360
3380
|
/* @__PURE__ */ n.jsx(
|
|
3361
3381
|
"div",
|
|
3362
3382
|
{
|
|
3363
3383
|
className: "mermaid-modal-overlay",
|
|
3364
|
-
onClick: () =>
|
|
3384
|
+
onClick: () => Ke(),
|
|
3365
3385
|
children: /* @__PURE__ */ n.jsxs(
|
|
3366
3386
|
"div",
|
|
3367
3387
|
{
|
|
3368
|
-
className:
|
|
3388
|
+
className: Ee("mermaid-modal-panel", { "is-dark": e.isDark }),
|
|
3369
3389
|
role: "dialog",
|
|
3370
3390
|
"aria-modal": "true",
|
|
3371
|
-
onClick: (
|
|
3391
|
+
onClick: (l) => l.stopPropagation(),
|
|
3372
3392
|
children: [
|
|
3373
3393
|
/* @__PURE__ */ n.jsxs("div", { className: "mermaid-modal-header", children: [
|
|
3374
3394
|
/* @__PURE__ */ n.jsx("span", { className: "mermaid-modal-title", children: "Mermaid Preview" }),
|
|
3375
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", className: "mermaid-modal-close", onClick:
|
|
3395
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "mermaid-modal-close", onClick: Ke, children: "Close" })
|
|
3376
3396
|
] }),
|
|
3377
|
-
/* @__PURE__ */ n.jsx("div", { className: "mermaid-modal-body", children: /* @__PURE__ */ n.jsx("div", { ref:
|
|
3397
|
+
/* @__PURE__ */ n.jsx("div", { className: "mermaid-modal-body", children: /* @__PURE__ */ n.jsx("div", { ref: Je, className: "mermaid-modal-content" }) })
|
|
3378
3398
|
]
|
|
3379
3399
|
}
|
|
3380
3400
|
)
|
|
@@ -3400,8 +3420,8 @@ async function bo(t, e, r) {
|
|
|
3400
3420
|
const o = nr(t, e), a = r.mermaid;
|
|
3401
3421
|
if (typeof a.parse == "function")
|
|
3402
3422
|
return await Vt(() => a.parse(o), { timeoutMs: r.parseTimeout, signal: r.signal }), !0;
|
|
3403
|
-
const
|
|
3404
|
-
return await Vt(() => a.render(
|
|
3423
|
+
const u = `mermaid-parse-${Math.random().toString(36).slice(2, 9)}`;
|
|
3424
|
+
return await Vt(() => a.render(u, o), { timeoutMs: r.parseTimeout, signal: r.signal }), !0;
|
|
3405
3425
|
}
|
|
3406
3426
|
async function ko(t, e, r) {
|
|
3407
3427
|
try {
|
|
@@ -3438,20 +3458,20 @@ function zr(t) {
|
|
|
3438
3458
|
}
|
|
3439
3459
|
async function Vt(t, e = {}) {
|
|
3440
3460
|
const { timeoutMs: r, signal: o } = e;
|
|
3441
|
-
return o != null && o.aborted ? Promise.reject(new DOMException("Aborted", "AbortError")) : new Promise((a,
|
|
3442
|
-
let c = !1,
|
|
3461
|
+
return o != null && o.aborted ? Promise.reject(new DOMException("Aborted", "AbortError")) : new Promise((a, u) => {
|
|
3462
|
+
let c = !1, m = null;
|
|
3443
3463
|
function s() {
|
|
3444
|
-
c || (c = !0, g(),
|
|
3464
|
+
c || (c = !0, g(), u(new DOMException("Aborted", "AbortError")));
|
|
3445
3465
|
}
|
|
3446
3466
|
function g() {
|
|
3447
|
-
|
|
3467
|
+
m != null && clearTimeout(m), o && o.removeEventListener("abort", s);
|
|
3448
3468
|
}
|
|
3449
|
-
o && o.addEventListener("abort", s, { once: !0 }), r && r > 0 && (
|
|
3450
|
-
c || (c = !0, g(),
|
|
3469
|
+
o && o.addEventListener("abort", s, { once: !0 }), r && r > 0 && (m = setTimeout(() => {
|
|
3470
|
+
c || (c = !0, g(), u(new Error("Operation timed out")));
|
|
3451
3471
|
}, r)), t().then((f) => {
|
|
3452
3472
|
c || (c = !0, g(), a(f));
|
|
3453
3473
|
}).catch((f) => {
|
|
3454
|
-
c || (c = !0, g(),
|
|
3474
|
+
c || (c = !0, g(), u(f));
|
|
3455
3475
|
});
|
|
3456
3476
|
});
|
|
3457
3477
|
}
|
|
@@ -3459,8 +3479,8 @@ function or(t) {
|
|
|
3459
3479
|
return new XMLSerializer().serializeToString(t);
|
|
3460
3480
|
}
|
|
3461
3481
|
function jo(t, e) {
|
|
3462
|
-
const r = e != null ? e : or(t), o = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(o),
|
|
3463
|
-
|
|
3482
|
+
const r = e != null ? e : or(t), o = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(o), u = document.createElement("a");
|
|
3483
|
+
u.href = a, u.download = `mermaid-${Date.now()}.svg`, document.body.appendChild(u), u.click(), document.body.removeChild(u), URL.revokeObjectURL(a);
|
|
3464
3484
|
}
|
|
3465
3485
|
function Co(t) {
|
|
3466
3486
|
const { node: e } = t;
|
|
@@ -3472,22 +3492,22 @@ function Co(t) {
|
|
|
3472
3492
|
}
|
|
3473
3493
|
function Mo(t) {
|
|
3474
3494
|
var f;
|
|
3475
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a, children:
|
|
3495
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a, children: u } = t;
|
|
3476
3496
|
if (!r || !o)
|
|
3477
|
-
return /* @__PURE__ */ n.jsx("p", { dir: "auto", className: "paragraph-node", children:
|
|
3478
|
-
const c = (f = e.children) != null ? f : [],
|
|
3497
|
+
return /* @__PURE__ */ n.jsx("p", { dir: "auto", className: "paragraph-node", children: u });
|
|
3498
|
+
const c = (f = e.children) != null ? f : [], m = [], s = [], g = () => {
|
|
3479
3499
|
if (!s.length)
|
|
3480
3500
|
return;
|
|
3481
|
-
const h =
|
|
3482
|
-
|
|
3483
|
-
/* @__PURE__ */ n.jsx("p", { dir: "auto", className: "paragraph-node", children:
|
|
3501
|
+
const h = m.length;
|
|
3502
|
+
m.push(
|
|
3503
|
+
/* @__PURE__ */ n.jsx("p", { dir: "auto", className: "paragraph-node", children: qe(s.slice(), r, `${String(a != null ? a : "paragraph")}-${h}`, o) }, `${String(a != null ? a : "paragraph")}-inline-${h}`)
|
|
3484
3504
|
), s.length = 0;
|
|
3485
3505
|
};
|
|
3486
3506
|
return c.forEach((h, C) => {
|
|
3487
|
-
en.has(h.type) ? (g(),
|
|
3488
|
-
/* @__PURE__ */ n.jsx(
|
|
3507
|
+
en.has(h.type) ? (g(), m.push(
|
|
3508
|
+
/* @__PURE__ */ n.jsx(Ct.Fragment, { children: o(h, `${String(a != null ? a : "paragraph")}-block-${C}`, r) }, `${String(a != null ? a : "paragraph")}-block-${C}`)
|
|
3489
3509
|
)) : s.push(h);
|
|
3490
|
-
}), g(),
|
|
3510
|
+
}), g(), m.length ? /* @__PURE__ */ n.jsx(n.Fragment, { children: m }) : /* @__PURE__ */ n.jsx("p", { dir: "auto", className: "paragraph-node", children: qe(c, r, String(a != null ? a : "paragraph"), o) });
|
|
3491
3511
|
}
|
|
3492
3512
|
function Eo(t) {
|
|
3493
3513
|
const { node: e } = t, r = D((o) => {
|
|
@@ -3530,43 +3550,43 @@ function No(t) {
|
|
|
3530
3550
|
}
|
|
3531
3551
|
function _o(t) {
|
|
3532
3552
|
var g;
|
|
3533
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a } = t,
|
|
3553
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a } = t, u = Array.isArray((g = e == null ? void 0 : e.header) == null ? void 0 : g.cells) ? e.header.cells : [], c = !!(e != null && e.loading), m = Array.isArray(e == null ? void 0 : e.rows) ? e.rows : [], s = (f) => f === "right" ? "text-right" : f === "center" ? "text-center" : "text-left";
|
|
3534
3554
|
return /* @__PURE__ */ n.jsxs("div", { className: "table-node-wrapper", "data-index-key": a, children: [
|
|
3535
3555
|
/* @__PURE__ */ n.jsxs(
|
|
3536
3556
|
"table",
|
|
3537
3557
|
{
|
|
3538
|
-
className:
|
|
3558
|
+
className: Ee(
|
|
3539
3559
|
"my-8 text-sm table-node",
|
|
3540
3560
|
c && "table-node--loading"
|
|
3541
3561
|
),
|
|
3542
3562
|
"aria-busy": c,
|
|
3543
3563
|
children: [
|
|
3544
|
-
/* @__PURE__ */ n.jsx("thead", { className: "border-[var(--table-border,#cbd5e1)]", children: /* @__PURE__ */ n.jsx("tr", { className: "border-b", children:
|
|
3564
|
+
/* @__PURE__ */ n.jsx("thead", { className: "border-[var(--table-border,#cbd5e1)]", children: /* @__PURE__ */ n.jsx("tr", { className: "border-b", children: u.map((f, h) => /* @__PURE__ */ n.jsx(
|
|
3545
3565
|
"th",
|
|
3546
3566
|
{
|
|
3547
|
-
className:
|
|
3567
|
+
className: Ee("font-semibold p-[calc(4/7*1em)]", s(f.align)),
|
|
3548
3568
|
dir: "auto",
|
|
3549
3569
|
children: r && o ? Ht(f.children, r, `${String(a != null ? a : "table")}-th-${h}`, o) : null
|
|
3550
3570
|
},
|
|
3551
3571
|
`header-${h}`
|
|
3552
3572
|
)) }) }),
|
|
3553
|
-
/* @__PURE__ */ n.jsx("tbody", { children:
|
|
3573
|
+
/* @__PURE__ */ n.jsx("tbody", { children: m.map((f, h) => {
|
|
3554
3574
|
var C;
|
|
3555
3575
|
return /* @__PURE__ */ n.jsx(
|
|
3556
3576
|
"tr",
|
|
3557
3577
|
{
|
|
3558
|
-
className:
|
|
3578
|
+
className: Ee(
|
|
3559
3579
|
"border-[var(--table-border,#cbd5e1)]",
|
|
3560
|
-
h <
|
|
3580
|
+
h < m.length - 1 && "border-b"
|
|
3561
3581
|
),
|
|
3562
|
-
children: (C = f.cells) == null ? void 0 : C.map((w,
|
|
3582
|
+
children: (C = f.cells) == null ? void 0 : C.map((w, x) => /* @__PURE__ */ n.jsx(
|
|
3563
3583
|
"td",
|
|
3564
3584
|
{
|
|
3565
|
-
className:
|
|
3585
|
+
className: Ee("p-[calc(4/7*1em)]", s(w.align)),
|
|
3566
3586
|
dir: "auto",
|
|
3567
|
-
children: r && o ? Ht(w.children, r, `${String(a != null ? a : "table")}-row-${h}-${
|
|
3587
|
+
children: r && o ? Ht(w.children, r, `${String(a != null ? a : "table")}-row-${h}-${x}`, o) : null
|
|
3568
3588
|
},
|
|
3569
|
-
`cell-${h}-${
|
|
3589
|
+
`cell-${h}-${x}`
|
|
3570
3590
|
))
|
|
3571
3591
|
},
|
|
3572
3592
|
`row-${h}`
|
|
@@ -3586,7 +3606,7 @@ function Cr(t) {
|
|
|
3586
3606
|
return /* @__PURE__ */ n.jsx(
|
|
3587
3607
|
"span",
|
|
3588
3608
|
{
|
|
3589
|
-
className:
|
|
3609
|
+
className: Ee(
|
|
3590
3610
|
"text-node whitespace-pre-wrap break-words",
|
|
3591
3611
|
e.center && "text-node-center"
|
|
3592
3612
|
),
|
|
@@ -3598,11 +3618,11 @@ function Lo() {
|
|
|
3598
3618
|
return /* @__PURE__ */ n.jsx("hr", { className: "hr-node thematic-break" });
|
|
3599
3619
|
}
|
|
3600
3620
|
function Bo(t) {
|
|
3601
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a } = t,
|
|
3621
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a } = t, u = `vmr-container vmr-container-${e.name}`, c = H(() => {
|
|
3602
3622
|
if (e.attrs)
|
|
3603
3623
|
return Array.isArray(e.attrs) ? ar(e.attrs) : e.attrs;
|
|
3604
3624
|
}, [e.attrs]);
|
|
3605
|
-
return /* @__PURE__ */ n.jsx("div", { className:
|
|
3625
|
+
return /* @__PURE__ */ n.jsx("div", { className: u, ...c, children: r && o && Array.isArray(e.children) ? e.children.map((m, s) => /* @__PURE__ */ n.jsx(Ct.Fragment, { children: o(m, `${String(a != null ? a : "vmr-container")}-${s}`, r) }, `${String(a != null ? a : "vmr-container")}-${s}`)) : null });
|
|
3606
3626
|
}
|
|
3607
3627
|
function Po(t) {
|
|
3608
3628
|
const r = String(t != null ? t : "").match(/^\s*<\s*([A-Z][\w:-]*)/i);
|
|
@@ -3616,12 +3636,12 @@ function Do(t, e) {
|
|
|
3616
3636
|
return r.replace(o, "").replace(a, "");
|
|
3617
3637
|
}
|
|
3618
3638
|
function Io(t, e, r) {
|
|
3619
|
-
var a,
|
|
3620
|
-
const o =
|
|
3639
|
+
var a, u, c, m, s, g;
|
|
3640
|
+
const o = pt(String(t.language || ""));
|
|
3621
3641
|
if (o === "mermaid") {
|
|
3622
3642
|
const f = cr(r.customId).mermaid;
|
|
3623
3643
|
if (f)
|
|
3624
|
-
return
|
|
3644
|
+
return Ct.createElement(f, { key: e, node: t, isDark: r.isDark });
|
|
3625
3645
|
if (!r.renderCodeBlocksAsPre)
|
|
3626
3646
|
return /* @__PURE__ */ n.jsx(
|
|
3627
3647
|
Hr,
|
|
@@ -3640,9 +3660,9 @@ function Io(t, e, r) {
|
|
|
3640
3660
|
loading: !!t.loading,
|
|
3641
3661
|
stream: r.codeBlockStream,
|
|
3642
3662
|
darkTheme: (a = r.codeBlockThemes) == null ? void 0 : a.darkTheme,
|
|
3643
|
-
lightTheme: (
|
|
3663
|
+
lightTheme: (u = r.codeBlockThemes) == null ? void 0 : u.lightTheme,
|
|
3644
3664
|
monacoOptions: (c = r.codeBlockThemes) == null ? void 0 : c.monacoOptions,
|
|
3645
|
-
themes: (
|
|
3665
|
+
themes: (m = r.codeBlockThemes) == null ? void 0 : m.themes,
|
|
3646
3666
|
minWidth: (s = r.codeBlockThemes) == null ? void 0 : s.minWidth,
|
|
3647
3667
|
maxWidth: (g = r.codeBlockThemes) == null ? void 0 : g.maxWidth,
|
|
3648
3668
|
isDark: r.isDark,
|
|
@@ -3653,10 +3673,10 @@ function Io(t, e, r) {
|
|
|
3653
3673
|
);
|
|
3654
3674
|
}
|
|
3655
3675
|
function Re(t, e, r) {
|
|
3656
|
-
var
|
|
3676
|
+
var u, c;
|
|
3657
3677
|
const o = cr(r.customId), a = o[t.type];
|
|
3658
3678
|
if (a)
|
|
3659
|
-
return
|
|
3679
|
+
return Ct.createElement(a, {
|
|
3660
3680
|
key: e,
|
|
3661
3681
|
node: t,
|
|
3662
3682
|
customId: r.customId,
|
|
@@ -3667,15 +3687,15 @@ function Re(t, e, r) {
|
|
|
3667
3687
|
typewriter: r.typewriter
|
|
3668
3688
|
});
|
|
3669
3689
|
if (t.type === "html_block" || t.type === "html_inline") {
|
|
3670
|
-
const
|
|
3690
|
+
const m = String((u = t.tag) != null ? u : "").trim().toLowerCase() || Po(t.content), s = m ? o[m] : null;
|
|
3671
3691
|
if (s) {
|
|
3672
3692
|
const g = {
|
|
3673
3693
|
...t,
|
|
3674
|
-
type:
|
|
3675
|
-
tag:
|
|
3676
|
-
content: Do(t.content,
|
|
3694
|
+
type: m,
|
|
3695
|
+
tag: m,
|
|
3696
|
+
content: Do(t.content, m)
|
|
3677
3697
|
};
|
|
3678
|
-
return
|
|
3698
|
+
return Ct.createElement(s, {
|
|
3679
3699
|
key: e,
|
|
3680
3700
|
node: g,
|
|
3681
3701
|
customId: r.customId,
|
|
@@ -3735,22 +3755,22 @@ function Re(t, e, r) {
|
|
|
3735
3755
|
Ro,
|
|
3736
3756
|
{
|
|
3737
3757
|
node: t,
|
|
3738
|
-
children:
|
|
3758
|
+
children: qe(t.children, r, `${String(e)}-strong`, Re)
|
|
3739
3759
|
},
|
|
3740
3760
|
e
|
|
3741
3761
|
);
|
|
3742
3762
|
case "emphasis":
|
|
3743
|
-
return /* @__PURE__ */ n.jsx(In, { node: t, children:
|
|
3763
|
+
return /* @__PURE__ */ n.jsx(In, { node: t, children: qe(t.children, r, `${String(e)}-em`, Re) }, e);
|
|
3744
3764
|
case "strikethrough":
|
|
3745
|
-
return /* @__PURE__ */ n.jsx(To, { node: t, children:
|
|
3765
|
+
return /* @__PURE__ */ n.jsx(To, { node: t, children: qe(t.children, r, `${String(e)}-strike`, Re) }, e);
|
|
3746
3766
|
case "highlight":
|
|
3747
|
-
return /* @__PURE__ */ n.jsx(Hn, { node: t, children:
|
|
3767
|
+
return /* @__PURE__ */ n.jsx(Hn, { node: t, children: qe(t.children, r, `${String(e)}-highlight`, Re) }, e);
|
|
3748
3768
|
case "insert":
|
|
3749
|
-
return /* @__PURE__ */ n.jsx(Yn, { node: t, children:
|
|
3769
|
+
return /* @__PURE__ */ n.jsx(Yn, { node: t, children: qe(t.children, r, `${String(e)}-insert`, Re) }, e);
|
|
3750
3770
|
case "subscript":
|
|
3751
|
-
return /* @__PURE__ */ n.jsx(So, { node: t, children:
|
|
3771
|
+
return /* @__PURE__ */ n.jsx(So, { node: t, children: qe(t.children, r, `${String(e)}-sub`, Re) }, e);
|
|
3752
3772
|
case "superscript":
|
|
3753
|
-
return /* @__PURE__ */ n.jsx(No, { node: t, children:
|
|
3773
|
+
return /* @__PURE__ */ n.jsx(No, { node: t, children: qe(t.children, r, `${String(e)}-sup`, Re) }, e);
|
|
3754
3774
|
case "checkbox":
|
|
3755
3775
|
case "checkbox_input":
|
|
3756
3776
|
return /* @__PURE__ */ n.jsx(an, { node: t, typewriter: r.typewriter }, e);
|
|
@@ -3806,358 +3826,358 @@ const Wo = 32, Ho = 900, zo = ({
|
|
|
3806
3826
|
indexPrefix: o,
|
|
3807
3827
|
containerRef: a
|
|
3808
3828
|
}) => {
|
|
3809
|
-
var
|
|
3810
|
-
const
|
|
3829
|
+
var ze, dt, ct, Ke, mt, le, rt;
|
|
3830
|
+
const u = It(), c = typeof window != "undefined", m = typeof window != "undefined" && typeof window.requestIdleCallback == "function", s = Math.max(0, Math.trunc((ze = t.renderBatchSize) != null ? ze : 80)), g = Math.max(
|
|
3811
3831
|
0,
|
|
3812
|
-
Math.trunc((
|
|
3813
|
-
), f = t.batchRendering !== !1 && s > 0 && c, h = Math.max(0, (
|
|
3832
|
+
Math.trunc((dt = t.initialRenderBatchSize) != null ? dt : s || e.length)
|
|
3833
|
+
), f = t.batchRendering !== !1 && s > 0 && c, h = Math.max(0, (ct = t.liveNodeBuffer) != null ? ct : 60), C = Math.max(1, (Ke = t.maxLiveNodes) != null ? Ke : 320), w = ((mt = t.maxLiveNodes) != null ? mt : 0) > 0 && e.length > C, x = t.viewportPriority !== !1, S = f && ((le = t.maxLiveNodes) != null ? le : 0) <= 0, O = H(() => {
|
|
3814
3834
|
var b;
|
|
3815
|
-
return t.deferNodesUntilVisible === !1 || ((b = t.maxLiveNodes) != null ? b : 0) <= 0 || w || e.length > Ho ? !1 :
|
|
3835
|
+
return t.deferNodesUntilVisible === !1 || ((b = t.maxLiveNodes) != null ? b : 0) <= 0 || w || e.length > Ho ? !1 : x;
|
|
3816
3836
|
}, [
|
|
3817
3837
|
e.length,
|
|
3818
3838
|
t.deferNodesUntilVisible,
|
|
3819
3839
|
t.maxLiveNodes,
|
|
3820
|
-
|
|
3840
|
+
x,
|
|
3821
3841
|
w
|
|
3822
|
-
]), [L, M] =
|
|
3823
|
-
|
|
3842
|
+
]), [L, M] = P(() => S ? Math.min(e.length, g) : e.length), I = R(L);
|
|
3843
|
+
W(() => {
|
|
3824
3844
|
I.current = L;
|
|
3825
3845
|
}, [L]);
|
|
3826
|
-
const
|
|
3846
|
+
const $ = S ? L : e.length, [te, ue] = P(0), [ie, de] = P({ start: 0, end: e.length }), ce = R(/* @__PURE__ */ new Map()), [Se, V] = P(0), re = R({}), we = R(/* @__PURE__ */ new Map()), q = R(/* @__PURE__ */ new Map()), ye = R(/* @__PURE__ */ new Set()), $e = R(L), oe = R(null), Ne = R(null), X = R(null), ne = R(!1), ve = R(null), Fe = R(Math.max(1, s || 1)), ae = R(e.length), st = R({
|
|
3827
3847
|
key: t.indexKey,
|
|
3828
3848
|
total: e.length
|
|
3829
|
-
}),
|
|
3849
|
+
}), Je = R({
|
|
3830
3850
|
batchSize: s,
|
|
3831
3851
|
initial: g,
|
|
3832
|
-
delay: (
|
|
3833
|
-
enabled:
|
|
3834
|
-
}),
|
|
3835
|
-
const b =
|
|
3852
|
+
delay: (rt = t.renderBatchDelay) != null ? rt : 16,
|
|
3853
|
+
enabled: S
|
|
3854
|
+
}), We = O || w, y = H(() => {
|
|
3855
|
+
const b = ce.current;
|
|
3836
3856
|
if (!b.size)
|
|
3837
3857
|
return Wo;
|
|
3838
3858
|
let j = 0;
|
|
3839
|
-
for (const
|
|
3840
|
-
j +=
|
|
3859
|
+
for (const N of b.values())
|
|
3860
|
+
j += N;
|
|
3841
3861
|
return Math.max(16, j / b.size);
|
|
3842
|
-
}, [Se]),
|
|
3862
|
+
}, [Se]), De = H(() => {
|
|
3843
3863
|
if (!w)
|
|
3844
|
-
return e.map((
|
|
3845
|
-
const b = e.length, j = Math.max(0, Math.min(
|
|
3846
|
-
return e.slice(j,
|
|
3847
|
-
node:
|
|
3848
|
-
index: j +
|
|
3864
|
+
return e.map((z, Z) => ({ node: z, index: Z }));
|
|
3865
|
+
const b = e.length, j = Math.max(0, Math.min(ie.start, b)), N = Math.max(j, Math.min(ie.end, b));
|
|
3866
|
+
return e.slice(j, N).map((z, Z) => ({
|
|
3867
|
+
node: z,
|
|
3868
|
+
index: j + Z
|
|
3849
3869
|
}));
|
|
3850
|
-
}, [e,
|
|
3870
|
+
}, [e, ie, w]), be = H(() => {
|
|
3851
3871
|
if (!w)
|
|
3852
3872
|
return e.length;
|
|
3853
|
-
const b = Math.max(
|
|
3873
|
+
const b = Math.max(ie.end + h, g), j = Math.min(e.length, b);
|
|
3854
3874
|
return Math.max(L, j);
|
|
3855
3875
|
}, [
|
|
3856
3876
|
e.length,
|
|
3857
3877
|
w,
|
|
3858
|
-
|
|
3878
|
+
ie.end,
|
|
3859
3879
|
h,
|
|
3860
3880
|
g,
|
|
3861
3881
|
L
|
|
3862
3882
|
]);
|
|
3863
|
-
|
|
3864
|
-
const
|
|
3865
|
-
var
|
|
3883
|
+
ae.current = be;
|
|
3884
|
+
const _e = D((b, j) => {
|
|
3885
|
+
var Z;
|
|
3866
3886
|
if (b >= j)
|
|
3867
3887
|
return 0;
|
|
3868
|
-
const
|
|
3869
|
-
let
|
|
3870
|
-
for (let
|
|
3871
|
-
|
|
3872
|
-
return
|
|
3873
|
-
}, [
|
|
3874
|
-
|
|
3875
|
-
}, []),
|
|
3876
|
-
var
|
|
3877
|
-
if (!
|
|
3888
|
+
const N = ce.current;
|
|
3889
|
+
let z = 0;
|
|
3890
|
+
for (let Q = b; Q < j; Q++)
|
|
3891
|
+
z += (Z = N.get(Q)) != null ? Z : y;
|
|
3892
|
+
return z;
|
|
3893
|
+
}, [y]), He = w ? _e(0, Math.min(ie.start, e.length)) : 0, ut = w ? _e(Math.min(ie.end, e.length), e.length) : 0, xe = D(() => {
|
|
3894
|
+
oe.current != null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(oe.current), oe.current = null), Ne.current != null && (window.clearTimeout(Ne.current), Ne.current = null), X.current != null && typeof window.cancelIdleCallback == "function" && (window.cancelIdleCallback(X.current), X.current = null), ne.current = !1, ve.current = null;
|
|
3895
|
+
}, []), vt = D((b) => {
|
|
3896
|
+
var Z;
|
|
3897
|
+
if (!S)
|
|
3878
3898
|
return;
|
|
3879
|
-
const j = Math.max(2, (
|
|
3880
|
-
b > j * 1.2 ?
|
|
3881
|
-
}, [
|
|
3882
|
-
var
|
|
3883
|
-
if (!
|
|
3899
|
+
const j = Math.max(2, (Z = t.renderBatchBudgetMs) != null ? Z : 6), N = Math.max(1, s || 1), z = Math.max(1, Math.floor(N / 4));
|
|
3900
|
+
b > j * 1.2 ? Fe.current = Math.max(z, Math.floor(Fe.current * 0.7)) : b < j * 0.5 && Fe.current < N && (Fe.current = Math.min(N, Math.ceil(Fe.current * 1.2)));
|
|
3901
|
+
}, [S, t.renderBatchBudgetMs, s]), fe = D((b, j = {}) => {
|
|
3902
|
+
var Te, he;
|
|
3903
|
+
if (!S)
|
|
3884
3904
|
return;
|
|
3885
|
-
const
|
|
3886
|
-
if (I.current >=
|
|
3905
|
+
const N = ae.current;
|
|
3906
|
+
if (I.current >= N)
|
|
3887
3907
|
return;
|
|
3888
|
-
const
|
|
3889
|
-
const
|
|
3890
|
-
M((
|
|
3891
|
-
const
|
|
3892
|
-
return I.current =
|
|
3908
|
+
const z = Math.max(1, b), Z = (J) => {
|
|
3909
|
+
const Ze = typeof performance != "undefined" ? performance.now() : Date.now();
|
|
3910
|
+
M((nt) => {
|
|
3911
|
+
const d = Math.min(ae.current, nt + Math.max(1, J));
|
|
3912
|
+
return I.current = d, d;
|
|
3893
3913
|
});
|
|
3894
|
-
const
|
|
3895
|
-
|
|
3896
|
-
},
|
|
3897
|
-
const
|
|
3898
|
-
|
|
3899
|
-
},
|
|
3900
|
-
var
|
|
3901
|
-
|
|
3902
|
-
const
|
|
3903
|
-
|
|
3904
|
-
const
|
|
3905
|
-
if (
|
|
3914
|
+
const ft = typeof performance != "undefined" ? performance.now() : Date.now();
|
|
3915
|
+
vt(ft - Ze);
|
|
3916
|
+
}, Q = () => {
|
|
3917
|
+
const J = Math.max(1, Math.round(Fe.current));
|
|
3918
|
+
fe(J);
|
|
3919
|
+
}, je = (J) => {
|
|
3920
|
+
var d;
|
|
3921
|
+
oe.current = null, Ne.current = null, X.current = null, ne.current = !1;
|
|
3922
|
+
const Ze = ve.current;
|
|
3923
|
+
ve.current = null;
|
|
3924
|
+
const ft = Ze != null ? Ze : z;
|
|
3925
|
+
if (Z(ft), I.current >= ae.current)
|
|
3906
3926
|
return;
|
|
3907
|
-
if (!
|
|
3908
|
-
|
|
3927
|
+
if (!J) {
|
|
3928
|
+
Q();
|
|
3909
3929
|
return;
|
|
3910
3930
|
}
|
|
3911
|
-
const
|
|
3912
|
-
for (; I.current <
|
|
3913
|
-
|
|
3914
|
-
I.current <
|
|
3931
|
+
const nt = Math.max(2, (d = t.renderBatchBudgetMs) != null ? d : 6);
|
|
3932
|
+
for (; I.current < ae.current && !((typeof J.timeRemaining == "function" ? J.timeRemaining() : 0) <= nt * 0.5); )
|
|
3933
|
+
Z(Math.max(1, Math.round(Fe.current)));
|
|
3934
|
+
I.current < ae.current && Q();
|
|
3915
3935
|
};
|
|
3916
3936
|
if (!c || j.immediate) {
|
|
3917
|
-
|
|
3937
|
+
je();
|
|
3918
3938
|
return;
|
|
3919
3939
|
}
|
|
3920
|
-
const
|
|
3921
|
-
if (
|
|
3922
|
-
if (ne.current = !0,
|
|
3923
|
-
const
|
|
3924
|
-
|
|
3940
|
+
const Be = Math.max(0, (Te = t.renderBatchDelay) != null ? Te : 16);
|
|
3941
|
+
if (ve.current = ve.current != null ? Math.max(ve.current, z) : z, !ne.current) {
|
|
3942
|
+
if (ne.current = !0, m) {
|
|
3943
|
+
const J = Math.max(0, (he = t.renderBatchIdleTimeoutMs) != null ? he : 120);
|
|
3944
|
+
X.current = window.requestIdleCallback((Ze) => je(Ze), { timeout: J });
|
|
3925
3945
|
return;
|
|
3926
3946
|
}
|
|
3927
3947
|
if (typeof requestAnimationFrame != "function") {
|
|
3928
|
-
|
|
3948
|
+
Ne.current = window.setTimeout(() => je(), Be);
|
|
3929
3949
|
return;
|
|
3930
3950
|
}
|
|
3931
|
-
|
|
3932
|
-
if (
|
|
3933
|
-
|
|
3951
|
+
oe.current = requestAnimationFrame(() => {
|
|
3952
|
+
if (Be === 0) {
|
|
3953
|
+
je();
|
|
3934
3954
|
return;
|
|
3935
3955
|
}
|
|
3936
|
-
|
|
3956
|
+
Ne.current = window.setTimeout(() => je(), Be);
|
|
3937
3957
|
});
|
|
3938
3958
|
}
|
|
3939
3959
|
}, [
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3960
|
+
vt,
|
|
3961
|
+
m,
|
|
3962
|
+
S,
|
|
3943
3963
|
c,
|
|
3944
3964
|
t.renderBatchDelay,
|
|
3945
3965
|
t.renderBatchBudgetMs,
|
|
3946
3966
|
t.renderBatchIdleTimeoutMs
|
|
3947
3967
|
]);
|
|
3948
|
-
|
|
3949
|
-
var
|
|
3950
|
-
const b = t.indexKey, j = e.length,
|
|
3968
|
+
W(() => {
|
|
3969
|
+
var he;
|
|
3970
|
+
const b = t.indexKey, j = e.length, N = st.current, z = b !== void 0 ? b !== N.key : j !== N.total;
|
|
3951
3971
|
st.current = { key: b, total: j };
|
|
3952
|
-
const
|
|
3953
|
-
if (
|
|
3972
|
+
const Z = Je.current, Q = (he = t.renderBatchDelay) != null ? he : 16, je = Z.batchSize !== s || Z.initial !== g || Z.delay !== Q || Z.enabled !== S;
|
|
3973
|
+
if (Je.current = {
|
|
3954
3974
|
batchSize: s,
|
|
3955
3975
|
initial: g,
|
|
3956
|
-
delay:
|
|
3957
|
-
enabled:
|
|
3958
|
-
}, (
|
|
3976
|
+
delay: Q,
|
|
3977
|
+
enabled: S
|
|
3978
|
+
}, (z || je || !S) && xe(), (z || je) && (Fe.current = Math.max(1, s || 1), ye.current.clear()), !j) {
|
|
3959
3979
|
I.current = 0, M(0);
|
|
3960
3980
|
return;
|
|
3961
3981
|
}
|
|
3962
|
-
const
|
|
3963
|
-
if (!
|
|
3964
|
-
I.current =
|
|
3982
|
+
const Be = ae.current;
|
|
3983
|
+
if (!S) {
|
|
3984
|
+
I.current = Be, M(Be);
|
|
3965
3985
|
return;
|
|
3966
3986
|
}
|
|
3967
|
-
if (
|
|
3968
|
-
const
|
|
3969
|
-
I.current =
|
|
3987
|
+
if (z || je) {
|
|
3988
|
+
const J = Math.min(Be, g);
|
|
3989
|
+
I.current = J, M(J), J < Be && fe(Math.max(1, g), { immediate: !c });
|
|
3970
3990
|
return;
|
|
3971
3991
|
}
|
|
3972
|
-
const
|
|
3973
|
-
|
|
3992
|
+
const Te = Math.min(I.current, Be);
|
|
3993
|
+
Te !== I.current && (I.current = Te, M(Te)), I.current < Be && fe(Math.max(1, s || 1));
|
|
3974
3994
|
}, [
|
|
3975
|
-
|
|
3976
|
-
|
|
3995
|
+
xe,
|
|
3996
|
+
S,
|
|
3977
3997
|
c,
|
|
3978
3998
|
e.length,
|
|
3979
3999
|
t.indexKey,
|
|
3980
4000
|
t.renderBatchDelay,
|
|
3981
4001
|
s,
|
|
3982
4002
|
g,
|
|
3983
|
-
|
|
3984
|
-
]),
|
|
4003
|
+
fe
|
|
4004
|
+
]), W(() => {
|
|
3985
4005
|
if (!w) {
|
|
3986
|
-
|
|
4006
|
+
de({ start: 0, end: e.length });
|
|
3987
4007
|
return;
|
|
3988
4008
|
}
|
|
3989
4009
|
const b = e.length;
|
|
3990
4010
|
if (!b) {
|
|
3991
|
-
|
|
4011
|
+
de({ start: 0, end: 0 });
|
|
3992
4012
|
return;
|
|
3993
4013
|
}
|
|
3994
|
-
const j = Math.max(0, Math.min(
|
|
3995
|
-
let
|
|
3996
|
-
const
|
|
3997
|
-
if (
|
|
3998
|
-
const
|
|
3999
|
-
|
|
4000
|
-
} else if (
|
|
4001
|
-
const
|
|
4002
|
-
|
|
4003
|
-
}
|
|
4004
|
-
|
|
4005
|
-
}, [
|
|
4006
|
-
|
|
4014
|
+
const j = Math.max(0, Math.min(te, b - 1));
|
|
4015
|
+
let N = Math.max(0, j - h), z = Math.min(b, j + h + 1);
|
|
4016
|
+
const Z = z - N;
|
|
4017
|
+
if (Z > C) {
|
|
4018
|
+
const Q = Z - C;
|
|
4019
|
+
N += Math.ceil(Q / 2), z -= Math.floor(Q / 2);
|
|
4020
|
+
} else if (Z < C) {
|
|
4021
|
+
const Q = C - Z;
|
|
4022
|
+
N = Math.max(0, N - Math.ceil(Q / 2)), z = Math.min(b, z + Math.floor(Q / 2));
|
|
4023
|
+
}
|
|
4024
|
+
de({ start: N, end: z });
|
|
4025
|
+
}, [te, h, C, e.length, w]), W(() => () => {
|
|
4026
|
+
xe();
|
|
4007
4027
|
for (const b of we.current.values())
|
|
4008
4028
|
b.destroy();
|
|
4009
4029
|
we.current.clear();
|
|
4010
|
-
}, [
|
|
4011
|
-
const
|
|
4012
|
-
for (const [j,
|
|
4013
|
-
j >= b && (
|
|
4030
|
+
}, [xe]);
|
|
4031
|
+
const Xe = D((b) => {
|
|
4032
|
+
for (const [j, N] of we.current.entries())
|
|
4033
|
+
j >= b && (N.destroy(), we.current.delete(j), delete re.current[j], q.current.delete(j));
|
|
4014
4034
|
}, []);
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
}, [
|
|
4035
|
+
W(() => {
|
|
4036
|
+
Xe($);
|
|
4037
|
+
}, [Xe, $]), W(() => {
|
|
4018
4038
|
const b = e.length;
|
|
4019
4039
|
let j = !1;
|
|
4020
|
-
for (const
|
|
4021
|
-
|
|
4022
|
-
j &&
|
|
4023
|
-
for (const
|
|
4024
|
-
Number(
|
|
4025
|
-
for (const
|
|
4026
|
-
|
|
4040
|
+
for (const N of Array.from(ce.current.keys()))
|
|
4041
|
+
N >= b && (ce.current.delete(N), j = !0);
|
|
4042
|
+
j && V((N) => N + 1);
|
|
4043
|
+
for (const N of Object.keys(re.current))
|
|
4044
|
+
Number(N) >= b && delete re.current[N];
|
|
4045
|
+
for (const N of Array.from(ye.current))
|
|
4046
|
+
N >= b && ye.current.delete(N);
|
|
4027
4047
|
}, [e.length]);
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4030
|
-
}, [
|
|
4048
|
+
const Le = D((b, j) => {
|
|
4049
|
+
O && j && (re.current[b] = !0), j && w && ue((N) => b > N ? b : N);
|
|
4050
|
+
}, [O, w]), Ie = D((b) => {
|
|
4031
4051
|
const j = we.current.get(b);
|
|
4032
4052
|
j && (j.destroy(), we.current.delete(b));
|
|
4033
|
-
}, []),
|
|
4034
|
-
const
|
|
4035
|
-
if (j ?
|
|
4036
|
-
|
|
4053
|
+
}, []), U = D((b, j) => {
|
|
4054
|
+
const N = q.current;
|
|
4055
|
+
if (j ? N.set(b, j) : N.delete(b), !We || !j) {
|
|
4056
|
+
Ie(b), O && !j && delete re.current[b], j && Le(b, !0);
|
|
4037
4057
|
return;
|
|
4038
4058
|
}
|
|
4039
4059
|
if (b < g && !w) {
|
|
4040
|
-
|
|
4060
|
+
Ie(b), Le(b, !0);
|
|
4041
4061
|
return;
|
|
4042
4062
|
}
|
|
4043
|
-
|
|
4044
|
-
const
|
|
4045
|
-
we.current.set(b,
|
|
4063
|
+
Ie(b);
|
|
4064
|
+
const z = u(j, { rootMargin: "400px" });
|
|
4065
|
+
we.current.set(b, z), z.isVisible() && Le(b, !0), z.whenVisible.then(() => Le(b, !0)).catch(() => {
|
|
4046
4066
|
});
|
|
4047
4067
|
}, [
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4068
|
+
O,
|
|
4069
|
+
Ie,
|
|
4070
|
+
Le,
|
|
4071
|
+
u,
|
|
4052
4072
|
g,
|
|
4053
|
-
|
|
4073
|
+
We,
|
|
4054
4074
|
w
|
|
4055
|
-
]),
|
|
4075
|
+
]), Ue = D((b, j) => {
|
|
4056
4076
|
if (!j) {
|
|
4057
|
-
|
|
4077
|
+
ce.current.has(b) && (ce.current.delete(b), V((z) => z + 1));
|
|
4058
4078
|
return;
|
|
4059
4079
|
}
|
|
4060
|
-
const
|
|
4061
|
-
const
|
|
4062
|
-
if (!
|
|
4080
|
+
const N = () => {
|
|
4081
|
+
const z = j.offsetHeight;
|
|
4082
|
+
if (!z)
|
|
4063
4083
|
return;
|
|
4064
|
-
|
|
4084
|
+
ce.current.get(b) !== z && (ce.current.set(b, z), V((Q) => Q + 1));
|
|
4065
4085
|
};
|
|
4066
|
-
typeof queueMicrotask == "function" ? queueMicrotask(
|
|
4067
|
-
}, []),
|
|
4086
|
+
typeof queueMicrotask == "function" ? queueMicrotask(N) : Promise.resolve().then(N);
|
|
4087
|
+
}, []), bt = D((b) => S && b >= I.current ? !1 : !O || b < g ? !0 : re.current[b] === !0, [O, S, g]), Ge = D((b) => (j) => {
|
|
4068
4088
|
if (!b)
|
|
4069
4089
|
return;
|
|
4070
|
-
const
|
|
4071
|
-
|
|
4090
|
+
const N = j.target;
|
|
4091
|
+
N != null && N.closest("[data-node-index]") && b(j);
|
|
4072
4092
|
}, []);
|
|
4073
|
-
|
|
4074
|
-
for (const [b, j] of
|
|
4075
|
-
j &&
|
|
4076
|
-
}, [
|
|
4077
|
-
w && L >
|
|
4093
|
+
W(() => {
|
|
4094
|
+
for (const [b, j] of q.current.entries())
|
|
4095
|
+
j && U(b, j);
|
|
4096
|
+
}, [U]), W(() => {
|
|
4097
|
+
w && L > $e.current && ue(L - 1), $e.current = L;
|
|
4078
4098
|
}, [L, w]);
|
|
4079
|
-
const
|
|
4099
|
+
const et = w ? /* @__PURE__ */ n.jsx("div", { className: "node-spacer", style: { height: `${He}px` }, "aria-hidden": "true" }) : null, Me = w ? /* @__PURE__ */ n.jsx("div", { className: "node-spacer", style: { height: `${ut}px` }, "aria-hidden": "true" }) : null;
|
|
4080
4100
|
return /* @__PURE__ */ n.jsxs(
|
|
4081
4101
|
"div",
|
|
4082
4102
|
{
|
|
4083
4103
|
ref: a,
|
|
4084
4104
|
className: `markstream-vue markdown-renderer${t.isDark ? " dark" : ""}${w ? " virtualized" : ""}`,
|
|
4085
4105
|
onClick: t.onClick,
|
|
4086
|
-
onMouseOver:
|
|
4087
|
-
onMouseOut:
|
|
4106
|
+
onMouseOver: Ge(t.onMouseOver),
|
|
4107
|
+
onMouseOut: Ge(t.onMouseOut),
|
|
4088
4108
|
children: [
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
var
|
|
4092
|
-
const
|
|
4093
|
-
return
|
|
4109
|
+
et,
|
|
4110
|
+
De.map(({ node: b, index: j }) => {
|
|
4111
|
+
var Q;
|
|
4112
|
+
const N = bt(j), z = (Q = ce.current.get(j)) != null ? Q : y, Z = t.typewriter !== !1 && b.type !== "code_block" && !ye.current.has(j) && N;
|
|
4113
|
+
return Z && ye.current.add(j), /* @__PURE__ */ n.jsx(
|
|
4094
4114
|
"div",
|
|
4095
4115
|
{
|
|
4096
|
-
ref: (
|
|
4116
|
+
ref: (je) => U(j, je),
|
|
4097
4117
|
className: "node-slot",
|
|
4098
4118
|
"data-node-index": j,
|
|
4099
4119
|
"data-node-type": b.type,
|
|
4100
|
-
children:
|
|
4120
|
+
children: N ? /* @__PURE__ */ n.jsx(
|
|
4101
4121
|
"div",
|
|
4102
4122
|
{
|
|
4103
|
-
ref: (
|
|
4104
|
-
className: `node-content${
|
|
4123
|
+
ref: (je) => Ue(j, je),
|
|
4124
|
+
className: `node-content${Z ? " typewriter-node" : ""}`,
|
|
4105
4125
|
children: Re(b, `${o}-${j}`, r)
|
|
4106
4126
|
}
|
|
4107
|
-
) : /* @__PURE__ */ n.jsx("div", { className: "node-placeholder", style: { height: `${
|
|
4127
|
+
) : /* @__PURE__ */ n.jsx("div", { className: "node-placeholder", style: { height: `${z}px` } })
|
|
4108
4128
|
},
|
|
4109
4129
|
`${o}-${j}`
|
|
4110
4130
|
);
|
|
4111
4131
|
}),
|
|
4112
|
-
|
|
4132
|
+
Me
|
|
4113
4133
|
]
|
|
4114
4134
|
}
|
|
4115
4135
|
);
|
|
4116
4136
|
}, Vo = (t) => {
|
|
4117
|
-
const e = { ...Ao, ...t }, r =
|
|
4137
|
+
const e = { ...Ao, ...t }, r = R(null), o = qr(
|
|
4118
4138
|
on,
|
|
4119
4139
|
gr,
|
|
4120
4140
|
gr
|
|
4121
|
-
), a =
|
|
4141
|
+
), a = H(() => e.customId ? `renderer-${e.customId}` : `renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`, [e.customId]), u = H(() => {
|
|
4122
4142
|
const w = cr(e.customId);
|
|
4123
|
-
return Object.keys(w).map(String).map((
|
|
4124
|
-
}, [e.customId, o]), c =
|
|
4125
|
-
var
|
|
4126
|
-
const
|
|
4143
|
+
return Object.keys(w).map(String).map((x) => x.trim().toLowerCase()).filter(Fo);
|
|
4144
|
+
}, [e.customId, o]), c = H(() => {
|
|
4145
|
+
var O, L, M;
|
|
4146
|
+
const x = (L = ((O = e.parseOptions) != null ? O : {}).customHtmlTags) != null ? L : [], S = [
|
|
4127
4147
|
...(M = e.customHtmlTags) != null ? M : [],
|
|
4128
|
-
...Array.isArray(
|
|
4129
|
-
...
|
|
4148
|
+
...Array.isArray(x) ? x : [],
|
|
4149
|
+
...u
|
|
4130
4150
|
].map($o).filter(Boolean);
|
|
4131
|
-
return Array.from(new Set(
|
|
4151
|
+
return Array.from(new Set(S));
|
|
4132
4152
|
}, [
|
|
4133
4153
|
e.customId,
|
|
4134
4154
|
e.customHtmlTags,
|
|
4135
4155
|
e.parseOptions,
|
|
4136
|
-
|
|
4156
|
+
u,
|
|
4137
4157
|
o
|
|
4138
|
-
]),
|
|
4158
|
+
]), m = H(() => {
|
|
4139
4159
|
const w = c;
|
|
4140
4160
|
return !w || w.length === 0 ? Jt(a) : Jt(a, { customHtmlTags: w });
|
|
4141
|
-
}, [a, c]), s =
|
|
4142
|
-
const w =
|
|
4161
|
+
}, [a, c]), s = H(() => {
|
|
4162
|
+
const w = m;
|
|
4143
4163
|
return e.customMarkdownIt ? e.customMarkdownIt(w) : w;
|
|
4144
|
-
}, [
|
|
4145
|
-
var
|
|
4146
|
-
const w = (
|
|
4147
|
-
return
|
|
4164
|
+
}, [m, e.customMarkdownIt]), g = H(() => {
|
|
4165
|
+
var O, L;
|
|
4166
|
+
const w = (O = e.parseOptions) != null ? O : {}, x = (L = e.final) != null ? L : w.final, S = c;
|
|
4167
|
+
return S.length ? {
|
|
4148
4168
|
...w,
|
|
4149
|
-
final:
|
|
4150
|
-
customHtmlTags:
|
|
4151
|
-
} :
|
|
4152
|
-
}, [c, e.final, e.parseOptions]), f =
|
|
4153
|
-
var
|
|
4154
|
-
const w = !!e.debugPerformance && typeof console != "undefined" && typeof performance != "undefined",
|
|
4155
|
-
let
|
|
4156
|
-
return Array.isArray(e.nodes) && e.nodes.length ?
|
|
4157
|
-
ms: Math.round(performance.now() -
|
|
4158
|
-
nodes:
|
|
4159
|
-
contentLength: (L = (
|
|
4160
|
-
}),
|
|
4169
|
+
final: x,
|
|
4170
|
+
customHtmlTags: S
|
|
4171
|
+
} : x == null ? w : { ...w, final: x };
|
|
4172
|
+
}, [c, e.final, e.parseOptions]), f = H(() => {
|
|
4173
|
+
var O, L;
|
|
4174
|
+
const w = !!e.debugPerformance && typeof console != "undefined" && typeof performance != "undefined", x = w ? performance.now() : 0;
|
|
4175
|
+
let S = [];
|
|
4176
|
+
return Array.isArray(e.nodes) && e.nodes.length ? S = e.nodes.map((M) => ({ ...M })) : e.content && (S = Gr(e.content, s != null ? s : Oo, g)), w && console.info("[markstream-react][perf] parse(sync)", {
|
|
4177
|
+
ms: Math.round(performance.now() - x),
|
|
4178
|
+
nodes: S.length,
|
|
4179
|
+
contentLength: (L = (O = e.content) == null ? void 0 : O.length) != null ? L : 0
|
|
4180
|
+
}), S;
|
|
4161
4181
|
}, [
|
|
4162
4182
|
e.content,
|
|
4163
4183
|
e.debugPerformance,
|
|
@@ -4168,22 +4188,22 @@ const Wo = 32, Ho = 900, zo = ({
|
|
|
4168
4188
|
o,
|
|
4169
4189
|
c
|
|
4170
4190
|
]);
|
|
4171
|
-
|
|
4191
|
+
W(() => {
|
|
4172
4192
|
var L, M;
|
|
4173
4193
|
if (typeof window == "undefined" || e.renderCodeBlocksAsPre || !f.some((I) => {
|
|
4174
|
-
var
|
|
4175
|
-
return (I == null ? void 0 : I.type) !== "code_block" ? !1 :
|
|
4194
|
+
var te;
|
|
4195
|
+
return (I == null ? void 0 : I.type) !== "code_block" ? !1 : pt(String((te = I == null ? void 0 : I.language) != null ? te : "")) !== "mermaid";
|
|
4176
4196
|
}))
|
|
4177
4197
|
return;
|
|
4178
|
-
const
|
|
4179
|
-
var
|
|
4180
|
-
return window.setTimeout(() => I({ didTimeout: !0, timeRemaining: () => 0 }), (
|
|
4181
|
-
}),
|
|
4198
|
+
const x = (L = window.requestIdleCallback) != null ? L : ((I, $) => {
|
|
4199
|
+
var te;
|
|
4200
|
+
return window.setTimeout(() => I({ didTimeout: !0, timeRemaining: () => 0 }), (te = $ == null ? void 0 : $.timeout) != null ? te : 600);
|
|
4201
|
+
}), S = (M = window.cancelIdleCallback) != null ? M : ((I) => window.clearTimeout(I)), O = x(() => {
|
|
4182
4202
|
Pr();
|
|
4183
4203
|
}, { timeout: 900 });
|
|
4184
|
-
return () =>
|
|
4204
|
+
return () => S(O);
|
|
4185
4205
|
}, [f, e.renderCodeBlocksAsPre]);
|
|
4186
|
-
const h =
|
|
4206
|
+
const h = H(() => e.indexKey != null ? String(e.indexKey) : "markdown-renderer", [e.indexKey]), C = H(() => ({
|
|
4187
4207
|
customId: e.customId,
|
|
4188
4208
|
isDark: e.isDark,
|
|
4189
4209
|
indexKey: h,
|
|
@@ -4239,9 +4259,9 @@ const Wo = 32, Ho = 900, zo = ({
|
|
|
4239
4259
|
);
|
|
4240
4260
|
};
|
|
4241
4261
|
function Xo(t) {
|
|
4242
|
-
var c,
|
|
4243
|
-
const { node: e, ctx: r, renderNode: o, indexKey: a, children:
|
|
4244
|
-
return /* @__PURE__ */ n.jsx("blockquote", { className: "blockquote-node", dir: "auto", cite: e.cite, children:
|
|
4262
|
+
var c, m, s, g, f, h;
|
|
4263
|
+
const { node: e, ctx: r, renderNode: o, indexKey: a, children: u } = t;
|
|
4264
|
+
return /* @__PURE__ */ n.jsx("blockquote", { className: "blockquote-node", dir: "auto", cite: e.cite, children: u != null ? u : r && o ? /* @__PURE__ */ n.jsx(
|
|
4245
4265
|
Vo,
|
|
4246
4266
|
{
|
|
4247
4267
|
nodes: e.children || [],
|
|
@@ -4254,7 +4274,7 @@ function Xo(t) {
|
|
|
4254
4274
|
renderCodeBlocksAsPre: r.renderCodeBlocksAsPre,
|
|
4255
4275
|
codeBlockProps: r.codeBlockProps,
|
|
4256
4276
|
themes: (c = r.codeBlockThemes) == null ? void 0 : c.themes,
|
|
4257
|
-
codeBlockDarkTheme: (
|
|
4277
|
+
codeBlockDarkTheme: (m = r.codeBlockThemes) == null ? void 0 : m.darkTheme,
|
|
4258
4278
|
codeBlockLightTheme: (s = r.codeBlockThemes) == null ? void 0 : s.lightTheme,
|
|
4259
4279
|
codeBlockMonacoOptions: (g = r.codeBlockThemes) == null ? void 0 : g.monacoOptions,
|
|
4260
4280
|
codeBlockMinWidth: (f = r.codeBlockThemes) == null ? void 0 : f.minWidth,
|
|
@@ -4287,94 +4307,94 @@ function pi(t) {
|
|
|
4287
4307
|
showPreviewButton: !0,
|
|
4288
4308
|
showFontSizeButtons: !0,
|
|
4289
4309
|
...t
|
|
4290
|
-
}, r =
|
|
4291
|
-
var
|
|
4292
|
-
return String((
|
|
4293
|
-
}, [e.node.language]), o =
|
|
4294
|
-
const
|
|
4295
|
-
return
|
|
4296
|
-
}, [a]),
|
|
4297
|
-
const
|
|
4298
|
-
if (
|
|
4299
|
-
return typeof
|
|
4300
|
-
}, be =
|
|
4301
|
-
return be && (
|
|
4302
|
-
}, [e.maxWidth, e.minWidth]), [h, C] =
|
|
4303
|
-
if (!
|
|
4304
|
-
M(""),
|
|
4310
|
+
}, r = H(() => {
|
|
4311
|
+
var y;
|
|
4312
|
+
return String((y = e.node.language) != null ? y : "");
|
|
4313
|
+
}, [e.node.language]), o = H(() => Ko(r), [r]), a = H(() => pt(r), [r]), u = a === "mermaid", c = H(() => {
|
|
4314
|
+
const y = Qt[a] || a;
|
|
4315
|
+
return y ? y.charAt(0).toUpperCase() + y.slice(1) : "Text";
|
|
4316
|
+
}, [a]), m = H(() => ur(a), [a]), { t: s } = lr(), g = H(() => e.isShowPreview ? a === "html" || a === "svg" : !1, [a, e.isShowPreview]), f = H(() => {
|
|
4317
|
+
const y = {}, De = (He) => {
|
|
4318
|
+
if (He != null)
|
|
4319
|
+
return typeof He == "number" ? `${He}px` : String(He);
|
|
4320
|
+
}, be = De(e.minWidth), _e = De(e.maxWidth);
|
|
4321
|
+
return be && (y.minWidth = be), _e && (y.maxWidth = _e), y;
|
|
4322
|
+
}, [e.maxWidth, e.minWidth]), [h, C] = P(!1), [w, x] = P(!1), [S, O] = P(!1), [L, M] = P(""), [I, $] = P(!1), [te, ue] = P(14), [ie, de] = P(te), ce = R(null), Se = R(null), V = R(null), re = R(null), we = R(!1), q = D(() => e.isDark ? e.darkTheme : e.lightTheme, [e.darkTheme, e.isDark, e.lightTheme]), ye = D((y) => {
|
|
4323
|
+
if (!y) {
|
|
4324
|
+
M(""), $(!1);
|
|
4305
4325
|
return;
|
|
4306
4326
|
}
|
|
4307
|
-
M(`<pre class="shiki shiki-fallback"><code>${Uo(
|
|
4308
|
-
}, []),
|
|
4309
|
-
M(""),
|
|
4310
|
-
}, []),
|
|
4311
|
-
if (!(
|
|
4327
|
+
M(`<pre class="shiki shiki-fallback"><code>${Uo(y)}</code></pre>`), $(!1);
|
|
4328
|
+
}, []), $e = D(() => {
|
|
4329
|
+
M(""), $(!0);
|
|
4330
|
+
}, []), oe = D(async () => {
|
|
4331
|
+
if (!(re.current || we.current)) {
|
|
4312
4332
|
we.current = !0;
|
|
4313
4333
|
try {
|
|
4314
|
-
const
|
|
4315
|
-
|
|
4334
|
+
const y = await import("stream-markdown");
|
|
4335
|
+
re.current = y.createShikiStreamRenderer;
|
|
4316
4336
|
} catch {
|
|
4317
4337
|
}
|
|
4318
4338
|
}
|
|
4319
|
-
}, []),
|
|
4320
|
-
var
|
|
4321
|
-
if (
|
|
4322
|
-
(
|
|
4339
|
+
}, []), Ne = D(async () => {
|
|
4340
|
+
var y;
|
|
4341
|
+
if (u) {
|
|
4342
|
+
(y = V.current) == null || y.dispose(), V.current = null, $(!1);
|
|
4323
4343
|
return;
|
|
4324
4344
|
}
|
|
4325
|
-
if (await
|
|
4326
|
-
|
|
4345
|
+
if (await oe(), !ce.current || !Se.current) {
|
|
4346
|
+
ye(e.node.code);
|
|
4327
4347
|
return;
|
|
4328
4348
|
}
|
|
4329
|
-
if (!
|
|
4330
|
-
theme:
|
|
4349
|
+
if (!V.current && re.current && (V.current = re.current(Se.current, {
|
|
4350
|
+
theme: q(),
|
|
4331
4351
|
themes: e.themes
|
|
4332
|
-
}),
|
|
4333
|
-
|
|
4352
|
+
}), $(!0)), !V.current) {
|
|
4353
|
+
ye(e.node.code);
|
|
4334
4354
|
return;
|
|
4335
4355
|
}
|
|
4336
4356
|
if (e.stream === !1 && e.loading) {
|
|
4337
|
-
|
|
4357
|
+
ye(e.node.code);
|
|
4338
4358
|
return;
|
|
4339
4359
|
}
|
|
4340
|
-
|
|
4360
|
+
ye(e.node.code);
|
|
4341
4361
|
try {
|
|
4342
|
-
await
|
|
4362
|
+
await V.current.updateCode(e.node.code, o), $e();
|
|
4343
4363
|
} catch {
|
|
4344
4364
|
}
|
|
4345
|
-
}, [
|
|
4346
|
-
|
|
4347
|
-
var
|
|
4348
|
-
(
|
|
4349
|
-
}), [
|
|
4350
|
-
|
|
4351
|
-
}, [
|
|
4352
|
-
|
|
4365
|
+
}, [$e, oe, q, u, o, e.loading, e.node.code, e.stream, e.themes, ye]);
|
|
4366
|
+
W(() => (Ne(), () => {
|
|
4367
|
+
var y;
|
|
4368
|
+
(y = V.current) == null || y.dispose(), V.current = null;
|
|
4369
|
+
}), [Ne]), W(() => {
|
|
4370
|
+
V.current && V.current.setTheme(q());
|
|
4371
|
+
}, [q]), W(() => {
|
|
4372
|
+
V.current && (e.stream === !1 && e.loading || (ye(e.node.code), Promise.resolve(V.current.updateCode(e.node.code, o)).then(() => $e()).catch(() => {
|
|
4353
4373
|
})));
|
|
4354
|
-
}, [
|
|
4355
|
-
const
|
|
4356
|
-
const be =
|
|
4357
|
-
Ut(be,
|
|
4358
|
-
}, [e.isDark]), ne = D(() =>
|
|
4359
|
-
var
|
|
4374
|
+
}, [$e, o, e.loading, e.node.code, e.stream, ye]);
|
|
4375
|
+
const X = D((y, De) => {
|
|
4376
|
+
const be = y.currentTarget;
|
|
4377
|
+
Ut(be, De, "top", !1, { x: y.clientX, y: y.clientY }, e.isDark);
|
|
4378
|
+
}, [e.isDark]), ne = D(() => Oe(), []), ve = D(async () => {
|
|
4379
|
+
var y;
|
|
4360
4380
|
try {
|
|
4361
|
-
typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && await navigator.clipboard.writeText(e.node.code), C(!0), (
|
|
4381
|
+
typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && await navigator.clipboard.writeText(e.node.code), C(!0), (y = e.onCopy) == null || y.call(e, e.node.code), setTimeout(() => C(!1), 1e3);
|
|
4362
4382
|
} catch {
|
|
4363
4383
|
}
|
|
4364
|
-
}, [e]),
|
|
4365
|
-
var
|
|
4384
|
+
}, [e]), Fe = D(() => {
|
|
4385
|
+
var _e;
|
|
4366
4386
|
if (!g)
|
|
4367
4387
|
return;
|
|
4368
|
-
const
|
|
4369
|
-
(
|
|
4370
|
-
type:
|
|
4388
|
+
const y = o, De = y === "html" ? "text/html" : "image/svg+xml", be = y === "html" ? "HTML Preview" : "SVG Preview";
|
|
4389
|
+
(_e = e.onPreviewCode) == null || _e.call(e, {
|
|
4390
|
+
type: De,
|
|
4371
4391
|
content: e.node.code,
|
|
4372
4392
|
title: be
|
|
4373
4393
|
});
|
|
4374
|
-
}, [g, o, e]),
|
|
4375
|
-
return
|
|
4376
|
-
ue(14),
|
|
4377
|
-
}, []),
|
|
4394
|
+
}, [g, o, e]), ae = H(() => ({ fontSize: `${ie}px` }), [ie]), st = () => de((y) => Math.max(10, y - 1)), Je = () => de((y) => Math.min(36, y + 1)), We = () => de(te);
|
|
4395
|
+
return W(() => {
|
|
4396
|
+
ue(14), de(14);
|
|
4397
|
+
}, []), u ? /* @__PURE__ */ n.jsx(
|
|
4378
4398
|
Hr,
|
|
4379
4399
|
{
|
|
4380
4400
|
node: e.node,
|
|
@@ -4401,7 +4421,7 @@ function pi(t) {
|
|
|
4401
4421
|
"span",
|
|
4402
4422
|
{
|
|
4403
4423
|
className: "icon-slot h-4 w-4 flex-shrink-0",
|
|
4404
|
-
dangerouslySetInnerHTML: { __html:
|
|
4424
|
+
dangerouslySetInnerHTML: { __html: m }
|
|
4405
4425
|
}
|
|
4406
4426
|
),
|
|
4407
4427
|
/* @__PURE__ */ n.jsx("span", { className: "text-sm font-medium font-mono", children: c })
|
|
@@ -4412,16 +4432,16 @@ function pi(t) {
|
|
|
4412
4432
|
{
|
|
4413
4433
|
type: "button",
|
|
4414
4434
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4415
|
-
"aria-pressed":
|
|
4416
|
-
onClick: () =>
|
|
4417
|
-
onMouseEnter: (
|
|
4418
|
-
onFocus: (
|
|
4435
|
+
"aria-pressed": S,
|
|
4436
|
+
onClick: () => O((y) => !y),
|
|
4437
|
+
onMouseEnter: (y) => X(y, S ? s("common.expand") || "Expand" : s("common.collapse") || "Collapse"),
|
|
4438
|
+
onFocus: (y) => X(y, S ? s("common.expand") || "Expand" : s("common.collapse") || "Collapse"),
|
|
4419
4439
|
onMouseLeave: ne,
|
|
4420
4440
|
onBlur: ne,
|
|
4421
4441
|
children: /* @__PURE__ */ n.jsx(
|
|
4422
4442
|
"svg",
|
|
4423
4443
|
{
|
|
4424
|
-
style: { rotate:
|
|
4444
|
+
style: { rotate: S ? "0deg" : "90deg" },
|
|
4425
4445
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4426
4446
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4427
4447
|
"aria-hidden": "true",
|
|
@@ -4441,10 +4461,10 @@ function pi(t) {
|
|
|
4441
4461
|
{
|
|
4442
4462
|
type: "button",
|
|
4443
4463
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4444
|
-
disabled:
|
|
4464
|
+
disabled: ie <= 10,
|
|
4445
4465
|
onClick: st,
|
|
4446
|
-
onMouseEnter: (
|
|
4447
|
-
onFocus: (
|
|
4466
|
+
onMouseEnter: (y) => X(y, s("common.decrease") || "Decrease"),
|
|
4467
|
+
onFocus: (y) => X(y, s("common.decrease") || "Decrease"),
|
|
4448
4468
|
onMouseLeave: ne,
|
|
4449
4469
|
onBlur: ne,
|
|
4450
4470
|
children: /* @__PURE__ */ n.jsx(
|
|
@@ -4468,10 +4488,10 @@ function pi(t) {
|
|
|
4468
4488
|
{
|
|
4469
4489
|
type: "button",
|
|
4470
4490
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4471
|
-
disabled:
|
|
4472
|
-
onClick:
|
|
4473
|
-
onMouseEnter: (
|
|
4474
|
-
onFocus: (
|
|
4491
|
+
disabled: ie === te,
|
|
4492
|
+
onClick: We,
|
|
4493
|
+
onMouseEnter: (y) => X(y, s("common.reset") || "Reset"),
|
|
4494
|
+
onFocus: (y) => X(y, s("common.reset") || "Reset"),
|
|
4475
4495
|
onMouseLeave: ne,
|
|
4476
4496
|
onBlur: ne,
|
|
4477
4497
|
children: /* @__PURE__ */ n.jsx(
|
|
@@ -4498,10 +4518,10 @@ function pi(t) {
|
|
|
4498
4518
|
{
|
|
4499
4519
|
type: "button",
|
|
4500
4520
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4501
|
-
disabled:
|
|
4502
|
-
onClick:
|
|
4503
|
-
onMouseEnter: (
|
|
4504
|
-
onFocus: (
|
|
4521
|
+
disabled: ie >= 36,
|
|
4522
|
+
onClick: Je,
|
|
4523
|
+
onMouseEnter: (y) => X(y, s("common.increase") || "Increase"),
|
|
4524
|
+
onFocus: (y) => X(y, s("common.increase") || "Increase"),
|
|
4505
4525
|
onMouseLeave: ne,
|
|
4506
4526
|
onBlur: ne,
|
|
4507
4527
|
children: /* @__PURE__ */ n.jsx(
|
|
@@ -4527,9 +4547,9 @@ function pi(t) {
|
|
|
4527
4547
|
type: "button",
|
|
4528
4548
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4529
4549
|
"aria-label": h ? s("common.copied") || "Copied" : s("common.copy") || "Copy",
|
|
4530
|
-
onClick:
|
|
4531
|
-
onMouseEnter: (
|
|
4532
|
-
onFocus: (
|
|
4550
|
+
onClick: ve,
|
|
4551
|
+
onMouseEnter: (y) => X(y, h ? s("common.copied") || "Copied" : s("common.copy") || "Copy"),
|
|
4552
|
+
onFocus: (y) => X(y, h ? s("common.copied") || "Copied" : s("common.copy") || "Copy"),
|
|
4533
4553
|
onMouseLeave: ne,
|
|
4534
4554
|
onBlur: ne,
|
|
4535
4555
|
children: h ? /* @__PURE__ */ n.jsx(
|
|
@@ -4570,9 +4590,9 @@ function pi(t) {
|
|
|
4570
4590
|
type: "button",
|
|
4571
4591
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4572
4592
|
"aria-pressed": w,
|
|
4573
|
-
onClick: () =>
|
|
4574
|
-
onMouseEnter: (
|
|
4575
|
-
onFocus: (
|
|
4593
|
+
onClick: () => x((y) => !y),
|
|
4594
|
+
onMouseEnter: (y) => X(y, w ? s("common.collapse") || "Collapse" : s("common.expand") || "Expand"),
|
|
4595
|
+
onFocus: (y) => X(y, w ? s("common.collapse") || "Collapse" : s("common.expand") || "Expand"),
|
|
4576
4596
|
onMouseLeave: ne,
|
|
4577
4597
|
onBlur: ne,
|
|
4578
4598
|
children: w ? /* @__PURE__ */ n.jsx(
|
|
@@ -4610,9 +4630,9 @@ function pi(t) {
|
|
|
4610
4630
|
type: "button",
|
|
4611
4631
|
className: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
4612
4632
|
"aria-label": s("common.preview") || "Preview",
|
|
4613
|
-
onClick:
|
|
4614
|
-
onMouseEnter: (
|
|
4615
|
-
onFocus: (
|
|
4633
|
+
onClick: Fe,
|
|
4634
|
+
onMouseEnter: (y) => X(y, s("common.preview") || "Preview"),
|
|
4635
|
+
onFocus: (y) => X(y, s("common.preview") || "Preview"),
|
|
4616
4636
|
onMouseLeave: ne,
|
|
4617
4637
|
onBlur: ne,
|
|
4618
4638
|
children: /* @__PURE__ */ n.jsx(
|
|
@@ -4638,13 +4658,13 @@ function pi(t) {
|
|
|
4638
4658
|
]
|
|
4639
4659
|
}
|
|
4640
4660
|
),
|
|
4641
|
-
!
|
|
4661
|
+
!S && (e.stream ? !0 : !e.loading) && /* @__PURE__ */ n.jsxs(
|
|
4642
4662
|
"div",
|
|
4643
4663
|
{
|
|
4644
|
-
ref:
|
|
4664
|
+
ref: ce,
|
|
4645
4665
|
className: "code-block-content",
|
|
4646
4666
|
style: {
|
|
4647
|
-
...
|
|
4667
|
+
...ae,
|
|
4648
4668
|
maxHeight: w ? "none" : "500px",
|
|
4649
4669
|
overflow: w ? "visible" : "auto"
|
|
4650
4670
|
},
|
|
@@ -4681,9 +4701,9 @@ function Yo(t) {
|
|
|
4681
4701
|
return !1;
|
|
4682
4702
|
}
|
|
4683
4703
|
function wi(t) {
|
|
4684
|
-
var
|
|
4685
|
-
const e =
|
|
4686
|
-
return
|
|
4704
|
+
var m;
|
|
4705
|
+
const e = R(null), [r, o] = P(!1), [a, u] = P({ transform: "translate3d(0px, 0px, 0px)", left: "0px", top: "0px" }), c = H(() => Yo(t.isDark), [t.isDark]);
|
|
4706
|
+
return W(() => {
|
|
4687
4707
|
if (!t.visible) {
|
|
4688
4708
|
o(!1);
|
|
4689
4709
|
return;
|
|
@@ -4694,15 +4714,15 @@ function wi(t) {
|
|
|
4694
4714
|
}
|
|
4695
4715
|
let s = null, g = !1;
|
|
4696
4716
|
const f = async () => {
|
|
4697
|
-
var w,
|
|
4717
|
+
var w, x;
|
|
4698
4718
|
if (!t.anchorEl || !e.current)
|
|
4699
4719
|
return;
|
|
4700
4720
|
const { x: h, y: C } = await Er(t.anchorEl, e.current, {
|
|
4701
4721
|
placement: (w = t.placement) != null ? w : "top",
|
|
4702
|
-
middleware: [Tr((
|
|
4722
|
+
middleware: [Tr((x = t.offset) != null ? x : 8), Rr(), Sr({ padding: 8 })],
|
|
4703
4723
|
strategy: "fixed"
|
|
4704
4724
|
});
|
|
4705
|
-
g ||
|
|
4725
|
+
g || u({
|
|
4706
4726
|
position: "fixed",
|
|
4707
4727
|
left: "0px",
|
|
4708
4728
|
top: "0px",
|
|
@@ -4718,7 +4738,7 @@ function wi(t) {
|
|
|
4718
4738
|
/* @__PURE__ */ n.jsx(
|
|
4719
4739
|
"div",
|
|
4720
4740
|
{
|
|
4721
|
-
id: (
|
|
4741
|
+
id: (m = t.id) != null ? m : void 0,
|
|
4722
4742
|
ref: e,
|
|
4723
4743
|
style: a,
|
|
4724
4744
|
className: [
|
|
@@ -4787,7 +4807,7 @@ export {
|
|
|
4787
4807
|
ur as getLanguageIcon,
|
|
4788
4808
|
fi as getMermaidWorkerLoad,
|
|
4789
4809
|
Qt as languageMap,
|
|
4790
|
-
|
|
4810
|
+
pt as normalizeLanguageIdentifier,
|
|
4791
4811
|
ei as removeCustomComponents,
|
|
4792
4812
|
Zn as renderKaTeXInWorker,
|
|
4793
4813
|
$r as renderKaTeXWithBackpressure,
|