@aiquants/markdown-explorer 0.8.0 → 0.9.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,20 +1,20 @@
1
- import { jsxs as F, jsx as c, Fragment as Ne } from "react/jsx-runtime";
2
- import * as y from "react";
3
- import { createContext as me, use as ne, useMemo as U, useSyncExternalStore as te, useRef as B, useId as Oe, useLayoutEffect as V, useCallback as P, useEffect as oe, Component as Zt, Suspense as pe, lazy as tt, useState as I, useEffectEvent as ie } from "react";
4
- import { useParams as Tn, useSearchParams as Cn, matchPath as On, useBlocker as An, useNavigate as Ln, Link as Mn, useHref as De, useLocation as Vt, useRevalidator as Nn } from "react-router";
5
- import { f as Dn, a as Gt, u as $n, G as Se, e as ge, x as Pn, y as Fn, z as ft, B as qn, D as mt, H as _n, w as Bn, I as In } from "./location-Q4sgRrUm.js";
6
- import { B as Ee, i as jn, x as Y, w as Hn, C as ht, y as He, F as zn, G as Un, H as Zn, I as Vn, J as Gn, f as Kn, K as gt, u as Wn, L as Xn, N as Yn, O as Jn, z as Qn, v as er, P as tr, Q as nr, R as rr, t as pt } from "./dataRoute-D1vE1wFW.js";
7
- import { HostedScrollArea as vt, useMarkdownToolbarState as or, MarkdownViewer as Kt } from "@aiquants/markdown";
8
- import { SOURCE_LINES_ATTRIBUTE as Wt, parseSourceLines as lr } from "@aiquants/markdown/source-lines";
9
- import { DEFAULT_CONTENT_ALIGN as ir } from "@aiquants/markdown/viewer-settings";
10
- import { w as Xt, r as Yt, a as sr, b as wt, s as ze, c as ar } from "./storage-BSthKLSG.js";
11
- const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
1
+ import { jsxs as F, jsx as a, Fragment as Ne } from "react/jsx-runtime";
2
+ import * as b from "react";
3
+ import { createContext as me, use as re, useMemo as Z, useSyncExternalStore as te, useRef as B, useId as Oe, useLayoutEffect as V, useCallback as P, useEffect as ne, Component as Vt, Suspense as ge, lazy as tt, useState as I, useEffectEvent as ie } from "react";
4
+ import { useParams as Cn, useSearchParams as On, matchPath as An, useBlocker as Ln, useNavigate as Mn, Link as Nn, useHref as De, useLocation as Gt, useRevalidator as Dn } from "react-router";
5
+ import { f as $n, a as Kt, u as Pn, G as ke, e as pe, x as Fn, y as qn, z as ft, B as _n, D as mt, H as Bn, w as In, I as jn } from "./location-Q4sgRrUm.js";
6
+ import { B as Ee, i as Hn, x as Y, w as zn, C as ht, y as He, F as Zn, G as Un, H as Vn, I as Gn, J as Kn, f as Wn, K as pt, u as Xn, L as Yn, N as Jn, O as Qn, z as er, v as tr, P as nr, Q as rr, R as or, t as gt } from "./dataRoute-D1vE1wFW.js";
7
+ import { HostedScrollArea as vt, useMarkdownToolbarState as lr, MarkdownViewer as Wt } from "@aiquants/markdown";
8
+ import { SOURCE_LINES_ATTRIBUTE as Xt, parseSourceLines as ir } from "@aiquants/markdown/source-lines";
9
+ import { DEFAULT_CONTENT_ALIGN as sr } from "@aiquants/markdown/viewer-settings";
10
+ import { w as Yt, r as Jt, a as ar, b as wt, s as ze, c as cr } from "./storage-BSthKLSG.js";
11
+ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
12
12
  panelMoved: Object.freeze(["title", "column", "position"]),
13
13
  panelMoveUnavailable: Object.freeze(["title", "move"]),
14
14
  panelDragStarted: Object.freeze(["title"]),
15
15
  panelDragCancelled: Object.freeze(["title"]),
16
16
  multiColumnRegion: Object.freeze(["column"])
17
- }), ur = /\{(\w+)\}/gu, Jt = {
17
+ }), fr = /\{(\w+)\}/gu, Qt = {
18
18
  explorerRegion: "Explorer",
19
19
  sourceLabel: "Source",
20
20
  refreshTreeLabel: "Refresh tree",
@@ -173,6 +173,9 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
173
173
  imageZoomLevel: (e) => `${String(e)}%`,
174
174
  openInNewTab: "Open in a new tab",
175
175
  download: "Download",
176
+ copyText: "Copy the text",
177
+ copiedText: "Copied the text",
178
+ copyTextFailed: "Could not copy the text",
176
179
  mediaUnsupported: "Your browser cannot play this file.",
177
180
  fileNotShown: "This file cannot be shown here. Download it to open it.",
178
181
  viewerLoading: "Loading data...",
@@ -239,7 +242,7 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
239
242
  multiColumnEmpty: "This column is empty",
240
243
  multiColumnRegion: "Column {column}",
241
244
  panelDropHere: "Drop the panel here"
242
- }, fr = {
245
+ }, mr = {
243
246
  explorerRegion: "エクスプローラー",
244
247
  sourceLabel: "ソース",
245
248
  refreshTreeLabel: "ツリーを更新",
@@ -398,6 +401,9 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
398
401
  imageZoomLevel: (e) => `${String(e)}%`,
399
402
  openInNewTab: "新しいタブで開く",
400
403
  download: "ダウンロード",
404
+ copyText: "テキストをコピー",
405
+ copiedText: "テキストをコピーしました",
406
+ copyTextFailed: "テキストをコピーできませんでした",
401
407
  mediaUnsupported: "このブラウザではこのファイルを再生できません。",
402
408
  fileNotShown: "このファイルはここでは表示できません。ダウンロードして開いてください。",
403
409
  viewerLoading: "データを読み込み中...",
@@ -464,24 +470,24 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
464
470
  multiColumnEmpty: "この列は空です",
465
471
  multiColumnRegion: "{column} 列目",
466
472
  panelDropHere: "ここへパネルをドロップ"
467
- }, mr = Object.freeze({
468
- en: Object.freeze(Jt),
469
- ja: Object.freeze(fr)
470
- }), Qt = Object.freeze(Object.keys(Jt)), hr = new Set(Qt), gr = (e) => hr.has(e), Te = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, en = (e) => {
471
- if (e === void 0) return cr;
473
+ }, hr = Object.freeze({
474
+ en: Object.freeze(Qt),
475
+ ja: Object.freeze(mr)
476
+ }), en = Object.freeze(Object.keys(Qt)), pr = new Set(en), gr = (e) => pr.has(e), Te = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, tn = (e) => {
477
+ if (e === void 0) return dr;
472
478
  if (bt.includes(e)) return e;
473
479
  throw new RangeError(`[markdown-explorer] locale is the UI language (${bt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
474
480
  }, Et = (e, t) => {
475
- const n = mr[en(e)];
481
+ const n = hr[tn(e)];
476
482
  if (t === void 0) return n;
477
483
  if (t === null || typeof t != "object")
478
484
  throw new RangeError(`[markdown-explorer] labels must be an object; got ${Te(t)}`);
479
- if (!Dn(t))
485
+ if (!$n(t))
480
486
  throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Te(t)}`);
481
487
  const r = t, o = { ...n };
482
488
  for (const l of Object.keys(r)) {
483
489
  if (!gr(l))
484
- throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${Qt.join(", ")}`);
490
+ throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${en.join(", ")}`);
485
491
  const i = r[l];
486
492
  if (i === void 0) continue;
487
493
  const d = typeof n[l];
@@ -489,35 +495,35 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
489
495
  throw new TypeError(`[markdown-explorer] labels.${l} must be a ${d}; got ${Te(i)}`);
490
496
  if (typeof i == "string" && i.trim() === "")
491
497
  throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
492
- const v = dr[l];
493
- if (typeof i == "string" && v !== void 0) {
494
- for (const [, f] of i.matchAll(ur))
495
- if (!v.includes(f ?? ""))
496
- throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${v.map((u) => `{${u}}`).join(", ")}`);
498
+ const g = ur[l];
499
+ if (typeof i == "string" && g !== void 0) {
500
+ for (const [, f] of i.matchAll(fr))
501
+ if (!g.includes(f ?? ""))
502
+ throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${g.map((u) => `{${u}}`).join(", ")}`);
497
503
  }
498
504
  o[l] = i;
499
505
  }
500
506
  return Object.freeze(o);
501
- }, pr = (e, t) => {
507
+ }, vr = (e, t) => {
502
508
  if (Object.is(e, t)) return !0;
503
509
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
504
510
  const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
505
511
  return o.length === l.length && l.every((i) => Object.hasOwn(n, i) && Object.is(n[i], r[i]));
506
- }, yt = Object.freeze(["light", "dark"]), vr = (e) => {
512
+ }, yt = Object.freeze(["light", "dark"]), wr = (e) => {
507
513
  if (e === void 0) return "light";
508
514
  if (yt.includes(e)) return e;
509
515
  throw new RangeError(`[markdown-explorer] theme must be ${yt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
510
- }, tn = me(null), D = () => {
511
- const e = ne(tn);
516
+ }, nn = me(null), D = () => {
517
+ const e = re(nn);
512
518
  if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
513
519
  return e;
514
520
  }, Ae = (e) => {
515
521
  const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
516
522
  return te(t.subscribe, n, n);
517
523
  }, nt = () => {
518
- const { config: e } = D(), t = Tn()["*"], [n] = Cn(), r = n.toString();
519
- return U(() => Gt(e, t, new URLSearchParams(r)), [e, t, r]);
520
- }, nn = {
524
+ const { config: e } = D(), t = Cn()["*"], [n] = On(), r = n.toString();
525
+ return Z(() => Kt(e, t, new URLSearchParams(r)), [e, t, r]);
526
+ }, rn = {
521
527
  unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
522
528
  forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
523
529
  "not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
@@ -526,14 +532,14 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
526
532
  "too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
527
533
  unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
528
534
  failed: ["failureFailedTitle", "failureFailedBody"]
529
- }, ae = (e, t) => e[nn[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
530
- const { labels: o } = D(), l = ae(o, e.reason), i = o[nn[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
535
+ }, ae = (e, t) => e[rn[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
536
+ const { labels: o } = D(), l = ae(o, e.reason), i = o[rn[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
531
537
  return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": d, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
532
- /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: l }),
533
- /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: i }),
534
- 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
538
+ /* @__PURE__ */ a("p", { className: "aqmx-callout-title", children: l }),
539
+ /* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: i }),
540
+ e.reason === "unauthorized" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
535
541
  ] });
536
- }, wr = (e, t) => {
542
+ }, br = (e, t) => {
537
543
  const { phase: n, save: r, dirty: o } = t;
538
544
  switch (n.kind) {
539
545
  case "opening":
@@ -557,7 +563,7 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
557
563
  break;
558
564
  }
559
565
  return o ? e.draftUnsaved : "";
560
- }, br = (e, t, n) => {
566
+ }, Er = (e, t, n) => {
561
567
  switch (t.kind) {
562
568
  case "saved":
563
569
  return t.merged ? e.documentSavedMerged(n) : e.documentSaved(n);
@@ -581,108 +587,108 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
581
587
  for (const t of [...e]) t();
582
588
  }
583
589
  };
584
- }, Er = "<<<<<<<", yr = "=======", kr = ">>>>>>>", kt = (e, t) => e === t || e.startsWith(`${t} `), St = (e) => Sr(e.split(`
590
+ }, yr = "<<<<<<<", xr = "=======", kr = ">>>>>>>", xt = (e, t) => e === t || e.startsWith(`${t} `), kt = (e) => Sr(e.split(`
585
591
  `)), Sr = (e) => {
586
592
  const t = [];
587
593
  let n = null, r = null, o = 0;
588
594
  for (const l of e) {
589
595
  o += 1;
590
596
  const i = l.charCodeAt(0);
591
- i !== 60 && i !== 61 && i !== 62 || (kt(l, Er) ? (n = o, r = null) : l === yr ? n !== null && r === null ? r = o : n = null : kt(l, kr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
597
+ i !== 60 && i !== 61 && i !== 62 || (xt(l, yr) ? (n = o, r = null) : l === xr ? n !== null && r === null ? r = o : n = null : xt(l, kr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
592
598
  }
593
599
  return t;
594
- }, xt = (e) => e.includes(`\r
600
+ }, St = (e) => e.includes(`\r
595
601
  `) ? `\r
596
602
  ` : `
597
- `, Ue = (e) => e.replace(/\r\n?/gu, `
598
- `), xr = (e, t) => t === `
603
+ `, Ze = (e) => e.replace(/\r\n?/gu, `
604
+ `), Rr = (e, t) => t === `
599
605
  ` ? e : e.replaceAll(`
600
606
  `, `\r
601
- `), Rr = 3, Ze = Object.freeze({ kind: "idle" }), Tr = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
602
- const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), f = ye();
603
- let u = null, g = null;
604
- const m = (s, a) => {
605
- s.value = { ...s.value, ...a }, f.emit();
606
- }, k = (s, a) => o.get(s) === a, O = async (s, a) => {
607
- a.controller.abort(), a.controller = new AbortController();
608
- const { signal: h } = a.controller;
609
- m(a, { phase: { kind: "opening" } });
607
+ `), Tr = 3, Ue = Object.freeze({ kind: "idle" }), Cr = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
608
+ const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), f = ye();
609
+ let u = null, p = null;
610
+ const m = (s, c) => {
611
+ s.value = { ...s.value, ...c }, f.emit();
612
+ }, x = (s, c) => o.get(s) === c, O = async (s, c) => {
613
+ c.controller.abort(), c.controller = new AbortController();
614
+ const { signal: h } = c.controller;
615
+ m(c, { phase: { kind: "opening" } });
610
616
  const w = await e.edit(s, h);
611
- if (!k(s, a) || h.aborted || !("kind" in w)) return;
617
+ if (!x(s, c) || h.aborted || !("kind" in w)) return;
612
618
  if (w.kind === "grant") {
613
- m(a, { phase: { kind: "grant", href: w.href } });
619
+ m(c, { phase: { kind: "grant", href: w.href } });
614
620
  return;
615
621
  }
616
622
  if (w.kind === "failure") {
617
- m(a, { phase: { kind: "failed", failure: w.failure } });
623
+ m(c, { phase: { kind: "failed", failure: w.failure } });
618
624
  return;
619
625
  }
620
- const S = Ue(w.text);
621
- a.base = { text: S, version: w.version }, a.draft = S, a.ending = xt(w.text), m(a, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ze, generation: a.value.generation + 1 });
622
- }, E = (s) => {
623
- const a = o.get(s);
624
- a !== void 0 && (a.controller.abort(), o.delete(s), i.delete(s));
625
- }, T = (s, a, h) => (s.set(a, h), () => {
626
- s.get(a) === h && s.delete(a);
627
- }), x = (s, a, h, w = {}) => {
628
- m(a, { ...w, save: h }), n(s, h);
626
+ const k = Ze(w.text);
627
+ c.base = { text: k, version: w.version }, c.draft = k, c.ending = St(w.text), m(c, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ue, generation: c.value.generation + 1 });
628
+ }, y = (s) => {
629
+ const c = o.get(s);
630
+ c !== void 0 && (c.controller.abort(), o.delete(s), i.delete(s));
631
+ }, T = (s, c, h) => (s.set(c, h), () => {
632
+ s.get(c) === h && s.delete(c);
633
+ }), S = (s, c, h, w = {}) => {
634
+ m(c, { ...w, save: h }), n(s, h);
629
635
  }, M = async (s) => {
630
636
  d.get(s)?.flush();
631
- const a = o.get(s);
632
- if (a === void 0 || a.value.phase.kind !== "editing" || a.base === null || a.value.save.kind === "saving") return;
633
- const h = St(a.draft).length;
637
+ const c = o.get(s);
638
+ if (c === void 0 || c.value.phase.kind !== "editing" || c.base === null || c.value.save.kind === "saving") return;
639
+ const h = kt(c.draft).length;
634
640
  if (h > 0) {
635
- x(s, a, { kind: "conflicts", count: h });
641
+ S(s, c, { kind: "conflicts", count: h });
636
642
  return;
637
643
  }
638
- a.controller.abort(), a.controller = new AbortController();
639
- const { signal: w } = a.controller;
640
- let S = a.base, L = a.draft, R = !1;
641
- m(a, { save: { kind: "saving" } });
642
- for (let N = 0; N < Rr; N += 1) {
643
- const q = await e.save(s, S.version, xr(L, a.ending), w);
644
- if (!k(s, a) || w.aborted || !("kind" in q)) return;
644
+ c.controller.abort(), c.controller = new AbortController();
645
+ const { signal: w } = c.controller;
646
+ let k = c.base, L = c.draft, R = !1;
647
+ m(c, { save: { kind: "saving" } });
648
+ for (let N = 0; N < Tr; N += 1) {
649
+ const q = await e.save(s, k.version, Rr(L, c.ending), w);
650
+ if (!x(s, c) || w.aborted || !("kind" in q)) return;
645
651
  if (q.kind === "saved") {
646
- d.get(s)?.flush(), a.base = { text: L, version: q.version }, x(s, a, { kind: "saved", merged: R }, { dirty: a.draft !== L });
652
+ d.get(s)?.flush(), c.base = { text: L, version: q.version }, S(s, c, { kind: "saved", merged: R }, { dirty: c.draft !== L });
647
653
  return;
648
654
  }
649
655
  if (q.kind === "grant") {
650
- x(s, a, { kind: "grant", href: q.href });
656
+ S(s, c, { kind: "grant", href: q.href });
651
657
  return;
652
658
  }
653
659
  if (q.kind === "failure") {
654
- x(s, a, { kind: "failed", failure: q.failure });
660
+ S(s, c, { kind: "failed", failure: q.failure });
655
661
  return;
656
662
  }
657
- const { mergeDraft: W } = await import("./merge-DfI0ro2L.js");
658
- if (!k(s, a) || w.aborted) return;
663
+ const { mergeDraft: W } = await import("./merge-D_qmtwWR.js");
664
+ if (!x(s, c) || w.aborted) return;
659
665
  const J = d.get(s);
660
666
  J?.flush();
661
- const ee = Ue(q.text), X = W(S.text, a.draft, ee, t());
662
- if (S = { text: ee, version: q.version }, a.base = S, a.ending = xt(q.text), a.draft = X.text, J?.adopt(X.text), X.kind === "conflicts") {
663
- x(s, a, { kind: "conflicts", count: X.conflicts }, { dirty: !0, generation: a.value.generation + 1 });
667
+ const ee = Ze(q.text), X = W(k.text, c.draft, ee, t());
668
+ if (k = { text: ee, version: q.version }, c.base = k, c.ending = St(q.text), c.draft = X.text, J?.adopt(X.text), X.kind === "conflicts") {
669
+ S(s, c, { kind: "conflicts", count: X.conflicts }, { dirty: !0, generation: c.value.generation + 1 });
664
670
  return;
665
671
  }
666
- if (R = !0, L = X.text, L === S.text) {
667
- x(s, a, { kind: "saved", merged: R }, { dirty: !1, generation: a.value.generation + 1 });
672
+ if (R = !0, L = X.text, L === k.text) {
673
+ S(s, c, { kind: "saved", merged: R }, { dirty: !1, generation: c.value.generation + 1 });
668
674
  return;
669
675
  }
670
- m(a, { dirty: !0, generation: a.value.generation + 1 });
676
+ m(c, { dirty: !0, generation: c.value.generation + 1 });
671
677
  }
672
- x(s, a, { kind: "failed", failure: { reason: "failed" } });
678
+ S(s, c, { kind: "failed", failure: { reason: "failed" } });
673
679
  };
674
680
  return {
675
681
  session: (s) => o.get(s)?.value,
676
682
  subscribe: f.subscribe,
677
- start: (s, a) => {
683
+ start: (s, c) => {
678
684
  const h = o.get(s);
679
685
  if (h !== void 0) {
680
- m(h, { request: { anchor: a } }), (h.value.phase.kind === "failed" || h.value.phase.kind === "grant") && O(s, h);
686
+ m(h, { request: { anchor: c } }), (h.value.phase.kind === "failed" || h.value.phase.kind === "grant") && O(s, h);
681
687
  return;
682
688
  }
683
689
  l.delete(s);
684
690
  const w = {
685
- value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: a } },
691
+ value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ue, generation: 0, request: { anchor: c } },
686
692
  base: null,
687
693
  draft: "",
688
694
  ending: `
@@ -692,64 +698,64 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
692
698
  o.set(s, w), O(s, w);
693
699
  },
694
700
  retry: (s) => {
695
- const a = o.get(s);
696
- a === void 0 || a.value.phase.kind === "editing" || O(s, a);
701
+ const c = o.get(s);
702
+ c === void 0 || c.value.phase.kind === "editing" || O(s, c);
697
703
  },
698
704
  draft: (s) => {
699
- const a = o.get(s);
700
- return a === void 0 || a.base === null ? null : a.draft;
705
+ const c = o.get(s);
706
+ return c === void 0 || c.base === null ? null : c.draft;
701
707
  },
702
- setDraft: (s, a) => {
708
+ setDraft: (s, c) => {
703
709
  const h = o.get(s);
704
710
  if (h === void 0 || h.base === null) return;
705
- h.draft = a;
706
- const w = {}, S = a !== h.base.text;
707
- S !== h.value.dirty && (w.dirty = S);
711
+ h.draft = c;
712
+ const w = {}, k = c !== h.base.text;
713
+ k !== h.value.dirty && (w.dirty = k);
708
714
  const { save: L } = h.value;
709
715
  if (L.kind === "conflicts") {
710
- const R = St(a).length;
711
- R === 0 ? w.save = Ze : R !== L.count && (w.save = { kind: "conflicts", count: R });
716
+ const R = kt(c).length;
717
+ R === 0 ? w.save = Ue : R !== L.count && (w.save = { kind: "conflicts", count: R });
712
718
  }
713
719
  (w.dirty !== void 0 || w.save !== void 0) && m(h, w);
714
720
  },
715
721
  consumeRequest: (s) => {
716
- const a = o.get(s);
717
- a !== void 0 && a.value.request !== null && m(a, { request: null });
722
+ const c = o.get(s);
723
+ c !== void 0 && c.value.request !== null && m(c, { request: null });
718
724
  },
719
725
  save: M,
720
- replaceDraft: (s, a) => {
726
+ replaceDraft: (s, c) => {
721
727
  const h = d.get(s);
722
728
  h?.flush();
723
729
  const w = o.get(s);
724
730
  if (w === void 0 || w.base === null) return;
725
- const S = Ue(a);
726
- w.draft = S, h?.adopt(S), m(w, { dirty: S !== w.base.text, generation: w.value.generation + 1 });
731
+ const k = Ze(c);
732
+ w.draft = k, h?.adopt(k), m(w, { dirty: k !== w.base.text, generation: w.value.generation + 1 });
727
733
  },
728
734
  close: (s) => {
729
735
  if (!o.has(s)) return;
730
- const a = d.get(s), h = a === void 0 ? null : a.returnPoint();
731
- E(s), h === null ? l.delete(s) : l.set(s, h), f.emit();
736
+ const c = d.get(s), h = c === void 0 ? null : c.returnPoint();
737
+ y(s), h === null ? l.delete(s) : l.set(s, h), f.emit();
732
738
  },
733
739
  takeReturn: (s) => {
734
- const a = l.get(s) ?? null;
735
- return l.delete(s), a;
740
+ const c = l.get(s) ?? null;
741
+ return l.delete(s), c;
736
742
  },
737
743
  dirtyPaths: () => [...o.values()].filter((s) => s.value.dirty).map((s) => s.value.path),
738
744
  discard: (s) => {
739
- for (const a of s) E(a);
745
+ for (const c of s) y(c);
740
746
  s.length > 0 && f.emit();
741
747
  },
742
748
  editorState: {
743
749
  get: (s) => i.get(s),
744
- set: (s, a) => {
745
- o.has(s) && i.set(s, a);
750
+ set: (s, c) => {
751
+ o.has(s) && i.set(s, c);
746
752
  }
747
753
  },
748
- bindEditor: (s, a) => T(d, s, a),
749
- bindView: (s, a) => T(v, s, a),
754
+ bindEditor: (s, c) => T(d, s, c),
755
+ bindView: (s, c) => T(g, s, c),
750
756
  viewAnchor: (s) => {
751
- const a = v.get(s);
752
- return a === void 0 ? null : a.anchor();
757
+ const c = g.get(s);
758
+ return c === void 0 ? null : c.anchor();
753
759
  },
754
760
  flush: (s) => d.get(s)?.flush(),
755
761
  flushDrafts: () => {
@@ -758,55 +764,55 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
758
764
  nextConflict: (s) => d.get(s)?.nextConflict() === !0,
759
765
  hasSessions: () => o.size > 0,
760
766
  unsavedAmong: (s) => {
761
- for (const a of d.values()) a.flush();
762
- return s.filter((a) => o.get(a)?.value.dirty === !0);
767
+ for (const c of d.values()) c.flush();
768
+ return s.filter((c) => o.get(c)?.value.dirty === !0);
763
769
  },
764
- askToDiscard: (s) => new Promise((a) => {
765
- g?.settle(!1);
770
+ askToDiscard: (s) => new Promise((c) => {
771
+ p?.settle(!1);
766
772
  const h = {
767
773
  paths: s,
768
774
  settle: (w) => {
769
- if (g === h) {
770
- if (g = null, w) for (const S of s) E(S);
771
- f.emit(), a(w);
775
+ if (p === h) {
776
+ if (p = null, w) for (const k of s) y(k);
777
+ f.emit(), c(w);
772
778
  }
773
779
  }
774
780
  };
775
- g = h, f.emit();
781
+ p = h, f.emit();
776
782
  }),
777
- discardRequest: () => g,
783
+ discardRequest: () => p,
778
784
  previewShown: () => (u ??= r.read(), u),
779
785
  setPreviewShown: (s) => {
780
786
  u !== s && (u = s, r.write(s), f.emit());
781
787
  }
782
788
  };
783
- }, rn = (e) => {
789
+ }, on = (e) => {
784
790
  e.preventDefault(), e.stopPropagation();
785
- }, on = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
786
- const v = B(null), f = B(null), u = B(null), g = Oe(), m = Oe();
791
+ }, ln = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
792
+ const g = B(null), f = B(null), u = B(null), p = Oe(), m = Oe();
787
793
  return V(() => {
788
- const E = v.current;
789
- if (E !== null)
790
- if (e && !E.open) {
791
- const T = E.ownerDocument.activeElement;
792
- u.current = T instanceof HTMLElement ? T : null, E.showModal(), f.current?.focus();
793
- } else !e && E.open && (E.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
794
- }, [e]), /* @__PURE__ */ c("dialog", { ref: v, className: "aqmx-confirm", "aria-labelledby": g, "aria-describedby": m, "data-testid": d, onKeyDown: (E) => {
795
- E.key !== "Escape" || E.defaultPrevented || (rn(E), i());
796
- }, onClick: (E) => {
797
- E.target === E.currentTarget && i();
798
- }, onCancel: (E) => E.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
799
- /* @__PURE__ */ c("p", { id: g, className: "aqmx-confirm-title", children: t }),
800
- /* @__PURE__ */ c("p", { id: m, className: "aqmx-confirm-body", children: n }),
794
+ const y = g.current;
795
+ if (y !== null)
796
+ if (e && !y.open) {
797
+ const T = y.ownerDocument.activeElement;
798
+ u.current = T instanceof HTMLElement ? T : null, y.showModal(), f.current?.focus();
799
+ } else !e && y.open && (y.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
800
+ }, [e]), /* @__PURE__ */ a("dialog", { ref: g, className: "aqmx-confirm", "aria-labelledby": p, "aria-describedby": m, "data-testid": d, onKeyDown: (y) => {
801
+ y.key !== "Escape" || y.defaultPrevented || (on(y), i());
802
+ }, onClick: (y) => {
803
+ y.target === y.currentTarget && i();
804
+ }, onCancel: (y) => y.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
805
+ /* @__PURE__ */ a("p", { id: p, className: "aqmx-confirm-title", children: t }),
806
+ /* @__PURE__ */ a("p", { id: m, className: "aqmx-confirm-body", children: n }),
801
807
  /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
802
- /* @__PURE__ */ c("button", { ref: f, type: "button", className: "aqmx-callout-action", "data-testid": `${d}-cancel`, onClick: i, children: o }),
803
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
808
+ /* @__PURE__ */ a("button", { ref: f, type: "button", className: "aqmx-callout-action", "data-testid": `${d}-cancel`, onClick: i, children: o }),
809
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
804
810
  ] })
805
811
  ] }) });
806
- }, Cr = (e, t) => {
807
- const n = On({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
812
+ }, Or = (e, t) => {
813
+ const n = An({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
808
814
  if (n === null) return /* @__PURE__ */ new Set();
809
- const { location: r } = Gt(e, n.params["*"], new URLSearchParams(t.search));
815
+ const { location: r } = Kt(e, n.params["*"], new URLSearchParams(t.search));
810
816
  switch (r.view) {
811
817
  case "tree":
812
818
  return new Set(r.doc === null ? [] : [r.doc]);
@@ -815,36 +821,36 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
815
821
  case "multi":
816
822
  return new Set(r.docs);
817
823
  }
818
- }, ln = (e) => {
824
+ }, sn = (e) => {
819
825
  const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
820
- return te(t.subscribe, n, Or);
821
- }, sn = () => !1, Or = () => {
822
- }, Ar = () => {
823
- const { edits: e } = D();
824
- return te(e.subscribe, e.hasSessions, sn);
826
+ return te(t.subscribe, n, Ar);
827
+ }, an = () => !1, Ar = () => {
825
828
  }, Lr = () => {
826
829
  const { edits: e } = D();
827
- return te(e.subscribe, e.previewShown, sn);
828
- }, Mr = () => null, Nr = () => {
830
+ return te(e.subscribe, e.hasSessions, an);
831
+ }, Mr = () => {
832
+ const { edits: e } = D();
833
+ return te(e.subscribe, e.previewShown, an);
834
+ }, Nr = () => null, Dr = () => {
829
835
  const { edits: e, labels: t, config: n } = D(), r = B([]), o = P(
830
- ({ nextLocation: g }) => {
831
- const m = Cr(n, g);
832
- return e.flushDrafts(), r.current = e.dirtyPaths().filter((k) => !m.has(k)), r.current.length > 0;
836
+ ({ nextLocation: p }) => {
837
+ const m = Or(n, p);
838
+ return e.flushDrafts(), r.current = e.dirtyPaths().filter((x) => !m.has(x)), r.current.length > 0;
833
839
  },
834
840
  [e, n]
835
- ), l = An(o), i = Ar();
836
- oe(() => {
841
+ ), l = Ln(o), i = Lr();
842
+ ne(() => {
837
843
  if (!i) return;
838
- const g = (m) => {
844
+ const p = (m) => {
839
845
  e.flushDrafts(), e.dirtyPaths().length !== 0 && (m.preventDefault(), m.returnValue = !0);
840
846
  };
841
- return window.addEventListener("beforeunload", g), () => window.removeEventListener("beforeunload", g);
847
+ return window.addEventListener("beforeunload", p), () => window.removeEventListener("beforeunload", p);
842
848
  }, [i, e]);
843
- const d = te(e.subscribe, e.discardRequest, Mr), v = l.state === "blocked", u = (v ? r.current : d === null ? [] : d.paths).map((g) => Ee(g)).join(", ");
844
- return /* @__PURE__ */ c(
845
- on,
849
+ const d = te(e.subscribe, e.discardRequest, Nr), g = l.state === "blocked", u = (g ? r.current : d === null ? [] : d.paths).map((p) => Ee(p)).join(", ");
850
+ return /* @__PURE__ */ a(
851
+ ln,
846
852
  {
847
- open: v || d !== null,
853
+ open: g || d !== null,
848
854
  title: t.unsavedTitle,
849
855
  body: t.unsavedBody(u),
850
856
  confirmLabel: t.unsavedDiscard,
@@ -867,12 +873,12 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
867
873
  }
868
874
  );
869
875
  };
870
- function Dr({
876
+ function $r({
871
877
  title: e,
872
878
  titleId: t,
873
879
  ...n
874
880
  }, r) {
875
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
881
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
876
882
  xmlns: "http://www.w3.org/2000/svg",
877
883
  viewBox: "0 0 20 20",
878
884
  fill: "currentColor",
@@ -880,26 +886,26 @@ function Dr({
880
886
  "data-slot": "icon",
881
887
  ref: r,
882
888
  "aria-labelledby": t
883
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
889
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
884
890
  id: t
885
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
891
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
886
892
  fillRule: "evenodd",
887
893
  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",
888
894
  clipRule: "evenodd"
889
895
  }));
890
896
  }
891
- const $r = /* @__PURE__ */ y.forwardRef(Dr);
897
+ const Pr = /* @__PURE__ */ b.forwardRef($r);
892
898
  let Ve = null;
893
- const an = () => (Ve ??= import("./EditSurface-CaS1O6Nt.js").catch((e) => {
899
+ const cn = () => (Ve ??= import("./EditSurface-DJ9pJlDd.js").catch((e) => {
894
900
  throw Ve = null, e;
895
901
  }), Ve), Rt = () => {
896
- an().catch(() => {
902
+ cn().catch(() => {
897
903
  });
898
- }, Pr = (e) => {
899
- const { default: t } = ne(an());
900
- return /* @__PURE__ */ c(t, { ...e });
904
+ }, Fr = (e) => {
905
+ const { default: t } = re(cn());
906
+ return /* @__PURE__ */ a(t, { ...e });
901
907
  };
902
- class Fr extends Zt {
908
+ class qr extends Vt {
903
909
  state = { failed: !1 };
904
910
  static getDerivedStateFromError() {
905
911
  return { failed: !0 };
@@ -909,7 +915,7 @@ class Fr extends Zt {
909
915
  return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
910
916
  }
911
917
  }
912
- const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', Br = 200, we = (e) => lr(e.getAttribute(Wt)), Ir = (e, t) => {
918
+ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', Ir = 200, we = (e) => ir(e.getAttribute(Xt)), jr = (e, t) => {
913
919
  for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
914
920
  const o = we(r);
915
921
  if (o !== null) return { block: r, lines: o, own: !0 };
@@ -921,69 +927,69 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
921
927
  o !== null && (n = { block: r, lines: o });
922
928
  }
923
929
  return n === null ? null : { ...n, own: !1 };
924
- }, jr = (e, t) => {
930
+ }, Hr = (e, t) => {
925
931
  let n = 0;
926
932
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
927
933
  return n;
928
- }, Hr = (e) => e.closest(qr) !== null && e.closest(_r) === null, zr = (e, t, n) => {
929
- const r = Ir(e, t);
934
+ }, zr = (e) => e.closest(_r) !== null && e.closest(Br) === null, Zr = (e, t, n) => {
935
+ const r = jr(e, t);
930
936
  if (r === null) return null;
931
937
  const { block: o, own: l } = r;
932
938
  if (!l) {
933
939
  const d = r.lines.last + 1;
934
940
  return { lines: { first: d, last: d }, word: null, occurrence: 0, clientTop: Le(e) };
935
941
  }
936
- const i = Gr(o, n);
942
+ const i = Kr(o, n);
937
943
  return i === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Le(o) } : { lines: r.lines, word: i.text, occurrence: i.occurrence, clientTop: i.clientTop };
938
944
  }, Ur = (e, t) => {
939
945
  let n = null, r = null, o = null;
940
946
  for (const i of e.querySelectorAll(rt)) {
941
947
  const d = we(i);
942
948
  if (d === null) continue;
943
- n ??= Vr(t, i);
944
- const { top: v, bottom: f } = i.getBoundingClientRect();
945
- v <= n && n < f ? r = { lines: d, block: i } : o === null && v >= n && (o = { lines: d, block: i });
949
+ n ??= Gr(t, i);
950
+ const { top: g, bottom: f } = i.getBoundingClientRect();
951
+ g <= n && n < f ? r = { lines: d, block: i } : o === null && g >= n && (o = { lines: d, block: i });
946
952
  }
947
953
  const l = r === null ? o : r;
948
954
  return l === null ? null : { lines: l.lines, word: null, occurrence: 0, clientTop: Le(l.block) };
949
- }, Zr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Vr = (e, t) => {
955
+ }, Vr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Gr = (e, t) => {
950
956
  const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
951
- return Zr(e) + (Number.isFinite(n) ? n : 0);
952
- }, Gr = (e, t) => {
957
+ return Vr(e) + (Number.isFinite(n) ? n : 0);
958
+ }, Kr = (e, t) => {
953
959
  if (t === null || t.rangeCount === 0) return null;
954
960
  const n = t.getRangeAt(0);
955
961
  if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
956
962
  const r = n.toString().trim();
957
- if (r === "" || r.length > Br || /[\r\n]/u.test(r)) return null;
963
+ if (r === "" || r.length > Ir || /[\r\n]/u.test(r)) return null;
958
964
  const o = e.ownerDocument.createRange();
959
- return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: jr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
960
- }, Zi = (e, t) => {
965
+ return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: Hr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
966
+ }, ts = (e, t) => {
961
967
  const n = e.split(`
962
968
  `), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), l = { line: r, column: 0 };
963
969
  if (t.word === null) return l;
964
970
  let i = 0;
965
971
  for (let d = r; d <= o; d += 1) {
966
- const v = n[d - 1] ?? "";
967
- for (let f = v.indexOf(t.word); f >= 0; f = v.indexOf(t.word, f + t.word.length)) {
972
+ const g = n[d - 1] ?? "";
973
+ for (let f = g.indexOf(t.word); f >= 0; f = g.indexOf(t.word, f + t.word.length)) {
968
974
  if (i === t.occurrence) return { line: d, column: f };
969
975
  i += 1;
970
976
  }
971
977
  }
972
- return i > 0 ? Kr(n, r, o, t.word) ?? l : l;
973
- }, Kr = (e, t, n, r) => {
978
+ return i > 0 ? Wr(n, r, o, t.word) ?? l : l;
979
+ }, Wr = (e, t, n, r) => {
974
980
  for (let o = n; o >= t; o -= 1) {
975
981
  const l = (e[o - 1] ?? "").lastIndexOf(r);
976
982
  if (l >= 0) return { line: o, column: l };
977
983
  }
978
984
  return null;
979
- }, Wr = (e, t) => {
985
+ }, Xr = (e, t) => {
980
986
  let n = null, r = null;
981
987
  for (const o of e.querySelectorAll(rt)) {
982
988
  const l = we(o);
983
989
  l === null || l.first > t || (l.last >= t ? n = o : (r === null || l.last >= r.last) && (r = { element: o, last: l.last }));
984
990
  }
985
991
  return n !== null ? n : r === null ? null : r.element;
986
- }, Xr = (e, t) => {
992
+ }, Yr = (e, t) => {
987
993
  const { bottom: n } = e.getBoundingClientRect(), r = Le(e), o = we(e);
988
994
  if (o === null) return r;
989
995
  const l = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
@@ -1004,15 +1010,15 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
1004
1010
  "switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1005
1011
  "switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
1006
1012
  "follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
1007
- }), Vi = (e) => ot[e], $e = () => {
1008
- const e = Ln();
1013
+ }), ns = (e) => ot[e], $e = () => {
1014
+ const e = Mn();
1009
1015
  return P(
1010
1016
  (t, n) => {
1011
1017
  e(t, ot[n]);
1012
1018
  },
1013
1019
  [e]
1014
1020
  );
1015
- }, Yr = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Mn, { ...t, ...ot[e] }), cn = (e) => {
1021
+ }, Jr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(Nn, { ...t, ...ot[e] }), dn = (e) => {
1016
1022
  const t = e.ownerDocument;
1017
1023
  if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
1018
1024
  if (e.hasAttribute("tabindex")) return !1;
@@ -1022,11 +1028,11 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
1022
1028
  t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
1023
1029
  };
1024
1030
  return e.addEventListener("blur", n), !0;
1025
- }, Jr = (e, t) => {
1031
+ }, Qr = (e, t) => {
1026
1032
  const n = B(null), r = B(null), o = B(null), l = P(() => {
1027
1033
  n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
1028
1034
  }, []);
1029
- oe(() => l, [l]);
1035
+ ne(() => l, [l]);
1030
1036
  const i = P(
1031
1037
  (f) => {
1032
1038
  if (r.current !== f) return;
@@ -1036,9 +1042,9 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
1036
1042
  return;
1037
1043
  }
1038
1044
  e.prefetch(f);
1039
- const g = e.peek(f);
1040
- if (g?.status !== "pending") return;
1041
- const m = Promise.allSettled([g.promise]);
1045
+ const p = e.peek(f);
1046
+ if (p?.status !== "pending") return;
1047
+ const m = Promise.allSettled([p.promise]);
1042
1048
  o.current = m, m.then(() => {
1043
1049
  o.current === m && (o.current = null);
1044
1050
  });
@@ -1049,26 +1055,26 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
1049
1055
  const u = t(f);
1050
1056
  u !== r.current && (l(), u !== null && (r.current = u, n.current = window.setTimeout(() => {
1051
1057
  n.current = null, i(u);
1052
- }, $n)));
1058
+ }, Pn)));
1053
1059
  },
1054
1060
  [l, t, i]
1055
- ), v = P(
1061
+ ), g = P(
1056
1062
  (f) => {
1057
1063
  t(f) !== r.current && l();
1058
1064
  },
1059
1065
  [l, t]
1060
1066
  );
1061
- return U(
1067
+ return Z(
1062
1068
  () => ({
1063
1069
  onPointerOver: (f) => d(f.target),
1064
- onPointerOut: (f) => v(f.relatedTarget),
1070
+ onPointerOut: (f) => g(f.relatedTarget),
1065
1071
  onFocus: (f) => d(f.target),
1066
- onBlur: (f) => v(f.relatedTarget)
1072
+ onBlur: (f) => g(f.relatedTarget)
1067
1073
  }),
1068
- [d, v]
1074
+ [d, g]
1069
1075
  );
1070
- }, Qr = tt(() => import("./NativeScrollBar-CiVlg2ob.js").then((e) => ({ default: e.NativeScrollBar })));
1071
- class eo extends Zt {
1076
+ }, eo = tt(() => import("./NativeScrollBar-CwgalDjg.js").then((e) => ({ default: e.NativeScrollBar })));
1077
+ class to extends Vt {
1072
1078
  state = { failed: !1 };
1073
1079
  static getDerivedStateFromError() {
1074
1080
  return { failed: !0 };
@@ -1080,7 +1086,7 @@ class eo extends Zt {
1080
1086
  return this.state.failed ? null : this.props.children;
1081
1087
  }
1082
1088
  }
1083
- const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children: /* @__PURE__ */ c(pe, { fallback: null, children: /* @__PURE__ */ c(Qr, { scroller: e, withCircle: t }) }) }), dn = (e) => /* @__PURE__ */ c(to, { scroller: e, withCircle: !0 }), un = () => {
1089
+ const no = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(to, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(eo, { scroller: e, withCircle: t }) }) }), un = (e) => /* @__PURE__ */ a(no, { scroller: e, withCircle: !0 }), fn = () => {
1084
1090
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
1085
1091
  let n = !1;
1086
1092
  const r = (o) => {
@@ -1124,43 +1130,43 @@ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children:
1124
1130
  t.status = "rejected", t.reason = n;
1125
1131
  }
1126
1132
  )), t;
1127
- }, fn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), xe = (e) => e.status === "fulfilled" ? e.value : void 0, no = 55e3, Tt = Object.freeze({ status: "deferred" }), Ct = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, mn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", ro = ({ client: e, capacity: t }) => {
1133
+ }, mn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Se = (e) => e.status === "fulfilled" ? e.value : void 0, ro = 55e3, Tt = Object.freeze({ status: "deferred" }), Ct = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, hn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", oo = ({ client: e, capacity: t }) => {
1128
1134
  if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
1129
- const n = /* @__PURE__ */ new Map(), r = un(), o = ye(), l = /* @__PURE__ */ new WeakSet();
1135
+ const n = /* @__PURE__ */ new Map(), r = fn(), o = ye(), l = /* @__PURE__ */ new WeakSet();
1130
1136
  let i = 0;
1131
- const d = o.emit, v = () => (i += 1, i), f = () => {
1137
+ const d = o.emit, g = () => (i += 1, i), f = () => {
1132
1138
  if (!(n.size <= t))
1133
1139
  for (const s of [...n.keys()]) {
1134
1140
  if (n.size <= t) return;
1135
1141
  r.isHeld(s) || n.delete(s);
1136
1142
  }
1137
- }, u = (s, a) => {
1138
- n.delete(s), n.set(s, a);
1139
- }, g = (s) => performance.now() - s.validatedAt >= no, m = (s, a, h) => {
1140
- const w = n.get(s), S = de(w?.snapshot), L = h || w?.refreshPending === !0, R = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: R, previous: S }, validatedAt: performance.now(), opened: a, background: null, refreshPending: !1, seeded: void 0, stamp: v() };
1143
+ }, u = (s, c) => {
1144
+ n.delete(s), n.set(s, c);
1145
+ }, p = (s) => performance.now() - s.validatedAt >= ro, m = (s, c, h) => {
1146
+ const w = n.get(s), k = de(w?.snapshot), L = h || w?.refreshPending === !0, R = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: R, previous: k }, validatedAt: performance.now(), opened: c, background: null, refreshPending: !1, seeded: void 0, stamp: g() };
1141
1147
  return u(s, N), f(), R.then((q) => {
1142
- n.get(s) === N && (N.snapshot = q, N.stamp = v(), d());
1148
+ n.get(s) === N && (N.snapshot = q, N.stamp = g(), d());
1143
1149
  }), N;
1144
- }, k = (s, a, h, w, S, L) => {
1145
- a.background === h && (a.background = null, !(n.get(s) !== a || a.snapshot !== w) && (S.kind === "failure" && w.document.kind !== "failure" || (a.validatedAt = L, a.stamp = v(), Me(w.document, S) || (a.snapshot = { status: "loaded", document: S }), d())));
1146
- }, O = async (s, a) => {
1147
- const h = a.snapshot;
1150
+ }, x = (s, c, h, w, k, L) => {
1151
+ c.background === h && (c.background = null, !(n.get(s) !== c || c.snapshot !== w) && (k.kind === "failure" && w.document.kind !== "failure" || (c.validatedAt = L, c.stamp = g(), Me(w.document, k) || (c.snapshot = { status: "loaded", document: k }), d())));
1152
+ }, O = async (s, c) => {
1153
+ const h = c.snapshot;
1148
1154
  if (h.status !== "loaded") return null;
1149
1155
  const w = {};
1150
- a.background = w;
1151
- const S = performance.now(), L = e.document(s, { refresh: a.refreshPending });
1152
- a.refreshPending = !1;
1153
- const R = await L, N = a.background === w && n.get(s) === a && a.snapshot === h;
1154
- return k(s, a, w, h, R, S), N ? R : null;
1155
- }, E = (s, a) => {
1156
- const { snapshot: h } = a;
1157
- return h.status === "pending" ? !1 : h.status === "loaded" && h.document.kind !== "failure" ? (O(s, a), !1) : (h.status === "loaded" && l.add(h), m(s, !0, !1), !0);
1156
+ c.background = w;
1157
+ const k = performance.now(), L = e.document(s, { refresh: c.refreshPending });
1158
+ c.refreshPending = !1;
1159
+ const R = await L, N = c.background === w && n.get(s) === c && c.snapshot === h;
1160
+ return x(s, c, w, h, R, k), N ? R : null;
1161
+ }, y = (s, c) => {
1162
+ const { snapshot: h } = c;
1163
+ return h.status === "pending" ? !1 : h.status === "loaded" && h.document.kind !== "failure" ? (O(s, c), !1) : (h.status === "loaded" && l.add(h), m(s, !0, !1), !0);
1158
1164
  }, T = (s) => {
1159
- const a = r.hold(s);
1165
+ const c = r.hold(s);
1160
1166
  let h = !1;
1161
1167
  return () => {
1162
1168
  if (h) return;
1163
- h = !0, a();
1169
+ h = !0, c();
1164
1170
  const w = n.get(s);
1165
1171
  w !== void 0 && u(s, w), f();
1166
1172
  };
@@ -1170,65 +1176,65 @@ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children:
1170
1176
  peekSeeded: (s) => n.get(s)?.seeded,
1171
1177
  answerStampOf: (s) => n.get(s)?.stamp,
1172
1178
  prefetch: (s) => {
1173
- const a = n.get(s);
1174
- a !== void 0 && a.snapshot.status !== "deferred" || (m(s, !1, !1), d());
1179
+ const c = n.get(s);
1180
+ c !== void 0 && c.snapshot.status !== "deferred" || (m(s, !1, !1), d());
1175
1181
  },
1176
1182
  open: (s) => {
1177
- const a = r.resumes(s), h = T(s), w = n.get(s);
1183
+ const c = r.resumes(s), h = T(s), w = n.get(s);
1178
1184
  if (w === void 0 || w.snapshot.status === "deferred")
1179
1185
  return m(s, !0, !1), d(), h;
1180
- if (u(s, w), a) return h;
1181
- const { snapshot: S } = w;
1182
- return S.status === "pending" ? (w.opened = !0, h) : S.document.kind === "failure" ? (w.opened || g(w) ? (l.add(S), m(s, !0, !1), d()) : w.opened = !0, h) : (w.opened = !0, w.background === null && g(w) && O(s, w), h);
1186
+ if (u(s, w), c) return h;
1187
+ const { snapshot: k } = w;
1188
+ return k.status === "pending" ? (w.opened = !0, h) : k.document.kind === "failure" ? (w.opened || p(w) ? (l.add(k), m(s, !0, !1), d()) : w.opened = !0, h) : (w.opened = !0, w.background === null && p(w) && O(s, w), h);
1183
1189
  },
1184
1190
  retain: T,
1185
1191
  retry: (s) => {
1186
- const a = n.get(s);
1187
- a === void 0 || a.snapshot.status !== "loaded" || a.snapshot.document.kind !== "failure" || (m(s, !0, !1), d());
1192
+ const c = n.get(s);
1193
+ c === void 0 || c.snapshot.status !== "loaded" || c.snapshot.document.kind !== "failure" || (m(s, !0, !1), d());
1188
1194
  },
1189
- seed: (s, a) => {
1195
+ seed: (s, c) => {
1190
1196
  const h = performance.now(), w = be(
1191
- a.then(
1197
+ c.then(
1192
1198
  (q) => q === null ? Tt : { status: "loaded", document: q },
1193
1199
  () => Tt
1194
1200
  )
1195
- ), S = n.get(s);
1196
- if (S !== void 0 && S.snapshot.status === "loaded") {
1197
- const q = S.snapshot, W = {};
1198
- S.background = W, w.then((J) => {
1201
+ ), k = n.get(s);
1202
+ if (k !== void 0 && k.snapshot.status === "loaded") {
1203
+ const q = k.snapshot, W = {};
1204
+ k.background = W, w.then((J) => {
1199
1205
  if (J.status === "loaded") {
1200
- k(s, S, W, q, J.document, h);
1206
+ x(s, k, W, q, J.document, h);
1201
1207
  return;
1202
1208
  }
1203
- S.background === W && (S.background = null);
1209
+ k.background === W && (k.background = null);
1204
1210
  });
1205
1211
  return;
1206
1212
  }
1207
- const L = S !== void 0 && S.snapshot.status === "pending" ? S.snapshot.previous : null, R = { status: "pending", promise: w, previous: L }, N = { snapshot: R, validatedAt: h, opened: S?.opened === !0, background: null, refreshPending: S?.refreshPending === !0, seeded: R, stamp: v() };
1213
+ const L = k !== void 0 && k.snapshot.status === "pending" ? k.snapshot.previous : null, R = { status: "pending", promise: w, previous: L }, N = { snapshot: R, validatedAt: h, opened: k?.opened === !0, background: null, refreshPending: k?.refreshPending === !0, seeded: R, stamp: g() };
1208
1214
  u(s, N), f(), w.then((q) => {
1209
- n.get(s) === N && (q.status === "deferred" && r.isHeld(s) ? m(s, N.opened, !1) : (N.snapshot = q, N.stamp = v()), d());
1215
+ n.get(s) === N && (q.status === "deferred" && r.isHeld(s) ? m(s, N.opened, !1) : (N.snapshot = q, N.stamp = g()), d());
1210
1216
  });
1211
1217
  },
1212
1218
  invalidate: () => {
1213
1219
  let s = !1;
1214
- for (const [a, h] of [...n]) {
1215
- if (h.validatedAt = Number.NEGATIVE_INFINITY, h.opened = !0, h.refreshPending = !0, !r.isHeld(a)) continue;
1220
+ for (const [c, h] of [...n]) {
1221
+ if (h.validatedAt = Number.NEGATIVE_INFINITY, h.opened = !0, h.refreshPending = !0, !r.isHeld(c)) continue;
1216
1222
  const { snapshot: w } = h;
1217
1223
  if (w.status !== "pending") {
1218
- E(a, h) && (s = !0);
1224
+ y(c, h) && (s = !0);
1219
1225
  continue;
1220
1226
  }
1221
1227
  w.promise.then(() => {
1222
- n.get(a) === h && h.refreshPending && r.isHeld(a) && E(a, h) && d();
1228
+ n.get(c) === h && h.refreshPending && r.isHeld(c) && y(c, h) && d();
1223
1229
  });
1224
1230
  }
1225
1231
  s && d();
1226
1232
  },
1227
1233
  refresh: async (s) => {
1228
- const a = n.get(s);
1229
- if (a !== void 0 && mn(a.snapshot)) {
1230
- a.refreshPending = !0;
1231
- const w = await O(s, a);
1234
+ const c = n.get(s);
1235
+ if (c !== void 0 && hn(c.snapshot)) {
1236
+ c.refreshPending = !0;
1237
+ const w = await O(s, c);
1232
1238
  return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } : Ct;
1233
1239
  }
1234
1240
  const h = m(s, !0, !0);
@@ -1242,13 +1248,63 @@ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children:
1242
1248
  subscribe: o.subscribe,
1243
1249
  noteFailureShown: (s) => l.has(s) ? !1 : (l.add(s), !0)
1244
1250
  };
1245
- }, fe = me("fill"), oo = Object.freeze({ blockSize: "100%" }), ke = ({ scrollerProps: e, children: t }) => ne(fe) === "content" ? /* @__PURE__ */ c(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(vt, { scrollerProps: { ...e, style: oo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: dn, children: t });
1251
+ };
1246
1252
  function lo({
1247
1253
  title: e,
1248
1254
  titleId: t,
1249
1255
  ...n
1250
1256
  }, r) {
1251
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1257
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1258
+ xmlns: "http://www.w3.org/2000/svg",
1259
+ viewBox: "0 0 20 20",
1260
+ fill: "currentColor",
1261
+ "aria-hidden": "true",
1262
+ "data-slot": "icon",
1263
+ ref: r,
1264
+ "aria-labelledby": t
1265
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1266
+ id: t
1267
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1268
+ fillRule: "evenodd",
1269
+ 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",
1270
+ clipRule: "evenodd"
1271
+ }), /* @__PURE__ */ b.createElement("path", {
1272
+ fillRule: "evenodd",
1273
+ 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",
1274
+ clipRule: "evenodd"
1275
+ }));
1276
+ }
1277
+ const io = /* @__PURE__ */ b.forwardRef(lo);
1278
+ function so({
1279
+ title: e,
1280
+ titleId: t,
1281
+ ...n
1282
+ }, r) {
1283
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1284
+ xmlns: "http://www.w3.org/2000/svg",
1285
+ viewBox: "0 0 20 20",
1286
+ fill: "currentColor",
1287
+ "aria-hidden": "true",
1288
+ "data-slot": "icon",
1289
+ ref: r,
1290
+ "aria-labelledby": t
1291
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1292
+ id: t
1293
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1294
+ fillRule: "evenodd",
1295
+ 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",
1296
+ clipRule: "evenodd"
1297
+ }), /* @__PURE__ */ b.createElement("path", {
1298
+ 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"
1299
+ }));
1300
+ }
1301
+ const ao = /* @__PURE__ */ b.forwardRef(so);
1302
+ function co({
1303
+ title: e,
1304
+ titleId: t,
1305
+ ...n
1306
+ }, r) {
1307
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1252
1308
  xmlns: "http://www.w3.org/2000/svg",
1253
1309
  viewBox: "0 0 20 20",
1254
1310
  fill: "currentColor",
@@ -1256,21 +1312,64 @@ function lo({
1256
1312
  "data-slot": "icon",
1257
1313
  ref: r,
1258
1314
  "aria-labelledby": t
1259
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1315
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1260
1316
  id: t
1261
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1317
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1318
+ fillRule: "evenodd",
1319
+ 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",
1320
+ clipRule: "evenodd"
1321
+ }));
1322
+ }
1323
+ const uo = /* @__PURE__ */ b.forwardRef(co), fo = 2e3, Ot = Object.freeze({ outcome: "idle" }), mo = (e) => {
1324
+ const t = navigator.clipboard;
1325
+ return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
1326
+ }, ho = ({ text: e }) => {
1327
+ const { announcer: t, labels: n } = D(), [r, o] = I(Ot);
1328
+ ne(() => {
1329
+ if (r.outcome === "idle") return;
1330
+ const g = setTimeout(() => o(Ot), fo);
1331
+ return () => clearTimeout(g);
1332
+ }, [r]);
1333
+ const l = (g) => {
1334
+ o({ outcome: g }), t.announce(g === "copied" ? n.copiedText : n.copyTextFailed);
1335
+ }, i = () => {
1336
+ mo(e).then(
1337
+ () => l("copied"),
1338
+ () => l("failed")
1339
+ );
1340
+ }, d = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
1341
+ return (
1342
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: i, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ a(io, {}) : r.outcome === "failed" ? /* @__PURE__ */ a(uo, {}) : /* @__PURE__ */ a(ao, {}) })
1343
+ );
1344
+ }, fe = me("fill"), po = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) => re(fe) === "content" ? /* @__PURE__ */ a(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ a(vt, { scrollerProps: { ...e, style: po }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: un, children: t });
1345
+ function go({
1346
+ title: e,
1347
+ titleId: t,
1348
+ ...n
1349
+ }, r) {
1350
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1351
+ xmlns: "http://www.w3.org/2000/svg",
1352
+ viewBox: "0 0 20 20",
1353
+ fill: "currentColor",
1354
+ "aria-hidden": "true",
1355
+ "data-slot": "icon",
1356
+ ref: r,
1357
+ "aria-labelledby": t
1358
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1359
+ id: t
1360
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1262
1361
  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"
1263
- }), /* @__PURE__ */ y.createElement("path", {
1362
+ }), /* @__PURE__ */ b.createElement("path", {
1264
1363
  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"
1265
1364
  }));
1266
1365
  }
1267
- const io = /* @__PURE__ */ y.forwardRef(lo);
1268
- function so({
1366
+ const vo = /* @__PURE__ */ b.forwardRef(go);
1367
+ function wo({
1269
1368
  title: e,
1270
1369
  titleId: t,
1271
1370
  ...n
1272
1371
  }, r) {
1273
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1372
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1274
1373
  xmlns: "http://www.w3.org/2000/svg",
1275
1374
  viewBox: "0 0 20 20",
1276
1375
  fill: "currentColor",
@@ -1278,34 +1377,34 @@ function so({
1278
1377
  "data-slot": "icon",
1279
1378
  ref: r,
1280
1379
  "aria-labelledby": t
1281
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1380
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1282
1381
  id: t
1283
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1382
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1284
1383
  fillRule: "evenodd",
1285
1384
  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",
1286
1385
  clipRule: "evenodd"
1287
- }), /* @__PURE__ */ y.createElement("path", {
1386
+ }), /* @__PURE__ */ b.createElement("path", {
1288
1387
  fillRule: "evenodd",
1289
1388
  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",
1290
1389
  clipRule: "evenodd"
1291
1390
  }));
1292
1391
  }
1293
- const ao = /* @__PURE__ */ y.forwardRef(so), Pe = ({ name: e, url: t, icon: n, children: r }) => {
1392
+ const bo = /* @__PURE__ */ b.forwardRef(wo), Pe = ({ name: e, url: t, icon: n, children: r }) => {
1294
1393
  const { labels: o } = D();
1295
1394
  return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
1296
- /* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: n }),
1297
- /* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1395
+ /* @__PURE__ */ a("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: n }),
1396
+ /* @__PURE__ */ a("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1298
1397
  r,
1299
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(ao, {}) }),
1300
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(io, {}) })
1398
+ /* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ a(bo, {}) }),
1399
+ /* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ a(vo, {}) })
1301
1400
  ] });
1302
1401
  };
1303
- function co({
1402
+ function Eo({
1304
1403
  title: e,
1305
1404
  titleId: t,
1306
1405
  ...n
1307
1406
  }, r) {
1308
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1407
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1309
1408
  xmlns: "http://www.w3.org/2000/svg",
1310
1409
  viewBox: "0 0 20 20",
1311
1410
  fill: "currentColor",
@@ -1313,31 +1412,31 @@ function co({
1313
1412
  "data-slot": "icon",
1314
1413
  ref: r,
1315
1414
  "aria-labelledby": t
1316
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1415
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1317
1416
  id: t
1318
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1417
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1319
1418
  fillRule: "evenodd",
1320
1419
  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",
1321
1420
  clipRule: "evenodd"
1322
1421
  }));
1323
1422
  }
1324
- const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aqmx-document-stage" }), mo = ({ document: e }) => {
1423
+ const yo = /* @__PURE__ */ b.forwardRef(Eo), xo = Object.freeze({ className: "aqmx-document-stage" }), ko = ({ document: e }) => {
1325
1424
  const { labels: t } = D();
1326
1425
  return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1327
- /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(uo, {}) }),
1328
- /* @__PURE__ */ c(ke, { scrollerProps: fo, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1329
- /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1330
- /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1426
+ /* @__PURE__ */ a(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ a(yo, {}) }),
1427
+ /* @__PURE__ */ a(xe, { scrollerProps: xo, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1428
+ /* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1429
+ /* @__PURE__ */ a("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1331
1430
  ] }) })
1332
1431
  ] });
1333
- }, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ho = (e) => {
1432
+ }, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", So = (e) => {
1334
1433
  const t = e.indexOf("#");
1335
1434
  return t === -1 ? "" : e.slice(t);
1336
- }, go = /(%[0-9A-Fa-f]{2})/u, lt = (e) => {
1435
+ }, Ro = /(%[0-9A-Fa-f]{2})/u, lt = (e) => {
1337
1436
  if (!e.startsWith("#") || e.length === 1) return null;
1338
- const t = new TextEncoder(), n = e.slice(1).split(go).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1437
+ const t = new TextEncoder(), n = e.slice(1).split(Ro).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1339
1438
  return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
1340
- }, hn = (e) => `#${encodeURIComponent(e)}`, po = (e) => {
1439
+ }, pn = (e) => `#${encodeURIComponent(e)}`, To = (e) => {
1341
1440
  if (e === "#") return !0;
1342
1441
  const t = lt(e);
1343
1442
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
@@ -1346,20 +1445,20 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
1346
1445
  for (const n of e.querySelectorAll("[id]"))
1347
1446
  if (n.id === t) return n;
1348
1447
  return null;
1349
- }, vo = "http://www.w3.org/1999/xhtml", Ot = (e, t) => {
1448
+ }, Co = "http://www.w3.org/1999/xhtml", At = (e, t) => {
1350
1449
  if (t === "") return null;
1351
1450
  const n = gn(e, t);
1352
1451
  if (n !== null) return n;
1353
1452
  for (const r of e.querySelectorAll("a[name]"))
1354
- if (r.localName === "a" && r.namespaceURI === vo && r.getAttribute("name") === t) return r;
1453
+ if (r.localName === "a" && r.namespaceURI === Co && r.getAttribute("name") === t) return r;
1355
1454
  return null;
1356
- }, pn = (e, t) => {
1455
+ }, vn = (e, t) => {
1357
1456
  if (e === null || !t.startsWith("#")) return null;
1358
- const n = Ot(e, t.slice(1));
1457
+ const n = At(e, t.slice(1));
1359
1458
  if (n !== null) return n;
1360
1459
  const r = lt(t);
1361
- return r === null ? null : Ot(e, r);
1362
- }, At = (e) => {
1460
+ return r === null ? null : At(e, r);
1461
+ }, Lt = (e) => {
1363
1462
  const { body: t, documentElement: n } = e.ownerDocument;
1364
1463
  if (e === t) {
1365
1464
  const o = getComputedStyle(n);
@@ -1367,22 +1466,22 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
1367
1466
  }
1368
1467
  const { overflowY: r } = getComputedStyle(e);
1369
1468
  return r === "auto" || r === "scroll";
1370
- }, wo = (e) => {
1469
+ }, Oo = (e) => {
1371
1470
  const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
1372
1471
  return o !== "hidden" && o !== "clip";
1373
- }, bo = (e, t) => {
1472
+ }, Ao = (e, t) => {
1374
1473
  const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
1375
- if (r.scrollHeight > r.clientHeight && At(r)) return r;
1474
+ if (r.scrollHeight > r.clientHeight && Lt(r)) return r;
1376
1475
  const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: i } = e.ownerDocument;
1377
1476
  for (let d = e.parentElement; d !== null && d !== l; d = d.parentElement)
1378
- if (At(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
1379
- return i instanceof Element && wo(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
1380
- }, Eo = Object.freeze({
1381
- scrollerOf: bo,
1477
+ if (Lt(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
1478
+ return i instanceof Element && Oo(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
1479
+ }, Lo = Object.freeze({
1480
+ scrollerOf: Ao,
1382
1481
  reveal: (e) => {
1383
1482
  e.scrollIntoView(Ye);
1384
1483
  }
1385
- }), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), yo = (e, t) => {
1484
+ }), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), Mo = (e, t) => {
1386
1485
  for (let n = t; n !== null && n !== e; n = n.parentElement) {
1387
1486
  const r = n.parentElement;
1388
1487
  if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
@@ -1390,7 +1489,7 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
1390
1489
  n.removeAttribute("hidden");
1391
1490
  }
1392
1491
  }
1393
- }, ko = (e, t) => {
1492
+ }, No = (e, t) => {
1394
1493
  if (t.getClientRects().length === 0) return;
1395
1494
  const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), i = t.getBoundingClientRect(), d = i.height + l + Number.parseFloat(o) > e.clientHeight;
1396
1495
  if (!d && Math.abs(i.top - l - n) < 1) {
@@ -1398,20 +1497,20 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
1398
1497
  return;
1399
1498
  }
1400
1499
  e.scrollBy({ top: d ? i.top - n - e.clientHeight : i.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Ye);
1401
- }, So = (e, t) => {
1500
+ }, Do = (e, t) => {
1402
1501
  const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
1403
1502
  n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
1404
- }, Lt = (e, t, n) => {
1503
+ }, Mt = (e, t, n) => {
1405
1504
  if (e === null) return null;
1406
- const r = pn(e, t);
1407
- return r === null ? (po(t) && So(e, n), null) : (yo(e, r), ko(n.scrollerOf(e, r), r), n.reveal(r), r);
1505
+ const r = vn(e, t);
1506
+ return r === null ? (To(t) && Do(e, n), null) : (Mo(e, r), No(n.scrollerOf(e, r), r), n.reveal(r), r);
1408
1507
  };
1409
- function xo({
1508
+ function $o({
1410
1509
  title: e,
1411
1510
  titleId: t,
1412
1511
  ...n
1413
1512
  }, r) {
1414
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1513
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1415
1514
  xmlns: "http://www.w3.org/2000/svg",
1416
1515
  viewBox: "0 0 20 20",
1417
1516
  fill: "currentColor",
@@ -1419,19 +1518,19 @@ function xo({
1419
1518
  "data-slot": "icon",
1420
1519
  ref: r,
1421
1520
  "aria-labelledby": t
1422
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1521
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1423
1522
  id: t
1424
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1523
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1425
1524
  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"
1426
1525
  }));
1427
1526
  }
1428
- const Ro = /* @__PURE__ */ y.forwardRef(xo);
1429
- function To({
1527
+ const Po = /* @__PURE__ */ b.forwardRef($o);
1528
+ function Fo({
1430
1529
  title: e,
1431
1530
  titleId: t,
1432
1531
  ...n
1433
1532
  }, r) {
1434
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1533
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1435
1534
  xmlns: "http://www.w3.org/2000/svg",
1436
1535
  viewBox: "0 0 20 20",
1437
1536
  fill: "currentColor",
@@ -1439,23 +1538,23 @@ function To({
1439
1538
  "data-slot": "icon",
1440
1539
  ref: r,
1441
1540
  "aria-labelledby": t
1442
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1541
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1443
1542
  id: t
1444
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1543
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1445
1544
  d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
1446
- }), /* @__PURE__ */ y.createElement("path", {
1545
+ }), /* @__PURE__ */ b.createElement("path", {
1447
1546
  fillRule: "evenodd",
1448
1547
  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",
1449
1548
  clipRule: "evenodd"
1450
1549
  }));
1451
1550
  }
1452
- const Co = /* @__PURE__ */ y.forwardRef(To);
1453
- function Oo({
1551
+ const qo = /* @__PURE__ */ b.forwardRef(Fo);
1552
+ function _o({
1454
1553
  title: e,
1455
1554
  titleId: t,
1456
1555
  ...n
1457
1556
  }, r) {
1458
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1557
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1459
1558
  xmlns: "http://www.w3.org/2000/svg",
1460
1559
  viewBox: "0 0 20 20",
1461
1560
  fill: "currentColor",
@@ -1463,23 +1562,23 @@ function Oo({
1463
1562
  "data-slot": "icon",
1464
1563
  ref: r,
1465
1564
  "aria-labelledby": t
1466
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1565
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1467
1566
  id: t
1468
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1567
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1469
1568
  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"
1470
- }), /* @__PURE__ */ y.createElement("path", {
1569
+ }), /* @__PURE__ */ b.createElement("path", {
1471
1570
  fillRule: "evenodd",
1472
1571
  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",
1473
1572
  clipRule: "evenodd"
1474
1573
  }));
1475
1574
  }
1476
- const Ao = /* @__PURE__ */ y.forwardRef(Oo);
1477
- function Lo({
1575
+ const Bo = /* @__PURE__ */ b.forwardRef(_o);
1576
+ function Io({
1478
1577
  title: e,
1479
1578
  titleId: t,
1480
1579
  ...n
1481
1580
  }, r) {
1482
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1581
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1483
1582
  xmlns: "http://www.w3.org/2000/svg",
1484
1583
  viewBox: "0 0 20 20",
1485
1584
  fill: "currentColor",
@@ -1487,15 +1586,15 @@ function Lo({
1487
1586
  "data-slot": "icon",
1488
1587
  ref: r,
1489
1588
  "aria-labelledby": t
1490
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1589
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1491
1590
  id: t
1492
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1591
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1493
1592
  fillRule: "evenodd",
1494
1593
  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",
1495
1594
  clipRule: "evenodd"
1496
1595
  }));
1497
1596
  }
1498
- const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), No = `[${Je}="${Qe[Je]}"]`, Do = () => {
1597
+ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), Ho = `[${Je}="${Qe[Je]}"]`, zo = () => {
1499
1598
  let e = null;
1500
1599
  return {
1501
1600
  onKeyDownCapture: (t) => {
@@ -1504,7 +1603,7 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
1504
1603
  e = t.target instanceof Element ? t.target : null;
1505
1604
  return;
1506
1605
  }
1507
- e !== null && t.target === e && e.closest(No) !== null || (t.preventDefault(), t.stopPropagation());
1606
+ e !== null && t.target === e && e.closest(Ho) !== null || (t.preventDefault(), t.stopPropagation());
1508
1607
  }
1509
1608
  },
1510
1609
  onKeyUpCapture: (t) => {
@@ -1514,7 +1613,7 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
1514
1613
  t.target === e && (e = null);
1515
1614
  }
1516
1615
  };
1517
- }, Ce = Object.freeze([1 / Se ** 2, 1 / Se, 1, Se, Se ** 2]), Mt = Object.freeze({ mode: "fit" }), $o = 1, Po = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Fo = me(null), qo = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= $o ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Nt = (e, t, n) => {
1616
+ }, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]), Nt = Object.freeze({ mode: "fit" }), Zo = 1, Uo = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Vo = me(null), Go = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Zo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Dt = (e, t, n) => {
1518
1617
  if (e.mode === "level") {
1519
1618
  const o = e.index + n;
1520
1619
  return o >= 0 && o < Ce.length ? o : null;
@@ -1522,46 +1621,46 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
1522
1621
  if (t === null || !Number.isFinite(t) || t <= 0) return null;
1523
1622
  const r = n === 1 ? Ce.findIndex((o) => o > t) : Ce.findLastIndex((o) => o < t);
1524
1623
  return r === -1 ? null : r;
1525
- }, Dt = (e, t, n) => {
1624
+ }, $t = (e, t, n) => {
1526
1625
  if (e.mode === "level") {
1527
- const o = Nt(e, null, n);
1626
+ const o = Dt(e, null, n);
1528
1627
  return o === null ? null : { mode: "level", index: o, base: e.base };
1529
1628
  }
1530
1629
  if (t === null) return null;
1531
- const r = Nt(e, t.scale, n);
1630
+ const r = Dt(e, t.scale, n);
1532
1631
  return r === null ? null : { mode: "level", index: r, base: t.base };
1533
- }, _o = (e) => {
1632
+ }, Ko = (e) => {
1534
1633
  const t = Ce[e];
1535
1634
  if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
1536
1635
  return t;
1537
- }, $t = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Bo = ({ document: e }) => {
1538
- const { labels: t } = D(), n = ne(Fo), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Mt : r.zoom), [i, d] = I(r === null ? null : r.reported), [v, f] = I(null), u = B(null), g = P((M) => {
1539
- const { naturalWidth: s, naturalHeight: a } = M;
1540
- d((h) => $t(h, s, a));
1636
+ }, Pt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Wo = ({ document: e }) => {
1637
+ const { labels: t } = D(), n = re(Vo), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Nt : r.zoom), [i, d] = I(r === null ? null : r.reported), [g, f] = I(null), u = B(null), p = P((M) => {
1638
+ const { naturalWidth: s, naturalHeight: c } = M;
1639
+ d((h) => Pt(h, s, c));
1541
1640
  }, []), m = P(
1542
1641
  (M) => {
1543
- u.current = M, !(M === null || !M.complete) && (M.naturalWidth > 0 || M.naturalHeight > 0 ? g(M) : M.decode().then(
1544
- () => g(M),
1642
+ u.current = M, !(M === null || !M.complete) && (M.naturalWidth > 0 || M.naturalHeight > 0 ? p(M) : M.decode().then(
1643
+ () => p(M),
1545
1644
  () => {
1546
1645
  }
1547
1646
  ));
1548
1647
  },
1549
- [g]
1648
+ [p]
1550
1649
  );
1551
- oe(() => {
1650
+ ne(() => {
1552
1651
  n !== null && i !== null && n.save(e.url, { zoom: o, reported: i });
1553
1652
  }, [n, e.url, o, i]), V(() => {
1554
1653
  const M = u.current;
1555
1654
  if (M === null || i === null || o.mode !== "fit") return;
1556
- const s = () => f((h) => $t(h, M.clientWidth, M.clientHeight));
1655
+ const s = () => f((h) => Pt(h, M.clientWidth, M.clientHeight));
1557
1656
  if (s(), typeof ResizeObserver > "u") return;
1558
- const a = new ResizeObserver(s);
1559
- return a.observe(M), () => a.disconnect();
1657
+ const c = new ResizeObserver(s);
1658
+ return c.observe(M), () => c.disconnect();
1560
1659
  }, [i, o.mode]);
1561
- const k = i === null || v === null ? null : qo(i, v), O = Dt(o, k, -1), E = Dt(o, k, 1), T = o.mode === "level" ? _o(o.index) : null, x = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
1660
+ const x = i === null || g === null ? null : Go(i, g), O = $t(o, x, -1), y = $t(o, x, 1), T = o.mode === "level" ? Ko(o.index) : null, S = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
1562
1661
  return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
1563
- /* @__PURE__ */ F(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(Mo, {}), children: [
1564
- /* @__PURE__ */ c(
1662
+ /* @__PURE__ */ F(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ a(jo, {}), children: [
1663
+ /* @__PURE__ */ a(
1565
1664
  "button",
1566
1665
  {
1567
1666
  type: "button",
@@ -1573,58 +1672,58 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
1573
1672
  O !== null && l(O);
1574
1673
  },
1575
1674
  ...Qe,
1576
- children: /* @__PURE__ */ c(Co, {})
1675
+ children: /* @__PURE__ */ a(qo, {})
1577
1676
  }
1578
1677
  ),
1579
- /* @__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)) }),
1580
- /* @__PURE__ */ c(
1678
+ /* @__PURE__ */ a("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)) }),
1679
+ /* @__PURE__ */ a(
1581
1680
  "button",
1582
1681
  {
1583
1682
  type: "button",
1584
1683
  className: "aqmx-icon-button",
1585
1684
  "aria-label": t.imageZoomIn,
1586
1685
  title: t.imageZoomIn,
1587
- "aria-disabled": E === null,
1686
+ "aria-disabled": y === null,
1588
1687
  onClick: () => {
1589
- E !== null && l(E);
1688
+ y !== null && l(y);
1590
1689
  },
1591
1690
  ...Qe,
1592
- children: /* @__PURE__ */ c(Ao, {})
1691
+ children: /* @__PURE__ */ a(Bo, {})
1593
1692
  }
1594
1693
  ),
1595
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Mt), children: /* @__PURE__ */ c(Ro, {}) })
1694
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Nt), children: /* @__PURE__ */ a(Po, {}) })
1596
1695
  ] }),
1597
- /* @__PURE__ */ c(ke, { scrollerProps: Po, children: /* @__PURE__ */ c("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: x, onLoad: (M) => g(M.currentTarget), "data-testid": "markdown-explorer-image" }) })
1696
+ /* @__PURE__ */ a(xe, { scrollerProps: Uo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: S, onLoad: (M) => p(M.currentTarget), "data-testid": "markdown-explorer-image" }) })
1598
1697
  ] });
1599
- }, vn = me(null), qe = me(void 0), wn = me(null), _e = () => {
1600
- const e = ne(vn);
1698
+ }, wn = me(null), qe = me(void 0), bn = me(null), _e = () => {
1699
+ const e = re(wn);
1601
1700
  if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
1602
1701
  return e;
1603
- }, Io = () => {
1604
- const e = ne(wn);
1702
+ }, Xo = () => {
1703
+ const e = re(bn);
1605
1704
  if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
1606
1705
  return e;
1607
- }, Be = (e, t, n, r) => t.kind === "panel" ? ge(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ge(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ge(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), jo = ({ children: e }) => {
1706
+ }, Be = (e, t, n, r) => t.kind === "panel" ? pe(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? pe(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : pe(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Yo = ({ children: e }) => {
1608
1707
  const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
1609
- return /* @__PURE__ */ c(qe, { value: o, children: /* @__PURE__ */ c(wn, { value: l, children: e }) });
1610
- }, Ho = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', zo = (e) => {
1611
- const t = e instanceof Element ? e.closest(Ho) : null;
1708
+ return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(bn, { value: l, children: e }) });
1709
+ }, Jo = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Qo = (e) => {
1710
+ const t = e instanceof Element ? e.closest(Jo) : null;
1612
1711
  return t === null ? null : t.getAttribute("data-doc-path");
1613
- }, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Uo = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: v }) => {
1712
+ }, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, el = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: g }) => {
1614
1713
  const f = De(e);
1615
- return /* @__PURE__ */ c("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (g) => {
1616
- if (Ie(g)) {
1617
- if (g.preventDefault(), t === d.currentPath && n !== "") {
1714
+ return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (p) => {
1715
+ if (Ie(p)) {
1716
+ if (p.preventDefault(), t === d.currentPath && n !== "") {
1618
1717
  d.scrollWithin(n);
1619
1718
  return;
1620
1719
  }
1621
1720
  i(t, n);
1622
1721
  }
1623
- }, children: v });
1624
- }, Zo = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
1625
- const { config: i } = D(), d = _e(), v = ne(qe), f = ho(e), { navigation: u } = d, g = `${Be(i, u, v, t)}${f}`, m = n === !1 ? "false" : void 0;
1626
- return u.kind === "page" ? /* @__PURE__ */ c(Yr, { ...o, to: g, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ c(Uo, { to: g, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
1627
- }, Vo = ({ className: e, attributes: t, children: n }) => {
1722
+ }, children: g });
1723
+ }, tl = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
1724
+ const { config: i } = D(), d = _e(), g = re(qe), f = So(e), { navigation: u } = d, p = `${Be(i, u, g, t)}${f}`, m = n === !1 ? "false" : void 0;
1725
+ return u.kind === "page" ? /* @__PURE__ */ a(Jr, { ...o, to: p, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ a(el, { to: p, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
1726
+ }, nl = ({ className: e, attributes: t, children: n }) => {
1628
1727
  const { labels: r } = D();
1629
1728
  return (
1630
1729
  /* @__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: [
@@ -1636,39 +1735,39 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
1636
1735
  ] })
1637
1736
  ] })
1638
1737
  );
1639
- }, Go = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1640
- const { config: l } = D(), i = ne(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
1641
- return /* @__PURE__ */ c("a", { ...n, href: d, className: t, onClick: (f) => {
1738
+ }, rl = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1739
+ const { config: l } = D(), i = re(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
1740
+ return /* @__PURE__ */ a("a", { ...n, href: d, className: t, onClick: (f) => {
1642
1741
  Ie(f) && (f.preventDefault(), r.scrollWithin(e));
1643
1742
  }, children: o });
1644
- }, Ko = ({ href: e, className: t, attributes: n, children: r }) => {
1743
+ }, ol = ({ href: e, className: t, attributes: n, children: r }) => {
1645
1744
  const o = _e();
1646
- return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (i) => {
1745
+ return o.navigation.kind === "page" ? /* @__PURE__ */ a("a", { ...n, href: e, className: t, onClick: (i) => {
1647
1746
  if (!Ie(i)) return;
1648
1747
  const d = i.currentTarget;
1649
1748
  e === "#" ? o.followEmptyFragment(i.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, i.nativeEvent);
1650
- }, children: r }) : /* @__PURE__ */ c(Go, { href: e, className: t, attributes: n, scope: o, children: r });
1651
- }, Wo = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !jn(n) ? /* @__PURE__ */ c(Vo, { className: o, attributes: l, children: i }) : /* @__PURE__ */ c(Zo, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ c(Ko, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ c("a", { ...l, href: e, className: o, children: i }), Xo = () => {
1652
- const { config: e } = D(), t = _e(), n = ne(qe), r = $e();
1749
+ }, children: r }) : /* @__PURE__ */ a(rl, { href: e, className: t, attributes: n, scope: o, children: r });
1750
+ }, ll = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !Hn(n) ? /* @__PURE__ */ a(nl, { className: o, attributes: l, children: i }) : /* @__PURE__ */ a(tl, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ a(ol, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ a("a", { ...l, href: e, className: o, children: i }), il = () => {
1751
+ const { config: e } = D(), t = _e(), n = re(qe), r = $e();
1653
1752
  return P(
1654
1753
  (o, l) => {
1655
1754
  if (!Ie(l)) return !0;
1656
1755
  l.preventDefault();
1657
- const i = hn(o.id), { navigation: d } = t;
1756
+ const i = pn(o.id), { navigation: d } = t;
1658
1757
  return d.kind === "panel" || lt(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(i), !0) : (r(`${Be(e, d, n, t.currentPath)}${i}`, "follow-link"), !0);
1659
1758
  },
1660
1759
  [e, t, n, r]
1661
1760
  );
1662
- }, Yo = () => {
1663
- const e = Io();
1664
- return P((t) => `${e}${hn(t.id)}`, [e]);
1761
+ }, sl = () => {
1762
+ const e = Xo();
1763
+ return P((t) => `${e}${pn(t.id)}`, [e]);
1665
1764
  };
1666
- function Jo({
1765
+ function al({
1667
1766
  title: e,
1668
1767
  titleId: t,
1669
1768
  ...n
1670
1769
  }, r) {
1671
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1770
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1672
1771
  xmlns: "http://www.w3.org/2000/svg",
1673
1772
  viewBox: "0 0 20 20",
1674
1773
  fill: "currentColor",
@@ -1676,19 +1775,19 @@ function Jo({
1676
1775
  "data-slot": "icon",
1677
1776
  ref: r,
1678
1777
  "aria-labelledby": t
1679
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1778
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1680
1779
  id: t
1681
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1780
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1682
1781
  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"
1683
1782
  }));
1684
1783
  }
1685
- const Qo = /* @__PURE__ */ y.forwardRef(Jo);
1686
- function el({
1784
+ const cl = /* @__PURE__ */ b.forwardRef(al);
1785
+ function dl({
1687
1786
  title: e,
1688
1787
  titleId: t,
1689
1788
  ...n
1690
1789
  }, r) {
1691
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1790
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1692
1791
  xmlns: "http://www.w3.org/2000/svg",
1693
1792
  viewBox: "0 0 20 20",
1694
1793
  fill: "currentColor",
@@ -1696,21 +1795,21 @@ function el({
1696
1795
  "data-slot": "icon",
1697
1796
  ref: r,
1698
1797
  "aria-labelledby": t
1699
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1798
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1700
1799
  id: t
1701
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1800
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1702
1801
  fillRule: "evenodd",
1703
1802
  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",
1704
1803
  clipRule: "evenodd"
1705
1804
  }));
1706
1805
  }
1707
- const tl = /* @__PURE__ */ y.forwardRef(el);
1708
- function nl({
1806
+ const ul = /* @__PURE__ */ b.forwardRef(dl);
1807
+ function fl({
1709
1808
  title: e,
1710
1809
  titleId: t,
1711
1810
  ...n
1712
1811
  }, r) {
1713
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1812
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
1714
1813
  xmlns: "http://www.w3.org/2000/svg",
1715
1814
  viewBox: "0 0 20 20",
1716
1815
  fill: "currentColor",
@@ -1718,49 +1817,49 @@ function nl({
1718
1817
  "data-slot": "icon",
1719
1818
  ref: r,
1720
1819
  "aria-labelledby": t
1721
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1820
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
1722
1821
  id: t
1723
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1822
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
1724
1823
  fillRule: "evenodd",
1725
1824
  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",
1726
1825
  clipRule: "evenodd"
1727
1826
  }));
1728
1827
  }
1729
- const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aqmx-document-stage" }), ll = (e) => {
1828
+ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aqmx-document-stage" }), pl = (e) => {
1730
1829
  switch (e) {
1731
1830
  case "video":
1732
- return /* @__PURE__ */ c(tl, {});
1831
+ return /* @__PURE__ */ a(ul, {});
1733
1832
  case "audio":
1734
- return /* @__PURE__ */ c(rl, {});
1833
+ return /* @__PURE__ */ a(ml, {});
1735
1834
  case "pdf":
1736
- return /* @__PURE__ */ c(Qo, {});
1835
+ return /* @__PURE__ */ a(cl, {});
1737
1836
  default: {
1738
1837
  const t = e;
1739
1838
  throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
1740
1839
  }
1741
1840
  }
1742
- }, il = ({ document: e }) => {
1841
+ }, gl = ({ document: e }) => {
1743
1842
  const { labels: t } = D();
1744
1843
  switch (e.mediaType) {
1745
1844
  case "video":
1746
1845
  return (
1747
- /* @__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 })
1846
+ /* @__PURE__ */ a("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 })
1748
1847
  );
1749
1848
  case "audio":
1750
1849
  return (
1751
- /* @__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 })
1850
+ /* @__PURE__ */ a("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 })
1752
1851
  );
1753
1852
  case "pdf":
1754
- return /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" });
1853
+ return /* @__PURE__ */ a("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" });
1755
1854
  default: {
1756
1855
  const n = e.mediaType;
1757
1856
  throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
1758
1857
  }
1759
1858
  }
1760
- }, sl = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
1761
- /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: ll(e.mediaType) }),
1762
- /* @__PURE__ */ c(ke, { scrollerProps: ol, children: /* @__PURE__ */ c(il, { document: e }) })
1763
- ] }), al = (e) => ({
1859
+ }, vl = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
1860
+ /* @__PURE__ */ a(Pe, { name: e.name, url: e.url, icon: pl(e.mediaType) }),
1861
+ /* @__PURE__ */ a(xe, { scrollerProps: hl, children: /* @__PURE__ */ a(gl, { document: e }) })
1862
+ ] }), wl = (e) => ({
1764
1863
  loading: e.viewerLoading,
1765
1864
  errorPrefix: e.viewerErrorPrefix,
1766
1865
  styleTitle: e.viewerStyleTitle,
@@ -1794,144 +1893,144 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
1794
1893
  embeddedVideo: e.viewerEmbeddedVideo,
1795
1894
  embeddedPost: e.viewerEmbeddedPost,
1796
1895
  embeddedFrame: e.viewerEmbeddedFrame
1797
- }), bn = (e, t, n) => {
1896
+ }), En = (e, t, n) => {
1798
1897
  if (t !== void 0) return t;
1799
1898
  if (n !== void 0) return n;
1800
1899
  const [r] = e.documentStyles;
1801
1900
  if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
1802
1901
  return r.name;
1803
- }, En = (e, t) => e !== void 0 ? e : t !== void 0 ? t : ir, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), cl = (e, t, n) => {
1902
+ }, yn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : sr, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), bl = (e, t, n) => {
1804
1903
  if (t.view === "multi" || t.overrides[n] === void 0) return null;
1805
1904
  const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
1806
- return ge(e, { ...t, overrides: r });
1905
+ return pe(e, { ...t, overrides: r });
1807
1906
  }, st = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: i, children: d }) => {
1808
- const v = ne(fe);
1907
+ const g = re(fe);
1809
1908
  return (
1810
- /* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": v, className: "aqmx-document", ...i, children: [
1811
- r ? /* @__PURE__ */ c("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
1909
+ /* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": g, className: "aqmx-document", ...i, children: [
1910
+ r ? /* @__PURE__ */ a("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
1812
1911
  d
1813
1912
  ] })
1814
1913
  );
1815
- }, dl = () => {
1914
+ }, El = () => {
1816
1915
  const { labels: e } = D();
1817
- return /* @__PURE__ */ c(st, { kind: "empty", label: e.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: e.documentEmpty }) }) });
1818
- }, yn = ({ label: e }) => {
1916
+ return /* @__PURE__ */ a(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ a("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ a("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
1917
+ }, xn = ({ label: e }) => {
1819
1918
  const { labels: t } = D();
1820
1919
  return /* @__PURE__ */ F(st, { kind: "loading", label: e, stale: !1, busy: !0, children: [
1821
- /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1822
- /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
1920
+ /* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ a("span", {}, n)) }),
1921
+ /* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: t.documentLoading })
1823
1922
  ] });
1824
- }, Pt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), ul = ({ path: e, document: t, viewer: n, editing: r }) => {
1825
- const { reportMathDiagnostics: o, edits: l } = D(), i = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = Xo(), v = Yo(), f = U(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = B(null), { editable: g, doubleClick: m, region: k, paneScroll: O, stale: E } = r;
1923
+ }, Ft = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), yl = ({ path: e, document: t, viewer: n, editing: r }) => {
1924
+ const { reportMathDiagnostics: o, edits: l } = D(), i = Z(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = il(), g = sl(), f = Z(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = B(null), { editable: p, doubleClick: m, region: x, paneScroll: O, stale: y } = r;
1826
1925
  V(() => {
1827
- if (g)
1926
+ if (p)
1828
1927
  return l.bindView(e, {
1829
1928
  anchor: () => {
1830
- const h = u.current, w = k(), S = h === null ? null : h.querySelector(Fe);
1831
- return h === null || w === null || S === null ? null : Ur(h, O.scrollerOf(w, S));
1929
+ const h = u.current, w = x(), k = h === null ? null : h.querySelector(Fe);
1930
+ return h === null || w === null || k === null ? null : Ur(h, O.scrollerOf(w, k));
1832
1931
  }
1833
1932
  });
1834
- }, [l, e, g, k, O]);
1933
+ }, [l, e, p, x, O]);
1835
1934
  const T = (h) => {
1836
- const w = u.current, { target: S } = h;
1837
- !m || w === null || !(S instanceof Element) || !Hr(S) || (h.stopPropagation(), l.start(e, zr(S, w, w.ownerDocument.getSelection())));
1838
- }, x = B(null), M = B(E);
1935
+ const w = u.current, { target: k } = h;
1936
+ !m || w === null || !(k instanceof Element) || !zr(k) || (h.stopPropagation(), l.start(e, Zr(k, w, w.ownerDocument.getSelection())));
1937
+ }, S = B(null), M = B(y);
1839
1938
  V(() => {
1840
- M.current = E;
1939
+ M.current = y;
1841
1940
  });
1842
1941
  const s = ie((h) => {
1843
- const w = u.current, S = k(), L = w === null ? null : Wr(w, h.line);
1844
- if (S === null || L === null) return !1;
1845
- const R = O.scrollerOf(S, L);
1846
- return R.scrollTop += Xr(L, h.line) - h.clientTop, !0;
1847
- }), a = ie((h) => {
1848
- const w = k();
1942
+ const w = u.current, k = x(), L = w === null ? null : Xr(w, h.line);
1943
+ if (k === null || L === null) return !1;
1944
+ const R = O.scrollerOf(k, L);
1945
+ return R.scrollTop += Yr(L, h.line) - h.clientTop, !0;
1946
+ }), c = ie((h) => {
1947
+ const w = x();
1849
1948
  if (w === null) return;
1850
- const S = () => {
1851
- for (const R of Pt) w.removeEventListener(R, L, !0);
1852
- x.current?.release === S && (x.current = null);
1853
- }, L = () => S();
1854
- for (const R of Pt) w.addEventListener(R, L, { capture: !0, passive: !0 });
1855
- x.current = { point: h, release: S };
1949
+ const k = () => {
1950
+ for (const R of Ft) w.removeEventListener(R, L, !0);
1951
+ S.current?.release === k && (S.current = null);
1952
+ }, L = () => k();
1953
+ for (const R of Ft) w.addEventListener(R, L, { capture: !0, passive: !0 });
1954
+ S.current = { point: h, release: k };
1856
1955
  });
1857
1956
  return V(() => {
1858
1957
  const h = l.takeReturn(e);
1859
1958
  if (h !== null)
1860
1959
  return queueMicrotask(() => {
1861
- s(h) && M.current && a(h);
1862
- }), () => x.current?.release();
1960
+ s(h) && M.current && c(h);
1961
+ }), () => S.current?.release();
1863
1962
  }, [l, e]), V(() => {
1864
- const h = x.current;
1865
- h === null || E || (h.release(), s(h.point));
1866
- }, [t, E]),
1867
- /* @__PURE__ */ c("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(Kt, { ...n, onHeadingSelect: d, headingHref: v, onMathDiagnostics: f, parseResult: i, content: null }) });
1963
+ const h = S.current;
1964
+ h === null || y || (h.release(), s(h.point));
1965
+ }, [t, y]),
1966
+ /* @__PURE__ */ a("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ a(Wt, { ...n, onHeadingSelect: d, headingHref: g, onMathDiagnostics: f, parseResult: i, content: null }) });
1868
1967
  }, kn = ({ document: e, viewer: t }) => {
1869
1968
  const { labels: n } = D();
1870
1969
  return /* @__PURE__ */ F(Ne, { children: [
1871
- /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c($r, {}) }),
1872
- e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
1873
- /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(Kt, { ...t, parseResult: null, content: e.text }) })
1970
+ /* @__PURE__ */ a(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ a(Pr, {}), children: e.truncated ? null : /* @__PURE__ */ a(ho, { text: e.text }) }),
1971
+ e.truncated ? /* @__PURE__ */ a("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
1972
+ /* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(Wt, { ...t, parseResult: null, content: e.text }) })
1874
1973
  ] });
1875
- }, fl = ({ path: e, name: t, viewer: n }) => {
1876
- const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), v = te(o.subscribe, d, d), [f, u] = I(0), g = U(() => ({ path: e, stamp: v, attempt: f }), [e, v, f]), [m, k] = I(null), O = ie((T) => {
1877
- k(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
1974
+ }, xl = ({ path: e, name: t, viewer: n }) => {
1975
+ const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g = te(o.subscribe, d, d), [f, u] = I(0), p = Z(() => ({ path: e, stamp: g, attempt: f }), [e, g, f]), [m, x] = I(null), O = ie((T) => {
1976
+ x(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
1878
1977
  });
1879
- oe(() => {
1978
+ ne(() => {
1880
1979
  const T = new AbortController();
1881
- return r.text(g.path, T.signal).then((x) => {
1882
- "kind" in x && O(x);
1980
+ return r.text(p.path, T.signal).then((S) => {
1981
+ "kind" in S && O(S);
1883
1982
  }), () => T.abort();
1884
- }, [r, g]);
1885
- const E = P(() => u((T) => T + 1), []);
1983
+ }, [r, p]);
1984
+ const y = P(() => u((T) => T + 1), []);
1886
1985
  return m === null ? /* @__PURE__ */ F(Ne, { children: [
1887
- /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ c("span", {}, T)) }),
1888
- /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: i.markupLoading })
1889
- ] }) : m.kind === "failure" ? /* @__PURE__ */ c(ke, { scrollerProps: Sn, children: /* @__PURE__ */ c(ve, { failure: m.failure, alert: !1, onRetry: E, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(kn, { document: m, viewer: n });
1890
- }, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), ml = Object.freeze({ reason: "failed" }), hl = (e) => /* @__PURE__ */ c(
1891
- Fr,
1986
+ /* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ a("span", {}, T)) }),
1987
+ /* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: i.markupLoading })
1988
+ ] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps: Sn, children: /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: y, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ a(kn, { document: m, viewer: n });
1989
+ }, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), kl = Object.freeze({ reason: "failed" }), Sl = (e) => /* @__PURE__ */ a(
1990
+ qr,
1892
1991
  {
1893
- fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(ve, { failure: ml, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
1894
- children: /* @__PURE__ */ c(
1895
- pe,
1992
+ fallback: (t) => /* @__PURE__ */ a("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ a(ve, { failure: kl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
1993
+ children: /* @__PURE__ */ a(
1994
+ ge,
1896
1995
  {
1897
- fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: it.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
1898
- children: /* @__PURE__ */ c(Pr, { ...e })
1996
+ fallback: /* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: it.map((t) => /* @__PURE__ */ a("span", {}, t)) }),
1997
+ children: /* @__PURE__ */ a(Fr, { ...e })
1899
1998
  }
1900
1999
  )
1901
2000
  }
1902
- ), gl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: l }) => {
2001
+ ), Rl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: l }) => {
1903
2002
  switch (t.kind) {
1904
2003
  case "markdown": {
1905
- const { session: i, layout: d, region: v, paneScroll: f, stale: u } = l;
1906
- if (n === "edit" && i !== void 0) return /* @__PURE__ */ c(hl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: v, paneScroll: f });
1907
- if (n === "markup") return /* @__PURE__ */ c(fl, { path: e, name: t.name, viewer: r });
1908
- const g = t.edit !== null && t.edit.kind === "inline";
1909
- return /* @__PURE__ */ c(ul, { path: e, document: t, viewer: r, editing: { editable: g, doubleClick: g && d === "fill", region: v, paneScroll: f, stale: u } });
2004
+ const { session: i, layout: d, region: g, paneScroll: f, stale: u } = l;
2005
+ if (n === "edit" && i !== void 0) return /* @__PURE__ */ a(Sl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: g, paneScroll: f });
2006
+ if (n === "markup") return /* @__PURE__ */ a(xl, { path: e, name: t.name, viewer: r });
2007
+ const p = t.edit !== null && t.edit.kind === "inline";
2008
+ return /* @__PURE__ */ a(yl, { path: e, document: t, viewer: r, editing: { editable: p, doubleClick: p && d === "fill", region: g, paneScroll: f, stale: u } });
1910
2009
  }
1911
2010
  case "text":
1912
- return /* @__PURE__ */ c(kn, { document: t, viewer: r });
2011
+ return /* @__PURE__ */ a(kn, { document: t, viewer: r });
1913
2012
  case "image":
1914
- return /* @__PURE__ */ c(Bo, { document: t });
2013
+ return /* @__PURE__ */ a(Wo, { document: t });
1915
2014
  case "media":
1916
- return /* @__PURE__ */ c(sl, { document: t });
2015
+ return /* @__PURE__ */ a(vl, { document: t });
1917
2016
  case "file":
1918
- return /* @__PURE__ */ c(mo, { document: t });
2017
+ return /* @__PURE__ */ a(ko, { document: t });
1919
2018
  case "failure":
1920
- return /* @__PURE__ */ c(ke, { scrollerProps: Sn, children: /* @__PURE__ */ c(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
2019
+ return /* @__PURE__ */ a(xe, { scrollerProps: Sn, children: /* @__PURE__ */ a(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
1921
2020
  default: {
1922
2021
  const i = t;
1923
2022
  throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(i)}`);
1924
2023
  }
1925
2024
  }
1926
- }, pl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', vl = (e, t, n) => {
1927
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : pn(e, n), r === void 0 ? null : gn(e, r.id), e.querySelector(Fe), e.querySelector(pl)];
2025
+ }, Tl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Cl = (e, t, n) => {
2026
+ const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : vn(e, n), r === void 0 ? null : gn(e, r.id), e.querySelector(Fe), e.querySelector(Tl)];
1928
2027
  for (const l of o)
1929
- if (l instanceof HTMLElement && cn(l)) return l;
2028
+ if (l instanceof HTMLElement && dn(l)) return l;
1930
2029
  return null;
1931
- }, Ft = (e, t, n) => {
2030
+ }, qt = (e, t, n) => {
1932
2031
  const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
1933
- t instanceof HTMLElement && n && (l || e.contains(r)) && cn(t);
1934
- }, wl = (e) => {
2032
+ t instanceof HTMLElement && n && (l || e.contains(r)) && dn(t);
2033
+ }, Ol = (e) => {
1935
2034
  const t = B(!1);
1936
2035
  return V(() => {
1937
2036
  const n = e.current;
@@ -1943,32 +2042,32 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
1943
2042
  l = !(m.target instanceof Node && n.contains(m.target)), l && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(i), i = setTimeout(() => {
1944
2043
  l = !1;
1945
2044
  }, 0);
1946
- }, v = (m) => {
2045
+ }, g = (m) => {
1947
2046
  t.current = m.target instanceof Node && n.contains(m.target);
1948
2047
  }, f = (m) => {
1949
2048
  m.relatedTarget === null && l && (t.current = !1);
1950
2049
  }, u = () => {
1951
- const { activeElement: m, body: k } = r;
1952
- m !== null && m !== k && (t.current = n.contains(m));
1953
- }, g = () => {
2050
+ const { activeElement: m, body: x } = r;
2051
+ m !== null && m !== x && (t.current = n.contains(m));
2052
+ }, p = () => {
1954
2053
  l && !n.contains(r.activeElement) && (t.current = !1);
1955
2054
  };
1956
- return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", v, !0), o.addEventListener("blur", u), o.addEventListener("focus", g), n.addEventListener("focusout", f), () => {
1957
- clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", v, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", g), n.removeEventListener("focusout", f);
2055
+ return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", g, !0), o.addEventListener("blur", u), o.addEventListener("focus", p), n.addEventListener("focusout", f), () => {
2056
+ clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", p), n.removeEventListener("focusout", f);
1958
2057
  };
1959
2058
  }, [e]), t;
1960
- }, bl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: v, paneScroll: f, announces: u, announceFailure: g, onDocumentShown: m }) => {
1961
- const { labels: k, announcer: O, documents: E } = D(), { document: T } = t, x = B(null), M = B(null), s = B(null), a = B(0), h = wl(x), w = B({ path: e, document: T }), S = B(null), L = P(
2059
+ }, Al = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure: p, onDocumentShown: m }) => {
2060
+ const { labels: x, announcer: O, documents: y } = D(), { document: T } = t, S = B(null), M = B(null), s = B(null), c = B(0), h = Ol(S), w = B({ path: e, document: T }), k = B(null), L = P(
1962
2061
  (z) => {
1963
- const K = x.current, Q = Lt(K, z, f);
1964
- K !== null && Q !== null && Ft(K, Q, h.current);
2062
+ const K = S.current, Q = Mt(K, z, f);
2063
+ K !== null && Q !== null && qt(K, Q, h.current);
1965
2064
  },
1966
2065
  [f, h]
1967
2066
  ), R = P(
1968
2067
  (z, K) => {
1969
- const Q = a.current;
2068
+ const Q = c.current;
1970
2069
  setTimeout(() => {
1971
- !K.defaultPrevented && a.current === Q && L(z);
2070
+ !K.defaultPrevented && c.current === Q && L(z);
1972
2071
  }, 0);
1973
2072
  },
1974
2073
  [L]
@@ -1979,81 +2078,81 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
1979
2078
  }, 0);
1980
2079
  },
1981
2080
  [L]
1982
- ), q = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() => E.retry(e), [E, e]), J = Jr(E, zo), ee = ln(e), X = ee !== void 0 ? "edit" : n ? "markup" : "rendered", $ = T.kind === "markdown" ? X : void 0, G = P(() => x.current, []), p = U(() => ({ session: ee, layout: l, region: G, paneScroll: f, stale: r }), [ee, l, G, f, r]), b = $ === "edit" ? !1 : r, C = ne(fe), A = $ === "edit" && l === "fill" ? "fill" : C, _ = ie((z, K) => {
2081
+ ), q = Z(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() => y.retry(e), [y, e]), J = Qr(y, Qo), ee = sn(e), X = ee !== void 0 ? "edit" : n ? "markup" : "rendered", $ = T.kind === "markdown" ? X : void 0, G = P(() => S.current, []), v = Z(() => ({ session: ee, layout: l, region: G, paneScroll: f, stale: r }), [ee, l, G, f, r]), E = $ === "edit" ? !1 : r, C = re(fe), A = $ === "edit" && l === "fill" ? "fill" : C, _ = ie((z, K) => {
1983
2082
  const Q = M.current;
1984
2083
  if (Q !== null && Q.path === z && Q.snapshot === K) return;
1985
2084
  M.current = { path: z, snapshot: K };
1986
- const re = K.document;
1987
- if (re.kind === "failure") {
1988
- E.noteFailureShown(K) && g(k.documentFailed(Ee(z), ae(k, re.failure.reason)));
2085
+ const oe = K.document;
2086
+ if (oe.kind === "failure") {
2087
+ y.noteFailureShown(K) && p(x.documentFailed(Ee(z), ae(x, oe.failure.reason)));
1989
2088
  return;
1990
2089
  }
1991
- m?.(z, re), u && (Q === null || Q.path !== z || Q.snapshot.document.kind === "failure") && O.announce(k.documentShown(re.name));
2090
+ m?.(z, oe), u && (Q === null || Q.path !== z || Q.snapshot.document.kind === "failure") && O.announce(x.documentShown(oe.name));
1992
2091
  });
1993
- oe(() => {
2092
+ ne(() => {
1994
2093
  _(e, t);
1995
2094
  }, [e, t]);
1996
2095
  const j = ie(() => {
1997
- v.kind === "panel" && v.consume();
1998
- }), Z = ie((z) => {
1999
- const K = x.current;
2096
+ g.kind === "panel" && g.consume();
2097
+ }), U = ie((z) => {
2098
+ const K = S.current;
2000
2099
  if (K === null || !h.current) return null;
2001
- const { activeElement: Q, body: re } = K.ownerDocument;
2002
- return Q !== null && Q !== re ? null : vl(K, T, z);
2100
+ const { activeElement: Q, body: oe } = K.ownerDocument;
2101
+ return Q !== null && Q !== oe ? null : Cl(K, T, z);
2003
2102
  }), H = ie((z) => {
2004
- const K = x.current;
2005
- K !== null && Ft(K, z, h.current);
2006
- }), le = ie((z) => f.reveal(z)), ct = ie((z) => Lt(x.current, z, f));
2007
- return oe(() => {
2103
+ const K = S.current;
2104
+ K !== null && qt(K, z, h.current);
2105
+ }), le = ie((z) => f.reveal(z)), ct = ie((z) => Mt(S.current, z, f));
2106
+ return ne(() => {
2008
2107
  if (r) return;
2009
2108
  const z = w.current.path !== e, K = z || w.current.document !== T;
2010
2109
  w.current = { path: e, document: T };
2011
- const Q = S.current !== e;
2012
- S.current = e;
2013
- let re = null;
2014
- v.kind === "page" ? s.current !== v.navigation && (s.current = v.navigation, a.current += 1, re = v.fragment) : v.fragment !== null && (re = v.fragment, j());
2110
+ const Q = k.current !== e;
2111
+ k.current = e;
2112
+ let oe = null;
2113
+ g.kind === "page" ? s.current !== g.navigation && (s.current = g.navigation, c.current += 1, oe = g.fragment) : g.fragment !== null && (oe = g.fragment, j());
2015
2114
  const dt = () => {
2016
- const je = re === null ? null : ct(re);
2115
+ const je = oe === null ? null : ct(oe);
2017
2116
  if (!K) {
2018
2117
  je !== null && H(je);
2019
2118
  return;
2020
2119
  }
2021
- const ut = Z(v.fragment);
2120
+ const ut = U(g.fragment);
2022
2121
  z && je === null && ut !== null && le(ut);
2023
2122
  };
2024
2123
  Q ? queueMicrotask(dt) : dt();
2025
- }, [v, e, T, r]), /* @__PURE__ */ c(fe, { value: A, children: /* @__PURE__ */ c(st, { kind: T.kind, view: $, label: i(e, T), stale: b, busy: b, frameRef: x, intent: J, children: /* @__PURE__ */ c(vn, { value: q, children: /* @__PURE__ */ c(jo, { children: /* @__PURE__ */ c(gl, { path: e, document: T, view: X, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2026
- }, at = Object.freeze({ kind: "skeleton" }), El = (e, t, n, r, o) => {
2124
+ }, [g, e, T, r]), /* @__PURE__ */ a(fe, { value: A, children: /* @__PURE__ */ a(st, { kind: T.kind, view: $, label: i(e, T), stale: E, busy: E, frameRef: S, intent: J, children: /* @__PURE__ */ a(wn, { value: q, children: /* @__PURE__ */ a(Yo, { children: /* @__PURE__ */ a(Rl, { path: e, document: T, view: X, viewer: o, onRetry: W, editing: v }, e) }) }) }) });
2125
+ }, at = Object.freeze({ kind: "skeleton" }), Ll = (e, t, n, r, o) => {
2027
2126
  if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
2028
2127
  const l = de(t);
2029
2128
  if (l !== null) return { kind: "document", path: e, snapshot: l, stale: !0 };
2030
2129
  if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
2031
2130
  const i = n === null || n === e ? null : de(r);
2032
2131
  return n === null || i === null ? at : { kind: "document", path: n, snapshot: i, stale: !0 };
2033
- }, yl = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, kl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2034
- const o = t.kind === "streaming" ? yl(t.path, ne(t.promise)) : t;
2035
- return o.kind !== "document" ? /* @__PURE__ */ c(yn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(bl, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2036
- }, xn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: v }) => {
2037
- const { config: f, labels: u, theme: g, documents: m } = D(), k = or(), O = B(!1);
2132
+ }, Ml = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, Nl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2133
+ const o = t.kind === "streaming" ? Ml(t.path, re(t.promise)) : t;
2134
+ return o.kind !== "document" ? /* @__PURE__ */ a(xn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ a(Al, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2135
+ }, Rn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: g }) => {
2136
+ const { config: f, labels: u, theme: p, documents: m } = D(), x = lr(), O = B(!1);
2038
2137
  V(() => {
2039
2138
  O.current = !0;
2040
2139
  }, []);
2041
- const [E, T] = I(null), [x, M] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), a = te(m.subscribe, s, s), h = P(() => E === null ? void 0 : m.peek(E), [m, E]), w = te(m.subscribe, h, h);
2042
- V(() => e === null ? void 0 : m.open(e), [m, e]), V(() => E === null ? void 0 : m.retain(E), [m, E]);
2043
- const S = e === null ? at : El(e, a, E, w, !O.current), L = e === null ? null : S.kind === "document" && !S.stale ? S.path : E;
2044
- L !== E && T(L);
2045
- const R = S.kind !== "document" || S.path === e;
2046
- R && t !== x && M(t);
2047
- const N = U(() => al(u), [u]), q = U(() => [...f.iframeHosts], [f]), W = r.kind === "panel", J = U(
2140
+ const [y, T] = I(null), [S, M] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), c = te(m.subscribe, s, s), h = P(() => y === null ? void 0 : m.peek(y), [m, y]), w = te(m.subscribe, h, h);
2141
+ V(() => e === null ? void 0 : m.open(e), [m, e]), V(() => y === null ? void 0 : m.retain(y), [m, y]);
2142
+ const k = e === null ? at : Ll(e, c, y, w, !O.current), L = e === null ? null : k.kind === "document" && !k.stale ? k.path : y;
2143
+ L !== y && T(L);
2144
+ const R = k.kind !== "document" || k.path === e;
2145
+ R && t !== S && M(t);
2146
+ const N = Z(() => wl(u), [u]), q = Z(() => [...f.iframeHosts], [f]), W = r.kind === "panel", J = Z(
2048
2147
  () => ({
2049
2148
  labels: N,
2050
2149
  emptyMessage: u.documentEmpty,
2051
- theme: g,
2150
+ theme: p,
2052
2151
  availableStyles: f.documentStyles,
2053
2152
  iFrameAllowedDomains: q,
2054
2153
  embeds: f.embeds,
2055
- linkComponent: Wo,
2056
- toolbar: k,
2154
+ linkComponent: ll,
2155
+ toolbar: x,
2057
2156
  style: n.style,
2058
2157
  onStyleChange: n.onStyleChange,
2059
2158
  align: n.align,
@@ -2064,16 +2163,16 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
2064
2163
  padding: n.padding,
2065
2164
  width: n.width === void 0 ? void 0 : `min(${n.width}, 100%)`,
2066
2165
  maxWidth: n.maxWidth === void 0 ? void 0 : `min(${n.maxWidth}, 100%)`,
2067
- renderScrollBar: W ? void 0 : dn
2166
+ renderScrollBar: W ? void 0 : un
2068
2167
  }),
2069
- [N, u.documentEmpty, g, f.documentStyles, q, f.embeds, k, n, W]
2168
+ [N, u.documentEmpty, p, f.documentStyles, q, f.embeds, x, n, W]
2070
2169
  ), ee = P(($, G) => W ? G === null || G.kind === "failure" ? Ee($) : G.name : u.documentRegion, [W, u.documentRegion]), X = W ? "content" : "fill";
2071
- return e === null ? /* @__PURE__ */ c(fe, { value: X, children: /* @__PURE__ */ c(dl, {}) }) : /* @__PURE__ */ c(fe, { value: X, children: /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c(yn, { label: ee(e, null) }), children: /* @__PURE__ */ c(
2072
- kl,
2170
+ return e === null ? /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(El, {}) }) : /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a(xn, { label: ee(e, null) }), children: /* @__PURE__ */ a(
2171
+ Nl,
2073
2172
  {
2074
2173
  requestedPath: e,
2075
- content: S,
2076
- markup: R ? t : x,
2174
+ content: k,
2175
+ markup: R ? t : S,
2077
2176
  viewer: J,
2078
2177
  editLayout: n.editLayout,
2079
2178
  regionLabel: ee,
@@ -2082,33 +2181,33 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
2082
2181
  paneScroll: l,
2083
2182
  announces: i,
2084
2183
  announceFailure: d,
2085
- onDocumentShown: v
2184
+ onDocumentShown: g
2086
2185
  }
2087
2186
  ) }) });
2088
- }, Sl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2089
- const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), v = Ae((L) => L.align), f = $e(), u = Vt(), g = nt(), { view: m, overrides: k, embed: O } = n, E = P(
2187
+ }, Dl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2188
+ const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u = Gt(), p = nt(), { view: m, overrides: x, embed: O } = n, y = P(
2090
2189
  (L) => {
2091
- if (g.kind !== "location") return;
2092
- const R = cl(o, g.location, L);
2190
+ if (p.kind !== "location") return;
2191
+ const R = bl(o, p.location, L);
2093
2192
  R !== null && f(R, "browse");
2094
2193
  },
2095
- [o, f, g]
2194
+ [o, f, p]
2096
2195
  ), T = P(
2097
2196
  (L) => {
2098
- l.update({ style: L }), E("style");
2197
+ l.update({ style: L }), y("style");
2099
2198
  },
2100
- [l, E]
2101
- ), x = P(
2199
+ [l, y]
2200
+ ), S = P(
2102
2201
  (L) => {
2103
- l.update({ align: L }), E("align");
2202
+ l.update({ align: L }), y("align");
2104
2203
  },
2105
- [l, E]
2106
- ), M = bn(o, k.style, d), s = En(k.align, v), a = U(
2204
+ [l, y]
2205
+ ), M = En(o, x.style, d), s = yn(x.align, g), c = Z(
2107
2206
  () => ({
2108
2207
  style: M,
2109
2208
  onStyleChange: T,
2110
2209
  align: s,
2111
- onAlignChange: x,
2210
+ onAlignChange: S,
2112
2211
  showToc: O.showToc !== !1,
2113
2212
  showStyle: O.showStyle !== !1,
2114
2213
  showAlign: O.showAlign !== !1,
@@ -2117,16 +2216,16 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
2117
2216
  maxWidth: O.maxWidth,
2118
2217
  editLayout: "fill"
2119
2218
  }),
2120
- [M, T, s, x, O]
2121
- ), h = U(() => ({ kind: "page", view: m, overrides: k, embed: O }), [m, k, O]), w = U(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), S = P((L) => i.announce(L), [i]);
2122
- return /* @__PURE__ */ c(xn, { path: e, markup: t, display: a, navigation: h, fragment: w, paneScroll: Eo, announces: !0, announceFailure: S, onDocumentShown: r });
2123
- }, xl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2124
- const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [v, f] = I(() => bn(o, void 0, i)), u = En(void 0, d), g = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: k, pendingHash: O, onHashConsumed: E, announceFailure: T, paneScroll: x } = n, M = U(
2219
+ [M, T, s, S, O]
2220
+ ), h = Z(() => ({ kind: "page", view: m, overrides: x, embed: O }), [m, x, O]), w = Z(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), k = P((L) => i.announce(L), [i]);
2221
+ return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: c, navigation: h, fragment: w, paneScroll: Lo, announces: !0, announceFailure: k, onDocumentShown: r });
2222
+ }, $l = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2223
+ const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [g, f] = I(() => En(o, void 0, i)), u = yn(void 0, d), p = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: x, pendingHash: O, onHashConsumed: y, announceFailure: T, paneScroll: S } = n, M = Z(
2125
2224
  () => ({
2126
- style: v,
2225
+ style: g,
2127
2226
  onStyleChange: f,
2128
2227
  align: u,
2129
- onAlignChange: g,
2228
+ onAlignChange: p,
2130
2229
  showToc: m,
2131
2230
  showStyle: m,
2132
2231
  showAlign: m,
@@ -2135,16 +2234,16 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
2135
2234
  maxWidth: void 0,
2136
2235
  editLayout: m ? "fill" : "content"
2137
2236
  }),
2138
- [v, u, g, m]
2139
- ), s = U(() => ({ kind: "panel", onDocumentLink: k }), [k]), a = U(() => ({ kind: "panel", fragment: O, consume: E }), [O, E]);
2140
- return /* @__PURE__ */ c(xn, { path: e, markup: t, display: M, navigation: s, fragment: a, paneScroll: x, announces: !1, announceFailure: T, onDocumentShown: r });
2141
- }, Rl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ c(Sl, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ c(xl, { path: e, markup: t, variant: n, onDocumentShown: r });
2142
- function Tl({
2237
+ [g, u, p, m]
2238
+ ), s = Z(() => ({ kind: "panel", onDocumentLink: x }), [x]), c = Z(() => ({ kind: "panel", fragment: O, consume: y }), [O, y]);
2239
+ return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: M, navigation: s, fragment: c, paneScroll: S, announces: !1, announceFailure: T, onDocumentShown: r });
2240
+ }, Pl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ a(Dl, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ a($l, { path: e, markup: t, variant: n, onDocumentShown: r });
2241
+ function Fl({
2143
2242
  title: e,
2144
2243
  titleId: t,
2145
2244
  ...n
2146
2245
  }, r) {
2147
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2246
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2148
2247
  xmlns: "http://www.w3.org/2000/svg",
2149
2248
  viewBox: "0 0 24 24",
2150
2249
  fill: "currentColor",
@@ -2152,21 +2251,21 @@ function Tl({
2152
2251
  "data-slot": "icon",
2153
2252
  ref: r,
2154
2253
  "aria-labelledby": t
2155
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2254
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2156
2255
  id: t
2157
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2256
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2158
2257
  fillRule: "evenodd",
2159
2258
  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",
2160
2259
  clipRule: "evenodd"
2161
2260
  }));
2162
2261
  }
2163
- const Cl = /* @__PURE__ */ y.forwardRef(Tl);
2164
- function Ol({
2262
+ const ql = /* @__PURE__ */ b.forwardRef(Fl);
2263
+ function _l({
2165
2264
  title: e,
2166
2265
  titleId: t,
2167
2266
  ...n
2168
2267
  }, r) {
2169
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2268
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2170
2269
  xmlns: "http://www.w3.org/2000/svg",
2171
2270
  viewBox: "0 0 24 24",
2172
2271
  fill: "currentColor",
@@ -2174,21 +2273,21 @@ function Ol({
2174
2273
  "data-slot": "icon",
2175
2274
  ref: r,
2176
2275
  "aria-labelledby": t
2177
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2276
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2178
2277
  id: t
2179
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2278
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2180
2279
  fillRule: "evenodd",
2181
2280
  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",
2182
2281
  clipRule: "evenodd"
2183
2282
  }));
2184
2283
  }
2185
- const Al = /* @__PURE__ */ y.forwardRef(Ol);
2186
- function Ll({
2284
+ const Bl = /* @__PURE__ */ b.forwardRef(_l);
2285
+ function Il({
2187
2286
  title: e,
2188
2287
  titleId: t,
2189
2288
  ...n
2190
2289
  }, r) {
2191
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2290
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2192
2291
  xmlns: "http://www.w3.org/2000/svg",
2193
2292
  viewBox: "0 0 24 24",
2194
2293
  fill: "currentColor",
@@ -2196,21 +2295,21 @@ function Ll({
2196
2295
  "data-slot": "icon",
2197
2296
  ref: r,
2198
2297
  "aria-labelledby": t
2199
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2298
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2200
2299
  id: t
2201
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2300
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2202
2301
  fillRule: "evenodd",
2203
2302
  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",
2204
2303
  clipRule: "evenodd"
2205
2304
  }));
2206
2305
  }
2207
- const Ml = /* @__PURE__ */ y.forwardRef(Ll);
2208
- function Nl({
2306
+ const jl = /* @__PURE__ */ b.forwardRef(Il);
2307
+ function Hl({
2209
2308
  title: e,
2210
2309
  titleId: t,
2211
2310
  ...n
2212
2311
  }, r) {
2213
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2312
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2214
2313
  xmlns: "http://www.w3.org/2000/svg",
2215
2314
  viewBox: "0 0 24 24",
2216
2315
  fill: "currentColor",
@@ -2218,25 +2317,25 @@ function Nl({
2218
2317
  "data-slot": "icon",
2219
2318
  ref: r,
2220
2319
  "aria-labelledby": t
2221
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2320
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2222
2321
  id: t
2223
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2322
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2224
2323
  fillRule: "evenodd",
2225
2324
  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",
2226
2325
  clipRule: "evenodd"
2227
- }), /* @__PURE__ */ y.createElement("path", {
2326
+ }), /* @__PURE__ */ b.createElement("path", {
2228
2327
  fillRule: "evenodd",
2229
2328
  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",
2230
2329
  clipRule: "evenodd"
2231
2330
  }));
2232
2331
  }
2233
- const Dl = /* @__PURE__ */ y.forwardRef(Nl);
2234
- function $l({
2332
+ const zl = /* @__PURE__ */ b.forwardRef(Hl);
2333
+ function Zl({
2235
2334
  title: e,
2236
2335
  titleId: t,
2237
2336
  ...n
2238
2337
  }, r) {
2239
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2338
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2240
2339
  xmlns: "http://www.w3.org/2000/svg",
2241
2340
  viewBox: "0 0 24 24",
2242
2341
  fill: "currentColor",
@@ -2244,21 +2343,21 @@ function $l({
2244
2343
  "data-slot": "icon",
2245
2344
  ref: r,
2246
2345
  "aria-labelledby": t
2247
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2346
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2248
2347
  id: t
2249
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2348
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2250
2349
  fillRule: "evenodd",
2251
2350
  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",
2252
2351
  clipRule: "evenodd"
2253
2352
  }));
2254
2353
  }
2255
- const Pl = /* @__PURE__ */ y.forwardRef($l);
2256
- function Fl({
2354
+ const Ul = /* @__PURE__ */ b.forwardRef(Zl);
2355
+ function Vl({
2257
2356
  title: e,
2258
2357
  titleId: t,
2259
2358
  ...n
2260
2359
  }, r) {
2261
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2360
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2262
2361
  xmlns: "http://www.w3.org/2000/svg",
2263
2362
  viewBox: "0 0 24 24",
2264
2363
  fill: "currentColor",
@@ -2266,23 +2365,23 @@ function Fl({
2266
2365
  "data-slot": "icon",
2267
2366
  ref: r,
2268
2367
  "aria-labelledby": t
2269
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2368
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2270
2369
  id: t
2271
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2370
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2272
2371
  fillRule: "evenodd",
2273
2372
  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",
2274
2373
  clipRule: "evenodd"
2275
- }), /* @__PURE__ */ y.createElement("path", {
2374
+ }), /* @__PURE__ */ b.createElement("path", {
2276
2375
  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"
2277
2376
  }));
2278
2377
  }
2279
- const ql = /* @__PURE__ */ y.forwardRef(Fl);
2280
- function _l({
2378
+ const Gl = /* @__PURE__ */ b.forwardRef(Vl);
2379
+ function Kl({
2281
2380
  title: e,
2282
2381
  titleId: t,
2283
2382
  ...n
2284
2383
  }, r) {
2285
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2384
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2286
2385
  xmlns: "http://www.w3.org/2000/svg",
2287
2386
  viewBox: "0 0 24 24",
2288
2387
  fill: "currentColor",
@@ -2290,23 +2389,23 @@ function _l({
2290
2389
  "data-slot": "icon",
2291
2390
  ref: r,
2292
2391
  "aria-labelledby": t
2293
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2392
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2294
2393
  id: t
2295
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2394
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2296
2395
  d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
2297
- }), /* @__PURE__ */ y.createElement("path", {
2396
+ }), /* @__PURE__ */ b.createElement("path", {
2298
2397
  fillRule: "evenodd",
2299
2398
  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",
2300
2399
  clipRule: "evenodd"
2301
2400
  }));
2302
2401
  }
2303
- const Bl = /* @__PURE__ */ y.forwardRef(_l);
2304
- function Il({
2402
+ const Wl = /* @__PURE__ */ b.forwardRef(Kl);
2403
+ function Xl({
2305
2404
  title: e,
2306
2405
  titleId: t,
2307
2406
  ...n
2308
2407
  }, r) {
2309
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2408
+ return /* @__PURE__ */ b.createElement("svg", Object.assign({
2310
2409
  xmlns: "http://www.w3.org/2000/svg",
2311
2410
  viewBox: "0 0 24 24",
2312
2411
  fill: "currentColor",
@@ -2314,49 +2413,49 @@ function Il({
2314
2413
  "data-slot": "icon",
2315
2414
  ref: r,
2316
2415
  "aria-labelledby": t
2317
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2416
+ }, n), e ? /* @__PURE__ */ b.createElement("title", {
2318
2417
  id: t
2319
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2418
+ }, e) : null, /* @__PURE__ */ b.createElement("path", {
2320
2419
  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"
2321
- }), /* @__PURE__ */ y.createElement("path", {
2420
+ }), /* @__PURE__ */ b.createElement("path", {
2322
2421
  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"
2323
2422
  }));
2324
2423
  }
2325
- const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId: n }) => {
2424
+ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId: n }) => {
2326
2425
  const { labels: r, onEditGrant: o } = D(), [l, i] = I(!1), d = () => {
2327
- o === void 0 || l || (i(!0), o(e).then((v) => {
2328
- v && t();
2426
+ o === void 0 || l || (i(!0), o(e).then((g) => {
2427
+ g && t();
2329
2428
  }).finally(() => i(!1)));
2330
2429
  };
2331
2430
  return /* @__PURE__ */ F("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
2332
- /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
2333
- /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
2431
+ /* @__PURE__ */ a("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
2432
+ /* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
2334
2433
  /* @__PURE__ */ F("div", { className: "aqmx-edit-grant-actions", children: [
2335
- o === void 0 ? /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
2336
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": l, "data-testid": `${n}-open`, onClick: d, children: r.editGrantAction })
2434
+ o === void 0 ? /* @__PURE__ */ a("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
2435
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": l, "data-testid": `${n}-open`, onClick: d, children: r.editGrantAction })
2337
2436
  ),
2338
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2437
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2339
2438
  ] })
2340
2439
  ] });
2341
- }, qt = (e, t, n) => {
2440
+ }, _t = (e, t, n) => {
2342
2441
  const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
2343
2442
  return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
2344
- }, zl = ({ path: e, documentName: t, open: n, onClose: r }) => {
2345
- const { data: o, edits: l, labels: i, locale: d, announcer: v } = D(), f = B(null), u = B(null), g = Oe(), [m, k] = I(null), [O, E] = I(0), [T, x] = I(null), [M, s] = I(null), a = U(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
2443
+ }, Ql = ({ path: e, documentName: t, open: n, onClose: r }) => {
2444
+ const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f = B(null), u = B(null), p = Oe(), [m, x] = I(null), [O, y] = I(0), [T, S] = I(null), [M, s] = I(null), c = Z(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
2346
2445
  V(() => {
2347
2446
  const R = f.current;
2348
2447
  if (R !== null)
2349
2448
  if (n && !R.open) {
2350
2449
  const N = R.ownerDocument.activeElement;
2351
- u.current = N instanceof HTMLElement ? N : null, x(null), s(null), R.showModal();
2450
+ u.current = N instanceof HTMLElement ? N : null, S(null), s(null), R.showModal();
2352
2451
  } else !n && R.open && (R.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
2353
- }, [n]), oe(() => {
2452
+ }, [n]), ne(() => {
2354
2453
  if (!n) return;
2355
2454
  const R = new AbortController();
2356
- return k(null), o.revisions(e, R.signal).then((N) => {
2357
- "kind" in N && k(N);
2455
+ return x(null), o.revisions(e, R.signal).then((N) => {
2456
+ "kind" in N && x(N);
2358
2457
  }), () => R.abort();
2359
- }, [n, o, e, O]), oe(() => {
2458
+ }, [n, o, e, O]), ne(() => {
2360
2459
  if (!n || T === null) return;
2361
2460
  const R = new AbortController();
2362
2461
  return s(null), o.revision(e, T, R.signal).then((N) => {
@@ -2364,38 +2463,38 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2364
2463
  }), () => R.abort();
2365
2464
  }, [n, o, e, T]);
2366
2465
  const h = () => {
2367
- M === null || M.kind !== "revision" || (l.replaceDraft(e, M.text), v.announce(i.historyRestored(t)), r());
2466
+ M === null || M.kind !== "revision" || (l.replaceDraft(e, M.text), g.announce(i.historyRestored(t)), r());
2368
2467
  }, w = (R) => {
2369
- R.key !== "Escape" || R.defaultPrevented || (rn(R), r());
2370
- }, S = (R) => {
2468
+ R.key !== "Escape" || R.defaultPrevented || (on(R), r());
2469
+ }, k = (R) => {
2371
2470
  R.target === R.currentTarget && r();
2372
2471
  }, L = m !== null && m.kind === "revisions" ? m.revisions.find((R) => R.id === T) : void 0;
2373
- return /* @__PURE__ */ c("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby": g, "data-testid": "markdown-explorer-history", onKeyDown: w, onClick: S, onCancel: (R) => R.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2374
- /* @__PURE__ */ c("p", { id: g, className: "aqmx-confirm-title", children: i.historyTitle(t) }),
2375
- m === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ c(ve, { failure: m.failure, alert: !1, onRetry: () => E((R) => R + 1), testId: "markdown-explorer-history-failure" }) : m.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: i.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: m.revisions.map((R) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": R.id === T, "data-testid": "markdown-explorer-history-entry", onClick: () => x(R.id), children: [
2376
- /* @__PURE__ */ c("span", { children: qt(R, a, i.historyEntry) }),
2377
- R.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: i.historyCurrent }) : null,
2378
- R.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: i.historyKept }) : null
2472
+ return /* @__PURE__ */ a("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby": p, "data-testid": "markdown-explorer-history", onKeyDown: w, onClick: k, onCancel: (R) => R.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2473
+ /* @__PURE__ */ a("p", { id: p, className: "aqmx-confirm-title", children: i.historyTitle(t) }),
2474
+ m === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: () => y((R) => R + 1), testId: "markdown-explorer-history-failure" }) : m.revisions.length === 0 ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: i.historyEmpty }) : /* @__PURE__ */ a("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: m.revisions.map((R) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": R.id === T, "data-testid": "markdown-explorer-history-entry", onClick: () => S(R.id), children: [
2475
+ /* @__PURE__ */ a("span", { children: _t(R, c, i.historyEntry) }),
2476
+ R.current ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyCurrent }) : null,
2477
+ R.kept ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyKept }) : null
2379
2478
  ] }) }, R.id)) }),
2380
- T === null ? null : M === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: i.historyLoading }) : M.kind === "failure" ? /* @__PURE__ */ c(ve, { failure: M.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2381
- /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : qt(L, a, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: M.text }) })
2479
+ T === null ? null : M === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", children: i.historyLoading }) : M.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: M.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2480
+ /* @__PURE__ */ a("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : _t(L, c, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ a("pre", { children: M.text }) })
2382
2481
  ),
2383
2482
  /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
2384
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: i.historyClose }),
2385
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": M === null || M.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: h, children: i.historyRestore })
2483
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: i.historyClose }),
2484
+ /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": M === null || M.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: h, children: i.historyRestore })
2386
2485
  ] })
2387
2486
  ] }) });
2388
- }, Ul = (e) => {
2487
+ }, ei = (e) => {
2389
2488
  const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r), l = de(o)?.document;
2390
2489
  return l === void 0 || l.kind === "failure" ? { edit: null, name: Ee(e) } : { edit: l.kind === "markdown" ? l.edit : null, name: l.name };
2391
2490
  }, se = (e) => {
2392
2491
  e.stopPropagation();
2393
- }, Zl = ({ path: e, documentName: t, iconOnly: n }) => {
2492
+ }, ti = ({ path: e, documentName: t, iconOnly: n }) => {
2394
2493
  const { edits: r, labels: o } = D(), l = te(
2395
2494
  r.subscribe,
2396
2495
  () => r.session(e) !== void 0,
2397
2496
  () => !1
2398
- ), [i, d] = I(!1), v = () => {
2497
+ ), [i, d] = I(!1), g = () => {
2399
2498
  if (!l) {
2400
2499
  r.start(e, r.viewAnchor(e));
2401
2500
  return;
@@ -2412,18 +2511,18 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2412
2511
  "aria-label": f === null ? void 0 : f,
2413
2512
  "aria-pressed": l,
2414
2513
  "data-testid": "markdown-explorer-document-edit",
2415
- onClick: v,
2514
+ onClick: g,
2416
2515
  onDoubleClick: se,
2417
2516
  onPointerEnter: Rt,
2418
2517
  onFocus: Rt,
2419
2518
  children: [
2420
- /* @__PURE__ */ c(jl, { "aria-hidden": "true" }),
2421
- f === null ? /* @__PURE__ */ c("span", { children: o.editDocumentLabel }) : null
2519
+ /* @__PURE__ */ a(Yl, { "aria-hidden": "true" }),
2520
+ f === null ? /* @__PURE__ */ a("span", { children: o.editDocumentLabel }) : null
2422
2521
  ]
2423
2522
  }
2424
2523
  ),
2425
- /* @__PURE__ */ c(
2426
- on,
2524
+ /* @__PURE__ */ a(
2525
+ ln,
2427
2526
  {
2428
2527
  open: i,
2429
2528
  title: o.unsavedTitle,
@@ -2438,7 +2537,7 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2438
2537
  }
2439
2538
  )
2440
2539
  ] });
2441
- }, Vl = ({ href: e, documentName: t, iconOnly: n }) => {
2540
+ }, ni = ({ href: e, documentName: t, iconOnly: n }) => {
2442
2541
  const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
2443
2542
  return /* @__PURE__ */ F(
2444
2543
  "a",
@@ -2452,87 +2551,87 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2452
2551
  "data-testid": "markdown-explorer-document-edit-external",
2453
2552
  onDoubleClick: se,
2454
2553
  children: [
2455
- /* @__PURE__ */ c(Ml, { "aria-hidden": "true" }),
2456
- o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
2554
+ /* @__PURE__ */ a(jl, { "aria-hidden": "true" }),
2555
+ o === null ? /* @__PURE__ */ a("span", { children: r.editExternallyLabel }) : null
2457
2556
  ]
2458
2557
  }
2459
2558
  );
2460
- }, Gl = ({ session: e }) => {
2461
- const { labels: t } = D(), n = wr(t, e);
2462
- 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 });
2463
- }, Kl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2464
- const { edits: l, labels: i } = D(), d = Lr(), [v, f] = I(!1);
2559
+ }, ri = ({ session: e }) => {
2560
+ const { labels: t } = D(), n = br(t, e);
2561
+ return /* @__PURE__ */ a("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
2562
+ }, oi = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2563
+ const { edits: l, labels: i } = D(), d = Mr(), [g, f] = I(!1);
2465
2564
  if (r.phase.kind !== "editing") return null;
2466
- const u = r.save.kind === "saving", g = u || !r.dirty, m = () => {
2565
+ const u = r.save.kind === "saving", p = u || !r.dirty, m = () => {
2467
2566
  l.flush(e);
2468
2567
  const O = l.session(e);
2469
2568
  O === void 0 || !O.dirty || O.save.kind === "saving" || l.save(e);
2470
- }, k = (O) => n ? { className: "aqmx-icon-button", "aria-label": O } : { className: "aqmx-icon-button aqmx-labelled-button" };
2569
+ }, x = (O) => n ? { className: "aqmx-icon-button", "aria-label": O } : { className: "aqmx-icon-button aqmx-labelled-button" };
2471
2570
  return /* @__PURE__ */ F(Ne, { children: [
2472
- r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...k(i.conflictNext), title: i.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => l.nextConflict(e), onDoubleClick: se, children: [
2473
- /* @__PURE__ */ c(Dl, { "aria-hidden": "true" }),
2474
- n ? null : /* @__PURE__ */ c("span", { children: i.conflictNext })
2571
+ r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...x(i.conflictNext), title: i.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => l.nextConflict(e), onDoubleClick: se, children: [
2572
+ /* @__PURE__ */ a(zl, { "aria-hidden": "true" }),
2573
+ n ? null : /* @__PURE__ */ a("span", { children: i.conflictNext })
2475
2574
  ] }) : null,
2476
- o ? /* @__PURE__ */ F("button", { type: "button", ...k(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
2477
- /* @__PURE__ */ c(Bl, { "aria-hidden": "true" }),
2478
- n ? null : /* @__PURE__ */ c("span", { children: i.previewToggle })
2575
+ o ? /* @__PURE__ */ F("button", { type: "button", ...x(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
2576
+ /* @__PURE__ */ a(Wl, { "aria-hidden": "true" }),
2577
+ n ? null : /* @__PURE__ */ a("span", { children: i.previewToggle })
2479
2578
  ] }) : null,
2480
- r.history ? /* @__PURE__ */ F("button", { type: "button", ...k(i.historyOpen), title: i.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: se, children: [
2481
- /* @__PURE__ */ c(Pl, { "aria-hidden": "true" }),
2482
- n ? null : /* @__PURE__ */ c("span", { children: i.historyOpen })
2579
+ r.history ? /* @__PURE__ */ F("button", { type: "button", ...x(i.historyOpen), title: i.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: se, children: [
2580
+ /* @__PURE__ */ a(Ul, { "aria-hidden": "true" }),
2581
+ n ? null : /* @__PURE__ */ a("span", { children: i.historyOpen })
2483
2582
  ] }) : null,
2484
- /* @__PURE__ */ F("button", { type: "button", ...k(i.saveDraft), title: i.saveDraftTooltip, "aria-disabled": g, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: m, onDoubleClick: se, children: [
2485
- /* @__PURE__ */ c(ql, { "aria-hidden": "true" }),
2486
- n ? null : /* @__PURE__ */ c("span", { children: i.saveDraft })
2583
+ /* @__PURE__ */ F("button", { type: "button", ...x(i.saveDraft), title: i.saveDraftTooltip, "aria-disabled": p, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: m, onDoubleClick: se, children: [
2584
+ /* @__PURE__ */ a(Gl, { "aria-hidden": "true" }),
2585
+ n ? null : /* @__PURE__ */ a("span", { children: i.saveDraft })
2487
2586
  ] }),
2488
- r.history ? /* @__PURE__ */ c(zl, { path: e, documentName: t, open: v, onClose: () => f(!1) }) : null
2587
+ r.history ? /* @__PURE__ */ a(Ql, { path: e, documentName: t, open: g, onClose: () => f(!1) }) : null
2489
2588
  ] });
2490
- }, Wl = ({ path: e, session: t }) => {
2589
+ }, li = ({ path: e, session: t }) => {
2491
2590
  const { edits: n } = D();
2492
- return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Hl, { href: t.save.href, onRetry: () => {
2591
+ return t.save.kind !== "grant" ? null : /* @__PURE__ */ a(Jl, { href: t.save.href, onRetry: () => {
2493
2592
  n.save(e);
2494
2593
  }, testId: "markdown-explorer-save-grant" });
2495
- }, Xl = (e) => {
2594
+ }, ii = (e) => {
2496
2595
  const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r);
2497
2596
  return de(o)?.document.kind === "markdown";
2498
- }, Yl = (e) => {
2499
- const { config: t } = D(), n = $e(), r = P(() => n(ge(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2500
- return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2501
- }, Jl = /* @__PURE__ */ new Set(), Ql = (e, t) => {
2502
- const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i), v = P(() => n.answerStampOf(e), [n, e]), f = te(n.subscribe, v, v), [u] = I(() => /* @__PURE__ */ new Set()), [g, m] = I(Jl), [k, O] = I(null);
2503
- k !== null && k.path !== e && O(null);
2504
- const E = B(null);
2505
- V(() => (E.current = e, () => {
2506
- E.current = null;
2597
+ }, si = (e) => {
2598
+ const { config: t } = D(), n = $e(), r = P(() => n(pe(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2599
+ return Z(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2600
+ }, ai = /* @__PURE__ */ new Set(), ci = (e, t) => {
2601
+ const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i), g = P(() => n.answerStampOf(e), [n, e]), f = te(n.subscribe, g, g), [u] = I(() => /* @__PURE__ */ new Set()), [p, m] = I(ai), [x, O] = I(null);
2602
+ x !== null && x.path !== e && O(null);
2603
+ const y = B(null);
2604
+ V(() => (y.current = e, () => {
2605
+ y.current = null;
2507
2606
  }), [e]);
2508
2607
  const T = P(() => {
2509
- const s = e, a = n.peek(s);
2510
- if (u.has(s) || a?.status === "pending") return;
2511
- const h = t && !mn(a);
2608
+ const s = e, c = n.peek(s);
2609
+ if (u.has(s) || c?.status === "pending") return;
2610
+ const h = t && !hn(c);
2512
2611
  u.add(s), m(new Set(u)), O(null), (async () => {
2513
2612
  try {
2514
2613
  const w = await n.refresh(s);
2515
- if (E.current !== s || w.status === "superseded") return;
2614
+ if (y.current !== s || w.status === "superseded") return;
2516
2615
  if (w.status === "failed") {
2517
2616
  O({ path: s, failure: w.failure, stamp: n.answerStampOf(s) }), r.announce(o.documentRefreshFailed(ae(o, w.failure.reason)));
2518
2617
  return;
2519
2618
  }
2520
- const S = de(n.peek(s));
2521
- if (h || S === null || S.document.kind === "failure") return;
2522
- r.announce(o.documentRefreshed(S.document.name));
2619
+ const k = de(n.peek(s));
2620
+ if (h || k === null || k.document.kind === "failure") return;
2621
+ r.announce(o.documentRefreshed(k.document.name));
2523
2622
  } finally {
2524
2623
  u.delete(s), m(new Set(u));
2525
2624
  }
2526
2625
  })();
2527
- }, [e, t, u, n, r, o]), x = g.has(e), M = k !== null && k.path === e && k.stamp === f ? k.failure : null;
2528
- return { refreshing: x, unavailable: x || d?.status === "pending", failure: M, refresh: T };
2529
- }, ei = Object.freeze({ kind: "page" }), ti = ({ path: e, placement: t, markup: n }) => {
2530
- const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = Ql(e, t.kind === "page"), v = Xl(e), f = Ul(e), u = ln(e), g = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, k = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, E = t.kind === "page" || t.maximized;
2626
+ }, [e, t, u, n, r, o]), S = p.has(e), M = x !== null && x.path === e && x.stamp === f ? x.failure : null;
2627
+ return { refreshing: S, unavailable: S || d?.status === "pending", failure: M, refresh: T };
2628
+ }, di = Object.freeze({ kind: "page" }), ui = ({ path: e, placement: t, markup: n }) => {
2629
+ const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = ci(e, t.kind === "page"), g = ii(e), f = ei(e), u = sn(e), p = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, x = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, y = t.kind === "page" || t.maximized;
2531
2630
  return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": u === void 0 ? void 0 : "true", children: [
2532
2631
  /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
2533
- u === void 0 ? null : /* @__PURE__ */ c(Gl, { session: u }),
2534
- u === void 0 ? null : /* @__PURE__ */ c(Kl, { path: e, documentName: O, iconOnly: k, session: u, previewAvailable: E }),
2535
- u === void 0 && v ? /* @__PURE__ */ F(
2632
+ u === void 0 ? null : /* @__PURE__ */ a(ri, { session: u }),
2633
+ u === void 0 ? null : /* @__PURE__ */ a(oi, { path: e, documentName: O, iconOnly: x, session: u, previewAvailable: y }),
2634
+ u === void 0 && g ? /* @__PURE__ */ F(
2536
2635
  "button",
2537
2636
  {
2538
2637
  type: "button",
@@ -2544,19 +2643,19 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2544
2643
  onClick: n.toggle,
2545
2644
  onDoubleClick: se,
2546
2645
  children: [
2547
- /* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
2548
- m === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
2646
+ /* @__PURE__ */ a(Bl, { "aria-hidden": "true" }),
2647
+ m === null ? /* @__PURE__ */ a("span", { children: r.showMarkupLabel }) : null
2549
2648
  ]
2550
2649
  }
2551
2650
  ) : null,
2552
- u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ c(Zl, { path: e, documentName: O, iconOnly: k }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Vl, { href: f.edit.href, documentName: O, iconOnly: k }) : null,
2651
+ u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ti, { path: e, documentName: O, iconOnly: x }) : f.edit?.kind === "external" ? /* @__PURE__ */ a(ni, { href: f.edit.href, documentName: O, iconOnly: x }) : null,
2553
2652
  u === void 0 ? /* @__PURE__ */ F(
2554
2653
  "button",
2555
2654
  {
2556
2655
  type: "button",
2557
- className: g === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
2558
- title: g === null ? r.refreshDocument : g,
2559
- "aria-label": g === null ? void 0 : g,
2656
+ className: p === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
2657
+ title: p === null ? r.refreshDocument : p,
2658
+ "aria-label": p === null ? void 0 : p,
2560
2659
  "aria-disabled": l,
2561
2660
  "aria-busy": o,
2562
2661
  "data-aqmx-busy": o ? "true" : void 0,
@@ -2564,46 +2663,46 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2564
2663
  onClick: d,
2565
2664
  onDoubleClick: se,
2566
2665
  children: [
2567
- /* @__PURE__ */ c(Cl, { "aria-hidden": "true" }),
2568
- g === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
2666
+ /* @__PURE__ */ a(ql, { "aria-hidden": "true" }),
2667
+ p === null ? /* @__PURE__ */ a("span", { children: r.refreshDocumentLabel }) : null
2569
2668
  ]
2570
2669
  }
2571
2670
  ) : null
2572
2671
  ] }),
2573
- u !== void 0 || i === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": i.reason, children: r.documentRefreshFailed(ae(r, i.reason)) }),
2574
- u === void 0 ? null : /* @__PURE__ */ c(Wl, { path: e, session: u })
2672
+ u !== void 0 || i === null ? null : /* @__PURE__ */ a("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": i.reason, children: r.documentRefreshFailed(ae(r, i.reason)) }),
2673
+ u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, session: u })
2575
2674
  ] });
2576
- }, ni = ({ location: e }) => {
2577
- const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Yl(e);
2675
+ }, fi = ({ location: e }) => {
2676
+ const t = e.doc, n = Z(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = si(e);
2578
2677
  return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
2579
- /* @__PURE__ */ c(ti, { path: t, placement: ei, markup: r }),
2580
- /* @__PURE__ */ c(Rl, { path: t, markup: e.markup, variant: n })
2678
+ /* @__PURE__ */ a(ui, { path: t, placement: di, markup: r }),
2679
+ /* @__PURE__ */ a(Pl, { path: t, markup: e.markup, variant: n })
2581
2680
  ] });
2582
- }, ri = ({ holds: e, testId: t }) => {
2681
+ }, mi = ({ holds: e, testId: t }) => {
2583
2682
  const { labels: n, announcer: r } = D(), o = Oe();
2584
2683
  V(() => e ? r.claim(o) : void 0, [e, r, o]);
2585
2684
  const l = P(() => r.shownIn(o), [r, o]), i = te(r.subscribe, l, l);
2586
- return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
2587
- }, ue = Object.freeze([]), oi = (e) => {
2685
+ return /* @__PURE__ */ a("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
2686
+ }, ue = Object.freeze([]), hi = (e) => {
2588
2687
  const t = /* @__PURE__ */ new Set();
2589
2688
  let n = ue, r = [], o = !1;
2590
2689
  const l = [], i = (u) => {
2591
2690
  n = u;
2592
- for (const g of [...t]) g();
2593
- }, d = () => l.at(-1)?.region, v = (u) => {
2594
- const g = d();
2595
- u(), d() !== g && n !== ue && i(ue);
2691
+ for (const p of [...t]) p();
2692
+ }, d = () => l.at(-1)?.region, g = (u) => {
2693
+ const p = d();
2694
+ u(), d() !== p && n !== ue && i(ue);
2596
2695
  }, f = () => {
2597
2696
  o = !1;
2598
- const u = r.map((g) => "sentence" in g ? g.sentence : g.list(g.items));
2697
+ const u = r.map((p) => "sentence" in p ? p.sentence : p.list(p.items));
2599
2698
  r = [], i(Object.freeze(u));
2600
2699
  };
2601
2700
  return {
2602
2701
  announce: (u) => {
2603
2702
  if (typeof u == "string") r.push({ sentence: u });
2604
2703
  else {
2605
- const g = r.find((m) => "list" in m && m.list === u.list);
2606
- g !== void 0 && "items" in g ? g.items.push(u.item) : r.push({ list: u.list, items: [u.item] });
2704
+ const p = r.find((m) => "list" in m && m.list === u.list);
2705
+ p !== void 0 && "items" in p ? p.items.push(u.item) : r.push({ list: u.list, items: [u.item] });
2607
2706
  }
2608
2707
  o || (o = !0, n !== ue && i(ue), e.request(f));
2609
2708
  },
@@ -2611,77 +2710,77 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2611
2710
  t.delete(u);
2612
2711
  }),
2613
2712
  claim: (u) => {
2614
- const g = { region: u };
2615
- return v(() => l.push(g)), () => v(() => {
2616
- const m = l.indexOf(g);
2713
+ const p = { region: u };
2714
+ return g(() => l.push(p)), () => g(() => {
2715
+ const m = l.indexOf(p);
2617
2716
  m !== -1 && l.splice(m, 1);
2618
2717
  });
2619
2718
  },
2620
2719
  shownIn: (u) => d() === u ? n : ue
2621
2720
  };
2622
- }, he = Object.freeze({ status: "cancelled" }), li = (e) => {
2721
+ }, he = Object.freeze({ status: "cancelled" }), pi = (e) => {
2623
2722
  if (e === null || typeof e != "object") return null;
2624
2723
  const { failure: t } = e;
2625
- if (Gn(t) !== null) return null;
2724
+ if (Kn(t) !== null) return null;
2626
2725
  const { reason: n, code: r } = t;
2627
- return Kn(n, r);
2628
- }, ii = ({ dataPath: e, onScope: t, fetch: n }) => {
2629
- const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, g, m) => {
2630
- let k;
2726
+ return Wn(n, r);
2727
+ }, gi = ({ dataPath: e, onScope: t, fetch: n }) => {
2728
+ const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, p, m) => {
2729
+ let x;
2631
2730
  try {
2632
- k = await r(f, { credentials: "same-origin", ...u, headers: { Accept: "application/json", ...u.headers } });
2731
+ x = await r(f, { credentials: "same-origin", ...u, headers: { Accept: "application/json", ...u.headers } });
2633
2732
  } catch {
2634
2733
  return m({ reason: "failed" });
2635
2734
  }
2636
- k.status === 401 && t(null);
2637
- const O = k.headers.get(Hn);
2735
+ x.status === 401 && t(null);
2736
+ const O = x.headers.get(zn);
2638
2737
  O !== null && t(O);
2639
- let E;
2738
+ let y;
2640
2739
  try {
2641
- E = await k.json();
2740
+ y = await x.json();
2642
2741
  } catch {
2643
- return m({ reason: ht(k.status) });
2742
+ return m({ reason: ht(x.status) });
2644
2743
  }
2645
2744
  let T;
2646
2745
  try {
2647
- T = g(E);
2746
+ T = p(y);
2648
2747
  } catch {
2649
2748
  T = !1;
2650
2749
  }
2651
- if (T) return E;
2652
- const x = li(E);
2653
- return m(x !== null ? x : { reason: k.status === 200 ? "failed" : ht(k.status) });
2654
- }, i = { [pt]: Wn }, d = { [pt]: er, "Content-Type": `${Qn}; charset=utf-8` }, v = async (f, u, g) => {
2655
- const m = await l(f, u, g, (k) => He(k.reason, k.code));
2750
+ if (T) return y;
2751
+ const S = pi(y);
2752
+ return m(S !== null ? S : { reason: x.status === 200 ? "failed" : ht(x.status) });
2753
+ }, i = { [gt]: Xn }, d = { [gt]: tr, "Content-Type": `${er}; charset=utf-8` }, g = async (f, u, p) => {
2754
+ const m = await l(f, u, p, (x) => He(x.reason, x.code));
2656
2755
  return u.signal.aborted ? he : m;
2657
2756
  };
2658
2757
  return {
2659
- tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" }, gt, (u) => ({ status: "error", failure: u })),
2660
- children: async (f, u, g) => {
2661
- const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Vn, (k) => ({ status: "error", failure: k }));
2662
- return g.aborted ? he : m;
2758
+ tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" }, pt, (u) => ({ status: "error", failure: u })),
2759
+ children: async (f, u, p) => {
2760
+ const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Gn, (x) => ({ status: "error", failure: x }));
2761
+ return p.aborted ? he : m;
2663
2762
  },
2664
- ancestors: async (f, u, g) => {
2665
- const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Zn, (k) => ({ status: "error", failure: k }));
2666
- return g.aborted ? he : m;
2763
+ ancestors: async (f, u, p) => {
2764
+ const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Vn, (x) => ({ status: "error", failure: x }));
2765
+ return p.aborted ? he : m;
2667
2766
  },
2668
- reveal: async (f, u, g) => {
2669
- const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Un, (k) => ({ status: "error", failure: k }));
2670
- return g.aborted ? he : m;
2767
+ reveal: async (f, u, p) => {
2768
+ const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Un, (x) => ({ status: "error", failure: x }));
2769
+ return p.aborted ? he : m;
2671
2770
  },
2672
- document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, rr, (g) => He(g.reason, g.code)),
2771
+ document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, or, (p) => He(p.reason, p.code)),
2673
2772
  text: async (f, u) => {
2674
- const g = await l(o("text", { [Y.path]: f }), { method: "GET", signal: u }, zn, (m) => He(m.reason, m.code));
2675
- return u.aborted ? he : g;
2773
+ const p = await l(o("text", { [Y.path]: f }), { method: "GET", signal: u }, Zn, (m) => He(m.reason, m.code));
2774
+ return u.aborted ? he : p;
2676
2775
  },
2677
- edit: (f, u) => v(o("edit", { [Y.path]: f }), { method: "GET", signal: u }, nr),
2678
- save: (f, u, g, m) => v(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: g, signal: m }, tr),
2679
- preview: (f, u, g) => v(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: g }, Jn),
2680
- revisions: (f, u) => v(o("revisions", { [Y.path]: f }), { method: "GET", signal: u }, Yn),
2681
- revision: (f, u, g) => v(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: g }, Xn),
2682
- refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i }, gt, (u) => ({ status: "error", failure: u }))
2776
+ edit: (f, u) => g(o("edit", { [Y.path]: f }), { method: "GET", signal: u }, rr),
2777
+ save: (f, u, p, m) => g(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: p, signal: m }, nr),
2778
+ preview: (f, u, p) => g(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: p }, Qn),
2779
+ revisions: (f, u) => g(o("revisions", { [Y.path]: f }), { method: "GET", signal: u }, Jn),
2780
+ revision: (f, u, p) => g(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: p }, Yn),
2781
+ refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i }, pt, (u) => ({ status: "error", failure: u }))
2683
2782
  };
2684
- }, si = () => {
2783
+ }, vi = () => {
2685
2784
  let e = null, t = null;
2686
2785
  return {
2687
2786
  settle: (n) => {
@@ -2696,19 +2795,19 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2696
2795
  return t = null, o;
2697
2796
  }
2698
2797
  };
2699
- }, ai = (e) => {
2700
- const t = Yt(e);
2798
+ }, wi = (e) => {
2799
+ const t = Jt(e);
2701
2800
  if (t === null) return mt;
2702
2801
  try {
2703
- return _n(JSON.parse(t));
2802
+ return Bn(JSON.parse(t));
2704
2803
  } catch (n) {
2705
2804
  return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), mt;
2706
2805
  }
2707
- }, _t = (e, t) => {
2806
+ }, Bt = (e, t) => {
2708
2807
  let n = null;
2709
2808
  const r = () => {
2710
2809
  if (n === null) {
2711
- const l = ai(e);
2810
+ const l = wi(e);
2712
2811
  n = { changes: l, settings: ft(t, l) };
2713
2812
  }
2714
2813
  return n;
@@ -2720,207 +2819,207 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2720
2819
  getServerSnapshot: () => t,
2721
2820
  subscribe: o.subscribe,
2722
2821
  advance: (l) => {
2723
- const { changes: i, settings: d } = r(), v = Pn(i, l, Fn(d, l)[l], t);
2724
- return n = { changes: v, settings: ft(t, v) }, o.emit(), Xt(e, qn(v)), n.settings;
2822
+ const { changes: i, settings: d } = r(), g = Fn(i, l, qn(d, l)[l], t);
2823
+ return n = { changes: g, settings: ft(t, g) }, o.emit(), Yt(e, _n(g)), n.settings;
2725
2824
  }
2726
2825
  };
2727
- }, ci = Object.freeze({ status: "refreshed" }), di = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), ui = fn(et), Rn = 4, fi = Rn - 1, Bt = Object.freeze({ status: "loading" }), mi = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), hi = (e) => {
2728
- const t = /* @__PURE__ */ new Map(), n = un(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), v = /* @__PURE__ */ new Set();
2826
+ }, bi = Object.freeze({ status: "refreshed" }), Ei = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), yi = mn(et), Tn = 4, xi = Tn - 1, It = Object.freeze({ status: "loading" }), ki = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Si = (e) => {
2827
+ const t = /* @__PURE__ */ new Map(), n = fn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), g = /* @__PURE__ */ new Set();
2729
2828
  let f = 0, u = 0;
2730
- const g = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
2731
- let k = !1, O = 0;
2732
- const E = () => {
2829
+ const p = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
2830
+ let x = !1, O = 0;
2831
+ const y = () => {
2733
2832
  O += 1, d.emit();
2734
- }, T = (p) => o.get(p) ?? 0, x = (p) => {
2735
- let b = i.get(p);
2736
- return b === void 0 && (b = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, i.set(p, b)), b;
2737
- }, M = (p, b, C) => {
2738
- p.inFlight.delete(b), f -= 1, C.lane === "bulk" && (u -= 1);
2739
- }, s = (p) => {
2740
- const b = i.get(p);
2741
- if (b !== void 0) {
2742
- for (const [C, A] of [...b.inFlight])
2743
- M(b, C, A), A.controller.abort();
2744
- b.direct.clear(), b.bulk.clear(), b.unclaimed.clear();
2833
+ }, T = (v) => o.get(v) ?? 0, S = (v) => {
2834
+ let E = i.get(v);
2835
+ return E === void 0 && (E = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, i.set(v, E)), E;
2836
+ }, M = (v, E, C) => {
2837
+ v.inFlight.delete(E), f -= 1, C.lane === "bulk" && (u -= 1);
2838
+ }, s = (v) => {
2839
+ const E = i.get(v);
2840
+ if (E !== void 0) {
2841
+ for (const [C, A] of [...E.inFlight])
2842
+ M(E, C, A), A.controller.abort();
2843
+ E.direct.clear(), E.bulk.clear(), E.unclaimed.clear();
2745
2844
  }
2746
- }, a = (p) => {
2747
- const b = T(p) + 1;
2748
- return o.set(p, b), s(p), b;
2749
- }, h = (p, b) => {
2750
- const C = xe(p), A = { promise: p, opened: b, stale: !1, loadedAt: C?.status === "ok" ? C.loadedAt : null };
2751
- return p.status === "pending" && p.then((_) => {
2845
+ }, c = (v) => {
2846
+ const E = T(v) + 1;
2847
+ return o.set(v, E), s(v), E;
2848
+ }, h = (v, E) => {
2849
+ const C = Se(v), A = { promise: v, opened: E, stale: !1, loadedAt: C?.status === "ok" ? C.loadedAt : null };
2850
+ return v.status === "pending" && v.then((_) => {
2752
2851
  _.status === "ok" && (A.loadedAt = _.loadedAt);
2753
2852
  }), A;
2754
- }, w = (p) => {
2755
- let b = r.get(p);
2756
- return b === void 0 && (b = /* @__PURE__ */ new Map(), r.set(p, b)), b;
2757
- }, S = (p) => {
2758
- const b = [...i.keys()], C = g[p], A = C === null ? 0 : b.indexOf(C) + 1;
2759
- for (let _ = 0; _ < b.length; _ += 1) {
2760
- const j = b[(A + _) % b.length], Z = j === void 0 ? void 0 : i.get(j);
2761
- if (!(j === void 0 || Z === void 0)) {
2762
- for (const H of Z[p])
2763
- if ((Z.claims.get(H) ?? 0) !== 0)
2764
- return Z[p].delete(H), g[p] = j, { sourceId: j, path: H };
2853
+ }, w = (v) => {
2854
+ let E = r.get(v);
2855
+ return E === void 0 && (E = /* @__PURE__ */ new Map(), r.set(v, E)), E;
2856
+ }, k = (v) => {
2857
+ const E = [...i.keys()], C = p[v], A = C === null ? 0 : E.indexOf(C) + 1;
2858
+ for (let _ = 0; _ < E.length; _ += 1) {
2859
+ const j = E[(A + _) % E.length], U = j === void 0 ? void 0 : i.get(j);
2860
+ if (!(j === void 0 || U === void 0)) {
2861
+ for (const H of U[v])
2862
+ if ((U.claims.get(H) ?? 0) !== 0)
2863
+ return U[v].delete(H), p[v] = j, { sourceId: j, path: H };
2765
2864
  }
2766
2865
  }
2767
2866
  return null;
2768
- }, L = (p, b, C, A) => {
2769
- const _ = i.get(p);
2770
- if (_ === void 0 || _.inFlight.get(b) !== C) return;
2771
- M(_, b, C);
2772
- const j = (_.claims.get(b) ?? 0) > 0, Z = w(p);
2773
- if (A.status === "ok" ? Z.set(b, { status: "loaded", entries: A.entries }) : A.status === "error" && j ? Z.set(b, { status: "failed", failure: A.failure }) : Z.delete(b), E(), A.status === "error" && j) {
2774
- const H = { sourceId: p, path: b, failure: A.failure };
2775
- for (const le of [...v]) le(H);
2867
+ }, L = (v, E, C, A) => {
2868
+ const _ = i.get(v);
2869
+ if (_ === void 0 || _.inFlight.get(E) !== C) return;
2870
+ M(_, E, C);
2871
+ const j = (_.claims.get(E) ?? 0) > 0, U = w(v);
2872
+ if (A.status === "ok" ? U.set(E, { status: "loaded", entries: A.entries }) : A.status === "error" && j ? U.set(E, { status: "failed", failure: A.failure }) : U.delete(E), y(), A.status === "error" && j) {
2873
+ const H = { sourceId: v, path: E, failure: A.failure };
2874
+ for (const le of [...g]) le(H);
2776
2875
  }
2777
2876
  N();
2778
- }, R = (p, b, C) => {
2877
+ }, R = (v, E, C) => {
2779
2878
  const A = { controller: new AbortController(), lane: C };
2780
- x(p).inFlight.set(b, A), f += 1, C === "bulk" && (u += 1), e.children(p, b, A.controller.signal).then(
2781
- (_) => L(p, b, A, _),
2782
- () => L(p, b, A, mi)
2879
+ S(v).inFlight.set(E, A), f += 1, C === "bulk" && (u += 1), e.children(v, E, A.controller.signal).then(
2880
+ (_) => L(v, E, A, _),
2881
+ () => L(v, E, A, ki)
2783
2882
  );
2784
2883
  }, N = () => {
2785
- for (; f < Rn; ) {
2786
- const p = S("direct");
2787
- if (p !== null) {
2788
- R(p.sourceId, p.path, "direct");
2884
+ for (; f < Tn; ) {
2885
+ const v = k("direct");
2886
+ if (v !== null) {
2887
+ R(v.sourceId, v.path, "direct");
2789
2888
  continue;
2790
2889
  }
2791
- const b = u < fi ? S("bulk") : null;
2792
- if (b === null) return;
2793
- R(b.sourceId, b.path, "bulk");
2890
+ const E = u < xi ? k("bulk") : null;
2891
+ if (E === null) return;
2892
+ R(E.sourceId, E.path, "bulk");
2794
2893
  }
2795
- }, q = (p, b, C) => {
2796
- if (!(b.direct.delete(C) || b.bulk.delete(C))) {
2797
- const _ = b.inFlight.get(C);
2894
+ }, q = (v, E, C) => {
2895
+ if (!(E.direct.delete(C) || E.bulk.delete(C))) {
2896
+ const _ = E.inFlight.get(C);
2798
2897
  if (_ === void 0) return !1;
2799
- M(b, C, _), _.controller.abort();
2898
+ M(E, C, _), _.controller.abort();
2800
2899
  }
2801
- return r.get(p)?.delete(C), !0;
2900
+ return r.get(v)?.delete(C), !0;
2802
2901
  }, W = () => {
2803
- k = !1;
2804
- let p = !1;
2805
- for (const b of m) {
2806
- const C = x(b);
2902
+ x = !1;
2903
+ let v = !1;
2904
+ for (const E of m) {
2905
+ const C = S(E);
2807
2906
  for (const A of C.unclaimed)
2808
- (C.claims.get(A) ?? 0) === 0 && q(b, C, A) && (p = !0);
2907
+ (C.claims.get(A) ?? 0) === 0 && q(E, C, A) && (v = !0);
2809
2908
  C.unclaimed.clear();
2810
2909
  }
2811
- m.clear(), p && (E(), N());
2812
- }, J = (p, b) => {
2813
- t.set(p, h(be(e.tree(p)), b));
2814
- }, ee = (p, b, C) => {
2815
- a(p);
2816
- const A = h(fn(b), C);
2817
- return t.set(p, A), r.delete(p), E(), N(), A;
2818
- }, X = (p, b, C, A) => {
2819
- if (C !== T(p) || t.get(p) !== b) return;
2820
- const _ = xe(b.promise);
2821
- if (!(A.status !== "ok" || _?.status !== "ok" || b.loadedAt === null || A.loadedAt <= b.loadedAt)) {
2910
+ m.clear(), v && (y(), N());
2911
+ }, J = (v, E) => {
2912
+ t.set(v, h(be(e.tree(v)), E));
2913
+ }, ee = (v, E, C) => {
2914
+ c(v);
2915
+ const A = h(mn(E), C);
2916
+ return t.set(v, A), r.delete(v), y(), N(), A;
2917
+ }, X = (v, E, C, A) => {
2918
+ if (C !== T(v) || t.get(v) !== E) return;
2919
+ const _ = Se(E.promise);
2920
+ if (!(A.status !== "ok" || _?.status !== "ok" || E.loadedAt === null || A.loadedAt <= E.loadedAt)) {
2822
2921
  if (Me(_.entries, A.entries)) {
2823
- b.loadedAt = A.loadedAt;
2922
+ E.loadedAt = A.loadedAt;
2824
2923
  return;
2825
2924
  }
2826
- ee(p, A, b.opened);
2925
+ ee(v, A, E.opened);
2827
2926
  }
2828
- }, $ = (p, b) => {
2829
- const C = t.get(p);
2830
- return C !== void 0 && xe(C.promise)?.status === b;
2831
- }, G = (p, b) => {
2832
- b.stale = !1;
2833
- const C = T(p);
2834
- e.tree(p).then((A) => X(p, b, C, A));
2927
+ }, $ = (v, E) => {
2928
+ const C = t.get(v);
2929
+ return C !== void 0 && Se(C.promise)?.status === E;
2930
+ }, G = (v, E) => {
2931
+ E.stale = !1;
2932
+ const C = T(v);
2933
+ e.tree(v).then((A) => X(v, E, C, A));
2835
2934
  };
2836
2935
  return {
2837
- read: (p) => t.get(p)?.promise ?? ui,
2838
- open: (p) => {
2839
- const b = n.resumes(p), C = n.hold(p), A = t.get(p);
2840
- return A === void 0 || $(p, "deferred") ? (J(p, !0), E()) : b || (A.opened && $(p, "error") ? (J(p, !0), E()) : (A.opened = !0, A.stale && $(p, "ok") && G(p, A))), C;
2936
+ read: (v) => t.get(v)?.promise ?? yi,
2937
+ open: (v) => {
2938
+ const E = n.resumes(v), C = n.hold(v), A = t.get(v);
2939
+ return A === void 0 || $(v, "deferred") ? (J(v, !0), y()) : E || (A.opened && $(v, "error") ? (J(v, !0), y()) : (A.opened = !0, A.stale && $(v, "ok") && G(v, A))), C;
2841
2940
  },
2842
- retry: (p) => {
2843
- $(p, "error") && (J(p, !0), E());
2941
+ retry: (v) => {
2942
+ $(v, "error") && (J(v, !0), y());
2844
2943
  },
2845
- seed: (p, b) => {
2846
- const C = b.then(
2944
+ seed: (v, E) => {
2945
+ const C = E.then(
2847
2946
  (j) => j === null ? et : j,
2848
2947
  () => et
2849
- ), A = t.get(p);
2850
- if (A !== void 0 && $(p, "ok")) {
2851
- const j = T(p);
2852
- C.then((Z) => X(p, A, j, Z));
2948
+ ), A = t.get(v);
2949
+ if (A !== void 0 && $(v, "ok")) {
2950
+ const j = T(v);
2951
+ C.then((U) => X(v, A, j, U));
2853
2952
  return;
2854
2953
  }
2855
- a(p);
2954
+ c(v);
2856
2955
  const _ = h(be(C), A?.opened === !0);
2857
- t.set(p, _), r.delete(p), N(), C.then((j) => {
2858
- t.get(p) === _ && (j.status === "deferred" && n.isHeld(p) && J(p, _.opened), E());
2956
+ t.set(v, _), r.delete(v), N(), C.then((j) => {
2957
+ t.get(v) === _ && (j.status === "deferred" && n.isHeld(v) && J(v, _.opened), y());
2859
2958
  });
2860
2959
  },
2861
- refresh: async (p) => {
2862
- const b = (l.get(p) ?? 0) + 1;
2863
- l.set(p, b);
2864
- const C = await e.refresh(p);
2865
- if (l.get(p) !== b) return di;
2960
+ refresh: async (v) => {
2961
+ const E = (l.get(v) ?? 0) + 1;
2962
+ l.set(v, E);
2963
+ const C = await e.refresh(v);
2964
+ if (l.get(v) !== E) return Ei;
2866
2965
  if (C.status === "error") return { status: "failed", failure: C.failure };
2867
- const A = t.get(p);
2868
- if (!(A !== void 0 && A.loadedAt !== null && $(p, "ok") && A.loadedAt > C.loadedAt)) {
2869
- const j = ee(p, C, !0);
2966
+ const A = t.get(v);
2967
+ if (!(A !== void 0 && A.loadedAt !== null && $(v, "ok") && A.loadedAt > C.loadedAt)) {
2968
+ const j = ee(v, C, !0);
2870
2969
  if (A !== void 0 && A.promise.status === "pending") {
2871
- const Z = T(p);
2872
- A.promise.then((H) => X(p, j, Z, H));
2970
+ const U = T(v);
2971
+ A.promise.then((H) => X(v, j, U, H));
2873
2972
  }
2874
2973
  }
2875
- for (const [j, Z] of t)
2876
- j !== p && xe(Z.promise)?.status === "ok" && (Z.stale = !0);
2877
- return ci;
2974
+ for (const [j, U] of t)
2975
+ j !== v && Se(U.promise)?.status === "ok" && (U.stale = !0);
2976
+ return bi;
2878
2977
  },
2879
- children: (p, b) => r.get(p)?.get(b),
2880
- claimChildren: (p, b) => {
2881
- const C = x(p), A = w(p);
2978
+ children: (v, E) => r.get(v)?.get(E),
2979
+ claimChildren: (v, E) => {
2980
+ const C = S(v), A = w(v);
2882
2981
  let _ = !1, j = !1;
2883
- for (const [H, le] of b)
2884
- C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H, Bt), C[le].add(H), _ = !0, j = !0) : le === "direct" && C.bulk.delete(H) && (C.direct.add(H), j = !0);
2885
- _ && E(), j && N();
2886
- let Z = !1;
2982
+ for (const [H, le] of E)
2983
+ C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H, It), C[le].add(H), _ = !0, j = !0) : le === "direct" && C.bulk.delete(H) && (C.direct.add(H), j = !0);
2984
+ _ && y(), j && N();
2985
+ let U = !1;
2887
2986
  return () => {
2888
- if (!Z) {
2889
- Z = !0;
2890
- for (const H of b.keys()) {
2987
+ if (!U) {
2988
+ U = !0;
2989
+ for (const H of E.keys()) {
2891
2990
  const le = (C.claims.get(H) ?? 0) - 1;
2892
2991
  le > 0 ? C.claims.set(H, le) : (C.claims.delete(H), C.unclaimed.add(H));
2893
2992
  }
2894
- m.add(p), !k && (k = !0, queueMicrotask(W));
2993
+ m.add(v), !x && (x = !0, queueMicrotask(W));
2895
2994
  }
2896
2995
  };
2897
2996
  },
2898
- retryChildren: (p, b) => {
2899
- const C = r.get(p);
2900
- if (C === void 0 || C.get(b)?.status !== "failed") return;
2901
- const A = x(p);
2902
- if ((A.claims.get(b) ?? 0) > 0) {
2903
- C.set(b, Bt), A.direct.add(b), E(), N();
2997
+ retryChildren: (v, E) => {
2998
+ const C = r.get(v);
2999
+ if (C === void 0 || C.get(E)?.status !== "failed") return;
3000
+ const A = S(v);
3001
+ if ((A.claims.get(E) ?? 0) > 0) {
3002
+ C.set(E, It), A.direct.add(E), y(), N();
2904
3003
  return;
2905
3004
  }
2906
- C.delete(b), E();
3005
+ C.delete(E), y();
2907
3006
  },
2908
- pendingChildren: (p) => {
2909
- const b = i.get(p);
2910
- return b === void 0 ? 0 : b.direct.size + b.bulk.size + b.inFlight.size;
3007
+ pendingChildren: (v) => {
3008
+ const E = i.get(v);
3009
+ return E === void 0 ? 0 : E.direct.size + E.bulk.size + E.inFlight.size;
2911
3010
  },
2912
3011
  clear: () => {
2913
- for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...i.keys()])) a(p);
2914
- for (const [p, b] of l) l.set(p, b + 1);
2915
- t.clear(), r.clear(), E();
3012
+ for (const v of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...i.keys()])) c(v);
3013
+ for (const [v, E] of l) l.set(v, E + 1);
3014
+ t.clear(), r.clear(), y();
2916
3015
  },
2917
- subscribeChildrenFailures: (p) => (v.add(p), () => {
2918
- v.delete(p);
3016
+ subscribeChildrenFailures: (v) => (g.add(v), () => {
3017
+ g.delete(v);
2919
3018
  }),
2920
3019
  subscribe: d.subscribe,
2921
3020
  version: () => O
2922
3021
  };
2923
- }, gi = (e, t) => {
3022
+ }, Ri = (e, t) => {
2924
3023
  let n = e;
2925
3024
  const r = ye();
2926
3025
  return {
@@ -2930,70 +3029,70 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
2930
3029
  n = { ...n, ...o }, t(n), r.emit();
2931
3030
  }
2932
3031
  };
2933
- }, pi = 1;
3032
+ }, Ti = 1;
2934
3033
  let Re = 0, ce = null;
2935
- const vi = () => {
3034
+ const Ci = () => {
2936
3035
  const { documentElement: e, body: t } = document;
2937
3036
  Re === 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"), Re += 1;
2938
3037
  let n = !1;
2939
3038
  return () => {
2940
3039
  n || (n = !0, Re -= 1, !(Re > 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));
2941
3040
  };
2942
- }, wi = [
3041
+ }, Oi = [
2943
3042
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
2944
3043
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
2945
- ], It = 1, jt = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", bi = (e) => {
2946
- if (!jt(e)) return null;
3044
+ ], jt = 1, Ht = (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.", Ai = (e) => {
3045
+ if (!Ht(e)) return null;
2947
3046
  const t = e.getBoundingClientRect(), n = window.innerHeight;
2948
- if (t.bottom > n + pi)
3047
+ if (t.bottom > n + Ti)
2949
3048
  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}`;
2950
- if (t.height < It)
3049
+ if (t.height < jt)
2951
3050
  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}`;
2952
- for (const { selector: r, name: o } of wi)
3051
+ for (const { selector: r, name: o } of Oi)
2953
3052
  for (const l of e.querySelectorAll(r)) {
2954
- if (!jt(l)) continue;
3053
+ if (!Ht(l)) continue;
2955
3054
  const i = l.getBoundingClientRect().height;
2956
- if (i < It)
3055
+ if (i < jt)
2957
3056
  return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
2958
3057
  }
2959
3058
  return null;
2960
- }, Ei = (e) => {
3059
+ }, Li = (e) => {
2961
3060
  let t = !1;
2962
3061
  const n = () => {
2963
3062
  if (t) return;
2964
- const o = bi(e);
3063
+ const o = Ai(e);
2965
3064
  o !== null && (t = !0, console.error(o));
2966
3065
  }, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
2967
3066
  return r?.observe(e), window.addEventListener("resize", n), n(), () => {
2968
3067
  r?.disconnect(), window.removeEventListener("resize", n);
2969
3068
  };
2970
- }, yi = (e, t) => {
2971
- oe(() => e ? vi() : void 0, [e]), oe(() => {
3069
+ }, Mi = (e, t) => {
3070
+ ne(() => e ? Ci() : void 0, [e]), ne(() => {
2972
3071
  const n = t.current;
2973
3072
  if (!(!e || n === null))
2974
- return Ei(n);
3073
+ return Li(n);
2975
3074
  }, [e, t]);
2976
- }, Ht = '[data-testid="markdown-explorer-view-switch"]', ki = [
2977
- { control: Ht, successors: [Ht, '[data-testid="markdown-explorer-sheet-toggle"]'] },
3075
+ }, zt = '[data-testid="markdown-explorer-view-switch"]', Ni = [
3076
+ { control: zt, successors: [zt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
2978
3077
  { control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
2979
- ], Si = (e) => {
2980
- for (const t of ki) {
3078
+ ], Di = (e) => {
3079
+ for (const t of Ni) {
2981
3080
  const n = e.closest(t.control);
2982
3081
  if (n !== null) return { element: n, control: t };
2983
3082
  }
2984
3083
  return null;
2985
- }, xi = (e, t) => {
3084
+ }, $i = (e, t) => {
2986
3085
  const n = B(null);
2987
- oe(() => {
3086
+ ne(() => {
2988
3087
  const o = (d) => {
2989
- const v = e.current;
2990
- n.current = v !== null && d instanceof Element && v.contains(d) ? Si(d) : null;
3088
+ const g = e.current;
3089
+ n.current = g !== null && d instanceof Element && g.contains(d) ? Di(d) : null;
2991
3090
  }, l = (d) => o(d.target);
2992
3091
  o(document.activeElement);
2993
3092
  const i = (d) => {
2994
- const v = d.target;
2995
- d.relatedTarget !== null || !(v instanceof Element) || queueMicrotask(() => {
2996
- n.current?.element === v && v.isConnected && document.activeElement !== v && (n.current = null);
3093
+ const g = d.target;
3094
+ d.relatedTarget !== null || !(g instanceof Element) || queueMicrotask(() => {
3095
+ n.current?.element === g && g.isConnected && document.activeElement !== g && (n.current = null);
2997
3096
  });
2998
3097
  };
2999
3098
  return document.addEventListener("focusin", l), document.addEventListener("focusout", i), () => {
@@ -3007,13 +3106,13 @@ const vi = () => {
3007
3106
  const o = n.current;
3008
3107
  if (o === null) return;
3009
3108
  const l = () => {
3010
- const v = document.activeElement;
3011
- if (v !== null && v !== document.body && v !== o.element) return !0;
3109
+ const g = document.activeElement;
3110
+ if (g !== null && g !== document.body && g !== o.element) return !0;
3012
3111
  const f = e.current;
3013
3112
  if (f === null) return !0;
3014
3113
  for (const u of o.control.successors)
3015
- for (const g of f.querySelectorAll(u))
3016
- if (g !== o.element && (g.focus({ preventScroll: !0 }), document.activeElement === g))
3114
+ for (const p of f.querySelectorAll(u))
3115
+ if (p !== o.element && (p.focus({ preventScroll: !0 }), document.activeElement === p))
3017
3116
  return !0;
3018
3117
  return !1;
3019
3118
  };
@@ -3025,106 +3124,106 @@ const vi = () => {
3025
3124
  });
3026
3125
  return d.observe(i, { childList: !0, subtree: !0 }), () => d.disconnect();
3027
3126
  }, [t, e]);
3028
- }, Ri = tt(() => import("./TreeLayout-bk-Ziybl.js").then((e) => ({ default: e.TreeLayout }))), Ti = tt(() => import("./MultiLayout-DBpUTcCQ.js").then((e) => ({ default: e.MultiLayout }))), Ci = 64, Oi = {
3127
+ }, Pi = tt(() => import("./TreeLayout-B3i_63hs.js").then((e) => ({ default: e.TreeLayout }))), Fi = tt(() => import("./MultiLayout-DPE2GP2T.js").then((e) => ({ default: e.MultiLayout }))), qi = 64, _i = {
3029
3128
  request: (e) => {
3030
3129
  requestAnimationFrame(e);
3031
3130
  }
3032
- }, zt = (e) => {
3131
+ }, Zt = (e) => {
3033
3132
  e.documents.clear(), e.trees.clear();
3034
3133
  }, We = (e, t) => {
3035
3134
  t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
3036
3135
  for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
3037
- }, Ai = (e, t) => {
3136
+ }, Bi = (e, t) => {
3038
3137
  const [n, r] = I(() => ({ overrides: t, locale: e, labels: Et(e, t) }));
3039
- if (n.locale === e && pr(n.overrides, t)) return n.labels;
3138
+ if (n.locale === e && vr(n.overrides, t)) return n.labels;
3040
3139
  const o = { overrides: t, locale: e, labels: Et(e, t) };
3041
3140
  return r(o), o.labels;
3042
- }, Li = (e, t, n) => {
3043
- const [r, o] = I(() => ({ scope: t, store: _t(e, n) }));
3141
+ }, Ii = (e, t, n) => {
3142
+ const [r, o] = I(() => ({ scope: t, store: Bt(e, n) }));
3044
3143
  if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
3045
- const l = { scope: t, store: _t(e, n) };
3144
+ const l = { scope: t, store: Bt(e, n) };
3046
3145
  return o(l), l.store;
3047
3146
  }, Xe = (e, t) => {
3048
3147
  const [n, r] = I(() => ({ scope: e, value: t() }));
3049
3148
  if (n.scope === e) return n.value;
3050
3149
  const o = { scope: e, value: t() };
3051
3150
  return r(o), o.value;
3052
- }, Mi = () => oi(Oi), Ut = "on", Ni = "off", Di = (e, t) => {
3151
+ }, ji = () => hi(_i), Ut = "on", Hi = "off", zi = (e, t) => {
3053
3152
  const n = de(e.peek(t));
3054
3153
  return n === null || n.document.kind === "failure" ? Ee(t) : n.document.name;
3055
- }, Gi = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: i, renderTreeFailure: d, lockDocumentScroll: v = !1, onMathDiagnostics: f, onEditGrant: u }) => {
3056
- sr(n);
3057
- const g = en(r), m = vr(l), k = Ai(g, o), { revalidate: O } = Nn(), E = B(() => {
3058
- }), T = De(t.dataPath), [x] = I(() => {
3059
- const $ = ii({ dataPath: T, onScope: (p) => E.current(p) }), G = { documents: ro({ client: $, capacity: Math.max(Ci, t.multiView.maxPanels * 2) }), trees: hi($) };
3154
+ }, rs = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: i, renderTreeFailure: d, lockDocumentScroll: g = !1, onMathDiagnostics: f, onEditGrant: u }) => {
3155
+ ar(n);
3156
+ const p = tn(r), m = wr(l), x = Bi(p, o), { revalidate: O } = Dn(), y = B(() => {
3157
+ }), T = De(t.dataPath), [S] = I(() => {
3158
+ const $ = gi({ dataPath: T, onScope: (v) => y.current(v) }), G = { documents: oo({ client: $, capacity: Math.max(qi, t.multiView.maxPanels * 2) }), trees: Si($) };
3060
3159
  return We(G, e), wt(n, e.scope), { data: $, ...G, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3061
3160
  });
3062
- if (x.aligned.pageData !== e || x.aligned.storageNamespace !== n) {
3063
- const $ = x.aligned.pageData;
3064
- x.aligned.pageData = e, x.aligned.storageNamespace = n, $ !== e && ($.scope !== e.scope ? x.aligned.pendingReader = e : We(x, e)), wt(n, e.scope);
3161
+ if (S.aligned.pageData !== e || S.aligned.storageNamespace !== n) {
3162
+ const $ = S.aligned.pageData;
3163
+ S.aligned.pageData = e, S.aligned.storageNamespace = n, $ !== e && ($.scope !== e.scope ? S.aligned.pendingReader = e : We(S, e)), wt(n, e.scope);
3065
3164
  }
3066
- const M = Li(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
3165
+ const M = Ii(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
3067
3166
  V(() => {
3068
- const $ = x.aligned.pendingReader;
3069
- $ !== null && (x.aligned.pendingReader = null, zt(x), We(x, $));
3070
- }, [e, x]), V(() => {
3167
+ const $ = S.aligned.pendingReader;
3168
+ $ !== null && (S.aligned.pendingReader = null, Zt(S), We(S, $));
3169
+ }, [e, S]), V(() => {
3071
3170
  let $ = !1;
3072
- return E.current = (G) => {
3073
- G === e.scope || $ || ($ = !0, G !== null && (zt(x), ar(n)), O());
3171
+ return y.current = (G) => {
3172
+ G === e.scope || $ || ($ = !0, G !== null && (Zt(S), cr(n)), O());
3074
3173
  }, () => {
3075
- E.current = () => {
3174
+ y.current = () => {
3076
3175
  };
3077
3176
  };
3078
- }, [e, O, x, n]);
3177
+ }, [e, O, S, n]);
3079
3178
  const s = B(t.settingsCookie);
3080
3179
  V(() => {
3081
3180
  s.current = t.settingsCookie;
3082
3181
  }, [t.settingsCookie]);
3083
- const [a] = I(
3084
- () => gi(e.settings, ($) => {
3085
- document.cookie = In(s.current, $, window.location.protocol === "https:");
3182
+ const [c] = I(
3183
+ () => Ri(e.settings, ($) => {
3184
+ document.cookie = jn(s.current, $, window.location.protocol === "https:");
3086
3185
  })
3087
- ), h = Xe(e.scope, Mi), w = Xe(e.scope, si), S = B(k);
3186
+ ), h = Xe(e.scope, ji), w = Xe(e.scope, vi), k = B(x);
3088
3187
  V(() => {
3089
- S.current = k;
3090
- }, [k]);
3188
+ k.current = x;
3189
+ }, [x]);
3091
3190
  const L = Xe(
3092
3191
  e.scope,
3093
- () => Tr({
3094
- data: x.data,
3095
- conflictLabels: () => ({ ours: S.current.conflictOurs, theirs: S.current.conflictTheirs }),
3192
+ () => Cr({
3193
+ data: S.data,
3194
+ conflictLabels: () => ({ ours: k.current.conflictOurs, theirs: k.current.conflictTheirs }),
3096
3195
  onSaveSettled: ($, G) => {
3097
- G.kind === "saved" && x.documents.refresh($);
3098
- const p = br(S.current, G, Di(x.documents, $));
3099
- p !== null && h.announce(p);
3196
+ G.kind === "saved" && S.documents.refresh($);
3197
+ const v = Er(k.current, G, zi(S.documents, $));
3198
+ v !== null && h.announce(v);
3100
3199
  },
3101
3200
  previewSetting: {
3102
- read: () => Yt(ze(n).editPreview) === Ut,
3103
- write: ($) => Xt(ze(n).editPreview, $ ? Ut : Ni)
3201
+ read: () => Jt(ze(n).editPreview) === Ut,
3202
+ write: ($) => Yt(ze(n).editPreview, $ ? Ut : Hi)
3104
3203
  }
3105
3204
  })
3106
- ), R = U(() => be(e.notices.catch(() => [])), [e.notices]), N = e.sources.map(($) => $.id).join(`
3107
- `), q = U(() => Bn(t, N.split(`
3205
+ ), R = Z(() => be(e.notices.catch(() => [])), [e.notices]), N = e.sources.map(($) => $.id).join(`
3206
+ `), q = Z(() => In(t, N.split(`
3108
3207
  `)), [t, N]), W = B(f);
3109
3208
  V(() => {
3110
3209
  W.current = f;
3111
3210
  }, [f]);
3112
3211
  const [J] = I(() => ($, G) => {
3113
3212
  W.current?.($, G);
3114
- }), ee = f === void 0 ? void 0 : J, X = U(
3213
+ }), ee = f === void 0 ? void 0 : J, X = Z(
3115
3214
  () => ({
3116
3215
  config: q,
3117
- labels: k,
3118
- locale: g,
3216
+ labels: x,
3217
+ locale: p,
3119
3218
  theme: m,
3120
3219
  storageNamespace: n,
3121
3220
  scope: e.scope,
3122
3221
  sources: e.sources,
3123
3222
  notices: R,
3124
- documents: x.documents,
3125
- trees: x.trees,
3126
- data: x.data,
3127
- viewSettings: a,
3223
+ documents: S.documents,
3224
+ trees: S.trees,
3225
+ data: S.data,
3226
+ viewSettings: c,
3128
3227
  treeSettings: M,
3129
3228
  announcer: h,
3130
3229
  reveals: w,
@@ -3133,67 +3232,67 @@ const vi = () => {
3133
3232
  renderTreeFailure: d,
3134
3233
  reportMathDiagnostics: ee
3135
3234
  }),
3136
- [q, k, g, m, n, e.scope, e.sources, R, x, a, M, h, w, L, u, d, ee]
3235
+ [q, x, p, m, n, e.scope, e.sources, R, S, c, M, h, w, L, u, d, ee]
3137
3236
  );
3138
- return /* @__PURE__ */ c(tn, { value: X, children: /* @__PURE__ */ c(Pi, { renderFrame: i, lockDocumentScroll: v }, e.scope) });
3139
- }, $i = ({ ref: e, theme: t, view: n, children: r }) => {
3140
- const [o] = I(Do);
3141
- 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 });
3142
- }, Pi = ({ renderFrame: e, lockDocumentScroll: t }) => {
3143
- const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Vt(), i = $e(), d = B(null);
3144
- yi(t, d), V(() => {
3237
+ return /* @__PURE__ */ a(nn, { value: X, children: /* @__PURE__ */ a(Ui, { renderFrame: i, lockDocumentScroll: g }, e.scope) });
3238
+ }, Zi = ({ ref: e, theme: t, view: n, children: r }) => {
3239
+ const [o] = I(zo);
3240
+ return /* @__PURE__ */ a("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
3241
+ }, Ui = ({ renderFrame: e, lockDocumentScroll: t }) => {
3242
+ const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Gt(), i = $e(), d = B(null);
3243
+ Mi(t, d), V(() => {
3145
3244
  o.kind === "redirect" && i(`${o.href}${l}`, "browse");
3146
3245
  }, [o, l, i]);
3147
- const { location: v } = o, f = v.view;
3148
- xi(d, f);
3149
- const u = v.view === "tree" ? /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ c(Ri, { location: v }) }) : v.view === "multi" ? /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ c(Ti, { location: v }) }) : /* @__PURE__ */ c(ni, { location: v }), g = /* @__PURE__ */ F($i, { ref: d, theme: n, view: f, children: [
3246
+ const { location: g } = o, f = g.view;
3247
+ $i(d, f);
3248
+ const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Pi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : /* @__PURE__ */ a(fi, { location: g }), p = /* @__PURE__ */ F(Zi, { ref: d, theme: n, view: f, children: [
3150
3249
  u,
3151
- /* @__PURE__ */ c(Nr, {}),
3152
- /* @__PURE__ */ c(ri, { holds: !0, testId: "markdown-explorer-announcer" })
3250
+ /* @__PURE__ */ a(Dr, {}),
3251
+ /* @__PURE__ */ a(mi, { holds: !0, testId: "markdown-explorer-announcer" })
3153
3252
  ] });
3154
- return e === void 0 ? g : e({ view: f, children: g });
3155
- }, Ki = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
3253
+ return e === void 0 ? p : e({ view: f, children: p });
3254
+ }, os = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
3156
3255
  export {
3157
3256
  Qe as A,
3158
3257
  yt as B,
3159
- Er as C,
3160
- ti as D,
3161
- Hl as E,
3258
+ yr as C,
3259
+ ui as D,
3260
+ Jl as E,
3162
3261
  ve as F,
3163
- Qt as G,
3164
- dr as H,
3165
- Fo as I,
3262
+ en as G,
3263
+ ur as H,
3264
+ Vo as I,
3166
3265
  bt as J,
3167
- Gi as K,
3168
- to as L,
3169
- mr as M,
3266
+ rs as K,
3267
+ no as L,
3268
+ hr as M,
3170
3269
  Et as N,
3171
- Ki as O,
3172
- ei as P,
3270
+ os as O,
3271
+ di as P,
3173
3272
  $e as a,
3174
- Yl as b,
3175
- Rl as c,
3176
- yr as d,
3273
+ si as b,
3274
+ Pl as c,
3275
+ xr as d,
3177
3276
  kr as e,
3178
- Zr as f,
3277
+ Vr as f,
3179
3278
  Sr as g,
3180
3279
  ae as h,
3181
- Wr as i,
3182
- Lr as j,
3183
- rn as k,
3184
- Xr as l,
3280
+ Xr as i,
3281
+ Mr as j,
3282
+ on as k,
3283
+ Yr as l,
3185
3284
  ye as m,
3186
- Vi as n,
3187
- cn as o,
3188
- Zi as p,
3189
- Cl as q,
3190
- Jr as r,
3191
- Bl as s,
3192
- Yr as t,
3285
+ ns as n,
3286
+ dn as o,
3287
+ ts as p,
3288
+ ql as q,
3289
+ Qr as r,
3290
+ Wl as s,
3291
+ Jr as t,
3193
3292
  D as u,
3194
- Vr as v,
3293
+ Gr as v,
3195
3294
  nt as w,
3196
- ri as x,
3295
+ mi as x,
3197
3296
  Ae as y,
3198
- cr as z
3297
+ dr as z
3199
3298
  };