@aiquants/markdown-explorer 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -1
- package/README.md +65 -6
- package/dist/EditSurface-By6NPcD7.js +633 -0
- package/dist/EditSurface-BztcpQPW.cjs +2 -0
- package/dist/{ExplorerSplit-DwlWWfRv.js → ExplorerSplit-BjjqNRtj.js} +52 -52
- package/dist/{ExplorerSplit-51frK8xf.cjs → ExplorerSplit-CqmbUSZ7.cjs} +1 -1
- package/dist/{MultiLayout-CeR_l6Rb.js → MultiLayout-BYXoD1aS.js} +4 -4
- package/dist/{MultiLayout-B4PtS45V.cjs → MultiLayout-BZbEl73E.cjs} +1 -1
- package/dist/{NativeScrollBar-Dp4YWBp7.cjs → NativeScrollBar-B7jTbQmn.cjs} +1 -1
- package/dist/{NativeScrollBar-CVWeTlHC.js → NativeScrollBar-RP37nwmY.js} +1 -1
- package/dist/{TreeLayout-D-NyhuVM.cjs → TreeLayout-CEp5oKly.cjs} +1 -1
- package/dist/{TreeLayout-min5AOhr.js → TreeLayout-Uo6RG7lq.js} +3 -3
- package/dist/client/MarkdownExplorer.d.cts +3 -2
- package/dist/client/MarkdownExplorer.d.ts +3 -2
- package/dist/core/contracts.d.cts +16 -0
- package/dist/core/contracts.d.ts +16 -0
- package/dist/dataRoute-CH3yOKR0.cjs +1 -0
- package/dist/{dataRoute-CU9CKP44.js → dataRoute-Pm_0ue_4.js} +93 -92
- package/dist/{index-DJ_FUtYM.cjs → index-CGBl3fYT.cjs} +8 -8
- package/dist/{index-BPj19kIo.js → index-CjCr8czx.js} +962 -908
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/{location-LNl0QOXI.cjs → location-BUNWJ4eB.cjs} +1 -1
- package/dist/{location-BT23fKeh.js → location-DWd6SQhN.js} +1 -1
- package/dist/{merge-AnqxGn__.cjs → merge-DRGBbLuR.cjs} +1 -1
- package/dist/{merge-hyUGPGbJ.js → merge-q-5i8qsn.js} +1 -1
- package/dist/sanitizePolicy-BfUlXI5E.cjs +1 -0
- package/dist/sanitizePolicy-djLC3fRN.js +96 -0
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +143 -226
- package/dist/server.cjs +1 -1
- package/dist/server.js +3 -3
- package/dist/styles/markdown-explorer.css +1 -1
- package/docs/behavior/dom-hooks.md +1 -1
- package/docs/behavior/layout.md +4 -1
- package/docs/behavior/security.md +2 -0
- package/package.json +3 -3
- package/dist/EditSurface-BK_Pz_LF.js +0 -371
- package/dist/EditSurface-CfbYYXrc.cjs +0 -2
- package/dist/dataRoute-CIFFX5bd.cjs +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as F, jsx as a, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as me, use as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { f as
|
|
6
|
-
import {
|
|
7
|
-
import { HostedScrollArea as vt, useMarkdownToolbarState as
|
|
8
|
-
import { SOURCE_LINES_ATTRIBUTE as
|
|
9
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
10
|
-
import { w as
|
|
11
|
-
const bt = Object.freeze(["en", "ja"]),
|
|
2
|
+
import * as E from "react";
|
|
3
|
+
import { createContext as me, use as ne, useMemo as z, useSyncExternalStore as ee, useRef as _, useId as Oe, useLayoutEffect as U, useCallback as P, useEffect as te, Component as Zt, Suspense as ge, lazy as tt, useState as I, useEffectEvent as ie } from "react";
|
|
4
|
+
import { useParams as Tn, useSearchParams as Cn, matchPath as On, useBlocker as An, useNavigate as Ln, Link as Mn, useHref as De, useLocation as Vt, useRevalidator as Nn } from "react-router";
|
|
5
|
+
import { f as Dn, a as Gt, u as $n, G as ke, e as pe, x as Pn, y as Fn, z as ft, B as qn, D as mt, H as _n, w as Bn, I as In } from "./location-DWd6SQhN.js";
|
|
6
|
+
import { F as Ee, i as jn, G as Hn, y as X, x as zn, H as ht, z as He, I as Un, J as Zn, K as Vn, L as Gn, N as Kn, f as Wn, O as pt, v as Xn, P as Yn, Q as Jn, R as Qn, B as er, w as tr, S as nr, T as rr, U as or, u as gt } from "./dataRoute-Pm_0ue_4.js";
|
|
7
|
+
import { HostedScrollArea as vt, useMarkdownToolbarState as lr, MarkdownViewer as Kt } from "@aiquants/markdown";
|
|
8
|
+
import { SOURCE_LINES_ATTRIBUTE as Wt, parseSourceLines as ir } from "@aiquants/markdown/source-lines";
|
|
9
|
+
import { DEFAULT_CONTENT_ALIGN as sr } from "@aiquants/markdown/viewer-settings";
|
|
10
|
+
import { w as Xt, r as Yt, a as ar, b as wt, s as ze, c as cr } from "./storage-BSthKLSG.js";
|
|
11
|
+
const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
12
12
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
13
13
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
14
14
|
panelDragStarted: Object.freeze(["title"]),
|
|
15
15
|
panelDragCancelled: Object.freeze(["title"]),
|
|
16
16
|
multiColumnRegion: Object.freeze(["column"])
|
|
17
|
-
}),
|
|
17
|
+
}), fr = /\{(\w+)\}/gu, Jt = {
|
|
18
18
|
explorerRegion: "Explorer",
|
|
19
19
|
sourceLabel: "Source",
|
|
20
20
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -244,7 +244,7 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
244
244
|
multiColumnEmpty: "This column is empty",
|
|
245
245
|
multiColumnRegion: "Column {column}",
|
|
246
246
|
panelDropHere: "Drop the panel here"
|
|
247
|
-
},
|
|
247
|
+
}, mr = {
|
|
248
248
|
explorerRegion: "エクスプローラー",
|
|
249
249
|
sourceLabel: "ソース",
|
|
250
250
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -474,24 +474,24 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
474
474
|
multiColumnEmpty: "この列は空です",
|
|
475
475
|
multiColumnRegion: "{column} 列目",
|
|
476
476
|
panelDropHere: "ここへパネルをドロップ"
|
|
477
|
-
},
|
|
478
|
-
en: Object.freeze(
|
|
479
|
-
ja: Object.freeze(
|
|
480
|
-
}),
|
|
481
|
-
if (e === void 0) return
|
|
477
|
+
}, hr = Object.freeze({
|
|
478
|
+
en: Object.freeze(Jt),
|
|
479
|
+
ja: Object.freeze(mr)
|
|
480
|
+
}), Qt = Object.freeze(Object.keys(Jt)), pr = new Set(Qt), gr = (e) => pr.has(e), Te = (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, en = (e) => {
|
|
481
|
+
if (e === void 0) return dr;
|
|
482
482
|
if (bt.includes(e)) return e;
|
|
483
483
|
throw new RangeError(`[markdown-explorer] locale is the UI language (${bt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
|
|
484
484
|
}, Et = (e, t) => {
|
|
485
|
-
const n =
|
|
485
|
+
const n = hr[en(e)];
|
|
486
486
|
if (t === void 0) return n;
|
|
487
487
|
if (t === null || typeof t != "object")
|
|
488
488
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Te(t)}`);
|
|
489
|
-
if (
|
|
489
|
+
if (!Dn(t))
|
|
490
490
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Te(t)}`);
|
|
491
491
|
const r = t, o = { ...n };
|
|
492
492
|
for (const l of Object.keys(r)) {
|
|
493
|
-
if (!
|
|
494
|
-
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${
|
|
493
|
+
if (!gr(l))
|
|
494
|
+
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${Qt.join(", ")}`);
|
|
495
495
|
const i = r[l];
|
|
496
496
|
if (i === void 0) continue;
|
|
497
497
|
const d = typeof n[l];
|
|
@@ -499,35 +499,35 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
499
499
|
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${d}; got ${Te(i)}`);
|
|
500
500
|
if (typeof i == "string" && i.trim() === "")
|
|
501
501
|
throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
|
|
502
|
-
const g =
|
|
502
|
+
const g = ur[l];
|
|
503
503
|
if (typeof i == "string" && g !== void 0) {
|
|
504
|
-
for (const [, f] of i.matchAll(
|
|
504
|
+
for (const [, f] of i.matchAll(fr))
|
|
505
505
|
if (!g.includes(f ?? ""))
|
|
506
506
|
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${g.map((u) => `{${u}}`).join(", ")}`);
|
|
507
507
|
}
|
|
508
508
|
o[l] = i;
|
|
509
509
|
}
|
|
510
510
|
return Object.freeze(o);
|
|
511
|
-
},
|
|
511
|
+
}, vr = (e, t) => {
|
|
512
512
|
if (Object.is(e, t)) return !0;
|
|
513
513
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
514
514
|
const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
|
|
515
515
|
return o.length === l.length && l.every((i) => Object.hasOwn(n, i) && Object.is(n[i], r[i]));
|
|
516
|
-
}, yt = Object.freeze(["light", "dark"]),
|
|
516
|
+
}, yt = Object.freeze(["light", "dark"]), wr = (e) => {
|
|
517
517
|
if (e === void 0) return "light";
|
|
518
518
|
if (yt.includes(e)) return e;
|
|
519
519
|
throw new RangeError(`[markdown-explorer] theme must be ${yt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
520
|
-
},
|
|
521
|
-
const e =
|
|
520
|
+
}, tn = me(null), D = () => {
|
|
521
|
+
const e = ne(tn);
|
|
522
522
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
523
523
|
return e;
|
|
524
524
|
}, Ae = (e) => {
|
|
525
525
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
526
|
-
return
|
|
526
|
+
return ee(t.subscribe, n, n);
|
|
527
527
|
}, nt = () => {
|
|
528
|
-
const { config: e } = D(), t =
|
|
529
|
-
return
|
|
530
|
-
},
|
|
528
|
+
const { config: e } = D(), t = Tn()["*"], [n] = Cn(), r = n.toString();
|
|
529
|
+
return z(() => Gt(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
530
|
+
}, nn = {
|
|
531
531
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
532
532
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
533
533
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -536,14 +536,14 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
536
536
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
537
537
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
538
538
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
539
|
-
}, ae = (e, t) => e[
|
|
540
|
-
const { labels: o } = D(), l = ae(o, e.reason), i = o[
|
|
539
|
+
}, ae = (e, t) => e[nn[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
540
|
+
const { labels: o } = D(), l = ae(o, e.reason), i = o[nn[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
541
541
|
return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": d, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
542
542
|
/* @__PURE__ */ a("p", { className: "aqmx-callout-title", children: l }),
|
|
543
543
|
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: i }),
|
|
544
544
|
e.reason === "unauthorized" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
545
545
|
] });
|
|
546
|
-
},
|
|
546
|
+
}, br = (e, t) => {
|
|
547
547
|
const { phase: n, save: r, dirty: o } = t;
|
|
548
548
|
switch (n.kind) {
|
|
549
549
|
case "opening":
|
|
@@ -567,7 +567,7 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
567
567
|
break;
|
|
568
568
|
}
|
|
569
569
|
return o ? e.draftUnsaved : "";
|
|
570
|
-
},
|
|
570
|
+
}, Er = (e, t, n) => {
|
|
571
571
|
switch (t.kind) {
|
|
572
572
|
case "saved":
|
|
573
573
|
return t.merged ? e.documentSavedMerged(n) : e.documentSaved(n);
|
|
@@ -591,34 +591,34 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
591
591
|
for (const t of [...e]) t();
|
|
592
592
|
}
|
|
593
593
|
};
|
|
594
|
-
},
|
|
595
|
-
`)),
|
|
594
|
+
}, yr = "<<<<<<<", xr = "=======", kr = ">>>>>>>", xt = (e, t) => e === t || e.startsWith(`${t} `), kt = (e) => Sr(e.split(`
|
|
595
|
+
`)), Sr = (e) => {
|
|
596
596
|
const t = [];
|
|
597
597
|
let n = null, r = null, o = 0;
|
|
598
598
|
for (const l of e) {
|
|
599
599
|
o += 1;
|
|
600
600
|
const i = l.charCodeAt(0);
|
|
601
|
-
i !== 60 && i !== 61 && i !== 62 || (xt(l,
|
|
601
|
+
i !== 60 && i !== 61 && i !== 62 || (xt(l, yr) ? (n = o, r = null) : l === xr ? n !== null && r === null ? r = o : n = null : xt(l, kr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
602
602
|
}
|
|
603
603
|
return t;
|
|
604
604
|
}, St = (e) => e.includes(`\r
|
|
605
605
|
`) ? `\r
|
|
606
606
|
` : `
|
|
607
607
|
`, Ue = (e) => e.replace(/\r\n?/gu, `
|
|
608
|
-
`),
|
|
608
|
+
`), Rr = (e, t) => t === `
|
|
609
609
|
` ? e : e.replaceAll(`
|
|
610
610
|
`, `\r
|
|
611
|
-
`),
|
|
611
|
+
`), Tr = 3, Ze = Object.freeze({ kind: "idle" }), Cr = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
|
|
612
612
|
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), f = ye();
|
|
613
|
-
let u = null,
|
|
613
|
+
let u = null, h = null;
|
|
614
614
|
const m = (s, c) => {
|
|
615
615
|
s.value = { ...s.value, ...c }, f.emit();
|
|
616
|
-
},
|
|
616
|
+
}, S = (s, c) => o.get(s) === c, A = async (s, c) => {
|
|
617
617
|
c.controller.abort(), c.controller = new AbortController();
|
|
618
|
-
const { signal:
|
|
618
|
+
const { signal: p } = c.controller;
|
|
619
619
|
m(c, { phase: { kind: "opening" } });
|
|
620
|
-
const w = await e.edit(s,
|
|
621
|
-
if (!
|
|
620
|
+
const w = await e.edit(s, p);
|
|
621
|
+
if (!S(s, c) || p.aborted || !("kind" in w)) return;
|
|
622
622
|
if (w.kind === "grant") {
|
|
623
623
|
m(c, { phase: { kind: "grant", href: w.href } });
|
|
624
624
|
return;
|
|
@@ -629,65 +629,65 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
629
629
|
}
|
|
630
630
|
const k = Ue(w.text);
|
|
631
631
|
c.base = { text: k, version: w.version }, c.draft = k, c.ending = St(w.text), m(c, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ze, generation: c.value.generation + 1 });
|
|
632
|
-
},
|
|
632
|
+
}, x = (s) => {
|
|
633
633
|
const c = o.get(s);
|
|
634
634
|
c !== void 0 && (c.controller.abort(), o.delete(s), i.delete(s));
|
|
635
|
-
}, T = (s, c,
|
|
636
|
-
s.get(c) ===
|
|
637
|
-
}),
|
|
638
|
-
m(c, { ...w, save:
|
|
639
|
-
},
|
|
635
|
+
}, T = (s, c, p) => (s.set(c, p), () => {
|
|
636
|
+
s.get(c) === p && s.delete(c);
|
|
637
|
+
}), M = (s, c, p, w = {}) => {
|
|
638
|
+
m(c, { ...w, save: p }), n(s, p);
|
|
639
|
+
}, C = async (s) => {
|
|
640
640
|
d.get(s)?.flush();
|
|
641
641
|
const c = o.get(s);
|
|
642
642
|
if (c === void 0 || c.value.phase.kind !== "editing" || c.base === null || c.value.save.kind === "saving") return;
|
|
643
|
-
const
|
|
644
|
-
if (
|
|
645
|
-
|
|
643
|
+
const p = kt(c.draft).length;
|
|
644
|
+
if (p > 0) {
|
|
645
|
+
M(s, c, { kind: "conflicts", count: p });
|
|
646
646
|
return;
|
|
647
647
|
}
|
|
648
648
|
c.controller.abort(), c.controller = new AbortController();
|
|
649
649
|
const { signal: w } = c.controller;
|
|
650
|
-
let k = c.base, L = c.draft,
|
|
650
|
+
let k = c.base, L = c.draft, O = !1;
|
|
651
651
|
m(c, { save: { kind: "saving" } });
|
|
652
|
-
for (let N = 0; N <
|
|
653
|
-
const q = await e.save(s, k.version,
|
|
654
|
-
if (!
|
|
652
|
+
for (let N = 0; N < Tr; N += 1) {
|
|
653
|
+
const q = await e.save(s, k.version, Rr(L, c.ending), w);
|
|
654
|
+
if (!S(s, c) || w.aborted || !("kind" in q)) return;
|
|
655
655
|
if (q.kind === "saved") {
|
|
656
|
-
d.get(s)?.flush(), c.base = { text: L, version: q.version },
|
|
656
|
+
d.get(s)?.flush(), c.base = { text: L, version: q.version }, M(s, c, { kind: "saved", merged: O }, { dirty: c.draft !== L });
|
|
657
657
|
return;
|
|
658
658
|
}
|
|
659
659
|
if (q.kind === "grant") {
|
|
660
|
-
|
|
660
|
+
M(s, c, { kind: "grant", href: q.href });
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
663
|
if (q.kind === "failure") {
|
|
664
|
-
|
|
664
|
+
M(s, c, { kind: "failed", failure: q.failure });
|
|
665
665
|
return;
|
|
666
666
|
}
|
|
667
|
-
const { mergeDraft:
|
|
668
|
-
if (!
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
if (k = { text:
|
|
673
|
-
|
|
667
|
+
const { mergeDraft: G } = await import("./merge-q-5i8qsn.js");
|
|
668
|
+
if (!S(s, c) || w.aborted) return;
|
|
669
|
+
const W = d.get(s);
|
|
670
|
+
W?.flush();
|
|
671
|
+
const Q = Ue(q.text), K = G(k.text, c.draft, Q, t());
|
|
672
|
+
if (k = { text: Q, version: q.version }, c.base = k, c.ending = St(q.text), c.draft = K.text, W?.adopt(K.text), K.kind === "conflicts") {
|
|
673
|
+
M(s, c, { kind: "conflicts", count: K.conflicts }, { dirty: !0, generation: c.value.generation + 1 });
|
|
674
674
|
return;
|
|
675
675
|
}
|
|
676
|
-
if (
|
|
677
|
-
|
|
676
|
+
if (O = !0, L = K.text, L === k.text) {
|
|
677
|
+
M(s, c, { kind: "saved", merged: O }, { dirty: !1, generation: c.value.generation + 1 });
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
680
|
m(c, { dirty: !0, generation: c.value.generation + 1 });
|
|
681
681
|
}
|
|
682
|
-
|
|
682
|
+
M(s, c, { kind: "failed", failure: { reason: "failed" } });
|
|
683
683
|
};
|
|
684
684
|
return {
|
|
685
685
|
session: (s) => o.get(s)?.value,
|
|
686
686
|
subscribe: f.subscribe,
|
|
687
687
|
start: (s, c) => {
|
|
688
|
-
const
|
|
689
|
-
if (
|
|
690
|
-
m(
|
|
688
|
+
const p = o.get(s);
|
|
689
|
+
if (p !== void 0) {
|
|
690
|
+
m(p, { request: { anchor: c } }), (p.value.phase.kind === "failed" || p.value.phase.kind === "grant") && A(s, p);
|
|
691
691
|
return;
|
|
692
692
|
}
|
|
693
693
|
l.delete(s);
|
|
@@ -699,46 +699,46 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
699
699
|
`,
|
|
700
700
|
controller: new AbortController()
|
|
701
701
|
};
|
|
702
|
-
o.set(s, w),
|
|
702
|
+
o.set(s, w), A(s, w);
|
|
703
703
|
},
|
|
704
704
|
retry: (s) => {
|
|
705
705
|
const c = o.get(s);
|
|
706
|
-
c === void 0 || c.value.phase.kind === "editing" ||
|
|
706
|
+
c === void 0 || c.value.phase.kind === "editing" || A(s, c);
|
|
707
707
|
},
|
|
708
708
|
draft: (s) => {
|
|
709
709
|
const c = o.get(s);
|
|
710
710
|
return c === void 0 || c.base === null ? null : c.draft;
|
|
711
711
|
},
|
|
712
712
|
setDraft: (s, c) => {
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
715
|
-
|
|
716
|
-
const w = {}, k = c !==
|
|
717
|
-
k !==
|
|
718
|
-
const { save: L } =
|
|
713
|
+
const p = o.get(s);
|
|
714
|
+
if (p === void 0 || p.base === null) return;
|
|
715
|
+
p.draft = c;
|
|
716
|
+
const w = {}, k = c !== p.base.text;
|
|
717
|
+
k !== p.value.dirty && (w.dirty = k);
|
|
718
|
+
const { save: L } = p.value;
|
|
719
719
|
if (L.kind === "conflicts") {
|
|
720
|
-
const
|
|
721
|
-
|
|
720
|
+
const O = kt(c).length;
|
|
721
|
+
O === 0 ? w.save = Ze : O !== L.count && (w.save = { kind: "conflicts", count: O });
|
|
722
722
|
}
|
|
723
|
-
(w.dirty !== void 0 || w.save !== void 0) && m(
|
|
723
|
+
(w.dirty !== void 0 || w.save !== void 0) && m(p, w);
|
|
724
724
|
},
|
|
725
725
|
consumeRequest: (s) => {
|
|
726
726
|
const c = o.get(s);
|
|
727
727
|
c !== void 0 && c.value.request !== null && m(c, { request: null });
|
|
728
728
|
},
|
|
729
|
-
save:
|
|
729
|
+
save: C,
|
|
730
730
|
replaceDraft: (s, c) => {
|
|
731
|
-
const
|
|
732
|
-
|
|
731
|
+
const p = d.get(s);
|
|
732
|
+
p?.flush();
|
|
733
733
|
const w = o.get(s);
|
|
734
734
|
if (w === void 0 || w.base === null) return;
|
|
735
735
|
const k = Ue(c);
|
|
736
|
-
w.draft = k,
|
|
736
|
+
w.draft = k, p?.adopt(k), m(w, { dirty: k !== w.base.text, generation: w.value.generation + 1 });
|
|
737
737
|
},
|
|
738
738
|
close: (s) => {
|
|
739
739
|
if (!o.has(s)) return;
|
|
740
|
-
const c = d.get(s),
|
|
741
|
-
|
|
740
|
+
const c = d.get(s), p = c === void 0 ? null : c.returnPoint();
|
|
741
|
+
x(s), p === null ? l.delete(s) : l.set(s, p), f.emit();
|
|
742
742
|
},
|
|
743
743
|
takeReturn: (s) => {
|
|
744
744
|
const c = l.get(s) ?? null;
|
|
@@ -746,7 +746,7 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
746
746
|
},
|
|
747
747
|
dirtyPaths: () => [...o.values()].filter((s) => s.value.dirty).map((s) => s.value.path),
|
|
748
748
|
discard: (s) => {
|
|
749
|
-
for (const c of s)
|
|
749
|
+
for (const c of s) x(c);
|
|
750
750
|
s.length > 0 && f.emit();
|
|
751
751
|
},
|
|
752
752
|
editorState: {
|
|
@@ -772,51 +772,51 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
772
772
|
return s.filter((c) => o.get(c)?.value.dirty === !0);
|
|
773
773
|
},
|
|
774
774
|
askToDiscard: (s) => new Promise((c) => {
|
|
775
|
-
|
|
776
|
-
const
|
|
775
|
+
h?.settle(!1);
|
|
776
|
+
const p = {
|
|
777
777
|
paths: s,
|
|
778
778
|
settle: (w) => {
|
|
779
|
-
if (
|
|
780
|
-
if (
|
|
779
|
+
if (h === p) {
|
|
780
|
+
if (h = null, w) for (const k of s) x(k);
|
|
781
781
|
f.emit(), c(w);
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
};
|
|
785
|
-
|
|
785
|
+
h = p, f.emit();
|
|
786
786
|
}),
|
|
787
|
-
discardRequest: () =>
|
|
787
|
+
discardRequest: () => h,
|
|
788
788
|
previewShown: () => (u ??= r.read(), u),
|
|
789
789
|
setPreviewShown: (s) => {
|
|
790
790
|
u !== s && (u = s, r.write(s), f.emit());
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
|
-
},
|
|
793
|
+
}, rn = (e) => {
|
|
794
794
|
e.preventDefault(), e.stopPropagation();
|
|
795
|
-
},
|
|
796
|
-
const g =
|
|
797
|
-
return
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
800
|
-
if (e && !
|
|
801
|
-
const T =
|
|
802
|
-
u.current = T instanceof HTMLElement ? T : null,
|
|
803
|
-
} else !e &&
|
|
804
|
-
}, [e]), /* @__PURE__ */ a("dialog", { ref: g, className: "aqmx-confirm", "aria-labelledby":
|
|
805
|
-
|
|
806
|
-
}, onClick: (
|
|
807
|
-
|
|
808
|
-
}, onCancel: (
|
|
809
|
-
/* @__PURE__ */ a("p", { id:
|
|
795
|
+
}, on = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
|
|
796
|
+
const g = _(null), f = _(null), u = _(null), h = Oe(), m = Oe();
|
|
797
|
+
return U(() => {
|
|
798
|
+
const x = g.current;
|
|
799
|
+
if (x !== null)
|
|
800
|
+
if (e && !x.open) {
|
|
801
|
+
const T = x.ownerDocument.activeElement;
|
|
802
|
+
u.current = T instanceof HTMLElement ? T : null, x.showModal(), f.current?.focus();
|
|
803
|
+
} else !e && x.open && (x.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
|
|
804
|
+
}, [e]), /* @__PURE__ */ a("dialog", { ref: g, className: "aqmx-confirm", "aria-labelledby": h, "aria-describedby": m, "data-testid": d, onKeyDown: (x) => {
|
|
805
|
+
x.key !== "Escape" || x.defaultPrevented || (rn(x), i());
|
|
806
|
+
}, onClick: (x) => {
|
|
807
|
+
x.target === x.currentTarget && i();
|
|
808
|
+
}, onCancel: (x) => x.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
|
|
809
|
+
/* @__PURE__ */ a("p", { id: h, className: "aqmx-confirm-title", children: t }),
|
|
810
810
|
/* @__PURE__ */ a("p", { id: m, className: "aqmx-confirm-body", children: n }),
|
|
811
811
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
812
812
|
/* @__PURE__ */ a("button", { ref: f, type: "button", className: "aqmx-callout-action", "data-testid": `${d}-cancel`, onClick: i, children: o }),
|
|
813
813
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
|
|
814
814
|
] })
|
|
815
815
|
] }) });
|
|
816
|
-
},
|
|
817
|
-
const n =
|
|
816
|
+
}, Or = (e, t) => {
|
|
817
|
+
const n = On({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
818
818
|
if (n === null) return /* @__PURE__ */ new Set();
|
|
819
|
-
const { location: r } =
|
|
819
|
+
const { location: r } = Gt(e, n.params["*"], new URLSearchParams(t.search));
|
|
820
820
|
switch (r.view) {
|
|
821
821
|
case "tree":
|
|
822
822
|
return new Set(r.doc === null ? [] : [r.doc]);
|
|
@@ -825,34 +825,34 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
825
825
|
case "multi":
|
|
826
826
|
return new Set(r.docs);
|
|
827
827
|
}
|
|
828
|
-
},
|
|
828
|
+
}, ln = (e) => {
|
|
829
829
|
const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
|
|
830
|
-
return
|
|
831
|
-
},
|
|
832
|
-
},
|
|
830
|
+
return ee(t.subscribe, n, Ar);
|
|
831
|
+
}, sn = () => !1, Ar = () => {
|
|
832
|
+
}, Lr = () => {
|
|
833
833
|
const { edits: e } = D();
|
|
834
|
-
return
|
|
835
|
-
},
|
|
834
|
+
return ee(e.subscribe, e.hasSessions, sn);
|
|
835
|
+
}, Mr = () => {
|
|
836
836
|
const { edits: e } = D();
|
|
837
|
-
return
|
|
838
|
-
},
|
|
839
|
-
const { edits: e, labels: t, config: n } = D(), r =
|
|
840
|
-
({ nextLocation:
|
|
841
|
-
const m =
|
|
842
|
-
return e.flushDrafts(), r.current = e.dirtyPaths().filter((
|
|
837
|
+
return ee(e.subscribe, e.previewShown, sn);
|
|
838
|
+
}, Nr = () => null, Dr = () => {
|
|
839
|
+
const { edits: e, labels: t, config: n } = D(), r = _([]), o = P(
|
|
840
|
+
({ nextLocation: h }) => {
|
|
841
|
+
const m = Or(n, h);
|
|
842
|
+
return e.flushDrafts(), r.current = e.dirtyPaths().filter((S) => !m.has(S)), r.current.length > 0;
|
|
843
843
|
},
|
|
844
844
|
[e, n]
|
|
845
|
-
), l =
|
|
846
|
-
|
|
845
|
+
), l = An(o), i = Lr();
|
|
846
|
+
te(() => {
|
|
847
847
|
if (!i) return;
|
|
848
|
-
const
|
|
848
|
+
const h = (m) => {
|
|
849
849
|
e.flushDrafts(), e.dirtyPaths().length !== 0 && (m.preventDefault(), m.returnValue = !0);
|
|
850
850
|
};
|
|
851
|
-
return window.addEventListener("beforeunload",
|
|
851
|
+
return window.addEventListener("beforeunload", h), () => window.removeEventListener("beforeunload", h);
|
|
852
852
|
}, [i, e]);
|
|
853
|
-
const d =
|
|
853
|
+
const d = ee(e.subscribe, e.discardRequest, Nr), g = l.state === "blocked", u = (g ? r.current : d === null ? [] : d.paths).map((h) => Ee(h)).join(", ");
|
|
854
854
|
return /* @__PURE__ */ a(
|
|
855
|
-
|
|
855
|
+
on,
|
|
856
856
|
{
|
|
857
857
|
open: g || d !== null,
|
|
858
858
|
title: t.unsavedTitle,
|
|
@@ -877,12 +877,12 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
877
877
|
}
|
|
878
878
|
);
|
|
879
879
|
};
|
|
880
|
-
function
|
|
880
|
+
function $r({
|
|
881
881
|
title: e,
|
|
882
882
|
titleId: t,
|
|
883
883
|
...n
|
|
884
884
|
}, r) {
|
|
885
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
886
886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
887
887
|
viewBox: "0 0 20 20",
|
|
888
888
|
fill: "currentColor",
|
|
@@ -890,26 +890,26 @@ function Pr({
|
|
|
890
890
|
"data-slot": "icon",
|
|
891
891
|
ref: r,
|
|
892
892
|
"aria-labelledby": t
|
|
893
|
-
}, n), e ? /* @__PURE__ */
|
|
893
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
894
894
|
id: t
|
|
895
|
-
}, e) : null, /* @__PURE__ */
|
|
895
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
896
896
|
fillRule: "evenodd",
|
|
897
897
|
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",
|
|
898
898
|
clipRule: "evenodd"
|
|
899
899
|
}));
|
|
900
900
|
}
|
|
901
|
-
const
|
|
901
|
+
const Pr = /* @__PURE__ */ E.forwardRef($r);
|
|
902
902
|
let Ve = null;
|
|
903
|
-
const
|
|
903
|
+
const an = () => (Ve ??= import("./EditSurface-By6NPcD7.js").catch((e) => {
|
|
904
904
|
throw Ve = null, e;
|
|
905
|
-
}), Ve),
|
|
906
|
-
|
|
905
|
+
}), Ve), Fr = () => {
|
|
906
|
+
an().catch(() => {
|
|
907
907
|
});
|
|
908
908
|
}, qr = (e) => {
|
|
909
|
-
const { default: t } =
|
|
909
|
+
const { default: t } = ne(an());
|
|
910
910
|
return /* @__PURE__ */ a(t, { ...e });
|
|
911
911
|
};
|
|
912
|
-
class _r extends
|
|
912
|
+
class _r extends Zt {
|
|
913
913
|
state = { failed: !1 };
|
|
914
914
|
static getDerivedStateFromError() {
|
|
915
915
|
return { failed: !0 };
|
|
@@ -919,7 +919,7 @@ class _r extends Vt {
|
|
|
919
919
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
const rt = `[${
|
|
922
|
+
const rt = `[${Wt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', jr = 200, we = (e) => ir(e.getAttribute(Wt)), Hr = (e, t) => {
|
|
923
923
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
924
924
|
const o = we(r);
|
|
925
925
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
@@ -967,7 +967,7 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
967
967
|
if (r === "" || r.length > jr || /[\r\n]/u.test(r)) return null;
|
|
968
968
|
const o = e.ownerDocument.createRange();
|
|
969
969
|
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: zr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
970
|
-
},
|
|
970
|
+
}, os = (e, t) => {
|
|
971
971
|
const n = e.split(`
|
|
972
972
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), l = { line: r, column: 0 };
|
|
973
973
|
if (t.word === null) return l;
|
|
@@ -1014,15 +1014,15 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1014
1014
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1015
1015
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1016
1016
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1017
|
-
}),
|
|
1018
|
-
const e =
|
|
1017
|
+
}), ls = (e) => ot[e], $e = () => {
|
|
1018
|
+
const e = Ln();
|
|
1019
1019
|
return P(
|
|
1020
1020
|
(t, n) => {
|
|
1021
1021
|
e(t, ot[n]);
|
|
1022
1022
|
},
|
|
1023
1023
|
[e]
|
|
1024
1024
|
);
|
|
1025
|
-
}, Qr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(
|
|
1025
|
+
}, Qr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(Mn, { ...t, ...ot[e] }), cn = (e) => {
|
|
1026
1026
|
const t = e.ownerDocument;
|
|
1027
1027
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1028
1028
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1033,10 +1033,10 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1033
1033
|
};
|
|
1034
1034
|
return e.addEventListener("blur", n), !0;
|
|
1035
1035
|
}, eo = (e, t) => {
|
|
1036
|
-
const n =
|
|
1036
|
+
const n = _(null), r = _(null), o = _(null), l = P(() => {
|
|
1037
1037
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1038
1038
|
}, []);
|
|
1039
|
-
|
|
1039
|
+
te(() => l, [l]);
|
|
1040
1040
|
const i = P(
|
|
1041
1041
|
(f) => {
|
|
1042
1042
|
if (r.current !== f) return;
|
|
@@ -1046,9 +1046,9 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1046
1046
|
return;
|
|
1047
1047
|
}
|
|
1048
1048
|
e.prefetch(f);
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1051
|
-
const m = Promise.allSettled([
|
|
1049
|
+
const h = e.peek(f);
|
|
1050
|
+
if (h?.status !== "pending") return;
|
|
1051
|
+
const m = Promise.allSettled([h.promise]);
|
|
1052
1052
|
o.current = m, m.then(() => {
|
|
1053
1053
|
o.current === m && (o.current = null);
|
|
1054
1054
|
});
|
|
@@ -1059,7 +1059,7 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1059
1059
|
const u = t(f);
|
|
1060
1060
|
u !== r.current && (l(), u !== null && (r.current = u, n.current = window.setTimeout(() => {
|
|
1061
1061
|
n.current = null, i(u);
|
|
1062
|
-
},
|
|
1062
|
+
}, $n)));
|
|
1063
1063
|
},
|
|
1064
1064
|
[l, t, i]
|
|
1065
1065
|
), g = P(
|
|
@@ -1068,7 +1068,7 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1068
1068
|
},
|
|
1069
1069
|
[l, t]
|
|
1070
1070
|
);
|
|
1071
|
-
return
|
|
1071
|
+
return z(
|
|
1072
1072
|
() => ({
|
|
1073
1073
|
onPointerOver: (f) => d(f.target),
|
|
1074
1074
|
onPointerOut: (f) => g(f.relatedTarget),
|
|
@@ -1077,8 +1077,8 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1077
1077
|
}),
|
|
1078
1078
|
[d, g]
|
|
1079
1079
|
);
|
|
1080
|
-
}, to = tt(() => import("./NativeScrollBar-
|
|
1081
|
-
class no extends
|
|
1080
|
+
}, to = tt(() => import("./NativeScrollBar-RP37nwmY.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1081
|
+
class no extends Zt {
|
|
1082
1082
|
state = { failed: !1 };
|
|
1083
1083
|
static getDerivedStateFromError() {
|
|
1084
1084
|
return { failed: !0 };
|
|
@@ -1090,7 +1090,7 @@ class no extends Vt {
|
|
|
1090
1090
|
return this.state.failed ? null : this.props.children;
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(to, { scroller: e, withCircle: t }) }) }),
|
|
1093
|
+
const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(to, { scroller: e, withCircle: t }) }) }), dn = (e) => /* @__PURE__ */ a(ro, { scroller: e, withCircle: !0 }), un = () => {
|
|
1094
1094
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1095
1095
|
let n = !1;
|
|
1096
1096
|
const r = (o) => {
|
|
@@ -1134,9 +1134,9 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1134
1134
|
t.status = "rejected", t.reason = n;
|
|
1135
1135
|
}
|
|
1136
1136
|
)), t;
|
|
1137
|
-
},
|
|
1137
|
+
}, fn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Se = (e) => e.status === "fulfilled" ? e.value : void 0, oo = 55e3, Rt = Object.freeze({ status: "deferred" }), Tt = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, mn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", lo = ({ client: e, capacity: t }) => {
|
|
1138
1138
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1139
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
1139
|
+
const n = /* @__PURE__ */ new Map(), r = un(), o = ye(), l = /* @__PURE__ */ new WeakSet();
|
|
1140
1140
|
let i = 0;
|
|
1141
1141
|
const d = o.emit, g = () => (i += 1, i), f = () => {
|
|
1142
1142
|
if (!(n.size <= t))
|
|
@@ -1146,31 +1146,31 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1146
1146
|
}
|
|
1147
1147
|
}, u = (s, c) => {
|
|
1148
1148
|
n.delete(s), n.set(s, c);
|
|
1149
|
-
},
|
|
1150
|
-
const w = n.get(s), k = de(w?.snapshot), L =
|
|
1151
|
-
return u(s, N), f(),
|
|
1149
|
+
}, h = (s) => performance.now() - s.validatedAt >= oo, m = (s, c, p) => {
|
|
1150
|
+
const w = n.get(s), k = de(w?.snapshot), L = p || w?.refreshPending === !0, O = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: O, previous: k }, validatedAt: performance.now(), opened: c, background: null, refreshPending: !1, seeded: void 0, stamp: g() };
|
|
1151
|
+
return u(s, N), f(), O.then((q) => {
|
|
1152
1152
|
n.get(s) === N && (N.snapshot = q, N.stamp = g(), d());
|
|
1153
1153
|
}), N;
|
|
1154
|
-
},
|
|
1155
|
-
c.background ===
|
|
1156
|
-
},
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
1154
|
+
}, S = (s, c, p, w, k, L) => {
|
|
1155
|
+
c.background === p && (c.background = null, !(n.get(s) !== c || c.snapshot !== w) && (k.kind === "failure" && w.document.kind !== "failure" || (c.validatedAt = L, c.stamp = g(), Me(w.document, k) || (c.snapshot = { status: "loaded", document: k }), d())));
|
|
1156
|
+
}, A = async (s, c) => {
|
|
1157
|
+
const p = c.snapshot;
|
|
1158
|
+
if (p.status !== "loaded") return null;
|
|
1159
1159
|
const w = {};
|
|
1160
1160
|
c.background = w;
|
|
1161
1161
|
const k = performance.now(), L = e.document(s, { refresh: c.refreshPending });
|
|
1162
1162
|
c.refreshPending = !1;
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1165
|
-
},
|
|
1166
|
-
const { snapshot:
|
|
1167
|
-
return
|
|
1163
|
+
const O = await L, N = c.background === w && n.get(s) === c && c.snapshot === p;
|
|
1164
|
+
return S(s, c, w, p, O, k), N ? O : null;
|
|
1165
|
+
}, x = (s, c) => {
|
|
1166
|
+
const { snapshot: p } = c;
|
|
1167
|
+
return p.status === "pending" ? !1 : p.status === "loaded" && p.document.kind !== "failure" ? (A(s, c), !1) : (p.status === "loaded" && l.add(p), m(s, !0, !1), !0);
|
|
1168
1168
|
}, T = (s) => {
|
|
1169
1169
|
const c = r.hold(s);
|
|
1170
|
-
let
|
|
1170
|
+
let p = !1;
|
|
1171
1171
|
return () => {
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
1172
|
+
if (p) return;
|
|
1173
|
+
p = !0, c();
|
|
1174
1174
|
const w = n.get(s);
|
|
1175
1175
|
w !== void 0 && u(s, w), f();
|
|
1176
1176
|
};
|
|
@@ -1184,12 +1184,12 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1184
1184
|
c !== void 0 && c.snapshot.status !== "deferred" || (m(s, !1, !1), d());
|
|
1185
1185
|
},
|
|
1186
1186
|
open: (s) => {
|
|
1187
|
-
const c = r.resumes(s),
|
|
1187
|
+
const c = r.resumes(s), p = T(s), w = n.get(s);
|
|
1188
1188
|
if (w === void 0 || w.snapshot.status === "deferred")
|
|
1189
|
-
return m(s, !0, !1), d(),
|
|
1190
|
-
if (u(s, w), c) return
|
|
1189
|
+
return m(s, !0, !1), d(), p;
|
|
1190
|
+
if (u(s, w), c) return p;
|
|
1191
1191
|
const { snapshot: k } = w;
|
|
1192
|
-
return k.status === "pending" ? (w.opened = !0,
|
|
1192
|
+
return k.status === "pending" ? (w.opened = !0, p) : k.document.kind === "failure" ? (w.opened || h(w) ? (l.add(k), m(s, !0, !1), d()) : w.opened = !0, p) : (w.opened = !0, w.background === null && h(w) && A(s, w), p);
|
|
1193
1193
|
},
|
|
1194
1194
|
retain: T,
|
|
1195
1195
|
retry: (s) => {
|
|
@@ -1197,52 +1197,52 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1197
1197
|
c === void 0 || c.snapshot.status !== "loaded" || c.snapshot.document.kind !== "failure" || (m(s, !0, !1), d());
|
|
1198
1198
|
},
|
|
1199
1199
|
seed: (s, c) => {
|
|
1200
|
-
const
|
|
1200
|
+
const p = performance.now(), w = be(
|
|
1201
1201
|
c.then(
|
|
1202
|
-
(q) => q === null ?
|
|
1203
|
-
() =>
|
|
1202
|
+
(q) => q === null ? Rt : { status: "loaded", document: q },
|
|
1203
|
+
() => Rt
|
|
1204
1204
|
)
|
|
1205
1205
|
), k = n.get(s);
|
|
1206
1206
|
if (k !== void 0 && k.snapshot.status === "loaded") {
|
|
1207
|
-
const q = k.snapshot,
|
|
1208
|
-
k.background =
|
|
1209
|
-
if (
|
|
1210
|
-
|
|
1207
|
+
const q = k.snapshot, G = {};
|
|
1208
|
+
k.background = G, w.then((W) => {
|
|
1209
|
+
if (W.status === "loaded") {
|
|
1210
|
+
S(s, k, G, q, W.document, p);
|
|
1211
1211
|
return;
|
|
1212
1212
|
}
|
|
1213
|
-
k.background ===
|
|
1213
|
+
k.background === G && (k.background = null);
|
|
1214
1214
|
});
|
|
1215
1215
|
return;
|
|
1216
1216
|
}
|
|
1217
|
-
const L = k !== void 0 && k.snapshot.status === "pending" ? k.snapshot.previous : null,
|
|
1217
|
+
const L = k !== void 0 && k.snapshot.status === "pending" ? k.snapshot.previous : null, O = { status: "pending", promise: w, previous: L }, N = { snapshot: O, validatedAt: p, opened: k?.opened === !0, background: null, refreshPending: k?.refreshPending === !0, seeded: O, stamp: g() };
|
|
1218
1218
|
u(s, N), f(), w.then((q) => {
|
|
1219
1219
|
n.get(s) === N && (q.status === "deferred" && r.isHeld(s) ? m(s, N.opened, !1) : (N.snapshot = q, N.stamp = g()), d());
|
|
1220
1220
|
});
|
|
1221
1221
|
},
|
|
1222
1222
|
invalidate: () => {
|
|
1223
1223
|
let s = !1;
|
|
1224
|
-
for (const [c,
|
|
1225
|
-
if (
|
|
1226
|
-
const { snapshot: w } =
|
|
1224
|
+
for (const [c, p] of [...n]) {
|
|
1225
|
+
if (p.validatedAt = Number.NEGATIVE_INFINITY, p.opened = !0, p.refreshPending = !0, !r.isHeld(c)) continue;
|
|
1226
|
+
const { snapshot: w } = p;
|
|
1227
1227
|
if (w.status !== "pending") {
|
|
1228
|
-
|
|
1228
|
+
x(c, p) && (s = !0);
|
|
1229
1229
|
continue;
|
|
1230
1230
|
}
|
|
1231
1231
|
w.promise.then(() => {
|
|
1232
|
-
n.get(c) ===
|
|
1232
|
+
n.get(c) === p && p.refreshPending && r.isHeld(c) && x(c, p) && d();
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
1235
1235
|
s && d();
|
|
1236
1236
|
},
|
|
1237
1237
|
refresh: async (s) => {
|
|
1238
1238
|
const c = n.get(s);
|
|
1239
|
-
if (c !== void 0 &&
|
|
1239
|
+
if (c !== void 0 && mn(c.snapshot)) {
|
|
1240
1240
|
c.refreshPending = !0;
|
|
1241
|
-
const w = await
|
|
1242
|
-
return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } :
|
|
1241
|
+
const w = await A(s, c);
|
|
1242
|
+
return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } : Tt;
|
|
1243
1243
|
}
|
|
1244
|
-
const
|
|
1245
|
-
return d(),
|
|
1244
|
+
const p = m(s, !0, !0);
|
|
1245
|
+
return d(), p.snapshot.status !== "pending" ? Ge : (await p.snapshot.promise, n.get(s) === p ? Tt : Ge);
|
|
1246
1246
|
},
|
|
1247
1247
|
clear: () => {
|
|
1248
1248
|
n.clear();
|
|
@@ -1258,7 +1258,7 @@ function io({
|
|
|
1258
1258
|
titleId: t,
|
|
1259
1259
|
...n
|
|
1260
1260
|
}, r) {
|
|
1261
|
-
return /* @__PURE__ */
|
|
1261
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1262
1262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1263
1263
|
viewBox: "0 0 20 20",
|
|
1264
1264
|
fill: "currentColor",
|
|
@@ -1266,25 +1266,25 @@ function io({
|
|
|
1266
1266
|
"data-slot": "icon",
|
|
1267
1267
|
ref: r,
|
|
1268
1268
|
"aria-labelledby": t
|
|
1269
|
-
}, n), e ? /* @__PURE__ */
|
|
1269
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1270
1270
|
id: t
|
|
1271
|
-
}, e) : null, /* @__PURE__ */
|
|
1271
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1272
1272
|
fillRule: "evenodd",
|
|
1273
1273
|
d: "M18 5.25a2.25 2.25 0 0 0-2.012-2.238A2.25 2.25 0 0 0 13.75 1h-1.5a2.25 2.25 0 0 0-2.238 2.012c-.875.092-1.6.686-1.884 1.488H11A2.5 2.5 0 0 1 13.5 7v7h2.25A2.25 2.25 0 0 0 18 11.75v-6.5ZM12.25 2.5a.75.75 0 0 0-.75.75v.25h3v-.25a.75.75 0 0 0-.75-.75h-1.5Z",
|
|
1274
1274
|
clipRule: "evenodd"
|
|
1275
|
-
}), /* @__PURE__ */
|
|
1275
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1276
1276
|
fillRule: "evenodd",
|
|
1277
1277
|
d: "M3 6a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm6.874 4.166a.75.75 0 1 0-1.248-.832l-2.493 3.739-.853-.853a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.154-.114l3-4.5Z",
|
|
1278
1278
|
clipRule: "evenodd"
|
|
1279
1279
|
}));
|
|
1280
1280
|
}
|
|
1281
|
-
const so = /* @__PURE__ */
|
|
1281
|
+
const so = /* @__PURE__ */ E.forwardRef(io);
|
|
1282
1282
|
function ao({
|
|
1283
1283
|
title: e,
|
|
1284
1284
|
titleId: t,
|
|
1285
1285
|
...n
|
|
1286
1286
|
}, r) {
|
|
1287
|
-
return /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1288
1288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1289
1289
|
viewBox: "0 0 20 20",
|
|
1290
1290
|
fill: "currentColor",
|
|
@@ -1292,23 +1292,23 @@ function ao({
|
|
|
1292
1292
|
"data-slot": "icon",
|
|
1293
1293
|
ref: r,
|
|
1294
1294
|
"aria-labelledby": t
|
|
1295
|
-
}, n), e ? /* @__PURE__ */
|
|
1295
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1296
1296
|
id: t
|
|
1297
|
-
}, e) : null, /* @__PURE__ */
|
|
1297
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1298
1298
|
fillRule: "evenodd",
|
|
1299
1299
|
d: "M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z",
|
|
1300
1300
|
clipRule: "evenodd"
|
|
1301
|
-
}), /* @__PURE__ */
|
|
1301
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1302
1302
|
d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
|
|
1303
1303
|
}));
|
|
1304
1304
|
}
|
|
1305
|
-
const co = /* @__PURE__ */
|
|
1305
|
+
const co = /* @__PURE__ */ E.forwardRef(ao);
|
|
1306
1306
|
function uo({
|
|
1307
1307
|
title: e,
|
|
1308
1308
|
titleId: t,
|
|
1309
1309
|
...n
|
|
1310
1310
|
}, r) {
|
|
1311
|
-
return /* @__PURE__ */
|
|
1311
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1312
1312
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1313
1313
|
viewBox: "0 0 20 20",
|
|
1314
1314
|
fill: "currentColor",
|
|
@@ -1316,22 +1316,22 @@ function uo({
|
|
|
1316
1316
|
"data-slot": "icon",
|
|
1317
1317
|
ref: r,
|
|
1318
1318
|
"aria-labelledby": t
|
|
1319
|
-
}, n), e ? /* @__PURE__ */
|
|
1319
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1320
1320
|
id: t
|
|
1321
|
-
}, e) : null, /* @__PURE__ */
|
|
1321
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1322
1322
|
fillRule: "evenodd",
|
|
1323
1323
|
d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
1324
1324
|
clipRule: "evenodd"
|
|
1325
1325
|
}));
|
|
1326
1326
|
}
|
|
1327
|
-
const fo = /* @__PURE__ */
|
|
1327
|
+
const fo = /* @__PURE__ */ E.forwardRef(uo), mo = 2e3, Ct = Object.freeze({ outcome: "idle" }), ho = (e) => {
|
|
1328
1328
|
const t = navigator.clipboard;
|
|
1329
1329
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1330
1330
|
}, po = ({ text: e }) => {
|
|
1331
|
-
const { announcer: t, labels: n } = D(), [r, o] = I(
|
|
1332
|
-
|
|
1331
|
+
const { announcer: t, labels: n } = D(), [r, o] = I(Ct);
|
|
1332
|
+
te(() => {
|
|
1333
1333
|
if (r.outcome === "idle") return;
|
|
1334
|
-
const g = setTimeout(() => o(
|
|
1334
|
+
const g = setTimeout(() => o(Ct), mo);
|
|
1335
1335
|
return () => clearTimeout(g);
|
|
1336
1336
|
}, [r]);
|
|
1337
1337
|
const l = (g) => {
|
|
@@ -1345,13 +1345,13 @@ const fo = /* @__PURE__ */ b.forwardRef(uo), mo = 2e3, Ot = Object.freeze({ outc
|
|
|
1345
1345
|
return (
|
|
1346
1346
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: i, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ a(so, {}) : r.outcome === "failed" ? /* @__PURE__ */ a(fo, {}) : /* @__PURE__ */ a(co, {}) })
|
|
1347
1347
|
);
|
|
1348
|
-
}, fe = me("fill"), go = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) =>
|
|
1348
|
+
}, fe = me("fill"), go = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) => ne(fe) === "content" ? /* @__PURE__ */ a(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ a(vt, { scrollerProps: { ...e, style: go }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: dn, children: t });
|
|
1349
1349
|
function vo({
|
|
1350
1350
|
title: e,
|
|
1351
1351
|
titleId: t,
|
|
1352
1352
|
...n
|
|
1353
1353
|
}, r) {
|
|
1354
|
-
return /* @__PURE__ */
|
|
1354
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1355
1355
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1356
1356
|
viewBox: "0 0 20 20",
|
|
1357
1357
|
fill: "currentColor",
|
|
@@ -1359,21 +1359,21 @@ function vo({
|
|
|
1359
1359
|
"data-slot": "icon",
|
|
1360
1360
|
ref: r,
|
|
1361
1361
|
"aria-labelledby": t
|
|
1362
|
-
}, n), e ? /* @__PURE__ */
|
|
1362
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1363
1363
|
id: t
|
|
1364
|
-
}, e) : null, /* @__PURE__ */
|
|
1364
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1365
1365
|
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"
|
|
1366
|
-
}), /* @__PURE__ */
|
|
1366
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1367
1367
|
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"
|
|
1368
1368
|
}));
|
|
1369
1369
|
}
|
|
1370
|
-
const wo = /* @__PURE__ */
|
|
1370
|
+
const wo = /* @__PURE__ */ E.forwardRef(vo);
|
|
1371
1371
|
function bo({
|
|
1372
1372
|
title: e,
|
|
1373
1373
|
titleId: t,
|
|
1374
1374
|
...n
|
|
1375
1375
|
}, r) {
|
|
1376
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1377
1377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1378
1378
|
viewBox: "0 0 20 20",
|
|
1379
1379
|
fill: "currentColor",
|
|
@@ -1381,19 +1381,19 @@ function bo({
|
|
|
1381
1381
|
"data-slot": "icon",
|
|
1382
1382
|
ref: r,
|
|
1383
1383
|
"aria-labelledby": t
|
|
1384
|
-
}, n), e ? /* @__PURE__ */
|
|
1384
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1385
1385
|
id: t
|
|
1386
|
-
}, e) : null, /* @__PURE__ */
|
|
1386
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1387
1387
|
fillRule: "evenodd",
|
|
1388
1388
|
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",
|
|
1389
1389
|
clipRule: "evenodd"
|
|
1390
|
-
}), /* @__PURE__ */
|
|
1390
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1391
1391
|
fillRule: "evenodd",
|
|
1392
1392
|
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",
|
|
1393
1393
|
clipRule: "evenodd"
|
|
1394
1394
|
}));
|
|
1395
1395
|
}
|
|
1396
|
-
const Eo = /* @__PURE__ */
|
|
1396
|
+
const Eo = /* @__PURE__ */ E.forwardRef(bo), Pe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1397
1397
|
const { labels: l } = D();
|
|
1398
1398
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1399
1399
|
/* @__PURE__ */ a("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
@@ -1408,7 +1408,7 @@ function yo({
|
|
|
1408
1408
|
titleId: t,
|
|
1409
1409
|
...n
|
|
1410
1410
|
}, r) {
|
|
1411
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1412
1412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1413
1413
|
viewBox: "0 0 20 20",
|
|
1414
1414
|
fill: "currentColor",
|
|
@@ -1416,15 +1416,15 @@ function yo({
|
|
|
1416
1416
|
"data-slot": "icon",
|
|
1417
1417
|
ref: r,
|
|
1418
1418
|
"aria-labelledby": t
|
|
1419
|
-
}, n), e ? /* @__PURE__ */
|
|
1419
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1420
1420
|
id: t
|
|
1421
|
-
}, e) : null, /* @__PURE__ */
|
|
1421
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1422
1422
|
fillRule: "evenodd",
|
|
1423
1423
|
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",
|
|
1424
1424
|
clipRule: "evenodd"
|
|
1425
1425
|
}));
|
|
1426
1426
|
}
|
|
1427
|
-
const xo = /* @__PURE__ */
|
|
1427
|
+
const xo = /* @__PURE__ */ E.forwardRef(yo), ko = Object.freeze({ className: "aqmx-document-stage" }), So = ({ document: e }) => {
|
|
1428
1428
|
const { labels: t } = D();
|
|
1429
1429
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1430
1430
|
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(xo, {}) }),
|
|
@@ -1440,29 +1440,29 @@ const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aq
|
|
|
1440
1440
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1441
1441
|
const t = new TextEncoder(), n = e.slice(1).split(To).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1442
1442
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1443
|
-
},
|
|
1443
|
+
}, hn = (e) => `#${encodeURIComponent(e)}`, Co = (e) => {
|
|
1444
1444
|
if (e === "#") return !0;
|
|
1445
1445
|
const t = lt(e);
|
|
1446
1446
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
1447
|
-
},
|
|
1447
|
+
}, pn = (e, t) => {
|
|
1448
1448
|
if (t === "") return null;
|
|
1449
1449
|
for (const n of e.querySelectorAll("[id]"))
|
|
1450
1450
|
if (n.id === t) return n;
|
|
1451
1451
|
return null;
|
|
1452
|
-
}, Oo = "http://www.w3.org/1999/xhtml",
|
|
1452
|
+
}, Oo = "http://www.w3.org/1999/xhtml", Ot = (e, t) => {
|
|
1453
1453
|
if (t === "") return null;
|
|
1454
|
-
const n =
|
|
1454
|
+
const n = pn(e, t);
|
|
1455
1455
|
if (n !== null) return n;
|
|
1456
1456
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1457
1457
|
if (r.localName === "a" && r.namespaceURI === Oo && r.getAttribute("name") === t) return r;
|
|
1458
1458
|
return null;
|
|
1459
|
-
},
|
|
1459
|
+
}, gn = (e, t) => {
|
|
1460
1460
|
if (e === null || !t.startsWith("#")) return null;
|
|
1461
|
-
const n =
|
|
1461
|
+
const n = Ot(e, t.slice(1));
|
|
1462
1462
|
if (n !== null) return n;
|
|
1463
1463
|
const r = lt(t);
|
|
1464
|
-
return r === null ? null :
|
|
1465
|
-
},
|
|
1464
|
+
return r === null ? null : Ot(e, r);
|
|
1465
|
+
}, At = (e) => {
|
|
1466
1466
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
1467
1467
|
if (e === t) {
|
|
1468
1468
|
const o = getComputedStyle(n);
|
|
@@ -1475,10 +1475,10 @@ const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aq
|
|
|
1475
1475
|
return o !== "hidden" && o !== "clip";
|
|
1476
1476
|
}, Lo = (e, t) => {
|
|
1477
1477
|
const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
|
|
1478
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
1478
|
+
if (r.scrollHeight > r.clientHeight && At(r)) return r;
|
|
1479
1479
|
const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: i } = e.ownerDocument;
|
|
1480
1480
|
for (let d = e.parentElement; d !== null && d !== l; d = d.parentElement)
|
|
1481
|
-
if (
|
|
1481
|
+
if (At(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
|
|
1482
1482
|
return i instanceof Element && Ao(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
|
|
1483
1483
|
}, Mo = Object.freeze({
|
|
1484
1484
|
scrollerOf: Lo,
|
|
@@ -1504,9 +1504,9 @@ const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aq
|
|
|
1504
1504
|
}, $o = (e, t) => {
|
|
1505
1505
|
const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
|
|
1506
1506
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1507
|
-
},
|
|
1507
|
+
}, Lt = (e, t, n) => {
|
|
1508
1508
|
if (e === null) return null;
|
|
1509
|
-
const r =
|
|
1509
|
+
const r = gn(e, t);
|
|
1510
1510
|
return r === null ? (Co(t) && $o(e, n), null) : (No(e, r), Do(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1511
1511
|
};
|
|
1512
1512
|
function Po({
|
|
@@ -1514,7 +1514,7 @@ function Po({
|
|
|
1514
1514
|
titleId: t,
|
|
1515
1515
|
...n
|
|
1516
1516
|
}, r) {
|
|
1517
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1518
1518
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1519
1519
|
viewBox: "0 0 20 20",
|
|
1520
1520
|
fill: "currentColor",
|
|
@@ -1522,19 +1522,19 @@ function Po({
|
|
|
1522
1522
|
"data-slot": "icon",
|
|
1523
1523
|
ref: r,
|
|
1524
1524
|
"aria-labelledby": t
|
|
1525
|
-
}, n), e ? /* @__PURE__ */
|
|
1525
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1526
1526
|
id: t
|
|
1527
|
-
}, e) : null, /* @__PURE__ */
|
|
1527
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1528
1528
|
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"
|
|
1529
1529
|
}));
|
|
1530
1530
|
}
|
|
1531
|
-
const Fo = /* @__PURE__ */
|
|
1531
|
+
const Fo = /* @__PURE__ */ E.forwardRef(Po);
|
|
1532
1532
|
function qo({
|
|
1533
1533
|
title: e,
|
|
1534
1534
|
titleId: t,
|
|
1535
1535
|
...n
|
|
1536
1536
|
}, r) {
|
|
1537
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1538
1538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1539
1539
|
viewBox: "0 0 20 20",
|
|
1540
1540
|
fill: "currentColor",
|
|
@@ -1542,23 +1542,23 @@ function qo({
|
|
|
1542
1542
|
"data-slot": "icon",
|
|
1543
1543
|
ref: r,
|
|
1544
1544
|
"aria-labelledby": t
|
|
1545
|
-
}, n), e ? /* @__PURE__ */
|
|
1545
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1546
1546
|
id: t
|
|
1547
|
-
}, e) : null, /* @__PURE__ */
|
|
1547
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1548
1548
|
d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
|
|
1549
|
-
}), /* @__PURE__ */
|
|
1549
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1550
1550
|
fillRule: "evenodd",
|
|
1551
1551
|
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",
|
|
1552
1552
|
clipRule: "evenodd"
|
|
1553
1553
|
}));
|
|
1554
1554
|
}
|
|
1555
|
-
const _o = /* @__PURE__ */
|
|
1555
|
+
const _o = /* @__PURE__ */ E.forwardRef(qo);
|
|
1556
1556
|
function Bo({
|
|
1557
1557
|
title: e,
|
|
1558
1558
|
titleId: t,
|
|
1559
1559
|
...n
|
|
1560
1560
|
}, r) {
|
|
1561
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1562
1562
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1563
1563
|
viewBox: "0 0 20 20",
|
|
1564
1564
|
fill: "currentColor",
|
|
@@ -1566,23 +1566,23 @@ function Bo({
|
|
|
1566
1566
|
"data-slot": "icon",
|
|
1567
1567
|
ref: r,
|
|
1568
1568
|
"aria-labelledby": t
|
|
1569
|
-
}, n), e ? /* @__PURE__ */
|
|
1569
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1570
1570
|
id: t
|
|
1571
|
-
}, e) : null, /* @__PURE__ */
|
|
1571
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1572
1572
|
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"
|
|
1573
|
-
}), /* @__PURE__ */
|
|
1573
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1574
1574
|
fillRule: "evenodd",
|
|
1575
1575
|
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",
|
|
1576
1576
|
clipRule: "evenodd"
|
|
1577
1577
|
}));
|
|
1578
1578
|
}
|
|
1579
|
-
const Io = /* @__PURE__ */
|
|
1579
|
+
const Io = /* @__PURE__ */ E.forwardRef(Bo);
|
|
1580
1580
|
function jo({
|
|
1581
1581
|
title: e,
|
|
1582
1582
|
titleId: t,
|
|
1583
1583
|
...n
|
|
1584
1584
|
}, r) {
|
|
1585
|
-
return /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1586
1586
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1587
1587
|
viewBox: "0 0 20 20",
|
|
1588
1588
|
fill: "currentColor",
|
|
@@ -1590,15 +1590,15 @@ function jo({
|
|
|
1590
1590
|
"data-slot": "icon",
|
|
1591
1591
|
ref: r,
|
|
1592
1592
|
"aria-labelledby": t
|
|
1593
|
-
}, n), e ? /* @__PURE__ */
|
|
1593
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1594
1594
|
id: t
|
|
1595
|
-
}, e) : null, /* @__PURE__ */
|
|
1595
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1596
1596
|
fillRule: "evenodd",
|
|
1597
1597
|
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",
|
|
1598
1598
|
clipRule: "evenodd"
|
|
1599
1599
|
}));
|
|
1600
1600
|
}
|
|
1601
|
-
const Ho = /* @__PURE__ */
|
|
1601
|
+
const Ho = /* @__PURE__ */ E.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), zo = `[${Je}="${Qe[Je]}"]`, Uo = () => {
|
|
1602
1602
|
let e = null;
|
|
1603
1603
|
return {
|
|
1604
1604
|
onKeyDownCapture: (t) => {
|
|
@@ -1617,7 +1617,7 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1617
1617
|
t.target === e && (e = null);
|
|
1618
1618
|
}
|
|
1619
1619
|
};
|
|
1620
|
-
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]),
|
|
1620
|
+
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]), Mt = Object.freeze({ mode: "fit" }), Zo = 1, Vo = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Go = me(null), Ko = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Zo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Nt = (e, t, n) => {
|
|
1621
1621
|
if (e.mode === "level") {
|
|
1622
1622
|
const o = e.index + n;
|
|
1623
1623
|
return o >= 0 && o < Ce.length ? o : null;
|
|
@@ -1625,43 +1625,43 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1625
1625
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
1626
1626
|
const r = n === 1 ? Ce.findIndex((o) => o > t) : Ce.findLastIndex((o) => o < t);
|
|
1627
1627
|
return r === -1 ? null : r;
|
|
1628
|
-
},
|
|
1628
|
+
}, Dt = (e, t, n) => {
|
|
1629
1629
|
if (e.mode === "level") {
|
|
1630
|
-
const o =
|
|
1630
|
+
const o = Nt(e, null, n);
|
|
1631
1631
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
1632
1632
|
}
|
|
1633
1633
|
if (t === null) return null;
|
|
1634
|
-
const r =
|
|
1634
|
+
const r = Nt(e, t.scale, n);
|
|
1635
1635
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1636
1636
|
}, Wo = (e) => {
|
|
1637
1637
|
const t = Ce[e];
|
|
1638
1638
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1639
1639
|
return t;
|
|
1640
|
-
},
|
|
1641
|
-
const { labels: t } = D(), n =
|
|
1642
|
-
const { naturalWidth: s, naturalHeight: c } =
|
|
1643
|
-
d((
|
|
1640
|
+
}, $t = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Xo = ({ document: e }) => {
|
|
1641
|
+
const { labels: t } = D(), n = ne(Go), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Mt : r.zoom), [i, d] = I(r === null ? null : r.reported), [g, f] = I(null), u = _(null), h = P((C) => {
|
|
1642
|
+
const { naturalWidth: s, naturalHeight: c } = C;
|
|
1643
|
+
d((p) => $t(p, s, c));
|
|
1644
1644
|
}, []), m = P(
|
|
1645
|
-
(
|
|
1646
|
-
u.current =
|
|
1647
|
-
() =>
|
|
1645
|
+
(C) => {
|
|
1646
|
+
u.current = C, !(C === null || !C.complete) && (C.naturalWidth > 0 || C.naturalHeight > 0 ? h(C) : C.decode().then(
|
|
1647
|
+
() => h(C),
|
|
1648
1648
|
() => {
|
|
1649
1649
|
}
|
|
1650
1650
|
));
|
|
1651
1651
|
},
|
|
1652
|
-
[
|
|
1652
|
+
[h]
|
|
1653
1653
|
);
|
|
1654
|
-
|
|
1654
|
+
te(() => {
|
|
1655
1655
|
n !== null && i !== null && n.save(e.url, { zoom: o, reported: i });
|
|
1656
|
-
}, [n, e.url, o, i]),
|
|
1657
|
-
const
|
|
1658
|
-
if (
|
|
1659
|
-
const s = () => f((
|
|
1656
|
+
}, [n, e.url, o, i]), U(() => {
|
|
1657
|
+
const C = u.current;
|
|
1658
|
+
if (C === null || i === null || o.mode !== "fit") return;
|
|
1659
|
+
const s = () => f((p) => $t(p, C.clientWidth, C.clientHeight));
|
|
1660
1660
|
if (s(), typeof ResizeObserver > "u") return;
|
|
1661
1661
|
const c = new ResizeObserver(s);
|
|
1662
|
-
return c.observe(
|
|
1662
|
+
return c.observe(C), () => c.disconnect();
|
|
1663
1663
|
}, [i, o.mode]);
|
|
1664
|
-
const
|
|
1664
|
+
const S = i === null || g === null ? null : Ko(i, g), A = Dt(o, S, -1), x = Dt(o, S, 1), T = o.mode === "level" ? Wo(o.index) : null, M = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1665
1665
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1666
1666
|
/* @__PURE__ */ F(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(Ho, {}), children: [
|
|
1667
1667
|
/* @__PURE__ */ a(
|
|
@@ -1671,9 +1671,9 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1671
1671
|
className: "aqmx-icon-button",
|
|
1672
1672
|
"aria-label": t.imageZoomOut,
|
|
1673
1673
|
title: t.imageZoomOut,
|
|
1674
|
-
"aria-disabled":
|
|
1674
|
+
"aria-disabled": A === null,
|
|
1675
1675
|
onClick: () => {
|
|
1676
|
-
|
|
1676
|
+
A !== null && l(A);
|
|
1677
1677
|
},
|
|
1678
1678
|
...Qe,
|
|
1679
1679
|
children: /* @__PURE__ */ a(_o, {})
|
|
@@ -1687,37 +1687,37 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1687
1687
|
className: "aqmx-icon-button",
|
|
1688
1688
|
"aria-label": t.imageZoomIn,
|
|
1689
1689
|
title: t.imageZoomIn,
|
|
1690
|
-
"aria-disabled":
|
|
1690
|
+
"aria-disabled": x === null,
|
|
1691
1691
|
onClick: () => {
|
|
1692
|
-
|
|
1692
|
+
x !== null && l(x);
|
|
1693
1693
|
},
|
|
1694
1694
|
...Qe,
|
|
1695
1695
|
children: /* @__PURE__ */ a(Io, {})
|
|
1696
1696
|
}
|
|
1697
1697
|
),
|
|
1698
|
-
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(
|
|
1698
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Mt), children: /* @__PURE__ */ a(Fo, {}) })
|
|
1699
1699
|
] }),
|
|
1700
|
-
/* @__PURE__ */ a(xe, { scrollerProps: Vo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style:
|
|
1700
|
+
/* @__PURE__ */ a(xe, { scrollerProps: Vo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: M, onLoad: (C) => h(C.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1701
1701
|
] });
|
|
1702
|
-
},
|
|
1703
|
-
const e =
|
|
1702
|
+
}, vn = me(null), qe = me(void 0), wn = me(null), _e = () => {
|
|
1703
|
+
const e = ne(vn);
|
|
1704
1704
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1705
1705
|
return e;
|
|
1706
1706
|
}, Yo = () => {
|
|
1707
|
-
const e =
|
|
1707
|
+
const e = ne(wn);
|
|
1708
1708
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1709
1709
|
return e;
|
|
1710
1710
|
}, Be = (e, t, n, r) => t.kind === "panel" ? pe(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? pe(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : pe(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Jo = ({ children: e }) => {
|
|
1711
1711
|
const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
|
|
1712
|
-
return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(
|
|
1712
|
+
return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(wn, { value: l, children: e }) });
|
|
1713
1713
|
}, Qo = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', el = (e) => {
|
|
1714
1714
|
const t = e instanceof Element ? e.closest(Qo) : null;
|
|
1715
1715
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1716
1716
|
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, tl = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: g }) => {
|
|
1717
1717
|
const f = De(e);
|
|
1718
|
-
return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (
|
|
1719
|
-
if (Ie(
|
|
1720
|
-
if (
|
|
1718
|
+
return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
|
|
1719
|
+
if (Ie(h)) {
|
|
1720
|
+
if (h.preventDefault(), t === d.currentPath && n !== "") {
|
|
1721
1721
|
d.scrollWithin(n);
|
|
1722
1722
|
return;
|
|
1723
1723
|
}
|
|
@@ -1725,8 +1725,8 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1725
1725
|
}
|
|
1726
1726
|
}, children: g });
|
|
1727
1727
|
}, nl = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
|
|
1728
|
-
const { config: i } = D(), d = _e(), g =
|
|
1729
|
-
return u.kind === "page" ? /* @__PURE__ */ a(Qr, { ...o, to:
|
|
1728
|
+
const { config: i } = D(), d = _e(), g = ne(qe), f = Ro(e), { navigation: u } = d, h = `${Be(i, u, g, t)}${f}`, m = n === !1 ? "false" : void 0;
|
|
1729
|
+
return u.kind === "page" ? /* @__PURE__ */ a(Qr, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ a(tl, { to: h, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
|
|
1730
1730
|
}, rl = ({ className: e, attributes: t, children: n }) => {
|
|
1731
1731
|
const { labels: r } = D();
|
|
1732
1732
|
return (
|
|
@@ -1740,7 +1740,7 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1740
1740
|
] })
|
|
1741
1741
|
);
|
|
1742
1742
|
}, ol = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1743
|
-
const { config: l } = D(), i =
|
|
1743
|
+
const { config: l } = D(), i = ne(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
|
|
1744
1744
|
return /* @__PURE__ */ a("a", { ...n, href: d, className: t, onClick: (f) => {
|
|
1745
1745
|
Ie(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1746
1746
|
}, children: o });
|
|
@@ -1751,27 +1751,27 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1751
1751
|
const d = i.currentTarget;
|
|
1752
1752
|
e === "#" ? o.followEmptyFragment(i.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, i.nativeEvent);
|
|
1753
1753
|
}, children: r }) : /* @__PURE__ */ a(ol, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1754
|
-
}, il = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !
|
|
1755
|
-
const { config: e } = D(), t = _e(), n =
|
|
1754
|
+
}, il = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !jn(n) ? /* @__PURE__ */ a(rl, { className: o, attributes: l, children: i }) : /* @__PURE__ */ a(nl, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ a(ll, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ a("a", { ...l, href: e, className: o, children: i }), sl = () => {
|
|
1755
|
+
const { config: e } = D(), t = _e(), n = ne(qe), r = $e();
|
|
1756
1756
|
return P(
|
|
1757
1757
|
(o, l) => {
|
|
1758
1758
|
if (!Ie(l)) return !0;
|
|
1759
1759
|
l.preventDefault();
|
|
1760
|
-
const i =
|
|
1760
|
+
const i = hn(o.id), { navigation: d } = t;
|
|
1761
1761
|
return d.kind === "panel" || lt(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(i), !0) : (r(`${Be(e, d, n, t.currentPath)}${i}`, "follow-link"), !0);
|
|
1762
1762
|
},
|
|
1763
1763
|
[e, t, n, r]
|
|
1764
1764
|
);
|
|
1765
1765
|
}, al = () => {
|
|
1766
1766
|
const e = Yo();
|
|
1767
|
-
return P((t) => `${e}${
|
|
1767
|
+
return P((t) => `${e}${hn(t.id)}`, [e]);
|
|
1768
1768
|
};
|
|
1769
1769
|
function cl({
|
|
1770
1770
|
title: e,
|
|
1771
1771
|
titleId: t,
|
|
1772
1772
|
...n
|
|
1773
1773
|
}, r) {
|
|
1774
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1775
1775
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1776
1776
|
viewBox: "0 0 20 20",
|
|
1777
1777
|
fill: "currentColor",
|
|
@@ -1779,19 +1779,19 @@ function cl({
|
|
|
1779
1779
|
"data-slot": "icon",
|
|
1780
1780
|
ref: r,
|
|
1781
1781
|
"aria-labelledby": t
|
|
1782
|
-
}, n), e ? /* @__PURE__ */
|
|
1782
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1783
1783
|
id: t
|
|
1784
|
-
}, e) : null, /* @__PURE__ */
|
|
1784
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1785
1785
|
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"
|
|
1786
1786
|
}));
|
|
1787
1787
|
}
|
|
1788
|
-
const dl = /* @__PURE__ */
|
|
1788
|
+
const dl = /* @__PURE__ */ E.forwardRef(cl);
|
|
1789
1789
|
function ul({
|
|
1790
1790
|
title: e,
|
|
1791
1791
|
titleId: t,
|
|
1792
1792
|
...n
|
|
1793
1793
|
}, r) {
|
|
1794
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1795
1795
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1796
1796
|
viewBox: "0 0 20 20",
|
|
1797
1797
|
fill: "currentColor",
|
|
@@ -1799,21 +1799,21 @@ function ul({
|
|
|
1799
1799
|
"data-slot": "icon",
|
|
1800
1800
|
ref: r,
|
|
1801
1801
|
"aria-labelledby": t
|
|
1802
|
-
}, n), e ? /* @__PURE__ */
|
|
1802
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1803
1803
|
id: t
|
|
1804
|
-
}, e) : null, /* @__PURE__ */
|
|
1804
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1805
1805
|
fillRule: "evenodd",
|
|
1806
1806
|
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",
|
|
1807
1807
|
clipRule: "evenodd"
|
|
1808
1808
|
}));
|
|
1809
1809
|
}
|
|
1810
|
-
const fl = /* @__PURE__ */
|
|
1810
|
+
const fl = /* @__PURE__ */ E.forwardRef(ul);
|
|
1811
1811
|
function ml({
|
|
1812
1812
|
title: e,
|
|
1813
1813
|
titleId: t,
|
|
1814
1814
|
...n
|
|
1815
1815
|
}, r) {
|
|
1816
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1817
1817
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1818
1818
|
viewBox: "0 0 20 20",
|
|
1819
1819
|
fill: "currentColor",
|
|
@@ -1821,15 +1821,15 @@ function ml({
|
|
|
1821
1821
|
"data-slot": "icon",
|
|
1822
1822
|
ref: r,
|
|
1823
1823
|
"aria-labelledby": t
|
|
1824
|
-
}, n), e ? /* @__PURE__ */
|
|
1824
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1825
1825
|
id: t
|
|
1826
|
-
}, e) : null, /* @__PURE__ */
|
|
1826
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1827
1827
|
fillRule: "evenodd",
|
|
1828
1828
|
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",
|
|
1829
1829
|
clipRule: "evenodd"
|
|
1830
1830
|
}));
|
|
1831
1831
|
}
|
|
1832
|
-
const hl = /* @__PURE__ */
|
|
1832
|
+
const hl = /* @__PURE__ */ E.forwardRef(ml), pl = Object.freeze({ className: "aqmx-document-stage" }), gl = (e) => {
|
|
1833
1833
|
switch (e) {
|
|
1834
1834
|
case "video":
|
|
1835
1835
|
return /* @__PURE__ */ a(fl, {});
|
|
@@ -1897,18 +1897,18 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
1897
1897
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
1898
1898
|
embeddedPost: e.viewerEmbeddedPost,
|
|
1899
1899
|
embeddedFrame: e.viewerEmbeddedFrame
|
|
1900
|
-
}),
|
|
1900
|
+
}), bn = (e, t, n) => {
|
|
1901
1901
|
if (t !== void 0) return t;
|
|
1902
1902
|
if (n !== void 0) return n;
|
|
1903
1903
|
const [r] = e.documentStyles;
|
|
1904
1904
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1905
1905
|
return r.name;
|
|
1906
|
-
},
|
|
1906
|
+
}, En = (e, t) => e !== void 0 ? e : t !== void 0 ? t : sr, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), El = (e, t, n) => {
|
|
1907
1907
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1908
1908
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1909
1909
|
return pe(e, { ...t, overrides: r });
|
|
1910
1910
|
}, st = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: i, children: d }) => {
|
|
1911
|
-
const g =
|
|
1911
|
+
const g = ne(fe);
|
|
1912
1912
|
return (
|
|
1913
1913
|
/* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": g, className: "aqmx-document", ...i, children: [
|
|
1914
1914
|
r ? /* @__PURE__ */ a("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
@@ -1918,79 +1918,79 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
1918
1918
|
}, yl = () => {
|
|
1919
1919
|
const { labels: e } = D();
|
|
1920
1920
|
return /* @__PURE__ */ a(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ a("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ a("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1921
|
-
},
|
|
1921
|
+
}, yn = ({ label: e }) => {
|
|
1922
1922
|
const { labels: t } = D();
|
|
1923
1923
|
return /* @__PURE__ */ F(st, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
1924
1924
|
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ a("span", {}, n)) }),
|
|
1925
1925
|
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1926
1926
|
] });
|
|
1927
|
-
},
|
|
1928
|
-
const { reportMathDiagnostics: o, edits: l } = D(), i =
|
|
1929
|
-
|
|
1930
|
-
if (
|
|
1927
|
+
}, Pt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), xl = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
1928
|
+
const { reportMathDiagnostics: o, edits: l } = D(), i = z(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = sl(), g = al(), f = z(() => o === void 0 ? void 0 : (p) => o(e, p), [o, e]), u = _(null), { editable: h, doubleClick: m, region: S, paneScroll: A, stale: x } = r;
|
|
1929
|
+
U(() => {
|
|
1930
|
+
if (h)
|
|
1931
1931
|
return l.bindView(e, {
|
|
1932
1932
|
anchor: () => {
|
|
1933
|
-
const
|
|
1934
|
-
return
|
|
1933
|
+
const p = u.current, w = S(), k = p === null ? null : p.querySelector(Fe);
|
|
1934
|
+
return p === null || w === null || k === null ? null : Vr(p, A.scrollerOf(w, k));
|
|
1935
1935
|
}
|
|
1936
1936
|
});
|
|
1937
|
-
}, [l, e,
|
|
1938
|
-
const T = (
|
|
1939
|
-
const w = u.current, { target: k } =
|
|
1940
|
-
!m || w === null || !(k instanceof Element) || !Ur(k) || (
|
|
1941
|
-
},
|
|
1942
|
-
|
|
1943
|
-
|
|
1937
|
+
}, [l, e, h, S, A]);
|
|
1938
|
+
const T = (p) => {
|
|
1939
|
+
const w = u.current, { target: k } = p;
|
|
1940
|
+
!m || w === null || !(k instanceof Element) || !Ur(k) || (p.stopPropagation(), l.start(e, Zr(k, w, w.ownerDocument.getSelection())));
|
|
1941
|
+
}, M = _(null), C = _(x);
|
|
1942
|
+
U(() => {
|
|
1943
|
+
C.current = x;
|
|
1944
1944
|
});
|
|
1945
|
-
const s = ie((
|
|
1946
|
-
const w = u.current, k =
|
|
1945
|
+
const s = ie((p) => {
|
|
1946
|
+
const w = u.current, k = S(), L = w === null ? null : Yr(w, p.line);
|
|
1947
1947
|
if (k === null || L === null) return !1;
|
|
1948
|
-
const
|
|
1949
|
-
return
|
|
1950
|
-
}), c = ie((
|
|
1951
|
-
const w =
|
|
1948
|
+
const O = A.scrollerOf(k, L);
|
|
1949
|
+
return O.scrollTop += Jr(L, p.line) - p.clientTop, !0;
|
|
1950
|
+
}), c = ie((p) => {
|
|
1951
|
+
const w = S();
|
|
1952
1952
|
if (w === null) return;
|
|
1953
1953
|
const k = () => {
|
|
1954
|
-
for (const
|
|
1955
|
-
|
|
1954
|
+
for (const O of Pt) w.removeEventListener(O, L, !0);
|
|
1955
|
+
M.current?.release === k && (M.current = null);
|
|
1956
1956
|
}, L = () => k();
|
|
1957
|
-
for (const
|
|
1958
|
-
|
|
1957
|
+
for (const O of Pt) w.addEventListener(O, L, { capture: !0, passive: !0 });
|
|
1958
|
+
M.current = { point: p, release: k };
|
|
1959
1959
|
});
|
|
1960
|
-
return
|
|
1961
|
-
const
|
|
1962
|
-
if (
|
|
1960
|
+
return U(() => {
|
|
1961
|
+
const p = l.takeReturn(e);
|
|
1962
|
+
if (p !== null)
|
|
1963
1963
|
return queueMicrotask(() => {
|
|
1964
|
-
s(
|
|
1965
|
-
}), () =>
|
|
1966
|
-
}, [l, e]),
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
}, [t,
|
|
1970
|
-
/* @__PURE__ */ a("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ a(
|
|
1971
|
-
},
|
|
1964
|
+
s(p) && C.current && c(p);
|
|
1965
|
+
}), () => M.current?.release();
|
|
1966
|
+
}, [l, e]), U(() => {
|
|
1967
|
+
const p = M.current;
|
|
1968
|
+
p === null || x || (p.release(), s(p.point));
|
|
1969
|
+
}, [t, x]),
|
|
1970
|
+
/* @__PURE__ */ a("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ a(Kt, { ...n, onHeadingSelect: d, headingHref: g, onMathDiagnostics: f, parseResult: i, content: null }) });
|
|
1971
|
+
}, xn = ({ document: e, viewer: t }) => {
|
|
1972
1972
|
const { labels: n } = D();
|
|
1973
1973
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
1974
|
-
/* @__PURE__ */ a(Pe, { name: e.name, openUrl:
|
|
1974
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: Hn(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ a(Pr, {}), children: e.truncated ? null : /* @__PURE__ */ a(po, { text: e.text }) }),
|
|
1975
1975
|
e.truncated ? /* @__PURE__ */ a("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
1976
|
-
/* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(
|
|
1976
|
+
/* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(Kt, { ...t, parseResult: null, content: e.text }) })
|
|
1977
1977
|
] });
|
|
1978
1978
|
}, kl = ({ path: e, name: t, viewer: n }) => {
|
|
1979
|
-
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g =
|
|
1980
|
-
|
|
1979
|
+
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g = ee(o.subscribe, d, d), [f, u] = I(0), h = z(() => ({ path: e, stamp: g, attempt: f }), [e, g, f]), [m, S] = I(null), A = ie((T) => {
|
|
1980
|
+
S(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
|
|
1981
1981
|
});
|
|
1982
|
-
|
|
1982
|
+
te(() => {
|
|
1983
1983
|
const T = new AbortController();
|
|
1984
|
-
return r.text(
|
|
1985
|
-
"kind" in
|
|
1984
|
+
return r.text(h.path, T.signal).then((M) => {
|
|
1985
|
+
"kind" in M && A(M);
|
|
1986
1986
|
}), () => T.abort();
|
|
1987
|
-
}, [r,
|
|
1988
|
-
const
|
|
1987
|
+
}, [r, h]);
|
|
1988
|
+
const x = P(() => u((T) => T + 1), []);
|
|
1989
1989
|
return m === null ? /* @__PURE__ */ F(Ne, { children: [
|
|
1990
1990
|
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ a("span", {}, T)) }),
|
|
1991
1991
|
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: i.markupLoading })
|
|
1992
|
-
] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps:
|
|
1993
|
-
},
|
|
1992
|
+
] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps: kn, children: /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: x, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ a(xn, { document: m, viewer: n });
|
|
1993
|
+
}, kn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Sl = Object.freeze({ reason: "failed" }), Rl = (e) => /* @__PURE__ */ a(
|
|
1994
1994
|
_r,
|
|
1995
1995
|
{
|
|
1996
1996
|
fallback: (t) => /* @__PURE__ */ a("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ a(ve, { failure: Sl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
@@ -2008,11 +2008,11 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2008
2008
|
const { session: i, layout: d, region: g, paneScroll: f, stale: u } = l;
|
|
2009
2009
|
if (n === "edit" && i !== void 0) return /* @__PURE__ */ a(Rl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: g, paneScroll: f });
|
|
2010
2010
|
if (n === "markup") return /* @__PURE__ */ a(kl, { path: e, name: t.name, viewer: r });
|
|
2011
|
-
const
|
|
2012
|
-
return /* @__PURE__ */ a(xl, { path: e, document: t, viewer: r, editing: { editable:
|
|
2011
|
+
const h = t.edit !== null && t.edit.kind === "inline";
|
|
2012
|
+
return /* @__PURE__ */ a(xl, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && d === "fill", region: g, paneScroll: f, stale: u } });
|
|
2013
2013
|
}
|
|
2014
2014
|
case "text":
|
|
2015
|
-
return /* @__PURE__ */ a(
|
|
2015
|
+
return /* @__PURE__ */ a(xn, { document: t, viewer: r });
|
|
2016
2016
|
case "image":
|
|
2017
2017
|
return /* @__PURE__ */ a(Xo, { document: t });
|
|
2018
2018
|
case "media":
|
|
@@ -2020,23 +2020,23 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2020
2020
|
case "file":
|
|
2021
2021
|
return /* @__PURE__ */ a(So, { document: t });
|
|
2022
2022
|
case "failure":
|
|
2023
|
-
return /* @__PURE__ */ a(xe, { scrollerProps:
|
|
2023
|
+
return /* @__PURE__ */ a(xe, { scrollerProps: kn, children: /* @__PURE__ */ a(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2024
2024
|
default: {
|
|
2025
2025
|
const i = t;
|
|
2026
2026
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(i)}`);
|
|
2027
2027
|
}
|
|
2028
2028
|
}
|
|
2029
2029
|
}, Cl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Ol = (e, t, n) => {
|
|
2030
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2030
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : gn(e, n), r === void 0 ? null : pn(e, r.id), e.querySelector(Fe), e.querySelector(Cl)];
|
|
2031
2031
|
for (const l of o)
|
|
2032
|
-
if (l instanceof HTMLElement &&
|
|
2032
|
+
if (l instanceof HTMLElement && cn(l)) return l;
|
|
2033
2033
|
return null;
|
|
2034
|
-
},
|
|
2034
|
+
}, Ft = (e, t, n) => {
|
|
2035
2035
|
const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
|
|
2036
|
-
t instanceof HTMLElement && n && (l || e.contains(r)) &&
|
|
2036
|
+
t instanceof HTMLElement && n && (l || e.contains(r)) && cn(t);
|
|
2037
2037
|
}, Al = (e) => {
|
|
2038
|
-
const t =
|
|
2039
|
-
return
|
|
2038
|
+
const t = _(!1);
|
|
2039
|
+
return U(() => {
|
|
2040
2040
|
const n = e.current;
|
|
2041
2041
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
2042
2042
|
const r = n.ownerDocument, o = r.defaultView;
|
|
@@ -2051,81 +2051,81 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2051
2051
|
}, f = (m) => {
|
|
2052
2052
|
m.relatedTarget === null && l && (t.current = !1);
|
|
2053
2053
|
}, u = () => {
|
|
2054
|
-
const { activeElement: m, body:
|
|
2055
|
-
m !== null && m !==
|
|
2056
|
-
},
|
|
2054
|
+
const { activeElement: m, body: S } = r;
|
|
2055
|
+
m !== null && m !== S && (t.current = n.contains(m));
|
|
2056
|
+
}, h = () => {
|
|
2057
2057
|
l && !n.contains(r.activeElement) && (t.current = !1);
|
|
2058
2058
|
};
|
|
2059
|
-
return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", g, !0), o.addEventListener("blur", u), o.addEventListener("focus",
|
|
2060
|
-
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus",
|
|
2059
|
+
return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", g, !0), o.addEventListener("blur", u), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
|
|
2060
|
+
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
|
|
2061
2061
|
};
|
|
2062
2062
|
}, [e]), t;
|
|
2063
|
-
}, Ll = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure:
|
|
2064
|
-
const { labels:
|
|
2065
|
-
(
|
|
2066
|
-
const
|
|
2067
|
-
|
|
2063
|
+
}, Ll = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure: h, onDocumentShown: m }) => {
|
|
2064
|
+
const { labels: S, announcer: A, documents: x } = D(), { document: T } = t, M = _(null), C = _(null), s = _(null), c = _(0), p = Al(M), w = _({ path: e, document: T }), k = _(null), L = P(
|
|
2065
|
+
(H) => {
|
|
2066
|
+
const V = M.current, J = Lt(V, H, f);
|
|
2067
|
+
V !== null && J !== null && Ft(V, J, p.current);
|
|
2068
2068
|
},
|
|
2069
|
-
[f,
|
|
2070
|
-
),
|
|
2071
|
-
(
|
|
2072
|
-
const
|
|
2069
|
+
[f, p]
|
|
2070
|
+
), O = P(
|
|
2071
|
+
(H, V) => {
|
|
2072
|
+
const J = c.current;
|
|
2073
2073
|
setTimeout(() => {
|
|
2074
|
-
!
|
|
2074
|
+
!V.defaultPrevented && c.current === J && L(H);
|
|
2075
2075
|
}, 0);
|
|
2076
2076
|
},
|
|
2077
2077
|
[L]
|
|
2078
2078
|
), N = P(
|
|
2079
|
-
(
|
|
2079
|
+
(H) => {
|
|
2080
2080
|
setTimeout(() => {
|
|
2081
|
-
|
|
2081
|
+
H.defaultPrevented || L("#");
|
|
2082
2082
|
}, 0);
|
|
2083
2083
|
},
|
|
2084
2084
|
[L]
|
|
2085
|
-
), q =
|
|
2086
|
-
const
|
|
2087
|
-
if (
|
|
2088
|
-
|
|
2089
|
-
const
|
|
2090
|
-
if (
|
|
2091
|
-
|
|
2085
|
+
), q = z(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: O, followEmptyFragment: N }), [d, e, L, O, N]), G = P(() => x.retry(e), [x, e]), W = eo(x, el), Q = ln(e), K = Q !== void 0 ? "edit" : n ? "markup" : "rendered", Y = T.kind === "markdown" ? K : void 0, oe = P(() => M.current, []), v = z(() => ({ session: Q, layout: l, region: oe, paneScroll: f, stale: r }), [Q, l, oe, f, r]), b = Y === "edit" ? !1 : r, y = ne(fe), R = Y === "edit" && l === "fill" ? "fill" : y, $ = ie((H, V) => {
|
|
2086
|
+
const J = C.current;
|
|
2087
|
+
if (J !== null && J.path === H && J.snapshot === V) return;
|
|
2088
|
+
C.current = { path: H, snapshot: V };
|
|
2089
|
+
const re = V.document;
|
|
2090
|
+
if (re.kind === "failure") {
|
|
2091
|
+
x.noteFailureShown(V) && h(S.documentFailed(Ee(H), ae(S, re.failure.reason)));
|
|
2092
2092
|
return;
|
|
2093
2093
|
}
|
|
2094
|
-
m?.(
|
|
2094
|
+
m?.(H, re), u && (J === null || J.path !== H || J.snapshot.document.kind === "failure") && A.announce(S.documentShown(re.name));
|
|
2095
2095
|
});
|
|
2096
|
-
|
|
2097
|
-
|
|
2096
|
+
te(() => {
|
|
2097
|
+
$(e, t);
|
|
2098
2098
|
}, [e, t]);
|
|
2099
|
-
const
|
|
2099
|
+
const B = ie(() => {
|
|
2100
2100
|
g.kind === "panel" && g.consume();
|
|
2101
|
-
}), Z = ie((
|
|
2102
|
-
const
|
|
2103
|
-
if (
|
|
2104
|
-
const { activeElement:
|
|
2105
|
-
return
|
|
2106
|
-
}),
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2109
|
-
}), le = ie((
|
|
2110
|
-
return
|
|
2101
|
+
}), Z = ie((H) => {
|
|
2102
|
+
const V = M.current;
|
|
2103
|
+
if (V === null || !p.current) return null;
|
|
2104
|
+
const { activeElement: J, body: re } = V.ownerDocument;
|
|
2105
|
+
return J !== null && J !== re ? null : Ol(V, T, H);
|
|
2106
|
+
}), j = ie((H) => {
|
|
2107
|
+
const V = M.current;
|
|
2108
|
+
V !== null && Ft(V, H, p.current);
|
|
2109
|
+
}), le = ie((H) => f.reveal(H)), ct = ie((H) => Lt(M.current, H, f));
|
|
2110
|
+
return te(() => {
|
|
2111
2111
|
if (r) return;
|
|
2112
|
-
const
|
|
2112
|
+
const H = w.current.path !== e, V = H || w.current.document !== T;
|
|
2113
2113
|
w.current = { path: e, document: T };
|
|
2114
|
-
const
|
|
2114
|
+
const J = k.current !== e;
|
|
2115
2115
|
k.current = e;
|
|
2116
|
-
let
|
|
2117
|
-
g.kind === "page" ? s.current !== g.navigation && (s.current = g.navigation, c.current += 1,
|
|
2116
|
+
let re = null;
|
|
2117
|
+
g.kind === "page" ? s.current !== g.navigation && (s.current = g.navigation, c.current += 1, re = g.fragment) : g.fragment !== null && (re = g.fragment, B());
|
|
2118
2118
|
const dt = () => {
|
|
2119
|
-
const je =
|
|
2120
|
-
if (!
|
|
2121
|
-
je !== null &&
|
|
2119
|
+
const je = re === null ? null : ct(re);
|
|
2120
|
+
if (!V) {
|
|
2121
|
+
je !== null && j(je);
|
|
2122
2122
|
return;
|
|
2123
2123
|
}
|
|
2124
2124
|
const ut = Z(g.fragment);
|
|
2125
|
-
|
|
2125
|
+
H && je === null && ut !== null && le(ut);
|
|
2126
2126
|
};
|
|
2127
|
-
|
|
2128
|
-
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value:
|
|
2127
|
+
J ? queueMicrotask(dt) : dt();
|
|
2128
|
+
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value: R, children: /* @__PURE__ */ a(st, { kind: T.kind, view: Y, label: i(e, T), stale: b, busy: b, frameRef: M, intent: W, children: /* @__PURE__ */ a(vn, { value: q, children: /* @__PURE__ */ a(Jo, { children: /* @__PURE__ */ a(Tl, { path: e, document: T, view: K, viewer: o, onRetry: G, editing: v }, e) }) }) }) });
|
|
2129
2129
|
}, at = Object.freeze({ kind: "skeleton" }), Ml = (e, t, n, r, o) => {
|
|
2130
2130
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2131
2131
|
const l = de(t);
|
|
@@ -2134,29 +2134,29 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2134
2134
|
const i = n === null || n === e ? null : de(r);
|
|
2135
2135
|
return n === null || i === null ? at : { kind: "document", path: n, snapshot: i, stale: !0 };
|
|
2136
2136
|
}, Nl = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, Dl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2137
|
-
const o = t.kind === "streaming" ? Nl(t.path,
|
|
2138
|
-
return o.kind !== "document" ? /* @__PURE__ */ a(
|
|
2139
|
-
},
|
|
2140
|
-
const { config: f, labels: u, theme:
|
|
2141
|
-
|
|
2142
|
-
|
|
2137
|
+
const o = t.kind === "streaming" ? Nl(t.path, ne(t.promise)) : t;
|
|
2138
|
+
return o.kind !== "document" ? /* @__PURE__ */ a(yn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ a(Ll, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2139
|
+
}, Sn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: g }) => {
|
|
2140
|
+
const { config: f, labels: u, theme: h, documents: m } = D(), S = lr(), A = _(!1);
|
|
2141
|
+
U(() => {
|
|
2142
|
+
A.current = !0;
|
|
2143
2143
|
}, []);
|
|
2144
|
-
const [
|
|
2145
|
-
|
|
2146
|
-
const k = e === null ? at : Ml(e, c,
|
|
2147
|
-
L !==
|
|
2148
|
-
const
|
|
2149
|
-
|
|
2150
|
-
const N =
|
|
2144
|
+
const [x, T] = I(null), [M, C] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), c = ee(m.subscribe, s, s), p = P(() => x === null ? void 0 : m.peek(x), [m, x]), w = ee(m.subscribe, p, p);
|
|
2145
|
+
U(() => e === null ? void 0 : m.open(e), [m, e]), U(() => x === null ? void 0 : m.retain(x), [m, x]);
|
|
2146
|
+
const k = e === null ? at : Ml(e, c, x, w, !A.current), L = e === null ? null : k.kind === "document" && !k.stale ? k.path : x;
|
|
2147
|
+
L !== x && T(L);
|
|
2148
|
+
const O = k.kind !== "document" || k.path === e;
|
|
2149
|
+
O && t !== M && C(t);
|
|
2150
|
+
const N = z(() => bl(u), [u]), q = z(() => [...f.iframeHosts], [f]), G = r.kind === "panel", W = z(
|
|
2151
2151
|
() => ({
|
|
2152
2152
|
labels: N,
|
|
2153
2153
|
emptyMessage: u.documentEmpty,
|
|
2154
|
-
theme:
|
|
2154
|
+
theme: h,
|
|
2155
2155
|
availableStyles: f.documentStyles,
|
|
2156
2156
|
iFrameAllowedDomains: q,
|
|
2157
2157
|
embeds: f.embeds,
|
|
2158
2158
|
linkComponent: il,
|
|
2159
|
-
toolbar:
|
|
2159
|
+
toolbar: S,
|
|
2160
2160
|
style: n.style,
|
|
2161
2161
|
onStyleChange: n.onStyleChange,
|
|
2162
2162
|
align: n.align,
|
|
@@ -2167,19 +2167,19 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2167
2167
|
padding: n.padding,
|
|
2168
2168
|
width: n.width === void 0 ? void 0 : `min(${n.width}, 100%)`,
|
|
2169
2169
|
maxWidth: n.maxWidth === void 0 ? void 0 : `min(${n.maxWidth}, 100%)`,
|
|
2170
|
-
renderScrollBar:
|
|
2170
|
+
renderScrollBar: G ? void 0 : dn
|
|
2171
2171
|
}),
|
|
2172
|
-
[N, u.documentEmpty,
|
|
2173
|
-
),
|
|
2174
|
-
return e === null ? /* @__PURE__ */ a(fe, { value:
|
|
2172
|
+
[N, u.documentEmpty, h, f.documentStyles, q, f.embeds, S, n, G]
|
|
2173
|
+
), Q = P((Y, oe) => G ? oe === null || oe.kind === "failure" ? Ee(Y) : oe.name : u.documentRegion, [G, u.documentRegion]), K = G ? "content" : "fill";
|
|
2174
|
+
return e === null ? /* @__PURE__ */ a(fe, { value: K, children: /* @__PURE__ */ a(yl, {}) }) : /* @__PURE__ */ a(fe, { value: K, children: /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a(yn, { label: Q(e, null) }), children: /* @__PURE__ */ a(
|
|
2175
2175
|
Dl,
|
|
2176
2176
|
{
|
|
2177
2177
|
requestedPath: e,
|
|
2178
2178
|
content: k,
|
|
2179
|
-
markup:
|
|
2180
|
-
viewer:
|
|
2179
|
+
markup: O ? t : M,
|
|
2180
|
+
viewer: W,
|
|
2181
2181
|
editLayout: n.editLayout,
|
|
2182
|
-
regionLabel:
|
|
2182
|
+
regionLabel: Q,
|
|
2183
2183
|
navigation: r,
|
|
2184
2184
|
fragment: o,
|
|
2185
2185
|
paneScroll: l,
|
|
@@ -2189,47 +2189,47 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2189
2189
|
}
|
|
2190
2190
|
) }) });
|
|
2191
2191
|
}, $l = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2192
|
-
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u =
|
|
2192
|
+
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u = Vt(), h = nt(), { view: m, overrides: S, embed: A } = n, x = P(
|
|
2193
2193
|
(L) => {
|
|
2194
|
-
if (
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2194
|
+
if (h.kind !== "location") return;
|
|
2195
|
+
const O = El(o, h.location, L);
|
|
2196
|
+
O !== null && f(O, "browse");
|
|
2197
2197
|
},
|
|
2198
|
-
[o, f,
|
|
2198
|
+
[o, f, h]
|
|
2199
2199
|
), T = P(
|
|
2200
2200
|
(L) => {
|
|
2201
|
-
l.update({ style: L }),
|
|
2201
|
+
l.update({ style: L }), x("style");
|
|
2202
2202
|
},
|
|
2203
|
-
[l,
|
|
2204
|
-
),
|
|
2203
|
+
[l, x]
|
|
2204
|
+
), M = P(
|
|
2205
2205
|
(L) => {
|
|
2206
|
-
l.update({ align: L }),
|
|
2206
|
+
l.update({ align: L }), x("align");
|
|
2207
2207
|
},
|
|
2208
|
-
[l,
|
|
2209
|
-
),
|
|
2208
|
+
[l, x]
|
|
2209
|
+
), C = bn(o, S.style, d), s = En(S.align, g), c = z(
|
|
2210
2210
|
() => ({
|
|
2211
|
-
style:
|
|
2211
|
+
style: C,
|
|
2212
2212
|
onStyleChange: T,
|
|
2213
2213
|
align: s,
|
|
2214
|
-
onAlignChange:
|
|
2215
|
-
showToc:
|
|
2216
|
-
showStyle:
|
|
2217
|
-
showAlign:
|
|
2218
|
-
padding:
|
|
2219
|
-
width:
|
|
2220
|
-
maxWidth:
|
|
2214
|
+
onAlignChange: M,
|
|
2215
|
+
showToc: A.showToc !== !1,
|
|
2216
|
+
showStyle: A.showStyle !== !1,
|
|
2217
|
+
showAlign: A.showAlign !== !1,
|
|
2218
|
+
padding: A.padding,
|
|
2219
|
+
width: A.width,
|
|
2220
|
+
maxWidth: A.maxWidth,
|
|
2221
2221
|
editLayout: "fill"
|
|
2222
2222
|
}),
|
|
2223
|
-
[
|
|
2224
|
-
),
|
|
2225
|
-
return /* @__PURE__ */ a(
|
|
2223
|
+
[C, T, s, M, A]
|
|
2224
|
+
), p = z(() => ({ kind: "page", view: m, overrides: S, embed: A }), [m, S, A]), w = z(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), k = P((L) => i.announce(L), [i]);
|
|
2225
|
+
return /* @__PURE__ */ a(Sn, { path: e, markup: t, display: c, navigation: p, fragment: w, paneScroll: Mo, announces: !0, announceFailure: k, onDocumentShown: r });
|
|
2226
2226
|
}, Pl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2227
|
-
const { config: o, viewSettings: l } = D(), i = Ae((
|
|
2227
|
+
const { config: o, viewSettings: l } = D(), i = Ae((p) => p.style), d = Ae((p) => p.align), [g, f] = I(() => bn(o, void 0, i)), u = En(void 0, d), h = P((p) => l.update({ align: p }), [l]), { maximized: m, onDocumentLink: S, pendingHash: A, onHashConsumed: x, announceFailure: T, paneScroll: M } = n, C = z(
|
|
2228
2228
|
() => ({
|
|
2229
2229
|
style: g,
|
|
2230
2230
|
onStyleChange: f,
|
|
2231
2231
|
align: u,
|
|
2232
|
-
onAlignChange:
|
|
2232
|
+
onAlignChange: h,
|
|
2233
2233
|
showToc: m,
|
|
2234
2234
|
showStyle: m,
|
|
2235
2235
|
showAlign: m,
|
|
@@ -2238,16 +2238,16 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2238
2238
|
maxWidth: void 0,
|
|
2239
2239
|
editLayout: m ? "fill" : "content"
|
|
2240
2240
|
}),
|
|
2241
|
-
[g, u,
|
|
2242
|
-
), s =
|
|
2243
|
-
return /* @__PURE__ */ a(
|
|
2241
|
+
[g, u, h, m]
|
|
2242
|
+
), s = z(() => ({ kind: "panel", onDocumentLink: S }), [S]), c = z(() => ({ kind: "panel", fragment: A, consume: x }), [A, x]);
|
|
2243
|
+
return /* @__PURE__ */ a(Sn, { path: e, markup: t, display: C, navigation: s, fragment: c, paneScroll: M, announces: !1, announceFailure: T, onDocumentShown: r });
|
|
2244
2244
|
}, Fl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ a($l, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ a(Pl, { path: e, markup: t, variant: n, onDocumentShown: r });
|
|
2245
2245
|
function ql({
|
|
2246
2246
|
title: e,
|
|
2247
2247
|
titleId: t,
|
|
2248
2248
|
...n
|
|
2249
2249
|
}, r) {
|
|
2250
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2251
2251
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2252
2252
|
viewBox: "0 0 24 24",
|
|
2253
2253
|
fill: "currentColor",
|
|
@@ -2255,21 +2255,21 @@ function ql({
|
|
|
2255
2255
|
"data-slot": "icon",
|
|
2256
2256
|
ref: r,
|
|
2257
2257
|
"aria-labelledby": t
|
|
2258
|
-
}, n), e ? /* @__PURE__ */
|
|
2258
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2259
2259
|
id: t
|
|
2260
|
-
}, e) : null, /* @__PURE__ */
|
|
2260
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2261
2261
|
fillRule: "evenodd",
|
|
2262
2262
|
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",
|
|
2263
2263
|
clipRule: "evenodd"
|
|
2264
2264
|
}));
|
|
2265
2265
|
}
|
|
2266
|
-
const _l = /* @__PURE__ */
|
|
2266
|
+
const _l = /* @__PURE__ */ E.forwardRef(ql);
|
|
2267
2267
|
function Bl({
|
|
2268
2268
|
title: e,
|
|
2269
2269
|
titleId: t,
|
|
2270
2270
|
...n
|
|
2271
2271
|
}, r) {
|
|
2272
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2273
2273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2274
2274
|
viewBox: "0 0 24 24",
|
|
2275
2275
|
fill: "currentColor",
|
|
@@ -2277,21 +2277,21 @@ function Bl({
|
|
|
2277
2277
|
"data-slot": "icon",
|
|
2278
2278
|
ref: r,
|
|
2279
2279
|
"aria-labelledby": t
|
|
2280
|
-
}, n), e ? /* @__PURE__ */
|
|
2280
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2281
2281
|
id: t
|
|
2282
|
-
}, e) : null, /* @__PURE__ */
|
|
2282
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2283
2283
|
fillRule: "evenodd",
|
|
2284
2284
|
d: "M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",
|
|
2285
2285
|
clipRule: "evenodd"
|
|
2286
2286
|
}));
|
|
2287
2287
|
}
|
|
2288
|
-
const Il = /* @__PURE__ */
|
|
2288
|
+
const Il = /* @__PURE__ */ E.forwardRef(Bl);
|
|
2289
2289
|
function jl({
|
|
2290
2290
|
title: e,
|
|
2291
2291
|
titleId: t,
|
|
2292
2292
|
...n
|
|
2293
2293
|
}, r) {
|
|
2294
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2295
2295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2296
2296
|
viewBox: "0 0 24 24",
|
|
2297
2297
|
fill: "currentColor",
|
|
@@ -2299,21 +2299,21 @@ function jl({
|
|
|
2299
2299
|
"data-slot": "icon",
|
|
2300
2300
|
ref: r,
|
|
2301
2301
|
"aria-labelledby": t
|
|
2302
|
-
}, n), e ? /* @__PURE__ */
|
|
2302
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2303
2303
|
id: t
|
|
2304
|
-
}, e) : null, /* @__PURE__ */
|
|
2304
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2305
2305
|
fillRule: "evenodd",
|
|
2306
2306
|
d: "M15.75 2.25H21a.75.75 0 0 1 .75.75v5.25a.75.75 0 0 1-1.5 0V4.81L8.03 17.03a.75.75 0 0 1-1.06-1.06L19.19 3.75h-3.44a.75.75 0 0 1 0-1.5Zm-10.5 4.5a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5a1.5 1.5 0 0 0 1.5-1.5V10.5a.75.75 0 0 1 1.5 0v8.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h8.25a.75.75 0 0 1 0 1.5H5.25Z",
|
|
2307
2307
|
clipRule: "evenodd"
|
|
2308
2308
|
}));
|
|
2309
2309
|
}
|
|
2310
|
-
const Hl = /* @__PURE__ */
|
|
2310
|
+
const Hl = /* @__PURE__ */ E.forwardRef(jl);
|
|
2311
2311
|
function zl({
|
|
2312
2312
|
title: e,
|
|
2313
2313
|
titleId: t,
|
|
2314
2314
|
...n
|
|
2315
2315
|
}, r) {
|
|
2316
|
-
return /* @__PURE__ */
|
|
2316
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2317
2317
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2318
2318
|
viewBox: "0 0 24 24",
|
|
2319
2319
|
fill: "currentColor",
|
|
@@ -2321,25 +2321,25 @@ function zl({
|
|
|
2321
2321
|
"data-slot": "icon",
|
|
2322
2322
|
ref: r,
|
|
2323
2323
|
"aria-labelledby": t
|
|
2324
|
-
}, n), e ? /* @__PURE__ */
|
|
2324
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2325
2325
|
id: t
|
|
2326
|
-
}, e) : null, /* @__PURE__ */
|
|
2326
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2327
2327
|
fillRule: "evenodd",
|
|
2328
2328
|
d: "M11.47 13.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 0 0-1.06-1.06L12 11.69 5.03 4.72a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2329
2329
|
clipRule: "evenodd"
|
|
2330
|
-
}), /* @__PURE__ */
|
|
2330
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2331
2331
|
fillRule: "evenodd",
|
|
2332
2332
|
d: "M11.47 19.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 1 0-1.06-1.06L12 17.69l-6.97-6.97a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2333
2333
|
clipRule: "evenodd"
|
|
2334
2334
|
}));
|
|
2335
2335
|
}
|
|
2336
|
-
const Ul = /* @__PURE__ */
|
|
2336
|
+
const Ul = /* @__PURE__ */ E.forwardRef(zl);
|
|
2337
2337
|
function Zl({
|
|
2338
2338
|
title: e,
|
|
2339
2339
|
titleId: t,
|
|
2340
2340
|
...n
|
|
2341
2341
|
}, r) {
|
|
2342
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2343
2343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2344
2344
|
viewBox: "0 0 24 24",
|
|
2345
2345
|
fill: "currentColor",
|
|
@@ -2347,21 +2347,21 @@ function Zl({
|
|
|
2347
2347
|
"data-slot": "icon",
|
|
2348
2348
|
ref: r,
|
|
2349
2349
|
"aria-labelledby": t
|
|
2350
|
-
}, n), e ? /* @__PURE__ */
|
|
2350
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2351
2351
|
id: t
|
|
2352
|
-
}, e) : null, /* @__PURE__ */
|
|
2352
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2353
2353
|
fillRule: "evenodd",
|
|
2354
2354
|
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",
|
|
2355
2355
|
clipRule: "evenodd"
|
|
2356
2356
|
}));
|
|
2357
2357
|
}
|
|
2358
|
-
const Vl = /* @__PURE__ */
|
|
2358
|
+
const Vl = /* @__PURE__ */ E.forwardRef(Zl);
|
|
2359
2359
|
function Gl({
|
|
2360
2360
|
title: e,
|
|
2361
2361
|
titleId: t,
|
|
2362
2362
|
...n
|
|
2363
2363
|
}, r) {
|
|
2364
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2365
2365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2366
2366
|
viewBox: "0 0 24 24",
|
|
2367
2367
|
fill: "currentColor",
|
|
@@ -2369,23 +2369,23 @@ function Gl({
|
|
|
2369
2369
|
"data-slot": "icon",
|
|
2370
2370
|
ref: r,
|
|
2371
2371
|
"aria-labelledby": t
|
|
2372
|
-
}, n), e ? /* @__PURE__ */
|
|
2372
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2373
2373
|
id: t
|
|
2374
|
-
}, e) : null, /* @__PURE__ */
|
|
2374
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2375
2375
|
fillRule: "evenodd",
|
|
2376
2376
|
d: "M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
2377
2377
|
clipRule: "evenodd"
|
|
2378
|
-
}), /* @__PURE__ */
|
|
2378
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2379
2379
|
d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
|
|
2380
2380
|
}));
|
|
2381
2381
|
}
|
|
2382
|
-
const Kl = /* @__PURE__ */
|
|
2382
|
+
const Kl = /* @__PURE__ */ E.forwardRef(Gl);
|
|
2383
2383
|
function Wl({
|
|
2384
2384
|
title: e,
|
|
2385
2385
|
titleId: t,
|
|
2386
2386
|
...n
|
|
2387
2387
|
}, r) {
|
|
2388
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2389
2389
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2390
2390
|
viewBox: "0 0 24 24",
|
|
2391
2391
|
fill: "currentColor",
|
|
@@ -2393,23 +2393,23 @@ function Wl({
|
|
|
2393
2393
|
"data-slot": "icon",
|
|
2394
2394
|
ref: r,
|
|
2395
2395
|
"aria-labelledby": t
|
|
2396
|
-
}, n), e ? /* @__PURE__ */
|
|
2396
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2397
2397
|
id: t
|
|
2398
|
-
}, e) : null, /* @__PURE__ */
|
|
2398
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2399
2399
|
d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
|
|
2400
|
-
}), /* @__PURE__ */
|
|
2400
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2401
2401
|
fillRule: "evenodd",
|
|
2402
2402
|
d: "M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",
|
|
2403
2403
|
clipRule: "evenodd"
|
|
2404
2404
|
}));
|
|
2405
2405
|
}
|
|
2406
|
-
const Xl = /* @__PURE__ */
|
|
2406
|
+
const Xl = /* @__PURE__ */ E.forwardRef(Wl);
|
|
2407
2407
|
function Yl({
|
|
2408
2408
|
title: e,
|
|
2409
2409
|
titleId: t,
|
|
2410
2410
|
...n
|
|
2411
2411
|
}, r) {
|
|
2412
|
-
return /* @__PURE__ */
|
|
2412
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2413
2413
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2414
2414
|
viewBox: "0 0 24 24",
|
|
2415
2415
|
fill: "currentColor",
|
|
@@ -2417,15 +2417,15 @@ function Yl({
|
|
|
2417
2417
|
"data-slot": "icon",
|
|
2418
2418
|
ref: r,
|
|
2419
2419
|
"aria-labelledby": t
|
|
2420
|
-
}, n), e ? /* @__PURE__ */
|
|
2420
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2421
2421
|
id: t
|
|
2422
|
-
}, e) : null, /* @__PURE__ */
|
|
2422
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2423
2423
|
d: "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"
|
|
2424
|
-
}), /* @__PURE__ */
|
|
2424
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2425
2425
|
d: "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"
|
|
2426
2426
|
}));
|
|
2427
2427
|
}
|
|
2428
|
-
const Jl = /* @__PURE__ */
|
|
2428
|
+
const Jl = /* @__PURE__ */ E.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId: n }) => {
|
|
2429
2429
|
const { labels: r, onEditGrant: o } = D(), [l, i] = I(!1), d = () => {
|
|
2430
2430
|
o === void 0 || l || (i(!0), o(e).then((g) => {
|
|
2431
2431
|
g && t();
|
|
@@ -2441,103 +2441,105 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2441
2441
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2442
2442
|
] })
|
|
2443
2443
|
] });
|
|
2444
|
-
},
|
|
2444
|
+
}, qt = (e, t, n) => {
|
|
2445
2445
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2446
2446
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2447
2447
|
}, ei = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2448
|
-
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f =
|
|
2449
|
-
|
|
2450
|
-
const
|
|
2451
|
-
if (
|
|
2452
|
-
if (n && !
|
|
2453
|
-
const N =
|
|
2454
|
-
u.current = N instanceof HTMLElement ? N : null,
|
|
2455
|
-
} else !n &&
|
|
2456
|
-
}, [n]),
|
|
2448
|
+
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f = _(null), u = _(null), h = Oe(), [m, S] = I(null), [A, x] = I(0), [T, M] = I(null), [C, s] = I(null), c = z(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
|
|
2449
|
+
U(() => {
|
|
2450
|
+
const O = f.current;
|
|
2451
|
+
if (O !== null)
|
|
2452
|
+
if (n && !O.open) {
|
|
2453
|
+
const N = O.ownerDocument.activeElement;
|
|
2454
|
+
u.current = N instanceof HTMLElement ? N : null, M(null), s(null), O.showModal();
|
|
2455
|
+
} else !n && O.open && (O.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
|
|
2456
|
+
}, [n]), te(() => {
|
|
2457
2457
|
if (!n) return;
|
|
2458
|
-
const
|
|
2459
|
-
return
|
|
2460
|
-
"kind" in N &&
|
|
2461
|
-
}), () =>
|
|
2462
|
-
}, [n, o, e,
|
|
2458
|
+
const O = new AbortController();
|
|
2459
|
+
return S(null), o.revisions(e, O.signal).then((N) => {
|
|
2460
|
+
"kind" in N && S(N);
|
|
2461
|
+
}), () => O.abort();
|
|
2462
|
+
}, [n, o, e, A]), te(() => {
|
|
2463
2463
|
if (!n || T === null) return;
|
|
2464
|
-
const
|
|
2465
|
-
return s(null), o.revision(e, T,
|
|
2464
|
+
const O = new AbortController();
|
|
2465
|
+
return s(null), o.revision(e, T, O.signal).then((N) => {
|
|
2466
2466
|
"kind" in N && s(N);
|
|
2467
|
-
}), () =>
|
|
2467
|
+
}), () => O.abort();
|
|
2468
2468
|
}, [n, o, e, T]);
|
|
2469
|
-
const
|
|
2470
|
-
|
|
2471
|
-
}, w = (
|
|
2472
|
-
|
|
2473
|
-
}, k = (
|
|
2474
|
-
|
|
2475
|
-
}, L = m !== null && m.kind === "revisions" ? m.revisions.find((
|
|
2476
|
-
return /* @__PURE__ */ a("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby":
|
|
2477
|
-
/* @__PURE__ */ a("p", { id:
|
|
2478
|
-
m === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: () =>
|
|
2479
|
-
/* @__PURE__ */ a("span", { children:
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
] }) },
|
|
2483
|
-
T === null ? null :
|
|
2484
|
-
/* @__PURE__ */ a("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) :
|
|
2469
|
+
const p = () => {
|
|
2470
|
+
C === null || C.kind !== "revision" || (l.replaceDraft(e, C.text), g.announce(i.historyRestored(t)), r());
|
|
2471
|
+
}, w = (O) => {
|
|
2472
|
+
O.key !== "Escape" || O.defaultPrevented || (rn(O), r());
|
|
2473
|
+
}, k = (O) => {
|
|
2474
|
+
O.target === O.currentTarget && r();
|
|
2475
|
+
}, L = m !== null && m.kind === "revisions" ? m.revisions.find((O) => O.id === T) : void 0;
|
|
2476
|
+
return /* @__PURE__ */ a("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby": h, "data-testid": "markdown-explorer-history", onKeyDown: w, onClick: k, onCancel: (O) => O.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2477
|
+
/* @__PURE__ */ a("p", { id: h, className: "aqmx-confirm-title", children: i.historyTitle(t) }),
|
|
2478
|
+
m === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: () => x((O) => O + 1), testId: "markdown-explorer-history-failure" }) : m.revisions.length === 0 ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: i.historyEmpty }) : /* @__PURE__ */ a("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: m.revisions.map((O) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": O.id === T, "data-testid": "markdown-explorer-history-entry", onClick: () => M(O.id), children: [
|
|
2479
|
+
/* @__PURE__ */ a("span", { children: qt(O, c, i.historyEntry) }),
|
|
2480
|
+
O.current ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyCurrent }) : null,
|
|
2481
|
+
O.kept ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyKept }) : null
|
|
2482
|
+
] }) }, O.id)) }),
|
|
2483
|
+
T === null ? null : C === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", children: i.historyLoading }) : C.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: C.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2484
|
+
/* @__PURE__ */ a("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : qt(L, c, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ a("pre", { children: C.text }) })
|
|
2485
2485
|
),
|
|
2486
2486
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
2487
2487
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: i.historyClose }),
|
|
2488
|
-
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled":
|
|
2488
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": C === null || C.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: p, children: i.historyRestore })
|
|
2489
2489
|
] })
|
|
2490
2490
|
] }) });
|
|
2491
2491
|
}, ti = (e) => {
|
|
2492
|
-
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o =
|
|
2492
|
+
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), l = de(o)?.document;
|
|
2493
2493
|
return l === void 0 || l.kind === "failure" ? { edit: null, name: Ee(e) } : { edit: l.kind === "markdown" ? l.edit : null, name: l.name };
|
|
2494
2494
|
}, se = (e) => {
|
|
2495
2495
|
e.stopPropagation();
|
|
2496
|
-
}, ni = ({ path: e, documentName: t, iconOnly: n }) => {
|
|
2497
|
-
const { edits:
|
|
2498
|
-
|
|
2499
|
-
() =>
|
|
2496
|
+
}, ni = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r }) => {
|
|
2497
|
+
const { draftConverter: o, edits: l, labels: i } = D(), d = ee(
|
|
2498
|
+
l.subscribe,
|
|
2499
|
+
() => l.session(e) !== void 0,
|
|
2500
2500
|
() => !1
|
|
2501
|
-
), [
|
|
2502
|
-
if (!
|
|
2503
|
-
|
|
2501
|
+
), [g, f] = I(!1), u = () => {
|
|
2502
|
+
if (!d) {
|
|
2503
|
+
l.start(e, l.viewAnchor(e));
|
|
2504
2504
|
return;
|
|
2505
2505
|
}
|
|
2506
|
-
|
|
2507
|
-
},
|
|
2506
|
+
l.flush(e), l.session(e)?.dirty === !0 ? f(!0) : l.close(e);
|
|
2507
|
+
}, h = () => {
|
|
2508
|
+
d || (Fr(), r && l.previewShown() && o?.prepare?.());
|
|
2509
|
+
}, m = n ? i.editDocumentNamed(t) : null;
|
|
2508
2510
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2509
2511
|
/* @__PURE__ */ F(
|
|
2510
2512
|
"button",
|
|
2511
2513
|
{
|
|
2512
2514
|
type: "button",
|
|
2513
|
-
className:
|
|
2514
|
-
title:
|
|
2515
|
-
"aria-label":
|
|
2516
|
-
"aria-pressed":
|
|
2515
|
+
className: m === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2516
|
+
title: d ? i.closeEditor : m === null ? i.editDocument : m,
|
|
2517
|
+
"aria-label": m === null ? void 0 : m,
|
|
2518
|
+
"aria-pressed": d,
|
|
2517
2519
|
"data-testid": "markdown-explorer-document-edit",
|
|
2518
|
-
onClick:
|
|
2520
|
+
onClick: u,
|
|
2519
2521
|
onDoubleClick: se,
|
|
2520
|
-
onPointerEnter:
|
|
2521
|
-
onFocus:
|
|
2522
|
+
onPointerEnter: h,
|
|
2523
|
+
onFocus: h,
|
|
2522
2524
|
children: [
|
|
2523
2525
|
/* @__PURE__ */ a(Jl, { "aria-hidden": "true" }),
|
|
2524
|
-
|
|
2526
|
+
m === null ? /* @__PURE__ */ a("span", { children: i.editDocumentLabel }) : null
|
|
2525
2527
|
]
|
|
2526
2528
|
}
|
|
2527
2529
|
),
|
|
2528
2530
|
/* @__PURE__ */ a(
|
|
2529
|
-
|
|
2531
|
+
on,
|
|
2530
2532
|
{
|
|
2531
|
-
open:
|
|
2532
|
-
title:
|
|
2533
|
-
body:
|
|
2534
|
-
confirmLabel:
|
|
2535
|
-
cancelLabel:
|
|
2533
|
+
open: g,
|
|
2534
|
+
title: i.unsavedTitle,
|
|
2535
|
+
body: i.unsavedBody(t),
|
|
2536
|
+
confirmLabel: i.unsavedDiscard,
|
|
2537
|
+
cancelLabel: i.unsavedStay,
|
|
2536
2538
|
testId: "markdown-explorer-edit-close-confirm",
|
|
2537
2539
|
onConfirm: () => {
|
|
2538
|
-
|
|
2540
|
+
f(!1), l.close(e);
|
|
2539
2541
|
},
|
|
2540
|
-
onCancel: () =>
|
|
2542
|
+
onCancel: () => f(!1)
|
|
2541
2543
|
}
|
|
2542
2544
|
)
|
|
2543
2545
|
] });
|
|
@@ -2561,34 +2563,50 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2561
2563
|
}
|
|
2562
2564
|
);
|
|
2563
2565
|
}, oi = ({ session: e }) => {
|
|
2564
|
-
const { labels: t } = D(), n =
|
|
2566
|
+
const { labels: t } = D(), n = br(t, e);
|
|
2565
2567
|
return /* @__PURE__ */ a("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2566
2568
|
}, li = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2567
|
-
const {
|
|
2569
|
+
const { draftConverter: l, edits: i, labels: d } = D(), g = Mr(), [f, u] = I(!1);
|
|
2568
2570
|
if (r.phase.kind !== "editing") return null;
|
|
2569
|
-
const
|
|
2570
|
-
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2573
|
-
},
|
|
2571
|
+
const h = r.save.kind === "saving", m = h || !r.dirty, S = () => {
|
|
2572
|
+
i.flush(e);
|
|
2573
|
+
const T = i.session(e);
|
|
2574
|
+
T === void 0 || !T.dirty || T.save.kind === "saving" || i.save(e);
|
|
2575
|
+
}, A = (T) => n ? { className: "aqmx-icon-button", "aria-label": T } : { className: "aqmx-icon-button aqmx-labelled-button" }, x = () => {
|
|
2576
|
+
g || l?.prepare?.();
|
|
2577
|
+
};
|
|
2574
2578
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2575
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2579
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...A(d.conflictNext), title: d.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: se, children: [
|
|
2576
2580
|
/* @__PURE__ */ a(Ul, { "aria-hidden": "true" }),
|
|
2577
|
-
n ? null : /* @__PURE__ */ a("span", { children:
|
|
2578
|
-
] }) : null,
|
|
2579
|
-
o ? /* @__PURE__ */ F("button", { type: "button", ...x(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
|
|
2580
|
-
/* @__PURE__ */ a(Xl, { "aria-hidden": "true" }),
|
|
2581
|
-
n ? null : /* @__PURE__ */ a("span", { children: i.previewToggle })
|
|
2581
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.conflictNext })
|
|
2582
2582
|
] }) : null,
|
|
2583
|
-
|
|
2583
|
+
o ? /* @__PURE__ */ F(
|
|
2584
|
+
"button",
|
|
2585
|
+
{
|
|
2586
|
+
type: "button",
|
|
2587
|
+
...A(d.previewToggle),
|
|
2588
|
+
title: d.previewToggle,
|
|
2589
|
+
"aria-pressed": g,
|
|
2590
|
+
"data-testid": "markdown-explorer-edit-preview-toggle",
|
|
2591
|
+
onClick: () => i.setPreviewShown(!g),
|
|
2592
|
+
onDoubleClick: se,
|
|
2593
|
+
onPointerEnter: x,
|
|
2594
|
+
onFocus: x,
|
|
2595
|
+
children: [
|
|
2596
|
+
/* @__PURE__ */ a(Xl, { "aria-hidden": "true" }),
|
|
2597
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.previewToggle })
|
|
2598
|
+
]
|
|
2599
|
+
}
|
|
2600
|
+
) : null,
|
|
2601
|
+
r.history ? /* @__PURE__ */ F("button", { type: "button", ...A(d.historyOpen), title: d.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => u(!0), onDoubleClick: se, children: [
|
|
2584
2602
|
/* @__PURE__ */ a(Vl, { "aria-hidden": "true" }),
|
|
2585
|
-
n ? null : /* @__PURE__ */ a("span", { children:
|
|
2603
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.historyOpen })
|
|
2586
2604
|
] }) : null,
|
|
2587
|
-
/* @__PURE__ */ F("button", { type: "button", ...
|
|
2605
|
+
/* @__PURE__ */ F("button", { type: "button", ...A(d.saveDraft), title: d.saveDraftTooltip, "aria-disabled": m, "aria-busy": h, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: S, onDoubleClick: se, children: [
|
|
2588
2606
|
/* @__PURE__ */ a(Kl, { "aria-hidden": "true" }),
|
|
2589
|
-
n ? null : /* @__PURE__ */ a("span", { children:
|
|
2607
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.saveDraft })
|
|
2590
2608
|
] }),
|
|
2591
|
-
r.history ? /* @__PURE__ */ a(ei, { path: e, documentName: t, open:
|
|
2609
|
+
r.history ? /* @__PURE__ */ a(ei, { path: e, documentName: t, open: f, onClose: () => u(!1) }) : null
|
|
2592
2610
|
] });
|
|
2593
2611
|
}, ii = ({ path: e, session: t }) => {
|
|
2594
2612
|
const { edits: n } = D();
|
|
@@ -2596,45 +2614,45 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2596
2614
|
n.save(e);
|
|
2597
2615
|
}, testId: "markdown-explorer-save-grant" });
|
|
2598
2616
|
}, si = (e) => {
|
|
2599
|
-
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o =
|
|
2617
|
+
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
|
|
2600
2618
|
return de(o)?.document.kind === "markdown";
|
|
2601
2619
|
}, ai = (e) => {
|
|
2602
2620
|
const { config: t } = D(), n = $e(), r = P(() => n(pe(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2603
|
-
return
|
|
2621
|
+
return z(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2604
2622
|
}, ci = /* @__PURE__ */ new Set(), di = (e, t) => {
|
|
2605
|
-
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d =
|
|
2606
|
-
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2609
|
-
|
|
2623
|
+
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = ee(n.subscribe, l, i), g = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, g, g), [u] = I(() => /* @__PURE__ */ new Set()), [h, m] = I(ci), [S, A] = I(null);
|
|
2624
|
+
S !== null && S.path !== e && A(null);
|
|
2625
|
+
const x = _(null);
|
|
2626
|
+
U(() => (x.current = e, () => {
|
|
2627
|
+
x.current = null;
|
|
2610
2628
|
}), [e]);
|
|
2611
2629
|
const T = P(() => {
|
|
2612
2630
|
const s = e, c = n.peek(s);
|
|
2613
2631
|
if (u.has(s) || c?.status === "pending") return;
|
|
2614
|
-
const
|
|
2615
|
-
u.add(s), m(new Set(u)),
|
|
2632
|
+
const p = t && !mn(c);
|
|
2633
|
+
u.add(s), m(new Set(u)), A(null), (async () => {
|
|
2616
2634
|
try {
|
|
2617
2635
|
const w = await n.refresh(s);
|
|
2618
|
-
if (
|
|
2636
|
+
if (x.current !== s || w.status === "superseded") return;
|
|
2619
2637
|
if (w.status === "failed") {
|
|
2620
|
-
|
|
2638
|
+
A({ path: s, failure: w.failure, stamp: n.answerStampOf(s) }), r.announce(o.documentRefreshFailed(ae(o, w.failure.reason)));
|
|
2621
2639
|
return;
|
|
2622
2640
|
}
|
|
2623
2641
|
const k = de(n.peek(s));
|
|
2624
|
-
if (
|
|
2642
|
+
if (p || k === null || k.document.kind === "failure") return;
|
|
2625
2643
|
r.announce(o.documentRefreshed(k.document.name));
|
|
2626
2644
|
} finally {
|
|
2627
2645
|
u.delete(s), m(new Set(u));
|
|
2628
2646
|
}
|
|
2629
2647
|
})();
|
|
2630
|
-
}, [e, t, u, n, r, o]),
|
|
2631
|
-
return { refreshing:
|
|
2648
|
+
}, [e, t, u, n, r, o]), M = h.has(e), C = S !== null && S.path === e && S.stamp === f ? S.failure : null;
|
|
2649
|
+
return { refreshing: M, unavailable: M || d?.status === "pending", failure: C, refresh: T };
|
|
2632
2650
|
}, ui = Object.freeze({ kind: "page" }), fi = ({ path: e, placement: t, markup: n }) => {
|
|
2633
|
-
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = di(e, t.kind === "page"), g = si(e), f = ti(e), u =
|
|
2651
|
+
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = di(e, t.kind === "page"), g = si(e), f = ti(e), u = ln(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, S = t.kind === "panel", A = t.kind === "panel" ? t.documentName : f.name, x = t.kind === "page" || t.maximized;
|
|
2634
2652
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": u === void 0 ? void 0 : "true", children: [
|
|
2635
2653
|
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2636
2654
|
u === void 0 ? null : /* @__PURE__ */ a(oi, { session: u }),
|
|
2637
|
-
u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, documentName:
|
|
2655
|
+
u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, documentName: A, iconOnly: S, session: u, previewAvailable: x }),
|
|
2638
2656
|
u === void 0 && g ? /* @__PURE__ */ F(
|
|
2639
2657
|
"button",
|
|
2640
2658
|
{
|
|
@@ -2652,14 +2670,14 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2652
2670
|
]
|
|
2653
2671
|
}
|
|
2654
2672
|
) : null,
|
|
2655
|
-
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ni, { path: e, documentName:
|
|
2673
|
+
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ni, { path: e, documentName: A, iconOnly: S, previewAvailable: x }) : f.edit?.kind === "external" ? /* @__PURE__ */ a(ri, { href: f.edit.href, documentName: A, iconOnly: S }) : null,
|
|
2656
2674
|
u === void 0 ? /* @__PURE__ */ F(
|
|
2657
2675
|
"button",
|
|
2658
2676
|
{
|
|
2659
2677
|
type: "button",
|
|
2660
|
-
className:
|
|
2661
|
-
title:
|
|
2662
|
-
"aria-label":
|
|
2678
|
+
className: h === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2679
|
+
title: h === null ? r.refreshDocument : h,
|
|
2680
|
+
"aria-label": h === null ? void 0 : h,
|
|
2663
2681
|
"aria-disabled": l,
|
|
2664
2682
|
"aria-busy": o,
|
|
2665
2683
|
"data-aqmx-busy": o ? "true" : void 0,
|
|
@@ -2668,7 +2686,7 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2668
2686
|
onDoubleClick: se,
|
|
2669
2687
|
children: [
|
|
2670
2688
|
/* @__PURE__ */ a(_l, { "aria-hidden": "true" }),
|
|
2671
|
-
|
|
2689
|
+
h === null ? /* @__PURE__ */ a("span", { children: r.refreshDocumentLabel }) : null
|
|
2672
2690
|
]
|
|
2673
2691
|
}
|
|
2674
2692
|
) : null
|
|
@@ -2677,36 +2695,36 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2677
2695
|
u === void 0 ? null : /* @__PURE__ */ a(ii, { path: e, session: u })
|
|
2678
2696
|
] });
|
|
2679
2697
|
}, mi = ({ location: e }) => {
|
|
2680
|
-
const t = e.doc, n =
|
|
2698
|
+
const t = e.doc, n = z(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = ai(e);
|
|
2681
2699
|
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
2682
2700
|
/* @__PURE__ */ a(fi, { path: t, placement: ui, markup: r }),
|
|
2683
2701
|
/* @__PURE__ */ a(Fl, { path: t, markup: e.markup, variant: n })
|
|
2684
2702
|
] });
|
|
2685
2703
|
}, hi = ({ holds: e, testId: t }) => {
|
|
2686
2704
|
const { labels: n, announcer: r } = D(), o = Oe();
|
|
2687
|
-
|
|
2688
|
-
const l = P(() => r.shownIn(o), [r, o]), i =
|
|
2705
|
+
U(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2706
|
+
const l = P(() => r.shownIn(o), [r, o]), i = ee(r.subscribe, l, l);
|
|
2689
2707
|
return /* @__PURE__ */ a("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
|
|
2690
2708
|
}, ue = Object.freeze([]), pi = (e) => {
|
|
2691
2709
|
const t = /* @__PURE__ */ new Set();
|
|
2692
2710
|
let n = ue, r = [], o = !1;
|
|
2693
2711
|
const l = [], i = (u) => {
|
|
2694
2712
|
n = u;
|
|
2695
|
-
for (const
|
|
2713
|
+
for (const h of [...t]) h();
|
|
2696
2714
|
}, d = () => l.at(-1)?.region, g = (u) => {
|
|
2697
|
-
const
|
|
2698
|
-
u(), d() !==
|
|
2715
|
+
const h = d();
|
|
2716
|
+
u(), d() !== h && n !== ue && i(ue);
|
|
2699
2717
|
}, f = () => {
|
|
2700
2718
|
o = !1;
|
|
2701
|
-
const u = r.map((
|
|
2719
|
+
const u = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
|
|
2702
2720
|
r = [], i(Object.freeze(u));
|
|
2703
2721
|
};
|
|
2704
2722
|
return {
|
|
2705
2723
|
announce: (u) => {
|
|
2706
2724
|
if (typeof u == "string") r.push({ sentence: u });
|
|
2707
2725
|
else {
|
|
2708
|
-
const
|
|
2709
|
-
|
|
2726
|
+
const h = r.find((m) => "list" in m && m.list === u.list);
|
|
2727
|
+
h !== void 0 && "items" in h ? h.items.push(u.item) : r.push({ list: u.list, items: [u.item] });
|
|
2710
2728
|
}
|
|
2711
2729
|
o || (o = !0, n !== ue && i(ue), e.request(f));
|
|
2712
2730
|
},
|
|
@@ -2714,9 +2732,9 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2714
2732
|
t.delete(u);
|
|
2715
2733
|
}),
|
|
2716
2734
|
claim: (u) => {
|
|
2717
|
-
const
|
|
2718
|
-
return g(() => l.push(
|
|
2719
|
-
const m = l.indexOf(
|
|
2735
|
+
const h = { region: u };
|
|
2736
|
+
return g(() => l.push(h)), () => g(() => {
|
|
2737
|
+
const m = l.indexOf(h);
|
|
2720
2738
|
m !== -1 && l.splice(m, 1);
|
|
2721
2739
|
});
|
|
2722
2740
|
},
|
|
@@ -2725,64 +2743,64 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2725
2743
|
}, he = Object.freeze({ status: "cancelled" }), gi = (e) => {
|
|
2726
2744
|
if (e === null || typeof e != "object") return null;
|
|
2727
2745
|
const { failure: t } = e;
|
|
2728
|
-
if (
|
|
2746
|
+
if (Kn(t) !== null) return null;
|
|
2729
2747
|
const { reason: n, code: r } = t;
|
|
2730
|
-
return
|
|
2748
|
+
return Wn(n, r);
|
|
2731
2749
|
}, vi = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
2732
|
-
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u,
|
|
2733
|
-
let
|
|
2750
|
+
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, h, m) => {
|
|
2751
|
+
let S;
|
|
2734
2752
|
try {
|
|
2735
|
-
|
|
2753
|
+
S = await r(f, { credentials: "same-origin", ...u, headers: { Accept: "application/json", ...u.headers } });
|
|
2736
2754
|
} catch {
|
|
2737
2755
|
return m({ reason: "failed" });
|
|
2738
2756
|
}
|
|
2739
|
-
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2742
|
-
let
|
|
2757
|
+
S.status === 401 && t(null);
|
|
2758
|
+
const A = S.headers.get(zn);
|
|
2759
|
+
A !== null && t(A);
|
|
2760
|
+
let x;
|
|
2743
2761
|
try {
|
|
2744
|
-
|
|
2762
|
+
x = await S.json();
|
|
2745
2763
|
} catch {
|
|
2746
|
-
return m({ reason: ht(
|
|
2764
|
+
return m({ reason: ht(S.status) });
|
|
2747
2765
|
}
|
|
2748
2766
|
let T;
|
|
2749
2767
|
try {
|
|
2750
|
-
T =
|
|
2768
|
+
T = h(x);
|
|
2751
2769
|
} catch {
|
|
2752
2770
|
T = !1;
|
|
2753
2771
|
}
|
|
2754
|
-
if (T) return
|
|
2755
|
-
const
|
|
2756
|
-
return m(
|
|
2757
|
-
}, i = { [gt]:
|
|
2758
|
-
const m = await l(f, u,
|
|
2772
|
+
if (T) return x;
|
|
2773
|
+
const M = gi(x);
|
|
2774
|
+
return m(M !== null ? M : { reason: S.status === 200 ? "failed" : ht(S.status) });
|
|
2775
|
+
}, i = { [gt]: Xn }, d = { [gt]: tr, "Content-Type": `${er}; charset=utf-8` }, g = async (f, u, h) => {
|
|
2776
|
+
const m = await l(f, u, h, (S) => He(S.reason, S.code));
|
|
2759
2777
|
return u.signal.aborted ? he : m;
|
|
2760
2778
|
};
|
|
2761
2779
|
return {
|
|
2762
|
-
tree: (f) => l(o("tree", { [
|
|
2763
|
-
children: async (f, u,
|
|
2764
|
-
const m = await l(o("children", { [
|
|
2765
|
-
return
|
|
2780
|
+
tree: (f) => l(o("tree", { [X.source]: f }), { method: "GET" }, pt, (u) => ({ status: "error", failure: u })),
|
|
2781
|
+
children: async (f, u, h) => {
|
|
2782
|
+
const m = await l(o("children", { [X.source]: f, [X.path]: u }), { method: "GET", signal: h }, Gn, (S) => ({ status: "error", failure: S }));
|
|
2783
|
+
return h.aborted ? he : m;
|
|
2766
2784
|
},
|
|
2767
|
-
ancestors: async (f, u,
|
|
2768
|
-
const m = await l(o("ancestors", { [
|
|
2769
|
-
return
|
|
2785
|
+
ancestors: async (f, u, h) => {
|
|
2786
|
+
const m = await l(o("ancestors", { [X.source]: f, [X.path]: u }), { method: "GET", signal: h }, Vn, (S) => ({ status: "error", failure: S }));
|
|
2787
|
+
return h.aborted ? he : m;
|
|
2770
2788
|
},
|
|
2771
|
-
reveal: async (f, u,
|
|
2772
|
-
const m = await l(o("reveal", { [
|
|
2773
|
-
return
|
|
2789
|
+
reveal: async (f, u, h) => {
|
|
2790
|
+
const m = await l(o("reveal", { [X.source]: f, [X.path]: u }), { method: "GET", signal: h }, Zn, (S) => ({ status: "error", failure: S }));
|
|
2791
|
+
return h.aborted ? he : m;
|
|
2774
2792
|
},
|
|
2775
|
-
document: (f, { refresh: u }) => l(o("document", { [
|
|
2793
|
+
document: (f, { refresh: u }) => l(o("document", { [X.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, or, (h) => He(h.reason, h.code)),
|
|
2776
2794
|
text: async (f, u) => {
|
|
2777
|
-
const
|
|
2778
|
-
return u.aborted ? he :
|
|
2795
|
+
const h = await l(o("text", { [X.path]: f }), { method: "GET", signal: u }, Un, (m) => He(m.reason, m.code));
|
|
2796
|
+
return u.aborted ? he : h;
|
|
2779
2797
|
},
|
|
2780
|
-
edit: (f, u) => g(o("edit", { [
|
|
2781
|
-
save: (f, u,
|
|
2782
|
-
preview: (f, u,
|
|
2783
|
-
revisions: (f, u) => g(o("revisions", { [
|
|
2784
|
-
revision: (f, u,
|
|
2785
|
-
refresh: (f) => l(o("refresh", { [
|
|
2798
|
+
edit: (f, u) => g(o("edit", { [X.path]: f }), { method: "GET", signal: u }, rr),
|
|
2799
|
+
save: (f, u, h, m) => g(o("save", { [X.path]: f, [X.base]: u }), { method: "POST", headers: d, body: h, signal: m }, nr),
|
|
2800
|
+
preview: (f, u, h) => g(o("preview", { [X.path]: f }), { method: "POST", headers: d, body: u, signal: h }, Qn),
|
|
2801
|
+
revisions: (f, u) => g(o("revisions", { [X.path]: f }), { method: "GET", signal: u }, Jn),
|
|
2802
|
+
revision: (f, u, h) => g(o("revision", { [X.path]: f, [X.revision]: u }), { method: "GET", signal: h }, Yn),
|
|
2803
|
+
refresh: (f) => l(o("refresh", { [X.source]: f }), { method: "POST", headers: i }, pt, (u) => ({ status: "error", failure: u }))
|
|
2786
2804
|
};
|
|
2787
2805
|
}, wi = () => {
|
|
2788
2806
|
let e = null, t = null;
|
|
@@ -2800,14 +2818,14 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2800
2818
|
}
|
|
2801
2819
|
};
|
|
2802
2820
|
}, bi = (e) => {
|
|
2803
|
-
const t =
|
|
2821
|
+
const t = Yt(e);
|
|
2804
2822
|
if (t === null) return mt;
|
|
2805
2823
|
try {
|
|
2806
|
-
return
|
|
2824
|
+
return _n(JSON.parse(t));
|
|
2807
2825
|
} catch (n) {
|
|
2808
2826
|
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), mt;
|
|
2809
2827
|
}
|
|
2810
|
-
},
|
|
2828
|
+
}, _t = (e, t) => {
|
|
2811
2829
|
let n = null;
|
|
2812
2830
|
const r = () => {
|
|
2813
2831
|
if (n === null) {
|
|
@@ -2823,205 +2841,205 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2823
2841
|
getServerSnapshot: () => t,
|
|
2824
2842
|
subscribe: o.subscribe,
|
|
2825
2843
|
advance: (l) => {
|
|
2826
|
-
const { changes: i, settings: d } = r(), g =
|
|
2827
|
-
return n = { changes: g, settings: ft(t, g) }, o.emit(),
|
|
2844
|
+
const { changes: i, settings: d } = r(), g = Pn(i, l, Fn(d, l)[l], t);
|
|
2845
|
+
return n = { changes: g, settings: ft(t, g) }, o.emit(), Xt(e, qn(g)), n.settings;
|
|
2828
2846
|
}
|
|
2829
2847
|
};
|
|
2830
|
-
}, Ei = Object.freeze({ status: "refreshed" }), yi = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), xi =
|
|
2831
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
2848
|
+
}, Ei = Object.freeze({ status: "refreshed" }), yi = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), xi = fn(et), Rn = 4, ki = Rn - 1, Bt = Object.freeze({ status: "loading" }), Si = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Ri = (e) => {
|
|
2849
|
+
const t = /* @__PURE__ */ new Map(), n = un(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), g = /* @__PURE__ */ new Set();
|
|
2832
2850
|
let f = 0, u = 0;
|
|
2833
|
-
const
|
|
2834
|
-
let
|
|
2835
|
-
const
|
|
2836
|
-
|
|
2837
|
-
}, T = (v) => o.get(v) ?? 0,
|
|
2838
|
-
let
|
|
2839
|
-
return
|
|
2840
|
-
},
|
|
2841
|
-
v.inFlight.delete(
|
|
2851
|
+
const h = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
|
|
2852
|
+
let S = !1, A = 0;
|
|
2853
|
+
const x = () => {
|
|
2854
|
+
A += 1, d.emit();
|
|
2855
|
+
}, T = (v) => o.get(v) ?? 0, M = (v) => {
|
|
2856
|
+
let b = i.get(v);
|
|
2857
|
+
return b === void 0 && (b = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, i.set(v, b)), b;
|
|
2858
|
+
}, C = (v, b, y) => {
|
|
2859
|
+
v.inFlight.delete(b), f -= 1, y.lane === "bulk" && (u -= 1);
|
|
2842
2860
|
}, s = (v) => {
|
|
2843
|
-
const
|
|
2844
|
-
if (
|
|
2845
|
-
for (const [
|
|
2846
|
-
|
|
2847
|
-
|
|
2861
|
+
const b = i.get(v);
|
|
2862
|
+
if (b !== void 0) {
|
|
2863
|
+
for (const [y, R] of [...b.inFlight])
|
|
2864
|
+
C(b, y, R), R.controller.abort();
|
|
2865
|
+
b.direct.clear(), b.bulk.clear(), b.unclaimed.clear();
|
|
2848
2866
|
}
|
|
2849
2867
|
}, c = (v) => {
|
|
2850
|
-
const
|
|
2851
|
-
return o.set(v,
|
|
2852
|
-
},
|
|
2853
|
-
const
|
|
2854
|
-
return v.status === "pending" && v.then((
|
|
2855
|
-
|
|
2856
|
-
}),
|
|
2868
|
+
const b = T(v) + 1;
|
|
2869
|
+
return o.set(v, b), s(v), b;
|
|
2870
|
+
}, p = (v, b) => {
|
|
2871
|
+
const y = Se(v), R = { promise: v, opened: b, stale: !1, loadedAt: y?.status === "ok" ? y.loadedAt : null };
|
|
2872
|
+
return v.status === "pending" && v.then(($) => {
|
|
2873
|
+
$.status === "ok" && (R.loadedAt = $.loadedAt);
|
|
2874
|
+
}), R;
|
|
2857
2875
|
}, w = (v) => {
|
|
2858
|
-
let
|
|
2859
|
-
return
|
|
2876
|
+
let b = r.get(v);
|
|
2877
|
+
return b === void 0 && (b = /* @__PURE__ */ new Map(), r.set(v, b)), b;
|
|
2860
2878
|
}, k = (v) => {
|
|
2861
|
-
const
|
|
2862
|
-
for (let
|
|
2863
|
-
const
|
|
2864
|
-
if (!(
|
|
2865
|
-
for (const
|
|
2866
|
-
if ((Z.claims.get(
|
|
2867
|
-
return Z[v].delete(
|
|
2879
|
+
const b = [...i.keys()], y = h[v], R = y === null ? 0 : b.indexOf(y) + 1;
|
|
2880
|
+
for (let $ = 0; $ < b.length; $ += 1) {
|
|
2881
|
+
const B = b[(R + $) % b.length], Z = B === void 0 ? void 0 : i.get(B);
|
|
2882
|
+
if (!(B === void 0 || Z === void 0)) {
|
|
2883
|
+
for (const j of Z[v])
|
|
2884
|
+
if ((Z.claims.get(j) ?? 0) !== 0)
|
|
2885
|
+
return Z[v].delete(j), h[v] = B, { sourceId: B, path: j };
|
|
2868
2886
|
}
|
|
2869
2887
|
}
|
|
2870
2888
|
return null;
|
|
2871
|
-
}, L = (v,
|
|
2872
|
-
const
|
|
2873
|
-
if (
|
|
2874
|
-
|
|
2875
|
-
const
|
|
2876
|
-
if (
|
|
2877
|
-
const
|
|
2878
|
-
for (const le of [...g]) le(
|
|
2889
|
+
}, L = (v, b, y, R) => {
|
|
2890
|
+
const $ = i.get(v);
|
|
2891
|
+
if ($ === void 0 || $.inFlight.get(b) !== y) return;
|
|
2892
|
+
C($, b, y);
|
|
2893
|
+
const B = ($.claims.get(b) ?? 0) > 0, Z = w(v);
|
|
2894
|
+
if (R.status === "ok" ? Z.set(b, { status: "loaded", entries: R.entries }) : R.status === "error" && B ? Z.set(b, { status: "failed", failure: R.failure }) : Z.delete(b), x(), R.status === "error" && B) {
|
|
2895
|
+
const j = { sourceId: v, path: b, failure: R.failure };
|
|
2896
|
+
for (const le of [...g]) le(j);
|
|
2879
2897
|
}
|
|
2880
2898
|
N();
|
|
2881
|
-
},
|
|
2882
|
-
const
|
|
2883
|
-
|
|
2884
|
-
(
|
|
2885
|
-
() => L(v,
|
|
2899
|
+
}, O = (v, b, y) => {
|
|
2900
|
+
const R = { controller: new AbortController(), lane: y };
|
|
2901
|
+
M(v).inFlight.set(b, R), f += 1, y === "bulk" && (u += 1), e.children(v, b, R.controller.signal).then(
|
|
2902
|
+
($) => L(v, b, R, $),
|
|
2903
|
+
() => L(v, b, R, Si)
|
|
2886
2904
|
);
|
|
2887
2905
|
}, N = () => {
|
|
2888
|
-
for (; f <
|
|
2906
|
+
for (; f < Rn; ) {
|
|
2889
2907
|
const v = k("direct");
|
|
2890
2908
|
if (v !== null) {
|
|
2891
|
-
|
|
2909
|
+
O(v.sourceId, v.path, "direct");
|
|
2892
2910
|
continue;
|
|
2893
2911
|
}
|
|
2894
|
-
const
|
|
2895
|
-
if (
|
|
2896
|
-
|
|
2912
|
+
const b = u < ki ? k("bulk") : null;
|
|
2913
|
+
if (b === null) return;
|
|
2914
|
+
O(b.sourceId, b.path, "bulk");
|
|
2897
2915
|
}
|
|
2898
|
-
}, q = (v,
|
|
2899
|
-
if (!(
|
|
2900
|
-
const
|
|
2901
|
-
if (
|
|
2902
|
-
|
|
2916
|
+
}, q = (v, b, y) => {
|
|
2917
|
+
if (!(b.direct.delete(y) || b.bulk.delete(y))) {
|
|
2918
|
+
const $ = b.inFlight.get(y);
|
|
2919
|
+
if ($ === void 0) return !1;
|
|
2920
|
+
C(b, y, $), $.controller.abort();
|
|
2903
2921
|
}
|
|
2904
|
-
return r.get(v)?.delete(
|
|
2905
|
-
},
|
|
2906
|
-
|
|
2922
|
+
return r.get(v)?.delete(y), !0;
|
|
2923
|
+
}, G = () => {
|
|
2924
|
+
S = !1;
|
|
2907
2925
|
let v = !1;
|
|
2908
|
-
for (const
|
|
2909
|
-
const
|
|
2910
|
-
for (const
|
|
2911
|
-
(
|
|
2912
|
-
|
|
2926
|
+
for (const b of m) {
|
|
2927
|
+
const y = M(b);
|
|
2928
|
+
for (const R of y.unclaimed)
|
|
2929
|
+
(y.claims.get(R) ?? 0) === 0 && q(b, y, R) && (v = !0);
|
|
2930
|
+
y.unclaimed.clear();
|
|
2913
2931
|
}
|
|
2914
|
-
m.clear(), v && (
|
|
2915
|
-
},
|
|
2916
|
-
t.set(v,
|
|
2917
|
-
},
|
|
2932
|
+
m.clear(), v && (x(), N());
|
|
2933
|
+
}, W = (v, b) => {
|
|
2934
|
+
t.set(v, p(be(e.tree(v)), b));
|
|
2935
|
+
}, Q = (v, b, y) => {
|
|
2918
2936
|
c(v);
|
|
2919
|
-
const
|
|
2920
|
-
return t.set(v,
|
|
2921
|
-
},
|
|
2922
|
-
if (
|
|
2923
|
-
const
|
|
2924
|
-
if (!(
|
|
2925
|
-
if (Me(
|
|
2926
|
-
|
|
2937
|
+
const R = p(fn(b), y);
|
|
2938
|
+
return t.set(v, R), r.delete(v), x(), N(), R;
|
|
2939
|
+
}, K = (v, b, y, R) => {
|
|
2940
|
+
if (y !== T(v) || t.get(v) !== b) return;
|
|
2941
|
+
const $ = Se(b.promise);
|
|
2942
|
+
if (!(R.status !== "ok" || $?.status !== "ok" || b.loadedAt === null || R.loadedAt <= b.loadedAt)) {
|
|
2943
|
+
if (Me($.entries, R.entries)) {
|
|
2944
|
+
b.loadedAt = R.loadedAt;
|
|
2927
2945
|
return;
|
|
2928
2946
|
}
|
|
2929
|
-
|
|
2947
|
+
Q(v, R, b.opened);
|
|
2930
2948
|
}
|
|
2931
|
-
},
|
|
2932
|
-
const
|
|
2933
|
-
return
|
|
2934
|
-
},
|
|
2935
|
-
|
|
2936
|
-
const
|
|
2937
|
-
e.tree(v).then((
|
|
2949
|
+
}, Y = (v, b) => {
|
|
2950
|
+
const y = t.get(v);
|
|
2951
|
+
return y !== void 0 && Se(y.promise)?.status === b;
|
|
2952
|
+
}, oe = (v, b) => {
|
|
2953
|
+
b.stale = !1;
|
|
2954
|
+
const y = T(v);
|
|
2955
|
+
e.tree(v).then((R) => K(v, b, y, R));
|
|
2938
2956
|
};
|
|
2939
2957
|
return {
|
|
2940
2958
|
read: (v) => t.get(v)?.promise ?? xi,
|
|
2941
2959
|
open: (v) => {
|
|
2942
|
-
const
|
|
2943
|
-
return
|
|
2960
|
+
const b = n.resumes(v), y = n.hold(v), R = t.get(v);
|
|
2961
|
+
return R === void 0 || Y(v, "deferred") ? (W(v, !0), x()) : b || (R.opened && Y(v, "error") ? (W(v, !0), x()) : (R.opened = !0, R.stale && Y(v, "ok") && oe(v, R))), y;
|
|
2944
2962
|
},
|
|
2945
2963
|
retry: (v) => {
|
|
2946
|
-
|
|
2964
|
+
Y(v, "error") && (W(v, !0), x());
|
|
2947
2965
|
},
|
|
2948
|
-
seed: (v,
|
|
2949
|
-
const
|
|
2950
|
-
(
|
|
2966
|
+
seed: (v, b) => {
|
|
2967
|
+
const y = b.then(
|
|
2968
|
+
(B) => B === null ? et : B,
|
|
2951
2969
|
() => et
|
|
2952
|
-
),
|
|
2953
|
-
if (
|
|
2954
|
-
const
|
|
2955
|
-
|
|
2970
|
+
), R = t.get(v);
|
|
2971
|
+
if (R !== void 0 && Y(v, "ok")) {
|
|
2972
|
+
const B = T(v);
|
|
2973
|
+
y.then((Z) => K(v, R, B, Z));
|
|
2956
2974
|
return;
|
|
2957
2975
|
}
|
|
2958
2976
|
c(v);
|
|
2959
|
-
const
|
|
2960
|
-
t.set(v,
|
|
2961
|
-
t.get(v) ===
|
|
2977
|
+
const $ = p(be(y), R?.opened === !0);
|
|
2978
|
+
t.set(v, $), r.delete(v), N(), y.then((B) => {
|
|
2979
|
+
t.get(v) === $ && (B.status === "deferred" && n.isHeld(v) && W(v, $.opened), x());
|
|
2962
2980
|
});
|
|
2963
2981
|
},
|
|
2964
2982
|
refresh: async (v) => {
|
|
2965
|
-
const
|
|
2966
|
-
l.set(v,
|
|
2967
|
-
const
|
|
2968
|
-
if (l.get(v) !==
|
|
2969
|
-
if (
|
|
2970
|
-
const
|
|
2971
|
-
if (!(
|
|
2972
|
-
const
|
|
2973
|
-
if (
|
|
2983
|
+
const b = (l.get(v) ?? 0) + 1;
|
|
2984
|
+
l.set(v, b);
|
|
2985
|
+
const y = await e.refresh(v);
|
|
2986
|
+
if (l.get(v) !== b) return yi;
|
|
2987
|
+
if (y.status === "error") return { status: "failed", failure: y.failure };
|
|
2988
|
+
const R = t.get(v);
|
|
2989
|
+
if (!(R !== void 0 && R.loadedAt !== null && Y(v, "ok") && R.loadedAt > y.loadedAt)) {
|
|
2990
|
+
const B = Q(v, y, !0);
|
|
2991
|
+
if (R !== void 0 && R.promise.status === "pending") {
|
|
2974
2992
|
const Z = T(v);
|
|
2975
|
-
|
|
2993
|
+
R.promise.then((j) => K(v, B, Z, j));
|
|
2976
2994
|
}
|
|
2977
2995
|
}
|
|
2978
|
-
for (const [
|
|
2979
|
-
|
|
2996
|
+
for (const [B, Z] of t)
|
|
2997
|
+
B !== v && Se(Z.promise)?.status === "ok" && (Z.stale = !0);
|
|
2980
2998
|
return Ei;
|
|
2981
2999
|
},
|
|
2982
|
-
children: (v,
|
|
2983
|
-
claimChildren: (v,
|
|
2984
|
-
const
|
|
2985
|
-
let
|
|
2986
|
-
for (const [
|
|
2987
|
-
|
|
2988
|
-
|
|
3000
|
+
children: (v, b) => r.get(v)?.get(b),
|
|
3001
|
+
claimChildren: (v, b) => {
|
|
3002
|
+
const y = M(v), R = w(v);
|
|
3003
|
+
let $ = !1, B = !1;
|
|
3004
|
+
for (const [j, le] of b)
|
|
3005
|
+
y.claims.set(j, (y.claims.get(j) ?? 0) + 1), R.get(j) === void 0 ? (R.set(j, Bt), y[le].add(j), $ = !0, B = !0) : le === "direct" && y.bulk.delete(j) && (y.direct.add(j), B = !0);
|
|
3006
|
+
$ && x(), B && N();
|
|
2989
3007
|
let Z = !1;
|
|
2990
3008
|
return () => {
|
|
2991
3009
|
if (!Z) {
|
|
2992
3010
|
Z = !0;
|
|
2993
|
-
for (const
|
|
2994
|
-
const le = (
|
|
2995
|
-
le > 0 ?
|
|
3011
|
+
for (const j of b.keys()) {
|
|
3012
|
+
const le = (y.claims.get(j) ?? 0) - 1;
|
|
3013
|
+
le > 0 ? y.claims.set(j, le) : (y.claims.delete(j), y.unclaimed.add(j));
|
|
2996
3014
|
}
|
|
2997
|
-
m.add(v), !
|
|
3015
|
+
m.add(v), !S && (S = !0, queueMicrotask(G));
|
|
2998
3016
|
}
|
|
2999
3017
|
};
|
|
3000
3018
|
},
|
|
3001
|
-
retryChildren: (v,
|
|
3002
|
-
const
|
|
3003
|
-
if (
|
|
3004
|
-
const
|
|
3005
|
-
if ((
|
|
3006
|
-
|
|
3019
|
+
retryChildren: (v, b) => {
|
|
3020
|
+
const y = r.get(v);
|
|
3021
|
+
if (y === void 0 || y.get(b)?.status !== "failed") return;
|
|
3022
|
+
const R = M(v);
|
|
3023
|
+
if ((R.claims.get(b) ?? 0) > 0) {
|
|
3024
|
+
y.set(b, Bt), R.direct.add(b), x(), N();
|
|
3007
3025
|
return;
|
|
3008
3026
|
}
|
|
3009
|
-
|
|
3027
|
+
y.delete(b), x();
|
|
3010
3028
|
},
|
|
3011
3029
|
pendingChildren: (v) => {
|
|
3012
|
-
const
|
|
3013
|
-
return
|
|
3030
|
+
const b = i.get(v);
|
|
3031
|
+
return b === void 0 ? 0 : b.direct.size + b.bulk.size + b.inFlight.size;
|
|
3014
3032
|
},
|
|
3015
3033
|
clear: () => {
|
|
3016
3034
|
for (const v of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...i.keys()])) c(v);
|
|
3017
|
-
for (const [v,
|
|
3018
|
-
t.clear(), r.clear(),
|
|
3035
|
+
for (const [v, b] of l) l.set(v, b + 1);
|
|
3036
|
+
t.clear(), r.clear(), x();
|
|
3019
3037
|
},
|
|
3020
3038
|
subscribeChildrenFailures: (v) => (g.add(v), () => {
|
|
3021
3039
|
g.delete(v);
|
|
3022
3040
|
}),
|
|
3023
3041
|
subscribe: d.subscribe,
|
|
3024
|
-
version: () =>
|
|
3042
|
+
version: () => A
|
|
3025
3043
|
};
|
|
3026
3044
|
}, Ti = (e, t) => {
|
|
3027
3045
|
let n = e;
|
|
@@ -3045,18 +3063,18 @@ const Oi = () => {
|
|
|
3045
3063
|
}, Ai = [
|
|
3046
3064
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3047
3065
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3048
|
-
],
|
|
3049
|
-
if (!
|
|
3066
|
+
], It = 1, jt = (e) => e.getClientRects().length > 0, Ke = "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.", Li = (e) => {
|
|
3067
|
+
if (!jt(e)) return null;
|
|
3050
3068
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3051
3069
|
if (t.bottom > n + Ci)
|
|
3052
3070
|
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. ${Ke}`;
|
|
3053
|
-
if (t.height <
|
|
3071
|
+
if (t.height < It)
|
|
3054
3072
|
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. ${Ke}`;
|
|
3055
3073
|
for (const { selector: r, name: o } of Ai)
|
|
3056
3074
|
for (const l of e.querySelectorAll(r)) {
|
|
3057
|
-
if (!
|
|
3075
|
+
if (!jt(l)) continue;
|
|
3058
3076
|
const i = l.getBoundingClientRect().height;
|
|
3059
|
-
if (i <
|
|
3077
|
+
if (i < It)
|
|
3060
3078
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
3061
3079
|
}
|
|
3062
3080
|
return null;
|
|
@@ -3071,13 +3089,13 @@ const Oi = () => {
|
|
|
3071
3089
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
3072
3090
|
};
|
|
3073
3091
|
}, Ni = (e, t) => {
|
|
3074
|
-
|
|
3092
|
+
te(() => e ? Oi() : void 0, [e]), te(() => {
|
|
3075
3093
|
const n = t.current;
|
|
3076
3094
|
if (!(!e || n === null))
|
|
3077
3095
|
return Mi(n);
|
|
3078
3096
|
}, [e, t]);
|
|
3079
|
-
},
|
|
3080
|
-
{ control:
|
|
3097
|
+
}, Ht = '[data-testid="markdown-explorer-view-switch"]', Di = [
|
|
3098
|
+
{ control: Ht, successors: [Ht, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3081
3099
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3082
3100
|
], $i = (e) => {
|
|
3083
3101
|
for (const t of Di) {
|
|
@@ -3086,8 +3104,8 @@ const Oi = () => {
|
|
|
3086
3104
|
}
|
|
3087
3105
|
return null;
|
|
3088
3106
|
}, Pi = (e, t) => {
|
|
3089
|
-
const n =
|
|
3090
|
-
|
|
3107
|
+
const n = _(null);
|
|
3108
|
+
te(() => {
|
|
3091
3109
|
const o = (d) => {
|
|
3092
3110
|
const g = e.current;
|
|
3093
3111
|
n.current = g !== null && d instanceof Element && g.contains(d) ? $i(d) : null;
|
|
@@ -3103,8 +3121,8 @@ const Oi = () => {
|
|
|
3103
3121
|
document.removeEventListener("focusin", l), document.removeEventListener("focusout", i);
|
|
3104
3122
|
};
|
|
3105
3123
|
}, [e]);
|
|
3106
|
-
const r =
|
|
3107
|
-
|
|
3124
|
+
const r = _(t);
|
|
3125
|
+
U(() => {
|
|
3108
3126
|
if (r.current === t) return;
|
|
3109
3127
|
r.current = t;
|
|
3110
3128
|
const o = n.current;
|
|
@@ -3115,8 +3133,8 @@ const Oi = () => {
|
|
|
3115
3133
|
const f = e.current;
|
|
3116
3134
|
if (f === null) return !0;
|
|
3117
3135
|
for (const u of o.control.successors)
|
|
3118
|
-
for (const
|
|
3119
|
-
if (
|
|
3136
|
+
for (const h of f.querySelectorAll(u))
|
|
3137
|
+
if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
|
|
3120
3138
|
return !0;
|
|
3121
3139
|
return !1;
|
|
3122
3140
|
};
|
|
@@ -3128,175 +3146,211 @@ const Oi = () => {
|
|
|
3128
3146
|
});
|
|
3129
3147
|
return d.observe(i, { childList: !0, subtree: !0 }), () => d.disconnect();
|
|
3130
3148
|
}, [t, e]);
|
|
3131
|
-
}, Fi = tt(() => import("./TreeLayout-
|
|
3149
|
+
}, Fi = tt(() => import("./TreeLayout-Uo6RG7lq.js").then((e) => ({ default: e.TreeLayout }))), qi = tt(() => import("./MultiLayout-BYXoD1aS.js").then((e) => ({ default: e.MultiLayout }))), _i = 64, Bi = {
|
|
3132
3150
|
request: (e) => {
|
|
3133
3151
|
requestAnimationFrame(e);
|
|
3134
3152
|
}
|
|
3135
|
-
},
|
|
3153
|
+
}, zt = (e) => {
|
|
3136
3154
|
e.documents.clear(), e.trees.clear();
|
|
3137
3155
|
}, We = (e, t) => {
|
|
3138
3156
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3139
3157
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3140
3158
|
}, Ii = (e, t) => {
|
|
3141
3159
|
const [n, r] = I(() => ({ overrides: t, locale: e, labels: Et(e, t) }));
|
|
3142
|
-
if (n.locale === e &&
|
|
3160
|
+
if (n.locale === e && vr(n.overrides, t)) return n.labels;
|
|
3143
3161
|
const o = { overrides: t, locale: e, labels: Et(e, t) };
|
|
3144
3162
|
return r(o), o.labels;
|
|
3145
3163
|
}, ji = (e, t, n) => {
|
|
3146
|
-
const [r, o] = I(() => ({ scope: t, store:
|
|
3164
|
+
const [r, o] = I(() => ({ scope: t, store: _t(e, n) }));
|
|
3147
3165
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3148
|
-
const l = { scope: t, store:
|
|
3166
|
+
const l = { scope: t, store: _t(e, n) };
|
|
3149
3167
|
return o(l), l.store;
|
|
3150
3168
|
}, Xe = (e, t) => {
|
|
3151
3169
|
const [n, r] = I(() => ({ scope: e, value: t() }));
|
|
3152
3170
|
if (n.scope === e) return n.value;
|
|
3153
3171
|
const o = { scope: e, value: t() };
|
|
3154
3172
|
return r(o), o.value;
|
|
3155
|
-
}, Hi = () => pi(Bi),
|
|
3173
|
+
}, Hi = () => pi(Bi), Ut = "on", zi = "off", Ui = Object.freeze({ kind: "unavailable" }), Zi = (e) => {
|
|
3174
|
+
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3175
|
+
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3176
|
+
}, Vi = (e, t) => {
|
|
3156
3177
|
const n = de(e.peek(t));
|
|
3157
3178
|
return n === null || n.document.kind === "failure" ? Ee(t) : n.document.name;
|
|
3158
|
-
},
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3179
|
+
}, is = ({
|
|
3180
|
+
data: e,
|
|
3181
|
+
config: t,
|
|
3182
|
+
storageNamespace: n,
|
|
3183
|
+
locale: r,
|
|
3184
|
+
labels: o,
|
|
3185
|
+
theme: l,
|
|
3186
|
+
renderFrame: i,
|
|
3187
|
+
renderTreeFailure: d,
|
|
3188
|
+
lockDocumentScroll: g = !1,
|
|
3189
|
+
onMathDiagnostics: f,
|
|
3190
|
+
onEditGrant: u,
|
|
3191
|
+
draftConverter: h
|
|
3192
|
+
}) => {
|
|
3193
|
+
ar(n), Zi(h);
|
|
3194
|
+
const m = en(r), S = wr(l), A = Ii(m, o), { revalidate: x } = Nn(), T = _(() => {
|
|
3195
|
+
}), M = De(t.dataPath), [C] = I(() => {
|
|
3196
|
+
const y = vi({ dataPath: M, onScope: ($) => T.current($) }), R = { documents: lo({ client: y, capacity: Math.max(_i, t.multiView.maxPanels * 2) }), trees: Ri(y) };
|
|
3197
|
+
return We(R, e), wt(n, e.scope), { data: y, ...R, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3164
3198
|
});
|
|
3165
|
-
if (
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3199
|
+
if (C.aligned.pageData !== e || C.aligned.storageNamespace !== n) {
|
|
3200
|
+
const y = C.aligned.pageData;
|
|
3201
|
+
C.aligned.pageData = e, C.aligned.storageNamespace = n, y !== e && (y.scope !== e.scope ? C.aligned.pendingReader = e : We(C, e)), wt(n, e.scope);
|
|
3168
3202
|
}
|
|
3169
|
-
const
|
|
3170
|
-
|
|
3171
|
-
const
|
|
3172
|
-
|
|
3173
|
-
}, [e,
|
|
3174
|
-
let
|
|
3175
|
-
return
|
|
3176
|
-
|
|
3203
|
+
const s = ji(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3204
|
+
U(() => {
|
|
3205
|
+
const y = C.aligned.pendingReader;
|
|
3206
|
+
y !== null && (C.aligned.pendingReader = null, zt(C), We(C, y));
|
|
3207
|
+
}, [e, C]), U(() => {
|
|
3208
|
+
let y = !1;
|
|
3209
|
+
return T.current = (R) => {
|
|
3210
|
+
R === e.scope || y || (y = !0, R !== null && (zt(C), cr(n)), x());
|
|
3177
3211
|
}, () => {
|
|
3178
|
-
|
|
3212
|
+
T.current = () => {
|
|
3179
3213
|
};
|
|
3180
3214
|
};
|
|
3181
|
-
}, [e,
|
|
3182
|
-
const
|
|
3183
|
-
|
|
3184
|
-
|
|
3215
|
+
}, [e, x, C, n]);
|
|
3216
|
+
const c = _(t.settingsCookie);
|
|
3217
|
+
U(() => {
|
|
3218
|
+
c.current = t.settingsCookie;
|
|
3185
3219
|
}, [t.settingsCookie]);
|
|
3186
|
-
const [
|
|
3187
|
-
() => Ti(e.settings, (
|
|
3188
|
-
document.cookie =
|
|
3220
|
+
const [p] = I(
|
|
3221
|
+
() => Ti(e.settings, (y) => {
|
|
3222
|
+
document.cookie = In(c.current, y, window.location.protocol === "https:");
|
|
3189
3223
|
})
|
|
3190
|
-
),
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
}, [
|
|
3194
|
-
const
|
|
3224
|
+
), w = Xe(e.scope, Hi), k = Xe(e.scope, wi), L = _(A);
|
|
3225
|
+
U(() => {
|
|
3226
|
+
L.current = A;
|
|
3227
|
+
}, [A]);
|
|
3228
|
+
const O = Xe(
|
|
3195
3229
|
e.scope,
|
|
3196
|
-
() =>
|
|
3197
|
-
data:
|
|
3198
|
-
conflictLabels: () => ({ ours:
|
|
3199
|
-
onSaveSettled: (
|
|
3200
|
-
|
|
3201
|
-
const
|
|
3202
|
-
|
|
3230
|
+
() => Cr({
|
|
3231
|
+
data: C.data,
|
|
3232
|
+
conflictLabels: () => ({ ours: L.current.conflictOurs, theirs: L.current.conflictTheirs }),
|
|
3233
|
+
onSaveSettled: (y, R) => {
|
|
3234
|
+
R.kind === "saved" && C.documents.refresh(y);
|
|
3235
|
+
const $ = Er(L.current, R, Vi(C.documents, y));
|
|
3236
|
+
$ !== null && w.announce($);
|
|
3203
3237
|
},
|
|
3204
3238
|
previewSetting: {
|
|
3205
|
-
read: () =>
|
|
3206
|
-
write: (
|
|
3239
|
+
read: () => Yt(ze(n).editPreview) === Ut,
|
|
3240
|
+
write: (y) => Xt(ze(n).editPreview, y ? Ut : zi)
|
|
3207
3241
|
}
|
|
3208
3242
|
})
|
|
3209
|
-
),
|
|
3210
|
-
`),
|
|
3211
|
-
`)), [t,
|
|
3212
|
-
|
|
3243
|
+
), N = z(() => be(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((y) => y.id).join(`
|
|
3244
|
+
`), G = z(() => Bn(t, q.split(`
|
|
3245
|
+
`)), [t, q]), W = _(f);
|
|
3246
|
+
U(() => {
|
|
3213
3247
|
W.current = f;
|
|
3214
3248
|
}, [f]);
|
|
3215
|
-
const [
|
|
3216
|
-
W.current?.(
|
|
3217
|
-
}),
|
|
3249
|
+
const [Q] = I(() => (y, R) => {
|
|
3250
|
+
W.current?.(y, R);
|
|
3251
|
+
}), K = f === void 0 ? void 0 : Q, Y = _(h);
|
|
3252
|
+
U(() => {
|
|
3253
|
+
Y.current = h;
|
|
3254
|
+
}, [h]);
|
|
3255
|
+
const [oe] = I(() => {
|
|
3256
|
+
let y = !1;
|
|
3257
|
+
return {
|
|
3258
|
+
convert: (R, $) => {
|
|
3259
|
+
const B = Y.current;
|
|
3260
|
+
return B === void 0 ? Promise.resolve(Ui) : B.convert(R, $);
|
|
3261
|
+
},
|
|
3262
|
+
prepare: () => {
|
|
3263
|
+
try {
|
|
3264
|
+
Y.current?.prepare?.();
|
|
3265
|
+
} catch (R) {
|
|
3266
|
+
if (y) return;
|
|
3267
|
+
y = !0, console.error("[markdown-explorer] the draft converter's prepare threw", R);
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
};
|
|
3271
|
+
}), v = h === void 0 ? void 0 : oe, b = z(
|
|
3218
3272
|
() => ({
|
|
3219
|
-
config:
|
|
3220
|
-
labels:
|
|
3221
|
-
locale:
|
|
3222
|
-
theme:
|
|
3273
|
+
config: G,
|
|
3274
|
+
labels: A,
|
|
3275
|
+
locale: m,
|
|
3276
|
+
theme: S,
|
|
3223
3277
|
storageNamespace: n,
|
|
3224
3278
|
scope: e.scope,
|
|
3225
3279
|
sources: e.sources,
|
|
3226
|
-
notices:
|
|
3227
|
-
documents:
|
|
3228
|
-
trees:
|
|
3229
|
-
data:
|
|
3230
|
-
viewSettings:
|
|
3231
|
-
treeSettings:
|
|
3232
|
-
announcer:
|
|
3233
|
-
reveals:
|
|
3234
|
-
edits:
|
|
3280
|
+
notices: N,
|
|
3281
|
+
documents: C.documents,
|
|
3282
|
+
trees: C.trees,
|
|
3283
|
+
data: C.data,
|
|
3284
|
+
viewSettings: p,
|
|
3285
|
+
treeSettings: s,
|
|
3286
|
+
announcer: w,
|
|
3287
|
+
reveals: k,
|
|
3288
|
+
edits: O,
|
|
3235
3289
|
onEditGrant: u,
|
|
3290
|
+
draftConverter: v,
|
|
3236
3291
|
renderTreeFailure: d,
|
|
3237
|
-
reportMathDiagnostics:
|
|
3292
|
+
reportMathDiagnostics: K
|
|
3238
3293
|
}),
|
|
3239
|
-
[
|
|
3294
|
+
[G, A, m, S, n, e.scope, e.sources, N, C, p, s, w, k, O, u, v, d, K]
|
|
3240
3295
|
);
|
|
3241
|
-
return /* @__PURE__ */ a(
|
|
3242
|
-
},
|
|
3296
|
+
return /* @__PURE__ */ a(tn, { value: b, children: /* @__PURE__ */ a(Ki, { renderFrame: i, lockDocumentScroll: g }, e.scope) });
|
|
3297
|
+
}, Gi = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3243
3298
|
const [o] = I(Uo);
|
|
3244
3299
|
return /* @__PURE__ */ a("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 });
|
|
3245
|
-
},
|
|
3246
|
-
const { theme: n, labels: r } = D(), o = nt(), { hash: l } =
|
|
3247
|
-
Ni(t, d),
|
|
3300
|
+
}, Ki = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3301
|
+
const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Vt(), i = $e(), d = _(null);
|
|
3302
|
+
Ni(t, d), U(() => {
|
|
3248
3303
|
o.kind === "redirect" && i(`${o.href}${l}`, "browse");
|
|
3249
3304
|
}, [o, l, i]);
|
|
3250
3305
|
const { location: g } = o, f = g.view;
|
|
3251
3306
|
Pi(d, f);
|
|
3252
|
-
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(qi, { location: g }) }) : /* @__PURE__ */ a(mi, { location: g }),
|
|
3307
|
+
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(qi, { location: g }) }) : /* @__PURE__ */ a(mi, { location: g }), h = /* @__PURE__ */ F(Gi, { ref: d, theme: n, view: f, children: [
|
|
3253
3308
|
u,
|
|
3254
|
-
/* @__PURE__ */ a(
|
|
3309
|
+
/* @__PURE__ */ a(Dr, {}),
|
|
3255
3310
|
/* @__PURE__ */ a(hi, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3256
3311
|
] });
|
|
3257
|
-
return e === void 0 ?
|
|
3258
|
-
},
|
|
3312
|
+
return e === void 0 ? h : e({ view: f, children: h });
|
|
3313
|
+
}, ss = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
|
|
3259
3314
|
export {
|
|
3260
3315
|
Qe as A,
|
|
3261
|
-
|
|
3262
|
-
|
|
3316
|
+
Qt as B,
|
|
3317
|
+
yr as C,
|
|
3263
3318
|
fi as D,
|
|
3264
3319
|
Ql as E,
|
|
3265
3320
|
ve as F,
|
|
3266
|
-
|
|
3267
|
-
|
|
3321
|
+
ur as G,
|
|
3322
|
+
bt as H,
|
|
3268
3323
|
Go as I,
|
|
3269
|
-
|
|
3270
|
-
|
|
3324
|
+
is as J,
|
|
3325
|
+
Et as K,
|
|
3271
3326
|
ro as L,
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
ls as O,
|
|
3327
|
+
hr as M,
|
|
3328
|
+
ss as N,
|
|
3275
3329
|
ui as P,
|
|
3276
3330
|
$e as a,
|
|
3277
3331
|
ai as b,
|
|
3278
3332
|
Fl as c,
|
|
3279
|
-
|
|
3280
|
-
|
|
3333
|
+
xr as d,
|
|
3334
|
+
kr as e,
|
|
3281
3335
|
Gr as f,
|
|
3282
|
-
|
|
3336
|
+
Sr as g,
|
|
3283
3337
|
ae as h,
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3338
|
+
Mr as i,
|
|
3339
|
+
rn as j,
|
|
3340
|
+
ye as k,
|
|
3341
|
+
de as l,
|
|
3342
|
+
ls as m,
|
|
3343
|
+
cn as n,
|
|
3344
|
+
_l as o,
|
|
3345
|
+
os as p,
|
|
3346
|
+
eo as q,
|
|
3347
|
+
Xl as r,
|
|
3348
|
+
Qr as s,
|
|
3349
|
+
nt as t,
|
|
3296
3350
|
D as u,
|
|
3297
3351
|
Kr as v,
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3352
|
+
hi as w,
|
|
3353
|
+
Ae as x,
|
|
3354
|
+
dr as y,
|
|
3355
|
+
yt as z
|
|
3302
3356
|
};
|