@aiquants/markdown-explorer 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -1
- package/README.md +53 -16
- package/dist/{ExplorerSplit-DwEFmvQM.js → ExplorerSplit-B7pmzR8t.js} +3 -3
- package/dist/{ExplorerSplit-BESGFcu6.cjs → ExplorerSplit-Bi3yU6NG.cjs} +1 -1
- package/dist/MultiLayout-BxeXOLX1.js +909 -0
- package/dist/MultiLayout-DtFrFRmS.cjs +1 -0
- package/dist/TreeLayout-BQUfVNlA.cjs +1 -0
- package/dist/TreeLayout-D6hCSihW.js +22 -0
- package/dist/core/config.d.cts +8 -0
- package/dist/core/config.d.ts +8 -0
- package/dist/core/labels.d.cts +6 -1
- package/dist/core/labels.d.ts +6 -1
- package/dist/{dataRoute-CKbdwkQ7.cjs → dataRoute-B9Wk-G7A.cjs} +1 -1
- package/dist/{dataRoute-Bkfwfp1R.js → dataRoute-zUX-oR9j.js} +39 -38
- package/dist/{index-BgkZ9ATV.js → index-BJTmp0lR.js} +947 -901
- package/dist/index-DkiGlM7C.cjs +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -13
- package/dist/location-DfYTzfFS.cjs +1 -0
- package/dist/{location-Cb2Ak55B.js → location-V5BKeWNs.js} +189 -162
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +196 -206
- package/dist/server/anonymous.d.cts +2 -2
- package/dist/server/anonymous.d.ts +2 -2
- package/dist/server/ports.d.cts +4 -1
- package/dist/server/ports.d.ts +4 -1
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +631 -603
- package/dist/styles/markdown-explorer.css +1 -1
- package/docs/behavior/dom-hooks.md +4 -4
- package/docs/behavior/layout.md +21 -9
- package/docs/behavior/localization.md +4 -3
- package/docs/behavior/security.md +23 -5
- package/docs/behavior/url-contract.md +8 -2
- package/package.json +5 -5
- package/dist/MultiLayout-DxPiARsv.js +0 -896
- package/dist/MultiLayout-r_qx1Mfz.cjs +0 -1
- package/dist/TreeLayout-9-20bbSM.cjs +0 -1
- package/dist/TreeLayout-CW7lgV_e.js +0 -19
- package/dist/index-y9tVvDW7.cjs +0 -3
- package/dist/location-DWHQYntR.cjs +0 -1
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { jsx as d, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { f as
|
|
6
|
-
import { useMarkdownToolbarState as
|
|
7
|
-
import { i as
|
|
8
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
9
|
-
import { w as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as d, jsxs as U, Fragment as Ft } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { createContext as ne, use as W, useMemo as I, useSyncExternalStore as te, useCallback as $, useRef as H, useEffect as Y, useState as Z, useLayoutEffect as V, Suspense as Ae, useEffectEvent as Q, useId as Pt, lazy as ft } from "react";
|
|
4
|
+
import { useParams as qt, useSearchParams as _t, useNavigate as jt, Link as Bt, useHref as he, useLocation as mt, useRevalidator as zt } from "react-router";
|
|
5
|
+
import { f as Ht, a as It, u as Zt, G as se, e as le, x as Ut, y as Vt, z as Be, B as Wt, D as ze, H as Kt, w as Gt, I as Xt } from "./location-V5BKeWNs.js";
|
|
6
|
+
import { useMarkdownToolbarState as Yt, MarkdownViewer as gt } from "@aiquants/markdown";
|
|
7
|
+
import { i as Jt, v as ht, s as oe, q as Qt, w as He, x as en, y as tn, f as nn, z as Ie, p as rn, t as on, A as ln, o as sn } from "./dataRoute-zUX-oR9j.js";
|
|
8
|
+
import { DEFAULT_CONTENT_ALIGN as an } from "@aiquants/markdown/viewer-settings";
|
|
9
|
+
import { w as cn, r as dn, a as un, b as Ze, s as fn, c as mn } from "./storage-DA4ItHzl.js";
|
|
10
|
+
const Ue = Object.freeze(["en", "ja"]), gn = "en", hn = Object.freeze({
|
|
11
11
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
12
12
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
13
13
|
panelDragStarted: Object.freeze(["title"]),
|
|
14
14
|
panelDragCancelled: Object.freeze(["title"]),
|
|
15
15
|
multiColumnRegion: Object.freeze(["column"])
|
|
16
|
-
}),
|
|
16
|
+
}), pn = /\{(\w+)\}/gu, pt = {
|
|
17
17
|
explorerRegion: "Explorer",
|
|
18
18
|
sourceLabel: "Source",
|
|
19
|
-
|
|
19
|
+
refreshTreeLabel: "Refresh tree",
|
|
20
20
|
refreshTree: "Reload the tree and the open documents from the source",
|
|
21
21
|
treeRefreshed: "Reloaded the tree from the source",
|
|
22
22
|
treeRefreshFailed: (e) => `Could not reload the tree: ${e}`,
|
|
23
|
+
refreshDocumentLabel: "Refresh document",
|
|
23
24
|
refreshDocument: "Reload the document from the source",
|
|
25
|
+
refreshDocumentNamed: (e) => `Refresh ${e}`,
|
|
24
26
|
documentRefreshed: (e) => `Reloaded ${e}`,
|
|
25
27
|
documentRefreshFailed: (e) => `Could not reload the document: ${e}`,
|
|
26
28
|
expandAll: "Expand all folders",
|
|
@@ -145,6 +147,9 @@ const Ve = Object.freeze(["en", "ja"]), un = "en", fn = Object.freeze({
|
|
|
145
147
|
viewerMermaidZoomOut: "Zoom Out",
|
|
146
148
|
viewerMermaidResetView: "Reset View",
|
|
147
149
|
viewerMermaidRetry: "Try again",
|
|
150
|
+
viewerEmbeddedVideo: "embedded video",
|
|
151
|
+
viewerEmbeddedPost: "embedded post",
|
|
152
|
+
viewerEmbeddedFrame: "Embedded content",
|
|
148
153
|
multiRegion: "Panels",
|
|
149
154
|
multiEmpty: "Select documents in the explorer to open them side by side.",
|
|
150
155
|
panelLimit: (e) => `You can open up to ${String(e)} panels at once.`,
|
|
@@ -176,14 +181,16 @@ const Ve = Object.freeze(["en", "ja"]), un = "en", fn = Object.freeze({
|
|
|
176
181
|
multiColumnEmpty: "This column is empty",
|
|
177
182
|
multiColumnRegion: "Column {column}",
|
|
178
183
|
panelDropHere: "Drop the panel here"
|
|
179
|
-
},
|
|
184
|
+
}, wn = {
|
|
180
185
|
explorerRegion: "エクスプローラー",
|
|
181
186
|
sourceLabel: "ソース",
|
|
182
|
-
|
|
187
|
+
refreshTreeLabel: "ツリーを更新",
|
|
183
188
|
refreshTree: "ソースからツリーと開いている文書を読み込み直す",
|
|
184
189
|
treeRefreshed: "ツリーをソースから読み込み直しました",
|
|
185
190
|
treeRefreshFailed: (e) => `ツリーを読み込み直せませんでした: ${e}`,
|
|
191
|
+
refreshDocumentLabel: "文書を更新",
|
|
186
192
|
refreshDocument: "ソースから文書を読み込み直す",
|
|
193
|
+
refreshDocumentNamed: (e) => `${e} を更新`,
|
|
187
194
|
documentRefreshed: (e) => `${e} を読み込み直しました`,
|
|
188
195
|
documentRefreshFailed: (e) => `文書を読み込み直せませんでした: ${e}`,
|
|
189
196
|
expandAll: "すべてのフォルダーを展開",
|
|
@@ -308,6 +315,9 @@ const Ve = Object.freeze(["en", "ja"]), un = "en", fn = Object.freeze({
|
|
|
308
315
|
viewerMermaidZoomOut: "縮小",
|
|
309
316
|
viewerMermaidResetView: "表示を元に戻す",
|
|
310
317
|
viewerMermaidRetry: "再試行",
|
|
318
|
+
viewerEmbeddedVideo: "埋め込みの動画",
|
|
319
|
+
viewerEmbeddedPost: "埋め込みの投稿",
|
|
320
|
+
viewerEmbeddedFrame: "埋め込みのコンテンツ",
|
|
311
321
|
multiRegion: "パネル",
|
|
312
322
|
multiEmpty: "エクスプローラーで文書を選ぶと、ここに並べて開きます。",
|
|
313
323
|
panelLimit: (e) => `同時に開けるのは ${String(e)} パネルまでです。`,
|
|
@@ -339,88 +349,66 @@ const Ve = Object.freeze(["en", "ja"]), un = "en", fn = Object.freeze({
|
|
|
339
349
|
multiColumnEmpty: "この列は空です",
|
|
340
350
|
multiColumnRegion: "{column} 列目",
|
|
341
351
|
panelDropHere: "ここへパネルをドロップ"
|
|
342
|
-
},
|
|
343
|
-
en: Object.freeze(
|
|
344
|
-
ja: Object.freeze(
|
|
345
|
-
}),
|
|
346
|
-
if (e === void 0) return
|
|
347
|
-
if (
|
|
348
|
-
throw new RangeError(`[markdown-explorer] locale is the UI language (${
|
|
349
|
-
},
|
|
350
|
-
const n =
|
|
352
|
+
}, vn = Object.freeze({
|
|
353
|
+
en: Object.freeze(pt),
|
|
354
|
+
ja: Object.freeze(wn)
|
|
355
|
+
}), wt = Object.freeze(Object.keys(pt)), bn = new Set(wt), En = (e) => bn.has(e), de = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, vt = (e) => {
|
|
356
|
+
if (e === void 0) return gn;
|
|
357
|
+
if (Ue.includes(e)) return e;
|
|
358
|
+
throw new RangeError(`[markdown-explorer] locale is the UI language (${Ue.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${de(e)}`);
|
|
359
|
+
}, Ve = (e, t) => {
|
|
360
|
+
const n = vn[vt(e)];
|
|
351
361
|
if (t === void 0) return n;
|
|
352
362
|
if (t === null || typeof t != "object")
|
|
353
363
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${de(t)}`);
|
|
354
|
-
if (!
|
|
364
|
+
if (!Ht(t))
|
|
355
365
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${de(t)}`);
|
|
356
366
|
const r = t, o = { ...n };
|
|
357
|
-
for (const
|
|
358
|
-
if (!
|
|
359
|
-
throw new RangeError(`[markdown-explorer] labels.${
|
|
360
|
-
const
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
363
|
-
if (typeof
|
|
364
|
-
throw new TypeError(`[markdown-explorer] labels.${
|
|
365
|
-
if (typeof
|
|
366
|
-
throw new RangeError(`[markdown-explorer] labels.${
|
|
367
|
-
const
|
|
368
|
-
if (typeof
|
|
369
|
-
for (const [,
|
|
370
|
-
if (!
|
|
371
|
-
throw new RangeError(`[markdown-explorer] labels.${
|
|
367
|
+
for (const l of Object.keys(r)) {
|
|
368
|
+
if (!En(l))
|
|
369
|
+
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${wt.join(", ")}`);
|
|
370
|
+
const s = r[l];
|
|
371
|
+
if (s === void 0) continue;
|
|
372
|
+
const a = typeof n[l];
|
|
373
|
+
if (typeof s !== a)
|
|
374
|
+
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${a}; got ${de(s)}`);
|
|
375
|
+
if (typeof s == "string" && s.trim() === "")
|
|
376
|
+
throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
|
|
377
|
+
const f = hn[l];
|
|
378
|
+
if (typeof s == "string" && f !== void 0) {
|
|
379
|
+
for (const [, h] of s.matchAll(pn))
|
|
380
|
+
if (!f.includes(h ?? ""))
|
|
381
|
+
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(h)}}; it accepts ${f.map((m) => `{${m}}`).join(", ")}`);
|
|
372
382
|
}
|
|
373
|
-
o[
|
|
383
|
+
o[l] = s;
|
|
374
384
|
}
|
|
375
385
|
return Object.freeze(o);
|
|
376
|
-
},
|
|
386
|
+
}, Sn = (e, t) => {
|
|
377
387
|
if (Object.is(e, t)) return !0;
|
|
378
388
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
379
|
-
const n = e, r = t, o = Object.keys(n),
|
|
380
|
-
return o.length ===
|
|
381
|
-
},
|
|
389
|
+
const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
|
|
390
|
+
return o.length === l.length && l.every((s) => Object.hasOwn(n, s) && Object.is(n[s], r[s]));
|
|
391
|
+
}, We = Object.freeze(["light", "dark"]), yn = (e) => {
|
|
382
392
|
if (e === void 0) return "light";
|
|
383
|
-
if (
|
|
384
|
-
throw new RangeError(`[markdown-explorer] theme must be ${
|
|
385
|
-
},
|
|
386
|
-
const e = W(
|
|
393
|
+
if (We.includes(e)) return e;
|
|
394
|
+
throw new RangeError(`[markdown-explorer] theme must be ${We.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
395
|
+
}, bt = ne(null), D = () => {
|
|
396
|
+
const e = W(bt);
|
|
387
397
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
388
398
|
return e;
|
|
389
399
|
}, fe = (e) => {
|
|
390
400
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
391
|
-
return
|
|
392
|
-
},
|
|
393
|
-
const { config: e } = D(), t =
|
|
394
|
-
return
|
|
401
|
+
return te(t.subscribe, n, n);
|
|
402
|
+
}, $e = () => {
|
|
403
|
+
const { config: e } = D(), t = qt()["*"], [n] = _t(), r = n.toString();
|
|
404
|
+
return I(() => It(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
395
405
|
};
|
|
396
|
-
function
|
|
406
|
+
function xn({
|
|
397
407
|
title: e,
|
|
398
408
|
titleId: t,
|
|
399
409
|
...n
|
|
400
410
|
}, r) {
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
403
|
-
viewBox: "0 0 24 24",
|
|
404
|
-
fill: "currentColor",
|
|
405
|
-
"aria-hidden": "true",
|
|
406
|
-
"data-slot": "icon",
|
|
407
|
-
ref: r,
|
|
408
|
-
"aria-labelledby": t
|
|
409
|
-
}, n), e ? /* @__PURE__ */ y.createElement("title", {
|
|
410
|
-
id: t
|
|
411
|
-
}, e) : null, /* @__PURE__ */ y.createElement("path", {
|
|
412
|
-
fillRule: "evenodd",
|
|
413
|
-
d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
|
|
414
|
-
clipRule: "evenodd"
|
|
415
|
-
}));
|
|
416
|
-
}
|
|
417
|
-
const Sn = /* @__PURE__ */ y.forwardRef(En);
|
|
418
|
-
function yn({
|
|
419
|
-
title: e,
|
|
420
|
-
titleId: t,
|
|
421
|
-
...n
|
|
422
|
-
}, r) {
|
|
423
|
-
return /* @__PURE__ */ y.createElement("svg", Object.assign({
|
|
411
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
424
412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
425
413
|
viewBox: "0 0 20 20",
|
|
426
414
|
fill: "currentColor",
|
|
@@ -428,28 +416,28 @@ function yn({
|
|
|
428
416
|
"data-slot": "icon",
|
|
429
417
|
ref: r,
|
|
430
418
|
"aria-labelledby": t
|
|
431
|
-
}, n), e ? /* @__PURE__ */
|
|
419
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
432
420
|
id: t
|
|
433
|
-
}, e) : null, /* @__PURE__ */
|
|
421
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
434
422
|
fillRule: "evenodd",
|
|
435
423
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
436
424
|
clipRule: "evenodd"
|
|
437
425
|
}));
|
|
438
426
|
}
|
|
439
|
-
const
|
|
427
|
+
const kn = /* @__PURE__ */ x.forwardRef(xn), De = Object.freeze({
|
|
440
428
|
browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
441
429
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
442
430
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
443
431
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
444
|
-
}),
|
|
445
|
-
const e =
|
|
432
|
+
}), jo = (e) => De[e], Fe = () => {
|
|
433
|
+
const e = jt();
|
|
446
434
|
return $(
|
|
447
435
|
(t, n) => {
|
|
448
436
|
e(t, De[n]);
|
|
449
437
|
},
|
|
450
438
|
[e]
|
|
451
439
|
);
|
|
452
|
-
},
|
|
440
|
+
}, Rn = ({ navigation: e, ...t }) => /* @__PURE__ */ d(Bt, { ...t, ...De[e] }), Et = {
|
|
453
441
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
454
442
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
455
443
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -458,14 +446,14 @@ const xn = /* @__PURE__ */ y.forwardRef(yn), De = Object.freeze({
|
|
|
458
446
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
459
447
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
460
448
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
461
|
-
},
|
|
462
|
-
const { labels: o } = D(),
|
|
463
|
-
return /* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */ d("p", { className: "aqmx-callout-title", children:
|
|
465
|
-
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children:
|
|
449
|
+
}, pe = (e, t) => e[Et[t][0]], Tn = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
450
|
+
const { labels: o } = D(), l = pe(o, e.reason), s = o[Et[e.reason][1]], a = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
451
|
+
return /* @__PURE__ */ U("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": a, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
452
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: l }),
|
|
453
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: s }),
|
|
466
454
|
e.reason === "unauthorized" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
467
455
|
] });
|
|
468
|
-
},
|
|
456
|
+
}, St = (e) => {
|
|
469
457
|
const t = e.ownerDocument;
|
|
470
458
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
471
459
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -475,52 +463,52 @@ const xn = /* @__PURE__ */ y.forwardRef(yn), De = Object.freeze({
|
|
|
475
463
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
476
464
|
};
|
|
477
465
|
return e.addEventListener("blur", n), !0;
|
|
478
|
-
},
|
|
479
|
-
const n =
|
|
466
|
+
}, An = (e, t) => {
|
|
467
|
+
const n = H(null), r = H(null), o = H(null), l = $(() => {
|
|
480
468
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
481
469
|
}, []);
|
|
482
|
-
Y(() =>
|
|
483
|
-
const
|
|
484
|
-
(
|
|
485
|
-
if (r.current !==
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
|
|
470
|
+
Y(() => l, [l]);
|
|
471
|
+
const s = $(
|
|
472
|
+
(h) => {
|
|
473
|
+
if (r.current !== h) return;
|
|
474
|
+
const m = o.current;
|
|
475
|
+
if (m !== null) {
|
|
476
|
+
m.then(() => s(h));
|
|
489
477
|
return;
|
|
490
478
|
}
|
|
491
|
-
e.prefetch(
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
const
|
|
495
|
-
o.current =
|
|
496
|
-
o.current ===
|
|
479
|
+
e.prefetch(h);
|
|
480
|
+
const g = e.peek(h);
|
|
481
|
+
if (g?.status !== "pending") return;
|
|
482
|
+
const b = Promise.allSettled([g.promise]);
|
|
483
|
+
o.current = b, b.then(() => {
|
|
484
|
+
o.current === b && (o.current = null);
|
|
497
485
|
});
|
|
498
486
|
},
|
|
499
487
|
[e]
|
|
500
|
-
),
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
n.current = null,
|
|
505
|
-
},
|
|
488
|
+
), a = $(
|
|
489
|
+
(h) => {
|
|
490
|
+
const m = t(h);
|
|
491
|
+
m !== r.current && (l(), m !== null && (r.current = m, n.current = window.setTimeout(() => {
|
|
492
|
+
n.current = null, s(m);
|
|
493
|
+
}, Zt)));
|
|
506
494
|
},
|
|
507
|
-
[
|
|
508
|
-
),
|
|
509
|
-
(
|
|
510
|
-
t(
|
|
495
|
+
[l, t, s]
|
|
496
|
+
), f = $(
|
|
497
|
+
(h) => {
|
|
498
|
+
t(h) !== r.current && l();
|
|
511
499
|
},
|
|
512
|
-
[
|
|
500
|
+
[l, t]
|
|
513
501
|
);
|
|
514
|
-
return
|
|
502
|
+
return I(
|
|
515
503
|
() => ({
|
|
516
|
-
onPointerOver: (
|
|
517
|
-
onPointerOut: (
|
|
518
|
-
onFocus: (
|
|
519
|
-
onBlur: (
|
|
504
|
+
onPointerOver: (h) => a(h.target),
|
|
505
|
+
onPointerOut: (h) => f(h.relatedTarget),
|
|
506
|
+
onFocus: (h) => a(h.target),
|
|
507
|
+
onBlur: (h) => f(h.relatedTarget)
|
|
520
508
|
}),
|
|
521
|
-
[
|
|
509
|
+
[a, f]
|
|
522
510
|
);
|
|
523
|
-
},
|
|
511
|
+
}, we = () => {
|
|
524
512
|
const e = /* @__PURE__ */ new Set();
|
|
525
513
|
return {
|
|
526
514
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -530,7 +518,7 @@ const xn = /* @__PURE__ */ y.forwardRef(yn), De = Object.freeze({
|
|
|
530
518
|
for (const t of [...e]) t();
|
|
531
519
|
}
|
|
532
520
|
};
|
|
533
|
-
},
|
|
521
|
+
}, yt = () => {
|
|
534
522
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
535
523
|
let n = !1;
|
|
536
524
|
const r = (o) => {
|
|
@@ -541,13 +529,13 @@ const xn = /* @__PURE__ */ y.forwardRef(yn), De = Object.freeze({
|
|
|
541
529
|
return {
|
|
542
530
|
hold: (o) => {
|
|
543
531
|
e.set(o, (e.get(o) ?? 0) + 1);
|
|
544
|
-
let
|
|
532
|
+
let l = !1;
|
|
545
533
|
return () => {
|
|
546
|
-
if (
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
if (
|
|
550
|
-
e.set(o,
|
|
534
|
+
if (l) return;
|
|
535
|
+
l = !0;
|
|
536
|
+
const s = e.get(o);
|
|
537
|
+
if (s !== void 0 && s > 1) {
|
|
538
|
+
e.set(o, s - 1);
|
|
551
539
|
return;
|
|
552
540
|
}
|
|
553
541
|
e.delete(o), r(o);
|
|
@@ -561,9 +549,9 @@ const xn = /* @__PURE__ */ y.forwardRef(yn), De = Object.freeze({
|
|
|
561
549
|
if (Object.is(e, t)) return !0;
|
|
562
550
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
563
551
|
if (Array.isArray(e) || Array.isArray(t))
|
|
564
|
-
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((
|
|
552
|
+
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((l, s) => me(l, t[s]));
|
|
565
553
|
const n = e, r = t, o = Object.keys(n);
|
|
566
|
-
return o.length !== Object.keys(r).length ? !1 : o.every((
|
|
554
|
+
return o.length !== Object.keys(r).length ? !1 : o.every((l) => Object.hasOwn(r, l) && me(n[l], r[l]));
|
|
567
555
|
}, ie = (e) => {
|
|
568
556
|
const t = e;
|
|
569
557
|
return t.status === void 0 && (t.status = "pending", e.then(
|
|
@@ -574,128 +562,131 @@ const xn = /* @__PURE__ */ y.forwardRef(yn), De = Object.freeze({
|
|
|
574
562
|
t.status = "rejected", t.reason = n;
|
|
575
563
|
}
|
|
576
564
|
)), t;
|
|
577
|
-
},
|
|
565
|
+
}, xt = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), ae = (e) => e.status === "fulfilled" ? e.value : void 0, On = 55e3, Ke = Object.freeze({ status: "deferred" }), Ge = Object.freeze({ status: "refreshed" }), ke = Object.freeze({ status: "superseded" }), ge = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, kt = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Ln = ({ client: e, capacity: t }) => {
|
|
578
566
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
579
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
567
|
+
const n = /* @__PURE__ */ new Map(), r = yt(), o = we(), l = /* @__PURE__ */ new WeakSet();
|
|
568
|
+
let s = 0;
|
|
569
|
+
const a = o.emit, f = () => (s += 1, s), h = () => {
|
|
580
570
|
if (!(n.size <= t))
|
|
581
571
|
for (const u of [...n.keys()]) {
|
|
582
572
|
if (n.size <= t) return;
|
|
583
573
|
r.isHeld(u) || n.delete(u);
|
|
584
574
|
}
|
|
585
|
-
},
|
|
586
|
-
n.delete(u), n.set(u,
|
|
587
|
-
},
|
|
588
|
-
const
|
|
589
|
-
return
|
|
590
|
-
n.get(u) ===
|
|
591
|
-
}),
|
|
592
|
-
},
|
|
593
|
-
|
|
594
|
-
},
|
|
595
|
-
const
|
|
596
|
-
if (
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
return
|
|
603
|
-
},
|
|
604
|
-
const { snapshot:
|
|
605
|
-
return
|
|
606
|
-
},
|
|
607
|
-
const
|
|
608
|
-
let
|
|
575
|
+
}, m = (u, p) => {
|
|
576
|
+
n.delete(u), n.set(u, p);
|
|
577
|
+
}, g = (u) => performance.now() - u.validatedAt >= On, b = (u, p, S) => {
|
|
578
|
+
const E = n.get(u), y = ge(E?.snapshot), P = S || E?.refreshPending === !0, z = ie(e.document(u, { refresh: P }).then((j) => ({ status: "loaded", document: j }))), M = { snapshot: { status: "pending", promise: z, previous: y }, validatedAt: performance.now(), opened: p, background: null, refreshPending: !1, seeded: void 0, stamp: f() };
|
|
579
|
+
return m(u, M), h(), z.then((j) => {
|
|
580
|
+
n.get(u) === M && (M.snapshot = j, M.stamp = f(), a());
|
|
581
|
+
}), M;
|
|
582
|
+
}, R = (u, p, S, E, y, P) => {
|
|
583
|
+
p.background === S && (p.background = null, !(n.get(u) !== p || p.snapshot !== E) && (y.kind === "failure" && E.document.kind !== "failure" || (p.validatedAt = P, p.stamp = f(), me(E.document, y) || (p.snapshot = { status: "loaded", document: y }), a())));
|
|
584
|
+
}, k = async (u, p) => {
|
|
585
|
+
const S = p.snapshot;
|
|
586
|
+
if (S.status !== "loaded") return null;
|
|
587
|
+
const E = {};
|
|
588
|
+
p.background = E;
|
|
589
|
+
const y = performance.now(), P = e.document(u, { refresh: p.refreshPending });
|
|
590
|
+
p.refreshPending = !1;
|
|
591
|
+
const z = await P, M = p.background === E && n.get(u) === p && p.snapshot === S;
|
|
592
|
+
return R(u, p, E, S, z, y), M ? z : null;
|
|
593
|
+
}, A = (u, p) => {
|
|
594
|
+
const { snapshot: S } = p;
|
|
595
|
+
return S.status === "pending" ? !1 : S.status === "loaded" && S.document.kind !== "failure" ? (k(u, p), !1) : (S.status === "loaded" && l.add(S), b(u, !0, !1), !0);
|
|
596
|
+
}, T = (u) => {
|
|
597
|
+
const p = r.hold(u);
|
|
598
|
+
let S = !1;
|
|
609
599
|
return () => {
|
|
610
|
-
if (
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
|
|
600
|
+
if (S) return;
|
|
601
|
+
S = !0, p();
|
|
602
|
+
const E = n.get(u);
|
|
603
|
+
E !== void 0 && m(u, E), h();
|
|
614
604
|
};
|
|
615
605
|
};
|
|
616
606
|
return {
|
|
617
607
|
peek: (u) => n.get(u)?.snapshot,
|
|
618
608
|
peekSeeded: (u) => n.get(u)?.seeded,
|
|
609
|
+
answerStampOf: (u) => n.get(u)?.stamp,
|
|
619
610
|
prefetch: (u) => {
|
|
620
|
-
const
|
|
621
|
-
|
|
611
|
+
const p = n.get(u);
|
|
612
|
+
p !== void 0 && p.snapshot.status !== "deferred" || (b(u, !1, !1), a());
|
|
622
613
|
},
|
|
623
614
|
open: (u) => {
|
|
624
|
-
const
|
|
625
|
-
if (
|
|
626
|
-
return
|
|
627
|
-
if (
|
|
628
|
-
const { snapshot:
|
|
629
|
-
return
|
|
615
|
+
const p = r.resumes(u), S = T(u), E = n.get(u);
|
|
616
|
+
if (E === void 0 || E.snapshot.status === "deferred")
|
|
617
|
+
return b(u, !0, !1), a(), S;
|
|
618
|
+
if (m(u, E), p) return S;
|
|
619
|
+
const { snapshot: y } = E;
|
|
620
|
+
return y.status === "pending" ? (E.opened = !0, S) : y.document.kind === "failure" ? (E.opened || g(E) ? (l.add(y), b(u, !0, !1), a()) : E.opened = !0, S) : (E.opened = !0, E.background === null && g(E) && k(u, E), S);
|
|
630
621
|
},
|
|
631
|
-
retain:
|
|
622
|
+
retain: T,
|
|
632
623
|
retry: (u) => {
|
|
633
|
-
const
|
|
634
|
-
|
|
624
|
+
const p = n.get(u);
|
|
625
|
+
p === void 0 || p.snapshot.status !== "loaded" || p.snapshot.document.kind !== "failure" || (b(u, !0, !1), a());
|
|
635
626
|
},
|
|
636
|
-
seed: (u,
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
(
|
|
640
|
-
() =>
|
|
627
|
+
seed: (u, p) => {
|
|
628
|
+
const S = performance.now(), E = ie(
|
|
629
|
+
p.then(
|
|
630
|
+
(j) => j === null ? Ke : { status: "loaded", document: j },
|
|
631
|
+
() => Ke
|
|
641
632
|
)
|
|
642
|
-
),
|
|
643
|
-
if (
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
if (
|
|
647
|
-
|
|
633
|
+
), y = n.get(u);
|
|
634
|
+
if (y !== void 0 && y.snapshot.status === "loaded") {
|
|
635
|
+
const j = y.snapshot, C = {};
|
|
636
|
+
y.background = C, E.then((q) => {
|
|
637
|
+
if (q.status === "loaded") {
|
|
638
|
+
R(u, y, C, j, q.document, S);
|
|
648
639
|
return;
|
|
649
640
|
}
|
|
650
|
-
|
|
641
|
+
y.background === C && (y.background = null);
|
|
651
642
|
});
|
|
652
643
|
return;
|
|
653
644
|
}
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
n.get(u) ===
|
|
645
|
+
const P = y !== void 0 && y.snapshot.status === "pending" ? y.snapshot.previous : null, z = { status: "pending", promise: E, previous: P }, M = { snapshot: z, validatedAt: S, opened: y?.opened === !0, background: null, refreshPending: y?.refreshPending === !0, seeded: z, stamp: f() };
|
|
646
|
+
m(u, M), h(), E.then((j) => {
|
|
647
|
+
n.get(u) === M && (j.status === "deferred" && r.isHeld(u) ? b(u, M.opened, !1) : (M.snapshot = j, M.stamp = f()), a());
|
|
657
648
|
});
|
|
658
649
|
},
|
|
659
650
|
invalidate: () => {
|
|
660
651
|
let u = !1;
|
|
661
|
-
for (const [
|
|
662
|
-
if (
|
|
663
|
-
const { snapshot:
|
|
664
|
-
if (
|
|
665
|
-
|
|
652
|
+
for (const [p, S] of [...n]) {
|
|
653
|
+
if (S.validatedAt = Number.NEGATIVE_INFINITY, S.opened = !0, S.refreshPending = !0, !r.isHeld(p)) continue;
|
|
654
|
+
const { snapshot: E } = S;
|
|
655
|
+
if (E.status !== "pending") {
|
|
656
|
+
A(p, S) && (u = !0);
|
|
666
657
|
continue;
|
|
667
658
|
}
|
|
668
|
-
|
|
669
|
-
n.get(
|
|
659
|
+
E.promise.then(() => {
|
|
660
|
+
n.get(p) === S && S.refreshPending && r.isHeld(p) && A(p, S) && a();
|
|
670
661
|
});
|
|
671
662
|
}
|
|
672
|
-
u &&
|
|
663
|
+
u && a();
|
|
673
664
|
},
|
|
674
665
|
refresh: async (u) => {
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
return
|
|
666
|
+
const p = n.get(u);
|
|
667
|
+
if (p !== void 0 && kt(p.snapshot)) {
|
|
668
|
+
p.refreshPending = !0;
|
|
669
|
+
const E = await k(u, p);
|
|
670
|
+
return E === null ? ke : E.kind === "failure" ? { status: "failed", failure: E.failure } : Ge;
|
|
680
671
|
}
|
|
681
|
-
const
|
|
682
|
-
return
|
|
672
|
+
const S = b(u, !0, !0);
|
|
673
|
+
return a(), S.snapshot.status !== "pending" ? ke : (await S.snapshot.promise, n.get(u) === S ? Ge : ke);
|
|
683
674
|
},
|
|
684
675
|
clear: () => {
|
|
685
676
|
n.clear();
|
|
686
|
-
for (const u of r.heldKeys())
|
|
687
|
-
|
|
677
|
+
for (const u of r.heldKeys()) b(u, !0, !1);
|
|
678
|
+
a();
|
|
688
679
|
},
|
|
689
680
|
subscribe: o.subscribe,
|
|
690
|
-
noteFailureShown: (u) =>
|
|
681
|
+
noteFailureShown: (u) => l.has(u) ? !1 : (l.add(u), !0)
|
|
691
682
|
};
|
|
692
683
|
};
|
|
693
|
-
function
|
|
684
|
+
function Mn({
|
|
694
685
|
title: e,
|
|
695
686
|
titleId: t,
|
|
696
687
|
...n
|
|
697
688
|
}, r) {
|
|
698
|
-
return /* @__PURE__ */
|
|
689
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
699
690
|
xmlns: "http://www.w3.org/2000/svg",
|
|
700
691
|
viewBox: "0 0 20 20",
|
|
701
692
|
fill: "currentColor",
|
|
@@ -703,21 +694,21 @@ function Ln({
|
|
|
703
694
|
"data-slot": "icon",
|
|
704
695
|
ref: r,
|
|
705
696
|
"aria-labelledby": t
|
|
706
|
-
}, n), e ? /* @__PURE__ */
|
|
697
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
707
698
|
id: t
|
|
708
|
-
}, e) : null, /* @__PURE__ */
|
|
699
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
709
700
|
d: "M10.75 2.75a.75.75 0 0 0-1.5 0v8.614L6.295 8.235a.75.75 0 1 0-1.09 1.03l4.25 4.5a.75.75 0 0 0 1.09 0l4.25-4.5a.75.75 0 0 0-1.09-1.03l-2.955 3.129V2.75Z"
|
|
710
|
-
}), /* @__PURE__ */
|
|
701
|
+
}), /* @__PURE__ */ x.createElement("path", {
|
|
711
702
|
d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z"
|
|
712
703
|
}));
|
|
713
704
|
}
|
|
714
|
-
const
|
|
715
|
-
function
|
|
705
|
+
const Cn = /* @__PURE__ */ x.forwardRef(Mn);
|
|
706
|
+
function Nn({
|
|
716
707
|
title: e,
|
|
717
708
|
titleId: t,
|
|
718
709
|
...n
|
|
719
710
|
}, r) {
|
|
720
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
721
712
|
xmlns: "http://www.w3.org/2000/svg",
|
|
722
713
|
viewBox: "0 0 20 20",
|
|
723
714
|
fill: "currentColor",
|
|
@@ -725,34 +716,34 @@ function Cn({
|
|
|
725
716
|
"data-slot": "icon",
|
|
726
717
|
ref: r,
|
|
727
718
|
"aria-labelledby": t
|
|
728
|
-
}, n), e ? /* @__PURE__ */
|
|
719
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
729
720
|
id: t
|
|
730
|
-
}, e) : null, /* @__PURE__ */
|
|
721
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
731
722
|
fillRule: "evenodd",
|
|
732
723
|
d: "M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",
|
|
733
724
|
clipRule: "evenodd"
|
|
734
|
-
}), /* @__PURE__ */
|
|
725
|
+
}), /* @__PURE__ */ x.createElement("path", {
|
|
735
726
|
fillRule: "evenodd",
|
|
736
727
|
d: "M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",
|
|
737
728
|
clipRule: "evenodd"
|
|
738
729
|
}));
|
|
739
730
|
}
|
|
740
|
-
const
|
|
731
|
+
const $n = /* @__PURE__ */ x.forwardRef(Nn), ve = ({ name: e, url: t, icon: n, children: r }) => {
|
|
741
732
|
const { labels: o } = D();
|
|
742
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ U("div", { className: "aqmx-document-toolbar", children: [
|
|
743
734
|
/* @__PURE__ */ d("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: n }),
|
|
744
735
|
/* @__PURE__ */ d("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
745
736
|
r,
|
|
746
|
-
/* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ d(
|
|
747
|
-
/* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ d(
|
|
737
|
+
/* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ d($n, {}) }),
|
|
738
|
+
/* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ d(Cn, {}) })
|
|
748
739
|
] });
|
|
749
740
|
};
|
|
750
|
-
function
|
|
741
|
+
function Dn({
|
|
751
742
|
title: e,
|
|
752
743
|
titleId: t,
|
|
753
744
|
...n
|
|
754
745
|
}, r) {
|
|
755
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
756
747
|
xmlns: "http://www.w3.org/2000/svg",
|
|
757
748
|
viewBox: "0 0 20 20",
|
|
758
749
|
fill: "currentColor",
|
|
@@ -760,44 +751,52 @@ function $n({
|
|
|
760
751
|
"data-slot": "icon",
|
|
761
752
|
ref: r,
|
|
762
753
|
"aria-labelledby": t
|
|
763
|
-
}, n), e ? /* @__PURE__ */
|
|
754
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
764
755
|
id: t
|
|
765
|
-
}, e) : null, /* @__PURE__ */
|
|
756
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
766
757
|
fillRule: "evenodd",
|
|
767
758
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm4.75 6.75a.75.75 0 0 1 1.5 0v2.546l.943-1.048a.75.75 0 0 1 1.114 1.004l-2.25 2.5a.75.75 0 0 1-1.114 0l-2.25-2.5a.75.75 0 1 1 1.114-1.004l.943 1.048V8.75Z",
|
|
768
759
|
clipRule: "evenodd"
|
|
769
760
|
}));
|
|
770
761
|
}
|
|
771
|
-
const Fn = /* @__PURE__ */
|
|
762
|
+
const Fn = /* @__PURE__ */ x.forwardRef(Dn), Pn = ({ document: e }) => {
|
|
772
763
|
const { labels: t } = D();
|
|
773
|
-
return /* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */ d(
|
|
775
|
-
/* @__PURE__ */ d("div", { className: "aqmx-document-stage", children: /* @__PURE__ */
|
|
764
|
+
return /* @__PURE__ */ U("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
765
|
+
/* @__PURE__ */ d(ve, { name: e.name, url: e.url, icon: /* @__PURE__ */ d(Fn, {}) }),
|
|
766
|
+
/* @__PURE__ */ d("div", { className: "aqmx-document-stage", children: /* @__PURE__ */ U("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
776
767
|
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
777
768
|
/* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
778
769
|
] }) })
|
|
779
770
|
] });
|
|
780
|
-
},
|
|
771
|
+
}, Pe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", qn = (e) => {
|
|
781
772
|
const t = e.indexOf("#");
|
|
782
773
|
return t === -1 ? "" : e.slice(t);
|
|
783
|
-
},
|
|
774
|
+
}, _n = /(%[0-9A-Fa-f]{2})/u, qe = (e) => {
|
|
784
775
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
return null;
|
|
789
|
-
}
|
|
790
|
-
}, xt = (e) => `#${encodeURIComponent(e)}`, qn = (e) => {
|
|
776
|
+
const t = new TextEncoder(), n = e.slice(1).split(_n).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
777
|
+
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
778
|
+
}, Rt = (e) => `#${encodeURIComponent(e)}`, jn = (e) => {
|
|
791
779
|
if (e === "#") return !0;
|
|
792
|
-
const t =
|
|
780
|
+
const t = qe(e);
|
|
793
781
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
794
|
-
},
|
|
782
|
+
}, Tt = (e, t) => {
|
|
783
|
+
if (t === "") return null;
|
|
795
784
|
for (const n of e.querySelectorAll("[id]"))
|
|
796
785
|
if (n.id === t) return n;
|
|
797
786
|
return null;
|
|
798
|
-
},
|
|
799
|
-
|
|
800
|
-
|
|
787
|
+
}, Bn = "http://www.w3.org/1999/xhtml", Xe = (e, t) => {
|
|
788
|
+
if (t === "") return null;
|
|
789
|
+
const n = Tt(e, t);
|
|
790
|
+
if (n !== null) return n;
|
|
791
|
+
for (const r of e.querySelectorAll("a[name]"))
|
|
792
|
+
if (r.localName === "a" && r.namespaceURI === Bn && r.getAttribute("name") === t) return r;
|
|
793
|
+
return null;
|
|
794
|
+
}, At = (e, t) => {
|
|
795
|
+
if (e === null || !t.startsWith("#")) return null;
|
|
796
|
+
const n = Xe(e, t.slice(1));
|
|
797
|
+
if (n !== null) return n;
|
|
798
|
+
const r = qe(t);
|
|
799
|
+
return r === null ? null : Xe(e, r);
|
|
801
800
|
}, Ye = (e) => {
|
|
802
801
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
803
802
|
if (e === t) {
|
|
@@ -809,19 +808,19 @@ const Fn = /* @__PURE__ */ y.forwardRef($n), Dn = ({ document: e }) => {
|
|
|
809
808
|
}, zn = (e) => {
|
|
810
809
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
811
810
|
return o !== "hidden" && o !== "clip";
|
|
812
|
-
},
|
|
813
|
-
const n = t.closest(
|
|
811
|
+
}, Hn = (e, t) => {
|
|
812
|
+
const n = t.closest(Pe), r = n !== null && e.contains(n) ? n : e;
|
|
814
813
|
if (r.scrollHeight > r.clientHeight && Ye(r)) return r;
|
|
815
|
-
const o = e.getBoundingClientRect().height, { documentElement:
|
|
816
|
-
for (let
|
|
817
|
-
if (Ye(
|
|
818
|
-
return
|
|
819
|
-
},
|
|
820
|
-
scrollerOf:
|
|
814
|
+
const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: s } = e.ownerDocument;
|
|
815
|
+
for (let a = e.parentElement; a !== null && a !== l; a = a.parentElement)
|
|
816
|
+
if (Ye(a) && a.scrollHeight > a.clientHeight && a.clientHeight < o) return a;
|
|
817
|
+
return s instanceof Element && zn(e.ownerDocument) && s.scrollHeight > s.clientHeight && s.clientHeight < o ? s : r;
|
|
818
|
+
}, In = Object.freeze({
|
|
819
|
+
scrollerOf: Hn,
|
|
821
820
|
reveal: (e) => {
|
|
822
|
-
e.scrollIntoView(
|
|
821
|
+
e.scrollIntoView(Oe);
|
|
823
822
|
}
|
|
824
|
-
}),
|
|
823
|
+
}), Oe = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), Zn = (e, t) => {
|
|
825
824
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
826
825
|
const r = n.parentElement;
|
|
827
826
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -829,28 +828,28 @@ const Fn = /* @__PURE__ */ y.forwardRef($n), Dn = ({ document: e }) => {
|
|
|
829
828
|
n.removeAttribute("hidden");
|
|
830
829
|
}
|
|
831
830
|
}
|
|
832
|
-
},
|
|
831
|
+
}, Un = (e, t) => {
|
|
833
832
|
if (t.getClientRects().length === 0) return;
|
|
834
|
-
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t),
|
|
835
|
-
if (!
|
|
836
|
-
t.scrollIntoView(
|
|
833
|
+
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), s = t.getBoundingClientRect(), a = s.height + l + Number.parseFloat(o) > e.clientHeight;
|
|
834
|
+
if (!a && Math.abs(s.top - l - n) < 1) {
|
|
835
|
+
t.scrollIntoView(Oe);
|
|
837
836
|
return;
|
|
838
837
|
}
|
|
839
|
-
e.scrollBy({ top:
|
|
840
|
-
},
|
|
841
|
-
const n = t.scrollerOf(e, e.querySelector(
|
|
838
|
+
e.scrollBy({ top: a ? s.top - n - e.clientHeight : s.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Oe);
|
|
839
|
+
}, Vn = (e, t) => {
|
|
840
|
+
const n = t.scrollerOf(e, e.querySelector(Pe) ?? e);
|
|
842
841
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
843
842
|
}, Je = (e, t, n) => {
|
|
844
843
|
if (e === null) return null;
|
|
845
|
-
const r =
|
|
846
|
-
return r === null ? (
|
|
844
|
+
const r = At(e, t);
|
|
845
|
+
return r === null ? (jn(t) && Vn(e, n), null) : (Zn(e, r), Un(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
847
846
|
};
|
|
848
|
-
function
|
|
847
|
+
function Wn({
|
|
849
848
|
title: e,
|
|
850
849
|
titleId: t,
|
|
851
850
|
...n
|
|
852
851
|
}, r) {
|
|
853
|
-
return /* @__PURE__ */
|
|
852
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
854
853
|
xmlns: "http://www.w3.org/2000/svg",
|
|
855
854
|
viewBox: "0 0 20 20",
|
|
856
855
|
fill: "currentColor",
|
|
@@ -858,19 +857,19 @@ function Un({
|
|
|
858
857
|
"data-slot": "icon",
|
|
859
858
|
ref: r,
|
|
860
859
|
"aria-labelledby": t
|
|
861
|
-
}, n), e ? /* @__PURE__ */
|
|
860
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
862
861
|
id: t
|
|
863
|
-
}, e) : null, /* @__PURE__ */
|
|
862
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
864
863
|
d: "M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z"
|
|
865
864
|
}));
|
|
866
865
|
}
|
|
867
|
-
const
|
|
868
|
-
function
|
|
866
|
+
const Kn = /* @__PURE__ */ x.forwardRef(Wn);
|
|
867
|
+
function Gn({
|
|
869
868
|
title: e,
|
|
870
869
|
titleId: t,
|
|
871
870
|
...n
|
|
872
871
|
}, r) {
|
|
873
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
874
873
|
xmlns: "http://www.w3.org/2000/svg",
|
|
875
874
|
viewBox: "0 0 20 20",
|
|
876
875
|
fill: "currentColor",
|
|
@@ -878,23 +877,23 @@ function Wn({
|
|
|
878
877
|
"data-slot": "icon",
|
|
879
878
|
ref: r,
|
|
880
879
|
"aria-labelledby": t
|
|
881
|
-
}, n), e ? /* @__PURE__ */
|
|
880
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
882
881
|
id: t
|
|
883
|
-
}, e) : null, /* @__PURE__ */
|
|
882
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
884
883
|
d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
|
|
885
|
-
}), /* @__PURE__ */
|
|
884
|
+
}), /* @__PURE__ */ x.createElement("path", {
|
|
886
885
|
fillRule: "evenodd",
|
|
887
886
|
d: "M9 2a7 7 0 1 0 4.391 12.452l3.329 3.328a.75.75 0 1 0 1.06-1.06l-3.328-3.329A7 7 0 0 0 9 2ZM3.5 9a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",
|
|
888
887
|
clipRule: "evenodd"
|
|
889
888
|
}));
|
|
890
889
|
}
|
|
891
|
-
const
|
|
892
|
-
function
|
|
890
|
+
const Xn = /* @__PURE__ */ x.forwardRef(Gn);
|
|
891
|
+
function Yn({
|
|
893
892
|
title: e,
|
|
894
893
|
titleId: t,
|
|
895
894
|
...n
|
|
896
895
|
}, r) {
|
|
897
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
898
897
|
xmlns: "http://www.w3.org/2000/svg",
|
|
899
898
|
viewBox: "0 0 20 20",
|
|
900
899
|
fill: "currentColor",
|
|
@@ -902,23 +901,23 @@ function Gn({
|
|
|
902
901
|
"data-slot": "icon",
|
|
903
902
|
ref: r,
|
|
904
903
|
"aria-labelledby": t
|
|
905
|
-
}, n), e ? /* @__PURE__ */
|
|
904
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
906
905
|
id: t
|
|
907
|
-
}, e) : null, /* @__PURE__ */
|
|
906
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
908
907
|
d: "M9 6a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 9 6Z"
|
|
909
|
-
}), /* @__PURE__ */
|
|
908
|
+
}), /* @__PURE__ */ x.createElement("path", {
|
|
910
909
|
fillRule: "evenodd",
|
|
911
910
|
d: "M2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Zm7-5.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Z",
|
|
912
911
|
clipRule: "evenodd"
|
|
913
912
|
}));
|
|
914
913
|
}
|
|
915
|
-
const
|
|
916
|
-
function
|
|
914
|
+
const Jn = /* @__PURE__ */ x.forwardRef(Yn);
|
|
915
|
+
function Qn({
|
|
917
916
|
title: e,
|
|
918
917
|
titleId: t,
|
|
919
918
|
...n
|
|
920
919
|
}, r) {
|
|
921
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
922
921
|
xmlns: "http://www.w3.org/2000/svg",
|
|
923
922
|
viewBox: "0 0 20 20",
|
|
924
923
|
fill: "currentColor",
|
|
@@ -926,15 +925,15 @@ function Yn({
|
|
|
926
925
|
"data-slot": "icon",
|
|
927
926
|
ref: r,
|
|
928
927
|
"aria-labelledby": t
|
|
929
|
-
}, n), e ? /* @__PURE__ */
|
|
928
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
930
929
|
id: t
|
|
931
|
-
}, e) : null, /* @__PURE__ */
|
|
930
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
932
931
|
fillRule: "evenodd",
|
|
933
932
|
d: "M1 5.25A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm1.5 5.81v3.69c0 .414.336.75.75.75h13.5a.75.75 0 0 0 .75-.75v-2.69l-2.22-2.219a.75.75 0 0 0-1.06 0l-1.91 1.909.47.47a.75.75 0 1 1-1.06 1.06L6.53 8.091a.75.75 0 0 0-1.06 0l-2.97 2.97ZM12 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
|
|
934
933
|
clipRule: "evenodd"
|
|
935
934
|
}));
|
|
936
935
|
}
|
|
937
|
-
const
|
|
936
|
+
const er = /* @__PURE__ */ x.forwardRef(Qn), Le = "data-aqmx-key-repeat", Me = Object.freeze({ [Le]: "allow" }), tr = `[${Le}="${Me[Le]}"]`, nr = () => {
|
|
938
937
|
let e = null;
|
|
939
938
|
return {
|
|
940
939
|
onKeyDownCapture: (t) => {
|
|
@@ -943,7 +942,7 @@ const Jn = /* @__PURE__ */ y.forwardRef(Yn), Me = "data-aqmx-key-repeat", Ce = O
|
|
|
943
942
|
e = t.target instanceof Element ? t.target : null;
|
|
944
943
|
return;
|
|
945
944
|
}
|
|
946
|
-
e !== null && t.target === e && e.closest(
|
|
945
|
+
e !== null && t.target === e && e.closest(tr) !== null || (t.preventDefault(), t.stopPropagation());
|
|
947
946
|
}
|
|
948
947
|
},
|
|
949
948
|
onKeyUpCapture: (t) => {
|
|
@@ -953,7 +952,7 @@ const Jn = /* @__PURE__ */ y.forwardRef(Yn), Me = "data-aqmx-key-repeat", Ce = O
|
|
|
953
952
|
t.target === e && (e = null);
|
|
954
953
|
}
|
|
955
954
|
};
|
|
956
|
-
}, ue = Object.freeze([1 / se ** 2, 1 / se, 1, se, se ** 2]), Qe = Object.freeze({ mode: "fit" }),
|
|
955
|
+
}, ue = Object.freeze([1 / se ** 2, 1 / se, 1, se, se ** 2]), Qe = Object.freeze({ mode: "fit" }), rr = 1, or = ne(null), lr = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= rr ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, et = (e, t, n) => {
|
|
957
956
|
if (e.mode === "level") {
|
|
958
957
|
const o = e.index + n;
|
|
959
958
|
return o >= 0 && o < ue.length ? o : null;
|
|
@@ -969,37 +968,37 @@ const Jn = /* @__PURE__ */ y.forwardRef(Yn), Me = "data-aqmx-key-repeat", Ce = O
|
|
|
969
968
|
if (t === null) return null;
|
|
970
969
|
const r = et(e, t.scale, n);
|
|
971
970
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
972
|
-
},
|
|
971
|
+
}, ir = (e) => {
|
|
973
972
|
const t = ue[e];
|
|
974
973
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
975
974
|
return t;
|
|
976
|
-
}, nt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n },
|
|
977
|
-
const { labels: t } = D(), n = W(
|
|
978
|
-
const { naturalWidth:
|
|
979
|
-
|
|
980
|
-
}, []),
|
|
981
|
-
(
|
|
982
|
-
|
|
983
|
-
() =>
|
|
975
|
+
}, nt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, sr = ({ document: e }) => {
|
|
976
|
+
const { labels: t } = D(), n = W(or), [r] = Z(() => n === null ? null : n.read(e.url)), [o, l] = Z(r === null ? Qe : r.zoom), [s, a] = Z(r === null ? null : r.reported), [f, h] = Z(null), m = H(null), g = $((O) => {
|
|
977
|
+
const { naturalWidth: u, naturalHeight: p } = O;
|
|
978
|
+
a((S) => nt(S, u, p));
|
|
979
|
+
}, []), b = $(
|
|
980
|
+
(O) => {
|
|
981
|
+
m.current = O, !(O === null || !O.complete) && (O.naturalWidth > 0 || O.naturalHeight > 0 ? g(O) : O.decode().then(
|
|
982
|
+
() => g(O),
|
|
984
983
|
() => {
|
|
985
984
|
}
|
|
986
985
|
));
|
|
987
986
|
},
|
|
988
|
-
[
|
|
987
|
+
[g]
|
|
989
988
|
);
|
|
990
989
|
Y(() => {
|
|
991
|
-
n !== null &&
|
|
992
|
-
}, [n, e.url, o,
|
|
993
|
-
const
|
|
994
|
-
if (
|
|
995
|
-
const
|
|
996
|
-
if (
|
|
997
|
-
const
|
|
998
|
-
return
|
|
999
|
-
}, [
|
|
1000
|
-
const R =
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */
|
|
990
|
+
n !== null && s !== null && n.save(e.url, { zoom: o, reported: s });
|
|
991
|
+
}, [n, e.url, o, s]), V(() => {
|
|
992
|
+
const O = m.current;
|
|
993
|
+
if (O === null || s === null || o.mode !== "fit") return;
|
|
994
|
+
const u = () => h((S) => nt(S, O.clientWidth, O.clientHeight));
|
|
995
|
+
if (u(), typeof ResizeObserver > "u") return;
|
|
996
|
+
const p = new ResizeObserver(u);
|
|
997
|
+
return p.observe(O), () => p.disconnect();
|
|
998
|
+
}, [s, o.mode]);
|
|
999
|
+
const R = s === null || f === null ? null : lr(s, f), k = tt(o, R, -1), A = tt(o, R, 1), T = o.mode === "level" ? ir(o.index) : null, F = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1000
|
+
return /* @__PURE__ */ U("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1001
|
+
/* @__PURE__ */ U(ve, { name: e.name, url: e.url, icon: /* @__PURE__ */ d(er, {}), children: [
|
|
1003
1002
|
/* @__PURE__ */ d(
|
|
1004
1003
|
"button",
|
|
1005
1004
|
{
|
|
@@ -1007,15 +1006,15 @@ const Jn = /* @__PURE__ */ y.forwardRef(Yn), Me = "data-aqmx-key-repeat", Ce = O
|
|
|
1007
1006
|
className: "aqmx-icon-button",
|
|
1008
1007
|
"aria-label": t.imageZoomOut,
|
|
1009
1008
|
title: t.imageZoomOut,
|
|
1010
|
-
"aria-disabled":
|
|
1009
|
+
"aria-disabled": k === null,
|
|
1011
1010
|
onClick: () => {
|
|
1012
|
-
|
|
1011
|
+
k !== null && l(k);
|
|
1013
1012
|
},
|
|
1014
|
-
...
|
|
1015
|
-
children: /* @__PURE__ */ d(
|
|
1013
|
+
...Me,
|
|
1014
|
+
children: /* @__PURE__ */ d(Xn, {})
|
|
1016
1015
|
}
|
|
1017
1016
|
),
|
|
1018
|
-
/* @__PURE__ */ d("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children:
|
|
1017
|
+
/* @__PURE__ */ d("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
|
|
1019
1018
|
/* @__PURE__ */ d(
|
|
1020
1019
|
"button",
|
|
1021
1020
|
{
|
|
@@ -1025,88 +1024,89 @@ const Jn = /* @__PURE__ */ y.forwardRef(Yn), Me = "data-aqmx-key-repeat", Ce = O
|
|
|
1025
1024
|
title: t.imageZoomIn,
|
|
1026
1025
|
"aria-disabled": A === null,
|
|
1027
1026
|
onClick: () => {
|
|
1028
|
-
A !== null &&
|
|
1027
|
+
A !== null && l(A);
|
|
1029
1028
|
},
|
|
1030
|
-
...
|
|
1031
|
-
children: /* @__PURE__ */ d(
|
|
1029
|
+
...Me,
|
|
1030
|
+
children: /* @__PURE__ */ d(Jn, {})
|
|
1032
1031
|
}
|
|
1033
1032
|
),
|
|
1034
|
-
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () =>
|
|
1033
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Qe), children: /* @__PURE__ */ d(Kn, {}) })
|
|
1035
1034
|
] }),
|
|
1036
|
-
/* @__PURE__ */ d("div", { className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas", children: /* @__PURE__ */ d("img", { ref:
|
|
1035
|
+
/* @__PURE__ */ d("div", { className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas", children: /* @__PURE__ */ d("img", { ref: b, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: F, onLoad: (O) => g(O.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1037
1036
|
] });
|
|
1038
|
-
},
|
|
1039
|
-
const e = W(
|
|
1037
|
+
}, Ot = ne(null), be = ne(void 0), Lt = ne(null), Ee = () => {
|
|
1038
|
+
const e = W(Ot);
|
|
1040
1039
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1041
1040
|
return e;
|
|
1042
|
-
},
|
|
1043
|
-
const e = W(
|
|
1041
|
+
}, ar = () => {
|
|
1042
|
+
const e = W(Lt);
|
|
1044
1043
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1045
1044
|
return e;
|
|
1046
|
-
}, Se = (e, t, n, r) => t.kind === "panel" ?
|
|
1047
|
-
const { config: t } = D(), n = Ee(), r =
|
|
1048
|
-
return /* @__PURE__ */ d(be, { value: o, children: /* @__PURE__ */ d(
|
|
1049
|
-
},
|
|
1050
|
-
const t = e instanceof Element ? e.closest(
|
|
1045
|
+
}, Se = (e, t, n, r) => t.kind === "panel" ? le(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? le(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : le(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), cr = ({ children: e }) => {
|
|
1046
|
+
const { config: t } = D(), n = Ee(), r = $e(), o = r.kind === "location" ? r.location.source : void 0, l = he(Se(t, n.navigation, o, n.currentPath));
|
|
1047
|
+
return /* @__PURE__ */ d(be, { value: o, children: /* @__PURE__ */ d(Lt, { value: l, children: e }) });
|
|
1048
|
+
}, dr = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', ur = (e) => {
|
|
1049
|
+
const t = e instanceof Element ? e.closest(dr) : null;
|
|
1051
1050
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1052
|
-
}, ye = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey,
|
|
1053
|
-
const
|
|
1054
|
-
return /* @__PURE__ */ d("a", { ...
|
|
1055
|
-
if (ye(
|
|
1056
|
-
if (
|
|
1057
|
-
|
|
1051
|
+
}, ye = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, fr = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: s, scope: a, children: f }) => {
|
|
1052
|
+
const h = he(e);
|
|
1053
|
+
return /* @__PURE__ */ d("a", { ...l, href: h, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (g) => {
|
|
1054
|
+
if (ye(g)) {
|
|
1055
|
+
if (g.preventDefault(), t === a.currentPath && n !== "") {
|
|
1056
|
+
a.scrollWithin(n);
|
|
1058
1057
|
return;
|
|
1059
1058
|
}
|
|
1060
|
-
|
|
1059
|
+
s(t, n);
|
|
1061
1060
|
}
|
|
1062
|
-
}, children:
|
|
1063
|
-
},
|
|
1064
|
-
const { config:
|
|
1065
|
-
return
|
|
1066
|
-
},
|
|
1061
|
+
}, children: f });
|
|
1062
|
+
}, mr = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
|
|
1063
|
+
const { config: s } = D(), a = Ee(), f = W(be), h = qn(e), { navigation: m } = a, g = `${Se(s, m, f, t)}${h}`, b = n === !1 ? "false" : void 0;
|
|
1064
|
+
return m.kind === "page" ? /* @__PURE__ */ d(Rn, { ...o, to: g, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": b, children: l }) : /* @__PURE__ */ d(fr, { to: g, docPath: t, fragment: h, exists: b, className: r, attributes: o, onDocumentLink: m.onDocumentLink, scope: a, children: l });
|
|
1065
|
+
}, gr = ({ className: e, attributes: t, children: n }) => {
|
|
1067
1066
|
const { labels: r } = D();
|
|
1068
1067
|
return (
|
|
1069
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ U("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
|
|
1070
1069
|
n,
|
|
1071
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ U("span", { className: "aqmx-sr-only", children: [
|
|
1072
1071
|
" (",
|
|
1073
1072
|
r.inertLink,
|
|
1074
1073
|
")"
|
|
1075
1074
|
] })
|
|
1076
1075
|
] })
|
|
1077
1076
|
);
|
|
1078
|
-
},
|
|
1079
|
-
const { config:
|
|
1080
|
-
return /* @__PURE__ */ d("a", { ...n, href:
|
|
1081
|
-
ye(
|
|
1077
|
+
}, hr = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1078
|
+
const { config: l } = D(), s = W(be), a = he(`${Se(l, r.navigation, s, r.currentPath)}${e}`);
|
|
1079
|
+
return /* @__PURE__ */ d("a", { ...n, href: a, className: t, onClick: (h) => {
|
|
1080
|
+
ye(h) && (h.preventDefault(), r.scrollWithin(e));
|
|
1082
1081
|
}, children: o });
|
|
1083
|
-
},
|
|
1082
|
+
}, pr = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1084
1083
|
const o = Ee();
|
|
1085
|
-
return o.navigation.kind === "page" ? /* @__PURE__ */ d("a", { ...n, href: e, className: t, onClick: (
|
|
1086
|
-
if (!ye(
|
|
1087
|
-
const
|
|
1088
|
-
e === "#" ? o.followEmptyFragment(
|
|
1089
|
-
}, children: r }) : /* @__PURE__ */ d(
|
|
1090
|
-
},
|
|
1091
|
-
const { config: e } = D(), t = Ee(), n = W(be), r =
|
|
1084
|
+
return o.navigation.kind === "page" ? /* @__PURE__ */ d("a", { ...n, href: e, className: t, onClick: (s) => {
|
|
1085
|
+
if (!ye(s)) return;
|
|
1086
|
+
const a = s.currentTarget;
|
|
1087
|
+
e === "#" ? o.followEmptyFragment(s.nativeEvent) : a.href === a.ownerDocument.URL && o.followSameUrlJump(e, s.nativeEvent);
|
|
1088
|
+
}, children: r }) : /* @__PURE__ */ d(hr, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1089
|
+
}, wr = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: s }) => t === "doc" ? n === void 0 || !Jt(n) ? /* @__PURE__ */ d(gr, { className: o, attributes: l, children: s }) : /* @__PURE__ */ d(mr, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: s }) : e.startsWith("#") ? /* @__PURE__ */ d(pr, { href: e, className: o, attributes: l, children: s }) : /* @__PURE__ */ d("a", { ...l, href: e, className: o, children: s }), vr = () => {
|
|
1090
|
+
const { config: e } = D(), t = Ee(), n = W(be), r = Fe();
|
|
1092
1091
|
return $(
|
|
1093
|
-
(o,
|
|
1094
|
-
if (!ye(
|
|
1095
|
-
|
|
1096
|
-
|
|
1092
|
+
(o, l) => {
|
|
1093
|
+
if (!ye(l)) return !0;
|
|
1094
|
+
l.preventDefault();
|
|
1095
|
+
const s = Rt(o.id), { navigation: a } = t;
|
|
1096
|
+
return a.kind === "panel" || qe(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(s), !0) : (r(`${Se(e, a, n, t.currentPath)}${s}`, "follow-link"), !0);
|
|
1097
1097
|
},
|
|
1098
1098
|
[e, t, n, r]
|
|
1099
1099
|
);
|
|
1100
|
-
},
|
|
1101
|
-
const e =
|
|
1102
|
-
return $((t) =>
|
|
1100
|
+
}, br = () => {
|
|
1101
|
+
const e = ar();
|
|
1102
|
+
return $((t) => `${e}${Rt(t.id)}`, [e]);
|
|
1103
1103
|
};
|
|
1104
|
-
function
|
|
1104
|
+
function Er({
|
|
1105
1105
|
title: e,
|
|
1106
1106
|
titleId: t,
|
|
1107
1107
|
...n
|
|
1108
1108
|
}, r) {
|
|
1109
|
-
return /* @__PURE__ */
|
|
1109
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
1110
1110
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1111
1111
|
viewBox: "0 0 20 20",
|
|
1112
1112
|
fill: "currentColor",
|
|
@@ -1114,19 +1114,19 @@ function vr({
|
|
|
1114
1114
|
"data-slot": "icon",
|
|
1115
1115
|
ref: r,
|
|
1116
1116
|
"aria-labelledby": t
|
|
1117
|
-
}, n), e ? /* @__PURE__ */
|
|
1117
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
1118
1118
|
id: t
|
|
1119
|
-
}, e) : null, /* @__PURE__ */
|
|
1119
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
1120
1120
|
d: "M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Z"
|
|
1121
1121
|
}));
|
|
1122
1122
|
}
|
|
1123
|
-
const
|
|
1124
|
-
function
|
|
1123
|
+
const Sr = /* @__PURE__ */ x.forwardRef(Er);
|
|
1124
|
+
function yr({
|
|
1125
1125
|
title: e,
|
|
1126
1126
|
titleId: t,
|
|
1127
1127
|
...n
|
|
1128
1128
|
}, r) {
|
|
1129
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
1130
1130
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1131
1131
|
viewBox: "0 0 20 20",
|
|
1132
1132
|
fill: "currentColor",
|
|
@@ -1134,21 +1134,21 @@ function Er({
|
|
|
1134
1134
|
"data-slot": "icon",
|
|
1135
1135
|
ref: r,
|
|
1136
1136
|
"aria-labelledby": t
|
|
1137
|
-
}, n), e ? /* @__PURE__ */
|
|
1137
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
1138
1138
|
id: t
|
|
1139
|
-
}, e) : null, /* @__PURE__ */
|
|
1139
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
1140
1140
|
fillRule: "evenodd",
|
|
1141
1141
|
d: "M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v10.515a1.75 1.75 0 0 1-1.75 1.75h-1.5c-.078 0-.155-.005-.23-.015H4.48c-.075.01-.152.015-.23.015h-1.5A1.75 1.75 0 0 1 1 15.265V4.75Zm16.5 7.385V11.01a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25Zm0 2.005a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .108.069.2.165.235h1.585a.25.25 0 0 0 .25-.25v-1.11Zm-15 1.11v-1.11a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.164.235H2.75a.25.25 0 0 1-.25-.25Zm2-4.24v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V11.01a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25Zm13-2.005V7.88a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25ZM4.25 7.63a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V7.88a.25.25 0 0 1 .25-.25h1.5Zm0-3.13a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5Zm11.5 1.625a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5Zm-9 3.125a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
1142
1142
|
clipRule: "evenodd"
|
|
1143
1143
|
}));
|
|
1144
1144
|
}
|
|
1145
|
-
const
|
|
1146
|
-
function
|
|
1145
|
+
const xr = /* @__PURE__ */ x.forwardRef(yr);
|
|
1146
|
+
function kr({
|
|
1147
1147
|
title: e,
|
|
1148
1148
|
titleId: t,
|
|
1149
1149
|
...n
|
|
1150
1150
|
}, r) {
|
|
1151
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
1152
1152
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1153
1153
|
viewBox: "0 0 20 20",
|
|
1154
1154
|
fill: "currentColor",
|
|
@@ -1156,28 +1156,28 @@ function yr({
|
|
|
1156
1156
|
"data-slot": "icon",
|
|
1157
1157
|
ref: r,
|
|
1158
1158
|
"aria-labelledby": t
|
|
1159
|
-
}, n), e ? /* @__PURE__ */
|
|
1159
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
1160
1160
|
id: t
|
|
1161
|
-
}, e) : null, /* @__PURE__ */
|
|
1161
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
1162
1162
|
fillRule: "evenodd",
|
|
1163
1163
|
d: "M17.721 1.599a.75.75 0 0 1 .279.583v11.29a2.25 2.25 0 0 1-1.774 2.2l-2.041.44a2.216 2.216 0 0 1-.938-4.332l2.662-.577a.75.75 0 0 0 .591-.733V6.112l-8 1.73v7.684a2.25 2.25 0 0 1-1.774 2.2l-2.042.44a2.216 2.216 0 1 1-.935-4.331l2.659-.573A.75.75 0 0 0 7 12.529V4.236a.75.75 0 0 1 .591-.733l9.5-2.054a.75.75 0 0 1 .63.15Z",
|
|
1164
1164
|
clipRule: "evenodd"
|
|
1165
1165
|
}));
|
|
1166
1166
|
}
|
|
1167
|
-
const
|
|
1167
|
+
const Rr = /* @__PURE__ */ x.forwardRef(kr), Tr = (e) => {
|
|
1168
1168
|
switch (e) {
|
|
1169
1169
|
case "video":
|
|
1170
|
-
return /* @__PURE__ */ d(Sr, {});
|
|
1171
|
-
case "audio":
|
|
1172
1170
|
return /* @__PURE__ */ d(xr, {});
|
|
1171
|
+
case "audio":
|
|
1172
|
+
return /* @__PURE__ */ d(Rr, {});
|
|
1173
1173
|
case "pdf":
|
|
1174
|
-
return /* @__PURE__ */ d(
|
|
1174
|
+
return /* @__PURE__ */ d(Sr, {});
|
|
1175
1175
|
default: {
|
|
1176
1176
|
const t = e;
|
|
1177
1177
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
},
|
|
1180
|
+
}, Ar = ({ document: e }) => {
|
|
1181
1181
|
const { labels: t } = D();
|
|
1182
1182
|
switch (e.mediaType) {
|
|
1183
1183
|
case "video":
|
|
@@ -1195,10 +1195,10 @@ const xr = /* @__PURE__ */ y.forwardRef(yr), kr = (e) => {
|
|
|
1195
1195
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
},
|
|
1199
|
-
/* @__PURE__ */ d(
|
|
1200
|
-
/* @__PURE__ */ d("div", { className: "aqmx-document-stage", children: /* @__PURE__ */ d(
|
|
1201
|
-
] }),
|
|
1198
|
+
}, Or = ({ document: e }) => /* @__PURE__ */ U("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
1199
|
+
/* @__PURE__ */ d(ve, { name: e.name, url: e.url, icon: Tr(e.mediaType) }),
|
|
1200
|
+
/* @__PURE__ */ d("div", { className: "aqmx-document-stage", children: /* @__PURE__ */ d(Ar, { document: e }) })
|
|
1201
|
+
] }), Lr = (e) => ({
|
|
1202
1202
|
loading: e.viewerLoading,
|
|
1203
1203
|
errorPrefix: e.viewerErrorPrefix,
|
|
1204
1204
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -1228,191 +1228,195 @@ const xr = /* @__PURE__ */ y.forwardRef(yr), kr = (e) => {
|
|
|
1228
1228
|
mermaidZoomIn: e.viewerMermaidZoomIn,
|
|
1229
1229
|
mermaidZoomOut: e.viewerMermaidZoomOut,
|
|
1230
1230
|
mermaidResetView: e.viewerMermaidResetView,
|
|
1231
|
-
mermaidRetry: e.viewerMermaidRetry
|
|
1232
|
-
|
|
1231
|
+
mermaidRetry: e.viewerMermaidRetry,
|
|
1232
|
+
embeddedVideo: e.viewerEmbeddedVideo,
|
|
1233
|
+
embeddedPost: e.viewerEmbeddedPost,
|
|
1234
|
+
embeddedFrame: e.viewerEmbeddedFrame
|
|
1235
|
+
}), Mt = (e, t, n) => {
|
|
1233
1236
|
if (t !== void 0) return t;
|
|
1234
1237
|
if (n !== void 0) return n;
|
|
1235
1238
|
const [r] = e.documentStyles;
|
|
1236
1239
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1237
1240
|
return r.name;
|
|
1238
|
-
},
|
|
1241
|
+
}, Ct = (e, t) => e !== void 0 ? e : t !== void 0 ? t : an, Mr = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), Cr = (e, t, n) => {
|
|
1239
1242
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1240
1243
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1241
|
-
return t.view === "single" ?
|
|
1242
|
-
},
|
|
1243
|
-
const
|
|
1244
|
+
return t.view === "single" ? le(e, { view: "single", source: t.source, doc: t.doc, overrides: r, embed: t.embed }) : le(e, { view: "tree", source: t.source, doc: t.doc, overrides: r });
|
|
1245
|
+
}, Ce = ne("fill"), _e = ({ kind: e, label: t, stale: n, busy: r, frameRef: o, intent: l, children: s }) => {
|
|
1246
|
+
const a = W(Ce);
|
|
1244
1247
|
return (
|
|
1245
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ U("section", { ref: o, role: "region", "aria-label": t, "aria-busy": r, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-flow": a, className: "aqmx-document", ...l, children: [
|
|
1246
1249
|
n ? /* @__PURE__ */ d("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
1247
|
-
|
|
1250
|
+
s
|
|
1248
1251
|
] })
|
|
1249
1252
|
);
|
|
1250
|
-
},
|
|
1253
|
+
}, Nr = () => {
|
|
1251
1254
|
const { labels: e } = D();
|
|
1252
|
-
return /* @__PURE__ */ d(
|
|
1253
|
-
},
|
|
1255
|
+
return /* @__PURE__ */ d(_e, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1256
|
+
}, Nt = ({ label: e }) => {
|
|
1254
1257
|
const { labels: t } = D();
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
/* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children:
|
|
1258
|
+
return /* @__PURE__ */ U(_e, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
1259
|
+
/* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: Mr.map((n) => /* @__PURE__ */ d("span", {}, n)) }),
|
|
1257
1260
|
/* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1258
1261
|
] });
|
|
1259
|
-
},
|
|
1260
|
-
const { reportMathDiagnostics: r } = D(), o =
|
|
1261
|
-
return /* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(
|
|
1262
|
-
},
|
|
1262
|
+
}, $r = ({ path: e, document: t, viewer: n }) => {
|
|
1263
|
+
const { reportMathDiagnostics: r } = D(), o = I(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), l = vr(), s = br(), a = I(() => r === void 0 ? void 0 : (f) => r(e, f), [r, e]);
|
|
1264
|
+
return /* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(gt, { ...n, onHeadingSelect: l, headingHref: s, onMathDiagnostics: a, parseResult: o, content: null }) });
|
|
1265
|
+
}, Dr = ({ document: e, viewer: t }) => {
|
|
1263
1266
|
const { labels: n } = D();
|
|
1264
|
-
return /* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */ d(
|
|
1267
|
+
return /* @__PURE__ */ U(Ft, { children: [
|
|
1268
|
+
/* @__PURE__ */ d(ve, { name: e.name, url: e.url, icon: /* @__PURE__ */ d(kn, {}) }),
|
|
1266
1269
|
e.truncated ? /* @__PURE__ */ d("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
1267
|
-
/* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(
|
|
1270
|
+
/* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(gt, { ...t, parseResult: null, content: e.text }) })
|
|
1268
1271
|
] });
|
|
1269
|
-
},
|
|
1272
|
+
}, Fr = ({ path: e, document: t, viewer: n, onRetry: r }) => {
|
|
1270
1273
|
switch (t.kind) {
|
|
1271
1274
|
case "markdown":
|
|
1272
|
-
return /* @__PURE__ */ d(
|
|
1275
|
+
return /* @__PURE__ */ d($r, { path: e, document: t, viewer: n });
|
|
1273
1276
|
case "text":
|
|
1274
|
-
return /* @__PURE__ */ d(
|
|
1277
|
+
return /* @__PURE__ */ d(Dr, { document: t, viewer: n });
|
|
1275
1278
|
case "image":
|
|
1276
|
-
return /* @__PURE__ */ d(
|
|
1279
|
+
return /* @__PURE__ */ d(sr, { document: t });
|
|
1277
1280
|
case "media":
|
|
1278
|
-
return /* @__PURE__ */ d(
|
|
1281
|
+
return /* @__PURE__ */ d(Or, { document: t });
|
|
1279
1282
|
case "file":
|
|
1280
|
-
return /* @__PURE__ */ d(
|
|
1283
|
+
return /* @__PURE__ */ d(Pn, { document: t });
|
|
1281
1284
|
case "failure":
|
|
1282
|
-
return /* @__PURE__ */ d("div", { className: "aqmx-document-failure", "data-aqmx-document-scroller": "", children: /* @__PURE__ */ d(
|
|
1285
|
+
return /* @__PURE__ */ d("div", { className: "aqmx-document-failure", "data-aqmx-document-scroller": "", children: /* @__PURE__ */ d(Tn, { failure: t.failure, alert: !1, onRetry: r, testId: "markdown-explorer-document-failure" }) });
|
|
1283
1286
|
default: {
|
|
1284
1287
|
const o = t;
|
|
1285
1288
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(o)}`);
|
|
1286
1289
|
}
|
|
1287
1290
|
}
|
|
1288
|
-
},
|
|
1289
|
-
const r
|
|
1290
|
-
for (const l of
|
|
1291
|
-
if (l instanceof HTMLElement &&
|
|
1291
|
+
}, Pr = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', qr = (e, t, n) => {
|
|
1292
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : At(e, n), r === void 0 ? null : Tt(e, r.id), e.querySelector(Pe), e.querySelector(Pr)];
|
|
1293
|
+
for (const l of o)
|
|
1294
|
+
if (l instanceof HTMLElement && St(l)) return l;
|
|
1292
1295
|
return null;
|
|
1293
1296
|
}, rt = (e, t, n) => {
|
|
1294
|
-
const { activeElement: r, body: o } = e.ownerDocument,
|
|
1295
|
-
t instanceof HTMLElement && n && (
|
|
1296
|
-
},
|
|
1297
|
-
const t =
|
|
1298
|
-
return
|
|
1297
|
+
const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
|
|
1298
|
+
t instanceof HTMLElement && n && (l || e.contains(r)) && St(t);
|
|
1299
|
+
}, _r = (e) => {
|
|
1300
|
+
const t = H(!1);
|
|
1301
|
+
return V(() => {
|
|
1299
1302
|
const n = e.current;
|
|
1300
1303
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
1301
1304
|
const r = n.ownerDocument, o = r.defaultView;
|
|
1302
1305
|
if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
|
|
1303
|
-
let
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1306
|
+
let l = !1, s;
|
|
1307
|
+
const a = (b) => {
|
|
1308
|
+
l = !(b.target instanceof Node && n.contains(b.target)), l && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(s), s = setTimeout(() => {
|
|
1309
|
+
l = !1;
|
|
1307
1310
|
}, 0);
|
|
1308
|
-
},
|
|
1309
|
-
t.current =
|
|
1310
|
-
},
|
|
1311
|
-
|
|
1312
|
-
},
|
|
1313
|
-
const { activeElement:
|
|
1314
|
-
|
|
1315
|
-
},
|
|
1316
|
-
|
|
1311
|
+
}, f = (b) => {
|
|
1312
|
+
t.current = b.target instanceof Node && n.contains(b.target);
|
|
1313
|
+
}, h = (b) => {
|
|
1314
|
+
b.relatedTarget === null && l && (t.current = !1);
|
|
1315
|
+
}, m = () => {
|
|
1316
|
+
const { activeElement: b, body: R } = r;
|
|
1317
|
+
b !== null && b !== R && (t.current = n.contains(b));
|
|
1318
|
+
}, g = () => {
|
|
1319
|
+
l && !n.contains(r.activeElement) && (t.current = !1);
|
|
1317
1320
|
};
|
|
1318
|
-
return o.addEventListener("pointerdown",
|
|
1319
|
-
clearTimeout(
|
|
1321
|
+
return o.addEventListener("pointerdown", a, !0), o.addEventListener("mousedown", a, !0), o.addEventListener("focusin", f, !0), o.addEventListener("blur", m), o.addEventListener("focus", g), n.addEventListener("focusout", h), () => {
|
|
1322
|
+
clearTimeout(s), o.removeEventListener("pointerdown", a, !0), o.removeEventListener("mousedown", a, !0), o.removeEventListener("focusin", f, !0), o.removeEventListener("blur", m), o.removeEventListener("focus", g), n.removeEventListener("focusout", h);
|
|
1320
1323
|
};
|
|
1321
1324
|
}, [e]), t;
|
|
1322
|
-
},
|
|
1323
|
-
const { labels:
|
|
1325
|
+
}, jr = ({ path: e, snapshot: t, stale: n, viewer: r, regionLabel: o, navigation: l, fragment: s, paneScroll: a, announces: f, announceFailure: h, onDocumentShown: m }) => {
|
|
1326
|
+
const { labels: g, announcer: b, documents: R } = D(), { document: k } = t, A = H(null), T = H(null), F = H(null), O = H(0), u = _r(A), p = H({ path: e, document: k }), S = H(null), E = $(
|
|
1324
1327
|
(i) => {
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1328
|
+
const c = A.current, w = Je(c, i, a);
|
|
1329
|
+
c !== null && w !== null && rt(c, w, u.current);
|
|
1327
1330
|
},
|
|
1328
|
-
[
|
|
1329
|
-
),
|
|
1330
|
-
(i,
|
|
1331
|
-
const w =
|
|
1331
|
+
[a, u]
|
|
1332
|
+
), y = $(
|
|
1333
|
+
(i, c) => {
|
|
1334
|
+
const w = O.current;
|
|
1332
1335
|
setTimeout(() => {
|
|
1333
|
-
!
|
|
1336
|
+
!c.defaultPrevented && O.current === w && E(i);
|
|
1334
1337
|
}, 0);
|
|
1335
1338
|
},
|
|
1336
|
-
[
|
|
1337
|
-
),
|
|
1339
|
+
[E]
|
|
1340
|
+
), P = $(
|
|
1338
1341
|
(i) => {
|
|
1339
1342
|
setTimeout(() => {
|
|
1340
|
-
i.defaultPrevented ||
|
|
1343
|
+
i.defaultPrevented || E("#");
|
|
1341
1344
|
}, 0);
|
|
1342
1345
|
},
|
|
1343
|
-
[
|
|
1344
|
-
),
|
|
1345
|
-
const w =
|
|
1346
|
-
if (w !== null && w.path === i && w.snapshot ===
|
|
1347
|
-
|
|
1348
|
-
const v =
|
|
1346
|
+
[E]
|
|
1347
|
+
), z = I(() => ({ navigation: l, currentPath: e, scrollWithin: E, followSameUrlJump: y, followEmptyFragment: P }), [l, e, E, y, P]), M = $(() => R.retry(e), [R, e]), j = An(R, ur), C = Q((i, c) => {
|
|
1348
|
+
const w = T.current;
|
|
1349
|
+
if (w !== null && w.path === i && w.snapshot === c) return;
|
|
1350
|
+
T.current = { path: i, snapshot: c };
|
|
1351
|
+
const v = c.document;
|
|
1349
1352
|
if (v.kind === "failure") {
|
|
1350
|
-
R.noteFailureShown(
|
|
1353
|
+
R.noteFailureShown(c) && h(g.documentFailed(ht(i), pe(g, v.failure.reason)));
|
|
1351
1354
|
return;
|
|
1352
1355
|
}
|
|
1353
|
-
|
|
1356
|
+
m?.(i, v), f && (w === null || w.path !== i || w.snapshot.document.kind === "failure") && b.announce(g.documentShown(v.name));
|
|
1354
1357
|
});
|
|
1355
1358
|
Y(() => {
|
|
1356
|
-
|
|
1359
|
+
C(e, t);
|
|
1357
1360
|
}, [e, t]);
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1361
|
+
const q = Q(() => {
|
|
1362
|
+
s.kind === "panel" && s.consume();
|
|
1360
1363
|
}), J = Q((i) => {
|
|
1361
|
-
const
|
|
1362
|
-
if (
|
|
1363
|
-
const { activeElement: w, body: v } =
|
|
1364
|
-
return w !== null && w !== v ? null :
|
|
1365
|
-
}),
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1368
|
-
}), K = Q((i) =>
|
|
1364
|
+
const c = A.current;
|
|
1365
|
+
if (c === null || !u.current) return null;
|
|
1366
|
+
const { activeElement: w, body: v } = c.ownerDocument;
|
|
1367
|
+
return w !== null && w !== v ? null : qr(c, k, i);
|
|
1368
|
+
}), re = Q((i) => {
|
|
1369
|
+
const c = A.current;
|
|
1370
|
+
c !== null && rt(c, i, u.current);
|
|
1371
|
+
}), K = Q((i) => a.reveal(i)), xe = Q((i) => Je(A.current, i, a));
|
|
1369
1372
|
return Y(() => {
|
|
1370
1373
|
if (n) return;
|
|
1371
|
-
const i =
|
|
1372
|
-
|
|
1373
|
-
const w =
|
|
1374
|
-
|
|
1374
|
+
const i = p.current.path !== e, c = i || p.current.document !== k;
|
|
1375
|
+
p.current = { path: e, document: k };
|
|
1376
|
+
const w = S.current !== e;
|
|
1377
|
+
S.current = e;
|
|
1375
1378
|
let v = null;
|
|
1376
|
-
|
|
1379
|
+
s.kind === "page" ? F.current !== s.navigation && (F.current = s.navigation, O.current += 1, v = s.fragment) : s.fragment !== null && (v = s.fragment, q());
|
|
1377
1380
|
const L = () => {
|
|
1378
|
-
const
|
|
1379
|
-
if (!
|
|
1380
|
-
|
|
1381
|
+
const N = v === null ? null : xe(v);
|
|
1382
|
+
if (!c) {
|
|
1383
|
+
N !== null && re(N);
|
|
1381
1384
|
return;
|
|
1382
1385
|
}
|
|
1383
|
-
const
|
|
1384
|
-
i &&
|
|
1386
|
+
const _ = J(s.fragment);
|
|
1387
|
+
i && N === null && _ !== null && K(_);
|
|
1385
1388
|
};
|
|
1386
1389
|
w ? queueMicrotask(L) : L();
|
|
1387
|
-
}, [
|
|
1388
|
-
},
|
|
1390
|
+
}, [s, e, k, n]), /* @__PURE__ */ d(_e, { kind: k.kind, label: o(e, k), stale: n, busy: n, frameRef: A, intent: j, children: /* @__PURE__ */ d(Ot, { value: z, children: /* @__PURE__ */ d(cr, { children: /* @__PURE__ */ d(Fr, { path: e, document: k, viewer: r, onRetry: M }, e) }) }) });
|
|
1391
|
+
}, je = Object.freeze({ kind: "skeleton" }), Br = (e, t, n, r, o) => {
|
|
1389
1392
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1393
|
+
const l = ge(t);
|
|
1394
|
+
if (l !== null) return { kind: "document", path: e, snapshot: l, stale: !0 };
|
|
1392
1395
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
1393
|
-
const
|
|
1394
|
-
return n === null ||
|
|
1395
|
-
}, zr = (e, t) => t.status === "deferred" ?
|
|
1396
|
+
const s = n === null || n === e ? null : ge(r);
|
|
1397
|
+
return n === null || s === null ? je : { kind: "document", path: n, snapshot: s, stale: !0 };
|
|
1398
|
+
}, zr = (e, t) => t.status === "deferred" ? je : { kind: "document", path: e, snapshot: t, stale: !1 }, Hr = ({ requestedPath: e, content: t, ...n }) => {
|
|
1396
1399
|
const r = t.kind === "streaming" ? zr(t.path, W(t.promise)) : t;
|
|
1397
|
-
return r.kind !== "document" ? /* @__PURE__ */ d(
|
|
1398
|
-
},
|
|
1399
|
-
const { config:
|
|
1400
|
-
|
|
1400
|
+
return r.kind !== "document" ? /* @__PURE__ */ d(Nt, { label: n.regionLabel(e, null) }) : /* @__PURE__ */ d(jr, { path: r.path, snapshot: r.snapshot, stale: r.stale, ...n });
|
|
1401
|
+
}, $t = ({ path: e, display: t, navigation: n, fragment: r, paneScroll: o, announces: l, announceFailure: s, onDocumentShown: a }) => {
|
|
1402
|
+
const { config: f, labels: h, theme: m, documents: g } = D(), b = Yt(), R = H(!1);
|
|
1403
|
+
V(() => {
|
|
1401
1404
|
R.current = !0;
|
|
1402
1405
|
}, []);
|
|
1403
|
-
const [
|
|
1404
|
-
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
const
|
|
1406
|
+
const [k, A] = Z(null), T = $(() => e === null ? void 0 : g.peek(e), [g, e]), F = te(g.subscribe, T, T), O = $(() => k === null ? void 0 : g.peek(k), [g, k]), u = te(g.subscribe, O, O);
|
|
1407
|
+
V(() => e === null ? void 0 : g.open(e), [g, e]), V(() => k === null ? void 0 : g.retain(k), [g, k]);
|
|
1408
|
+
const p = e === null ? je : Br(e, F, k, u, !R.current), S = e === null ? null : p.kind === "document" && !p.stale ? p.path : k;
|
|
1409
|
+
S !== k && A(S);
|
|
1410
|
+
const E = I(() => Lr(h), [h]), y = I(() => [...f.iframeHosts], [f]), P = I(
|
|
1408
1411
|
() => ({
|
|
1409
|
-
labels:
|
|
1410
|
-
emptyMessage:
|
|
1411
|
-
theme:
|
|
1412
|
-
availableStyles:
|
|
1413
|
-
iFrameAllowedDomains:
|
|
1414
|
-
|
|
1415
|
-
|
|
1412
|
+
labels: E,
|
|
1413
|
+
emptyMessage: h.documentEmpty,
|
|
1414
|
+
theme: m,
|
|
1415
|
+
availableStyles: f.documentStyles,
|
|
1416
|
+
iFrameAllowedDomains: y,
|
|
1417
|
+
embeds: f.embeds,
|
|
1418
|
+
linkComponent: wr,
|
|
1419
|
+
toolbar: b,
|
|
1416
1420
|
style: t.style,
|
|
1417
1421
|
onStyleChange: t.onStyleChange,
|
|
1418
1422
|
align: t.align,
|
|
@@ -1424,33 +1428,33 @@ const xr = /* @__PURE__ */ y.forwardRef(yr), kr = (e) => {
|
|
|
1424
1428
|
width: t.width === void 0 ? void 0 : `min(${t.width}, 100%)`,
|
|
1425
1429
|
maxWidth: t.maxWidth === void 0 ? void 0 : `min(${t.maxWidth}, 100%)`
|
|
1426
1430
|
}),
|
|
1427
|
-
[
|
|
1428
|
-
),
|
|
1429
|
-
return e === null ? /* @__PURE__ */ d(
|
|
1430
|
-
},
|
|
1431
|
-
const { config: r, viewSettings: o, announcer:
|
|
1432
|
-
(
|
|
1433
|
-
if (
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1431
|
+
[E, h.documentEmpty, m, f.documentStyles, y, f.embeds, b, t]
|
|
1432
|
+
), z = n.kind === "panel", M = $((C, q) => z ? q === null || q.kind === "failure" ? ht(C) : q.name : h.documentRegion, [z, h.documentRegion]), j = z ? "content" : "fill";
|
|
1433
|
+
return e === null ? /* @__PURE__ */ d(Ce, { value: j, children: /* @__PURE__ */ d(Nr, {}) }) : /* @__PURE__ */ d(Ce, { value: j, children: /* @__PURE__ */ d(Ae, { fallback: /* @__PURE__ */ d(Nt, { label: M(e, null) }), children: /* @__PURE__ */ d(Hr, { requestedPath: e, content: p, viewer: P, regionLabel: M, navigation: n, fragment: r, paneScroll: o, announces: l, announceFailure: s, onDocumentShown: a }) }) });
|
|
1434
|
+
}, Ir = ({ path: e, variant: t, onDocumentShown: n }) => {
|
|
1435
|
+
const { config: r, viewSettings: o, announcer: l } = D(), s = fe((y) => y.style), a = fe((y) => y.align), f = Fe(), h = mt(), m = $e(), { view: g, overrides: b, embed: R } = t, k = $(
|
|
1436
|
+
(y) => {
|
|
1437
|
+
if (m.kind !== "location") return;
|
|
1438
|
+
const P = Cr(r, m.location, y);
|
|
1439
|
+
P !== null && f(P, "browse");
|
|
1436
1440
|
},
|
|
1437
|
-
[r,
|
|
1441
|
+
[r, f, m]
|
|
1438
1442
|
), A = $(
|
|
1439
|
-
(
|
|
1440
|
-
o.update({ style:
|
|
1443
|
+
(y) => {
|
|
1444
|
+
o.update({ style: y }), k("style");
|
|
1441
1445
|
},
|
|
1442
|
-
[o,
|
|
1443
|
-
),
|
|
1444
|
-
(
|
|
1445
|
-
o.update({ align:
|
|
1446
|
+
[o, k]
|
|
1447
|
+
), T = $(
|
|
1448
|
+
(y) => {
|
|
1449
|
+
o.update({ align: y }), k("align");
|
|
1446
1450
|
},
|
|
1447
|
-
[o,
|
|
1448
|
-
),
|
|
1451
|
+
[o, k]
|
|
1452
|
+
), F = Mt(r, b.style, s), O = Ct(b.align, a), u = I(
|
|
1449
1453
|
() => ({
|
|
1450
|
-
style:
|
|
1454
|
+
style: F,
|
|
1451
1455
|
onStyleChange: A,
|
|
1452
|
-
align:
|
|
1453
|
-
onAlignChange:
|
|
1456
|
+
align: O,
|
|
1457
|
+
onAlignChange: T,
|
|
1454
1458
|
showToc: R.showToc !== !1,
|
|
1455
1459
|
showStyle: R.showStyle !== !1,
|
|
1456
1460
|
showAlign: R.showAlign !== !1,
|
|
@@ -1458,377 +1462,417 @@ const xr = /* @__PURE__ */ y.forwardRef(yr), kr = (e) => {
|
|
|
1458
1462
|
width: R.width,
|
|
1459
1463
|
maxWidth: R.maxWidth
|
|
1460
1464
|
}),
|
|
1461
|
-
[
|
|
1462
|
-
),
|
|
1463
|
-
return /* @__PURE__ */ d(
|
|
1464
|
-
},
|
|
1465
|
-
const { config: r, viewSettings: o } = D(),
|
|
1465
|
+
[F, A, O, T, R]
|
|
1466
|
+
), p = I(() => ({ kind: "page", view: g, overrides: b, embed: R }), [g, b, R]), S = I(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), E = $((y) => l.announce(y), [l]);
|
|
1467
|
+
return /* @__PURE__ */ d($t, { path: e, display: u, navigation: p, fragment: S, paneScroll: In, announces: !0, announceFailure: E, onDocumentShown: n });
|
|
1468
|
+
}, Zr = ({ path: e, variant: t, onDocumentShown: n }) => {
|
|
1469
|
+
const { config: r, viewSettings: o } = D(), l = fe((p) => p.style), s = fe((p) => p.align), [a, f] = Z(() => Mt(r, void 0, l)), h = Ct(void 0, s), m = $((p) => o.update({ align: p }), [o]), { maximized: g, onDocumentLink: b, pendingHash: R, onHashConsumed: k, announceFailure: A, paneScroll: T } = t, F = I(
|
|
1466
1470
|
() => ({
|
|
1467
|
-
style:
|
|
1468
|
-
onStyleChange:
|
|
1469
|
-
align:
|
|
1470
|
-
onAlignChange:
|
|
1471
|
-
showToc:
|
|
1472
|
-
showStyle:
|
|
1473
|
-
showAlign:
|
|
1471
|
+
style: a,
|
|
1472
|
+
onStyleChange: f,
|
|
1473
|
+
align: h,
|
|
1474
|
+
onAlignChange: m,
|
|
1475
|
+
showToc: g,
|
|
1476
|
+
showStyle: g,
|
|
1477
|
+
showAlign: g,
|
|
1474
1478
|
padding: void 0,
|
|
1475
1479
|
width: void 0,
|
|
1476
1480
|
maxWidth: void 0
|
|
1477
1481
|
}),
|
|
1478
|
-
[
|
|
1479
|
-
),
|
|
1480
|
-
return /* @__PURE__ */ d(
|
|
1481
|
-
},
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1482
|
+
[a, h, m, g]
|
|
1483
|
+
), O = I(() => ({ kind: "panel", onDocumentLink: b }), [b]), u = I(() => ({ kind: "panel", fragment: R, consume: k }), [R, k]);
|
|
1484
|
+
return /* @__PURE__ */ d($t, { path: e, display: F, navigation: O, fragment: u, paneScroll: T, announces: !1, announceFailure: A, onDocumentShown: n });
|
|
1485
|
+
}, Ur = ({ path: e, variant: t, onDocumentShown: n }) => t.kind === "page" ? /* @__PURE__ */ d(Ir, { path: e, variant: t, onDocumentShown: n }) : /* @__PURE__ */ d(Zr, { path: e, variant: t, onDocumentShown: n });
|
|
1486
|
+
function Vr({
|
|
1487
|
+
title: e,
|
|
1488
|
+
titleId: t,
|
|
1489
|
+
...n
|
|
1490
|
+
}, r) {
|
|
1491
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
1492
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1493
|
+
viewBox: "0 0 24 24",
|
|
1494
|
+
fill: "currentColor",
|
|
1495
|
+
"aria-hidden": "true",
|
|
1496
|
+
"data-slot": "icon",
|
|
1497
|
+
ref: r,
|
|
1498
|
+
"aria-labelledby": t
|
|
1499
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
1500
|
+
id: t
|
|
1501
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
1502
|
+
fillRule: "evenodd",
|
|
1503
|
+
d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
|
|
1504
|
+
clipRule: "evenodd"
|
|
1505
|
+
}));
|
|
1506
|
+
}
|
|
1507
|
+
const Wr = /* @__PURE__ */ x.forwardRef(Vr), Kr = /* @__PURE__ */ new Set(), Gr = (e, t) => {
|
|
1508
|
+
const { documents: n, announcer: r, labels: o } = D(), l = $(() => n.peek(e), [n, e]), s = $(() => n.peekSeeded(e), [n, e]), a = te(n.subscribe, l, s), f = $(() => n.answerStampOf(e), [n, e]), h = te(n.subscribe, f, f), [m] = Z(() => /* @__PURE__ */ new Set()), [g, b] = Z(Kr), [R, k] = Z(null);
|
|
1509
|
+
R !== null && R.path !== e && k(null);
|
|
1510
|
+
const A = H(null);
|
|
1511
|
+
V(() => (A.current = e, () => {
|
|
1512
|
+
A.current = null;
|
|
1513
|
+
}), [e]);
|
|
1514
|
+
const T = $(() => {
|
|
1515
|
+
const u = e, p = n.peek(u);
|
|
1516
|
+
if (m.has(u) || p?.status === "pending") return;
|
|
1517
|
+
const S = t && !kt(p);
|
|
1518
|
+
m.add(u), b(new Set(m)), k(null), (async () => {
|
|
1485
1519
|
try {
|
|
1486
|
-
const
|
|
1487
|
-
if (
|
|
1488
|
-
|
|
1520
|
+
const E = await n.refresh(u);
|
|
1521
|
+
if (A.current !== u || E.status === "superseded") return;
|
|
1522
|
+
if (E.status === "failed") {
|
|
1523
|
+
k({ path: u, failure: E.failure, stamp: n.answerStampOf(u) }), r.announce(o.documentRefreshFailed(pe(o, E.failure.reason)));
|
|
1489
1524
|
return;
|
|
1490
1525
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
r.announce(t.documentRefreshed(u.document.name));
|
|
1526
|
+
const y = ge(n.peek(u));
|
|
1527
|
+
if (S || y === null || y.document.kind === "failure") return;
|
|
1528
|
+
r.announce(o.documentRefreshed(y.document.name));
|
|
1495
1529
|
} finally {
|
|
1496
|
-
|
|
1530
|
+
m.delete(u), b(new Set(m));
|
|
1497
1531
|
}
|
|
1498
|
-
}
|
|
1499
|
-
}, [
|
|
1500
|
-
return
|
|
1501
|
-
|
|
1532
|
+
})();
|
|
1533
|
+
}, [e, t, m, n, r, o]), F = g.has(e), O = R !== null && R.path === e && R.stamp === h ? R.failure : null;
|
|
1534
|
+
return { refreshing: F, unavailable: F || a?.status === "pending", failure: O, refresh: T };
|
|
1535
|
+
}, Xr = Object.freeze({ kind: "page" }), Yr = (e) => {
|
|
1536
|
+
e.stopPropagation();
|
|
1537
|
+
}, Jr = ({ path: e, placement: t }) => {
|
|
1538
|
+
const { labels: n } = D(), { refreshing: r, unavailable: o, failure: l, refresh: s } = Gr(e, t.kind === "page"), a = t.kind === "panel" ? n.refreshDocumentNamed(t.documentName) : null;
|
|
1539
|
+
return /* @__PURE__ */ U("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", children: [
|
|
1540
|
+
/* @__PURE__ */ d("div", { className: "aqmx-document-refresh-row", children: /* @__PURE__ */ U(
|
|
1502
1541
|
"button",
|
|
1503
1542
|
{
|
|
1504
1543
|
type: "button",
|
|
1505
|
-
className: "aqmx-icon-button aqmx-labelled-button",
|
|
1506
|
-
title:
|
|
1507
|
-
"aria-
|
|
1508
|
-
"aria-
|
|
1509
|
-
"
|
|
1510
|
-
"data-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1544
|
+
className: a === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
1545
|
+
title: a === null ? n.refreshDocument : a,
|
|
1546
|
+
"aria-label": a === null ? void 0 : a,
|
|
1547
|
+
"aria-disabled": o,
|
|
1548
|
+
"aria-busy": r,
|
|
1549
|
+
"data-aqmx-busy": r ? "true" : void 0,
|
|
1550
|
+
"data-testid": "markdown-explorer-document-refresh",
|
|
1551
|
+
onClick: s,
|
|
1552
|
+
onDoubleClick: Yr,
|
|
1514
1553
|
children: [
|
|
1515
|
-
/* @__PURE__ */ d(
|
|
1516
|
-
/* @__PURE__ */ d("span", { children:
|
|
1554
|
+
/* @__PURE__ */ d(Wr, { "aria-hidden": "true" }),
|
|
1555
|
+
a === null ? /* @__PURE__ */ d("span", { children: n.refreshDocumentLabel }) : null
|
|
1517
1556
|
]
|
|
1518
1557
|
}
|
|
1519
1558
|
) }),
|
|
1520
|
-
|
|
1521
|
-
|
|
1559
|
+
l === null ? null : /* @__PURE__ */ d("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: n.documentRefreshFailed(pe(n, l.reason)) })
|
|
1560
|
+
] });
|
|
1561
|
+
}, Qr = ({ location: e }) => {
|
|
1562
|
+
const t = e.doc, n = I(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]);
|
|
1563
|
+
return /* @__PURE__ */ U("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
1564
|
+
/* @__PURE__ */ d(Jr, { path: t, placement: Xr }),
|
|
1565
|
+
/* @__PURE__ */ d(Ur, { path: t, variant: n })
|
|
1522
1566
|
] });
|
|
1523
|
-
},
|
|
1524
|
-
const { labels: n, announcer: r } = D(), o =
|
|
1525
|
-
|
|
1526
|
-
const
|
|
1527
|
-
return /* @__PURE__ */ d("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children:
|
|
1567
|
+
}, eo = ({ holds: e, testId: t }) => {
|
|
1568
|
+
const { labels: n, announcer: r } = D(), o = Pt();
|
|
1569
|
+
V(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
1570
|
+
const l = $(() => r.shownIn(o), [r, o]), s = te(r.subscribe, l, l);
|
|
1571
|
+
return /* @__PURE__ */ d("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: s.length > 1 ? n.announcementSequence(s) : s[0] });
|
|
1528
1572
|
}, ee = Object.freeze([]), ot = (e) => {
|
|
1529
1573
|
const t = /* @__PURE__ */ new Set();
|
|
1530
1574
|
let n = ee, r = [], o = !1;
|
|
1531
|
-
const
|
|
1532
|
-
n =
|
|
1533
|
-
for (const
|
|
1534
|
-
},
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
},
|
|
1575
|
+
const l = [], s = (m) => {
|
|
1576
|
+
n = m;
|
|
1577
|
+
for (const g of [...t]) g();
|
|
1578
|
+
}, a = () => l.at(-1)?.region, f = (m) => {
|
|
1579
|
+
const g = a();
|
|
1580
|
+
m(), a() !== g && n !== ee && s(ee);
|
|
1581
|
+
}, h = () => {
|
|
1538
1582
|
o = !1;
|
|
1539
|
-
const
|
|
1540
|
-
r = [],
|
|
1583
|
+
const m = r.map((g) => "sentence" in g ? g.sentence : g.list(g.items));
|
|
1584
|
+
r = [], s(Object.freeze(m));
|
|
1541
1585
|
};
|
|
1542
1586
|
return {
|
|
1543
|
-
announce: (
|
|
1544
|
-
if (typeof
|
|
1587
|
+
announce: (m) => {
|
|
1588
|
+
if (typeof m == "string") r.push({ sentence: m });
|
|
1545
1589
|
else {
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1590
|
+
const g = r.find((b) => "list" in b && b.list === m.list);
|
|
1591
|
+
g !== void 0 && "items" in g ? g.items.push(m.item) : r.push({ list: m.list, items: [m.item] });
|
|
1548
1592
|
}
|
|
1549
|
-
o || (o = !0, n !== ee &&
|
|
1593
|
+
o || (o = !0, n !== ee && s(ee), e.request(h));
|
|
1550
1594
|
},
|
|
1551
|
-
subscribe: (
|
|
1552
|
-
t.delete(
|
|
1595
|
+
subscribe: (m) => (t.add(m), () => {
|
|
1596
|
+
t.delete(m);
|
|
1553
1597
|
}),
|
|
1554
|
-
claim: (
|
|
1555
|
-
const
|
|
1556
|
-
return
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1598
|
+
claim: (m) => {
|
|
1599
|
+
const g = { region: m };
|
|
1600
|
+
return f(() => l.push(g)), () => f(() => {
|
|
1601
|
+
const b = l.indexOf(g);
|
|
1602
|
+
b !== -1 && l.splice(b, 1);
|
|
1559
1603
|
});
|
|
1560
1604
|
},
|
|
1561
|
-
shownIn: (
|
|
1605
|
+
shownIn: (m) => a() === m ? n : ee
|
|
1562
1606
|
};
|
|
1563
|
-
},
|
|
1607
|
+
}, to = Object.freeze({ status: "cancelled" }), no = (e) => {
|
|
1564
1608
|
if (e === null || typeof e != "object") return null;
|
|
1565
1609
|
const { failure: t } = e;
|
|
1566
|
-
if (
|
|
1610
|
+
if (tn(t) !== null) return null;
|
|
1567
1611
|
const { reason: n, code: r } = t;
|
|
1568
|
-
return
|
|
1569
|
-
},
|
|
1570
|
-
const r = n ?? ((
|
|
1571
|
-
let
|
|
1612
|
+
return nn(n, r);
|
|
1613
|
+
}, ro = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
1614
|
+
const r = n ?? ((a, f) => globalThis.fetch(a, f)), o = (a, f) => `${e}/${a}?${new URLSearchParams(f).toString()}`, l = async (a, f, h, m) => {
|
|
1615
|
+
let g;
|
|
1572
1616
|
try {
|
|
1573
|
-
|
|
1617
|
+
g = await r(a, { credentials: "same-origin", ...f, headers: { Accept: "application/json", ...f.headers } });
|
|
1574
1618
|
} catch {
|
|
1575
|
-
return
|
|
1619
|
+
return m({ reason: "failed" });
|
|
1576
1620
|
}
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1621
|
+
g.status === 401 && t(null);
|
|
1622
|
+
const b = g.headers.get(Qt);
|
|
1623
|
+
b !== null && t(b);
|
|
1580
1624
|
let R;
|
|
1581
1625
|
try {
|
|
1582
|
-
R = await
|
|
1626
|
+
R = await g.json();
|
|
1583
1627
|
} catch {
|
|
1584
|
-
return
|
|
1628
|
+
return m({ reason: He(g.status) });
|
|
1585
1629
|
}
|
|
1586
|
-
let
|
|
1630
|
+
let k;
|
|
1587
1631
|
try {
|
|
1588
|
-
|
|
1632
|
+
k = h(R);
|
|
1589
1633
|
} catch {
|
|
1590
|
-
|
|
1634
|
+
k = !1;
|
|
1591
1635
|
}
|
|
1592
|
-
if (
|
|
1593
|
-
const A =
|
|
1594
|
-
return
|
|
1595
|
-
},
|
|
1636
|
+
if (k) return R;
|
|
1637
|
+
const A = no(R);
|
|
1638
|
+
return m(A !== null ? A : { reason: g.status === 200 ? "failed" : He(g.status) });
|
|
1639
|
+
}, s = { [sn]: rn };
|
|
1596
1640
|
return {
|
|
1597
|
-
tree: (
|
|
1598
|
-
children: async (
|
|
1599
|
-
const
|
|
1600
|
-
return
|
|
1641
|
+
tree: (a) => l(o("tree", { [oe.source]: a }), { method: "GET" }, Ie, (f) => ({ status: "error", failure: f })),
|
|
1642
|
+
children: async (a, f, h) => {
|
|
1643
|
+
const m = await l(o("children", { [oe.source]: a, [oe.path]: f }), { method: "GET", signal: h }, en, (g) => ({ status: "error", failure: g }));
|
|
1644
|
+
return h.aborted ? to : m;
|
|
1601
1645
|
},
|
|
1602
|
-
document: (
|
|
1603
|
-
refresh: (
|
|
1646
|
+
document: (a, { refresh: f }) => l(o("document", { [oe.path]: a }), f ? { method: "GET", headers: s } : { method: "GET" }, ln, (h) => on(h.reason, h.code)),
|
|
1647
|
+
refresh: (a) => l(o("refresh", { [oe.source]: a }), { method: "POST", headers: s }, Ie, (f) => ({ status: "error", failure: f }))
|
|
1604
1648
|
};
|
|
1605
|
-
},
|
|
1606
|
-
const t =
|
|
1607
|
-
if (t === null) return
|
|
1649
|
+
}, oo = (e) => {
|
|
1650
|
+
const t = dn(e);
|
|
1651
|
+
if (t === null) return ze;
|
|
1608
1652
|
try {
|
|
1609
|
-
return
|
|
1653
|
+
return Kt(JSON.parse(t));
|
|
1610
1654
|
} catch (n) {
|
|
1611
|
-
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n),
|
|
1655
|
+
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), ze;
|
|
1612
1656
|
}
|
|
1613
1657
|
}, lt = (e, t) => {
|
|
1614
1658
|
let n = null;
|
|
1615
1659
|
const r = () => {
|
|
1616
1660
|
if (n === null) {
|
|
1617
|
-
const
|
|
1618
|
-
n = { changes:
|
|
1661
|
+
const l = oo(e);
|
|
1662
|
+
n = { changes: l, settings: Be(t, l) };
|
|
1619
1663
|
}
|
|
1620
1664
|
return n;
|
|
1621
|
-
}, o =
|
|
1665
|
+
}, o = we();
|
|
1622
1666
|
return {
|
|
1623
1667
|
storageKey: e,
|
|
1624
1668
|
defaults: t,
|
|
1625
1669
|
getSnapshot: () => r().settings,
|
|
1626
1670
|
getServerSnapshot: () => t,
|
|
1627
1671
|
subscribe: o.subscribe,
|
|
1628
|
-
advance: (
|
|
1629
|
-
const { changes:
|
|
1630
|
-
return n = { changes:
|
|
1672
|
+
advance: (l) => {
|
|
1673
|
+
const { changes: s, settings: a } = r(), f = Ut(s, l, Vt(a, l)[l], t);
|
|
1674
|
+
return n = { changes: f, settings: Be(t, f) }, o.emit(), cn(e, Wt(f)), n.settings;
|
|
1631
1675
|
}
|
|
1632
1676
|
};
|
|
1633
|
-
},
|
|
1634
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
1635
|
-
let
|
|
1636
|
-
const
|
|
1637
|
-
let R = !1,
|
|
1677
|
+
}, lo = Object.freeze({ status: "refreshed" }), io = Object.freeze({ status: "superseded" }), Ne = Object.freeze({ status: "deferred" }), so = xt(Ne), Dt = 4, ao = Dt - 1, it = Object.freeze({ status: "loading" }), co = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), uo = (e) => {
|
|
1678
|
+
const t = /* @__PURE__ */ new Map(), n = yt(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = we(), f = /* @__PURE__ */ new Set();
|
|
1679
|
+
let h = 0, m = 0;
|
|
1680
|
+
const g = { direct: null, bulk: null }, b = /* @__PURE__ */ new Set();
|
|
1681
|
+
let R = !1, k = 0;
|
|
1638
1682
|
const A = () => {
|
|
1639
|
-
|
|
1640
|
-
},
|
|
1641
|
-
let
|
|
1642
|
-
return
|
|
1643
|
-
},
|
|
1644
|
-
i.inFlight.delete(
|
|
1645
|
-
},
|
|
1646
|
-
const
|
|
1647
|
-
if (
|
|
1648
|
-
for (const [w, v] of [...
|
|
1649
|
-
|
|
1650
|
-
|
|
1683
|
+
k += 1, a.emit();
|
|
1684
|
+
}, T = (i) => o.get(i) ?? 0, F = (i) => {
|
|
1685
|
+
let c = s.get(i);
|
|
1686
|
+
return c === void 0 && (c = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, s.set(i, c)), c;
|
|
1687
|
+
}, O = (i, c, w) => {
|
|
1688
|
+
i.inFlight.delete(c), h -= 1, w.lane === "bulk" && (m -= 1);
|
|
1689
|
+
}, u = (i) => {
|
|
1690
|
+
const c = s.get(i);
|
|
1691
|
+
if (c !== void 0) {
|
|
1692
|
+
for (const [w, v] of [...c.inFlight])
|
|
1693
|
+
O(c, w, v), v.controller.abort();
|
|
1694
|
+
c.direct.clear(), c.bulk.clear(), c.unclaimed.clear();
|
|
1651
1695
|
}
|
|
1652
|
-
},
|
|
1653
|
-
const
|
|
1654
|
-
return o.set(i,
|
|
1655
|
-
},
|
|
1656
|
-
const w = ae(i), v = { promise: i, opened:
|
|
1696
|
+
}, p = (i) => {
|
|
1697
|
+
const c = T(i) + 1;
|
|
1698
|
+
return o.set(i, c), u(i), c;
|
|
1699
|
+
}, S = (i, c) => {
|
|
1700
|
+
const w = ae(i), v = { promise: i, opened: c, stale: !1, loadedAt: w?.status === "ok" ? w.loadedAt : null };
|
|
1657
1701
|
return i.status === "pending" && i.then((L) => {
|
|
1658
1702
|
L.status === "ok" && (v.loadedAt = L.loadedAt);
|
|
1659
1703
|
}), v;
|
|
1660
|
-
},
|
|
1661
|
-
let
|
|
1662
|
-
return
|
|
1663
|
-
},
|
|
1664
|
-
const
|
|
1665
|
-
for (let L = 0; L <
|
|
1666
|
-
const
|
|
1667
|
-
if (!(
|
|
1668
|
-
for (const
|
|
1669
|
-
if ((
|
|
1670
|
-
return
|
|
1704
|
+
}, E = (i) => {
|
|
1705
|
+
let c = r.get(i);
|
|
1706
|
+
return c === void 0 && (c = /* @__PURE__ */ new Map(), r.set(i, c)), c;
|
|
1707
|
+
}, y = (i) => {
|
|
1708
|
+
const c = [...s.keys()], w = g[i], v = w === null ? 0 : c.indexOf(w) + 1;
|
|
1709
|
+
for (let L = 0; L < c.length; L += 1) {
|
|
1710
|
+
const N = c[(v + L) % c.length], _ = N === void 0 ? void 0 : s.get(N);
|
|
1711
|
+
if (!(N === void 0 || _ === void 0)) {
|
|
1712
|
+
for (const B of _[i])
|
|
1713
|
+
if ((_.claims.get(B) ?? 0) !== 0)
|
|
1714
|
+
return _[i].delete(B), g[i] = N, { sourceId: N, path: B };
|
|
1671
1715
|
}
|
|
1672
1716
|
}
|
|
1673
1717
|
return null;
|
|
1674
|
-
},
|
|
1675
|
-
const L =
|
|
1676
|
-
if (L === void 0 || L.inFlight.get(
|
|
1677
|
-
|
|
1678
|
-
const
|
|
1679
|
-
if (v.status === "ok" ?
|
|
1680
|
-
const
|
|
1681
|
-
for (const G of [...
|
|
1718
|
+
}, P = (i, c, w, v) => {
|
|
1719
|
+
const L = s.get(i);
|
|
1720
|
+
if (L === void 0 || L.inFlight.get(c) !== w) return;
|
|
1721
|
+
O(L, c, w);
|
|
1722
|
+
const N = (L.claims.get(c) ?? 0) > 0, _ = E(i);
|
|
1723
|
+
if (v.status === "ok" ? _.set(c, { status: "loaded", entries: v.entries }) : v.status === "error" && N ? _.set(c, { status: "failed", failure: v.failure }) : _.delete(c), A(), v.status === "error" && N) {
|
|
1724
|
+
const B = { sourceId: i, path: c, failure: v.failure };
|
|
1725
|
+
for (const G of [...f]) G(B);
|
|
1682
1726
|
}
|
|
1683
|
-
|
|
1684
|
-
},
|
|
1727
|
+
M();
|
|
1728
|
+
}, z = (i, c, w) => {
|
|
1685
1729
|
const v = { controller: new AbortController(), lane: w };
|
|
1686
|
-
|
|
1687
|
-
(L) =>
|
|
1688
|
-
() =>
|
|
1730
|
+
F(i).inFlight.set(c, v), h += 1, w === "bulk" && (m += 1), e.children(i, c, v.controller.signal).then(
|
|
1731
|
+
(L) => P(i, c, v, L),
|
|
1732
|
+
() => P(i, c, v, co)
|
|
1689
1733
|
);
|
|
1690
|
-
},
|
|
1691
|
-
for (;
|
|
1692
|
-
const i =
|
|
1734
|
+
}, M = () => {
|
|
1735
|
+
for (; h < Dt; ) {
|
|
1736
|
+
const i = y("direct");
|
|
1693
1737
|
if (i !== null) {
|
|
1694
|
-
|
|
1738
|
+
z(i.sourceId, i.path, "direct");
|
|
1695
1739
|
continue;
|
|
1696
1740
|
}
|
|
1697
|
-
const
|
|
1698
|
-
if (
|
|
1699
|
-
|
|
1741
|
+
const c = m < ao ? y("bulk") : null;
|
|
1742
|
+
if (c === null) return;
|
|
1743
|
+
z(c.sourceId, c.path, "bulk");
|
|
1700
1744
|
}
|
|
1701
|
-
},
|
|
1702
|
-
if (!(
|
|
1703
|
-
const L =
|
|
1745
|
+
}, j = (i, c, w) => {
|
|
1746
|
+
if (!(c.direct.delete(w) || c.bulk.delete(w))) {
|
|
1747
|
+
const L = c.inFlight.get(w);
|
|
1704
1748
|
if (L === void 0) return !1;
|
|
1705
|
-
|
|
1749
|
+
O(c, w, L), L.controller.abort();
|
|
1706
1750
|
}
|
|
1707
1751
|
return r.get(i)?.delete(w), !0;
|
|
1708
|
-
},
|
|
1752
|
+
}, C = () => {
|
|
1709
1753
|
R = !1;
|
|
1710
1754
|
let i = !1;
|
|
1711
|
-
for (const
|
|
1712
|
-
const w =
|
|
1755
|
+
for (const c of b) {
|
|
1756
|
+
const w = F(c);
|
|
1713
1757
|
for (const v of w.unclaimed)
|
|
1714
|
-
(w.claims.get(v) ?? 0) === 0 &&
|
|
1758
|
+
(w.claims.get(v) ?? 0) === 0 && j(c, w, v) && (i = !0);
|
|
1715
1759
|
w.unclaimed.clear();
|
|
1716
1760
|
}
|
|
1717
|
-
|
|
1718
|
-
},
|
|
1719
|
-
t.set(i,
|
|
1720
|
-
}, J = (i,
|
|
1721
|
-
|
|
1722
|
-
const v =
|
|
1723
|
-
return t.set(i, v), r.delete(i), A(),
|
|
1724
|
-
},
|
|
1725
|
-
if (w !==
|
|
1726
|
-
const L = ae(
|
|
1727
|
-
if (!(v.status !== "ok" || L?.status !== "ok" ||
|
|
1761
|
+
b.clear(), i && (A(), M());
|
|
1762
|
+
}, q = (i, c) => {
|
|
1763
|
+
t.set(i, S(ie(e.tree(i)), c));
|
|
1764
|
+
}, J = (i, c, w) => {
|
|
1765
|
+
p(i);
|
|
1766
|
+
const v = S(xt(c), w);
|
|
1767
|
+
return t.set(i, v), r.delete(i), A(), M(), v;
|
|
1768
|
+
}, re = (i, c, w, v) => {
|
|
1769
|
+
if (w !== T(i) || t.get(i) !== c) return;
|
|
1770
|
+
const L = ae(c.promise);
|
|
1771
|
+
if (!(v.status !== "ok" || L?.status !== "ok" || c.loadedAt === null || v.loadedAt <= c.loadedAt)) {
|
|
1728
1772
|
if (me(L.entries, v.entries)) {
|
|
1729
|
-
|
|
1773
|
+
c.loadedAt = v.loadedAt;
|
|
1730
1774
|
return;
|
|
1731
1775
|
}
|
|
1732
|
-
J(i, v,
|
|
1776
|
+
J(i, v, c.opened);
|
|
1733
1777
|
}
|
|
1734
|
-
}, K = (i,
|
|
1778
|
+
}, K = (i, c) => {
|
|
1735
1779
|
const w = t.get(i);
|
|
1736
|
-
return w !== void 0 && ae(w.promise)?.status ===
|
|
1737
|
-
}, xe = (i,
|
|
1738
|
-
|
|
1739
|
-
const w =
|
|
1740
|
-
e.tree(i).then((v) =>
|
|
1780
|
+
return w !== void 0 && ae(w.promise)?.status === c;
|
|
1781
|
+
}, xe = (i, c) => {
|
|
1782
|
+
c.stale = !1;
|
|
1783
|
+
const w = T(i);
|
|
1784
|
+
e.tree(i).then((v) => re(i, c, w, v));
|
|
1741
1785
|
};
|
|
1742
1786
|
return {
|
|
1743
|
-
read: (i) => t.get(i)?.promise ??
|
|
1787
|
+
read: (i) => t.get(i)?.promise ?? so,
|
|
1744
1788
|
open: (i) => {
|
|
1745
|
-
const
|
|
1746
|
-
return v === void 0 || K(i, "deferred") ? (
|
|
1789
|
+
const c = n.resumes(i), w = n.hold(i), v = t.get(i);
|
|
1790
|
+
return v === void 0 || K(i, "deferred") ? (q(i, !0), A()) : c || (v.opened && K(i, "error") ? (q(i, !0), A()) : (v.opened = !0, v.stale && K(i, "ok") && xe(i, v))), w;
|
|
1747
1791
|
},
|
|
1748
1792
|
retry: (i) => {
|
|
1749
|
-
K(i, "error") && (
|
|
1793
|
+
K(i, "error") && (q(i, !0), A());
|
|
1750
1794
|
},
|
|
1751
|
-
seed: (i,
|
|
1752
|
-
const w =
|
|
1753
|
-
(
|
|
1754
|
-
() =>
|
|
1795
|
+
seed: (i, c) => {
|
|
1796
|
+
const w = c.then(
|
|
1797
|
+
(N) => N === null ? Ne : N,
|
|
1798
|
+
() => Ne
|
|
1755
1799
|
), v = t.get(i);
|
|
1756
1800
|
if (v !== void 0 && K(i, "ok")) {
|
|
1757
|
-
const
|
|
1758
|
-
w.then((
|
|
1801
|
+
const N = T(i);
|
|
1802
|
+
w.then((_) => re(i, v, N, _));
|
|
1759
1803
|
return;
|
|
1760
1804
|
}
|
|
1761
|
-
|
|
1762
|
-
const L =
|
|
1763
|
-
t.set(i, L), r.delete(i),
|
|
1764
|
-
t.get(i) === L && (
|
|
1805
|
+
p(i);
|
|
1806
|
+
const L = S(ie(w), v?.opened === !0);
|
|
1807
|
+
t.set(i, L), r.delete(i), M(), w.then((N) => {
|
|
1808
|
+
t.get(i) === L && (N.status === "deferred" && n.isHeld(i) && q(i, L.opened), A());
|
|
1765
1809
|
});
|
|
1766
1810
|
},
|
|
1767
1811
|
refresh: async (i) => {
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1812
|
+
const c = (l.get(i) ?? 0) + 1;
|
|
1813
|
+
l.set(i, c);
|
|
1770
1814
|
const w = await e.refresh(i);
|
|
1771
|
-
if (
|
|
1815
|
+
if (l.get(i) !== c) return io;
|
|
1772
1816
|
if (w.status === "error") return { status: "failed", failure: w.failure };
|
|
1773
1817
|
const v = t.get(i);
|
|
1774
1818
|
if (!(v !== void 0 && v.loadedAt !== null && K(i, "ok") && v.loadedAt > w.loadedAt)) {
|
|
1775
|
-
const
|
|
1819
|
+
const N = J(i, w, !0);
|
|
1776
1820
|
if (v !== void 0 && v.promise.status === "pending") {
|
|
1777
|
-
const
|
|
1778
|
-
v.promise.then((
|
|
1821
|
+
const _ = T(i);
|
|
1822
|
+
v.promise.then((B) => re(i, N, _, B));
|
|
1779
1823
|
}
|
|
1780
1824
|
}
|
|
1781
|
-
for (const [
|
|
1782
|
-
|
|
1783
|
-
return
|
|
1825
|
+
for (const [N, _] of t)
|
|
1826
|
+
N !== i && ae(_.promise)?.status === "ok" && (_.stale = !0);
|
|
1827
|
+
return lo;
|
|
1784
1828
|
},
|
|
1785
|
-
children: (i,
|
|
1786
|
-
claimChildren: (i,
|
|
1787
|
-
const w =
|
|
1788
|
-
let L = !1,
|
|
1789
|
-
for (const [
|
|
1790
|
-
w.claims.set(
|
|
1791
|
-
L && A(),
|
|
1792
|
-
let
|
|
1829
|
+
children: (i, c) => r.get(i)?.get(c),
|
|
1830
|
+
claimChildren: (i, c) => {
|
|
1831
|
+
const w = F(i), v = E(i);
|
|
1832
|
+
let L = !1, N = !1;
|
|
1833
|
+
for (const [B, G] of c)
|
|
1834
|
+
w.claims.set(B, (w.claims.get(B) ?? 0) + 1), v.get(B) === void 0 ? (v.set(B, it), w[G].add(B), L = !0, N = !0) : G === "direct" && w.bulk.delete(B) && (w.direct.add(B), N = !0);
|
|
1835
|
+
L && A(), N && M();
|
|
1836
|
+
let _ = !1;
|
|
1793
1837
|
return () => {
|
|
1794
|
-
if (!
|
|
1795
|
-
|
|
1796
|
-
for (const
|
|
1797
|
-
const G = (w.claims.get(
|
|
1798
|
-
G > 0 ? w.claims.set(
|
|
1838
|
+
if (!_) {
|
|
1839
|
+
_ = !0;
|
|
1840
|
+
for (const B of c.keys()) {
|
|
1841
|
+
const G = (w.claims.get(B) ?? 0) - 1;
|
|
1842
|
+
G > 0 ? w.claims.set(B, G) : (w.claims.delete(B), w.unclaimed.add(B));
|
|
1799
1843
|
}
|
|
1800
|
-
|
|
1844
|
+
b.add(i), !R && (R = !0, queueMicrotask(C));
|
|
1801
1845
|
}
|
|
1802
1846
|
};
|
|
1803
1847
|
},
|
|
1804
|
-
retryChildren: (i,
|
|
1848
|
+
retryChildren: (i, c) => {
|
|
1805
1849
|
const w = r.get(i);
|
|
1806
|
-
if (w === void 0 || w.get(
|
|
1807
|
-
const v =
|
|
1808
|
-
if ((v.claims.get(
|
|
1809
|
-
w.set(
|
|
1850
|
+
if (w === void 0 || w.get(c)?.status !== "failed") return;
|
|
1851
|
+
const v = F(i);
|
|
1852
|
+
if ((v.claims.get(c) ?? 0) > 0) {
|
|
1853
|
+
w.set(c, it), v.direct.add(c), A(), M();
|
|
1810
1854
|
return;
|
|
1811
1855
|
}
|
|
1812
|
-
w.delete(
|
|
1856
|
+
w.delete(c), A();
|
|
1813
1857
|
},
|
|
1814
1858
|
pendingChildren: (i) => {
|
|
1815
|
-
const
|
|
1816
|
-
return
|
|
1859
|
+
const c = s.get(i);
|
|
1860
|
+
return c === void 0 ? 0 : c.direct.size + c.bulk.size + c.inFlight.size;
|
|
1817
1861
|
},
|
|
1818
1862
|
clear: () => {
|
|
1819
|
-
for (const i of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...
|
|
1820
|
-
for (const [i,
|
|
1863
|
+
for (const i of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...s.keys()])) p(i);
|
|
1864
|
+
for (const [i, c] of l) l.set(i, c + 1);
|
|
1821
1865
|
t.clear(), r.clear(), A();
|
|
1822
1866
|
},
|
|
1823
|
-
subscribeChildrenFailures: (i) => (
|
|
1824
|
-
|
|
1867
|
+
subscribeChildrenFailures: (i) => (f.add(i), () => {
|
|
1868
|
+
f.delete(i);
|
|
1825
1869
|
}),
|
|
1826
|
-
subscribe:
|
|
1827
|
-
version: () =>
|
|
1870
|
+
subscribe: a.subscribe,
|
|
1871
|
+
version: () => k
|
|
1828
1872
|
};
|
|
1829
|
-
},
|
|
1873
|
+
}, fo = (e, t) => {
|
|
1830
1874
|
let n = e;
|
|
1831
|
-
const r =
|
|
1875
|
+
const r = we();
|
|
1832
1876
|
return {
|
|
1833
1877
|
getSnapshot: () => n,
|
|
1834
1878
|
subscribe: r.subscribe,
|
|
@@ -1836,102 +1880,102 @@ const xr = /* @__PURE__ */ y.forwardRef(yr), kr = (e) => {
|
|
|
1836
1880
|
n = { ...n, ...o }, t(n), r.emit();
|
|
1837
1881
|
}
|
|
1838
1882
|
};
|
|
1839
|
-
},
|
|
1883
|
+
}, mo = 1;
|
|
1840
1884
|
let ce = 0, X = null;
|
|
1841
|
-
const
|
|
1885
|
+
const go = () => {
|
|
1842
1886
|
const { documentElement: e, body: t } = document;
|
|
1843
1887
|
ce === 0 && (X = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), ce += 1;
|
|
1844
1888
|
let n = !1;
|
|
1845
1889
|
return () => {
|
|
1846
1890
|
n || (n = !0, ce -= 1, !(ce > 0 || X === null) && (e.style.overflow = X.htmlOverflow, t.style.overflow = X.bodyOverflow, e.style.scrollbarGutter = X.htmlGutter, t.style.scrollbarGutter = X.bodyGutter, X = null));
|
|
1847
1891
|
};
|
|
1848
|
-
},
|
|
1892
|
+
}, ho = [
|
|
1849
1893
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
1850
1894
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
1851
|
-
], st = 1, at = (e) => e.getClientRects().length > 0, Re = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.",
|
|
1895
|
+
], st = 1, at = (e) => e.getClientRects().length > 0, Re = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", po = (e) => {
|
|
1852
1896
|
if (!at(e)) return null;
|
|
1853
1897
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
1854
|
-
if (t.bottom > n +
|
|
1898
|
+
if (t.bottom > n + mo)
|
|
1855
1899
|
return `[markdown-explorer] the explorer ends ${String(Math.round(t.bottom))}px down a ${String(n)}px viewport while lockDocumentScroll stops the page from scrolling, so the rest cannot be reached. ${Re}`;
|
|
1856
1900
|
if (t.height < st)
|
|
1857
1901
|
return `[markdown-explorer] the explorer collapsed to ${String(Math.round(t.height))}px while lockDocumentScroll stops the page from scrolling, so nothing can be read. ${Re}`;
|
|
1858
|
-
for (const { selector: r, name: o } of
|
|
1859
|
-
for (const
|
|
1860
|
-
if (!at(
|
|
1861
|
-
const
|
|
1862
|
-
if (
|
|
1863
|
-
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(
|
|
1902
|
+
for (const { selector: r, name: o } of ho)
|
|
1903
|
+
for (const l of e.querySelectorAll(r)) {
|
|
1904
|
+
if (!at(l)) continue;
|
|
1905
|
+
const s = l.getBoundingClientRect().height;
|
|
1906
|
+
if (s < st)
|
|
1907
|
+
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(s))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Re}`;
|
|
1864
1908
|
}
|
|
1865
1909
|
return null;
|
|
1866
|
-
},
|
|
1910
|
+
}, wo = (e) => {
|
|
1867
1911
|
let t = !1;
|
|
1868
1912
|
const n = () => {
|
|
1869
1913
|
if (t) return;
|
|
1870
|
-
const o =
|
|
1914
|
+
const o = po(e);
|
|
1871
1915
|
o !== null && (t = !0, console.error(o));
|
|
1872
1916
|
}, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
|
|
1873
1917
|
return r?.observe(e), window.addEventListener("resize", n), n(), () => {
|
|
1874
1918
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
1875
1919
|
};
|
|
1876
|
-
},
|
|
1877
|
-
Y(() => e ?
|
|
1920
|
+
}, vo = (e, t) => {
|
|
1921
|
+
Y(() => e ? go() : void 0, [e]), Y(() => {
|
|
1878
1922
|
const n = t.current;
|
|
1879
1923
|
if (!(!e || n === null))
|
|
1880
|
-
return
|
|
1924
|
+
return wo(n);
|
|
1881
1925
|
}, [e, t]);
|
|
1882
|
-
}, ct = '[data-testid="markdown-explorer-view-switch"]',
|
|
1926
|
+
}, ct = '[data-testid="markdown-explorer-view-switch"]', bo = [
|
|
1883
1927
|
{ control: ct, successors: [ct, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
1884
1928
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
1885
|
-
],
|
|
1886
|
-
for (const t of
|
|
1929
|
+
], Eo = (e) => {
|
|
1930
|
+
for (const t of bo) {
|
|
1887
1931
|
const n = e.closest(t.control);
|
|
1888
1932
|
if (n !== null) return { element: n, control: t };
|
|
1889
1933
|
}
|
|
1890
1934
|
return null;
|
|
1891
|
-
},
|
|
1892
|
-
const n =
|
|
1935
|
+
}, So = (e, t) => {
|
|
1936
|
+
const n = H(null);
|
|
1893
1937
|
Y(() => {
|
|
1894
|
-
const o = (
|
|
1895
|
-
const
|
|
1896
|
-
n.current =
|
|
1897
|
-
},
|
|
1938
|
+
const o = (a) => {
|
|
1939
|
+
const f = e.current;
|
|
1940
|
+
n.current = f !== null && a instanceof Element && f.contains(a) ? Eo(a) : null;
|
|
1941
|
+
}, l = (a) => o(a.target);
|
|
1898
1942
|
o(document.activeElement);
|
|
1899
|
-
const
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1902
|
-
n.current?.element ===
|
|
1943
|
+
const s = (a) => {
|
|
1944
|
+
const f = a.target;
|
|
1945
|
+
a.relatedTarget !== null || !(f instanceof Element) || queueMicrotask(() => {
|
|
1946
|
+
n.current?.element === f && f.isConnected && document.activeElement !== f && (n.current = null);
|
|
1903
1947
|
});
|
|
1904
1948
|
};
|
|
1905
|
-
return document.addEventListener("focusin",
|
|
1906
|
-
document.removeEventListener("focusin",
|
|
1949
|
+
return document.addEventListener("focusin", l), document.addEventListener("focusout", s), () => {
|
|
1950
|
+
document.removeEventListener("focusin", l), document.removeEventListener("focusout", s);
|
|
1907
1951
|
};
|
|
1908
1952
|
}, [e]);
|
|
1909
|
-
const r =
|
|
1910
|
-
|
|
1953
|
+
const r = H(t);
|
|
1954
|
+
V(() => {
|
|
1911
1955
|
if (r.current === t) return;
|
|
1912
1956
|
r.current = t;
|
|
1913
1957
|
const o = n.current;
|
|
1914
1958
|
if (o === null) return;
|
|
1915
|
-
const
|
|
1916
|
-
const
|
|
1917
|
-
if (
|
|
1918
|
-
const
|
|
1919
|
-
if (
|
|
1920
|
-
for (const
|
|
1921
|
-
for (const
|
|
1922
|
-
if (
|
|
1959
|
+
const l = () => {
|
|
1960
|
+
const f = document.activeElement;
|
|
1961
|
+
if (f !== null && f !== document.body && f !== o.element) return !0;
|
|
1962
|
+
const h = e.current;
|
|
1963
|
+
if (h === null) return !0;
|
|
1964
|
+
for (const m of o.control.successors)
|
|
1965
|
+
for (const g of h.querySelectorAll(m))
|
|
1966
|
+
if (g !== o.element && (g.focus({ preventScroll: !0 }), document.activeElement === g))
|
|
1923
1967
|
return !0;
|
|
1924
1968
|
return !1;
|
|
1925
1969
|
};
|
|
1926
|
-
if (
|
|
1927
|
-
const
|
|
1928
|
-
if (
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1970
|
+
if (l()) return;
|
|
1971
|
+
const s = e.current;
|
|
1972
|
+
if (s === null) return;
|
|
1973
|
+
const a = new MutationObserver(() => {
|
|
1974
|
+
l() && a.disconnect();
|
|
1931
1975
|
});
|
|
1932
|
-
return
|
|
1976
|
+
return a.observe(s, { childList: !0, subtree: !0 }), () => a.disconnect();
|
|
1933
1977
|
}, [t, e]);
|
|
1934
|
-
},
|
|
1978
|
+
}, yo = ft(() => import("./TreeLayout-D6hCSihW.js").then((e) => ({ default: e.TreeLayout }))), xo = ft(() => import("./MultiLayout-BxeXOLX1.js").then((e) => ({ default: e.MultiLayout }))), ko = 64, dt = {
|
|
1935
1979
|
request: (e) => {
|
|
1936
1980
|
requestAnimationFrame(e);
|
|
1937
1981
|
}
|
|
@@ -1940,122 +1984,124 @@ const oo = () => {
|
|
|
1940
1984
|
}, Te = (e, t) => {
|
|
1941
1985
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
1942
1986
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
1943
|
-
},
|
|
1944
|
-
const [n, r] =
|
|
1945
|
-
if (n.locale === e &&
|
|
1946
|
-
const o = { overrides: t, locale: e, labels:
|
|
1987
|
+
}, Ro = (e, t) => {
|
|
1988
|
+
const [n, r] = Z(() => ({ overrides: t, locale: e, labels: Ve(e, t) }));
|
|
1989
|
+
if (n.locale === e && Sn(n.overrides, t)) return n.labels;
|
|
1990
|
+
const o = { overrides: t, locale: e, labels: Ve(e, t) };
|
|
1947
1991
|
return r(o), o.labels;
|
|
1948
|
-
},
|
|
1949
|
-
const [r, o] =
|
|
1992
|
+
}, To = (e, t, n) => {
|
|
1993
|
+
const [r, o] = Z(() => ({ scope: t, store: lt(e, n) }));
|
|
1950
1994
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
1951
|
-
const
|
|
1952
|
-
return o(
|
|
1953
|
-
},
|
|
1954
|
-
const [t, n] =
|
|
1995
|
+
const l = { scope: t, store: lt(e, n) };
|
|
1996
|
+
return o(l), l.store;
|
|
1997
|
+
}, Ao = (e) => {
|
|
1998
|
+
const [t, n] = Z(() => ({ scope: e, announcer: ot(dt) }));
|
|
1955
1999
|
if (t.scope === e) return t.announcer;
|
|
1956
2000
|
const r = { scope: e, announcer: ot(dt) };
|
|
1957
2001
|
return n(r), r.announcer;
|
|
1958
|
-
},
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
-
}), A = he(t.dataPath), [
|
|
1962
|
-
const
|
|
1963
|
-
return Te(
|
|
2002
|
+
}, Bo = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: s, renderTreeFailure: a, lockDocumentScroll: f = !1, onMathDiagnostics: h }) => {
|
|
2003
|
+
un(n);
|
|
2004
|
+
const m = vt(r), g = yn(l), b = Ro(m, o), { revalidate: R } = zt(), k = H(() => {
|
|
2005
|
+
}), A = he(t.dataPath), [T] = Z(() => {
|
|
2006
|
+
const C = ro({ dataPath: A, onScope: (J) => k.current(J) }), q = { documents: Ln({ client: C, capacity: Math.max(ko, t.multiView.maxPanels * 2) }), trees: uo(C) };
|
|
2007
|
+
return Te(q, e), Ze(n, e.scope), { data: C, ...q, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
1964
2008
|
});
|
|
1965
|
-
if (
|
|
1966
|
-
const
|
|
1967
|
-
|
|
2009
|
+
if (T.aligned.pageData !== e || T.aligned.storageNamespace !== n) {
|
|
2010
|
+
const C = T.aligned.pageData;
|
|
2011
|
+
T.aligned.pageData = e, T.aligned.storageNamespace = n, C !== e && (C.scope !== e.scope ? T.aligned.pendingReader = e : Te(T, e)), Ze(n, e.scope);
|
|
1968
2012
|
}
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1973
|
-
}, [e,
|
|
1974
|
-
let
|
|
1975
|
-
return
|
|
1976
|
-
|
|
2013
|
+
const F = To(fn(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
2014
|
+
V(() => {
|
|
2015
|
+
const C = T.aligned.pendingReader;
|
|
2016
|
+
C !== null && (T.aligned.pendingReader = null, ut(T), Te(T, C));
|
|
2017
|
+
}, [e, T]), V(() => {
|
|
2018
|
+
let C = !1;
|
|
2019
|
+
return k.current = (q) => {
|
|
2020
|
+
q === e.scope || C || (C = !0, q !== null && (ut(T), mn(n)), R());
|
|
1977
2021
|
}, () => {
|
|
1978
|
-
|
|
2022
|
+
k.current = () => {
|
|
1979
2023
|
};
|
|
1980
2024
|
};
|
|
1981
|
-
}, [e, R,
|
|
1982
|
-
const
|
|
1983
|
-
|
|
1984
|
-
|
|
2025
|
+
}, [e, R, T, n]);
|
|
2026
|
+
const O = H(t.settingsCookie);
|
|
2027
|
+
V(() => {
|
|
2028
|
+
O.current = t.settingsCookie;
|
|
1985
2029
|
}, [t.settingsCookie]);
|
|
1986
|
-
const [
|
|
1987
|
-
() =>
|
|
1988
|
-
document.cookie =
|
|
2030
|
+
const [u] = Z(
|
|
2031
|
+
() => fo(e.settings, (C) => {
|
|
2032
|
+
document.cookie = Xt(O.current, C, window.location.protocol === "https:");
|
|
1989
2033
|
})
|
|
1990
|
-
),
|
|
1991
|
-
`),
|
|
1992
|
-
`)), [t,
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
}, [
|
|
1996
|
-
const [
|
|
1997
|
-
|
|
1998
|
-
}),
|
|
2034
|
+
), p = Ao(e.scope), S = I(() => ie(e.notices.catch(() => [])), [e.notices]), E = e.sources.map((C) => C.id).join(`
|
|
2035
|
+
`), y = I(() => Gt(t, E.split(`
|
|
2036
|
+
`)), [t, E]), P = H(h);
|
|
2037
|
+
V(() => {
|
|
2038
|
+
P.current = h;
|
|
2039
|
+
}, [h]);
|
|
2040
|
+
const [z] = Z(() => (C, q) => {
|
|
2041
|
+
P.current?.(C, q);
|
|
2042
|
+
}), M = h === void 0 ? void 0 : z, j = I(
|
|
1999
2043
|
() => ({
|
|
2000
|
-
config:
|
|
2001
|
-
labels:
|
|
2002
|
-
locale:
|
|
2003
|
-
theme:
|
|
2044
|
+
config: y,
|
|
2045
|
+
labels: b,
|
|
2046
|
+
locale: m,
|
|
2047
|
+
theme: g,
|
|
2004
2048
|
storageNamespace: n,
|
|
2005
2049
|
scope: e.scope,
|
|
2006
2050
|
sources: e.sources,
|
|
2007
|
-
notices:
|
|
2008
|
-
documents:
|
|
2009
|
-
trees:
|
|
2010
|
-
data:
|
|
2011
|
-
viewSettings:
|
|
2012
|
-
treeSettings:
|
|
2013
|
-
announcer:
|
|
2014
|
-
renderTreeFailure:
|
|
2015
|
-
reportMathDiagnostics:
|
|
2051
|
+
notices: S,
|
|
2052
|
+
documents: T.documents,
|
|
2053
|
+
trees: T.trees,
|
|
2054
|
+
data: T.data,
|
|
2055
|
+
viewSettings: u,
|
|
2056
|
+
treeSettings: F,
|
|
2057
|
+
announcer: p,
|
|
2058
|
+
renderTreeFailure: a,
|
|
2059
|
+
reportMathDiagnostics: M
|
|
2016
2060
|
}),
|
|
2017
|
-
[
|
|
2061
|
+
[y, b, m, g, n, e.scope, e.sources, S, T, u, F, p, a, M]
|
|
2018
2062
|
);
|
|
2019
|
-
return /* @__PURE__ */ d(
|
|
2020
|
-
},
|
|
2021
|
-
const [o] =
|
|
2063
|
+
return /* @__PURE__ */ d(bt, { value: j, children: /* @__PURE__ */ d(Lo, { renderFrame: s, lockDocumentScroll: f }, e.scope) });
|
|
2064
|
+
}, Oo = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
2065
|
+
const [o] = Z(nr);
|
|
2022
2066
|
return /* @__PURE__ */ d("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
|
|
2023
|
-
},
|
|
2024
|
-
const { theme: n, labels: r } = D(), o =
|
|
2025
|
-
|
|
2026
|
-
o.kind === "redirect" && s(o.href
|
|
2027
|
-
}, [o, s]);
|
|
2028
|
-
const { location:
|
|
2029
|
-
|
|
2030
|
-
const
|
|
2031
|
-
|
|
2032
|
-
/* @__PURE__ */ d(
|
|
2067
|
+
}, Lo = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
2068
|
+
const { theme: n, labels: r } = D(), o = $e(), { hash: l } = mt(), s = Fe(), a = H(null);
|
|
2069
|
+
vo(t, a), V(() => {
|
|
2070
|
+
o.kind === "redirect" && s(`${o.href}${l}`, "browse");
|
|
2071
|
+
}, [o, l, s]);
|
|
2072
|
+
const { location: f } = o, h = f.view;
|
|
2073
|
+
So(a, h);
|
|
2074
|
+
const m = f.view === "tree" ? /* @__PURE__ */ d(Ae, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ d(yo, { location: f }) }) : f.view === "multi" ? /* @__PURE__ */ d(Ae, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ d(xo, { location: f }) }) : /* @__PURE__ */ d(Qr, { location: f }), g = /* @__PURE__ */ U(Oo, { ref: a, theme: n, view: h, children: [
|
|
2075
|
+
m,
|
|
2076
|
+
/* @__PURE__ */ d(eo, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
2033
2077
|
] });
|
|
2034
|
-
return e === void 0 ?
|
|
2035
|
-
},
|
|
2078
|
+
return e === void 0 ? g : e({ view: h, children: g });
|
|
2079
|
+
}, zo = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
|
|
2036
2080
|
export {
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2081
|
+
Jr as D,
|
|
2082
|
+
Rn as E,
|
|
2083
|
+
Tn as F,
|
|
2084
|
+
or as I,
|
|
2085
|
+
eo as L,
|
|
2086
|
+
vn as M,
|
|
2087
|
+
Xr as P,
|
|
2088
|
+
Fe as a,
|
|
2089
|
+
Ur as b,
|
|
2090
|
+
we as c,
|
|
2091
|
+
Wr as d,
|
|
2092
|
+
jo as e,
|
|
2093
|
+
St as f,
|
|
2094
|
+
An as g,
|
|
2095
|
+
pe as h,
|
|
2096
|
+
$e as i,
|
|
2097
|
+
fe as j,
|
|
2098
|
+
gn as k,
|
|
2099
|
+
We as l,
|
|
2100
|
+
wt as m,
|
|
2101
|
+
hn as n,
|
|
2102
|
+
Ue as o,
|
|
2103
|
+
Bo as p,
|
|
2104
|
+
Ve as r,
|
|
2105
|
+
zo as s,
|
|
2060
2106
|
D as u
|
|
2061
2107
|
};
|