@aiquants/markdown 13.5.1 → 13.6.1
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/extractHeadings-BOJs4vWR.cjs +12 -0
- package/dist/{extractHeadings-BmRzzwg1.js → extractHeadings-CFRjiMP5.js} +603 -602
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mermaidFrame/NOTICES.md +1 -1
- package/package.json +9 -8
- package/dist/extractHeadings-BCQiyUSk.cjs +0 -12
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import dl from "
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import wl from "
|
|
15
|
-
import bl from "
|
|
1
|
+
import { isInputMethodKey as Hs } from "@aiquants/input-method";
|
|
2
|
+
import Oi, { useRef as W, useCallback as V, useState as F, useLayoutEffect as Ze, forwardRef as Us, createElement as un, Component as Yn, useSyncExternalStore as Mt, createContext as _i, useContext as Ri, useEffect as xe, useMemo as te, useId as tt, memo as Wt, Suspense as Ai, useReducer as Ni, use as ji, Fragment as Qr, useEffectEvent as Ci, isValidElement as Mi } from "react";
|
|
3
|
+
import { c as Li, d as Ii, b as Di, e as Pi, i as $i, f as zi, g as Fi, N as Ws, h as Gs, j as Bi } from "./linkCards-DfSLqLPF.js";
|
|
4
|
+
import { i as qi, a as Dr, b as So, r as Hi, D as Ui } from "./providers-CSvkTZsr.js";
|
|
5
|
+
import { DOCUMENT_FONT_FAMILY_PROPERTY as ko, DEFAULT_MARKDOWN_STYLES as Wi, CONTENT_ALIGNS as ar, DEFAULT_CONTENT_ALIGN as Gi, CONTENT_MEASURES as ir, DEFAULT_CONTENT_MEASURE as Vi, CONTENT_COLORS as lr, DEFAULT_CONTENT_COLORS as To } from "./viewer-settings.js";
|
|
6
|
+
import { i as Ki, E as Yi, n as Vs, f as Ks, a as Ys, r as Xi, b as Zi, c as Xs, p as Ji, d as Qi } from "./embeds-Dra-dGKD.js";
|
|
7
|
+
import el, { htmlToDOM as tl, Element as nt, domToReact as kt, attributesToProps as _t, Text as Xn } from "html-react-parser";
|
|
8
|
+
import { O as Zs, C as Js, F as Qs, f as Ke, S as Pr, b as cr, c as nl, p as rl, d as ol, e as ea } from "./code-blocks-C6J8rVTc.js";
|
|
9
|
+
import { SOURCE_LINES_ATTRIBUTE as Zn, parseSourceLines as ta } from "./source-lines.js";
|
|
10
|
+
import { l as sl, L as al, a as il } from "./simple-logger-DwH1YQvq.js";
|
|
11
|
+
import { codeToHtml as ll, isSpecialLang as cl, bundledLanguages as dl } from "shiki";
|
|
12
|
+
import ul from "dompurify";
|
|
13
|
+
import { SPREADSHEET_ZOOM_STEPS as fl, SPREADSHEET_COLUMN_HEADER_HEIGHT_PX as ml, SPREADSHEET_SCROLLBAR_SIZE_PX as hl, columnIndexToName as Bn, SPREADSHEET_ZOOM_MAX as na, SPREADSHEET_MAX_OPERATION_CELLS as Tn, clampSpreadsheetZoom as pl, stepSpreadsheetZoom as gl, SPREADSHEET_ZOOM_MIN as yl } from "@aiquants/spreadsheet/view";
|
|
14
|
+
import { measureTsv as xl, parseTsv as wl, serializeTsv as ra } from "@aiquants/spreadsheet/tsv";
|
|
15
|
+
import bl from "github-slugger";
|
|
16
|
+
import El from "katex";
|
|
16
17
|
import { visit as et } from "unist-util-visit";
|
|
17
|
-
const
|
|
18
|
+
const vl = (e) => {
|
|
18
19
|
if (e !== void 0) {
|
|
19
20
|
if (typeof e != "string")
|
|
20
21
|
throw new TypeError(`[@aiquants/markdown] labelsLang must be a string; got ${e === null ? "null" : typeof e}`);
|
|
@@ -25,7 +26,7 @@ const El = (e) => {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}, ft = (e, t, n) => {
|
|
28
|
-
const r =
|
|
29
|
+
const r = vl(n), o = {};
|
|
29
30
|
for (const s of Object.keys(e)) {
|
|
30
31
|
const a = t?.[s];
|
|
31
32
|
if (a === void 0) {
|
|
@@ -46,18 +47,18 @@ const El = (e) => {
|
|
|
46
47
|
copy: { text: "Copy the code", lang: "en" },
|
|
47
48
|
copied: { text: "Copied the code.", lang: "en" },
|
|
48
49
|
copyFailed: { text: "Could not copy the code.", lang: "en" }
|
|
49
|
-
}),
|
|
50
|
+
}), Px = Gt(Jn), yn = Object.freeze({
|
|
50
51
|
copy: { text: "Copy the formula", lang: "en" },
|
|
51
52
|
copied: { text: "Copied the formula.", lang: "en" },
|
|
52
53
|
copyFailed: { text: "Could not copy the formula.", lang: "en" }
|
|
53
|
-
}),
|
|
54
|
+
}), $x = Gt(yn), Sl = ft(yn, void 0, void 0), Qn = Object.freeze({
|
|
54
55
|
embeddedVideo: { text: "embedded video", lang: "en" },
|
|
55
56
|
embeddedPost: { text: "embedded post", lang: "en" },
|
|
56
57
|
embeddedFrame: { text: "Embedded content", lang: "en" }
|
|
57
|
-
}),
|
|
58
|
+
}), zx = Gt(Qn), oa = (e, t) => ft(Qn, e, t), kl = oa(void 0, void 0);
|
|
58
59
|
var On = { exports: {} }, en = {};
|
|
59
60
|
var Oo;
|
|
60
|
-
function
|
|
61
|
+
function Tl() {
|
|
61
62
|
if (Oo) return en;
|
|
62
63
|
Oo = 1;
|
|
63
64
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -80,7 +81,7 @@ function kl() {
|
|
|
80
81
|
}
|
|
81
82
|
var tn = {};
|
|
82
83
|
var _o;
|
|
83
|
-
function
|
|
84
|
+
function Ol() {
|
|
84
85
|
return _o || (_o = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
85
86
|
function e(p) {
|
|
86
87
|
if (p == null) return null;
|
|
@@ -275,7 +276,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
275
276
|
function m(p) {
|
|
276
277
|
return typeof p == "object" && p !== null && p.$$typeof === g;
|
|
277
278
|
}
|
|
278
|
-
var w =
|
|
279
|
+
var w = Oi, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), h = /* @__PURE__ */ Symbol.for("react.portal"), y = /* @__PURE__ */ Symbol.for("react.fragment"), b = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.consumer"), x = /* @__PURE__ */ Symbol.for("react.context"), S = /* @__PURE__ */ Symbol.for("react.forward_ref"), R = /* @__PURE__ */ Symbol.for("react.suspense"), D = /* @__PURE__ */ Symbol.for("react.suspense_list"), j = /* @__PURE__ */ Symbol.for("react.memo"), z = /* @__PURE__ */ Symbol.for("react.lazy"), P = /* @__PURE__ */ Symbol.for("react.activity"), B = /* @__PURE__ */ Symbol.for("react.client.reference"), q = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, ue = Array.isArray, ae = console.createTask ? console.createTask : function() {
|
|
279
280
|
return null;
|
|
280
281
|
};
|
|
281
282
|
w = {
|
|
@@ -311,13 +312,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
311
312
|
})()), tn;
|
|
312
313
|
}
|
|
313
314
|
var Ro;
|
|
314
|
-
function
|
|
315
|
-
return Ro || (Ro = 1, process.env.NODE_ENV === "production" ? On.exports =
|
|
315
|
+
function _l() {
|
|
316
|
+
return Ro || (Ro = 1, process.env.NODE_ENV === "production" ? On.exports = Tl() : On.exports = Ol()), On.exports;
|
|
316
317
|
}
|
|
317
|
-
var i =
|
|
318
|
-
const
|
|
319
|
-
const t =
|
|
320
|
-
return t === void 0 ?
|
|
318
|
+
var i = _l();
|
|
319
|
+
const Rl = new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh rlh vw vh vi vb vmin vmax svw svh svi svb svmin svmax lvw lvh lvi lvb lvmin lvmax dvw dvh dvi dvb dvmin dvmax cqw cqh cqi cqb cqmin cqmax".split(" ")), Al = /^(?:\d+(?:\.\d+)?|\.\d+)(?:[Ee][+-]?\d+)?([A-Za-z]+)$/u, Nl = /^var\([\t\n\f\r ]*--[A-Za-z0-9_-]+[\t\n\f\r ]*\)$/u, Ao = 'a non-negative CSS length (an unsigned number directly followed by a length unit, such as "54px" or "3.5rem"; no sign, no %) or a custom property reference without a fallback (such as "var(--lane)")', jl = (e) => {
|
|
320
|
+
const t = Al.exec(e)?.[1];
|
|
321
|
+
return t === void 0 ? Nl.test(e) : Rl.has(t.toLowerCase());
|
|
321
322
|
}, eo = (e, t) => {
|
|
322
323
|
if (typeof t == "number") {
|
|
323
324
|
if (!Number.isFinite(t) || t < 0)
|
|
@@ -326,24 +327,24 @@ const _l = new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh
|
|
|
326
327
|
}
|
|
327
328
|
if (typeof t == "string") {
|
|
328
329
|
const n = t.trim();
|
|
329
|
-
if (!
|
|
330
|
+
if (!jl(n))
|
|
330
331
|
throw new RangeError(`[@aiquants/markdown] ${e} as a string must be ${Ao}; got ${JSON.stringify(t)}`);
|
|
331
332
|
return n;
|
|
332
333
|
}
|
|
333
334
|
throw new RangeError(`[@aiquants/markdown] ${e} must be a finite number >= 0 or a string that is ${Ao}; got ${String(t)}`);
|
|
334
|
-
},
|
|
335
|
+
}, sa = 0.01, ln = (e) => {
|
|
335
336
|
const t = Number.parseFloat(e);
|
|
336
337
|
return Number.isFinite(t) ? t : 0;
|
|
337
|
-
},
|
|
338
|
+
}, aa = (e) => {
|
|
338
339
|
const t = e.getBoundingClientRect().height;
|
|
339
340
|
return t > 0 && e.offsetHeight > 0 ? t / e.offsetHeight : 1;
|
|
340
|
-
},
|
|
341
|
+
}, Cl = (e) => Math.max(0, Math.ceil(e - sa)), Ml = 1 / 256, Ll = (e) => e > sa ? e + Ml : 0, No = Object.freeze({ display: "flex", flexDirection: "row", inlineSize: "100%", blockSize: "100%", minInlineSize: 0, minBlockSize: 0 }), Il = Object.freeze({ flex: "1 1 0%", minInlineSize: 0, minBlockSize: 0, overflow: "clip" }), jo = Object.freeze({ display: "flex", flex: "none", minBlockSize: 0 }), Dl = Object.freeze({ position: "absolute", insetBlock: 0, insetInline: 0, overflowY: "scroll", visibility: "hidden", pointerEvents: "none" }), Pl = Object.freeze({ scrollbarWidth: "none" }), $n = "data-aqmd-native-scrollbars-hidden", $l = Object.freeze({ [$n]: "true" }), Co = Object.freeze({ scroller: null, barInlineSize: 0, nativeBarInlineSize: 0 }), Mo = (e, t, n) => {
|
|
341
342
|
const r = getComputedStyle(e), o = ln(r.width), s = e.getBoundingClientRect();
|
|
342
343
|
if (o <= 0 || s.width <= 0)
|
|
343
344
|
return { barInlineSize: 0, nativeBarInlineSize: 0 };
|
|
344
345
|
const a = s.width / o, l = (s.width - t.getBoundingClientRect().width) / a - ln(r.borderLeftWidth) - ln(r.borderRightWidth);
|
|
345
|
-
return { barInlineSize: n.getBoundingClientRect().width / a, nativeBarInlineSize:
|
|
346
|
-
},
|
|
346
|
+
return { barInlineSize: n.getBoundingClientRect().width / a, nativeBarInlineSize: Ll(l) };
|
|
347
|
+
}, zl = (e, t, n, r) => {
|
|
347
348
|
const o = e.style.scrollbarWidth, s = e.getAttribute($n);
|
|
348
349
|
if (o === r && s === null)
|
|
349
350
|
return Mo(e, t, n);
|
|
@@ -353,7 +354,7 @@ const _l = new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh
|
|
|
353
354
|
} finally {
|
|
354
355
|
e.style.scrollbarWidth = o, s !== null && e.setAttribute($n, s);
|
|
355
356
|
}
|
|
356
|
-
},
|
|
357
|
+
}, Fl = (e, t, n, r, o, s) => {
|
|
357
358
|
const [a, l] = F(Co), c = W(o), d = W(0);
|
|
358
359
|
return Ze(() => {
|
|
359
360
|
c.current = o;
|
|
@@ -366,7 +367,7 @@ const _l = new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh
|
|
|
366
367
|
return;
|
|
367
368
|
}
|
|
368
369
|
const g = () => {
|
|
369
|
-
const { barInlineSize: y, nativeBarInlineSize: b } =
|
|
370
|
+
const { barInlineSize: y, nativeBarInlineSize: b } = zl(f, m, w, s);
|
|
370
371
|
l((k) => k.scroller === f && k.barInlineSize === y && k.nativeBarInlineSize === b ? k : Object.freeze({ scroller: f, barInlineSize: y, nativeBarInlineSize: b })), u(y);
|
|
371
372
|
};
|
|
372
373
|
g();
|
|
@@ -375,7 +376,7 @@ const _l = new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh
|
|
|
375
376
|
h.disconnect(), window.removeEventListener("resize", g);
|
|
376
377
|
};
|
|
377
378
|
}, [e, t, n, r, s]), a;
|
|
378
|
-
},
|
|
379
|
+
}, Bl = (e, t) => {
|
|
379
380
|
if (typeof e == "function") {
|
|
380
381
|
const n = e(t);
|
|
381
382
|
return typeof n == "function" ? n : () => e(null);
|
|
@@ -385,11 +386,11 @@ const _l = new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh
|
|
|
385
386
|
}) : () => {
|
|
386
387
|
};
|
|
387
388
|
};
|
|
388
|
-
function
|
|
389
|
-
const c = W(null), d = W(null), u = W(null), f = r !== void 0, m = l === void 0 ? null : eo("barInlineSize", l), w = e.style?.scrollbarWidth ?? "", g =
|
|
389
|
+
function ql({ scrollerProps: e, scrollerRef: t, children: n, renderScrollBar: r, rowClassName: o, rowStyle: s, onBarInlineSizeChange: a, barInlineSize: l }) {
|
|
390
|
+
const c = W(null), d = W(null), u = W(null), f = r !== void 0, m = l === void 0 ? null : eo("barInlineSize", l), w = e.style?.scrollbarWidth ?? "", g = Fl(f, c, d, u, a, w), h = V(
|
|
390
391
|
(T) => {
|
|
391
392
|
c.current = T;
|
|
392
|
-
const x =
|
|
393
|
+
const x = Bl(t, T);
|
|
393
394
|
return () => {
|
|
394
395
|
c.current = null, x();
|
|
395
396
|
};
|
|
@@ -400,28 +401,28 @@ function Bl({ scrollerProps: e, scrollerRef: t, children: n, renderScrollBar: r,
|
|
|
400
401
|
// 内容の箱で測るホストでは余白の分だけ枠からはみ出し、横のスクロールバーと行の終わりの余白まで切れるため、枠の箱で測る
|
|
401
402
|
// 太さを測る探りの箱の包含ブロックにするため位置指定にする (問い合わせの容器は包含ブロックを作らない)
|
|
402
403
|
// 測る前と太さ 0 の間は縦横とも隠す。場所を取るバーが測った後に出ても、広げた幅がそれを打ち消し、本文の幅は動かない
|
|
403
|
-
{ ...e.style, position: "relative", boxSizing: "border-box", overflowY: "scroll", width: `calc(100% + ${g.nativeBarInlineSize}px)`, ...g.nativeBarInlineSize === 0 ?
|
|
404
|
-
) : e.style, b = f && g.nativeBarInlineSize === 0, k = /* @__PURE__ */ i.jsxs("div", { ...e, ...b ?
|
|
404
|
+
{ ...e.style, position: "relative", boxSizing: "border-box", overflowY: "scroll", width: `calc(100% + ${g.nativeBarInlineSize}px)`, ...g.nativeBarInlineSize === 0 ? Pl : void 0 }
|
|
405
|
+
) : e.style, b = f && g.nativeBarInlineSize === 0, k = /* @__PURE__ */ i.jsxs("div", { ...e, ...b ? $l : void 0, ref: h, style: y, children: [
|
|
405
406
|
n,
|
|
406
|
-
f && /* @__PURE__ */ i.jsx("span", { ref: d, "data-aqmd-scroll-bar-probe": !0, "aria-hidden": "true", style:
|
|
407
|
+
f && /* @__PURE__ */ i.jsx("span", { ref: d, "data-aqmd-scroll-bar-probe": !0, "aria-hidden": "true", style: Dl })
|
|
407
408
|
] });
|
|
408
409
|
return f ? /* @__PURE__ */ i.jsxs("div", { "data-aqmd-scroll-row": !0, className: o, style: s === void 0 ? No : { ...No, ...s }, children: [
|
|
409
|
-
/* @__PURE__ */ i.jsx("div", { "data-aqmd-scroll-clip": !0, style:
|
|
410
|
+
/* @__PURE__ */ i.jsx("div", { "data-aqmd-scroll-clip": !0, style: Il, children: k }),
|
|
410
411
|
/* @__PURE__ */ i.jsx("div", { ref: u, "data-aqmd-scroll-bar": !0, style: m === null ? jo : { ...jo, inlineSize: m }, children: g.scroller !== null && r(g.scroller) })
|
|
411
412
|
] }) : k;
|
|
412
413
|
}
|
|
413
|
-
const
|
|
414
|
+
const Hl = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ul = (e) => e.replace(
|
|
414
415
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
415
416
|
(t, n, r) => r ? r.toUpperCase() : n.toLowerCase()
|
|
416
417
|
), Lo = (e) => {
|
|
417
|
-
const t =
|
|
418
|
+
const t = Ul(e);
|
|
418
419
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
419
|
-
},
|
|
420
|
+
}, ia = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim(), Wl = (e) => {
|
|
420
421
|
for (const t in e)
|
|
421
422
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
422
423
|
return !0;
|
|
423
424
|
};
|
|
424
|
-
var
|
|
425
|
+
var Gl = {
|
|
425
426
|
xmlns: "http://www.w3.org/2000/svg",
|
|
426
427
|
width: 24,
|
|
427
428
|
height: 24,
|
|
@@ -432,7 +433,7 @@ var Wl = {
|
|
|
432
433
|
strokeLinecap: "round",
|
|
433
434
|
strokeLinejoin: "round"
|
|
434
435
|
};
|
|
435
|
-
const
|
|
436
|
+
const Vl = Us(
|
|
436
437
|
({
|
|
437
438
|
color: e = "currentColor",
|
|
438
439
|
size: t = 24,
|
|
@@ -446,13 +447,13 @@ const Gl = Hs(
|
|
|
446
447
|
"svg",
|
|
447
448
|
{
|
|
448
449
|
ref: c,
|
|
449
|
-
...
|
|
450
|
+
...Gl,
|
|
450
451
|
width: t,
|
|
451
452
|
height: t,
|
|
452
453
|
stroke: e,
|
|
453
454
|
strokeWidth: r ? Number(n) * 24 / Number(t) : n,
|
|
454
|
-
className:
|
|
455
|
-
...!s && !
|
|
455
|
+
className: ia("lucide", o),
|
|
456
|
+
...!s && !Wl(l) && { "aria-hidden": "true" },
|
|
456
457
|
...l
|
|
457
458
|
},
|
|
458
459
|
[
|
|
@@ -462,12 +463,12 @@ const Gl = Hs(
|
|
|
462
463
|
)
|
|
463
464
|
);
|
|
464
465
|
const se = (e, t) => {
|
|
465
|
-
const n =
|
|
466
|
-
({ className: r, ...o }, s) => un(
|
|
466
|
+
const n = Us(
|
|
467
|
+
({ className: r, ...o }, s) => un(Vl, {
|
|
467
468
|
ref: s,
|
|
468
469
|
iconNode: t,
|
|
469
|
-
className:
|
|
470
|
-
`lucide-${
|
|
470
|
+
className: ia(
|
|
471
|
+
`lucide-${Hl(Lo(e))}`,
|
|
471
472
|
`lucide-${e}`,
|
|
472
473
|
r
|
|
473
474
|
),
|
|
@@ -476,7 +477,7 @@ const se = (e, t) => {
|
|
|
476
477
|
);
|
|
477
478
|
return n.displayName = Lo(e), n;
|
|
478
479
|
};
|
|
479
|
-
const
|
|
480
|
+
const Kl = [
|
|
480
481
|
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }],
|
|
481
482
|
["path", { d: "M10.41 10.41a2 2 0 1 1-2.83-2.83", key: "1bzlo9" }],
|
|
482
483
|
["line", { x1: "13.5", x2: "6", y1: "13.5", y2: "21", key: "1q0aeu" }],
|
|
@@ -489,8 +490,8 @@ const Vl = [
|
|
|
489
490
|
}
|
|
490
491
|
],
|
|
491
492
|
["path", { d: "M21 15V5a2 2 0 0 0-2-2H9", key: "43el77" }]
|
|
492
|
-
],
|
|
493
|
-
class
|
|
493
|
+
], Yl = se("image-off", Kl);
|
|
494
|
+
class la extends Yn {
|
|
494
495
|
/**
|
|
495
496
|
* Starts with the block's content and no failure.
|
|
496
497
|
* ブロックの内容と、失敗の無い状態から始める。
|
|
@@ -533,16 +534,16 @@ class ia extends Yn {
|
|
|
533
534
|
] }) : this.props.children;
|
|
534
535
|
}
|
|
535
536
|
}
|
|
536
|
-
const
|
|
537
|
+
const ca = Object.freeze({
|
|
537
538
|
blockFailed: { text: "This block could not be shown.", lang: "en" }
|
|
538
|
-
}),
|
|
539
|
+
}), Xl = 1024, fn = (e, t) => e.fingerprint === t.fingerprint && e.content === t.content, Zl = (e, t) => {
|
|
539
540
|
let n = 0;
|
|
540
541
|
for (; n < e.length && n < t.length && fn(e[n], t[n]); ) n += 1;
|
|
541
542
|
let r = 0;
|
|
542
543
|
for (; r < e.length - n && r < t.length - n && fn(e[e.length - 1 - r], t[t.length - 1 - r]); ) r += 1;
|
|
543
|
-
const o = Array.from({ length: n }, (l, c) => [c, c]), s = Array.from({ length: r }, (l, c) => [e.length - r + c, t.length - r + c]), a =
|
|
544
|
+
const o = Array.from({ length: n }, (l, c) => [c, c]), s = Array.from({ length: r }, (l, c) => [e.length - r + c, t.length - r + c]), a = Jl(e, t, n, e.length - r, t.length - r);
|
|
544
545
|
return [...o, ...a, ...s];
|
|
545
|
-
},
|
|
546
|
+
}, Jl = (e, t, n, r, o) => {
|
|
546
547
|
const s = new Set(e.slice(n, r).map((x) => x.fingerprint)), a = new Set(t.slice(n, o).map((x) => x.fingerprint)), l = [];
|
|
547
548
|
for (let x = n; x < r; x += 1) a.has(e[x].fingerprint) && l.push(x);
|
|
548
549
|
const c = [];
|
|
@@ -556,7 +557,7 @@ const la = Object.freeze({
|
|
|
556
557
|
}, g = [Int32Array.of(w(0, 0))], h = [Uint8Array.of(dr)], y = u - d;
|
|
557
558
|
let b = 0;
|
|
558
559
|
for (; !(y >= -b && y <= b && g[b][y + b] === d); ) {
|
|
559
|
-
if (b += 1, b >
|
|
560
|
+
if (b += 1, b > Xl) return [];
|
|
560
561
|
const x = g[b - 1], S = (j) => j >= -(b - 1) && j <= b - 1 ? x[j + b - 1] : -1, R = new Int32Array(2 * b + 1).fill(-1), D = new Uint8Array(2 * b + 1);
|
|
561
562
|
for (let j = -b; j <= b; j += 1) {
|
|
562
563
|
if (j < -d || j > u) continue;
|
|
@@ -578,9 +579,9 @@ const la = Object.freeze({
|
|
|
578
579
|
R === Io && k.push([l[j - 1], c[j - 1 + T]]), T = D;
|
|
579
580
|
}
|
|
580
581
|
return k.reverse();
|
|
581
|
-
}, dr = 0, Io = 1, Do = 2, ur = 3,
|
|
582
|
+
}, dr = 0, Io = 1, Do = 2, ur = 3, da = (e, t, n) => {
|
|
582
583
|
const r = e.map(() => null), o = /* @__PURE__ */ new Set(), s = [];
|
|
583
|
-
for (const [d, u] of
|
|
584
|
+
for (const [d, u] of Zl(t, e))
|
|
584
585
|
n.contentOnly && !fn(t[d], e[u]) || (r[u] = t[d].key, o.add(d), s.push([d, u]));
|
|
585
586
|
const a = /* @__PURE__ */ new Map();
|
|
586
587
|
for (const [d, u] of t.entries()) {
|
|
@@ -617,9 +618,9 @@ const la = Object.freeze({
|
|
|
617
618
|
}
|
|
618
619
|
return { ...d, key: f };
|
|
619
620
|
});
|
|
620
|
-
},
|
|
621
|
+
}, Ql = /^[\t\n\f\r ]*$/u, ec = (e, t) => {
|
|
621
622
|
if (t.length === 0) {
|
|
622
|
-
if (!
|
|
623
|
+
if (!Ql.test(e))
|
|
623
624
|
throw new RangeError("MarkdownRenderer: blockOffsets is empty, but htmlContent holds blocks");
|
|
624
625
|
return;
|
|
625
626
|
}
|
|
@@ -633,14 +634,14 @@ const la = Object.freeze({
|
|
|
633
634
|
if (r >= e.length)
|
|
634
635
|
throw new RangeError(`MarkdownRenderer: blockOffsets[${n}] (${r}) must lie inside htmlContent (${e.length} UTF-16 code units)`);
|
|
635
636
|
}
|
|
636
|
-
},
|
|
637
|
+
}, tc = (e, t) => t.map((n, r) => e.slice(n, r + 1 < t.length ? t[r + 1] : e.length)), nc = (e) => {
|
|
637
638
|
if (!Number.isSafeInteger(e))
|
|
638
639
|
throw new RangeError(`MarkdownRenderer: blockKeyEpoch must be a safe integer, got ${e}`);
|
|
639
|
-
},
|
|
640
|
+
}, ua = (e) => (
|
|
640
641
|
// カスタムプロパティへ空の値を書くと CSSOM が消し、var() がフォールバックの無い解決不能となって、表示スタイルの字形を失い地の字形へ落ちる
|
|
641
642
|
e === void 0 || e.trim() === "" ? void 0 : e
|
|
642
643
|
);
|
|
643
|
-
const
|
|
644
|
+
const rc = [
|
|
644
645
|
["path", { d: "M10 12h4", key: "a56b0p" }],
|
|
645
646
|
["path", { d: "M10 8h4", key: "1sr2af" }],
|
|
646
647
|
["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
|
|
@@ -652,42 +653,42 @@ const nc = [
|
|
|
652
653
|
}
|
|
653
654
|
],
|
|
654
655
|
["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
|
|
655
|
-
],
|
|
656
|
-
const
|
|
656
|
+
], oc = se("building-2", rc);
|
|
657
|
+
const sc = [
|
|
657
658
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
658
659
|
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
659
660
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
660
|
-
], Po = se("globe",
|
|
661
|
+
], Po = se("globe", sc), ac = /^[a-z]{2,3}$/u, ic = (e) => {
|
|
661
662
|
const t = e.trim().split("-", 1)[0]?.toLowerCase() ?? "";
|
|
662
|
-
return
|
|
663
|
-
},
|
|
664
|
-
},
|
|
663
|
+
return ac.test(t) ? t : null;
|
|
664
|
+
}, fa = () => () => {
|
|
665
|
+
}, lc = (e) => {
|
|
665
666
|
const t = new MutationObserver(e);
|
|
666
667
|
return t.observe(document.documentElement, { attributes: !0, attributeFilter: ["lang"] }), () => t.disconnect();
|
|
667
|
-
},
|
|
668
|
-
|
|
668
|
+
}, ma = () => Mt(
|
|
669
|
+
fa,
|
|
669
670
|
() => window.location.origin,
|
|
670
671
|
() => null
|
|
671
|
-
),
|
|
672
|
-
|
|
672
|
+
), cc = () => Mt(
|
|
673
|
+
fa,
|
|
673
674
|
() => window.location.href,
|
|
674
675
|
() => null
|
|
675
|
-
),
|
|
676
|
-
|
|
677
|
-
() =>
|
|
676
|
+
), dc = () => Mt(
|
|
677
|
+
lc,
|
|
678
|
+
() => ic(document.documentElement.lang),
|
|
678
679
|
() => null
|
|
679
|
-
),
|
|
680
|
-
const o =
|
|
680
|
+
), uc = /^[1-9]\d{0,4}$/u, $o = (e) => e !== void 0 && uc.test(e.trim()) ? Number(e.trim()) : null, fc = ({ embed: e, label: t, insideAnchor: n, children: r }) => {
|
|
681
|
+
const o = ma(), s = new URL(e.src);
|
|
681
682
|
if (o !== null && s.origin !== o && !n)
|
|
682
683
|
return r;
|
|
683
684
|
const a = $o(e.attributes.width), l = $o(e.attributes.height), c = a !== null && l !== null ? { width: "100%", maxWidth: `${a}px`, aspectRatio: `${a} / ${l}` } : void 0, d = e.attributes.title, u = d === void 0 ? t.lang : void 0;
|
|
684
685
|
return /* @__PURE__ */ i.jsx("span", { "data-embed-frame": o === null ? "pending" : "refused", "data-aqmd-embed-surface": c === void 0 ? void 0 : "", style: c, className: c === void 0 ? void 0 : "flex items-center justify-center rounded-lg p-2 text-center", children: n ? /* @__PURE__ */ i.jsx("span", { lang: u, children: `${d ?? t.text}: ${s.hostname}` }) : /* @__PURE__ */ i.jsx("a", { href: s.href, target: "_blank", rel: "noreferrer", lang: u, children: d ?? `${t.text}: ${s.hostname}` }) });
|
|
685
|
-
},
|
|
686
|
+
}, ha = (e, t) => fetch(e, t), pa = _i(ha), mc = (e) => {
|
|
686
687
|
const t = W(e);
|
|
687
688
|
return Ze(() => {
|
|
688
689
|
t.current = e;
|
|
689
|
-
}, [e]), V((n, r) => (t.current ??
|
|
690
|
-
}, Vt = (e) => new Promise((t) => t(e())),
|
|
690
|
+
}, [e]), V((n, r) => (t.current ?? ha)(n, r), []);
|
|
691
|
+
}, Vt = (e) => new Promise((t) => t(e())), ga = ({ concurrency: e, capacity: t, timeoutMs: n }) => {
|
|
691
692
|
for (const [u, f] of Object.entries({ concurrency: e, capacity: t, timeoutMs: n }))
|
|
692
693
|
if (!Number.isInteger(f) || f <= 0) throw new RangeError(`[@aiquants/markdown] request queue ${u} must be a positive integer; got ${String(f)}`);
|
|
693
694
|
const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = [];
|
|
@@ -728,7 +729,7 @@ const oc = [
|
|
|
728
729
|
h.subscriptions.delete(y), !(h.subscriptions.size > 0 || o.get(u) !== h) && (o.delete(u), h.controller === null ? s.splice(s.indexOf(u), 1) : h.controller.abort());
|
|
729
730
|
};
|
|
730
731
|
} });
|
|
731
|
-
},
|
|
732
|
+
}, hc = ga({ concurrency: 2, capacity: 256, timeoutMs: 15e3 }), pc = "[data-aqmd-scroll-container]", gc = async (e, t, n) => {
|
|
732
733
|
let r;
|
|
733
734
|
try {
|
|
734
735
|
r = await e(t, { credentials: "same-origin", redirect: "error", headers: { accept: "application/json" }, signal: n });
|
|
@@ -737,7 +738,7 @@ const oc = [
|
|
|
737
738
|
return { kind: "error", cause: "network error" };
|
|
738
739
|
}
|
|
739
740
|
if (r.status === 204) {
|
|
740
|
-
const a =
|
|
741
|
+
const a = Ii(r.headers.get(Di));
|
|
741
742
|
return a === null ? { kind: "error", cause: "HTTP 204 without a known skip reason" } : { kind: "skip", reason: a };
|
|
742
743
|
}
|
|
743
744
|
if (!r.ok) return { kind: "error", cause: `HTTP ${r.status}` };
|
|
@@ -748,16 +749,16 @@ const oc = [
|
|
|
748
749
|
if (n.aborted) throw a;
|
|
749
750
|
return { kind: "error", cause: `HTTP ${r.status}, not JSON` };
|
|
750
751
|
}
|
|
751
|
-
const s =
|
|
752
|
+
const s = Pi(o);
|
|
752
753
|
return s === null ? { kind: "error", cause: `HTTP ${r.status}, not a JSON object` } : { kind: "card", metadata: s };
|
|
753
|
-
},
|
|
754
|
+
}, yc = (e) => e.ok ? e.value.kind === "card" ? null : e.value.kind === "skip" ? e.value.reason : e.value.cause : "network error", zo = (e, t) => e !== null && new URL(e).hostname !== t ? e : null, fr = ({ tile: e, tileKind: t, primary: n, secondary: r }) => /* @__PURE__ */ i.jsxs("span", { className: "flex min-w-0 flex-auto items-center gap-3 px-3", children: [
|
|
754
755
|
/* @__PURE__ */ i.jsx("span", { "aria-hidden": "true", "data-link-card-icon": t, className: `flex size-8 shrink-0 items-center justify-center rounded-md bg-(--aqmd-link-card-bg-hover) text-(--aqmd-link-card-muted) ${t === "pending" ? "motion-safe:animate-pulse" : ""}`, children: e }),
|
|
755
756
|
/* @__PURE__ */ i.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
756
757
|
/* @__PURE__ */ i.jsx("span", { className: "truncate font-semibold text-[0.875rem] leading-5", children: n }),
|
|
757
758
|
/* @__PURE__ */ i.jsx("span", { className: "truncate text-(--aqmd-link-card-muted) text-xs leading-4", children: r })
|
|
758
759
|
] })
|
|
759
|
-
] }),
|
|
760
|
-
const o =
|
|
760
|
+
] }), xc = ({ href: e, endpoint: t, size: n, fallback: r }) => {
|
|
761
|
+
const o = cc(), s = o === null ? null : new URL(o).hostname, a = Ri(pa), l = W(null), c = new URL(e), d = `${t}
|
|
761
762
|
${c.href}`, [u, f] = F(null);
|
|
762
763
|
xe(() => {
|
|
763
764
|
const k = l.current;
|
|
@@ -765,17 +766,17 @@ ${c.href}`, [u, f] = F(null);
|
|
|
765
766
|
let T = null;
|
|
766
767
|
const x = new IntersectionObserver(
|
|
767
768
|
(S) => {
|
|
768
|
-
T !== null || !S.some((R) => R.isIntersecting) || (x.disconnect(), T =
|
|
769
|
+
T !== null || !S.some((R) => R.isIntersecting) || (x.disconnect(), T = hc.subscribe(
|
|
769
770
|
d,
|
|
770
|
-
(R) =>
|
|
771
|
+
(R) => gc(a, Li(t, new URL(e), window.location.href), R),
|
|
771
772
|
(R) => {
|
|
772
773
|
f({ key: d, outcome: R });
|
|
773
|
-
const D =
|
|
774
|
-
D !== null &&
|
|
774
|
+
const D = yc(R);
|
|
775
|
+
D !== null && sl.info(`No link card for ${e} (${D})`);
|
|
775
776
|
}
|
|
776
777
|
));
|
|
777
778
|
},
|
|
778
|
-
{ root: k.closest(
|
|
779
|
+
{ root: k.closest(pc), rootMargin: "100% 0px" }
|
|
779
780
|
);
|
|
780
781
|
return x.observe(k), () => {
|
|
781
782
|
x.disconnect(), T?.();
|
|
@@ -794,7 +795,7 @@ ${c.href}`, [u, f] = F(null);
|
|
|
794
795
|
/* @__PURE__ */ i.jsx("span", { className: "truncate text-(--aqmd-link-card-muted) text-xs leading-4", children: e })
|
|
795
796
|
] }) });
|
|
796
797
|
if (w.kind === "skip") {
|
|
797
|
-
const { reason: k } = w, T = k === "private-network", x = T ?
|
|
798
|
+
const { reason: k } = w, T = k === "private-network", x = T ? oc : Po;
|
|
798
799
|
return /* @__PURE__ */ i.jsx("a", { ref: l, href: e, target: "_blank", rel: "noreferrer", "data-link-card": "compact", "data-link-card-reason": k, "data-link-card-size": "compact", children: /* @__PURE__ */ i.jsx(fr, { tile: /* @__PURE__ */ i.jsx(x, { "aria-hidden": "true", className: "size-4" }), tileKind: T ? "internal" : "link", primary: c.hostname, secondary: e }) });
|
|
799
800
|
}
|
|
800
801
|
const { metadata: g } = w, h = zo(g.image, s), y = zo(g.icon, s), b = g.siteName === null ? c.hostname : `${g.siteName} · ${c.hostname}`;
|
|
@@ -817,18 +818,18 @@ ${c.href}`, [u, f] = F(null);
|
|
|
817
818
|
] }),
|
|
818
819
|
h === null ? null : /* @__PURE__ */ i.jsx("img", { src: h, alt: "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
819
820
|
] });
|
|
820
|
-
},
|
|
821
|
+
}, ya = (e) => {
|
|
821
822
|
if (!Array.isArray(e.providers))
|
|
822
823
|
throw new RangeError(`[@aiquants/markdown] embeds.providers must be an array of provider ids; got ${typeof e.providers}`);
|
|
823
824
|
for (const t of e.providers)
|
|
824
|
-
if (!
|
|
825
|
+
if (!qi(t))
|
|
825
826
|
throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Dr.join(", ")}`);
|
|
826
|
-
if (e.linkCardEndpoint !== null &&
|
|
827
|
+
if (e.linkCardEndpoint !== null && !$i(e.linkCardEndpoint))
|
|
827
828
|
throw new RangeError(`[@aiquants/markdown] embeds.linkCardEndpoint must be null or an absolute path without a trailing "/" (segments of A-Z a-z 0-9 . _ ~ -, no "." or ".."); got ${JSON.stringify(e.linkCardEndpoint)}`);
|
|
828
|
-
if (e.linkCardSize !== void 0 &&
|
|
829
|
-
throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${
|
|
830
|
-
if (e.frameSandbox !== void 0 && !
|
|
831
|
-
throw new RangeError(`[@aiquants/markdown] embeds.frameSandbox must be omitted or a list of ${[...
|
|
829
|
+
if (e.linkCardSize !== void 0 && !zi(e.linkCardSize))
|
|
830
|
+
throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Fi.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);
|
|
831
|
+
if (e.frameSandbox !== void 0 && !Ki(e.frameSandbox))
|
|
832
|
+
throw new RangeError(`[@aiquants/markdown] embeds.frameSandbox must be omitted or a list of ${[...Yi].join(", ")}; got ${JSON.stringify(e.frameSandbox)}`);
|
|
832
833
|
return e;
|
|
833
834
|
}, sn = /* @__PURE__ */ new WeakMap();
|
|
834
835
|
let _n = 0;
|
|
@@ -840,16 +841,16 @@ const Fo = (e) => {
|
|
|
840
841
|
if (n === null || !Number.isFinite(n)) return;
|
|
841
842
|
const r = Math.min(So.max, Math.max(So.min, Math.ceil(n)));
|
|
842
843
|
r !== t.last && (t.last = r, t.watch.set(r));
|
|
843
|
-
},
|
|
844
|
+
}, wc = (e, t) => {
|
|
844
845
|
const n = { watch: t, last: null };
|
|
845
846
|
return sn.has(e) || (_n += 1, _n === 1 && window.addEventListener("message", Fo)), sn.set(e, n), () => {
|
|
846
847
|
sn.get(e) === n && (sn.delete(e), _n -= 1, _n === 0 && window.removeEventListener("message", Fo));
|
|
847
848
|
};
|
|
848
|
-
},
|
|
849
|
+
}, bc = ga({ concurrency: 2, capacity: 256, timeoutMs: 5e3 }), Ec = async (e, t) => {
|
|
849
850
|
const n = await fetch(e, { credentials: "omit", redirect: "error", referrerPolicy: "no-referrer", headers: { accept: "application/json" }, signal: t });
|
|
850
851
|
if (!n.ok) throw new Error(`[@aiquants/markdown] embed lookup answered ${n.status}`);
|
|
851
852
|
return await n.json();
|
|
852
|
-
},
|
|
853
|
+
}, vc = (e, t) => {
|
|
853
854
|
const n = e.maxWidth === null ? void 0 : `${e.maxWidth}px`;
|
|
854
855
|
switch (e.kind) {
|
|
855
856
|
case "aspect":
|
|
@@ -859,7 +860,7 @@ const Fo = (e) => {
|
|
|
859
860
|
case "message":
|
|
860
861
|
return { width: "100%", maxWidth: n, height: `${t ?? e.initialHeight}px` };
|
|
861
862
|
}
|
|
862
|
-
},
|
|
863
|
+
}, Sc = Object.freeze({ marginInline: 0 }), mr = Object.freeze({ kind: "pending" }), kc = Object.freeze({ kind: "narrow" }), Tc = Object.freeze({ kind: "fallback" }), Oc = (e, t, n, r, o) => {
|
|
863
864
|
if (t === null) return mr;
|
|
864
865
|
let s;
|
|
865
866
|
if (e.kind === "frame")
|
|
@@ -868,24 +869,24 @@ const Fo = (e) => {
|
|
|
868
869
|
if (r === null) return mr;
|
|
869
870
|
s = r.ok ? e.srcOf(r.value, n) : null;
|
|
870
871
|
}
|
|
871
|
-
if (s === null || new URL(s).origin === t) return
|
|
872
|
+
if (s === null || new URL(s).origin === t) return Tc;
|
|
872
873
|
const { minWidth: a, maxWidth: l } = e.layout;
|
|
873
874
|
if (a !== null) {
|
|
874
875
|
if (o === null) return mr;
|
|
875
|
-
if (Math.min(o, l ?? Number.POSITIVE_INFINITY) < a) return
|
|
876
|
+
if (Math.min(o, l ?? Number.POSITIVE_INFINITY) < a) return kc;
|
|
876
877
|
}
|
|
877
878
|
return { kind: "frame", src: s };
|
|
878
|
-
},
|
|
879
|
-
const a =
|
|
879
|
+
}, _c = ({ resolution: e, caption: t, fallback: n, theme: r, labels: o, frameSandbox: s }) => {
|
|
880
|
+
const a = ma(), l = dc(), [c, d] = F(null), [u, f] = F(null), m = e.kind === "lookup" ? e.request.href : null, [w, g] = F(null);
|
|
880
881
|
xe(() => {
|
|
881
882
|
if (m !== null)
|
|
882
|
-
return
|
|
883
|
+
return bc.subscribe(
|
|
883
884
|
m,
|
|
884
|
-
(P) =>
|
|
885
|
+
(P) => Ec(new URL(m), P),
|
|
885
886
|
(P) => g({ key: m, outcome: P })
|
|
886
887
|
);
|
|
887
888
|
}, [m]);
|
|
888
|
-
const { provider: h, layout: y } = e, b =
|
|
889
|
+
const { provider: h, layout: y } = e, b = Oc(e, a, { theme: r, lang: l }, w !== null && w.key === m ? w.outcome : null, c), k = V((P) => {
|
|
889
890
|
if (P === null) return;
|
|
890
891
|
d(P.getBoundingClientRect().width);
|
|
891
892
|
const B = new ResizeObserver(() => d(P.getBoundingClientRect().width));
|
|
@@ -893,7 +894,7 @@ const Fo = (e) => {
|
|
|
893
894
|
}, []), T = b.kind === "frame" ? b.src : null, x = u !== null && u.src === T ? u.height : null, S = V(
|
|
894
895
|
(P) => {
|
|
895
896
|
if (!(P === null || P.contentWindow === null || y.kind !== "message" || T === null))
|
|
896
|
-
return
|
|
897
|
+
return wc(P.contentWindow, { origin: h.frameOrigin, src: T, heightOf: y.heightOf, set: (B) => f({ src: T, height: B }) });
|
|
897
898
|
},
|
|
898
899
|
[y, h.frameOrigin, T]
|
|
899
900
|
);
|
|
@@ -905,11 +906,11 @@ const Fo = (e) => {
|
|
|
905
906
|
R,
|
|
906
907
|
n
|
|
907
908
|
] });
|
|
908
|
-
const D = h.content === "video" ? o.embeddedVideo : o.embeddedPost, { frame: j } = h, z =
|
|
909
|
+
const D = h.content === "video" ? o.embeddedVideo : o.embeddedPost, { frame: j } = h, z = Vs(j.sandbox, s);
|
|
909
910
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
910
911
|
R,
|
|
911
|
-
/* @__PURE__ */ i.jsxs("figure", { "data-embed-provider": h.id, "data-embed-state": b.kind, style:
|
|
912
|
-
/* @__PURE__ */ i.jsx("div", { "data-embed-box": "", "data-aqmd-embed-surface": "", style:
|
|
912
|
+
/* @__PURE__ */ i.jsxs("figure", { "data-embed-provider": h.id, "data-embed-state": b.kind, style: Sc, children: [
|
|
913
|
+
/* @__PURE__ */ i.jsx("div", { "data-embed-box": "", "data-aqmd-embed-surface": "", style: vc(y, x), className: "noscript:hidden overflow-hidden rounded-lg", children: b.kind === "frame" ? (
|
|
913
914
|
// src か sandbox を替えるたびに新しい要素にし、登録表の属性 (referrerpolicy・sandbox・allow) を挿入より前に揃え、その場の移動に
|
|
914
915
|
// よる履歴の追加を起こさない。sandbox の旗は読み込みの時に決まるため、読み込んだ後の属性の書き換えは効かない
|
|
915
916
|
/* @__PURE__ */ i.jsx(
|
|
@@ -927,47 +928,47 @@ const Fo = (e) => {
|
|
|
927
928
|
scrolling: j.scrolling ?? void 0,
|
|
928
929
|
className: "block h-full w-full border-0"
|
|
929
930
|
},
|
|
930
|
-
`${
|
|
931
|
+
`${Ks(z)} ${b.src}`
|
|
931
932
|
)
|
|
932
933
|
) : null }),
|
|
933
934
|
/* @__PURE__ */ i.jsx("figcaption", { className: "mt-2", children: t })
|
|
934
935
|
] })
|
|
935
936
|
] });
|
|
936
|
-
}, $r = 9,
|
|
937
|
+
}, $r = 9, Rc = 6, Ac = "data-aqmd-heading-depth", Nc = /^h([1-6])$/u, jc = (e) => {
|
|
937
938
|
if (!Number.isSafeInteger(e) || e < 1 || e > $r)
|
|
938
939
|
throw new RangeError(`MarkdownRenderer: topHeadingLevel must be an integer from 1 to ${$r}, got ${e}`);
|
|
939
|
-
},
|
|
940
|
-
const t =
|
|
940
|
+
}, Cc = (e) => {
|
|
941
|
+
const t = Nc.exec(e);
|
|
941
942
|
return t === null ? void 0 : Number(t[1]);
|
|
942
|
-
},
|
|
943
|
-
const t =
|
|
943
|
+
}, Mc = (e, t) => Math.min(e + t - 1, $r), Lc = { lowerCaseAttributeNames: !1 }, Ic = "<div></div>", cn = (e) => {
|
|
944
|
+
const t = tl(`${Ic}${e}`, Lc), n = t.find((s) => s instanceof nt), { prev: r, next: o } = n;
|
|
944
945
|
return r !== null && (r.next = o), o !== null && (o.prev = r), t.filter((s) => s !== n);
|
|
945
|
-
},
|
|
946
|
-
const n = new Map(Object.entries(e).map(([s, a]) => [s.toLowerCase(), a])), r =
|
|
946
|
+
}, Dc = ["title", "width", "height", "allow", "allowfullscreen", "sandbox", "referrerpolicy", "loading", "frameborder", "scrolling"], Pc = (e, t) => ({ ...e, attributes: { ...e.attributes, sandbox: Vs(e.attributes.sandbox, t) } }), $c = (e, t) => Ys(e, t) !== null, zc = (e, t) => {
|
|
947
|
+
const n = new Map(Object.entries(e).map(([s, a]) => [s.toLowerCase(), a])), r = Ys(n.get("src"), t);
|
|
947
948
|
if (r === null) return null;
|
|
948
949
|
const o = {};
|
|
949
|
-
for (const s of
|
|
950
|
+
for (const s of Dc) {
|
|
950
951
|
const a = n.get(s);
|
|
951
952
|
if (a !== void 0)
|
|
952
953
|
if (s === "allow") {
|
|
953
|
-
const l =
|
|
954
|
+
const l = Xi(a);
|
|
954
955
|
l !== null && (o.allow = l);
|
|
955
956
|
} else if (s === "referrerpolicy") {
|
|
956
957
|
const l = a.trim().toLowerCase();
|
|
957
|
-
|
|
958
|
+
Zi.has(l) && (o.referrerpolicy = l);
|
|
958
959
|
} else
|
|
959
960
|
o[s] = a;
|
|
960
961
|
}
|
|
961
962
|
return Object.freeze({ src: r.href, attributes: Object.freeze(o) });
|
|
962
|
-
},
|
|
963
|
+
}, Fc = /^[a-z][a-z0-9+.-]*:/i, Bc = /^[/\\]{2}/, qc = /[\t\n\r]/g, Bo = 32, Hc = (e) => {
|
|
963
964
|
let t = 0, n = e.length;
|
|
964
965
|
for (; t < n && e.charCodeAt(t) <= Bo; ) t += 1;
|
|
965
966
|
for (; n > t && e.charCodeAt(n - 1) <= Bo; ) n -= 1;
|
|
966
967
|
return e.slice(t, n);
|
|
967
|
-
},
|
|
968
|
-
const t =
|
|
969
|
-
return
|
|
970
|
-
},
|
|
968
|
+
}, xa = (e) => Hc(e).replace(qc, ""), to = (e) => {
|
|
969
|
+
const t = xa(e);
|
|
970
|
+
return Fc.test(t) || Bc.test(t);
|
|
971
|
+
}, Uc = "text-link underline visited:text-link-visited", Wc = "inline-block w-fit", no = /* @__PURE__ */ new Set([
|
|
971
972
|
"img",
|
|
972
973
|
"picture",
|
|
973
974
|
"video",
|
|
@@ -1013,15 +1014,15 @@ const Fo = (e) => {
|
|
|
1013
1014
|
"ul"
|
|
1014
1015
|
]);
|
|
1015
1016
|
[...no].join(",");
|
|
1016
|
-
const
|
|
1017
|
+
const wa = (e, t) => [e, t ? Wc : void 0, Uc].filter((n) => n !== void 0 && n.trim() !== "").join(" "), Gc = /* @__PURE__ */ new Set(["id", "title", "lang", "dir", "role"]), Vc = ["aria-", "data-footnote-"], Kc = (e) => {
|
|
1017
1018
|
const t = {};
|
|
1018
1019
|
for (const [n, r] of Object.entries(e)) {
|
|
1019
1020
|
const o = n.toLowerCase();
|
|
1020
|
-
(
|
|
1021
|
+
(Gc.has(o) || Vc.some((s) => o.startsWith(s) && o.length > s.length)) && (t[o] = r);
|
|
1021
1022
|
}
|
|
1022
1023
|
return Object.freeze(t);
|
|
1023
|
-
},
|
|
1024
|
-
if (!
|
|
1024
|
+
}, Yc = Object.freeze(["document", "untrusted"]), ro = /^[A-Za-z][A-Za-z0-9_-]*$/u, Xc = (e, t) => {
|
|
1025
|
+
if (!Yc.includes(e))
|
|
1025
1026
|
throw new RangeError(`MarkdownRenderer: allowlist must be "document" or "untrusted", got ${String(e)}`);
|
|
1026
1027
|
if (e === "document") {
|
|
1027
1028
|
if (t !== void 0) throw new RangeError('MarkdownRenderer: idPrefix needs allowlist "untrusted" (the ids of a document stay the names its links and the page use)');
|
|
@@ -1031,7 +1032,7 @@ const xa = (e, t) => [e, t ? Uc : void 0, Hc].filter((n) => n !== void 0 && n.tr
|
|
|
1031
1032
|
if (typeof t != "string" || !ro.test(t))
|
|
1032
1033
|
throw new RangeError(`MarkdownRenderer: idPrefix must be an ASCII letter followed by ASCII letters, digits, "-" and "_", got ${typeof t == "string" ? JSON.stringify(t) : String(t)}`);
|
|
1033
1034
|
return { allowlist: e, idPrefix: t };
|
|
1034
|
-
},
|
|
1035
|
+
}, Zc = /* @__PURE__ */ new Set(["video", "audio", "source", "main", "nav", "header", "footer", "section", "article"]), Jc = /* @__PURE__ */ new Set(["aside"]), Qc = /* @__PURE__ */ new Set(["name", "headers", "hidden"]), ed = /* @__PURE__ */ new Set(["doc-noteref", "doc-backlink", "doc-endnotes"]), td = /* @__PURE__ */ new Set(["aria-hidden"]), nd = /* @__PURE__ */ new Set([
|
|
1035
1036
|
"script",
|
|
1036
1037
|
"style",
|
|
1037
1038
|
"template",
|
|
@@ -1056,7 +1057,7 @@ const xa = (e, t) => [e, t ? Uc : void 0, Hc].filter((n) => n !== void 0 && n.tr
|
|
|
1056
1057
|
"track",
|
|
1057
1058
|
"math",
|
|
1058
1059
|
"foreignobject"
|
|
1059
|
-
]),
|
|
1060
|
+
]), rd = /* @__PURE__ */ new Set(["id", "class", "title", "lang", "dir", "role", "hidden", "translate", "style"]), od = /* @__PURE__ */ new Set([
|
|
1060
1061
|
"markdown-alert",
|
|
1061
1062
|
"markdown-alert-title",
|
|
1062
1063
|
"markdown-alert-note",
|
|
@@ -1085,7 +1086,7 @@ const xa = (e, t) => [e, t ? Uc : void 0, Hc].filter((n) => n !== void 0 && n.tr
|
|
|
1085
1086
|
"math",
|
|
1086
1087
|
"inline",
|
|
1087
1088
|
"display"
|
|
1088
|
-
]), qo = "language-",
|
|
1089
|
+
]), qo = "language-", sd = /[\t\n\f\r ]+/u, ad = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]), Ho = Object.freeze({ sup: /^fnref\d*:\d+$/u, li: /^fn:\d+$/u }), Uo = "user-content-", He = ["align"], zt = ["width", "height"], Wo = ["colspan", "rowspan", "headers", "scope", "abbr", "align", "valign", "width", "height"], Rn = Object.freeze({
|
|
1089
1090
|
a: ["href", "name", "hreflang", "data-link-kind", "data-doc-path", "data-doc-exists", "data-footnote-ref", "data-footnote-backref"],
|
|
1090
1091
|
abbr: [],
|
|
1091
1092
|
address: [],
|
|
@@ -1099,7 +1100,7 @@ const xa = (e, t) => [e, t ? Uc : void 0, Hc].filter((n) => n !== void 0 && n.tr
|
|
|
1099
1100
|
br: [],
|
|
1100
1101
|
caption: He,
|
|
1101
1102
|
cite: [],
|
|
1102
|
-
code: [
|
|
1103
|
+
code: [Js],
|
|
1103
1104
|
col: ["span", ...He, ...zt],
|
|
1104
1105
|
colgroup: ["span", ...He, ...zt],
|
|
1105
1106
|
dd: [],
|
|
@@ -1132,7 +1133,7 @@ const xa = (e, t) => [e, t ? Uc : void 0, Hc].filter((n) => n !== void 0 && n.tr
|
|
|
1132
1133
|
nav: [],
|
|
1133
1134
|
ol: ["start", "reversed", "type"],
|
|
1134
1135
|
p: He,
|
|
1135
|
-
pre: [
|
|
1136
|
+
pre: [Zs],
|
|
1136
1137
|
q: ["cite"],
|
|
1137
1138
|
rp: [],
|
|
1138
1139
|
rt: [],
|
|
@@ -1164,69 +1165,69 @@ const xa = (e, t) => [e, t ? Uc : void 0, Hc].filter((n) => n !== void 0 && n.tr
|
|
|
1164
1165
|
svg: ["viewbox", "version", "xmlns", "focusable", "fill", ...zt],
|
|
1165
1166
|
g: ["fill", "fill-rule", "clip-rule"],
|
|
1166
1167
|
path: ["d", "fill", "fill-rule", "clip-rule"]
|
|
1167
|
-
}),
|
|
1168
|
+
}), id = /* @__PURE__ */ new Set(["svg", "g"]), ba = /* @__PURE__ */ new Set(["href", "src", "cite", "poster", Xs]), ld = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu, cd = /^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu, dd = /* @__PURE__ */ new Set(["left", "right", "center", "justify", "start", "end"]), xn = (e) => cd.test(e.replace(ld, "")), ud = (e) => {
|
|
1168
1169
|
let t = null;
|
|
1169
1170
|
for (const n of e.split(";")) {
|
|
1170
1171
|
const r = n.indexOf(":");
|
|
1171
1172
|
if (r < 0 || n.slice(0, r).trim().toLowerCase() !== "text-align") continue;
|
|
1172
1173
|
const o = n.slice(r + 1).trim().toLowerCase();
|
|
1173
|
-
|
|
1174
|
+
dd.has(o) && (t = o);
|
|
1174
1175
|
}
|
|
1175
1176
|
return t === null ? null : `text-align: ${t}`;
|
|
1176
|
-
},
|
|
1177
|
-
const t = e.split(
|
|
1177
|
+
}, fd = (e) => {
|
|
1178
|
+
const t = e.split(sd).filter((n) => od.has(n) || n.startsWith(qo) && n.length > qo.length);
|
|
1178
1179
|
return t.length === 0 ? null : t.join(" ");
|
|
1179
|
-
},
|
|
1180
|
+
}, md = (e, t) => ad.has(e) && t !== "" || t.startsWith(Uo) && t.length > Uo.length || Object.hasOwn(Ho, e) && Ho[e].test(t), hd = (e) => {
|
|
1180
1181
|
const t = /* @__PURE__ */ new Map();
|
|
1181
1182
|
for (const [n, r] of Object.entries(e)) {
|
|
1182
1183
|
const o = n.toLowerCase();
|
|
1183
1184
|
t.has(o) || t.set(o, r);
|
|
1184
1185
|
}
|
|
1185
1186
|
return t;
|
|
1186
|
-
},
|
|
1187
|
+
}, pd = (e, t, n) => {
|
|
1187
1188
|
if (e === "id") return `${n}${t}`;
|
|
1188
|
-
if (!
|
|
1189
|
-
const r =
|
|
1189
|
+
if (!ba.has(e)) return t;
|
|
1190
|
+
const r = xa(t);
|
|
1190
1191
|
return r.startsWith("#") ? `#${n}${r.slice(1)}` : t;
|
|
1191
1192
|
}, Pt = (e, t, n, r) => {
|
|
1192
1193
|
const { allowlist: o } = r, s = {};
|
|
1193
1194
|
for (const [a, l] of t) {
|
|
1194
1195
|
if (a === Zn) {
|
|
1195
|
-
|
|
1196
|
+
ta(l) !== null && (s[a] = l);
|
|
1196
1197
|
continue;
|
|
1197
1198
|
}
|
|
1198
|
-
if (!(o === "untrusted" && (
|
|
1199
|
+
if (!(o === "untrusted" && (Qc.has(a) || a === "title" && Jc.has(e) || a === "role" && !ed.has(l) || a.startsWith("aria-") && !td.has(a))) && (rd.has(a) || n.includes(a) || a.startsWith("aria-") && a.length > 5) && !(ba.has(a) && !xn(l)) && !(a === "fill" && /url\s*\(/iu.test(l)) && !(a === "id" && !md(e, l))) {
|
|
1199
1200
|
if (a === "class" || a === "style") {
|
|
1200
|
-
const c = a === "class" ?
|
|
1201
|
+
const c = a === "class" ? fd(l) : ud(l);
|
|
1201
1202
|
c !== null && (s[a] = c);
|
|
1202
1203
|
continue;
|
|
1203
1204
|
}
|
|
1204
|
-
s[a] = r.idPrefix === void 0 ? l :
|
|
1205
|
+
s[a] = r.idPrefix === void 0 ? l : pd(a, l, r.idPrefix);
|
|
1205
1206
|
}
|
|
1206
1207
|
}
|
|
1207
1208
|
return s;
|
|
1208
|
-
},
|
|
1209
|
-
const r = e.toLowerCase(), o = n.parentName === null ? null : n.parentName.toLowerCase(), s =
|
|
1210
|
-
if (o !== null &&
|
|
1209
|
+
}, gd = (e) => e.get("type")?.trim().toLowerCase() === "checkbox" && e.has("disabled"), er = (e, t, n) => {
|
|
1210
|
+
const r = e.toLowerCase(), o = n.parentName === null ? null : n.parentName.toLowerCase(), s = hd(t), { allowlist: a } = n;
|
|
1211
|
+
if (o !== null && id.has(o)) {
|
|
1211
1212
|
const c = r !== "svg" && Object.hasOwn(hr, r) ? hr[r] : void 0;
|
|
1212
1213
|
return c === void 0 ? { action: "remove" } : { action: "keep", attributes: Pt(r, s, c, n) };
|
|
1213
1214
|
}
|
|
1214
1215
|
if (r === "svg")
|
|
1215
1216
|
return { action: "keep", attributes: Pt(r, s, hr.svg, n) };
|
|
1216
1217
|
if (r === "iframe") {
|
|
1217
|
-
const c = a === "untrusted" ? null :
|
|
1218
|
+
const c = a === "untrusted" ? null : zc(Object.fromEntries(s), n.iFrameAllowedDomains);
|
|
1218
1219
|
return c === null ? { action: "remove" } : { action: "embed", embed: c, pluginType: s.get("data-plugin-type") ?? null };
|
|
1219
1220
|
}
|
|
1220
1221
|
if (r === "p") {
|
|
1221
|
-
const c = Pt(r, s, Rn.p, n), d = a === "untrusted" ? void 0 : s.get(
|
|
1222
|
+
const c = Pt(r, s, Rn.p, n), d = a === "untrusted" ? void 0 : s.get(Xs);
|
|
1222
1223
|
return d !== void 0 && xn(d) ? { action: "placeholder", attributes: c, link: d } : { action: "keep", attributes: c };
|
|
1223
1224
|
}
|
|
1224
1225
|
if (r === "input")
|
|
1225
|
-
return
|
|
1226
|
-
if (
|
|
1226
|
+
return gd(s) ? { action: "keep", attributes: Pt(r, s, ["type", "checked", "disabled"], n) } : { action: "remove" };
|
|
1227
|
+
if (nd.has(r))
|
|
1227
1228
|
return { action: "remove" };
|
|
1228
1229
|
if (a === "untrusted") {
|
|
1229
|
-
if (
|
|
1230
|
+
if (Zc.has(r))
|
|
1230
1231
|
return { action: "unwrap" };
|
|
1231
1232
|
if (r === "img")
|
|
1232
1233
|
return { action: "image", attributes: Pt(r, s, Rn.img, n) };
|
|
@@ -1239,16 +1240,16 @@ typeof window < "u" && (window.NodeList && !NodeList.prototype.forEach && (NodeL
|
|
|
1239
1240
|
var r = document.createEvent("CustomEvent");
|
|
1240
1241
|
return r.initCustomEvent(t, n.bubbles, n.cancelable, n.detail), r;
|
|
1241
1242
|
}));
|
|
1242
|
-
const
|
|
1243
|
+
const yd = typeof document < "u" && !!document.documentMode;
|
|
1243
1244
|
let pr;
|
|
1244
|
-
function
|
|
1245
|
+
function xd() {
|
|
1245
1246
|
return pr || (pr = document.createElement("div").style);
|
|
1246
1247
|
}
|
|
1247
1248
|
const Go = ["webkit", "moz", "ms"], An = {};
|
|
1248
1249
|
function oo(e) {
|
|
1249
1250
|
if (An[e])
|
|
1250
1251
|
return An[e];
|
|
1251
|
-
const t =
|
|
1252
|
+
const t = xd();
|
|
1252
1253
|
if (e in t)
|
|
1253
1254
|
return An[e] = e;
|
|
1254
1255
|
const n = e[0].toUpperCase() + e.slice(1);
|
|
@@ -1274,12 +1275,12 @@ function jn(e, t, n = window.getComputedStyle(e)) {
|
|
|
1274
1275
|
function Bt(e, t, n) {
|
|
1275
1276
|
e.style[oo(t)] = n;
|
|
1276
1277
|
}
|
|
1277
|
-
function
|
|
1278
|
+
function wd(e, t) {
|
|
1278
1279
|
const n = oo("transform");
|
|
1279
1280
|
Bt(e, "transition", `${n} ${t.duration}ms ${t.easing}`);
|
|
1280
1281
|
}
|
|
1281
|
-
function
|
|
1282
|
-
if (Bt(e, "transform", `scale(${r}) translate(${t}px, ${n}px)`), o &&
|
|
1282
|
+
function bd(e, { x: t, y: n, scale: r, isSVG: o }, s) {
|
|
1283
|
+
if (Bt(e, "transform", `scale(${r}) translate(${t}px, ${n}px)`), o && yd) {
|
|
1283
1284
|
const a = window.getComputedStyle(e).getPropertyValue("transform");
|
|
1284
1285
|
e.setAttribute("transform", a);
|
|
1285
1286
|
}
|
|
@@ -1337,7 +1338,7 @@ function xr(e, t, n) {
|
|
|
1337
1338
|
t.removeEventListener(r, n);
|
|
1338
1339
|
});
|
|
1339
1340
|
}
|
|
1340
|
-
function
|
|
1341
|
+
function Ea(e, t) {
|
|
1341
1342
|
let n = e.length;
|
|
1342
1343
|
for (; n--; )
|
|
1343
1344
|
if (e[n].pointerId === t.pointerId)
|
|
@@ -1352,15 +1353,15 @@ function zr(e, t) {
|
|
|
1352
1353
|
r.pointerId = n++, zr(e, r);
|
|
1353
1354
|
return;
|
|
1354
1355
|
}
|
|
1355
|
-
n =
|
|
1356
|
+
n = Ea(e, t), n > -1 && e.splice(n, 1), e.push(t);
|
|
1356
1357
|
}
|
|
1357
|
-
function
|
|
1358
|
+
function Ed(e, t) {
|
|
1358
1359
|
if (t.touches) {
|
|
1359
1360
|
for (; e.length; )
|
|
1360
1361
|
e.pop();
|
|
1361
1362
|
return;
|
|
1362
1363
|
}
|
|
1363
|
-
const n =
|
|
1364
|
+
const n = Ea(e, t);
|
|
1364
1365
|
n > -1 && e.splice(n, 1);
|
|
1365
1366
|
}
|
|
1366
1367
|
function Vo(e) {
|
|
@@ -1379,7 +1380,7 @@ function wr(e) {
|
|
|
1379
1380
|
const t = e[0], n = e[1];
|
|
1380
1381
|
return Math.sqrt(Math.pow(Math.abs(n.clientX - t.clientX), 2) + Math.pow(Math.abs(n.clientY - t.clientY), 2));
|
|
1381
1382
|
}
|
|
1382
|
-
function
|
|
1383
|
+
function vd(e) {
|
|
1383
1384
|
let t = e;
|
|
1384
1385
|
for (; t && t.parentNode; ) {
|
|
1385
1386
|
if (t.parentNode === document)
|
|
@@ -1388,29 +1389,29 @@ function Ed(e) {
|
|
|
1388
1389
|
}
|
|
1389
1390
|
return !1;
|
|
1390
1391
|
}
|
|
1391
|
-
function
|
|
1392
|
+
function Sd(e) {
|
|
1392
1393
|
return (e.getAttribute("class") || "").trim();
|
|
1393
1394
|
}
|
|
1394
|
-
function Sd(e, t) {
|
|
1395
|
-
return e.nodeType === 1 && ` ${vd(e)} `.indexOf(` ${t} `) > -1;
|
|
1396
|
-
}
|
|
1397
1395
|
function kd(e, t) {
|
|
1396
|
+
return e.nodeType === 1 && ` ${Sd(e)} `.indexOf(` ${t} `) > -1;
|
|
1397
|
+
}
|
|
1398
|
+
function Td(e, t) {
|
|
1398
1399
|
for (let n = e; n != null; n = n.parentNode)
|
|
1399
|
-
if (
|
|
1400
|
+
if (kd(n, t.excludeClass) || t.exclude.indexOf(n) > -1)
|
|
1400
1401
|
return !0;
|
|
1401
1402
|
return !1;
|
|
1402
1403
|
}
|
|
1403
|
-
const
|
|
1404
|
-
function Od(e) {
|
|
1405
|
-
return Td.test(e.namespaceURI) && e.nodeName.toLowerCase() !== "svg";
|
|
1406
|
-
}
|
|
1404
|
+
const Od = /^http:[\w\.\/]+svg$/;
|
|
1407
1405
|
function _d(e) {
|
|
1406
|
+
return Od.test(e.namespaceURI) && e.nodeName.toLowerCase() !== "svg";
|
|
1407
|
+
}
|
|
1408
|
+
function Rd(e) {
|
|
1408
1409
|
const t = {};
|
|
1409
1410
|
for (const n in e)
|
|
1410
1411
|
e.hasOwnProperty(n) && (t[n] = e[n]);
|
|
1411
1412
|
return t;
|
|
1412
1413
|
}
|
|
1413
|
-
const
|
|
1414
|
+
const va = {
|
|
1414
1415
|
animate: !1,
|
|
1415
1416
|
canvas: !1,
|
|
1416
1417
|
cursor: "move",
|
|
@@ -1431,22 +1432,22 @@ const Ea = {
|
|
|
1431
1432
|
panOnlyWhenZoomed: !1,
|
|
1432
1433
|
pinchAndPan: !1,
|
|
1433
1434
|
relative: !1,
|
|
1434
|
-
setTransform:
|
|
1435
|
+
setTransform: bd,
|
|
1435
1436
|
startX: 0,
|
|
1436
1437
|
startY: 0,
|
|
1437
1438
|
startScale: 1,
|
|
1438
1439
|
step: 0.3,
|
|
1439
1440
|
touchAction: "none"
|
|
1440
1441
|
};
|
|
1441
|
-
function
|
|
1442
|
+
function Sa(e, t) {
|
|
1442
1443
|
if (!e)
|
|
1443
1444
|
throw new Error("Panzoom requires an element as an argument");
|
|
1444
1445
|
if (e.nodeType !== 1)
|
|
1445
1446
|
throw new Error("Panzoom requires an element with a nodeType of 1");
|
|
1446
|
-
if (!
|
|
1447
|
+
if (!vd(e))
|
|
1447
1448
|
throw new Error("Panzoom should be called on elements that have been attached to the DOM");
|
|
1448
|
-
t = { ...
|
|
1449
|
-
const n =
|
|
1449
|
+
t = { ...va, ...t };
|
|
1450
|
+
const n = _d(e), r = e.parentNode;
|
|
1450
1451
|
r.style.overflow = t.overflow, r.style.userSelect = "none", r.style.touchAction = t.touchAction, (t.canvas ? r : e).style.cursor = t.cursor, e.style.userSelect = "none", e.style.touchAction = t.touchAction, Bt(e, "transformOrigin", typeof t.origin == "string" ? t.origin : n ? "0 0" : "50% 50%");
|
|
1451
1452
|
function o() {
|
|
1452
1453
|
r.style.overflow = "", r.style.userSelect = "", r.style.touchAction = "", r.style.cursor = "", e.style.cursor = "", e.style.userSelect = "", e.style.touchAction = "", Bt(e, "transformOrigin", "");
|
|
@@ -1469,7 +1470,7 @@ function va(e, t) {
|
|
|
1469
1470
|
function f(_, $, p) {
|
|
1470
1471
|
const v = { x: a, y: l, scale: c, isSVG: n, originalEvent: p };
|
|
1471
1472
|
return requestAnimationFrame(() => {
|
|
1472
|
-
typeof $.animate == "boolean" && ($.animate ?
|
|
1473
|
+
typeof $.animate == "boolean" && ($.animate ? wd(e, $) : Bt(e, "transition", "none")), $.setTransform(e, v, $), u(_, v, $), u("panzoomchange", v, $);
|
|
1473
1474
|
}), v;
|
|
1474
1475
|
}
|
|
1475
1476
|
function m(_, $, p, v) {
|
|
@@ -1560,7 +1561,7 @@ function va(e, t) {
|
|
|
1560
1561
|
let R, D, j, z, P, B;
|
|
1561
1562
|
const q = [];
|
|
1562
1563
|
function H(_) {
|
|
1563
|
-
if (
|
|
1564
|
+
if (Td(_.target, t))
|
|
1564
1565
|
return;
|
|
1565
1566
|
zr(q, _), d = !0, t.handleStartEvent(_), R = a, D = l, u("panzoomstart", { x: a, y: l, scale: c, isSVG: n, originalEvent: _ }, t);
|
|
1566
1567
|
const $ = Vo(q);
|
|
@@ -1580,7 +1581,7 @@ function va(e, t) {
|
|
|
1580
1581
|
(!p || t.pinchAndPan) && g(R + ($.clientX - j) / v, D + ($.clientY - z) / v, { animate: !1 }, _);
|
|
1581
1582
|
}
|
|
1582
1583
|
function ae(_) {
|
|
1583
|
-
q.length === 1 && u("panzoomend", { x: a, y: l, scale: c, isSVG: n, originalEvent: _ }, t),
|
|
1584
|
+
q.length === 1 && u("panzoomend", { x: a, y: l, scale: c, isSVG: n, originalEvent: _ }, t), Ed(q, _), d && (d = !1, R = D = j = z = void 0);
|
|
1584
1585
|
}
|
|
1585
1586
|
let ne = !1;
|
|
1586
1587
|
function ie() {
|
|
@@ -1595,7 +1596,7 @@ function va(e, t) {
|
|
|
1595
1596
|
eventNames: mn,
|
|
1596
1597
|
getPan: () => ({ x: a, y: l }),
|
|
1597
1598
|
getScale: () => c,
|
|
1598
|
-
getOptions: () =>
|
|
1599
|
+
getOptions: () => Rd(t),
|
|
1599
1600
|
handleDown: H,
|
|
1600
1601
|
handleMove: ue,
|
|
1601
1602
|
handleUp: ae,
|
|
@@ -1611,60 +1612,60 @@ function va(e, t) {
|
|
|
1611
1612
|
zoomWithWheel: x
|
|
1612
1613
|
};
|
|
1613
1614
|
}
|
|
1614
|
-
|
|
1615
|
-
const
|
|
1615
|
+
Sa.defaultOptions = va;
|
|
1616
|
+
const Ad = [
|
|
1616
1617
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
1617
1618
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
1618
|
-
],
|
|
1619
|
-
const
|
|
1619
|
+
], Nd = se("arrow-down", Ad);
|
|
1620
|
+
const jd = [
|
|
1620
1621
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
1621
1622
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
1622
|
-
],
|
|
1623
|
-
const
|
|
1623
|
+
], Cd = se("arrow-left", jd);
|
|
1624
|
+
const Md = [
|
|
1624
1625
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
1625
1626
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
1626
|
-
],
|
|
1627
|
-
const
|
|
1627
|
+
], Ld = se("arrow-right", Md);
|
|
1628
|
+
const Id = [
|
|
1628
1629
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
1629
1630
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
1630
|
-
],
|
|
1631
|
-
const
|
|
1631
|
+
], Dd = se("arrow-up", Id);
|
|
1632
|
+
const Pd = [
|
|
1632
1633
|
["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
|
|
1633
1634
|
["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
|
|
1634
1635
|
["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
|
|
1635
|
-
],
|
|
1636
|
-
const
|
|
1636
|
+
], ka = se("code-xml", Pd);
|
|
1637
|
+
const $d = [
|
|
1637
1638
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1638
1639
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
1639
|
-
], hn = se("copy",
|
|
1640
|
-
const
|
|
1640
|
+
], hn = se("copy", $d);
|
|
1641
|
+
const zd = [
|
|
1641
1642
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
1642
1643
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
1643
1644
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
1644
|
-
],
|
|
1645
|
-
const
|
|
1645
|
+
], Ta = se("download", zd);
|
|
1646
|
+
const Fd = [
|
|
1646
1647
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
1647
1648
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
1648
1649
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
1649
1650
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
1650
|
-
], Fr = se("refresh-cw",
|
|
1651
|
-
const
|
|
1651
|
+
], Fr = se("refresh-cw", Fd);
|
|
1652
|
+
const Bd = [
|
|
1652
1653
|
["path", { d: "M14 17H5", key: "gfn3mx" }],
|
|
1653
1654
|
["path", { d: "M19 7h-9", key: "6i9tg" }],
|
|
1654
1655
|
["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
|
|
1655
1656
|
["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
|
|
1656
|
-
],
|
|
1657
|
-
const
|
|
1657
|
+
], qd = se("settings-2", Bd);
|
|
1658
|
+
const Hd = [
|
|
1658
1659
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
1659
1660
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
|
1660
1661
|
["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
|
|
1661
1662
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
|
1662
|
-
],
|
|
1663
|
-
const
|
|
1663
|
+
], Oa = se("zoom-in", Hd);
|
|
1664
|
+
const Ud = [
|
|
1664
1665
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
1665
1666
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
|
1666
1667
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
|
1667
|
-
],
|
|
1668
|
+
], _a = se("zoom-out", Ud), Ra = Object.freeze({
|
|
1668
1669
|
light: Object.freeze({
|
|
1669
1670
|
ground: "#ffffff",
|
|
1670
1671
|
text: "#454e58",
|
|
@@ -1681,7 +1682,7 @@ const Hd = [
|
|
|
1681
1682
|
series: Object.freeze(["#58a2ea", "#e88074", "#2fb285", "#b18de4", "#c9952d", "#00accc", "#e17fa7", "#7aab52", "#809af0", "#e28655", "#00b1a3", "#c985d2"]),
|
|
1682
1683
|
seriesText: "#0d1117"
|
|
1683
1684
|
})
|
|
1684
|
-
}), so = -1, Br = "�",
|
|
1685
|
+
}), so = -1, Br = "�", Wd = /[\u0000\uD800-\uDFFF]/gu, oe = Object.freeze({
|
|
1685
1686
|
quotationMark: 34,
|
|
1686
1687
|
numberSign: 35,
|
|
1687
1688
|
percentSign: 37,
|
|
@@ -1697,7 +1698,7 @@ const Hd = [
|
|
|
1697
1698
|
reverseSolidus: 92,
|
|
1698
1699
|
lowLine: 95,
|
|
1699
1700
|
smallE: 101
|
|
1700
|
-
}),
|
|
1701
|
+
}), Gd = /* @__PURE__ */ new Map([
|
|
1701
1702
|
["(", "("],
|
|
1702
1703
|
[")", ")"],
|
|
1703
1704
|
[",", "comma"],
|
|
@@ -1707,21 +1708,21 @@ const Hd = [
|
|
|
1707
1708
|
["]", "]"],
|
|
1708
1709
|
["{", "{"],
|
|
1709
1710
|
["}", "}"]
|
|
1710
|
-
]), yt = (e) => e >= 48 && e <= 57, Ko = (e) => yt(e) || e >= 65 && e <= 70 || e >= 97 && e <= 102, qn = (e) => e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 128 || e === oe.lowLine,
|
|
1711
|
+
]), yt = (e) => e >= 48 && e <= 57, Ko = (e) => yt(e) || e >= 65 && e <= 70 || e >= 97 && e <= 102, qn = (e) => e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 128 || e === oe.lowLine, Aa = (e) => qn(e) || yt(e) || e === oe.hyphenMinus, Hn = (e) => e === 10 || e === 13 || e === 12, Ct = (e) => Hn(e) || e === 9 || e === 32, Vd = (e) => e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e === 127, Un = (e) => e === oe.quotationMark || e === oe.apostrophe, wn = (e) => e.replace(/[A-Z]/gu, (t) => t.toLowerCase()), de = (e, t) => t < e.source.length ? e.source.charCodeAt(t) : so, Ht = (e, t) => de(e, t) === oe.reverseSolidus && !Hn(de(e, t + 1));
|
|
1711
1712
|
function qr(e, t) {
|
|
1712
1713
|
const n = de(e, t);
|
|
1713
1714
|
if (n !== oe.hyphenMinus) return qn(n) || Ht(e, t);
|
|
1714
1715
|
const r = de(e, t + 1);
|
|
1715
1716
|
return qn(r) || r === oe.hyphenMinus || Ht(e, t + 1);
|
|
1716
1717
|
}
|
|
1717
|
-
function
|
|
1718
|
+
function Kd(e, t) {
|
|
1718
1719
|
const n = de(e, t), r = de(e, t + 1);
|
|
1719
1720
|
return n === oe.plusSign || n === oe.hyphenMinus ? yt(r) || r === oe.fullStop && yt(de(e, t + 2)) : n === oe.fullStop ? yt(r) : yt(n);
|
|
1720
1721
|
}
|
|
1721
1722
|
function Hr(e) {
|
|
1722
1723
|
for (; Ct(de(e, e.index)); ) e.index += 1;
|
|
1723
1724
|
}
|
|
1724
|
-
function
|
|
1725
|
+
function Na(e) {
|
|
1725
1726
|
e.index += e.source.startsWith(`\r
|
|
1726
1727
|
`, e.index) ? 2 : 1;
|
|
1727
1728
|
}
|
|
@@ -1736,15 +1737,15 @@ function tr(e) {
|
|
|
1736
1737
|
const n = e.index;
|
|
1737
1738
|
for (; e.index - n < 6 && Ko(de(e, e.index)); ) e.index += 1;
|
|
1738
1739
|
const r = Number.parseInt(e.source.slice(n, e.index), 16);
|
|
1739
|
-
return Ct(de(e, e.index)) &&
|
|
1740
|
+
return Ct(de(e, e.index)) && Na(e), r === 0 || r >= 55296 && r <= 57343 || r > 1114111 ? Br : String.fromCodePoint(r);
|
|
1740
1741
|
}
|
|
1741
1742
|
function Wn(e) {
|
|
1742
1743
|
let t = "";
|
|
1743
|
-
for (let n = de(e, e.index);
|
|
1744
|
+
for (let n = de(e, e.index); Aa(n) || Ht(e, e.index); n = de(e, e.index))
|
|
1744
1745
|
e.index += 1, t += n === oe.reverseSolidus ? tr(e) : String.fromCharCode(n);
|
|
1745
1746
|
return t;
|
|
1746
1747
|
}
|
|
1747
|
-
function
|
|
1748
|
+
function Yd(e) {
|
|
1748
1749
|
const t = de(e, e.index);
|
|
1749
1750
|
(t === oe.plusSign || t === oe.hyphenMinus) && (e.index += 1), Cn(e), de(e, e.index) === oe.fullStop && yt(de(e, e.index + 1)) && (e.index += 1, Cn(e));
|
|
1750
1751
|
const n = de(e, e.index);
|
|
@@ -1752,8 +1753,8 @@ function Kd(e) {
|
|
|
1752
1753
|
const r = de(e, e.index + 1);
|
|
1753
1754
|
yt(r) ? (e.index += 1, Cn(e)) : (r === oe.plusSign || r === oe.hyphenMinus) && yt(de(e, e.index + 2)) && (e.index += 2, Cn(e));
|
|
1754
1755
|
}
|
|
1755
|
-
function
|
|
1756
|
-
return
|
|
1756
|
+
function Xd(e) {
|
|
1757
|
+
return Yd(e), qr(e, e.index) ? (Wn(e), { type: "dimension", value: "" }) : de(e, e.index) !== oe.percentSign ? { type: "number", value: "" } : (e.index += 1, { type: "percentage", value: "" });
|
|
1757
1758
|
}
|
|
1758
1759
|
function Yo(e) {
|
|
1759
1760
|
for (; e.index < e.source.length; ) {
|
|
@@ -1763,7 +1764,7 @@ function Yo(e) {
|
|
|
1763
1764
|
}
|
|
1764
1765
|
return { type: "bad-url", value: "" };
|
|
1765
1766
|
}
|
|
1766
|
-
function
|
|
1767
|
+
function Zd(e) {
|
|
1767
1768
|
let t = "";
|
|
1768
1769
|
for (Hr(e); e.index < e.source.length; ) {
|
|
1769
1770
|
const n = de(e, e.index);
|
|
@@ -1772,31 +1773,31 @@ function Xd(e) {
|
|
|
1772
1773
|
const r = de(e, e.index);
|
|
1773
1774
|
return r !== so && r !== oe.rightParenthesis ? Yo(e) : (r === oe.rightParenthesis && (e.index += 1), { type: "url", value: t });
|
|
1774
1775
|
}
|
|
1775
|
-
if (Un(n) || n === oe.leftParenthesis ||
|
|
1776
|
+
if (Un(n) || n === oe.leftParenthesis || Vd(n) || n === oe.reverseSolidus && !Ht(e, e.index)) return Yo(e);
|
|
1776
1777
|
if (e.index += 1, n === oe.rightParenthesis) return { type: "url", value: t };
|
|
1777
1778
|
t += n === oe.reverseSolidus ? tr(e) : String.fromCharCode(n);
|
|
1778
1779
|
}
|
|
1779
1780
|
return { type: "url", value: t };
|
|
1780
1781
|
}
|
|
1781
|
-
function
|
|
1782
|
+
function Jd(e) {
|
|
1782
1783
|
const t = Wn(e);
|
|
1783
1784
|
if (de(e, e.index) !== oe.leftParenthesis) return { type: "ident", value: t };
|
|
1784
1785
|
if (e.index += 1, wn(t) !== "url") return { type: "function", value: t };
|
|
1785
1786
|
for (; Ct(de(e, e.index)) && Ct(de(e, e.index + 1)); ) e.index += 1;
|
|
1786
1787
|
const n = de(e, e.index);
|
|
1787
|
-
return Un(n) || Ct(n) && Un(de(e, e.index + 1)) ? { type: "function", value: t } :
|
|
1788
|
+
return Un(n) || Ct(n) && Un(de(e, e.index + 1)) ? { type: "function", value: t } : Zd(e);
|
|
1788
1789
|
}
|
|
1789
|
-
function
|
|
1790
|
+
function Qd(e, t) {
|
|
1790
1791
|
let n = "";
|
|
1791
1792
|
for (; e.index < e.source.length; ) {
|
|
1792
1793
|
const r = de(e, e.index);
|
|
1793
1794
|
if (Hn(r)) return { type: "bad-string", value: "" };
|
|
1794
1795
|
if (e.index += 1, r === t) return { type: "string", value: n };
|
|
1795
|
-
r !== oe.reverseSolidus ? n += String.fromCharCode(r) : Hn(de(e, e.index)) ?
|
|
1796
|
+
r !== oe.reverseSolidus ? n += String.fromCharCode(r) : Hn(de(e, e.index)) ? Na(e) : e.index < e.source.length && (n += tr(e));
|
|
1796
1797
|
}
|
|
1797
1798
|
return { type: "string", value: n };
|
|
1798
1799
|
}
|
|
1799
|
-
function
|
|
1800
|
+
function eu(e) {
|
|
1800
1801
|
const { source: t } = e, n = de(e, e.index);
|
|
1801
1802
|
if (t.startsWith("/*", e.index)) {
|
|
1802
1803
|
const s = t.indexOf("*/", e.index + 2);
|
|
@@ -1804,28 +1805,28 @@ function Qd(e) {
|
|
|
1804
1805
|
}
|
|
1805
1806
|
if (Ct(n))
|
|
1806
1807
|
return Hr(e), { type: "whitespace", value: "" };
|
|
1807
|
-
if (
|
|
1808
|
+
if (Kd(e, e.index)) return Xd(e);
|
|
1808
1809
|
if (n === oe.hyphenMinus && t.startsWith("-->", e.index))
|
|
1809
1810
|
return e.index += 3, { type: "CDC", value: "" };
|
|
1810
|
-
if (qn(n) || (n === oe.hyphenMinus || n === oe.reverseSolidus) && qr(e, e.index)) return
|
|
1811
|
+
if (qn(n) || (n === oe.hyphenMinus || n === oe.reverseSolidus) && qr(e, e.index)) return Jd(e);
|
|
1811
1812
|
if (t.startsWith("<!--", e.index))
|
|
1812
1813
|
return e.index += 4, { type: "CDO", value: "" };
|
|
1813
|
-
if (e.index += 1, Un(n)) return
|
|
1814
|
-
if (n === oe.numberSign && (
|
|
1814
|
+
if (e.index += 1, Un(n)) return Qd(e, n);
|
|
1815
|
+
if (n === oe.numberSign && (Aa(de(e, e.index)) || Ht(e, e.index))) return { type: "hash", value: Wn(e) };
|
|
1815
1816
|
if (n === oe.commercialAt && qr(e, e.index)) return { type: "at-keyword", value: Wn(e) };
|
|
1816
|
-
const r = String.fromCharCode(n), o =
|
|
1817
|
+
const r = String.fromCharCode(n), o = Gd.get(r);
|
|
1817
1818
|
return o === void 0 ? { type: "delim", value: r } : { type: o, value: "" };
|
|
1818
1819
|
}
|
|
1819
1820
|
function ht(e) {
|
|
1820
|
-
const t = { source: e.replace(
|
|
1821
|
+
const t = { source: e.replace(Wd, Br), index: 0 }, n = [];
|
|
1821
1822
|
for (; t.index < t.source.length; ) {
|
|
1822
|
-
const r = t.index, { type: o, value: s } =
|
|
1823
|
+
const r = t.index, { type: o, value: s } = eu(t);
|
|
1823
1824
|
n.push({ type: o, value: s, start: r, end: t.index });
|
|
1824
1825
|
}
|
|
1825
1826
|
return n;
|
|
1826
1827
|
}
|
|
1827
|
-
const ao = /[\\<\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F\uD800-\uDFFF]/u,
|
|
1828
|
-
|
|
1828
|
+
const ao = /[\\<\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F\uD800-\uDFFF]/u, ja = "--mermaid-font-family", tu = /* @__PURE__ */ new Set([
|
|
1829
|
+
ja,
|
|
1829
1830
|
"-webkit-box-orient",
|
|
1830
1831
|
"align-items",
|
|
1831
1832
|
"alignment-baseline",
|
|
@@ -1883,7 +1884,7 @@ const ao = /[\\<\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F\uD800-\uDFFF]/u, Na
|
|
|
1883
1884
|
"width",
|
|
1884
1885
|
"word-break",
|
|
1885
1886
|
"z-index"
|
|
1886
|
-
]),
|
|
1887
|
+
]), nu = /* @__PURE__ */ new Set(["font-family", "font-size", "fill", "max-width"]), ru = Object.freeze({ root: nu, inside: tu }), ou = /* @__PURE__ */ new Set([
|
|
1887
1888
|
"rgb",
|
|
1888
1889
|
"rgba",
|
|
1889
1890
|
"hsl",
|
|
@@ -1937,15 +1938,15 @@ const ao = /[\\<\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F\uD800-\uDFFF]/u, Na
|
|
|
1937
1938
|
"opacity",
|
|
1938
1939
|
"saturate",
|
|
1939
1940
|
"sepia"
|
|
1940
|
-
]), Ur = /* @__PURE__ */ new Set(["fill", "stroke", "filter", "clip-path", "marker-start", "marker-end"]),
|
|
1941
|
+
]), Ur = /* @__PURE__ */ new Set(["fill", "stroke", "filter", "clip-path", "marker-start", "marker-end"]), su = /* @__PURE__ */ new Set(["whitespace", "ident", "number", "percentage", "dimension", "hash", "string", "comma", "(", ")"]), au = /* @__PURE__ */ new Set(["+", "-", "*", "/", "."]), Gn = /^#\S+$/u, iu = /* @__PURE__ */ new Map([
|
|
1941
1942
|
["function", ")"],
|
|
1942
1943
|
["(", ")"],
|
|
1943
1944
|
["[", "]"],
|
|
1944
1945
|
["{", "}"]
|
|
1945
|
-
]),
|
|
1946
|
+
]), lu = /* @__PURE__ */ new Set([">", "+", "~"]), cu = /* @__PURE__ */ new Map([
|
|
1946
1947
|
["data-look", "="],
|
|
1947
1948
|
["id", "$="]
|
|
1948
|
-
]),
|
|
1949
|
+
]), du = /* @__PURE__ */ new Set(["whitespace", "comment", "CDO", "CDC"]), mt = (e, t, n) => e.text.slice(e.tokens[t].start, e.tokens[n - 1].end);
|
|
1949
1950
|
function qt(e, t, n) {
|
|
1950
1951
|
let r = t, o = n;
|
|
1951
1952
|
for (; r < o && e[r].type === "whitespace"; ) r += 1;
|
|
@@ -1960,59 +1961,59 @@ function pn(e, t, n, r) {
|
|
|
1960
1961
|
if (a === o[o.length - 1])
|
|
1961
1962
|
o.pop();
|
|
1962
1963
|
else {
|
|
1963
|
-
const l =
|
|
1964
|
+
const l = iu.get(a);
|
|
1964
1965
|
l !== void 0 && o.push(l);
|
|
1965
1966
|
}
|
|
1966
1967
|
}
|
|
1967
1968
|
return -1;
|
|
1968
1969
|
}
|
|
1969
|
-
function
|
|
1970
|
+
function uu(e, t) {
|
|
1970
1971
|
const n = pn(e, t + 1, e.length, ["semicolon", "{"]);
|
|
1971
1972
|
if (n < 0) return e.length;
|
|
1972
1973
|
if (e[n].type === "semicolon") return n + 1;
|
|
1973
1974
|
const r = pn(e, n + 1, e.length, ["}"]);
|
|
1974
1975
|
return r < 0 ? e.length : r + 1;
|
|
1975
1976
|
}
|
|
1976
|
-
function
|
|
1977
|
+
function fu(e, t, n) {
|
|
1977
1978
|
let r = t + 1;
|
|
1978
1979
|
for (; r < n && e.tokens[r].type !== "]"; ) r += 1;
|
|
1979
1980
|
if (r === n) return null;
|
|
1980
|
-
const o = e.tokens.slice(t + 1, r).filter((u) => u.type !== "whitespace"), s = o[0], a = o[o.length - 1], l = o.slice(1, -1), c = s?.type === "ident" ?
|
|
1981
|
+
const o = e.tokens.slice(t + 1, r).filter((u) => u.type !== "whitespace"), s = o[0], a = o[o.length - 1], l = o.slice(1, -1), c = s?.type === "ident" ? cu.get(s.value) : void 0;
|
|
1981
1982
|
return c === void 0 || a.type !== "ident" && a.type !== "string" ? null : l.length === c.length && l.every((u, f) => u.type === "delim" && u.value === c[f]) ? { text: mt(e, t, r + 1), end: r + 1 } : null;
|
|
1982
1983
|
}
|
|
1983
|
-
function
|
|
1984
|
+
function mu(e, t, n, r) {
|
|
1984
1985
|
const o = e.tokens[t], s = t + 1 < n ? e.tokens[t + 1] : void 0;
|
|
1985
1986
|
if (o.type === "hash" || o.type === "ident" || o.type === "delim" && o.value === "*") return { text: mt(e, t, t + 1), end: t + 1 };
|
|
1986
1987
|
if (o.type === "delim" && o.value === "." && s?.type === "ident") return { text: `.${r}${mt(e, t + 1, t + 2)}`, end: t + 2 };
|
|
1987
|
-
if (o.type === "[") return
|
|
1988
|
+
if (o.type === "[") return fu(e, t, n);
|
|
1988
1989
|
if (o.type !== "colon") return null;
|
|
1989
1990
|
const a = s?.type === "colon" ? t + 2 : t + 1;
|
|
1990
1991
|
return a < n && e.tokens[a].type === "ident" ? { text: mt(e, t, a + 1), end: a + 1 } : null;
|
|
1991
1992
|
}
|
|
1992
|
-
function
|
|
1993
|
+
function hu(e, t, n, r) {
|
|
1993
1994
|
const [o, s] = qt(e.tokens, t, n);
|
|
1994
1995
|
if (o === s || e.tokens[o].type !== "hash" || e.tokens[o].value !== r.svgId) return null;
|
|
1995
1996
|
let a = mt(e, o, o + 1), l = !1, c = o + 1;
|
|
1996
1997
|
for (; c < s; ) {
|
|
1997
|
-
const d =
|
|
1998
|
+
const d = mu(e, c, s, r.classPrefix);
|
|
1998
1999
|
if (d !== null) {
|
|
1999
2000
|
a += d.text, c = d.end;
|
|
2000
2001
|
continue;
|
|
2001
2002
|
}
|
|
2002
2003
|
let u = c;
|
|
2003
|
-
for (; u < s && (e.tokens[u].type === "whitespace" || e.tokens[u].type === "delim" &&
|
|
2004
|
+
for (; u < s && (e.tokens[u].type === "whitespace" || e.tokens[u].type === "delim" && lu.has(e.tokens[u].value)); ) u += 1;
|
|
2004
2005
|
if (u === c || !l && e.tokens.slice(c, u).some((f) => f.type === "delim" && f.value !== ">")) return null;
|
|
2005
2006
|
l = !0, a += mt(e, c, u), c = u;
|
|
2006
2007
|
}
|
|
2007
2008
|
return { text: a, target: l ? "inside" : "root" };
|
|
2008
2009
|
}
|
|
2009
|
-
function
|
|
2010
|
+
function pu(e, t, n, r) {
|
|
2010
2011
|
if (ao.test(e.text.slice(e.tokens[t].start, e.tokens[n].start))) return null;
|
|
2011
2012
|
const o = [];
|
|
2012
2013
|
let s = t;
|
|
2013
2014
|
for (let a = t; a <= n; a += 1) {
|
|
2014
2015
|
if (a < n && e.tokens[a].type !== "comma") continue;
|
|
2015
|
-
const l =
|
|
2016
|
+
const l = hu(e, s, a, r);
|
|
2016
2017
|
if (l === null) return null;
|
|
2017
2018
|
o.push(l), s = a + 1;
|
|
2018
2019
|
}
|
|
@@ -2023,7 +2024,7 @@ function Xo(e, t, n) {
|
|
|
2023
2024
|
for (; r >= t && e[r].type === "whitespace"; ) r -= 1;
|
|
2024
2025
|
return r;
|
|
2025
2026
|
}
|
|
2026
|
-
function
|
|
2027
|
+
function gu(e, t, n) {
|
|
2027
2028
|
const r = Xo(e, t, n);
|
|
2028
2029
|
if (r < t || e[r].type !== "ident" || wn(e[r].value) !== "important") return n;
|
|
2029
2030
|
const o = Xo(e, t, r);
|
|
@@ -2034,7 +2035,7 @@ function nr(e, t, n) {
|
|
|
2034
2035
|
if (r === o || e[r].type !== "ident") return null;
|
|
2035
2036
|
const [s] = qt(e, r + 1, o);
|
|
2036
2037
|
if (s === o || e[s].type !== "colon") return null;
|
|
2037
|
-
const [a, l] = qt(e, s + 1,
|
|
2038
|
+
const [a, l] = qt(e, s + 1, gu(e, s + 1, o));
|
|
2038
2039
|
return { first: r, end: o, property: e[r], valueFirst: a, valueEnd: l };
|
|
2039
2040
|
}
|
|
2040
2041
|
function rr(e, t, n) {
|
|
@@ -2051,12 +2052,12 @@ function io(e) {
|
|
|
2051
2052
|
let n = 0;
|
|
2052
2053
|
for (; n < e.length; ) {
|
|
2053
2054
|
const { type: r } = e[n];
|
|
2054
|
-
if (
|
|
2055
|
+
if (du.has(r)) {
|
|
2055
2056
|
n += 1;
|
|
2056
2057
|
continue;
|
|
2057
2058
|
}
|
|
2058
2059
|
if (r === "at-keyword") {
|
|
2059
|
-
n =
|
|
2060
|
+
n = uu(e, n);
|
|
2060
2061
|
continue;
|
|
2061
2062
|
}
|
|
2062
2063
|
const o = pn(e, n, e.length, ["{"]), s = o < 0 ? -1 : pn(e, o + 1, e.length, ["}"]);
|
|
@@ -2065,16 +2066,16 @@ function io(e) {
|
|
|
2065
2066
|
}
|
|
2066
2067
|
return t;
|
|
2067
2068
|
}
|
|
2068
|
-
function
|
|
2069
|
+
function Ca(e, t, n) {
|
|
2069
2070
|
const [r] = qt(e, t + 1, n), [o] = qt(e, r + 1, n);
|
|
2070
2071
|
return o < n && e[o].type === ")" && e[r].type !== ")" ? { argument: e[r], close: o } : null;
|
|
2071
2072
|
}
|
|
2072
|
-
function
|
|
2073
|
+
function Ma(e, t, n, r) {
|
|
2073
2074
|
let o = t;
|
|
2074
2075
|
for (; o < n; ) {
|
|
2075
2076
|
const s = e[o], a = s.type === "function" ? wn(s.value) : "";
|
|
2076
2077
|
if (a === "url" || a === "var") {
|
|
2077
|
-
const l =
|
|
2078
|
+
const l = Ca(e, o, n), c = a === "url" ? l?.argument.type === "string" && Gn.test(l.argument.value) && Ur.has(r) : l?.argument.type === "ident" && l.argument.value === ja;
|
|
2078
2079
|
if (l === null || !c) return !1;
|
|
2079
2080
|
o = l.close + 1;
|
|
2080
2081
|
continue;
|
|
@@ -2082,55 +2083,55 @@ function Ca(e, t, n, r) {
|
|
|
2082
2083
|
if (s.type === "url") {
|
|
2083
2084
|
if (!(Ur.has(r) && Gn.test(s.value))) return !1;
|
|
2084
2085
|
} else if (s.type === "function") {
|
|
2085
|
-
if (!
|
|
2086
|
-
} else if (s.type === "delim" ? !
|
|
2086
|
+
if (!ou.has(a)) return !1;
|
|
2087
|
+
} else if (s.type === "delim" ? !au.has(s.value) : !su.has(s.type))
|
|
2087
2088
|
return !1;
|
|
2088
2089
|
o += 1;
|
|
2089
2090
|
}
|
|
2090
2091
|
return !0;
|
|
2091
2092
|
}
|
|
2092
|
-
function
|
|
2093
|
+
function yu(e, t, n, r) {
|
|
2093
2094
|
const o = nr(e.tokens, t, n);
|
|
2094
2095
|
if (o === null) return null;
|
|
2095
2096
|
const s = mt(e, o.first, o.end);
|
|
2096
|
-
return ao.test(s) || !
|
|
2097
|
+
return ao.test(s) || !ru[r].has(o.property.value) ? null : o.valueFirst < o.valueEnd && Ma(e.tokens, o.valueFirst, o.valueEnd, o.property.value) ? s : null;
|
|
2097
2098
|
}
|
|
2098
|
-
function
|
|
2099
|
-
const o = rr(e.tokens, t, n).map(([s, a]) =>
|
|
2099
|
+
function La(e, t, n, r) {
|
|
2100
|
+
const o = rr(e.tokens, t, n).map(([s, a]) => yu(e, s, a, r)).filter((s) => s !== null);
|
|
2100
2101
|
return o.length === 0 ? null : o.join(";");
|
|
2101
2102
|
}
|
|
2102
|
-
function
|
|
2103
|
+
function xu(e, t, n) {
|
|
2103
2104
|
const r = { text: e, tokens: ht(e) }, o = { svgId: t, classPrefix: n }, s = [];
|
|
2104
2105
|
for (const { from: a, blockStart: l, blockEnd: c } of io(r.tokens)) {
|
|
2105
|
-
const d =
|
|
2106
|
+
const d = pu(r, a, l, o), u = d === null ? null : La(r, l + 1, c, d.target);
|
|
2106
2107
|
d !== null && u !== null && s.push(`${d.text}{${u}}`);
|
|
2107
2108
|
}
|
|
2108
2109
|
return s.length === 0 ? null : s.join("");
|
|
2109
2110
|
}
|
|
2110
|
-
function
|
|
2111
|
+
function wu(e, t) {
|
|
2111
2112
|
const n = { text: e, tokens: ht(e) };
|
|
2112
|
-
return
|
|
2113
|
+
return La(n, 0, n.tokens.length, t);
|
|
2113
2114
|
}
|
|
2114
|
-
function
|
|
2115
|
+
function bu(e, t) {
|
|
2115
2116
|
if (ao.test(t)) return !1;
|
|
2116
2117
|
const n = ht(t);
|
|
2117
|
-
return
|
|
2118
|
+
return Ma(n, 0, n.length, e);
|
|
2118
2119
|
}
|
|
2119
|
-
function
|
|
2120
|
+
function Ia(e, t, n) {
|
|
2120
2121
|
return rr(e.tokens, t, n).flatMap(([r, o]) => {
|
|
2121
2122
|
const s = nr(e.tokens, r, o);
|
|
2122
2123
|
return s === null ? [] : [{ property: s.property.value, value: s.valueFirst < s.valueEnd ? mt(e, s.valueFirst, s.valueEnd) : "" }];
|
|
2123
2124
|
});
|
|
2124
2125
|
}
|
|
2125
|
-
function
|
|
2126
|
+
function Eu(e) {
|
|
2126
2127
|
const t = { text: e, tokens: ht(e) };
|
|
2127
|
-
return
|
|
2128
|
+
return Ia(t, 0, t.tokens.length);
|
|
2128
2129
|
}
|
|
2129
|
-
function
|
|
2130
|
+
function vu(e) {
|
|
2130
2131
|
const t = { text: e, tokens: ht(e) };
|
|
2131
|
-
return io(t.tokens).flatMap(({ blockStart: n, blockEnd: r }) =>
|
|
2132
|
+
return io(t.tokens).flatMap(({ blockStart: n, blockEnd: r }) => Ia(t, n + 1, r));
|
|
2132
2133
|
}
|
|
2133
|
-
function
|
|
2134
|
+
function Su(e, t) {
|
|
2134
2135
|
const n = { text: e, tokens: ht(e) }, r = rr(n.tokens, 0, n.tokens.length).flatMap(([o, s]) => {
|
|
2135
2136
|
const a = nr(n.tokens, o, s);
|
|
2136
2137
|
return a === null || t.has(wn(a.property.value)) ? [] : [mt(n, a.first, a.end)];
|
|
@@ -2138,7 +2139,7 @@ function vu(e, t) {
|
|
|
2138
2139
|
return r.length === 0 ? null : r.join(";");
|
|
2139
2140
|
}
|
|
2140
2141
|
const Wr = (e, t) => e.startsWith("#") && !e.includes("%") && t.ids.has(e.slice(1)), Zo = (e, t, n) => e[t] === "#" ? `${e.slice(0, t + 1)}${n.prefix}${e.slice(t + 1)}` : null;
|
|
2141
|
-
function
|
|
2142
|
+
function Da(e, t, n, r) {
|
|
2142
2143
|
let o = "", s = t;
|
|
2143
2144
|
for (; s < n; ) {
|
|
2144
2145
|
const a = e.tokens[s], l = e.text.slice(a.start, a.end);
|
|
@@ -2149,7 +2150,7 @@ function Ia(e, t, n, r) {
|
|
|
2149
2150
|
continue;
|
|
2150
2151
|
}
|
|
2151
2152
|
if (a.type === "function" && wn(a.value) === "url") {
|
|
2152
|
-
const c =
|
|
2153
|
+
const c = Ca(e.tokens, s, n);
|
|
2153
2154
|
if (c === null || c.argument.type !== "string" || !Wr(c.argument.value, r)) return null;
|
|
2154
2155
|
const d = Zo(e.text.slice(c.argument.start, c.argument.end), 1, r);
|
|
2155
2156
|
if (d === null) return null;
|
|
@@ -2160,18 +2161,18 @@ function Ia(e, t, n, r) {
|
|
|
2160
2161
|
}
|
|
2161
2162
|
return o;
|
|
2162
2163
|
}
|
|
2163
|
-
function
|
|
2164
|
+
function Pa(e, t, n, r) {
|
|
2164
2165
|
const o = rr(e.tokens, t, n).flatMap(([s, a]) => {
|
|
2165
2166
|
const l = nr(e.tokens, s, a);
|
|
2166
2167
|
if (l === null) return [];
|
|
2167
|
-
const c = l.valueFirst < l.valueEnd ?
|
|
2168
|
+
const c = l.valueFirst < l.valueEnd ? Da(e, l.valueFirst, l.valueEnd, r) : "";
|
|
2168
2169
|
if (c === null) return [];
|
|
2169
2170
|
const d = l.valueEnd < l.end ? mt(e, l.valueEnd, l.end) : "";
|
|
2170
2171
|
return [`${mt(e, l.first, l.valueFirst)}${c}${d}`];
|
|
2171
2172
|
});
|
|
2172
2173
|
return o.length === 0 ? null : o.join(";");
|
|
2173
2174
|
}
|
|
2174
|
-
function
|
|
2175
|
+
function ku(e, t, n, r) {
|
|
2175
2176
|
const o = [];
|
|
2176
2177
|
let s = "";
|
|
2177
2178
|
for (let a = t; a <= n; a += 1) {
|
|
@@ -2185,23 +2186,23 @@ function Su(e, t, n, r) {
|
|
|
2185
2186
|
}
|
|
2186
2187
|
return o.length === 0 ? null : o.join(",");
|
|
2187
2188
|
}
|
|
2188
|
-
function
|
|
2189
|
+
function Tu(e, t) {
|
|
2189
2190
|
const n = { text: e, tokens: ht(e) }, r = [];
|
|
2190
2191
|
for (const { from: o, blockStart: s, blockEnd: a } of io(n.tokens)) {
|
|
2191
|
-
const l =
|
|
2192
|
+
const l = ku(n, o, s, t), c = l === null ? null : Pa(n, s + 1, a, t);
|
|
2192
2193
|
l !== null && c !== null && r.push(`${l}{${c}}`);
|
|
2193
2194
|
}
|
|
2194
2195
|
return r.length === 0 ? null : r.join("");
|
|
2195
2196
|
}
|
|
2196
|
-
function
|
|
2197
|
+
function Ou(e, t) {
|
|
2197
2198
|
const n = { text: e, tokens: ht(e) };
|
|
2198
|
-
return
|
|
2199
|
+
return Pa(n, 0, n.tokens.length, t);
|
|
2199
2200
|
}
|
|
2200
|
-
function
|
|
2201
|
+
function _u(e, t) {
|
|
2201
2202
|
const n = { text: e, tokens: ht(e) };
|
|
2202
|
-
return
|
|
2203
|
+
return Da(n, 0, n.tokens.length, t);
|
|
2203
2204
|
}
|
|
2204
|
-
const he = (e, t) => Object.freeze({ type: e, header: t }),
|
|
2205
|
+
const he = (e, t) => Object.freeze({ type: e, header: t }), Ru = Object.freeze([
|
|
2205
2206
|
he("mindmap", "mindmap"),
|
|
2206
2207
|
he("architecture", "architecture-beta"),
|
|
2207
2208
|
he("c4", "C4Context"),
|
|
@@ -2234,7 +2235,7 @@ const he = (e, t) => Object.freeze({ type: e, header: t }), _u = Object.freeze([
|
|
|
2234
2235
|
he("venn", "venn-beta"),
|
|
2235
2236
|
he("wardley", "wardley-beta"),
|
|
2236
2237
|
he("cynefin", "cynefin-beta")
|
|
2237
|
-
]),
|
|
2238
|
+
]), Au = new Set(Ru.map(({ type: e }) => e)), Nu = (e) => Au.has(e), it = "http://www.w3.org/2000/svg", $a = "http://www.w3.org/1999/xhtml", ju = Object.freeze([
|
|
2238
2239
|
"fill",
|
|
2239
2240
|
"stroke",
|
|
2240
2241
|
"color",
|
|
@@ -2254,37 +2255,37 @@ const he = (e, t) => Object.freeze({ type: e, header: t }), _u = Object.freeze([
|
|
|
2254
2255
|
"flood-opacity",
|
|
2255
2256
|
"text-decoration",
|
|
2256
2257
|
"text-shadow"
|
|
2257
|
-
]),
|
|
2258
|
+
]), Cu = (e) => {
|
|
2258
2259
|
const { ground: t, text: n, surface: r, line: o, series: s, seriesText: a } = e;
|
|
2259
2260
|
return [.../* @__PURE__ */ new Set([t, n, r.primary, r.secondary, r.tertiary, r.note, o, ...s, a])];
|
|
2260
|
-
}, Gr = new Set(
|
|
2261
|
+
}, Gr = new Set(ju), Mu = /* @__PURE__ */ new Set(["fill", "stroke", "color", "background-color"]), Lu = /* @__PURE__ */ new Set(["none", "transparent"]), Iu = "text-decoration", Du = /* @__PURE__ */ new Set(["none", "underline", "overline", "line-through", "blink", "spelling-error", "grammar-error", "solid", "double", "dotted", "dashed", "wavy"]), Pu = /^[0-9a-f]{6}$/u, Jo = ["function", "number", "comma", "number", "comma", "number", ")"], $u = /^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/u, zu = (e) => {
|
|
2261
2262
|
const t = ht(e).filter((r) => r.type !== "whitespace");
|
|
2262
|
-
if (t.length === 1) return t[0].type === "hash" &&
|
|
2263
|
+
if (t.length === 1) return t[0].type === "hash" && Pu.test(t[0].value) ? `#${t[0].value}` : null;
|
|
2263
2264
|
if (t.length !== Jo.length || t.some((r, o) => r.type !== Jo[o]) || t[0].value !== "rgb") return null;
|
|
2264
2265
|
const n = [t[1], t[3], t[5]].map((r) => e.slice(r.start, r.end));
|
|
2265
|
-
return n.every((r) =>
|
|
2266
|
-
},
|
|
2266
|
+
return n.every((r) => $u.test(r)) ? `#${n.map((r) => Number(r).toString(16).padStart(2, "0")).join("")}` : null;
|
|
2267
|
+
}, Fu = ({ property: e, value: t }, n) => {
|
|
2267
2268
|
if (!Gr.has(e)) return !0;
|
|
2268
|
-
if (
|
|
2269
|
-
if (
|
|
2270
|
-
const o =
|
|
2269
|
+
if (Mu.has(e)) {
|
|
2270
|
+
if (Lu.has(t)) return !0;
|
|
2271
|
+
const o = zu(t);
|
|
2271
2272
|
return o !== null && n.has(o);
|
|
2272
2273
|
}
|
|
2273
|
-
if (e !==
|
|
2274
|
+
if (e !== Iu) return !1;
|
|
2274
2275
|
const r = ht(t).filter((o) => o.type !== "whitespace");
|
|
2275
|
-
return r.length > 0 && r.every((o) => o.type === "ident" &&
|
|
2276
|
+
return r.length > 0 && r.every((o) => o.type === "ident" && Du.has(o.value));
|
|
2276
2277
|
};
|
|
2277
|
-
function
|
|
2278
|
-
const n = new Set(
|
|
2278
|
+
function Bu(e, t) {
|
|
2279
|
+
const n = new Set(Cu(t));
|
|
2279
2280
|
for (const r of [e, ...e.querySelectorAll("*")]) {
|
|
2280
2281
|
if (r.localName === "style") {
|
|
2281
|
-
const o =
|
|
2282
|
+
const o = vu(r.textContent).find(({ property: s }) => Gr.has(s));
|
|
2282
2283
|
if (o !== void 0) return `${o.property} ${JSON.stringify(o.value)} in a sheet`;
|
|
2283
2284
|
}
|
|
2284
2285
|
for (const o of Array.from(r.attributes)) {
|
|
2285
2286
|
const s = o.name.toLowerCase();
|
|
2286
2287
|
if (s === "style") {
|
|
2287
|
-
const a =
|
|
2288
|
+
const a = Eu(o.value).find((l) => !Fu(l, n));
|
|
2288
2289
|
if (a !== void 0) return `${a.property} ${JSON.stringify(a.value)} in the style of the ${r.localName} element`;
|
|
2289
2290
|
} else if (Gr.has(s))
|
|
2290
2291
|
return `${s} ${JSON.stringify(o.value)} in an attribute of the ${r.localName} element`;
|
|
@@ -2292,7 +2293,7 @@ function Fu(e, t) {
|
|
|
2292
2293
|
}
|
|
2293
2294
|
return null;
|
|
2294
2295
|
}
|
|
2295
|
-
const
|
|
2296
|
+
const qu = "data-aqmd-mermaid-drawing-place", Hu = "listening", Uu = "aiquants-markdown:mermaid-frame:connect", za = "aqmd-mmd-", Wu = [
|
|
2296
2297
|
"svg",
|
|
2297
2298
|
"g",
|
|
2298
2299
|
"defs",
|
|
@@ -2319,7 +2320,7 @@ const Bu = "data-aqmd-mermaid-drawing-place", qu = "listening", Hu = "aiquants-m
|
|
|
2319
2320
|
"tspan",
|
|
2320
2321
|
"image",
|
|
2321
2322
|
"a"
|
|
2322
|
-
],
|
|
2323
|
+
], Gu = ["div", "span", "p", "br", "b", "strong", "i", "em", "u", "s", "del", "ins", "sub", "sup", "small", "mark", "code", "kbd", "ul", "ol", "li", "table", "caption", "thead", "tbody", "tfoot", "tr", "th", "td", "img"], Vu = /* @__PURE__ */ new Set(["style", "title"]), Ku = [
|
|
2323
2324
|
"alignment-baseline",
|
|
2324
2325
|
"clip-path",
|
|
2325
2326
|
"clip-rule",
|
|
@@ -2387,41 +2388,41 @@ const Bu = "data-aqmd-mermaid-drawing-place", qu = "listening", Hu = "aiquants-m
|
|
|
2387
2388
|
"y",
|
|
2388
2389
|
"y1",
|
|
2389
2390
|
"y2"
|
|
2390
|
-
],
|
|
2391
|
+
], Fa = /* @__PURE__ */ new Set(["id", "data-look", "title", "alt"]), Vn = /* @__PURE__ */ new Set(["role", "aria-roledescription", "aria-labelledby", "aria-describedby"]), Yu = /* @__PURE__ */ new Set(["id", "class", "style", "width", "height", "viewbox", "preserveaspectratio", "overflow", ...Vn]), Ba = /* @__PURE__ */ new Set(["href", "xlink:href", "src"]), Qo = /^data:image\//u, Xu = /* @__PURE__ */ new Map([
|
|
2391
2392
|
[`${it} use`, { attributes: /* @__PURE__ */ new Set(["href", "xlink:href"]), shape: Gn, removesElement: !1 }],
|
|
2392
2393
|
[`${it} linearGradient`, { attributes: /* @__PURE__ */ new Set(["href", "xlink:href"]), shape: Gn, removesElement: !1 }],
|
|
2393
2394
|
[`${it} image`, { attributes: /* @__PURE__ */ new Set(["href", "xlink:href"]), shape: Qo, removesElement: !0 }],
|
|
2394
|
-
[`${
|
|
2395
|
-
]),
|
|
2396
|
-
ALLOWED_TAGS: [...
|
|
2397
|
-
ALLOWED_ATTR: [...
|
|
2395
|
+
[`${$a} img`, { attributes: /* @__PURE__ */ new Set(["src"]), shape: Qo, removesElement: !0 }]
|
|
2396
|
+
]), Zu = /[\t\n\f\r ]+/u, Ju = {
|
|
2397
|
+
ALLOWED_TAGS: [...Wu, ...Gu],
|
|
2398
|
+
ALLOWED_ATTR: [...Ku, ...Fa, ...Vn, ...Ba, "class", "style"],
|
|
2398
2399
|
ALLOW_ARIA_ATTR: !1,
|
|
2399
2400
|
ALLOW_DATA_ATTR: !1,
|
|
2400
2401
|
HTML_INTEGRATION_POINTS: { foreignobject: !0 },
|
|
2401
2402
|
RETURN_DOM_FRAGMENT: !0
|
|
2402
|
-
},
|
|
2403
|
-
function
|
|
2404
|
-
const t = e.split(
|
|
2405
|
-
return t.length === 0 ? null : t.map((n) => `${
|
|
2403
|
+
}, Qu = (e, t) => e !== null && e.namespaceURI === it && e.localName === "svg" && e.getAttribute("id") === t;
|
|
2404
|
+
function ef(e) {
|
|
2405
|
+
const t = e.split(Zu).filter((n) => n !== "");
|
|
2406
|
+
return t.length === 0 ? null : t.map((n) => `${za}${n}`).join(" ");
|
|
2406
2407
|
}
|
|
2407
|
-
function
|
|
2408
|
-
const r =
|
|
2408
|
+
function tf(e, t, n) {
|
|
2409
|
+
const r = Xu.get(`${e.namespaceURI} ${e.localName}`);
|
|
2409
2410
|
return r?.attributes.has(n) && r.shape.test(t.value) ? !0 : r?.attributes.has(n) && r.removesElement ? !1 : (e.removeAttributeNode(t), !0);
|
|
2410
2411
|
}
|
|
2411
|
-
function
|
|
2412
|
+
function nf(e, t, n) {
|
|
2412
2413
|
const r = t.name.toLowerCase(), { value: o } = t;
|
|
2413
|
-
if (
|
|
2414
|
+
if (Ba.has(r)) return tf(e, t, r);
|
|
2414
2415
|
const s = e === n;
|
|
2415
2416
|
let a = o;
|
|
2416
|
-
return (s ? !
|
|
2417
|
+
return (s ? !Yu.has(r) : Vn.has(r)) ? a = null : r === "class" ? a = ef(o) : r === "style" ? a = wu(o, s ? "root" : "inside") : Fa.has(r) || Vn.has(r) || bu(r, o) || (a = null), a === null ? e.removeAttributeNode(t) : a !== o && (t.value = a), !0;
|
|
2417
2418
|
}
|
|
2418
|
-
function
|
|
2419
|
+
function rf(e) {
|
|
2419
2420
|
for (let t = e.parentElement; t !== null; t = t.parentElement)
|
|
2420
2421
|
if (t.namespaceURI === it && t.localName === "text") return !0;
|
|
2421
2422
|
return !1;
|
|
2422
2423
|
}
|
|
2423
|
-
function
|
|
2424
|
-
if (e.namespaceURI !== it ||
|
|
2424
|
+
function of(e) {
|
|
2425
|
+
if (e.namespaceURI !== it || rf(e)) {
|
|
2425
2426
|
e.replaceWith(...Array.from(e.childNodes));
|
|
2426
2427
|
return;
|
|
2427
2428
|
}
|
|
@@ -2429,37 +2430,37 @@ function rf(e) {
|
|
|
2429
2430
|
for (const n of Array.from(e.attributes)) t.setAttributeNS(n.namespaceURI, n.name, n.value);
|
|
2430
2431
|
t.append(...Array.from(e.childNodes)), e.replaceWith(t);
|
|
2431
2432
|
}
|
|
2432
|
-
function
|
|
2433
|
-
if (e.namespaceURI ===
|
|
2433
|
+
function sf(e, t, n) {
|
|
2434
|
+
if (e.namespaceURI === $a && Vu.has(e.localName)) {
|
|
2434
2435
|
e.remove();
|
|
2435
2436
|
return;
|
|
2436
2437
|
}
|
|
2437
2438
|
for (const o of Array.from(e.attributes))
|
|
2438
|
-
if (!
|
|
2439
|
+
if (!nf(e, o, t)) {
|
|
2439
2440
|
e.remove();
|
|
2440
2441
|
return;
|
|
2441
2442
|
}
|
|
2442
2443
|
if (e.localName === "a") {
|
|
2443
|
-
|
|
2444
|
+
of(e);
|
|
2444
2445
|
return;
|
|
2445
2446
|
}
|
|
2446
2447
|
if (e.namespaceURI !== it || e.localName !== "style") return;
|
|
2447
|
-
const r =
|
|
2448
|
+
const r = xu(e.textContent, n, za);
|
|
2448
2449
|
r === null ? e.remove() : e.textContent = r;
|
|
2449
2450
|
}
|
|
2450
|
-
function
|
|
2451
|
-
const t =
|
|
2451
|
+
function af(e) {
|
|
2452
|
+
const t = ul(e);
|
|
2452
2453
|
if (!t.isSupported) throw new TypeError("createMermaidSvgCleaner: DOMPurify cannot run on the given window (it has no document)");
|
|
2453
2454
|
return (n, r) => {
|
|
2454
2455
|
if (typeof r != "string" || !ro.test(r))
|
|
2455
2456
|
throw new RangeError(`cleanMermaidSvg: svgId must be an ASCII letter followed by ASCII letters, digits, "-" and "_", got ${typeof r == "string" ? JSON.stringify(r) : String(r)}`);
|
|
2456
|
-
const o = t.sanitize(n,
|
|
2457
|
-
if (o.childNodes.length !== 1 || !
|
|
2458
|
-
for (const a of [s, ...Array.from(s.querySelectorAll("*"))])
|
|
2457
|
+
const o = t.sanitize(n, Ju), s = o.firstElementChild;
|
|
2458
|
+
if (o.childNodes.length !== 1 || !Qu(s, r)) return null;
|
|
2459
|
+
for (const a of [s, ...Array.from(s.querySelectorAll("*"))]) sf(a, s, r);
|
|
2459
2460
|
return s;
|
|
2460
2461
|
};
|
|
2461
2462
|
}
|
|
2462
|
-
const
|
|
2463
|
+
const lf = (e) => `default-src 'none'; script-src ${e}; style-src ${e} 'unsafe-inline'; font-src ${e}; img-src data:`, cf = Object.freeze(["html-label", "unsized", "unlike-text"]), df = /* @__PURE__ */ new Set(["https:", "http:"]), uf = "aqmd-mermaid-", ff = [
|
|
2463
2464
|
["position", "fixed"],
|
|
2464
2465
|
["inset-block-start", "0"],
|
|
2465
2466
|
["inset-inline-start", "0"],
|
|
@@ -2467,15 +2468,15 @@ const af = (e) => `default-src 'none'; script-src ${e}; style-src ${e} 'unsafe-i
|
|
|
2467
2468
|
["block-size", "0"],
|
|
2468
2469
|
["border", "0"],
|
|
2469
2470
|
["visibility", "hidden"]
|
|
2470
|
-
],
|
|
2471
|
+
], mf = "the drawing place's script did not load, or threw before it listened", hf = "the drawing place's frame loaded again, and the diagrams it held were lost", es = "the drawing place's frame left the page, and the diagrams it held were lost", pf = "the page has no body to hold the drawing place's frame", gf = "the drawing place answered with something other than one svg of the requested id", yf = "the drawing place answered with a paint off the diagram palette", xf = "the drawing place answered in a shape the page does not read", wf = "the drawing holds a foreignObject, a label drawn as HTML, which not every reader of an image file draws", bf = "the drawing has no viewBox of a positive width and height to take its size from", Ef = "the drawing's text, white space aside, differs from that of the shown drawing, as when a label holds HTML or an icon the export form writes out as characters", vf = /* @__PURE__ */ new Set(["style", "title", "desc"]), Sf = /\s/gu, kf = /* @__PURE__ */ new Set(["max-width"]), Mn = String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)`, Tf = String.raw`(?:[\t\n\r ]*,[\t\n\r ]*|[\t\n\r ]+)`, Of = new RegExp(String.raw`^[\t\n\r ]*${[Mn, Mn, Mn, Mn].join(Tf)}[\t\n\r ]*$`, "u"), qa = /* @__PURE__ */ new WeakMap(), lo = (e) => typeof e == "object" && e !== null, br = (e) => Number.isSafeInteger(e) && e >= 0, Er = (e) => e.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">"), _f = (e, t, n) => `<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${Er(lf(e))}">${n.map((r) => `<link rel="stylesheet" href="${Er(r)}">`).join("")}<script type="module" src="${Er(t)}"><\/script></head><body></body></html>`, ts = (e, t) => {
|
|
2471
2472
|
if (!(t instanceof URL) && (typeof t != "string" || t === ""))
|
|
2472
2473
|
throw new TypeError(`createMermaidDrawer: ${e} must be a URL or a non-empty string`);
|
|
2473
2474
|
if (!URL.canParse(t, window.location.href)) throw new TypeError(`createMermaidDrawer: ${e} does not parse as a URL: ${String(t)}`);
|
|
2474
2475
|
const n = new URL(t, window.location.href);
|
|
2475
|
-
if (n.origin !== window.location.origin || !
|
|
2476
|
+
if (n.origin !== window.location.origin || !df.has(n.protocol))
|
|
2476
2477
|
throw new RangeError(`createMermaidDrawer: ${e} must be an https or http URL of the page's origin ${window.location.origin}, the only one the frame's content security policy takes, got ${n.href}`);
|
|
2477
2478
|
return n.href;
|
|
2478
|
-
},
|
|
2479
|
+
}, Rf = (e) => {
|
|
2479
2480
|
if (!lo(e)) throw new TypeError("MermaidDrawer: the request must be an object");
|
|
2480
2481
|
if (typeof e.source != "string") throw new TypeError("MermaidDrawer: source must be a string");
|
|
2481
2482
|
if (e.theme !== "light" && e.theme !== "dark") throw new RangeError(`MermaidDrawer: theme must be "light" or "dark", got ${String(e.theme)}`);
|
|
@@ -2485,7 +2486,7 @@ const af = (e) => `default-src 'none'; script-src ${e}; style-src ${e} 'unsafe-i
|
|
|
2485
2486
|
if (typeof e.lang != "string") throw new TypeError("MermaidDrawer: lang must be a string, the slot's lang as written (empty when it has none)");
|
|
2486
2487
|
for (const t of ["maxChars", "maxEdges"])
|
|
2487
2488
|
if (!(Number.isSafeInteger(e[t]) && e[t] > 0)) throw new RangeError(`MermaidDrawer: ${t} must be a positive safe integer, got ${String(e[t])}`);
|
|
2488
|
-
},
|
|
2489
|
+
}, Af = (e) => {
|
|
2489
2490
|
if (!lo(e)) return null;
|
|
2490
2491
|
switch (e.kind) {
|
|
2491
2492
|
case "too-large":
|
|
@@ -2496,21 +2497,21 @@ const af = (e) => `default-src 'none'; script-src ${e}; style-src ${e} 'unsafe-i
|
|
|
2496
2497
|
case "frame":
|
|
2497
2498
|
return typeof e.message == "string" ? { kind: e.kind, message: e.message } : null;
|
|
2498
2499
|
case "unlisted-type":
|
|
2499
|
-
return typeof e.type == "string" && e.type !== "" && !
|
|
2500
|
+
return typeof e.type == "string" && e.type !== "" && !Nu(e.type) ? { kind: "unlisted-type", type: e.type } : null;
|
|
2500
2501
|
default:
|
|
2501
2502
|
return null;
|
|
2502
2503
|
}
|
|
2503
|
-
}, nn = (e) => ({ failure: { kind: "frame", message: e } }),
|
|
2504
|
-
const t = e === null ? null :
|
|
2504
|
+
}, nn = (e) => ({ failure: { kind: "frame", message: e } }), Nf = (e) => {
|
|
2505
|
+
const t = e === null ? null : Of.exec(e);
|
|
2505
2506
|
if (t === null) return null;
|
|
2506
2507
|
const [n, r, o, s] = t.slice(1).map(Number);
|
|
2507
2508
|
return [n, r, o, s].every(Number.isFinite) && o > 0 && s > 0 ? { x: n, y: r, width: o, height: s } : null;
|
|
2508
|
-
},
|
|
2509
|
-
if (e.getElementsByTagNameNS(it, "foreignObject").length > 0) return { kind: "not-exportable", reason: "html-label", message:
|
|
2510
|
-
const n =
|
|
2511
|
-
if (n === null) return { kind: "not-exportable", reason: "unsized", message:
|
|
2509
|
+
}, jf = (e, t) => {
|
|
2510
|
+
if (e.getElementsByTagNameNS(it, "foreignObject").length > 0) return { kind: "not-exportable", reason: "html-label", message: wf };
|
|
2511
|
+
const n = Nf(e.getAttribute("viewBox"));
|
|
2512
|
+
if (n === null) return { kind: "not-exportable", reason: "unsized", message: bf };
|
|
2512
2513
|
e.setAttribute("width", String(n.width)), e.setAttribute("height", String(n.height));
|
|
2513
|
-
const r = e.getAttribute("style"), o = r === null ? null :
|
|
2514
|
+
const r = e.getAttribute("style"), o = r === null ? null : Su(r, kf);
|
|
2514
2515
|
o === null ? e.removeAttribute("style") : e.setAttribute("style", o);
|
|
2515
2516
|
const s = e.ownerDocument.createElementNS(it, "rect");
|
|
2516
2517
|
for (const [a, l] of [
|
|
@@ -2528,20 +2529,20 @@ const af = (e) => `default-src 'none'; script-src ${e}; style-src ${e} 'unsafe-i
|
|
|
2528
2529
|
}, rs = (e) => {
|
|
2529
2530
|
const t = [], n = (r) => {
|
|
2530
2531
|
for (const o of r)
|
|
2531
|
-
o.nodeType === o.TEXT_NODE || o.nodeType === o.CDATA_SECTION_NODE ? t.push(...Array.from((o.nodeValue ?? "").replace(
|
|
2532
|
+
o.nodeType === o.TEXT_NODE || o.nodeType === o.CDATA_SECTION_NODE ? t.push(...Array.from((o.nodeValue ?? "").replace(Sf, ""))) : o.nodeType === o.ELEMENT_NODE && !vf.has(o.localName) && n(ns(o));
|
|
2532
2533
|
};
|
|
2533
2534
|
return n(ns(e)), t.sort().join("");
|
|
2534
2535
|
}, os = (e) => {
|
|
2535
2536
|
const t = Object.freeze({ length: e.outerHTML.length });
|
|
2536
|
-
return
|
|
2537
|
-
},
|
|
2538
|
-
function
|
|
2537
|
+
return qa.set(t, e), t;
|
|
2538
|
+
}, Ha = (e) => qa.get(e);
|
|
2539
|
+
function Fx(e) {
|
|
2539
2540
|
if (typeof window > "u") throw new TypeError("createMermaidDrawer: it needs the page's window; create it in the browser");
|
|
2540
2541
|
if (window.location.hostname.startsWith("["))
|
|
2541
2542
|
throw new RangeError(`createMermaidDrawer: the page's origin ${window.location.origin} has an IPv6 address, which no content security policy takes as a source, so the frame could not load its script; serve the page under a domain name or an IPv4 address`);
|
|
2542
|
-
const t =
|
|
2543
|
+
const t = af(window), n = ts("frameScriptUrl", e.frameScriptUrl);
|
|
2543
2544
|
if (!Array.isArray(e.fontStylesheetUrls)) throw new TypeError("createMermaidDrawer: fontStylesheetUrls must be an array");
|
|
2544
|
-
const r =
|
|
2545
|
+
const r = _f(
|
|
2545
2546
|
window.location.origin,
|
|
2546
2547
|
n,
|
|
2547
2548
|
e.fontStylesheetUrls.map((h, y) => ts(`fontStylesheetUrls[${y}]`, h))
|
|
@@ -2561,35 +2562,35 @@ function zx(e) {
|
|
|
2561
2562
|
if (typeof h.svg == "string" && !("failure" in h)) {
|
|
2562
2563
|
const k = t(h.svg, y.svgId);
|
|
2563
2564
|
if (k === null) {
|
|
2564
|
-
l(h.id, y, nn(
|
|
2565
|
+
l(h.id, y, nn(gf));
|
|
2565
2566
|
return;
|
|
2566
2567
|
}
|
|
2567
|
-
const T =
|
|
2568
|
+
const T = Bu(k, y.palette);
|
|
2568
2569
|
if (T !== null) {
|
|
2569
|
-
l(h.id, y, nn(`${
|
|
2570
|
+
l(h.id, y, nn(`${yf}: ${T}`));
|
|
2570
2571
|
return;
|
|
2571
2572
|
}
|
|
2572
|
-
const x = y.form === "export" ?
|
|
2573
|
+
const x = y.form === "export" ? jf(k, y.palette) : null;
|
|
2573
2574
|
l(h.id, y, x === null ? { svg: k } : { failure: x });
|
|
2574
2575
|
return;
|
|
2575
2576
|
}
|
|
2576
|
-
const b = "svg" in h ? null :
|
|
2577
|
-
l(h.id, y, b === null ? nn(
|
|
2577
|
+
const b = "svg" in h ? null : Af(h.failure);
|
|
2578
|
+
l(h.id, y, b === null ? nn(xf) : { failure: b });
|
|
2578
2579
|
}, f = (h) => {
|
|
2579
2580
|
if (s !== h) return;
|
|
2580
|
-
h.port !== null && (c(h,
|
|
2581
|
+
h.port !== null && (c(h, hf), h.port.close(), h.port = null);
|
|
2581
2582
|
const y = h.element.contentWindow;
|
|
2582
|
-
if (y?.document.documentElement.getAttribute(
|
|
2583
|
-
d(h,
|
|
2583
|
+
if (y?.document.documentElement.getAttribute(qu) !== Hu) {
|
|
2584
|
+
d(h, mf);
|
|
2584
2585
|
return;
|
|
2585
2586
|
}
|
|
2586
2587
|
const b = new MessageChannel();
|
|
2587
|
-
b.port1.onmessage = (k) => u(k.data), y.postMessage({ type:
|
|
2588
|
+
b.port1.onmessage = (k) => u(k.data), y.postMessage({ type: Uu }, window.location.origin, [b.port2]), h.port = b.port1;
|
|
2588
2589
|
for (const k of h.queued.splice(0)) b.port1.postMessage(k);
|
|
2589
2590
|
}, m = (h) => {
|
|
2590
2591
|
const y = window.document.createElement("iframe");
|
|
2591
2592
|
y.setAttribute("aria-hidden", "true"), y.setAttribute("inert", ""), y.tabIndex = -1;
|
|
2592
|
-
for (const [T, x] of
|
|
2593
|
+
for (const [T, x] of ff) y.style.setProperty(T, x);
|
|
2593
2594
|
y.srcdoc = r;
|
|
2594
2595
|
const b = new MutationObserver(() => {
|
|
2595
2596
|
y.isConnected || d(k, es);
|
|
@@ -2599,17 +2600,17 @@ function zx(e) {
|
|
|
2599
2600
|
if (s !== null && !s.element.isConnected && d(s, es), s === null) {
|
|
2600
2601
|
const { body: b } = window.document;
|
|
2601
2602
|
if (b === null) {
|
|
2602
|
-
y(nn(
|
|
2603
|
+
y(nn(pf));
|
|
2603
2604
|
return;
|
|
2604
2605
|
}
|
|
2605
2606
|
s = m(b);
|
|
2606
2607
|
}
|
|
2607
|
-
o.set(h.id, { svgId: h.svgId, palette:
|
|
2608
|
+
o.set(h.id, { svgId: h.svgId, palette: Ra[h.theme], form: h.form, frame: s, resolve: y }), s.port === null ? s.queued.push(h) : s.port.postMessage(h);
|
|
2608
2609
|
}, g = (h, y) => {
|
|
2609
2610
|
a += 1;
|
|
2610
2611
|
const b = {
|
|
2611
2612
|
id: a,
|
|
2612
|
-
svgId: `${
|
|
2613
|
+
svgId: `${uf}${a}`,
|
|
2613
2614
|
source: h.source,
|
|
2614
2615
|
theme: h.theme,
|
|
2615
2616
|
form: y,
|
|
@@ -2622,31 +2623,31 @@ function zx(e) {
|
|
|
2622
2623
|
return new Promise((k) => w(b, k));
|
|
2623
2624
|
};
|
|
2624
2625
|
return async (h) => {
|
|
2625
|
-
if (
|
|
2626
|
+
if (Rf(h), h.form === "shown") {
|
|
2626
2627
|
const x = await g(h, "shown");
|
|
2627
2628
|
return "failure" in x ? x : { diagram: os(x.svg) };
|
|
2628
2629
|
}
|
|
2629
2630
|
const y = g(h, "export"), b = g(h, "shown"), k = await y;
|
|
2630
2631
|
if ("failure" in k) return k;
|
|
2631
2632
|
const T = await b;
|
|
2632
|
-
return "failure" in T ? T : rs(k.svg) !== rs(T.svg) ? { failure: { kind: "not-exportable", reason: "unlike-text", message:
|
|
2633
|
+
return "failure" in T ? T : rs(k.svg) !== rs(T.svg) ? { failure: { kind: "not-exportable", reason: "unlike-text", message: Ef } } : { diagram: os(k.svg) };
|
|
2633
2634
|
};
|
|
2634
2635
|
}
|
|
2635
|
-
const
|
|
2636
|
-
const e = Array.from(crypto.getRandomValues(new Uint8Array(
|
|
2637
|
-
return `${
|
|
2636
|
+
const Cf = "aqmd-mmd-", Mf = "data-aqmd-mermaid-drawing", ss = "drawing", Lf = "scalable", If = 8, Df = /* @__PURE__ */ new Set(["href", "xlink:href"]), Pf = /* @__PURE__ */ new Set(["aria-labelledby", "aria-describedby"]), $f = /[\t\n\f\r ]+/u, zf = () => {
|
|
2637
|
+
const e = Array.from(crypto.getRandomValues(new Uint8Array(If)), (t) => t.toString(16).padStart(2, "0")).join("");
|
|
2638
|
+
return `${Cf}${e}-`;
|
|
2638
2639
|
};
|
|
2639
|
-
function
|
|
2640
|
+
function Ff(e, t, n) {
|
|
2640
2641
|
if (e === "id") return t === "" ? t : `${n.prefix}${t}`;
|
|
2641
|
-
if (
|
|
2642
|
+
if (Df.has(e))
|
|
2642
2643
|
return t.startsWith("#") ? Wr(t, n) ? `#${n.prefix}${t.slice(1)}` : null : t;
|
|
2643
|
-
if (
|
|
2644
|
-
const r = t.split(
|
|
2644
|
+
if (Pf.has(e)) {
|
|
2645
|
+
const r = t.split($f).filter((o) => n.ids.has(o));
|
|
2645
2646
|
return r.length === 0 ? null : r.map((o) => `${n.prefix}${o}`).join(" ");
|
|
2646
2647
|
}
|
|
2647
|
-
return e === "style" ?
|
|
2648
|
+
return e === "style" ? Ou(t, n) : Ur.has(e) ? _u(t, n) : t;
|
|
2648
2649
|
}
|
|
2649
|
-
function
|
|
2650
|
+
function Bf(e, t, n) {
|
|
2650
2651
|
if (typeof n != "string" || !ro.test(n))
|
|
2651
2652
|
throw new RangeError(`insertionCopyOf: the prefix must be an ASCII letter followed by ASCII letters, digits, "-" and "_", got ${typeof n == "string" ? JSON.stringify(n) : String(n)}`);
|
|
2652
2653
|
const r = t.importNode(e, !0), o = [r, ...r.querySelectorAll("*")], s = {
|
|
@@ -2655,34 +2656,34 @@ function Ff(e, t, n) {
|
|
|
2655
2656
|
};
|
|
2656
2657
|
for (const a of o) {
|
|
2657
2658
|
for (const { name: l, value: c } of [...a.attributes]) {
|
|
2658
|
-
const d =
|
|
2659
|
+
const d = Ff(l, c, s);
|
|
2659
2660
|
d === null ? a.removeAttribute(l) : d !== c && a.setAttribute(l, d);
|
|
2660
2661
|
}
|
|
2661
2662
|
if (a.namespaceURI === it && a.localName === "style") {
|
|
2662
|
-
const l =
|
|
2663
|
+
const l = Tu(a.textContent, s);
|
|
2663
2664
|
l === null ? a.remove() : a.textContent = l;
|
|
2664
2665
|
}
|
|
2665
2666
|
}
|
|
2666
2667
|
return r;
|
|
2667
2668
|
}
|
|
2668
|
-
function
|
|
2669
|
-
const n = e.ownerDocument, r =
|
|
2670
|
-
r.setAttribute("part", r.hasAttribute("viewBox") ? `${ss} ${
|
|
2669
|
+
function qf(e, t) {
|
|
2670
|
+
const n = e.ownerDocument, r = Bf(t, n, zf());
|
|
2671
|
+
r.setAttribute("part", r.hasAttribute("viewBox") ? `${ss} ${Lf}` : ss);
|
|
2671
2672
|
const o = n.createElement("div");
|
|
2672
|
-
return o.setAttribute(
|
|
2673
|
+
return o.setAttribute(Mf, ""), o.attachShadow({ mode: "open" }).append(r), e.replaceChildren(o), { host: o, svg: r };
|
|
2673
2674
|
}
|
|
2674
|
-
const
|
|
2675
|
+
const Hf = [
|
|
2675
2676
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
2676
2677
|
["path", { d: "m21 3-7 7", key: "1l2asr" }],
|
|
2677
2678
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
2678
2679
|
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
|
|
2679
|
-
],
|
|
2680
|
-
const
|
|
2680
|
+
], Uf = se("maximize-2", Hf);
|
|
2681
|
+
const Wf = [
|
|
2681
2682
|
["path", { d: "m14 10 7-7", key: "oa77jy" }],
|
|
2682
2683
|
["path", { d: "M20 10h-6V4", key: "mjg0md" }],
|
|
2683
2684
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
2684
2685
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
2685
|
-
],
|
|
2686
|
+
], Gf = se("minimize-2", Wf), St = "flex size-11 items-center justify-center rounded border p-1 shadow", Vf = "flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow", Kf = "absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg", as = "flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start", wt = "fullscreen", Yf = (e) => {
|
|
2686
2687
|
const t = e.ownerDocument.defaultView?.getComputedStyle(e).blockSize;
|
|
2687
2688
|
t !== void 0 && (e.style.minBlockSize = t);
|
|
2688
2689
|
}, is = (e) => {
|
|
@@ -2717,7 +2718,7 @@ const Uf = [
|
|
|
2717
2718
|
}, [n, t, c]);
|
|
2718
2719
|
const d = V(() => c(!n), [n, c]), u = V(
|
|
2719
2720
|
(m) => {
|
|
2720
|
-
!n || m.key !== "Escape" || m.defaultPrevented || m.nativeEvent
|
|
2721
|
+
!n || m.key !== "Escape" || m.defaultPrevented || Hs(m.nativeEvent) || (m.preventDefault(), m.stopPropagation(), c(!1));
|
|
2721
2722
|
},
|
|
2722
2723
|
[n, c]
|
|
2723
2724
|
), f = V(
|
|
@@ -2735,8 +2736,8 @@ const Uf = [
|
|
|
2735
2736
|
};
|
|
2736
2737
|
}, uo = ({ hook: e, fullscreen: t, labels: n, tabIndex: r, onToggle: o }) => {
|
|
2737
2738
|
const s = t ? n.exitFullscreen : n.fullscreen;
|
|
2738
|
-
return /* @__PURE__ */ i.jsx("button", { type: "button", [e]: wt, tabIndex: r, onClick: o, className: St, "aria-label": s.text, lang: s.lang, children: t ? /* @__PURE__ */ i.jsx(
|
|
2739
|
-
}, fo = (e, t) => ({ text: t.text, lang: t.lang, serial: e === null ? 1 : e.serial + 1 }), mo = ({ hook: e, notice: t }) => /* @__PURE__ */ i.jsx("p", { ...e, role: "status", children: t !== null && /* @__PURE__ */ i.jsx("span", { lang: t.lang, children: t.text }, t.serial) }),
|
|
2739
|
+
return /* @__PURE__ */ i.jsx("button", { type: "button", [e]: wt, tabIndex: r, onClick: o, className: St, "aria-label": s.text, lang: s.lang, children: t ? /* @__PURE__ */ i.jsx(Gf, { size: 18 }) : /* @__PURE__ */ i.jsx(Uf, { size: 18 }) });
|
|
2740
|
+
}, fo = (e, t) => ({ text: t.text, lang: t.lang, serial: e === null ? 1 : e.serial + 1 }), mo = ({ hook: e, notice: t }) => /* @__PURE__ */ i.jsx("p", { ...e, role: "status", children: t !== null && /* @__PURE__ */ i.jsx("span", { lang: t.lang, children: t.text }, t.serial) }), Ua = () => {
|
|
2740
2741
|
const e = W(null);
|
|
2741
2742
|
return xe(() => () => e.current?.abort(), []), V(() => {
|
|
2742
2743
|
e.current?.abort();
|
|
@@ -2749,7 +2750,7 @@ const Uf = [
|
|
|
2749
2750
|
() => "copied",
|
|
2750
2751
|
(r) => (console.error("[@aiquants/markdown] could not copy the text", r), "failed")
|
|
2751
2752
|
);
|
|
2752
|
-
},
|
|
2753
|
+
}, Wa = (e, t, n) => {
|
|
2753
2754
|
const r = n.defaultView;
|
|
2754
2755
|
if (r === null)
|
|
2755
2756
|
throw new Error("[@aiquants/markdown] saving a file needs a document with a window");
|
|
@@ -2825,11 +2826,11 @@ const Uf = [
|
|
|
2825
2826
|
}, om = 4096 * 4096, cs = 32767, sm = Object.freeze({ width: 0, height: 0 }), am = /^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[a-zA-Z]*\s*$/u, im = (e, t) => {
|
|
2826
2827
|
const n = new t.DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
|
2827
2828
|
return n.localName === "svg" && [n.getAttribute("width"), n.getAttribute("height")].some((r) => r !== null && am.test(r));
|
|
2828
|
-
}, vr = (e) => Number.isFinite(e.width) && Number.isFinite(e.height) && e.width > 0 && e.height > 0,
|
|
2829
|
+
}, vr = (e) => Number.isFinite(e.width) && Number.isFinite(e.height) && e.width > 0 && e.height > 0, Ga = (e) => {
|
|
2829
2830
|
if (!(Number.isFinite(e) && e > 0))
|
|
2830
2831
|
throw new RangeError(`[@aiquants/markdown] the PNG's scale must be a positive finite number, got ${String(e)}`);
|
|
2831
2832
|
}, lm = (e, t, n) => {
|
|
2832
|
-
|
|
2833
|
+
Ga(n);
|
|
2833
2834
|
const r = vr(e) ? e : vr(t) ? t : null;
|
|
2834
2835
|
if (r === null)
|
|
2835
2836
|
return null;
|
|
@@ -2838,8 +2839,8 @@ const Uf = [
|
|
|
2838
2839
|
return null;
|
|
2839
2840
|
const s = Math.min(1, Math.sqrt(om / o.width / o.height), cs / o.width, cs / o.height);
|
|
2840
2841
|
return { width: Math.max(1, Math.floor(o.width * s)), height: Math.max(1, Math.floor(o.height * s)) };
|
|
2841
|
-
},
|
|
2842
|
-
|
|
2842
|
+
}, Va = async (e, t, n, r) => {
|
|
2843
|
+
Ga(n);
|
|
2843
2844
|
const o = r.URL.createObjectURL(new r.Blob([e], { type: "image/svg+xml;charset=utf-8" }));
|
|
2844
2845
|
try {
|
|
2845
2846
|
const s = new r.Image();
|
|
@@ -2858,13 +2859,13 @@ const Uf = [
|
|
|
2858
2859
|
} finally {
|
|
2859
2860
|
r.URL.revokeObjectURL(o);
|
|
2860
2861
|
}
|
|
2861
|
-
}, po = "image/svg+xml", cm = "image/png", dm = Object.freeze({ width: 0, height: 0 }),
|
|
2862
|
+
}, po = "image/svg+xml", cm = "image/png", dm = Object.freeze({ width: 0, height: 0 }), Ka = (e, t) => {
|
|
2862
2863
|
if (typeof e != "object" || e === null) throw new TypeError(`${t} must be an object, got ${e === null ? "null" : typeof e}`);
|
|
2863
2864
|
if (typeof e.fileName != "function") throw new TypeError(`${t}.fileName must be a function, got ${typeof e.fileName}`);
|
|
2864
2865
|
const { pngScale: n } = e;
|
|
2865
2866
|
if (typeof n != "number" || !Number.isFinite(n) || n <= 0) throw new RangeError(`${t}.pngScale must be a positive finite number, got ${String(n)}`);
|
|
2866
2867
|
}, um = (e, t) => {
|
|
2867
|
-
|
|
2868
|
+
Ka(e, t);
|
|
2868
2869
|
const { index: n } = e;
|
|
2869
2870
|
if (typeof n != "number" || !Number.isSafeInteger(n) || n < 1) throw new RangeError(`${t}.index must be a positive safe integer, got ${String(n)}`);
|
|
2870
2871
|
}, fm = (e) => {
|
|
@@ -2915,12 +2916,12 @@ const mm = (e) => {
|
|
|
2915
2916
|
}, ds = async (e, t, n, r, o) => {
|
|
2916
2917
|
const s = await Vt(() => e({ ...t, theme: "light", form: "export" }));
|
|
2917
2918
|
if ("failure" in s)
|
|
2918
|
-
throw s.failure.kind === "not-exportable" ?
|
|
2919
|
-
const a =
|
|
2919
|
+
throw s.failure.kind === "not-exportable" ? cf.includes(s.failure.reason) ? new Vr(s.failure.reason, s.failure.message) : new Error(`[@aiquants/markdown] the drawing place refused the diagram's export version for a reason the package does not know: ${String(s.failure.reason)}`) : new Error(`[@aiquants/markdown] the drawing place did not draw the diagram's export version: ${mm(s.failure)}`);
|
|
2920
|
+
const a = Ha(s.diagram);
|
|
2920
2921
|
if (a === void 0)
|
|
2921
2922
|
throw new Error("[@aiquants/markdown] the drawing place answered no drawn diagram for the export version");
|
|
2922
2923
|
const l = new o.XMLSerializer().serializeToString(a);
|
|
2923
|
-
return n === "svg" ? new o.Blob([l], { type: po }) :
|
|
2924
|
+
return n === "svg" ? new o.Blob([l], { type: po }) : Va(l, dm, r, o);
|
|
2924
2925
|
}, hm = "both-shift", us = "ctrl";
|
|
2925
2926
|
function Sr(e, t) {
|
|
2926
2927
|
return t === "ctrl" ? e.ctrlKey : e.shiftKey;
|
|
@@ -3033,7 +3034,7 @@ const Am = Object.freeze(["tooLarge", "tooManyEdges", "unlistedType"]), Nm = Obj
|
|
|
3033
3034
|
panDown: { text: "Pan Down", lang: "en" },
|
|
3034
3035
|
panLeft: { text: "Pan Left", lang: "en" },
|
|
3035
3036
|
panRight: { text: "Pan Right", lang: "en" },
|
|
3036
|
-
...
|
|
3037
|
+
...Qs.en,
|
|
3037
3038
|
fullscreenDialog: { text: "Diagram (full screen)", lang: "en" },
|
|
3038
3039
|
diagram: { text: "Diagram (arrow keys pan, + and - zoom, 0 resets)", lang: "en" },
|
|
3039
3040
|
source: { text: "Source", lang: "en" },
|
|
@@ -3096,7 +3097,7 @@ const Am = Object.freeze(["tooLarge", "tooManyEdges", "unlistedType"]), Nm = Obj
|
|
|
3096
3097
|
typeWardley: { text: "Wardley map", lang: "en" },
|
|
3097
3098
|
typeCynefin: { text: "Cynefin diagram", lang: "en" },
|
|
3098
3099
|
typeRailroad: { text: "Railroad diagram", lang: "en" }
|
|
3099
|
-
}),
|
|
3100
|
+
}), Bx = Gt(or), Cm = Object.freeze({
|
|
3100
3101
|
none: "modeNone",
|
|
3101
3102
|
zoom: "modeZoom",
|
|
3102
3103
|
pan: "modePan",
|
|
@@ -3125,10 +3126,10 @@ const Am = Object.freeze(["tooLarge", "tooManyEdges", "unlistedType"]), Nm = Obj
|
|
|
3125
3126
|
throw t = null, n;
|
|
3126
3127
|
}
|
|
3127
3128
|
)), t);
|
|
3128
|
-
}, Im = Lm(() => import("./mermaid.core-C4EClWgB.js").then((e) => e.bp)),
|
|
3129
|
-
const t = window.matchMedia(
|
|
3129
|
+
}, Im = Lm(() => import("./mermaid.core-C4EClWgB.js").then((e) => e.bp)), Ya = "(pointer: coarse)", Dm = (e) => {
|
|
3130
|
+
const t = window.matchMedia(Ya);
|
|
3130
3131
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
3131
|
-
}, Pm = () => window.matchMedia(
|
|
3132
|
+
}, Pm = () => window.matchMedia(Ya).matches, $m = () => !1, zm = () => Mt(Dm, Pm, $m), go = (e, t) => {
|
|
3132
3133
|
const [n, r] = F(null), o = n !== null && e.includes(n) ? n : e[0], s = (c) => c instanceof Element ? c.getAttribute(t) : null;
|
|
3133
3134
|
return { onKeyDown: (c) => {
|
|
3134
3135
|
const d = s(c.target);
|
|
@@ -3256,7 +3257,7 @@ const Am = Object.freeze(["tooLarge", "tooManyEdges", "unlistedType"]), Nm = Obj
|
|
|
3256
3257
|
"data-aqmd-control-menu": c.side,
|
|
3257
3258
|
style: c.maxWidth === null ? { insetInlineStart: c.offset } : { insetInlineStart: c.offset, maxInlineSize: c.maxWidth },
|
|
3258
3259
|
onKeyDown: T,
|
|
3259
|
-
className:
|
|
3260
|
+
className: Kf,
|
|
3260
3261
|
children: s.map((x) => {
|
|
3261
3262
|
const S = () => {
|
|
3262
3263
|
b(!0), x.onSelect();
|
|
@@ -3321,14 +3322,14 @@ const Gm = (e) => {
|
|
|
3321
3322
|
}
|
|
3322
3323
|
}
|
|
3323
3324
|
return "";
|
|
3324
|
-
},
|
|
3325
|
+
}, Xa = ({ chartContent: e, interaction: t, modifier: n, hideInteractionMenu: r = !1, labels: o, labelsLang: s, sourceLines: a, drawing: l, theme: c = "light", exporting: d, held: u }) => {
|
|
3325
3326
|
const f = te(() => ft(or, o, s), [o, s]);
|
|
3326
3327
|
if (l !== void 0 && typeof l.drawer != "function")
|
|
3327
3328
|
throw new TypeError(`MermaidDiagram: drawing.drawer must be a function (what createMermaidDrawer returns), got ${typeof l.drawer}`);
|
|
3328
3329
|
if (d !== void 0 && (um(d, "MermaidDiagram: exporting"), l === void 0))
|
|
3329
3330
|
throw new RangeError("MermaidDiagram: exporting needs drawing (only a diagram the drawing place draws is exported)");
|
|
3330
3331
|
u !== void 0 && th(u);
|
|
3331
|
-
const m = u !== void 0, w = te(() => l?.drawer === void 0 ? null : { drawer: l.drawer, maxChars: l.maxChars, maxEdges: l.maxEdges, theme: c }, [l?.drawer, l?.maxChars, l?.maxEdges, c]), g = tt(), h = tt(), y = tt(), b = tt(), k = tt(), T = W(`mermaid-chart-${Math.random().toString(36).substring(2, 15)}`), x = W(0), S = W(null), R = W(null), D = W(null), j = W(null), [z, P] = F(!0), [B, q] = F(null), [H, ue] = F(null), [ae, ne] = F(null), ie = ae !== null && ae.diagram === H ? ae.texts : em, Re = W(null), [_, $] = F(0), p = W(!1), v = zm(), [E, C] = F(t ?? hm), I = W(fs[E]), le = W(n ?? us), G = W(!1), [ce, Se] = F(!1), [be, ke] = F(!1), [Ee, Ne] = F(null), Ye =
|
|
3332
|
+
const m = u !== void 0, w = te(() => l?.drawer === void 0 ? null : { drawer: l.drawer, maxChars: l.maxChars, maxEdges: l.maxEdges, theme: c }, [l?.drawer, l?.maxChars, l?.maxEdges, c]), g = tt(), h = tt(), y = tt(), b = tt(), k = tt(), T = W(`mermaid-chart-${Math.random().toString(36).substring(2, 15)}`), x = W(0), S = W(null), R = W(null), D = W(null), j = W(null), [z, P] = F(!0), [B, q] = F(null), [H, ue] = F(null), [ae, ne] = F(null), ie = ae !== null && ae.diagram === H ? ae.texts : em, Re = W(null), [_, $] = F(0), p = W(!1), v = zm(), [E, C] = F(t ?? hm), I = W(fs[E]), le = W(n ?? us), G = W(!1), [ce, Se] = F(!1), [be, ke] = F(!1), [Ee, Ne] = F(null), Ye = Ua();
|
|
3332
3333
|
xe(() => {
|
|
3333
3334
|
t && C(t);
|
|
3334
3335
|
}, [t]), xe(() => {
|
|
@@ -3381,7 +3382,7 @@ const Gm = (e) => {
|
|
|
3381
3382
|
Le(Qm(Z.failure));
|
|
3382
3383
|
return;
|
|
3383
3384
|
}
|
|
3384
|
-
const fe =
|
|
3385
|
+
const fe = Ha(Z.diagram);
|
|
3385
3386
|
if (fe === void 0) {
|
|
3386
3387
|
Le({ label: "renderFailed" });
|
|
3387
3388
|
return;
|
|
@@ -3462,7 +3463,7 @@ const Gm = (e) => {
|
|
|
3462
3463
|
const Q = N.querySelector("svg");
|
|
3463
3464
|
J = Q === null ? null : { svg: Q, moved: Q };
|
|
3464
3465
|
} else {
|
|
3465
|
-
const { host: Q, svg: ge } =
|
|
3466
|
+
const { host: Q, svg: ge } = qf(N, H.cleaned);
|
|
3466
3467
|
J = { svg: ge, moved: Q };
|
|
3467
3468
|
}
|
|
3468
3469
|
let Y = !1, Ae;
|
|
@@ -3488,7 +3489,7 @@ const Gm = (e) => {
|
|
|
3488
3489
|
return;
|
|
3489
3490
|
}
|
|
3490
3491
|
D.current && ws(D.current);
|
|
3491
|
-
const je =
|
|
3492
|
+
const je = Sa(ge, {
|
|
3492
3493
|
startScale: 1,
|
|
3493
3494
|
startX: 0,
|
|
3494
3495
|
startY: 0,
|
|
@@ -3739,7 +3740,7 @@ const Gm = (e) => {
|
|
|
3739
3740
|
}
|
|
3740
3741
|
const Q = ve;
|
|
3741
3742
|
ds(N.drawer, N.shown, K, N.exporting.pngScale, Ae).then((ge) => {
|
|
3742
|
-
J.aborted || (
|
|
3743
|
+
J.aborted || (Wa(ge, Q, Y), _e({ text: Ke(f.saveStarted.text, { name: Q }), lang: f.saveStarted.lang }));
|
|
3743
3744
|
}).catch((ge) => {
|
|
3744
3745
|
if (!J.aborted) {
|
|
3745
3746
|
if (ge instanceof Vr) {
|
|
@@ -3793,10 +3794,10 @@ const Gm = (e) => {
|
|
|
3793
3794
|
st = /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
3794
3795
|
/* @__PURE__ */ i.jsxs("div", { "data-aqmd-mermaid-toolbar": "", role: "toolbar", "aria-labelledby": ot(g), onKeyDown: rt, onFocus: Tt, className: "mb-1 flex flex-wrap items-start justify-end gap-1", children: [
|
|
3795
3796
|
!Ge && /* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap justify-end gap-1", children: [
|
|
3796
|
-
Te("pan-left", "panLeft", () => Fe({ x: 1, y: 0 }), /* @__PURE__ */ i.jsx(
|
|
3797
|
-
Te("pan-up", "panUp", () => Fe({ x: 0, y: 1 }), /* @__PURE__ */ i.jsx(
|
|
3798
|
-
Te("pan-down", "panDown", () => Fe({ x: 0, y: -1 }), /* @__PURE__ */ i.jsx(
|
|
3799
|
-
Te("pan-right", "panRight", () => Fe({ x: -1, y: 0 }), /* @__PURE__ */ i.jsx(
|
|
3797
|
+
Te("pan-left", "panLeft", () => Fe({ x: 1, y: 0 }), /* @__PURE__ */ i.jsx(Cd, { size: 18 }), !ce),
|
|
3798
|
+
Te("pan-up", "panUp", () => Fe({ x: 0, y: 1 }), /* @__PURE__ */ i.jsx(Dd, { size: 18 }), !ce),
|
|
3799
|
+
Te("pan-down", "panDown", () => Fe({ x: 0, y: -1 }), /* @__PURE__ */ i.jsx(Nd, { size: 18 }), !ce),
|
|
3800
|
+
Te("pan-right", "panRight", () => Fe({ x: -1, y: 0 }), /* @__PURE__ */ i.jsx(Ld, { size: 18 }), !ce)
|
|
3800
3801
|
] }),
|
|
3801
3802
|
!Ge && /* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap justify-end gap-1", children: [
|
|
3802
3803
|
!r && /* @__PURE__ */ i.jsx(
|
|
@@ -3805,13 +3806,13 @@ const Gm = (e) => {
|
|
|
3805
3806
|
buttonHook: { [At]: "mode" },
|
|
3806
3807
|
menuHook: { "data-aqmd-mermaid-menu": "" },
|
|
3807
3808
|
label: N,
|
|
3808
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3809
|
+
icon: /* @__PURE__ */ i.jsx(qd, { size: 18 }),
|
|
3809
3810
|
tabIndex: ct("mode"),
|
|
3810
3811
|
items: K.map(({ value: Y, label: Ae, checked: ve }) => ({ key: Y, label: Ae, checked: ve, onSelect: () => C(Y) }))
|
|
3811
3812
|
}
|
|
3812
3813
|
),
|
|
3813
|
-
Te("zoom-in", "zoomIn", () => j.current?.zoomBy(1), /* @__PURE__ */ i.jsx(
|
|
3814
|
-
Te("zoom-out", "zoomOut", () => j.current?.zoomBy(-1), /* @__PURE__ */ i.jsx(
|
|
3814
|
+
Te("zoom-in", "zoomIn", () => j.current?.zoomBy(1), /* @__PURE__ */ i.jsx(Oa, { size: 20 })),
|
|
3815
|
+
Te("zoom-out", "zoomOut", () => j.current?.zoomBy(-1), /* @__PURE__ */ i.jsx(_a, { size: 20 })),
|
|
3815
3816
|
Te("reset", "resetView", () => j.current?.reset(), /* @__PURE__ */ i.jsx(Fr, { size: 18 }))
|
|
3816
3817
|
] }),
|
|
3817
3818
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap justify-end gap-1", children: [
|
|
@@ -3821,7 +3822,7 @@ const Gm = (e) => {
|
|
|
3821
3822
|
buttonHook: { [At]: "export" },
|
|
3822
3823
|
menuHook: { "data-aqmd-mermaid-export-menu": "" },
|
|
3823
3824
|
label: f.exportMenu,
|
|
3824
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3825
|
+
icon: /* @__PURE__ */ i.jsx(Ta, { size: 18 }),
|
|
3825
3826
|
tabIndex: ct("export"),
|
|
3826
3827
|
items: [
|
|
3827
3828
|
{ key: "save-svg", label: f.saveSvg, onSelect: () => It($e, "svg"), hook: { [_r]: "save-svg" } },
|
|
@@ -3833,7 +3834,7 @@ const Gm = (e) => {
|
|
|
3833
3834
|
),
|
|
3834
3835
|
$e !== null && Te("copy-diagram", "copyDiagram", () => Lt($e, "png"), /* @__PURE__ */ i.jsx(hn, { size: 18 })),
|
|
3835
3836
|
Ge && Te("copy-source", "copySource", gt, /* @__PURE__ */ i.jsx(hn, { size: 18 })),
|
|
3836
|
-
/* @__PURE__ */ i.jsx("button", { type: "button", [At]: "source", tabIndex: ct("source"), "aria-pressed": be, onClick: dt, className: St, "aria-label": f.source.text, lang: f.source.lang, children: /* @__PURE__ */ i.jsx(
|
|
3837
|
+
/* @__PURE__ */ i.jsx("button", { type: "button", [At]: "source", tabIndex: ct("source"), "aria-pressed": be, onClick: dt, className: St, "aria-label": f.source.text, lang: f.source.lang, children: /* @__PURE__ */ i.jsx(ka, { size: 20 }) })
|
|
3837
3838
|
] }),
|
|
3838
3839
|
/* @__PURE__ */ i.jsx(uo, { hook: At, fullscreen: Ve, labels: f, tabIndex: ct(wt), onToggle: pt })
|
|
3839
3840
|
] }),
|
|
@@ -3851,7 +3852,7 @@ const Gm = (e) => {
|
|
|
3851
3852
|
"aria-describedby": ie.description === null ? void 0 : b,
|
|
3852
3853
|
onKeyDown: Pe,
|
|
3853
3854
|
className: J === null ? "mermaid mermaid-diagram-container bg-white dark:bg-gray-400" : "mermaid mermaid-diagram-container",
|
|
3854
|
-
style: J === null ? void 0 : { backgroundColor:
|
|
3855
|
+
style: J === null ? void 0 : { backgroundColor: Ra[J].ground }
|
|
3855
3856
|
}
|
|
3856
3857
|
),
|
|
3857
3858
|
Ge && // biome-ignore lint/a11y/useSemanticElements: 書いたままの文字の空白と改行を保つのは pre で、section では保てない。名前を持つ領域にするため role を付ける
|
|
@@ -3880,15 +3881,15 @@ const Gm = (e) => {
|
|
|
3880
3881
|
] })
|
|
3881
3882
|
] });
|
|
3882
3883
|
};
|
|
3883
|
-
|
|
3884
|
-
const
|
|
3884
|
+
Xa.displayName = "MermaidDiagramInternal";
|
|
3885
|
+
const Za = Wt(Xa), oh = "unicodeTextInMathMode", sh = "noCharacterMetrics", ah = "var(--aqmd-math-error, #cc0000)", ih = /^No character metrics for '.+' in style '.+' and mode '.+'$/su, lh = "consoleCommand", ch = (e) => {
|
|
3885
3886
|
const t = (n, r) => (o) => (r(o), e(lh, `${n} is ignored: a formula does not write to the console`), "");
|
|
3886
3887
|
return {
|
|
3887
3888
|
"\\message": t("\\message", (n) => n.consumeArgs(1)),
|
|
3888
3889
|
"\\errmessage": t("\\errmessage", (n) => n.consumeArgs(1)),
|
|
3889
3890
|
"\\show": t("\\show", (n) => n.popToken())
|
|
3890
3891
|
};
|
|
3891
|
-
},
|
|
3892
|
+
}, Ja = (e, t) => {
|
|
3892
3893
|
const n = `${t ? "display" : "inline"}:${e}`, r = Nt.get(n);
|
|
3893
3894
|
if (r !== void 0)
|
|
3894
3895
|
return Nt.delete(n), Nt.set(n, r), r;
|
|
@@ -3907,7 +3908,7 @@ const Xa = Wt(Ya), oh = "unicodeTextInMathMode", sh = "noCharacterMetrics", ah =
|
|
|
3907
3908
|
o.apply(console, s);
|
|
3908
3909
|
};
|
|
3909
3910
|
try {
|
|
3910
|
-
const s =
|
|
3911
|
+
const s = El.renderToString(e, {
|
|
3911
3912
|
displayMode: t,
|
|
3912
3913
|
throwOnError: !1,
|
|
3913
3914
|
errorColor: ah,
|
|
@@ -3931,7 +3932,7 @@ const hh = [
|
|
|
3931
3932
|
["line", { x1: "12", x2: "18", y1: "18", y2: "12", key: "ebkxgr" }],
|
|
3932
3933
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
3933
3934
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
3934
|
-
], ph = se("copy-x", hh), gh = 2e3,
|
|
3935
|
+
], ph = se("copy-x", hh), gh = 2e3, Qa = Wt(function({ text: t, labels: n }) {
|
|
3935
3936
|
const [r, o] = F(null), s = W(0);
|
|
3936
3937
|
xe(() => {
|
|
3937
3938
|
if (r === null)
|
|
@@ -3962,7 +3963,7 @@ const hh = [
|
|
|
3962
3963
|
),
|
|
3963
3964
|
/* @__PURE__ */ i.jsx("span", { "data-aqmd-copy-notice": "", role: "status", className: "sr-only", children: r !== null && /* @__PURE__ */ i.jsx("span", { lang: n[r.notice].lang, children: n[r.notice].text }, r.press) })
|
|
3964
3965
|
] });
|
|
3965
|
-
}),
|
|
3966
|
+
}), ei = (e) => {
|
|
3966
3967
|
const t = e.ownerDocument.getSelection();
|
|
3967
3968
|
if (t === null)
|
|
3968
3969
|
return null;
|
|
@@ -3979,7 +3980,7 @@ class xh extends Yn {
|
|
|
3979
3980
|
*/
|
|
3980
3981
|
getSnapshotBeforeUpdate() {
|
|
3981
3982
|
const t = this.props.root.current;
|
|
3982
|
-
return t === null ? null :
|
|
3983
|
+
return t === null ? null : ei(t);
|
|
3983
3984
|
}
|
|
3984
3985
|
/**
|
|
3985
3986
|
* Puts back the points the commit moved inside their texts, while both points are in the nodes they were in.
|
|
@@ -4048,7 +4049,7 @@ class bh extends Yn {
|
|
|
4048
4049
|
const t = this.props.root.current;
|
|
4049
4050
|
if (t === null)
|
|
4050
4051
|
return null;
|
|
4051
|
-
const n =
|
|
4052
|
+
const n = ei(t);
|
|
4052
4053
|
if (n === null)
|
|
4053
4054
|
return null;
|
|
4054
4055
|
const { selection: r, anchorNode: o, anchorOffset: s, focusNode: a, focusOffset: l } = n;
|
|
@@ -4149,20 +4150,20 @@ const Ih = [
|
|
|
4149
4150
|
["path", { d: "M22 12h-2", key: "14jgyd" }],
|
|
4150
4151
|
["path", { d: "m15 19-3 3-3-3", key: "11eu04" }],
|
|
4151
4152
|
["path", { d: "m15 5-3-3-3 3", key: "itvq4r" }]
|
|
4152
|
-
], Dh = se("unfold-vertical", Ih),
|
|
4153
|
+
], Dh = se("unfold-vertical", Ih), ti = 24, Ph = 1, $h = 1, Rr = 24, ni = (e) => {
|
|
4153
4154
|
if (e === void 0)
|
|
4154
4155
|
return Rr;
|
|
4155
4156
|
if (!Number.isInteger(e) || e < Rr)
|
|
4156
4157
|
throw new RangeError(`[@aiquants/markdown] the size of a document table's tap-scroll circle must be a whole number of at least ${Rr} CSS px (WCAG 2.5.8); got ${String(e)}`);
|
|
4157
4158
|
return e;
|
|
4158
4159
|
}, zh = Object.freeze({}), Ar = (e) => {
|
|
4159
|
-
const { rows: t, cols: n } =
|
|
4160
|
+
const { rows: t, cols: n } = xl(e);
|
|
4160
4161
|
return t * n;
|
|
4161
4162
|
}, Fh = 26, Bh = (e, t, n, r) => {
|
|
4162
4163
|
const o = e.length > t ? Math.min(r, t - Math.min(n, t)) : 0, s = e.slice(0, t - o).map((l, c) => ({ index: c, cells: l })), a = e.slice(e.length - o).map((l, c) => ({ index: e.length - o + c, cells: l }));
|
|
4163
4164
|
return [...s, ...a];
|
|
4164
|
-
}, qh = (e, t) => Math.max(1, Math.min(e.visibleRows, t)), Hh = 3, Uh = (e) => Math.max(1, Math.min(Hh, e)), Nr = (e, t, n) => ((n ?
|
|
4165
|
-
const t =
|
|
4165
|
+
}, qh = (e, t) => Math.max(1, Math.min(e.visibleRows, t)), Hh = 3, Uh = (e) => Math.max(1, Math.min(Hh, e)), Nr = (e, t, n) => ((n ? ml : 0) + e * ti + hl) * t, Wh = 1, vs = (e) => Math.ceil(e) + Wh, Gh = (e, t) => e >= t, Kn = (e) => Math.round(e * 100), Ss = (e) => {
|
|
4166
|
+
const t = fl.find((n) => Kn(n) === e);
|
|
4166
4167
|
if (t === void 0)
|
|
4167
4168
|
throw new RangeError(`[@aiquants/markdown] no spreadsheet zoom step shows as ${String(e)} %`);
|
|
4168
4169
|
return t;
|
|
@@ -4187,7 +4188,7 @@ const Ih = [
|
|
|
4187
4188
|
for (; r > 1 && o(r - 1); )
|
|
4188
4189
|
r -= 1;
|
|
4189
4190
|
return t === 0 || r === 0 ? [[""]] : t === e.length && r === n ? e : e.slice(0, t).map((s) => r === n ? s : s.slice(0, r));
|
|
4190
|
-
}, In = (e) => yo(
|
|
4191
|
+
}, In = (e) => yo(wl(e)), Kh = ["format", "hyperlink", "note", "comments", "validation"], Yh = (e, t) => {
|
|
4191
4192
|
const n = /* @__PURE__ */ new Map();
|
|
4192
4193
|
let r = !1, o = !1;
|
|
4193
4194
|
for (const s of t) {
|
|
@@ -4218,7 +4219,7 @@ const Ih = [
|
|
|
4218
4219
|
for (; r > 0 && n[r - 1] === ""; ) r -= 1;
|
|
4219
4220
|
return r === n.length ? n : n.slice(0, r);
|
|
4220
4221
|
});
|
|
4221
|
-
return
|
|
4222
|
+
return ra(t).replaceAll(`\r
|
|
4222
4223
|
`, `
|
|
4223
4224
|
`);
|
|
4224
4225
|
}, Zh = (e, t) => {
|
|
@@ -4264,15 +4265,15 @@ const Ih = [
|
|
|
4264
4265
|
/* @__PURE__ */ i.jsxs("div", { "data-aqmd-spreadsheet-toolbar": "", role: "toolbar", "aria-labelledby": t, onKeyDown: k, onFocus: T, className: "mb-1 flex flex-wrap items-center justify-end gap-1", children: [
|
|
4265
4266
|
/* @__PURE__ */ i.jsx("span", { "data-aqmd-spreadsheet-size": "", lang: e.size.lang, className: "me-auto text-sm", children: Ke(e.size.text, { rows: n, cols: r }) }),
|
|
4266
4267
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap justify-end gap-1", children: [
|
|
4267
|
-
P("zoom-in", e.zoomIn, () => l(1), /* @__PURE__ */ i.jsx(
|
|
4268
|
-
P("zoom-out", e.zoomOut, () => l(-1), /* @__PURE__ */ i.jsx(
|
|
4268
|
+
P("zoom-in", e.zoomIn, () => l(1), /* @__PURE__ */ i.jsx(Oa, { size: 20 }), h && o),
|
|
4269
|
+
P("zoom-out", e.zoomOut, () => l(-1), /* @__PURE__ */ i.jsx(_a, { size: 20 }), h && s),
|
|
4269
4270
|
P(
|
|
4270
4271
|
"reset-zoom",
|
|
4271
4272
|
q,
|
|
4272
4273
|
c,
|
|
4273
4274
|
/* @__PURE__ */ i.jsxs("span", { "data-aqmd-spreadsheet-zoom": "", children: [
|
|
4274
4275
|
/* @__PURE__ */ i.jsxs("span", { "data-aqmd-spreadsheet-zoom-widest": "", "aria-hidden": "true", children: [
|
|
4275
|
-
Kn(
|
|
4276
|
+
Kn(na),
|
|
4276
4277
|
" %"
|
|
4277
4278
|
] }),
|
|
4278
4279
|
/* @__PURE__ */ i.jsxs("span", { children: [
|
|
@@ -4282,7 +4283,7 @@ const Ih = [
|
|
|
4282
4283
|
] }),
|
|
4283
4284
|
h && a !== 1,
|
|
4284
4285
|
void 0,
|
|
4285
|
-
|
|
4286
|
+
Vf
|
|
4286
4287
|
)
|
|
4287
4288
|
] }),
|
|
4288
4289
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap justify-end gap-1", children: [
|
|
@@ -4307,7 +4308,7 @@ const Ih = [
|
|
|
4307
4308
|
] }),
|
|
4308
4309
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap justify-end gap-1", children: [
|
|
4309
4310
|
P("copy", e.copyAll, f, /* @__PURE__ */ i.jsx(hn, { size: 18 }), h),
|
|
4310
|
-
P("save", e.saveTsv, () => m(!1), /* @__PURE__ */ i.jsx(
|
|
4311
|
+
P("save", e.saveTsv, () => m(!1), /* @__PURE__ */ i.jsx(Ta, { size: 18 }), !0),
|
|
4311
4312
|
/* @__PURE__ */ i.jsx(
|
|
4312
4313
|
Kr,
|
|
4313
4314
|
{
|
|
@@ -4370,7 +4371,7 @@ const Ih = [
|
|
|
4370
4371
|
"text/html": new Blob([e.html], { type: "text/html" })
|
|
4371
4372
|
})
|
|
4372
4373
|
]);
|
|
4373
|
-
}, dp = "\uFEFF", up = "text/tab-separated-values;charset=utf-8", fp = (e, t) => `${t ? dp : ""}${
|
|
4374
|
+
}, dp = "\uFEFF", up = "text/tab-separated-values;charset=utf-8", fp = (e, t) => `${t ? dp : ""}${ra(e)}`, mp = (e, t) => new Blob([fp(e, t)], { type: up }), ri = (e) => {
|
|
4374
4375
|
const t = W(e);
|
|
4375
4376
|
Ze(() => {
|
|
4376
4377
|
t.current = e;
|
|
@@ -4431,17 +4432,17 @@ class $t extends Error {
|
|
|
4431
4432
|
}
|
|
4432
4433
|
const Ts = (e) => {
|
|
4433
4434
|
console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet", e);
|
|
4434
|
-
}, Os = Object.freeze({ row: !0, column: !0, intersection: !1 }), _s = Object.freeze({ row: !1, column: !1, intersection: !1 }), Rs = Object.freeze([Object.freeze([""])]), pp = Object.freeze({ link: !1 }), gp = Object.freeze({ enabled: !1 }),
|
|
4435
|
+
}, Os = Object.freeze({ row: !0, column: !0, intersection: !1 }), _s = Object.freeze({ row: !1, column: !1, intersection: !1 }), Rs = Object.freeze([Object.freeze([""])]), pp = Object.freeze({ link: !1 }), gp = Object.freeze({ enabled: !1 }), oi = (e) => e.trim().replace(/\s+/g, " ").toLowerCase(), yp = (e) => {
|
|
4435
4436
|
const t = [];
|
|
4436
4437
|
let n = "", r = null;
|
|
4437
4438
|
for (let o = 0; o < e.length; o++) {
|
|
4438
4439
|
const s = e[o];
|
|
4439
4440
|
s === "\\" && o + 1 < e.length ? (o++, n += e[o]) : r !== null ? s === r ? r = null : n += s : s === '"' || s === "'" ? r = s : s === "," ? (t.push(n), n = "") : n += s;
|
|
4440
4441
|
}
|
|
4441
|
-
return t.push(n), new Set(t.map(
|
|
4442
|
+
return t.push(n), new Set(t.map(oi));
|
|
4442
4443
|
}, xp = (e) => {
|
|
4443
4444
|
const t = e.trim(), n = t.length >= 2 && (t[0] === '"' || t[0] === "'") && t[t.length - 1] === t[0];
|
|
4444
|
-
return
|
|
4445
|
+
return oi((n ? t.slice(1, -1) : t).replace(/\\(.)/g, "$1"));
|
|
4445
4446
|
}, wp = (e, t) => {
|
|
4446
4447
|
const n = yp(t);
|
|
4447
4448
|
return e.fontfaces.some((r) => n.has(xp(r.family)));
|
|
@@ -4490,20 +4491,20 @@ const Ts = (e) => {
|
|
|
4490
4491
|
);
|
|
4491
4492
|
}, vp = (e) => {
|
|
4492
4493
|
try {
|
|
4493
|
-
return { options:
|
|
4494
|
+
return { options: rl(e), unreadWord: null };
|
|
4494
4495
|
} catch (t) {
|
|
4495
|
-
if (t instanceof
|
|
4496
|
+
if (t instanceof ol)
|
|
4496
4497
|
return { options: null, unreadWord: t.word };
|
|
4497
4498
|
throw t;
|
|
4498
4499
|
}
|
|
4499
|
-
},
|
|
4500
|
+
}, si = ({ tsv: e, meta: t, sourceLines: n, editor: r, locale: o = "en", labels: s, labelsLang: a, layout: l = "inline", tapScrollCircle: c, tapScrollCircleShownBy: d = "host", scrollBarControls: u }) => {
|
|
4500
4501
|
if (!Object.hasOwn(Pr, o))
|
|
4501
4502
|
throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(o)}" (en and ja are supported)`);
|
|
4502
4503
|
if (l !== "inline" && l !== "fill")
|
|
4503
4504
|
throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(l)}" (inline and fill are supported)`);
|
|
4504
4505
|
if (d !== "host" && d !== "options")
|
|
4505
4506
|
throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet tap-scroll circle chooser "${String(d)}" (host and options are supported)`);
|
|
4506
|
-
const f = te(() => ft(Pr[o], s, a), [o, s, a]), { options: m, unreadWord: w } = te(() => vp(t), [t]), g = te(() => Ar(e), [e]), h = g > Tn, y = te(() =>
|
|
4507
|
+
const f = te(() => ft(Pr[o], s, a), [o, s, a]), { options: m, unreadWord: w } = te(() => vp(t), [t]), g = te(() => Ar(e), [e]), h = g > Tn, y = te(() => ta(n)?.first ?? null, [n]), [b, k] = F(null), T = `${n ?? ""}
|
|
4507
4508
|
${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !== void 0, D = R && m !== null && m.footerRows === 0 ? Ph : 0, j = R ? $h : 0, [z, P] = F(() => h ? Rs : In(e)), [B, q] = F(0), H = W(e), ue = W([]), ae = te(() => Vh(z, D, j), [z, D, j]), ne = W(ae);
|
|
4508
4509
|
ne.current = ae;
|
|
4509
4510
|
const ie = Mt(
|
|
@@ -4623,7 +4624,7 @@ ${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !==
|
|
|
4623
4624
|
}, [C]), xe(() => {
|
|
4624
4625
|
st.current !== ot && (st.current = ot, ze("zoomed", { percent: ot }));
|
|
4625
4626
|
}, [ze, ot]);
|
|
4626
|
-
const N = V((O) => E((M) =>
|
|
4627
|
+
const N = V((O) => E((M) => pl(gl(M, O))), []), K = V(() => E(1), []), J = G.row || G.column, Y = V(() => ce((O) => O.row || O.column ? _s : Os), []), Ae = V(() => {
|
|
4627
4628
|
if (ie === null)
|
|
4628
4629
|
return;
|
|
4629
4630
|
const O = Pe.current?.ownerDocument.defaultView;
|
|
@@ -4641,13 +4642,13 @@ ${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !==
|
|
|
4641
4642
|
}, [ze, z, ie]), ve = V(
|
|
4642
4643
|
(O) => {
|
|
4643
4644
|
const M = Pe.current?.ownerDocument;
|
|
4644
|
-
M !== void 0 &&
|
|
4645
|
+
M !== void 0 && Wa(mp(z, O), f.fileName.text, M);
|
|
4645
4646
|
},
|
|
4646
4647
|
[z, f]
|
|
4647
4648
|
), Q = z.length, ge = z[0].length, Ue = m === null ? 0 : m.frame, Ot = te(() => Ue === 0 ? void 0 : { startRow: 0, startCol: 0, endRow: Q - 1, endCol: ge - 1 }, [Ue, Q, ge]), ut = m === null ? 0 : m.tapscroll, Le = te(() => {
|
|
4648
4649
|
if (d === "host")
|
|
4649
4650
|
return c;
|
|
4650
|
-
const O =
|
|
4651
|
+
const O = ni(c?.size);
|
|
4651
4652
|
return ut === 1 ? { ...c, enabled: !0, size: O } : gp;
|
|
4652
4653
|
}, [c, d, ut]), je = m === null ? 0 : qh(m, ae.length), Ce = ae.length, We = m !== null && l === "inline" && Gh(m.visibleRows, Ce), [Oe, Je] = F(null), bt = te(() => {
|
|
4653
4654
|
if (m === null)
|
|
@@ -4676,7 +4677,7 @@ ${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !==
|
|
|
4676
4677
|
word: w,
|
|
4677
4678
|
frozenMax: cr.header.max,
|
|
4678
4679
|
heightMax: cr.height.max,
|
|
4679
|
-
zoomSteps:
|
|
4680
|
+
zoomSteps: nl.join(", "),
|
|
4680
4681
|
frameMax: cr.frame.max
|
|
4681
4682
|
}) }) : h ? /* @__PURE__ */ i.jsx("div", { "data-aqmd-spreadsheet-error": "size", role: "alert", lang: f.tooLarge.lang, children: Ke(f.tooLarge.text, { cells: new Intl.NumberFormat(o).format(g), max: new Intl.NumberFormat(o).format(Tn) }) }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4682
4683
|
m.toolbar === 1 && /* @__PURE__ */ i.jsx(
|
|
@@ -4686,8 +4687,8 @@ ${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !==
|
|
|
4686
4687
|
labelledBy: $e,
|
|
4687
4688
|
rows: Q,
|
|
4688
4689
|
cols: ge,
|
|
4689
|
-
canZoomIn: v <
|
|
4690
|
-
canZoomOut: v >
|
|
4690
|
+
canZoomIn: v < na,
|
|
4691
|
+
canZoomOut: v > yl,
|
|
4691
4692
|
zoom: v,
|
|
4692
4693
|
onZoom: N,
|
|
4693
4694
|
onResetZoom: K,
|
|
@@ -4708,7 +4709,7 @@ ${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !==
|
|
|
4708
4709
|
ref: _e,
|
|
4709
4710
|
adapter: pt,
|
|
4710
4711
|
dataVersion: B,
|
|
4711
|
-
defaultRowHeight:
|
|
4712
|
+
defaultRowHeight: ti,
|
|
4712
4713
|
frozenRows: m.headerRows,
|
|
4713
4714
|
headerRows: m.headerRows,
|
|
4714
4715
|
frozenTrailingRows: m.footerRows,
|
|
@@ -4762,8 +4763,8 @@ ${e}`, x = b === T, S = r !== void 0 && y !== null && !x ? r : void 0, R = S !==
|
|
|
4762
4763
|
] })
|
|
4763
4764
|
] });
|
|
4764
4765
|
};
|
|
4765
|
-
|
|
4766
|
-
const
|
|
4766
|
+
si.displayName = "SpreadsheetBlock";
|
|
4767
|
+
const ai = Wt(si), Sp = Object.freeze({ light: "solarized-light", dark: "github-dark-high-contrast" }), kp = Object.freeze({
|
|
4767
4768
|
"solarized-light": Object.freeze({
|
|
4768
4769
|
"#657b83": "#435860",
|
|
4769
4770
|
"#93a1a1": "#4b5757",
|
|
@@ -4809,32 +4810,32 @@ function Tp(e) {
|
|
|
4809
4810
|
}
|
|
4810
4811
|
return t;
|
|
4811
4812
|
}
|
|
4812
|
-
const Op = { margin: "1rem 0" },
|
|
4813
|
+
const Op = { margin: "1rem 0" }, ii = { margin: "0", padding: "0.8rem 0" }, _p = ({ filename: e, code: t, labels: n }) => (
|
|
4813
4814
|
// pre の上に重ねたボタンは長い 1 行目の行末を覆うため、帯に置き、帯の高さの下限をボタンと同じ 44 px にする。ファイル名が無く
|
|
4814
4815
|
// ボタンが唯一の項目でも行の終わりに立つよう、行は終わりへ詰め、ファイル名を自身の余白で始まりへ寄せる
|
|
4815
4816
|
/* @__PURE__ */ i.jsxs("div", { "data-aqmd-code-header": "", className: "flex min-h-11 items-end justify-end gap-2", children: [
|
|
4816
4817
|
e && // 区切りの無い長いファイル名も帯の中で折り返し、ボタンを押し出さない
|
|
4817
4818
|
/* @__PURE__ */ i.jsx("div", { "data-aqmd-code-filename": "", className: "wrap-anywhere me-auto min-w-0 rounded-md px-2 py-0.5 text-sm", children: e }),
|
|
4818
|
-
/* @__PURE__ */ i.jsx(
|
|
4819
|
+
/* @__PURE__ */ i.jsx(Qa, { text: t, labels: n })
|
|
4819
4820
|
] })
|
|
4820
|
-
),
|
|
4821
|
+
), li = (e, t) => (
|
|
4821
4822
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: 横に送る pre はキーボードの利用者が送れるよう焦点を受けなければならない (WCAG 2.1.1。Shiki の pre と同じ)
|
|
4822
|
-
/* @__PURE__ */ i.jsx("pre", { ref: t, style:
|
|
4823
|
-
), Rp = ({ code: e }) =>
|
|
4823
|
+
/* @__PURE__ */ i.jsx("pre", { ref: t, style: ii, tabIndex: 0, "data-aqmd-code-pending": "", children: /* @__PURE__ */ i.jsx("code", { children: e }) })
|
|
4824
|
+
), Rp = ({ code: e }) => li(e), ci = (e, t) => {
|
|
4824
4825
|
const n = {
|
|
4825
4826
|
replace: (r) => {
|
|
4826
4827
|
if (r instanceof nt && r.name === "pre") {
|
|
4827
4828
|
const o = Tp(r.attribs);
|
|
4828
|
-
return o.style = { ...typeof o.style == "object" ? o.style : {}, ...
|
|
4829
|
+
return o.style = { ...typeof o.style == "object" ? o.style : {}, ...ii }, /* @__PURE__ */ i.jsx("pre", { ...o, ref: t, children: kt(r.children, n) });
|
|
4829
4830
|
}
|
|
4830
4831
|
},
|
|
4831
4832
|
htmlparser2: { lowerCaseTags: !0 }
|
|
4832
4833
|
};
|
|
4833
|
-
return
|
|
4834
|
-
}, Ap = ({ htmlPromise: e }) => /* @__PURE__ */ i.jsx(i.Fragment, { children:
|
|
4834
|
+
return el(e, n);
|
|
4835
|
+
}, Ap = ({ htmlPromise: e }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: ci(ji(e)) }), Np = Object.freeze({ __html: "" }), jp = () => /* @__PURE__ */ i.jsx("pre", { suppressHydrationWarning: !0, dangerouslySetInnerHTML: Np }), Cp = () => () => {
|
|
4835
4836
|
}, Mp = () => !1, Lp = () => !0, Ip = () => Mt(Cp, Mp, Lp) && typeof document < "u", Dp = /^(diff)?:?(\w+):?([\w.-]*)?/, Pp = /* @__PURE__ */ new Map([["svg", "xml"]]), $p = "text", zp = (e) => {
|
|
4836
4837
|
const t = Pp.get(e), n = t === void 0 ? e : t;
|
|
4837
|
-
return
|
|
4838
|
+
return cl(n) || Object.hasOwn(dl, n) ? n : $p;
|
|
4838
4839
|
}, Fp = () => ({
|
|
4839
4840
|
code(e) {
|
|
4840
4841
|
for (const t of e.children) {
|
|
@@ -4863,7 +4864,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4863
4864
|
}
|
|
4864
4865
|
}
|
|
4865
4866
|
}
|
|
4866
|
-
}), Bp = (e, t, n) =>
|
|
4867
|
+
}), Bp = (e, t, n) => ll(e, {
|
|
4867
4868
|
lang: zp(t),
|
|
4868
4869
|
themes: Sp,
|
|
4869
4870
|
// 色は表示スタイルシートが --shiki-light / --shiki-dark から選ぶ (配色ごとに地の色が違い、インラインの色では選べない)
|
|
@@ -4885,7 +4886,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4885
4886
|
const t = Ip(), [n] = F(() => t ? e : null);
|
|
4886
4887
|
return n === e ? /* @__PURE__ */ i.jsx(jp, {}) : /* @__PURE__ */ i.jsx(Ap, { htmlPromise: e.html() });
|
|
4887
4888
|
}, Up = (e) => e + 1, Wp = ({ code: e, highlight: t }) => {
|
|
4888
|
-
const n = W(null), [, r] =
|
|
4889
|
+
const n = W(null), [, r] = Ni(Up, 0);
|
|
4889
4890
|
xe(() => {
|
|
4890
4891
|
t !== null && t.outcome() === null && t.html().then(r, r);
|
|
4891
4892
|
}, [t]);
|
|
@@ -4893,7 +4894,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4893
4894
|
if (o !== null && "error" in o)
|
|
4894
4895
|
throw o.error;
|
|
4895
4896
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4896
|
-
o === null ?
|
|
4897
|
+
o === null ? li(e, n) : ci(o.html, n),
|
|
4897
4898
|
/* @__PURE__ */ i.jsx(bh, { root: n })
|
|
4898
4899
|
] });
|
|
4899
4900
|
}, Gp = (e) => {
|
|
@@ -4903,9 +4904,9 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4903
4904
|
lang: t?.[2] || "text",
|
|
4904
4905
|
filename: t?.[3] || void 0
|
|
4905
4906
|
};
|
|
4906
|
-
},
|
|
4907
|
+
}, di = ({ lang: e, code: t, node: n, sourceLines: r, labels: o, labelsLang: s, deferHighlight: a = !1 }) => {
|
|
4907
4908
|
const l = e ?? n?.lang ?? void 0, c = t ?? n?.value ?? "", { isDiff: d, lang: u, filename: f } = Gp(l);
|
|
4908
|
-
return u ===
|
|
4909
|
+
return u === ea ? /* @__PURE__ */ i.jsx(ai, { tsv: c, meta: n?.meta ?? void 0, sourceLines: r, labelsLang: s, tapScrollCircleShownBy: "options" }) : u === "mermaid" ? /* @__PURE__ */ i.jsx(Za, { chartContent: c, sourceLines: r, labelsLang: s }) : /* @__PURE__ */ i.jsx(Vp, { code: c, lang: u, isDiff: d, filename: f, sourceLines: r, labels: o, labelsLang: s, deferHighlight: a });
|
|
4909
4910
|
}, Vp = Wt(function({
|
|
4910
4911
|
code: t,
|
|
4911
4912
|
lang: n,
|
|
@@ -4919,7 +4920,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4919
4920
|
const d = te(() => qp(t, n, r), [t, n, r]), u = te(() => ft(Jn, a, l), [a, l]), [f, m] = F(c);
|
|
4920
4921
|
return c && !f && m(!0), /* @__PURE__ */ i.jsxs("div", { style: Op, "data-aqmd-code-block": "", "data-source-lines": s, children: [
|
|
4921
4922
|
/* @__PURE__ */ i.jsx(_p, { filename: o, code: t, labels: u }),
|
|
4922
|
-
f ? /* @__PURE__ */ i.jsx(Wp, { code: t, highlight: c ? null : d }) : /* @__PURE__ */ i.jsx(
|
|
4923
|
+
f ? /* @__PURE__ */ i.jsx(Wp, { code: t, highlight: c ? null : d }) : /* @__PURE__ */ i.jsx(Ai, { fallback: /* @__PURE__ */ i.jsx(Rp, { code: t }), children: /* @__PURE__ */ i.jsx(Hp, { highlight: d }) })
|
|
4923
4924
|
] });
|
|
4924
4925
|
}), Kp = (e) => {
|
|
4925
4926
|
const [t, n] = F(!1);
|
|
@@ -4940,7 +4941,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4940
4941
|
cancelAnimationFrame(r), s.disconnect(), a.disconnect(), l?.removeEventListener("loadingdone", o);
|
|
4941
4942
|
};
|
|
4942
4943
|
}, [e]), t;
|
|
4943
|
-
},
|
|
4944
|
+
}, ui = ({ source: e, placement: t, labels: n, children: r }) => {
|
|
4944
4945
|
const [o, s] = F(null), a = Kp(o), l = t === "flow" ? "span" : "div";
|
|
4945
4946
|
return /* @__PURE__ */ i.jsxs(l, { "data-aqmd-math-display": t, children: [
|
|
4946
4947
|
/* @__PURE__ */ i.jsx(
|
|
@@ -4952,12 +4953,12 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4952
4953
|
children: r
|
|
4953
4954
|
}
|
|
4954
4955
|
),
|
|
4955
|
-
/* @__PURE__ */ i.jsx(l, { "data-aqmd-math-copy": "", children: /* @__PURE__ */ i.jsx(
|
|
4956
|
+
/* @__PURE__ */ i.jsx(l, { "data-aqmd-math-copy": "", children: /* @__PURE__ */ i.jsx(Qa, { text: e, labels: n }) })
|
|
4956
4957
|
] });
|
|
4957
|
-
},
|
|
4958
|
+
}, fi = (e, t) => {
|
|
4958
4959
|
const n = te(() => {
|
|
4959
4960
|
try {
|
|
4960
|
-
return { kind: "rendered", innerHtml:
|
|
4961
|
+
return { kind: "rendered", innerHtml: Ja(e, t).innerHtml };
|
|
4961
4962
|
} catch (r) {
|
|
4962
4963
|
return { kind: "failed", error: r, message: `Math rendering error: ${r instanceof Error ? r.message : String(r)}` };
|
|
4963
4964
|
}
|
|
@@ -4966,14 +4967,14 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
4966
4967
|
n.kind === "failed" && console.error("An error occurred while rendering KaTeX:", n.error);
|
|
4967
4968
|
}, [n]), n;
|
|
4968
4969
|
}, Yp = ({ node: e }) => {
|
|
4969
|
-
const t =
|
|
4970
|
-
return /* @__PURE__ */ i.jsx(
|
|
4971
|
-
},
|
|
4970
|
+
const t = fi(e.value, !0), n = "rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";
|
|
4971
|
+
return /* @__PURE__ */ i.jsx(ui, { source: e.value, placement: "block", labels: Sl, children: t.kind === "rendered" ? /* @__PURE__ */ i.jsx("article", { className: n, dangerouslySetInnerHTML: t.innerHtml }) : /* @__PURE__ */ i.jsx("article", { className: n, children: t.message }) });
|
|
4972
|
+
}, mi = Object.freeze({
|
|
4972
4973
|
missingImage: { text: "Image not found", lang: "en" }
|
|
4973
|
-
}), at = new
|
|
4974
|
+
}), at = new al(il.INFO, "[DifyIFramePlugin]"), Xp = "100%", Zp = "600px", Jp = "0", Qp = (e) => typeof e != "object" || e === null || !("type" in e) ? null : typeof e.type == "string" ? e.type : null, eg = ({ embed: e, iFrameAllowedDomains: t }) => {
|
|
4974
4975
|
const [n, r] = F(!0), [o, s] = F(!1), a = W(null), l = W(null), c = W(null), { src: d } = e, u = V(
|
|
4975
4976
|
(b) => {
|
|
4976
|
-
b.source === null || b.source !== a.current?.contentWindow ||
|
|
4977
|
+
b.source === null || b.source !== a.current?.contentWindow || !$c(b.origin, t) || Qp(b.data) === "dify-chatbot-iframe-ready" && (at.info("Dify chatbot iframe is ready"), r((k) => k && (s(!1), l.current && (clearTimeout(l.current), l.current = null), c.current && (clearTimeout(c.current), c.current = null), !1)));
|
|
4977
4978
|
},
|
|
4978
4979
|
[t]
|
|
4979
4980
|
), f = V(() => {
|
|
@@ -5047,23 +5048,23 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5047
5048
|
*/
|
|
5048
5049
|
dify: eg
|
|
5049
5050
|
}), tg = (e) => Object.hasOwn(As, e) ? As[e] : null, Ns = /* @__PURE__ */ i.jsx(Qr, {}), ng = (e, t, n, r, o, s) => {
|
|
5050
|
-
const a = t === null ? null : tg(t), l = e.attributes.title === void 0 ? { title: `${r.text}: ${new URL(e.src).hostname}`, lang: r.lang } : {}, c =
|
|
5051
|
-
return /* @__PURE__ */ i.jsx(
|
|
5051
|
+
const a = t === null ? null : tg(t), l = e.attributes.title === void 0 ? { title: `${r.text}: ${new URL(e.src).hostname}`, lang: r.lang } : {}, c = Pc(e, s), d = Ks(c.attributes.sandbox);
|
|
5052
|
+
return /* @__PURE__ */ i.jsx(fc, { embed: e, label: r, insideAnchor: o, children: a !== null ? /* @__PURE__ */ i.jsx(a, { embed: c, iFrameAllowedDomains: n }, d) : /* @__PURE__ */ i.jsx("iframe", { ..._t(c.attributes, "iframe"), ...l, src: c.src }, d) });
|
|
5052
5053
|
}, xo = (e) => {
|
|
5053
5054
|
for (let t = e.parent; t !== null; t = t.parent)
|
|
5054
5055
|
if (t instanceof nt && t.name.toLowerCase() === "a") return !0;
|
|
5055
5056
|
return !1;
|
|
5056
|
-
},
|
|
5057
|
-
const { class: o, "data-link-kind": s, "data-doc-path": a, "data-doc-exists": l, ...c } = e.attribs, d =
|
|
5057
|
+
}, hi = (e) => e.some((t) => t instanceof nt && (no.has(t.name) || hi(t.children))), rg = (e, t, n, r) => {
|
|
5058
|
+
const { class: o, "data-link-kind": s, "data-doc-path": a, "data-doc-exists": l, ...c } = e.attribs, d = wa(o, hi(e.children)), u = c.href ?? "", f = s, m = f === "external" || to(u), w = kt(e.children, t), g = u !== "" && (r === "untrusted" || !m);
|
|
5058
5059
|
if (g && n)
|
|
5059
|
-
return /* @__PURE__ */ i.jsx(n, { href: u, kind: m ? "external" : f, docPath: a, docExists: l === void 0 ? void 0 : l === "true", className: d, attributes:
|
|
5060
|
+
return /* @__PURE__ */ i.jsx(n, { href: u, kind: m ? "external" : f, docPath: a, docExists: l === void 0 ? void 0 : l === "true", className: d, attributes: Kc(c), children: w });
|
|
5060
5061
|
if (g && r === "untrusted")
|
|
5061
5062
|
return /* @__PURE__ */ i.jsx(Qr, { children: w });
|
|
5062
5063
|
m && (c.target = "_blank", c.rel = "noreferrer");
|
|
5063
5064
|
const h = {};
|
|
5064
5065
|
return s !== void 0 && (h["data-link-kind"] = s), a !== void 0 && (h["data-doc-path"] = a), l !== void 0 && (h["data-doc-exists"] = l), // 文書の属性は他の要素と同じく React の props へ変換して渡す (style の文字列をそのまま渡すと React が描画を止める)
|
|
5065
5066
|
/* @__PURE__ */ i.jsx("a", { ..._t(c, "a"), className: d, ...h, children: w });
|
|
5066
|
-
},
|
|
5067
|
+
}, pi = ({ iFrameAllowedDomains: e, embedLabels: t, frameSandbox: n, linkComponent: r, allowlistContext: o, renderImage: s, renderPlaceholder: a, renderKept: l }) => {
|
|
5067
5068
|
const c = {
|
|
5068
5069
|
replace: (d) => {
|
|
5069
5070
|
if (!(d instanceof nt))
|
|
@@ -5092,7 +5093,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5092
5093
|
}
|
|
5093
5094
|
};
|
|
5094
5095
|
return c;
|
|
5095
|
-
}, og = (e) => /\.[Ss][Vv][Gg]$/u.test(e),
|
|
5096
|
+
}, og = (e) => /\.[Ss][Vv][Gg]$/u.test(e), gi = (e) => {
|
|
5096
5097
|
const t = W(e);
|
|
5097
5098
|
Ze(() => {
|
|
5098
5099
|
t.current = e;
|
|
@@ -5108,7 +5109,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5108
5109
|
};
|
|
5109
5110
|
}, [n]);
|
|
5110
5111
|
}, on = "data-aqmd-svg-image-control", sg = Object.freeze({ "data-aqmd-svg-image-notice": "" }), ag = 1, ig = Object.freeze(["copy", "source", wt]), lg = Object.freeze(["source", wt]), cg = Object.freeze({ kind: "failure", retryable: !0 }), js = (e, t, n) => Vt(() => e.read(t, n)), dg = ({ paragraph: e, image: t, path: n, name: r, reader: o, labels: s }) => {
|
|
5111
|
-
const { [Zn]: a, ...l } = e, [c, d] = F(!1), [u, f] = F(0), [m, w] = F(null), [g, h] = F(null), y = tt(), b = tt(), k = tt(), T = W(null), x =
|
|
5112
|
+
const { [Zn]: a, ...l } = e, [c, d] = F(!1), [u, f] = F(0), [m, w] = F(null), [g, h] = F(null), y = tt(), b = tt(), k = tt(), T = W(null), x = Ua(), S = W(null);
|
|
5112
5113
|
xe(() => {
|
|
5113
5114
|
if (!c)
|
|
5114
5115
|
return;
|
|
@@ -5149,7 +5150,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5149
5150
|
(Ee) => {
|
|
5150
5151
|
if (Ee.kind !== "text" || Ee.truncated)
|
|
5151
5152
|
throw be = !0, new Error("[@aiquants/markdown] the SVG image cannot be copied whole");
|
|
5152
|
-
return
|
|
5153
|
+
return Va(Ee.text, Se, ag, C).catch((Ne) => {
|
|
5153
5154
|
throw be = !0, console.error("[@aiquants/markdown] could not draw the SVG image as a PNG", Ne), Ne;
|
|
5154
5155
|
});
|
|
5155
5156
|
},
|
|
@@ -5205,7 +5206,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5205
5206
|
children: /* @__PURE__ */ i.jsx(hn, { size: 18 })
|
|
5206
5207
|
}
|
|
5207
5208
|
),
|
|
5208
|
-
/* @__PURE__ */ i.jsx("button", { ref: T, type: "button", [on]: "source", tabIndex: B("source"), "aria-pressed": c, onClick: ie, className: St, "aria-label": s.source.text, lang: s.source.lang, children: /* @__PURE__ */ i.jsx(
|
|
5209
|
+
/* @__PURE__ */ i.jsx("button", { ref: T, type: "button", [on]: "source", tabIndex: B("source"), "aria-pressed": c, onClick: ie, className: St, "aria-label": s.source.text, lang: s.source.lang, children: /* @__PURE__ */ i.jsx(ka, { size: 20 }) }),
|
|
5209
5210
|
/* @__PURE__ */ i.jsx(uo, { hook: on, fullscreen: q, labels: s, tabIndex: B(wt), onToggle: H })
|
|
5210
5211
|
] }),
|
|
5211
5212
|
p,
|
|
@@ -5226,9 +5227,9 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5226
5227
|
copyImage: { text: "Copy the image", lang: "en" },
|
|
5227
5228
|
copiedImage: { text: "Copied the image.", lang: "en" },
|
|
5228
5229
|
copyImageFailed: { text: "Could not copy the image.", lang: "en" },
|
|
5229
|
-
...
|
|
5230
|
+
...Qs.en,
|
|
5230
5231
|
fullscreenDialog: { text: "{name} (full screen)", lang: "en" }
|
|
5231
|
-
}),
|
|
5232
|
+
}), qx = Gt(sr), ug = ({ alt: e, target: t, label: n }) => /* @__PURE__ */ i.jsxs(
|
|
5232
5233
|
"span",
|
|
5233
5234
|
{
|
|
5234
5235
|
"data-testid": "markdown-missing-image",
|
|
@@ -5239,7 +5240,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5239
5240
|
lang: n.lang,
|
|
5240
5241
|
className: "my-1 inline-flex max-w-full items-center gap-2 rounded-lg border border-gray-300 border-dashed bg-gray-50 px-3 py-2 text-gray-600 text-sm dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400",
|
|
5241
5242
|
children: [
|
|
5242
|
-
/* @__PURE__ */ i.jsx(
|
|
5243
|
+
/* @__PURE__ */ i.jsx(Yl, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }),
|
|
5243
5244
|
/* @__PURE__ */ i.jsxs("span", { className: "min-w-0", children: [
|
|
5244
5245
|
/* @__PURE__ */ i.jsx("span", { className: "font-medium", children: e ? `${n.text} (${e})` : n.text }),
|
|
5245
5246
|
t && /* @__PURE__ */ i.jsx("span", { className: "ml-2 break-all font-mono text-xs dark:text-gray-300", children: t })
|
|
@@ -5259,13 +5260,13 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5259
5260
|
const { alt: t, title: n, "data-asset-src": r, "data-asset-exists": o } = e.attribs, s = wo(e.attribs);
|
|
5260
5261
|
return { src: s, external: s !== void 0 && to(s), alt: t, title: n, assetPath: r, assetExists: o === void 0 ? void 0 : !bo(e.attribs), insideLink: xo(e) };
|
|
5261
5262
|
}, hg = (e, t, n, r) => {
|
|
5262
|
-
const o =
|
|
5263
|
-
if (o <=
|
|
5263
|
+
const o = Mc(t, n), s = _t(e.attribs), a = kt(e.children, r), l = { [Ac]: String(t) };
|
|
5264
|
+
if (o <= Rc)
|
|
5264
5265
|
return un(`h${o}`, { ...s, ...l }, a);
|
|
5265
5266
|
const c = Object.hasOwn(s, "role") ? {} : { role: "heading", "aria-level": o };
|
|
5266
5267
|
return un("div", { ...c, ...s, ...l }, a);
|
|
5267
5268
|
}, pg = Wt(function({ source: t, innerHtml: n, labels: r }) {
|
|
5268
|
-
return /* @__PURE__ */ i.jsx(
|
|
5269
|
+
return /* @__PURE__ */ i.jsx(ui, { source: t, placement: "flow", labels: r, children: /* @__PURE__ */ i.jsx("span", { dangerouslySetInnerHTML: n }) });
|
|
5269
5270
|
}), xt = (e) => e.map((t) => t instanceof Xn ? t.data : t instanceof nt ? xt(t.children) : "").join(""), gg = (e, t, n) => e.map((r) => {
|
|
5270
5271
|
if (r instanceof Xn) return { kind: "text", text: r.data };
|
|
5271
5272
|
if (!(r instanceof nt)) return { kind: "ignored" };
|
|
@@ -5273,11 +5274,11 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5273
5274
|
const o = er(r.name, r.attribs, { parentName: "p", iFrameAllowedDomains: t, ...n });
|
|
5274
5275
|
return { kind: "link", href: o.action === "keep" ? o.attributes.href ?? null : null };
|
|
5275
5276
|
}), yg = (e, t, n, r) => {
|
|
5276
|
-
const o = e.children, s =
|
|
5277
|
+
const o = e.children, s = Ji(t, gg(o, r.iFrameAllowedDomains, r.allowlistContext));
|
|
5277
5278
|
if (s === null)
|
|
5278
5279
|
return;
|
|
5279
|
-
const a = kt(o, n), l = /* @__PURE__ */ i.jsx("p", { ..._t(e.attribs, "p"), children: a }), c = o.find((m) => m instanceof nt), d = r.embeds.linkCardEndpoint, u = d !== null && c !== void 0 &&
|
|
5280
|
-
return f === null ? u : /* @__PURE__ */ i.jsx(
|
|
5280
|
+
const a = kt(o, n), l = /* @__PURE__ */ i.jsx("p", { ..._t(e.attribs, "p"), children: a }), c = o.find((m) => m instanceof nt), d = r.embeds.linkCardEndpoint, u = d !== null && c !== void 0 && Qi(xt(c.children), s) ? /* @__PURE__ */ i.jsx(xc, { href: t, endpoint: d, size: Bi(r.embeds), fallback: l }) : l, f = Hi(s, r.embeds.providers);
|
|
5281
|
+
return f === null ? u : /* @__PURE__ */ i.jsx(_c, { resolution: f, caption: a, fallback: u, theme: r.theme, labels: r.embedLabels, frameSandbox: Gs(r.embeds) });
|
|
5281
5282
|
}, xg = (e, t, n) => {
|
|
5282
5283
|
if (xo(e))
|
|
5283
5284
|
return null;
|
|
@@ -5289,7 +5290,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5289
5290
|
return null;
|
|
5290
5291
|
const { alt: a, "data-asset-src": l } = s.attributes;
|
|
5291
5292
|
return l === void 0 || !og(l) || wo(s.attributes) === void 0 || bo(s.attributes) ? null : { node: o, path: l, name: a !== void 0 && a.trim() !== "" ? a : l.slice(l.lastIndexOf("/") + 1) };
|
|
5292
|
-
}, Cs = 2166136261, Ms = 16777619, wg = /^[\t\n\f\r ]*$/u, Ut = (e) => e instanceof Xn && wg.test(e.data), bg = `language-${
|
|
5293
|
+
}, Cs = 2166136261, Ms = 16777619, wg = /^[\t\n\f\r ]*$/u, Ut = (e) => e instanceof Xn && wg.test(e.data), bg = `language-${ea}`, yi = (e) => e.name === "code" && (e.attribs.class ?? "").split(/[\t\n\f\r ]+/u).includes(bg), xi = (e) => {
|
|
5293
5294
|
let t = Cs, n = Cs;
|
|
5294
5295
|
const r = (l, c) => {
|
|
5295
5296
|
for (let d = 0; d < l.length; d += 1) {
|
|
@@ -5304,7 +5305,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5304
5305
|
for (const [u, f] of Object.entries(l.attribs))
|
|
5305
5306
|
u !== Zn && (r("", c), r(u, c), r("", c), r(f, c));
|
|
5306
5307
|
r("", c);
|
|
5307
|
-
const d = c && !
|
|
5308
|
+
const d = c && !yi(l);
|
|
5308
5309
|
for (const u of l.children) o(u, d);
|
|
5309
5310
|
r("", c);
|
|
5310
5311
|
} else
|
|
@@ -5338,8 +5339,8 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5338
5339
|
}, gn = /* @__PURE__ */ new Map(), Og = (e, { options: t, tally: n, previous: r, rules: o, failureLabel: s }) => {
|
|
5339
5340
|
const a = [];
|
|
5340
5341
|
if (n.mathReports = a, e === "") return { nodes: [], keys: [], kept: gn, diagnostics: a };
|
|
5341
|
-
const l = cn(e), c =
|
|
5342
|
-
l.filter((u) => !Ut(u)).map((u) =>
|
|
5342
|
+
const l = cn(e), c = da(
|
|
5343
|
+
l.filter((u) => !Ut(u)).map((u) => xi([u])),
|
|
5343
5344
|
r,
|
|
5344
5345
|
o
|
|
5345
5346
|
);
|
|
@@ -5348,7 +5349,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5348
5349
|
nodes: l.map((u) => {
|
|
5349
5350
|
if (Ut(u)) return xt([u]);
|
|
5350
5351
|
const { key: f, content: m } = c[d];
|
|
5351
|
-
return d += 1, /* @__PURE__ */ i.jsx(
|
|
5352
|
+
return d += 1, /* @__PURE__ */ i.jsx(la, { content: m, label: s, text: () => xt([u]), children: kt([u], t) }, f);
|
|
5352
5353
|
}),
|
|
5353
5354
|
keys: c,
|
|
5354
5355
|
kept: gn,
|
|
@@ -5357,13 +5358,13 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5357
5358
|
}, _g = (e, t, n, { options: r, tally: o, progress: s, previous: a, rules: l, failureLabel: c }) => {
|
|
5358
5359
|
if (t.length === 0)
|
|
5359
5360
|
return { nodes: Cr(cn(e)).before, keys: [], kept: gn, diagnostics: [] };
|
|
5360
|
-
const d =
|
|
5361
|
+
const d = tc(e, t).map((m) => {
|
|
5361
5362
|
const w = o.images.rendered, g = o.diagrams.rendered, h = n.get(m)?.find((j) => (j.images === 0 || j.imagesBefore === w) && (j.diagrams === 0 || j.diagramsBefore === g) && (j.openCodeProgress === null || j.openCodeProgress === s));
|
|
5362
5363
|
if (h !== void 0)
|
|
5363
5364
|
return o.images.rendered += h.images, o.diagrams.rendered += h.diagrams, [m, h];
|
|
5364
5365
|
const { before: y, content: b, after: k } = Cr(cn(m)), T = [];
|
|
5365
5366
|
o.mathReports = T;
|
|
5366
|
-
const x =
|
|
5367
|
+
const x = xi(b), S = o.openCode.rendered, R = kt(b, r), D = o.openCode.rendered > S ? s : null;
|
|
5367
5368
|
return [
|
|
5368
5369
|
m,
|
|
5369
5370
|
{
|
|
@@ -5379,7 +5380,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5379
5380
|
openCodeProgress: D
|
|
5380
5381
|
}
|
|
5381
5382
|
];
|
|
5382
|
-
}), u =
|
|
5383
|
+
}), u = da(
|
|
5383
5384
|
d.map(([, m]) => m.shape),
|
|
5384
5385
|
a,
|
|
5385
5386
|
l
|
|
@@ -5393,7 +5394,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5393
5394
|
const { key: h, content: y } = u[g];
|
|
5394
5395
|
return [
|
|
5395
5396
|
...w.before,
|
|
5396
|
-
/* @__PURE__ */ i.jsx(
|
|
5397
|
+
/* @__PURE__ */ i.jsx(la, { content: y, label: c, text: () => xt(Cr(cn(m)).content), children: w.element }, h),
|
|
5397
5398
|
...w.after
|
|
5398
5399
|
];
|
|
5399
5400
|
}),
|
|
@@ -5410,7 +5411,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5410
5411
|
theme: s = "light",
|
|
5411
5412
|
topHeadingLevel: a,
|
|
5412
5413
|
iFrameAllowedDomains: l = Rg,
|
|
5413
|
-
embeds: c =
|
|
5414
|
+
embeds: c = Ws,
|
|
5414
5415
|
embedLabels: d,
|
|
5415
5416
|
documentFontFamily: u,
|
|
5416
5417
|
mermaidInteraction: f,
|
|
@@ -5437,9 +5438,9 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5437
5438
|
imageComponent: ne,
|
|
5438
5439
|
idPrefix: ie
|
|
5439
5440
|
}) => {
|
|
5440
|
-
if (
|
|
5441
|
+
if (ya(c), ni(R?.size), t !== void 0 && ec(e, t), n !== void 0 && nc(n), a !== void 0 && jc(a), y !== void 0 && vg(y), h !== void 0 && (Ka(h, "MarkdownRenderer: mermaidExporting"), g === void 0))
|
|
5441
5442
|
throw new RangeError("MarkdownRenderer: mermaidExporting needs mermaidDrawing (only a diagram the drawing place draws is exported)");
|
|
5442
|
-
const Re = te(() =>
|
|
5443
|
+
const Re = te(() => Xc(ae, ie), [ae, ie]);
|
|
5443
5444
|
if (ae === "untrusted" && ne === void 0) throw new RangeError('MarkdownRenderer: allowlist "untrusted" needs imageComponent (the package never renders an image of untrusted text)');
|
|
5444
5445
|
if (ae === "untrusted" && j === void 0) throw new RangeError('MarkdownRenderer: allowlist "untrusted" needs linkComponent (the package never renders a link of untrusted text)');
|
|
5445
5446
|
if (ae === "document" && ne !== void 0) throw new RangeError('MarkdownRenderer: imageComponent needs allowlist "untrusted" (the images of a document render as written)');
|
|
@@ -5448,13 +5449,13 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5448
5449
|
if (ae === "untrusted" && l.length > 0) throw new RangeError('MarkdownRenderer: iFrameAllowedDomains that allow a host need allowlist "document" (untrusted text never loads a frame)');
|
|
5449
5450
|
if (r && t === void 0) throw new RangeError("MarkdownRenderer: streaming needs blockOffsets (only the block offsets path holds open code blocks)");
|
|
5450
5451
|
if (o && t === void 0) throw new RangeError("MarkdownRenderer: truncated needs blockOffsets (only the block offsets path holds open code blocks)");
|
|
5451
|
-
const _ = Eg(r, o), $ = te(() =>
|
|
5452
|
+
const _ = Eg(r, o), $ = te(() => oa(d, B), [d, B]), p = ri(T), v = gi(q), E = fm(h), C = te(() => ft(sr, H, B), [H, B]), I = te(() => ft(yn, k, B), [k, B]), { blockFailed: le } = ft(ca, { blockFailed: P }, B), { missingImage: G } = te(() => ft(mi, { missingImage: z }, B), [z, B]), ce = W(null), Se = W(null), be = Ci((Ve) => {
|
|
5452
5453
|
ue?.(Ve);
|
|
5453
5454
|
}), ke = V(
|
|
5454
|
-
(Ve, pt) =>
|
|
5455
|
+
(Ve, pt) => pi({
|
|
5455
5456
|
iFrameAllowedDomains: l,
|
|
5456
5457
|
embedLabels: $,
|
|
5457
|
-
frameSandbox:
|
|
5458
|
+
frameSandbox: Gs(c),
|
|
5458
5459
|
linkComponent: j,
|
|
5459
5460
|
allowlistContext: Re,
|
|
5460
5461
|
renderImage: ne === void 0 ? void 0 : (we) => /* @__PURE__ */ i.jsx(ne, { ...mg(we) }),
|
|
@@ -5469,12 +5470,12 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5469
5470
|
const U = we.children[0];
|
|
5470
5471
|
if (U instanceof nt && U.name === "code") {
|
|
5471
5472
|
const Te = U.attribs.class ?? "", Fe = xt(U.children), dt = we.attribs[Zn];
|
|
5472
|
-
if (
|
|
5473
|
+
if (yi(U))
|
|
5473
5474
|
return /* @__PURE__ */ i.jsx(
|
|
5474
|
-
|
|
5475
|
+
ai,
|
|
5475
5476
|
{
|
|
5476
5477
|
tsv: Fe,
|
|
5477
|
-
meta: U.attribs[
|
|
5478
|
+
meta: U.attribs[Js],
|
|
5478
5479
|
sourceLines: dt,
|
|
5479
5480
|
editor: p,
|
|
5480
5481
|
locale: x,
|
|
@@ -5485,11 +5486,11 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5485
5486
|
scrollBarControls: D
|
|
5486
5487
|
}
|
|
5487
5488
|
);
|
|
5488
|
-
const _e = Object.hasOwn(we.attribs,
|
|
5489
|
+
const _e = Object.hasOwn(we.attribs, Zs);
|
|
5489
5490
|
if (_e && (Ve.openCode.rendered += 1), Te.includes("language-mermaid")) {
|
|
5490
5491
|
const gt = Ve.diagrams.rendered;
|
|
5491
5492
|
return Ve.diagrams.rendered += 1, /* @__PURE__ */ i.jsx(
|
|
5492
|
-
|
|
5493
|
+
Za,
|
|
5493
5494
|
{
|
|
5494
5495
|
chartContent: Fe,
|
|
5495
5496
|
interaction: f,
|
|
@@ -5504,7 +5505,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5504
5505
|
}
|
|
5505
5506
|
);
|
|
5506
5507
|
}
|
|
5507
|
-
return /* @__PURE__ */ i.jsx(
|
|
5508
|
+
return /* @__PURE__ */ i.jsx(di, { lang: Te.replace("language-", ""), code: Fe, theme: s, sourceLines: dt, labels: b, labelsLang: B, deferHighlight: _e && pt === "streaming" });
|
|
5508
5509
|
}
|
|
5509
5510
|
}
|
|
5510
5511
|
if (we.name === "img")
|
|
@@ -5514,7 +5515,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5514
5515
|
let Te = xt(we.children).trim();
|
|
5515
5516
|
U ? Te = Te.replace(/^\\\[/, "").replace(/\\\]$/, "") : Te = Te.replace(/^\\\(/, "").replace(/\\\)$/, "");
|
|
5516
5517
|
try {
|
|
5517
|
-
const { innerHtml: Fe, diagnostics: dt } =
|
|
5518
|
+
const { innerHtml: Fe, diagnostics: dt } = Ja(Te, U);
|
|
5518
5519
|
return Ve.mathReports.push(...dt), U ? /* @__PURE__ */ i.jsx(pg, { source: Te, innerHtml: Fe, labels: I }) : /* @__PURE__ */ i.jsx("span", { dangerouslySetInnerHTML: Fe });
|
|
5519
5520
|
} catch (Fe) {
|
|
5520
5521
|
console.error("Failed to render math:", Fe);
|
|
@@ -5522,7 +5523,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5522
5523
|
}
|
|
5523
5524
|
}
|
|
5524
5525
|
if (a !== void 0) {
|
|
5525
|
-
const U =
|
|
5526
|
+
const U = Cc(we.name);
|
|
5526
5527
|
if (U !== void 0)
|
|
5527
5528
|
return hg(we, U, a, pe);
|
|
5528
5529
|
}
|
|
@@ -5566,7 +5567,7 @@ const Op = { margin: "1rem 0" }, ai = { margin: "0", padding: "0.8rem 0" }, _p =
|
|
|
5566
5567
|
}, [ze, n, ke, Xe]), xe(() => {
|
|
5567
5568
|
ce.current !== e && (ce.current = e, rt.length > 0 && be(rt));
|
|
5568
5569
|
}, [e, rt]);
|
|
5569
|
-
const Tt =
|
|
5570
|
+
const Tt = ua(u), ct = Tt === void 0 ? void 0 : { [ko]: Tt, fontFamily: `var(${ko})` };
|
|
5570
5571
|
return /* @__PURE__ */ i.jsxs("div", { ref: Se, className: "markdown-body", "data-theme": s, "data-aqmd-document": "", style: ct, children: [
|
|
5571
5572
|
$e,
|
|
5572
5573
|
t !== void 0 && /* @__PURE__ */ i.jsx(xh, { root: Se })
|
|
@@ -5640,9 +5641,9 @@ const Wg = [
|
|
|
5640
5641
|
key: "c9qhm2"
|
|
5641
5642
|
}
|
|
5642
5643
|
]
|
|
5643
|
-
], Gg = se("pin-off", Wg), Vg = /* @__PURE__ */ new Set(["UL", "OL", "LI", "DL", "DD", "BLOCKQUOTE", "SECTION", "DETAILS"]),
|
|
5644
|
+
], Gg = se("pin-off", Wg), Vg = /* @__PURE__ */ new Set(["UL", "OL", "LI", "DL", "DD", "BLOCKQUOTE", "SECTION", "DETAILS"]), wi = (e) => [...e.children].flatMap((t) => Vg.has(t.tagName) ? [t, ...wi(t)] : [t]), Kg = (e, t) => {
|
|
5644
5645
|
let n = null;
|
|
5645
|
-
for (const r of
|
|
5646
|
+
for (const r of wi(e)) {
|
|
5646
5647
|
if (!r.checkVisibility())
|
|
5647
5648
|
continue;
|
|
5648
5649
|
const o = r.getBoundingClientRect().top - t;
|
|
@@ -5652,7 +5653,7 @@ const Wg = [
|
|
|
5652
5653
|
}, Zr = ({ block: e, offset: t, root: n, scroller: r }) => (
|
|
5653
5654
|
// 矩形はビューポートの px で scrollTop は容器自身の px。倍率は文書の高さで測ると、整数に丸めた offsetHeight の誤差が
|
|
5654
5655
|
// 動かす距離 (文書の高さまで) の上で 1 px に満たない
|
|
5655
|
-
(e.getBoundingClientRect().top - r.getBoundingClientRect().top - t) /
|
|
5656
|
+
(e.getBoundingClientRect().top - r.getBoundingClientRect().top - t) / aa(n)
|
|
5656
5657
|
), Ls = (e) => {
|
|
5657
5658
|
e.scrollTop = e.scroller.scrollTop, e.moved = Zr(e);
|
|
5658
5659
|
}, Is = (e, t) => {
|
|
@@ -5770,17 +5771,17 @@ const Xg = (e) => `#${e.id}`, Zg = (e) => {
|
|
|
5770
5771
|
}) }) });
|
|
5771
5772
|
}, Mr = "--aqmd-toolbar-block-overlap", Qg = "--aqmd-toolbar-block-reach-px", ey = 1 / 16, ty = 2, ny = (e, t, n) => {
|
|
5772
5773
|
const r = ty * ey / Math.min(1, n);
|
|
5773
|
-
return t > 0 && e - t < r && t - e < 1 + r ? t :
|
|
5774
|
+
return t > 0 && e - t < r && t - e < 1 + r ? t : Cl(e);
|
|
5774
5775
|
}, ry = ({ toolbar: e, content: t, scrollportTop: n, scrollportBottom: r, scale: o, reach: s }) => {
|
|
5775
5776
|
if (e.width <= 0 || e.height <= 0) return 0;
|
|
5776
5777
|
const a = e.left < t.right && e.right > t.left, l = e.top < n + e.height && e.top < r, c = e.bottom - n;
|
|
5777
5778
|
return a && l && c > 0 ? ny(c / o, s, o) : 0;
|
|
5778
|
-
}, Kt = (e, t) => `${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`, Dn = (e, t) => Object.fromEntries(Object.keys(t).map((n) => [Kt(e, n), t[n]])), oy = (e) => ![...Am, ...jm, ...Nm].includes(e),
|
|
5779
|
+
}, Kt = (e, t) => `${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`, Dn = (e, t) => Object.fromEntries(Object.keys(t).map((n) => [Kt(e, n), t[n]])), oy = (e) => ![...Am, ...jm, ...Nm].includes(e), bi = Object.keys(or).filter(oy), { errorPrefix: sy, ...ay } = Object.fromEntries(bi.map((e) => [e, or[e]])), iy = Object.keys(Pr.en), ly = Object.keys(sr), cy = Object.keys(Jn), dy = Object.keys(yn), Ei = Object.freeze({
|
|
5779
5780
|
loading: { text: "Loading data...", lang: "en" },
|
|
5780
5781
|
errorPrefix: sy,
|
|
5781
5782
|
defaultErrorTitle: { text: "An error occurred", lang: "en" },
|
|
5782
|
-
...
|
|
5783
|
-
...
|
|
5783
|
+
...mi,
|
|
5784
|
+
...ca,
|
|
5784
5785
|
styleTitle: { text: "Display", lang: "en" },
|
|
5785
5786
|
selectStyleAria: { text: "Display options", lang: "en" },
|
|
5786
5787
|
pinStyleAria: { text: "Pin display options", lang: "en" },
|
|
@@ -5812,7 +5813,7 @@ const Xg = (e) => `#${e.id}`, Zg = (e) => {
|
|
|
5812
5813
|
...Dn("codeBlock", Jn),
|
|
5813
5814
|
...Dn("displayMath", yn),
|
|
5814
5815
|
...Qn
|
|
5815
|
-
}),
|
|
5816
|
+
}), Hx = Gt(Ei), uy = (e, t) => ft(Ei, e, t), bn = (e, t, n) => {
|
|
5816
5817
|
const r = {};
|
|
5817
5818
|
if (e === void 0) return Object.freeze(r);
|
|
5818
5819
|
for (const o of t) {
|
|
@@ -5820,7 +5821,7 @@ const Xg = (e) => `#${e.id}`, Zg = (e) => {
|
|
|
5820
5821
|
s !== void 0 && (r[o] = s);
|
|
5821
5822
|
}
|
|
5822
5823
|
return Object.freeze(r);
|
|
5823
|
-
}, fy = (e) => bn(e,
|
|
5824
|
+
}, fy = (e) => bn(e, bi, (t) => t === "errorPrefix" ? t : Kt("mermaid", t)), my = (e) => bn(e, iy, (t) => Kt("spreadsheet", t)), hy = (e) => bn(e, ly, (t) => Kt("svgImage", t)), py = (e) => bn(e, cy, (t) => Kt("codeBlock", t)), gy = (e) => bn(e, dy, (t) => Kt("displayMath", t)), yy = Object.keys(Qn), xy = (e) => {
|
|
5824
5825
|
const t = {};
|
|
5825
5826
|
if (e === void 0) return Object.freeze(t);
|
|
5826
5827
|
for (const n of yy) {
|
|
@@ -5850,7 +5851,7 @@ const Xg = (e) => `#${e.id}`, Zg = (e) => {
|
|
|
5850
5851
|
if (n.has(l)) throw new RangeError(`[@aiquants/markdown] the labels of documentFontOptions must be unique; ${JSON.stringify(l)} repeats at ${s}`);
|
|
5851
5852
|
t.add(a), n.add(l);
|
|
5852
5853
|
}
|
|
5853
|
-
},
|
|
5854
|
+
}, vi = (e) => `min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${e ? "bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200" : "bg-transparent text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-200"}`, Oy = "--aqmd-reading-margin-inline", _y = Object.freeze({ emptyMessage: { text: "ファイルを選択してください。", lang: "ja" } }), Ry = "100%", $s = (e) => e === "center" ? "auto" : e === "right" ? "auto 0" : "0 auto", Jr = "24px", Si = (e) => Object.freeze({
|
|
5854
5855
|
position: "fixed",
|
|
5855
5856
|
insetBlockStart: "var(--aqmd-toolbar-inset-block-start, 0px)",
|
|
5856
5857
|
insetInlineEnd: `calc(var(--aqmd-toolbar-inset-inline-end, 0px) + ${e})`,
|
|
@@ -5860,7 +5861,7 @@ const Xg = (e) => `#${e.id}`, Zg = (e) => {
|
|
|
5860
5861
|
alignItems: "flex-start",
|
|
5861
5862
|
gap: "0.5rem",
|
|
5862
5863
|
pointerEvents: "none"
|
|
5863
|
-
}), Ay =
|
|
5864
|
+
}), Ay = Si(Jr), Ny = Object.freeze({
|
|
5864
5865
|
position: "absolute",
|
|
5865
5866
|
insetBlockStart: 0,
|
|
5866
5867
|
insetInlineStart: 0,
|
|
@@ -5893,7 +5894,7 @@ const Xg = (e) => `#${e.id}`, Zg = (e) => {
|
|
|
5893
5894
|
let l = 0;
|
|
5894
5895
|
const c = () => {
|
|
5895
5896
|
l = 0;
|
|
5896
|
-
const f = s.getBoundingClientRect(), m =
|
|
5897
|
+
const f = s.getBoundingClientRect(), m = aa(s), w = a?.visualViewport ?? null, g = w === null ? Number.POSITIVE_INFINITY : w.offsetTop + w.height, h = Math.min(n.getBoundingClientRect().bottom, g);
|
|
5897
5898
|
o(Math.max(0, Math.floor((h - f.top) / m - Cy)));
|
|
5898
5899
|
}, d = () => {
|
|
5899
5900
|
a !== null && l === 0 && (l = a.requestAnimationFrame(c));
|
|
@@ -5923,7 +5924,7 @@ function Ir({ menu: e, Icon: t, buttonLabel: n, titleLabel: r, titleId: o, pinLa
|
|
|
5923
5924
|
const P = (q) => {
|
|
5924
5925
|
z.contains(q.target) || (m(), q.pointerType === "touch" && !(q.target instanceof Element && q.target.closest("[data-aqmd-toolbar]") !== null) && Ly(z.ownerDocument, q));
|
|
5925
5926
|
}, B = (q) => {
|
|
5926
|
-
q.key !== "Escape" || q.defaultPrevented || q
|
|
5927
|
+
q.key !== "Escape" || q.defaultPrevented || Hs(q) || (q.preventDefault(), m(), T.current?.focus());
|
|
5927
5928
|
};
|
|
5928
5929
|
return document.addEventListener("pointerdown", P), z.addEventListener("keydown", B), () => {
|
|
5929
5930
|
document.removeEventListener("pointerdown", P), z.removeEventListener("keydown", B);
|
|
@@ -5963,7 +5964,7 @@ function Ir({ menu: e, Icon: t, buttonLabel: n, titleLabel: r, titleId: o, pinLa
|
|
|
5963
5964
|
function Pn({ section: e, titleLabel: t, options: n, current: r, onChoose: o }) {
|
|
5964
5965
|
return /* @__PURE__ */ i.jsxs("fieldset", { className: "m-0 min-w-0 border-0 p-0", "data-aqmd-display-section": e, children: [
|
|
5965
5966
|
/* @__PURE__ */ i.jsx("legend", { lang: t.lang, className: "px-2 pb-1 font-medium text-gray-600 text-xs dark:text-gray-300", children: t.text }),
|
|
5966
|
-
/* @__PURE__ */ i.jsx("div", { className: "space-y-1", children: n.map(({ value: s, label: a }) => /* @__PURE__ */ i.jsx("button", { type: "button", "aria-pressed": r === s, lang: a.lang, className:
|
|
5967
|
+
/* @__PURE__ */ i.jsx("div", { className: "space-y-1", children: n.map(({ value: s, label: a }) => /* @__PURE__ */ i.jsx("button", { type: "button", "aria-pressed": r === s, lang: a.lang, className: vi(r === s), onClick: () => o(s), children: a.text }, s)) })
|
|
5967
5968
|
] });
|
|
5968
5969
|
}
|
|
5969
5970
|
const Dy = (e, t, n, r) => {
|
|
@@ -6083,7 +6084,7 @@ function Fy() {
|
|
|
6083
6084
|
};
|
|
6084
6085
|
}
|
|
6085
6086
|
const By = ({ error: e, labels: t }) => {
|
|
6086
|
-
if (
|
|
6087
|
+
if (Mi(e))
|
|
6087
6088
|
return /* @__PURE__ */ i.jsx("div", { className: "p-4", children: e });
|
|
6088
6089
|
if (typeof e == "object" && e !== null && "message" in e) {
|
|
6089
6090
|
const r = e, o = r.title !== void 0 && r.title !== "";
|
|
@@ -6107,7 +6108,7 @@ const By = ({ error: e, labels: t }) => {
|
|
|
6107
6108
|
const t = eo("scrollBarGutter", e);
|
|
6108
6109
|
return e === 0 ? null : t;
|
|
6109
6110
|
};
|
|
6110
|
-
function
|
|
6111
|
+
function Ux({
|
|
6111
6112
|
parseResult: e,
|
|
6112
6113
|
content: t,
|
|
6113
6114
|
error: n = null,
|
|
@@ -6117,14 +6118,14 @@ function Hx({
|
|
|
6117
6118
|
theme: a,
|
|
6118
6119
|
style: l,
|
|
6119
6120
|
onStyleChange: c,
|
|
6120
|
-
availableStyles: d =
|
|
6121
|
-
align: u =
|
|
6121
|
+
availableStyles: d = Wi,
|
|
6122
|
+
align: u = Gi,
|
|
6122
6123
|
onAlignChange: f,
|
|
6123
6124
|
showToc: m = !0,
|
|
6124
6125
|
showStyle: w = !0,
|
|
6125
6126
|
showAlign: g = !0,
|
|
6126
6127
|
contentLang: h,
|
|
6127
|
-
measure: y =
|
|
6128
|
+
measure: y = Vi,
|
|
6128
6129
|
onMeasureChange: b,
|
|
6129
6130
|
showMeasure: k = !0,
|
|
6130
6131
|
contentColors: T = To,
|
|
@@ -6138,7 +6139,7 @@ function Hx({
|
|
|
6138
6139
|
maxWidth: B,
|
|
6139
6140
|
padding: q = 16,
|
|
6140
6141
|
iFrameAllowedDomains: H,
|
|
6141
|
-
embeds: ue =
|
|
6142
|
+
embeds: ue = Ws,
|
|
6142
6143
|
fetch: ae,
|
|
6143
6144
|
emptyMessage: ne,
|
|
6144
6145
|
toolbar: ie,
|
|
@@ -6161,8 +6162,8 @@ function Hx({
|
|
|
6161
6162
|
Ee.current = ye, Ye(ye);
|
|
6162
6163
|
}, []), [lt, Ge] = F(0), [$e, ze] = F(null), [Xe, rt] = F(null), Tt = V((ye) => {
|
|
6163
6164
|
rt(ye === null ? null : ye.querySelector(Ey));
|
|
6164
|
-
}, []), [ct, Ve] = F(null), pt = tt(), we = Fy(), pe = ie ?? we, U = te(() => uy(o, s), [o, s]), Te = te(() => fy(o), [o]), Fe = te(() => my(o), [o]), dt = te(() => hy(o), [o]), _e = te(() => py(o), [o]), gt = te(() => gy(o), [o]), Lt =
|
|
6165
|
-
|
|
6165
|
+
}, []), [ct, Ve] = F(null), pt = tt(), we = Fy(), pe = ie ?? we, U = te(() => uy(o, s), [o, s]), Te = te(() => fy(o), [o]), Fe = te(() => my(o), [o]), dt = te(() => hy(o), [o]), _e = te(() => py(o), [o]), gt = te(() => gy(o), [o]), Lt = gi(ce), It = mc(ae), ot = ri(v);
|
|
6166
|
+
ya(ue);
|
|
6166
6167
|
const st = Dr.filter((ye) => ue.providers.includes(ye)).join(" "), N = ue.linkCardEndpoint, K = ue.linkCardSize, J = ue.frameSandbox, Y = te(() => {
|
|
6167
6168
|
const ye = st.split(" "), me = Object.freeze(Dr.filter((kn) => ye.includes(kn)));
|
|
6168
6169
|
return Object.freeze({ providers: me, linkCardEndpoint: N, ...K === void 0 ? void 0 : { linkCardSize: K }, ...J === void 0 ? void 0 : { frameSandbox: J } });
|
|
@@ -6193,7 +6194,7 @@ function Hx({
|
|
|
6193
6194
|
vt && ($y(vt), vt.tabIndex < 0 && !vt.hasAttribute("tabindex") && vt.setAttribute("tabindex", "-1"), vt.scrollIntoView({ behavior: Py() ? "instant" : "smooth", block: "start" }), vt.focus({ preventScroll: !0 }));
|
|
6194
6195
|
},
|
|
6195
6196
|
[Be, bt, _]
|
|
6196
|
-
), O = e?.headings ?? [], M = !(r || n), L = M && e !== null, Z = M && e === null && t !== null, fe = L && m && O.length > 0, qe = L && w, Qe = L && k && typeof b == "function", Yt = L && S && typeof x == "function", Rt = L && z && typeof j == "function" && R.length > 0, Xt = qe || Qe || Yt || Rt, Dt = L && y === "reading", Zt = P !== void 0 || B !== void 0 || Dt, Jt = (L || Z) && g && typeof f == "function" && Zt, En = te(() => /* @__PURE__ */ i.jsx(Jg, { headings: O, className: "text-sm", labelledBy: pt, onHeadingSelect: ee, headingHref: $ }), [O, pt, ee, $]), Et = Se === void 0 ? Jr : qy(Je, lt), vn = te(() => Et === Jr ? Ay :
|
|
6197
|
+
), O = e?.headings ?? [], M = !(r || n), L = M && e !== null, Z = M && e === null && t !== null, fe = L && m && O.length > 0, qe = L && w, Qe = L && k && typeof b == "function", Yt = L && S && typeof x == "function", Rt = L && z && typeof j == "function" && R.length > 0, Xt = qe || Qe || Yt || Rt, Dt = L && y === "reading", Zt = P !== void 0 || B !== void 0 || Dt, Jt = (L || Z) && g && typeof f == "function" && Zt, En = te(() => /* @__PURE__ */ i.jsx(Jg, { headings: O, className: "text-sm", labelledBy: pt, onHeadingSelect: ee, headingHref: $ }), [O, pt, ee, $]), Et = Se === void 0 ? Jr : qy(Je, lt), vn = te(() => Et === Jr ? Ay : Si(Et), [Et]), Qt = fe || Xt || Jt ? /* @__PURE__ */ i.jsxs("div", { ref: Ve, "data-aqmd-toolbar": !0, style: vn, children: [
|
|
6197
6198
|
/* @__PURE__ */ i.jsx("span", { "data-aqmd-toolbar-inset-probe": !0, "aria-hidden": "true", style: Ny }),
|
|
6198
6199
|
Jt && f && /* @__PURE__ */ i.jsx(
|
|
6199
6200
|
Ir,
|
|
@@ -6222,7 +6223,7 @@ function Hx({
|
|
|
6222
6223
|
type: "button",
|
|
6223
6224
|
"aria-pressed": vo,
|
|
6224
6225
|
lang: Eo.lang,
|
|
6225
|
-
className: `flex items-center gap-2 ${
|
|
6226
|
+
className: `flex items-center gap-2 ${vi(vo)}`,
|
|
6226
6227
|
onClick: () => {
|
|
6227
6228
|
f(me), ye();
|
|
6228
6229
|
},
|
|
@@ -6334,7 +6335,7 @@ function Hx({
|
|
|
6334
6335
|
/* @__PURE__ */ i.jsx("span", { "aria-hidden": "true", children: "🌀" }),
|
|
6335
6336
|
" ",
|
|
6336
6337
|
/* @__PURE__ */ i.jsx("span", { lang: U.loading.lang, children: U.loading.text })
|
|
6337
|
-
] }) : n ? /* @__PURE__ */ i.jsx(By, { error: n, labels: U }) : e ? /* @__PURE__ */ i.jsx("div", { className: "relative w-full min-w-0", children: /* @__PURE__ */ i.jsx("div", { className: "w-full min-w-0", children: /* @__PURE__ */ i.jsx("div", { ref: Tt, className: Le, "data-theme": a, "data-aqmd-reading-box": Dt ? "" : void 0, style: Dt ? { [Oy]: $s(u) } : void 0, children: /* @__PURE__ */ i.jsx(
|
|
6338
|
+
] }) : n ? /* @__PURE__ */ i.jsx(By, { error: n, labels: U }) : e ? /* @__PURE__ */ i.jsx("div", { className: "relative w-full min-w-0", children: /* @__PURE__ */ i.jsx("div", { className: "w-full min-w-0", children: /* @__PURE__ */ i.jsx("div", { ref: Tt, className: Le, "data-theme": a, "data-aqmd-reading-box": Dt ? "" : void 0, style: Dt ? { [Oy]: $s(u) } : void 0, children: /* @__PURE__ */ i.jsx(pa, { value: It, children: /* @__PURE__ */ i.jsx(
|
|
6338
6339
|
zy,
|
|
6339
6340
|
{
|
|
6340
6341
|
parseResult: e,
|
|
@@ -6372,7 +6373,7 @@ function Hx({
|
|
|
6372
6373
|
...je === null ? void 0 : { [Mr]: `${je}px` }
|
|
6373
6374
|
}, Ie = Qt !== null && !Zt, De = Z ? $e : Xe, Sn = T === To ? void 0 : T;
|
|
6374
6375
|
return /* @__PURE__ */ i.jsxs(
|
|
6375
|
-
|
|
6376
|
+
ql,
|
|
6376
6377
|
{
|
|
6377
6378
|
scrollerRef: Pe,
|
|
6378
6379
|
scrollerProps: {
|
|
@@ -6398,7 +6399,7 @@ function Hx({
|
|
|
6398
6399
|
style: l,
|
|
6399
6400
|
measure: y,
|
|
6400
6401
|
align: u,
|
|
6401
|
-
documentFontFamily: L ?
|
|
6402
|
+
documentFontFamily: L ? ua(G) : void 0
|
|
6402
6403
|
}
|
|
6403
6404
|
)
|
|
6404
6405
|
]
|
|
@@ -6409,13 +6410,13 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6409
6410
|
"[",
|
|
6410
6411
|
e.identifier,
|
|
6411
6412
|
"]"
|
|
6412
|
-
] }) }),
|
|
6413
|
+
] }) }), Wx = ({ nodes: e, theme: t = "light" }) => e.length === 0 ? null : /* @__PURE__ */ i.jsx("section", { className: "border-[#171717] border-t pt-4 dark:border-[#464646]", children: /* @__PURE__ */ i.jsx("ol", { className: "pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]", children: e.map((n, r) => /* @__PURE__ */ i.jsx("li", { id: `fn-${n.identifier}`, className: r === 0 ? "" : "mt-4", children: /* @__PURE__ */ i.jsx(Me, { nodes: n.children, theme: t }) }, `mdast-node-fn-${n.identifier}-${r}`)) }) }), Vy = ({ node: e }) => /* @__PURE__ */ i.jsx("a", { href: e.url, className: "text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]", children: "↩" }), Ky = (e) => e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi, "").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi, "").replace(/<[^>]+>/g, "").replace(/ /gi, " ").replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);/g, (o, s) => {
|
|
6413
6414
|
const a = Number(s);
|
|
6414
6415
|
return Number.isFinite(a) ? String.fromCodePoint(a) : "";
|
|
6415
6416
|
}).replace(/&#x([0-9a-f]+);/gi, (o, s) => {
|
|
6416
6417
|
const a = Number.parseInt(s, 16);
|
|
6417
6418
|
return Number.isFinite(a) ? String.fromCodePoint(a) : "";
|
|
6418
|
-
}).replace(/\s+/g, " ").trim(),
|
|
6419
|
+
}).replace(/\s+/g, " ").trim(), ki = (e) => {
|
|
6419
6420
|
const t = (n) => {
|
|
6420
6421
|
if (!n || typeof n != "object")
|
|
6421
6422
|
return "";
|
|
@@ -6443,7 +6444,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6443
6444
|
return "text-lg font-medium dark:text-gray-400";
|
|
6444
6445
|
}
|
|
6445
6446
|
}, Xy = ({ node: e }) => {
|
|
6446
|
-
const t = new
|
|
6447
|
+
const t = new bl(), n = `h${e.depth}`, r = e.data?.hProperties?.id, o = t.slug(ki(e.children));
|
|
6447
6448
|
return (
|
|
6448
6449
|
// <Tag id={customId || encodeURIComponent(childrenText)} className={getHeadingClassName(node.depth)}>
|
|
6449
6450
|
/* @__PURE__ */ i.jsx(n, { id: r || o, className: Yy(e.depth), children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children }) })
|
|
@@ -6459,7 +6460,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6459
6460
|
const s = e.data.tagName.toLowerCase();
|
|
6460
6461
|
return /* @__PURE__ */ i.jsx(s, { ..._t(o.attributes, e.data.tagName.toLowerCase()), children: r });
|
|
6461
6462
|
}, Qy = /^\s*<(address|article|aside|blockquote|details|dialog|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h[1-6]|header|hgroup|hr|li|main|nav|ol|p|pre|section|table|ul)/i, ex = ({ node: e, iFrameAllowedDomains: t = [] }) => {
|
|
6462
|
-
const n = kt(cn(e.value),
|
|
6463
|
+
const n = kt(cn(e.value), pi({ iFrameAllowedDomains: t, embedLabels: kl, frameSandbox: Ui, allowlistContext: { allowlist: "document" } }));
|
|
6463
6464
|
return Array.isArray(n) && n.length === 0 ? null : Qy.test(e.value) ? /* @__PURE__ */ i.jsx("div", { children: n }) : /* @__PURE__ */ i.jsx("span", { children: n });
|
|
6464
6465
|
}, tx = ({ node: e }) => {
|
|
6465
6466
|
if (!e.url || e.url.trim() === "" || !xn(e.url))
|
|
@@ -6470,11 +6471,11 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6470
6471
|
t && /* @__PURE__ */ i.jsx("em", { className: "block text-center text-gray-400 text-xs", children: t })
|
|
6471
6472
|
] });
|
|
6472
6473
|
}, nx = ({ node: e }) => /* @__PURE__ */ i.jsx("code", { className: "rounded-md bg-gray-200 px-1.5 py-1 font-mono text-gray-800 text-sm dark:bg-gray-700 dark:text-gray-200", children: e.value }), rx = ({ node: e }) => {
|
|
6473
|
-
const t =
|
|
6474
|
+
const t = fi(e.value, !1), n = "rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";
|
|
6474
6475
|
return t.kind === "rendered" ? /* @__PURE__ */ i.jsx("span", { className: n, dangerouslySetInnerHTML: t.innerHtml }) : /* @__PURE__ */ i.jsx("span", { className: n, children: t.message });
|
|
6475
|
-
}, ox = new RegExp(`<(?:${[...no].join("|")})(?=[\\s/>])`, "i"),
|
|
6476
|
+
}, ox = new RegExp(`<(?:${[...no].join("|")})(?=[\\s/>])`, "i"), Ti = (e) => e.some((t) => t.type === "image" || t.type === "imageReference" || t.type === "html" && typeof t.value == "string" && ox.test(t.value) || t.children !== void 0 && Ti(t.children)), sx = ({ node: e }) => {
|
|
6476
6477
|
const t = xn(e.url) ? e.url : void 0, n = t !== void 0 && to(t);
|
|
6477
|
-
return /* @__PURE__ */ i.jsx("a", { className:
|
|
6478
|
+
return /* @__PURE__ */ i.jsx("a", { className: wa(void 0, Ti(e.children)), href: t, target: n ? "_blank" : void 0, rel: n ? "noreferrer" : void 0, children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children }) });
|
|
6478
6479
|
}, ax = ({ node: e }) => e.children.length === 1 && e.children[0].type === "paragraph" ? /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children[0].children }) }) : /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children }) }), ix = ({ node: e }) => {
|
|
6479
6480
|
const t = e.ordered ? "ol" : "ul";
|
|
6480
6481
|
return /* @__PURE__ */ i.jsx(t, { children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children }) });
|
|
@@ -6537,7 +6538,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6537
6538
|
case "break":
|
|
6538
6539
|
return /* @__PURE__ */ i.jsx("br", {}, `mdast-node-${r.type}-${o}`);
|
|
6539
6540
|
case "code":
|
|
6540
|
-
return /* @__PURE__ */ i.jsx(
|
|
6541
|
+
return /* @__PURE__ */ i.jsx(di, { node: r, theme: t }, `mdast-node-${r.type}-${o}`);
|
|
6541
6542
|
case "delete":
|
|
6542
6543
|
return /* @__PURE__ */ i.jsx(Uy, { node: r }, `mdast-node-${r.type}-${o}`);
|
|
6543
6544
|
case "details":
|
|
@@ -6604,7 +6605,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6604
6605
|
throw new Error(`Unknown node type: ${r.type}`);
|
|
6605
6606
|
}
|
|
6606
6607
|
}
|
|
6607
|
-
}), xx = ({ node: e }) => /* @__PURE__ */ i.jsx("blockquote", { className: "my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300", children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children }) }), wx = /\s*\{#(.+?)\}\s*$/,
|
|
6608
|
+
}), xx = ({ node: e }) => /* @__PURE__ */ i.jsx("blockquote", { className: "my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300", children: /* @__PURE__ */ i.jsx(Me, { nodes: e.children }) }), wx = /\s*\{#(.+?)\}\s*$/, Gx = () => (e) => {
|
|
6608
6609
|
et(e, "heading", (t) => {
|
|
6609
6610
|
if (t.children.length === 0)
|
|
6610
6611
|
return;
|
|
@@ -6619,7 +6620,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6619
6620
|
l.id = s, a.hProperties = l, r.value = r.value.substring(0, o.index).trimEnd(), r.value === "" && t.children.pop();
|
|
6620
6621
|
}
|
|
6621
6622
|
});
|
|
6622
|
-
},
|
|
6623
|
+
}, Vx = () => (e) => {
|
|
6623
6624
|
et(e, "footnoteDefinition", (t) => {
|
|
6624
6625
|
et(t, "paragraph", (n) => {
|
|
6625
6626
|
n.children.push({
|
|
@@ -6628,7 +6629,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6628
6629
|
});
|
|
6629
6630
|
});
|
|
6630
6631
|
});
|
|
6631
|
-
},
|
|
6632
|
+
}, Kx = () => (e) => {
|
|
6632
6633
|
et(e, "html", (t, n, r) => {
|
|
6633
6634
|
if (typeof n != "number" || !r)
|
|
6634
6635
|
return;
|
|
@@ -6642,7 +6643,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6642
6643
|
r.children.splice(n, 1, c);
|
|
6643
6644
|
}
|
|
6644
6645
|
});
|
|
6645
|
-
},
|
|
6646
|
+
}, Yx = () => (e) => {
|
|
6646
6647
|
const t = (n) => {
|
|
6647
6648
|
const r = n.children;
|
|
6648
6649
|
if (!r)
|
|
@@ -6685,7 +6686,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6685
6686
|
}
|
|
6686
6687
|
};
|
|
6687
6688
|
et(e, "paragraph", t), et(e, "tableCell", t), et(e, "heading", t), et(e, "emphasis", t), et(e, "strong", t), et(e, "delete", t);
|
|
6688
|
-
}, Bs = /\s*=\s*(\d+)(w|h|x|y)\s*/g,
|
|
6689
|
+
}, Bs = /\s*=\s*(\d+)(w|h|x|y)\s*/g, Xx = () => (e) => {
|
|
6689
6690
|
et(e, "image", (t) => {
|
|
6690
6691
|
const n = (c) => {
|
|
6691
6692
|
if (!c)
|
|
@@ -6705,7 +6706,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6705
6706
|
}
|
|
6706
6707
|
}
|
|
6707
6708
|
});
|
|
6708
|
-
},
|
|
6709
|
+
}, Zx = () => (e) => {
|
|
6709
6710
|
et(e, (t, n, r) => {
|
|
6710
6711
|
r && Object.defineProperty(t, "parent", {
|
|
6711
6712
|
value: r,
|
|
@@ -6715,7 +6716,7 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6715
6716
|
// JSON.stringify でシリアライズされないようにする
|
|
6716
6717
|
});
|
|
6717
6718
|
});
|
|
6718
|
-
}, qs = /^:::(message|details)\s*(.*)/,
|
|
6719
|
+
}, qs = /^:::(message|details)\s*(.*)/, Jx = () => (e) => {
|
|
6719
6720
|
function t(n) {
|
|
6720
6721
|
const r = [];
|
|
6721
6722
|
let o = 0;
|
|
@@ -6785,10 +6786,10 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6785
6786
|
return r;
|
|
6786
6787
|
}
|
|
6787
6788
|
e.children = t(e.children);
|
|
6788
|
-
},
|
|
6789
|
+
}, Qx = (e) => {
|
|
6789
6790
|
const t = [];
|
|
6790
6791
|
return et(e, "heading", (n) => {
|
|
6791
|
-
const r =
|
|
6792
|
+
const r = ki(n.children), o = n.data?.hProperties?.id;
|
|
6792
6793
|
o && r && t.push({
|
|
6793
6794
|
depth: n.depth,
|
|
6794
6795
|
text: r,
|
|
@@ -6797,50 +6798,50 @@ const Uy = ({ node: e }) => /* @__PURE__ */ i.jsx("del", { children: /* @__PURE_
|
|
|
6797
6798
|
}), t;
|
|
6798
6799
|
};
|
|
6799
6800
|
export {
|
|
6800
|
-
|
|
6801
|
+
Kx as A,
|
|
6801
6802
|
xx as B,
|
|
6802
|
-
|
|
6803
|
-
|
|
6803
|
+
di as C,
|
|
6804
|
+
Px as D,
|
|
6804
6805
|
Wy as E,
|
|
6805
6806
|
Vy as F,
|
|
6806
|
-
|
|
6807
|
+
Yx as G,
|
|
6807
6808
|
Xy as H,
|
|
6808
6809
|
tx as I,
|
|
6809
|
-
|
|
6810
|
-
|
|
6810
|
+
Xx as J,
|
|
6811
|
+
Zx as K,
|
|
6811
6812
|
sx as L,
|
|
6812
|
-
|
|
6813
|
+
Ru as M,
|
|
6813
6814
|
Me as N,
|
|
6814
|
-
|
|
6815
|
+
Jx as O,
|
|
6815
6816
|
cx as P,
|
|
6816
6817
|
Fy as Q,
|
|
6817
|
-
|
|
6818
|
+
ai as S,
|
|
6818
6819
|
mx as T,
|
|
6819
6820
|
gx as Z,
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6821
|
+
$x as a,
|
|
6822
|
+
zx as b,
|
|
6823
|
+
Hx as c,
|
|
6824
|
+
Bx as d,
|
|
6824
6825
|
hm as e,
|
|
6825
6826
|
us as f,
|
|
6826
|
-
|
|
6827
|
+
qx as g,
|
|
6827
6828
|
Uy as h,
|
|
6828
6829
|
Gy as i,
|
|
6829
|
-
|
|
6830
|
-
|
|
6830
|
+
Wx as j,
|
|
6831
|
+
ql as k,
|
|
6831
6832
|
nx as l,
|
|
6832
6833
|
ax as m,
|
|
6833
6834
|
ix as n,
|
|
6834
6835
|
Ng as o,
|
|
6835
|
-
|
|
6836
|
-
|
|
6836
|
+
Ux as p,
|
|
6837
|
+
Za as q,
|
|
6837
6838
|
dx as r,
|
|
6838
6839
|
Jg as s,
|
|
6839
6840
|
hx as t,
|
|
6840
6841
|
px as u,
|
|
6841
6842
|
yx as v,
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6843
|
+
Fx as w,
|
|
6844
|
+
Qx as x,
|
|
6845
|
+
Gx as y,
|
|
6846
|
+
Vx as z
|
|
6846
6847
|
};
|