@aiquants/markdown-explorer 0.20.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.
@@ -1,27 +1,24 @@
1
- import { jsxs as $, jsx as d, Fragment as Pe } from "react/jsx-runtime";
2
- import * as y from "react";
3
- import { createContext as pe, use as re, useMemo as U, useSyncExternalStore as ee, useRef as _, useLayoutEffect as j, useCallback as P, useId as xe, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as z, useEffectEvent as ae } from "react";
4
- import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as Fe, useLocation as nn, useRevalidator as Vn } from "react-router";
5
- import { j as Zn, g as rn, z as Un, E as on, a as an, B as Gn, D as wt, G as Wn, H as be, e as Se, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-B-m9scLf.js";
6
- import { F as se, i as tr, G as nr, y as Y, x as rr, H as Et, z as Ve, I as or, J as ir, K as ar, L as lr, N as sr, f as dr, O as St, v as cr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as wr, U as gr, u as yt } from "./dataRoute-CObbjNxG.js";
7
- import { HostedScrollArea as xt, useMarkdownToolbarState as br, MarkdownViewer as ln } from "@aiquants/markdown";
8
- import { SOURCE_LINES_ATTRIBUTE as sn, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
9
- import { DEFAULT_CONTENT_ALIGN as Sr } from "@aiquants/markdown/viewer-settings";
10
- import { w as Je, r as Qe, a as yr, b as kt, s as we, c as xr } from "./storage-CmGHg7OA.js";
11
- import { createShouldRevalidate as kr } from "@aiquants/route-revalidation";
12
- const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
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
- viewerSpreadsheetSize: Object.freeze(["rows", "cols"]),
19
- viewerSpreadsheetCopyFailed: Object.freeze(["reason"]),
20
- viewerSpreadsheetCellAnnouncement: Object.freeze(["cell", "value"]),
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
- }, Cr = {
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
- }, Mr = Object.freeze({
599
- en: Object.freeze(dn),
600
- ja: Object.freeze(Cr)
601
- }), cn = Object.freeze(Object.keys(dn)), Ar = new Set(cn), Lr = (e) => Ar.has(e), Me = (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, un = (e) => {
602
- if (e === void 0) return Tr;
603
- if (Tt.includes(e)) return e;
604
- throw new RangeError(`[markdown-explorer] locale is the UI language (${Tt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Me(e)}`);
605
- }, Rt = (e, t) => {
606
- const n = Mr[un(e)];
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 ${Me(t)}`);
610
- if (!Zn(t))
611
- throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Me(t)}`);
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 (!Lr(i))
615
- throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${cn.join(", ")}`);
616
- const a = r[i];
617
- if (a === void 0) continue;
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 a !== u)
620
- throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Me(a)}`);
621
- if (typeof a == "string" && a.trim() === "")
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 = Rr[i];
624
- if (typeof a == "string" && m !== void 0) {
625
- for (const [, f] of a.matchAll(Or))
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((c) => `{${c}}`).join(", ")}`);
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] = a;
577
+ o[i] = l;
630
578
  }
631
579
  return Object.freeze(o);
632
- }, Nr = (e, t) => {
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((a) => Object.hasOwn(n, a) && Object.is(n[a], r[a]));
637
- }, Ot = Object.freeze(["light", "dark"]), Dr = (e) => {
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 (Ot.includes(e)) return e;
640
- throw new RangeError(`[markdown-explorer] theme must be ${Ot.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
641
- }, fn = pe(null), D = () => {
642
- const e = re(fn);
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
- }, Le = (e) => {
593
+ }, Ne = (e) => {
646
594
  const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
647
595
  return ee(t.subscribe, n, n);
648
- }, at = () => {
649
- const { config: e } = D(), t = _n()["*"], [n] = In(), r = n.toString();
650
- return U(() => rn(e, t, new URLSearchParams(r)), [e, t, r]);
651
- }, mn = {
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
- }, le = (e, t) => e[mn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
661
- const { labels: o } = D(), i = le(o, e.reason), a = o[mn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
662
- return /* @__PURE__ */ $("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: [
663
- /* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: i }),
664
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: a }),
665
- e.reason === "unauthorized" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
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
- }, Pr = (e, t) => {
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 le(e, n.failure.reason);
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(le(e, r.failure.reason));
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
- }, Fr = (e, t, n) => {
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(le(e, t.failure.reason));
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
- }, $r = "<<<<<<<", qr = "=======", _r = ">>>>>>>", Ct = (e, t) => e === t || e.startsWith(`${t} `), Mt = (e) => Ir(e.split(`
720
- `)), Ir = (e) => {
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 a = i.charCodeAt(0);
726
- a !== 60 && a !== 61 && a !== 62 || (Ct(i, $r) ? (n = o, r = null) : i === qr ? n !== null && r === null ? r = o : n = null : Ct(i, _r) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
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
- }, At = (e) => e.includes(`\r
677
+ }, Dt = (e) => e.includes(`\r
730
678
  `) ? `\r
731
679
  ` : `
732
680
  `, Ze = (e) => e.replace(/\r\n?/gu, `
733
- `), Br = (e, t) => t === `
681
+ `), Ur = (e, t) => t === `
734
682
  ` ? e : e.replaceAll(`
735
683
  `, `\r
736
- `), zr = 3, jr = /^\d+(?:\.\d+)?$/u, Hr = (e) => {
737
- if (e === null || !jr.test(e)) return 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 >= an && t <= on ? t : null;
740
- }, Ue = Object.freeze({ kind: "idle" }), Lt = Object.freeze({ kind: "draft" }), Vr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
741
- const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), c = Oe();
742
- let h = null, g = null, E = null;
743
- const k = (l, s) => {
744
- l.value = { ...l.value, ...s }, c.emit();
745
- }, R = (l, s) => i.get(l) === s, T = async (l, s) => {
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: v } = s.controller;
695
+ const { signal: w } = s.controller;
748
696
  k(s, { phase: { kind: "opening" } });
749
- const O = await e.edit(l, v);
750
- if (!R(l, s) || v.aborted || !("kind" in O)) return;
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 M = Ze(O.text), N = O.kind === "draft";
760
- s.base = { text: M, version: N ? null : O.version }, s.draft = M, s.ending = At(O.text), k(s, { phase: { kind: "editing" }, history: N ? !1 : O.history, dirty: !1, save: N ? Lt : Ue, generation: s.value.generation + 1 });
761
- }, A = (l) => {
762
- const s = i.get(l);
763
- s !== void 0 && (s.controller.abort(), i.delete(l), u.delete(l));
764
- }, L = (l, s, v) => (l.set(s, v), () => {
765
- l.get(s) === v && l.delete(s);
766
- }), b = (l, s, v, O = {}) => {
767
- k(s, { ...O, save: v }), n(l, v);
768
- }, w = async (l) => {
769
- m.get(l)?.flush();
770
- const s = i.get(l);
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: v } = s.base;
773
- if (v === null) {
774
- n(l, Lt);
720
+ const { version: w } = s.base;
721
+ if (w === null) {
722
+ n(a, Pt);
775
723
  return;
776
724
  }
777
- const O = Mt(s.draft).length;
725
+ const O = Nt(s.draft).length;
778
726
  if (O > 0) {
779
- b(l, s, { kind: "conflicts", count: O });
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: M } = s.controller;
784
- let N = { text: s.base.text, version: v }, q = s.draft, W = !1;
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 < zr; G += 1) {
787
- const I = await e.save(l, N.version, Br(q, s.ending), M);
788
- if (!R(l, s) || M.aborted || !("kind" in I)) return;
789
- if (I.kind === "saved") {
790
- m.get(l)?.flush(), s.base = { text: q, version: I.version }, b(l, s, { kind: "saved", merged: W }, { dirty: s.draft !== q });
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 (I.kind === "grant") {
794
- b(l, s, { kind: "grant", href: I.href });
741
+ if (B.kind === "grant") {
742
+ b(a, s, { kind: "grant", href: B.href });
795
743
  return;
796
744
  }
797
- if (I.kind === "failure") {
798
- b(l, s, { kind: "failed", failure: I.failure });
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-BIXNcrea.js");
802
- if (!R(l, s) || M.aborted) return;
803
- const H = m.get(l);
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(I.text), p = J(N.text, s.draft, ne, t());
806
- if (N = { text: ne, version: I.version }, s.base = N, s.ending = At(I.text), s.draft = p.text, H?.adopt(p.text), p.kind === "conflicts") {
807
- b(l, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
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 (W = !0, q = p.text, q === N.text) {
811
- b(l, s, { kind: "saved", merged: W }, { dirty: !1, generation: s.value.generation + 1 });
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(l, s, { kind: "failed", failure: { reason: "failed" } });
764
+ b(a, s, { kind: "failed", failure: { reason: "failed" } });
817
765
  };
818
766
  return {
819
- session: (l) => i.get(l)?.value,
820
- subscribe: c.subscribe,
821
- start: (l, s) => {
822
- const v = i.get(l);
823
- if (v !== void 0) {
824
- k(v, { request: { anchor: s }, view: "editor" }), (v.value.phase.kind === "failed" || v.value.phase.kind === "grant") && T(l, v);
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
- a.delete(l);
775
+ l.delete(a);
828
776
  const O = {
829
- value: { path: l, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ue, generation: 0, request: { anchor: s } },
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(l, O), T(l, O);
784
+ i.set(a, O), T(a, O);
837
785
  },
838
- retry: (l) => {
839
- const s = i.get(l);
840
- s === void 0 || s.value.phase.kind === "editing" || T(l, s);
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: (l) => {
843
- const s = i.get(l);
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: (l, s) => {
847
- const v = i.get(l);
848
- if (v === void 0 || v.base === null) return;
849
- v.draft = s;
850
- const O = {}, M = s !== v.base.text;
851
- M !== v.value.dirty && (O.dirty = M);
852
- const { save: N } = v.value;
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 = Mt(s).length;
855
- q === 0 ? O.save = Ue : q !== N.count && (O.save = { kind: "conflicts", count: q });
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(v, O);
805
+ (O.dirty !== void 0 || O.save !== void 0) && k(w, O);
858
806
  },
859
- consumeRequest: (l) => {
860
- const s = i.get(l);
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: w,
864
- replaceDraft: (l, s) => {
865
- const v = m.get(l);
866
- v?.flush();
867
- const O = i.get(l);
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 M = Ze(s);
870
- O.draft = M, v?.adopt(M), k(O, { dirty: M !== O.base.text, generation: O.value.generation + 1 });
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: (l) => {
873
- if (!i.has(l)) return;
874
- const s = m.get(l), v = s === void 0 ? null : s.returnPoint();
875
- A(l), v === null ? a.delete(l) : a.set(l, v), c.emit();
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: (l) => {
878
- const s = a.get(l) ?? null;
879
- return a.delete(l), s;
825
+ takeReturn: (a) => {
826
+ const s = l.get(a) ?? null;
827
+ return l.delete(a), s;
880
828
  },
881
- dirtyPaths: () => [...i.values()].filter((l) => l.value.dirty).map((l) => l.value.path),
882
- discard: (l) => {
883
- for (const s of l) A(s);
884
- l.length > 0 && c.emit();
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: (l) => u.get(l),
888
- set: (l, s) => {
889
- i.has(l) && u.set(l, s);
835
+ get: (a) => u.get(a),
836
+ set: (a, s) => {
837
+ i.has(a) && u.set(a, s);
890
838
  }
891
839
  },
892
- bindEditor: (l, s) => L(m, l, s),
893
- bindView: (l, s) => L(f, l, s),
894
- viewAnchor: (l) => {
895
- const s = f.get(l);
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: (l) => m.get(l)?.flush(),
846
+ flush: (a) => m.get(a)?.flush(),
899
847
  flushDrafts: () => {
900
- for (const l of m.values()) l.flush();
848
+ for (const a of m.values()) a.flush();
901
849
  },
902
- nextConflict: (l) => m.get(l)?.nextConflict() === !0,
850
+ nextConflict: (a) => m.get(a)?.nextConflict() === !0,
903
851
  hasSessions: () => i.size > 0,
904
- unsavedAmong: (l) => {
852
+ unsavedAmong: (a) => {
905
853
  for (const s of m.values()) s.flush();
906
- return l.filter((s) => i.get(s)?.value.dirty === !0);
854
+ return a.filter((s) => i.get(s)?.value.dirty === !0);
907
855
  },
908
- askToDiscard: (l) => new Promise((s) => {
856
+ askToDiscard: (a) => new Promise((s) => {
909
857
  E?.settle(!1);
910
- const v = {
911
- paths: l,
858
+ const w = {
859
+ paths: a,
912
860
  settle: (O) => {
913
- if (E === v) {
914
- if (E = null, O) for (const M of l) A(M);
915
- c.emit(), s(O);
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 = v, c.emit();
867
+ E = w, d.emit();
920
868
  }),
921
869
  discardRequest: () => E,
922
870
  sideBySide: () => (h ??= r.read(), h),
923
- setSideBySide: (l) => {
924
- h !== l && (h = l, r.write(l), c.emit());
871
+ setSideBySide: (a) => {
872
+ h !== a && (h = a, r.write(a), d.emit());
925
873
  },
926
- editorShare: () => (g ??= o.read() ?? Un, g),
927
- setEditorShare: (l) => {
928
- if (!Number.isFinite(l)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(l)}`);
929
- const s = Math.min(on, Math.max(an, l));
930
- g !== s && (g = s, o.write(s));
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: (l, s) => {
933
- const v = i.get(l);
934
- v === void 0 || v.value.view === s || (m.get(l)?.beforeView(s), k(v, { view: s, previewPrepared: v.value.previewPrepared || s === "preview" }));
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: (l) => {
937
- const s = i.get(l);
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
- }, hn = (e) => {
889
+ }, bn = (e) => {
942
890
  e.preventDefault(), e.stopPropagation();
943
- }, Zr = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, pn = "data-aqmx-content-pane", et = Object.freeze({ [pn]: "" }), Ur = "--aqmx-dialog-left", Gr = "--aqmx-dialog-top", Wr = '[data-testid="markdown-explorer"]', Kr = (e) => {
944
- const t = e.closest(Wr)?.querySelectorAll(`[${pn}]`), n = t?.item(t.length - 1);
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
- }, Xr = (e) => {
948
- const t = Zr(getComputedStyle(e).marginTop);
895
+ }, to = (e) => {
896
+ const t = Yr(getComputedStyle(e).marginTop);
949
897
  if (Number.isNaN(t)) return null;
950
- const n = Kr(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top: a } = Gn(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
951
- return e.style.setProperty(Ur, `${String(i)}px`), e.style.setProperty(Gr, `${String(a)}px`), n;
952
- }, Yr = (e) => e.preventDefault(), vn = ({ open: e, onOpen: t, onDismiss: n }) => {
953
- const r = _(null), o = _(null), i = _(!1), a = _(t);
954
- j(() => {
955
- a.current = t;
956
- }, [t]), j(() => {
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 c = r.current;
959
- if (c !== null)
960
- if (e && !c.open) {
961
- const h = c.ownerDocument.activeElement;
962
- o.current = h instanceof HTMLElement ? h : null, c.showModal(), a.current?.();
963
- } else !e && c.open && (c.close(), o.current?.isConnected === !0 && o.current.focus(), o.current = null);
964
- }, [e]), j(() => {
965
- const c = r.current;
966
- if (!e || c === null) return;
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 g = null;
916
+ let v = null;
969
917
  const E = () => {
970
- const R = Xr(c);
971
- R === null || R === g || (g !== null && h.unobserve(g), h.observe(R), g = 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(c);
974
- const k = c.ownerDocument.defaultView;
975
- return k?.addEventListener("resize", E), c.ownerDocument.addEventListener("scroll", E, { capture: !0, passive: !0 }), () => {
976
- h.disconnect(), k?.removeEventListener("resize", E), c.ownerDocument.removeEventListener("scroll", E, { capture: !0 });
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
- (c) => {
981
- c.key !== "Escape" || c.defaultPrevented || (hn(c), n());
928
+ (d) => {
929
+ d.key !== "Escape" || d.defaultPrevented || (bn(d), n());
982
930
  },
983
931
  [n]
984
932
  ), m = P(
985
- (c) => {
986
- c.target === c.currentTarget && n();
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: Yr, onClose: f };
993
- }, wn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: a, testId: u }) => {
994
- const m = _(null), f = xe(), c = xe(), h = P(() => m.current?.focus(), []), g = vn({ open: e, onOpen: h, onDismiss: a });
995
- return /* @__PURE__ */ d("dialog", { ...g, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": c, "data-testid": u, children: /* @__PURE__ */ $("div", { className: "aqmx-confirm-panel", children: [
996
- /* @__PURE__ */ d("p", { id: f, className: "aqmx-confirm-title", children: t }),
997
- /* @__PURE__ */ d("p", { id: c, className: "aqmx-confirm-body", children: n }),
998
- /* @__PURE__ */ $("div", { className: "aqmx-confirm-actions", children: [
999
- /* @__PURE__ */ d("button", { ref: m, type: "button", className: "aqmx-callout-action", "data-testid": `${u}-cancel`, onClick: a, children: o }),
1000
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
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
- }, gn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, Jr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Qr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), eo = (e, t, n) => {
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 a = i.lazy === !0 ? n(i.path) : void 0, u = i.lazy === !0 ? a?.status === "loaded" ? a.entries : null : i.children === void 0 ? [] : i.children;
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
- }, to = (e, t, n) => {
971
+ }, lo = (e, t, n) => {
1024
972
  const r = Ee(e.read(t));
1025
- if (r === void 0 || r.status === "deferred") return Jr;
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 = eo(r.entries, n, (a) => e.children(t, a));
1028
- if (o !== null) return { readme: { status: "ok", readme: wt(o) }, claim: !1 };
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" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: wt(i.entries) }, claim: !0 };
1031
- }, no = (e, t, n) => {
1032
- const { readme: r } = to(e, t, n);
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
- }, ro = (e, t, n) => {
1035
- const r = Bn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
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 } = rn(e, r.params["*"], new URLSearchParams(t.search));
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
- }, bn = (e) => {
996
+ }, kn = (e) => {
1049
997
  const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
1050
- return ee(t.subscribe, n, oo);
1051
- }, En = () => !1, oo = () => {
1052
- }, io = () => {
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, En);
1055
- }, ao = () => {
1002
+ return ee(e.subscribe, e.hasSessions, Tn);
1003
+ }, fo = () => {
1056
1004
  const { edits: e } = D();
1057
- return ee(e.subscribe, e.sideBySide, En);
1058
- }, lo = () => null, so = () => {
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 = ro(n, E, (R, T) => no(r, R, T));
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
- ), a = zn(i), u = io();
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, lo), f = a.state === "blocked", c = f ? o.current : m === null ? [] : m.paths, h = c.map((E) => se(E)).join(", "), g = c.length > 0 && c.every((E) => e.session(E)?.save.kind === "draft");
1074
- return /* @__PURE__ */ d(
1075
- wn,
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: g ? t.draftDiscardTitle : t.unsavedTitle,
1079
- body: g ? t.draftDiscardBody(h) : t.unsavedBody(h),
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 (a.state === "blocked") {
1085
- e.discard(o.current), a.proceed();
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 (a.state === "blocked") {
1092
- a.reset();
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 co({
1048
+ function po({
1101
1049
  title: e,
1102
1050
  titleId: t,
1103
1051
  ...n
1104
1052
  }, r) {
1105
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1061
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1114
1062
  id: t
1115
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 uo = /* @__PURE__ */ y.forwardRef(co);
1122
- let Ge = null;
1123
- const Sn = () => (Ge ??= import("./EditSurface-D1yklbWu.js").catch((e) => {
1124
- throw Ge = null, e;
1125
- }), Ge), fo = () => {
1126
- Sn().catch(() => {
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
- }, mo = (e) => {
1129
- const { default: t } = re(Sn());
1130
- return /* @__PURE__ */ d(t, { ...e });
1076
+ }, go = (e) => {
1077
+ const { default: t } = re(Rn());
1078
+ return /* @__PURE__ */ c(t, { ...e });
1131
1079
  };
1132
- class ho extends tn {
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 lt = `[${sn}]`, po = "[data-aqmd-content]", vo = '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]', wo = 200, Re = (e) => Er(e.getAttribute(sn)), go = (e, t) => {
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(lt)) {
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
- }, bo = (e, t) => {
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
- }, Eo = (e) => e.closest(po) !== null && e.closest(vo) === null, So = (e, t, n) => {
1159
- const r = go(e, t);
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: Ne(e) };
1112
+ return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: De(e) };
1165
1113
  }
1166
- const a = To(o, n);
1167
- return a === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Ne(o) } : { lines: r.lines, word: a.text, occurrence: a.occurrence, clientTop: a.clientTop };
1168
- }, yo = (e, t) => {
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 a of e.querySelectorAll(lt)) {
1171
- const u = Re(a);
1118
+ for (const l of e.querySelectorAll(ct)) {
1119
+ const u = Re(l);
1172
1120
  if (u === null) continue;
1173
- n ??= ko(t, a);
1174
- const { top: m, bottom: f } = a.getBoundingClientRect();
1175
- m <= n && n < f ? r = { lines: u, block: a } : o === null && m >= n && (o = { lines: u, block: a });
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: Ne(i.block) };
1179
- }, xo = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ko = (e, t) => {
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 xo(e) + (Number.isFinite(n) ? n : 0);
1182
- }, To = (e, t) => {
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 > wo || /[\r\n]/u.test(r)) return null;
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: bo(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1190
- }, Xl = (e, t) => {
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 a = 0;
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 (a === t.occurrence) return { line: u, column: f };
1199
- a += 1;
1146
+ if (l === t.occurrence) return { line: u, column: f };
1147
+ l += 1;
1200
1148
  }
1201
1149
  }
1202
- return a > 0 ? Ro(n, r, o, t.word) ?? i : i;
1203
- }, Ro = (e, t, n, r) => {
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
- }, Oo = (e, t) => {
1157
+ }, No = (e, t) => {
1210
1158
  let n = null, r = null;
1211
- for (const o of e.querySelectorAll(lt)) {
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
- }, Co = (e, t) => {
1217
- const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o = Re(e);
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
- }, Ne = (e) => {
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: a, height: u } = i.getBoundingClientRect();
1229
- if (u > 0) return a;
1176
+ const { top: l, height: u } = i.getBoundingClientRect();
1177
+ if (u > 0) return l;
1230
1178
  }
1231
1179
  return e.getBoundingClientRect().top;
1232
- }, st = Object.freeze({
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
- }), Yl = (e) => st[e], $e = () => {
1238
- const e = jn();
1185
+ }), os = (e) => dt[e], qe = () => {
1186
+ const e = Gn();
1239
1187
  return P(
1240
1188
  (t, n) => {
1241
- e(t, st[n]);
1189
+ e(t, dt[n]);
1242
1190
  },
1243
1191
  [e]
1244
1192
  );
1245
- }, Mo = ({ navigation: e, ...t }) => /* @__PURE__ */ d(Hn, { ...t, ...st[e] }), yn = (e) => {
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
- }, Ao = (e, t) => {
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 a = P(
1208
+ const l = P(
1261
1209
  (f) => {
1262
1210
  if (r.current !== f) return;
1263
- const c = o.current;
1264
- if (c !== null) {
1265
- c.then(() => a(f));
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 g = Promise.allSettled([h.promise]);
1272
- o.current = g, g.then(() => {
1273
- o.current === g && (o.current = null);
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 c = t(f);
1280
- c !== r.current && (i(), c !== null && (r.current = c, n.current = window.setTimeout(() => {
1281
- n.current = null, a(c);
1282
- }, Wn)));
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, a]
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 U(
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
- }, Lo = it(() => import("./NativeScrollBar-CcNqDlO6.js").then((e) => ({ default: e.NativeScrollBar })));
1301
- class No extends tn {
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 Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children: /* @__PURE__ */ d(ke, { fallback: null, children: /* @__PURE__ */ d(Lo, { scroller: e, withCircle: t }) }) }), xn = (e) => /* @__PURE__ */ d(Do, { scroller: e, withCircle: !0 }), kn = () => {
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 a = e.get(o);
1329
- if (a !== void 0 && a > 1) {
1330
- e.set(o, a - 1);
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
- }, De = (e, t) => {
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, a) => De(i, t[a]));
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) && De(n[i], r[i]));
1347
- }, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Tn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Fo = ({ client: e, capacity: t }) => {
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 = kn(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
1350
- let a = 0;
1351
- const u = o.emit, m = () => (a += 1, a), f = () => {
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
- }, c = (b, w) => {
1358
- n.delete(b), n.set(b, w);
1359
- }, h = (b) => performance.now() - b.validatedAt >= Po, g = (b, w, l) => {
1360
- const s = n.get(b), v = ue(s?.snapshot), O = l || s?.refreshPending === !0, M = Te(e.document(b, { refresh: O }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: M, previous: v }, validatedAt: performance.now(), opened: w, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
1361
- return c(b, N), f(), M.then((q) => {
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, w, l, s, v, O) => {
1365
- w.background === l && (w.background = null, !(n.get(b) !== w || w.snapshot !== s) && (v.kind === "failure" && s.document.kind !== "failure" || (w.validatedAt = O, w.stamp = m(), De(s.document, v) || (w.snapshot = { status: "loaded", document: v }), u())));
1366
- }, k = async (b, w) => {
1367
- const l = w.snapshot;
1368
- if (l.status !== "loaded") return null;
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
- w.background = s;
1371
- const v = performance.now(), O = e.document(b, { refresh: w.refreshPending });
1372
- w.refreshPending = !1;
1373
- const M = await O, N = w.background === s && n.get(b) === w && w.snapshot === l;
1374
- return E(b, w, s, l, M, v), N ? M : null;
1375
- }, R = (b, w) => {
1376
- const { snapshot: l } = w;
1377
- return l.status === "pending" ? !1 : l.status === "loaded" && l.document.kind !== "failure" ? (k(b, w), !1) : (l.status === "loaded" && i.add(l), g(b, !0, !1), !0);
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 w = r.hold(b);
1380
- let l = !1;
1327
+ const g = r.hold(b);
1328
+ let a = !1;
1381
1329
  return () => {
1382
- if (l) return;
1383
- l = !0, w();
1330
+ if (a) return;
1331
+ a = !0, g();
1384
1332
  const s = n.get(b);
1385
- s !== void 0 && c(b, s), f();
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 w = n.get(b);
1394
- w !== void 0 && w.snapshot.status !== "deferred" || (g(b, !1, !1), u());
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 w = r.resumes(b), l = T(b), s = n.get(b);
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 g(b, !0, !1), u(), l;
1400
- if (c(b, s), w) return l;
1401
- const { snapshot: v } = s;
1402
- return v.status === "pending" ? (s.opened = !0, l) : v.document.kind === "failure" ? (s.opened || h(s) ? (i.add(v), g(b, !0, !1), u()) : s.opened = !0, l) : (s.opened = !0, s.background === null && h(s) && k(b, s), l);
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 w = n.get(b);
1407
- w === void 0 || w.snapshot.status !== "loaded" || w.snapshot.document.kind !== "failure" || (g(b, !0, !1), u());
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, w) => {
1410
- const l = performance.now(), s = Te(
1411
- w.then(
1412
- (q) => q === null ? Nt : { status: "loaded", document: q },
1413
- () => Nt
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
- ), v = n.get(b);
1416
- if (v !== void 0 && v.snapshot.status === "loaded") {
1417
- const q = v.snapshot, W = {};
1418
- v.background = W, s.then((G) => {
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, v, W, q, G.document, l);
1368
+ E(b, w, K, q, G.document, a);
1421
1369
  return;
1422
1370
  }
1423
- v.background === W && (v.background = null);
1371
+ w.background === K && (w.background = null);
1424
1372
  });
1425
1373
  return;
1426
1374
  }
1427
- const O = v !== void 0 && v.snapshot.status === "pending" ? v.snapshot.previous : null, M = { status: "pending", promise: s, previous: O }, N = { snapshot: M, validatedAt: l, opened: v?.opened === !0, background: null, refreshPending: v?.refreshPending === !0, seeded: M, stamp: m() };
1428
- c(b, N), f(), s.then((q) => {
1429
- n.get(b) === N && (q.status === "deferred" && r.isHeld(b) ? g(b, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
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 [w, l] of [...n]) {
1435
- if (l.validatedAt = Number.NEGATIVE_INFINITY, l.opened = !0, l.refreshPending = !0, !r.isHeld(w)) continue;
1436
- const { snapshot: s } = l;
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(w, l) && (b = !0);
1386
+ R(g, a) && (b = !0);
1439
1387
  continue;
1440
1388
  }
1441
1389
  s.promise.then(() => {
1442
- n.get(w) === l && l.refreshPending && r.isHeld(w) && R(w, l) && u();
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 w = n.get(b);
1449
- if (w !== void 0 && Tn(w.snapshot)) {
1450
- w.refreshPending = !0;
1451
- const s = await k(b, w);
1452
- return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : Dt;
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 l = g(b, !0, !0);
1455
- return u(), l.snapshot.status !== "pending" ? We : (await l.snapshot.promise, n.get(b) === l ? Dt : We);
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()) g(b, !0, !1);
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 $o({
1414
+ function jo({
1467
1415
  title: e,
1468
1416
  titleId: t,
1469
1417
  ...n
1470
1418
  }, r) {
1471
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1427
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1480
1428
  id: t
1481
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 qo = /* @__PURE__ */ y.forwardRef($o);
1492
- function _o({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1453
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1506
1454
  id: t
1507
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 Io = /* @__PURE__ */ y.forwardRef(_o);
1516
- function Bo({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1477
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1530
1478
  id: t
1531
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 zo = /* @__PURE__ */ y.forwardRef(Bo), jo = 2e3, Pt = Object.freeze({ outcome: "idle" }), Ho = (e) => {
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
- }, Vo = ({ text: e }) => {
1541
- const { announcer: t, labels: n } = D(), [r, o] = z(Pt);
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(Pt), jo);
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
- }, a = () => {
1550
- Ho(e).then(
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__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ d(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ d(zo, {}) : /* @__PURE__ */ d(Io, {}) })
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"), Zo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => re(he) === "content" ? /* @__PURE__ */ d(xt, { scrollerProps: e, children: t }) : /* @__PURE__ */ d(xt, { scrollerProps: { ...e, style: Zo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: xn, children: t });
1559
- function Uo({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1520
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1573
1521
  id: t
1574
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 Go = /* @__PURE__ */ y.forwardRef(Uo);
1581
- function Wo({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1542
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1595
1543
  id: t
1596
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 Ko = /* @__PURE__ */ y.forwardRef(Wo), qe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
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__ */ $("div", { className: "aqmx-document-toolbar", children: [
1609
- /* @__PURE__ */ d("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
1610
- /* @__PURE__ */ d("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
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__ */ d("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__ */ d(Ko, {}) }),
1613
- /* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ d(Go, {}) })
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 Xo({
1564
+ function ti({
1617
1565
  title: e,
1618
1566
  titleId: t,
1619
1567
  ...n
1620
1568
  }, r) {
1621
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1577
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1630
1578
  id: t
1631
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aqmx-document-stage" }), Qo = ({ document: e }) => {
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__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1640
- /* @__PURE__ */ d(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ d(Yo, {}) }),
1641
- /* @__PURE__ */ d(ve, { scrollerProps: Jo, children: /* @__PURE__ */ $("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1642
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1643
- /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
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
- }, _e = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ei = (e) => {
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
- }, ti = /(%[0-9A-Fa-f]{2})/u, dt = (e) => {
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(ti).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
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
- }, Rn = (e) => `#${encodeURIComponent(e)}`, ni = (e) => {
1601
+ }, An = (e) => `#${encodeURIComponent(e)}`, ai = (e) => {
1654
1602
  if (e === "#") return !0;
1655
- const t = dt(e);
1603
+ const t = ut(e);
1656
1604
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
1657
- }, On = (e, t) => {
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
- }, ri = "http://www.w3.org/1999/xhtml", Ft = (e, t) => {
1610
+ }, si = "http://www.w3.org/1999/xhtml", _t = (e, t) => {
1663
1611
  if (t === "") return null;
1664
- const n = On(e, t);
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 === ri && r.getAttribute("name") === t) return r;
1615
+ if (r.localName === "a" && r.namespaceURI === si && r.getAttribute("name") === t) return r;
1668
1616
  return null;
1669
- }, Cn = (e, t) => {
1617
+ }, Dn = (e, t) => {
1670
1618
  if (e === null || !t.startsWith("#")) return null;
1671
- const n = Ft(e, t.slice(1));
1619
+ const n = _t(e, t.slice(1));
1672
1620
  if (n !== null) return n;
1673
- const r = dt(t);
1674
- return r === null ? null : Ft(e, r);
1675
- }, $t = (e) => {
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
- }, oi = (e) => {
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
- }, ii = (e, t) => {
1687
- const n = t.closest(_e), r = n !== null && e.contains(n) ? n : e;
1688
- if (r.scrollHeight > r.clientHeight && $t(r)) return r;
1689
- const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: a } = e.ownerDocument;
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 ($t(u) && u.scrollHeight > u.clientHeight && u.clientHeight < o) return u;
1692
- return a instanceof Element && oi(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
1693
- }, ai = Object.freeze({
1694
- scrollerOf: ii,
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(tt);
1644
+ e.scrollIntoView(nt);
1697
1645
  }
1698
- }), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), li = (e, t) => {
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
- }, si = (e, t) => {
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), a = t.getBoundingClientRect(), u = a.height + i + Number.parseFloat(o) > e.clientHeight;
1709
- if (!u && Math.abs(a.top - i - n) < 1) {
1710
- t.scrollIntoView(tt);
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 ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(tt);
1714
- }, di = (e, t) => {
1715
- const n = t.scrollerOf(e, e.querySelector(_e) ?? e);
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
- }, qt = (e, t, n) => {
1665
+ }, It = (e, t, n) => {
1718
1666
  if (e === null) return null;
1719
- const r = Cn(e, t);
1720
- return r === null ? (ni(t) && di(e, n), null) : (li(e, r), si(n.scrollerOf(e, r), r), n.reveal(r), r);
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 ci({
1670
+ function pi({
1723
1671
  title: e,
1724
1672
  titleId: t,
1725
1673
  ...n
1726
1674
  }, r) {
1727
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1683
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1736
1684
  id: t
1737
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 ui = /* @__PURE__ */ y.forwardRef(ci);
1742
- function fi({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1703
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1756
1704
  id: t
1757
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 mi = /* @__PURE__ */ y.forwardRef(fi);
1766
- function hi({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1727
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1780
1728
  id: t
1781
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 pi = /* @__PURE__ */ y.forwardRef(hi);
1790
- function vi({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1751
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1804
1752
  id: t
1805
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = Object.freeze({ [nt]: "allow" }), gi = `[${nt}="${rt[nt]}"]`, bi = () => {
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(gi) !== null || (t.preventDefault(), t.stopPropagation());
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
- }, Ae = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1, Mn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), It = `[data-testid="${Mn["data-testid"]}"]`, Si = pe(null), yi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ei ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Bt = (e, t, n) => {
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 < Ae.length ? o : null;
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 ? Ae.findIndex((o) => o > t) : Ae.findLastIndex((o) => o < t);
1784
+ const r = n === 1 ? Le.findIndex((o) => o > t) : Le.findLastIndex((o) => o < t);
1837
1785
  return r === -1 ? null : r;
1838
- }, zt = (e, t, n) => {
1786
+ }, Vt = (e, t, n) => {
1839
1787
  if (e.mode === "level") {
1840
- const o = Bt(e, null, n);
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 = Bt(e, t.scale, n);
1792
+ const r = Ht(e, t.scale, n);
1845
1793
  return r === null ? null : { mode: "level", index: r, base: t.base };
1846
- }, xi = (e, t) => {
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
- }, jt = (e) => {
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
- }, ki = (e) => {
1854
- const t = Ae[e];
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
- }, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ti = ({ document: e }) => {
1858
- const { labels: t } = D(), n = re(Si), [r] = z(() => n === null ? null : n.read(e.url)), [o, i] = z(r === null ? _t : r.zoom), [a, u] = z(r === null ? null : r.reported), [m, f] = z(null), c = _(null), h = P((w) => {
1859
- const { naturalWidth: l, naturalHeight: s } = w;
1860
- u((v) => Ht(v, l, s));
1861
- }, []), g = P(
1862
- (w) => {
1863
- c.current = w, !(w === null || !w.complete) && (w.naturalWidth > 0 || w.naturalHeight > 0 ? h(w) : w.decode().then(
1864
- () => h(w),
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 && a !== null && n.save(e.url, { zoom: o, reported: a });
1873
- }, [n, e.url, o, a]), j(() => {
1874
- const w = c.current;
1875
- if (w === null || a === null || o.mode !== "fit") return;
1876
- const l = () => f((v) => Ht(v, w.clientWidth, w.clientHeight));
1877
- if (l(), typeof ResizeObserver > "u") return;
1878
- const s = new ResizeObserver(l);
1879
- return s.observe(w), () => s.disconnect();
1880
- }, [a, o.mode]);
1881
- const E = a === null || m === null ? null : yi(a, m), k = zt(o, E, -1), R = zt(o, E, 1), T = o.mode === "level" ? ki(o.index) : null, A = _({ zoomIn: R, zoomOut: k });
1882
- j(() => {
1883
- A.current = { zoomIn: R, zoomOut: k };
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 L = _(null);
1886
- j(() => {
1887
- const w = L.current, l = c.current?.closest(It);
1888
- L.current = null, !(w === null || l === null || l === void 0) && (l.scrollLeft = w.across * l.scrollWidth - w.x, l.scrollTop = w.down * l.scrollHeight - w.y);
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 w = c.current?.closest(It);
1891
- if (w == null) return;
1892
- let l = null;
1893
- const s = (M) => {
1894
- const N = jt(M.touches);
1895
- l = N === null ? null : { distance: N.distance, steps: 0 };
1896
- }, v = (M) => {
1897
- const N = jt(M.touches);
1898
- if (l === null || N === null) return;
1899
- M.preventDefault();
1900
- const q = xi(l.distance, N.distance);
1901
- if (q === l.steps) return;
1902
- const W = q > l.steps ? 1 : -1, G = W === 1 ? A.current.zoomIn : A.current.zoomOut;
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
- l.steps += W;
1905
- const I = w.getBoundingClientRect(), J = N.middle.x - I.left, H = N.middle.y - I.top;
1906
- L.current = w.scrollWidth > 0 && w.scrollHeight > 0 ? { x: J, y: H, across: (w.scrollLeft + J) / w.scrollWidth, down: (w.scrollTop + H) / w.scrollHeight } : null, i(G);
1907
- }, O = (M) => {
1908
- M.touches.length < 2 && (l = null);
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 w.addEventListener("touchstart", s, { passive: !0 }), w.addEventListener("touchmove", v, { passive: !1 }), w.addEventListener("touchend", O, { passive: !0 }), w.addEventListener("touchcancel", O, { passive: !0 }), () => {
1911
- w.removeEventListener("touchstart", s), w.removeEventListener("touchmove", v), w.removeEventListener("touchend", O), w.removeEventListener("touchcancel", O);
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__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
1916
- /* @__PURE__ */ $(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ d(wi, {}), children: [
1917
- /* @__PURE__ */ d(
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
- ...rt,
1929
- children: /* @__PURE__ */ d(mi, {})
1876
+ ...ot,
1877
+ children: /* @__PURE__ */ c(gi, {})
1930
1878
  }
1931
1879
  ),
1932
- /* @__PURE__ */ d("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
1933
- /* @__PURE__ */ d(
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
- ...rt,
1945
- children: /* @__PURE__ */ d(pi, {})
1892
+ ...ot,
1893
+ children: /* @__PURE__ */ c(Ei, {})
1946
1894
  }
1947
1895
  ),
1948
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(_t), children: /* @__PURE__ */ d(ui, {}) })
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__ */ d(ve, { scrollerProps: Mn, children: /* @__PURE__ */ d("img", { ref: g, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: b, onLoad: (w) => h(w.currentTarget), "data-testid": "markdown-explorer-image" }) })
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
- }, An = pe(null), Ie = pe(void 0), Ln = pe(null), Be = () => {
1953
- const e = re(An);
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
- }, Ri = () => {
1957
- const e = re(Ln);
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" ? Se(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Se(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Se(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Oi = ({ children: e }) => {
1961
- const { config: t } = D(), n = Be(), r = at(), o = r.kind === "location" ? r.location.source : void 0, i = Fe(ze(t, n.navigation, o, n.currentPath));
1962
- return /* @__PURE__ */ d(Ie, { value: o, children: /* @__PURE__ */ d(Ln, { value: i, children: e }) });
1963
- }, Ci = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Mi = (e) => {
1964
- const t = e instanceof Element ? e.closest(Ci) : null;
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
- }, je = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ai = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: a, scope: u, children: m }) => {
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__ */ d("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
1969
- if (je(h)) {
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
- a(t, n);
1922
+ l(t, n);
1975
1923
  }
1976
1924
  }, children: m });
1977
- }, Li = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
1978
- const { config: a } = D(), u = Be(), m = re(Ie), f = ei(e), { navigation: c } = u, h = `${ze(a, c, m, t)}${f}`, g = n === !1 ? "false" : void 0;
1979
- return c.kind === "page" ? /* @__PURE__ */ d(Mo, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": g, children: i }) : /* @__PURE__ */ d(Ai, { to: h, docPath: t, fragment: f, exists: g, className: r, attributes: o, onDocumentLink: c.onDocumentLink, scope: u, children: i });
1980
- }, Ni = ({ className: e, attributes: t, children: n }) => {
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__ */ $("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: [
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__ */ $("span", { className: "aqmx-sr-only", children: [
1933
+ /* @__PURE__ */ F("span", { className: "aqmx-sr-only", children: [
1986
1934
  " (",
1987
1935
  r.inertLink,
1988
1936
  ")"
1989
1937
  ] })
1990
1938
  ] })
1991
1939
  );
1992
- }, Di = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1993
- const { config: i } = D(), a = re(Ie), u = Fe(`${ze(i, r.navigation, a, r.currentPath)}${e}`);
1994
- return /* @__PURE__ */ d("a", { ...n, href: u, className: t, onClick: (f) => {
1995
- je(f) && (f.preventDefault(), r.scrollWithin(e));
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
- }, Pi = ({ href: e, className: t, attributes: n, children: r }) => {
1998
- const o = Be();
1999
- return o.navigation.kind === "page" ? /* @__PURE__ */ d("a", { ...n, href: e, className: t, onClick: (a) => {
2000
- if (!je(a)) return;
2001
- const u = a.currentTarget;
2002
- e === "#" ? o.followEmptyFragment(a.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, a.nativeEvent);
2003
- }, children: r }) : /* @__PURE__ */ d(Di, { href: e, className: t, attributes: n, scope: o, children: r });
2004
- }, Fi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: a }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ d(Ni, { className: o, attributes: i, children: a }) : /* @__PURE__ */ d(Li, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: a }) : e.startsWith("#") ? /* @__PURE__ */ d(Pi, { href: e, className: o, attributes: i, children: a }) : /* @__PURE__ */ d("a", { ...i, href: e, className: o, children: a }), $i = () => {
2005
- const { config: e } = D(), t = Be(), n = re(Ie), r = $e();
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 (!je(i)) return !0;
1956
+ if (!He(i)) return !0;
2009
1957
  i.preventDefault();
2010
- const a = Rn(o.id), { navigation: u } = t;
2011
- return u.kind === "panel" || dt(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(a), !0) : (r(`${ze(e, u, n, t.currentPath)}${a}`, "follow-link"), !0);
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
- }, qi = () => {
2016
- const e = Ri();
2017
- return P((t) => `${e}${Rn(t.id)}`, [e]);
1963
+ }, zi = () => {
1964
+ const e = Ai();
1965
+ return P((t) => `${e}${An(t.id)}`, [e]);
2018
1966
  };
2019
- function _i({
1967
+ function Hi({
2020
1968
  title: e,
2021
1969
  titleId: t,
2022
1970
  ...n
2023
1971
  }, r) {
2024
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
1980
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2033
1981
  id: t
2034
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 Ii = /* @__PURE__ */ y.forwardRef(_i);
2039
- function Bi({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2000
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2053
2001
  id: t
2054
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 zi = /* @__PURE__ */ y.forwardRef(Bi);
2061
- function ji({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2022
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2075
2023
  id: t
2076
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aqmx-document-stage" }), Zi = () => () => {
2083
- }, Ui = () => navigator.pdfViewerEnabled !== !1, Gi = () => null, Wi = ({ document: e }) => {
2084
- const { labels: t } = D(), n = ee(Zi, Ui, Gi);
2085
- return n === null ? null : n ? /* @__PURE__ */ d("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ $("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
2086
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
2087
- /* @__PURE__ */ $("div", { className: "aqmx-callout-actions", children: [
2088
- /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, target: "_blank", rel: "noopener noreferrer", "data-testid": "markdown-explorer-pdf-not-shown-open", children: t.openInNewTab }),
2089
- /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
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
- }, Ki = (e) => {
2040
+ }, el = (e) => {
2093
2041
  switch (e) {
2094
2042
  case "video":
2095
- return /* @__PURE__ */ d(zi, {});
2043
+ return /* @__PURE__ */ c(Zi, {});
2096
2044
  case "audio":
2097
- return /* @__PURE__ */ d(Hi, {});
2045
+ return /* @__PURE__ */ c(Ki, {});
2098
2046
  case "pdf":
2099
- return /* @__PURE__ */ d(Ii, {});
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
- }, Xi = ({ document: e }) => {
2053
+ }, tl = ({ document: e }) => {
2106
2054
  const { labels: t } = D();
2107
2055
  switch (e.mediaType) {
2108
2056
  case "video":
2109
2057
  return (
2110
- /* @__PURE__ */ d("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 })
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__ */ d("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 })
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__ */ d(Wi, { document: e });
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
- }, Yi = ({ document: e }) => /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2124
- /* @__PURE__ */ d(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Ki(e.mediaType) }),
2125
- /* @__PURE__ */ d(ve, { scrollerProps: Vi, children: /* @__PURE__ */ d(Xi, { document: e }) })
2126
- ] }), Ji = (e) => ({
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
- }), Nn = (e, t, n) => {
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
- }, Dn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Sr, Qi = Object.freeze({ kind: "empty" }), ct = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), ea = (e, t, n) => {
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 Se(e, { ...t, overrides: r });
2206
- }, ye = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: i, intent: a, children: u }) => {
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__ */ $("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", ...a, children: [
2210
- r ? /* @__PURE__ */ d("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
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
- }, ta = ({ absence: e, announces: t, announceFailure: n }) => {
2215
- const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, a = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : 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
- a !== null && u !== null && n(r.documentFailed(se(a), le(r, u.reason)));
2220
- }, [a, u, n, r]), e.kind) {
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__ */ d(ye, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
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__ */ d(ut, { label: r.documentRegion });
2154
+ return /* @__PURE__ */ c(mt, { label: r.documentRegion });
2225
2155
  case "no-readme":
2226
- return /* @__PURE__ */ d(ye, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
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__ */ d(ye, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
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
- }, ut = ({ label: e }) => {
2160
+ }, mt = ({ label: e }) => {
2231
2161
  const { labels: t } = D();
2232
- return /* @__PURE__ */ $(ye, { kind: "loading", label: e, stale: !1, busy: !0, children: [
2233
- /* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: ct.map((n) => /* @__PURE__ */ d("span", {}, n)) }),
2234
- /* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: t.documentLoading })
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
- }, Vt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), na = ({ path: e, document: t, viewer: n, editing: r }) => {
2237
- const { reportMathDiagnostics: o, edits: i } = D(), a = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = $i(), m = qi(), f = U(() => o === void 0 ? void 0 : (l) => o(e, l), [o, e]), c = _(null), { editable: h, doubleClick: g, region: E, paneScroll: k, stale: R } = r;
2238
- j(() => {
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 l = c.current, s = E(), v = l === null ? null : l.querySelector(_e);
2243
- return l === null || s === null || v === null ? null : yo(l, k.scrollerOf(s, v));
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 = (l) => {
2248
- const s = c.current, { target: v } = l;
2249
- !g || s === null || !(v instanceof Element) || !Eo(v) || (l.stopPropagation(), i.start(e, So(v, s, s.ownerDocument.getSelection())));
2250
- }, A = _(null), L = _(R);
2251
- j(() => {
2252
- L.current = R;
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 = ae((l) => {
2255
- const s = c.current, v = E(), O = s === null ? null : Oo(s, l.line);
2256
- if (v === null || O === null) return !1;
2257
- const M = k.scrollerOf(v, O);
2258
- return M.scrollTop += Co(O, l.line) - l.clientTop, !0;
2259
- }), w = ae((l) => {
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 v = () => {
2263
- for (const M of Vt) s.removeEventListener(M, O, !0);
2264
- A.current?.release === v && (A.current = null);
2265
- }, O = () => v();
2266
- for (const M of Vt) s.addEventListener(M, O, { capture: !0, passive: !0 });
2267
- A.current = { point: l, release: v };
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 j(() => {
2270
- const l = i.takeReturn(e);
2271
- if (l !== null)
2199
+ return z(() => {
2200
+ const a = i.takeReturn(e);
2201
+ if (a !== null)
2272
2202
  return queueMicrotask(() => {
2273
- b(l) && L.current && w(l);
2274
- }), () => A.current?.release();
2275
- }, [i, e]), j(() => {
2276
- const l = A.current;
2277
- l === null || R || (l.release(), b(l.point));
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__ */ d("div", { ref: c, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ d(ln, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: a, content: null }) });
2280
- }, Pn = ({ document: e, viewer: t }) => {
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__ */ $(Pe, { children: [
2283
- /* @__PURE__ */ d(qe, { name: e.name, openUrl: nr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ d(uo, {}), children: e.truncated ? null : /* @__PURE__ */ d(Vo, { text: e.text }) }),
2284
- e.truncated ? /* @__PURE__ */ d("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
2285
- /* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(ln, { ...t, parseResult: null, content: e.text }) })
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
- }, ra = ({ path: e, name: t, viewer: n }) => {
2288
- const { data: r, documents: o, announcer: i, labels: a } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, c] = z(0), h = U(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [g, E] = z(null), k = ae((T) => {
2289
- E(T), T.kind === "failure" && i.announce(a.documentFailed(t, le(a, T.failure.reason)));
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((A) => {
2294
- "kind" in A && k(A);
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(() => c((T) => T + 1), []);
2298
- return g === null ? /* @__PURE__ */ $(Pe, { children: [
2299
- /* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: ct.map((T) => /* @__PURE__ */ d("span", {}, T)) }),
2300
- /* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: a.markupLoading })
2301
- ] }) : g.kind === "failure" ? /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: g.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ d(Pn, { document: g, viewer: n });
2302
- }, ft = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), oa = Object.freeze({ reason: "failed" }), ia = (e) => /* @__PURE__ */ d(
2303
- ho,
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__ */ d("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ d(me, { failure: oa, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
2306
- children: /* @__PURE__ */ d(
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__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: ct.map((t) => /* @__PURE__ */ d("span", {}, t)) }),
2310
- children: /* @__PURE__ */ d(mo, { ...e })
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
- ), aa = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
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: a, layout: u, region: m, paneScroll: f, stale: c } = i;
2318
- if (n === "edit" && a !== void 0) return /* @__PURE__ */ d(ia, { path: e, name: t.name, session: a, layout: u, viewer: r, region: m, paneScroll: f });
2319
- if (n === "markup") return /* @__PURE__ */ d(ra, { path: e, name: t.name, viewer: r });
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__ */ d(na, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && u === "fill", region: m, paneScroll: f, stale: c } });
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__ */ d(Pn, { document: t, viewer: r });
2254
+ return /* @__PURE__ */ c(Bn, { document: t, viewer: r });
2325
2255
  case "image":
2326
- return /* @__PURE__ */ d(Ti, { document: t });
2256
+ return /* @__PURE__ */ c(Li, { document: t });
2327
2257
  case "media":
2328
- return /* @__PURE__ */ d(Yi, { document: t });
2258
+ return /* @__PURE__ */ c(nl, { document: t });
2329
2259
  case "file":
2330
- return /* @__PURE__ */ d(Qo, { document: t });
2260
+ return /* @__PURE__ */ c(oi, { document: t });
2331
2261
  case "failure":
2332
- return /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
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 a = t;
2335
- throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(a)}`);
2264
+ const l = t;
2265
+ throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
2336
2266
  }
2337
2267
  }
2338
- }, la = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', sa = (e, t, n) => {
2339
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Cn(e, n), r === void 0 ? null : On(e, r.id), e.querySelector(_e), e.querySelector(la)];
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 && yn(i)) return i;
2271
+ if (i instanceof HTMLElement && On(i)) return i;
2342
2272
  return null;
2343
- }, Zt = (e, t, n) => {
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)) && yn(t);
2346
- }, da = (e) => {
2275
+ t instanceof HTMLElement && n && (i || e.contains(r)) && On(t);
2276
+ }, pl = (e) => {
2347
2277
  const t = _(!1);
2348
- return j(() => {
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, a;
2354
- const u = (g) => {
2355
- i = !(g.target instanceof Node && n.contains(g.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(a), a = setTimeout(() => {
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 = (g) => {
2359
- t.current = g.target instanceof Node && n.contains(g.target);
2360
- }, f = (g) => {
2361
- g.relatedTarget === null && i && (t.current = !1);
2362
- }, c = () => {
2363
- const { activeElement: g, body: E } = r;
2364
- g !== null && g !== E && (t.current = n.contains(g));
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", c), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
2369
- clearTimeout(a), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", c), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
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
- }, ca = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: a, navigation: u, fragment: m, paneScroll: f, announces: c, announceFailure: h, onDocumentShown: g }) => {
2373
- const { labels: E, announcer: k, documents: R } = D(), { document: T } = t, A = _(null), L = _(null), b = _(null), w = _(0), l = da(A), s = _({ path: e, document: T }), v = _(null), O = P(
2374
- (Z) => {
2375
- const X = A.current, Q = qt(X, Z, f);
2376
- X !== null && Q !== null && Zt(X, Q, l.current);
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, l]
2379
- ), M = P(
2380
- (Z, X) => {
2381
- const Q = w.current;
2308
+ [f, a]
2309
+ ), C = P(
2310
+ (U, Y) => {
2311
+ const Q = g.current;
2382
2312
  setTimeout(() => {
2383
- !X.defaultPrevented && w.current === Q && O(Z);
2313
+ !Y.defaultPrevented && g.current === Q && O(U);
2384
2314
  }, 0);
2385
2315
  },
2386
2316
  [O]
2387
2317
  ), N = P(
2388
- (Z) => {
2318
+ (U) => {
2389
2319
  setTimeout(() => {
2390
- Z.defaultPrevented || O("#");
2320
+ U.defaultPrevented || O("#");
2391
2321
  }, 0);
2392
2322
  },
2393
2323
  [O]
2394
- ), q = U(() => ({ navigation: u, currentPath: e, scrollWithin: O, followSameUrlJump: M, followEmptyFragment: N }), [u, e, O, M, N]), W = P(() => R.retry(e), [R, e]), G = Ao(R, Mi), I = bn(e), J = I !== void 0 ? "edit" : n ? "markup" : "rendered", H = T.kind === "markdown" ? J : void 0, ne = P(() => A.current, []), p = U(() => ({ session: I, layout: i, region: ne, paneScroll: f, stale: r }), [I, i, ne, f, r]), S = H === "edit" ? !1 : r, x = re(he), C = H === "edit" && i === "fill" ? "fill" : x, F = ae((Z, X) => {
2395
- const Q = L.current;
2396
- if (Q !== null && Q.path === Z && Q.snapshot === X) return;
2397
- L.current = { path: Z, snapshot: X };
2398
- const oe = X.document;
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(X) && h(E.documentFailed(se(Z), le(E, oe.failure.reason)));
2330
+ R.noteFailureShown(Y) && h(E.documentFailed(se(U), ae(E, oe.failure.reason)));
2401
2331
  return;
2402
2332
  }
2403
- g?.(Z, oe), c && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && k.announce(E.documentShown(oe.name));
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
- F(e, t);
2336
+ $(e, t);
2407
2337
  }, [e, t]);
2408
- const B = ae(() => {
2338
+ const I = le(() => {
2409
2339
  m.kind === "panel" && m.consume();
2410
- }), K = ae((Z) => {
2411
- const X = A.current;
2412
- if (X === null || !l.current) return null;
2413
- const { activeElement: Q, body: oe } = X.ownerDocument;
2414
- return Q !== null && Q !== oe ? null : sa(X, T, Z);
2415
- }), V = ae((Z) => {
2416
- const X = A.current;
2417
- X !== null && Zt(X, Z, l.current);
2418
- }), ie = ae((Z) => f.reveal(Z)), ht = ae((Z) => qt(A.current, Z, f));
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 Z = s.current.path !== e, X = Z || s.current.document !== T;
2351
+ const U = s.current.path !== e, Y = U || s.current.document !== T;
2422
2352
  s.current = { path: e, document: T };
2423
- const Q = v.current !== e;
2424
- v.current = e;
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, w.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, B());
2427
- const pt = () => {
2428
- const He = oe === null ? null : ht(oe);
2429
- if (!X) {
2430
- He !== null && V(He);
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 vt = K(m.fragment);
2434
- Z && He === null && vt !== null && ie(vt);
2363
+ const gt = W(m.fragment);
2364
+ U && Ve === null && gt !== null && ie(gt);
2435
2365
  };
2436
- Q ? queueMicrotask(pt) : pt();
2437
- }, [m, e, T, r]), /* @__PURE__ */ d(he, { value: C, children: /* @__PURE__ */ d(ye, { kind: T.kind, view: H, label: a(e, T), stale: S, busy: S, frameRef: A, intent: G, children: /* @__PURE__ */ d(An, { value: q, children: /* @__PURE__ */ d(Oi, { children: /* @__PURE__ */ d(aa, { path: e, document: T, view: J, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2438
- }, mt = Object.freeze({ kind: "skeleton" }), ua = (e, t, n, r, o) => {
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 a = n === null || n === e ? null : ue(r);
2444
- return n === null || a === null ? mt : { kind: "document", path: n, snapshot: a, stale: !0 };
2445
- }, fa = (e, t) => t.status === "deferred" ? mt : { kind: "document", path: e, snapshot: t, stale: !1 }, ma = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2446
- const o = t.kind === "streaming" ? fa(t.path, re(t.promise)) : t;
2447
- return o.kind !== "document" ? /* @__PURE__ */ d(ut, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ d(ca, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2448
- }, Fn = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: a, announces: u, announceFailure: m, onDocumentShown: f }) => {
2449
- const { config: c, labels: h, locale: g, theme: E, documents: k } = D(), R = br(), T = _(!1);
2450
- j(() => {
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 [A, L] = z(null), [b, w] = z(n), l = P(() => e === null ? void 0 : k.peek(e), [k, e]), s = ee(k.subscribe, l, l), v = P(() => A === null ? void 0 : k.peek(A), [k, A]), O = ee(k.subscribe, v, v);
2454
- j(() => e === null ? void 0 : k.open(e), [k, e]), j(() => A === null ? void 0 : k.retain(A), [k, A]);
2455
- const M = e === null ? mt : ua(e, s, A, O, !T.current), N = e === null ? null : M.kind === "document" && !M.stale ? M.path : A;
2456
- N !== A && L(N);
2457
- const q = M.kind !== "document" || M.path === e;
2458
- q && n !== b && w(n);
2459
- const W = U(() => Ji(h), [h]), G = U(() => [...c.iframeHosts], [c]), I = o.kind === "panel", J = U(
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: W,
2462
- spreadsheetLocale: g,
2391
+ labels: K,
2392
+ spreadsheetLocale: v,
2463
2393
  emptyMessage: h.documentEmpty,
2464
2394
  theme: E,
2465
- availableStyles: c.documentStyles,
2395
+ availableStyles: d.documentStyles,
2466
2396
  iFrameAllowedDomains: G,
2467
- embeds: c.embeds,
2468
- linkComponent: Fi,
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: I ? void 0 : xn
2410
+ renderScrollBar: B ? void 0 : Mn
2481
2411
  }),
2482
- [W, g, h.documentEmpty, E, c.documentStyles, G, c.embeds, R, r, I]
2483
- ), H = P((p, S) => I ? S === null || S.kind === "failure" ? se(p) : S.name : h.documentRegion, [I, h.documentRegion]), ne = I ? "content" : "fill";
2484
- return e === null ? /* @__PURE__ */ d(he, { value: ne, children: /* @__PURE__ */ d(ta, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ d(he, { value: ne, children: /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d(ut, { label: H(e, null) }), children: /* @__PURE__ */ d(
2485
- ma,
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: M,
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: a,
2425
+ paneScroll: l,
2496
2426
  announces: u,
2497
2427
  announceFailure: m,
2498
2428
  onDocumentShown: f
2499
2429
  }
2500
2430
  ) }) });
2501
- }, ha = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2502
- const { config: i, viewSettings: a, announcer: u } = D(), m = Le((M) => M.style), f = Le((M) => M.align), c = $e(), h = nn(), g = at(), { view: E, overrides: k, embed: R } = r, T = P(
2503
- (M) => {
2504
- if (g.kind !== "location") return;
2505
- const N = ea(i, g.location, M);
2506
- N !== null && c(N, "browse");
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
- [a, T]
2438
+ [i, d, v]
2514
2439
  ), L = P(
2515
- (M) => {
2516
- a.update({ align: M }), T("align");
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
- [a, T]
2519
- ), b = Nn(i, k.style, m), w = Dn(k.align, f), l = U(
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: A,
2523
- align: w,
2524
- onAlignChange: L,
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, A, w, L, R]
2534
- ), s = U(() => ({ kind: "page", view: E, overrides: k, embed: R }), [E, k, R]), v = U(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), O = P((M) => u.announce(M), [u]);
2535
- return /* @__PURE__ */ d(Fn, { path: e, absence: t, markup: n, display: l, navigation: s, fragment: v, paneScroll: ai, announces: !0, announceFailure: O, onDocumentShown: o });
2536
- }, pa = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2537
- const { config: i, viewSettings: a } = D(), u = Le((s) => s.style), m = Le((s) => s.align), [f, c] = z(() => Nn(i, void 0, u)), h = Dn(void 0, m), g = P((s) => a.update({ align: s }), [a]), { maximized: E, onDocumentLink: k, pendingHash: R, onHashConsumed: T, announceFailure: A, paneScroll: L } = r, b = U(
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: c,
2470
+ onStyleChange: d,
2541
2471
  align: h,
2542
- onAlignChange: g,
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, g, E]
2552
- ), w = U(() => ({ kind: "panel", onDocumentLink: k }), [k]), l = U(() => ({ kind: "panel", fragment: R, consume: T }), [R, T]);
2553
- return /* @__PURE__ */ d(Fn, { path: e, absence: t, markup: n, display: b, navigation: w, fragment: l, paneScroll: L, announces: !1, announceFailure: A, onDocumentShown: o });
2554
- }, va = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ d(ha, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ d(pa, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
2555
- function wa({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2498
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2569
2499
  id: t
2570
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 ga = /* @__PURE__ */ y.forwardRef(wa);
2577
- function ba({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2520
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2591
2521
  id: t
2592
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 $n = /* @__PURE__ */ y.forwardRef(ba);
2599
- function Ea({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2542
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2613
2543
  id: t
2614
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 Sa = /* @__PURE__ */ y.forwardRef(Ea);
2621
- function ya({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2564
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2635
2565
  id: t
2636
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 xa = /* @__PURE__ */ y.forwardRef(ya);
2647
- function ka({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2590
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2661
2591
  id: t
2662
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 Ta = /* @__PURE__ */ y.forwardRef(ka);
2669
- function Ra({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2612
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2683
2613
  id: t
2684
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 Oa = /* @__PURE__ */ y.forwardRef(Ra);
2693
- function Ca({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2636
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2707
2637
  id: t
2708
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 Ma = /* @__PURE__ */ y.forwardRef(Ca);
2717
- function Aa({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2660
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2731
2661
  id: t
2732
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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__ */ y.createElement("path", {
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 La = /* @__PURE__ */ y.forwardRef(Aa);
2739
- function Na({
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__ */ y.createElement("svg", Object.assign({
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__ */ y.createElement("title", {
2682
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2753
2683
  id: t
2754
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
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 Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId: n }) => {
2759
- const { labels: r, onEditGrant: o } = D(), [i, a] = z(!1), u = () => {
2760
- o === void 0 || i || (a(!0), o(e).then((m) => {
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(() => a(!1)));
2692
+ }).finally(() => l(!1)));
2763
2693
  };
2764
- return /* @__PURE__ */ $("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
2765
- /* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
2766
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
2767
- /* @__PURE__ */ $("div", { className: "aqmx-edit-grant-actions", children: [
2768
- o === void 0 ? /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
2769
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": i, "data-testid": `${n}-open`, onClick: u, children: r.editGrantAction })
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__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2701
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2772
2702
  ] })
2773
2703
  ] });
2774
- }, Fa = "Control+E Meta+E", $a = (e, t, n) => n && t ? "split" : e.view, Ut = (e, t, n, r) => {
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
- }, Jl = (e) => e === "split" ? null : e, qa = (e) => e === "preview" ? "editor" : "preview", _a = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Ia = (e, t) => {
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
- }, Gt = (e, t, n) => {
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
- }, Ba = ({ path: e, documentName: t, open: n, onClose: r }) => {
2788
- const { data: o, edits: i, labels: a, locale: u, announcer: m } = D(), f = xe(), [c, h] = z(null), [g, E] = z(0), [k, R] = z(null), [T, A] = z(null), L = U(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), b = P(() => {
2789
- R(null), A(null);
2790
- }, []), w = vn({ open: n, onOpen: b, onDismiss: r });
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 v = new AbortController();
2794
- return h(null), o.revisions(e, v.signal).then((O) => {
2723
+ const w = new AbortController();
2724
+ return h(null), o.revisions(e, w.signal).then((O) => {
2795
2725
  "kind" in O && h(O);
2796
- }), () => v.abort();
2797
- }, [n, o, e, g]), te(() => {
2726
+ }), () => w.abort();
2727
+ }, [n, o, e, v]), te(() => {
2798
2728
  if (!n || k === null) return;
2799
- const v = new AbortController();
2800
- return A(null), o.revision(e, k, v.signal).then((O) => {
2801
- "kind" in O && A(O);
2802
- }), () => v.abort();
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 l = () => {
2805
- T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(a.historyRestored(t)), r());
2806
- }, s = c !== null && c.kind === "revisions" ? c.revisions.find((v) => v.id === k) : void 0;
2807
- return /* @__PURE__ */ d("dialog", { ...w, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ $("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2808
- /* @__PURE__ */ d("p", { id: f, className: "aqmx-confirm-title", children: a.historyTitle(t) }),
2809
- c === null ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: a.historyLoading }) : c.kind === "failure" ? /* @__PURE__ */ d(me, { failure: c.failure, alert: !1, onRetry: () => E((v) => v + 1), testId: "markdown-explorer-history-failure" }) : c.revisions.length === 0 ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: a.historyEmpty }) : /* @__PURE__ */ d("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: c.revisions.map((v) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ $("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": v.id === k, "data-testid": "markdown-explorer-history-entry", onClick: () => R(v.id), children: [
2810
- /* @__PURE__ */ d("span", { children: Gt(v, L, a.historyEntry) }),
2811
- v.current ? /* @__PURE__ */ d("span", { className: "aqmx-history-mark", children: a.historyCurrent }) : null,
2812
- v.kept ? /* @__PURE__ */ d("span", { className: "aqmx-history-mark", children: a.historyKept }) : null
2813
- ] }) }, v.id)) }),
2814
- k === null ? null : T === null ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", children: a.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ d(me, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2815
- /* @__PURE__ */ d("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? a.historyTitle(t) : Gt(s, L, a.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ d("pre", { children: T.text }) })
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__ */ $("div", { className: "aqmx-confirm-actions", children: [
2818
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: a.historyClose }),
2819
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: l, children: a.historyRestore })
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
- }, za = (e) => {
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
- }, de = (e) => {
2755
+ }, ce = (e) => {
2826
2756
  e.stopPropagation();
2827
- }, ja = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
2828
- const { draftConverter: i, edits: a, labels: u } = D(), m = ee(
2829
- a.subscribe,
2830
- () => a.session(e) !== void 0,
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, c] = z(null), h = () => {
2762
+ ), [f, d] = j(null), h = () => {
2833
2763
  if (!m) {
2834
- a.start(e, a.viewAnchor(e));
2764
+ l.start(e, l.viewAnchor(e));
2835
2765
  return;
2836
2766
  }
2837
- a.flush(e);
2838
- const R = a.session(e);
2839
- R?.dirty === !0 ? c(R.save.kind === "draft" ? "draft" : "unsaved") : a.close(e);
2840
- }, g = () => {
2841
- m || (fo(), r && a.sideBySide() && i?.prepare?.());
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__ */ $(Pe, { children: [
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: de,
2855
- onPointerEnter: g,
2856
- onFocus: g,
2784
+ onDoubleClick: ce,
2785
+ onPointerEnter: v,
2786
+ onFocus: v,
2857
2787
  children: [
2858
- /* @__PURE__ */ d(La, { "aria-hidden": "true" }),
2859
- E === null ? /* @__PURE__ */ d("span", { children: u.editDocumentLabel }) : null
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__ */ d(
2864
- wn,
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
- c(null), a.close(e);
2803
+ d(null), l.close(e);
2874
2804
  },
2875
- onCancel: () => c(null)
2805
+ onCancel: () => d(null)
2876
2806
  }
2877
2807
  )
2878
2808
  ] });
2879
- }, Ha = ({ href: e, documentName: t, iconOnly: n }) => {
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: de,
2821
+ onDoubleClick: ce,
2892
2822
  children: [
2893
- /* @__PURE__ */ d(Sa, { "aria-hidden": "true" }),
2894
- o === null ? /* @__PURE__ */ d("span", { children: r.editExternallyLabel }) : null
2823
+ /* @__PURE__ */ c(Ol, { "aria-hidden": "true" }),
2824
+ o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
2895
2825
  ]
2896
2826
  }
2897
2827
  );
2898
- }, Va = ({ session: e }) => {
2899
- const { labels: t } = D(), n = Pr(t, e);
2900
- return /* @__PURE__ */ d("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
2901
- }, Za = Object.freeze(["editor", "split", "preview"]), Ua = Object.freeze(["editor", "preview"]), Ga = Object.freeze({ editor: $n, split: Da, preview: Ma }), Wa = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2902
- const { draftConverter: i, edits: a, labels: u } = D(), m = ao(), f = $a(r, m, o), c = o ? Za : Ua, h = xe(), g = _(/* @__PURE__ */ new Map()), E = {
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
- a.preparePreview(e), i?.prepare?.();
2837
+ l.preparePreview(e), i?.prepare?.();
2908
2838
  }, R = (T) => {
2909
- if (!Ia(T.nativeEvent, _a(navigator.platform))) return;
2910
- hn(T);
2911
- const A = qa(f);
2912
- Ut(a, e, A, o), g.current.get(A)?.focus();
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__ */ d("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: c.map((T) => {
2915
- const A = Ga[T], { label: L, tooltip: b } = E[T], w = T === "preview" ? k : void 0;
2916
- return /* @__PURE__ */ $("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
2917
- /* @__PURE__ */ d(
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: (l) => {
2921
- l === null ? g.current.delete(T) : g.current.set(T, l);
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": L,
2928
- "aria-keyshortcuts": T === "split" ? void 0 : Fa,
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: () => Ut(a, e, T, o),
2932
- onDoubleClick: de,
2933
- onPointerEnter: w,
2934
- onFocus: w
2861
+ onChange: () => Wt(l, e, T, o),
2862
+ onDoubleClick: ce,
2863
+ onPointerEnter: g,
2864
+ onFocus: g
2935
2865
  }
2936
2866
  ),
2937
- /* @__PURE__ */ d(A, { "aria-hidden": "true" }),
2938
- n ? null : /* @__PURE__ */ d("span", { children: L })
2867
+ /* @__PURE__ */ c(L, { "aria-hidden": "true" }),
2868
+ n ? null : /* @__PURE__ */ c("span", { children: A })
2939
2869
  ] }, T);
2940
2870
  }) });
2941
- }, Ka = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2942
- const { edits: i, labels: a } = D(), [u, m] = z(!1);
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", c = f || !r.dirty, h = () => {
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
- }, g = (E) => n ? { className: "aqmx-icon-button", "aria-label": E } : { className: "aqmx-icon-button aqmx-labelled-button" };
2949
- return /* @__PURE__ */ $(Pe, { children: [
2950
- r.save.kind === "conflicts" ? /* @__PURE__ */ $("button", { type: "button", ...g(a.conflictNext), title: a.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: de, children: [
2951
- /* @__PURE__ */ d(xa, { "aria-hidden": "true" }),
2952
- n ? null : /* @__PURE__ */ d("span", { children: a.conflictNext })
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__ */ d(Wa, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
2955
- r.history ? /* @__PURE__ */ $("button", { type: "button", ...g(a.historyOpen), title: a.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: de, children: [
2956
- /* @__PURE__ */ d(Ta, { "aria-hidden": "true" }),
2957
- n ? null : /* @__PURE__ */ d("span", { children: a.historyOpen })
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__ */ $("button", { type: "button", ...g(a.saveDraft), title: a.saveDraftTooltip, "aria-disabled": c, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: de, children: [
2960
- /* @__PURE__ */ d(Oa, { "aria-hidden": "true" }),
2961
- n ? null : /* @__PURE__ */ d("span", { children: a.saveDraft })
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__ */ d(Ba, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
2893
+ r.history ? /* @__PURE__ */ c(Zl, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
2964
2894
  ] });
2965
- }, Xa = ({ path: e, session: t }) => {
2895
+ }, na = ({ path: e, session: t }) => {
2966
2896
  const { edits: n } = D();
2967
- return t.save.kind !== "grant" ? null : /* @__PURE__ */ d(Pa, { href: t.save.href, onRetry: () => {
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
- }, Ya = (e) => {
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
- }, Ja = (e) => {
2974
- const { config: t } = D(), n = $e(), r = P(() => n(Se(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2975
- return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2976
- }, Qa = /* @__PURE__ */ new Set(), el = (e, t) => {
2977
- const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), a = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, a), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [c] = z(() => /* @__PURE__ */ new Set()), [h, g] = z(Qa), [E, k] = z(null);
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
- j(() => (R.current = e, () => {
2910
+ z(() => (R.current = e, () => {
2981
2911
  R.current = null;
2982
2912
  }), [e]);
2983
2913
  const T = P(() => {
2984
- const b = e, w = n.peek(b);
2985
- if (c.has(b) || w?.status === "pending") return;
2986
- const l = t && !Tn(w);
2987
- c.add(b), g(new Set(c)), k(null), (async () => {
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(le(o, s.failure.reason)));
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 v = ue(n.peek(b));
2996
- if (l || v === null || v.document.kind === "failure") return;
2997
- r.announce(o.documentRefreshed(v.document.name));
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
- c.delete(b), g(new Set(c));
2929
+ d.delete(b), v(new Set(d));
3000
2930
  }
3001
2931
  })();
3002
- }, [e, t, c, n, r, o]), A = h.has(e), L = E !== null && E.path === e && E.stamp === f ? E.failure : null;
3003
- return { refreshing: A, unavailable: A || u?.status === "pending", failure: L, refresh: T };
3004
- }, tl = Object.freeze({ kind: "page" }), nl = ({ path: e, placement: t, markup: n }) => {
3005
- const { labels: r } = D(), { refreshing: o, unavailable: i, failure: a, refresh: u } = el(e, t.kind === "page"), m = Ya(e), f = za(e), c = bn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, g = 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;
3006
- return /* @__PURE__ */ $("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": c === void 0 ? void 0 : "true", children: [
3007
- /* @__PURE__ */ $("div", { className: "aqmx-document-refresh-row", children: [
3008
- c === void 0 ? null : /* @__PURE__ */ d(Va, { session: c }),
3009
- c === void 0 ? null : /* @__PURE__ */ d(Ka, { path: e, documentName: k, iconOnly: E, session: c, previewAvailable: R }),
3010
- c === void 0 && m ? /* @__PURE__ */ $(
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: g === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
3015
- title: g === null ? r.showMarkup : g,
3016
- "aria-label": g === null ? void 0 : g,
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: de,
2950
+ onDoubleClick: ce,
3021
2951
  children: [
3022
- /* @__PURE__ */ d($n, { "aria-hidden": "true" }),
3023
- g === null ? /* @__PURE__ */ d("span", { children: r.showMarkupLabel }) : null
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
- c !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ d(ja, { path: e, documentName: k, iconOnly: E, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ d(Ha, { href: f.edit.href, documentName: k, iconOnly: E }) : null,
3028
- c === void 0 ? /* @__PURE__ */ $(
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: de,
2970
+ onDoubleClick: ce,
3041
2971
  children: [
3042
- /* @__PURE__ */ d(ga, { "aria-hidden": "true" }),
3043
- h === null ? /* @__PURE__ */ d("span", { children: r.refreshDocumentLabel }) : null
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
- c !== void 0 || a === null ? null : /* @__PURE__ */ d("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": a.reason, children: r.documentRefreshFailed(le(r, a.reason)) }),
3049
- c === void 0 ? null : /* @__PURE__ */ d(Xa, { path: e, session: c })
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
- }, rl = ({ location: e }) => {
3052
- const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Ja(e);
3053
- return /* @__PURE__ */ $("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...et, children: [
3054
- /* @__PURE__ */ d(nl, { path: t, placement: tl, markup: r }),
3055
- /* @__PURE__ */ d(va, { path: t, absence: Qi, markup: e.markup, variant: n })
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
- }, ol = ({ holds: e, testId: t }) => {
2987
+ }, da = ({ holds: e, testId: t }) => {
3058
2988
  const { labels: n, announcer: r } = D(), o = xe();
3059
- j(() => e ? r.claim(o) : void 0, [e, r, o]);
3060
- const i = P(() => r.shownIn(o), [r, o]), a = ee(r.subscribe, i, i);
3061
- return /* @__PURE__ */ d("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: a.length > 1 ? n.announcementSequence(a) : a[0] });
3062
- }, fe = Object.freeze([]), il = (e) => {
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 = [], a = (c) => {
3066
- n = c;
2995
+ const i = [], l = (d) => {
2996
+ n = d;
3067
2997
  for (const h of [...t]) h();
3068
- }, u = () => i.at(-1)?.region, m = (c) => {
2998
+ }, u = () => i.at(-1)?.region, m = (d) => {
3069
2999
  const h = u();
3070
- c(), u() !== h && n !== fe && a(fe);
3000
+ d(), u() !== h && n !== fe && l(fe);
3071
3001
  }, f = () => {
3072
3002
  o = !1;
3073
- const c = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
3074
- r = [], a(Object.freeze(c));
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: (c) => {
3078
- if (typeof c == "string") r.push({ sentence: c });
3007
+ announce: (d) => {
3008
+ if (typeof d == "string") r.push({ sentence: d });
3079
3009
  else {
3080
- const h = r.find((g) => "list" in g && g.list === c.list);
3081
- h !== void 0 && "items" in h ? h.items.push(c.item) : r.push({ list: c.list, items: [c.item] });
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 && a(fe), e.request(f));
3013
+ o || (o = !0, n !== fe && l(fe), e.request(f));
3084
3014
  },
3085
- subscribe: (c) => (t.add(c), () => {
3086
- t.delete(c);
3015
+ subscribe: (d) => (t.add(d), () => {
3016
+ t.delete(d);
3087
3017
  }),
3088
- claim: (c) => {
3089
- const h = { region: c };
3018
+ claim: (d) => {
3019
+ const h = { region: d };
3090
3020
  return m(() => i.push(h)), () => m(() => {
3091
- const g = i.indexOf(h);
3092
- g !== -1 && i.splice(g, 1);
3021
+ const v = i.indexOf(h);
3022
+ v !== -1 && i.splice(v, 1);
3093
3023
  });
3094
3024
  },
3095
- shownIn: (c) => u() === c ? n : fe
3025
+ shownIn: (d) => u() === d ? n : fe
3096
3026
  };
3097
- }, ge = Object.freeze({ status: "cancelled" }), al = (e) => {
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 (sr(t) !== null) return null;
3030
+ if (mr(t) !== null) return null;
3101
3031
  const { reason: n, code: r } = t;
3102
- return dr(n, r);
3103
- }, ll = ({ dataPath: e, onScope: t, fetch: n }) => {
3104
- const r = n ?? ((f, c) => globalThis.fetch(f, c)), o = (f, c) => `${e}/${f}?${new URLSearchParams(c).toString()}`, i = async (f, c, h, g) => {
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", ...c, headers: { Accept: "application/json", ...c.headers } });
3037
+ E = await r(f, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
3108
3038
  } catch {
3109
- return g({ reason: "failed" });
3039
+ return v({ reason: "failed" });
3110
3040
  }
3111
3041
  E.status === 401 && t(null);
3112
- const k = E.headers.get(rr);
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 g({ reason: Et(E.status) });
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 A = al(R);
3128
- return g(A !== null ? A : { reason: E.status === 200 ? "failed" : Et(E.status) });
3129
- }, a = { [yt]: cr }, u = { [yt]: pr, "Content-Type": `${hr}; charset=utf-8` }, m = async (f, c, h) => {
3130
- const g = await i(f, c, h, (E) => Ve(E.reason, E.code));
3131
- return c.signal.aborted ? ge : g;
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", { [Y.source]: f }), { method: "GET" }, St, (c) => ({ status: "error", failure: c })),
3135
- children: async (f, c, h) => {
3136
- const g = await i(o("children", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, lr, (E) => ({ status: "error", failure: E }));
3137
- return h.aborted ? ge : g;
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, c, h) => {
3140
- const g = await i(o("ancestors", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, ar, (E) => ({ status: "error", failure: E }));
3141
- return h.aborted ? ge : g;
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, c, h) => {
3144
- const g = await i(o("reveal", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, ir, (E) => ({ status: "error", failure: E }));
3145
- return h.aborted ? ge : g;
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: c }) => i(o("document", { [Y.path]: f }), c ? { method: "GET", headers: a } : { method: "GET" }, gr, (h) => Ve(h.reason, h.code)),
3148
- text: async (f, c) => {
3149
- const h = await i(o("text", { [Y.path]: f }), { method: "GET", signal: c }, or, (g) => Ve(g.reason, g.code));
3150
- return c.aborted ? ge : h;
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, c) => m(o("edit", { [Y.path]: f }), { method: "GET", signal: c }, wr),
3153
- save: (f, c, h, g) => m(o("save", { [Y.path]: f, [Y.base]: c }), { method: "POST", headers: u, body: h, signal: g }, vr),
3154
- preview: (f, c, h) => m(o("preview", { [Y.path]: f }), { method: "POST", headers: u, body: c, signal: h }, mr),
3155
- revisions: (f, c) => m(o("revisions", { [Y.path]: f }), { method: "GET", signal: c }, fr),
3156
- revision: (f, c, h) => m(o("revision", { [Y.path]: f, [Y.revision]: c }), { method: "GET", signal: h }, ur),
3157
- refresh: (f) => i(o("refresh", { [Y.source]: f }), { method: "POST", headers: a }, St, (c) => ({ status: "error", failure: c }))
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
- }, sl = () => {
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
- }, dl = (e) => {
3175
- const t = Qe(e);
3176
- if (t === null) return bt;
3104
+ }, pa = (e) => {
3105
+ const t = et(e);
3106
+ if (t === null) return yt;
3177
3107
  try {
3178
- return Jn(JSON.parse(t));
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), bt;
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
- }, Wt = (e, t) => {
3112
+ }, Xt = (e, t) => {
3183
3113
  let n = null;
3184
3114
  const r = () => {
3185
3115
  if (n === null) {
3186
- const i = dl(e);
3187
- n = { changes: i, settings: gt(t, i) };
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: a, settings: u } = r(), m = Kn(a, i, Xn(u, i)[i], t);
3199
- return n = { changes: m, settings: gt(t, m) }, o.emit(), Je(e, Yn(m)), n.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
- }, cl = Object.freeze({ status: "refreshed" }), ul = Object.freeze({ status: "superseded" }), ot = Object.freeze({ status: "deferred" }), fl = gn(ot), qn = 4, ml = qn - 1, Kt = Object.freeze({ status: "loading" }), hl = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), pl = (e) => {
3203
- const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
3204
- let f = 0, c = 0;
3205
- const h = { direct: null, bulk: null }, g = /* @__PURE__ */ new Set();
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, A = (p) => {
3210
- let S = a.get(p);
3211
- return S === void 0 && (S = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, a.set(p, S)), S;
3212
- }, L = (p, S, x) => {
3213
- p.inFlight.delete(S), f -= 1, x.lane === "bulk" && (c -= 1);
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 S = a.get(p);
3216
- if (S !== void 0) {
3217
- for (const [x, C] of [...S.inFlight])
3218
- L(S, x, C), C.controller.abort();
3219
- S.direct.clear(), S.bulk.clear(), S.unclaimed.clear();
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
- }, w = (p) => {
3222
- const S = T(p) + 1;
3223
- return o.set(p, S), b(p), S;
3224
- }, l = (p, S) => {
3225
- const x = Ee(p), C = { promise: p, opened: S, stale: !1, loadedAt: x?.status === "ok" ? x.loadedAt : null };
3226
- return p.status === "pending" && p.then((F) => {
3227
- F.status === "ok" && (C.loadedAt = F.loadedAt);
3228
- }), C;
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 S = r.get(p);
3231
- return S === void 0 && (S = /* @__PURE__ */ new Map(), r.set(p, S)), S;
3232
- }, v = (p) => {
3233
- const S = [...a.keys()], x = h[p], C = x === null ? 0 : S.indexOf(x) + 1;
3234
- for (let F = 0; F < S.length; F += 1) {
3235
- const B = S[(C + F) % S.length], K = B === void 0 ? void 0 : a.get(B);
3236
- if (!(B === void 0 || K === void 0)) {
3237
- for (const V of K[p])
3238
- if ((K.claims.get(V) ?? 0) !== 0)
3239
- return K[p].delete(V), h[p] = B, { sourceId: B, path: V };
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, S, x, C) => {
3244
- const F = a.get(p);
3245
- if (F === void 0 || F.inFlight.get(S) !== x) return;
3246
- L(F, S, x);
3247
- const B = (F.claims.get(S) ?? 0) > 0, K = s(p);
3248
- if (C.status === "ok" ? K.set(S, { status: "loaded", entries: C.entries }) : C.status === "error" && B ? K.set(S, { status: "failed", failure: C.failure }) : K.delete(S), R(), C.status === "error" && B) {
3249
- const V = { sourceId: p, path: S, failure: C.failure };
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
- }, M = (p, S, x) => {
3254
- const C = { controller: new AbortController(), lane: x };
3255
- A(p).inFlight.set(S, C), f += 1, x === "bulk" && (c += 1), e.children(p, S, C.controller.signal).then(
3256
- (F) => O(p, S, C, F),
3257
- () => O(p, S, C, hl)
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 < qn; ) {
3261
- const p = v("direct");
3190
+ for (; f < zn; ) {
3191
+ const p = w("direct");
3262
3192
  if (p !== null) {
3263
- M(p.sourceId, p.path, "direct");
3193
+ C(p.sourceId, p.path, "direct");
3264
3194
  continue;
3265
3195
  }
3266
- const S = c < ml ? v("bulk") : null;
3267
- if (S === null) return;
3268
- M(S.sourceId, S.path, "bulk");
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, S, x) => {
3271
- if (!(S.direct.delete(x) || S.bulk.delete(x))) {
3272
- const F = S.inFlight.get(x);
3273
- if (F === void 0) return !1;
3274
- L(S, x, F), F.controller.abort();
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
- }, W = () => {
3207
+ }, K = () => {
3278
3208
  E = !1;
3279
3209
  let p = !1;
3280
- for (const S of g) {
3281
- const x = A(S);
3282
- for (const C of x.unclaimed)
3283
- (x.claims.get(C) ?? 0) === 0 && q(S, x, C) && (p = !0);
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
- g.clear(), p && (R(), N());
3287
- }, G = (p, S) => {
3288
- t.set(p, l(Te(e.tree(p)), S));
3289
- }, I = (p, S, x) => {
3290
- w(p);
3291
- const C = l(gn(S), x);
3292
- return t.set(p, C), r.delete(p), R(), N(), C;
3293
- }, J = (p, S, x, C) => {
3294
- if (x !== T(p) || t.get(p) !== S) return;
3295
- const F = Ee(S.promise);
3296
- if (!(C.status !== "ok" || F?.status !== "ok" || S.loadedAt === null || C.loadedAt <= S.loadedAt)) {
3297
- if (De(F.entries, C.entries)) {
3298
- S.loadedAt = C.loadedAt;
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
- I(p, C, S.opened);
3231
+ B(p, M, y.opened);
3302
3232
  }
3303
- }, H = (p, S) => {
3233
+ }, H = (p, y) => {
3304
3234
  const x = t.get(p);
3305
- return x !== void 0 && Ee(x.promise)?.status === S;
3306
- }, ne = (p, S) => {
3307
- S.stale = !1;
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((C) => J(p, S, x, C));
3239
+ e.tree(p).then((M) => J(p, y, x, M));
3310
3240
  };
3311
3241
  return {
3312
- read: (p) => t.get(p)?.promise ?? fl,
3242
+ read: (p) => t.get(p)?.promise ?? ga,
3313
3243
  open: (p) => {
3314
- const S = n.resumes(p), x = n.hold(p), C = t.get(p);
3315
- return C === void 0 || H(p, "deferred") ? (G(p, !0), R()) : S || (C.opened && H(p, "error") ? (G(p, !0), R()) : (C.opened = !0, C.stale && H(p, "ok") && ne(p, C))), x;
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, S) => {
3321
- const x = S.then(
3322
- (B) => B === null ? ot : B,
3323
- () => ot
3324
- ), C = t.get(p);
3325
- if (C !== void 0 && H(p, "ok")) {
3326
- const B = T(p);
3327
- x.then((K) => J(p, C, B, K));
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
- w(p);
3331
- const F = l(Te(x), C?.opened === !0);
3332
- t.set(p, F), r.delete(p), N(), x.then((B) => {
3333
- t.get(p) === F && (B.status === "deferred" && n.isHeld(p) && G(p, F.opened), R());
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 S = (i.get(p) ?? 0) + 1;
3338
- i.set(p, S);
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) !== S) return ul;
3270
+ if (i.get(p) !== y) return wa;
3341
3271
  if (x.status === "error") return { status: "failed", failure: x.failure };
3342
- const C = t.get(p);
3343
- if (!(C !== void 0 && C.loadedAt !== null && H(p, "ok") && C.loadedAt > x.loadedAt)) {
3344
- const B = I(p, x, !0);
3345
- if (C !== void 0 && C.promise.status === "pending") {
3346
- const K = T(p);
3347
- C.promise.then((V) => J(p, B, K, V));
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 [B, K] of t)
3351
- B !== p && Ee(K.promise)?.status === "ok" && (K.stale = !0);
3352
- return cl;
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, S) => r.get(p)?.get(S),
3355
- claimChildren: (p, S) => {
3356
- const x = A(p), C = s(p);
3357
- let F = !1, B = !1;
3358
- for (const [V, ie] of S)
3359
- x.claims.set(V, (x.claims.get(V) ?? 0) + 1), C.get(V) === void 0 ? (C.set(V, Kt), x[ie].add(V), F = !0, B = !0) : ie === "direct" && x.bulk.delete(V) && (x.direct.add(V), B = !0);
3360
- F && R(), B && N();
3361
- let K = !1;
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 (!K) {
3364
- K = !0;
3365
- for (const V of S.keys()) {
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
- g.add(p), !E && (E = !0, queueMicrotask(W));
3299
+ v.add(p), !E && (E = !0, queueMicrotask(K));
3370
3300
  }
3371
3301
  };
3372
3302
  },
3373
- retryChildren: (p, S) => {
3303
+ retryChildren: (p, y) => {
3374
3304
  const x = r.get(p);
3375
- if (x === void 0 || x.get(S)?.status !== "failed") return;
3376
- const C = A(p);
3377
- if ((C.claims.get(S) ?? 0) > 0) {
3378
- x.set(S, Kt), C.direct.add(S), R(), N();
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(S), R();
3311
+ x.delete(y), R();
3382
3312
  },
3383
3313
  pendingChildren: (p) => {
3384
- const S = a.get(p);
3385
- return S === void 0 ? 0 : S.direct.size + S.bulk.size + S.inFlight.size;
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(), ...a.keys()])) w(p);
3389
- for (const [p, S] of i) i.set(p, S + 1);
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
- }, vl = (e, t) => {
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
- }, wl = 1;
3409
- let Ce = 0, ce = null;
3410
- const gl = () => {
3338
+ }, xa = 1;
3339
+ let Me = 0, de = null;
3340
+ const ka = () => {
3411
3341
  const { documentElement: e, body: t } = document;
3412
- Ce === 0 && (ce = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Ce += 1;
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, Ce -= 1, !(Ce > 0 || ce === null) && (e.style.overflow = ce.htmlOverflow, t.style.overflow = ce.bodyOverflow, e.style.scrollbarGutter = ce.htmlGutter, t.style.scrollbarGutter = ce.bodyGutter, ce = null));
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
- }, bl = [
3347
+ }, Ta = [
3418
3348
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
3419
3349
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
3420
- ], Xt = 1, El = 1e3, Yt = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Sl = (e) => {
3421
- if (!Yt(e)) return null;
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 + wl)
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. ${Ke}`;
3425
- if (t.height < Xt)
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. ${Ke}`;
3427
- for (const { selector: r, name: o } of bl)
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 (!Yt(i)) continue;
3430
- const a = i.getBoundingClientRect().height;
3431
- if (a < Xt)
3432
- return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(a))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
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
- }, yl = (e) => {
3365
+ }, Ma = (e) => {
3436
3366
  let t = !1, n;
3437
3367
  const r = () => {
3438
3368
  n = void 0;
3439
- const a = Sl(e);
3440
- a !== null && (t = !0, console.error(a));
3369
+ const l = Oa(e);
3370
+ l !== null && (t = !0, console.error(l));
3441
3371
  }, o = () => {
3442
- t || (clearTimeout(n), n = setTimeout(r, El));
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
- }, xl = (e, t) => {
3448
- te(() => e ? gl() : void 0, [e]), te(() => {
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 yl(n);
3381
+ return Ma(n);
3452
3382
  }, [e, t]);
3453
- }, Jt = '[data-testid="markdown-explorer-view-switch"]', kl = [
3454
- { control: Jt, successors: [Jt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
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
- ], Tl = (e) => {
3457
- for (const t of kl) {
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
- }, Rl = (e, t) => {
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) ? Tl(u) : null;
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 a = (u) => {
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", a), () => {
3477
- document.removeEventListener("focusin", i), document.removeEventListener("focusout", a);
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
- j(() => {
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 c of o.control.successors)
3492
- for (const h of f.querySelectorAll(c))
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 a = e.current;
3499
- if (a === null) return;
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(a, { childList: !0, subtree: !0 }), () => u.disconnect();
3433
+ return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
3504
3434
  }, [t, e]);
3505
- }, Ol = it(() => import("./TreeLayout-Cf2PzZEI.js").then((e) => ({ default: e.TreeLayout }))), Cl = it(() => import("./MultiLayout-BkhnkQs5.js").then((e) => ({ default: e.MultiLayout }))), Ml = 64, Al = {
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
- }, Qt = (e) => {
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
- }, Ll = (e, t) => {
3515
- const [n, r] = z(() => ({ overrides: t, locale: e, labels: Rt(e, t) }));
3516
- if (n.locale === e && Nr(n.overrides, t)) return n.labels;
3517
- const o = { overrides: t, locale: e, labels: Rt(e, t) };
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
- }, Nl = (e, t, n) => {
3520
- const [r, o] = z(() => ({ scope: t, store: Wt(e, n) }));
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: Wt(e, n) };
3452
+ const i = { scope: t, store: Xt(e, n) };
3523
3453
  return o(i), i.store;
3524
- }, Ye = (e, t) => {
3525
- const [n, r] = z(() => ({ scope: e, value: t() }));
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
- }, Dl = () => il(Al), en = "on", Pl = "off", Fl = Object.freeze({ kind: "unavailable" }), $l = (e) => {
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
- }, ql = (e, t) => {
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
- }, Ql = ({
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: a,
3472
+ renderFrame: l,
3543
3473
  renderTreeFailure: u,
3544
3474
  lockDocumentScroll: m = !1,
3545
3475
  onMathDiagnostics: f,
3546
- onEditGrant: c,
3476
+ onEditGrant: d,
3547
3477
  draftConverter: h
3548
3478
  }) => {
3549
- yr(n), $l(h);
3550
- const g = un(r), E = Dr(i), k = Ll(g, o), { revalidate: R } = Vn(), T = _(() => {
3551
- }), A = Fe(t.dataPath), [L] = z(() => {
3552
- const x = ll({ dataPath: A, onScope: (F) => T.current(F) }), C = { documents: Fo({ client: x, capacity: Math.max(Ml, t.multiView.maxPanels * 2) }), trees: pl(x) };
3553
- return Xe(C, e), kt(n, e.scope), { data: x, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
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 (L.aligned.pageData !== e || L.aligned.storageNamespace !== n) {
3556
- const x = L.aligned.pageData;
3557
- L.aligned.pageData = e, L.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? L.aligned.pendingReader = e : Xe(L, e)), kt(n, e.scope);
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 = Nl(we(n).treeSettings, e.scope, t.defaultTreeSettings);
3560
- j(() => {
3561
- const x = L.aligned.pendingReader;
3562
- x !== null && (L.aligned.pendingReader = null, Qt(L), Xe(L, x));
3563
- }, [e, L]), j(() => {
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 = (C) => {
3566
- C === e.scope || x || (x = !0, C !== null && (Qt(L), xr(n)), R());
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, L, n]);
3572
- const w = _(t.settingsCookie);
3573
- j(() => {
3574
- w.current = t.settingsCookie;
3501
+ }, [e, R, A, n]);
3502
+ const g = _(t.settingsCookie);
3503
+ z(() => {
3504
+ g.current = t.settingsCookie;
3575
3505
  }, [t.settingsCookie]);
3576
- const [l] = z(
3577
- () => vl(e.settings, (x) => {
3578
- document.cookie = er(w.current, x, window.location.protocol === "https:");
3506
+ const [a] = j(
3507
+ () => Sa(e.settings, (x) => {
3508
+ document.cookie = ir(g.current, x, window.location.protocol === "https:");
3579
3509
  })
3580
- ), s = Ye(e.scope, Dl), v = Ye(e.scope, sl), O = _(k);
3581
- j(() => {
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 M = Ye(
3514
+ const C = Je(
3585
3515
  e.scope,
3586
- () => Vr({
3587
- data: L.data,
3516
+ () => Wr({
3517
+ data: A.data,
3588
3518
  conflictLabels: () => ({ ours: O.current.conflictOurs, theirs: O.current.conflictTheirs }),
3589
- onSaveSettled: (x, C) => {
3590
- C.kind === "saved" && L.documents.refresh(x);
3591
- const F = Fr(O.current, C, ql(L.documents, x));
3592
- F !== null && s.announce(F);
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: () => Qe(we(n).editPreview) === en,
3596
- write: (x) => Je(we(n).editPreview, x ? en : Pl)
3525
+ read: () => et(we(n).editPreview) === rn,
3526
+ write: (x) => Qe(we(n).editPreview, x ? rn : Ia)
3597
3527
  },
3598
3528
  editorShareSetting: {
3599
- read: () => Hr(Qe(we(n).editSplit)),
3600
- write: (x) => Je(we(n).editSplit, String(x))
3529
+ read: () => Kr(et(we(n).editSplit)),
3530
+ write: (x) => Qe(we(n).editSplit, String(x))
3601
3531
  }
3602
3532
  })
3603
- ), N = U(() => Te(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((x) => x.id).join(`
3604
- `), W = U(() => Qn(t, q.split(`
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
- j(() => {
3536
+ z(() => {
3607
3537
  G.current = f;
3608
3538
  }, [f]);
3609
- const [I] = z(() => (x, C) => {
3610
- G.current?.(x, C);
3611
- }), J = f === void 0 ? void 0 : I, H = _(h);
3612
- j(() => {
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] = z(() => {
3545
+ const [ne] = j(() => {
3616
3546
  let x = !1;
3617
3547
  return {
3618
- convert: (C, F) => {
3619
- const B = H.current;
3620
- return B === void 0 ? Promise.resolve(Fl) : B.convert(C, F);
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 (C) {
3555
+ } catch (M) {
3626
3556
  if (x) return;
3627
- x = !0, console.error("[markdown-explorer] the draft converter's prepare threw", C);
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, S = U(
3561
+ }), p = h === void 0 ? void 0 : ne, y = Z(
3632
3562
  () => ({
3633
- config: W,
3563
+ config: K,
3634
3564
  labels: k,
3635
- locale: g,
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: L.documents,
3642
- trees: L.trees,
3643
- data: L.data,
3644
- viewSettings: l,
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: v,
3648
- edits: M,
3649
- onEditGrant: c,
3577
+ reveals: w,
3578
+ edits: C,
3579
+ onEditGrant: d,
3650
3580
  draftConverter: p,
3651
3581
  renderTreeFailure: u,
3652
3582
  reportMathDiagnostics: J
3653
3583
  }),
3654
- [W, k, g, E, n, e.scope, e.sources, N, L, l, b, s, v, M, c, p, u, J]
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__ */ d(fn, { value: S, children: /* @__PURE__ */ d(Il, { renderFrame: a, lockDocumentScroll: m }, e.scope) });
3657
- }, _l = ({ ref: e, theme: t, view: n, children: r }) => {
3658
- const [o] = z(bi);
3659
- return /* @__PURE__ */ d("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
3660
- }, Il = ({ renderFrame: e, lockDocumentScroll: t }) => {
3661
- const { theme: n, labels: r } = D(), o = at(), { hash: i } = nn(), a = $e(), u = _(null);
3662
- xl(t, u), j(() => {
3663
- o.kind === "redirect" && a(`${o.href}${i}`, "browse");
3664
- }, [o, i, a]);
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
- Rl(u, f);
3667
- const c = m.view === "tree" ? /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ d(Ol, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...et }), children: /* @__PURE__ */ d(Cl, { location: m }) }) : /* @__PURE__ */ d(rl, { location: m }), h = /* @__PURE__ */ $(_l, { ref: u, theme: n, view: f, children: [
3668
- c,
3669
- /* @__PURE__ */ d(so, {}),
3670
- /* @__PURE__ */ d(ol, { holds: !0, testId: "markdown-explorer-announcer" })
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
- }, es = kr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
3603
+ }, as = Cr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
3674
3604
  export {
3675
- Tt as $,
3676
- rt as A,
3677
- Ut as B,
3678
- $r as C,
3679
- nl as D,
3680
- Pa as E,
3681
- Jr as F,
3682
- qa as G,
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
- Yl as I,
3685
- Si as J,
3686
- Zr as K,
3687
- yn as L,
3688
- Do as M,
3689
- Qi as N,
3690
- ga as O,
3691
- tl as P,
3692
- Ao as Q,
3693
- Ma as R,
3694
- Mo as S,
3695
- at as T,
3696
- ol as U,
3697
- Le as V,
3698
- Tr as W,
3699
- Ot as X,
3700
- Mr as Y,
3701
- cn as Z,
3702
- Rr as _,
3703
- qr as a,
3704
- Ql as a0,
3705
- Rt as a1,
3706
- es as a2,
3707
- _r as b,
3708
- $e as c,
3709
- Ja as d,
3710
- et as e,
3711
- va as f,
3712
- xo as g,
3713
- Ir as h,
3714
- Oo as i,
3715
- yo as j,
3716
- le as k,
3717
- Co as l,
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
- Eo as n,
3720
- So as o,
3649
+ To as n,
3650
+ Ro as o,
3721
3651
  me as p,
3722
- ao as q,
3723
- to as r,
3724
- $a as s,
3725
- Xl as t,
3652
+ fo as q,
3653
+ lo as r,
3654
+ zl as s,
3655
+ rs as t,
3726
3656
  D as u,
3727
- ko as v,
3728
- Jl as w,
3729
- hn as x,
3730
- Ia as y,
3731
- _a as z
3657
+ Co as v,
3658
+ is as w,
3659
+ bn as x,
3660
+ Ul as y,
3661
+ Vl as z
3732
3662
  };