@aiquants/markdown-explorer 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +13 -8
- package/dist/EditSurface-BesNcSQj.cjs +6 -0
- package/dist/EditSurface-DNjI8pV3.js +975 -0
- package/dist/{ExplorerSplit-CdqEKz-I.cjs → ExplorerSplit-B4oNvydP.cjs} +1 -1
- package/dist/{ExplorerSplit-3WMRDA7G.js → ExplorerSplit-GUdzpDPg.js} +1 -1
- package/dist/{MultiLayout-Gf1xT-Le.js → MultiLayout-BJ-s6AaD.js} +2 -2
- package/dist/{MultiLayout-BEg1X8Jx.cjs → MultiLayout-DtKChQ_s.cjs} +1 -1
- package/dist/{NativeScrollBar-0cpp2OIu.js → NativeScrollBar-D10fsk-7.js} +1 -1
- package/dist/{NativeScrollBar-idIQsvCv.cjs → NativeScrollBar-DJKlPWvD.cjs} +1 -1
- package/dist/{TreeLayout-DJY_WqzP.cjs → TreeLayout-C1mTmoPp.cjs} +1 -1
- package/dist/{TreeLayout-DzZCgMTt.js → TreeLayout-DQT5p2vI.js} +2 -2
- package/dist/core/labels.d.cts +9 -27
- package/dist/core/labels.d.ts +9 -27
- package/dist/{index-CJgHGeZs.js → index-0pnuyLUO.js} +1445 -1515
- package/dist/index-T98wklgM.cjs +13 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{merge-BVk6pvO_.cjs → merge-CTkzzHtn.cjs} +1 -1
- package/dist/{merge-BOcofJN5.js → merge-DauzoA2W.js} +1 -1
- package/docs/behavior/dom-hooks.md +1 -1
- package/docs/behavior/layout.md +2 -1
- package/docs/behavior/localization.md +6 -5
- package/package.json +5 -5
- package/dist/EditSurface-Bwl4S1vQ.cjs +0 -7
- package/dist/EditSurface-rKoy_ndP.js +0 -880
- package/dist/index-bMaSoQTe.cjs +0 -13
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as pe, use as re, useMemo as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { j as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { jsxs as F, jsx as c, Fragment as $e } from "react/jsx-runtime";
|
|
2
|
+
import * as S from "react";
|
|
3
|
+
import { createContext as pe, use as re, useMemo as Z, useSyncExternalStore as ee, useRef as _, useLayoutEffect as z, useCallback as P, useId as xe, useEffect as te, Component as on, Suspense as ke, lazy as lt, useState as j, useEffectEvent as le } from "react";
|
|
4
|
+
import { useParams as Hn, useSearchParams as Vn, matchPath as Un, useBlocker as Zn, useNavigate as Gn, Link as Kn, useHref as Fe, useLocation as ln, useRevalidator as Wn } from "react-router";
|
|
5
|
+
import { j as Yn, g as an, z as Xn, E as sn, a as cn, B as Jn, D as bt, G as Qn, H as be, e as ye, I as er, J as tr, K as Et, L as nr, M as yt, O as rr, w as or, Q as ir } from "./location-B-m9scLf.js";
|
|
6
|
+
import { SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS as St, SPREADSHEET_BLOCK_LABEL_CATALOGS as Ae } from "@aiquants/markdown/code-blocks";
|
|
7
|
+
import { F as se, i as lr, G as ar, y as X, x as sr, H as xt, z as Ue, I as cr, J as dr, K as ur, L as fr, N as mr, f as hr, O as kt, v as pr, P as vr, Q as wr, R as gr, B as br, w as Er, S as yr, T as Sr, U as xr, u as Tt } from "./dataRoute-CObbjNxG.js";
|
|
8
|
+
import { HostedScrollArea as Rt, useMarkdownToolbarState as kr, MarkdownViewer as dn } from "@aiquants/markdown";
|
|
9
|
+
import { SOURCE_LINES_ATTRIBUTE as un, parseSourceLines as Tr } from "@aiquants/markdown/source-lines";
|
|
10
|
+
import { DEFAULT_CONTENT_ALIGN as Rr } from "@aiquants/markdown/viewer-settings";
|
|
11
|
+
import { w as Qe, r as et, a as Or, b as Ot, s as we, c as Mr } from "./storage-CmGHg7OA.js";
|
|
12
|
+
import { createShouldRevalidate as Cr } from "@aiquants/route-revalidation";
|
|
13
|
+
const Mt = Object.freeze(["en", "ja"]), Lr = "en", at = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, fn = Object.freeze(Object.keys(Ae.en)), mn = (e) => Object.fromEntries(fn.map((t) => [at(t), Ae[e][t].text])), Ar = Object.freeze({
|
|
13
14
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
14
15
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
15
16
|
panelDragStarted: Object.freeze(["title"]),
|
|
16
17
|
panelDragCancelled: Object.freeze(["title"]),
|
|
17
18
|
multiColumnRegion: Object.freeze(["column"]),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
viewerSpreadsheetSelectionAnnouncement: Object.freeze(["range"]),
|
|
22
|
-
viewerSpreadsheetOptionsError: Object.freeze(["message"]),
|
|
23
|
-
viewerSpreadsheetLoadFailed: Object.freeze(["message"])
|
|
24
|
-
}), Or = /\{(\w+)\}/gu, dn = {
|
|
19
|
+
...Object.fromEntries(fn.filter((e) => St[e].length > 0).map((e) => [at(e), St[e]]))
|
|
20
|
+
}), Nr = /\{(\w+)\}/gu, hn = {
|
|
21
|
+
...mn("en"),
|
|
25
22
|
explorerRegion: "Explorer",
|
|
26
23
|
sourceLabel: "Source",
|
|
27
24
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -99,6 +96,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
99
96
|
previewRegion: "Preview",
|
|
100
97
|
previewUpdating: "Updating the preview…",
|
|
101
98
|
previewFailed: (e) => `Could not preview: ${e}`,
|
|
99
|
+
previewTablePending: "This table can be edited once the preview shows the draft.",
|
|
102
100
|
expandAll: "Expand all folders",
|
|
103
101
|
collapseAll: "Collapse all folders",
|
|
104
102
|
treeSettings: "Tree settings",
|
|
@@ -250,32 +248,6 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
250
248
|
viewerEmbeddedVideo: "embedded video",
|
|
251
249
|
viewerEmbeddedPost: "embedded post",
|
|
252
250
|
viewerEmbeddedFrame: "Embedded content",
|
|
253
|
-
viewerSpreadsheetTable: "Spreadsheet",
|
|
254
|
-
viewerSpreadsheetZoomIn: "Zoom in",
|
|
255
|
-
viewerSpreadsheetZoomOut: "Zoom out",
|
|
256
|
-
viewerSpreadsheetResetZoom: "Reset zoom",
|
|
257
|
-
viewerSpreadsheetHighlight: "Highlight the active row and column",
|
|
258
|
-
viewerSpreadsheetCopyAll: "Copy the whole table",
|
|
259
|
-
viewerSpreadsheetSaveTsv: "Save as TSV",
|
|
260
|
-
viewerSpreadsheetSaveMenu: "More ways to save",
|
|
261
|
-
viewerSpreadsheetSaveTsvWithBom: "Save with a BOM (for Excel)",
|
|
262
|
-
viewerSpreadsheetFullscreen: "View full screen",
|
|
263
|
-
viewerSpreadsheetExitFullscreen: "Exit full screen",
|
|
264
|
-
viewerSpreadsheetFullscreenDialog: "Spreadsheet (full screen)",
|
|
265
|
-
viewerSpreadsheetSize: "Rows {rows} × columns {cols}",
|
|
266
|
-
viewerSpreadsheetFileName: "spreadsheet.tsv",
|
|
267
|
-
viewerSpreadsheetCopied: "Copied the whole table.",
|
|
268
|
-
viewerSpreadsheetCopyFailed: "Could not copy the table: {reason}",
|
|
269
|
-
viewerSpreadsheetCellAnnouncement: "{cell}, {value}",
|
|
270
|
-
viewerSpreadsheetEmptyCell: "blank",
|
|
271
|
-
viewerSpreadsheetSelectionAnnouncement: "{range} selected",
|
|
272
|
-
viewerSpreadsheetReadOnly: "This table is read-only here.",
|
|
273
|
-
viewerSpreadsheetFormatRefused: "This table keeps text only, so formatting and links are not saved.",
|
|
274
|
-
viewerSpreadsheetFenceRefused: "A cell cannot begin a line with ``` or ~~~ in this table, so the change was not saved.",
|
|
275
|
-
viewerSpreadsheetEditConflict: "The table changed in the editor, so the change was not saved. Try again.",
|
|
276
|
-
viewerSpreadsheetOptionsError: "Invalid spreadsheet options: {message}",
|
|
277
|
-
viewerSpreadsheetLoadFailed: "Could not load the spreadsheet: {message}",
|
|
278
|
-
viewerSpreadsheetRetry: "Retry",
|
|
279
251
|
multiRegion: "Panels",
|
|
280
252
|
multiEmpty: "Select documents in the explorer to open them side by side.",
|
|
281
253
|
panelLimit: (e) => `You can open up to ${String(e)} panels at once.`,
|
|
@@ -308,7 +280,8 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
308
280
|
multiColumnEmpty: "This column is empty",
|
|
309
281
|
multiColumnRegion: "Column {column}",
|
|
310
282
|
panelDropHere: "Drop the panel here"
|
|
311
|
-
},
|
|
283
|
+
}, Dr = {
|
|
284
|
+
...mn("ja"),
|
|
312
285
|
explorerRegion: "エクスプローラー",
|
|
313
286
|
sourceLabel: "ソース",
|
|
314
287
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -386,6 +359,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
386
359
|
previewRegion: "プレビュー",
|
|
387
360
|
previewUpdating: "プレビューを更新中…",
|
|
388
361
|
previewFailed: (e) => `プレビューできませんでした: ${e}`,
|
|
362
|
+
previewTablePending: "プレビューが下書きを描くと、この表を編集できます。",
|
|
389
363
|
expandAll: "すべてのフォルダーを展開",
|
|
390
364
|
collapseAll: "すべてのフォルダーを折りたたむ",
|
|
391
365
|
treeSettings: "ツリーの設定",
|
|
@@ -537,32 +511,6 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
537
511
|
viewerEmbeddedVideo: "埋め込みの動画",
|
|
538
512
|
viewerEmbeddedPost: "埋め込みの投稿",
|
|
539
513
|
viewerEmbeddedFrame: "埋め込みのコンテンツ",
|
|
540
|
-
viewerSpreadsheetTable: "表",
|
|
541
|
-
viewerSpreadsheetZoomIn: "拡大",
|
|
542
|
-
viewerSpreadsheetZoomOut: "縮小",
|
|
543
|
-
viewerSpreadsheetResetZoom: "拡大率を戻す",
|
|
544
|
-
viewerSpreadsheetHighlight: "選んだ行と列を強調",
|
|
545
|
-
viewerSpreadsheetCopyAll: "表全体をコピー",
|
|
546
|
-
viewerSpreadsheetSaveTsv: "TSV として保存",
|
|
547
|
-
viewerSpreadsheetSaveMenu: "ほかの保存の方法",
|
|
548
|
-
viewerSpreadsheetSaveTsvWithBom: "BOM を付けて保存 (Excel 向け)",
|
|
549
|
-
viewerSpreadsheetFullscreen: "全画面で見る",
|
|
550
|
-
viewerSpreadsheetExitFullscreen: "全画面を閉じる",
|
|
551
|
-
viewerSpreadsheetFullscreenDialog: "表 (全画面)",
|
|
552
|
-
viewerSpreadsheetSize: "{rows} 行 × {cols} 列",
|
|
553
|
-
viewerSpreadsheetFileName: "表.tsv",
|
|
554
|
-
viewerSpreadsheetCopied: "表全体をコピーしました。",
|
|
555
|
-
viewerSpreadsheetCopyFailed: "表をコピーできませんでした: {reason}",
|
|
556
|
-
viewerSpreadsheetCellAnnouncement: "{cell}、{value}",
|
|
557
|
-
viewerSpreadsheetEmptyCell: "空白",
|
|
558
|
-
viewerSpreadsheetSelectionAnnouncement: "{range} を選択",
|
|
559
|
-
viewerSpreadsheetReadOnly: "この表はここでは編集できません。",
|
|
560
|
-
viewerSpreadsheetFormatRefused: "この表は文字だけを保つため、書式とリンクは保存しません。",
|
|
561
|
-
viewerSpreadsheetFenceRefused: "セルの行頭に ``` や ~~~ を置くと表が壊れるため、この変更は保存しませんでした。",
|
|
562
|
-
viewerSpreadsheetEditConflict: "エディタで表が変わっていたため、この変更は保存しませんでした。もう一度お試しください。",
|
|
563
|
-
viewerSpreadsheetOptionsError: "表の指定の誤り: {message}",
|
|
564
|
-
viewerSpreadsheetLoadFailed: "表を読み込めませんでした: {message}",
|
|
565
|
-
viewerSpreadsheetRetry: "再試行",
|
|
566
514
|
multiRegion: "パネル",
|
|
567
515
|
multiEmpty: "エクスプローラーで文書を選ぶと、ここに並べて開きます。",
|
|
568
516
|
panelLimit: (e) => `同時に開けるのは ${String(e)} パネルまでです。`,
|
|
@@ -595,60 +543,60 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
595
543
|
multiColumnEmpty: "この列は空です",
|
|
596
544
|
multiColumnRegion: "{column} 列目",
|
|
597
545
|
panelDropHere: "ここへパネルをドロップ"
|
|
598
|
-
},
|
|
599
|
-
en: Object.freeze(
|
|
600
|
-
ja: Object.freeze(
|
|
601
|
-
}),
|
|
602
|
-
if (e === void 0) return
|
|
603
|
-
if (
|
|
604
|
-
throw new RangeError(`[markdown-explorer] locale is the UI language (${
|
|
605
|
-
},
|
|
606
|
-
const n =
|
|
546
|
+
}, Pr = Object.freeze({
|
|
547
|
+
en: Object.freeze(hn),
|
|
548
|
+
ja: Object.freeze(Dr)
|
|
549
|
+
}), pn = Object.freeze(Object.keys(hn)), $r = new Set(pn), Fr = (e) => $r.has(e), Ce = (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, vn = (e) => {
|
|
550
|
+
if (e === void 0) return Lr;
|
|
551
|
+
if (Mt.includes(e)) return e;
|
|
552
|
+
throw new RangeError(`[markdown-explorer] locale is the UI language (${Mt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ce(e)}`);
|
|
553
|
+
}, Ct = (e, t) => {
|
|
554
|
+
const n = Pr[vn(e)];
|
|
607
555
|
if (t === void 0) return n;
|
|
608
556
|
if (t === null || typeof t != "object")
|
|
609
|
-
throw new RangeError(`[markdown-explorer] labels must be an object; got ${
|
|
610
|
-
if (!
|
|
611
|
-
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${
|
|
557
|
+
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ce(t)}`);
|
|
558
|
+
if (!Yn(t))
|
|
559
|
+
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ce(t)}`);
|
|
612
560
|
const r = t, o = { ...n };
|
|
613
561
|
for (const i of Object.keys(r)) {
|
|
614
|
-
if (!
|
|
615
|
-
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
562
|
+
if (!Fr(i))
|
|
563
|
+
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${pn.join(", ")}`);
|
|
564
|
+
const l = r[i];
|
|
565
|
+
if (l === void 0) continue;
|
|
618
566
|
const u = typeof n[i];
|
|
619
|
-
if (typeof
|
|
620
|
-
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${
|
|
621
|
-
if (typeof
|
|
567
|
+
if (typeof l !== u)
|
|
568
|
+
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Ce(l)}`);
|
|
569
|
+
if (typeof l == "string" && l.trim() === "")
|
|
622
570
|
throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
|
|
623
|
-
const m =
|
|
624
|
-
if (typeof
|
|
625
|
-
for (const [, f] of
|
|
571
|
+
const m = Ar[i];
|
|
572
|
+
if (typeof l == "string" && m !== void 0) {
|
|
573
|
+
for (const [, f] of l.matchAll(Nr))
|
|
626
574
|
if (!m.includes(f ?? ""))
|
|
627
|
-
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((
|
|
575
|
+
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((d) => `{${d}}`).join(", ")}`);
|
|
628
576
|
}
|
|
629
|
-
o[i] =
|
|
577
|
+
o[i] = l;
|
|
630
578
|
}
|
|
631
579
|
return Object.freeze(o);
|
|
632
|
-
},
|
|
580
|
+
}, qr = (e, t) => {
|
|
633
581
|
if (Object.is(e, t)) return !0;
|
|
634
582
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
635
583
|
const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
|
|
636
|
-
return o.length === i.length && i.every((
|
|
637
|
-
},
|
|
584
|
+
return o.length === i.length && i.every((l) => Object.hasOwn(n, l) && Object.is(n[l], r[l]));
|
|
585
|
+
}, Lt = Object.freeze(["light", "dark"]), _r = (e) => {
|
|
638
586
|
if (e === void 0) return "light";
|
|
639
|
-
if (
|
|
640
|
-
throw new RangeError(`[markdown-explorer] theme must be ${
|
|
641
|
-
},
|
|
642
|
-
const e = re(
|
|
587
|
+
if (Lt.includes(e)) return e;
|
|
588
|
+
throw new RangeError(`[markdown-explorer] theme must be ${Lt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
589
|
+
}, wn = pe(null), D = () => {
|
|
590
|
+
const e = re(wn);
|
|
643
591
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
644
592
|
return e;
|
|
645
|
-
},
|
|
593
|
+
}, Ne = (e) => {
|
|
646
594
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
647
595
|
return ee(t.subscribe, n, n);
|
|
648
|
-
},
|
|
649
|
-
const { config: e } = D(), t =
|
|
650
|
-
return
|
|
651
|
-
},
|
|
596
|
+
}, st = () => {
|
|
597
|
+
const { config: e } = D(), t = Hn()["*"], [n] = Vn(), r = n.toString();
|
|
598
|
+
return Z(() => an(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
599
|
+
}, gn = {
|
|
652
600
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
653
601
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
654
602
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -657,14 +605,14 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
657
605
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
658
606
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
659
607
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
660
|
-
},
|
|
661
|
-
const { labels: o } = D(), i =
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
e.reason === "unauthorized" ? /* @__PURE__ */
|
|
608
|
+
}, ae = (e, t) => e[gn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
609
|
+
const { labels: o } = D(), i = ae(o, e.reason), l = o[gn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
610
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
611
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: i }),
|
|
612
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: l }),
|
|
613
|
+
e.reason === "unauthorized" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
666
614
|
] });
|
|
667
|
-
},
|
|
615
|
+
}, Br = (e, t) => {
|
|
668
616
|
const { phase: n, save: r, dirty: o } = t;
|
|
669
617
|
switch (n.kind) {
|
|
670
618
|
case "opening":
|
|
@@ -672,7 +620,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
672
620
|
case "grant":
|
|
673
621
|
return e.editGrantTitle;
|
|
674
622
|
case "failed":
|
|
675
|
-
return
|
|
623
|
+
return ae(e, n.failure.reason);
|
|
676
624
|
}
|
|
677
625
|
switch (r.kind) {
|
|
678
626
|
case "draft":
|
|
@@ -684,13 +632,13 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
684
632
|
case "grant":
|
|
685
633
|
return e.editGrantTitle;
|
|
686
634
|
case "failed":
|
|
687
|
-
return e.draftSaveFailed(
|
|
635
|
+
return e.draftSaveFailed(ae(e, r.failure.reason));
|
|
688
636
|
case "saved":
|
|
689
637
|
if (!o) return r.merged ? e.draftSavedMerged : e.draftSaved;
|
|
690
638
|
break;
|
|
691
639
|
}
|
|
692
640
|
return o ? e.draftUnsaved : "";
|
|
693
|
-
},
|
|
641
|
+
}, Ir = (e, t, n) => {
|
|
694
642
|
switch (t.kind) {
|
|
695
643
|
case "draft":
|
|
696
644
|
return e.draftNotSaved;
|
|
@@ -701,7 +649,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
701
649
|
case "grant":
|
|
702
650
|
return e.editGrantTitle;
|
|
703
651
|
case "failed":
|
|
704
|
-
return e.draftSaveFailed(
|
|
652
|
+
return e.draftSaveFailed(ae(e, t.failure.reason));
|
|
705
653
|
case "idle":
|
|
706
654
|
case "saving":
|
|
707
655
|
return null;
|
|
@@ -716,38 +664,38 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
716
664
|
for (const t of [...e]) t();
|
|
717
665
|
}
|
|
718
666
|
};
|
|
719
|
-
},
|
|
720
|
-
`)),
|
|
667
|
+
}, jr = "<<<<<<<", zr = "=======", Hr = ">>>>>>>", At = (e, t) => e === t || e.startsWith(`${t} `), Nt = (e) => Vr(e.split(`
|
|
668
|
+
`)), Vr = (e) => {
|
|
721
669
|
const t = [];
|
|
722
670
|
let n = null, r = null, o = 0;
|
|
723
671
|
for (const i of e) {
|
|
724
672
|
o += 1;
|
|
725
|
-
const
|
|
726
|
-
|
|
673
|
+
const l = i.charCodeAt(0);
|
|
674
|
+
l !== 60 && l !== 61 && l !== 62 || (At(i, jr) ? (n = o, r = null) : i === zr ? n !== null && r === null ? r = o : n = null : At(i, Hr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
727
675
|
}
|
|
728
676
|
return t;
|
|
729
|
-
},
|
|
677
|
+
}, Dt = (e) => e.includes(`\r
|
|
730
678
|
`) ? `\r
|
|
731
679
|
` : `
|
|
732
680
|
`, Ze = (e) => e.replace(/\r\n?/gu, `
|
|
733
|
-
`),
|
|
681
|
+
`), Ur = (e, t) => t === `
|
|
734
682
|
` ? e : e.replaceAll(`
|
|
735
683
|
`, `\r
|
|
736
|
-
`),
|
|
737
|
-
if (e === null || !
|
|
684
|
+
`), Zr = 3, Gr = /^\d+(?:\.\d+)?$/u, Kr = (e) => {
|
|
685
|
+
if (e === null || !Gr.test(e)) return null;
|
|
738
686
|
const t = Number(e);
|
|
739
|
-
return t >=
|
|
740
|
-
},
|
|
741
|
-
const i = /* @__PURE__ */ new Map(),
|
|
742
|
-
let h = null,
|
|
743
|
-
const k = (
|
|
744
|
-
|
|
745
|
-
}, R = (
|
|
687
|
+
return t >= cn && t <= sn ? t : null;
|
|
688
|
+
}, Ge = Object.freeze({ kind: "idle" }), Pt = Object.freeze({ kind: "draft" }), Wr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
|
|
689
|
+
const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = Oe();
|
|
690
|
+
let h = null, v = null, E = null;
|
|
691
|
+
const k = (a, s) => {
|
|
692
|
+
a.value = { ...a.value, ...s }, d.emit();
|
|
693
|
+
}, R = (a, s) => i.get(a) === s, T = async (a, s) => {
|
|
746
694
|
s.controller.abort(), s.controller = new AbortController();
|
|
747
|
-
const { signal:
|
|
695
|
+
const { signal: w } = s.controller;
|
|
748
696
|
k(s, { phase: { kind: "opening" } });
|
|
749
|
-
const O = await e.edit(
|
|
750
|
-
if (!R(
|
|
697
|
+
const O = await e.edit(a, w);
|
|
698
|
+
if (!R(a, s) || w.aborted || !("kind" in O)) return;
|
|
751
699
|
if (O.kind === "grant") {
|
|
752
700
|
k(s, { phase: { kind: "grant", href: O.href } });
|
|
753
701
|
return;
|
|
@@ -756,248 +704,248 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
756
704
|
k(s, { phase: { kind: "failed", failure: O.failure } });
|
|
757
705
|
return;
|
|
758
706
|
}
|
|
759
|
-
const
|
|
760
|
-
s.base = { text:
|
|
761
|
-
},
|
|
762
|
-
const s = i.get(
|
|
763
|
-
s !== void 0 && (s.controller.abort(), i.delete(
|
|
764
|
-
},
|
|
765
|
-
|
|
766
|
-
}), b = (
|
|
767
|
-
k(s, { ...O, save:
|
|
768
|
-
},
|
|
769
|
-
m.get(
|
|
770
|
-
const s = i.get(
|
|
707
|
+
const C = Ze(O.text), N = O.kind === "draft";
|
|
708
|
+
s.base = { text: C, version: N ? null : O.version }, s.draft = C, s.ending = Dt(O.text), k(s, { phase: { kind: "editing" }, history: N ? !1 : O.history, dirty: !1, save: N ? Pt : Ge, generation: s.value.generation + 1 });
|
|
709
|
+
}, L = (a) => {
|
|
710
|
+
const s = i.get(a);
|
|
711
|
+
s !== void 0 && (s.controller.abort(), i.delete(a), u.delete(a));
|
|
712
|
+
}, A = (a, s, w) => (a.set(s, w), () => {
|
|
713
|
+
a.get(s) === w && a.delete(s);
|
|
714
|
+
}), b = (a, s, w, O = {}) => {
|
|
715
|
+
k(s, { ...O, save: w }), n(a, w);
|
|
716
|
+
}, g = async (a) => {
|
|
717
|
+
m.get(a)?.flush();
|
|
718
|
+
const s = i.get(a);
|
|
771
719
|
if (s === void 0 || s.value.phase.kind !== "editing" || s.base === null || s.value.save.kind === "saving") return;
|
|
772
|
-
const { version:
|
|
773
|
-
if (
|
|
774
|
-
n(
|
|
720
|
+
const { version: w } = s.base;
|
|
721
|
+
if (w === null) {
|
|
722
|
+
n(a, Pt);
|
|
775
723
|
return;
|
|
776
724
|
}
|
|
777
|
-
const O =
|
|
725
|
+
const O = Nt(s.draft).length;
|
|
778
726
|
if (O > 0) {
|
|
779
|
-
b(
|
|
727
|
+
b(a, s, { kind: "conflicts", count: O });
|
|
780
728
|
return;
|
|
781
729
|
}
|
|
782
730
|
s.controller.abort(), s.controller = new AbortController();
|
|
783
|
-
const { signal:
|
|
784
|
-
let N = { text: s.base.text, version:
|
|
731
|
+
const { signal: C } = s.controller;
|
|
732
|
+
let N = { text: s.base.text, version: w }, q = s.draft, K = !1;
|
|
785
733
|
k(s, { save: { kind: "saving" } });
|
|
786
|
-
for (let G = 0; G <
|
|
787
|
-
const
|
|
788
|
-
if (!R(
|
|
789
|
-
if (
|
|
790
|
-
m.get(
|
|
734
|
+
for (let G = 0; G < Zr; G += 1) {
|
|
735
|
+
const B = await e.save(a, N.version, Ur(q, s.ending), C);
|
|
736
|
+
if (!R(a, s) || C.aborted || !("kind" in B)) return;
|
|
737
|
+
if (B.kind === "saved") {
|
|
738
|
+
m.get(a)?.flush(), s.base = { text: q, version: B.version }, b(a, s, { kind: "saved", merged: K }, { dirty: s.draft !== q });
|
|
791
739
|
return;
|
|
792
740
|
}
|
|
793
|
-
if (
|
|
794
|
-
b(
|
|
741
|
+
if (B.kind === "grant") {
|
|
742
|
+
b(a, s, { kind: "grant", href: B.href });
|
|
795
743
|
return;
|
|
796
744
|
}
|
|
797
|
-
if (
|
|
798
|
-
b(
|
|
745
|
+
if (B.kind === "failure") {
|
|
746
|
+
b(a, s, { kind: "failed", failure: B.failure });
|
|
799
747
|
return;
|
|
800
748
|
}
|
|
801
|
-
const { mergeDraft: J } = await import("./merge-
|
|
802
|
-
if (!R(
|
|
803
|
-
const H = m.get(
|
|
749
|
+
const { mergeDraft: J } = await import("./merge-DauzoA2W.js");
|
|
750
|
+
if (!R(a, s) || C.aborted) return;
|
|
751
|
+
const H = m.get(a);
|
|
804
752
|
H?.flush();
|
|
805
|
-
const ne = Ze(
|
|
806
|
-
if (N = { text: ne, version:
|
|
807
|
-
b(
|
|
753
|
+
const ne = Ze(B.text), p = J(N.text, s.draft, ne, t());
|
|
754
|
+
if (N = { text: ne, version: B.version }, s.base = N, s.ending = Dt(B.text), s.draft = p.text, H?.adopt(p.text), p.kind === "conflicts") {
|
|
755
|
+
b(a, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
|
|
808
756
|
return;
|
|
809
757
|
}
|
|
810
|
-
if (
|
|
811
|
-
b(
|
|
758
|
+
if (K = !0, q = p.text, q === N.text) {
|
|
759
|
+
b(a, s, { kind: "saved", merged: K }, { dirty: !1, generation: s.value.generation + 1 });
|
|
812
760
|
return;
|
|
813
761
|
}
|
|
814
762
|
k(s, { dirty: !0, generation: s.value.generation + 1 });
|
|
815
763
|
}
|
|
816
|
-
b(
|
|
764
|
+
b(a, s, { kind: "failed", failure: { reason: "failed" } });
|
|
817
765
|
};
|
|
818
766
|
return {
|
|
819
|
-
session: (
|
|
820
|
-
subscribe:
|
|
821
|
-
start: (
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
824
|
-
k(
|
|
767
|
+
session: (a) => i.get(a)?.value,
|
|
768
|
+
subscribe: d.subscribe,
|
|
769
|
+
start: (a, s) => {
|
|
770
|
+
const w = i.get(a);
|
|
771
|
+
if (w !== void 0) {
|
|
772
|
+
k(w, { request: { anchor: s }, view: "editor" }), (w.value.phase.kind === "failed" || w.value.phase.kind === "grant") && T(a, w);
|
|
825
773
|
return;
|
|
826
774
|
}
|
|
827
|
-
|
|
775
|
+
l.delete(a);
|
|
828
776
|
const O = {
|
|
829
|
-
value: { path:
|
|
777
|
+
value: { path: a, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ge, generation: 0, request: { anchor: s } },
|
|
830
778
|
base: null,
|
|
831
779
|
draft: "",
|
|
832
780
|
ending: `
|
|
833
781
|
`,
|
|
834
782
|
controller: new AbortController()
|
|
835
783
|
};
|
|
836
|
-
i.set(
|
|
784
|
+
i.set(a, O), T(a, O);
|
|
837
785
|
},
|
|
838
|
-
retry: (
|
|
839
|
-
const s = i.get(
|
|
840
|
-
s === void 0 || s.value.phase.kind === "editing" || T(
|
|
786
|
+
retry: (a) => {
|
|
787
|
+
const s = i.get(a);
|
|
788
|
+
s === void 0 || s.value.phase.kind === "editing" || T(a, s);
|
|
841
789
|
},
|
|
842
|
-
draft: (
|
|
843
|
-
const s = i.get(
|
|
790
|
+
draft: (a) => {
|
|
791
|
+
const s = i.get(a);
|
|
844
792
|
return s === void 0 || s.base === null ? null : s.draft;
|
|
845
793
|
},
|
|
846
|
-
setDraft: (
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
849
|
-
|
|
850
|
-
const O = {},
|
|
851
|
-
|
|
852
|
-
const { save: N } =
|
|
794
|
+
setDraft: (a, s) => {
|
|
795
|
+
const w = i.get(a);
|
|
796
|
+
if (w === void 0 || w.base === null) return;
|
|
797
|
+
w.draft = s;
|
|
798
|
+
const O = {}, C = s !== w.base.text;
|
|
799
|
+
C !== w.value.dirty && (O.dirty = C);
|
|
800
|
+
const { save: N } = w.value;
|
|
853
801
|
if (N.kind === "conflicts") {
|
|
854
|
-
const q =
|
|
855
|
-
q === 0 ? O.save =
|
|
802
|
+
const q = Nt(s).length;
|
|
803
|
+
q === 0 ? O.save = Ge : q !== N.count && (O.save = { kind: "conflicts", count: q });
|
|
856
804
|
}
|
|
857
|
-
(O.dirty !== void 0 || O.save !== void 0) && k(
|
|
805
|
+
(O.dirty !== void 0 || O.save !== void 0) && k(w, O);
|
|
858
806
|
},
|
|
859
|
-
consumeRequest: (
|
|
860
|
-
const s = i.get(
|
|
807
|
+
consumeRequest: (a) => {
|
|
808
|
+
const s = i.get(a);
|
|
861
809
|
s !== void 0 && s.value.request !== null && k(s, { request: null });
|
|
862
810
|
},
|
|
863
|
-
save:
|
|
864
|
-
replaceDraft: (
|
|
865
|
-
const
|
|
866
|
-
|
|
867
|
-
const O = i.get(
|
|
811
|
+
save: g,
|
|
812
|
+
replaceDraft: (a, s) => {
|
|
813
|
+
const w = m.get(a);
|
|
814
|
+
w?.flush();
|
|
815
|
+
const O = i.get(a);
|
|
868
816
|
if (O === void 0 || O.base === null) return;
|
|
869
|
-
const
|
|
870
|
-
O.draft =
|
|
817
|
+
const C = Ze(s);
|
|
818
|
+
O.draft = C, w?.adopt(C), k(O, { dirty: C !== O.base.text, generation: O.value.generation + 1 });
|
|
871
819
|
},
|
|
872
|
-
close: (
|
|
873
|
-
if (!i.has(
|
|
874
|
-
const s = m.get(
|
|
875
|
-
|
|
820
|
+
close: (a) => {
|
|
821
|
+
if (!i.has(a)) return;
|
|
822
|
+
const s = m.get(a), w = s === void 0 ? null : s.returnPoint();
|
|
823
|
+
L(a), w === null ? l.delete(a) : l.set(a, w), d.emit();
|
|
876
824
|
},
|
|
877
|
-
takeReturn: (
|
|
878
|
-
const s =
|
|
879
|
-
return
|
|
825
|
+
takeReturn: (a) => {
|
|
826
|
+
const s = l.get(a) ?? null;
|
|
827
|
+
return l.delete(a), s;
|
|
880
828
|
},
|
|
881
|
-
dirtyPaths: () => [...i.values()].filter((
|
|
882
|
-
discard: (
|
|
883
|
-
for (const s of
|
|
884
|
-
|
|
829
|
+
dirtyPaths: () => [...i.values()].filter((a) => a.value.dirty).map((a) => a.value.path),
|
|
830
|
+
discard: (a) => {
|
|
831
|
+
for (const s of a) L(s);
|
|
832
|
+
a.length > 0 && d.emit();
|
|
885
833
|
},
|
|
886
834
|
editorState: {
|
|
887
|
-
get: (
|
|
888
|
-
set: (
|
|
889
|
-
i.has(
|
|
835
|
+
get: (a) => u.get(a),
|
|
836
|
+
set: (a, s) => {
|
|
837
|
+
i.has(a) && u.set(a, s);
|
|
890
838
|
}
|
|
891
839
|
},
|
|
892
|
-
bindEditor: (
|
|
893
|
-
bindView: (
|
|
894
|
-
viewAnchor: (
|
|
895
|
-
const s = f.get(
|
|
840
|
+
bindEditor: (a, s) => A(m, a, s),
|
|
841
|
+
bindView: (a, s) => A(f, a, s),
|
|
842
|
+
viewAnchor: (a) => {
|
|
843
|
+
const s = f.get(a);
|
|
896
844
|
return s === void 0 ? null : s.anchor();
|
|
897
845
|
},
|
|
898
|
-
flush: (
|
|
846
|
+
flush: (a) => m.get(a)?.flush(),
|
|
899
847
|
flushDrafts: () => {
|
|
900
|
-
for (const
|
|
848
|
+
for (const a of m.values()) a.flush();
|
|
901
849
|
},
|
|
902
|
-
nextConflict: (
|
|
850
|
+
nextConflict: (a) => m.get(a)?.nextConflict() === !0,
|
|
903
851
|
hasSessions: () => i.size > 0,
|
|
904
|
-
unsavedAmong: (
|
|
852
|
+
unsavedAmong: (a) => {
|
|
905
853
|
for (const s of m.values()) s.flush();
|
|
906
|
-
return
|
|
854
|
+
return a.filter((s) => i.get(s)?.value.dirty === !0);
|
|
907
855
|
},
|
|
908
|
-
askToDiscard: (
|
|
856
|
+
askToDiscard: (a) => new Promise((s) => {
|
|
909
857
|
E?.settle(!1);
|
|
910
|
-
const
|
|
911
|
-
paths:
|
|
858
|
+
const w = {
|
|
859
|
+
paths: a,
|
|
912
860
|
settle: (O) => {
|
|
913
|
-
if (E ===
|
|
914
|
-
if (E = null, O) for (const
|
|
915
|
-
|
|
861
|
+
if (E === w) {
|
|
862
|
+
if (E = null, O) for (const C of a) L(C);
|
|
863
|
+
d.emit(), s(O);
|
|
916
864
|
}
|
|
917
865
|
}
|
|
918
866
|
};
|
|
919
|
-
E =
|
|
867
|
+
E = w, d.emit();
|
|
920
868
|
}),
|
|
921
869
|
discardRequest: () => E,
|
|
922
870
|
sideBySide: () => (h ??= r.read(), h),
|
|
923
|
-
setSideBySide: (
|
|
924
|
-
h !==
|
|
871
|
+
setSideBySide: (a) => {
|
|
872
|
+
h !== a && (h = a, r.write(a), d.emit());
|
|
925
873
|
},
|
|
926
|
-
editorShare: () => (
|
|
927
|
-
setEditorShare: (
|
|
928
|
-
if (!Number.isFinite(
|
|
929
|
-
const s = Math.min(
|
|
930
|
-
|
|
874
|
+
editorShare: () => (v ??= o.read() ?? Xn, v),
|
|
875
|
+
setEditorShare: (a) => {
|
|
876
|
+
if (!Number.isFinite(a)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(a)}`);
|
|
877
|
+
const s = Math.min(sn, Math.max(cn, a));
|
|
878
|
+
v !== s && (v = s, o.write(s));
|
|
931
879
|
},
|
|
932
|
-
setView: (
|
|
933
|
-
const
|
|
934
|
-
|
|
880
|
+
setView: (a, s) => {
|
|
881
|
+
const w = i.get(a);
|
|
882
|
+
w === void 0 || w.value.view === s || (m.get(a)?.beforeView(s), k(w, { view: s, previewPrepared: w.value.previewPrepared || s === "preview" }));
|
|
935
883
|
},
|
|
936
|
-
preparePreview: (
|
|
937
|
-
const s = i.get(
|
|
884
|
+
preparePreview: (a) => {
|
|
885
|
+
const s = i.get(a);
|
|
938
886
|
s !== void 0 && !s.value.previewPrepared && k(s, { previewPrepared: !0 });
|
|
939
887
|
}
|
|
940
888
|
};
|
|
941
|
-
},
|
|
889
|
+
}, bn = (e) => {
|
|
942
890
|
e.preventDefault(), e.stopPropagation();
|
|
943
|
-
},
|
|
944
|
-
const t = e.closest(
|
|
891
|
+
}, Yr = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, En = "data-aqmx-content-pane", tt = Object.freeze({ [En]: "" }), Xr = "--aqmx-dialog-left", Jr = "--aqmx-dialog-top", Qr = '[data-testid="markdown-explorer"]', eo = (e) => {
|
|
892
|
+
const t = e.closest(Qr)?.querySelectorAll(`[${En}]`), n = t?.item(t.length - 1);
|
|
945
893
|
if (!(n instanceof HTMLElement)) throw new Error("[markdown-explorer] a dialog opened where the explorer marks no content pane");
|
|
946
894
|
return n;
|
|
947
|
-
},
|
|
948
|
-
const t =
|
|
895
|
+
}, to = (e) => {
|
|
896
|
+
const t = Yr(getComputedStyle(e).marginTop);
|
|
949
897
|
if (Number.isNaN(t)) return null;
|
|
950
|
-
const n =
|
|
951
|
-
return e.style.setProperty(
|
|
952
|
-
},
|
|
953
|
-
const r = _(null), o = _(null), i = _(!1),
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}, [t]),
|
|
898
|
+
const n = eo(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top: l } = Jn(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
|
|
899
|
+
return e.style.setProperty(Xr, `${String(i)}px`), e.style.setProperty(Jr, `${String(l)}px`), n;
|
|
900
|
+
}, no = (e) => e.preventDefault(), yn = ({ open: e, onOpen: t, onDismiss: n }) => {
|
|
901
|
+
const r = _(null), o = _(null), i = _(!1), l = _(t);
|
|
902
|
+
z(() => {
|
|
903
|
+
l.current = t;
|
|
904
|
+
}, [t]), z(() => {
|
|
957
905
|
i.current = e;
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
960
|
-
if (e && !
|
|
961
|
-
const h =
|
|
962
|
-
o.current = h instanceof HTMLElement ? h : null,
|
|
963
|
-
} else !e &&
|
|
964
|
-
}, [e]),
|
|
965
|
-
const
|
|
966
|
-
if (!e ||
|
|
906
|
+
const d = r.current;
|
|
907
|
+
if (d !== null)
|
|
908
|
+
if (e && !d.open) {
|
|
909
|
+
const h = d.ownerDocument.activeElement;
|
|
910
|
+
o.current = h instanceof HTMLElement ? h : null, d.showModal(), l.current?.();
|
|
911
|
+
} else !e && d.open && (d.close(), o.current?.isConnected === !0 && o.current.focus(), o.current = null);
|
|
912
|
+
}, [e]), z(() => {
|
|
913
|
+
const d = r.current;
|
|
914
|
+
if (!e || d === null) return;
|
|
967
915
|
const h = new ResizeObserver(() => E());
|
|
968
|
-
let
|
|
916
|
+
let v = null;
|
|
969
917
|
const E = () => {
|
|
970
|
-
const R =
|
|
971
|
-
R === null || R ===
|
|
918
|
+
const R = to(d);
|
|
919
|
+
R === null || R === v || (v !== null && h.unobserve(v), h.observe(R), v = R);
|
|
972
920
|
};
|
|
973
|
-
E(), h.observe(
|
|
974
|
-
const k =
|
|
975
|
-
return k?.addEventListener("resize", E),
|
|
976
|
-
h.disconnect(), k?.removeEventListener("resize", E),
|
|
921
|
+
E(), h.observe(d);
|
|
922
|
+
const k = d.ownerDocument.defaultView;
|
|
923
|
+
return k?.addEventListener("resize", E), d.ownerDocument.addEventListener("scroll", E, { capture: !0, passive: !0 }), () => {
|
|
924
|
+
h.disconnect(), k?.removeEventListener("resize", E), d.ownerDocument.removeEventListener("scroll", E, { capture: !0 });
|
|
977
925
|
};
|
|
978
926
|
}, [e]);
|
|
979
927
|
const u = P(
|
|
980
|
-
(
|
|
981
|
-
|
|
928
|
+
(d) => {
|
|
929
|
+
d.key !== "Escape" || d.defaultPrevented || (bn(d), n());
|
|
982
930
|
},
|
|
983
931
|
[n]
|
|
984
932
|
), m = P(
|
|
985
|
-
(
|
|
986
|
-
|
|
933
|
+
(d) => {
|
|
934
|
+
d.target === d.currentTarget && n();
|
|
987
935
|
},
|
|
988
936
|
[n]
|
|
989
937
|
), f = P(() => {
|
|
990
938
|
i.current && n();
|
|
991
939
|
}, [n]);
|
|
992
|
-
return { ref: r, onKeyDown: u, onClick: m, onCancel:
|
|
993
|
-
},
|
|
994
|
-
const m = _(null), f = xe(),
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
940
|
+
return { ref: r, onKeyDown: u, onClick: m, onCancel: no, onClose: f };
|
|
941
|
+
}, Sn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: l, testId: u }) => {
|
|
942
|
+
const m = _(null), f = xe(), d = xe(), h = P(() => m.current?.focus(), []), v = yn({ open: e, onOpen: h, onDismiss: l });
|
|
943
|
+
return /* @__PURE__ */ c("dialog", { ...v, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": d, "data-testid": u, children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
|
|
944
|
+
/* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: t }),
|
|
945
|
+
/* @__PURE__ */ c("p", { id: d, className: "aqmx-confirm-body", children: n }),
|
|
946
|
+
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
947
|
+
/* @__PURE__ */ c("button", { ref: m, type: "button", className: "aqmx-callout-action", "data-testid": `${u}-cancel`, onClick: l, children: o }),
|
|
948
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
|
|
1001
949
|
] })
|
|
1002
950
|
] }) });
|
|
1003
951
|
}, Te = (e) => {
|
|
@@ -1010,31 +958,31 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1010
958
|
t.status = "rejected", t.reason = n;
|
|
1011
959
|
}
|
|
1012
960
|
)), t;
|
|
1013
|
-
},
|
|
961
|
+
}, xn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, ro = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), oo = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), io = (e, t, n) => {
|
|
1014
962
|
const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
|
|
1015
963
|
for (let i = o.pop(); i !== void 0; i = o.pop()) {
|
|
1016
964
|
if (i.type !== "directory" || r.has(i.path)) continue;
|
|
1017
965
|
r.add(i.path);
|
|
1018
|
-
const
|
|
966
|
+
const l = i.lazy === !0 ? n(i.path) : void 0, u = i.lazy === !0 ? l?.status === "loaded" ? l.entries : null : i.children === void 0 ? [] : i.children;
|
|
1019
967
|
if (i.path === t) return u;
|
|
1020
968
|
if (u !== null) for (const m of [...u].reverse()) o.push(m);
|
|
1021
969
|
}
|
|
1022
970
|
return null;
|
|
1023
|
-
},
|
|
971
|
+
}, lo = (e, t, n) => {
|
|
1024
972
|
const r = Ee(e.read(t));
|
|
1025
|
-
if (r === void 0 || r.status === "deferred") return
|
|
973
|
+
if (r === void 0 || r.status === "deferred") return ro;
|
|
1026
974
|
if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
|
|
1027
|
-
const o =
|
|
1028
|
-
if (o !== null) return { readme: { status: "ok", readme:
|
|
975
|
+
const o = io(r.entries, n, (l) => e.children(t, l));
|
|
976
|
+
if (o !== null) return { readme: { status: "ok", readme: bt(o) }, claim: !1 };
|
|
1029
977
|
const i = e.children(t, n);
|
|
1030
|
-
return i === void 0 || i.status === "loading" ?
|
|
1031
|
-
},
|
|
1032
|
-
const { readme: r } =
|
|
978
|
+
return i === void 0 || i.status === "loading" ? oo : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: bt(i.entries) }, claim: !0 };
|
|
979
|
+
}, ao = (e, t, n) => {
|
|
980
|
+
const { readme: r } = lo(e, t, n);
|
|
1033
981
|
return r.status === "ok" ? r.readme : null;
|
|
1034
|
-
},
|
|
1035
|
-
const r =
|
|
982
|
+
}, so = (e, t, n) => {
|
|
983
|
+
const r = Un({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
1036
984
|
if (r === null) return /* @__PURE__ */ new Set();
|
|
1037
|
-
const { location: o } =
|
|
985
|
+
const { location: o } = an(e, r.params["*"], new URLSearchParams(t.search));
|
|
1038
986
|
switch (o.view) {
|
|
1039
987
|
case "tree": {
|
|
1040
988
|
const i = o.folder === null ? o.doc : n(o.source, o.folder);
|
|
@@ -1045,24 +993,24 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1045
993
|
case "multi":
|
|
1046
994
|
return new Set(o.docs);
|
|
1047
995
|
}
|
|
1048
|
-
},
|
|
996
|
+
}, kn = (e) => {
|
|
1049
997
|
const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
|
|
1050
|
-
return ee(t.subscribe, n,
|
|
1051
|
-
},
|
|
1052
|
-
},
|
|
998
|
+
return ee(t.subscribe, n, co);
|
|
999
|
+
}, Tn = () => !1, co = () => {
|
|
1000
|
+
}, uo = () => {
|
|
1053
1001
|
const { edits: e } = D();
|
|
1054
|
-
return ee(e.subscribe, e.hasSessions,
|
|
1055
|
-
},
|
|
1002
|
+
return ee(e.subscribe, e.hasSessions, Tn);
|
|
1003
|
+
}, fo = () => {
|
|
1056
1004
|
const { edits: e } = D();
|
|
1057
|
-
return ee(e.subscribe, e.sideBySide,
|
|
1058
|
-
},
|
|
1005
|
+
return ee(e.subscribe, e.sideBySide, Tn);
|
|
1006
|
+
}, mo = () => null, ho = () => {
|
|
1059
1007
|
const { edits: e, labels: t, config: n, trees: r } = D(), o = _([]), i = P(
|
|
1060
1008
|
({ nextLocation: E }) => {
|
|
1061
|
-
const k =
|
|
1009
|
+
const k = so(n, E, (R, T) => ao(r, R, T));
|
|
1062
1010
|
return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !k.has(R)), o.current.length > 0;
|
|
1063
1011
|
},
|
|
1064
1012
|
[e, n, r]
|
|
1065
|
-
),
|
|
1013
|
+
), l = Zn(i), u = uo();
|
|
1066
1014
|
te(() => {
|
|
1067
1015
|
if (!u) return;
|
|
1068
1016
|
const E = (k) => {
|
|
@@ -1070,26 +1018,26 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1070
1018
|
};
|
|
1071
1019
|
return window.addEventListener("beforeunload", E), () => window.removeEventListener("beforeunload", E);
|
|
1072
1020
|
}, [u, e]);
|
|
1073
|
-
const m = ee(e.subscribe, e.discardRequest,
|
|
1074
|
-
return /* @__PURE__ */
|
|
1075
|
-
|
|
1021
|
+
const m = ee(e.subscribe, e.discardRequest, mo), f = l.state === "blocked", d = f ? o.current : m === null ? [] : m.paths, h = d.map((E) => se(E)).join(", "), v = d.length > 0 && d.every((E) => e.session(E)?.save.kind === "draft");
|
|
1022
|
+
return /* @__PURE__ */ c(
|
|
1023
|
+
Sn,
|
|
1076
1024
|
{
|
|
1077
1025
|
open: f || m !== null,
|
|
1078
|
-
title:
|
|
1079
|
-
body:
|
|
1026
|
+
title: v ? t.draftDiscardTitle : t.unsavedTitle,
|
|
1027
|
+
body: v ? t.draftDiscardBody(h) : t.unsavedBody(h),
|
|
1080
1028
|
confirmLabel: t.unsavedDiscard,
|
|
1081
1029
|
cancelLabel: t.unsavedStay,
|
|
1082
1030
|
testId: "markdown-explorer-unsaved-guard",
|
|
1083
1031
|
onConfirm: () => {
|
|
1084
|
-
if (
|
|
1085
|
-
e.discard(o.current),
|
|
1032
|
+
if (l.state === "blocked") {
|
|
1033
|
+
e.discard(o.current), l.proceed();
|
|
1086
1034
|
return;
|
|
1087
1035
|
}
|
|
1088
1036
|
m?.settle(!0);
|
|
1089
1037
|
},
|
|
1090
1038
|
onCancel: () => {
|
|
1091
|
-
if (
|
|
1092
|
-
|
|
1039
|
+
if (l.state === "blocked") {
|
|
1040
|
+
l.reset();
|
|
1093
1041
|
return;
|
|
1094
1042
|
}
|
|
1095
1043
|
m?.settle(!1);
|
|
@@ -1097,12 +1045,12 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1097
1045
|
}
|
|
1098
1046
|
);
|
|
1099
1047
|
};
|
|
1100
|
-
function
|
|
1048
|
+
function po({
|
|
1101
1049
|
title: e,
|
|
1102
1050
|
titleId: t,
|
|
1103
1051
|
...n
|
|
1104
1052
|
}, r) {
|
|
1105
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1106
1054
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1107
1055
|
viewBox: "0 0 20 20",
|
|
1108
1056
|
fill: "currentColor",
|
|
@@ -1110,26 +1058,26 @@ function co({
|
|
|
1110
1058
|
"data-slot": "icon",
|
|
1111
1059
|
ref: r,
|
|
1112
1060
|
"aria-labelledby": t
|
|
1113
|
-
}, n), e ? /* @__PURE__ */
|
|
1061
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1114
1062
|
id: t
|
|
1115
|
-
}, e) : null, /* @__PURE__ */
|
|
1063
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1116
1064
|
fillRule: "evenodd",
|
|
1117
1065
|
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",
|
|
1118
1066
|
clipRule: "evenodd"
|
|
1119
1067
|
}));
|
|
1120
1068
|
}
|
|
1121
|
-
const
|
|
1122
|
-
let
|
|
1123
|
-
const
|
|
1124
|
-
throw
|
|
1125
|
-
}),
|
|
1126
|
-
|
|
1069
|
+
const vo = /* @__PURE__ */ S.forwardRef(po);
|
|
1070
|
+
let Ke = null;
|
|
1071
|
+
const Rn = () => (Ke ??= import("./EditSurface-DNjI8pV3.js").catch((e) => {
|
|
1072
|
+
throw Ke = null, e;
|
|
1073
|
+
}), Ke), wo = () => {
|
|
1074
|
+
Rn().catch(() => {
|
|
1127
1075
|
});
|
|
1128
|
-
},
|
|
1129
|
-
const { default: t } = re(
|
|
1130
|
-
return /* @__PURE__ */
|
|
1076
|
+
}, go = (e) => {
|
|
1077
|
+
const { default: t } = re(Rn());
|
|
1078
|
+
return /* @__PURE__ */ c(t, { ...e });
|
|
1131
1079
|
};
|
|
1132
|
-
class
|
|
1080
|
+
class bo extends on {
|
|
1133
1081
|
state = { failed: !1 };
|
|
1134
1082
|
static getDerivedStateFromError() {
|
|
1135
1083
|
return { failed: !0 };
|
|
@@ -1139,110 +1087,110 @@ class ho extends tn {
|
|
|
1139
1087
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
1140
1088
|
}
|
|
1141
1089
|
}
|
|
1142
|
-
const
|
|
1090
|
+
const ct = `[${un}]`, Eo = "[data-aqmd-content]", yo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen]', So = 200, Re = (e) => Tr(e.getAttribute(un)), xo = (e, t) => {
|
|
1143
1091
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
1144
1092
|
const o = Re(r);
|
|
1145
1093
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
1146
1094
|
}
|
|
1147
1095
|
let n = null;
|
|
1148
|
-
for (const r of t.querySelectorAll(
|
|
1096
|
+
for (const r of t.querySelectorAll(ct)) {
|
|
1149
1097
|
if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
|
|
1150
1098
|
const o = Re(r);
|
|
1151
1099
|
o !== null && (n = { block: r, lines: o });
|
|
1152
1100
|
}
|
|
1153
1101
|
return n === null ? null : { ...n, own: !1 };
|
|
1154
|
-
},
|
|
1102
|
+
}, ko = (e, t) => {
|
|
1155
1103
|
let n = 0;
|
|
1156
1104
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
1157
1105
|
return n;
|
|
1158
|
-
},
|
|
1159
|
-
const r =
|
|
1106
|
+
}, To = (e) => e.closest(Eo) !== null && e.closest(yo) === null, Ro = (e, t, n) => {
|
|
1107
|
+
const r = xo(e, t);
|
|
1160
1108
|
if (r === null) return null;
|
|
1161
1109
|
const { block: o, own: i } = r;
|
|
1162
1110
|
if (!i) {
|
|
1163
1111
|
const u = r.lines.last + 1;
|
|
1164
|
-
return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop:
|
|
1112
|
+
return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: De(e) };
|
|
1165
1113
|
}
|
|
1166
|
-
const
|
|
1167
|
-
return
|
|
1168
|
-
},
|
|
1114
|
+
const l = Lo(o, n);
|
|
1115
|
+
return l === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: De(o) } : { lines: r.lines, word: l.text, occurrence: l.occurrence, clientTop: l.clientTop };
|
|
1116
|
+
}, Oo = (e, t) => {
|
|
1169
1117
|
let n = null, r = null, o = null;
|
|
1170
|
-
for (const
|
|
1171
|
-
const u = Re(
|
|
1118
|
+
for (const l of e.querySelectorAll(ct)) {
|
|
1119
|
+
const u = Re(l);
|
|
1172
1120
|
if (u === null) continue;
|
|
1173
|
-
n ??=
|
|
1174
|
-
const { top: m, bottom: f } =
|
|
1175
|
-
m <= n && n < f ? r = { lines: u, block:
|
|
1121
|
+
n ??= Co(t, l);
|
|
1122
|
+
const { top: m, bottom: f } = l.getBoundingClientRect();
|
|
1123
|
+
m <= n && n < f ? r = { lines: u, block: l } : o === null && m >= n && (o = { lines: u, block: l });
|
|
1176
1124
|
}
|
|
1177
1125
|
const i = r === null ? o : r;
|
|
1178
|
-
return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop:
|
|
1179
|
-
},
|
|
1126
|
+
return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop: De(i.block) };
|
|
1127
|
+
}, Mo = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Co = (e, t) => {
|
|
1180
1128
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
1181
|
-
return
|
|
1182
|
-
},
|
|
1129
|
+
return Mo(e) + (Number.isFinite(n) ? n : 0);
|
|
1130
|
+
}, Lo = (e, t) => {
|
|
1183
1131
|
if (t === null || t.rangeCount === 0) return null;
|
|
1184
1132
|
const n = t.getRangeAt(0);
|
|
1185
1133
|
if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
|
|
1186
1134
|
const r = n.toString().trim();
|
|
1187
|
-
if (r === "" || r.length >
|
|
1135
|
+
if (r === "" || r.length > So || /[\r\n]/u.test(r)) return null;
|
|
1188
1136
|
const o = e.ownerDocument.createRange();
|
|
1189
|
-
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence:
|
|
1190
|
-
},
|
|
1137
|
+
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: ko(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
1138
|
+
}, rs = (e, t) => {
|
|
1191
1139
|
const n = e.split(`
|
|
1192
1140
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
|
|
1193
1141
|
if (t.word === null) return i;
|
|
1194
|
-
let
|
|
1142
|
+
let l = 0;
|
|
1195
1143
|
for (let u = r; u <= o; u += 1) {
|
|
1196
1144
|
const m = n[u - 1] ?? "";
|
|
1197
1145
|
for (let f = m.indexOf(t.word); f >= 0; f = m.indexOf(t.word, f + t.word.length)) {
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1146
|
+
if (l === t.occurrence) return { line: u, column: f };
|
|
1147
|
+
l += 1;
|
|
1200
1148
|
}
|
|
1201
1149
|
}
|
|
1202
|
-
return
|
|
1203
|
-
},
|
|
1150
|
+
return l > 0 ? Ao(n, r, o, t.word) ?? i : i;
|
|
1151
|
+
}, Ao = (e, t, n, r) => {
|
|
1204
1152
|
for (let o = n; o >= t; o -= 1) {
|
|
1205
1153
|
const i = (e[o - 1] ?? "").lastIndexOf(r);
|
|
1206
1154
|
if (i >= 0) return { line: o, column: i };
|
|
1207
1155
|
}
|
|
1208
1156
|
return null;
|
|
1209
|
-
},
|
|
1157
|
+
}, No = (e, t) => {
|
|
1210
1158
|
let n = null, r = null;
|
|
1211
|
-
for (const o of e.querySelectorAll(
|
|
1159
|
+
for (const o of e.querySelectorAll(ct)) {
|
|
1212
1160
|
const i = Re(o);
|
|
1213
1161
|
i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
|
|
1214
1162
|
}
|
|
1215
1163
|
return n !== null ? n : r === null ? null : r.element;
|
|
1216
|
-
},
|
|
1217
|
-
const { bottom: n } = e.getBoundingClientRect(), r =
|
|
1164
|
+
}, Do = (e, t) => {
|
|
1165
|
+
const { bottom: n } = e.getBoundingClientRect(), r = De(e), o = Re(e);
|
|
1218
1166
|
if (o === null) return r;
|
|
1219
1167
|
const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
1220
1168
|
return r + (n - r) * i;
|
|
1221
|
-
},
|
|
1169
|
+
}, De = (e) => {
|
|
1222
1170
|
const t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
|
|
1223
1171
|
for (let n = t.nextNode(); n !== null; n = t.nextNode()) {
|
|
1224
1172
|
const o = (n.textContent ?? "").search(/\S/u);
|
|
1225
1173
|
if (o < 0) continue;
|
|
1226
1174
|
const i = e.ownerDocument.createRange();
|
|
1227
1175
|
i.setStart(n, o), i.setEnd(n, o + 1);
|
|
1228
|
-
const { top:
|
|
1229
|
-
if (u > 0) return
|
|
1176
|
+
const { top: l, height: u } = i.getBoundingClientRect();
|
|
1177
|
+
if (u > 0) return l;
|
|
1230
1178
|
}
|
|
1231
1179
|
return e.getBoundingClientRect().top;
|
|
1232
|
-
},
|
|
1180
|
+
}, dt = Object.freeze({
|
|
1233
1181
|
browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1234
1182
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1235
1183
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1236
1184
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1237
|
-
}),
|
|
1238
|
-
const e =
|
|
1185
|
+
}), os = (e) => dt[e], qe = () => {
|
|
1186
|
+
const e = Gn();
|
|
1239
1187
|
return P(
|
|
1240
1188
|
(t, n) => {
|
|
1241
|
-
e(t,
|
|
1189
|
+
e(t, dt[n]);
|
|
1242
1190
|
},
|
|
1243
1191
|
[e]
|
|
1244
1192
|
);
|
|
1245
|
-
},
|
|
1193
|
+
}, Po = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Kn, { ...t, ...dt[e] }), On = (e) => {
|
|
1246
1194
|
const t = e.ownerDocument;
|
|
1247
1195
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1248
1196
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1252,43 +1200,43 @@ const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1252
1200
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
1253
1201
|
};
|
|
1254
1202
|
return e.addEventListener("blur", n), !0;
|
|
1255
|
-
},
|
|
1203
|
+
}, $o = (e, t) => {
|
|
1256
1204
|
const n = _(null), r = _(null), o = _(null), i = P(() => {
|
|
1257
1205
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1258
1206
|
}, []);
|
|
1259
1207
|
te(() => i, [i]);
|
|
1260
|
-
const
|
|
1208
|
+
const l = P(
|
|
1261
1209
|
(f) => {
|
|
1262
1210
|
if (r.current !== f) return;
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1211
|
+
const d = o.current;
|
|
1212
|
+
if (d !== null) {
|
|
1213
|
+
d.then(() => l(f));
|
|
1266
1214
|
return;
|
|
1267
1215
|
}
|
|
1268
1216
|
e.prefetch(f);
|
|
1269
1217
|
const h = e.peek(f);
|
|
1270
1218
|
if (h?.status !== "pending") return;
|
|
1271
|
-
const
|
|
1272
|
-
o.current =
|
|
1273
|
-
o.current ===
|
|
1219
|
+
const v = Promise.allSettled([h.promise]);
|
|
1220
|
+
o.current = v, v.then(() => {
|
|
1221
|
+
o.current === v && (o.current = null);
|
|
1274
1222
|
});
|
|
1275
1223
|
},
|
|
1276
1224
|
[e]
|
|
1277
1225
|
), u = P(
|
|
1278
1226
|
(f) => {
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
n.current = null,
|
|
1282
|
-
},
|
|
1227
|
+
const d = t(f);
|
|
1228
|
+
d !== r.current && (i(), d !== null && (r.current = d, n.current = window.setTimeout(() => {
|
|
1229
|
+
n.current = null, l(d);
|
|
1230
|
+
}, Qn)));
|
|
1283
1231
|
},
|
|
1284
|
-
[i, t,
|
|
1232
|
+
[i, t, l]
|
|
1285
1233
|
), m = P(
|
|
1286
1234
|
(f) => {
|
|
1287
1235
|
t(f) !== r.current && i();
|
|
1288
1236
|
},
|
|
1289
1237
|
[i, t]
|
|
1290
1238
|
);
|
|
1291
|
-
return
|
|
1239
|
+
return Z(
|
|
1292
1240
|
() => ({
|
|
1293
1241
|
onPointerOver: (f) => u(f.target),
|
|
1294
1242
|
onPointerOut: (f) => m(f.relatedTarget),
|
|
@@ -1297,8 +1245,8 @@ const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1297
1245
|
}),
|
|
1298
1246
|
[u, m]
|
|
1299
1247
|
);
|
|
1300
|
-
},
|
|
1301
|
-
class
|
|
1248
|
+
}, Fo = lt(() => import("./NativeScrollBar-D10fsk-7.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1249
|
+
class qo extends on {
|
|
1302
1250
|
state = { failed: !1 };
|
|
1303
1251
|
static getDerivedStateFromError() {
|
|
1304
1252
|
return { failed: !0 };
|
|
@@ -1310,7 +1258,7 @@ class No extends tn {
|
|
|
1310
1258
|
return this.state.failed ? null : this.props.children;
|
|
1311
1259
|
}
|
|
1312
1260
|
}
|
|
1313
|
-
const
|
|
1261
|
+
const _o = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(qo, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(Fo, { scroller: e, withCircle: t }) }) }), Mn = (e) => /* @__PURE__ */ c(_o, { scroller: e, withCircle: !0 }), Cn = () => {
|
|
1314
1262
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1315
1263
|
let n = !1;
|
|
1316
1264
|
const r = (o) => {
|
|
@@ -1325,9 +1273,9 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
|
|
|
1325
1273
|
return () => {
|
|
1326
1274
|
if (i) return;
|
|
1327
1275
|
i = !0;
|
|
1328
|
-
const
|
|
1329
|
-
if (
|
|
1330
|
-
e.set(o,
|
|
1276
|
+
const l = e.get(o);
|
|
1277
|
+
if (l !== void 0 && l > 1) {
|
|
1278
|
+
e.set(o, l - 1);
|
|
1331
1279
|
return;
|
|
1332
1280
|
}
|
|
1333
1281
|
e.delete(o), r(o);
|
|
@@ -1337,52 +1285,52 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
|
|
|
1337
1285
|
resumes: (o) => t.delete(o),
|
|
1338
1286
|
heldKeys: () => [...e.keys()]
|
|
1339
1287
|
};
|
|
1340
|
-
},
|
|
1288
|
+
}, Pe = (e, t) => {
|
|
1341
1289
|
if (Object.is(e, t)) return !0;
|
|
1342
1290
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
1343
1291
|
if (Array.isArray(e) || Array.isArray(t))
|
|
1344
|
-
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i,
|
|
1292
|
+
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, l) => Pe(i, t[l]));
|
|
1345
1293
|
const n = e, r = t, o = Object.keys(n);
|
|
1346
|
-
return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) &&
|
|
1347
|
-
},
|
|
1294
|
+
return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && Pe(n[i], r[i]));
|
|
1295
|
+
}, Bo = 55e3, $t = Object.freeze({ status: "deferred" }), Ft = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Ln = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Io = ({ client: e, capacity: t }) => {
|
|
1348
1296
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1349
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
1350
|
-
let
|
|
1351
|
-
const u = o.emit, m = () => (
|
|
1297
|
+
const n = /* @__PURE__ */ new Map(), r = Cn(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
|
|
1298
|
+
let l = 0;
|
|
1299
|
+
const u = o.emit, m = () => (l += 1, l), f = () => {
|
|
1352
1300
|
if (!(n.size <= t))
|
|
1353
1301
|
for (const b of [...n.keys()]) {
|
|
1354
1302
|
if (n.size <= t) return;
|
|
1355
1303
|
r.isHeld(b) || n.delete(b);
|
|
1356
1304
|
}
|
|
1357
|
-
},
|
|
1358
|
-
n.delete(b), n.set(b,
|
|
1359
|
-
}, h = (b) => performance.now() - b.validatedAt >=
|
|
1360
|
-
const s = n.get(b),
|
|
1361
|
-
return
|
|
1305
|
+
}, d = (b, g) => {
|
|
1306
|
+
n.delete(b), n.set(b, g);
|
|
1307
|
+
}, h = (b) => performance.now() - b.validatedAt >= Bo, v = (b, g, a) => {
|
|
1308
|
+
const s = n.get(b), w = ue(s?.snapshot), O = a || s?.refreshPending === !0, C = Te(e.document(b, { refresh: O }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: C, previous: w }, validatedAt: performance.now(), opened: g, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
|
|
1309
|
+
return d(b, N), f(), C.then((q) => {
|
|
1362
1310
|
n.get(b) === N && (N.snapshot = q, N.stamp = m(), u());
|
|
1363
1311
|
}), N;
|
|
1364
|
-
}, E = (b,
|
|
1365
|
-
|
|
1366
|
-
}, k = async (b,
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1312
|
+
}, E = (b, g, a, s, w, O) => {
|
|
1313
|
+
g.background === a && (g.background = null, !(n.get(b) !== g || g.snapshot !== s) && (w.kind === "failure" && s.document.kind !== "failure" || (g.validatedAt = O, g.stamp = m(), Pe(s.document, w) || (g.snapshot = { status: "loaded", document: w }), u())));
|
|
1314
|
+
}, k = async (b, g) => {
|
|
1315
|
+
const a = g.snapshot;
|
|
1316
|
+
if (a.status !== "loaded") return null;
|
|
1369
1317
|
const s = {};
|
|
1370
|
-
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
const
|
|
1374
|
-
return E(b,
|
|
1375
|
-
}, R = (b,
|
|
1376
|
-
const { snapshot:
|
|
1377
|
-
return
|
|
1318
|
+
g.background = s;
|
|
1319
|
+
const w = performance.now(), O = e.document(b, { refresh: g.refreshPending });
|
|
1320
|
+
g.refreshPending = !1;
|
|
1321
|
+
const C = await O, N = g.background === s && n.get(b) === g && g.snapshot === a;
|
|
1322
|
+
return E(b, g, s, a, C, w), N ? C : null;
|
|
1323
|
+
}, R = (b, g) => {
|
|
1324
|
+
const { snapshot: a } = g;
|
|
1325
|
+
return a.status === "pending" ? !1 : a.status === "loaded" && a.document.kind !== "failure" ? (k(b, g), !1) : (a.status === "loaded" && i.add(a), v(b, !0, !1), !0);
|
|
1378
1326
|
}, T = (b) => {
|
|
1379
|
-
const
|
|
1380
|
-
let
|
|
1327
|
+
const g = r.hold(b);
|
|
1328
|
+
let a = !1;
|
|
1381
1329
|
return () => {
|
|
1382
|
-
if (
|
|
1383
|
-
|
|
1330
|
+
if (a) return;
|
|
1331
|
+
a = !0, g();
|
|
1384
1332
|
const s = n.get(b);
|
|
1385
|
-
s !== void 0 &&
|
|
1333
|
+
s !== void 0 && d(b, s), f();
|
|
1386
1334
|
};
|
|
1387
1335
|
};
|
|
1388
1336
|
return {
|
|
@@ -1390,85 +1338,85 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
|
|
|
1390
1338
|
peekSeeded: (b) => n.get(b)?.seeded,
|
|
1391
1339
|
answerStampOf: (b) => n.get(b)?.stamp,
|
|
1392
1340
|
prefetch: (b) => {
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1341
|
+
const g = n.get(b);
|
|
1342
|
+
g !== void 0 && g.snapshot.status !== "deferred" || (v(b, !1, !1), u());
|
|
1395
1343
|
},
|
|
1396
1344
|
open: (b) => {
|
|
1397
|
-
const
|
|
1345
|
+
const g = r.resumes(b), a = T(b), s = n.get(b);
|
|
1398
1346
|
if (s === void 0 || s.snapshot.status === "deferred")
|
|
1399
|
-
return
|
|
1400
|
-
if (
|
|
1401
|
-
const { snapshot:
|
|
1402
|
-
return
|
|
1347
|
+
return v(b, !0, !1), u(), a;
|
|
1348
|
+
if (d(b, s), g) return a;
|
|
1349
|
+
const { snapshot: w } = s;
|
|
1350
|
+
return w.status === "pending" ? (s.opened = !0, a) : w.document.kind === "failure" ? (s.opened || h(s) ? (i.add(w), v(b, !0, !1), u()) : s.opened = !0, a) : (s.opened = !0, s.background === null && h(s) && k(b, s), a);
|
|
1403
1351
|
},
|
|
1404
1352
|
retain: T,
|
|
1405
1353
|
retry: (b) => {
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1354
|
+
const g = n.get(b);
|
|
1355
|
+
g === void 0 || g.snapshot.status !== "loaded" || g.snapshot.document.kind !== "failure" || (v(b, !0, !1), u());
|
|
1408
1356
|
},
|
|
1409
|
-
seed: (b,
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
(q) => q === null ?
|
|
1413
|
-
() =>
|
|
1357
|
+
seed: (b, g) => {
|
|
1358
|
+
const a = performance.now(), s = Te(
|
|
1359
|
+
g.then(
|
|
1360
|
+
(q) => q === null ? $t : { status: "loaded", document: q },
|
|
1361
|
+
() => $t
|
|
1414
1362
|
)
|
|
1415
|
-
),
|
|
1416
|
-
if (
|
|
1417
|
-
const q =
|
|
1418
|
-
|
|
1363
|
+
), w = n.get(b);
|
|
1364
|
+
if (w !== void 0 && w.snapshot.status === "loaded") {
|
|
1365
|
+
const q = w.snapshot, K = {};
|
|
1366
|
+
w.background = K, s.then((G) => {
|
|
1419
1367
|
if (G.status === "loaded") {
|
|
1420
|
-
E(b,
|
|
1368
|
+
E(b, w, K, q, G.document, a);
|
|
1421
1369
|
return;
|
|
1422
1370
|
}
|
|
1423
|
-
|
|
1371
|
+
w.background === K && (w.background = null);
|
|
1424
1372
|
});
|
|
1425
1373
|
return;
|
|
1426
1374
|
}
|
|
1427
|
-
const O =
|
|
1428
|
-
|
|
1429
|
-
n.get(b) === N && (q.status === "deferred" && r.isHeld(b) ?
|
|
1375
|
+
const O = w !== void 0 && w.snapshot.status === "pending" ? w.snapshot.previous : null, C = { status: "pending", promise: s, previous: O }, N = { snapshot: C, validatedAt: a, opened: w?.opened === !0, background: null, refreshPending: w?.refreshPending === !0, seeded: C, stamp: m() };
|
|
1376
|
+
d(b, N), f(), s.then((q) => {
|
|
1377
|
+
n.get(b) === N && (q.status === "deferred" && r.isHeld(b) ? v(b, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
|
|
1430
1378
|
});
|
|
1431
1379
|
},
|
|
1432
1380
|
invalidate: () => {
|
|
1433
1381
|
let b = !1;
|
|
1434
|
-
for (const [
|
|
1435
|
-
if (
|
|
1436
|
-
const { snapshot: s } =
|
|
1382
|
+
for (const [g, a] of [...n]) {
|
|
1383
|
+
if (a.validatedAt = Number.NEGATIVE_INFINITY, a.opened = !0, a.refreshPending = !0, !r.isHeld(g)) continue;
|
|
1384
|
+
const { snapshot: s } = a;
|
|
1437
1385
|
if (s.status !== "pending") {
|
|
1438
|
-
R(
|
|
1386
|
+
R(g, a) && (b = !0);
|
|
1439
1387
|
continue;
|
|
1440
1388
|
}
|
|
1441
1389
|
s.promise.then(() => {
|
|
1442
|
-
n.get(
|
|
1390
|
+
n.get(g) === a && a.refreshPending && r.isHeld(g) && R(g, a) && u();
|
|
1443
1391
|
});
|
|
1444
1392
|
}
|
|
1445
1393
|
b && u();
|
|
1446
1394
|
},
|
|
1447
1395
|
refresh: async (b) => {
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
|
|
1451
|
-
const s = await k(b,
|
|
1452
|
-
return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } :
|
|
1396
|
+
const g = n.get(b);
|
|
1397
|
+
if (g !== void 0 && Ln(g.snapshot)) {
|
|
1398
|
+
g.refreshPending = !0;
|
|
1399
|
+
const s = await k(b, g);
|
|
1400
|
+
return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : Ft;
|
|
1453
1401
|
}
|
|
1454
|
-
const
|
|
1455
|
-
return u(),
|
|
1402
|
+
const a = v(b, !0, !0);
|
|
1403
|
+
return u(), a.snapshot.status !== "pending" ? We : (await a.snapshot.promise, n.get(b) === a ? Ft : We);
|
|
1456
1404
|
},
|
|
1457
1405
|
clear: () => {
|
|
1458
1406
|
n.clear();
|
|
1459
|
-
for (const b of r.heldKeys())
|
|
1407
|
+
for (const b of r.heldKeys()) v(b, !0, !1);
|
|
1460
1408
|
u();
|
|
1461
1409
|
},
|
|
1462
1410
|
subscribe: o.subscribe,
|
|
1463
1411
|
noteFailureShown: (b) => i.has(b) ? !1 : (i.add(b), !0)
|
|
1464
1412
|
};
|
|
1465
1413
|
};
|
|
1466
|
-
function
|
|
1414
|
+
function jo({
|
|
1467
1415
|
title: e,
|
|
1468
1416
|
titleId: t,
|
|
1469
1417
|
...n
|
|
1470
1418
|
}, r) {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1472
1420
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1473
1421
|
viewBox: "0 0 20 20",
|
|
1474
1422
|
fill: "currentColor",
|
|
@@ -1476,25 +1424,25 @@ function $o({
|
|
|
1476
1424
|
"data-slot": "icon",
|
|
1477
1425
|
ref: r,
|
|
1478
1426
|
"aria-labelledby": t
|
|
1479
|
-
}, n), e ? /* @__PURE__ */
|
|
1427
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1480
1428
|
id: t
|
|
1481
|
-
}, e) : null, /* @__PURE__ */
|
|
1429
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1482
1430
|
fillRule: "evenodd",
|
|
1483
1431
|
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",
|
|
1484
1432
|
clipRule: "evenodd"
|
|
1485
|
-
}), /* @__PURE__ */
|
|
1433
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1486
1434
|
fillRule: "evenodd",
|
|
1487
1435
|
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",
|
|
1488
1436
|
clipRule: "evenodd"
|
|
1489
1437
|
}));
|
|
1490
1438
|
}
|
|
1491
|
-
const
|
|
1492
|
-
function
|
|
1439
|
+
const zo = /* @__PURE__ */ S.forwardRef(jo);
|
|
1440
|
+
function Ho({
|
|
1493
1441
|
title: e,
|
|
1494
1442
|
titleId: t,
|
|
1495
1443
|
...n
|
|
1496
1444
|
}, r) {
|
|
1497
|
-
return /* @__PURE__ */
|
|
1445
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1498
1446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1499
1447
|
viewBox: "0 0 20 20",
|
|
1500
1448
|
fill: "currentColor",
|
|
@@ -1502,23 +1450,23 @@ function _o({
|
|
|
1502
1450
|
"data-slot": "icon",
|
|
1503
1451
|
ref: r,
|
|
1504
1452
|
"aria-labelledby": t
|
|
1505
|
-
}, n), e ? /* @__PURE__ */
|
|
1453
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1506
1454
|
id: t
|
|
1507
|
-
}, e) : null, /* @__PURE__ */
|
|
1455
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1508
1456
|
fillRule: "evenodd",
|
|
1509
1457
|
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",
|
|
1510
1458
|
clipRule: "evenodd"
|
|
1511
|
-
}), /* @__PURE__ */
|
|
1459
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1512
1460
|
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"
|
|
1513
1461
|
}));
|
|
1514
1462
|
}
|
|
1515
|
-
const
|
|
1516
|
-
function
|
|
1463
|
+
const Vo = /* @__PURE__ */ S.forwardRef(Ho);
|
|
1464
|
+
function Uo({
|
|
1517
1465
|
title: e,
|
|
1518
1466
|
titleId: t,
|
|
1519
1467
|
...n
|
|
1520
1468
|
}, r) {
|
|
1521
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1522
1470
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1523
1471
|
viewBox: "0 0 20 20",
|
|
1524
1472
|
fill: "currentColor",
|
|
@@ -1526,42 +1474,42 @@ function Bo({
|
|
|
1526
1474
|
"data-slot": "icon",
|
|
1527
1475
|
ref: r,
|
|
1528
1476
|
"aria-labelledby": t
|
|
1529
|
-
}, n), e ? /* @__PURE__ */
|
|
1477
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1530
1478
|
id: t
|
|
1531
|
-
}, e) : null, /* @__PURE__ */
|
|
1479
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1532
1480
|
fillRule: "evenodd",
|
|
1533
1481
|
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",
|
|
1534
1482
|
clipRule: "evenodd"
|
|
1535
1483
|
}));
|
|
1536
1484
|
}
|
|
1537
|
-
const
|
|
1485
|
+
const Zo = /* @__PURE__ */ S.forwardRef(Uo), Go = 2e3, qt = Object.freeze({ outcome: "idle" }), Ko = (e) => {
|
|
1538
1486
|
const t = navigator.clipboard;
|
|
1539
1487
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1540
|
-
},
|
|
1541
|
-
const { announcer: t, labels: n } = D(), [r, o] =
|
|
1488
|
+
}, Wo = ({ text: e }) => {
|
|
1489
|
+
const { announcer: t, labels: n } = D(), [r, o] = j(qt);
|
|
1542
1490
|
te(() => {
|
|
1543
1491
|
if (r.outcome === "idle") return;
|
|
1544
|
-
const m = setTimeout(() => o(
|
|
1492
|
+
const m = setTimeout(() => o(qt), Go);
|
|
1545
1493
|
return () => clearTimeout(m);
|
|
1546
1494
|
}, [r]);
|
|
1547
1495
|
const i = (m) => {
|
|
1548
1496
|
o({ outcome: m }), t.announce(m === "copied" ? n.copiedText : n.copyTextFailed);
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1497
|
+
}, l = () => {
|
|
1498
|
+
Ko(e).then(
|
|
1551
1499
|
() => i("copied"),
|
|
1552
1500
|
() => i("failed")
|
|
1553
1501
|
);
|
|
1554
1502
|
}, u = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1555
1503
|
return (
|
|
1556
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(zo, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(Zo, {}) : /* @__PURE__ */ c(Vo, {}) })
|
|
1557
1505
|
);
|
|
1558
|
-
}, he = pe("fill"),
|
|
1559
|
-
function
|
|
1506
|
+
}, he = pe("fill"), Yo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => re(he) === "content" ? /* @__PURE__ */ c(Rt, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(Rt, { scrollerProps: { ...e, style: Yo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Mn, children: t });
|
|
1507
|
+
function Xo({
|
|
1560
1508
|
title: e,
|
|
1561
1509
|
titleId: t,
|
|
1562
1510
|
...n
|
|
1563
1511
|
}, r) {
|
|
1564
|
-
return /* @__PURE__ */
|
|
1512
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1565
1513
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1566
1514
|
viewBox: "0 0 20 20",
|
|
1567
1515
|
fill: "currentColor",
|
|
@@ -1569,21 +1517,21 @@ function Uo({
|
|
|
1569
1517
|
"data-slot": "icon",
|
|
1570
1518
|
ref: r,
|
|
1571
1519
|
"aria-labelledby": t
|
|
1572
|
-
}, n), e ? /* @__PURE__ */
|
|
1520
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1573
1521
|
id: t
|
|
1574
|
-
}, e) : null, /* @__PURE__ */
|
|
1522
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1575
1523
|
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"
|
|
1576
|
-
}), /* @__PURE__ */
|
|
1524
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1577
1525
|
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"
|
|
1578
1526
|
}));
|
|
1579
1527
|
}
|
|
1580
|
-
const
|
|
1581
|
-
function
|
|
1528
|
+
const Jo = /* @__PURE__ */ S.forwardRef(Xo);
|
|
1529
|
+
function Qo({
|
|
1582
1530
|
title: e,
|
|
1583
1531
|
titleId: t,
|
|
1584
1532
|
...n
|
|
1585
1533
|
}, r) {
|
|
1586
|
-
return /* @__PURE__ */
|
|
1534
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1587
1535
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1588
1536
|
viewBox: "0 0 20 20",
|
|
1589
1537
|
fill: "currentColor",
|
|
@@ -1591,34 +1539,34 @@ function Wo({
|
|
|
1591
1539
|
"data-slot": "icon",
|
|
1592
1540
|
ref: r,
|
|
1593
1541
|
"aria-labelledby": t
|
|
1594
|
-
}, n), e ? /* @__PURE__ */
|
|
1542
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1595
1543
|
id: t
|
|
1596
|
-
}, e) : null, /* @__PURE__ */
|
|
1544
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1597
1545
|
fillRule: "evenodd",
|
|
1598
1546
|
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",
|
|
1599
1547
|
clipRule: "evenodd"
|
|
1600
|
-
}), /* @__PURE__ */
|
|
1548
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1601
1549
|
fillRule: "evenodd",
|
|
1602
1550
|
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",
|
|
1603
1551
|
clipRule: "evenodd"
|
|
1604
1552
|
}));
|
|
1605
1553
|
}
|
|
1606
|
-
const
|
|
1554
|
+
const ei = /* @__PURE__ */ S.forwardRef(Qo), _e = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1607
1555
|
const { labels: i } = D();
|
|
1608
|
-
return /* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1556
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1557
|
+
/* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
1558
|
+
/* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
1611
1559
|
o,
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(ei, {}) }),
|
|
1561
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(Jo, {}) })
|
|
1614
1562
|
] });
|
|
1615
1563
|
};
|
|
1616
|
-
function
|
|
1564
|
+
function ti({
|
|
1617
1565
|
title: e,
|
|
1618
1566
|
titleId: t,
|
|
1619
1567
|
...n
|
|
1620
1568
|
}, r) {
|
|
1621
|
-
return /* @__PURE__ */
|
|
1569
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1622
1570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1623
1571
|
viewBox: "0 0 20 20",
|
|
1624
1572
|
fill: "currentColor",
|
|
@@ -1626,53 +1574,53 @@ function Xo({
|
|
|
1626
1574
|
"data-slot": "icon",
|
|
1627
1575
|
ref: r,
|
|
1628
1576
|
"aria-labelledby": t
|
|
1629
|
-
}, n), e ? /* @__PURE__ */
|
|
1577
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1630
1578
|
id: t
|
|
1631
|
-
}, e) : null, /* @__PURE__ */
|
|
1579
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1632
1580
|
fillRule: "evenodd",
|
|
1633
1581
|
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",
|
|
1634
1582
|
clipRule: "evenodd"
|
|
1635
1583
|
}));
|
|
1636
1584
|
}
|
|
1637
|
-
const
|
|
1585
|
+
const ni = /* @__PURE__ */ S.forwardRef(ti), ri = Object.freeze({ className: "aqmx-document-stage" }), oi = ({ document: e }) => {
|
|
1638
1586
|
const { labels: t } = D();
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1588
|
+
/* @__PURE__ */ c(_e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(ni, {}) }),
|
|
1589
|
+
/* @__PURE__ */ c(ve, { scrollerProps: ri, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
1590
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
1591
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
1644
1592
|
] }) })
|
|
1645
1593
|
] });
|
|
1646
|
-
},
|
|
1594
|
+
}, Be = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ii = (e) => {
|
|
1647
1595
|
const t = e.indexOf("#");
|
|
1648
1596
|
return t === -1 ? "" : e.slice(t);
|
|
1649
|
-
},
|
|
1597
|
+
}, li = /(%[0-9A-Fa-f]{2})/u, ut = (e) => {
|
|
1650
1598
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1651
|
-
const t = new TextEncoder(), n = e.slice(1).split(
|
|
1599
|
+
const t = new TextEncoder(), n = e.slice(1).split(li).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1652
1600
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1653
|
-
},
|
|
1601
|
+
}, An = (e) => `#${encodeURIComponent(e)}`, ai = (e) => {
|
|
1654
1602
|
if (e === "#") return !0;
|
|
1655
|
-
const t =
|
|
1603
|
+
const t = ut(e);
|
|
1656
1604
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
1657
|
-
},
|
|
1605
|
+
}, Nn = (e, t) => {
|
|
1658
1606
|
if (t === "") return null;
|
|
1659
1607
|
for (const n of e.querySelectorAll("[id]"))
|
|
1660
1608
|
if (n.id === t) return n;
|
|
1661
1609
|
return null;
|
|
1662
|
-
},
|
|
1610
|
+
}, si = "http://www.w3.org/1999/xhtml", _t = (e, t) => {
|
|
1663
1611
|
if (t === "") return null;
|
|
1664
|
-
const n =
|
|
1612
|
+
const n = Nn(e, t);
|
|
1665
1613
|
if (n !== null) return n;
|
|
1666
1614
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1667
|
-
if (r.localName === "a" && r.namespaceURI ===
|
|
1615
|
+
if (r.localName === "a" && r.namespaceURI === si && r.getAttribute("name") === t) return r;
|
|
1668
1616
|
return null;
|
|
1669
|
-
},
|
|
1617
|
+
}, Dn = (e, t) => {
|
|
1670
1618
|
if (e === null || !t.startsWith("#")) return null;
|
|
1671
|
-
const n =
|
|
1619
|
+
const n = _t(e, t.slice(1));
|
|
1672
1620
|
if (n !== null) return n;
|
|
1673
|
-
const r =
|
|
1674
|
-
return r === null ? null :
|
|
1675
|
-
},
|
|
1621
|
+
const r = ut(t);
|
|
1622
|
+
return r === null ? null : _t(e, r);
|
|
1623
|
+
}, Bt = (e) => {
|
|
1676
1624
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
1677
1625
|
if (e === t) {
|
|
1678
1626
|
const o = getComputedStyle(n);
|
|
@@ -1680,22 +1628,22 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1680
1628
|
}
|
|
1681
1629
|
const { overflowY: r } = getComputedStyle(e);
|
|
1682
1630
|
return r === "auto" || r === "scroll";
|
|
1683
|
-
},
|
|
1631
|
+
}, ci = (e) => {
|
|
1684
1632
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
1685
1633
|
return o !== "hidden" && o !== "clip";
|
|
1686
|
-
},
|
|
1687
|
-
const n = t.closest(
|
|
1688
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
1689
|
-
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement:
|
|
1634
|
+
}, di = (e, t) => {
|
|
1635
|
+
const n = t.closest(Be), r = n !== null && e.contains(n) ? n : e;
|
|
1636
|
+
if (r.scrollHeight > r.clientHeight && Bt(r)) return r;
|
|
1637
|
+
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: l } = e.ownerDocument;
|
|
1690
1638
|
for (let u = e.parentElement; u !== null && u !== i; u = u.parentElement)
|
|
1691
|
-
if (
|
|
1692
|
-
return
|
|
1693
|
-
},
|
|
1694
|
-
scrollerOf:
|
|
1639
|
+
if (Bt(u) && u.scrollHeight > u.clientHeight && u.clientHeight < o) return u;
|
|
1640
|
+
return l instanceof Element && ci(e.ownerDocument) && l.scrollHeight > l.clientHeight && l.clientHeight < o ? l : r;
|
|
1641
|
+
}, ui = Object.freeze({
|
|
1642
|
+
scrollerOf: di,
|
|
1695
1643
|
reveal: (e) => {
|
|
1696
|
-
e.scrollIntoView(
|
|
1644
|
+
e.scrollIntoView(nt);
|
|
1697
1645
|
}
|
|
1698
|
-
}),
|
|
1646
|
+
}), nt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), fi = (e, t) => {
|
|
1699
1647
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1700
1648
|
const r = n.parentElement;
|
|
1701
1649
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1703,28 +1651,28 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1703
1651
|
n.removeAttribute("hidden");
|
|
1704
1652
|
}
|
|
1705
1653
|
}
|
|
1706
|
-
},
|
|
1654
|
+
}, mi = (e, t) => {
|
|
1707
1655
|
if (t.getClientRects().length === 0) return;
|
|
1708
|
-
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r),
|
|
1709
|
-
if (!u && Math.abs(
|
|
1710
|
-
t.scrollIntoView(
|
|
1656
|
+
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), l = t.getBoundingClientRect(), u = l.height + i + Number.parseFloat(o) > e.clientHeight;
|
|
1657
|
+
if (!u && Math.abs(l.top - i - n) < 1) {
|
|
1658
|
+
t.scrollIntoView(nt);
|
|
1711
1659
|
return;
|
|
1712
1660
|
}
|
|
1713
|
-
e.scrollBy({ top: u ?
|
|
1714
|
-
},
|
|
1715
|
-
const n = t.scrollerOf(e, e.querySelector(
|
|
1661
|
+
e.scrollBy({ top: u ? l.top - n - e.clientHeight : l.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(nt);
|
|
1662
|
+
}, hi = (e, t) => {
|
|
1663
|
+
const n = t.scrollerOf(e, e.querySelector(Be) ?? e);
|
|
1716
1664
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1717
|
-
},
|
|
1665
|
+
}, It = (e, t, n) => {
|
|
1718
1666
|
if (e === null) return null;
|
|
1719
|
-
const r =
|
|
1720
|
-
return r === null ? (
|
|
1667
|
+
const r = Dn(e, t);
|
|
1668
|
+
return r === null ? (ai(t) && hi(e, n), null) : (fi(e, r), mi(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1721
1669
|
};
|
|
1722
|
-
function
|
|
1670
|
+
function pi({
|
|
1723
1671
|
title: e,
|
|
1724
1672
|
titleId: t,
|
|
1725
1673
|
...n
|
|
1726
1674
|
}, r) {
|
|
1727
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1728
1676
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1729
1677
|
viewBox: "0 0 20 20",
|
|
1730
1678
|
fill: "currentColor",
|
|
@@ -1732,19 +1680,19 @@ function ci({
|
|
|
1732
1680
|
"data-slot": "icon",
|
|
1733
1681
|
ref: r,
|
|
1734
1682
|
"aria-labelledby": t
|
|
1735
|
-
}, n), e ? /* @__PURE__ */
|
|
1683
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1736
1684
|
id: t
|
|
1737
|
-
}, e) : null, /* @__PURE__ */
|
|
1685
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1738
1686
|
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"
|
|
1739
1687
|
}));
|
|
1740
1688
|
}
|
|
1741
|
-
const
|
|
1742
|
-
function
|
|
1689
|
+
const vi = /* @__PURE__ */ S.forwardRef(pi);
|
|
1690
|
+
function wi({
|
|
1743
1691
|
title: e,
|
|
1744
1692
|
titleId: t,
|
|
1745
1693
|
...n
|
|
1746
1694
|
}, r) {
|
|
1747
|
-
return /* @__PURE__ */
|
|
1695
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1748
1696
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1749
1697
|
viewBox: "0 0 20 20",
|
|
1750
1698
|
fill: "currentColor",
|
|
@@ -1752,23 +1700,23 @@ function fi({
|
|
|
1752
1700
|
"data-slot": "icon",
|
|
1753
1701
|
ref: r,
|
|
1754
1702
|
"aria-labelledby": t
|
|
1755
|
-
}, n), e ? /* @__PURE__ */
|
|
1703
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1756
1704
|
id: t
|
|
1757
|
-
}, e) : null, /* @__PURE__ */
|
|
1705
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1758
1706
|
d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
|
|
1759
|
-
}), /* @__PURE__ */
|
|
1707
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1760
1708
|
fillRule: "evenodd",
|
|
1761
1709
|
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",
|
|
1762
1710
|
clipRule: "evenodd"
|
|
1763
1711
|
}));
|
|
1764
1712
|
}
|
|
1765
|
-
const
|
|
1766
|
-
function
|
|
1713
|
+
const gi = /* @__PURE__ */ S.forwardRef(wi);
|
|
1714
|
+
function bi({
|
|
1767
1715
|
title: e,
|
|
1768
1716
|
titleId: t,
|
|
1769
1717
|
...n
|
|
1770
1718
|
}, r) {
|
|
1771
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1772
1720
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1773
1721
|
viewBox: "0 0 20 20",
|
|
1774
1722
|
fill: "currentColor",
|
|
@@ -1776,23 +1724,23 @@ function hi({
|
|
|
1776
1724
|
"data-slot": "icon",
|
|
1777
1725
|
ref: r,
|
|
1778
1726
|
"aria-labelledby": t
|
|
1779
|
-
}, n), e ? /* @__PURE__ */
|
|
1727
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1780
1728
|
id: t
|
|
1781
|
-
}, e) : null, /* @__PURE__ */
|
|
1729
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1782
1730
|
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"
|
|
1783
|
-
}), /* @__PURE__ */
|
|
1731
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1784
1732
|
fillRule: "evenodd",
|
|
1785
1733
|
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",
|
|
1786
1734
|
clipRule: "evenodd"
|
|
1787
1735
|
}));
|
|
1788
1736
|
}
|
|
1789
|
-
const
|
|
1790
|
-
function
|
|
1737
|
+
const Ei = /* @__PURE__ */ S.forwardRef(bi);
|
|
1738
|
+
function yi({
|
|
1791
1739
|
title: e,
|
|
1792
1740
|
titleId: t,
|
|
1793
1741
|
...n
|
|
1794
1742
|
}, r) {
|
|
1795
|
-
return /* @__PURE__ */
|
|
1743
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1796
1744
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1797
1745
|
viewBox: "0 0 20 20",
|
|
1798
1746
|
fill: "currentColor",
|
|
@@ -1800,15 +1748,15 @@ function vi({
|
|
|
1800
1748
|
"data-slot": "icon",
|
|
1801
1749
|
ref: r,
|
|
1802
1750
|
"aria-labelledby": t
|
|
1803
|
-
}, n), e ? /* @__PURE__ */
|
|
1751
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1804
1752
|
id: t
|
|
1805
|
-
}, e) : null, /* @__PURE__ */
|
|
1753
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1806
1754
|
fillRule: "evenodd",
|
|
1807
1755
|
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",
|
|
1808
1756
|
clipRule: "evenodd"
|
|
1809
1757
|
}));
|
|
1810
1758
|
}
|
|
1811
|
-
const
|
|
1759
|
+
const Si = /* @__PURE__ */ S.forwardRef(yi), rt = "data-aqmx-key-repeat", ot = Object.freeze({ [rt]: "allow" }), xi = `[${rt}="${ot[rt]}"]`, ki = () => {
|
|
1812
1760
|
let e = null;
|
|
1813
1761
|
return {
|
|
1814
1762
|
onKeyDownCapture: (t) => {
|
|
@@ -1817,7 +1765,7 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1817
1765
|
e = t.target instanceof Element ? t.target : null;
|
|
1818
1766
|
return;
|
|
1819
1767
|
}
|
|
1820
|
-
e !== null && t.target === e && e.closest(
|
|
1768
|
+
e !== null && t.target === e && e.closest(xi) !== null || (t.preventDefault(), t.stopPropagation());
|
|
1821
1769
|
}
|
|
1822
1770
|
},
|
|
1823
1771
|
onKeyUpCapture: (t) => {
|
|
@@ -1827,41 +1775,41 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1827
1775
|
t.target === e && (e = null);
|
|
1828
1776
|
}
|
|
1829
1777
|
};
|
|
1830
|
-
},
|
|
1778
|
+
}, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), jt = Object.freeze({ mode: "fit" }), Ti = 1, Pn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), zt = `[data-testid="${Pn["data-testid"]}"]`, Ri = pe(null), Oi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ti ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Ht = (e, t, n) => {
|
|
1831
1779
|
if (e.mode === "level") {
|
|
1832
1780
|
const o = e.index + n;
|
|
1833
|
-
return o >= 0 && o <
|
|
1781
|
+
return o >= 0 && o < Le.length ? o : null;
|
|
1834
1782
|
}
|
|
1835
1783
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
1836
|
-
const r = n === 1 ?
|
|
1784
|
+
const r = n === 1 ? Le.findIndex((o) => o > t) : Le.findLastIndex((o) => o < t);
|
|
1837
1785
|
return r === -1 ? null : r;
|
|
1838
|
-
},
|
|
1786
|
+
}, Vt = (e, t, n) => {
|
|
1839
1787
|
if (e.mode === "level") {
|
|
1840
|
-
const o =
|
|
1788
|
+
const o = Ht(e, null, n);
|
|
1841
1789
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
1842
1790
|
}
|
|
1843
1791
|
if (t === null) return null;
|
|
1844
|
-
const r =
|
|
1792
|
+
const r = Ht(e, t.scale, n);
|
|
1845
1793
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1846
|
-
},
|
|
1794
|
+
}, Mi = (e, t) => {
|
|
1847
1795
|
if (e <= 0 || t <= 0) return 0;
|
|
1848
1796
|
const n = Math.trunc(Math.log(t / e) / Math.log(be));
|
|
1849
1797
|
return n === 0 ? 0 : n;
|
|
1850
|
-
},
|
|
1798
|
+
}, Ut = (e) => {
|
|
1851
1799
|
const t = e[0], n = e[1];
|
|
1852
1800
|
return e.length !== 2 || t === void 0 || n === void 0 ? null : { distance: Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), middle: { x: (t.clientX + n.clientX) / 2, y: (t.clientY + n.clientY) / 2 } };
|
|
1853
|
-
},
|
|
1854
|
-
const t =
|
|
1801
|
+
}, Ci = (e) => {
|
|
1802
|
+
const t = Le[e];
|
|
1855
1803
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1856
1804
|
return t;
|
|
1857
|
-
},
|
|
1858
|
-
const { labels: t } = D(), n = re(
|
|
1859
|
-
const { naturalWidth:
|
|
1860
|
-
u((
|
|
1861
|
-
}, []),
|
|
1862
|
-
(
|
|
1863
|
-
|
|
1864
|
-
() => h(
|
|
1805
|
+
}, Zt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Li = ({ document: e }) => {
|
|
1806
|
+
const { labels: t } = D(), n = re(Ri), [r] = j(() => n === null ? null : n.read(e.url)), [o, i] = j(r === null ? jt : r.zoom), [l, u] = j(r === null ? null : r.reported), [m, f] = j(null), d = _(null), h = P((g) => {
|
|
1807
|
+
const { naturalWidth: a, naturalHeight: s } = g;
|
|
1808
|
+
u((w) => Zt(w, a, s));
|
|
1809
|
+
}, []), v = P(
|
|
1810
|
+
(g) => {
|
|
1811
|
+
d.current = g, !(g === null || !g.complete) && (g.naturalWidth > 0 || g.naturalHeight > 0 ? h(g) : g.decode().then(
|
|
1812
|
+
() => h(g),
|
|
1865
1813
|
() => {
|
|
1866
1814
|
}
|
|
1867
1815
|
));
|
|
@@ -1869,52 +1817,52 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1869
1817
|
[h]
|
|
1870
1818
|
);
|
|
1871
1819
|
te(() => {
|
|
1872
|
-
n !== null &&
|
|
1873
|
-
}, [n, e.url, o,
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
const
|
|
1877
|
-
if (
|
|
1878
|
-
const s = new ResizeObserver(
|
|
1879
|
-
return s.observe(
|
|
1880
|
-
}, [
|
|
1881
|
-
const E =
|
|
1882
|
-
|
|
1883
|
-
|
|
1820
|
+
n !== null && l !== null && n.save(e.url, { zoom: o, reported: l });
|
|
1821
|
+
}, [n, e.url, o, l]), z(() => {
|
|
1822
|
+
const g = d.current;
|
|
1823
|
+
if (g === null || l === null || o.mode !== "fit") return;
|
|
1824
|
+
const a = () => f((w) => Zt(w, g.clientWidth, g.clientHeight));
|
|
1825
|
+
if (a(), typeof ResizeObserver > "u") return;
|
|
1826
|
+
const s = new ResizeObserver(a);
|
|
1827
|
+
return s.observe(g), () => s.disconnect();
|
|
1828
|
+
}, [l, o.mode]);
|
|
1829
|
+
const E = l === null || m === null ? null : Oi(l, m), k = Vt(o, E, -1), R = Vt(o, E, 1), T = o.mode === "level" ? Ci(o.index) : null, L = _({ zoomIn: R, zoomOut: k });
|
|
1830
|
+
z(() => {
|
|
1831
|
+
L.current = { zoomIn: R, zoomOut: k };
|
|
1884
1832
|
});
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1833
|
+
const A = _(null);
|
|
1834
|
+
z(() => {
|
|
1835
|
+
const g = A.current, a = d.current?.closest(zt);
|
|
1836
|
+
A.current = null, !(g === null || a === null || a === void 0) && (a.scrollLeft = g.across * a.scrollWidth - g.x, a.scrollTop = g.down * a.scrollHeight - g.y);
|
|
1889
1837
|
}, [o]), te(() => {
|
|
1890
|
-
const
|
|
1891
|
-
if (
|
|
1892
|
-
let
|
|
1893
|
-
const s = (
|
|
1894
|
-
const N =
|
|
1895
|
-
|
|
1896
|
-
},
|
|
1897
|
-
const N =
|
|
1898
|
-
if (
|
|
1899
|
-
|
|
1900
|
-
const q =
|
|
1901
|
-
if (q ===
|
|
1902
|
-
const
|
|
1838
|
+
const g = d.current?.closest(zt);
|
|
1839
|
+
if (g == null) return;
|
|
1840
|
+
let a = null;
|
|
1841
|
+
const s = (C) => {
|
|
1842
|
+
const N = Ut(C.touches);
|
|
1843
|
+
a = N === null ? null : { distance: N.distance, steps: 0 };
|
|
1844
|
+
}, w = (C) => {
|
|
1845
|
+
const N = Ut(C.touches);
|
|
1846
|
+
if (a === null || N === null) return;
|
|
1847
|
+
C.preventDefault();
|
|
1848
|
+
const q = Mi(a.distance, N.distance);
|
|
1849
|
+
if (q === a.steps) return;
|
|
1850
|
+
const K = q > a.steps ? 1 : -1, G = K === 1 ? L.current.zoomIn : L.current.zoomOut;
|
|
1903
1851
|
if (G === null) return;
|
|
1904
|
-
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
}, O = (
|
|
1908
|
-
|
|
1852
|
+
a.steps += K;
|
|
1853
|
+
const B = g.getBoundingClientRect(), J = N.middle.x - B.left, H = N.middle.y - B.top;
|
|
1854
|
+
A.current = g.scrollWidth > 0 && g.scrollHeight > 0 ? { x: J, y: H, across: (g.scrollLeft + J) / g.scrollWidth, down: (g.scrollTop + H) / g.scrollHeight } : null, i(G);
|
|
1855
|
+
}, O = (C) => {
|
|
1856
|
+
C.touches.length < 2 && (a = null);
|
|
1909
1857
|
};
|
|
1910
|
-
return
|
|
1911
|
-
|
|
1858
|
+
return g.addEventListener("touchstart", s, { passive: !0 }), g.addEventListener("touchmove", w, { passive: !1 }), g.addEventListener("touchend", O, { passive: !0 }), g.addEventListener("touchcancel", O, { passive: !0 }), () => {
|
|
1859
|
+
g.removeEventListener("touchstart", s), g.removeEventListener("touchmove", w), g.removeEventListener("touchend", O), g.removeEventListener("touchcancel", O);
|
|
1912
1860
|
};
|
|
1913
1861
|
}, []);
|
|
1914
1862
|
const b = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1915
|
-
return /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1863
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1864
|
+
/* @__PURE__ */ F(_e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Si, {}), children: [
|
|
1865
|
+
/* @__PURE__ */ c(
|
|
1918
1866
|
"button",
|
|
1919
1867
|
{
|
|
1920
1868
|
type: "button",
|
|
@@ -1925,12 +1873,12 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1925
1873
|
onClick: () => {
|
|
1926
1874
|
k !== null && i(k);
|
|
1927
1875
|
},
|
|
1928
|
-
...
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1876
|
+
...ot,
|
|
1877
|
+
children: /* @__PURE__ */ c(gi, {})
|
|
1930
1878
|
}
|
|
1931
1879
|
),
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1880
|
+
/* @__PURE__ */ c("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
|
|
1881
|
+
/* @__PURE__ */ c(
|
|
1934
1882
|
"button",
|
|
1935
1883
|
{
|
|
1936
1884
|
type: "button",
|
|
@@ -1941,87 +1889,87 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1941
1889
|
onClick: () => {
|
|
1942
1890
|
R !== null && i(R);
|
|
1943
1891
|
},
|
|
1944
|
-
...
|
|
1945
|
-
children: /* @__PURE__ */
|
|
1892
|
+
...ot,
|
|
1893
|
+
children: /* @__PURE__ */ c(Ei, {})
|
|
1946
1894
|
}
|
|
1947
1895
|
),
|
|
1948
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(jt), children: /* @__PURE__ */ c(vi, {}) })
|
|
1949
1897
|
] }),
|
|
1950
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ c(ve, { scrollerProps: Pn, children: /* @__PURE__ */ c("img", { ref: v, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: b, onLoad: (g) => h(g.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1951
1899
|
] });
|
|
1952
|
-
},
|
|
1953
|
-
const e = re(
|
|
1900
|
+
}, $n = pe(null), Ie = pe(void 0), Fn = pe(null), je = () => {
|
|
1901
|
+
const e = re($n);
|
|
1954
1902
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1955
1903
|
return e;
|
|
1956
|
-
},
|
|
1957
|
-
const e = re(
|
|
1904
|
+
}, Ai = () => {
|
|
1905
|
+
const e = re(Fn);
|
|
1958
1906
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1959
1907
|
return e;
|
|
1960
|
-
}, ze = (e, t, n, r) => t.kind === "panel" ?
|
|
1961
|
-
const { config: t } = D(), n =
|
|
1962
|
-
return /* @__PURE__ */
|
|
1963
|
-
},
|
|
1964
|
-
const t = e instanceof Element ? e.closest(
|
|
1908
|
+
}, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Ni = ({ children: e }) => {
|
|
1909
|
+
const { config: t } = D(), n = je(), r = st(), o = r.kind === "location" ? r.location.source : void 0, i = Fe(ze(t, n.navigation, o, n.currentPath));
|
|
1910
|
+
return /* @__PURE__ */ c(Ie, { value: o, children: /* @__PURE__ */ c(Fn, { value: i, children: e }) });
|
|
1911
|
+
}, Di = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Pi = (e) => {
|
|
1912
|
+
const t = e instanceof Element ? e.closest(Di) : null;
|
|
1965
1913
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1966
|
-
},
|
|
1914
|
+
}, He = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, $i = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: l, scope: u, children: m }) => {
|
|
1967
1915
|
const f = Fe(e);
|
|
1968
|
-
return /* @__PURE__ */
|
|
1969
|
-
if (
|
|
1916
|
+
return /* @__PURE__ */ c("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
|
|
1917
|
+
if (He(h)) {
|
|
1970
1918
|
if (h.preventDefault(), t === u.currentPath && n !== "") {
|
|
1971
1919
|
u.scrollWithin(n);
|
|
1972
1920
|
return;
|
|
1973
1921
|
}
|
|
1974
|
-
|
|
1922
|
+
l(t, n);
|
|
1975
1923
|
}
|
|
1976
1924
|
}, children: m });
|
|
1977
|
-
},
|
|
1978
|
-
const { config:
|
|
1979
|
-
return
|
|
1980
|
-
},
|
|
1925
|
+
}, Fi = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
|
|
1926
|
+
const { config: l } = D(), u = je(), m = re(Ie), f = ii(e), { navigation: d } = u, h = `${ze(l, d, m, t)}${f}`, v = n === !1 ? "false" : void 0;
|
|
1927
|
+
return d.kind === "page" ? /* @__PURE__ */ c(Po, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": v, children: i }) : /* @__PURE__ */ c($i, { to: h, docPath: t, fragment: f, exists: v, className: r, attributes: o, onDocumentLink: d.onDocumentLink, scope: u, children: i });
|
|
1928
|
+
}, qi = ({ className: e, attributes: t, children: n }) => {
|
|
1981
1929
|
const { labels: r } = D();
|
|
1982
1930
|
return (
|
|
1983
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ F("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
|
|
1984
1932
|
n,
|
|
1985
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ F("span", { className: "aqmx-sr-only", children: [
|
|
1986
1934
|
" (",
|
|
1987
1935
|
r.inertLink,
|
|
1988
1936
|
")"
|
|
1989
1937
|
] })
|
|
1990
1938
|
] })
|
|
1991
1939
|
);
|
|
1992
|
-
},
|
|
1993
|
-
const { config: i } = D(),
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
-
|
|
1940
|
+
}, _i = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1941
|
+
const { config: i } = D(), l = re(Ie), u = Fe(`${ze(i, r.navigation, l, r.currentPath)}${e}`);
|
|
1942
|
+
return /* @__PURE__ */ c("a", { ...n, href: u, className: t, onClick: (f) => {
|
|
1943
|
+
He(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1996
1944
|
}, children: o });
|
|
1997
|
-
},
|
|
1998
|
-
const o =
|
|
1999
|
-
return o.navigation.kind === "page" ? /* @__PURE__ */
|
|
2000
|
-
if (!
|
|
2001
|
-
const u =
|
|
2002
|
-
e === "#" ? o.followEmptyFragment(
|
|
2003
|
-
}, children: r }) : /* @__PURE__ */
|
|
2004
|
-
},
|
|
2005
|
-
const { config: e } = D(), t =
|
|
1945
|
+
}, Bi = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1946
|
+
const o = je();
|
|
1947
|
+
return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (l) => {
|
|
1948
|
+
if (!He(l)) return;
|
|
1949
|
+
const u = l.currentTarget;
|
|
1950
|
+
e === "#" ? o.followEmptyFragment(l.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, l.nativeEvent);
|
|
1951
|
+
}, children: r }) : /* @__PURE__ */ c(_i, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1952
|
+
}, Ii = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !lr(n) ? /* @__PURE__ */ c(qi, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(Fi, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(Bi, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), ji = () => {
|
|
1953
|
+
const { config: e } = D(), t = je(), n = re(Ie), r = qe();
|
|
2006
1954
|
return P(
|
|
2007
1955
|
(o, i) => {
|
|
2008
|
-
if (!
|
|
1956
|
+
if (!He(i)) return !0;
|
|
2009
1957
|
i.preventDefault();
|
|
2010
|
-
const
|
|
2011
|
-
return u.kind === "panel" ||
|
|
1958
|
+
const l = An(o.id), { navigation: u } = t;
|
|
1959
|
+
return u.kind === "panel" || ut(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(l), !0) : (r(`${ze(e, u, n, t.currentPath)}${l}`, "follow-link"), !0);
|
|
2012
1960
|
},
|
|
2013
1961
|
[e, t, n, r]
|
|
2014
1962
|
);
|
|
2015
|
-
},
|
|
2016
|
-
const e =
|
|
2017
|
-
return P((t) => `${e}${
|
|
1963
|
+
}, zi = () => {
|
|
1964
|
+
const e = Ai();
|
|
1965
|
+
return P((t) => `${e}${An(t.id)}`, [e]);
|
|
2018
1966
|
};
|
|
2019
|
-
function
|
|
1967
|
+
function Hi({
|
|
2020
1968
|
title: e,
|
|
2021
1969
|
titleId: t,
|
|
2022
1970
|
...n
|
|
2023
1971
|
}, r) {
|
|
2024
|
-
return /* @__PURE__ */
|
|
1972
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2025
1973
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2026
1974
|
viewBox: "0 0 20 20",
|
|
2027
1975
|
fill: "currentColor",
|
|
@@ -2029,19 +1977,19 @@ function _i({
|
|
|
2029
1977
|
"data-slot": "icon",
|
|
2030
1978
|
ref: r,
|
|
2031
1979
|
"aria-labelledby": t
|
|
2032
|
-
}, n), e ? /* @__PURE__ */
|
|
1980
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2033
1981
|
id: t
|
|
2034
|
-
}, e) : null, /* @__PURE__ */
|
|
1982
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2035
1983
|
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"
|
|
2036
1984
|
}));
|
|
2037
1985
|
}
|
|
2038
|
-
const
|
|
2039
|
-
function
|
|
1986
|
+
const Vi = /* @__PURE__ */ S.forwardRef(Hi);
|
|
1987
|
+
function Ui({
|
|
2040
1988
|
title: e,
|
|
2041
1989
|
titleId: t,
|
|
2042
1990
|
...n
|
|
2043
1991
|
}, r) {
|
|
2044
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2045
1993
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2046
1994
|
viewBox: "0 0 20 20",
|
|
2047
1995
|
fill: "currentColor",
|
|
@@ -2049,21 +1997,21 @@ function Bi({
|
|
|
2049
1997
|
"data-slot": "icon",
|
|
2050
1998
|
ref: r,
|
|
2051
1999
|
"aria-labelledby": t
|
|
2052
|
-
}, n), e ? /* @__PURE__ */
|
|
2000
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2053
2001
|
id: t
|
|
2054
|
-
}, e) : null, /* @__PURE__ */
|
|
2002
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2055
2003
|
fillRule: "evenodd",
|
|
2056
2004
|
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",
|
|
2057
2005
|
clipRule: "evenodd"
|
|
2058
2006
|
}));
|
|
2059
2007
|
}
|
|
2060
|
-
const
|
|
2061
|
-
function
|
|
2008
|
+
const Zi = /* @__PURE__ */ S.forwardRef(Ui);
|
|
2009
|
+
function Gi({
|
|
2062
2010
|
title: e,
|
|
2063
2011
|
titleId: t,
|
|
2064
2012
|
...n
|
|
2065
2013
|
}, r) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2014
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2067
2015
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2068
2016
|
viewBox: "0 0 20 20",
|
|
2069
2017
|
fill: "currentColor",
|
|
@@ -2071,59 +2019,67 @@ function ji({
|
|
|
2071
2019
|
"data-slot": "icon",
|
|
2072
2020
|
ref: r,
|
|
2073
2021
|
"aria-labelledby": t
|
|
2074
|
-
}, n), e ? /* @__PURE__ */
|
|
2022
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2075
2023
|
id: t
|
|
2076
|
-
}, e) : null, /* @__PURE__ */
|
|
2024
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2077
2025
|
fillRule: "evenodd",
|
|
2078
2026
|
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",
|
|
2079
2027
|
clipRule: "evenodd"
|
|
2080
2028
|
}));
|
|
2081
2029
|
}
|
|
2082
|
-
const
|
|
2083
|
-
},
|
|
2084
|
-
const { labels: t } = D(), n = ee(
|
|
2085
|
-
return n === null ? null : n ? /* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2030
|
+
const Ki = /* @__PURE__ */ S.forwardRef(Gi), Wi = Object.freeze({ className: "aqmx-document-stage" }), Yi = () => () => {
|
|
2031
|
+
}, Xi = () => navigator.pdfViewerEnabled !== !1, Ji = () => null, Qi = ({ document: e }) => {
|
|
2032
|
+
const { labels: t } = D(), n = ee(Yi, Xi, Ji);
|
|
2033
|
+
return n === null ? null : n ? /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
|
|
2034
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
|
|
2035
|
+
/* @__PURE__ */ F("div", { className: "aqmx-callout-actions", children: [
|
|
2036
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, target: "_blank", rel: "noopener noreferrer", "data-testid": "markdown-explorer-pdf-not-shown-open", children: t.openInNewTab }),
|
|
2037
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
|
|
2090
2038
|
] })
|
|
2091
2039
|
] });
|
|
2092
|
-
},
|
|
2040
|
+
}, el = (e) => {
|
|
2093
2041
|
switch (e) {
|
|
2094
2042
|
case "video":
|
|
2095
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ c(Zi, {});
|
|
2096
2044
|
case "audio":
|
|
2097
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ c(Ki, {});
|
|
2098
2046
|
case "pdf":
|
|
2099
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ c(Vi, {});
|
|
2100
2048
|
default: {
|
|
2101
2049
|
const t = e;
|
|
2102
2050
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
2103
2051
|
}
|
|
2104
2052
|
}
|
|
2105
|
-
},
|
|
2053
|
+
}, tl = ({ document: e }) => {
|
|
2106
2054
|
const { labels: t } = D();
|
|
2107
2055
|
switch (e.mediaType) {
|
|
2108
2056
|
case "video":
|
|
2109
2057
|
return (
|
|
2110
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ c("video", { className: "aqmx-document-video", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
|
|
2111
2059
|
);
|
|
2112
2060
|
case "audio":
|
|
2113
2061
|
return (
|
|
2114
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ c("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
|
|
2115
2063
|
);
|
|
2116
2064
|
case "pdf":
|
|
2117
|
-
return /* @__PURE__ */
|
|
2065
|
+
return /* @__PURE__ */ c(Qi, { document: e });
|
|
2118
2066
|
default: {
|
|
2119
2067
|
const n = e.mediaType;
|
|
2120
2068
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
2121
2069
|
}
|
|
2122
2070
|
}
|
|
2123
|
-
},
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
] }),
|
|
2071
|
+
}, nl = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
2072
|
+
/* @__PURE__ */ c(_e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: el(e.mediaType) }),
|
|
2073
|
+
/* @__PURE__ */ c(ve, { scrollerProps: Wi, children: /* @__PURE__ */ c(tl, { document: e }) })
|
|
2074
|
+
] }), rl = (e, t) => {
|
|
2075
|
+
const n = {};
|
|
2076
|
+
for (const r of Object.keys(Ae[t])) {
|
|
2077
|
+
const o = e[at(r)];
|
|
2078
|
+
o !== Ae[t][r].text && (n[`spreadsheet${r.charAt(0).toUpperCase()}${r.slice(1)}`] = o);
|
|
2079
|
+
}
|
|
2080
|
+
return n;
|
|
2081
|
+
}, ol = (e, t) => ({
|
|
2082
|
+
...rl(e, t),
|
|
2127
2083
|
loading: e.viewerLoading,
|
|
2128
2084
|
errorPrefix: e.viewerErrorPrefix,
|
|
2129
2085
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -2164,308 +2120,282 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2164
2120
|
mermaidPanRight: e.viewerMermaidPanRight,
|
|
2165
2121
|
mermaidDiagram: e.viewerMermaidDiagram,
|
|
2166
2122
|
mermaidRetry: e.viewerMermaidRetry,
|
|
2167
|
-
spreadsheetTable: e.viewerSpreadsheetTable,
|
|
2168
|
-
spreadsheetZoomIn: e.viewerSpreadsheetZoomIn,
|
|
2169
|
-
spreadsheetZoomOut: e.viewerSpreadsheetZoomOut,
|
|
2170
|
-
spreadsheetResetZoom: e.viewerSpreadsheetResetZoom,
|
|
2171
|
-
spreadsheetHighlight: e.viewerSpreadsheetHighlight,
|
|
2172
|
-
spreadsheetCopyAll: e.viewerSpreadsheetCopyAll,
|
|
2173
|
-
spreadsheetSaveTsv: e.viewerSpreadsheetSaveTsv,
|
|
2174
|
-
spreadsheetSaveMenu: e.viewerSpreadsheetSaveMenu,
|
|
2175
|
-
spreadsheetSaveTsvWithBom: e.viewerSpreadsheetSaveTsvWithBom,
|
|
2176
|
-
spreadsheetFullscreen: e.viewerSpreadsheetFullscreen,
|
|
2177
|
-
spreadsheetExitFullscreen: e.viewerSpreadsheetExitFullscreen,
|
|
2178
|
-
spreadsheetFullscreenDialog: e.viewerSpreadsheetFullscreenDialog,
|
|
2179
|
-
spreadsheetSize: e.viewerSpreadsheetSize,
|
|
2180
|
-
spreadsheetFileName: e.viewerSpreadsheetFileName,
|
|
2181
|
-
spreadsheetCopied: e.viewerSpreadsheetCopied,
|
|
2182
|
-
spreadsheetCopyFailed: e.viewerSpreadsheetCopyFailed,
|
|
2183
|
-
spreadsheetCellAnnouncement: e.viewerSpreadsheetCellAnnouncement,
|
|
2184
|
-
spreadsheetEmptyCell: e.viewerSpreadsheetEmptyCell,
|
|
2185
|
-
spreadsheetSelectionAnnouncement: e.viewerSpreadsheetSelectionAnnouncement,
|
|
2186
|
-
spreadsheetReadOnly: e.viewerSpreadsheetReadOnly,
|
|
2187
|
-
spreadsheetFormatRefused: e.viewerSpreadsheetFormatRefused,
|
|
2188
|
-
spreadsheetFenceRefused: e.viewerSpreadsheetFenceRefused,
|
|
2189
|
-
spreadsheetEditConflict: e.viewerSpreadsheetEditConflict,
|
|
2190
|
-
spreadsheetOptionsError: e.viewerSpreadsheetOptionsError,
|
|
2191
|
-
spreadsheetLoadFailed: e.viewerSpreadsheetLoadFailed,
|
|
2192
|
-
spreadsheetRetry: e.viewerSpreadsheetRetry,
|
|
2193
2123
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
2194
2124
|
embeddedPost: e.viewerEmbeddedPost,
|
|
2195
2125
|
embeddedFrame: e.viewerEmbeddedFrame
|
|
2196
|
-
}),
|
|
2126
|
+
}), qn = (e, t, n) => {
|
|
2197
2127
|
if (t !== void 0) return t;
|
|
2198
2128
|
if (n !== void 0) return n;
|
|
2199
2129
|
const [r] = e.documentStyles;
|
|
2200
2130
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
2201
2131
|
return r.name;
|
|
2202
|
-
},
|
|
2132
|
+
}, _n = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Rr, il = Object.freeze({ kind: "empty" }), ft = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), ll = (e, t, n) => {
|
|
2203
2133
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
2204
2134
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
2205
|
-
return
|
|
2206
|
-
},
|
|
2135
|
+
return ye(e, { ...t, overrides: r });
|
|
2136
|
+
}, Se = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: i, intent: l, children: u }) => {
|
|
2207
2137
|
const m = re(he);
|
|
2208
2138
|
return (
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
r ? /* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ F("section", { ref: i, 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": m, className: "aqmx-document", ...l, children: [
|
|
2140
|
+
r ? /* @__PURE__ */ c("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
2211
2141
|
u
|
|
2212
2142
|
] })
|
|
2213
2143
|
);
|
|
2214
|
-
},
|
|
2215
|
-
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null,
|
|
2144
|
+
}, al = ({ absence: e, announces: t, announceFailure: n }) => {
|
|
2145
|
+
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, l = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
|
|
2216
2146
|
switch (te(() => {
|
|
2217
2147
|
t && i !== null && o.announce(r.folderReadmeMissing(se(i)));
|
|
2218
2148
|
}, [t, i, o, r]), te(() => {
|
|
2219
|
-
|
|
2220
|
-
}, [
|
|
2149
|
+
l !== null && u !== null && n(r.documentFailed(se(l), ae(r, u.reason)));
|
|
2150
|
+
}, [l, u, n, r]), e.kind) {
|
|
2221
2151
|
case "empty":
|
|
2222
|
-
return /* @__PURE__ */
|
|
2152
|
+
return /* @__PURE__ */ c(Se, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
|
|
2223
2153
|
case "loading":
|
|
2224
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ c(mt, { label: r.documentRegion });
|
|
2225
2155
|
case "no-readme":
|
|
2226
|
-
return /* @__PURE__ */
|
|
2156
|
+
return /* @__PURE__ */ c(Se, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
|
|
2227
2157
|
case "failure":
|
|
2228
|
-
return /* @__PURE__ */
|
|
2158
|
+
return /* @__PURE__ */ c(Se, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(ve, { scrollerProps: ht, children: /* @__PURE__ */ c(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
|
|
2229
2159
|
}
|
|
2230
|
-
},
|
|
2160
|
+
}, mt = ({ label: e }) => {
|
|
2231
2161
|
const { labels: t } = D();
|
|
2232
|
-
return /* @__PURE__ */
|
|
2233
|
-
/* @__PURE__ */
|
|
2234
|
-
/* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ F(Se, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
2163
|
+
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: ft.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
|
|
2164
|
+
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
2235
2165
|
] });
|
|
2236
|
-
},
|
|
2237
|
-
const { reportMathDiagnostics: o, edits: i } = D(),
|
|
2238
|
-
|
|
2166
|
+
}, Gt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), sl = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
2167
|
+
const { reportMathDiagnostics: o, edits: i } = D(), l = Z(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = ji(), m = zi(), f = Z(() => o === void 0 ? void 0 : (a) => o(e, a), [o, e]), d = _(null), { editable: h, doubleClick: v, region: E, paneScroll: k, stale: R } = r;
|
|
2168
|
+
z(() => {
|
|
2239
2169
|
if (h)
|
|
2240
2170
|
return i.bindView(e, {
|
|
2241
2171
|
anchor: () => {
|
|
2242
|
-
const
|
|
2243
|
-
return
|
|
2172
|
+
const a = d.current, s = E(), w = a === null ? null : a.querySelector(Be);
|
|
2173
|
+
return a === null || s === null || w === null ? null : Oo(a, k.scrollerOf(s, w));
|
|
2244
2174
|
}
|
|
2245
2175
|
});
|
|
2246
2176
|
}, [i, e, h, E, k]);
|
|
2247
|
-
const T = (
|
|
2248
|
-
const s =
|
|
2249
|
-
!
|
|
2250
|
-
},
|
|
2251
|
-
|
|
2252
|
-
|
|
2177
|
+
const T = (a) => {
|
|
2178
|
+
const s = d.current, { target: w } = a;
|
|
2179
|
+
!v || s === null || !(w instanceof Element) || !To(w) || (a.stopPropagation(), i.start(e, Ro(w, s, s.ownerDocument.getSelection())));
|
|
2180
|
+
}, L = _(null), A = _(R);
|
|
2181
|
+
z(() => {
|
|
2182
|
+
A.current = R;
|
|
2253
2183
|
});
|
|
2254
|
-
const b =
|
|
2255
|
-
const s =
|
|
2256
|
-
if (
|
|
2257
|
-
const
|
|
2258
|
-
return
|
|
2259
|
-
}),
|
|
2184
|
+
const b = le((a) => {
|
|
2185
|
+
const s = d.current, w = E(), O = s === null ? null : No(s, a.line);
|
|
2186
|
+
if (w === null || O === null) return !1;
|
|
2187
|
+
const C = k.scrollerOf(w, O);
|
|
2188
|
+
return C.scrollTop += Do(O, a.line) - a.clientTop, !0;
|
|
2189
|
+
}), g = le((a) => {
|
|
2260
2190
|
const s = E();
|
|
2261
2191
|
if (s === null) return;
|
|
2262
|
-
const
|
|
2263
|
-
for (const
|
|
2264
|
-
|
|
2265
|
-
}, O = () =>
|
|
2266
|
-
for (const
|
|
2267
|
-
|
|
2192
|
+
const w = () => {
|
|
2193
|
+
for (const C of Gt) s.removeEventListener(C, O, !0);
|
|
2194
|
+
L.current?.release === w && (L.current = null);
|
|
2195
|
+
}, O = () => w();
|
|
2196
|
+
for (const C of Gt) s.addEventListener(C, O, { capture: !0, passive: !0 });
|
|
2197
|
+
L.current = { point: a, release: w };
|
|
2268
2198
|
});
|
|
2269
|
-
return
|
|
2270
|
-
const
|
|
2271
|
-
if (
|
|
2199
|
+
return z(() => {
|
|
2200
|
+
const a = i.takeReturn(e);
|
|
2201
|
+
if (a !== null)
|
|
2272
2202
|
return queueMicrotask(() => {
|
|
2273
|
-
b(
|
|
2274
|
-
}), () =>
|
|
2275
|
-
}, [i, e]),
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2203
|
+
b(a) && A.current && g(a);
|
|
2204
|
+
}), () => L.current?.release();
|
|
2205
|
+
}, [i, e]), z(() => {
|
|
2206
|
+
const a = L.current;
|
|
2207
|
+
a === null || R || (a.release(), b(a.point));
|
|
2278
2208
|
}, [t, R]),
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
},
|
|
2209
|
+
/* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(dn, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: l, content: null }) });
|
|
2210
|
+
}, Bn = ({ document: e, viewer: t }) => {
|
|
2281
2211
|
const { labels: n } = D();
|
|
2282
|
-
return /* @__PURE__ */ $
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
e.truncated ? /* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2212
|
+
return /* @__PURE__ */ F($e, { children: [
|
|
2213
|
+
/* @__PURE__ */ c(_e, { name: e.name, openUrl: ar(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(vo, {}), children: e.truncated ? null : /* @__PURE__ */ c(Wo, { text: e.text }) }),
|
|
2214
|
+
e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
2215
|
+
/* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(dn, { ...t, parseResult: null, content: e.text }) })
|
|
2286
2216
|
] });
|
|
2287
|
-
},
|
|
2288
|
-
const { data: r, documents: o, announcer: i, labels:
|
|
2289
|
-
E(T), T.kind === "failure" && i.announce(
|
|
2217
|
+
}, cl = ({ path: e, name: t, viewer: n }) => {
|
|
2218
|
+
const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] = j(0), h = Z(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [v, E] = j(null), k = le((T) => {
|
|
2219
|
+
E(T), T.kind === "failure" && i.announce(l.documentFailed(t, ae(l, T.failure.reason)));
|
|
2290
2220
|
});
|
|
2291
2221
|
te(() => {
|
|
2292
2222
|
const T = new AbortController();
|
|
2293
|
-
return r.text(h.path, T.signal).then((
|
|
2294
|
-
"kind" in
|
|
2223
|
+
return r.text(h.path, T.signal).then((L) => {
|
|
2224
|
+
"kind" in L && k(L);
|
|
2295
2225
|
}), () => T.abort();
|
|
2296
2226
|
}, [r, h]);
|
|
2297
|
-
const R = P(() =>
|
|
2298
|
-
return
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
] }) :
|
|
2302
|
-
},
|
|
2303
|
-
|
|
2227
|
+
const R = P(() => d((T) => T + 1), []);
|
|
2228
|
+
return v === null ? /* @__PURE__ */ F($e, { children: [
|
|
2229
|
+
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: ft.map((T) => /* @__PURE__ */ c("span", {}, T)) }),
|
|
2230
|
+
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: l.markupLoading })
|
|
2231
|
+
] }) : v.kind === "failure" ? /* @__PURE__ */ c(ve, { scrollerProps: ht, children: /* @__PURE__ */ c(me, { failure: v.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(Bn, { document: v, viewer: n });
|
|
2232
|
+
}, ht = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), dl = Object.freeze({ reason: "failed" }), ul = (e) => /* @__PURE__ */ c(
|
|
2233
|
+
bo,
|
|
2304
2234
|
{
|
|
2305
|
-
fallback: (t) => /* @__PURE__ */
|
|
2306
|
-
children: /* @__PURE__ */
|
|
2235
|
+
fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(me, { failure: dl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
2236
|
+
children: /* @__PURE__ */ c(
|
|
2307
2237
|
ke,
|
|
2308
2238
|
{
|
|
2309
|
-
fallback: /* @__PURE__ */
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2239
|
+
fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: ft.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
|
|
2240
|
+
children: /* @__PURE__ */ c(go, { ...e })
|
|
2311
2241
|
}
|
|
2312
2242
|
)
|
|
2313
2243
|
}
|
|
2314
|
-
),
|
|
2244
|
+
), fl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
|
|
2315
2245
|
switch (t.kind) {
|
|
2316
2246
|
case "markdown": {
|
|
2317
|
-
const { session:
|
|
2318
|
-
if (n === "edit" &&
|
|
2319
|
-
if (n === "markup") return /* @__PURE__ */
|
|
2247
|
+
const { session: l, layout: u, region: m, paneScroll: f, stale: d } = i;
|
|
2248
|
+
if (n === "edit" && l !== void 0) return /* @__PURE__ */ c(ul, { path: e, name: t.name, session: l, layout: u, viewer: r, region: m, paneScroll: f });
|
|
2249
|
+
if (n === "markup") return /* @__PURE__ */ c(cl, { path: e, name: t.name, viewer: r });
|
|
2320
2250
|
const h = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
|
|
2321
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ c(sl, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && u === "fill", region: m, paneScroll: f, stale: d } });
|
|
2322
2252
|
}
|
|
2323
2253
|
case "text":
|
|
2324
|
-
return /* @__PURE__ */
|
|
2254
|
+
return /* @__PURE__ */ c(Bn, { document: t, viewer: r });
|
|
2325
2255
|
case "image":
|
|
2326
|
-
return /* @__PURE__ */
|
|
2256
|
+
return /* @__PURE__ */ c(Li, { document: t });
|
|
2327
2257
|
case "media":
|
|
2328
|
-
return /* @__PURE__ */
|
|
2258
|
+
return /* @__PURE__ */ c(nl, { document: t });
|
|
2329
2259
|
case "file":
|
|
2330
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ c(oi, { document: t });
|
|
2331
2261
|
case "failure":
|
|
2332
|
-
return /* @__PURE__ */
|
|
2262
|
+
return /* @__PURE__ */ c(ve, { scrollerProps: ht, children: /* @__PURE__ */ c(me, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2333
2263
|
default: {
|
|
2334
|
-
const
|
|
2335
|
-
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(
|
|
2264
|
+
const l = t;
|
|
2265
|
+
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
|
|
2336
2266
|
}
|
|
2337
2267
|
}
|
|
2338
|
-
},
|
|
2339
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2268
|
+
}, ml = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', hl = (e, t, n) => {
|
|
2269
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Dn(e, n), r === void 0 ? null : Nn(e, r.id), e.querySelector(Be), e.querySelector(ml)];
|
|
2340
2270
|
for (const i of o)
|
|
2341
|
-
if (i instanceof HTMLElement &&
|
|
2271
|
+
if (i instanceof HTMLElement && On(i)) return i;
|
|
2342
2272
|
return null;
|
|
2343
|
-
},
|
|
2273
|
+
}, Kt = (e, t, n) => {
|
|
2344
2274
|
const { activeElement: r, body: o } = e.ownerDocument, i = r === null || r === o;
|
|
2345
|
-
t instanceof HTMLElement && n && (i || e.contains(r)) &&
|
|
2346
|
-
},
|
|
2275
|
+
t instanceof HTMLElement && n && (i || e.contains(r)) && On(t);
|
|
2276
|
+
}, pl = (e) => {
|
|
2347
2277
|
const t = _(!1);
|
|
2348
|
-
return
|
|
2278
|
+
return z(() => {
|
|
2349
2279
|
const n = e.current;
|
|
2350
2280
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
2351
2281
|
const r = n.ownerDocument, o = r.defaultView;
|
|
2352
2282
|
if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
|
|
2353
|
-
let i = !1,
|
|
2354
|
-
const u = (
|
|
2355
|
-
i = !(
|
|
2283
|
+
let i = !1, l;
|
|
2284
|
+
const u = (v) => {
|
|
2285
|
+
i = !(v.target instanceof Node && n.contains(v.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(l), l = setTimeout(() => {
|
|
2356
2286
|
i = !1;
|
|
2357
2287
|
}, 0);
|
|
2358
|
-
}, m = (
|
|
2359
|
-
t.current =
|
|
2360
|
-
}, f = (
|
|
2361
|
-
|
|
2362
|
-
},
|
|
2363
|
-
const { activeElement:
|
|
2364
|
-
|
|
2288
|
+
}, m = (v) => {
|
|
2289
|
+
t.current = v.target instanceof Node && n.contains(v.target);
|
|
2290
|
+
}, f = (v) => {
|
|
2291
|
+
v.relatedTarget === null && i && (t.current = !1);
|
|
2292
|
+
}, d = () => {
|
|
2293
|
+
const { activeElement: v, body: E } = r;
|
|
2294
|
+
v !== null && v !== E && (t.current = n.contains(v));
|
|
2365
2295
|
}, h = () => {
|
|
2366
2296
|
i && !n.contains(r.activeElement) && (t.current = !1);
|
|
2367
2297
|
};
|
|
2368
|
-
return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur",
|
|
2369
|
-
clearTimeout(
|
|
2298
|
+
return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur", d), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
|
|
2299
|
+
clearTimeout(l), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", d), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
|
|
2370
2300
|
};
|
|
2371
2301
|
}, [e]), t;
|
|
2372
|
-
},
|
|
2373
|
-
const { labels: E, announcer: k, documents: R } = D(), { document: T } = t,
|
|
2374
|
-
(
|
|
2375
|
-
const
|
|
2376
|
-
|
|
2302
|
+
}, vl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown: v }) => {
|
|
2303
|
+
const { labels: E, announcer: k, documents: R } = D(), { document: T } = t, L = _(null), A = _(null), b = _(null), g = _(0), a = pl(L), s = _({ path: e, document: T }), w = _(null), O = P(
|
|
2304
|
+
(U) => {
|
|
2305
|
+
const Y = L.current, Q = It(Y, U, f);
|
|
2306
|
+
Y !== null && Q !== null && Kt(Y, Q, a.current);
|
|
2377
2307
|
},
|
|
2378
|
-
[f,
|
|
2379
|
-
),
|
|
2380
|
-
(
|
|
2381
|
-
const Q =
|
|
2308
|
+
[f, a]
|
|
2309
|
+
), C = P(
|
|
2310
|
+
(U, Y) => {
|
|
2311
|
+
const Q = g.current;
|
|
2382
2312
|
setTimeout(() => {
|
|
2383
|
-
!
|
|
2313
|
+
!Y.defaultPrevented && g.current === Q && O(U);
|
|
2384
2314
|
}, 0);
|
|
2385
2315
|
},
|
|
2386
2316
|
[O]
|
|
2387
2317
|
), N = P(
|
|
2388
|
-
(
|
|
2318
|
+
(U) => {
|
|
2389
2319
|
setTimeout(() => {
|
|
2390
|
-
|
|
2320
|
+
U.defaultPrevented || O("#");
|
|
2391
2321
|
}, 0);
|
|
2392
2322
|
},
|
|
2393
2323
|
[O]
|
|
2394
|
-
), q =
|
|
2395
|
-
const Q =
|
|
2396
|
-
if (Q !== null && Q.path ===
|
|
2397
|
-
|
|
2398
|
-
const oe =
|
|
2324
|
+
), q = Z(() => ({ navigation: u, currentPath: e, scrollWithin: O, followSameUrlJump: C, followEmptyFragment: N }), [u, e, O, C, N]), K = P(() => R.retry(e), [R, e]), G = $o(R, Pi), B = kn(e), J = B !== void 0 ? "edit" : n ? "markup" : "rendered", H = T.kind === "markdown" ? J : void 0, ne = P(() => L.current, []), p = Z(() => ({ session: B, layout: i, region: ne, paneScroll: f, stale: r }), [B, i, ne, f, r]), y = H === "edit" ? !1 : r, x = re(he), M = H === "edit" && i === "fill" ? "fill" : x, $ = le((U, Y) => {
|
|
2325
|
+
const Q = A.current;
|
|
2326
|
+
if (Q !== null && Q.path === U && Q.snapshot === Y) return;
|
|
2327
|
+
A.current = { path: U, snapshot: Y };
|
|
2328
|
+
const oe = Y.document;
|
|
2399
2329
|
if (oe.kind === "failure") {
|
|
2400
|
-
R.noteFailureShown(
|
|
2330
|
+
R.noteFailureShown(Y) && h(E.documentFailed(se(U), ae(E, oe.failure.reason)));
|
|
2401
2331
|
return;
|
|
2402
2332
|
}
|
|
2403
|
-
|
|
2333
|
+
v?.(U, oe), d && (Q === null || Q.path !== U || Q.snapshot.document.kind === "failure") && k.announce(E.documentShown(oe.name));
|
|
2404
2334
|
});
|
|
2405
2335
|
te(() => {
|
|
2406
|
-
|
|
2336
|
+
$(e, t);
|
|
2407
2337
|
}, [e, t]);
|
|
2408
|
-
const
|
|
2338
|
+
const I = le(() => {
|
|
2409
2339
|
m.kind === "panel" && m.consume();
|
|
2410
|
-
}),
|
|
2411
|
-
const
|
|
2412
|
-
if (
|
|
2413
|
-
const { activeElement: Q, body: oe } =
|
|
2414
|
-
return Q !== null && Q !== oe ? null :
|
|
2415
|
-
}), V =
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
}), ie =
|
|
2340
|
+
}), W = le((U) => {
|
|
2341
|
+
const Y = L.current;
|
|
2342
|
+
if (Y === null || !a.current) return null;
|
|
2343
|
+
const { activeElement: Q, body: oe } = Y.ownerDocument;
|
|
2344
|
+
return Q !== null && Q !== oe ? null : hl(Y, T, U);
|
|
2345
|
+
}), V = le((U) => {
|
|
2346
|
+
const Y = L.current;
|
|
2347
|
+
Y !== null && Kt(Y, U, a.current);
|
|
2348
|
+
}), ie = le((U) => f.reveal(U)), vt = le((U) => It(L.current, U, f));
|
|
2419
2349
|
return te(() => {
|
|
2420
2350
|
if (r) return;
|
|
2421
|
-
const
|
|
2351
|
+
const U = s.current.path !== e, Y = U || s.current.document !== T;
|
|
2422
2352
|
s.current = { path: e, document: T };
|
|
2423
|
-
const Q =
|
|
2424
|
-
|
|
2353
|
+
const Q = w.current !== e;
|
|
2354
|
+
w.current = e;
|
|
2425
2355
|
let oe = null;
|
|
2426
|
-
m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation,
|
|
2427
|
-
const
|
|
2428
|
-
const
|
|
2429
|
-
if (!
|
|
2430
|
-
|
|
2356
|
+
m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation, g.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, I());
|
|
2357
|
+
const wt = () => {
|
|
2358
|
+
const Ve = oe === null ? null : vt(oe);
|
|
2359
|
+
if (!Y) {
|
|
2360
|
+
Ve !== null && V(Ve);
|
|
2431
2361
|
return;
|
|
2432
2362
|
}
|
|
2433
|
-
const
|
|
2434
|
-
|
|
2363
|
+
const gt = W(m.fragment);
|
|
2364
|
+
U && Ve === null && gt !== null && ie(gt);
|
|
2435
2365
|
};
|
|
2436
|
-
Q ? queueMicrotask(
|
|
2437
|
-
}, [m, e, T, r]), /* @__PURE__ */
|
|
2438
|
-
},
|
|
2366
|
+
Q ? queueMicrotask(wt) : wt();
|
|
2367
|
+
}, [m, e, T, r]), /* @__PURE__ */ c(he, { value: M, children: /* @__PURE__ */ c(Se, { kind: T.kind, view: H, label: l(e, T), stale: y, busy: y, frameRef: L, intent: G, children: /* @__PURE__ */ c($n, { value: q, children: /* @__PURE__ */ c(Ni, { children: /* @__PURE__ */ c(fl, { path: e, document: T, view: J, viewer: o, onRetry: K, editing: p }, e) }) }) }) });
|
|
2368
|
+
}, pt = Object.freeze({ kind: "skeleton" }), wl = (e, t, n, r, o) => {
|
|
2439
2369
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2440
2370
|
const i = ue(t);
|
|
2441
2371
|
if (i !== null) return { kind: "document", path: e, snapshot: i, stale: !0 };
|
|
2442
2372
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
2443
|
-
const
|
|
2444
|
-
return n === null ||
|
|
2445
|
-
},
|
|
2446
|
-
const o = t.kind === "streaming" ?
|
|
2447
|
-
return o.kind !== "document" ? /* @__PURE__ */
|
|
2448
|
-
},
|
|
2449
|
-
const { config:
|
|
2450
|
-
|
|
2373
|
+
const l = n === null || n === e ? null : ue(r);
|
|
2374
|
+
return n === null || l === null ? pt : { kind: "document", path: n, snapshot: l, stale: !0 };
|
|
2375
|
+
}, gl = (e, t) => t.status === "deferred" ? pt : { kind: "document", path: e, snapshot: t, stale: !1 }, bl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2376
|
+
const o = t.kind === "streaming" ? gl(t.path, re(t.promise)) : t;
|
|
2377
|
+
return o.kind !== "document" ? /* @__PURE__ */ c(mt, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(vl, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2378
|
+
}, In = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: l, announces: u, announceFailure: m, onDocumentShown: f }) => {
|
|
2379
|
+
const { config: d, labels: h, locale: v, theme: E, documents: k } = D(), R = kr(), T = _(!1);
|
|
2380
|
+
z(() => {
|
|
2451
2381
|
T.current = !0;
|
|
2452
2382
|
}, []);
|
|
2453
|
-
const [
|
|
2454
|
-
|
|
2455
|
-
const
|
|
2456
|
-
N !==
|
|
2457
|
-
const q =
|
|
2458
|
-
q && n !== b &&
|
|
2459
|
-
const
|
|
2383
|
+
const [L, A] = j(null), [b, g] = j(n), a = P(() => e === null ? void 0 : k.peek(e), [k, e]), s = ee(k.subscribe, a, a), w = P(() => L === null ? void 0 : k.peek(L), [k, L]), O = ee(k.subscribe, w, w);
|
|
2384
|
+
z(() => e === null ? void 0 : k.open(e), [k, e]), z(() => L === null ? void 0 : k.retain(L), [k, L]);
|
|
2385
|
+
const C = e === null ? pt : wl(e, s, L, O, !T.current), N = e === null ? null : C.kind === "document" && !C.stale ? C.path : L;
|
|
2386
|
+
N !== L && A(N);
|
|
2387
|
+
const q = C.kind !== "document" || C.path === e;
|
|
2388
|
+
q && n !== b && g(n);
|
|
2389
|
+
const K = Z(() => ol(h, v), [h, v]), G = Z(() => [...d.iframeHosts], [d]), B = o.kind === "panel", J = Z(
|
|
2460
2390
|
() => ({
|
|
2461
|
-
labels:
|
|
2462
|
-
spreadsheetLocale:
|
|
2391
|
+
labels: K,
|
|
2392
|
+
spreadsheetLocale: v,
|
|
2463
2393
|
emptyMessage: h.documentEmpty,
|
|
2464
2394
|
theme: E,
|
|
2465
|
-
availableStyles:
|
|
2395
|
+
availableStyles: d.documentStyles,
|
|
2466
2396
|
iFrameAllowedDomains: G,
|
|
2467
|
-
embeds:
|
|
2468
|
-
linkComponent:
|
|
2397
|
+
embeds: d.embeds,
|
|
2398
|
+
linkComponent: Ii,
|
|
2469
2399
|
toolbar: R,
|
|
2470
2400
|
style: r.style,
|
|
2471
2401
|
onStyleChange: r.onStyleChange,
|
|
@@ -2477,51 +2407,51 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2477
2407
|
padding: r.padding,
|
|
2478
2408
|
width: r.width === void 0 ? void 0 : `min(${r.width}, 100%)`,
|
|
2479
2409
|
maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
|
|
2480
|
-
renderScrollBar:
|
|
2410
|
+
renderScrollBar: B ? void 0 : Mn
|
|
2481
2411
|
}),
|
|
2482
|
-
[
|
|
2483
|
-
), H = P((p,
|
|
2484
|
-
return e === null ? /* @__PURE__ */
|
|
2485
|
-
|
|
2412
|
+
[K, v, h.documentEmpty, E, d.documentStyles, G, d.embeds, R, r, B]
|
|
2413
|
+
), H = P((p, y) => B ? y === null || y.kind === "failure" ? se(p) : y.name : h.documentRegion, [B, h.documentRegion]), ne = B ? "content" : "fill";
|
|
2414
|
+
return e === null ? /* @__PURE__ */ c(he, { value: ne, children: /* @__PURE__ */ c(al, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ c(he, { value: ne, children: /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c(mt, { label: H(e, null) }), children: /* @__PURE__ */ c(
|
|
2415
|
+
bl,
|
|
2486
2416
|
{
|
|
2487
2417
|
requestedPath: e,
|
|
2488
|
-
content:
|
|
2418
|
+
content: C,
|
|
2489
2419
|
markup: q ? n : b,
|
|
2490
2420
|
viewer: J,
|
|
2491
2421
|
editLayout: r.editLayout,
|
|
2492
2422
|
regionLabel: H,
|
|
2493
2423
|
navigation: o,
|
|
2494
2424
|
fragment: i,
|
|
2495
|
-
paneScroll:
|
|
2425
|
+
paneScroll: l,
|
|
2496
2426
|
announces: u,
|
|
2497
2427
|
announceFailure: m,
|
|
2498
2428
|
onDocumentShown: f
|
|
2499
2429
|
}
|
|
2500
2430
|
) }) });
|
|
2501
|
-
},
|
|
2502
|
-
const { config: i, viewSettings:
|
|
2503
|
-
(
|
|
2504
|
-
if (
|
|
2505
|
-
const N =
|
|
2506
|
-
N !== null &&
|
|
2507
|
-
},
|
|
2508
|
-
[i, c, g]
|
|
2509
|
-
), A = P(
|
|
2510
|
-
(M) => {
|
|
2511
|
-
a.update({ style: M }), T("style");
|
|
2431
|
+
}, El = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2432
|
+
const { config: i, viewSettings: l, announcer: u } = D(), m = Ne((C) => C.style), f = Ne((C) => C.align), d = qe(), h = ln(), v = st(), { view: E, overrides: k, embed: R } = r, T = P(
|
|
2433
|
+
(C) => {
|
|
2434
|
+
if (v.kind !== "location") return;
|
|
2435
|
+
const N = ll(i, v.location, C);
|
|
2436
|
+
N !== null && d(N, "browse");
|
|
2512
2437
|
},
|
|
2513
|
-
[
|
|
2438
|
+
[i, d, v]
|
|
2514
2439
|
), L = P(
|
|
2515
|
-
(
|
|
2516
|
-
|
|
2440
|
+
(C) => {
|
|
2441
|
+
l.update({ style: C }), T("style");
|
|
2442
|
+
},
|
|
2443
|
+
[l, T]
|
|
2444
|
+
), A = P(
|
|
2445
|
+
(C) => {
|
|
2446
|
+
l.update({ align: C }), T("align");
|
|
2517
2447
|
},
|
|
2518
|
-
[
|
|
2519
|
-
), b =
|
|
2448
|
+
[l, T]
|
|
2449
|
+
), b = qn(i, k.style, m), g = _n(k.align, f), a = Z(
|
|
2520
2450
|
() => ({
|
|
2521
2451
|
style: b,
|
|
2522
|
-
onStyleChange:
|
|
2523
|
-
align:
|
|
2524
|
-
onAlignChange:
|
|
2452
|
+
onStyleChange: L,
|
|
2453
|
+
align: g,
|
|
2454
|
+
onAlignChange: A,
|
|
2525
2455
|
showToc: R.showToc !== !1,
|
|
2526
2456
|
showStyle: R.showStyle !== !1,
|
|
2527
2457
|
showAlign: R.showAlign !== !1,
|
|
@@ -2530,16 +2460,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2530
2460
|
maxWidth: R.maxWidth,
|
|
2531
2461
|
editLayout: "fill"
|
|
2532
2462
|
}),
|
|
2533
|
-
[b,
|
|
2534
|
-
), s =
|
|
2535
|
-
return /* @__PURE__ */
|
|
2536
|
-
},
|
|
2537
|
-
const { config: i, viewSettings:
|
|
2463
|
+
[b, L, g, A, R]
|
|
2464
|
+
), s = Z(() => ({ kind: "page", view: E, overrides: k, embed: R }), [E, k, R]), w = Z(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), O = P((C) => u.announce(C), [u]);
|
|
2465
|
+
return /* @__PURE__ */ c(In, { path: e, absence: t, markup: n, display: a, navigation: s, fragment: w, paneScroll: ui, announces: !0, announceFailure: O, onDocumentShown: o });
|
|
2466
|
+
}, yl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2467
|
+
const { config: i, viewSettings: l } = D(), u = Ne((s) => s.style), m = Ne((s) => s.align), [f, d] = j(() => qn(i, void 0, u)), h = _n(void 0, m), v = P((s) => l.update({ align: s }), [l]), { maximized: E, onDocumentLink: k, pendingHash: R, onHashConsumed: T, announceFailure: L, paneScroll: A } = r, b = Z(
|
|
2538
2468
|
() => ({
|
|
2539
2469
|
style: f,
|
|
2540
|
-
onStyleChange:
|
|
2470
|
+
onStyleChange: d,
|
|
2541
2471
|
align: h,
|
|
2542
|
-
onAlignChange:
|
|
2472
|
+
onAlignChange: v,
|
|
2543
2473
|
showToc: E,
|
|
2544
2474
|
showStyle: E,
|
|
2545
2475
|
showAlign: E,
|
|
@@ -2548,16 +2478,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2548
2478
|
maxWidth: void 0,
|
|
2549
2479
|
editLayout: E ? "fill" : "content"
|
|
2550
2480
|
}),
|
|
2551
|
-
[f, h,
|
|
2552
|
-
),
|
|
2553
|
-
return /* @__PURE__ */
|
|
2554
|
-
},
|
|
2555
|
-
function
|
|
2481
|
+
[f, h, v, E]
|
|
2482
|
+
), g = Z(() => ({ kind: "panel", onDocumentLink: k }), [k]), a = Z(() => ({ kind: "panel", fragment: R, consume: T }), [R, T]);
|
|
2483
|
+
return /* @__PURE__ */ c(In, { path: e, absence: t, markup: n, display: b, navigation: g, fragment: a, paneScroll: A, announces: !1, announceFailure: L, onDocumentShown: o });
|
|
2484
|
+
}, Sl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(El, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(yl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
|
|
2485
|
+
function xl({
|
|
2556
2486
|
title: e,
|
|
2557
2487
|
titleId: t,
|
|
2558
2488
|
...n
|
|
2559
2489
|
}, r) {
|
|
2560
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2561
2491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2562
2492
|
viewBox: "0 0 24 24",
|
|
2563
2493
|
fill: "currentColor",
|
|
@@ -2565,21 +2495,21 @@ function wa({
|
|
|
2565
2495
|
"data-slot": "icon",
|
|
2566
2496
|
ref: r,
|
|
2567
2497
|
"aria-labelledby": t
|
|
2568
|
-
}, n), e ? /* @__PURE__ */
|
|
2498
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2569
2499
|
id: t
|
|
2570
|
-
}, e) : null, /* @__PURE__ */
|
|
2500
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2571
2501
|
fillRule: "evenodd",
|
|
2572
2502
|
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",
|
|
2573
2503
|
clipRule: "evenodd"
|
|
2574
2504
|
}));
|
|
2575
2505
|
}
|
|
2576
|
-
const
|
|
2577
|
-
function
|
|
2506
|
+
const kl = /* @__PURE__ */ S.forwardRef(xl);
|
|
2507
|
+
function Tl({
|
|
2578
2508
|
title: e,
|
|
2579
2509
|
titleId: t,
|
|
2580
2510
|
...n
|
|
2581
2511
|
}, r) {
|
|
2582
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2583
2513
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2584
2514
|
viewBox: "0 0 24 24",
|
|
2585
2515
|
fill: "currentColor",
|
|
@@ -2587,21 +2517,21 @@ function ba({
|
|
|
2587
2517
|
"data-slot": "icon",
|
|
2588
2518
|
ref: r,
|
|
2589
2519
|
"aria-labelledby": t
|
|
2590
|
-
}, n), e ? /* @__PURE__ */
|
|
2520
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2591
2521
|
id: t
|
|
2592
|
-
}, e) : null, /* @__PURE__ */
|
|
2522
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2593
2523
|
fillRule: "evenodd",
|
|
2594
2524
|
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",
|
|
2595
2525
|
clipRule: "evenodd"
|
|
2596
2526
|
}));
|
|
2597
2527
|
}
|
|
2598
|
-
const
|
|
2599
|
-
function
|
|
2528
|
+
const jn = /* @__PURE__ */ S.forwardRef(Tl);
|
|
2529
|
+
function Rl({
|
|
2600
2530
|
title: e,
|
|
2601
2531
|
titleId: t,
|
|
2602
2532
|
...n
|
|
2603
2533
|
}, r) {
|
|
2604
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2605
2535
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2606
2536
|
viewBox: "0 0 24 24",
|
|
2607
2537
|
fill: "currentColor",
|
|
@@ -2609,21 +2539,21 @@ function Ea({
|
|
|
2609
2539
|
"data-slot": "icon",
|
|
2610
2540
|
ref: r,
|
|
2611
2541
|
"aria-labelledby": t
|
|
2612
|
-
}, n), e ? /* @__PURE__ */
|
|
2542
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2613
2543
|
id: t
|
|
2614
|
-
}, e) : null, /* @__PURE__ */
|
|
2544
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2615
2545
|
fillRule: "evenodd",
|
|
2616
2546
|
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",
|
|
2617
2547
|
clipRule: "evenodd"
|
|
2618
2548
|
}));
|
|
2619
2549
|
}
|
|
2620
|
-
const
|
|
2621
|
-
function
|
|
2550
|
+
const Ol = /* @__PURE__ */ S.forwardRef(Rl);
|
|
2551
|
+
function Ml({
|
|
2622
2552
|
title: e,
|
|
2623
2553
|
titleId: t,
|
|
2624
2554
|
...n
|
|
2625
2555
|
}, r) {
|
|
2626
|
-
return /* @__PURE__ */
|
|
2556
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2627
2557
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2628
2558
|
viewBox: "0 0 24 24",
|
|
2629
2559
|
fill: "currentColor",
|
|
@@ -2631,25 +2561,25 @@ function ya({
|
|
|
2631
2561
|
"data-slot": "icon",
|
|
2632
2562
|
ref: r,
|
|
2633
2563
|
"aria-labelledby": t
|
|
2634
|
-
}, n), e ? /* @__PURE__ */
|
|
2564
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2635
2565
|
id: t
|
|
2636
|
-
}, e) : null, /* @__PURE__ */
|
|
2566
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2637
2567
|
fillRule: "evenodd",
|
|
2638
2568
|
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",
|
|
2639
2569
|
clipRule: "evenodd"
|
|
2640
|
-
}), /* @__PURE__ */
|
|
2570
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2641
2571
|
fillRule: "evenodd",
|
|
2642
2572
|
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",
|
|
2643
2573
|
clipRule: "evenodd"
|
|
2644
2574
|
}));
|
|
2645
2575
|
}
|
|
2646
|
-
const
|
|
2647
|
-
function
|
|
2576
|
+
const Cl = /* @__PURE__ */ S.forwardRef(Ml);
|
|
2577
|
+
function Ll({
|
|
2648
2578
|
title: e,
|
|
2649
2579
|
titleId: t,
|
|
2650
2580
|
...n
|
|
2651
2581
|
}, r) {
|
|
2652
|
-
return /* @__PURE__ */
|
|
2582
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2653
2583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2654
2584
|
viewBox: "0 0 24 24",
|
|
2655
2585
|
fill: "currentColor",
|
|
@@ -2657,21 +2587,21 @@ function ka({
|
|
|
2657
2587
|
"data-slot": "icon",
|
|
2658
2588
|
ref: r,
|
|
2659
2589
|
"aria-labelledby": t
|
|
2660
|
-
}, n), e ? /* @__PURE__ */
|
|
2590
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2661
2591
|
id: t
|
|
2662
|
-
}, e) : null, /* @__PURE__ */
|
|
2592
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2663
2593
|
fillRule: "evenodd",
|
|
2664
2594
|
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",
|
|
2665
2595
|
clipRule: "evenodd"
|
|
2666
2596
|
}));
|
|
2667
2597
|
}
|
|
2668
|
-
const
|
|
2669
|
-
function
|
|
2598
|
+
const Al = /* @__PURE__ */ S.forwardRef(Ll);
|
|
2599
|
+
function Nl({
|
|
2670
2600
|
title: e,
|
|
2671
2601
|
titleId: t,
|
|
2672
2602
|
...n
|
|
2673
2603
|
}, r) {
|
|
2674
|
-
return /* @__PURE__ */
|
|
2604
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2675
2605
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2676
2606
|
viewBox: "0 0 24 24",
|
|
2677
2607
|
fill: "currentColor",
|
|
@@ -2679,23 +2609,23 @@ function Ra({
|
|
|
2679
2609
|
"data-slot": "icon",
|
|
2680
2610
|
ref: r,
|
|
2681
2611
|
"aria-labelledby": t
|
|
2682
|
-
}, n), e ? /* @__PURE__ */
|
|
2612
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2683
2613
|
id: t
|
|
2684
|
-
}, e) : null, /* @__PURE__ */
|
|
2614
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2685
2615
|
fillRule: "evenodd",
|
|
2686
2616
|
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",
|
|
2687
2617
|
clipRule: "evenodd"
|
|
2688
|
-
}), /* @__PURE__ */
|
|
2618
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2689
2619
|
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"
|
|
2690
2620
|
}));
|
|
2691
2621
|
}
|
|
2692
|
-
const
|
|
2693
|
-
function
|
|
2622
|
+
const Dl = /* @__PURE__ */ S.forwardRef(Nl);
|
|
2623
|
+
function Pl({
|
|
2694
2624
|
title: e,
|
|
2695
2625
|
titleId: t,
|
|
2696
2626
|
...n
|
|
2697
2627
|
}, r) {
|
|
2698
|
-
return /* @__PURE__ */
|
|
2628
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2699
2629
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2700
2630
|
viewBox: "0 0 24 24",
|
|
2701
2631
|
fill: "currentColor",
|
|
@@ -2703,23 +2633,23 @@ function Ca({
|
|
|
2703
2633
|
"data-slot": "icon",
|
|
2704
2634
|
ref: r,
|
|
2705
2635
|
"aria-labelledby": t
|
|
2706
|
-
}, n), e ? /* @__PURE__ */
|
|
2636
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2707
2637
|
id: t
|
|
2708
|
-
}, e) : null, /* @__PURE__ */
|
|
2638
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2709
2639
|
d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
|
|
2710
|
-
}), /* @__PURE__ */
|
|
2640
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2711
2641
|
fillRule: "evenodd",
|
|
2712
2642
|
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",
|
|
2713
2643
|
clipRule: "evenodd"
|
|
2714
2644
|
}));
|
|
2715
2645
|
}
|
|
2716
|
-
const
|
|
2717
|
-
function
|
|
2646
|
+
const $l = /* @__PURE__ */ S.forwardRef(Pl);
|
|
2647
|
+
function Fl({
|
|
2718
2648
|
title: e,
|
|
2719
2649
|
titleId: t,
|
|
2720
2650
|
...n
|
|
2721
2651
|
}, r) {
|
|
2722
|
-
return /* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2723
2653
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2724
2654
|
viewBox: "0 0 24 24",
|
|
2725
2655
|
fill: "currentColor",
|
|
@@ -2727,21 +2657,21 @@ function Aa({
|
|
|
2727
2657
|
"data-slot": "icon",
|
|
2728
2658
|
ref: r,
|
|
2729
2659
|
"aria-labelledby": t
|
|
2730
|
-
}, n), e ? /* @__PURE__ */
|
|
2660
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2731
2661
|
id: t
|
|
2732
|
-
}, e) : null, /* @__PURE__ */
|
|
2662
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2733
2663
|
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"
|
|
2734
|
-
}), /* @__PURE__ */
|
|
2664
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2735
2665
|
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"
|
|
2736
2666
|
}));
|
|
2737
2667
|
}
|
|
2738
|
-
const
|
|
2739
|
-
function
|
|
2668
|
+
const ql = /* @__PURE__ */ S.forwardRef(Fl);
|
|
2669
|
+
function _l({
|
|
2740
2670
|
title: e,
|
|
2741
2671
|
titleId: t,
|
|
2742
2672
|
...n
|
|
2743
2673
|
}, r) {
|
|
2744
|
-
return /* @__PURE__ */
|
|
2674
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2745
2675
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2746
2676
|
viewBox: "0 0 24 24",
|
|
2747
2677
|
fill: "currentColor",
|
|
@@ -2749,99 +2679,99 @@ function Na({
|
|
|
2749
2679
|
"data-slot": "icon",
|
|
2750
2680
|
ref: r,
|
|
2751
2681
|
"aria-labelledby": t
|
|
2752
|
-
}, n), e ? /* @__PURE__ */
|
|
2682
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2753
2683
|
id: t
|
|
2754
|
-
}, e) : null, /* @__PURE__ */
|
|
2684
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2755
2685
|
d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
|
|
2756
2686
|
}));
|
|
2757
2687
|
}
|
|
2758
|
-
const
|
|
2759
|
-
const { labels: r, onEditGrant: o } = D(), [i,
|
|
2760
|
-
o === void 0 || i || (
|
|
2688
|
+
const Bl = /* @__PURE__ */ S.forwardRef(_l), Il = ({ href: e, onRetry: t, testId: n }) => {
|
|
2689
|
+
const { labels: r, onEditGrant: o } = D(), [i, l] = j(!1), u = () => {
|
|
2690
|
+
o === void 0 || i || (l(!0), o(e).then((m) => {
|
|
2761
2691
|
m && t();
|
|
2762
|
-
}).finally(() =>
|
|
2692
|
+
}).finally(() => l(!1)));
|
|
2763
2693
|
};
|
|
2764
|
-
return /* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
/* @__PURE__ */
|
|
2768
|
-
o === void 0 ? /* @__PURE__ */
|
|
2769
|
-
/* @__PURE__ */
|
|
2694
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
|
|
2695
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
|
|
2696
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
|
|
2697
|
+
/* @__PURE__ */ F("div", { className: "aqmx-edit-grant-actions", children: [
|
|
2698
|
+
o === void 0 ? /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
|
|
2699
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": i, "data-testid": `${n}-open`, onClick: u, children: r.editGrantAction })
|
|
2770
2700
|
),
|
|
2771
|
-
/* @__PURE__ */
|
|
2701
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2772
2702
|
] })
|
|
2773
2703
|
] });
|
|
2774
|
-
},
|
|
2704
|
+
}, jl = "Control+E Meta+E", zl = (e, t, n) => n && t ? "split" : e.view, Wt = (e, t, n, r) => {
|
|
2775
2705
|
if (n === "split") {
|
|
2776
2706
|
e.setSideBySide(!0);
|
|
2777
2707
|
return;
|
|
2778
2708
|
}
|
|
2779
2709
|
e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
|
|
2780
|
-
},
|
|
2710
|
+
}, is = (e) => e === "split" ? null : e, Hl = (e) => e === "preview" ? "editor" : "preview", Vl = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Ul = (e, t) => {
|
|
2781
2711
|
if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
|
|
2782
2712
|
const n = e.key.toLowerCase();
|
|
2783
2713
|
return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
|
|
2784
|
-
},
|
|
2714
|
+
}, Yt = (e, t, n) => {
|
|
2785
2715
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2786
2716
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2787
|
-
},
|
|
2788
|
-
const { data: o, edits: i, labels:
|
|
2789
|
-
R(null),
|
|
2790
|
-
}, []),
|
|
2717
|
+
}, Zl = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2718
|
+
const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = xe(), [d, h] = j(null), [v, E] = j(0), [k, R] = j(null), [T, L] = j(null), A = Z(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), b = P(() => {
|
|
2719
|
+
R(null), L(null);
|
|
2720
|
+
}, []), g = yn({ open: n, onOpen: b, onDismiss: r });
|
|
2791
2721
|
te(() => {
|
|
2792
2722
|
if (!n) return;
|
|
2793
|
-
const
|
|
2794
|
-
return h(null), o.revisions(e,
|
|
2723
|
+
const w = new AbortController();
|
|
2724
|
+
return h(null), o.revisions(e, w.signal).then((O) => {
|
|
2795
2725
|
"kind" in O && h(O);
|
|
2796
|
-
}), () =>
|
|
2797
|
-
}, [n, o, e,
|
|
2726
|
+
}), () => w.abort();
|
|
2727
|
+
}, [n, o, e, v]), te(() => {
|
|
2798
2728
|
if (!n || k === null) return;
|
|
2799
|
-
const
|
|
2800
|
-
return
|
|
2801
|
-
"kind" in O &&
|
|
2802
|
-
}), () =>
|
|
2729
|
+
const w = new AbortController();
|
|
2730
|
+
return L(null), o.revision(e, k, w.signal).then((O) => {
|
|
2731
|
+
"kind" in O && L(O);
|
|
2732
|
+
}), () => w.abort();
|
|
2803
2733
|
}, [n, o, e, k]);
|
|
2804
|
-
const
|
|
2805
|
-
T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(
|
|
2806
|
-
}, s =
|
|
2807
|
-
return /* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
] }) },
|
|
2814
|
-
k === null ? null : T === null ? /* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2734
|
+
const a = () => {
|
|
2735
|
+
T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(l.historyRestored(t)), r());
|
|
2736
|
+
}, s = d !== null && d.kind === "revisions" ? d.revisions.find((w) => w.id === k) : void 0;
|
|
2737
|
+
return /* @__PURE__ */ c("dialog", { ...g, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2738
|
+
/* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: l.historyTitle(t) }),
|
|
2739
|
+
d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => E((w) => w + 1), testId: "markdown-explorer-history-failure" }) : d.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: l.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: d.revisions.map((w) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": w.id === k, "data-testid": "markdown-explorer-history-entry", onClick: () => R(w.id), children: [
|
|
2740
|
+
/* @__PURE__ */ c("span", { children: Yt(w, A, l.historyEntry) }),
|
|
2741
|
+
w.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyCurrent }) : null,
|
|
2742
|
+
w.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyKept }) : null
|
|
2743
|
+
] }) }, w.id)) }),
|
|
2744
|
+
k === null ? null : T === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: l.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ c(me, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2745
|
+
/* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? l.historyTitle(t) : Yt(s, A, l.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: T.text }) })
|
|
2816
2746
|
),
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
2748
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: l.historyClose }),
|
|
2749
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: a, children: l.historyRestore })
|
|
2820
2750
|
] })
|
|
2821
2751
|
] }) });
|
|
2822
|
-
},
|
|
2752
|
+
}, Gl = (e) => {
|
|
2823
2753
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o)?.document;
|
|
2824
2754
|
return i === void 0 || i.kind === "failure" ? { edit: null, name: se(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
|
|
2825
|
-
},
|
|
2755
|
+
}, ce = (e) => {
|
|
2826
2756
|
e.stopPropagation();
|
|
2827
|
-
},
|
|
2828
|
-
const { draftConverter: i, edits:
|
|
2829
|
-
|
|
2830
|
-
() =>
|
|
2757
|
+
}, Kl = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
|
|
2758
|
+
const { draftConverter: i, edits: l, labels: u } = D(), m = ee(
|
|
2759
|
+
l.subscribe,
|
|
2760
|
+
() => l.session(e) !== void 0,
|
|
2831
2761
|
() => !1
|
|
2832
|
-
), [f,
|
|
2762
|
+
), [f, d] = j(null), h = () => {
|
|
2833
2763
|
if (!m) {
|
|
2834
|
-
|
|
2764
|
+
l.start(e, l.viewAnchor(e));
|
|
2835
2765
|
return;
|
|
2836
2766
|
}
|
|
2837
|
-
|
|
2838
|
-
const R =
|
|
2839
|
-
R?.dirty === !0 ?
|
|
2840
|
-
},
|
|
2841
|
-
m || (
|
|
2767
|
+
l.flush(e);
|
|
2768
|
+
const R = l.session(e);
|
|
2769
|
+
R?.dirty === !0 ? d(R.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
|
|
2770
|
+
}, v = () => {
|
|
2771
|
+
m || (wo(), r && l.sideBySide() && i?.prepare?.());
|
|
2842
2772
|
}, E = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, k = o ? u.editDraftDocument : u.editDocument;
|
|
2843
|
-
return /* @__PURE__ */ $
|
|
2844
|
-
/* @__PURE__ */
|
|
2773
|
+
return /* @__PURE__ */ F($e, { children: [
|
|
2774
|
+
/* @__PURE__ */ F(
|
|
2845
2775
|
"button",
|
|
2846
2776
|
{
|
|
2847
2777
|
type: "button",
|
|
@@ -2851,17 +2781,17 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
2851
2781
|
"aria-pressed": m,
|
|
2852
2782
|
"data-testid": "markdown-explorer-document-edit",
|
|
2853
2783
|
onClick: h,
|
|
2854
|
-
onDoubleClick:
|
|
2855
|
-
onPointerEnter:
|
|
2856
|
-
onFocus:
|
|
2784
|
+
onDoubleClick: ce,
|
|
2785
|
+
onPointerEnter: v,
|
|
2786
|
+
onFocus: v,
|
|
2857
2787
|
children: [
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
E === null ? /* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ c(ql, { "aria-hidden": "true" }),
|
|
2789
|
+
E === null ? /* @__PURE__ */ c("span", { children: u.editDocumentLabel }) : null
|
|
2860
2790
|
]
|
|
2861
2791
|
}
|
|
2862
2792
|
),
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
|
|
2793
|
+
/* @__PURE__ */ c(
|
|
2794
|
+
Sn,
|
|
2865
2795
|
{
|
|
2866
2796
|
open: f !== null,
|
|
2867
2797
|
title: f === "draft" ? u.draftDiscardTitle : u.unsavedTitle,
|
|
@@ -2870,15 +2800,15 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
2870
2800
|
cancelLabel: u.unsavedStay,
|
|
2871
2801
|
testId: "markdown-explorer-edit-close-confirm",
|
|
2872
2802
|
onConfirm: () => {
|
|
2873
|
-
|
|
2803
|
+
d(null), l.close(e);
|
|
2874
2804
|
},
|
|
2875
|
-
onCancel: () =>
|
|
2805
|
+
onCancel: () => d(null)
|
|
2876
2806
|
}
|
|
2877
2807
|
)
|
|
2878
2808
|
] });
|
|
2879
|
-
},
|
|
2809
|
+
}, Wl = ({ href: e, documentName: t, iconOnly: n }) => {
|
|
2880
2810
|
const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
|
|
2881
|
-
return /* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ F(
|
|
2882
2812
|
"a",
|
|
2883
2813
|
{
|
|
2884
2814
|
className: o === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
@@ -2888,144 +2818,144 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
2888
2818
|
title: o === null ? r.editExternally : o,
|
|
2889
2819
|
"aria-label": o === null ? void 0 : o,
|
|
2890
2820
|
"data-testid": "markdown-explorer-document-edit-external",
|
|
2891
|
-
onDoubleClick:
|
|
2821
|
+
onDoubleClick: ce,
|
|
2892
2822
|
children: [
|
|
2893
|
-
/* @__PURE__ */
|
|
2894
|
-
o === null ? /* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ c(Ol, { "aria-hidden": "true" }),
|
|
2824
|
+
o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
|
|
2895
2825
|
]
|
|
2896
2826
|
}
|
|
2897
2827
|
);
|
|
2898
|
-
},
|
|
2899
|
-
const { labels: t } = D(), n =
|
|
2900
|
-
return /* @__PURE__ */
|
|
2901
|
-
},
|
|
2902
|
-
const { draftConverter: i, edits:
|
|
2828
|
+
}, Yl = ({ session: e }) => {
|
|
2829
|
+
const { labels: t } = D(), n = Br(t, e);
|
|
2830
|
+
return /* @__PURE__ */ c("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2831
|
+
}, Xl = Object.freeze(["editor", "split", "preview"]), Jl = Object.freeze(["editor", "preview"]), Ql = Object.freeze({ editor: jn, split: Bl, preview: $l }), ea = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2832
|
+
const { draftConverter: i, edits: l, labels: u } = D(), m = fo(), f = zl(r, m, o), d = o ? Xl : Jl, h = xe(), v = _(/* @__PURE__ */ new Map()), E = {
|
|
2903
2833
|
editor: { label: u.editViewEditor, tooltip: u.editViewEditorTooltip },
|
|
2904
2834
|
split: { label: u.editViewSplit, tooltip: u.editViewSplitTooltip },
|
|
2905
2835
|
preview: { label: u.editViewPreview, tooltip: u.editViewPreviewTooltip }
|
|
2906
2836
|
}, k = () => {
|
|
2907
|
-
|
|
2837
|
+
l.preparePreview(e), i?.prepare?.();
|
|
2908
2838
|
}, R = (T) => {
|
|
2909
|
-
if (!
|
|
2910
|
-
|
|
2911
|
-
const
|
|
2912
|
-
|
|
2839
|
+
if (!Ul(T.nativeEvent, Vl(navigator.platform))) return;
|
|
2840
|
+
bn(T);
|
|
2841
|
+
const L = Hl(f);
|
|
2842
|
+
Wt(l, e, L, o), v.current.get(L)?.focus();
|
|
2913
2843
|
};
|
|
2914
|
-
return /* @__PURE__ */
|
|
2915
|
-
const
|
|
2916
|
-
return /* @__PURE__ */
|
|
2917
|
-
/* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: d.map((T) => {
|
|
2845
|
+
const L = Ql[T], { label: A, tooltip: b } = E[T], g = T === "preview" ? k : void 0;
|
|
2846
|
+
return /* @__PURE__ */ F("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
|
|
2847
|
+
/* @__PURE__ */ c(
|
|
2918
2848
|
"input",
|
|
2919
2849
|
{
|
|
2920
|
-
ref: (
|
|
2921
|
-
|
|
2850
|
+
ref: (a) => {
|
|
2851
|
+
a === null ? v.current.delete(T) : v.current.set(T, a);
|
|
2922
2852
|
},
|
|
2923
2853
|
type: "radio",
|
|
2924
2854
|
name: h,
|
|
2925
2855
|
value: T,
|
|
2926
2856
|
checked: T === f,
|
|
2927
|
-
"aria-label":
|
|
2928
|
-
"aria-keyshortcuts": T === "split" ? void 0 :
|
|
2857
|
+
"aria-label": A,
|
|
2858
|
+
"aria-keyshortcuts": T === "split" ? void 0 : jl,
|
|
2929
2859
|
title: b,
|
|
2930
2860
|
"data-testid": `markdown-explorer-edit-view-${T}`,
|
|
2931
|
-
onChange: () =>
|
|
2932
|
-
onDoubleClick:
|
|
2933
|
-
onPointerEnter:
|
|
2934
|
-
onFocus:
|
|
2861
|
+
onChange: () => Wt(l, e, T, o),
|
|
2862
|
+
onDoubleClick: ce,
|
|
2863
|
+
onPointerEnter: g,
|
|
2864
|
+
onFocus: g
|
|
2935
2865
|
}
|
|
2936
2866
|
),
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
n ? null : /* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ c(L, { "aria-hidden": "true" }),
|
|
2868
|
+
n ? null : /* @__PURE__ */ c("span", { children: A })
|
|
2939
2869
|
] }, T);
|
|
2940
2870
|
}) });
|
|
2941
|
-
},
|
|
2942
|
-
const { edits: i, labels:
|
|
2871
|
+
}, ta = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2872
|
+
const { edits: i, labels: l } = D(), [u, m] = j(!1);
|
|
2943
2873
|
if (r.phase.kind !== "editing") return null;
|
|
2944
|
-
const f = r.save.kind === "saving",
|
|
2874
|
+
const f = r.save.kind === "saving", d = f || !r.dirty, h = () => {
|
|
2945
2875
|
i.flush(e);
|
|
2946
2876
|
const E = i.session(e);
|
|
2947
2877
|
E === void 0 || !E.dirty || E.save.kind === "saving" || i.save(e);
|
|
2948
|
-
},
|
|
2949
|
-
return /* @__PURE__ */ $
|
|
2950
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */
|
|
2951
|
-
/* @__PURE__ */
|
|
2952
|
-
n ? null : /* @__PURE__ */
|
|
2878
|
+
}, v = (E) => n ? { className: "aqmx-icon-button", "aria-label": E } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2879
|
+
return /* @__PURE__ */ F($e, { children: [
|
|
2880
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...v(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ce, children: [
|
|
2881
|
+
/* @__PURE__ */ c(Cl, { "aria-hidden": "true" }),
|
|
2882
|
+
n ? null : /* @__PURE__ */ c("span", { children: l.conflictNext })
|
|
2953
2883
|
] }) : null,
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
r.history ? /* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
2957
|
-
n ? null : /* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ c(ea, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
|
|
2885
|
+
r.history ? /* @__PURE__ */ F("button", { type: "button", ...v(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: ce, children: [
|
|
2886
|
+
/* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
|
|
2887
|
+
n ? null : /* @__PURE__ */ c("span", { children: l.historyOpen })
|
|
2958
2888
|
] }) : null,
|
|
2959
|
-
r.save.kind === "draft" ? null : /* @__PURE__ */
|
|
2960
|
-
/* @__PURE__ */
|
|
2961
|
-
n ? null : /* @__PURE__ */
|
|
2889
|
+
r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...v(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": d, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: ce, children: [
|
|
2890
|
+
/* @__PURE__ */ c(Dl, { "aria-hidden": "true" }),
|
|
2891
|
+
n ? null : /* @__PURE__ */ c("span", { children: l.saveDraft })
|
|
2962
2892
|
] }),
|
|
2963
|
-
r.history ? /* @__PURE__ */
|
|
2893
|
+
r.history ? /* @__PURE__ */ c(Zl, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
|
|
2964
2894
|
] });
|
|
2965
|
-
},
|
|
2895
|
+
}, na = ({ path: e, session: t }) => {
|
|
2966
2896
|
const { edits: n } = D();
|
|
2967
|
-
return t.save.kind !== "grant" ? null : /* @__PURE__ */
|
|
2897
|
+
return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Il, { href: t.save.href, onRetry: () => {
|
|
2968
2898
|
n.save(e);
|
|
2969
2899
|
}, testId: "markdown-explorer-save-grant" });
|
|
2970
|
-
},
|
|
2900
|
+
}, ra = (e) => {
|
|
2971
2901
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
|
|
2972
2902
|
return ue(o)?.document.kind === "markdown";
|
|
2973
|
-
},
|
|
2974
|
-
const { config: t } = D(), n =
|
|
2975
|
-
return
|
|
2976
|
-
},
|
|
2977
|
-
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]),
|
|
2903
|
+
}, oa = (e) => {
|
|
2904
|
+
const { config: t } = D(), n = qe(), r = P(() => n(ye(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2905
|
+
return Z(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2906
|
+
}, ia = /* @__PURE__ */ new Set(), la = (e, t) => {
|
|
2907
|
+
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] = j(() => /* @__PURE__ */ new Set()), [h, v] = j(ia), [E, k] = j(null);
|
|
2978
2908
|
E !== null && E.path !== e && k(null);
|
|
2979
2909
|
const R = _(null);
|
|
2980
|
-
|
|
2910
|
+
z(() => (R.current = e, () => {
|
|
2981
2911
|
R.current = null;
|
|
2982
2912
|
}), [e]);
|
|
2983
2913
|
const T = P(() => {
|
|
2984
|
-
const b = e,
|
|
2985
|
-
if (
|
|
2986
|
-
const
|
|
2987
|
-
|
|
2914
|
+
const b = e, g = n.peek(b);
|
|
2915
|
+
if (d.has(b) || g?.status === "pending") return;
|
|
2916
|
+
const a = t && !Ln(g);
|
|
2917
|
+
d.add(b), v(new Set(d)), k(null), (async () => {
|
|
2988
2918
|
try {
|
|
2989
2919
|
const s = await n.refresh(b);
|
|
2990
2920
|
if (R.current !== b || s.status === "superseded") return;
|
|
2991
2921
|
if (s.status === "failed") {
|
|
2992
|
-
k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(
|
|
2922
|
+
k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(ae(o, s.failure.reason)));
|
|
2993
2923
|
return;
|
|
2994
2924
|
}
|
|
2995
|
-
const
|
|
2996
|
-
if (
|
|
2997
|
-
r.announce(o.documentRefreshed(
|
|
2925
|
+
const w = ue(n.peek(b));
|
|
2926
|
+
if (a || w === null || w.document.kind === "failure") return;
|
|
2927
|
+
r.announce(o.documentRefreshed(w.document.name));
|
|
2998
2928
|
} finally {
|
|
2999
|
-
|
|
2929
|
+
d.delete(b), v(new Set(d));
|
|
3000
2930
|
}
|
|
3001
2931
|
})();
|
|
3002
|
-
}, [e, t,
|
|
3003
|
-
return { refreshing:
|
|
3004
|
-
},
|
|
3005
|
-
const { labels: r } = D(), { refreshing: o, unavailable: i, failure:
|
|
3006
|
-
return /* @__PURE__ */
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
2932
|
+
}, [e, t, d, n, r, o]), L = h.has(e), A = E !== null && E.path === e && E.stamp === f ? E.failure : null;
|
|
2933
|
+
return { refreshing: L, unavailable: L || u?.status === "pending", failure: A, refresh: T };
|
|
2934
|
+
}, aa = Object.freeze({ kind: "page" }), sa = ({ path: e, placement: t, markup: n }) => {
|
|
2935
|
+
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } = la(e, t.kind === "page"), m = ra(e), f = Gl(e), d = kn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, v = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, E = t.kind === "panel", k = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
|
|
2936
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": d === void 0 ? void 0 : "true", children: [
|
|
2937
|
+
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2938
|
+
d === void 0 ? null : /* @__PURE__ */ c(Yl, { session: d }),
|
|
2939
|
+
d === void 0 ? null : /* @__PURE__ */ c(ta, { path: e, documentName: k, iconOnly: E, session: d, previewAvailable: R }),
|
|
2940
|
+
d === void 0 && m ? /* @__PURE__ */ F(
|
|
3011
2941
|
"button",
|
|
3012
2942
|
{
|
|
3013
2943
|
type: "button",
|
|
3014
|
-
className:
|
|
3015
|
-
title:
|
|
3016
|
-
"aria-label":
|
|
2944
|
+
className: v === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2945
|
+
title: v === null ? r.showMarkup : v,
|
|
2946
|
+
"aria-label": v === null ? void 0 : v,
|
|
3017
2947
|
"aria-pressed": n.shown,
|
|
3018
2948
|
"data-testid": "markdown-explorer-document-markup",
|
|
3019
2949
|
onClick: n.toggle,
|
|
3020
|
-
onDoubleClick:
|
|
2950
|
+
onDoubleClick: ce,
|
|
3021
2951
|
children: [
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
|
|
2952
|
+
/* @__PURE__ */ c(jn, { "aria-hidden": "true" }),
|
|
2953
|
+
v === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
|
|
3024
2954
|
]
|
|
3025
2955
|
}
|
|
3026
2956
|
) : null,
|
|
3027
|
-
|
|
3028
|
-
|
|
2957
|
+
d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(Kl, { path: e, documentName: k, iconOnly: E, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Wl, { href: f.edit.href, documentName: k, iconOnly: E }) : null,
|
|
2958
|
+
d === void 0 ? /* @__PURE__ */ F(
|
|
3029
2959
|
"button",
|
|
3030
2960
|
{
|
|
3031
2961
|
type: "button",
|
|
@@ -3037,85 +2967,85 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3037
2967
|
"data-aqmx-busy": o ? "true" : void 0,
|
|
3038
2968
|
"data-testid": "markdown-explorer-document-refresh",
|
|
3039
2969
|
onClick: u,
|
|
3040
|
-
onDoubleClick:
|
|
2970
|
+
onDoubleClick: ce,
|
|
3041
2971
|
children: [
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
h === null ? /* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ c(kl, { "aria-hidden": "true" }),
|
|
2973
|
+
h === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
|
|
3044
2974
|
]
|
|
3045
2975
|
}
|
|
3046
2976
|
) : null
|
|
3047
2977
|
] }),
|
|
3048
|
-
|
|
3049
|
-
|
|
2978
|
+
d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(ae(r, l.reason)) }),
|
|
2979
|
+
d === void 0 ? null : /* @__PURE__ */ c(na, { path: e, session: d })
|
|
3050
2980
|
] });
|
|
3051
|
-
},
|
|
3052
|
-
const t = e.doc, n =
|
|
3053
|
-
return /* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
2981
|
+
}, ca = ({ location: e }) => {
|
|
2982
|
+
const t = e.doc, n = Z(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = oa(e);
|
|
2983
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...tt, children: [
|
|
2984
|
+
/* @__PURE__ */ c(sa, { path: t, placement: aa, markup: r }),
|
|
2985
|
+
/* @__PURE__ */ c(Sl, { path: t, absence: il, markup: e.markup, variant: n })
|
|
3056
2986
|
] });
|
|
3057
|
-
},
|
|
2987
|
+
}, da = ({ holds: e, testId: t }) => {
|
|
3058
2988
|
const { labels: n, announcer: r } = D(), o = xe();
|
|
3059
|
-
|
|
3060
|
-
const i = P(() => r.shownIn(o), [r, o]),
|
|
3061
|
-
return /* @__PURE__ */
|
|
3062
|
-
}, fe = Object.freeze([]),
|
|
2989
|
+
z(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2990
|
+
const i = P(() => r.shownIn(o), [r, o]), l = ee(r.subscribe, i, i);
|
|
2991
|
+
return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: l.length > 1 ? n.announcementSequence(l) : l[0] });
|
|
2992
|
+
}, fe = Object.freeze([]), ua = (e) => {
|
|
3063
2993
|
const t = /* @__PURE__ */ new Set();
|
|
3064
2994
|
let n = fe, r = [], o = !1;
|
|
3065
|
-
const i = [],
|
|
3066
|
-
n =
|
|
2995
|
+
const i = [], l = (d) => {
|
|
2996
|
+
n = d;
|
|
3067
2997
|
for (const h of [...t]) h();
|
|
3068
|
-
}, u = () => i.at(-1)?.region, m = (
|
|
2998
|
+
}, u = () => i.at(-1)?.region, m = (d) => {
|
|
3069
2999
|
const h = u();
|
|
3070
|
-
|
|
3000
|
+
d(), u() !== h && n !== fe && l(fe);
|
|
3071
3001
|
}, f = () => {
|
|
3072
3002
|
o = !1;
|
|
3073
|
-
const
|
|
3074
|
-
r = [],
|
|
3003
|
+
const d = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
|
|
3004
|
+
r = [], l(Object.freeze(d));
|
|
3075
3005
|
};
|
|
3076
3006
|
return {
|
|
3077
|
-
announce: (
|
|
3078
|
-
if (typeof
|
|
3007
|
+
announce: (d) => {
|
|
3008
|
+
if (typeof d == "string") r.push({ sentence: d });
|
|
3079
3009
|
else {
|
|
3080
|
-
const h = r.find((
|
|
3081
|
-
h !== void 0 && "items" in h ? h.items.push(
|
|
3010
|
+
const h = r.find((v) => "list" in v && v.list === d.list);
|
|
3011
|
+
h !== void 0 && "items" in h ? h.items.push(d.item) : r.push({ list: d.list, items: [d.item] });
|
|
3082
3012
|
}
|
|
3083
|
-
o || (o = !0, n !== fe &&
|
|
3013
|
+
o || (o = !0, n !== fe && l(fe), e.request(f));
|
|
3084
3014
|
},
|
|
3085
|
-
subscribe: (
|
|
3086
|
-
t.delete(
|
|
3015
|
+
subscribe: (d) => (t.add(d), () => {
|
|
3016
|
+
t.delete(d);
|
|
3087
3017
|
}),
|
|
3088
|
-
claim: (
|
|
3089
|
-
const h = { region:
|
|
3018
|
+
claim: (d) => {
|
|
3019
|
+
const h = { region: d };
|
|
3090
3020
|
return m(() => i.push(h)), () => m(() => {
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3021
|
+
const v = i.indexOf(h);
|
|
3022
|
+
v !== -1 && i.splice(v, 1);
|
|
3093
3023
|
});
|
|
3094
3024
|
},
|
|
3095
|
-
shownIn: (
|
|
3025
|
+
shownIn: (d) => u() === d ? n : fe
|
|
3096
3026
|
};
|
|
3097
|
-
}, ge = Object.freeze({ status: "cancelled" }),
|
|
3027
|
+
}, ge = Object.freeze({ status: "cancelled" }), fa = (e) => {
|
|
3098
3028
|
if (e === null || typeof e != "object") return null;
|
|
3099
3029
|
const { failure: t } = e;
|
|
3100
|
-
if (
|
|
3030
|
+
if (mr(t) !== null) return null;
|
|
3101
3031
|
const { reason: n, code: r } = t;
|
|
3102
|
-
return
|
|
3103
|
-
},
|
|
3104
|
-
const r = n ?? ((f,
|
|
3032
|
+
return hr(n, r);
|
|
3033
|
+
}, ma = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
3034
|
+
const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h, v) => {
|
|
3105
3035
|
let E;
|
|
3106
3036
|
try {
|
|
3107
|
-
E = await r(f, { credentials: "same-origin", ...
|
|
3037
|
+
E = await r(f, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
|
|
3108
3038
|
} catch {
|
|
3109
|
-
return
|
|
3039
|
+
return v({ reason: "failed" });
|
|
3110
3040
|
}
|
|
3111
3041
|
E.status === 401 && t(null);
|
|
3112
|
-
const k = E.headers.get(
|
|
3042
|
+
const k = E.headers.get(sr);
|
|
3113
3043
|
k !== null && t(k);
|
|
3114
3044
|
let R;
|
|
3115
3045
|
try {
|
|
3116
3046
|
R = await E.json();
|
|
3117
3047
|
} catch {
|
|
3118
|
-
return
|
|
3048
|
+
return v({ reason: xt(E.status) });
|
|
3119
3049
|
}
|
|
3120
3050
|
let T;
|
|
3121
3051
|
try {
|
|
@@ -3124,39 +3054,39 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3124
3054
|
T = !1;
|
|
3125
3055
|
}
|
|
3126
3056
|
if (T) return R;
|
|
3127
|
-
const
|
|
3128
|
-
return
|
|
3129
|
-
},
|
|
3130
|
-
const
|
|
3131
|
-
return
|
|
3057
|
+
const L = fa(R);
|
|
3058
|
+
return v(L !== null ? L : { reason: E.status === 200 ? "failed" : xt(E.status) });
|
|
3059
|
+
}, l = { [Tt]: pr }, u = { [Tt]: Er, "Content-Type": `${br}; charset=utf-8` }, m = async (f, d, h) => {
|
|
3060
|
+
const v = await i(f, d, h, (E) => Ue(E.reason, E.code));
|
|
3061
|
+
return d.signal.aborted ? ge : v;
|
|
3132
3062
|
};
|
|
3133
3063
|
return {
|
|
3134
|
-
tree: (f) => i(o("tree", { [
|
|
3135
|
-
children: async (f,
|
|
3136
|
-
const
|
|
3137
|
-
return h.aborted ? ge :
|
|
3064
|
+
tree: (f) => i(o("tree", { [X.source]: f }), { method: "GET" }, kt, (d) => ({ status: "error", failure: d })),
|
|
3065
|
+
children: async (f, d, h) => {
|
|
3066
|
+
const v = await i(o("children", { [X.source]: f, [X.path]: d }), { method: "GET", signal: h }, fr, (E) => ({ status: "error", failure: E }));
|
|
3067
|
+
return h.aborted ? ge : v;
|
|
3138
3068
|
},
|
|
3139
|
-
ancestors: async (f,
|
|
3140
|
-
const
|
|
3141
|
-
return h.aborted ? ge :
|
|
3069
|
+
ancestors: async (f, d, h) => {
|
|
3070
|
+
const v = await i(o("ancestors", { [X.source]: f, [X.path]: d }), { method: "GET", signal: h }, ur, (E) => ({ status: "error", failure: E }));
|
|
3071
|
+
return h.aborted ? ge : v;
|
|
3142
3072
|
},
|
|
3143
|
-
reveal: async (f,
|
|
3144
|
-
const
|
|
3145
|
-
return h.aborted ? ge :
|
|
3073
|
+
reveal: async (f, d, h) => {
|
|
3074
|
+
const v = await i(o("reveal", { [X.source]: f, [X.path]: d }), { method: "GET", signal: h }, dr, (E) => ({ status: "error", failure: E }));
|
|
3075
|
+
return h.aborted ? ge : v;
|
|
3146
3076
|
},
|
|
3147
|
-
document: (f, { refresh:
|
|
3148
|
-
text: async (f,
|
|
3149
|
-
const h = await i(o("text", { [
|
|
3150
|
-
return
|
|
3077
|
+
document: (f, { refresh: d }) => i(o("document", { [X.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" }, xr, (h) => Ue(h.reason, h.code)),
|
|
3078
|
+
text: async (f, d) => {
|
|
3079
|
+
const h = await i(o("text", { [X.path]: f }), { method: "GET", signal: d }, cr, (v) => Ue(v.reason, v.code));
|
|
3080
|
+
return d.aborted ? ge : h;
|
|
3151
3081
|
},
|
|
3152
|
-
edit: (f,
|
|
3153
|
-
save: (f,
|
|
3154
|
-
preview: (f,
|
|
3155
|
-
revisions: (f,
|
|
3156
|
-
revision: (f,
|
|
3157
|
-
refresh: (f) => i(o("refresh", { [
|
|
3082
|
+
edit: (f, d) => m(o("edit", { [X.path]: f }), { method: "GET", signal: d }, Sr),
|
|
3083
|
+
save: (f, d, h, v) => m(o("save", { [X.path]: f, [X.base]: d }), { method: "POST", headers: u, body: h, signal: v }, yr),
|
|
3084
|
+
preview: (f, d, h) => m(o("preview", { [X.path]: f }), { method: "POST", headers: u, body: d, signal: h }, gr),
|
|
3085
|
+
revisions: (f, d) => m(o("revisions", { [X.path]: f }), { method: "GET", signal: d }, wr),
|
|
3086
|
+
revision: (f, d, h) => m(o("revision", { [X.path]: f, [X.revision]: d }), { method: "GET", signal: h }, vr),
|
|
3087
|
+
refresh: (f) => i(o("refresh", { [X.source]: f }), { method: "POST", headers: l }, kt, (d) => ({ status: "error", failure: d }))
|
|
3158
3088
|
};
|
|
3159
|
-
},
|
|
3089
|
+
}, ha = () => {
|
|
3160
3090
|
let e = null, t = null;
|
|
3161
3091
|
return {
|
|
3162
3092
|
settle: (n) => {
|
|
@@ -3171,20 +3101,20 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3171
3101
|
return t = null, o;
|
|
3172
3102
|
}
|
|
3173
3103
|
};
|
|
3174
|
-
},
|
|
3175
|
-
const t =
|
|
3176
|
-
if (t === null) return
|
|
3104
|
+
}, pa = (e) => {
|
|
3105
|
+
const t = et(e);
|
|
3106
|
+
if (t === null) return yt;
|
|
3177
3107
|
try {
|
|
3178
|
-
return
|
|
3108
|
+
return rr(JSON.parse(t));
|
|
3179
3109
|
} catch (n) {
|
|
3180
|
-
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n),
|
|
3110
|
+
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), yt;
|
|
3181
3111
|
}
|
|
3182
|
-
},
|
|
3112
|
+
}, Xt = (e, t) => {
|
|
3183
3113
|
let n = null;
|
|
3184
3114
|
const r = () => {
|
|
3185
3115
|
if (n === null) {
|
|
3186
|
-
const i =
|
|
3187
|
-
n = { changes: i, settings:
|
|
3116
|
+
const i = pa(e);
|
|
3117
|
+
n = { changes: i, settings: Et(t, i) };
|
|
3188
3118
|
}
|
|
3189
3119
|
return n;
|
|
3190
3120
|
}, o = Oe();
|
|
@@ -3195,198 +3125,198 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3195
3125
|
getServerSnapshot: () => t,
|
|
3196
3126
|
subscribe: o.subscribe,
|
|
3197
3127
|
advance: (i) => {
|
|
3198
|
-
const { changes:
|
|
3199
|
-
return n = { changes: m, settings:
|
|
3128
|
+
const { changes: l, settings: u } = r(), m = er(l, i, tr(u, i)[i], t);
|
|
3129
|
+
return n = { changes: m, settings: Et(t, m) }, o.emit(), Qe(e, nr(m)), n.settings;
|
|
3200
3130
|
}
|
|
3201
3131
|
};
|
|
3202
|
-
},
|
|
3203
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
3204
|
-
let f = 0,
|
|
3205
|
-
const h = { direct: null, bulk: null },
|
|
3132
|
+
}, va = Object.freeze({ status: "refreshed" }), wa = Object.freeze({ status: "superseded" }), it = Object.freeze({ status: "deferred" }), ga = xn(it), zn = 4, ba = zn - 1, Jt = Object.freeze({ status: "loading" }), Ea = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), ya = (e) => {
|
|
3133
|
+
const t = /* @__PURE__ */ new Map(), n = Cn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
|
|
3134
|
+
let f = 0, d = 0;
|
|
3135
|
+
const h = { direct: null, bulk: null }, v = /* @__PURE__ */ new Set();
|
|
3206
3136
|
let E = !1, k = 0;
|
|
3207
3137
|
const R = () => {
|
|
3208
3138
|
k += 1, u.emit();
|
|
3209
|
-
}, T = (p) => o.get(p) ?? 0,
|
|
3210
|
-
let
|
|
3211
|
-
return
|
|
3212
|
-
},
|
|
3213
|
-
p.inFlight.delete(
|
|
3139
|
+
}, T = (p) => o.get(p) ?? 0, L = (p) => {
|
|
3140
|
+
let y = l.get(p);
|
|
3141
|
+
return y === void 0 && (y = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, l.set(p, y)), y;
|
|
3142
|
+
}, A = (p, y, x) => {
|
|
3143
|
+
p.inFlight.delete(y), f -= 1, x.lane === "bulk" && (d -= 1);
|
|
3214
3144
|
}, b = (p) => {
|
|
3215
|
-
const
|
|
3216
|
-
if (
|
|
3217
|
-
for (const [x,
|
|
3218
|
-
|
|
3219
|
-
|
|
3145
|
+
const y = l.get(p);
|
|
3146
|
+
if (y !== void 0) {
|
|
3147
|
+
for (const [x, M] of [...y.inFlight])
|
|
3148
|
+
A(y, x, M), M.controller.abort();
|
|
3149
|
+
y.direct.clear(), y.bulk.clear(), y.unclaimed.clear();
|
|
3220
3150
|
}
|
|
3221
|
-
},
|
|
3222
|
-
const
|
|
3223
|
-
return o.set(p,
|
|
3224
|
-
},
|
|
3225
|
-
const x = Ee(p),
|
|
3226
|
-
return p.status === "pending" && p.then((
|
|
3227
|
-
|
|
3228
|
-
}),
|
|
3151
|
+
}, g = (p) => {
|
|
3152
|
+
const y = T(p) + 1;
|
|
3153
|
+
return o.set(p, y), b(p), y;
|
|
3154
|
+
}, a = (p, y) => {
|
|
3155
|
+
const x = Ee(p), M = { promise: p, opened: y, stale: !1, loadedAt: x?.status === "ok" ? x.loadedAt : null };
|
|
3156
|
+
return p.status === "pending" && p.then(($) => {
|
|
3157
|
+
$.status === "ok" && (M.loadedAt = $.loadedAt);
|
|
3158
|
+
}), M;
|
|
3229
3159
|
}, s = (p) => {
|
|
3230
|
-
let
|
|
3231
|
-
return
|
|
3232
|
-
},
|
|
3233
|
-
const
|
|
3234
|
-
for (let
|
|
3235
|
-
const
|
|
3236
|
-
if (!(
|
|
3237
|
-
for (const V of
|
|
3238
|
-
if ((
|
|
3239
|
-
return
|
|
3160
|
+
let y = r.get(p);
|
|
3161
|
+
return y === void 0 && (y = /* @__PURE__ */ new Map(), r.set(p, y)), y;
|
|
3162
|
+
}, w = (p) => {
|
|
3163
|
+
const y = [...l.keys()], x = h[p], M = x === null ? 0 : y.indexOf(x) + 1;
|
|
3164
|
+
for (let $ = 0; $ < y.length; $ += 1) {
|
|
3165
|
+
const I = y[(M + $) % y.length], W = I === void 0 ? void 0 : l.get(I);
|
|
3166
|
+
if (!(I === void 0 || W === void 0)) {
|
|
3167
|
+
for (const V of W[p])
|
|
3168
|
+
if ((W.claims.get(V) ?? 0) !== 0)
|
|
3169
|
+
return W[p].delete(V), h[p] = I, { sourceId: I, path: V };
|
|
3240
3170
|
}
|
|
3241
3171
|
}
|
|
3242
3172
|
return null;
|
|
3243
|
-
}, O = (p,
|
|
3244
|
-
const
|
|
3245
|
-
if (
|
|
3246
|
-
|
|
3247
|
-
const
|
|
3248
|
-
if (
|
|
3249
|
-
const V = { sourceId: p, path:
|
|
3173
|
+
}, O = (p, y, x, M) => {
|
|
3174
|
+
const $ = l.get(p);
|
|
3175
|
+
if ($ === void 0 || $.inFlight.get(y) !== x) return;
|
|
3176
|
+
A($, y, x);
|
|
3177
|
+
const I = ($.claims.get(y) ?? 0) > 0, W = s(p);
|
|
3178
|
+
if (M.status === "ok" ? W.set(y, { status: "loaded", entries: M.entries }) : M.status === "error" && I ? W.set(y, { status: "failed", failure: M.failure }) : W.delete(y), R(), M.status === "error" && I) {
|
|
3179
|
+
const V = { sourceId: p, path: y, failure: M.failure };
|
|
3250
3180
|
for (const ie of [...m]) ie(V);
|
|
3251
3181
|
}
|
|
3252
3182
|
N();
|
|
3253
|
-
},
|
|
3254
|
-
const
|
|
3255
|
-
|
|
3256
|
-
(
|
|
3257
|
-
() => O(p,
|
|
3183
|
+
}, C = (p, y, x) => {
|
|
3184
|
+
const M = { controller: new AbortController(), lane: x };
|
|
3185
|
+
L(p).inFlight.set(y, M), f += 1, x === "bulk" && (d += 1), e.children(p, y, M.controller.signal).then(
|
|
3186
|
+
($) => O(p, y, M, $),
|
|
3187
|
+
() => O(p, y, M, Ea)
|
|
3258
3188
|
);
|
|
3259
3189
|
}, N = () => {
|
|
3260
|
-
for (; f <
|
|
3261
|
-
const p =
|
|
3190
|
+
for (; f < zn; ) {
|
|
3191
|
+
const p = w("direct");
|
|
3262
3192
|
if (p !== null) {
|
|
3263
|
-
|
|
3193
|
+
C(p.sourceId, p.path, "direct");
|
|
3264
3194
|
continue;
|
|
3265
3195
|
}
|
|
3266
|
-
const
|
|
3267
|
-
if (
|
|
3268
|
-
|
|
3196
|
+
const y = d < ba ? w("bulk") : null;
|
|
3197
|
+
if (y === null) return;
|
|
3198
|
+
C(y.sourceId, y.path, "bulk");
|
|
3269
3199
|
}
|
|
3270
|
-
}, q = (p,
|
|
3271
|
-
if (!(
|
|
3272
|
-
const
|
|
3273
|
-
if (
|
|
3274
|
-
|
|
3200
|
+
}, q = (p, y, x) => {
|
|
3201
|
+
if (!(y.direct.delete(x) || y.bulk.delete(x))) {
|
|
3202
|
+
const $ = y.inFlight.get(x);
|
|
3203
|
+
if ($ === void 0) return !1;
|
|
3204
|
+
A(y, x, $), $.controller.abort();
|
|
3275
3205
|
}
|
|
3276
3206
|
return r.get(p)?.delete(x), !0;
|
|
3277
|
-
},
|
|
3207
|
+
}, K = () => {
|
|
3278
3208
|
E = !1;
|
|
3279
3209
|
let p = !1;
|
|
3280
|
-
for (const
|
|
3281
|
-
const x =
|
|
3282
|
-
for (const
|
|
3283
|
-
(x.claims.get(
|
|
3210
|
+
for (const y of v) {
|
|
3211
|
+
const x = L(y);
|
|
3212
|
+
for (const M of x.unclaimed)
|
|
3213
|
+
(x.claims.get(M) ?? 0) === 0 && q(y, x, M) && (p = !0);
|
|
3284
3214
|
x.unclaimed.clear();
|
|
3285
3215
|
}
|
|
3286
|
-
|
|
3287
|
-
}, G = (p,
|
|
3288
|
-
t.set(p,
|
|
3289
|
-
},
|
|
3290
|
-
|
|
3291
|
-
const
|
|
3292
|
-
return t.set(p,
|
|
3293
|
-
}, J = (p,
|
|
3294
|
-
if (x !== T(p) || t.get(p) !==
|
|
3295
|
-
const
|
|
3296
|
-
if (!(
|
|
3297
|
-
if (
|
|
3298
|
-
|
|
3216
|
+
v.clear(), p && (R(), N());
|
|
3217
|
+
}, G = (p, y) => {
|
|
3218
|
+
t.set(p, a(Te(e.tree(p)), y));
|
|
3219
|
+
}, B = (p, y, x) => {
|
|
3220
|
+
g(p);
|
|
3221
|
+
const M = a(xn(y), x);
|
|
3222
|
+
return t.set(p, M), r.delete(p), R(), N(), M;
|
|
3223
|
+
}, J = (p, y, x, M) => {
|
|
3224
|
+
if (x !== T(p) || t.get(p) !== y) return;
|
|
3225
|
+
const $ = Ee(y.promise);
|
|
3226
|
+
if (!(M.status !== "ok" || $?.status !== "ok" || y.loadedAt === null || M.loadedAt <= y.loadedAt)) {
|
|
3227
|
+
if (Pe($.entries, M.entries)) {
|
|
3228
|
+
y.loadedAt = M.loadedAt;
|
|
3299
3229
|
return;
|
|
3300
3230
|
}
|
|
3301
|
-
|
|
3231
|
+
B(p, M, y.opened);
|
|
3302
3232
|
}
|
|
3303
|
-
}, H = (p,
|
|
3233
|
+
}, H = (p, y) => {
|
|
3304
3234
|
const x = t.get(p);
|
|
3305
|
-
return x !== void 0 && Ee(x.promise)?.status ===
|
|
3306
|
-
}, ne = (p,
|
|
3307
|
-
|
|
3235
|
+
return x !== void 0 && Ee(x.promise)?.status === y;
|
|
3236
|
+
}, ne = (p, y) => {
|
|
3237
|
+
y.stale = !1;
|
|
3308
3238
|
const x = T(p);
|
|
3309
|
-
e.tree(p).then((
|
|
3239
|
+
e.tree(p).then((M) => J(p, y, x, M));
|
|
3310
3240
|
};
|
|
3311
3241
|
return {
|
|
3312
|
-
read: (p) => t.get(p)?.promise ??
|
|
3242
|
+
read: (p) => t.get(p)?.promise ?? ga,
|
|
3313
3243
|
open: (p) => {
|
|
3314
|
-
const
|
|
3315
|
-
return
|
|
3244
|
+
const y = n.resumes(p), x = n.hold(p), M = t.get(p);
|
|
3245
|
+
return M === void 0 || H(p, "deferred") ? (G(p, !0), R()) : y || (M.opened && H(p, "error") ? (G(p, !0), R()) : (M.opened = !0, M.stale && H(p, "ok") && ne(p, M))), x;
|
|
3316
3246
|
},
|
|
3317
3247
|
retry: (p) => {
|
|
3318
3248
|
H(p, "error") && (G(p, !0), R());
|
|
3319
3249
|
},
|
|
3320
|
-
seed: (p,
|
|
3321
|
-
const x =
|
|
3322
|
-
(
|
|
3323
|
-
() =>
|
|
3324
|
-
),
|
|
3325
|
-
if (
|
|
3326
|
-
const
|
|
3327
|
-
x.then((
|
|
3250
|
+
seed: (p, y) => {
|
|
3251
|
+
const x = y.then(
|
|
3252
|
+
(I) => I === null ? it : I,
|
|
3253
|
+
() => it
|
|
3254
|
+
), M = t.get(p);
|
|
3255
|
+
if (M !== void 0 && H(p, "ok")) {
|
|
3256
|
+
const I = T(p);
|
|
3257
|
+
x.then((W) => J(p, M, I, W));
|
|
3328
3258
|
return;
|
|
3329
3259
|
}
|
|
3330
|
-
|
|
3331
|
-
const
|
|
3332
|
-
t.set(p,
|
|
3333
|
-
t.get(p) ===
|
|
3260
|
+
g(p);
|
|
3261
|
+
const $ = a(Te(x), M?.opened === !0);
|
|
3262
|
+
t.set(p, $), r.delete(p), N(), x.then((I) => {
|
|
3263
|
+
t.get(p) === $ && (I.status === "deferred" && n.isHeld(p) && G(p, $.opened), R());
|
|
3334
3264
|
});
|
|
3335
3265
|
},
|
|
3336
3266
|
refresh: async (p) => {
|
|
3337
|
-
const
|
|
3338
|
-
i.set(p,
|
|
3267
|
+
const y = (i.get(p) ?? 0) + 1;
|
|
3268
|
+
i.set(p, y);
|
|
3339
3269
|
const x = await e.refresh(p);
|
|
3340
|
-
if (i.get(p) !==
|
|
3270
|
+
if (i.get(p) !== y) return wa;
|
|
3341
3271
|
if (x.status === "error") return { status: "failed", failure: x.failure };
|
|
3342
|
-
const
|
|
3343
|
-
if (!(
|
|
3344
|
-
const
|
|
3345
|
-
if (
|
|
3346
|
-
const
|
|
3347
|
-
|
|
3272
|
+
const M = t.get(p);
|
|
3273
|
+
if (!(M !== void 0 && M.loadedAt !== null && H(p, "ok") && M.loadedAt > x.loadedAt)) {
|
|
3274
|
+
const I = B(p, x, !0);
|
|
3275
|
+
if (M !== void 0 && M.promise.status === "pending") {
|
|
3276
|
+
const W = T(p);
|
|
3277
|
+
M.promise.then((V) => J(p, I, W, V));
|
|
3348
3278
|
}
|
|
3349
3279
|
}
|
|
3350
|
-
for (const [
|
|
3351
|
-
|
|
3352
|
-
return
|
|
3280
|
+
for (const [I, W] of t)
|
|
3281
|
+
I !== p && Ee(W.promise)?.status === "ok" && (W.stale = !0);
|
|
3282
|
+
return va;
|
|
3353
3283
|
},
|
|
3354
|
-
children: (p,
|
|
3355
|
-
claimChildren: (p,
|
|
3356
|
-
const x =
|
|
3357
|
-
let
|
|
3358
|
-
for (const [V, ie] of
|
|
3359
|
-
x.claims.set(V, (x.claims.get(V) ?? 0) + 1),
|
|
3360
|
-
|
|
3361
|
-
let
|
|
3284
|
+
children: (p, y) => r.get(p)?.get(y),
|
|
3285
|
+
claimChildren: (p, y) => {
|
|
3286
|
+
const x = L(p), M = s(p);
|
|
3287
|
+
let $ = !1, I = !1;
|
|
3288
|
+
for (const [V, ie] of y)
|
|
3289
|
+
x.claims.set(V, (x.claims.get(V) ?? 0) + 1), M.get(V) === void 0 ? (M.set(V, Jt), x[ie].add(V), $ = !0, I = !0) : ie === "direct" && x.bulk.delete(V) && (x.direct.add(V), I = !0);
|
|
3290
|
+
$ && R(), I && N();
|
|
3291
|
+
let W = !1;
|
|
3362
3292
|
return () => {
|
|
3363
|
-
if (!
|
|
3364
|
-
|
|
3365
|
-
for (const V of
|
|
3293
|
+
if (!W) {
|
|
3294
|
+
W = !0;
|
|
3295
|
+
for (const V of y.keys()) {
|
|
3366
3296
|
const ie = (x.claims.get(V) ?? 0) - 1;
|
|
3367
3297
|
ie > 0 ? x.claims.set(V, ie) : (x.claims.delete(V), x.unclaimed.add(V));
|
|
3368
3298
|
}
|
|
3369
|
-
|
|
3299
|
+
v.add(p), !E && (E = !0, queueMicrotask(K));
|
|
3370
3300
|
}
|
|
3371
3301
|
};
|
|
3372
3302
|
},
|
|
3373
|
-
retryChildren: (p,
|
|
3303
|
+
retryChildren: (p, y) => {
|
|
3374
3304
|
const x = r.get(p);
|
|
3375
|
-
if (x === void 0 || x.get(
|
|
3376
|
-
const
|
|
3377
|
-
if ((
|
|
3378
|
-
x.set(
|
|
3305
|
+
if (x === void 0 || x.get(y)?.status !== "failed") return;
|
|
3306
|
+
const M = L(p);
|
|
3307
|
+
if ((M.claims.get(y) ?? 0) > 0) {
|
|
3308
|
+
x.set(y, Jt), M.direct.add(y), R(), N();
|
|
3379
3309
|
return;
|
|
3380
3310
|
}
|
|
3381
|
-
x.delete(
|
|
3311
|
+
x.delete(y), R();
|
|
3382
3312
|
},
|
|
3383
3313
|
pendingChildren: (p) => {
|
|
3384
|
-
const
|
|
3385
|
-
return
|
|
3314
|
+
const y = l.get(p);
|
|
3315
|
+
return y === void 0 ? 0 : y.direct.size + y.bulk.size + y.inFlight.size;
|
|
3386
3316
|
},
|
|
3387
3317
|
clear: () => {
|
|
3388
|
-
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...
|
|
3389
|
-
for (const [p,
|
|
3318
|
+
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...l.keys()])) g(p);
|
|
3319
|
+
for (const [p, y] of i) i.set(p, y + 1);
|
|
3390
3320
|
t.clear(), r.clear(), R();
|
|
3391
3321
|
},
|
|
3392
3322
|
subscribeChildrenFailures: (p) => (m.add(p), () => {
|
|
@@ -3395,7 +3325,7 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3395
3325
|
subscribe: u.subscribe,
|
|
3396
3326
|
version: () => k
|
|
3397
3327
|
};
|
|
3398
|
-
},
|
|
3328
|
+
}, Sa = (e, t) => {
|
|
3399
3329
|
let n = e;
|
|
3400
3330
|
const r = Oe();
|
|
3401
3331
|
return {
|
|
@@ -3405,80 +3335,80 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3405
3335
|
n = { ...n, ...o }, t(n), r.emit();
|
|
3406
3336
|
}
|
|
3407
3337
|
};
|
|
3408
|
-
},
|
|
3409
|
-
let
|
|
3410
|
-
const
|
|
3338
|
+
}, xa = 1;
|
|
3339
|
+
let Me = 0, de = null;
|
|
3340
|
+
const ka = () => {
|
|
3411
3341
|
const { documentElement: e, body: t } = document;
|
|
3412
|
-
|
|
3342
|
+
Me === 0 && (de = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Me += 1;
|
|
3413
3343
|
let n = !1;
|
|
3414
3344
|
return () => {
|
|
3415
|
-
n || (n = !0,
|
|
3345
|
+
n || (n = !0, Me -= 1, !(Me > 0 || de === null) && (e.style.overflow = de.htmlOverflow, t.style.overflow = de.bodyOverflow, e.style.scrollbarGutter = de.htmlGutter, t.style.scrollbarGutter = de.bodyGutter, de = null));
|
|
3416
3346
|
};
|
|
3417
|
-
},
|
|
3347
|
+
}, Ta = [
|
|
3418
3348
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3419
3349
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3420
|
-
],
|
|
3421
|
-
if (!
|
|
3350
|
+
], Qt = 1, Ra = 1e3, en = (e) => e.getClientRects().length > 0, Ye = "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.", Oa = (e) => {
|
|
3351
|
+
if (!en(e)) return null;
|
|
3422
3352
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3423
|
-
if (t.bottom > n +
|
|
3424
|
-
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. ${
|
|
3425
|
-
if (t.height <
|
|
3426
|
-
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. ${
|
|
3427
|
-
for (const { selector: r, name: o } of
|
|
3353
|
+
if (t.bottom > n + xa)
|
|
3354
|
+
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. ${Ye}`;
|
|
3355
|
+
if (t.height < Qt)
|
|
3356
|
+
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. ${Ye}`;
|
|
3357
|
+
for (const { selector: r, name: o } of Ta)
|
|
3428
3358
|
for (const i of e.querySelectorAll(r)) {
|
|
3429
|
-
if (!
|
|
3430
|
-
const
|
|
3431
|
-
if (
|
|
3432
|
-
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(
|
|
3359
|
+
if (!en(i)) continue;
|
|
3360
|
+
const l = i.getBoundingClientRect().height;
|
|
3361
|
+
if (l < Qt)
|
|
3362
|
+
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(l))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ye}`;
|
|
3433
3363
|
}
|
|
3434
3364
|
return null;
|
|
3435
|
-
},
|
|
3365
|
+
}, Ma = (e) => {
|
|
3436
3366
|
let t = !1, n;
|
|
3437
3367
|
const r = () => {
|
|
3438
3368
|
n = void 0;
|
|
3439
|
-
const
|
|
3440
|
-
|
|
3369
|
+
const l = Oa(e);
|
|
3370
|
+
l !== null && (t = !0, console.error(l));
|
|
3441
3371
|
}, o = () => {
|
|
3442
|
-
t || (clearTimeout(n), n = setTimeout(r,
|
|
3372
|
+
t || (clearTimeout(n), n = setTimeout(r, Ra));
|
|
3443
3373
|
}, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
|
|
3444
3374
|
return i?.observe(e), window.addEventListener("resize", o), o(), () => {
|
|
3445
3375
|
clearTimeout(n), i?.disconnect(), window.removeEventListener("resize", o);
|
|
3446
3376
|
};
|
|
3447
|
-
},
|
|
3448
|
-
te(() => e ?
|
|
3377
|
+
}, Ca = (e, t) => {
|
|
3378
|
+
te(() => e ? ka() : void 0, [e]), te(() => {
|
|
3449
3379
|
const n = t.current;
|
|
3450
3380
|
if (!(!e || n === null))
|
|
3451
|
-
return
|
|
3381
|
+
return Ma(n);
|
|
3452
3382
|
}, [e, t]);
|
|
3453
|
-
},
|
|
3454
|
-
{ control:
|
|
3383
|
+
}, tn = '[data-testid="markdown-explorer-view-switch"]', La = [
|
|
3384
|
+
{ control: tn, successors: [tn, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3455
3385
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3456
|
-
],
|
|
3457
|
-
for (const t of
|
|
3386
|
+
], Aa = (e) => {
|
|
3387
|
+
for (const t of La) {
|
|
3458
3388
|
const n = e.closest(t.control);
|
|
3459
3389
|
if (n !== null) return { element: n, control: t };
|
|
3460
3390
|
}
|
|
3461
3391
|
return null;
|
|
3462
|
-
},
|
|
3392
|
+
}, Na = (e, t) => {
|
|
3463
3393
|
const n = _(null);
|
|
3464
3394
|
te(() => {
|
|
3465
3395
|
const o = (u) => {
|
|
3466
3396
|
const m = e.current;
|
|
3467
|
-
n.current = m !== null && u instanceof Element && m.contains(u) ?
|
|
3397
|
+
n.current = m !== null && u instanceof Element && m.contains(u) ? Aa(u) : null;
|
|
3468
3398
|
}, i = (u) => o(u.target);
|
|
3469
3399
|
o(document.activeElement);
|
|
3470
|
-
const
|
|
3400
|
+
const l = (u) => {
|
|
3471
3401
|
const m = u.target;
|
|
3472
3402
|
u.relatedTarget !== null || !(m instanceof Element) || queueMicrotask(() => {
|
|
3473
3403
|
n.current?.element === m && m.isConnected && document.activeElement !== m && (n.current = null);
|
|
3474
3404
|
});
|
|
3475
3405
|
};
|
|
3476
|
-
return document.addEventListener("focusin", i), document.addEventListener("focusout",
|
|
3477
|
-
document.removeEventListener("focusin", i), document.removeEventListener("focusout",
|
|
3406
|
+
return document.addEventListener("focusin", i), document.addEventListener("focusout", l), () => {
|
|
3407
|
+
document.removeEventListener("focusin", i), document.removeEventListener("focusout", l);
|
|
3478
3408
|
};
|
|
3479
3409
|
}, [e]);
|
|
3480
3410
|
const r = _(t);
|
|
3481
|
-
|
|
3411
|
+
z(() => {
|
|
3482
3412
|
if (r.current === t) return;
|
|
3483
3413
|
r.current = t;
|
|
3484
3414
|
const o = n.current;
|
|
@@ -3488,245 +3418,245 @@ const gl = () => {
|
|
|
3488
3418
|
if (m !== null && m !== document.body && m !== o.element) return !0;
|
|
3489
3419
|
const f = e.current;
|
|
3490
3420
|
if (f === null) return !0;
|
|
3491
|
-
for (const
|
|
3492
|
-
for (const h of f.querySelectorAll(
|
|
3421
|
+
for (const d of o.control.successors)
|
|
3422
|
+
for (const h of f.querySelectorAll(d))
|
|
3493
3423
|
if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
|
|
3494
3424
|
return !0;
|
|
3495
3425
|
return !1;
|
|
3496
3426
|
};
|
|
3497
3427
|
if (i()) return;
|
|
3498
|
-
const
|
|
3499
|
-
if (
|
|
3428
|
+
const l = e.current;
|
|
3429
|
+
if (l === null) return;
|
|
3500
3430
|
const u = new MutationObserver(() => {
|
|
3501
3431
|
i() && u.disconnect();
|
|
3502
3432
|
});
|
|
3503
|
-
return u.observe(
|
|
3433
|
+
return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
|
|
3504
3434
|
}, [t, e]);
|
|
3505
|
-
},
|
|
3435
|
+
}, Da = lt(() => import("./TreeLayout-DQT5p2vI.js").then((e) => ({ default: e.TreeLayout }))), Pa = lt(() => import("./MultiLayout-BJ-s6AaD.js").then((e) => ({ default: e.MultiLayout }))), $a = 64, Fa = {
|
|
3506
3436
|
request: (e) => {
|
|
3507
3437
|
requestAnimationFrame(e);
|
|
3508
3438
|
}
|
|
3509
|
-
},
|
|
3439
|
+
}, nn = (e) => {
|
|
3510
3440
|
e.documents.clear(), e.trees.clear();
|
|
3511
3441
|
}, Xe = (e, t) => {
|
|
3512
3442
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3513
3443
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3514
|
-
},
|
|
3515
|
-
const [n, r] =
|
|
3516
|
-
if (n.locale === e &&
|
|
3517
|
-
const o = { overrides: t, locale: e, labels:
|
|
3444
|
+
}, qa = (e, t) => {
|
|
3445
|
+
const [n, r] = j(() => ({ overrides: t, locale: e, labels: Ct(e, t) }));
|
|
3446
|
+
if (n.locale === e && qr(n.overrides, t)) return n.labels;
|
|
3447
|
+
const o = { overrides: t, locale: e, labels: Ct(e, t) };
|
|
3518
3448
|
return r(o), o.labels;
|
|
3519
|
-
},
|
|
3520
|
-
const [r, o] =
|
|
3449
|
+
}, _a = (e, t, n) => {
|
|
3450
|
+
const [r, o] = j(() => ({ scope: t, store: Xt(e, n) }));
|
|
3521
3451
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3522
|
-
const i = { scope: t, store:
|
|
3452
|
+
const i = { scope: t, store: Xt(e, n) };
|
|
3523
3453
|
return o(i), i.store;
|
|
3524
|
-
},
|
|
3525
|
-
const [n, r] =
|
|
3454
|
+
}, Je = (e, t) => {
|
|
3455
|
+
const [n, r] = j(() => ({ scope: e, value: t() }));
|
|
3526
3456
|
if (n.scope === e) return n.value;
|
|
3527
3457
|
const o = { scope: e, value: t() };
|
|
3528
3458
|
return r(o), o.value;
|
|
3529
|
-
},
|
|
3459
|
+
}, Ba = () => ua(Fa), rn = "on", Ia = "off", ja = Object.freeze({ kind: "unavailable" }), za = (e) => {
|
|
3530
3460
|
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3531
3461
|
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3532
|
-
},
|
|
3462
|
+
}, Ha = (e, t) => {
|
|
3533
3463
|
const n = ue(e.peek(t));
|
|
3534
3464
|
return n === null || n.document.kind === "failure" ? se(t) : n.document.name;
|
|
3535
|
-
},
|
|
3465
|
+
}, ls = ({
|
|
3536
3466
|
data: e,
|
|
3537
3467
|
config: t,
|
|
3538
3468
|
storageNamespace: n,
|
|
3539
3469
|
locale: r,
|
|
3540
3470
|
labels: o,
|
|
3541
3471
|
theme: i,
|
|
3542
|
-
renderFrame:
|
|
3472
|
+
renderFrame: l,
|
|
3543
3473
|
renderTreeFailure: u,
|
|
3544
3474
|
lockDocumentScroll: m = !1,
|
|
3545
3475
|
onMathDiagnostics: f,
|
|
3546
|
-
onEditGrant:
|
|
3476
|
+
onEditGrant: d,
|
|
3547
3477
|
draftConverter: h
|
|
3548
3478
|
}) => {
|
|
3549
|
-
|
|
3550
|
-
const
|
|
3551
|
-
}),
|
|
3552
|
-
const x =
|
|
3553
|
-
return Xe(
|
|
3479
|
+
Or(n), za(h);
|
|
3480
|
+
const v = vn(r), E = _r(i), k = qa(v, o), { revalidate: R } = Wn(), T = _(() => {
|
|
3481
|
+
}), L = Fe(t.dataPath), [A] = j(() => {
|
|
3482
|
+
const x = ma({ dataPath: L, onScope: ($) => T.current($) }), M = { documents: Io({ client: x, capacity: Math.max($a, t.multiView.maxPanels * 2) }), trees: ya(x) };
|
|
3483
|
+
return Xe(M, e), Ot(n, e.scope), { data: x, ...M, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3554
3484
|
});
|
|
3555
|
-
if (
|
|
3556
|
-
const x =
|
|
3557
|
-
|
|
3485
|
+
if (A.aligned.pageData !== e || A.aligned.storageNamespace !== n) {
|
|
3486
|
+
const x = A.aligned.pageData;
|
|
3487
|
+
A.aligned.pageData = e, A.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? A.aligned.pendingReader = e : Xe(A, e)), Ot(n, e.scope);
|
|
3558
3488
|
}
|
|
3559
|
-
const b =
|
|
3560
|
-
|
|
3561
|
-
const x =
|
|
3562
|
-
x !== null && (
|
|
3563
|
-
}, [e,
|
|
3489
|
+
const b = _a(we(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3490
|
+
z(() => {
|
|
3491
|
+
const x = A.aligned.pendingReader;
|
|
3492
|
+
x !== null && (A.aligned.pendingReader = null, nn(A), Xe(A, x));
|
|
3493
|
+
}, [e, A]), z(() => {
|
|
3564
3494
|
let x = !1;
|
|
3565
|
-
return T.current = (
|
|
3566
|
-
|
|
3495
|
+
return T.current = (M) => {
|
|
3496
|
+
M === e.scope || x || (x = !0, M !== null && (nn(A), Mr(n)), R());
|
|
3567
3497
|
}, () => {
|
|
3568
3498
|
T.current = () => {
|
|
3569
3499
|
};
|
|
3570
3500
|
};
|
|
3571
|
-
}, [e, R,
|
|
3572
|
-
const
|
|
3573
|
-
|
|
3574
|
-
|
|
3501
|
+
}, [e, R, A, n]);
|
|
3502
|
+
const g = _(t.settingsCookie);
|
|
3503
|
+
z(() => {
|
|
3504
|
+
g.current = t.settingsCookie;
|
|
3575
3505
|
}, [t.settingsCookie]);
|
|
3576
|
-
const [
|
|
3577
|
-
() =>
|
|
3578
|
-
document.cookie =
|
|
3506
|
+
const [a] = j(
|
|
3507
|
+
() => Sa(e.settings, (x) => {
|
|
3508
|
+
document.cookie = ir(g.current, x, window.location.protocol === "https:");
|
|
3579
3509
|
})
|
|
3580
|
-
), s =
|
|
3581
|
-
|
|
3510
|
+
), s = Je(e.scope, Ba), w = Je(e.scope, ha), O = _(k);
|
|
3511
|
+
z(() => {
|
|
3582
3512
|
O.current = k;
|
|
3583
3513
|
}, [k]);
|
|
3584
|
-
const
|
|
3514
|
+
const C = Je(
|
|
3585
3515
|
e.scope,
|
|
3586
|
-
() =>
|
|
3587
|
-
data:
|
|
3516
|
+
() => Wr({
|
|
3517
|
+
data: A.data,
|
|
3588
3518
|
conflictLabels: () => ({ ours: O.current.conflictOurs, theirs: O.current.conflictTheirs }),
|
|
3589
|
-
onSaveSettled: (x,
|
|
3590
|
-
|
|
3591
|
-
const
|
|
3592
|
-
|
|
3519
|
+
onSaveSettled: (x, M) => {
|
|
3520
|
+
M.kind === "saved" && A.documents.refresh(x);
|
|
3521
|
+
const $ = Ir(O.current, M, Ha(A.documents, x));
|
|
3522
|
+
$ !== null && s.announce($);
|
|
3593
3523
|
},
|
|
3594
3524
|
sideBySideSetting: {
|
|
3595
|
-
read: () =>
|
|
3596
|
-
write: (x) =>
|
|
3525
|
+
read: () => et(we(n).editPreview) === rn,
|
|
3526
|
+
write: (x) => Qe(we(n).editPreview, x ? rn : Ia)
|
|
3597
3527
|
},
|
|
3598
3528
|
editorShareSetting: {
|
|
3599
|
-
read: () =>
|
|
3600
|
-
write: (x) =>
|
|
3529
|
+
read: () => Kr(et(we(n).editSplit)),
|
|
3530
|
+
write: (x) => Qe(we(n).editSplit, String(x))
|
|
3601
3531
|
}
|
|
3602
3532
|
})
|
|
3603
|
-
), N =
|
|
3604
|
-
`),
|
|
3533
|
+
), N = Z(() => Te(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((x) => x.id).join(`
|
|
3534
|
+
`), K = Z(() => or(t, q.split(`
|
|
3605
3535
|
`)), [t, q]), G = _(f);
|
|
3606
|
-
|
|
3536
|
+
z(() => {
|
|
3607
3537
|
G.current = f;
|
|
3608
3538
|
}, [f]);
|
|
3609
|
-
const [
|
|
3610
|
-
G.current?.(x,
|
|
3611
|
-
}), J = f === void 0 ? void 0 :
|
|
3612
|
-
|
|
3539
|
+
const [B] = j(() => (x, M) => {
|
|
3540
|
+
G.current?.(x, M);
|
|
3541
|
+
}), J = f === void 0 ? void 0 : B, H = _(h);
|
|
3542
|
+
z(() => {
|
|
3613
3543
|
H.current = h;
|
|
3614
3544
|
}, [h]);
|
|
3615
|
-
const [ne] =
|
|
3545
|
+
const [ne] = j(() => {
|
|
3616
3546
|
let x = !1;
|
|
3617
3547
|
return {
|
|
3618
|
-
convert: (
|
|
3619
|
-
const
|
|
3620
|
-
return
|
|
3548
|
+
convert: (M, $) => {
|
|
3549
|
+
const I = H.current;
|
|
3550
|
+
return I === void 0 ? Promise.resolve(ja) : I.convert(M, $);
|
|
3621
3551
|
},
|
|
3622
3552
|
prepare: () => {
|
|
3623
3553
|
try {
|
|
3624
3554
|
H.current?.prepare?.();
|
|
3625
|
-
} catch (
|
|
3555
|
+
} catch (M) {
|
|
3626
3556
|
if (x) return;
|
|
3627
|
-
x = !0, console.error("[markdown-explorer] the draft converter's prepare threw",
|
|
3557
|
+
x = !0, console.error("[markdown-explorer] the draft converter's prepare threw", M);
|
|
3628
3558
|
}
|
|
3629
3559
|
}
|
|
3630
3560
|
};
|
|
3631
|
-
}), p = h === void 0 ? void 0 : ne,
|
|
3561
|
+
}), p = h === void 0 ? void 0 : ne, y = Z(
|
|
3632
3562
|
() => ({
|
|
3633
|
-
config:
|
|
3563
|
+
config: K,
|
|
3634
3564
|
labels: k,
|
|
3635
|
-
locale:
|
|
3565
|
+
locale: v,
|
|
3636
3566
|
theme: E,
|
|
3637
3567
|
storageNamespace: n,
|
|
3638
3568
|
scope: e.scope,
|
|
3639
3569
|
sources: e.sources,
|
|
3640
3570
|
notices: N,
|
|
3641
|
-
documents:
|
|
3642
|
-
trees:
|
|
3643
|
-
data:
|
|
3644
|
-
viewSettings:
|
|
3571
|
+
documents: A.documents,
|
|
3572
|
+
trees: A.trees,
|
|
3573
|
+
data: A.data,
|
|
3574
|
+
viewSettings: a,
|
|
3645
3575
|
treeSettings: b,
|
|
3646
3576
|
announcer: s,
|
|
3647
|
-
reveals:
|
|
3648
|
-
edits:
|
|
3649
|
-
onEditGrant:
|
|
3577
|
+
reveals: w,
|
|
3578
|
+
edits: C,
|
|
3579
|
+
onEditGrant: d,
|
|
3650
3580
|
draftConverter: p,
|
|
3651
3581
|
renderTreeFailure: u,
|
|
3652
3582
|
reportMathDiagnostics: J
|
|
3653
3583
|
}),
|
|
3654
|
-
[
|
|
3584
|
+
[K, k, v, E, n, e.scope, e.sources, N, A, a, b, s, w, C, d, p, u, J]
|
|
3655
3585
|
);
|
|
3656
|
-
return /* @__PURE__ */
|
|
3657
|
-
},
|
|
3658
|
-
const [o] =
|
|
3659
|
-
return /* @__PURE__ */
|
|
3660
|
-
},
|
|
3661
|
-
const { theme: n, labels: r } = D(), o =
|
|
3662
|
-
|
|
3663
|
-
o.kind === "redirect" &&
|
|
3664
|
-
}, [o, i,
|
|
3586
|
+
return /* @__PURE__ */ c(wn, { value: y, children: /* @__PURE__ */ c(Ua, { renderFrame: l, lockDocumentScroll: m }, e.scope) });
|
|
3587
|
+
}, Va = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3588
|
+
const [o] = j(ki);
|
|
3589
|
+
return /* @__PURE__ */ c("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 });
|
|
3590
|
+
}, Ua = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3591
|
+
const { theme: n, labels: r } = D(), o = st(), { hash: i } = ln(), l = qe(), u = _(null);
|
|
3592
|
+
Ca(t, u), z(() => {
|
|
3593
|
+
o.kind === "redirect" && l(`${o.href}${i}`, "browse");
|
|
3594
|
+
}, [o, i, l]);
|
|
3665
3595
|
const { location: m } = o, f = m.view;
|
|
3666
|
-
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3669
|
-
/* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3596
|
+
Na(u, f);
|
|
3597
|
+
const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...tt }), children: /* @__PURE__ */ c(Da, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...tt }), children: /* @__PURE__ */ c(Pa, { location: m }) }) : /* @__PURE__ */ c(ca, { location: m }), h = /* @__PURE__ */ F(Va, { ref: u, theme: n, view: f, children: [
|
|
3598
|
+
d,
|
|
3599
|
+
/* @__PURE__ */ c(ho, {}),
|
|
3600
|
+
/* @__PURE__ */ c(da, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3671
3601
|
] });
|
|
3672
3602
|
return e === void 0 ? h : e({ view: f, children: h });
|
|
3673
|
-
},
|
|
3603
|
+
}, as = Cr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
|
|
3674
3604
|
export {
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3605
|
+
Mt as $,
|
|
3606
|
+
ot as A,
|
|
3607
|
+
Wt as B,
|
|
3608
|
+
jr as C,
|
|
3609
|
+
sa as D,
|
|
3610
|
+
Il as E,
|
|
3611
|
+
ro as F,
|
|
3612
|
+
Hl as G,
|
|
3683
3613
|
Oe as H,
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3614
|
+
os as I,
|
|
3615
|
+
Ri as J,
|
|
3616
|
+
Yr as K,
|
|
3617
|
+
On as L,
|
|
3618
|
+
_o as M,
|
|
3619
|
+
il as N,
|
|
3620
|
+
kl as O,
|
|
3621
|
+
aa as P,
|
|
3622
|
+
$o as Q,
|
|
3623
|
+
$l as R,
|
|
3624
|
+
Po as S,
|
|
3625
|
+
st as T,
|
|
3626
|
+
da as U,
|
|
3627
|
+
Ne as V,
|
|
3628
|
+
Lr as W,
|
|
3629
|
+
Lt as X,
|
|
3630
|
+
Pr as Y,
|
|
3631
|
+
pn as Z,
|
|
3632
|
+
Ar as _,
|
|
3633
|
+
zr as a,
|
|
3634
|
+
ls as a0,
|
|
3635
|
+
Ct as a1,
|
|
3636
|
+
as as a2,
|
|
3637
|
+
Hr as b,
|
|
3638
|
+
qe as c,
|
|
3639
|
+
oa as d,
|
|
3640
|
+
tt as e,
|
|
3641
|
+
Sl as f,
|
|
3642
|
+
Mo as g,
|
|
3643
|
+
Vr as h,
|
|
3644
|
+
No as i,
|
|
3645
|
+
Oo as j,
|
|
3646
|
+
ae as k,
|
|
3647
|
+
Do as l,
|
|
3718
3648
|
ue as m,
|
|
3719
|
-
|
|
3720
|
-
|
|
3649
|
+
To as n,
|
|
3650
|
+
Ro as o,
|
|
3721
3651
|
me as p,
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3652
|
+
fo as q,
|
|
3653
|
+
lo as r,
|
|
3654
|
+
zl as s,
|
|
3655
|
+
rs as t,
|
|
3726
3656
|
D as u,
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3657
|
+
Co as v,
|
|
3658
|
+
is as w,
|
|
3659
|
+
bn as x,
|
|
3660
|
+
Ul as y,
|
|
3661
|
+
Vl as z
|
|
3732
3662
|
};
|