@aiquants/markdown-explorer 0.21.0 → 0.23.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +27 -16
  3. package/dist/EditSurface-Bk4tdJ99.cjs +6 -0
  4. package/dist/EditSurface-Dhvw9IDD.js +975 -0
  5. package/dist/{ExplorerSplit-CdqEKz-I.cjs → ExplorerSplit-BAFiXU-V.cjs} +1 -1
  6. package/dist/{ExplorerSplit-3WMRDA7G.js → ExplorerSplit-Q5VqUBDE.js} +3 -3
  7. package/dist/{MultiLayout-BEg1X8Jx.cjs → MultiLayout-Bq_TS3ez.cjs} +1 -1
  8. package/dist/{MultiLayout-Gf1xT-Le.js → MultiLayout-DlATT7km.js} +22 -22
  9. package/dist/{NativeScrollBar-idIQsvCv.cjs → NativeScrollBar-A6-qEpz7.cjs} +1 -1
  10. package/dist/{NativeScrollBar-0cpp2OIu.js → NativeScrollBar-TsIcS3JZ.js} +1 -1
  11. package/dist/{TreeLayout-DJY_WqzP.cjs → TreeLayout-l-r2pPao.cjs} +1 -1
  12. package/dist/{TreeLayout-DzZCgMTt.js → TreeLayout-zrSo4MNZ.js} +3 -3
  13. package/dist/core/contracts.d.cts +7 -0
  14. package/dist/core/contracts.d.ts +7 -0
  15. package/dist/core/labels.d.cts +21 -27
  16. package/dist/core/labels.d.ts +21 -27
  17. package/dist/{dataRoute-CObbjNxG.js → dataRoute-Diu_7gle.js} +84 -83
  18. package/dist/dataRoute-vXGZMVB-.cjs +1 -0
  19. package/dist/index-BNFl3BsO.cjs +13 -0
  20. package/dist/{index-CJgHGeZs.js → index-Jz6zeO4O.js} +1500 -1529
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +9 -9
  25. package/dist/{location-B-m9scLf.js → location-8Ho8ZNv_.js} +1 -1
  26. package/dist/{location-BVEN_Ihk.cjs → location-DN0AI4ir.cjs} +1 -1
  27. package/dist/{merge-BOcofJN5.js → merge-BzMpSaxx.js} +1 -1
  28. package/dist/{merge-BVk6pvO_.cjs → merge-DlPkU2Jc.cjs} +1 -1
  29. package/dist/{sanitizePolicy-BWQtWhsL.js → sanitizePolicy-BvhYIqVO.js} +1 -1
  30. package/dist/{sanitizePolicy-gEXeavb-.cjs → sanitizePolicy-Du3lFZd-.cjs} +1 -1
  31. package/dist/sanitizeWorker.cjs +1 -1
  32. package/dist/sanitizeWorker.js +1 -1
  33. package/dist/server/ports.d.cts +2 -1
  34. package/dist/server/ports.d.ts +2 -1
  35. package/dist/server.cjs +1 -1
  36. package/dist/server.js +524 -521
  37. package/dist/{useSplitPersistence-Ba-v64n-.cjs → useSplitPersistence-CR4Oxtaa.cjs} +1 -1
  38. package/dist/{useSplitPersistence-Cc4tDxB4.js → useSplitPersistence-HfAb8Kzh.js} +1 -1
  39. package/docs/behavior/dom-hooks.md +3 -3
  40. package/docs/behavior/layout.md +11 -5
  41. package/docs/behavior/localization.md +9 -7
  42. package/docs/behavior/security.md +1 -1
  43. package/docs/behavior/url-contract.md +2 -2
  44. package/package.json +5 -5
  45. package/dist/EditSurface-Bwl4S1vQ.cjs +0 -7
  46. package/dist/EditSurface-rKoy_ndP.js +0 -880
  47. package/dist/dataRoute-BONacTPi.cjs +0 -1
  48. package/dist/index-bMaSoQTe.cjs +0 -13
@@ -1,27 +1,25 @@
1
- import { jsxs as $, jsx as d, Fragment as Pe } from "react/jsx-runtime";
2
- import * as y from "react";
3
- import { createContext as pe, use as re, useMemo as U, useSyncExternalStore as ee, useRef as _, useLayoutEffect as j, useCallback as P, useId as xe, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as z, useEffectEvent as ae } from "react";
4
- import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as Fe, useLocation as nn, useRevalidator as Vn } from "react-router";
5
- import { j as Zn, g as rn, z as Un, E as on, a as an, B as Gn, D as wt, G as Wn, H as be, e as Se, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-B-m9scLf.js";
6
- import { F as se, i as tr, G as nr, y as Y, x as rr, H as Et, z as Ve, I as or, J as ir, K as ar, L as lr, N as sr, f as dr, O as St, v as cr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as wr, U as gr, u as yt } from "./dataRoute-CObbjNxG.js";
7
- import { HostedScrollArea as xt, useMarkdownToolbarState as br, MarkdownViewer as ln } from "@aiquants/markdown";
8
- import { SOURCE_LINES_ATTRIBUTE as sn, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
9
- import { DEFAULT_CONTENT_ALIGN as Sr } from "@aiquants/markdown/viewer-settings";
10
- import { w as Je, r as Qe, a as yr, b as kt, s as we, c as xr } from "./storage-CmGHg7OA.js";
11
- import { createShouldRevalidate as kr } from "@aiquants/route-revalidation";
12
- const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
1
+ import { jsxs as F, jsx as c, Fragment as $e } from "react/jsx-runtime";
2
+ import * as S from "react";
3
+ import { createContext as pe, use as ne, useMemo as H, useSyncExternalStore as ee, useRef as q, useLayoutEffect as V, useCallback as P, useId as xe, useEffect as te, Component as an, Suspense as ke, lazy as lt, useState as B, useEffectEvent as le } from "react";
4
+ import { useParams as Un, useSearchParams as Zn, matchPath as Gn, useBlocker as Kn, useNavigate as Wn, Link as Yn, useHref as Fe, useLocation as sn, useRevalidator as Xn } from "react-router";
5
+ import { j as Jn, g as cn, z as Qn, E as dn, a as un, B as er, D as Et, G as tr, H as be, e as ye, I as nr, J as rr, K as yt, L as or, M as St, O as ir, w as lr, Q as ar } from "./location-8Ho8ZNv_.js";
6
+ import { SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS as xt, SPREADSHEET_BLOCK_LABEL_CATALOGS as Ae } from "@aiquants/markdown/code-blocks";
7
+ import { G as se, i as sr, H as cr, z as J, y as dr, I as kt, A as Ue, J as ur, K as fr, L as mr, N as hr, O as pr, f as vr, P as Tt, w as gr, Q as wr, R as br, S as Er, C as yr, x as Sr, T as xr, U as kr, V as Tr, v as Rt } from "./dataRoute-Diu_7gle.js";
8
+ import { HostedScrollArea as Ot, useMarkdownToolbarState as Rr, MarkdownViewer as fn } from "@aiquants/markdown";
9
+ import { SOURCE_LINES_ATTRIBUTE as mn, parseSourceLines as Or } from "@aiquants/markdown/source-lines";
10
+ import { DEFAULT_CONTENT_ALIGN as Cr } from "@aiquants/markdown/viewer-settings";
11
+ import { w as Qe, r as et, a as Mr, b as Ct, s as ge, c as Lr } from "./storage-CmGHg7OA.js";
12
+ import { createShouldRevalidate as Ar } from "@aiquants/route-revalidation";
13
+ const Mt = Object.freeze(["en", "ja"]), Nr = "en", at = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, hn = Object.freeze(Object.keys(Ae.en)), pn = (e) => Object.fromEntries(hn.map((t) => [at(t), Ae[e][t].text])), Dr = Object.freeze({
13
14
  panelMoved: Object.freeze(["title", "column", "position"]),
14
15
  panelMoveUnavailable: Object.freeze(["title", "move"]),
15
16
  panelDragStarted: Object.freeze(["title"]),
16
17
  panelDragCancelled: Object.freeze(["title"]),
17
18
  multiColumnRegion: Object.freeze(["column"]),
18
- viewerSpreadsheetSize: Object.freeze(["rows", "cols"]),
19
- viewerSpreadsheetCopyFailed: Object.freeze(["reason"]),
20
- viewerSpreadsheetCellAnnouncement: Object.freeze(["cell", "value"]),
21
- viewerSpreadsheetSelectionAnnouncement: Object.freeze(["range"]),
22
- viewerSpreadsheetOptionsError: Object.freeze(["message"]),
23
- viewerSpreadsheetLoadFailed: Object.freeze(["message"])
24
- }), Or = /\{(\w+)\}/gu, dn = {
19
+ viewerSvgImageSourceRegion: Object.freeze(["name"]),
20
+ ...Object.fromEntries(hn.filter((e) => xt[e].length > 0).map((e) => [at(e), xt[e]]))
21
+ }), Pr = /\{(\w+)\}/gu, vn = {
22
+ ...pn("en"),
25
23
  explorerRegion: "Explorer",
26
24
  sourceLabel: "Source",
27
25
  refreshTreeLabel: "Refresh tree",
@@ -35,6 +33,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
35
33
  documentRefreshFailed: (e) => `Could not reload the document: ${e}`,
36
34
  showMarkupLabel: "Source",
37
35
  showMarkup: "Show the document's Markdown as written",
36
+ showSvgMarkup: "Show the image's SVG as written",
38
37
  showMarkupNamed: (e) => `Source of ${e}`,
39
38
  editDocumentLabel: "Edit",
40
39
  editDocument: "Edit the document's Markdown (or double-click the document)",
@@ -99,6 +98,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
99
98
  previewRegion: "Preview",
100
99
  previewUpdating: "Updating the preview…",
101
100
  previewFailed: (e) => `Could not preview: ${e}`,
101
+ previewTablePending: "This table can be edited once the preview shows the draft.",
102
102
  expandAll: "Expand all folders",
103
103
  collapseAll: "Collapse all folders",
104
104
  treeSettings: "Tree settings",
@@ -250,32 +250,17 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
250
250
  viewerEmbeddedVideo: "embedded video",
251
251
  viewerEmbeddedPost: "embedded post",
252
252
  viewerEmbeddedFrame: "Embedded content",
253
- viewerSpreadsheetTable: "Spreadsheet",
254
- viewerSpreadsheetZoomIn: "Zoom in",
255
- viewerSpreadsheetZoomOut: "Zoom out",
256
- viewerSpreadsheetResetZoom: "Reset zoom",
257
- viewerSpreadsheetHighlight: "Highlight the active row and column",
258
- viewerSpreadsheetCopyAll: "Copy the whole table",
259
- viewerSpreadsheetSaveTsv: "Save as TSV",
260
- viewerSpreadsheetSaveMenu: "More ways to save",
261
- viewerSpreadsheetSaveTsvWithBom: "Save with a BOM (for Excel)",
262
- viewerSpreadsheetFullscreen: "View full screen",
263
- viewerSpreadsheetExitFullscreen: "Exit full screen",
264
- viewerSpreadsheetFullscreenDialog: "Spreadsheet (full screen)",
265
- viewerSpreadsheetSize: "Rows {rows} × columns {cols}",
266
- viewerSpreadsheetFileName: "spreadsheet.tsv",
267
- viewerSpreadsheetCopied: "Copied the whole table.",
268
- viewerSpreadsheetCopyFailed: "Could not copy the table: {reason}",
269
- viewerSpreadsheetCellAnnouncement: "{cell}, {value}",
270
- viewerSpreadsheetEmptyCell: "blank",
271
- viewerSpreadsheetSelectionAnnouncement: "{range} selected",
272
- viewerSpreadsheetReadOnly: "This table is read-only here.",
273
- viewerSpreadsheetFormatRefused: "This table keeps text only, so formatting and links are not saved.",
274
- viewerSpreadsheetFenceRefused: "A cell cannot begin a line with ``` or ~~~ in this table, so the change was not saved.",
275
- viewerSpreadsheetEditConflict: "The table changed in the editor, so the change was not saved. Try again.",
276
- viewerSpreadsheetOptionsError: "Invalid spreadsheet options: {message}",
277
- viewerSpreadsheetLoadFailed: "Could not load the spreadsheet: {message}",
278
- viewerSpreadsheetRetry: "Retry",
253
+ viewerBlockFailed: "This block could not be shown.",
254
+ viewerSvgImageToolbar: "SVG image",
255
+ viewerSvgImageSource: "Source",
256
+ viewerSvgImageSourceRegion: "Source of {name}",
257
+ viewerSvgImageLoading: "Loading the source…",
258
+ viewerSvgImageFailed: "The source could not be read.",
259
+ viewerSvgImageRetry: "Try again",
260
+ viewerSvgImageTruncated: "Only the beginning of this file is shown.",
261
+ viewerSvgImageCopy: "Copy the source",
262
+ viewerSvgImageCopied: "Copied the source.",
263
+ viewerSvgImageCopyFailed: "Could not copy the source.",
279
264
  multiRegion: "Panels",
280
265
  multiEmpty: "Select documents in the explorer to open them side by side.",
281
266
  panelLimit: (e) => `You can open up to ${String(e)} panels at once.`,
@@ -308,7 +293,8 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
308
293
  multiColumnEmpty: "This column is empty",
309
294
  multiColumnRegion: "Column {column}",
310
295
  panelDropHere: "Drop the panel here"
311
- }, Cr = {
296
+ }, $r = {
297
+ ...pn("ja"),
312
298
  explorerRegion: "エクスプローラー",
313
299
  sourceLabel: "ソース",
314
300
  refreshTreeLabel: "ツリーを更新",
@@ -322,6 +308,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
322
308
  documentRefreshFailed: (e) => `文書を読み込み直せませんでした: ${e}`,
323
309
  showMarkupLabel: "ソース",
324
310
  showMarkup: "文書の Markdown を書いたまま表示",
311
+ showSvgMarkup: "画像の SVG を書いたまま表示",
325
312
  showMarkupNamed: (e) => `${e} のソース`,
326
313
  editDocumentLabel: "編集",
327
314
  editDocument: "文書の Markdown を編集 (文書のダブルクリックでも)",
@@ -386,6 +373,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
386
373
  previewRegion: "プレビュー",
387
374
  previewUpdating: "プレビューを更新中…",
388
375
  previewFailed: (e) => `プレビューできませんでした: ${e}`,
376
+ previewTablePending: "プレビューが下書きを描くと、この表を編集できます。",
389
377
  expandAll: "すべてのフォルダーを展開",
390
378
  collapseAll: "すべてのフォルダーを折りたたむ",
391
379
  treeSettings: "ツリーの設定",
@@ -537,32 +525,17 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
537
525
  viewerEmbeddedVideo: "埋め込みの動画",
538
526
  viewerEmbeddedPost: "埋め込みの投稿",
539
527
  viewerEmbeddedFrame: "埋め込みのコンテンツ",
540
- viewerSpreadsheetTable: "表",
541
- viewerSpreadsheetZoomIn: "拡大",
542
- viewerSpreadsheetZoomOut: "縮小",
543
- viewerSpreadsheetResetZoom: "拡大率を戻す",
544
- viewerSpreadsheetHighlight: "選んだ行と列を強調",
545
- viewerSpreadsheetCopyAll: "表全体をコピー",
546
- viewerSpreadsheetSaveTsv: "TSV として保存",
547
- viewerSpreadsheetSaveMenu: "ほかの保存の方法",
548
- viewerSpreadsheetSaveTsvWithBom: "BOM を付けて保存 (Excel 向け)",
549
- viewerSpreadsheetFullscreen: "全画面で見る",
550
- viewerSpreadsheetExitFullscreen: "全画面を閉じる",
551
- viewerSpreadsheetFullscreenDialog: "表 (全画面)",
552
- viewerSpreadsheetSize: "{rows} 行 × {cols} 列",
553
- viewerSpreadsheetFileName: "表.tsv",
554
- viewerSpreadsheetCopied: "表全体をコピーしました。",
555
- viewerSpreadsheetCopyFailed: "表をコピーできませんでした: {reason}",
556
- viewerSpreadsheetCellAnnouncement: "{cell}、{value}",
557
- viewerSpreadsheetEmptyCell: "空白",
558
- viewerSpreadsheetSelectionAnnouncement: "{range} を選択",
559
- viewerSpreadsheetReadOnly: "この表はここでは編集できません。",
560
- viewerSpreadsheetFormatRefused: "この表は文字だけを保つため、書式とリンクは保存しません。",
561
- viewerSpreadsheetFenceRefused: "セルの行頭に ``` や ~~~ を置くと表が壊れるため、この変更は保存しませんでした。",
562
- viewerSpreadsheetEditConflict: "エディタで表が変わっていたため、この変更は保存しませんでした。もう一度お試しください。",
563
- viewerSpreadsheetOptionsError: "表の指定の誤り: {message}",
564
- viewerSpreadsheetLoadFailed: "表を読み込めませんでした: {message}",
565
- viewerSpreadsheetRetry: "再試行",
528
+ viewerBlockFailed: "このブロックを表示できませんでした。",
529
+ viewerSvgImageToolbar: "SVG の画像",
530
+ viewerSvgImageSource: "ソース",
531
+ viewerSvgImageSourceRegion: "{name} のソース",
532
+ viewerSvgImageLoading: "ソースを読み込み中…",
533
+ viewerSvgImageFailed: "ソースを読み込めませんでした。",
534
+ viewerSvgImageRetry: "再試行",
535
+ viewerSvgImageTruncated: "このファイルは先頭だけを表示しています。",
536
+ viewerSvgImageCopy: "ソースをコピー",
537
+ viewerSvgImageCopied: "ソースをコピーしました。",
538
+ viewerSvgImageCopyFailed: "ソースをコピーできませんでした。",
566
539
  multiRegion: "パネル",
567
540
  multiEmpty: "エクスプローラーで文書を選ぶと、ここに並べて開きます。",
568
541
  panelLimit: (e) => `同時に開けるのは ${String(e)} パネルまでです。`,
@@ -595,60 +568,60 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
595
568
  multiColumnEmpty: "この列は空です",
596
569
  multiColumnRegion: "{column} 列目",
597
570
  panelDropHere: "ここへパネルをドロップ"
598
- }, Mr = Object.freeze({
599
- en: Object.freeze(dn),
600
- ja: Object.freeze(Cr)
601
- }), cn = Object.freeze(Object.keys(dn)), Ar = new Set(cn), Lr = (e) => Ar.has(e), Me = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, un = (e) => {
602
- if (e === void 0) return Tr;
603
- if (Tt.includes(e)) return e;
604
- throw new RangeError(`[markdown-explorer] locale is the UI language (${Tt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Me(e)}`);
605
- }, Rt = (e, t) => {
606
- const n = Mr[un(e)];
571
+ }, Fr = Object.freeze({
572
+ en: Object.freeze(vn),
573
+ ja: Object.freeze($r)
574
+ }), gn = Object.freeze(Object.keys(vn)), Ir = new Set(gn), qr = (e) => Ir.has(e), Me = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, wn = (e) => {
575
+ if (e === void 0) return Nr;
576
+ if (Mt.includes(e)) return e;
577
+ throw new RangeError(`[markdown-explorer] locale is the UI language (${Mt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Me(e)}`);
578
+ }, Lt = (e, t) => {
579
+ const n = Fr[wn(e)];
607
580
  if (t === void 0) return n;
608
581
  if (t === null || typeof t != "object")
609
582
  throw new RangeError(`[markdown-explorer] labels must be an object; got ${Me(t)}`);
610
- if (!Zn(t))
583
+ if (!Jn(t))
611
584
  throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Me(t)}`);
612
585
  const r = t, o = { ...n };
613
586
  for (const i of Object.keys(r)) {
614
- if (!Lr(i))
615
- throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${cn.join(", ")}`);
616
- const a = r[i];
617
- if (a === void 0) continue;
587
+ if (!qr(i))
588
+ throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${gn.join(", ")}`);
589
+ const l = r[i];
590
+ if (l === void 0) continue;
618
591
  const u = typeof n[i];
619
- if (typeof a !== u)
620
- throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Me(a)}`);
621
- if (typeof a == "string" && a.trim() === "")
592
+ if (typeof l !== u)
593
+ throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Me(l)}`);
594
+ if (typeof l == "string" && l.trim() === "")
622
595
  throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
623
- const m = Rr[i];
624
- if (typeof a == "string" && m !== void 0) {
625
- for (const [, f] of a.matchAll(Or))
596
+ const m = Dr[i];
597
+ if (typeof l == "string" && m !== void 0) {
598
+ for (const [, f] of l.matchAll(Pr))
626
599
  if (!m.includes(f ?? ""))
627
- throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((c) => `{${c}}`).join(", ")}`);
600
+ throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((d) => `{${d}}`).join(", ")}`);
628
601
  }
629
- o[i] = a;
602
+ o[i] = l;
630
603
  }
631
604
  return Object.freeze(o);
632
- }, Nr = (e, t) => {
605
+ }, _r = (e, t) => {
633
606
  if (Object.is(e, t)) return !0;
634
607
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
635
608
  const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
636
- return o.length === i.length && i.every((a) => Object.hasOwn(n, a) && Object.is(n[a], r[a]));
637
- }, Ot = Object.freeze(["light", "dark"]), Dr = (e) => {
609
+ return o.length === i.length && i.every((l) => Object.hasOwn(n, l) && Object.is(n[l], r[l]));
610
+ }, At = Object.freeze(["light", "dark"]), Br = (e) => {
638
611
  if (e === void 0) return "light";
639
- if (Ot.includes(e)) return e;
640
- throw new RangeError(`[markdown-explorer] theme must be ${Ot.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
641
- }, fn = pe(null), D = () => {
642
- const e = re(fn);
612
+ if (At.includes(e)) return e;
613
+ throw new RangeError(`[markdown-explorer] theme must be ${At.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
614
+ }, bn = pe(null), D = () => {
615
+ const e = ne(bn);
643
616
  if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
644
617
  return e;
645
- }, Le = (e) => {
618
+ }, Ne = (e) => {
646
619
  const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
647
620
  return ee(t.subscribe, n, n);
648
- }, at = () => {
649
- const { config: e } = D(), t = _n()["*"], [n] = In(), r = n.toString();
650
- return U(() => rn(e, t, new URLSearchParams(r)), [e, t, r]);
651
- }, mn = {
621
+ }, st = () => {
622
+ const { config: e } = D(), t = Un()["*"], [n] = Zn(), r = n.toString();
623
+ return H(() => cn(e, t, new URLSearchParams(r)), [e, t, r]);
624
+ }, En = {
652
625
  unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
653
626
  forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
654
627
  "not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
@@ -657,14 +630,14 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
657
630
  "too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
658
631
  unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
659
632
  failed: ["failureFailedTitle", "failureFailedBody"]
660
- }, le = (e, t) => e[mn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
661
- const { labels: o } = D(), i = le(o, e.reason), a = o[mn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
662
- return /* @__PURE__ */ $("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
663
- /* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: i }),
664
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: a }),
665
- e.reason === "unauthorized" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
633
+ }, ae = (e, t) => e[En[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
634
+ const { labels: o } = D(), i = ae(o, e.reason), l = o[En[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
635
+ return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
636
+ /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: i }),
637
+ /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: l }),
638
+ e.reason === "unauthorized" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
666
639
  ] });
667
- }, Pr = (e, t) => {
640
+ }, jr = (e, t) => {
668
641
  const { phase: n, save: r, dirty: o } = t;
669
642
  switch (n.kind) {
670
643
  case "opening":
@@ -672,7 +645,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
672
645
  case "grant":
673
646
  return e.editGrantTitle;
674
647
  case "failed":
675
- return le(e, n.failure.reason);
648
+ return ae(e, n.failure.reason);
676
649
  }
677
650
  switch (r.kind) {
678
651
  case "draft":
@@ -684,13 +657,13 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
684
657
  case "grant":
685
658
  return e.editGrantTitle;
686
659
  case "failed":
687
- return e.draftSaveFailed(le(e, r.failure.reason));
660
+ return e.draftSaveFailed(ae(e, r.failure.reason));
688
661
  case "saved":
689
662
  if (!o) return r.merged ? e.draftSavedMerged : e.draftSaved;
690
663
  break;
691
664
  }
692
665
  return o ? e.draftUnsaved : "";
693
- }, Fr = (e, t, n) => {
666
+ }, zr = (e, t, n) => {
694
667
  switch (t.kind) {
695
668
  case "draft":
696
669
  return e.draftNotSaved;
@@ -701,7 +674,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
701
674
  case "grant":
702
675
  return e.editGrantTitle;
703
676
  case "failed":
704
- return e.draftSaveFailed(le(e, t.failure.reason));
677
+ return e.draftSaveFailed(ae(e, t.failure.reason));
705
678
  case "idle":
706
679
  case "saving":
707
680
  return null;
@@ -716,38 +689,38 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
716
689
  for (const t of [...e]) t();
717
690
  }
718
691
  };
719
- }, $r = "<<<<<<<", qr = "=======", _r = ">>>>>>>", Ct = (e, t) => e === t || e.startsWith(`${t} `), Mt = (e) => Ir(e.split(`
720
- `)), Ir = (e) => {
692
+ }, Vr = "<<<<<<<", Hr = "=======", Ur = ">>>>>>>", Nt = (e, t) => e === t || e.startsWith(`${t} `), Dt = (e) => Zr(e.split(`
693
+ `)), Zr = (e) => {
721
694
  const t = [];
722
695
  let n = null, r = null, o = 0;
723
696
  for (const i of e) {
724
697
  o += 1;
725
- const a = i.charCodeAt(0);
726
- a !== 60 && a !== 61 && a !== 62 || (Ct(i, $r) ? (n = o, r = null) : i === qr ? n !== null && r === null ? r = o : n = null : Ct(i, _r) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
698
+ const l = i.charCodeAt(0);
699
+ l !== 60 && l !== 61 && l !== 62 || (Nt(i, Vr) ? (n = o, r = null) : i === Hr ? n !== null && r === null ? r = o : n = null : Nt(i, Ur) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
727
700
  }
728
701
  return t;
729
- }, At = (e) => e.includes(`\r
702
+ }, Pt = (e) => e.includes(`\r
730
703
  `) ? `\r
731
704
  ` : `
732
705
  `, Ze = (e) => e.replace(/\r\n?/gu, `
733
- `), Br = (e, t) => t === `
706
+ `), Gr = (e, t) => t === `
734
707
  ` ? e : e.replaceAll(`
735
708
  `, `\r
736
- `), zr = 3, jr = /^\d+(?:\.\d+)?$/u, Hr = (e) => {
737
- if (e === null || !jr.test(e)) return null;
709
+ `), Kr = 3, Wr = /^\d+(?:\.\d+)?$/u, Yr = (e) => {
710
+ if (e === null || !Wr.test(e)) return null;
738
711
  const t = Number(e);
739
- return t >= an && t <= on ? t : null;
740
- }, Ue = Object.freeze({ kind: "idle" }), Lt = Object.freeze({ kind: "draft" }), Vr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
741
- const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), c = Oe();
742
- let h = null, g = null, E = null;
743
- const k = (l, s) => {
744
- l.value = { ...l.value, ...s }, c.emit();
745
- }, R = (l, s) => i.get(l) === s, T = async (l, s) => {
712
+ return t >= un && t <= dn ? t : null;
713
+ }, Ge = Object.freeze({ kind: "idle" }), $t = Object.freeze({ kind: "draft" }), Xr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
714
+ const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = Oe();
715
+ let h = null, v = null, E = null;
716
+ const k = (a, s) => {
717
+ a.value = { ...a.value, ...s }, d.emit();
718
+ }, R = (a, s) => i.get(a) === s, T = async (a, s) => {
746
719
  s.controller.abort(), s.controller = new AbortController();
747
- const { signal: v } = s.controller;
720
+ const { signal: w } = s.controller;
748
721
  k(s, { phase: { kind: "opening" } });
749
- const O = await e.edit(l, v);
750
- if (!R(l, s) || v.aborted || !("kind" in O)) return;
722
+ const O = await e.edit(a, w);
723
+ if (!R(a, s) || w.aborted || !("kind" in O)) return;
751
724
  if (O.kind === "grant") {
752
725
  k(s, { phase: { kind: "grant", href: O.href } });
753
726
  return;
@@ -756,248 +729,248 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
756
729
  k(s, { phase: { kind: "failed", failure: O.failure } });
757
730
  return;
758
731
  }
759
- const M = Ze(O.text), N = O.kind === "draft";
760
- s.base = { text: M, version: N ? null : O.version }, s.draft = M, s.ending = At(O.text), k(s, { phase: { kind: "editing" }, history: N ? !1 : O.history, dirty: !1, save: N ? Lt : Ue, generation: s.value.generation + 1 });
761
- }, A = (l) => {
762
- const s = i.get(l);
763
- s !== void 0 && (s.controller.abort(), i.delete(l), u.delete(l));
764
- }, L = (l, s, v) => (l.set(s, v), () => {
765
- l.get(s) === v && l.delete(s);
766
- }), b = (l, s, v, O = {}) => {
767
- k(s, { ...O, save: v }), n(l, v);
768
- }, w = async (l) => {
769
- m.get(l)?.flush();
770
- const s = i.get(l);
732
+ const L = Ze(O.text), A = O.kind === "draft";
733
+ s.base = { text: L, version: A ? null : O.version }, s.draft = L, s.ending = Pt(O.text), k(s, { phase: { kind: "editing" }, history: A ? !1 : O.history, dirty: !1, save: A ? $t : Ge, generation: s.value.generation + 1 });
734
+ }, N = (a) => {
735
+ const s = i.get(a);
736
+ s !== void 0 && (s.controller.abort(), i.delete(a), u.delete(a));
737
+ }, M = (a, s, w) => (a.set(s, w), () => {
738
+ a.get(s) === w && a.delete(s);
739
+ }), b = (a, s, w, O = {}) => {
740
+ k(s, { ...O, save: w }), n(a, w);
741
+ }, g = async (a) => {
742
+ m.get(a)?.flush();
743
+ const s = i.get(a);
771
744
  if (s === void 0 || s.value.phase.kind !== "editing" || s.base === null || s.value.save.kind === "saving") return;
772
- const { version: v } = s.base;
773
- if (v === null) {
774
- n(l, Lt);
745
+ const { version: w } = s.base;
746
+ if (w === null) {
747
+ n(a, $t);
775
748
  return;
776
749
  }
777
- const O = Mt(s.draft).length;
750
+ const O = Dt(s.draft).length;
778
751
  if (O > 0) {
779
- b(l, s, { kind: "conflicts", count: O });
752
+ b(a, s, { kind: "conflicts", count: O });
780
753
  return;
781
754
  }
782
755
  s.controller.abort(), s.controller = new AbortController();
783
- const { signal: M } = s.controller;
784
- let N = { text: s.base.text, version: v }, q = s.draft, W = !1;
756
+ const { signal: L } = s.controller;
757
+ let A = { text: s.base.text, version: w }, I = s.draft, K = !1;
785
758
  k(s, { save: { kind: "saving" } });
786
- for (let G = 0; G < zr; G += 1) {
787
- const I = await e.save(l, N.version, Br(q, s.ending), M);
788
- if (!R(l, s) || M.aborted || !("kind" in I)) return;
789
- if (I.kind === "saved") {
790
- m.get(l)?.flush(), s.base = { text: q, version: I.version }, b(l, s, { kind: "saved", merged: W }, { dirty: s.draft !== q });
759
+ for (let G = 0; G < Kr; G += 1) {
760
+ const z = await e.save(a, A.version, Gr(I, s.ending), L);
761
+ if (!R(a, s) || L.aborted || !("kind" in z)) return;
762
+ if (z.kind === "saved") {
763
+ m.get(a)?.flush(), s.base = { text: I, version: z.version }, b(a, s, { kind: "saved", merged: K }, { dirty: s.draft !== I });
791
764
  return;
792
765
  }
793
- if (I.kind === "grant") {
794
- b(l, s, { kind: "grant", href: I.href });
766
+ if (z.kind === "grant") {
767
+ b(a, s, { kind: "grant", href: z.href });
795
768
  return;
796
769
  }
797
- if (I.kind === "failure") {
798
- b(l, s, { kind: "failed", failure: I.failure });
770
+ if (z.kind === "failure") {
771
+ b(a, s, { kind: "failed", failure: z.failure });
799
772
  return;
800
773
  }
801
- const { mergeDraft: J } = await import("./merge-BOcofJN5.js");
802
- if (!R(l, s) || M.aborted) return;
803
- const H = m.get(l);
804
- H?.flush();
805
- const ne = Ze(I.text), p = J(N.text, s.draft, ne, t());
806
- if (N = { text: ne, version: I.version }, s.base = N, s.ending = At(I.text), s.draft = p.text, H?.adopt(p.text), p.kind === "conflicts") {
807
- b(l, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
774
+ const { mergeDraft: X } = await import("./merge-BzMpSaxx.js");
775
+ if (!R(a, s) || L.aborted) return;
776
+ const j = m.get(a);
777
+ j?.flush();
778
+ const re = Ze(z.text), p = X(A.text, s.draft, re, t());
779
+ if (A = { text: re, version: z.version }, s.base = A, s.ending = Pt(z.text), s.draft = p.text, j?.adopt(p.text), p.kind === "conflicts") {
780
+ b(a, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
808
781
  return;
809
782
  }
810
- if (W = !0, q = p.text, q === N.text) {
811
- b(l, s, { kind: "saved", merged: W }, { dirty: !1, generation: s.value.generation + 1 });
783
+ if (K = !0, I = p.text, I === A.text) {
784
+ b(a, s, { kind: "saved", merged: K }, { dirty: !1, generation: s.value.generation + 1 });
812
785
  return;
813
786
  }
814
787
  k(s, { dirty: !0, generation: s.value.generation + 1 });
815
788
  }
816
- b(l, s, { kind: "failed", failure: { reason: "failed" } });
789
+ b(a, s, { kind: "failed", failure: { reason: "failed" } });
817
790
  };
818
791
  return {
819
- session: (l) => i.get(l)?.value,
820
- subscribe: c.subscribe,
821
- start: (l, s) => {
822
- const v = i.get(l);
823
- if (v !== void 0) {
824
- k(v, { request: { anchor: s }, view: "editor" }), (v.value.phase.kind === "failed" || v.value.phase.kind === "grant") && T(l, v);
792
+ session: (a) => i.get(a)?.value,
793
+ subscribe: d.subscribe,
794
+ start: (a, s) => {
795
+ const w = i.get(a);
796
+ if (w !== void 0) {
797
+ k(w, { request: { anchor: s }, view: "editor" }), (w.value.phase.kind === "failed" || w.value.phase.kind === "grant") && T(a, w);
825
798
  return;
826
799
  }
827
- a.delete(l);
800
+ l.delete(a);
828
801
  const O = {
829
- value: { path: l, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ue, generation: 0, request: { anchor: s } },
802
+ value: { path: a, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ge, generation: 0, request: { anchor: s } },
830
803
  base: null,
831
804
  draft: "",
832
805
  ending: `
833
806
  `,
834
807
  controller: new AbortController()
835
808
  };
836
- i.set(l, O), T(l, O);
809
+ i.set(a, O), T(a, O);
837
810
  },
838
- retry: (l) => {
839
- const s = i.get(l);
840
- s === void 0 || s.value.phase.kind === "editing" || T(l, s);
811
+ retry: (a) => {
812
+ const s = i.get(a);
813
+ s === void 0 || s.value.phase.kind === "editing" || T(a, s);
841
814
  },
842
- draft: (l) => {
843
- const s = i.get(l);
815
+ draft: (a) => {
816
+ const s = i.get(a);
844
817
  return s === void 0 || s.base === null ? null : s.draft;
845
818
  },
846
- setDraft: (l, s) => {
847
- const v = i.get(l);
848
- if (v === void 0 || v.base === null) return;
849
- v.draft = s;
850
- const O = {}, M = s !== v.base.text;
851
- M !== v.value.dirty && (O.dirty = M);
852
- const { save: N } = v.value;
853
- if (N.kind === "conflicts") {
854
- const q = Mt(s).length;
855
- q === 0 ? O.save = Ue : q !== N.count && (O.save = { kind: "conflicts", count: q });
819
+ setDraft: (a, s) => {
820
+ const w = i.get(a);
821
+ if (w === void 0 || w.base === null) return;
822
+ w.draft = s;
823
+ const O = {}, L = s !== w.base.text;
824
+ L !== w.value.dirty && (O.dirty = L);
825
+ const { save: A } = w.value;
826
+ if (A.kind === "conflicts") {
827
+ const I = Dt(s).length;
828
+ I === 0 ? O.save = Ge : I !== A.count && (O.save = { kind: "conflicts", count: I });
856
829
  }
857
- (O.dirty !== void 0 || O.save !== void 0) && k(v, O);
830
+ (O.dirty !== void 0 || O.save !== void 0) && k(w, O);
858
831
  },
859
- consumeRequest: (l) => {
860
- const s = i.get(l);
832
+ consumeRequest: (a) => {
833
+ const s = i.get(a);
861
834
  s !== void 0 && s.value.request !== null && k(s, { request: null });
862
835
  },
863
- save: w,
864
- replaceDraft: (l, s) => {
865
- const v = m.get(l);
866
- v?.flush();
867
- const O = i.get(l);
836
+ save: g,
837
+ replaceDraft: (a, s) => {
838
+ const w = m.get(a);
839
+ w?.flush();
840
+ const O = i.get(a);
868
841
  if (O === void 0 || O.base === null) return;
869
- const M = Ze(s);
870
- O.draft = M, v?.adopt(M), k(O, { dirty: M !== O.base.text, generation: O.value.generation + 1 });
842
+ const L = Ze(s);
843
+ O.draft = L, w?.adopt(L), k(O, { dirty: L !== O.base.text, generation: O.value.generation + 1 });
871
844
  },
872
- close: (l) => {
873
- if (!i.has(l)) return;
874
- const s = m.get(l), v = s === void 0 ? null : s.returnPoint();
875
- A(l), v === null ? a.delete(l) : a.set(l, v), c.emit();
845
+ close: (a) => {
846
+ if (!i.has(a)) return;
847
+ const s = m.get(a), w = s === void 0 ? null : s.returnPoint();
848
+ N(a), w === null ? l.delete(a) : l.set(a, w), d.emit();
876
849
  },
877
- takeReturn: (l) => {
878
- const s = a.get(l) ?? null;
879
- return a.delete(l), s;
850
+ takeReturn: (a) => {
851
+ const s = l.get(a) ?? null;
852
+ return l.delete(a), s;
880
853
  },
881
- dirtyPaths: () => [...i.values()].filter((l) => l.value.dirty).map((l) => l.value.path),
882
- discard: (l) => {
883
- for (const s of l) A(s);
884
- l.length > 0 && c.emit();
854
+ dirtyPaths: () => [...i.values()].filter((a) => a.value.dirty).map((a) => a.value.path),
855
+ discard: (a) => {
856
+ for (const s of a) N(s);
857
+ a.length > 0 && d.emit();
885
858
  },
886
859
  editorState: {
887
- get: (l) => u.get(l),
888
- set: (l, s) => {
889
- i.has(l) && u.set(l, s);
860
+ get: (a) => u.get(a),
861
+ set: (a, s) => {
862
+ i.has(a) && u.set(a, s);
890
863
  }
891
864
  },
892
- bindEditor: (l, s) => L(m, l, s),
893
- bindView: (l, s) => L(f, l, s),
894
- viewAnchor: (l) => {
895
- const s = f.get(l);
865
+ bindEditor: (a, s) => M(m, a, s),
866
+ bindView: (a, s) => M(f, a, s),
867
+ viewAnchor: (a) => {
868
+ const s = f.get(a);
896
869
  return s === void 0 ? null : s.anchor();
897
870
  },
898
- flush: (l) => m.get(l)?.flush(),
871
+ flush: (a) => m.get(a)?.flush(),
899
872
  flushDrafts: () => {
900
- for (const l of m.values()) l.flush();
873
+ for (const a of m.values()) a.flush();
901
874
  },
902
- nextConflict: (l) => m.get(l)?.nextConflict() === !0,
875
+ nextConflict: (a) => m.get(a)?.nextConflict() === !0,
903
876
  hasSessions: () => i.size > 0,
904
- unsavedAmong: (l) => {
877
+ unsavedAmong: (a) => {
905
878
  for (const s of m.values()) s.flush();
906
- return l.filter((s) => i.get(s)?.value.dirty === !0);
879
+ return a.filter((s) => i.get(s)?.value.dirty === !0);
907
880
  },
908
- askToDiscard: (l) => new Promise((s) => {
881
+ askToDiscard: (a) => new Promise((s) => {
909
882
  E?.settle(!1);
910
- const v = {
911
- paths: l,
883
+ const w = {
884
+ paths: a,
912
885
  settle: (O) => {
913
- if (E === v) {
914
- if (E = null, O) for (const M of l) A(M);
915
- c.emit(), s(O);
886
+ if (E === w) {
887
+ if (E = null, O) for (const L of a) N(L);
888
+ d.emit(), s(O);
916
889
  }
917
890
  }
918
891
  };
919
- E = v, c.emit();
892
+ E = w, d.emit();
920
893
  }),
921
894
  discardRequest: () => E,
922
895
  sideBySide: () => (h ??= r.read(), h),
923
- setSideBySide: (l) => {
924
- h !== l && (h = l, r.write(l), c.emit());
896
+ setSideBySide: (a) => {
897
+ h !== a && (h = a, r.write(a), d.emit());
925
898
  },
926
- editorShare: () => (g ??= o.read() ?? Un, g),
927
- setEditorShare: (l) => {
928
- if (!Number.isFinite(l)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(l)}`);
929
- const s = Math.min(on, Math.max(an, l));
930
- g !== s && (g = s, o.write(s));
899
+ editorShare: () => (v ??= o.read() ?? Qn, v),
900
+ setEditorShare: (a) => {
901
+ if (!Number.isFinite(a)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(a)}`);
902
+ const s = Math.min(dn, Math.max(un, a));
903
+ v !== s && (v = s, o.write(s));
931
904
  },
932
- setView: (l, s) => {
933
- const v = i.get(l);
934
- v === void 0 || v.value.view === s || (m.get(l)?.beforeView(s), k(v, { view: s, previewPrepared: v.value.previewPrepared || s === "preview" }));
905
+ setView: (a, s) => {
906
+ const w = i.get(a);
907
+ w === void 0 || w.value.view === s || (m.get(a)?.beforeView(s), k(w, { view: s, previewPrepared: w.value.previewPrepared || s === "preview" }));
935
908
  },
936
- preparePreview: (l) => {
937
- const s = i.get(l);
909
+ preparePreview: (a) => {
910
+ const s = i.get(a);
938
911
  s !== void 0 && !s.value.previewPrepared && k(s, { previewPrepared: !0 });
939
912
  }
940
913
  };
941
- }, hn = (e) => {
914
+ }, yn = (e) => {
942
915
  e.preventDefault(), e.stopPropagation();
943
- }, Zr = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, pn = "data-aqmx-content-pane", et = Object.freeze({ [pn]: "" }), Ur = "--aqmx-dialog-left", Gr = "--aqmx-dialog-top", Wr = '[data-testid="markdown-explorer"]', Kr = (e) => {
944
- const t = e.closest(Wr)?.querySelectorAll(`[${pn}]`), n = t?.item(t.length - 1);
916
+ }, Jr = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, Sn = "data-aqmx-content-pane", tt = Object.freeze({ [Sn]: "" }), Qr = "--aqmx-dialog-left", eo = "--aqmx-dialog-top", to = '[data-testid="markdown-explorer"]', no = (e) => {
917
+ const t = e.closest(to)?.querySelectorAll(`[${Sn}]`), n = t?.item(t.length - 1);
945
918
  if (!(n instanceof HTMLElement)) throw new Error("[markdown-explorer] a dialog opened where the explorer marks no content pane");
946
919
  return n;
947
- }, Xr = (e) => {
948
- const t = Zr(getComputedStyle(e).marginTop);
920
+ }, ro = (e) => {
921
+ const t = Jr(getComputedStyle(e).marginTop);
949
922
  if (Number.isNaN(t)) return null;
950
- const n = Kr(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top: a } = Gn(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
951
- return e.style.setProperty(Ur, `${String(i)}px`), e.style.setProperty(Gr, `${String(a)}px`), n;
952
- }, Yr = (e) => e.preventDefault(), vn = ({ open: e, onOpen: t, onDismiss: n }) => {
953
- const r = _(null), o = _(null), i = _(!1), a = _(t);
954
- j(() => {
955
- a.current = t;
956
- }, [t]), j(() => {
923
+ const n = no(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top: l } = er(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
924
+ return e.style.setProperty(Qr, `${String(i)}px`), e.style.setProperty(eo, `${String(l)}px`), n;
925
+ }, oo = (e) => e.preventDefault(), xn = ({ open: e, onOpen: t, onDismiss: n }) => {
926
+ const r = q(null), o = q(null), i = q(!1), l = q(t);
927
+ V(() => {
928
+ l.current = t;
929
+ }, [t]), V(() => {
957
930
  i.current = e;
958
- const c = r.current;
959
- if (c !== null)
960
- if (e && !c.open) {
961
- const h = c.ownerDocument.activeElement;
962
- o.current = h instanceof HTMLElement ? h : null, c.showModal(), a.current?.();
963
- } else !e && c.open && (c.close(), o.current?.isConnected === !0 && o.current.focus(), o.current = null);
964
- }, [e]), j(() => {
965
- const c = r.current;
966
- if (!e || c === null) return;
931
+ const d = r.current;
932
+ if (d !== null)
933
+ if (e && !d.open) {
934
+ const h = d.ownerDocument.activeElement;
935
+ o.current = h instanceof HTMLElement ? h : null, d.showModal(), l.current?.();
936
+ } else !e && d.open && (d.close(), o.current?.isConnected === !0 && o.current.focus(), o.current = null);
937
+ }, [e]), V(() => {
938
+ const d = r.current;
939
+ if (!e || d === null) return;
967
940
  const h = new ResizeObserver(() => E());
968
- let g = null;
941
+ let v = null;
969
942
  const E = () => {
970
- const R = Xr(c);
971
- R === null || R === g || (g !== null && h.unobserve(g), h.observe(R), g = R);
943
+ const R = ro(d);
944
+ R === null || R === v || (v !== null && h.unobserve(v), h.observe(R), v = R);
972
945
  };
973
- E(), h.observe(c);
974
- const k = c.ownerDocument.defaultView;
975
- return k?.addEventListener("resize", E), c.ownerDocument.addEventListener("scroll", E, { capture: !0, passive: !0 }), () => {
976
- h.disconnect(), k?.removeEventListener("resize", E), c.ownerDocument.removeEventListener("scroll", E, { capture: !0 });
946
+ E(), h.observe(d);
947
+ const k = d.ownerDocument.defaultView;
948
+ return k?.addEventListener("resize", E), d.ownerDocument.addEventListener("scroll", E, { capture: !0, passive: !0 }), () => {
949
+ h.disconnect(), k?.removeEventListener("resize", E), d.ownerDocument.removeEventListener("scroll", E, { capture: !0 });
977
950
  };
978
951
  }, [e]);
979
952
  const u = P(
980
- (c) => {
981
- c.key !== "Escape" || c.defaultPrevented || (hn(c), n());
953
+ (d) => {
954
+ d.key !== "Escape" || d.defaultPrevented || (yn(d), n());
982
955
  },
983
956
  [n]
984
957
  ), m = P(
985
- (c) => {
986
- c.target === c.currentTarget && n();
958
+ (d) => {
959
+ d.target === d.currentTarget && n();
987
960
  },
988
961
  [n]
989
962
  ), f = P(() => {
990
963
  i.current && n();
991
964
  }, [n]);
992
- return { ref: r, onKeyDown: u, onClick: m, onCancel: Yr, onClose: f };
993
- }, wn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: a, testId: u }) => {
994
- const m = _(null), f = xe(), c = xe(), h = P(() => m.current?.focus(), []), g = vn({ open: e, onOpen: h, onDismiss: a });
995
- return /* @__PURE__ */ d("dialog", { ...g, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": c, "data-testid": u, children: /* @__PURE__ */ $("div", { className: "aqmx-confirm-panel", children: [
996
- /* @__PURE__ */ d("p", { id: f, className: "aqmx-confirm-title", children: t }),
997
- /* @__PURE__ */ d("p", { id: c, className: "aqmx-confirm-body", children: n }),
998
- /* @__PURE__ */ $("div", { className: "aqmx-confirm-actions", children: [
999
- /* @__PURE__ */ d("button", { ref: m, type: "button", className: "aqmx-callout-action", "data-testid": `${u}-cancel`, onClick: a, children: o }),
1000
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
965
+ return { ref: r, onKeyDown: u, onClick: m, onCancel: oo, onClose: f };
966
+ }, kn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: l, testId: u }) => {
967
+ const m = q(null), f = xe(), d = xe(), h = P(() => m.current?.focus(), []), v = xn({ open: e, onOpen: h, onDismiss: l });
968
+ return /* @__PURE__ */ c("dialog", { ...v, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": d, "data-testid": u, children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
969
+ /* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: t }),
970
+ /* @__PURE__ */ c("p", { id: d, className: "aqmx-confirm-body", children: n }),
971
+ /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
972
+ /* @__PURE__ */ c("button", { ref: m, type: "button", className: "aqmx-callout-action", "data-testid": `${u}-cancel`, onClick: l, children: o }),
973
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
1001
974
  ] })
1002
975
  ] }) });
1003
976
  }, Te = (e) => {
@@ -1010,31 +983,31 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
1010
983
  t.status = "rejected", t.reason = n;
1011
984
  }
1012
985
  )), t;
1013
- }, gn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, Jr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Qr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), eo = (e, t, n) => {
986
+ }, Tn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, io = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), lo = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), ao = (e, t, n) => {
1014
987
  const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
1015
988
  for (let i = o.pop(); i !== void 0; i = o.pop()) {
1016
989
  if (i.type !== "directory" || r.has(i.path)) continue;
1017
990
  r.add(i.path);
1018
- const a = i.lazy === !0 ? n(i.path) : void 0, u = i.lazy === !0 ? a?.status === "loaded" ? a.entries : null : i.children === void 0 ? [] : i.children;
991
+ const l = i.lazy === !0 ? n(i.path) : void 0, u = i.lazy === !0 ? l?.status === "loaded" ? l.entries : null : i.children === void 0 ? [] : i.children;
1019
992
  if (i.path === t) return u;
1020
993
  if (u !== null) for (const m of [...u].reverse()) o.push(m);
1021
994
  }
1022
995
  return null;
1023
- }, to = (e, t, n) => {
996
+ }, so = (e, t, n) => {
1024
997
  const r = Ee(e.read(t));
1025
- if (r === void 0 || r.status === "deferred") return Jr;
998
+ if (r === void 0 || r.status === "deferred") return io;
1026
999
  if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
1027
- const o = eo(r.entries, n, (a) => e.children(t, a));
1028
- if (o !== null) return { readme: { status: "ok", readme: wt(o) }, claim: !1 };
1000
+ const o = ao(r.entries, n, (l) => e.children(t, l));
1001
+ if (o !== null) return { readme: { status: "ok", readme: Et(o) }, claim: !1 };
1029
1002
  const i = e.children(t, n);
1030
- return i === void 0 || i.status === "loading" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: wt(i.entries) }, claim: !0 };
1031
- }, no = (e, t, n) => {
1032
- const { readme: r } = to(e, t, n);
1003
+ return i === void 0 || i.status === "loading" ? lo : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: Et(i.entries) }, claim: !0 };
1004
+ }, co = (e, t, n) => {
1005
+ const { readme: r } = so(e, t, n);
1033
1006
  return r.status === "ok" ? r.readme : null;
1034
- }, ro = (e, t, n) => {
1035
- const r = Bn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
1007
+ }, uo = (e, t, n) => {
1008
+ const r = Gn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
1036
1009
  if (r === null) return /* @__PURE__ */ new Set();
1037
- const { location: o } = rn(e, r.params["*"], new URLSearchParams(t.search));
1010
+ const { location: o } = cn(e, r.params["*"], new URLSearchParams(t.search));
1038
1011
  switch (o.view) {
1039
1012
  case "tree": {
1040
1013
  const i = o.folder === null ? o.doc : n(o.source, o.folder);
@@ -1045,24 +1018,24 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
1045
1018
  case "multi":
1046
1019
  return new Set(o.docs);
1047
1020
  }
1048
- }, bn = (e) => {
1021
+ }, Rn = (e) => {
1049
1022
  const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
1050
- return ee(t.subscribe, n, oo);
1051
- }, En = () => !1, oo = () => {
1052
- }, io = () => {
1023
+ return ee(t.subscribe, n, fo);
1024
+ }, On = () => !1, fo = () => {
1025
+ }, mo = () => {
1053
1026
  const { edits: e } = D();
1054
- return ee(e.subscribe, e.hasSessions, En);
1055
- }, ao = () => {
1027
+ return ee(e.subscribe, e.hasSessions, On);
1028
+ }, ho = () => {
1056
1029
  const { edits: e } = D();
1057
- return ee(e.subscribe, e.sideBySide, En);
1058
- }, lo = () => null, so = () => {
1059
- const { edits: e, labels: t, config: n, trees: r } = D(), o = _([]), i = P(
1030
+ return ee(e.subscribe, e.sideBySide, On);
1031
+ }, po = () => null, vo = () => {
1032
+ const { edits: e, labels: t, config: n, trees: r } = D(), o = q([]), i = P(
1060
1033
  ({ nextLocation: E }) => {
1061
- const k = ro(n, E, (R, T) => no(r, R, T));
1034
+ const k = uo(n, E, (R, T) => co(r, R, T));
1062
1035
  return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !k.has(R)), o.current.length > 0;
1063
1036
  },
1064
1037
  [e, n, r]
1065
- ), a = zn(i), u = io();
1038
+ ), l = Kn(i), u = mo();
1066
1039
  te(() => {
1067
1040
  if (!u) return;
1068
1041
  const E = (k) => {
@@ -1070,26 +1043,26 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
1070
1043
  };
1071
1044
  return window.addEventListener("beforeunload", E), () => window.removeEventListener("beforeunload", E);
1072
1045
  }, [u, e]);
1073
- const m = ee(e.subscribe, e.discardRequest, lo), f = a.state === "blocked", c = f ? o.current : m === null ? [] : m.paths, h = c.map((E) => se(E)).join(", "), g = c.length > 0 && c.every((E) => e.session(E)?.save.kind === "draft");
1074
- return /* @__PURE__ */ d(
1075
- wn,
1046
+ const m = ee(e.subscribe, e.discardRequest, po), f = l.state === "blocked", d = f ? o.current : m === null ? [] : m.paths, h = d.map((E) => se(E)).join(", "), v = d.length > 0 && d.every((E) => e.session(E)?.save.kind === "draft");
1047
+ return /* @__PURE__ */ c(
1048
+ kn,
1076
1049
  {
1077
1050
  open: f || m !== null,
1078
- title: g ? t.draftDiscardTitle : t.unsavedTitle,
1079
- body: g ? t.draftDiscardBody(h) : t.unsavedBody(h),
1051
+ title: v ? t.draftDiscardTitle : t.unsavedTitle,
1052
+ body: v ? t.draftDiscardBody(h) : t.unsavedBody(h),
1080
1053
  confirmLabel: t.unsavedDiscard,
1081
1054
  cancelLabel: t.unsavedStay,
1082
1055
  testId: "markdown-explorer-unsaved-guard",
1083
1056
  onConfirm: () => {
1084
- if (a.state === "blocked") {
1085
- e.discard(o.current), a.proceed();
1057
+ if (l.state === "blocked") {
1058
+ e.discard(o.current), l.proceed();
1086
1059
  return;
1087
1060
  }
1088
1061
  m?.settle(!0);
1089
1062
  },
1090
1063
  onCancel: () => {
1091
- if (a.state === "blocked") {
1092
- a.reset();
1064
+ if (l.state === "blocked") {
1065
+ l.reset();
1093
1066
  return;
1094
1067
  }
1095
1068
  m?.settle(!1);
@@ -1097,12 +1070,12 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
1097
1070
  }
1098
1071
  );
1099
1072
  };
1100
- function co({
1073
+ function go({
1101
1074
  title: e,
1102
1075
  titleId: t,
1103
1076
  ...n
1104
1077
  }, r) {
1105
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1078
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1106
1079
  xmlns: "http://www.w3.org/2000/svg",
1107
1080
  viewBox: "0 0 20 20",
1108
1081
  fill: "currentColor",
@@ -1110,26 +1083,26 @@ function co({
1110
1083
  "data-slot": "icon",
1111
1084
  ref: r,
1112
1085
  "aria-labelledby": t
1113
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1086
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1114
1087
  id: t
1115
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1088
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1116
1089
  fillRule: "evenodd",
1117
1090
  d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
1118
1091
  clipRule: "evenodd"
1119
1092
  }));
1120
1093
  }
1121
- const uo = /* @__PURE__ */ y.forwardRef(co);
1122
- let Ge = null;
1123
- const Sn = () => (Ge ??= import("./EditSurface-rKoy_ndP.js").catch((e) => {
1124
- throw Ge = null, e;
1125
- }), Ge), fo = () => {
1126
- Sn().catch(() => {
1094
+ const wo = /* @__PURE__ */ S.forwardRef(go);
1095
+ let Ke = null;
1096
+ const Cn = () => (Ke ??= import("./EditSurface-Dhvw9IDD.js").catch((e) => {
1097
+ throw Ke = null, e;
1098
+ }), Ke), bo = () => {
1099
+ Cn().catch(() => {
1127
1100
  });
1128
- }, mo = (e) => {
1129
- const { default: t } = re(Sn());
1130
- return /* @__PURE__ */ d(t, { ...e });
1101
+ }, Eo = (e) => {
1102
+ const { default: t } = ne(Cn());
1103
+ return /* @__PURE__ */ c(t, { ...e });
1131
1104
  };
1132
- class ho extends tn {
1105
+ class yo extends an {
1133
1106
  state = { failed: !1 };
1134
1107
  static getDerivedStateFromError() {
1135
1108
  return { failed: !0 };
@@ -1139,110 +1112,110 @@ class ho extends tn {
1139
1112
  return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
1140
1113
  }
1141
1114
  }
1142
- const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen]', wo = 200, Re = (e) => Er(e.getAttribute(sn)), go = (e, t) => {
1115
+ const ct = `[${mn}]`, So = "[data-aqmd-content]", xo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen], [data-aqmd-svg-image-source]', ko = 200, Re = (e) => Or(e.getAttribute(mn)), To = (e, t) => {
1143
1116
  for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
1144
1117
  const o = Re(r);
1145
1118
  if (o !== null) return { block: r, lines: o, own: !0 };
1146
1119
  }
1147
1120
  let n = null;
1148
- for (const r of t.querySelectorAll(lt)) {
1121
+ for (const r of t.querySelectorAll(ct)) {
1149
1122
  if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
1150
1123
  const o = Re(r);
1151
1124
  o !== null && (n = { block: r, lines: o });
1152
1125
  }
1153
1126
  return n === null ? null : { ...n, own: !1 };
1154
- }, bo = (e, t) => {
1127
+ }, Ro = (e, t) => {
1155
1128
  let n = 0;
1156
1129
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
1157
1130
  return n;
1158
- }, Eo = (e) => e.closest(po) !== null && e.closest(vo) === null, So = (e, t, n) => {
1159
- const r = go(e, t);
1131
+ }, Oo = (e) => e.closest(So) !== null && e.closest(xo) === null, Co = (e, t, n) => {
1132
+ const r = To(e, t);
1160
1133
  if (r === null) return null;
1161
1134
  const { block: o, own: i } = r;
1162
1135
  if (!i) {
1163
1136
  const u = r.lines.last + 1;
1164
- return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: Ne(e) };
1137
+ return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: De(e) };
1165
1138
  }
1166
- const a = To(o, n);
1167
- return a === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Ne(o) } : { lines: r.lines, word: a.text, occurrence: a.occurrence, clientTop: a.clientTop };
1168
- }, yo = (e, t) => {
1139
+ const l = No(o, n);
1140
+ return l === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: De(o) } : { lines: r.lines, word: l.text, occurrence: l.occurrence, clientTop: l.clientTop };
1141
+ }, Mo = (e, t) => {
1169
1142
  let n = null, r = null, o = null;
1170
- for (const a of e.querySelectorAll(lt)) {
1171
- const u = Re(a);
1143
+ for (const l of e.querySelectorAll(ct)) {
1144
+ const u = Re(l);
1172
1145
  if (u === null) continue;
1173
- n ??= ko(t, a);
1174
- const { top: m, bottom: f } = a.getBoundingClientRect();
1175
- m <= n && n < f ? r = { lines: u, block: a } : o === null && m >= n && (o = { lines: u, block: a });
1146
+ n ??= Ao(t, l);
1147
+ const { top: m, bottom: f } = l.getBoundingClientRect();
1148
+ m <= n && n < f ? r = { lines: u, block: l } : o === null && m >= n && (o = { lines: u, block: l });
1176
1149
  }
1177
1150
  const i = r === null ? o : r;
1178
- return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop: Ne(i.block) };
1179
- }, xo = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ko = (e, t) => {
1151
+ return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop: De(i.block) };
1152
+ }, Lo = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Ao = (e, t) => {
1180
1153
  const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
1181
- return xo(e) + (Number.isFinite(n) ? n : 0);
1182
- }, To = (e, t) => {
1154
+ return Lo(e) + (Number.isFinite(n) ? n : 0);
1155
+ }, No = (e, t) => {
1183
1156
  if (t === null || t.rangeCount === 0) return null;
1184
1157
  const n = t.getRangeAt(0);
1185
1158
  if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
1186
1159
  const r = n.toString().trim();
1187
- if (r === "" || r.length > wo || /[\r\n]/u.test(r)) return null;
1160
+ if (r === "" || r.length > ko || /[\r\n]/u.test(r)) return null;
1188
1161
  const o = e.ownerDocument.createRange();
1189
- return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: bo(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1190
- }, Xl = (e, t) => {
1162
+ return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: Ro(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1163
+ }, is = (e, t) => {
1191
1164
  const n = e.split(`
1192
1165
  `), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
1193
1166
  if (t.word === null) return i;
1194
- let a = 0;
1167
+ let l = 0;
1195
1168
  for (let u = r; u <= o; u += 1) {
1196
1169
  const m = n[u - 1] ?? "";
1197
1170
  for (let f = m.indexOf(t.word); f >= 0; f = m.indexOf(t.word, f + t.word.length)) {
1198
- if (a === t.occurrence) return { line: u, column: f };
1199
- a += 1;
1171
+ if (l === t.occurrence) return { line: u, column: f };
1172
+ l += 1;
1200
1173
  }
1201
1174
  }
1202
- return a > 0 ? Ro(n, r, o, t.word) ?? i : i;
1203
- }, Ro = (e, t, n, r) => {
1175
+ return l > 0 ? Do(n, r, o, t.word) ?? i : i;
1176
+ }, Do = (e, t, n, r) => {
1204
1177
  for (let o = n; o >= t; o -= 1) {
1205
1178
  const i = (e[o - 1] ?? "").lastIndexOf(r);
1206
1179
  if (i >= 0) return { line: o, column: i };
1207
1180
  }
1208
1181
  return null;
1209
- }, Oo = (e, t) => {
1182
+ }, Po = (e, t) => {
1210
1183
  let n = null, r = null;
1211
- for (const o of e.querySelectorAll(lt)) {
1184
+ for (const o of e.querySelectorAll(ct)) {
1212
1185
  const i = Re(o);
1213
1186
  i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
1214
1187
  }
1215
1188
  return n !== null ? n : r === null ? null : r.element;
1216
- }, Co = (e, t) => {
1217
- const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o = Re(e);
1189
+ }, $o = (e, t) => {
1190
+ const { bottom: n } = e.getBoundingClientRect(), r = De(e), o = Re(e);
1218
1191
  if (o === null) return r;
1219
1192
  const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
1220
1193
  return r + (n - r) * i;
1221
- }, Ne = (e) => {
1194
+ }, De = (e) => {
1222
1195
  const t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
1223
1196
  for (let n = t.nextNode(); n !== null; n = t.nextNode()) {
1224
1197
  const o = (n.textContent ?? "").search(/\S/u);
1225
1198
  if (o < 0) continue;
1226
1199
  const i = e.ownerDocument.createRange();
1227
1200
  i.setStart(n, o), i.setEnd(n, o + 1);
1228
- const { top: a, height: u } = i.getBoundingClientRect();
1229
- if (u > 0) return a;
1201
+ const { top: l, height: u } = i.getBoundingClientRect();
1202
+ if (u > 0) return l;
1230
1203
  }
1231
1204
  return e.getBoundingClientRect().top;
1232
- }, st = Object.freeze({
1205
+ }, dt = Object.freeze({
1233
1206
  browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1234
1207
  "switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1235
1208
  "switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
1236
1209
  "follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
1237
- }), Yl = (e) => st[e], $e = () => {
1238
- const e = jn();
1210
+ }), ls = (e) => dt[e], Ie = () => {
1211
+ const e = Wn();
1239
1212
  return P(
1240
1213
  (t, n) => {
1241
- e(t, st[n]);
1214
+ e(t, dt[n]);
1242
1215
  },
1243
1216
  [e]
1244
1217
  );
1245
- }, Mo = ({ navigation: e, ...t }) => /* @__PURE__ */ d(Hn, { ...t, ...st[e] }), yn = (e) => {
1218
+ }, Fo = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Yn, { ...t, ...dt[e] }), Mn = (e) => {
1246
1219
  const t = e.ownerDocument;
1247
1220
  if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
1248
1221
  if (e.hasAttribute("tabindex")) return !1;
@@ -1252,43 +1225,43 @@ const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1252
1225
  t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
1253
1226
  };
1254
1227
  return e.addEventListener("blur", n), !0;
1255
- }, Ao = (e, t) => {
1256
- const n = _(null), r = _(null), o = _(null), i = P(() => {
1228
+ }, Io = (e, t) => {
1229
+ const n = q(null), r = q(null), o = q(null), i = P(() => {
1257
1230
  n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
1258
1231
  }, []);
1259
1232
  te(() => i, [i]);
1260
- const a = P(
1233
+ const l = P(
1261
1234
  (f) => {
1262
1235
  if (r.current !== f) return;
1263
- const c = o.current;
1264
- if (c !== null) {
1265
- c.then(() => a(f));
1236
+ const d = o.current;
1237
+ if (d !== null) {
1238
+ d.then(() => l(f));
1266
1239
  return;
1267
1240
  }
1268
1241
  e.prefetch(f);
1269
1242
  const h = e.peek(f);
1270
1243
  if (h?.status !== "pending") return;
1271
- const g = Promise.allSettled([h.promise]);
1272
- o.current = g, g.then(() => {
1273
- o.current === g && (o.current = null);
1244
+ const v = Promise.allSettled([h.promise]);
1245
+ o.current = v, v.then(() => {
1246
+ o.current === v && (o.current = null);
1274
1247
  });
1275
1248
  },
1276
1249
  [e]
1277
1250
  ), u = P(
1278
1251
  (f) => {
1279
- const c = t(f);
1280
- c !== r.current && (i(), c !== null && (r.current = c, n.current = window.setTimeout(() => {
1281
- n.current = null, a(c);
1282
- }, Wn)));
1252
+ const d = t(f);
1253
+ d !== r.current && (i(), d !== null && (r.current = d, n.current = window.setTimeout(() => {
1254
+ n.current = null, l(d);
1255
+ }, tr)));
1283
1256
  },
1284
- [i, t, a]
1257
+ [i, t, l]
1285
1258
  ), m = P(
1286
1259
  (f) => {
1287
1260
  t(f) !== r.current && i();
1288
1261
  },
1289
1262
  [i, t]
1290
1263
  );
1291
- return U(
1264
+ return H(
1292
1265
  () => ({
1293
1266
  onPointerOver: (f) => u(f.target),
1294
1267
  onPointerOut: (f) => m(f.relatedTarget),
@@ -1297,8 +1270,8 @@ const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1297
1270
  }),
1298
1271
  [u, m]
1299
1272
  );
1300
- }, Lo = it(() => import("./NativeScrollBar-0cpp2OIu.js").then((e) => ({ default: e.NativeScrollBar })));
1301
- class No extends tn {
1273
+ }, qo = lt(() => import("./NativeScrollBar-TsIcS3JZ.js").then((e) => ({ default: e.NativeScrollBar })));
1274
+ class _o extends an {
1302
1275
  state = { failed: !1 };
1303
1276
  static getDerivedStateFromError() {
1304
1277
  return { failed: !0 };
@@ -1310,7 +1283,7 @@ class No extends tn {
1310
1283
  return this.state.failed ? null : this.props.children;
1311
1284
  }
1312
1285
  }
1313
- const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children: /* @__PURE__ */ d(ke, { fallback: null, children: /* @__PURE__ */ d(Lo, { scroller: e, withCircle: t }) }) }), xn = (e) => /* @__PURE__ */ d(Do, { scroller: e, withCircle: !0 }), kn = () => {
1286
+ const Bo = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(_o, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(qo, { scroller: e, withCircle: t }) }) }), Ln = (e) => /* @__PURE__ */ c(Bo, { scroller: e, withCircle: !0 }), An = () => {
1314
1287
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
1315
1288
  let n = !1;
1316
1289
  const r = (o) => {
@@ -1325,9 +1298,9 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
1325
1298
  return () => {
1326
1299
  if (i) return;
1327
1300
  i = !0;
1328
- const a = e.get(o);
1329
- if (a !== void 0 && a > 1) {
1330
- e.set(o, a - 1);
1301
+ const l = e.get(o);
1302
+ if (l !== void 0 && l > 1) {
1303
+ e.set(o, l - 1);
1331
1304
  return;
1332
1305
  }
1333
1306
  e.delete(o), r(o);
@@ -1337,52 +1310,52 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
1337
1310
  resumes: (o) => t.delete(o),
1338
1311
  heldKeys: () => [...e.keys()]
1339
1312
  };
1340
- }, De = (e, t) => {
1313
+ }, Pe = (e, t) => {
1341
1314
  if (Object.is(e, t)) return !0;
1342
1315
  if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
1343
1316
  if (Array.isArray(e) || Array.isArray(t))
1344
- return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, a) => De(i, t[a]));
1317
+ return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, l) => Pe(i, t[l]));
1345
1318
  const n = e, r = t, o = Object.keys(n);
1346
- return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && De(n[i], r[i]));
1347
- }, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Tn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Fo = ({ client: e, capacity: t }) => {
1319
+ return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && Pe(n[i], r[i]));
1320
+ }, jo = 55e3, Ft = Object.freeze({ status: "deferred" }), It = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Nn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", zo = ({ client: e, capacity: t }) => {
1348
1321
  if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
1349
- const n = /* @__PURE__ */ new Map(), r = kn(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
1350
- let a = 0;
1351
- const u = o.emit, m = () => (a += 1, a), f = () => {
1322
+ const n = /* @__PURE__ */ new Map(), r = An(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
1323
+ let l = 0;
1324
+ const u = o.emit, m = () => (l += 1, l), f = () => {
1352
1325
  if (!(n.size <= t))
1353
1326
  for (const b of [...n.keys()]) {
1354
1327
  if (n.size <= t) return;
1355
1328
  r.isHeld(b) || n.delete(b);
1356
1329
  }
1357
- }, c = (b, w) => {
1358
- n.delete(b), n.set(b, w);
1359
- }, h = (b) => performance.now() - b.validatedAt >= Po, g = (b, w, l) => {
1360
- const s = n.get(b), v = ue(s?.snapshot), O = l || s?.refreshPending === !0, M = Te(e.document(b, { refresh: O }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: M, previous: v }, validatedAt: performance.now(), opened: w, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
1361
- return c(b, N), f(), M.then((q) => {
1362
- n.get(b) === N && (N.snapshot = q, N.stamp = m(), u());
1363
- }), N;
1364
- }, E = (b, w, l, s, v, O) => {
1365
- w.background === l && (w.background = null, !(n.get(b) !== w || w.snapshot !== s) && (v.kind === "failure" && s.document.kind !== "failure" || (w.validatedAt = O, w.stamp = m(), De(s.document, v) || (w.snapshot = { status: "loaded", document: v }), u())));
1366
- }, k = async (b, w) => {
1367
- const l = w.snapshot;
1368
- if (l.status !== "loaded") return null;
1330
+ }, d = (b, g) => {
1331
+ n.delete(b), n.set(b, g);
1332
+ }, h = (b) => performance.now() - b.validatedAt >= jo, v = (b, g, a) => {
1333
+ const s = n.get(b), w = ue(s?.snapshot), O = a || s?.refreshPending === !0, L = Te(e.document(b, { refresh: O }).then((I) => ({ status: "loaded", document: I }))), A = { snapshot: { status: "pending", promise: L, previous: w }, validatedAt: performance.now(), opened: g, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
1334
+ return d(b, A), f(), L.then((I) => {
1335
+ n.get(b) === A && (A.snapshot = I, A.stamp = m(), u());
1336
+ }), A;
1337
+ }, E = (b, g, a, s, w, O) => {
1338
+ g.background === a && (g.background = null, !(n.get(b) !== g || g.snapshot !== s) && (w.kind === "failure" && s.document.kind !== "failure" || (g.validatedAt = O, g.stamp = m(), Pe(s.document, w) || (g.snapshot = { status: "loaded", document: w }), u())));
1339
+ }, k = async (b, g) => {
1340
+ const a = g.snapshot;
1341
+ if (a.status !== "loaded") return null;
1369
1342
  const s = {};
1370
- w.background = s;
1371
- const v = performance.now(), O = e.document(b, { refresh: w.refreshPending });
1372
- w.refreshPending = !1;
1373
- const M = await O, N = w.background === s && n.get(b) === w && w.snapshot === l;
1374
- return E(b, w, s, l, M, v), N ? M : null;
1375
- }, R = (b, w) => {
1376
- const { snapshot: l } = w;
1377
- return l.status === "pending" ? !1 : l.status === "loaded" && l.document.kind !== "failure" ? (k(b, w), !1) : (l.status === "loaded" && i.add(l), g(b, !0, !1), !0);
1343
+ g.background = s;
1344
+ const w = performance.now(), O = e.document(b, { refresh: g.refreshPending });
1345
+ g.refreshPending = !1;
1346
+ const L = await O, A = g.background === s && n.get(b) === g && g.snapshot === a;
1347
+ return E(b, g, s, a, L, w), A ? L : null;
1348
+ }, R = (b, g) => {
1349
+ const { snapshot: a } = g;
1350
+ return a.status === "pending" ? !1 : a.status === "loaded" && a.document.kind !== "failure" ? (k(b, g), !1) : (a.status === "loaded" && i.add(a), v(b, !0, !1), !0);
1378
1351
  }, T = (b) => {
1379
- const w = r.hold(b);
1380
- let l = !1;
1352
+ const g = r.hold(b);
1353
+ let a = !1;
1381
1354
  return () => {
1382
- if (l) return;
1383
- l = !0, w();
1355
+ if (a) return;
1356
+ a = !0, g();
1384
1357
  const s = n.get(b);
1385
- s !== void 0 && c(b, s), f();
1358
+ s !== void 0 && d(b, s), f();
1386
1359
  };
1387
1360
  };
1388
1361
  return {
@@ -1390,85 +1363,85 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
1390
1363
  peekSeeded: (b) => n.get(b)?.seeded,
1391
1364
  answerStampOf: (b) => n.get(b)?.stamp,
1392
1365
  prefetch: (b) => {
1393
- const w = n.get(b);
1394
- w !== void 0 && w.snapshot.status !== "deferred" || (g(b, !1, !1), u());
1366
+ const g = n.get(b);
1367
+ g !== void 0 && g.snapshot.status !== "deferred" || (v(b, !1, !1), u());
1395
1368
  },
1396
1369
  open: (b) => {
1397
- const w = r.resumes(b), l = T(b), s = n.get(b);
1370
+ const g = r.resumes(b), a = T(b), s = n.get(b);
1398
1371
  if (s === void 0 || s.snapshot.status === "deferred")
1399
- return g(b, !0, !1), u(), l;
1400
- if (c(b, s), w) return l;
1401
- const { snapshot: v } = s;
1402
- return v.status === "pending" ? (s.opened = !0, l) : v.document.kind === "failure" ? (s.opened || h(s) ? (i.add(v), g(b, !0, !1), u()) : s.opened = !0, l) : (s.opened = !0, s.background === null && h(s) && k(b, s), l);
1372
+ return v(b, !0, !1), u(), a;
1373
+ if (d(b, s), g) return a;
1374
+ const { snapshot: w } = s;
1375
+ return w.status === "pending" ? (s.opened = !0, a) : w.document.kind === "failure" ? (s.opened || h(s) ? (i.add(w), v(b, !0, !1), u()) : s.opened = !0, a) : (s.opened = !0, s.background === null && h(s) && k(b, s), a);
1403
1376
  },
1404
1377
  retain: T,
1405
1378
  retry: (b) => {
1406
- const w = n.get(b);
1407
- w === void 0 || w.snapshot.status !== "loaded" || w.snapshot.document.kind !== "failure" || (g(b, !0, !1), u());
1379
+ const g = n.get(b);
1380
+ g === void 0 || g.snapshot.status !== "loaded" || g.snapshot.document.kind !== "failure" || (v(b, !0, !1), u());
1408
1381
  },
1409
- seed: (b, w) => {
1410
- const l = performance.now(), s = Te(
1411
- w.then(
1412
- (q) => q === null ? Nt : { status: "loaded", document: q },
1413
- () => Nt
1382
+ seed: (b, g) => {
1383
+ const a = performance.now(), s = Te(
1384
+ g.then(
1385
+ (I) => I === null ? Ft : { status: "loaded", document: I },
1386
+ () => Ft
1414
1387
  )
1415
- ), v = n.get(b);
1416
- if (v !== void 0 && v.snapshot.status === "loaded") {
1417
- const q = v.snapshot, W = {};
1418
- v.background = W, s.then((G) => {
1388
+ ), w = n.get(b);
1389
+ if (w !== void 0 && w.snapshot.status === "loaded") {
1390
+ const I = w.snapshot, K = {};
1391
+ w.background = K, s.then((G) => {
1419
1392
  if (G.status === "loaded") {
1420
- E(b, v, W, q, G.document, l);
1393
+ E(b, w, K, I, G.document, a);
1421
1394
  return;
1422
1395
  }
1423
- v.background === W && (v.background = null);
1396
+ w.background === K && (w.background = null);
1424
1397
  });
1425
1398
  return;
1426
1399
  }
1427
- const O = v !== void 0 && v.snapshot.status === "pending" ? v.snapshot.previous : null, M = { status: "pending", promise: s, previous: O }, N = { snapshot: M, validatedAt: l, opened: v?.opened === !0, background: null, refreshPending: v?.refreshPending === !0, seeded: M, stamp: m() };
1428
- c(b, N), f(), s.then((q) => {
1429
- n.get(b) === N && (q.status === "deferred" && r.isHeld(b) ? g(b, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
1400
+ const O = w !== void 0 && w.snapshot.status === "pending" ? w.snapshot.previous : null, L = { status: "pending", promise: s, previous: O }, A = { snapshot: L, validatedAt: a, opened: w?.opened === !0, background: null, refreshPending: w?.refreshPending === !0, seeded: L, stamp: m() };
1401
+ d(b, A), f(), s.then((I) => {
1402
+ n.get(b) === A && (I.status === "deferred" && r.isHeld(b) ? v(b, A.opened, !1) : (A.snapshot = I, A.stamp = m()), u());
1430
1403
  });
1431
1404
  },
1432
1405
  invalidate: () => {
1433
1406
  let b = !1;
1434
- for (const [w, l] of [...n]) {
1435
- if (l.validatedAt = Number.NEGATIVE_INFINITY, l.opened = !0, l.refreshPending = !0, !r.isHeld(w)) continue;
1436
- const { snapshot: s } = l;
1407
+ for (const [g, a] of [...n]) {
1408
+ if (a.validatedAt = Number.NEGATIVE_INFINITY, a.opened = !0, a.refreshPending = !0, !r.isHeld(g)) continue;
1409
+ const { snapshot: s } = a;
1437
1410
  if (s.status !== "pending") {
1438
- R(w, l) && (b = !0);
1411
+ R(g, a) && (b = !0);
1439
1412
  continue;
1440
1413
  }
1441
1414
  s.promise.then(() => {
1442
- n.get(w) === l && l.refreshPending && r.isHeld(w) && R(w, l) && u();
1415
+ n.get(g) === a && a.refreshPending && r.isHeld(g) && R(g, a) && u();
1443
1416
  });
1444
1417
  }
1445
1418
  b && u();
1446
1419
  },
1447
1420
  refresh: async (b) => {
1448
- const w = n.get(b);
1449
- if (w !== void 0 && Tn(w.snapshot)) {
1450
- w.refreshPending = !0;
1451
- const s = await k(b, w);
1452
- return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : Dt;
1421
+ const g = n.get(b);
1422
+ if (g !== void 0 && Nn(g.snapshot)) {
1423
+ g.refreshPending = !0;
1424
+ const s = await k(b, g);
1425
+ return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : It;
1453
1426
  }
1454
- const l = g(b, !0, !0);
1455
- return u(), l.snapshot.status !== "pending" ? We : (await l.snapshot.promise, n.get(b) === l ? Dt : We);
1427
+ const a = v(b, !0, !0);
1428
+ return u(), a.snapshot.status !== "pending" ? We : (await a.snapshot.promise, n.get(b) === a ? It : We);
1456
1429
  },
1457
1430
  clear: () => {
1458
1431
  n.clear();
1459
- for (const b of r.heldKeys()) g(b, !0, !1);
1432
+ for (const b of r.heldKeys()) v(b, !0, !1);
1460
1433
  u();
1461
1434
  },
1462
1435
  subscribe: o.subscribe,
1463
1436
  noteFailureShown: (b) => i.has(b) ? !1 : (i.add(b), !0)
1464
1437
  };
1465
1438
  };
1466
- function $o({
1439
+ function Vo({
1467
1440
  title: e,
1468
1441
  titleId: t,
1469
1442
  ...n
1470
1443
  }, r) {
1471
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1444
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1472
1445
  xmlns: "http://www.w3.org/2000/svg",
1473
1446
  viewBox: "0 0 20 20",
1474
1447
  fill: "currentColor",
@@ -1476,25 +1449,25 @@ function $o({
1476
1449
  "data-slot": "icon",
1477
1450
  ref: r,
1478
1451
  "aria-labelledby": t
1479
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1452
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1480
1453
  id: t
1481
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1454
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1482
1455
  fillRule: "evenodd",
1483
1456
  d: "M18 5.25a2.25 2.25 0 0 0-2.012-2.238A2.25 2.25 0 0 0 13.75 1h-1.5a2.25 2.25 0 0 0-2.238 2.012c-.875.092-1.6.686-1.884 1.488H11A2.5 2.5 0 0 1 13.5 7v7h2.25A2.25 2.25 0 0 0 18 11.75v-6.5ZM12.25 2.5a.75.75 0 0 0-.75.75v.25h3v-.25a.75.75 0 0 0-.75-.75h-1.5Z",
1484
1457
  clipRule: "evenodd"
1485
- }), /* @__PURE__ */ y.createElement("path", {
1458
+ }), /* @__PURE__ */ S.createElement("path", {
1486
1459
  fillRule: "evenodd",
1487
1460
  d: "M3 6a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm6.874 4.166a.75.75 0 1 0-1.248-.832l-2.493 3.739-.853-.853a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.154-.114l3-4.5Z",
1488
1461
  clipRule: "evenodd"
1489
1462
  }));
1490
1463
  }
1491
- const qo = /* @__PURE__ */ y.forwardRef($o);
1492
- function _o({
1464
+ const Ho = /* @__PURE__ */ S.forwardRef(Vo);
1465
+ function Uo({
1493
1466
  title: e,
1494
1467
  titleId: t,
1495
1468
  ...n
1496
1469
  }, r) {
1497
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1470
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1498
1471
  xmlns: "http://www.w3.org/2000/svg",
1499
1472
  viewBox: "0 0 20 20",
1500
1473
  fill: "currentColor",
@@ -1502,23 +1475,23 @@ function _o({
1502
1475
  "data-slot": "icon",
1503
1476
  ref: r,
1504
1477
  "aria-labelledby": t
1505
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1478
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1506
1479
  id: t
1507
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1480
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1508
1481
  fillRule: "evenodd",
1509
1482
  d: "M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z",
1510
1483
  clipRule: "evenodd"
1511
- }), /* @__PURE__ */ y.createElement("path", {
1484
+ }), /* @__PURE__ */ S.createElement("path", {
1512
1485
  d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
1513
1486
  }));
1514
1487
  }
1515
- const Io = /* @__PURE__ */ y.forwardRef(_o);
1516
- function Bo({
1488
+ const Zo = /* @__PURE__ */ S.forwardRef(Uo);
1489
+ function Go({
1517
1490
  title: e,
1518
1491
  titleId: t,
1519
1492
  ...n
1520
1493
  }, r) {
1521
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1494
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1522
1495
  xmlns: "http://www.w3.org/2000/svg",
1523
1496
  viewBox: "0 0 20 20",
1524
1497
  fill: "currentColor",
@@ -1526,42 +1499,42 @@ function Bo({
1526
1499
  "data-slot": "icon",
1527
1500
  ref: r,
1528
1501
  "aria-labelledby": t
1529
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1502
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1530
1503
  id: t
1531
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1504
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1532
1505
  fillRule: "evenodd",
1533
1506
  d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
1534
1507
  clipRule: "evenodd"
1535
1508
  }));
1536
1509
  }
1537
- const zo = /* @__PURE__ */ y.forwardRef(Bo), jo = 2e3, Pt = Object.freeze({ outcome: "idle" }), Ho = (e) => {
1510
+ const Ko = /* @__PURE__ */ S.forwardRef(Go), Wo = 2e3, qt = Object.freeze({ outcome: "idle" }), Yo = (e) => {
1538
1511
  const t = navigator.clipboard;
1539
1512
  return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
1540
- }, Vo = ({ text: e }) => {
1541
- const { announcer: t, labels: n } = D(), [r, o] = z(Pt);
1513
+ }, Xo = ({ text: e }) => {
1514
+ const { announcer: t, labels: n } = D(), [r, o] = B(qt);
1542
1515
  te(() => {
1543
1516
  if (r.outcome === "idle") return;
1544
- const m = setTimeout(() => o(Pt), jo);
1517
+ const m = setTimeout(() => o(qt), Wo);
1545
1518
  return () => clearTimeout(m);
1546
1519
  }, [r]);
1547
1520
  const i = (m) => {
1548
1521
  o({ outcome: m }), t.announce(m === "copied" ? n.copiedText : n.copyTextFailed);
1549
- }, a = () => {
1550
- Ho(e).then(
1522
+ }, l = () => {
1523
+ Yo(e).then(
1551
1524
  () => i("copied"),
1552
1525
  () => i("failed")
1553
1526
  );
1554
1527
  }, u = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
1555
1528
  return (
1556
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ d(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ d(zo, {}) : /* @__PURE__ */ d(Io, {}) })
1529
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(Ho, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(Ko, {}) : /* @__PURE__ */ c(Zo, {}) })
1557
1530
  );
1558
- }, he = pe("fill"), Zo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => re(he) === "content" ? /* @__PURE__ */ d(xt, { scrollerProps: e, children: t }) : /* @__PURE__ */ d(xt, { scrollerProps: { ...e, style: Zo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: xn, children: t });
1559
- function Uo({
1531
+ }, he = pe("fill"), Jo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => ne(he) === "content" ? /* @__PURE__ */ c(Ot, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(Ot, { scrollerProps: { ...e, style: Jo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Ln, children: t });
1532
+ function Qo({
1560
1533
  title: e,
1561
1534
  titleId: t,
1562
1535
  ...n
1563
1536
  }, r) {
1564
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1537
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1565
1538
  xmlns: "http://www.w3.org/2000/svg",
1566
1539
  viewBox: "0 0 20 20",
1567
1540
  fill: "currentColor",
@@ -1569,21 +1542,21 @@ function Uo({
1569
1542
  "data-slot": "icon",
1570
1543
  ref: r,
1571
1544
  "aria-labelledby": t
1572
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1545
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1573
1546
  id: t
1574
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1547
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1575
1548
  d: "M10.75 2.75a.75.75 0 0 0-1.5 0v8.614L6.295 8.235a.75.75 0 1 0-1.09 1.03l4.25 4.5a.75.75 0 0 0 1.09 0l4.25-4.5a.75.75 0 0 0-1.09-1.03l-2.955 3.129V2.75Z"
1576
- }), /* @__PURE__ */ y.createElement("path", {
1549
+ }), /* @__PURE__ */ S.createElement("path", {
1577
1550
  d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z"
1578
1551
  }));
1579
1552
  }
1580
- const Go = /* @__PURE__ */ y.forwardRef(Uo);
1581
- function Wo({
1553
+ const ei = /* @__PURE__ */ S.forwardRef(Qo);
1554
+ function ti({
1582
1555
  title: e,
1583
1556
  titleId: t,
1584
1557
  ...n
1585
1558
  }, r) {
1586
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1559
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1587
1560
  xmlns: "http://www.w3.org/2000/svg",
1588
1561
  viewBox: "0 0 20 20",
1589
1562
  fill: "currentColor",
@@ -1591,34 +1564,34 @@ function Wo({
1591
1564
  "data-slot": "icon",
1592
1565
  ref: r,
1593
1566
  "aria-labelledby": t
1594
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1567
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1595
1568
  id: t
1596
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1569
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1597
1570
  fillRule: "evenodd",
1598
1571
  d: "M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",
1599
1572
  clipRule: "evenodd"
1600
- }), /* @__PURE__ */ y.createElement("path", {
1573
+ }), /* @__PURE__ */ S.createElement("path", {
1601
1574
  fillRule: "evenodd",
1602
1575
  d: "M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",
1603
1576
  clipRule: "evenodd"
1604
1577
  }));
1605
1578
  }
1606
- const Ko = /* @__PURE__ */ y.forwardRef(Wo), qe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
1579
+ const ni = /* @__PURE__ */ S.forwardRef(ti), qe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
1607
1580
  const { labels: i } = D();
1608
- return /* @__PURE__ */ $("div", { className: "aqmx-document-toolbar", children: [
1609
- /* @__PURE__ */ d("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
1610
- /* @__PURE__ */ d("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1581
+ return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
1582
+ /* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
1583
+ /* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1611
1584
  o,
1612
- /* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ d(Ko, {}) }),
1613
- /* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ d(Go, {}) })
1585
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(ni, {}) }),
1586
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(ei, {}) })
1614
1587
  ] });
1615
1588
  };
1616
- function Xo({
1589
+ function ri({
1617
1590
  title: e,
1618
1591
  titleId: t,
1619
1592
  ...n
1620
1593
  }, r) {
1621
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1594
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1622
1595
  xmlns: "http://www.w3.org/2000/svg",
1623
1596
  viewBox: "0 0 20 20",
1624
1597
  fill: "currentColor",
@@ -1626,53 +1599,53 @@ function Xo({
1626
1599
  "data-slot": "icon",
1627
1600
  ref: r,
1628
1601
  "aria-labelledby": t
1629
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1602
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1630
1603
  id: t
1631
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1604
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1632
1605
  fillRule: "evenodd",
1633
1606
  d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm4.75 6.75a.75.75 0 0 1 1.5 0v2.546l.943-1.048a.75.75 0 0 1 1.114 1.004l-2.25 2.5a.75.75 0 0 1-1.114 0l-2.25-2.5a.75.75 0 1 1 1.114-1.004l.943 1.048V8.75Z",
1634
1607
  clipRule: "evenodd"
1635
1608
  }));
1636
1609
  }
1637
- const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aqmx-document-stage" }), Qo = ({ document: e }) => {
1610
+ const oi = /* @__PURE__ */ S.forwardRef(ri), ii = Object.freeze({ className: "aqmx-document-stage" }), li = ({ document: e }) => {
1638
1611
  const { labels: t } = D();
1639
- return /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1640
- /* @__PURE__ */ d(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ d(Yo, {}) }),
1641
- /* @__PURE__ */ d(ve, { scrollerProps: Jo, children: /* @__PURE__ */ $("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1642
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1643
- /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1612
+ return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1613
+ /* @__PURE__ */ c(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(oi, {}) }),
1614
+ /* @__PURE__ */ c(ve, { scrollerProps: ii, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1615
+ /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1616
+ /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1644
1617
  ] }) })
1645
1618
  ] });
1646
- }, _e = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ei = (e) => {
1619
+ }, _e = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ai = (e) => {
1647
1620
  const t = e.indexOf("#");
1648
1621
  return t === -1 ? "" : e.slice(t);
1649
- }, ti = /(%[0-9A-Fa-f]{2})/u, dt = (e) => {
1622
+ }, si = /(%[0-9A-Fa-f]{2})/u, ut = (e) => {
1650
1623
  if (!e.startsWith("#") || e.length === 1) return null;
1651
- const t = new TextEncoder(), n = e.slice(1).split(ti).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1624
+ const t = new TextEncoder(), n = e.slice(1).split(si).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1652
1625
  return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
1653
- }, Rn = (e) => `#${encodeURIComponent(e)}`, ni = (e) => {
1626
+ }, Dn = (e) => `#${encodeURIComponent(e)}`, ci = (e) => {
1654
1627
  if (e === "#") return !0;
1655
- const t = dt(e);
1628
+ const t = ut(e);
1656
1629
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
1657
- }, On = (e, t) => {
1630
+ }, Pn = (e, t) => {
1658
1631
  if (t === "") return null;
1659
1632
  for (const n of e.querySelectorAll("[id]"))
1660
1633
  if (n.id === t) return n;
1661
1634
  return null;
1662
- }, ri = "http://www.w3.org/1999/xhtml", Ft = (e, t) => {
1635
+ }, di = "http://www.w3.org/1999/xhtml", _t = (e, t) => {
1663
1636
  if (t === "") return null;
1664
- const n = On(e, t);
1637
+ const n = Pn(e, t);
1665
1638
  if (n !== null) return n;
1666
1639
  for (const r of e.querySelectorAll("a[name]"))
1667
- if (r.localName === "a" && r.namespaceURI === ri && r.getAttribute("name") === t) return r;
1640
+ if (r.localName === "a" && r.namespaceURI === di && r.getAttribute("name") === t) return r;
1668
1641
  return null;
1669
- }, Cn = (e, t) => {
1642
+ }, $n = (e, t) => {
1670
1643
  if (e === null || !t.startsWith("#")) return null;
1671
- const n = Ft(e, t.slice(1));
1644
+ const n = _t(e, t.slice(1));
1672
1645
  if (n !== null) return n;
1673
- const r = dt(t);
1674
- return r === null ? null : Ft(e, r);
1675
- }, $t = (e) => {
1646
+ const r = ut(t);
1647
+ return r === null ? null : _t(e, r);
1648
+ }, Bt = (e) => {
1676
1649
  const { body: t, documentElement: n } = e.ownerDocument;
1677
1650
  if (e === t) {
1678
1651
  const o = getComputedStyle(n);
@@ -1680,22 +1653,22 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
1680
1653
  }
1681
1654
  const { overflowY: r } = getComputedStyle(e);
1682
1655
  return r === "auto" || r === "scroll";
1683
- }, oi = (e) => {
1656
+ }, ui = (e) => {
1684
1657
  const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
1685
1658
  return o !== "hidden" && o !== "clip";
1686
- }, ii = (e, t) => {
1659
+ }, fi = (e, t) => {
1687
1660
  const n = t.closest(_e), r = n !== null && e.contains(n) ? n : e;
1688
- if (r.scrollHeight > r.clientHeight && $t(r)) return r;
1689
- const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: a } = e.ownerDocument;
1661
+ if (r.scrollHeight > r.clientHeight && Bt(r)) return r;
1662
+ const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: l } = e.ownerDocument;
1690
1663
  for (let u = e.parentElement; u !== null && u !== i; u = u.parentElement)
1691
- if ($t(u) && u.scrollHeight > u.clientHeight && u.clientHeight < o) return u;
1692
- return a instanceof Element && oi(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
1693
- }, ai = Object.freeze({
1694
- scrollerOf: ii,
1664
+ if (Bt(u) && u.scrollHeight > u.clientHeight && u.clientHeight < o) return u;
1665
+ return l instanceof Element && ui(e.ownerDocument) && l.scrollHeight > l.clientHeight && l.clientHeight < o ? l : r;
1666
+ }, mi = Object.freeze({
1667
+ scrollerOf: fi,
1695
1668
  reveal: (e) => {
1696
- e.scrollIntoView(tt);
1669
+ e.scrollIntoView(nt);
1697
1670
  }
1698
- }), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), li = (e, t) => {
1671
+ }), nt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), hi = (e, t) => {
1699
1672
  for (let n = t; n !== null && n !== e; n = n.parentElement) {
1700
1673
  const r = n.parentElement;
1701
1674
  if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
@@ -1703,28 +1676,28 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
1703
1676
  n.removeAttribute("hidden");
1704
1677
  }
1705
1678
  }
1706
- }, si = (e, t) => {
1679
+ }, pi = (e, t) => {
1707
1680
  if (t.getClientRects().length === 0) return;
1708
- const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), a = t.getBoundingClientRect(), u = a.height + i + Number.parseFloat(o) > e.clientHeight;
1709
- if (!u && Math.abs(a.top - i - n) < 1) {
1710
- t.scrollIntoView(tt);
1681
+ const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), l = t.getBoundingClientRect(), u = l.height + i + Number.parseFloat(o) > e.clientHeight;
1682
+ if (!u && Math.abs(l.top - i - n) < 1) {
1683
+ t.scrollIntoView(nt);
1711
1684
  return;
1712
1685
  }
1713
- e.scrollBy({ top: u ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(tt);
1714
- }, di = (e, t) => {
1686
+ e.scrollBy({ top: u ? l.top - n - e.clientHeight : l.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(nt);
1687
+ }, vi = (e, t) => {
1715
1688
  const n = t.scrollerOf(e, e.querySelector(_e) ?? e);
1716
1689
  n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
1717
- }, qt = (e, t, n) => {
1690
+ }, jt = (e, t, n) => {
1718
1691
  if (e === null) return null;
1719
- const r = Cn(e, t);
1720
- return r === null ? (ni(t) && di(e, n), null) : (li(e, r), si(n.scrollerOf(e, r), r), n.reveal(r), r);
1692
+ const r = $n(e, t);
1693
+ return r === null ? (ci(t) && vi(e, n), null) : (hi(e, r), pi(n.scrollerOf(e, r), r), n.reveal(r), r);
1721
1694
  };
1722
- function ci({
1695
+ function gi({
1723
1696
  title: e,
1724
1697
  titleId: t,
1725
1698
  ...n
1726
1699
  }, r) {
1727
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1700
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1728
1701
  xmlns: "http://www.w3.org/2000/svg",
1729
1702
  viewBox: "0 0 20 20",
1730
1703
  fill: "currentColor",
@@ -1732,19 +1705,19 @@ function ci({
1732
1705
  "data-slot": "icon",
1733
1706
  ref: r,
1734
1707
  "aria-labelledby": t
1735
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1708
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1736
1709
  id: t
1737
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1710
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1738
1711
  d: "M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z"
1739
1712
  }));
1740
1713
  }
1741
- const ui = /* @__PURE__ */ y.forwardRef(ci);
1742
- function fi({
1714
+ const wi = /* @__PURE__ */ S.forwardRef(gi);
1715
+ function bi({
1743
1716
  title: e,
1744
1717
  titleId: t,
1745
1718
  ...n
1746
1719
  }, r) {
1747
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1720
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1748
1721
  xmlns: "http://www.w3.org/2000/svg",
1749
1722
  viewBox: "0 0 20 20",
1750
1723
  fill: "currentColor",
@@ -1752,23 +1725,23 @@ function fi({
1752
1725
  "data-slot": "icon",
1753
1726
  ref: r,
1754
1727
  "aria-labelledby": t
1755
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1728
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1756
1729
  id: t
1757
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1730
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1758
1731
  d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
1759
- }), /* @__PURE__ */ y.createElement("path", {
1732
+ }), /* @__PURE__ */ S.createElement("path", {
1760
1733
  fillRule: "evenodd",
1761
1734
  d: "M9 2a7 7 0 1 0 4.391 12.452l3.329 3.328a.75.75 0 1 0 1.06-1.06l-3.328-3.329A7 7 0 0 0 9 2ZM3.5 9a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",
1762
1735
  clipRule: "evenodd"
1763
1736
  }));
1764
1737
  }
1765
- const mi = /* @__PURE__ */ y.forwardRef(fi);
1766
- function hi({
1738
+ const Ei = /* @__PURE__ */ S.forwardRef(bi);
1739
+ function yi({
1767
1740
  title: e,
1768
1741
  titleId: t,
1769
1742
  ...n
1770
1743
  }, r) {
1771
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1744
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1772
1745
  xmlns: "http://www.w3.org/2000/svg",
1773
1746
  viewBox: "0 0 20 20",
1774
1747
  fill: "currentColor",
@@ -1776,23 +1749,23 @@ function hi({
1776
1749
  "data-slot": "icon",
1777
1750
  ref: r,
1778
1751
  "aria-labelledby": t
1779
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1752
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1780
1753
  id: t
1781
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1754
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1782
1755
  d: "M9 6a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 9 6Z"
1783
- }), /* @__PURE__ */ y.createElement("path", {
1756
+ }), /* @__PURE__ */ S.createElement("path", {
1784
1757
  fillRule: "evenodd",
1785
1758
  d: "M2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Zm7-5.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Z",
1786
1759
  clipRule: "evenodd"
1787
1760
  }));
1788
1761
  }
1789
- const pi = /* @__PURE__ */ y.forwardRef(hi);
1790
- function vi({
1762
+ const Si = /* @__PURE__ */ S.forwardRef(yi);
1763
+ function xi({
1791
1764
  title: e,
1792
1765
  titleId: t,
1793
1766
  ...n
1794
1767
  }, r) {
1795
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
1768
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
1796
1769
  xmlns: "http://www.w3.org/2000/svg",
1797
1770
  viewBox: "0 0 20 20",
1798
1771
  fill: "currentColor",
@@ -1800,15 +1773,15 @@ function vi({
1800
1773
  "data-slot": "icon",
1801
1774
  ref: r,
1802
1775
  "aria-labelledby": t
1803
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
1776
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
1804
1777
  id: t
1805
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
1778
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
1806
1779
  fillRule: "evenodd",
1807
1780
  d: "M1 5.25A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm1.5 5.81v3.69c0 .414.336.75.75.75h13.5a.75.75 0 0 0 .75-.75v-2.69l-2.22-2.219a.75.75 0 0 0-1.06 0l-1.91 1.909.47.47a.75.75 0 1 1-1.06 1.06L6.53 8.091a.75.75 0 0 0-1.06 0l-2.97 2.97ZM12 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
1808
1781
  clipRule: "evenodd"
1809
1782
  }));
1810
1783
  }
1811
- const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = Object.freeze({ [nt]: "allow" }), gi = `[${nt}="${rt[nt]}"]`, bi = () => {
1784
+ const ki = /* @__PURE__ */ S.forwardRef(xi), rt = "data-aqmx-key-repeat", ot = Object.freeze({ [rt]: "allow" }), Ti = `[${rt}="${ot[rt]}"]`, Ri = () => {
1812
1785
  let e = null;
1813
1786
  return {
1814
1787
  onKeyDownCapture: (t) => {
@@ -1817,7 +1790,7 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1817
1790
  e = t.target instanceof Element ? t.target : null;
1818
1791
  return;
1819
1792
  }
1820
- e !== null && t.target === e && e.closest(gi) !== null || (t.preventDefault(), t.stopPropagation());
1793
+ e !== null && t.target === e && e.closest(Ti) !== null || (t.preventDefault(), t.stopPropagation());
1821
1794
  }
1822
1795
  },
1823
1796
  onKeyUpCapture: (t) => {
@@ -1827,41 +1800,41 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1827
1800
  t.target === e && (e = null);
1828
1801
  }
1829
1802
  };
1830
- }, Ae = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1, Mn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), It = `[data-testid="${Mn["data-testid"]}"]`, Si = pe(null), yi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ei ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Bt = (e, t, n) => {
1803
+ }, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), zt = Object.freeze({ mode: "fit" }), Oi = 1, Fn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Vt = `[data-testid="${Fn["data-testid"]}"]`, Ci = pe(null), Mi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Oi ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Ht = (e, t, n) => {
1831
1804
  if (e.mode === "level") {
1832
1805
  const o = e.index + n;
1833
- return o >= 0 && o < Ae.length ? o : null;
1806
+ return o >= 0 && o < Le.length ? o : null;
1834
1807
  }
1835
1808
  if (t === null || !Number.isFinite(t) || t <= 0) return null;
1836
- const r = n === 1 ? Ae.findIndex((o) => o > t) : Ae.findLastIndex((o) => o < t);
1809
+ const r = n === 1 ? Le.findIndex((o) => o > t) : Le.findLastIndex((o) => o < t);
1837
1810
  return r === -1 ? null : r;
1838
- }, zt = (e, t, n) => {
1811
+ }, Ut = (e, t, n) => {
1839
1812
  if (e.mode === "level") {
1840
- const o = Bt(e, null, n);
1813
+ const o = Ht(e, null, n);
1841
1814
  return o === null ? null : { mode: "level", index: o, base: e.base };
1842
1815
  }
1843
1816
  if (t === null) return null;
1844
- const r = Bt(e, t.scale, n);
1817
+ const r = Ht(e, t.scale, n);
1845
1818
  return r === null ? null : { mode: "level", index: r, base: t.base };
1846
- }, xi = (e, t) => {
1819
+ }, Li = (e, t) => {
1847
1820
  if (e <= 0 || t <= 0) return 0;
1848
1821
  const n = Math.trunc(Math.log(t / e) / Math.log(be));
1849
1822
  return n === 0 ? 0 : n;
1850
- }, jt = (e) => {
1823
+ }, Zt = (e) => {
1851
1824
  const t = e[0], n = e[1];
1852
1825
  return e.length !== 2 || t === void 0 || n === void 0 ? null : { distance: Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), middle: { x: (t.clientX + n.clientX) / 2, y: (t.clientY + n.clientY) / 2 } };
1853
- }, ki = (e) => {
1854
- const t = Ae[e];
1826
+ }, Ai = (e) => {
1827
+ const t = Le[e];
1855
1828
  if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
1856
1829
  return t;
1857
- }, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ti = ({ document: e }) => {
1858
- const { labels: t } = D(), n = re(Si), [r] = z(() => n === null ? null : n.read(e.url)), [o, i] = z(r === null ? _t : r.zoom), [a, u] = z(r === null ? null : r.reported), [m, f] = z(null), c = _(null), h = P((w) => {
1859
- const { naturalWidth: l, naturalHeight: s } = w;
1860
- u((v) => Ht(v, l, s));
1861
- }, []), g = P(
1862
- (w) => {
1863
- c.current = w, !(w === null || !w.complete) && (w.naturalWidth > 0 || w.naturalHeight > 0 ? h(w) : w.decode().then(
1864
- () => h(w),
1830
+ }, Gt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ni = ({ document: e }) => {
1831
+ const { labels: t } = D(), n = ne(Ci), [r] = B(() => n === null ? null : n.read(e.url)), [o, i] = B(r === null ? zt : r.zoom), [l, u] = B(r === null ? null : r.reported), [m, f] = B(null), d = q(null), h = P((g) => {
1832
+ const { naturalWidth: a, naturalHeight: s } = g;
1833
+ u((w) => Gt(w, a, s));
1834
+ }, []), v = P(
1835
+ (g) => {
1836
+ d.current = g, !(g === null || !g.complete) && (g.naturalWidth > 0 || g.naturalHeight > 0 ? h(g) : g.decode().then(
1837
+ () => h(g),
1865
1838
  () => {
1866
1839
  }
1867
1840
  ));
@@ -1869,52 +1842,52 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1869
1842
  [h]
1870
1843
  );
1871
1844
  te(() => {
1872
- n !== null && a !== null && n.save(e.url, { zoom: o, reported: a });
1873
- }, [n, e.url, o, a]), j(() => {
1874
- const w = c.current;
1875
- if (w === null || a === null || o.mode !== "fit") return;
1876
- const l = () => f((v) => Ht(v, w.clientWidth, w.clientHeight));
1877
- if (l(), typeof ResizeObserver > "u") return;
1878
- const s = new ResizeObserver(l);
1879
- return s.observe(w), () => s.disconnect();
1880
- }, [a, o.mode]);
1881
- const E = a === null || m === null ? null : yi(a, m), k = zt(o, E, -1), R = zt(o, E, 1), T = o.mode === "level" ? ki(o.index) : null, A = _({ zoomIn: R, zoomOut: k });
1882
- j(() => {
1883
- A.current = { zoomIn: R, zoomOut: k };
1845
+ n !== null && l !== null && n.save(e.url, { zoom: o, reported: l });
1846
+ }, [n, e.url, o, l]), V(() => {
1847
+ const g = d.current;
1848
+ if (g === null || l === null || o.mode !== "fit") return;
1849
+ const a = () => f((w) => Gt(w, g.clientWidth, g.clientHeight));
1850
+ if (a(), typeof ResizeObserver > "u") return;
1851
+ const s = new ResizeObserver(a);
1852
+ return s.observe(g), () => s.disconnect();
1853
+ }, [l, o.mode]);
1854
+ const E = l === null || m === null ? null : Mi(l, m), k = Ut(o, E, -1), R = Ut(o, E, 1), T = o.mode === "level" ? Ai(o.index) : null, N = q({ zoomIn: R, zoomOut: k });
1855
+ V(() => {
1856
+ N.current = { zoomIn: R, zoomOut: k };
1884
1857
  });
1885
- const L = _(null);
1886
- j(() => {
1887
- const w = L.current, l = c.current?.closest(It);
1888
- L.current = null, !(w === null || l === null || l === void 0) && (l.scrollLeft = w.across * l.scrollWidth - w.x, l.scrollTop = w.down * l.scrollHeight - w.y);
1858
+ const M = q(null);
1859
+ V(() => {
1860
+ const g = M.current, a = d.current?.closest(Vt);
1861
+ M.current = null, !(g === null || a === null || a === void 0) && (a.scrollLeft = g.across * a.scrollWidth - g.x, a.scrollTop = g.down * a.scrollHeight - g.y);
1889
1862
  }, [o]), te(() => {
1890
- const w = c.current?.closest(It);
1891
- if (w == null) return;
1892
- let l = null;
1893
- const s = (M) => {
1894
- const N = jt(M.touches);
1895
- l = N === null ? null : { distance: N.distance, steps: 0 };
1896
- }, v = (M) => {
1897
- const N = jt(M.touches);
1898
- if (l === null || N === null) return;
1899
- M.preventDefault();
1900
- const q = xi(l.distance, N.distance);
1901
- if (q === l.steps) return;
1902
- const W = q > l.steps ? 1 : -1, G = W === 1 ? A.current.zoomIn : A.current.zoomOut;
1863
+ const g = d.current?.closest(Vt);
1864
+ if (g == null) return;
1865
+ let a = null;
1866
+ const s = (L) => {
1867
+ const A = Zt(L.touches);
1868
+ a = A === null ? null : { distance: A.distance, steps: 0 };
1869
+ }, w = (L) => {
1870
+ const A = Zt(L.touches);
1871
+ if (a === null || A === null) return;
1872
+ L.preventDefault();
1873
+ const I = Li(a.distance, A.distance);
1874
+ if (I === a.steps) return;
1875
+ const K = I > a.steps ? 1 : -1, G = K === 1 ? N.current.zoomIn : N.current.zoomOut;
1903
1876
  if (G === null) return;
1904
- l.steps += W;
1905
- const I = w.getBoundingClientRect(), J = N.middle.x - I.left, H = N.middle.y - I.top;
1906
- L.current = w.scrollWidth > 0 && w.scrollHeight > 0 ? { x: J, y: H, across: (w.scrollLeft + J) / w.scrollWidth, down: (w.scrollTop + H) / w.scrollHeight } : null, i(G);
1907
- }, O = (M) => {
1908
- M.touches.length < 2 && (l = null);
1877
+ a.steps += K;
1878
+ const z = g.getBoundingClientRect(), X = A.middle.x - z.left, j = A.middle.y - z.top;
1879
+ M.current = g.scrollWidth > 0 && g.scrollHeight > 0 ? { x: X, y: j, across: (g.scrollLeft + X) / g.scrollWidth, down: (g.scrollTop + j) / g.scrollHeight } : null, i(G);
1880
+ }, O = (L) => {
1881
+ L.touches.length < 2 && (a = null);
1909
1882
  };
1910
- return w.addEventListener("touchstart", s, { passive: !0 }), w.addEventListener("touchmove", v, { passive: !1 }), w.addEventListener("touchend", O, { passive: !0 }), w.addEventListener("touchcancel", O, { passive: !0 }), () => {
1911
- w.removeEventListener("touchstart", s), w.removeEventListener("touchmove", v), w.removeEventListener("touchend", O), w.removeEventListener("touchcancel", O);
1883
+ return g.addEventListener("touchstart", s, { passive: !0 }), g.addEventListener("touchmove", w, { passive: !1 }), g.addEventListener("touchend", O, { passive: !0 }), g.addEventListener("touchcancel", O, { passive: !0 }), () => {
1884
+ g.removeEventListener("touchstart", s), g.removeEventListener("touchmove", w), g.removeEventListener("touchend", O), g.removeEventListener("touchcancel", O);
1912
1885
  };
1913
1886
  }, []);
1914
1887
  const b = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
1915
- return /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
1916
- /* @__PURE__ */ $(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ d(wi, {}), children: [
1917
- /* @__PURE__ */ d(
1888
+ return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
1889
+ /* @__PURE__ */ F(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(ki, {}), children: [
1890
+ /* @__PURE__ */ c(
1918
1891
  "button",
1919
1892
  {
1920
1893
  type: "button",
@@ -1925,12 +1898,12 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1925
1898
  onClick: () => {
1926
1899
  k !== null && i(k);
1927
1900
  },
1928
- ...rt,
1929
- children: /* @__PURE__ */ d(mi, {})
1901
+ ...ot,
1902
+ children: /* @__PURE__ */ c(Ei, {})
1930
1903
  }
1931
1904
  ),
1932
- /* @__PURE__ */ d("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
1933
- /* @__PURE__ */ d(
1905
+ /* @__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)) }),
1906
+ /* @__PURE__ */ c(
1934
1907
  "button",
1935
1908
  {
1936
1909
  type: "button",
@@ -1941,87 +1914,91 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1941
1914
  onClick: () => {
1942
1915
  R !== null && i(R);
1943
1916
  },
1944
- ...rt,
1945
- children: /* @__PURE__ */ d(pi, {})
1917
+ ...ot,
1918
+ children: /* @__PURE__ */ c(Si, {})
1946
1919
  }
1947
1920
  ),
1948
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(_t), children: /* @__PURE__ */ d(ui, {}) })
1921
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(zt), children: /* @__PURE__ */ c(wi, {}) })
1949
1922
  ] }),
1950
- /* @__PURE__ */ d(ve, { scrollerProps: Mn, children: /* @__PURE__ */ d("img", { ref: g, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: b, onLoad: (w) => h(w.currentTarget), "data-testid": "markdown-explorer-image" }) })
1923
+ /* @__PURE__ */ c(ve, { scrollerProps: Fn, children: /* @__PURE__ */ c("img", { ref: v, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: b, onLoad: (g) => h(g.currentTarget), "data-testid": "markdown-explorer-image" }) })
1951
1924
  ] });
1952
- }, An = pe(null), Ie = pe(void 0), Ln = pe(null), Be = () => {
1953
- const e = re(An);
1925
+ }, Di = async (e, t, n) => {
1926
+ const r = await e.text(t, n);
1927
+ if (!("kind" in r)) throw n.reason;
1928
+ return r.kind === "text" ? { kind: "text", text: r.text, truncated: r.truncated } : { kind: "failure", retryable: r.failure.reason === "failed" };
1929
+ }, In = pe(null), Be = pe(void 0), qn = pe(null), je = () => {
1930
+ const e = ne(In);
1954
1931
  if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
1955
1932
  return e;
1956
- }, Ri = () => {
1957
- const e = re(Ln);
1933
+ }, Pi = () => {
1934
+ const e = ne(qn);
1958
1935
  if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
1959
1936
  return e;
1960
- }, ze = (e, t, n, r) => t.kind === "panel" ? Se(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Se(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Se(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Oi = ({ children: e }) => {
1961
- const { config: t } = D(), n = Be(), r = at(), o = r.kind === "location" ? r.location.source : void 0, i = Fe(ze(t, n.navigation, o, n.currentPath));
1962
- return /* @__PURE__ */ d(Ie, { value: o, children: /* @__PURE__ */ d(Ln, { value: i, children: e }) });
1963
- }, Ci = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Mi = (e) => {
1964
- const t = e instanceof Element ? e.closest(Ci) : null;
1937
+ }, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), $i = ({ children: e }) => {
1938
+ const { config: t } = D(), n = je(), r = st(), o = r.kind === "location" ? r.location.source : void 0, i = Fe(ze(t, n.navigation, o, n.currentPath));
1939
+ return /* @__PURE__ */ c(Be, { value: o, children: /* @__PURE__ */ c(qn, { value: i, children: e }) });
1940
+ }, Fi = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Ii = (e) => {
1941
+ const t = e instanceof Element ? e.closest(Fi) : null;
1965
1942
  return t === null ? null : t.getAttribute("data-doc-path");
1966
- }, je = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ai = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: a, scope: u, children: m }) => {
1943
+ }, Ve = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, qi = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: l, scope: u, children: m }) => {
1967
1944
  const f = Fe(e);
1968
- return /* @__PURE__ */ d("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
1969
- if (je(h)) {
1945
+ return /* @__PURE__ */ c("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
1946
+ if (Ve(h)) {
1970
1947
  if (h.preventDefault(), t === u.currentPath && n !== "") {
1971
1948
  u.scrollWithin(n);
1972
1949
  return;
1973
1950
  }
1974
- a(t, n);
1951
+ l(t, n);
1975
1952
  }
1976
1953
  }, children: m });
1977
- }, Li = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
1978
- const { config: a } = D(), u = Be(), m = re(Ie), f = ei(e), { navigation: c } = u, h = `${ze(a, c, m, t)}${f}`, g = n === !1 ? "false" : void 0;
1979
- return c.kind === "page" ? /* @__PURE__ */ d(Mo, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": g, children: i }) : /* @__PURE__ */ d(Ai, { to: h, docPath: t, fragment: f, exists: g, className: r, attributes: o, onDocumentLink: c.onDocumentLink, scope: u, children: i });
1980
- }, Ni = ({ className: e, attributes: t, children: n }) => {
1954
+ }, _i = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
1955
+ const { config: l } = D(), u = je(), m = ne(Be), f = ai(e), { navigation: d } = u, h = `${ze(l, d, m, t)}${f}`, v = n === !1 ? "false" : void 0;
1956
+ return d.kind === "page" ? /* @__PURE__ */ c(Fo, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": v, children: i }) : /* @__PURE__ */ c(qi, { to: h, docPath: t, fragment: f, exists: v, className: r, attributes: o, onDocumentLink: d.onDocumentLink, scope: u, children: i });
1957
+ }, Bi = ({ className: e, attributes: t, children: n }) => {
1981
1958
  const { labels: r } = D();
1982
1959
  return (
1983
- /* @__PURE__ */ $("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
1960
+ /* @__PURE__ */ F("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
1984
1961
  n,
1985
- /* @__PURE__ */ $("span", { className: "aqmx-sr-only", children: [
1962
+ /* @__PURE__ */ F("span", { className: "aqmx-sr-only", children: [
1986
1963
  " (",
1987
1964
  r.inertLink,
1988
1965
  ")"
1989
1966
  ] })
1990
1967
  ] })
1991
1968
  );
1992
- }, Di = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1993
- const { config: i } = D(), a = re(Ie), u = Fe(`${ze(i, r.navigation, a, r.currentPath)}${e}`);
1994
- return /* @__PURE__ */ d("a", { ...n, href: u, className: t, onClick: (f) => {
1995
- je(f) && (f.preventDefault(), r.scrollWithin(e));
1969
+ }, ji = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1970
+ const { config: i } = D(), l = ne(Be), u = Fe(`${ze(i, r.navigation, l, r.currentPath)}${e}`);
1971
+ return /* @__PURE__ */ c("a", { ...n, href: u, className: t, onClick: (f) => {
1972
+ Ve(f) && (f.preventDefault(), r.scrollWithin(e));
1996
1973
  }, children: o });
1997
- }, Pi = ({ href: e, className: t, attributes: n, children: r }) => {
1998
- const o = Be();
1999
- return o.navigation.kind === "page" ? /* @__PURE__ */ d("a", { ...n, href: e, className: t, onClick: (a) => {
2000
- if (!je(a)) return;
2001
- const u = a.currentTarget;
2002
- e === "#" ? o.followEmptyFragment(a.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, a.nativeEvent);
2003
- }, children: r }) : /* @__PURE__ */ d(Di, { href: e, className: t, attributes: n, scope: o, children: r });
2004
- }, Fi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: a }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ d(Ni, { className: o, attributes: i, children: a }) : /* @__PURE__ */ d(Li, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: a }) : e.startsWith("#") ? /* @__PURE__ */ d(Pi, { href: e, className: o, attributes: i, children: a }) : /* @__PURE__ */ d("a", { ...i, href: e, className: o, children: a }), $i = () => {
2005
- const { config: e } = D(), t = Be(), n = re(Ie), r = $e();
1974
+ }, zi = ({ href: e, className: t, attributes: n, children: r }) => {
1975
+ const o = je();
1976
+ return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (l) => {
1977
+ if (!Ve(l)) return;
1978
+ const u = l.currentTarget;
1979
+ e === "#" ? o.followEmptyFragment(l.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, l.nativeEvent);
1980
+ }, children: r }) : /* @__PURE__ */ c(ji, { href: e, className: t, attributes: n, scope: o, children: r });
1981
+ }, Vi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !sr(n) ? /* @__PURE__ */ c(Bi, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(_i, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(zi, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), Hi = () => {
1982
+ const { config: e } = D(), t = je(), n = ne(Be), r = Ie();
2006
1983
  return P(
2007
1984
  (o, i) => {
2008
- if (!je(i)) return !0;
1985
+ if (!Ve(i)) return !0;
2009
1986
  i.preventDefault();
2010
- const a = Rn(o.id), { navigation: u } = t;
2011
- return u.kind === "panel" || dt(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(a), !0) : (r(`${ze(e, u, n, t.currentPath)}${a}`, "follow-link"), !0);
1987
+ const l = Dn(o.id), { navigation: u } = t;
1988
+ return u.kind === "panel" || ut(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(l), !0) : (r(`${ze(e, u, n, t.currentPath)}${l}`, "follow-link"), !0);
2012
1989
  },
2013
1990
  [e, t, n, r]
2014
1991
  );
2015
- }, qi = () => {
2016
- const e = Ri();
2017
- return P((t) => `${e}${Rn(t.id)}`, [e]);
1992
+ }, Ui = () => {
1993
+ const e = Pi();
1994
+ return P((t) => `${e}${Dn(t.id)}`, [e]);
2018
1995
  };
2019
- function _i({
1996
+ function Zi({
2020
1997
  title: e,
2021
1998
  titleId: t,
2022
1999
  ...n
2023
2000
  }, r) {
2024
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2001
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2025
2002
  xmlns: "http://www.w3.org/2000/svg",
2026
2003
  viewBox: "0 0 20 20",
2027
2004
  fill: "currentColor",
@@ -2029,19 +2006,19 @@ function _i({
2029
2006
  "data-slot": "icon",
2030
2007
  ref: r,
2031
2008
  "aria-labelledby": t
2032
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2009
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2033
2010
  id: t
2034
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2011
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2035
2012
  d: "M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Z"
2036
2013
  }));
2037
2014
  }
2038
- const Ii = /* @__PURE__ */ y.forwardRef(_i);
2039
- function Bi({
2015
+ const Gi = /* @__PURE__ */ S.forwardRef(Zi);
2016
+ function Ki({
2040
2017
  title: e,
2041
2018
  titleId: t,
2042
2019
  ...n
2043
2020
  }, r) {
2044
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2021
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2045
2022
  xmlns: "http://www.w3.org/2000/svg",
2046
2023
  viewBox: "0 0 20 20",
2047
2024
  fill: "currentColor",
@@ -2049,21 +2026,21 @@ function Bi({
2049
2026
  "data-slot": "icon",
2050
2027
  ref: r,
2051
2028
  "aria-labelledby": t
2052
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2029
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2053
2030
  id: t
2054
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2031
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2055
2032
  fillRule: "evenodd",
2056
2033
  d: "M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v10.515a1.75 1.75 0 0 1-1.75 1.75h-1.5c-.078 0-.155-.005-.23-.015H4.48c-.075.01-.152.015-.23.015h-1.5A1.75 1.75 0 0 1 1 15.265V4.75Zm16.5 7.385V11.01a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25Zm0 2.005a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .108.069.2.165.235h1.585a.25.25 0 0 0 .25-.25v-1.11Zm-15 1.11v-1.11a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.164.235H2.75a.25.25 0 0 1-.25-.25Zm2-4.24v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V11.01a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25Zm13-2.005V7.88a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25ZM4.25 7.63a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V7.88a.25.25 0 0 1 .25-.25h1.5Zm0-3.13a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5Zm11.5 1.625a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5Zm-9 3.125a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
2057
2034
  clipRule: "evenodd"
2058
2035
  }));
2059
2036
  }
2060
- const zi = /* @__PURE__ */ y.forwardRef(Bi);
2061
- function ji({
2037
+ const Wi = /* @__PURE__ */ S.forwardRef(Ki);
2038
+ function Yi({
2062
2039
  title: e,
2063
2040
  titleId: t,
2064
2041
  ...n
2065
2042
  }, r) {
2066
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2043
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2067
2044
  xmlns: "http://www.w3.org/2000/svg",
2068
2045
  viewBox: "0 0 20 20",
2069
2046
  fill: "currentColor",
@@ -2071,59 +2048,73 @@ function ji({
2071
2048
  "data-slot": "icon",
2072
2049
  ref: r,
2073
2050
  "aria-labelledby": t
2074
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2051
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2075
2052
  id: t
2076
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2053
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2077
2054
  fillRule: "evenodd",
2078
2055
  d: "M17.721 1.599a.75.75 0 0 1 .279.583v11.29a2.25 2.25 0 0 1-1.774 2.2l-2.041.44a2.216 2.216 0 0 1-.938-4.332l2.662-.577a.75.75 0 0 0 .591-.733V6.112l-8 1.73v7.684a2.25 2.25 0 0 1-1.774 2.2l-2.042.44a2.216 2.216 0 1 1-.935-4.331l2.659-.573A.75.75 0 0 0 7 12.529V4.236a.75.75 0 0 1 .591-.733l9.5-2.054a.75.75 0 0 1 .63.15Z",
2079
2056
  clipRule: "evenodd"
2080
2057
  }));
2081
2058
  }
2082
- const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aqmx-document-stage" }), Zi = () => () => {
2083
- }, Ui = () => navigator.pdfViewerEnabled !== !1, Gi = () => null, Wi = ({ document: e }) => {
2084
- const { labels: t } = D(), n = ee(Zi, Ui, Gi);
2085
- return n === null ? null : n ? /* @__PURE__ */ d("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ $("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
2086
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
2087
- /* @__PURE__ */ $("div", { className: "aqmx-callout-actions", children: [
2088
- /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, target: "_blank", rel: "noopener noreferrer", "data-testid": "markdown-explorer-pdf-not-shown-open", children: t.openInNewTab }),
2089
- /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
2059
+ const Xi = /* @__PURE__ */ S.forwardRef(Yi), Ji = Object.freeze({ className: "aqmx-document-stage" }), Qi = () => () => {
2060
+ }, el = () => navigator.pdfViewerEnabled !== !1, tl = () => null, nl = ({ document: e }) => {
2061
+ const { labels: t } = D(), n = ee(Qi, el, tl);
2062
+ return n === null ? null : n ? /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
2063
+ /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
2064
+ /* @__PURE__ */ F("div", { className: "aqmx-callout-actions", children: [
2065
+ /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, target: "_blank", rel: "noopener noreferrer", "data-testid": "markdown-explorer-pdf-not-shown-open", children: t.openInNewTab }),
2066
+ /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
2090
2067
  ] })
2091
2068
  ] });
2092
- }, Ki = (e) => {
2069
+ }, rl = (e) => {
2093
2070
  switch (e) {
2094
2071
  case "video":
2095
- return /* @__PURE__ */ d(zi, {});
2072
+ return /* @__PURE__ */ c(Wi, {});
2096
2073
  case "audio":
2097
- return /* @__PURE__ */ d(Hi, {});
2074
+ return /* @__PURE__ */ c(Xi, {});
2098
2075
  case "pdf":
2099
- return /* @__PURE__ */ d(Ii, {});
2076
+ return /* @__PURE__ */ c(Gi, {});
2100
2077
  default: {
2101
2078
  const t = e;
2102
2079
  throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
2103
2080
  }
2104
2081
  }
2105
- }, Xi = ({ document: e }) => {
2082
+ }, ol = ({ document: e }) => {
2106
2083
  const { labels: t } = D();
2107
2084
  switch (e.mediaType) {
2108
2085
  case "video":
2109
2086
  return (
2110
- /* @__PURE__ */ d("video", { className: "aqmx-document-video", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
2087
+ /* @__PURE__ */ c("video", { className: "aqmx-document-video", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
2111
2088
  );
2112
2089
  case "audio":
2113
2090
  return (
2114
- /* @__PURE__ */ d("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
2091
+ /* @__PURE__ */ c("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
2115
2092
  );
2116
2093
  case "pdf":
2117
- return /* @__PURE__ */ d(Wi, { document: e });
2094
+ return /* @__PURE__ */ c(nl, { document: e });
2118
2095
  default: {
2119
2096
  const n = e.mediaType;
2120
2097
  throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
2121
2098
  }
2122
2099
  }
2123
- }, Yi = ({ document: e }) => /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2124
- /* @__PURE__ */ d(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Ki(e.mediaType) }),
2125
- /* @__PURE__ */ d(ve, { scrollerProps: Vi, children: /* @__PURE__ */ d(Xi, { document: e }) })
2126
- ] }), Ji = (e) => ({
2100
+ }, il = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2101
+ /* @__PURE__ */ c(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: rl(e.mediaType) }),
2102
+ /* @__PURE__ */ c(ve, { scrollerProps: Ji, children: /* @__PURE__ */ c(ol, { document: e }) })
2103
+ ] }), ft = (e) => e.kind === "markdown" ? "markdown" : e.kind === "image" && e.imageType === "svg" ? "svg" : null, ll = (e) => {
2104
+ const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o);
2105
+ return i === null ? null : ft(i.document);
2106
+ }, al = (e) => {
2107
+ const { config: t } = D(), n = Ie(), r = P(() => n(ye(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2108
+ return H(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2109
+ }, sl = (e, t) => {
2110
+ const n = {};
2111
+ for (const r of Object.keys(Ae[t])) {
2112
+ const o = e[at(r)];
2113
+ o !== Ae[t][r].text && (n[`spreadsheet${r.charAt(0).toUpperCase()}${r.slice(1)}`] = o);
2114
+ }
2115
+ return n;
2116
+ }, cl = (e, t) => ({
2117
+ ...sl(e, t),
2127
2118
  loading: e.viewerLoading,
2128
2119
  errorPrefix: e.viewerErrorPrefix,
2129
2120
  styleTitle: e.viewerStyleTitle,
@@ -2164,309 +2155,294 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2164
2155
  mermaidPanRight: e.viewerMermaidPanRight,
2165
2156
  mermaidDiagram: e.viewerMermaidDiagram,
2166
2157
  mermaidRetry: e.viewerMermaidRetry,
2167
- spreadsheetTable: e.viewerSpreadsheetTable,
2168
- spreadsheetZoomIn: e.viewerSpreadsheetZoomIn,
2169
- spreadsheetZoomOut: e.viewerSpreadsheetZoomOut,
2170
- spreadsheetResetZoom: e.viewerSpreadsheetResetZoom,
2171
- spreadsheetHighlight: e.viewerSpreadsheetHighlight,
2172
- spreadsheetCopyAll: e.viewerSpreadsheetCopyAll,
2173
- spreadsheetSaveTsv: e.viewerSpreadsheetSaveTsv,
2174
- spreadsheetSaveMenu: e.viewerSpreadsheetSaveMenu,
2175
- spreadsheetSaveTsvWithBom: e.viewerSpreadsheetSaveTsvWithBom,
2176
- spreadsheetFullscreen: e.viewerSpreadsheetFullscreen,
2177
- spreadsheetExitFullscreen: e.viewerSpreadsheetExitFullscreen,
2178
- spreadsheetFullscreenDialog: e.viewerSpreadsheetFullscreenDialog,
2179
- spreadsheetSize: e.viewerSpreadsheetSize,
2180
- spreadsheetFileName: e.viewerSpreadsheetFileName,
2181
- spreadsheetCopied: e.viewerSpreadsheetCopied,
2182
- spreadsheetCopyFailed: e.viewerSpreadsheetCopyFailed,
2183
- spreadsheetCellAnnouncement: e.viewerSpreadsheetCellAnnouncement,
2184
- spreadsheetEmptyCell: e.viewerSpreadsheetEmptyCell,
2185
- spreadsheetSelectionAnnouncement: e.viewerSpreadsheetSelectionAnnouncement,
2186
- spreadsheetReadOnly: e.viewerSpreadsheetReadOnly,
2187
- spreadsheetFormatRefused: e.viewerSpreadsheetFormatRefused,
2188
- spreadsheetFenceRefused: e.viewerSpreadsheetFenceRefused,
2189
- spreadsheetEditConflict: e.viewerSpreadsheetEditConflict,
2190
- spreadsheetOptionsError: e.viewerSpreadsheetOptionsError,
2191
- spreadsheetLoadFailed: e.viewerSpreadsheetLoadFailed,
2192
- spreadsheetRetry: e.viewerSpreadsheetRetry,
2193
2158
  embeddedVideo: e.viewerEmbeddedVideo,
2194
2159
  embeddedPost: e.viewerEmbeddedPost,
2195
- embeddedFrame: e.viewerEmbeddedFrame
2196
- }), Nn = (e, t, n) => {
2160
+ embeddedFrame: e.viewerEmbeddedFrame,
2161
+ blockFailed: e.viewerBlockFailed,
2162
+ svgImageToolbar: e.viewerSvgImageToolbar,
2163
+ svgImageSource: e.viewerSvgImageSource,
2164
+ svgImageSourceRegion: e.viewerSvgImageSourceRegion,
2165
+ svgImageLoading: e.viewerSvgImageLoading,
2166
+ svgImageFailed: e.viewerSvgImageFailed,
2167
+ svgImageRetry: e.viewerSvgImageRetry,
2168
+ svgImageTruncated: e.viewerSvgImageTruncated,
2169
+ svgImageCopy: e.viewerSvgImageCopy,
2170
+ svgImageCopied: e.viewerSvgImageCopied,
2171
+ svgImageCopyFailed: e.viewerSvgImageCopyFailed
2172
+ }), _n = (e, t, n) => {
2197
2173
  if (t !== void 0) return t;
2198
2174
  if (n !== void 0) return n;
2199
2175
  const [r] = e.documentStyles;
2200
2176
  if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
2201
2177
  return r.name;
2202
- }, Dn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Sr, Qi = Object.freeze({ kind: "empty" }), ct = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), ea = (e, t, n) => {
2178
+ }, Bn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Cr, dl = Object.freeze({ kind: "empty" }), mt = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), ul = (e, t, n) => {
2203
2179
  if (t.view === "multi" || t.overrides[n] === void 0) return null;
2204
2180
  const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
2205
- return Se(e, { ...t, overrides: r });
2206
- }, ye = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: i, intent: a, children: u }) => {
2207
- const m = re(he);
2181
+ return ye(e, { ...t, overrides: r });
2182
+ }, Se = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: i, intent: l, children: u }) => {
2183
+ const m = ne(he);
2208
2184
  return (
2209
- /* @__PURE__ */ $("section", { ref: i, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": m, className: "aqmx-document", ...a, children: [
2210
- r ? /* @__PURE__ */ d("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
2185
+ /* @__PURE__ */ F("section", { ref: i, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": m, className: "aqmx-document", ...l, children: [
2186
+ r ? /* @__PURE__ */ c("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
2211
2187
  u
2212
2188
  ] })
2213
2189
  );
2214
- }, ta = ({ absence: e, announces: t, announceFailure: n }) => {
2215
- const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, a = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
2190
+ }, fl = ({ absence: e, announces: t, announceFailure: n }) => {
2191
+ const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, l = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
2216
2192
  switch (te(() => {
2217
2193
  t && i !== null && o.announce(r.folderReadmeMissing(se(i)));
2218
2194
  }, [t, i, o, r]), te(() => {
2219
- a !== null && u !== null && n(r.documentFailed(se(a), le(r, u.reason)));
2220
- }, [a, u, n, r]), e.kind) {
2195
+ l !== null && u !== null && n(r.documentFailed(se(l), ae(r, u.reason)));
2196
+ }, [l, u, n, r]), e.kind) {
2221
2197
  case "empty":
2222
- return /* @__PURE__ */ d(ye, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
2198
+ return /* @__PURE__ */ c(Se, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
2223
2199
  case "loading":
2224
- return /* @__PURE__ */ d(ut, { label: r.documentRegion });
2200
+ return /* @__PURE__ */ c(ht, { label: r.documentRegion });
2225
2201
  case "no-readme":
2226
- return /* @__PURE__ */ d(ye, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
2202
+ return /* @__PURE__ */ c(Se, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
2227
2203
  case "failure":
2228
- return /* @__PURE__ */ d(ye, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
2204
+ return /* @__PURE__ */ c(Se, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(ve, { scrollerProps: pt, children: /* @__PURE__ */ c(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
2229
2205
  }
2230
- }, ut = ({ label: e }) => {
2206
+ }, ht = ({ label: e }) => {
2231
2207
  const { labels: t } = D();
2232
- return /* @__PURE__ */ $(ye, { kind: "loading", label: e, stale: !1, busy: !0, children: [
2233
- /* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: ct.map((n) => /* @__PURE__ */ d("span", {}, n)) }),
2234
- /* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: t.documentLoading })
2208
+ return /* @__PURE__ */ F(Se, { kind: "loading", label: e, stale: !1, busy: !0, children: [
2209
+ /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: mt.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
2210
+ /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
2235
2211
  ] });
2236
- }, Vt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), na = ({ path: e, document: t, viewer: n, editing: r }) => {
2237
- const { reportMathDiagnostics: o, edits: i } = D(), a = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = $i(), m = qi(), f = U(() => o === void 0 ? void 0 : (l) => o(e, l), [o, e]), c = _(null), { editable: h, doubleClick: g, region: E, paneScroll: k, stale: R } = r;
2238
- j(() => {
2212
+ }, Kt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), ml = ({ path: e, document: t, viewer: n, editing: r }) => {
2213
+ const { reportMathDiagnostics: o, edits: i } = D(), l = H(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = Hi(), m = Ui(), f = H(() => o === void 0 ? void 0 : (a) => o(e, a), [o, e]), d = q(null), { editable: h, doubleClick: v, region: E, paneScroll: k, stale: R } = r;
2214
+ V(() => {
2239
2215
  if (h)
2240
2216
  return i.bindView(e, {
2241
2217
  anchor: () => {
2242
- const l = c.current, s = E(), v = l === null ? null : l.querySelector(_e);
2243
- return l === null || s === null || v === null ? null : yo(l, k.scrollerOf(s, v));
2218
+ const a = d.current, s = E(), w = a === null ? null : a.querySelector(_e);
2219
+ return a === null || s === null || w === null ? null : Mo(a, k.scrollerOf(s, w));
2244
2220
  }
2245
2221
  });
2246
2222
  }, [i, e, h, E, k]);
2247
- const T = (l) => {
2248
- const s = c.current, { target: v } = l;
2249
- !g || s === null || !(v instanceof Element) || !Eo(v) || (l.stopPropagation(), i.start(e, So(v, s, s.ownerDocument.getSelection())));
2250
- }, A = _(null), L = _(R);
2251
- j(() => {
2252
- L.current = R;
2223
+ const T = (a) => {
2224
+ const s = d.current, { target: w } = a;
2225
+ !v || s === null || !(w instanceof Element) || !Oo(w) || (a.stopPropagation(), i.start(e, Co(w, s, s.ownerDocument.getSelection())));
2226
+ }, N = q(null), M = q(R);
2227
+ V(() => {
2228
+ M.current = R;
2253
2229
  });
2254
- const b = ae((l) => {
2255
- const s = c.current, v = E(), O = s === null ? null : Oo(s, l.line);
2256
- if (v === null || O === null) return !1;
2257
- const M = k.scrollerOf(v, O);
2258
- return M.scrollTop += Co(O, l.line) - l.clientTop, !0;
2259
- }), w = ae((l) => {
2230
+ const b = le((a) => {
2231
+ const s = d.current, w = E(), O = s === null ? null : Po(s, a.line);
2232
+ if (w === null || O === null) return !1;
2233
+ const L = k.scrollerOf(w, O);
2234
+ return L.scrollTop += $o(O, a.line) - a.clientTop, !0;
2235
+ }), g = le((a) => {
2260
2236
  const s = E();
2261
2237
  if (s === null) return;
2262
- const v = () => {
2263
- for (const M of Vt) s.removeEventListener(M, O, !0);
2264
- A.current?.release === v && (A.current = null);
2265
- }, O = () => v();
2266
- for (const M of Vt) s.addEventListener(M, O, { capture: !0, passive: !0 });
2267
- A.current = { point: l, release: v };
2238
+ const w = () => {
2239
+ for (const L of Kt) s.removeEventListener(L, O, !0);
2240
+ N.current?.release === w && (N.current = null);
2241
+ }, O = () => w();
2242
+ for (const L of Kt) s.addEventListener(L, O, { capture: !0, passive: !0 });
2243
+ N.current = { point: a, release: w };
2268
2244
  });
2269
- return j(() => {
2270
- const l = i.takeReturn(e);
2271
- if (l !== null)
2245
+ return V(() => {
2246
+ const a = i.takeReturn(e);
2247
+ if (a !== null)
2272
2248
  return queueMicrotask(() => {
2273
- b(l) && L.current && w(l);
2274
- }), () => A.current?.release();
2275
- }, [i, e]), j(() => {
2276
- const l = A.current;
2277
- l === null || R || (l.release(), b(l.point));
2249
+ b(a) && M.current && g(a);
2250
+ }), () => N.current?.release();
2251
+ }, [i, e]), V(() => {
2252
+ const a = N.current;
2253
+ a === null || R || (a.release(), b(a.point));
2278
2254
  }, [t, R]),
2279
- /* @__PURE__ */ d("div", { ref: c, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ d(ln, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: a, content: null }) });
2280
- }, Pn = ({ document: e, viewer: t }) => {
2255
+ /* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(fn, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: l, content: null }) });
2256
+ }, jn = ({ document: e, viewer: t }) => {
2281
2257
  const { labels: n } = D();
2282
- return /* @__PURE__ */ $(Pe, { children: [
2283
- /* @__PURE__ */ d(qe, { name: e.name, openUrl: nr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ d(uo, {}), children: e.truncated ? null : /* @__PURE__ */ d(Vo, { text: e.text }) }),
2284
- e.truncated ? /* @__PURE__ */ d("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
2285
- /* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(ln, { ...t, parseResult: null, content: e.text }) })
2258
+ return /* @__PURE__ */ F($e, { children: [
2259
+ /* @__PURE__ */ c(qe, { name: e.name, openUrl: cr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(wo, {}), children: e.truncated ? null : /* @__PURE__ */ c(Xo, { text: e.text }) }),
2260
+ e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
2261
+ /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(fn, { ...t, parseResult: null, content: e.text }) })
2286
2262
  ] });
2287
- }, ra = ({ path: e, name: t, viewer: n }) => {
2288
- const { data: r, documents: o, announcer: i, labels: a } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, c] = z(0), h = U(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [g, E] = z(null), k = ae((T) => {
2289
- E(T), T.kind === "failure" && i.announce(a.documentFailed(t, le(a, T.failure.reason)));
2263
+ }, Wt = ({ path: e, name: t, viewer: n }) => {
2264
+ const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] = B(0), h = H(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [v, E] = B(null), k = le((T) => {
2265
+ E(T), T.kind === "failure" && i.announce(l.documentFailed(t, ae(l, T.failure.reason)));
2290
2266
  });
2291
2267
  te(() => {
2292
2268
  const T = new AbortController();
2293
- return r.text(h.path, T.signal).then((A) => {
2294
- "kind" in A && k(A);
2269
+ return r.text(h.path, T.signal).then((N) => {
2270
+ "kind" in N && k(N);
2295
2271
  }), () => T.abort();
2296
2272
  }, [r, h]);
2297
- const R = P(() => c((T) => T + 1), []);
2298
- return g === null ? /* @__PURE__ */ $(Pe, { children: [
2299
- /* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: ct.map((T) => /* @__PURE__ */ d("span", {}, T)) }),
2300
- /* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: a.markupLoading })
2301
- ] }) : g.kind === "failure" ? /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: g.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ d(Pn, { document: g, viewer: n });
2302
- }, ft = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), oa = Object.freeze({ reason: "failed" }), ia = (e) => /* @__PURE__ */ d(
2303
- ho,
2273
+ const R = P(() => d((T) => T + 1), []);
2274
+ return v === null ? /* @__PURE__ */ F($e, { children: [
2275
+ /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: mt.map((T) => /* @__PURE__ */ c("span", {}, T)) }),
2276
+ /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: l.markupLoading })
2277
+ ] }) : v.kind === "failure" ? /* @__PURE__ */ c(ve, { scrollerProps: pt, children: /* @__PURE__ */ c(me, { failure: v.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(jn, { document: v, viewer: n });
2278
+ }, pt = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), hl = Object.freeze({ reason: "failed" }), pl = (e) => /* @__PURE__ */ c(
2279
+ yo,
2304
2280
  {
2305
- fallback: (t) => /* @__PURE__ */ d("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ d(me, { failure: oa, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
2306
- children: /* @__PURE__ */ d(
2281
+ fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(me, { failure: hl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
2282
+ children: /* @__PURE__ */ c(
2307
2283
  ke,
2308
2284
  {
2309
- fallback: /* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: ct.map((t) => /* @__PURE__ */ d("span", {}, t)) }),
2310
- children: /* @__PURE__ */ d(mo, { ...e })
2285
+ fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: mt.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
2286
+ children: /* @__PURE__ */ c(Eo, { ...e })
2311
2287
  }
2312
2288
  )
2313
2289
  }
2314
- ), aa = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
2290
+ ), vl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
2315
2291
  switch (t.kind) {
2316
2292
  case "markdown": {
2317
- const { session: a, layout: u, region: m, paneScroll: f, stale: c } = i;
2318
- if (n === "edit" && a !== void 0) return /* @__PURE__ */ d(ia, { path: e, name: t.name, session: a, layout: u, viewer: r, region: m, paneScroll: f });
2319
- if (n === "markup") return /* @__PURE__ */ d(ra, { path: e, name: t.name, viewer: r });
2293
+ const { session: l, layout: u, region: m, paneScroll: f, stale: d } = i;
2294
+ if (n === "edit" && l !== void 0) return /* @__PURE__ */ c(pl, { path: e, name: t.name, session: l, layout: u, viewer: r, region: m, paneScroll: f });
2295
+ if (n === "markup") return /* @__PURE__ */ c(Wt, { path: e, name: t.name, viewer: r });
2320
2296
  const h = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
2321
- return /* @__PURE__ */ d(na, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && u === "fill", region: m, paneScroll: f, stale: c } });
2297
+ return /* @__PURE__ */ c(ml, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && u === "fill", region: m, paneScroll: f, stale: d } });
2322
2298
  }
2323
2299
  case "text":
2324
- return /* @__PURE__ */ d(Pn, { document: t, viewer: r });
2300
+ return /* @__PURE__ */ c(jn, { document: t, viewer: r });
2325
2301
  case "image":
2326
- return /* @__PURE__ */ d(Ti, { document: t });
2302
+ return n === "markup" && ft(t) === "svg" ? /* @__PURE__ */ c(Wt, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(Ni, { document: t });
2327
2303
  case "media":
2328
- return /* @__PURE__ */ d(Yi, { document: t });
2304
+ return /* @__PURE__ */ c(il, { document: t });
2329
2305
  case "file":
2330
- return /* @__PURE__ */ d(Qo, { document: t });
2306
+ return /* @__PURE__ */ c(li, { document: t });
2331
2307
  case "failure":
2332
- return /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
2308
+ return /* @__PURE__ */ c(ve, { scrollerProps: pt, children: /* @__PURE__ */ c(me, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
2333
2309
  default: {
2334
- const a = t;
2335
- throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(a)}`);
2310
+ const l = t;
2311
+ throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
2336
2312
  }
2337
2313
  }
2338
- }, la = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', sa = (e, t, n) => {
2339
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Cn(e, n), r === void 0 ? null : On(e, r.id), e.querySelector(_e), e.querySelector(la)];
2314
+ }, gl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', wl = (e, t, n) => {
2315
+ const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : $n(e, n), r === void 0 ? null : Pn(e, r.id), e.querySelector(_e), e.querySelector(gl)];
2340
2316
  for (const i of o)
2341
- if (i instanceof HTMLElement && yn(i)) return i;
2317
+ if (i instanceof HTMLElement && Mn(i)) return i;
2342
2318
  return null;
2343
- }, Zt = (e, t, n) => {
2319
+ }, Yt = (e, t, n) => {
2344
2320
  const { activeElement: r, body: o } = e.ownerDocument, i = r === null || r === o;
2345
- t instanceof HTMLElement && n && (i || e.contains(r)) && yn(t);
2346
- }, da = (e) => {
2347
- const t = _(!1);
2348
- return j(() => {
2321
+ t instanceof HTMLElement && n && (i || e.contains(r)) && Mn(t);
2322
+ }, bl = (e) => {
2323
+ const t = q(!1);
2324
+ return V(() => {
2349
2325
  const n = e.current;
2350
2326
  if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
2351
2327
  const r = n.ownerDocument, o = r.defaultView;
2352
2328
  if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
2353
- let i = !1, a;
2354
- const u = (g) => {
2355
- i = !(g.target instanceof Node && n.contains(g.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(a), a = setTimeout(() => {
2329
+ let i = !1, l;
2330
+ const u = (v) => {
2331
+ i = !(v.target instanceof Node && n.contains(v.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(l), l = setTimeout(() => {
2356
2332
  i = !1;
2357
2333
  }, 0);
2358
- }, m = (g) => {
2359
- t.current = g.target instanceof Node && n.contains(g.target);
2360
- }, f = (g) => {
2361
- g.relatedTarget === null && i && (t.current = !1);
2362
- }, c = () => {
2363
- const { activeElement: g, body: E } = r;
2364
- g !== null && g !== E && (t.current = n.contains(g));
2334
+ }, m = (v) => {
2335
+ t.current = v.target instanceof Node && n.contains(v.target);
2336
+ }, f = (v) => {
2337
+ v.relatedTarget === null && i && (t.current = !1);
2338
+ }, d = () => {
2339
+ const { activeElement: v, body: E } = r;
2340
+ v !== null && v !== E && (t.current = n.contains(v));
2365
2341
  }, h = () => {
2366
2342
  i && !n.contains(r.activeElement) && (t.current = !1);
2367
2343
  };
2368
- return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur", c), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
2369
- clearTimeout(a), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", c), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
2344
+ return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur", d), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
2345
+ clearTimeout(l), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", d), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
2370
2346
  };
2371
2347
  }, [e]), t;
2372
- }, ca = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: a, navigation: u, fragment: m, paneScroll: f, announces: c, announceFailure: h, onDocumentShown: g }) => {
2373
- const { labels: E, announcer: k, documents: R } = D(), { document: T } = t, A = _(null), L = _(null), b = _(null), w = _(0), l = da(A), s = _({ path: e, document: T }), v = _(null), O = P(
2348
+ }, El = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown: v }) => {
2349
+ const { labels: E, announcer: k, documents: R } = D(), { document: T } = t, N = q(null), M = q(null), b = q(null), g = q(0), a = bl(N), s = q({ path: e, document: T }), w = q(null), O = P(
2374
2350
  (Z) => {
2375
- const X = A.current, Q = qt(X, Z, f);
2376
- X !== null && Q !== null && Zt(X, Q, l.current);
2351
+ const Y = N.current, Q = jt(Y, Z, f);
2352
+ Y !== null && Q !== null && Yt(Y, Q, a.current);
2377
2353
  },
2378
- [f, l]
2379
- ), M = P(
2380
- (Z, X) => {
2381
- const Q = w.current;
2354
+ [f, a]
2355
+ ), L = P(
2356
+ (Z, Y) => {
2357
+ const Q = g.current;
2382
2358
  setTimeout(() => {
2383
- !X.defaultPrevented && w.current === Q && O(Z);
2359
+ !Y.defaultPrevented && g.current === Q && O(Z);
2384
2360
  }, 0);
2385
2361
  },
2386
2362
  [O]
2387
- ), N = P(
2363
+ ), A = P(
2388
2364
  (Z) => {
2389
2365
  setTimeout(() => {
2390
2366
  Z.defaultPrevented || O("#");
2391
2367
  }, 0);
2392
2368
  },
2393
2369
  [O]
2394
- ), q = U(() => ({ navigation: u, currentPath: e, scrollWithin: O, followSameUrlJump: M, followEmptyFragment: N }), [u, e, O, M, N]), W = P(() => R.retry(e), [R, e]), G = Ao(R, Mi), I = bn(e), J = I !== void 0 ? "edit" : n ? "markup" : "rendered", H = T.kind === "markdown" ? J : void 0, ne = P(() => A.current, []), p = U(() => ({ session: I, layout: i, region: ne, paneScroll: f, stale: r }), [I, i, ne, f, r]), S = H === "edit" ? !1 : r, x = re(he), C = H === "edit" && i === "fill" ? "fill" : x, F = ae((Z, X) => {
2395
- const Q = L.current;
2396
- if (Q !== null && Q.path === Z && Q.snapshot === X) return;
2397
- L.current = { path: Z, snapshot: X };
2398
- const oe = X.document;
2370
+ ), I = H(() => ({ navigation: u, currentPath: e, scrollWithin: O, followSameUrlJump: L, followEmptyFragment: A }), [u, e, O, L, A]), K = P(() => R.retry(e), [R, e]), G = Io(R, Ii), z = Rn(e), X = z !== void 0 ? "edit" : n ? "markup" : "rendered", j = ft(T) === null ? void 0 : X, re = P(() => N.current, []), p = H(() => ({ session: z, layout: i, region: re, paneScroll: f, stale: r }), [z, i, re, f, r]), y = j === "edit" ? !1 : r, x = ne(he), C = j === "edit" && i === "fill" ? "fill" : x, $ = le((Z, Y) => {
2371
+ const Q = M.current;
2372
+ if (Q !== null && Q.path === Z && Q.snapshot === Y) return;
2373
+ M.current = { path: Z, snapshot: Y };
2374
+ const oe = Y.document;
2399
2375
  if (oe.kind === "failure") {
2400
- R.noteFailureShown(X) && h(E.documentFailed(se(Z), le(E, oe.failure.reason)));
2376
+ R.noteFailureShown(Y) && h(E.documentFailed(se(Z), ae(E, oe.failure.reason)));
2401
2377
  return;
2402
2378
  }
2403
- g?.(Z, oe), c && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && k.announce(E.documentShown(oe.name));
2379
+ v?.(Z, oe), d && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && k.announce(E.documentShown(oe.name));
2404
2380
  });
2405
2381
  te(() => {
2406
- F(e, t);
2382
+ $(e, t);
2407
2383
  }, [e, t]);
2408
- const B = ae(() => {
2384
+ const _ = le(() => {
2409
2385
  m.kind === "panel" && m.consume();
2410
- }), K = ae((Z) => {
2411
- const X = A.current;
2412
- if (X === null || !l.current) return null;
2413
- const { activeElement: Q, body: oe } = X.ownerDocument;
2414
- return Q !== null && Q !== oe ? null : sa(X, T, Z);
2415
- }), V = ae((Z) => {
2416
- const X = A.current;
2417
- X !== null && Zt(X, Z, l.current);
2418
- }), ie = ae((Z) => f.reveal(Z)), ht = ae((Z) => qt(A.current, Z, f));
2386
+ }), W = le((Z) => {
2387
+ const Y = N.current;
2388
+ if (Y === null || !a.current) return null;
2389
+ const { activeElement: Q, body: oe } = Y.ownerDocument;
2390
+ return Q !== null && Q !== oe ? null : wl(Y, T, Z);
2391
+ }), U = le((Z) => {
2392
+ const Y = N.current;
2393
+ Y !== null && Yt(Y, Z, a.current);
2394
+ }), ie = le((Z) => f.reveal(Z)), gt = le((Z) => jt(N.current, Z, f));
2419
2395
  return te(() => {
2420
2396
  if (r) return;
2421
- const Z = s.current.path !== e, X = Z || s.current.document !== T;
2397
+ const Z = s.current.path !== e, Y = Z || s.current.document !== T;
2422
2398
  s.current = { path: e, document: T };
2423
- const Q = v.current !== e;
2424
- v.current = e;
2399
+ const Q = w.current !== e;
2400
+ w.current = e;
2425
2401
  let oe = null;
2426
- m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation, w.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, B());
2427
- const pt = () => {
2428
- const He = oe === null ? null : ht(oe);
2429
- if (!X) {
2430
- He !== null && V(He);
2402
+ m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation, g.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, _());
2403
+ const wt = () => {
2404
+ const He = oe === null ? null : gt(oe);
2405
+ if (!Y) {
2406
+ He !== null && U(He);
2431
2407
  return;
2432
2408
  }
2433
- const vt = K(m.fragment);
2434
- Z && He === null && vt !== null && ie(vt);
2409
+ const bt = W(m.fragment);
2410
+ Z && He === null && bt !== null && ie(bt);
2435
2411
  };
2436
- Q ? queueMicrotask(pt) : pt();
2437
- }, [m, e, T, r]), /* @__PURE__ */ d(he, { value: C, children: /* @__PURE__ */ d(ye, { kind: T.kind, view: H, label: a(e, T), stale: S, busy: S, frameRef: A, intent: G, children: /* @__PURE__ */ d(An, { value: q, children: /* @__PURE__ */ d(Oi, { children: /* @__PURE__ */ d(aa, { path: e, document: T, view: J, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2438
- }, mt = Object.freeze({ kind: "skeleton" }), ua = (e, t, n, r, o) => {
2412
+ Q ? queueMicrotask(wt) : wt();
2413
+ }, [m, e, T, r]), /* @__PURE__ */ c(he, { value: C, children: /* @__PURE__ */ c(Se, { kind: T.kind, view: j, label: l(e, T), stale: y, busy: y, frameRef: N, intent: G, children: /* @__PURE__ */ c(In, { value: I, children: /* @__PURE__ */ c($i, { children: /* @__PURE__ */ c(vl, { path: e, document: T, view: X, viewer: o, onRetry: K, editing: p }, e) }) }) }) });
2414
+ }, vt = Object.freeze({ kind: "skeleton" }), yl = (e, t, n, r, o) => {
2439
2415
  if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
2440
2416
  const i = ue(t);
2441
2417
  if (i !== null) return { kind: "document", path: e, snapshot: i, stale: !0 };
2442
2418
  if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
2443
- const a = n === null || n === e ? null : ue(r);
2444
- return n === null || a === null ? mt : { kind: "document", path: n, snapshot: a, stale: !0 };
2445
- }, fa = (e, t) => t.status === "deferred" ? mt : { kind: "document", path: e, snapshot: t, stale: !1 }, ma = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2446
- const o = t.kind === "streaming" ? fa(t.path, re(t.promise)) : t;
2447
- return o.kind !== "document" ? /* @__PURE__ */ d(ut, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ d(ca, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2448
- }, Fn = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: a, announces: u, announceFailure: m, onDocumentShown: f }) => {
2449
- const { config: c, labels: h, locale: g, theme: E, documents: k } = D(), R = br(), T = _(!1);
2450
- j(() => {
2451
- T.current = !0;
2419
+ const l = n === null || n === e ? null : ue(r);
2420
+ return n === null || l === null ? vt : { kind: "document", path: n, snapshot: l, stale: !0 };
2421
+ }, Sl = (e, t) => t.status === "deferred" ? vt : { kind: "document", path: e, snapshot: t, stale: !1 }, xl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2422
+ const o = t.kind === "streaming" ? Sl(t.path, ne(t.promise)) : t;
2423
+ return o.kind !== "document" ? /* @__PURE__ */ c(ht, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(El, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2424
+ }, zn = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: l, announces: u, announceFailure: m, onDocumentShown: f }) => {
2425
+ const { config: d, labels: h, locale: v, theme: E, documents: k, data: R } = D(), T = Rr(), N = q(!1);
2426
+ V(() => {
2427
+ N.current = !0;
2452
2428
  }, []);
2453
- const [A, L] = z(null), [b, w] = z(n), l = P(() => e === null ? void 0 : k.peek(e), [k, e]), s = ee(k.subscribe, l, l), v = P(() => A === null ? void 0 : k.peek(A), [k, A]), O = ee(k.subscribe, v, v);
2454
- j(() => e === null ? void 0 : k.open(e), [k, e]), j(() => A === null ? void 0 : k.retain(A), [k, A]);
2455
- const M = e === null ? mt : ua(e, s, A, O, !T.current), N = e === null ? null : M.kind === "document" && !M.stale ? M.path : A;
2456
- N !== A && L(N);
2457
- const q = M.kind !== "document" || M.path === e;
2458
- q && n !== b && w(n);
2459
- const W = U(() => Ji(h), [h]), G = U(() => [...c.iframeHosts], [c]), I = o.kind === "panel", J = U(
2429
+ const [M, b] = B(null), [g, a] = B(n), s = P(() => e === null ? void 0 : k.peek(e), [k, e]), w = ee(k.subscribe, s, s), O = P(() => M === null ? void 0 : k.peek(M), [k, M]), L = ee(k.subscribe, O, O);
2430
+ V(() => e === null ? void 0 : k.open(e), [k, e]), V(() => M === null ? void 0 : k.retain(M), [k, M]);
2431
+ const A = e === null ? vt : yl(e, w, M, L, !N.current), I = e === null ? null : A.kind === "document" && !A.stale ? A.path : M;
2432
+ I !== M && b(I);
2433
+ const K = A.kind !== "document" || A.path === e;
2434
+ K && n !== g && a(n);
2435
+ const G = H(() => cl(h, v), [h, v]), z = H(() => ({ read: (x, C) => Di(R, x, C) }), [R]), X = H(() => [...d.iframeHosts], [d]), j = o.kind === "panel", re = H(
2460
2436
  () => ({
2461
- labels: W,
2462
- spreadsheetLocale: g,
2437
+ labels: G,
2438
+ spreadsheetLocale: v,
2463
2439
  emptyMessage: h.documentEmpty,
2464
2440
  theme: E,
2465
- availableStyles: c.documentStyles,
2466
- iFrameAllowedDomains: G,
2467
- embeds: c.embeds,
2468
- linkComponent: Fi,
2469
- toolbar: R,
2441
+ availableStyles: d.documentStyles,
2442
+ iFrameAllowedDomains: X,
2443
+ embeds: d.embeds,
2444
+ linkComponent: Vi,
2445
+ toolbar: T,
2470
2446
  style: r.style,
2471
2447
  onStyleChange: r.onStyleChange,
2472
2448
  align: r.align,
@@ -2477,51 +2453,52 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2477
2453
  padding: r.padding,
2478
2454
  width: r.width === void 0 ? void 0 : `min(${r.width}, 100%)`,
2479
2455
  maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
2480
- renderScrollBar: I ? void 0 : xn
2456
+ renderScrollBar: j ? void 0 : Ln,
2457
+ imageSource: z
2481
2458
  }),
2482
- [W, g, h.documentEmpty, E, c.documentStyles, G, c.embeds, R, r, I]
2483
- ), H = P((p, S) => I ? S === null || S.kind === "failure" ? se(p) : S.name : h.documentRegion, [I, h.documentRegion]), ne = I ? "content" : "fill";
2484
- return e === null ? /* @__PURE__ */ d(he, { value: ne, children: /* @__PURE__ */ d(ta, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ d(he, { value: ne, children: /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d(ut, { label: H(e, null) }), children: /* @__PURE__ */ d(
2485
- ma,
2459
+ [G, v, h.documentEmpty, E, d.documentStyles, X, d.embeds, T, r, j, z]
2460
+ ), p = P((x, C) => j ? C === null || C.kind === "failure" ? se(x) : C.name : h.documentRegion, [j, h.documentRegion]), y = j ? "content" : "fill";
2461
+ return e === null ? /* @__PURE__ */ c(he, { value: y, children: /* @__PURE__ */ c(fl, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ c(he, { value: y, children: /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c(ht, { label: p(e, null) }), children: /* @__PURE__ */ c(
2462
+ xl,
2486
2463
  {
2487
2464
  requestedPath: e,
2488
- content: M,
2489
- markup: q ? n : b,
2490
- viewer: J,
2465
+ content: A,
2466
+ markup: K ? n : g,
2467
+ viewer: re,
2491
2468
  editLayout: r.editLayout,
2492
- regionLabel: H,
2469
+ regionLabel: p,
2493
2470
  navigation: o,
2494
2471
  fragment: i,
2495
- paneScroll: a,
2472
+ paneScroll: l,
2496
2473
  announces: u,
2497
2474
  announceFailure: m,
2498
2475
  onDocumentShown: f
2499
2476
  }
2500
2477
  ) }) });
2501
- }, ha = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2502
- const { config: i, viewSettings: a, announcer: u } = D(), m = Le((M) => M.style), f = Le((M) => M.align), c = $e(), h = nn(), g = at(), { view: E, overrides: k, embed: R } = r, T = P(
2503
- (M) => {
2504
- if (g.kind !== "location") return;
2505
- const N = ea(i, g.location, M);
2506
- N !== null && c(N, "browse");
2478
+ }, kl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2479
+ const { config: i, viewSettings: l, announcer: u } = D(), m = Ne((L) => L.style), f = Ne((L) => L.align), d = Ie(), h = sn(), v = st(), { view: E, overrides: k, embed: R } = r, T = P(
2480
+ (L) => {
2481
+ if (v.kind !== "location") return;
2482
+ const A = ul(i, v.location, L);
2483
+ A !== null && d(A, "browse");
2507
2484
  },
2508
- [i, c, g]
2509
- ), A = P(
2510
- (M) => {
2511
- a.update({ style: M }), T("style");
2485
+ [i, d, v]
2486
+ ), N = P(
2487
+ (L) => {
2488
+ l.update({ style: L }), T("style");
2512
2489
  },
2513
- [a, T]
2514
- ), L = P(
2515
- (M) => {
2516
- a.update({ align: M }), T("align");
2490
+ [l, T]
2491
+ ), M = P(
2492
+ (L) => {
2493
+ l.update({ align: L }), T("align");
2517
2494
  },
2518
- [a, T]
2519
- ), b = Nn(i, k.style, m), w = Dn(k.align, f), l = U(
2495
+ [l, T]
2496
+ ), b = _n(i, k.style, m), g = Bn(k.align, f), a = H(
2520
2497
  () => ({
2521
2498
  style: b,
2522
- onStyleChange: A,
2523
- align: w,
2524
- onAlignChange: L,
2499
+ onStyleChange: N,
2500
+ align: g,
2501
+ onAlignChange: M,
2525
2502
  showToc: R.showToc !== !1,
2526
2503
  showStyle: R.showStyle !== !1,
2527
2504
  showAlign: R.showAlign !== !1,
@@ -2530,16 +2507,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2530
2507
  maxWidth: R.maxWidth,
2531
2508
  editLayout: "fill"
2532
2509
  }),
2533
- [b, A, w, L, R]
2534
- ), s = U(() => ({ kind: "page", view: E, overrides: k, embed: R }), [E, k, R]), v = U(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), O = P((M) => u.announce(M), [u]);
2535
- return /* @__PURE__ */ d(Fn, { path: e, absence: t, markup: n, display: l, navigation: s, fragment: v, paneScroll: ai, announces: !0, announceFailure: O, onDocumentShown: o });
2536
- }, pa = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2537
- const { config: i, viewSettings: a } = D(), u = Le((s) => s.style), m = Le((s) => s.align), [f, c] = z(() => Nn(i, void 0, u)), h = Dn(void 0, m), g = P((s) => a.update({ align: s }), [a]), { maximized: E, onDocumentLink: k, pendingHash: R, onHashConsumed: T, announceFailure: A, paneScroll: L } = r, b = U(
2510
+ [b, N, g, M, R]
2511
+ ), s = H(() => ({ kind: "page", view: E, overrides: k, embed: R }), [E, k, R]), w = H(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), O = P((L) => u.announce(L), [u]);
2512
+ return /* @__PURE__ */ c(zn, { path: e, absence: t, markup: n, display: a, navigation: s, fragment: w, paneScroll: mi, announces: !0, announceFailure: O, onDocumentShown: o });
2513
+ }, Tl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2514
+ const { config: i, viewSettings: l } = D(), u = Ne((s) => s.style), m = Ne((s) => s.align), [f, d] = B(() => _n(i, void 0, u)), h = Bn(void 0, m), v = P((s) => l.update({ align: s }), [l]), { maximized: E, onDocumentLink: k, pendingHash: R, onHashConsumed: T, announceFailure: N, paneScroll: M } = r, b = H(
2538
2515
  () => ({
2539
2516
  style: f,
2540
- onStyleChange: c,
2517
+ onStyleChange: d,
2541
2518
  align: h,
2542
- onAlignChange: g,
2519
+ onAlignChange: v,
2543
2520
  showToc: E,
2544
2521
  showStyle: E,
2545
2522
  showAlign: E,
@@ -2548,16 +2525,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2548
2525
  maxWidth: void 0,
2549
2526
  editLayout: E ? "fill" : "content"
2550
2527
  }),
2551
- [f, h, g, E]
2552
- ), w = U(() => ({ kind: "panel", onDocumentLink: k }), [k]), l = U(() => ({ kind: "panel", fragment: R, consume: T }), [R, T]);
2553
- return /* @__PURE__ */ d(Fn, { path: e, absence: t, markup: n, display: b, navigation: w, fragment: l, paneScroll: L, announces: !1, announceFailure: A, onDocumentShown: o });
2554
- }, va = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ d(ha, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ d(pa, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
2555
- function wa({
2528
+ [f, h, v, E]
2529
+ ), g = H(() => ({ kind: "panel", onDocumentLink: k }), [k]), a = H(() => ({ kind: "panel", fragment: R, consume: T }), [R, T]);
2530
+ return /* @__PURE__ */ c(zn, { path: e, absence: t, markup: n, display: b, navigation: g, fragment: a, paneScroll: M, announces: !1, announceFailure: N, onDocumentShown: o });
2531
+ }, Rl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(kl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(Tl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
2532
+ function Ol({
2556
2533
  title: e,
2557
2534
  titleId: t,
2558
2535
  ...n
2559
2536
  }, r) {
2560
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2537
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2561
2538
  xmlns: "http://www.w3.org/2000/svg",
2562
2539
  viewBox: "0 0 24 24",
2563
2540
  fill: "currentColor",
@@ -2565,21 +2542,21 @@ function wa({
2565
2542
  "data-slot": "icon",
2566
2543
  ref: r,
2567
2544
  "aria-labelledby": t
2568
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2545
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2569
2546
  id: t
2570
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2547
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2571
2548
  fillRule: "evenodd",
2572
2549
  d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
2573
2550
  clipRule: "evenodd"
2574
2551
  }));
2575
2552
  }
2576
- const ga = /* @__PURE__ */ y.forwardRef(wa);
2577
- function ba({
2553
+ const Cl = /* @__PURE__ */ S.forwardRef(Ol);
2554
+ function Ml({
2578
2555
  title: e,
2579
2556
  titleId: t,
2580
2557
  ...n
2581
2558
  }, r) {
2582
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2559
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2583
2560
  xmlns: "http://www.w3.org/2000/svg",
2584
2561
  viewBox: "0 0 24 24",
2585
2562
  fill: "currentColor",
@@ -2587,21 +2564,21 @@ function ba({
2587
2564
  "data-slot": "icon",
2588
2565
  ref: r,
2589
2566
  "aria-labelledby": t
2590
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2567
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2591
2568
  id: t
2592
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2569
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2593
2570
  fillRule: "evenodd",
2594
2571
  d: "M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",
2595
2572
  clipRule: "evenodd"
2596
2573
  }));
2597
2574
  }
2598
- const $n = /* @__PURE__ */ y.forwardRef(ba);
2599
- function Ea({
2575
+ const Vn = /* @__PURE__ */ S.forwardRef(Ml);
2576
+ function Ll({
2600
2577
  title: e,
2601
2578
  titleId: t,
2602
2579
  ...n
2603
2580
  }, r) {
2604
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2581
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2605
2582
  xmlns: "http://www.w3.org/2000/svg",
2606
2583
  viewBox: "0 0 24 24",
2607
2584
  fill: "currentColor",
@@ -2609,21 +2586,21 @@ function Ea({
2609
2586
  "data-slot": "icon",
2610
2587
  ref: r,
2611
2588
  "aria-labelledby": t
2612
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2589
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2613
2590
  id: t
2614
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2591
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2615
2592
  fillRule: "evenodd",
2616
2593
  d: "M15.75 2.25H21a.75.75 0 0 1 .75.75v5.25a.75.75 0 0 1-1.5 0V4.81L8.03 17.03a.75.75 0 0 1-1.06-1.06L19.19 3.75h-3.44a.75.75 0 0 1 0-1.5Zm-10.5 4.5a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5a1.5 1.5 0 0 0 1.5-1.5V10.5a.75.75 0 0 1 1.5 0v8.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h8.25a.75.75 0 0 1 0 1.5H5.25Z",
2617
2594
  clipRule: "evenodd"
2618
2595
  }));
2619
2596
  }
2620
- const Sa = /* @__PURE__ */ y.forwardRef(Ea);
2621
- function ya({
2597
+ const Al = /* @__PURE__ */ S.forwardRef(Ll);
2598
+ function Nl({
2622
2599
  title: e,
2623
2600
  titleId: t,
2624
2601
  ...n
2625
2602
  }, r) {
2626
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2603
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2627
2604
  xmlns: "http://www.w3.org/2000/svg",
2628
2605
  viewBox: "0 0 24 24",
2629
2606
  fill: "currentColor",
@@ -2631,25 +2608,25 @@ function ya({
2631
2608
  "data-slot": "icon",
2632
2609
  ref: r,
2633
2610
  "aria-labelledby": t
2634
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2611
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2635
2612
  id: t
2636
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2613
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2637
2614
  fillRule: "evenodd",
2638
2615
  d: "M11.47 13.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 0 0-1.06-1.06L12 11.69 5.03 4.72a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
2639
2616
  clipRule: "evenodd"
2640
- }), /* @__PURE__ */ y.createElement("path", {
2617
+ }), /* @__PURE__ */ S.createElement("path", {
2641
2618
  fillRule: "evenodd",
2642
2619
  d: "M11.47 19.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 1 0-1.06-1.06L12 17.69l-6.97-6.97a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
2643
2620
  clipRule: "evenodd"
2644
2621
  }));
2645
2622
  }
2646
- const xa = /* @__PURE__ */ y.forwardRef(ya);
2647
- function ka({
2623
+ const Dl = /* @__PURE__ */ S.forwardRef(Nl);
2624
+ function Pl({
2648
2625
  title: e,
2649
2626
  titleId: t,
2650
2627
  ...n
2651
2628
  }, r) {
2652
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2629
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2653
2630
  xmlns: "http://www.w3.org/2000/svg",
2654
2631
  viewBox: "0 0 24 24",
2655
2632
  fill: "currentColor",
@@ -2657,21 +2634,21 @@ function ka({
2657
2634
  "data-slot": "icon",
2658
2635
  ref: r,
2659
2636
  "aria-labelledby": t
2660
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2637
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2661
2638
  id: t
2662
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2639
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2663
2640
  fillRule: "evenodd",
2664
2641
  d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",
2665
2642
  clipRule: "evenodd"
2666
2643
  }));
2667
2644
  }
2668
- const Ta = /* @__PURE__ */ y.forwardRef(ka);
2669
- function Ra({
2645
+ const $l = /* @__PURE__ */ S.forwardRef(Pl);
2646
+ function Fl({
2670
2647
  title: e,
2671
2648
  titleId: t,
2672
2649
  ...n
2673
2650
  }, r) {
2674
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2651
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2675
2652
  xmlns: "http://www.w3.org/2000/svg",
2676
2653
  viewBox: "0 0 24 24",
2677
2654
  fill: "currentColor",
@@ -2679,23 +2656,23 @@ function Ra({
2679
2656
  "data-slot": "icon",
2680
2657
  ref: r,
2681
2658
  "aria-labelledby": t
2682
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2659
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2683
2660
  id: t
2684
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2661
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2685
2662
  fillRule: "evenodd",
2686
2663
  d: "M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
2687
2664
  clipRule: "evenodd"
2688
- }), /* @__PURE__ */ y.createElement("path", {
2665
+ }), /* @__PURE__ */ S.createElement("path", {
2689
2666
  d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
2690
2667
  }));
2691
2668
  }
2692
- const Oa = /* @__PURE__ */ y.forwardRef(Ra);
2693
- function Ca({
2669
+ const Il = /* @__PURE__ */ S.forwardRef(Fl);
2670
+ function ql({
2694
2671
  title: e,
2695
2672
  titleId: t,
2696
2673
  ...n
2697
2674
  }, r) {
2698
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2675
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2699
2676
  xmlns: "http://www.w3.org/2000/svg",
2700
2677
  viewBox: "0 0 24 24",
2701
2678
  fill: "currentColor",
@@ -2703,23 +2680,23 @@ function Ca({
2703
2680
  "data-slot": "icon",
2704
2681
  ref: r,
2705
2682
  "aria-labelledby": t
2706
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2683
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2707
2684
  id: t
2708
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2685
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2709
2686
  d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
2710
- }), /* @__PURE__ */ y.createElement("path", {
2687
+ }), /* @__PURE__ */ S.createElement("path", {
2711
2688
  fillRule: "evenodd",
2712
2689
  d: "M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",
2713
2690
  clipRule: "evenodd"
2714
2691
  }));
2715
2692
  }
2716
- const Ma = /* @__PURE__ */ y.forwardRef(Ca);
2717
- function Aa({
2693
+ const _l = /* @__PURE__ */ S.forwardRef(ql);
2694
+ function Bl({
2718
2695
  title: e,
2719
2696
  titleId: t,
2720
2697
  ...n
2721
2698
  }, r) {
2722
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2699
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2723
2700
  xmlns: "http://www.w3.org/2000/svg",
2724
2701
  viewBox: "0 0 24 24",
2725
2702
  fill: "currentColor",
@@ -2727,21 +2704,21 @@ function Aa({
2727
2704
  "data-slot": "icon",
2728
2705
  ref: r,
2729
2706
  "aria-labelledby": t
2730
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2707
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2731
2708
  id: t
2732
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2709
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2733
2710
  d: "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"
2734
- }), /* @__PURE__ */ y.createElement("path", {
2711
+ }), /* @__PURE__ */ S.createElement("path", {
2735
2712
  d: "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"
2736
2713
  }));
2737
2714
  }
2738
- const La = /* @__PURE__ */ y.forwardRef(Aa);
2739
- function Na({
2715
+ const jl = /* @__PURE__ */ S.forwardRef(Bl);
2716
+ function zl({
2740
2717
  title: e,
2741
2718
  titleId: t,
2742
2719
  ...n
2743
2720
  }, r) {
2744
- return /* @__PURE__ */ y.createElement("svg", Object.assign({
2721
+ return /* @__PURE__ */ S.createElement("svg", Object.assign({
2745
2722
  xmlns: "http://www.w3.org/2000/svg",
2746
2723
  viewBox: "0 0 24 24",
2747
2724
  fill: "currentColor",
@@ -2749,99 +2726,99 @@ function Na({
2749
2726
  "data-slot": "icon",
2750
2727
  ref: r,
2751
2728
  "aria-labelledby": t
2752
- }, n), e ? /* @__PURE__ */ y.createElement("title", {
2729
+ }, n), e ? /* @__PURE__ */ S.createElement("title", {
2753
2730
  id: t
2754
- }, e) : null, /* @__PURE__ */ y.createElement("path", {
2731
+ }, e) : null, /* @__PURE__ */ S.createElement("path", {
2755
2732
  d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
2756
2733
  }));
2757
2734
  }
2758
- const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId: n }) => {
2759
- const { labels: r, onEditGrant: o } = D(), [i, a] = z(!1), u = () => {
2760
- o === void 0 || i || (a(!0), o(e).then((m) => {
2735
+ const Vl = /* @__PURE__ */ S.forwardRef(zl), Hl = ({ href: e, onRetry: t, testId: n }) => {
2736
+ const { labels: r, onEditGrant: o } = D(), [i, l] = B(!1), u = () => {
2737
+ o === void 0 || i || (l(!0), o(e).then((m) => {
2761
2738
  m && t();
2762
- }).finally(() => a(!1)));
2739
+ }).finally(() => l(!1)));
2763
2740
  };
2764
- return /* @__PURE__ */ $("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
2765
- /* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
2766
- /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
2767
- /* @__PURE__ */ $("div", { className: "aqmx-edit-grant-actions", children: [
2768
- o === void 0 ? /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
2769
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": i, "data-testid": `${n}-open`, onClick: u, children: r.editGrantAction })
2741
+ return /* @__PURE__ */ F("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
2742
+ /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
2743
+ /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
2744
+ /* @__PURE__ */ F("div", { className: "aqmx-edit-grant-actions", children: [
2745
+ o === void 0 ? /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
2746
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": i, "data-testid": `${n}-open`, onClick: u, children: r.editGrantAction })
2770
2747
  ),
2771
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2748
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2772
2749
  ] })
2773
2750
  ] });
2774
- }, Fa = "Control+E Meta+E", $a = (e, t, n) => n && t ? "split" : e.view, Ut = (e, t, n, r) => {
2751
+ }, Ul = "Control+E Meta+E", Zl = (e, t, n) => n && t ? "split" : e.view, Xt = (e, t, n, r) => {
2775
2752
  if (n === "split") {
2776
2753
  e.setSideBySide(!0);
2777
2754
  return;
2778
2755
  }
2779
2756
  e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
2780
- }, Jl = (e) => e === "split" ? null : e, qa = (e) => e === "preview" ? "editor" : "preview", _a = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Ia = (e, t) => {
2757
+ }, as = (e) => e === "split" ? null : e, Gl = (e) => e === "preview" ? "editor" : "preview", Kl = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Wl = (e, t) => {
2781
2758
  if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
2782
2759
  const n = e.key.toLowerCase();
2783
2760
  return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
2784
- }, Gt = (e, t, n) => {
2761
+ }, Jt = (e, t, n) => {
2785
2762
  const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
2786
2763
  return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
2787
- }, Ba = ({ path: e, documentName: t, open: n, onClose: r }) => {
2788
- const { data: o, edits: i, labels: a, locale: u, announcer: m } = D(), f = xe(), [c, h] = z(null), [g, E] = z(0), [k, R] = z(null), [T, A] = z(null), L = U(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), b = P(() => {
2789
- R(null), A(null);
2790
- }, []), w = vn({ open: n, onOpen: b, onDismiss: r });
2764
+ }, Yl = ({ path: e, documentName: t, open: n, onClose: r }) => {
2765
+ const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = xe(), [d, h] = B(null), [v, E] = B(0), [k, R] = B(null), [T, N] = B(null), M = H(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), b = P(() => {
2766
+ R(null), N(null);
2767
+ }, []), g = xn({ open: n, onOpen: b, onDismiss: r });
2791
2768
  te(() => {
2792
2769
  if (!n) return;
2793
- const v = new AbortController();
2794
- return h(null), o.revisions(e, v.signal).then((O) => {
2770
+ const w = new AbortController();
2771
+ return h(null), o.revisions(e, w.signal).then((O) => {
2795
2772
  "kind" in O && h(O);
2796
- }), () => v.abort();
2797
- }, [n, o, e, g]), te(() => {
2773
+ }), () => w.abort();
2774
+ }, [n, o, e, v]), te(() => {
2798
2775
  if (!n || k === null) return;
2799
- const v = new AbortController();
2800
- return A(null), o.revision(e, k, v.signal).then((O) => {
2801
- "kind" in O && A(O);
2802
- }), () => v.abort();
2776
+ const w = new AbortController();
2777
+ return N(null), o.revision(e, k, w.signal).then((O) => {
2778
+ "kind" in O && N(O);
2779
+ }), () => w.abort();
2803
2780
  }, [n, o, e, k]);
2804
- const l = () => {
2805
- T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(a.historyRestored(t)), r());
2806
- }, s = c !== null && c.kind === "revisions" ? c.revisions.find((v) => v.id === k) : void 0;
2807
- return /* @__PURE__ */ d("dialog", { ...w, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ $("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2808
- /* @__PURE__ */ d("p", { id: f, className: "aqmx-confirm-title", children: a.historyTitle(t) }),
2809
- c === null ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: a.historyLoading }) : c.kind === "failure" ? /* @__PURE__ */ d(me, { failure: c.failure, alert: !1, onRetry: () => E((v) => v + 1), testId: "markdown-explorer-history-failure" }) : c.revisions.length === 0 ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: a.historyEmpty }) : /* @__PURE__ */ d("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: c.revisions.map((v) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ $("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": v.id === k, "data-testid": "markdown-explorer-history-entry", onClick: () => R(v.id), children: [
2810
- /* @__PURE__ */ d("span", { children: Gt(v, L, a.historyEntry) }),
2811
- v.current ? /* @__PURE__ */ d("span", { className: "aqmx-history-mark", children: a.historyCurrent }) : null,
2812
- v.kept ? /* @__PURE__ */ d("span", { className: "aqmx-history-mark", children: a.historyKept }) : null
2813
- ] }) }, v.id)) }),
2814
- k === null ? null : T === null ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", children: a.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ d(me, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2815
- /* @__PURE__ */ d("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? a.historyTitle(t) : Gt(s, L, a.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ d("pre", { children: T.text }) })
2781
+ const a = () => {
2782
+ T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(l.historyRestored(t)), r());
2783
+ }, s = d !== null && d.kind === "revisions" ? d.revisions.find((w) => w.id === k) : void 0;
2784
+ return /* @__PURE__ */ c("dialog", { ...g, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2785
+ /* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: l.historyTitle(t) }),
2786
+ d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => E((w) => w + 1), testId: "markdown-explorer-history-failure" }) : d.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: l.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: d.revisions.map((w) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": w.id === k, "data-testid": "markdown-explorer-history-entry", onClick: () => R(w.id), children: [
2787
+ /* @__PURE__ */ c("span", { children: Jt(w, M, l.historyEntry) }),
2788
+ w.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyCurrent }) : null,
2789
+ w.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyKept }) : null
2790
+ ] }) }, w.id)) }),
2791
+ k === null ? null : T === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: l.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ c(me, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2792
+ /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? l.historyTitle(t) : Jt(s, M, l.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: T.text }) })
2816
2793
  ),
2817
- /* @__PURE__ */ $("div", { className: "aqmx-confirm-actions", children: [
2818
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: a.historyClose }),
2819
- /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: l, children: a.historyRestore })
2794
+ /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
2795
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: l.historyClose }),
2796
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: a, children: l.historyRestore })
2820
2797
  ] })
2821
2798
  ] }) });
2822
- }, za = (e) => {
2799
+ }, Xl = (e) => {
2823
2800
  const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o)?.document;
2824
2801
  return i === void 0 || i.kind === "failure" ? { edit: null, name: se(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
2825
- }, de = (e) => {
2802
+ }, ce = (e) => {
2826
2803
  e.stopPropagation();
2827
- }, ja = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
2828
- const { draftConverter: i, edits: a, labels: u } = D(), m = ee(
2829
- a.subscribe,
2830
- () => a.session(e) !== void 0,
2804
+ }, Jl = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
2805
+ const { draftConverter: i, edits: l, labels: u } = D(), m = ee(
2806
+ l.subscribe,
2807
+ () => l.session(e) !== void 0,
2831
2808
  () => !1
2832
- ), [f, c] = z(null), h = () => {
2809
+ ), [f, d] = B(null), h = () => {
2833
2810
  if (!m) {
2834
- a.start(e, a.viewAnchor(e));
2811
+ l.start(e, l.viewAnchor(e));
2835
2812
  return;
2836
2813
  }
2837
- a.flush(e);
2838
- const R = a.session(e);
2839
- R?.dirty === !0 ? c(R.save.kind === "draft" ? "draft" : "unsaved") : a.close(e);
2840
- }, g = () => {
2841
- m || (fo(), r && a.sideBySide() && i?.prepare?.());
2814
+ l.flush(e);
2815
+ const R = l.session(e);
2816
+ R?.dirty === !0 ? d(R.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
2817
+ }, v = () => {
2818
+ m || (bo(), r && l.sideBySide() && i?.prepare?.());
2842
2819
  }, E = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, k = o ? u.editDraftDocument : u.editDocument;
2843
- return /* @__PURE__ */ $(Pe, { children: [
2844
- /* @__PURE__ */ $(
2820
+ return /* @__PURE__ */ F($e, { children: [
2821
+ /* @__PURE__ */ F(
2845
2822
  "button",
2846
2823
  {
2847
2824
  type: "button",
@@ -2851,17 +2828,17 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
2851
2828
  "aria-pressed": m,
2852
2829
  "data-testid": "markdown-explorer-document-edit",
2853
2830
  onClick: h,
2854
- onDoubleClick: de,
2855
- onPointerEnter: g,
2856
- onFocus: g,
2831
+ onDoubleClick: ce,
2832
+ onPointerEnter: v,
2833
+ onFocus: v,
2857
2834
  children: [
2858
- /* @__PURE__ */ d(La, { "aria-hidden": "true" }),
2859
- E === null ? /* @__PURE__ */ d("span", { children: u.editDocumentLabel }) : null
2835
+ /* @__PURE__ */ c(jl, { "aria-hidden": "true" }),
2836
+ E === null ? /* @__PURE__ */ c("span", { children: u.editDocumentLabel }) : null
2860
2837
  ]
2861
2838
  }
2862
2839
  ),
2863
- /* @__PURE__ */ d(
2864
- wn,
2840
+ /* @__PURE__ */ c(
2841
+ kn,
2865
2842
  {
2866
2843
  open: f !== null,
2867
2844
  title: f === "draft" ? u.draftDiscardTitle : u.unsavedTitle,
@@ -2870,15 +2847,15 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
2870
2847
  cancelLabel: u.unsavedStay,
2871
2848
  testId: "markdown-explorer-edit-close-confirm",
2872
2849
  onConfirm: () => {
2873
- c(null), a.close(e);
2850
+ d(null), l.close(e);
2874
2851
  },
2875
- onCancel: () => c(null)
2852
+ onCancel: () => d(null)
2876
2853
  }
2877
2854
  )
2878
2855
  ] });
2879
- }, Ha = ({ href: e, documentName: t, iconOnly: n }) => {
2856
+ }, Ql = ({ href: e, documentName: t, iconOnly: n }) => {
2880
2857
  const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
2881
- return /* @__PURE__ */ $(
2858
+ return /* @__PURE__ */ F(
2882
2859
  "a",
2883
2860
  {
2884
2861
  className: o === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
@@ -2888,144 +2865,138 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
2888
2865
  title: o === null ? r.editExternally : o,
2889
2866
  "aria-label": o === null ? void 0 : o,
2890
2867
  "data-testid": "markdown-explorer-document-edit-external",
2891
- onDoubleClick: de,
2868
+ onDoubleClick: ce,
2892
2869
  children: [
2893
- /* @__PURE__ */ d(Sa, { "aria-hidden": "true" }),
2894
- o === null ? /* @__PURE__ */ d("span", { children: r.editExternallyLabel }) : null
2870
+ /* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
2871
+ o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
2895
2872
  ]
2896
2873
  }
2897
2874
  );
2898
- }, Va = ({ session: e }) => {
2899
- const { labels: t } = D(), n = Pr(t, e);
2900
- return /* @__PURE__ */ d("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
2901
- }, Za = Object.freeze(["editor", "split", "preview"]), Ua = Object.freeze(["editor", "preview"]), Ga = Object.freeze({ editor: $n, split: Da, preview: Ma }), Wa = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2902
- const { draftConverter: i, edits: a, labels: u } = D(), m = ao(), f = $a(r, m, o), c = o ? Za : Ua, h = xe(), g = _(/* @__PURE__ */ new Map()), E = {
2875
+ }, ea = ({ session: e }) => {
2876
+ const { labels: t } = D(), n = jr(t, e);
2877
+ 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 });
2878
+ }, ta = Object.freeze(["editor", "split", "preview"]), na = Object.freeze(["editor", "preview"]), ra = Object.freeze({ editor: Vn, split: Vl, preview: _l }), oa = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2879
+ const { draftConverter: i, edits: l, labels: u } = D(), m = ho(), f = Zl(r, m, o), d = o ? ta : na, h = xe(), v = q(/* @__PURE__ */ new Map()), E = {
2903
2880
  editor: { label: u.editViewEditor, tooltip: u.editViewEditorTooltip },
2904
2881
  split: { label: u.editViewSplit, tooltip: u.editViewSplitTooltip },
2905
2882
  preview: { label: u.editViewPreview, tooltip: u.editViewPreviewTooltip }
2906
2883
  }, k = () => {
2907
- a.preparePreview(e), i?.prepare?.();
2884
+ l.preparePreview(e), i?.prepare?.();
2908
2885
  }, R = (T) => {
2909
- if (!Ia(T.nativeEvent, _a(navigator.platform))) return;
2910
- hn(T);
2911
- const A = qa(f);
2912
- Ut(a, e, A, o), g.current.get(A)?.focus();
2886
+ if (!Wl(T.nativeEvent, Kl(navigator.platform))) return;
2887
+ yn(T);
2888
+ const N = Gl(f);
2889
+ Xt(l, e, N, o), v.current.get(N)?.focus();
2913
2890
  };
2914
- return /* @__PURE__ */ d("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: c.map((T) => {
2915
- const A = Ga[T], { label: L, tooltip: b } = E[T], w = T === "preview" ? k : void 0;
2916
- return /* @__PURE__ */ $("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
2917
- /* @__PURE__ */ d(
2891
+ return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: d.map((T) => {
2892
+ const N = ra[T], { label: M, tooltip: b } = E[T], g = T === "preview" ? k : void 0;
2893
+ return /* @__PURE__ */ F("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
2894
+ /* @__PURE__ */ c(
2918
2895
  "input",
2919
2896
  {
2920
- ref: (l) => {
2921
- l === null ? g.current.delete(T) : g.current.set(T, l);
2897
+ ref: (a) => {
2898
+ a === null ? v.current.delete(T) : v.current.set(T, a);
2922
2899
  },
2923
2900
  type: "radio",
2924
2901
  name: h,
2925
2902
  value: T,
2926
2903
  checked: T === f,
2927
- "aria-label": L,
2928
- "aria-keyshortcuts": T === "split" ? void 0 : Fa,
2904
+ "aria-label": M,
2905
+ "aria-keyshortcuts": T === "split" ? void 0 : Ul,
2929
2906
  title: b,
2930
2907
  "data-testid": `markdown-explorer-edit-view-${T}`,
2931
- onChange: () => Ut(a, e, T, o),
2932
- onDoubleClick: de,
2933
- onPointerEnter: w,
2934
- onFocus: w
2908
+ onChange: () => Xt(l, e, T, o),
2909
+ onDoubleClick: ce,
2910
+ onPointerEnter: g,
2911
+ onFocus: g
2935
2912
  }
2936
2913
  ),
2937
- /* @__PURE__ */ d(A, { "aria-hidden": "true" }),
2938
- n ? null : /* @__PURE__ */ d("span", { children: L })
2914
+ /* @__PURE__ */ c(N, { "aria-hidden": "true" }),
2915
+ n ? null : /* @__PURE__ */ c("span", { children: M })
2939
2916
  ] }, T);
2940
2917
  }) });
2941
- }, Ka = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2942
- const { edits: i, labels: a } = D(), [u, m] = z(!1);
2918
+ }, ia = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2919
+ const { edits: i, labels: l } = D(), [u, m] = B(!1);
2943
2920
  if (r.phase.kind !== "editing") return null;
2944
- const f = r.save.kind === "saving", c = f || !r.dirty, h = () => {
2921
+ const f = r.save.kind === "saving", d = f || !r.dirty, h = () => {
2945
2922
  i.flush(e);
2946
2923
  const E = i.session(e);
2947
2924
  E === void 0 || !E.dirty || E.save.kind === "saving" || i.save(e);
2948
- }, g = (E) => n ? { className: "aqmx-icon-button", "aria-label": E } : { className: "aqmx-icon-button aqmx-labelled-button" };
2949
- return /* @__PURE__ */ $(Pe, { children: [
2950
- r.save.kind === "conflicts" ? /* @__PURE__ */ $("button", { type: "button", ...g(a.conflictNext), title: a.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: de, children: [
2951
- /* @__PURE__ */ d(xa, { "aria-hidden": "true" }),
2952
- n ? null : /* @__PURE__ */ d("span", { children: a.conflictNext })
2925
+ }, v = (E) => n ? { className: "aqmx-icon-button", "aria-label": E } : { className: "aqmx-icon-button aqmx-labelled-button" };
2926
+ return /* @__PURE__ */ F($e, { children: [
2927
+ r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...v(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ce, children: [
2928
+ /* @__PURE__ */ c(Dl, { "aria-hidden": "true" }),
2929
+ n ? null : /* @__PURE__ */ c("span", { children: l.conflictNext })
2953
2930
  ] }) : null,
2954
- /* @__PURE__ */ d(Wa, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
2955
- r.history ? /* @__PURE__ */ $("button", { type: "button", ...g(a.historyOpen), title: a.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: de, children: [
2956
- /* @__PURE__ */ d(Ta, { "aria-hidden": "true" }),
2957
- n ? null : /* @__PURE__ */ d("span", { children: a.historyOpen })
2931
+ /* @__PURE__ */ c(oa, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
2932
+ r.history ? /* @__PURE__ */ F("button", { type: "button", ...v(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: ce, children: [
2933
+ /* @__PURE__ */ c($l, { "aria-hidden": "true" }),
2934
+ n ? null : /* @__PURE__ */ c("span", { children: l.historyOpen })
2958
2935
  ] }) : null,
2959
- r.save.kind === "draft" ? null : /* @__PURE__ */ $("button", { type: "button", ...g(a.saveDraft), title: a.saveDraftTooltip, "aria-disabled": c, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: de, children: [
2960
- /* @__PURE__ */ d(Oa, { "aria-hidden": "true" }),
2961
- n ? null : /* @__PURE__ */ d("span", { children: a.saveDraft })
2936
+ r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...v(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": d, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: ce, children: [
2937
+ /* @__PURE__ */ c(Il, { "aria-hidden": "true" }),
2938
+ n ? null : /* @__PURE__ */ c("span", { children: l.saveDraft })
2962
2939
  ] }),
2963
- r.history ? /* @__PURE__ */ d(Ba, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
2940
+ r.history ? /* @__PURE__ */ c(Yl, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
2964
2941
  ] });
2965
- }, Xa = ({ path: e, session: t }) => {
2942
+ }, la = ({ path: e, session: t }) => {
2966
2943
  const { edits: n } = D();
2967
- return t.save.kind !== "grant" ? null : /* @__PURE__ */ d(Pa, { href: t.save.href, onRetry: () => {
2944
+ return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Hl, { href: t.save.href, onRetry: () => {
2968
2945
  n.save(e);
2969
2946
  }, testId: "markdown-explorer-save-grant" });
2970
- }, Ya = (e) => {
2971
- const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
2972
- return ue(o)?.document.kind === "markdown";
2973
- }, Ja = (e) => {
2974
- const { config: t } = D(), n = $e(), r = P(() => n(Se(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2975
- return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2976
- }, Qa = /* @__PURE__ */ new Set(), el = (e, t) => {
2977
- const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), a = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, a), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [c] = z(() => /* @__PURE__ */ new Set()), [h, g] = z(Qa), [E, k] = z(null);
2947
+ }, aa = /* @__PURE__ */ new Set(), sa = (e, t) => {
2948
+ const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] = B(() => /* @__PURE__ */ new Set()), [h, v] = B(aa), [E, k] = B(null);
2978
2949
  E !== null && E.path !== e && k(null);
2979
- const R = _(null);
2980
- j(() => (R.current = e, () => {
2950
+ const R = q(null);
2951
+ V(() => (R.current = e, () => {
2981
2952
  R.current = null;
2982
2953
  }), [e]);
2983
2954
  const T = P(() => {
2984
- const b = e, w = n.peek(b);
2985
- if (c.has(b) || w?.status === "pending") return;
2986
- const l = t && !Tn(w);
2987
- c.add(b), g(new Set(c)), k(null), (async () => {
2955
+ const b = e, g = n.peek(b);
2956
+ if (d.has(b) || g?.status === "pending") return;
2957
+ const a = t && !Nn(g);
2958
+ d.add(b), v(new Set(d)), k(null), (async () => {
2988
2959
  try {
2989
2960
  const s = await n.refresh(b);
2990
2961
  if (R.current !== b || s.status === "superseded") return;
2991
2962
  if (s.status === "failed") {
2992
- k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(le(o, s.failure.reason)));
2963
+ k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(ae(o, s.failure.reason)));
2993
2964
  return;
2994
2965
  }
2995
- const v = ue(n.peek(b));
2996
- if (l || v === null || v.document.kind === "failure") return;
2997
- r.announce(o.documentRefreshed(v.document.name));
2966
+ const w = ue(n.peek(b));
2967
+ if (a || w === null || w.document.kind === "failure") return;
2968
+ r.announce(o.documentRefreshed(w.document.name));
2998
2969
  } finally {
2999
- c.delete(b), g(new Set(c));
2970
+ d.delete(b), v(new Set(d));
3000
2971
  }
3001
2972
  })();
3002
- }, [e, t, c, n, r, o]), A = h.has(e), L = E !== null && E.path === e && E.stamp === f ? E.failure : null;
3003
- return { refreshing: A, unavailable: A || u?.status === "pending", failure: L, refresh: T };
3004
- }, tl = Object.freeze({ kind: "page" }), nl = ({ path: e, placement: t, markup: n }) => {
3005
- const { labels: r } = D(), { refreshing: o, unavailable: i, failure: a, refresh: u } = el(e, t.kind === "page"), m = Ya(e), f = za(e), c = bn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, g = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, E = t.kind === "panel", k = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
3006
- return /* @__PURE__ */ $("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": c === void 0 ? void 0 : "true", children: [
3007
- /* @__PURE__ */ $("div", { className: "aqmx-document-refresh-row", children: [
3008
- c === void 0 ? null : /* @__PURE__ */ d(Va, { session: c }),
3009
- c === void 0 ? null : /* @__PURE__ */ d(Ka, { path: e, documentName: k, iconOnly: E, session: c, previewAvailable: R }),
3010
- c === void 0 && m ? /* @__PURE__ */ $(
2973
+ }, [e, t, d, n, r, o]), N = h.has(e), M = E !== null && E.path === e && E.stamp === f ? E.failure : null;
2974
+ return { refreshing: N, unavailable: N || u?.status === "pending", failure: M, refresh: T };
2975
+ }, ca = Object.freeze({ kind: "page" }), da = ({ path: e, placement: t, markup: n }) => {
2976
+ const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } = sa(e, t.kind === "page"), m = ll(e), f = Xl(e), d = Rn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, v = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, E = t.kind === "panel", k = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
2977
+ return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": d === void 0 ? void 0 : "true", children: [
2978
+ /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
2979
+ d === void 0 ? null : /* @__PURE__ */ c(ea, { session: d }),
2980
+ d === void 0 ? null : /* @__PURE__ */ c(ia, { path: e, documentName: k, iconOnly: E, session: d, previewAvailable: R }),
2981
+ d === void 0 && m !== null ? /* @__PURE__ */ F(
3011
2982
  "button",
3012
2983
  {
3013
2984
  type: "button",
3014
- className: g === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
3015
- title: g === null ? r.showMarkup : g,
3016
- "aria-label": g === null ? void 0 : g,
2985
+ className: v === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
2986
+ title: v === null ? m === "svg" ? r.showSvgMarkup : r.showMarkup : v,
2987
+ "aria-label": v === null ? void 0 : v,
3017
2988
  "aria-pressed": n.shown,
3018
2989
  "data-testid": "markdown-explorer-document-markup",
3019
2990
  onClick: n.toggle,
3020
- onDoubleClick: de,
2991
+ onDoubleClick: ce,
3021
2992
  children: [
3022
- /* @__PURE__ */ d($n, { "aria-hidden": "true" }),
3023
- g === null ? /* @__PURE__ */ d("span", { children: r.showMarkupLabel }) : null
2993
+ /* @__PURE__ */ c(Vn, { "aria-hidden": "true" }),
2994
+ v === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
3024
2995
  ]
3025
2996
  }
3026
2997
  ) : null,
3027
- c !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ d(ja, { path: e, documentName: k, iconOnly: E, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ d(Ha, { href: f.edit.href, documentName: k, iconOnly: E }) : null,
3028
- c === void 0 ? /* @__PURE__ */ $(
2998
+ d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(Jl, { path: e, documentName: k, iconOnly: E, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Ql, { href: f.edit.href, documentName: k, iconOnly: E }) : null,
2999
+ d === void 0 ? /* @__PURE__ */ F(
3029
3000
  "button",
3030
3001
  {
3031
3002
  type: "button",
@@ -3037,85 +3008,85 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
3037
3008
  "data-aqmx-busy": o ? "true" : void 0,
3038
3009
  "data-testid": "markdown-explorer-document-refresh",
3039
3010
  onClick: u,
3040
- onDoubleClick: de,
3011
+ onDoubleClick: ce,
3041
3012
  children: [
3042
- /* @__PURE__ */ d(ga, { "aria-hidden": "true" }),
3043
- h === null ? /* @__PURE__ */ d("span", { children: r.refreshDocumentLabel }) : null
3013
+ /* @__PURE__ */ c(Cl, { "aria-hidden": "true" }),
3014
+ h === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
3044
3015
  ]
3045
3016
  }
3046
3017
  ) : null
3047
3018
  ] }),
3048
- c !== void 0 || a === null ? null : /* @__PURE__ */ d("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": a.reason, children: r.documentRefreshFailed(le(r, a.reason)) }),
3049
- c === void 0 ? null : /* @__PURE__ */ d(Xa, { path: e, session: c })
3019
+ d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(ae(r, l.reason)) }),
3020
+ d === void 0 ? null : /* @__PURE__ */ c(la, { path: e, session: d })
3050
3021
  ] });
3051
- }, rl = ({ location: e }) => {
3052
- const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Ja(e);
3053
- return /* @__PURE__ */ $("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...et, children: [
3054
- /* @__PURE__ */ d(nl, { path: t, placement: tl, markup: r }),
3055
- /* @__PURE__ */ d(va, { path: t, absence: Qi, markup: e.markup, variant: n })
3022
+ }, ua = ({ location: e }) => {
3023
+ const t = e.doc, n = H(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = al(e);
3024
+ return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...tt, children: [
3025
+ /* @__PURE__ */ c(da, { path: t, placement: ca, markup: r }),
3026
+ /* @__PURE__ */ c(Rl, { path: t, absence: dl, markup: e.markup, variant: n })
3056
3027
  ] });
3057
- }, ol = ({ holds: e, testId: t }) => {
3028
+ }, fa = ({ holds: e, testId: t }) => {
3058
3029
  const { labels: n, announcer: r } = D(), o = xe();
3059
- j(() => e ? r.claim(o) : void 0, [e, r, o]);
3060
- const i = P(() => r.shownIn(o), [r, o]), a = ee(r.subscribe, i, i);
3061
- return /* @__PURE__ */ d("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: a.length > 1 ? n.announcementSequence(a) : a[0] });
3062
- }, fe = Object.freeze([]), il = (e) => {
3030
+ V(() => e ? r.claim(o) : void 0, [e, r, o]);
3031
+ const i = P(() => r.shownIn(o), [r, o]), l = ee(r.subscribe, i, i);
3032
+ return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: l.length > 1 ? n.announcementSequence(l) : l[0] });
3033
+ }, fe = Object.freeze([]), ma = (e) => {
3063
3034
  const t = /* @__PURE__ */ new Set();
3064
3035
  let n = fe, r = [], o = !1;
3065
- const i = [], a = (c) => {
3066
- n = c;
3036
+ const i = [], l = (d) => {
3037
+ n = d;
3067
3038
  for (const h of [...t]) h();
3068
- }, u = () => i.at(-1)?.region, m = (c) => {
3039
+ }, u = () => i.at(-1)?.region, m = (d) => {
3069
3040
  const h = u();
3070
- c(), u() !== h && n !== fe && a(fe);
3041
+ d(), u() !== h && n !== fe && l(fe);
3071
3042
  }, f = () => {
3072
3043
  o = !1;
3073
- const c = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
3074
- r = [], a(Object.freeze(c));
3044
+ const d = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
3045
+ r = [], l(Object.freeze(d));
3075
3046
  };
3076
3047
  return {
3077
- announce: (c) => {
3078
- if (typeof c == "string") r.push({ sentence: c });
3048
+ announce: (d) => {
3049
+ if (typeof d == "string") r.push({ sentence: d });
3079
3050
  else {
3080
- const h = r.find((g) => "list" in g && g.list === c.list);
3081
- h !== void 0 && "items" in h ? h.items.push(c.item) : r.push({ list: c.list, items: [c.item] });
3051
+ const h = r.find((v) => "list" in v && v.list === d.list);
3052
+ h !== void 0 && "items" in h ? h.items.push(d.item) : r.push({ list: d.list, items: [d.item] });
3082
3053
  }
3083
- o || (o = !0, n !== fe && a(fe), e.request(f));
3054
+ o || (o = !0, n !== fe && l(fe), e.request(f));
3084
3055
  },
3085
- subscribe: (c) => (t.add(c), () => {
3086
- t.delete(c);
3056
+ subscribe: (d) => (t.add(d), () => {
3057
+ t.delete(d);
3087
3058
  }),
3088
- claim: (c) => {
3089
- const h = { region: c };
3059
+ claim: (d) => {
3060
+ const h = { region: d };
3090
3061
  return m(() => i.push(h)), () => m(() => {
3091
- const g = i.indexOf(h);
3092
- g !== -1 && i.splice(g, 1);
3062
+ const v = i.indexOf(h);
3063
+ v !== -1 && i.splice(v, 1);
3093
3064
  });
3094
3065
  },
3095
- shownIn: (c) => u() === c ? n : fe
3066
+ shownIn: (d) => u() === d ? n : fe
3096
3067
  };
3097
- }, ge = Object.freeze({ status: "cancelled" }), al = (e) => {
3068
+ }, we = Object.freeze({ status: "cancelled" }), ha = (e) => {
3098
3069
  if (e === null || typeof e != "object") return null;
3099
3070
  const { failure: t } = e;
3100
- if (sr(t) !== null) return null;
3071
+ if (pr(t) !== null) return null;
3101
3072
  const { reason: n, code: r } = t;
3102
- return dr(n, r);
3103
- }, ll = ({ dataPath: e, onScope: t, fetch: n }) => {
3104
- const r = n ?? ((f, c) => globalThis.fetch(f, c)), o = (f, c) => `${e}/${f}?${new URLSearchParams(c).toString()}`, i = async (f, c, h, g) => {
3073
+ return vr(n, r);
3074
+ }, pa = ({ dataPath: e, onScope: t, fetch: n }) => {
3075
+ const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h, v) => {
3105
3076
  let E;
3106
3077
  try {
3107
- E = await r(f, { credentials: "same-origin", ...c, headers: { Accept: "application/json", ...c.headers } });
3078
+ E = await r(f, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
3108
3079
  } catch {
3109
- return g({ reason: "failed" });
3080
+ return v({ reason: "failed" });
3110
3081
  }
3111
3082
  E.status === 401 && t(null);
3112
- const k = E.headers.get(rr);
3083
+ const k = E.headers.get(dr);
3113
3084
  k !== null && t(k);
3114
3085
  let R;
3115
3086
  try {
3116
3087
  R = await E.json();
3117
3088
  } catch {
3118
- return g({ reason: Et(E.status) });
3089
+ return v({ reason: kt(E.status) });
3119
3090
  }
3120
3091
  let T;
3121
3092
  try {
@@ -3124,39 +3095,39 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
3124
3095
  T = !1;
3125
3096
  }
3126
3097
  if (T) return R;
3127
- const A = al(R);
3128
- return g(A !== null ? A : { reason: E.status === 200 ? "failed" : Et(E.status) });
3129
- }, a = { [yt]: cr }, u = { [yt]: pr, "Content-Type": `${hr}; charset=utf-8` }, m = async (f, c, h) => {
3130
- const g = await i(f, c, h, (E) => Ve(E.reason, E.code));
3131
- return c.signal.aborted ? ge : g;
3098
+ const N = ha(R);
3099
+ return v(N !== null ? N : { reason: E.status === 200 ? "failed" : kt(E.status) });
3100
+ }, l = { [Rt]: gr }, u = { [Rt]: Sr, "Content-Type": `${yr}; charset=utf-8` }, m = async (f, d, h) => {
3101
+ const v = await i(f, d, h, (E) => Ue(E.reason, E.code));
3102
+ return d.signal.aborted ? we : v;
3132
3103
  };
3133
3104
  return {
3134
- tree: (f) => i(o("tree", { [Y.source]: f }), { method: "GET" }, St, (c) => ({ status: "error", failure: c })),
3135
- children: async (f, c, h) => {
3136
- const g = await i(o("children", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, lr, (E) => ({ status: "error", failure: E }));
3137
- return h.aborted ? ge : g;
3105
+ tree: (f) => i(o("tree", { [J.source]: f }), { method: "GET" }, Tt, (d) => ({ status: "error", failure: d })),
3106
+ children: async (f, d, h) => {
3107
+ const v = await i(o("children", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, hr, (E) => ({ status: "error", failure: E }));
3108
+ return h.aborted ? we : v;
3138
3109
  },
3139
- ancestors: async (f, c, h) => {
3140
- const g = await i(o("ancestors", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, ar, (E) => ({ status: "error", failure: E }));
3141
- return h.aborted ? ge : g;
3110
+ ancestors: async (f, d, h) => {
3111
+ const v = await i(o("ancestors", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, mr, (E) => ({ status: "error", failure: E }));
3112
+ return h.aborted ? we : v;
3142
3113
  },
3143
- reveal: async (f, c, h) => {
3144
- const g = await i(o("reveal", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, ir, (E) => ({ status: "error", failure: E }));
3145
- return h.aborted ? ge : g;
3114
+ reveal: async (f, d, h) => {
3115
+ const v = await i(o("reveal", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, fr, (E) => ({ status: "error", failure: E }));
3116
+ return h.aborted ? we : v;
3146
3117
  },
3147
- document: (f, { refresh: c }) => i(o("document", { [Y.path]: f }), c ? { method: "GET", headers: a } : { method: "GET" }, gr, (h) => Ve(h.reason, h.code)),
3148
- text: async (f, c) => {
3149
- const h = await i(o("text", { [Y.path]: f }), { method: "GET", signal: c }, or, (g) => Ve(g.reason, g.code));
3150
- return c.aborted ? ge : h;
3118
+ document: (f, { refresh: d }) => i(o("document", { [J.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" }, Tr, (h) => Ue(h.reason, h.code)),
3119
+ text: async (f, d) => {
3120
+ const h = await i(o("text", { [J.path]: f }), { method: "GET", signal: d }, ur, (v) => Ue(v.reason, v.code));
3121
+ return d.aborted ? we : h;
3151
3122
  },
3152
- edit: (f, c) => m(o("edit", { [Y.path]: f }), { method: "GET", signal: c }, wr),
3153
- save: (f, c, h, g) => m(o("save", { [Y.path]: f, [Y.base]: c }), { method: "POST", headers: u, body: h, signal: g }, vr),
3154
- preview: (f, c, h) => m(o("preview", { [Y.path]: f }), { method: "POST", headers: u, body: c, signal: h }, mr),
3155
- revisions: (f, c) => m(o("revisions", { [Y.path]: f }), { method: "GET", signal: c }, fr),
3156
- revision: (f, c, h) => m(o("revision", { [Y.path]: f, [Y.revision]: c }), { method: "GET", signal: h }, ur),
3157
- refresh: (f) => i(o("refresh", { [Y.source]: f }), { method: "POST", headers: a }, St, (c) => ({ status: "error", failure: c }))
3123
+ edit: (f, d) => m(o("edit", { [J.path]: f }), { method: "GET", signal: d }, kr),
3124
+ save: (f, d, h, v) => m(o("save", { [J.path]: f, [J.base]: d }), { method: "POST", headers: u, body: h, signal: v }, xr),
3125
+ preview: (f, d, h) => m(o("preview", { [J.path]: f }), { method: "POST", headers: u, body: d, signal: h }, Er),
3126
+ revisions: (f, d) => m(o("revisions", { [J.path]: f }), { method: "GET", signal: d }, br),
3127
+ revision: (f, d, h) => m(o("revision", { [J.path]: f, [J.revision]: d }), { method: "GET", signal: h }, wr),
3128
+ refresh: (f) => i(o("refresh", { [J.source]: f }), { method: "POST", headers: l }, Tt, (d) => ({ status: "error", failure: d }))
3158
3129
  };
3159
- }, sl = () => {
3130
+ }, va = () => {
3160
3131
  let e = null, t = null;
3161
3132
  return {
3162
3133
  settle: (n) => {
@@ -3171,20 +3142,20 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
3171
3142
  return t = null, o;
3172
3143
  }
3173
3144
  };
3174
- }, dl = (e) => {
3175
- const t = Qe(e);
3176
- if (t === null) return bt;
3145
+ }, ga = (e) => {
3146
+ const t = et(e);
3147
+ if (t === null) return St;
3177
3148
  try {
3178
- return Jn(JSON.parse(t));
3149
+ return ir(JSON.parse(t));
3179
3150
  } catch (n) {
3180
- return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), bt;
3151
+ return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), St;
3181
3152
  }
3182
- }, Wt = (e, t) => {
3153
+ }, Qt = (e, t) => {
3183
3154
  let n = null;
3184
3155
  const r = () => {
3185
3156
  if (n === null) {
3186
- const i = dl(e);
3187
- n = { changes: i, settings: gt(t, i) };
3157
+ const i = ga(e);
3158
+ n = { changes: i, settings: yt(t, i) };
3188
3159
  }
3189
3160
  return n;
3190
3161
  }, o = Oe();
@@ -3195,198 +3166,198 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
3195
3166
  getServerSnapshot: () => t,
3196
3167
  subscribe: o.subscribe,
3197
3168
  advance: (i) => {
3198
- const { changes: a, settings: u } = r(), m = Kn(a, i, Xn(u, i)[i], t);
3199
- return n = { changes: m, settings: gt(t, m) }, o.emit(), Je(e, Yn(m)), n.settings;
3169
+ const { changes: l, settings: u } = r(), m = nr(l, i, rr(u, i)[i], t);
3170
+ return n = { changes: m, settings: yt(t, m) }, o.emit(), Qe(e, or(m)), n.settings;
3200
3171
  }
3201
3172
  };
3202
- }, cl = Object.freeze({ status: "refreshed" }), ul = Object.freeze({ status: "superseded" }), ot = Object.freeze({ status: "deferred" }), fl = gn(ot), qn = 4, ml = qn - 1, Kt = Object.freeze({ status: "loading" }), hl = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), pl = (e) => {
3203
- const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
3204
- let f = 0, c = 0;
3205
- const h = { direct: null, bulk: null }, g = /* @__PURE__ */ new Set();
3173
+ }, wa = Object.freeze({ status: "refreshed" }), ba = Object.freeze({ status: "superseded" }), it = Object.freeze({ status: "deferred" }), Ea = Tn(it), Hn = 4, ya = Hn - 1, en = Object.freeze({ status: "loading" }), Sa = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), xa = (e) => {
3174
+ const t = /* @__PURE__ */ new Map(), n = An(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
3175
+ let f = 0, d = 0;
3176
+ const h = { direct: null, bulk: null }, v = /* @__PURE__ */ new Set();
3206
3177
  let E = !1, k = 0;
3207
3178
  const R = () => {
3208
3179
  k += 1, u.emit();
3209
- }, T = (p) => o.get(p) ?? 0, A = (p) => {
3210
- let S = a.get(p);
3211
- return S === void 0 && (S = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, a.set(p, S)), S;
3212
- }, L = (p, S, x) => {
3213
- p.inFlight.delete(S), f -= 1, x.lane === "bulk" && (c -= 1);
3180
+ }, T = (p) => o.get(p) ?? 0, N = (p) => {
3181
+ let y = l.get(p);
3182
+ return y === void 0 && (y = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, l.set(p, y)), y;
3183
+ }, M = (p, y, x) => {
3184
+ p.inFlight.delete(y), f -= 1, x.lane === "bulk" && (d -= 1);
3214
3185
  }, b = (p) => {
3215
- const S = a.get(p);
3216
- if (S !== void 0) {
3217
- for (const [x, C] of [...S.inFlight])
3218
- L(S, x, C), C.controller.abort();
3219
- S.direct.clear(), S.bulk.clear(), S.unclaimed.clear();
3186
+ const y = l.get(p);
3187
+ if (y !== void 0) {
3188
+ for (const [x, C] of [...y.inFlight])
3189
+ M(y, x, C), C.controller.abort();
3190
+ y.direct.clear(), y.bulk.clear(), y.unclaimed.clear();
3220
3191
  }
3221
- }, w = (p) => {
3222
- const S = T(p) + 1;
3223
- return o.set(p, S), b(p), S;
3224
- }, l = (p, S) => {
3225
- const x = Ee(p), C = { promise: p, opened: S, stale: !1, loadedAt: x?.status === "ok" ? x.loadedAt : null };
3226
- return p.status === "pending" && p.then((F) => {
3227
- F.status === "ok" && (C.loadedAt = F.loadedAt);
3192
+ }, g = (p) => {
3193
+ const y = T(p) + 1;
3194
+ return o.set(p, y), b(p), y;
3195
+ }, a = (p, y) => {
3196
+ const x = Ee(p), C = { promise: p, opened: y, stale: !1, loadedAt: x?.status === "ok" ? x.loadedAt : null };
3197
+ return p.status === "pending" && p.then(($) => {
3198
+ $.status === "ok" && (C.loadedAt = $.loadedAt);
3228
3199
  }), C;
3229
3200
  }, s = (p) => {
3230
- let S = r.get(p);
3231
- return S === void 0 && (S = /* @__PURE__ */ new Map(), r.set(p, S)), S;
3232
- }, v = (p) => {
3233
- const S = [...a.keys()], x = h[p], C = x === null ? 0 : S.indexOf(x) + 1;
3234
- for (let F = 0; F < S.length; F += 1) {
3235
- const B = S[(C + F) % S.length], K = B === void 0 ? void 0 : a.get(B);
3236
- if (!(B === void 0 || K === void 0)) {
3237
- for (const V of K[p])
3238
- if ((K.claims.get(V) ?? 0) !== 0)
3239
- return K[p].delete(V), h[p] = B, { sourceId: B, path: V };
3201
+ let y = r.get(p);
3202
+ return y === void 0 && (y = /* @__PURE__ */ new Map(), r.set(p, y)), y;
3203
+ }, w = (p) => {
3204
+ const y = [...l.keys()], x = h[p], C = x === null ? 0 : y.indexOf(x) + 1;
3205
+ for (let $ = 0; $ < y.length; $ += 1) {
3206
+ const _ = y[(C + $) % y.length], W = _ === void 0 ? void 0 : l.get(_);
3207
+ if (!(_ === void 0 || W === void 0)) {
3208
+ for (const U of W[p])
3209
+ if ((W.claims.get(U) ?? 0) !== 0)
3210
+ return W[p].delete(U), h[p] = _, { sourceId: _, path: U };
3240
3211
  }
3241
3212
  }
3242
3213
  return null;
3243
- }, O = (p, S, x, C) => {
3244
- const F = a.get(p);
3245
- if (F === void 0 || F.inFlight.get(S) !== x) return;
3246
- L(F, S, x);
3247
- const B = (F.claims.get(S) ?? 0) > 0, K = s(p);
3248
- if (C.status === "ok" ? K.set(S, { status: "loaded", entries: C.entries }) : C.status === "error" && B ? K.set(S, { status: "failed", failure: C.failure }) : K.delete(S), R(), C.status === "error" && B) {
3249
- const V = { sourceId: p, path: S, failure: C.failure };
3250
- for (const ie of [...m]) ie(V);
3214
+ }, O = (p, y, x, C) => {
3215
+ const $ = l.get(p);
3216
+ if ($ === void 0 || $.inFlight.get(y) !== x) return;
3217
+ M($, y, x);
3218
+ const _ = ($.claims.get(y) ?? 0) > 0, W = s(p);
3219
+ if (C.status === "ok" ? W.set(y, { status: "loaded", entries: C.entries }) : C.status === "error" && _ ? W.set(y, { status: "failed", failure: C.failure }) : W.delete(y), R(), C.status === "error" && _) {
3220
+ const U = { sourceId: p, path: y, failure: C.failure };
3221
+ for (const ie of [...m]) ie(U);
3251
3222
  }
3252
- N();
3253
- }, M = (p, S, x) => {
3223
+ A();
3224
+ }, L = (p, y, x) => {
3254
3225
  const C = { controller: new AbortController(), lane: x };
3255
- A(p).inFlight.set(S, C), f += 1, x === "bulk" && (c += 1), e.children(p, S, C.controller.signal).then(
3256
- (F) => O(p, S, C, F),
3257
- () => O(p, S, C, hl)
3226
+ N(p).inFlight.set(y, C), f += 1, x === "bulk" && (d += 1), e.children(p, y, C.controller.signal).then(
3227
+ ($) => O(p, y, C, $),
3228
+ () => O(p, y, C, Sa)
3258
3229
  );
3259
- }, N = () => {
3260
- for (; f < qn; ) {
3261
- const p = v("direct");
3230
+ }, A = () => {
3231
+ for (; f < Hn; ) {
3232
+ const p = w("direct");
3262
3233
  if (p !== null) {
3263
- M(p.sourceId, p.path, "direct");
3234
+ L(p.sourceId, p.path, "direct");
3264
3235
  continue;
3265
3236
  }
3266
- const S = c < ml ? v("bulk") : null;
3267
- if (S === null) return;
3268
- M(S.sourceId, S.path, "bulk");
3237
+ const y = d < ya ? w("bulk") : null;
3238
+ if (y === null) return;
3239
+ L(y.sourceId, y.path, "bulk");
3269
3240
  }
3270
- }, q = (p, S, x) => {
3271
- if (!(S.direct.delete(x) || S.bulk.delete(x))) {
3272
- const F = S.inFlight.get(x);
3273
- if (F === void 0) return !1;
3274
- L(S, x, F), F.controller.abort();
3241
+ }, I = (p, y, x) => {
3242
+ if (!(y.direct.delete(x) || y.bulk.delete(x))) {
3243
+ const $ = y.inFlight.get(x);
3244
+ if ($ === void 0) return !1;
3245
+ M(y, x, $), $.controller.abort();
3275
3246
  }
3276
3247
  return r.get(p)?.delete(x), !0;
3277
- }, W = () => {
3248
+ }, K = () => {
3278
3249
  E = !1;
3279
3250
  let p = !1;
3280
- for (const S of g) {
3281
- const x = A(S);
3251
+ for (const y of v) {
3252
+ const x = N(y);
3282
3253
  for (const C of x.unclaimed)
3283
- (x.claims.get(C) ?? 0) === 0 && q(S, x, C) && (p = !0);
3254
+ (x.claims.get(C) ?? 0) === 0 && I(y, x, C) && (p = !0);
3284
3255
  x.unclaimed.clear();
3285
3256
  }
3286
- g.clear(), p && (R(), N());
3287
- }, G = (p, S) => {
3288
- t.set(p, l(Te(e.tree(p)), S));
3289
- }, I = (p, S, x) => {
3290
- w(p);
3291
- const C = l(gn(S), x);
3292
- return t.set(p, C), r.delete(p), R(), N(), C;
3293
- }, J = (p, S, x, C) => {
3294
- if (x !== T(p) || t.get(p) !== S) return;
3295
- const F = Ee(S.promise);
3296
- if (!(C.status !== "ok" || F?.status !== "ok" || S.loadedAt === null || C.loadedAt <= S.loadedAt)) {
3297
- if (De(F.entries, C.entries)) {
3298
- S.loadedAt = C.loadedAt;
3257
+ v.clear(), p && (R(), A());
3258
+ }, G = (p, y) => {
3259
+ t.set(p, a(Te(e.tree(p)), y));
3260
+ }, z = (p, y, x) => {
3261
+ g(p);
3262
+ const C = a(Tn(y), x);
3263
+ return t.set(p, C), r.delete(p), R(), A(), C;
3264
+ }, X = (p, y, x, C) => {
3265
+ if (x !== T(p) || t.get(p) !== y) return;
3266
+ const $ = Ee(y.promise);
3267
+ if (!(C.status !== "ok" || $?.status !== "ok" || y.loadedAt === null || C.loadedAt <= y.loadedAt)) {
3268
+ if (Pe($.entries, C.entries)) {
3269
+ y.loadedAt = C.loadedAt;
3299
3270
  return;
3300
3271
  }
3301
- I(p, C, S.opened);
3272
+ z(p, C, y.opened);
3302
3273
  }
3303
- }, H = (p, S) => {
3274
+ }, j = (p, y) => {
3304
3275
  const x = t.get(p);
3305
- return x !== void 0 && Ee(x.promise)?.status === S;
3306
- }, ne = (p, S) => {
3307
- S.stale = !1;
3276
+ return x !== void 0 && Ee(x.promise)?.status === y;
3277
+ }, re = (p, y) => {
3278
+ y.stale = !1;
3308
3279
  const x = T(p);
3309
- e.tree(p).then((C) => J(p, S, x, C));
3280
+ e.tree(p).then((C) => X(p, y, x, C));
3310
3281
  };
3311
3282
  return {
3312
- read: (p) => t.get(p)?.promise ?? fl,
3283
+ read: (p) => t.get(p)?.promise ?? Ea,
3313
3284
  open: (p) => {
3314
- const S = n.resumes(p), x = n.hold(p), C = t.get(p);
3315
- return C === void 0 || H(p, "deferred") ? (G(p, !0), R()) : S || (C.opened && H(p, "error") ? (G(p, !0), R()) : (C.opened = !0, C.stale && H(p, "ok") && ne(p, C))), x;
3285
+ const y = n.resumes(p), x = n.hold(p), C = t.get(p);
3286
+ return C === void 0 || j(p, "deferred") ? (G(p, !0), R()) : y || (C.opened && j(p, "error") ? (G(p, !0), R()) : (C.opened = !0, C.stale && j(p, "ok") && re(p, C))), x;
3316
3287
  },
3317
3288
  retry: (p) => {
3318
- H(p, "error") && (G(p, !0), R());
3289
+ j(p, "error") && (G(p, !0), R());
3319
3290
  },
3320
- seed: (p, S) => {
3321
- const x = S.then(
3322
- (B) => B === null ? ot : B,
3323
- () => ot
3291
+ seed: (p, y) => {
3292
+ const x = y.then(
3293
+ (_) => _ === null ? it : _,
3294
+ () => it
3324
3295
  ), C = t.get(p);
3325
- if (C !== void 0 && H(p, "ok")) {
3326
- const B = T(p);
3327
- x.then((K) => J(p, C, B, K));
3296
+ if (C !== void 0 && j(p, "ok")) {
3297
+ const _ = T(p);
3298
+ x.then((W) => X(p, C, _, W));
3328
3299
  return;
3329
3300
  }
3330
- w(p);
3331
- const F = l(Te(x), C?.opened === !0);
3332
- t.set(p, F), r.delete(p), N(), x.then((B) => {
3333
- t.get(p) === F && (B.status === "deferred" && n.isHeld(p) && G(p, F.opened), R());
3301
+ g(p);
3302
+ const $ = a(Te(x), C?.opened === !0);
3303
+ t.set(p, $), r.delete(p), A(), x.then((_) => {
3304
+ t.get(p) === $ && (_.status === "deferred" && n.isHeld(p) && G(p, $.opened), R());
3334
3305
  });
3335
3306
  },
3336
3307
  refresh: async (p) => {
3337
- const S = (i.get(p) ?? 0) + 1;
3338
- i.set(p, S);
3308
+ const y = (i.get(p) ?? 0) + 1;
3309
+ i.set(p, y);
3339
3310
  const x = await e.refresh(p);
3340
- if (i.get(p) !== S) return ul;
3311
+ if (i.get(p) !== y) return ba;
3341
3312
  if (x.status === "error") return { status: "failed", failure: x.failure };
3342
3313
  const C = t.get(p);
3343
- if (!(C !== void 0 && C.loadedAt !== null && H(p, "ok") && C.loadedAt > x.loadedAt)) {
3344
- const B = I(p, x, !0);
3314
+ if (!(C !== void 0 && C.loadedAt !== null && j(p, "ok") && C.loadedAt > x.loadedAt)) {
3315
+ const _ = z(p, x, !0);
3345
3316
  if (C !== void 0 && C.promise.status === "pending") {
3346
- const K = T(p);
3347
- C.promise.then((V) => J(p, B, K, V));
3317
+ const W = T(p);
3318
+ C.promise.then((U) => X(p, _, W, U));
3348
3319
  }
3349
3320
  }
3350
- for (const [B, K] of t)
3351
- B !== p && Ee(K.promise)?.status === "ok" && (K.stale = !0);
3352
- return cl;
3321
+ for (const [_, W] of t)
3322
+ _ !== p && Ee(W.promise)?.status === "ok" && (W.stale = !0);
3323
+ return wa;
3353
3324
  },
3354
- children: (p, S) => r.get(p)?.get(S),
3355
- claimChildren: (p, S) => {
3356
- const x = A(p), C = s(p);
3357
- let F = !1, B = !1;
3358
- for (const [V, ie] of S)
3359
- x.claims.set(V, (x.claims.get(V) ?? 0) + 1), C.get(V) === void 0 ? (C.set(V, Kt), x[ie].add(V), F = !0, B = !0) : ie === "direct" && x.bulk.delete(V) && (x.direct.add(V), B = !0);
3360
- F && R(), B && N();
3361
- let K = !1;
3325
+ children: (p, y) => r.get(p)?.get(y),
3326
+ claimChildren: (p, y) => {
3327
+ const x = N(p), C = s(p);
3328
+ let $ = !1, _ = !1;
3329
+ for (const [U, ie] of y)
3330
+ x.claims.set(U, (x.claims.get(U) ?? 0) + 1), C.get(U) === void 0 ? (C.set(U, en), x[ie].add(U), $ = !0, _ = !0) : ie === "direct" && x.bulk.delete(U) && (x.direct.add(U), _ = !0);
3331
+ $ && R(), _ && A();
3332
+ let W = !1;
3362
3333
  return () => {
3363
- if (!K) {
3364
- K = !0;
3365
- for (const V of S.keys()) {
3366
- const ie = (x.claims.get(V) ?? 0) - 1;
3367
- ie > 0 ? x.claims.set(V, ie) : (x.claims.delete(V), x.unclaimed.add(V));
3334
+ if (!W) {
3335
+ W = !0;
3336
+ for (const U of y.keys()) {
3337
+ const ie = (x.claims.get(U) ?? 0) - 1;
3338
+ ie > 0 ? x.claims.set(U, ie) : (x.claims.delete(U), x.unclaimed.add(U));
3368
3339
  }
3369
- g.add(p), !E && (E = !0, queueMicrotask(W));
3340
+ v.add(p), !E && (E = !0, queueMicrotask(K));
3370
3341
  }
3371
3342
  };
3372
3343
  },
3373
- retryChildren: (p, S) => {
3344
+ retryChildren: (p, y) => {
3374
3345
  const x = r.get(p);
3375
- if (x === void 0 || x.get(S)?.status !== "failed") return;
3376
- const C = A(p);
3377
- if ((C.claims.get(S) ?? 0) > 0) {
3378
- x.set(S, Kt), C.direct.add(S), R(), N();
3346
+ if (x === void 0 || x.get(y)?.status !== "failed") return;
3347
+ const C = N(p);
3348
+ if ((C.claims.get(y) ?? 0) > 0) {
3349
+ x.set(y, en), C.direct.add(y), R(), A();
3379
3350
  return;
3380
3351
  }
3381
- x.delete(S), R();
3352
+ x.delete(y), R();
3382
3353
  },
3383
3354
  pendingChildren: (p) => {
3384
- const S = a.get(p);
3385
- return S === void 0 ? 0 : S.direct.size + S.bulk.size + S.inFlight.size;
3355
+ const y = l.get(p);
3356
+ return y === void 0 ? 0 : y.direct.size + y.bulk.size + y.inFlight.size;
3386
3357
  },
3387
3358
  clear: () => {
3388
- for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...a.keys()])) w(p);
3389
- for (const [p, S] of i) i.set(p, S + 1);
3359
+ for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...l.keys()])) g(p);
3360
+ for (const [p, y] of i) i.set(p, y + 1);
3390
3361
  t.clear(), r.clear(), R();
3391
3362
  },
3392
3363
  subscribeChildrenFailures: (p) => (m.add(p), () => {
@@ -3395,7 +3366,7 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
3395
3366
  subscribe: u.subscribe,
3396
3367
  version: () => k
3397
3368
  };
3398
- }, vl = (e, t) => {
3369
+ }, ka = (e, t) => {
3399
3370
  let n = e;
3400
3371
  const r = Oe();
3401
3372
  return {
@@ -3405,80 +3376,80 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
3405
3376
  n = { ...n, ...o }, t(n), r.emit();
3406
3377
  }
3407
3378
  };
3408
- }, wl = 1;
3409
- let Ce = 0, ce = null;
3410
- const gl = () => {
3379
+ }, Ta = 1;
3380
+ let Ce = 0, de = null;
3381
+ const Ra = () => {
3411
3382
  const { documentElement: e, body: t } = document;
3412
- Ce === 0 && (ce = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Ce += 1;
3383
+ Ce === 0 && (de = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Ce += 1;
3413
3384
  let n = !1;
3414
3385
  return () => {
3415
- n || (n = !0, Ce -= 1, !(Ce > 0 || ce === null) && (e.style.overflow = ce.htmlOverflow, t.style.overflow = ce.bodyOverflow, e.style.scrollbarGutter = ce.htmlGutter, t.style.scrollbarGutter = ce.bodyGutter, ce = null));
3386
+ n || (n = !0, Ce -= 1, !(Ce > 0 || de === null) && (e.style.overflow = de.htmlOverflow, t.style.overflow = de.bodyOverflow, e.style.scrollbarGutter = de.htmlGutter, t.style.scrollbarGutter = de.bodyGutter, de = null));
3416
3387
  };
3417
- }, bl = [
3388
+ }, Oa = [
3418
3389
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
3419
3390
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
3420
- ], Xt = 1, El = 1e3, Yt = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Sl = (e) => {
3421
- if (!Yt(e)) return null;
3391
+ ], tn = 1, Ca = 1e3, nn = (e) => e.getClientRects().length > 0, Ye = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Ma = (e) => {
3392
+ if (!nn(e)) return null;
3422
3393
  const t = e.getBoundingClientRect(), n = window.innerHeight;
3423
- if (t.bottom > n + wl)
3424
- return `[markdown-explorer] the explorer ends ${String(Math.round(t.bottom))}px down a ${String(n)}px viewport while lockDocumentScroll stops the page from scrolling, so the rest cannot be reached. ${Ke}`;
3425
- if (t.height < Xt)
3426
- return `[markdown-explorer] the explorer collapsed to ${String(Math.round(t.height))}px while lockDocumentScroll stops the page from scrolling, so nothing can be read. ${Ke}`;
3427
- for (const { selector: r, name: o } of bl)
3394
+ if (t.bottom > n + Ta)
3395
+ return `[markdown-explorer] the explorer ends ${String(Math.round(t.bottom))}px down a ${String(n)}px viewport while lockDocumentScroll stops the page from scrolling, so the rest cannot be reached. ${Ye}`;
3396
+ if (t.height < tn)
3397
+ return `[markdown-explorer] the explorer collapsed to ${String(Math.round(t.height))}px while lockDocumentScroll stops the page from scrolling, so nothing can be read. ${Ye}`;
3398
+ for (const { selector: r, name: o } of Oa)
3428
3399
  for (const i of e.querySelectorAll(r)) {
3429
- if (!Yt(i)) continue;
3430
- const a = i.getBoundingClientRect().height;
3431
- if (a < Xt)
3432
- return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(a))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
3400
+ if (!nn(i)) continue;
3401
+ const l = i.getBoundingClientRect().height;
3402
+ if (l < tn)
3403
+ return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(l))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ye}`;
3433
3404
  }
3434
3405
  return null;
3435
- }, yl = (e) => {
3406
+ }, La = (e) => {
3436
3407
  let t = !1, n;
3437
3408
  const r = () => {
3438
3409
  n = void 0;
3439
- const a = Sl(e);
3440
- a !== null && (t = !0, console.error(a));
3410
+ const l = Ma(e);
3411
+ l !== null && (t = !0, console.error(l));
3441
3412
  }, o = () => {
3442
- t || (clearTimeout(n), n = setTimeout(r, El));
3413
+ t || (clearTimeout(n), n = setTimeout(r, Ca));
3443
3414
  }, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
3444
3415
  return i?.observe(e), window.addEventListener("resize", o), o(), () => {
3445
3416
  clearTimeout(n), i?.disconnect(), window.removeEventListener("resize", o);
3446
3417
  };
3447
- }, xl = (e, t) => {
3448
- te(() => e ? gl() : void 0, [e]), te(() => {
3418
+ }, Aa = (e, t) => {
3419
+ te(() => e ? Ra() : void 0, [e]), te(() => {
3449
3420
  const n = t.current;
3450
3421
  if (!(!e || n === null))
3451
- return yl(n);
3422
+ return La(n);
3452
3423
  }, [e, t]);
3453
- }, Jt = '[data-testid="markdown-explorer-view-switch"]', kl = [
3454
- { control: Jt, successors: [Jt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
3424
+ }, rn = '[data-testid="markdown-explorer-view-switch"]', Na = [
3425
+ { control: rn, successors: [rn, '[data-testid="markdown-explorer-sheet-toggle"]'] },
3455
3426
  { control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
3456
- ], Tl = (e) => {
3457
- for (const t of kl) {
3427
+ ], Da = (e) => {
3428
+ for (const t of Na) {
3458
3429
  const n = e.closest(t.control);
3459
3430
  if (n !== null) return { element: n, control: t };
3460
3431
  }
3461
3432
  return null;
3462
- }, Rl = (e, t) => {
3463
- const n = _(null);
3433
+ }, Pa = (e, t) => {
3434
+ const n = q(null);
3464
3435
  te(() => {
3465
3436
  const o = (u) => {
3466
3437
  const m = e.current;
3467
- n.current = m !== null && u instanceof Element && m.contains(u) ? Tl(u) : null;
3438
+ n.current = m !== null && u instanceof Element && m.contains(u) ? Da(u) : null;
3468
3439
  }, i = (u) => o(u.target);
3469
3440
  o(document.activeElement);
3470
- const a = (u) => {
3441
+ const l = (u) => {
3471
3442
  const m = u.target;
3472
3443
  u.relatedTarget !== null || !(m instanceof Element) || queueMicrotask(() => {
3473
3444
  n.current?.element === m && m.isConnected && document.activeElement !== m && (n.current = null);
3474
3445
  });
3475
3446
  };
3476
- return document.addEventListener("focusin", i), document.addEventListener("focusout", a), () => {
3477
- document.removeEventListener("focusin", i), document.removeEventListener("focusout", a);
3447
+ return document.addEventListener("focusin", i), document.addEventListener("focusout", l), () => {
3448
+ document.removeEventListener("focusin", i), document.removeEventListener("focusout", l);
3478
3449
  };
3479
3450
  }, [e]);
3480
- const r = _(t);
3481
- j(() => {
3451
+ const r = q(t);
3452
+ V(() => {
3482
3453
  if (r.current === t) return;
3483
3454
  r.current = t;
3484
3455
  const o = n.current;
@@ -3488,245 +3459,245 @@ const gl = () => {
3488
3459
  if (m !== null && m !== document.body && m !== o.element) return !0;
3489
3460
  const f = e.current;
3490
3461
  if (f === null) return !0;
3491
- for (const c of o.control.successors)
3492
- for (const h of f.querySelectorAll(c))
3462
+ for (const d of o.control.successors)
3463
+ for (const h of f.querySelectorAll(d))
3493
3464
  if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
3494
3465
  return !0;
3495
3466
  return !1;
3496
3467
  };
3497
3468
  if (i()) return;
3498
- const a = e.current;
3499
- if (a === null) return;
3469
+ const l = e.current;
3470
+ if (l === null) return;
3500
3471
  const u = new MutationObserver(() => {
3501
3472
  i() && u.disconnect();
3502
3473
  });
3503
- return u.observe(a, { childList: !0, subtree: !0 }), () => u.disconnect();
3474
+ return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
3504
3475
  }, [t, e]);
3505
- }, Ol = it(() => import("./TreeLayout-DzZCgMTt.js").then((e) => ({ default: e.TreeLayout }))), Cl = it(() => import("./MultiLayout-Gf1xT-Le.js").then((e) => ({ default: e.MultiLayout }))), Ml = 64, Al = {
3476
+ }, $a = lt(() => import("./TreeLayout-zrSo4MNZ.js").then((e) => ({ default: e.TreeLayout }))), Fa = lt(() => import("./MultiLayout-DlATT7km.js").then((e) => ({ default: e.MultiLayout }))), Ia = 64, qa = {
3506
3477
  request: (e) => {
3507
3478
  requestAnimationFrame(e);
3508
3479
  }
3509
- }, Qt = (e) => {
3480
+ }, on = (e) => {
3510
3481
  e.documents.clear(), e.trees.clear();
3511
3482
  }, Xe = (e, t) => {
3512
3483
  t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
3513
3484
  for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
3514
- }, Ll = (e, t) => {
3515
- const [n, r] = z(() => ({ overrides: t, locale: e, labels: Rt(e, t) }));
3516
- if (n.locale === e && Nr(n.overrides, t)) return n.labels;
3517
- const o = { overrides: t, locale: e, labels: Rt(e, t) };
3485
+ }, _a = (e, t) => {
3486
+ const [n, r] = B(() => ({ overrides: t, locale: e, labels: Lt(e, t) }));
3487
+ if (n.locale === e && _r(n.overrides, t)) return n.labels;
3488
+ const o = { overrides: t, locale: e, labels: Lt(e, t) };
3518
3489
  return r(o), o.labels;
3519
- }, Nl = (e, t, n) => {
3520
- const [r, o] = z(() => ({ scope: t, store: Wt(e, n) }));
3490
+ }, Ba = (e, t, n) => {
3491
+ const [r, o] = B(() => ({ scope: t, store: Qt(e, n) }));
3521
3492
  if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
3522
- const i = { scope: t, store: Wt(e, n) };
3493
+ const i = { scope: t, store: Qt(e, n) };
3523
3494
  return o(i), i.store;
3524
- }, Ye = (e, t) => {
3525
- const [n, r] = z(() => ({ scope: e, value: t() }));
3495
+ }, Je = (e, t) => {
3496
+ const [n, r] = B(() => ({ scope: e, value: t() }));
3526
3497
  if (n.scope === e) return n.value;
3527
3498
  const o = { scope: e, value: t() };
3528
3499
  return r(o), o.value;
3529
- }, Dl = () => il(Al), en = "on", Pl = "off", Fl = Object.freeze({ kind: "unavailable" }), $l = (e) => {
3500
+ }, ja = () => ma(qa), ln = "on", za = "off", Va = Object.freeze({ kind: "unavailable" }), Ha = (e) => {
3530
3501
  if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
3531
3502
  throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
3532
- }, ql = (e, t) => {
3503
+ }, Ua = (e, t) => {
3533
3504
  const n = ue(e.peek(t));
3534
3505
  return n === null || n.document.kind === "failure" ? se(t) : n.document.name;
3535
- }, Ql = ({
3506
+ }, ss = ({
3536
3507
  data: e,
3537
3508
  config: t,
3538
3509
  storageNamespace: n,
3539
3510
  locale: r,
3540
3511
  labels: o,
3541
3512
  theme: i,
3542
- renderFrame: a,
3513
+ renderFrame: l,
3543
3514
  renderTreeFailure: u,
3544
3515
  lockDocumentScroll: m = !1,
3545
3516
  onMathDiagnostics: f,
3546
- onEditGrant: c,
3517
+ onEditGrant: d,
3547
3518
  draftConverter: h
3548
3519
  }) => {
3549
- yr(n), $l(h);
3550
- const g = un(r), E = Dr(i), k = Ll(g, o), { revalidate: R } = Vn(), T = _(() => {
3551
- }), A = Fe(t.dataPath), [L] = z(() => {
3552
- const x = ll({ dataPath: A, onScope: (F) => T.current(F) }), C = { documents: Fo({ client: x, capacity: Math.max(Ml, t.multiView.maxPanels * 2) }), trees: pl(x) };
3553
- return Xe(C, e), kt(n, e.scope), { data: x, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3520
+ Mr(n), Ha(h);
3521
+ const v = wn(r), E = Br(i), k = _a(v, o), { revalidate: R } = Xn(), T = q(() => {
3522
+ }), N = Fe(t.dataPath), [M] = B(() => {
3523
+ const x = pa({ dataPath: N, onScope: ($) => T.current($) }), C = { documents: zo({ client: x, capacity: Math.max(Ia, t.multiView.maxPanels * 2) }), trees: xa(x) };
3524
+ return Xe(C, e), Ct(n, e.scope), { data: x, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3554
3525
  });
3555
- if (L.aligned.pageData !== e || L.aligned.storageNamespace !== n) {
3556
- const x = L.aligned.pageData;
3557
- L.aligned.pageData = e, L.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? L.aligned.pendingReader = e : Xe(L, e)), kt(n, e.scope);
3526
+ if (M.aligned.pageData !== e || M.aligned.storageNamespace !== n) {
3527
+ const x = M.aligned.pageData;
3528
+ M.aligned.pageData = e, M.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? M.aligned.pendingReader = e : Xe(M, e)), Ct(n, e.scope);
3558
3529
  }
3559
- const b = Nl(we(n).treeSettings, e.scope, t.defaultTreeSettings);
3560
- j(() => {
3561
- const x = L.aligned.pendingReader;
3562
- x !== null && (L.aligned.pendingReader = null, Qt(L), Xe(L, x));
3563
- }, [e, L]), j(() => {
3530
+ const b = Ba(ge(n).treeSettings, e.scope, t.defaultTreeSettings);
3531
+ V(() => {
3532
+ const x = M.aligned.pendingReader;
3533
+ x !== null && (M.aligned.pendingReader = null, on(M), Xe(M, x));
3534
+ }, [e, M]), V(() => {
3564
3535
  let x = !1;
3565
3536
  return T.current = (C) => {
3566
- C === e.scope || x || (x = !0, C !== null && (Qt(L), xr(n)), R());
3537
+ C === e.scope || x || (x = !0, C !== null && (on(M), Lr(n)), R());
3567
3538
  }, () => {
3568
3539
  T.current = () => {
3569
3540
  };
3570
3541
  };
3571
- }, [e, R, L, n]);
3572
- const w = _(t.settingsCookie);
3573
- j(() => {
3574
- w.current = t.settingsCookie;
3542
+ }, [e, R, M, n]);
3543
+ const g = q(t.settingsCookie);
3544
+ V(() => {
3545
+ g.current = t.settingsCookie;
3575
3546
  }, [t.settingsCookie]);
3576
- const [l] = z(
3577
- () => vl(e.settings, (x) => {
3578
- document.cookie = er(w.current, x, window.location.protocol === "https:");
3547
+ const [a] = B(
3548
+ () => ka(e.settings, (x) => {
3549
+ document.cookie = ar(g.current, x, window.location.protocol === "https:");
3579
3550
  })
3580
- ), s = Ye(e.scope, Dl), v = Ye(e.scope, sl), O = _(k);
3581
- j(() => {
3551
+ ), s = Je(e.scope, ja), w = Je(e.scope, va), O = q(k);
3552
+ V(() => {
3582
3553
  O.current = k;
3583
3554
  }, [k]);
3584
- const M = Ye(
3555
+ const L = Je(
3585
3556
  e.scope,
3586
- () => Vr({
3587
- data: L.data,
3557
+ () => Xr({
3558
+ data: M.data,
3588
3559
  conflictLabels: () => ({ ours: O.current.conflictOurs, theirs: O.current.conflictTheirs }),
3589
3560
  onSaveSettled: (x, C) => {
3590
- C.kind === "saved" && L.documents.refresh(x);
3591
- const F = Fr(O.current, C, ql(L.documents, x));
3592
- F !== null && s.announce(F);
3561
+ C.kind === "saved" && M.documents.refresh(x);
3562
+ const $ = zr(O.current, C, Ua(M.documents, x));
3563
+ $ !== null && s.announce($);
3593
3564
  },
3594
3565
  sideBySideSetting: {
3595
- read: () => Qe(we(n).editPreview) === en,
3596
- write: (x) => Je(we(n).editPreview, x ? en : Pl)
3566
+ read: () => et(ge(n).editPreview) === ln,
3567
+ write: (x) => Qe(ge(n).editPreview, x ? ln : za)
3597
3568
  },
3598
3569
  editorShareSetting: {
3599
- read: () => Hr(Qe(we(n).editSplit)),
3600
- write: (x) => Je(we(n).editSplit, String(x))
3570
+ read: () => Yr(et(ge(n).editSplit)),
3571
+ write: (x) => Qe(ge(n).editSplit, String(x))
3601
3572
  }
3602
3573
  })
3603
- ), N = U(() => Te(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((x) => x.id).join(`
3604
- `), W = U(() => Qn(t, q.split(`
3605
- `)), [t, q]), G = _(f);
3606
- j(() => {
3574
+ ), A = H(() => Te(e.notices.catch(() => [])), [e.notices]), I = e.sources.map((x) => x.id).join(`
3575
+ `), K = H(() => lr(t, I.split(`
3576
+ `)), [t, I]), G = q(f);
3577
+ V(() => {
3607
3578
  G.current = f;
3608
3579
  }, [f]);
3609
- const [I] = z(() => (x, C) => {
3580
+ const [z] = B(() => (x, C) => {
3610
3581
  G.current?.(x, C);
3611
- }), J = f === void 0 ? void 0 : I, H = _(h);
3612
- j(() => {
3613
- H.current = h;
3582
+ }), X = f === void 0 ? void 0 : z, j = q(h);
3583
+ V(() => {
3584
+ j.current = h;
3614
3585
  }, [h]);
3615
- const [ne] = z(() => {
3586
+ const [re] = B(() => {
3616
3587
  let x = !1;
3617
3588
  return {
3618
- convert: (C, F) => {
3619
- const B = H.current;
3620
- return B === void 0 ? Promise.resolve(Fl) : B.convert(C, F);
3589
+ convert: (C, $) => {
3590
+ const _ = j.current;
3591
+ return _ === void 0 ? Promise.resolve(Va) : _.convert(C, $);
3621
3592
  },
3622
3593
  prepare: () => {
3623
3594
  try {
3624
- H.current?.prepare?.();
3595
+ j.current?.prepare?.();
3625
3596
  } catch (C) {
3626
3597
  if (x) return;
3627
3598
  x = !0, console.error("[markdown-explorer] the draft converter's prepare threw", C);
3628
3599
  }
3629
3600
  }
3630
3601
  };
3631
- }), p = h === void 0 ? void 0 : ne, S = U(
3602
+ }), p = h === void 0 ? void 0 : re, y = H(
3632
3603
  () => ({
3633
- config: W,
3604
+ config: K,
3634
3605
  labels: k,
3635
- locale: g,
3606
+ locale: v,
3636
3607
  theme: E,
3637
3608
  storageNamespace: n,
3638
3609
  scope: e.scope,
3639
3610
  sources: e.sources,
3640
- notices: N,
3641
- documents: L.documents,
3642
- trees: L.trees,
3643
- data: L.data,
3644
- viewSettings: l,
3611
+ notices: A,
3612
+ documents: M.documents,
3613
+ trees: M.trees,
3614
+ data: M.data,
3615
+ viewSettings: a,
3645
3616
  treeSettings: b,
3646
3617
  announcer: s,
3647
- reveals: v,
3648
- edits: M,
3649
- onEditGrant: c,
3618
+ reveals: w,
3619
+ edits: L,
3620
+ onEditGrant: d,
3650
3621
  draftConverter: p,
3651
3622
  renderTreeFailure: u,
3652
- reportMathDiagnostics: J
3623
+ reportMathDiagnostics: X
3653
3624
  }),
3654
- [W, k, g, E, n, e.scope, e.sources, N, L, l, b, s, v, M, c, p, u, J]
3625
+ [K, k, v, E, n, e.scope, e.sources, A, M, a, b, s, w, L, d, p, u, X]
3655
3626
  );
3656
- return /* @__PURE__ */ d(fn, { value: S, children: /* @__PURE__ */ d(Il, { renderFrame: a, lockDocumentScroll: m }, e.scope) });
3657
- }, _l = ({ ref: e, theme: t, view: n, children: r }) => {
3658
- const [o] = z(bi);
3659
- return /* @__PURE__ */ d("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
3660
- }, Il = ({ renderFrame: e, lockDocumentScroll: t }) => {
3661
- const { theme: n, labels: r } = D(), o = at(), { hash: i } = nn(), a = $e(), u = _(null);
3662
- xl(t, u), j(() => {
3663
- o.kind === "redirect" && a(`${o.href}${i}`, "browse");
3664
- }, [o, i, a]);
3627
+ return /* @__PURE__ */ c(bn, { value: y, children: /* @__PURE__ */ c(Ga, { renderFrame: l, lockDocumentScroll: m }, e.scope) });
3628
+ }, Za = ({ ref: e, theme: t, view: n, children: r }) => {
3629
+ const [o] = B(Ri);
3630
+ 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 });
3631
+ }, Ga = ({ renderFrame: e, lockDocumentScroll: t }) => {
3632
+ const { theme: n, labels: r } = D(), o = st(), { hash: i } = sn(), l = Ie(), u = q(null);
3633
+ Aa(t, u), V(() => {
3634
+ o.kind === "redirect" && l(`${o.href}${i}`, "browse");
3635
+ }, [o, i, l]);
3665
3636
  const { location: m } = o, f = m.view;
3666
- Rl(u, f);
3667
- const c = m.view === "tree" ? /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ d(Ol, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...et }), children: /* @__PURE__ */ d(Cl, { location: m }) }) : /* @__PURE__ */ d(rl, { location: m }), h = /* @__PURE__ */ $(_l, { ref: u, theme: n, view: f, children: [
3668
- c,
3669
- /* @__PURE__ */ d(so, {}),
3670
- /* @__PURE__ */ d(ol, { holds: !0, testId: "markdown-explorer-announcer" })
3637
+ Pa(u, f);
3638
+ const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...tt }), children: /* @__PURE__ */ c($a, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...tt }), children: /* @__PURE__ */ c(Fa, { location: m }) }) : /* @__PURE__ */ c(ua, { location: m }), h = /* @__PURE__ */ F(Za, { ref: u, theme: n, view: f, children: [
3639
+ d,
3640
+ /* @__PURE__ */ c(vo, {}),
3641
+ /* @__PURE__ */ c(fa, { holds: !0, testId: "markdown-explorer-announcer" })
3671
3642
  ] });
3672
3643
  return e === void 0 ? h : e({ view: f, children: h });
3673
- }, es = kr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
3644
+ }, cs = Ar({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
3674
3645
  export {
3675
- Tt as $,
3676
- rt as A,
3677
- Ut as B,
3678
- $r as C,
3679
- nl as D,
3680
- Pa as E,
3681
- Jr as F,
3682
- qa as G,
3646
+ Mt as $,
3647
+ ot as A,
3648
+ Xt as B,
3649
+ Vr as C,
3650
+ da as D,
3651
+ Hl as E,
3652
+ io as F,
3653
+ Gl as G,
3683
3654
  Oe as H,
3684
- Yl as I,
3685
- Si as J,
3686
- Zr as K,
3687
- yn as L,
3688
- Do as M,
3689
- Qi as N,
3690
- ga as O,
3691
- tl as P,
3692
- Ao as Q,
3693
- Ma as R,
3694
- Mo as S,
3695
- at as T,
3696
- ol as U,
3697
- Le as V,
3698
- Tr as W,
3699
- Ot as X,
3700
- Mr as Y,
3701
- cn as Z,
3702
- Rr as _,
3703
- qr as a,
3704
- Ql as a0,
3705
- Rt as a1,
3706
- es as a2,
3707
- _r as b,
3708
- $e as c,
3709
- Ja as d,
3710
- et as e,
3711
- va as f,
3712
- xo as g,
3713
- Ir as h,
3714
- Oo as i,
3715
- yo as j,
3716
- le as k,
3717
- Co as l,
3655
+ ls as I,
3656
+ Ci as J,
3657
+ Jr as K,
3658
+ Mn as L,
3659
+ Bo as M,
3660
+ dl as N,
3661
+ Cl as O,
3662
+ ca as P,
3663
+ Io as Q,
3664
+ _l as R,
3665
+ Fo as S,
3666
+ st as T,
3667
+ fa as U,
3668
+ Ne as V,
3669
+ Nr as W,
3670
+ At as X,
3671
+ Fr as Y,
3672
+ gn as Z,
3673
+ Dr as _,
3674
+ Hr as a,
3675
+ ss as a0,
3676
+ Lt as a1,
3677
+ cs as a2,
3678
+ Ur as b,
3679
+ Ie as c,
3680
+ al as d,
3681
+ tt as e,
3682
+ Rl as f,
3683
+ Lo as g,
3684
+ Zr as h,
3685
+ Po as i,
3686
+ Mo as j,
3687
+ ae as k,
3688
+ $o as l,
3718
3689
  ue as m,
3719
- Eo as n,
3720
- So as o,
3690
+ Oo as n,
3691
+ Co as o,
3721
3692
  me as p,
3722
- ao as q,
3723
- to as r,
3724
- $a as s,
3725
- Xl as t,
3693
+ ho as q,
3694
+ so as r,
3695
+ Zl as s,
3696
+ is as t,
3726
3697
  D as u,
3727
- ko as v,
3728
- Jl as w,
3729
- hn as x,
3730
- Ia as y,
3731
- _a as z
3698
+ Ao as v,
3699
+ as as w,
3700
+ yn as x,
3701
+ Wl as y,
3702
+ Kl as z
3732
3703
  };