@aiquants/markdown-explorer 0.34.0 → 0.36.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 (146) hide show
  1. package/CHANGELOG.md +608 -0
  2. package/README.md +121 -41
  3. package/dist/EditSurface-B70iRFkG.cjs +6 -0
  4. package/dist/EditSurface-BCFJRyIM.js +990 -0
  5. package/dist/ExplorerSplit-BNrHrIus.cjs +2 -0
  6. package/dist/ExplorerSplit-Bgccz2nm.js +1589 -0
  7. package/dist/MultiLayout-Bo9LAXiY.cjs +1 -0
  8. package/dist/{MultiLayout-kcZyVnvK.js → MultiLayout-Dy5TIC2t.js} +249 -248
  9. package/dist/{NativeScrollBar-pUbA4Zq3.cjs → NativeScrollBar-Bj-LKej0.cjs} +1 -1
  10. package/dist/{NativeScrollBar-UNed10Na.js → NativeScrollBar-DpZMYhmf.js} +2 -2
  11. package/dist/TreeLayout-DsSKW_Qj.js +103 -0
  12. package/dist/TreeLayout-T8sc_wg7.cjs +1 -0
  13. package/dist/client/MarkdownExplorer.d.cts +14 -1
  14. package/dist/client/MarkdownExplorer.d.ts +14 -1
  15. package/dist/client/edit/lineEndings.d.cts +4 -0
  16. package/dist/client/edit/lineEndings.d.ts +4 -0
  17. package/dist/client/hostContract.d.cts +67 -0
  18. package/dist/client/hostContract.d.ts +67 -0
  19. package/dist/core/config.d.cts +13 -0
  20. package/dist/core/config.d.ts +13 -0
  21. package/dist/core/contracts.d.cts +31 -4
  22. package/dist/core/contracts.d.ts +31 -4
  23. package/dist/core/dataRoute.d.cts +5 -1
  24. package/dist/core/dataRoute.d.ts +5 -1
  25. package/dist/core/documentId.d.cts +6 -0
  26. package/dist/core/documentId.d.ts +6 -0
  27. package/dist/core/draftAnswer.d.cts +23 -0
  28. package/dist/core/draftAnswer.d.ts +23 -0
  29. package/dist/core/labels.d.cts +78 -0
  30. package/dist/core/labels.d.ts +78 -0
  31. package/dist/core/location.d.cts +22 -2
  32. package/dist/core/location.d.ts +22 -2
  33. package/dist/core/ownUrls.d.cts +15 -0
  34. package/dist/core/ownUrls.d.ts +15 -0
  35. package/dist/core/treeSettings.d.cts +3 -2
  36. package/dist/core/treeSettings.d.ts +3 -2
  37. package/dist/core/viewSettings.d.cts +3 -1
  38. package/dist/core/viewSettings.d.ts +3 -1
  39. package/dist/describeValue-CLlVRO8d.js +17 -0
  40. package/dist/describeValue-Ccvhbt36.cjs +1 -0
  41. package/dist/explorerCore-B3RGmMG6.js +1083 -0
  42. package/dist/explorerCore-CUkyKtm8.cjs +1 -0
  43. package/dist/index-D0l_BJqb.js +5980 -0
  44. package/dist/index-lpL7GltU.cjs +18 -0
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.d.cts +8 -4
  47. package/dist/index.d.ts +8 -4
  48. package/dist/index.js +53 -43
  49. package/dist/licenses/@heroicons/react/LICENSE +21 -0
  50. package/dist/licenses/entities/LICENSE +11 -0
  51. package/dist/licenses/parse5/LICENSE +19 -0
  52. package/dist/location-Dh6K-y7w.js +761 -0
  53. package/dist/location-DrOP6t1F.cjs +1 -0
  54. package/dist/lru-DC8GBmkX.js +39 -0
  55. package/dist/lru-SGmUyBQU.cjs +1 -0
  56. package/dist/{merge-C1MWvhCS.js → merge-BwcqBd4c.js} +1 -1
  57. package/dist/{merge-BziXxZkE.cjs → merge-Dckw7r9T.cjs} +1 -1
  58. package/dist/nestingGuardWorker.js +5511 -0
  59. package/dist/ownUrls-BTPGNhBt.cjs +1 -0
  60. package/dist/ownUrls-DD0cSCsF.js +409 -0
  61. package/dist/sanitizeJob-BYqzjFJC.js +21 -0
  62. package/dist/sanitizeJob-CudE1RUP.cjs +1 -0
  63. package/dist/sanitizePolicy-C-ehd0J_.cjs +2 -0
  64. package/dist/sanitizePolicy-DAPnUUVm.js +139 -0
  65. package/dist/sanitizeWorker.cjs +1 -1
  66. package/dist/sanitizeWorker.js +134 -139
  67. package/dist/sanitizerService-B8v4ap9t.js +240 -0
  68. package/dist/sanitizerService-DomN7lwC.cjs +1 -0
  69. package/dist/server/assetResponse.d.cts +60 -0
  70. package/dist/server/assetResponse.d.ts +60 -0
  71. package/dist/server/browser/browserPlatform.d.cts +12 -0
  72. package/dist/server/browser/browserPlatform.d.ts +12 -0
  73. package/dist/server/createMarkdownExplorer.d.cts +0 -10
  74. package/dist/server/createMarkdownExplorer.d.ts +0 -10
  75. package/dist/server/errors.d.cts +1 -1
  76. package/dist/server/errors.d.ts +1 -1
  77. package/dist/server/explorerCore.d.cts +12 -0
  78. package/dist/server/explorerCore.d.ts +12 -0
  79. package/dist/server/fileSystemSource.d.cts +1 -0
  80. package/dist/server/fileSystemSource.d.ts +1 -0
  81. package/dist/server/inProcessFetch.d.cts +5 -0
  82. package/dist/server/inProcessFetch.d.ts +5 -0
  83. package/dist/server/platform.d.cts +18 -0
  84. package/dist/server/platform.d.ts +18 -0
  85. package/dist/server/ports.d.cts +55 -5
  86. package/dist/server/ports.d.ts +55 -5
  87. package/dist/server/sanitizeProtocol.d.cts +3 -0
  88. package/dist/server/sanitizeProtocol.d.ts +3 -0
  89. package/dist/server/sanitizer.d.cts +5 -40
  90. package/dist/server/sanitizer.d.ts +5 -40
  91. package/dist/server/sanitizerOptions.d.cts +24 -0
  92. package/dist/server/sanitizerOptions.d.ts +24 -0
  93. package/dist/server/sanitizerService.d.cts +41 -0
  94. package/dist/server/sanitizerService.d.ts +41 -0
  95. package/dist/server/{workerPool.d.cts → workerJobs.d.cts} +0 -16
  96. package/dist/server/{workerPool.d.ts → workerJobs.d.ts} +0 -16
  97. package/dist/server.cjs +1 -1
  98. package/dist/server.d.cts +3 -1
  99. package/dist/server.d.ts +3 -1
  100. package/dist/server.js +270 -1343
  101. package/dist/serverBrowser.cjs +1 -0
  102. package/dist/serverBrowser.d.cts +1 -0
  103. package/dist/serverBrowser.d.ts +1 -0
  104. package/dist/serverBrowser.js +120 -0
  105. package/dist/serverCore.cjs +1 -0
  106. package/dist/serverCore.d.cts +14 -0
  107. package/dist/serverCore.d.ts +14 -0
  108. package/dist/serverCore.js +46 -0
  109. package/dist/storage-BpYsprog.cjs +1 -0
  110. package/dist/{storage-CmGHg7OA.js → storage-D1uSw-xj.js} +19 -18
  111. package/dist/storage.cjs +1 -1
  112. package/dist/storage.js +1 -1
  113. package/dist/styles/markdown-explorer.css +1 -1
  114. package/dist/{tapScrollCircle-DigcJCsu.cjs → tapScrollCircle-DyLInGck.cjs} +1 -1
  115. package/dist/{tapScrollCircle-D_BpaLwY.js → tapScrollCircle-smKLgRa2.js} +1 -1
  116. package/dist/testing.cjs +1 -0
  117. package/dist/testing.d.cts +11 -0
  118. package/dist/testing.d.ts +11 -0
  119. package/dist/testing.js +82 -0
  120. package/dist/useSplitPersistence-BUa_KMsV.cjs +1 -0
  121. package/dist/useSplitPersistence-pnb21dsr.js +44 -0
  122. package/docs/behavior/dom-hooks.md +5 -1
  123. package/docs/behavior/hosting.md +123 -0
  124. package/docs/behavior/layout.md +5 -3
  125. package/docs/behavior/localization.md +25 -8
  126. package/docs/behavior/security.md +55 -15
  127. package/docs/behavior/url-contract.md +30 -3
  128. package/package.json +48 -10
  129. package/dist/EditSurface-CF82jZQg.cjs +0 -6
  130. package/dist/EditSurface-CqHk2R3k.js +0 -982
  131. package/dist/ExplorerSplit-D325YGEf.cjs +0 -1
  132. package/dist/ExplorerSplit-DGH9bckm.js +0 -1500
  133. package/dist/MultiLayout-CzR7yJ0m.cjs +0 -1
  134. package/dist/TreeLayout-BnIU87HX.js +0 -96
  135. package/dist/TreeLayout-DtvIpuOe.cjs +0 -1
  136. package/dist/dataRoute-D6KiSHIc.js +0 -298
  137. package/dist/dataRoute-DwYtgyt6.cjs +0 -1
  138. package/dist/index-BDCbvHDs.cjs +0 -15
  139. package/dist/index-DR31S_-4.js +0 -5012
  140. package/dist/location-C44b9H1S.js +0 -676
  141. package/dist/location-hGLhCCg4.cjs +0 -1
  142. package/dist/sanitizePolicy-CwvyPpp5.js +0 -98
  143. package/dist/sanitizePolicy-T5T-3vV5.cjs +0 -1
  144. package/dist/storage-DM0EvkVf.cjs +0 -1
  145. package/dist/useSplitPersistence-DCeYbJMx.js +0 -38
  146. package/dist/useSplitPersistence-QGcvyMAa.cjs +0 -1
@@ -1,15 +1,16 @@
1
- import { jsxs as ie, jsx as A } from "react/jsx-runtime";
2
- import { createContext as Je, use as Ne, useRef as q, useState as $, useLayoutEffect as F, useMemo as D, useSyncExternalStore as Xe, useCallback as R, memo as Ze, useEffect as U, useImperativeHandle as Qe } from "react";
3
- import { n as ce, e as Ae, o as en, P as nn, q as tn } from "./location-C44b9H1S.js";
4
- import { Q as on, u as J, R as rn, S as ln, D as sn, j as an, g as cn, U as V, I as un, i as Me, V as dn, N as mn, W as ke, X as fn, Y as pn, Z as Ie, _ as gn, $ as Le, a0 as hn } from "./index-DR31S_-4.js";
5
- import { S as vn, a as wn, b as yn } from "./ExplorerSplit-DGH9bckm.js";
6
- import { SCROLL_AREA_SELECTOR as Re, SCROLL_ROOT_SELECTOR as te, PANEL_ACTION_ATTRIBUTE as he, generateColumnIds as Sn, sortColumnIds as De, generateColumnId as _e, NO_PANEL_DRAG_ATTRIBUTE as xn, useDragDropColumns as En, DEFAULT_DEBUG_CONFIG as ve, DragDropLayout as On } from "@aiquants/drag-drop-panels";
7
- import { useNavigate as Pn, useLocation as bn } from "react-router";
8
- import { s as Cn, r as Tn, w as Nn } from "./storage-CmGHg7OA.js";
9
- import { l as An, i as Mn } from "./dataRoute-D6KiSHIc.js";
10
- import { createPortal as kn } from "react-dom";
11
- import { HostedScrollArea as In } from "@aiquants/markdown";
12
- const Ln = () => {
1
+ import { jsxs as ae, jsx as A } from "react/jsx-runtime";
2
+ import { createContext as Xe, use as Ae, useRef as q, useState as $, useLayoutEffect as F, useMemo as D, useSyncExternalStore as Ze, useCallback as R, memo as Qe, useEffect as U, useImperativeHandle as en } from "react";
3
+ import { d as J } from "./describeValue-CLlVRO8d.js";
4
+ import { s as ue, e as Me, u as nn, P as tn, v as on } from "./location-Dh6K-y7w.js";
5
+ import { R as rn, u as X, S as ln, U as sn, D as an, j as cn, g as un, V, J as dn, i as ke, W as mn, N as fn, X as Ie, Y as pn, Z as gn, _ as Le, $ as hn, a0 as Re, a1 as vn } from "./index-D0l_BJqb.js";
6
+ import { S as wn, a as yn, b as Sn } from "./ExplorerSplit-Bgccz2nm.js";
7
+ import { SCROLL_AREA_SELECTOR as De, SCROLL_ROOT_SELECTOR as oe, PANEL_ACTION_ATTRIBUTE as ve, generateColumnIds as xn, sortColumnIds as _e, generateColumnId as ze, NO_PANEL_DRAG_ATTRIBUTE as En, useDragDropColumns as On, DEFAULT_DEBUG_CONFIG as we, DragDropLayout as Pn } from "@aiquants/drag-drop-panels";
8
+ import { useNavigate as bn, useLocation as Cn } from "react-router";
9
+ import { s as Tn, r as Nn, w as An } from "./storage-D1uSw-xj.js";
10
+ import { l as Mn, i as kn } from "./ownUrls-DD0cSCsF.js";
11
+ import { createPortal as In } from "react-dom";
12
+ import { HostedScrollArea as Ln } from "@aiquants/markdown";
13
+ const Rn = () => {
13
14
  const e = /* @__PURE__ */ new Map();
14
15
  return {
15
16
  hold: (n, t) => {
@@ -22,35 +23,35 @@ const Ln = () => {
22
23
  return e.delete(n), t === void 0 ? null : t;
23
24
  }
24
25
  };
25
- }, ze = Je(null), ue = () => {
26
- const e = Ne(ze);
26
+ }, He = Xe(null), de = () => {
27
+ const e = Ae(He);
27
28
  if (e === null) throw new Error("[markdown-explorer] multi-view panels must be rendered inside the multi-view stage");
28
29
  return e;
29
- }, Rn = (e, n) => {
30
+ }, Dn = (e, n) => {
30
31
  const t = e.pendingHashes.get(n);
31
32
  return t === void 0 ? null : t;
32
- }, Dn = 0xcbf29ce484222325n, _n = 0x100000001b3n, zn = (1n << 64n) - 1n, Hn = (1n << 53n) - 1n, Bn = new TextEncoder(), qn = (e) => {
33
- let n = Dn;
34
- for (const t of Bn.encode(e))
35
- n = (n ^ BigInt(t)) * _n & zn;
36
- return Number(n & Hn);
37
- }, oe = 256, Fn = (e) => `aqmx-p-${qn(e).toString(36)}`, He = (e, n) => {
38
- const t = Fn(e);
33
+ }, _n = 0xcbf29ce484222325n, zn = 0x100000001b3n, Hn = (1n << 64n) - 1n, Bn = (1n << 53n) - 1n, qn = new TextEncoder(), Fn = (e) => {
34
+ let n = _n;
35
+ for (const t of qn.encode(e))
36
+ n = (n ^ BigInt(t)) * zn & Hn;
37
+ return Number(n & Bn);
38
+ }, re = 256, Vn = (e) => `aqmx-p-${Fn(e).toString(36)}`, Be = (e, n) => {
39
+ const t = Vn(e);
39
40
  let o = t;
40
41
  for (let r = 2; n.has(o); r += 1) o = `${t}-${String(r)}`;
41
42
  return o;
42
- }, Vn = /* @__PURE__ */ new Map(), $n = (e, n = Vn) => {
43
+ }, $n = /* @__PURE__ */ new Map(), Un = (e, n = $n) => {
43
44
  const t = new Set(e.flatMap((r) => n.get(r) ?? [])), o = /* @__PURE__ */ new Map();
44
45
  for (const r of e) {
45
- const l = n.get(r) ?? He(r, t);
46
+ const l = n.get(r) ?? Be(r, t);
46
47
  t.add(l), o.set(r, l);
47
48
  }
48
49
  return o;
49
- }, Be = (e, n, t) => {
50
+ }, qe = (e, n, t) => {
50
51
  const o = e.columnOf.get(n);
51
52
  return o === void 0 ? void 0 : Math.min(t - 1, Math.max(0, o));
52
- }, qe = (e, n) => {
53
- const [t, ...o] = ce(n.logical, n.visible);
53
+ }, Fe = (e, n) => {
54
+ const [t, ...o] = ue(n.logical, n.visible);
54
55
  if (t === void 0) throw new RangeError("[markdown-explorer] there must be at least one visible column");
55
56
  const r = ([d, p]) => e.slice(d, p).reduce((i, y) => i + y.length, 0);
56
57
  let l = t;
@@ -58,15 +59,15 @@ const Ln = () => {
58
59
  let a = l[0];
59
60
  for (let d = l[0]; d < l[1]; d += 1) (e[d]?.length ?? 0) < (e[a]?.length ?? 0) && (a = d);
60
61
  return a;
61
- }, re = (e, n) => {
62
+ }, le = (e, n) => {
62
63
  const t = Array.from({ length: n.logical }, () => []), o = [];
63
64
  for (const r of e.docs) {
64
- const l = Be(e, r, n.logical);
65
+ const l = qe(e, r, n.logical);
65
66
  l === void 0 ? o.push(r) : t[l]?.push(r);
66
67
  }
67
- for (const r of o) t[qe(t, n)]?.push(r);
68
+ for (const r of o) t[Fe(t, n)]?.push(r);
68
69
  return t;
69
- }, Un = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), jn = (e, n, t) => {
70
+ }, jn = (e, n) => ue(e.length, n).map(([t, o]) => e.slice(t, o).flat()), Gn = (e, n, t) => {
70
71
  const [o, r] = n, l = r - o, a = e.length, d = Array.from({ length: l }, (w, u) => {
71
72
  const v = [0];
72
73
  for (const g of e) v.push((v.at(-1) ?? 0) + (t(g) === o + u ? 1 : 0));
@@ -86,24 +87,24 @@ const Ln = () => {
86
87
  b[w - 1] = e.slice(u, k), k = u;
87
88
  }
88
89
  return b;
89
- }, Fe = (e, n) => {
90
+ }, Ve = (e, n) => {
90
91
  const t = n.flat(), o = new Map(e.columnOf);
91
92
  for (const [r, l] of n.entries())
92
93
  for (const a of l)
93
94
  o.delete(a), o.set(a, r);
94
95
  for (const r of o.keys()) {
95
- if (o.size <= oe) break;
96
+ if (o.size <= re) break;
96
97
  o.delete(r);
97
98
  }
98
99
  return { docs: t, columnOf: o };
99
- }, Gn = (e, n, t, o) => {
100
+ }, Yn = (e, n, t, o) => {
100
101
  if (e.docs.includes(n)) return { state: e, outcome: "existing" };
101
102
  if (e.docs.length >= o) return { state: e, outcome: "rejected" };
102
- const r = re(e, t), l = Be(e, n, t.logical) ?? qe(r, t);
103
+ const r = le(e, t), l = qe(e, n, t.logical) ?? Fe(r, t);
103
104
  r[l]?.push(n);
104
105
  const a = new Map(e.panelIds);
105
- return a.set(n, He(n, new Set(a.values()))), { state: { ...e, ...Fe(e, r), panelIds: a }, outcome: "opened" };
106
- }, Ve = (e, n) => {
106
+ return a.set(n, Be(n, new Set(a.values()))), { state: { ...e, ...Ve(e, r), panelIds: a }, outcome: "opened" };
107
+ }, $e = (e, n) => {
107
108
  if (!e.docs.includes(n)) return e;
108
109
  const t = new Set(e.hidden);
109
110
  t.delete(n);
@@ -111,12 +112,12 @@ const Ln = () => {
111
112
  o.delete(n);
112
113
  const r = new Map(e.panelIds);
113
114
  return r.delete(n), { ...e, docs: e.docs.filter((l) => l !== n), hidden: t, markup: o, panelIds: r, maximized: e.maximized === n ? null : e.maximized };
114
- }, Yn = (e, n, t, o) => {
115
- if (e.hidden.has(n)) return { state: $e(e, n, !1), outcome: "shown" };
116
- if (e.docs.includes(n)) return { state: Ve(e, n), outcome: "closed" };
117
- const r = Gn(e, n, t, o);
115
+ }, Wn = (e, n, t, o) => {
116
+ if (e.hidden.has(n)) return { state: Ue(e, n, !1), outcome: "shown" };
117
+ if (e.docs.includes(n)) return { state: $e(e, n), outcome: "closed" };
118
+ const r = Yn(e, n, t, o);
118
119
  return { state: r.state, outcome: r.outcome === "rejected" ? "rejected" : "opened" };
119
- }, Wn = (e, n, t) => {
120
+ }, Kn = (e, n, t) => {
120
121
  if (n === t || !e.docs.includes(n)) return { state: e, outcome: "ignored" };
121
122
  if (e.docs.includes(t)) return { state: e, outcome: "existing" };
122
123
  const o = new Map(e.columnOf), r = o.get(n);
@@ -124,41 +125,41 @@ const Ln = () => {
124
125
  const l = new Set(e.hidden);
125
126
  l.delete(n);
126
127
  const a = new Map(e.panelIds), d = a.get(n);
127
- if (d === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
128
+ if (d === void 0) throw new Error(`[markdown-explorer] the open document ${J(n)} has no panel id`);
128
129
  a.delete(n), a.set(t, d);
129
130
  const p = new Set(e.markup);
130
131
  return p.delete(n), {
131
132
  state: { docs: e.docs.map((i) => i === n ? t : i), maximized: e.maximized === n ? t : e.maximized, columnOf: o, hidden: l, markup: p, panelIds: a },
132
133
  outcome: "navigated"
133
134
  };
134
- }, $e = (e, n, t) => {
135
+ }, Ue = (e, n, t) => {
135
136
  if (!e.docs.includes(n) || e.hidden.has(n) === t) return e;
136
137
  const o = new Set(e.hidden);
137
138
  return t ? o.add(n) : o.delete(n), { ...e, hidden: o, maximized: t && e.maximized === n ? null : e.maximized };
138
- }, Kn = (e, n, t) => {
139
+ }, Jn = (e, n, t) => {
139
140
  if (!e.docs.includes(n) || e.markup.has(n) === t) return e;
140
141
  const o = new Set(e.markup);
141
142
  return t ? o.add(n) : o.delete(n), { ...e, markup: o };
142
- }, Jn = (e, n) => {
143
+ }, Xn = (e, n) => {
143
144
  if (e.maximized === n || n !== null && !e.docs.includes(n)) return e;
144
145
  if (n === null || !e.hidden.has(n)) return { ...e, maximized: n };
145
146
  const t = new Set(e.hidden);
146
147
  return t.delete(n), { ...e, maximized: n, hidden: t };
147
- }, Xn = (e, n, t) => {
148
- const o = re(e, t), r = /* @__PURE__ */ new Map();
148
+ }, Zn = (e, n, t) => {
149
+ const o = le(e, t), r = /* @__PURE__ */ new Map();
149
150
  for (const [i, y] of o.entries())
150
151
  for (const E of y) r.set(E, i);
151
- const l = new Set(e.docs), a = /* @__PURE__ */ new Set(), d = ce(t.logical, t.visible), p = Array.from({ length: t.logical }, () => []);
152
+ const l = new Set(e.docs), a = /* @__PURE__ */ new Set(), d = ue(t.logical, t.visible), p = Array.from({ length: t.logical }, () => []);
152
153
  for (const [i, y] of d.entries()) {
153
154
  const E = (n[i] ?? []).filter((b) => l.has(b) && !a.has(b));
154
155
  for (const b of E) a.add(b);
155
- for (const [b, k] of jn(E, y, (w) => r.get(w)).entries())
156
+ for (const [b, k] of Gn(E, y, (w) => r.get(w)).entries())
156
157
  p[y[0] + b]?.push(...k);
157
158
  }
158
159
  for (const i of e.docs)
159
160
  a.has(i) || p[r.get(i) ?? 0]?.push(i);
160
- return p.every((i, y) => i.length === o[y]?.length && i.every((E, b) => o[y]?.[b] === E)) ? e : { ...e, ...Fe(e, p) };
161
- }, le = (e, n) => {
161
+ return p.every((i, y) => i.length === o[y]?.length && i.every((E, b) => o[y]?.[b] === E)) ? e : { ...e, ...Ve(e, p) };
162
+ }, se = (e, n) => {
162
163
  const t = [...new Set(e.docs)].slice(0, n), o = new Set(t), r = e.maximized !== null && o.has(e.maximized) ? e.maximized : null;
163
164
  return {
164
165
  docs: t,
@@ -166,20 +167,20 @@ const Ln = () => {
166
167
  columnOf: e.stored.columnOf,
167
168
  hidden: new Set([...e.stored.hidden].filter((l) => o.has(l) && l !== r)),
168
169
  markup: new Set(e.markup.filter((l) => o.has(l))),
169
- panelIds: $n(t, e.panelIds)
170
+ panelIds: Un(t, e.panelIds)
170
171
  };
171
- }, we = (e, n) => {
172
+ }, ye = (e, n) => {
172
173
  if (e.docs.every((o) => e.columnOf.has(o))) return e;
173
174
  const t = new Map(e.columnOf);
174
- for (const [o, r] of re(e, n).entries())
175
+ for (const [o, r] of le(e, n).entries())
175
176
  for (const l of r)
176
177
  t.delete(l), t.set(l, o);
177
178
  for (const o of t.keys()) {
178
- if (t.size <= oe) break;
179
+ if (t.size <= re) break;
179
180
  t.delete(o);
180
181
  }
181
182
  return { ...e, columnOf: t };
182
- }, Ue = 1, Y = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Zn = (e, n) => {
183
+ }, je = 1, Y = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Qn = (e, n) => {
183
184
  if (e === null || e === "") return Y;
184
185
  let t;
185
186
  try {
@@ -189,30 +190,30 @@ const Ln = () => {
189
190
  }
190
191
  if (t === null || typeof t != "object" || Array.isArray(t)) return Y;
191
192
  const o = t;
192
- if (o.v !== Ue) return Y;
193
+ if (o.v !== je) return Y;
193
194
  const r = /* @__PURE__ */ new Map();
194
195
  if (Array.isArray(o.columnOf))
195
- for (const a of o.columnOf.slice(-oe))
196
+ for (const a of o.columnOf.slice(-re))
196
197
  Array.isArray(a) && a.length === 2 && typeof a[0] == "string" && a[0] !== "" && Number.isInteger(a[1]) && a[1] >= 0 && a[1] < n && (r.delete(a[0]), r.set(a[0], a[1]));
197
198
  const l = new Set(Array.isArray(o.hidden) ? o.hidden.filter((a) => typeof a == "string" && a !== "") : []);
198
199
  return { columnOf: r, hidden: l };
199
- }, Qn = (e) => JSON.stringify({
200
- v: Ue,
201
- columnOf: [...e.columnOf.entries()].slice(-oe),
200
+ }, et = (e) => JSON.stringify({
201
+ v: je,
202
+ columnOf: [...e.columnOf.entries()].slice(-re),
202
203
  hidden: e.docs.filter((n) => e.hidden.has(n))
203
- }), de = (e, n) => {
204
+ }), me = (e, n) => {
204
205
  const t = e.get(n);
205
- return t === void 0 ? An(n) : t;
206
- }, X = (e) => {
206
+ return t === void 0 ? Mn(n) : t;
207
+ }, Z = (e) => {
207
208
  const n = /* @__PURE__ */ new Map();
208
209
  for (const [t, o] of e.panelIds) n.set(o, t);
209
210
  return n;
210
- }, ye = (e) => {
211
- if (!Mn(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${JSON.stringify(e.slice(0, 80))}`);
212
- }, et = ({ config: e, location: n, writeUrl: t, persist: o }) => {
213
- const { maxPanels: r, columns: l } = e.multiView, a = on(), d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
211
+ }, Se = (e) => {
212
+ if (!kn(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${J(e)}`);
213
+ }, nt = ({ config: e, location: n, writeUrl: t, persist: o }) => {
214
+ const { maxPanels: r, columns: l } = e.multiView, a = rn(), d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
214
215
  let i = {
215
- layout: le({ docs: n.docs, maximized: n.maximized, markup: n.markup, stored: Y }, r),
216
+ layout: se({ docs: n.docs, maximized: n.maximized, markup: n.markup, stored: Y }, r),
216
217
  source: n.source,
217
218
  visibleColumns: l,
218
219
  ready: !1,
@@ -220,7 +221,7 @@ const Ln = () => {
220
221
  titles: /* @__PURE__ */ new Map(),
221
222
  pendingHashes: /* @__PURE__ */ new Map()
222
223
  }, y = !1;
223
- const E = (s) => y ? we(s, { logical: l, visible: i.visibleColumns }) : s, b = (s, h) => Ae(e, { view: "multi", source: s, docs: h.docs, maximized: h.maximized, markup: h.markup }), k = (s) => ({ docs: s.docs, maximized: s.maximized, markup: [...s.markup] });
224
+ const E = (s) => y ? ye(s, { logical: l, visible: i.visibleColumns }) : s, b = (s, h) => Me(e, { view: "multi", source: s, docs: h.docs, maximized: h.maximized, markup: h.markup }), k = (s) => ({ docs: s.docs, maximized: s.maximized, markup: [...s.markup] });
224
225
  let w = b(n.source, n), u = n.source, v = w;
225
226
  const g = [], O = [];
226
227
  let C = null;
@@ -231,7 +232,7 @@ const Ln = () => {
231
232
  i = { ...i, ...s }, a.emit();
232
233
  }, c = () => {
233
234
  if (!i.ready) return;
234
- const s = Qn(i.layout);
235
+ const s = et(i.layout);
235
236
  s !== C && (C = s, o(s));
236
237
  }, f = (s, h, P) => {
237
238
  const I = b(s, k(h));
@@ -247,22 +248,22 @@ const Ln = () => {
247
248
  getSnapshot: () => i,
248
249
  subscribe: a.subscribe,
249
250
  toggle: (s) => {
250
- ye(s);
251
- const { state: h, outcome: P } = Yn(i.layout, s, L(), r);
251
+ Se(s);
252
+ const { state: h, outcome: P } = Wn(i.layout, s, L(), r);
252
253
  return T(h), P;
253
254
  },
254
- close: (s) => T(Ve(i.layout, s)),
255
+ close: (s) => T($e(i.layout, s)),
255
256
  navigate: (s, h) => {
256
- ye(h);
257
- const { state: P, outcome: I } = Wn(i.layout, s, h);
257
+ Se(h);
258
+ const { state: P, outcome: I } = Kn(i.layout, s, h);
258
259
  if (I !== "navigated") return I;
259
260
  const S = P.panelIds.get(h);
260
261
  return S !== void 0 && (d.delete(S), p.delete(S)), T(P), I;
261
262
  },
262
- setHidden: (s, h) => T($e(i.layout, s, h)),
263
- maximize: (s) => T(Jn(i.layout, s)),
264
- setMarkup: (s, h) => T(Kn(i.layout, s, h)),
265
- arrange: (s) => T(Xn(i.layout, s, { logical: l, visible: s.length })),
263
+ setHidden: (s, h) => T(Ue(i.layout, s, h)),
264
+ maximize: (s) => T(Xn(i.layout, s)),
265
+ setMarkup: (s, h) => T(Jn(i.layout, s, h)),
266
+ arrange: (s) => T(Zn(i.layout, s, { logical: l, visible: s.length })),
266
267
  changeSource: (s) => {
267
268
  f(s, i.layout, "push");
268
269
  },
@@ -279,19 +280,19 @@ const Ln = () => {
279
280
  if (P >= 0)
280
281
  return g.splice(0, P + 1), s.source !== i.source && N({ source: s.source }), M(), !1;
281
282
  g.length = 0, w = h, u = s.source;
282
- const I = E(le({ docs: s.docs, maximized: s.maximized, markup: s.markup, stored: { columnOf: i.layout.columnOf, hidden: i.layout.hidden }, panelIds: i.layout.panelIds }, r));
283
+ const I = E(se({ docs: s.docs, maximized: s.maximized, markup: s.markup, stored: { columnOf: i.layout.columnOf, hidden: i.layout.hidden }, panelIds: i.layout.panelIds }, r));
283
284
  return N({ layout: I, source: s.source, ...m(I) }), c(), M(), !0;
284
285
  },
285
286
  whenUrlRendered: (s) => {
286
287
  O.push(s), M();
287
288
  },
288
289
  loadStored: (s) => {
289
- N({ layout: E(le({ docs: i.layout.docs, maximized: i.layout.maximized, markup: [...i.layout.markup], stored: s, panelIds: i.layout.panelIds }, r)), ready: !0 }), c();
290
+ N({ layout: E(se({ docs: i.layout.docs, maximized: i.layout.maximized, markup: [...i.layout.markup], stored: s, panelIds: i.layout.panelIds }, r)), ready: !0 }), c();
290
291
  },
291
292
  setVisibleColumns: (s) => {
292
- if (!Number.isInteger(s) || s < 1 || s > l) throw new RangeError(`[markdown-explorer] visible columns must be an integer in 1..${String(l)}; got ${String(s)}`);
293
+ if (!Number.isInteger(s) || s < 1 || s > l) throw new RangeError(`[markdown-explorer] visible columns must be an integer in 1..${String(l)}; got ${J(s)}`);
293
294
  y = !0;
294
- const h = we(i.layout, { logical: l, visible: s });
295
+ const h = ye(i.layout, { logical: l, visible: s });
295
296
  s === i.visibleColumns && h === i.layout || (N({ visibleColumns: s, layout: h }), h !== i.layout && c());
296
297
  },
297
298
  setSplitDragging: (s) => {
@@ -300,7 +301,7 @@ const Ln = () => {
300
301
  setTitle: (s, h) => {
301
302
  !i.layout.docs.includes(s) || i.titles.get(s) === h || N({ titles: new Map(i.titles).set(s, h) });
302
303
  },
303
- titleOf: (s) => de(i.titles, s),
304
+ titleOf: (s) => me(i.titles, s),
304
305
  setPendingHash: (s, h) => {
305
306
  const P = i.pendingHashes.get(s);
306
307
  if (h === null || h === "") {
@@ -328,33 +329,33 @@ const Ln = () => {
328
329
  };
329
330
  }, _ = (e, n) => {
330
331
  const t = () => n(e.getSnapshot());
331
- return Xe(e.subscribe, t, t);
332
- }, nt = (e) => {
333
- const { config: n, storageNamespace: t } = J(), o = Pn(), r = q(o), l = Cn(t).multiLayout, [a] = $(
334
- () => et({
332
+ return Ze(e.subscribe, t, t);
333
+ }, tt = (e) => {
334
+ const { config: n, storageNamespace: t } = X(), o = bn(), r = q(o), l = Tn(t).multiLayout, [a] = $(
335
+ () => nt({
335
336
  config: n,
336
337
  location: e,
337
338
  writeUrl: (i, y) => {
338
- r.current(i, rn(y === "replace" ? "browse" : "switch-source"));
339
+ r.current(i, ln(y === "replace" ? "browse" : "switch-source"));
339
340
  },
340
- persist: (i) => Nn(l, i)
341
+ persist: (i) => An(l, i)
341
342
  })
342
343
  );
343
344
  F(() => {
344
345
  r.current = o;
345
346
  }, [o]);
346
- const d = bn(), p = D(() => ({ location: e, navigated: d }), [e, d]);
347
+ const d = Cn(), p = D(() => ({ location: e, navigated: d }), [e, d]);
347
348
  return F(() => {
348
349
  a.observeLocation(p.location);
349
350
  }, [a, p]), F(() => {
350
- a.loadStored(Zn(Tn(l), n.multiView.columns));
351
+ a.loadStored(Qn(Nn(l), n.multiView.columns));
351
352
  }, [a, l, n]), a;
352
- }, tt = (e) => {
353
- const n = e.closest(Re);
353
+ }, ot = (e) => {
354
+ const n = e.closest(De);
354
355
  if (n === null) throw new Error("[markdown-explorer] a panel's document region is not inside the panel's scroll area");
355
356
  return n;
356
- }, ot = ({ docPath: e, panelId: n, maximized: t, title: o, onContentShown: r }) => {
357
- const { store: l, followLink: a, revealInPanel: d, keepAtStartInPanel: p } = ue(), { announcer: i } = J(), y = _(l, (c) => Rn(c, n)), E = _(l, (c) => c.layout.markup.has(e)), b = R((c, f) => a(n, e, c, f), [a, n, e]), k = R(() => l.setPendingHash(n, null), [l, n]), w = D(() => ({ read: (c) => l.imageViewOf(n, c), save: (c, f) => l.saveImageView(n, c, f) }), [l, n]), u = R(
357
+ }, rt = ({ docPath: e, panelId: n, maximized: t, title: o, onContentShown: r }) => {
358
+ const { store: l, followLink: a, revealInPanel: d, keepAtStartInPanel: p } = de(), { announcer: i } = X(), y = _(l, (c) => Dn(c, n)), E = _(l, (c) => c.layout.markup.has(e)), b = R((c, f) => a(n, e, c, f), [a, n, e]), k = R(() => l.setPendingHash(n, null), [l, n]), w = D(() => ({ read: (c) => l.imageViewOf(n, c), save: (c, f) => l.saveImageView(n, c, f) }), [l, n]), u = R(
358
359
  (c, f) => {
359
360
  f.kind !== "failure" && l.setTitle(c, f.name), r(c);
360
361
  },
@@ -366,7 +367,7 @@ const Ln = () => {
366
367
  [l, i]
367
368
  ), g = D(
368
369
  () => ({
369
- scrollerOf: tt,
370
+ scrollerOf: ot,
370
371
  reveal: (c) => d(n, c),
371
372
  keepAtStart: (c, f) => p(n, c, f)
372
373
  }),
@@ -375,64 +376,64 @@ const Ln = () => {
375
376
  () => ({ kind: "panel", maximized: t, onDocumentLink: b, pendingHash: y, onHashConsumed: k, announceFailure: v, paneScroll: g }),
376
377
  [t, b, y, k, v, g]
377
378
  ), C = D(() => ({ kind: "panel", documentName: o, maximized: t }), [o, t]), M = R(() => l.setMarkup(e, !l.getSnapshot().layout.markup.has(e)), [l, e]), N = D(() => ({ shown: E, toggle: M }), [E, M]);
378
- return /* @__PURE__ */ ie(ln, { value: w, children: [
379
- /* @__PURE__ */ A(sn, { path: e, placement: C, markup: N, maximize: null }),
380
- /* @__PURE__ */ A(an, { path: e, absence: cn, markup: E, variant: O, onDocumentShown: u })
379
+ return /* @__PURE__ */ ae(sn, { value: w, children: [
380
+ /* @__PURE__ */ A(an, { path: e, placement: C, markup: N, maximize: null }),
381
+ /* @__PURE__ */ A(cn, { path: e, absence: un, markup: E, variant: O, onDocumentShown: u })
381
382
  ] });
382
- }, Se = () => typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function" && typeof HTMLElement.prototype.hidePopover == "function", me = "data-aqmx-column-probe", Q = "data-panel-id", ae = "--aqmx-multi-panel-chrome", rt = (e) => e === "normal" ? 0 : V(e), lt = (e, n) => {
383
- const t = e.querySelector(te)?.firstElementChild, o = e.querySelector(`[${me}]`), r = o instanceof HTMLElement ? o.getBoundingClientRect().width : Number.NaN;
383
+ }, xe = () => typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function" && typeof HTMLElement.prototype.hidePopover == "function", fe = "data-aqmx-column-probe", ee = "data-panel-id", ce = "--aqmx-multi-panel-chrome", lt = (e) => e === "normal" ? 0 : V(e), st = (e, n) => {
384
+ const t = e.querySelector(oe)?.firstElementChild, o = e.querySelector(`[${fe}]`), r = o instanceof HTMLElement ? o.getBoundingClientRect().width : Number.NaN;
384
385
  if (!(t instanceof HTMLElement))
385
386
  return { plan: { trackInlineSize: Number.NaN, gap: Number.NaN, minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: Number.NaN };
386
387
  const l = getComputedStyle(t), a = t.clientWidth - V(l.paddingLeft) - V(l.paddingRight), d = t.clientHeight - V(l.paddingTop) - V(l.paddingBottom);
387
- return { plan: { trackInlineSize: a, gap: rt(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: d };
388
- }, st = (e, n) => {
388
+ return { plan: { trackInlineSize: a, gap: lt(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: d };
389
+ }, it = (e, n) => {
389
390
  if (e.getClientRects().length === 0) return Number.NaN;
390
391
  const t = getComputedStyle(e);
391
392
  return n.getBoundingClientRect().top - e.getBoundingClientRect().top + V(t.paddingBottom) + V(t.borderBottomWidth);
392
- }, ee = "data-aqmx-panel-frame", xe = "--aqmx-multi-panel-pinned-block-size", it = (e) => {
393
+ }, ne = "data-aqmx-panel-frame", Ee = "--aqmx-multi-panel-pinned-block-size", at = (e) => {
393
394
  const { docPath: n, panelId: t } = e;
394
395
  if (typeof n != "string" || typeof t != "string") throw new TypeError("[markdown-explorer] a multi-view panel needs string docPath and panelId props");
395
396
  return { docPath: n, panelId: t };
396
- }, at = (e) => {
397
+ }, ct = (e) => {
397
398
  const n = getComputedStyle(e), t = Number.parseFloat(n.lineHeight);
398
399
  return Number.isFinite(t) ? t : Number.parseFloat(n.fontSize);
399
- }, ct = (e, n, t) => e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? e.deltaY * n.clientHeight : e.deltaMode !== WheelEvent.DOM_DELTA_LINE ? e.deltaY : e.deltaY * t(n), W = (e) => {
400
- const n = e.closest(Re);
400
+ }, ut = (e, n, t) => e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? e.deltaY * n.clientHeight : e.deltaMode !== WheelEvent.DOM_DELTA_LINE ? e.deltaY : e.deltaY * t(n), W = (e) => {
401
+ const n = e.closest(De);
401
402
  return n instanceof HTMLElement ? n : null;
402
- }, je = (e) => {
403
+ }, Ge = (e) => {
403
404
  const n = e.firstElementChild;
404
405
  return n instanceof HTMLElement && getComputedStyle(n).position === "sticky" ? n : null;
405
- }, Ge = (e, n) => {
406
- const t = n.getBoundingClientRect().top, o = je(e);
406
+ }, Ye = (e, n) => {
407
+ const t = n.getBoundingClientRect().top, o = Ge(e);
407
408
  return o === null ? t : Math.max(t, o.getBoundingClientRect().bottom);
408
- }, Ee = (e, n) => {
409
+ }, Oe = (e, n) => {
409
410
  let t = 0, o = e.length;
410
411
  for (; t < o; ) {
411
412
  const r = t + o >>> 1;
412
413
  (e[r]?.getBoundingClientRect().bottom ?? Number.NEGATIVE_INFINITY) > n ? o = r : t = r + 1;
413
414
  }
414
415
  return t < e.length ? t : -1;
415
- }, ut = (e, n) => {
416
- const t = Ge(e, n), o = [];
416
+ }, dt = (e, n) => {
417
+ const t = Ye(e, n), o = [];
417
418
  let r = e;
418
- for (let a = Ee([...r.children], t); a >= 0; a = Ee([...r.children], t)) {
419
+ for (let a = Oe([...r.children], t); a >= 0; a = Oe([...r.children], t)) {
419
420
  const d = r.children[a];
420
421
  if (d === void 0) break;
421
422
  o.push(a), r = d;
422
423
  }
423
424
  const l = r.getBoundingClientRect();
424
425
  return { scrollTop: n.scrollTop, anchor: o.length === 0 ? null : { path: o, offset: l.top - t, height: l.height } };
425
- }, Oe = (e, n, t) => {
426
+ }, Pe = (e, n, t) => {
426
427
  if (n.scrollTop = t.scrollTop, t.anchor === null) return;
427
428
  let o = e;
428
429
  for (const p of t.anchor.path) o = o?.children[p];
429
430
  if (o === void 0) return;
430
431
  const r = o.getBoundingClientRect(), { offset: l, height: a } = t.anchor, d = l < 0 && a > 0 ? l / a * r.height : l;
431
- n.scrollTop += r.top - Ge(e, n) - d;
432
- }, dt = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ye = (e) => {
433
- const n = e.getAttribute(he);
434
- return JSON.stringify(n === null ? [e.tagName, ...dt.map((t) => e.getAttribute(t))] : [e.tagName, he, n]);
435
- }, mt = (e, n) => {
432
+ n.scrollTop += r.top - Ye(e, n) - d;
433
+ }, mt = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), We = (e) => {
434
+ const n = e.getAttribute(ve);
435
+ return JSON.stringify(n === null ? [e.tagName, ...mt.map((t) => e.getAttribute(t))] : [e.tagName, ve, n]);
436
+ }, ft = (e, n) => {
436
437
  if (n === null || !e.contains(n)) return null;
437
438
  const t = [];
438
439
  for (let o = n; o !== e; ) {
@@ -440,26 +441,26 @@ const Ln = () => {
440
441
  if (r === null) return null;
441
442
  t.unshift([...r.children].indexOf(o)), o = r;
442
443
  }
443
- return { path: t, signature: Ye(n) };
444
- }, ft = (e, n, t) => {
444
+ return { path: t, signature: We(n) };
445
+ }, pt = (e, n, t) => {
445
446
  let o = e;
446
447
  for (const r of t.path) o = o?.children[r];
447
- o instanceof HTMLElement && Ye(o) === t.signature && dn(o) || n.focus({ preventScroll: !0 });
448
- }, pt = (e, n, t) => {
448
+ o instanceof HTMLElement && We(o) === t.signature && mn(o) || n.focus({ preventScroll: !0 });
449
+ }, gt = (e, n, t) => {
449
450
  if (e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
450
- const o = e.ctrlKey || e.metaKey, r = o ? W(n) : n.closest(te);
451
+ const o = e.ctrlKey || e.metaKey, r = o ? W(n) : n.closest(oe);
451
452
  if (!(r instanceof HTMLElement)) return;
452
- const l = ct(e, r, t);
453
- (o || gt(r, l)) && (e.preventDefault(), r.scrollTop += l);
454
- }, gt = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, ht = (e) => e.scrollHeight > e.clientHeight, vt = (e, n, t) => {
453
+ const l = ut(e, r, t);
454
+ (o || ht(r, l)) && (e.preventDefault(), r.scrollTop += l);
455
+ }, ht = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, vt = (e) => e.scrollHeight > e.clientHeight, wt = (e, n, t) => {
455
456
  let o = Number.NaN, r = Number.NaN;
456
- const l = je(t), a = () => {
457
- const i = st(e, n);
457
+ const l = Ge(t), a = () => {
458
+ const i = it(e, n);
458
459
  if (!Number.isFinite(i)) return;
459
460
  const y = l === null ? 0 : l.getBoundingClientRect().height;
460
- y !== r && (r = y, t.style.setProperty(xe, `${String(y)}px`));
461
+ y !== r && (r = y, t.style.setProperty(Ee, `${String(y)}px`));
461
462
  const E = i + y;
462
- E !== o && (o = E, e.style.setProperty(ae, `${String(E)}px`));
463
+ E !== o && (o = E, e.style.setProperty(ce, `${String(E)}px`));
463
464
  };
464
465
  a();
465
466
  let d = null;
@@ -469,22 +470,22 @@ const Ln = () => {
469
470
  }));
470
471
  });
471
472
  return p?.observe(e), p?.observe(n), l !== null && p?.observe(l), () => {
472
- p?.disconnect(), d !== null && cancelAnimationFrame(d), e.style.removeProperty(ae), t.style.removeProperty(xe);
473
+ p?.disconnect(), d !== null && cancelAnimationFrame(d), e.style.removeProperty(ce), t.style.removeProperty(Ee);
473
474
  };
474
- }, wt = (e) => {
475
- const { docPath: n, panelId: t } = it(e), { store: o, Body: r, maximize: l, focusCarry: a } = ue(), d = _(o, (u) => u.layout.maximized === n), p = _(o, (u) => de(u.titles, n)), i = q(null), y = q(null), E = q(null), b = q(null);
475
+ }, yt = (e) => {
476
+ const { docPath: n, panelId: t } = at(e), { store: o, Body: r, maximize: l, focusCarry: a } = de(), d = _(o, (u) => u.layout.maximized === n), p = _(o, (u) => me(u.titles, n)), i = q(null), y = q(null), E = q(null), b = q(null);
476
477
  U(() => {
477
478
  const u = i.current, v = u === null ? null : W(u);
478
479
  if (u === null || v === null || d) return;
479
480
  const g = /* @__PURE__ */ new Map(), O = (f) => {
480
481
  const m = g.get(f);
481
482
  if (m !== void 0) return m;
482
- const T = at(f);
483
+ const T = ct(f);
483
484
  return g.set(f, T), T;
484
- }, C = (f) => pt(f, u, O);
485
+ }, C = (f) => gt(f, u, O);
485
486
  let M = !1;
486
487
  const N = () => {
487
- const f = ht(v);
488
+ const f = vt(v);
488
489
  f !== M && (M = f, f ? u.addEventListener("wheel", C, { capture: !0, passive: !1 }) : u.removeEventListener("wheel", C, { capture: !0 }));
489
490
  };
490
491
  N();
@@ -493,14 +494,14 @@ const Ln = () => {
493
494
  c?.disconnect(), u.removeEventListener("wheel", C, { capture: !0 });
494
495
  };
495
496
  }, [d]), F(() => {
496
- const u = i.current, v = u === null ? null : W(u), g = u === null ? null : u.closest(`[${Q}]`);
497
+ const u = i.current, v = u === null ? null : W(u), g = u === null ? null : u.closest(`[${ee}]`);
497
498
  if (!(u === null || v === null || !(g instanceof HTMLElement)))
498
- return vt(g, v, u);
499
+ return wt(g, v, u);
499
500
  }, []), F(() => {
500
501
  const u = i.current, v = u === null ? null : W(u);
501
502
  if (u === null || v === null) return;
502
503
  const g = (f) => {
503
- Oe(u, v, f), b.current = v.scrollTop;
504
+ Pe(u, v, f), b.current = v.scrollTop;
504
505
  }, O = o.readingPositionOf(t, n);
505
506
  y.current = O === null ? null : { doc: n, position: O }, O !== null && g(O);
506
507
  let C = null, M = u.getBoundingClientRect().width;
@@ -510,7 +511,7 @@ const Ln = () => {
510
511
  const f = b.current;
511
512
  if (b.current = null, f !== null && v.scrollTop === f || u.getBoundingClientRect().width !== M) return;
512
513
  const m = E.current;
513
- m !== null && o.saveReadingPosition(t, m, ut(u, v));
514
+ m !== null && o.saveReadingPosition(t, m, dt(u, v));
514
515
  }));
515
516
  };
516
517
  v.addEventListener("scroll", N, { passive: !0 });
@@ -525,11 +526,11 @@ const Ln = () => {
525
526
  v.removeEventListener("scroll", N), c?.disconnect(), C !== null && cancelAnimationFrame(C);
526
527
  };
527
528
  }, [o, t, n]), F(() => {
528
- const u = i.current, v = u === null ? null : u.closest(`[${Q}]`);
529
+ const u = i.current, v = u === null ? null : u.closest(`[${ee}]`);
529
530
  if (u === null || v === null) return;
530
531
  const g = a.take(t);
531
- return g !== null && ft(v, u, g), () => {
532
- const O = mt(v, v.ownerDocument.activeElement);
532
+ return g !== null && pt(v, u, g), () => {
533
+ const O = ft(v, v.ownerDocument.activeElement);
533
534
  O !== null && a.hold(t, O);
534
535
  };
535
536
  }, [a, t]);
@@ -539,10 +540,10 @@ const Ln = () => {
539
540
  const O = E.current;
540
541
  E.current = u;
541
542
  const C = y.current;
542
- y.current = null, C !== null && C.doc === u ? (Oe(v, g, C.position), b.current = g.scrollTop) : O !== null && O !== u && (g.scrollTop = 0);
543
+ y.current = null, C !== null && C.doc === u ? (Pe(v, g, C.position), b.current = g.scrollTop) : O !== null && O !== u && (g.scrollTop = 0);
543
544
  }, []), w = R(
544
545
  (u) => {
545
- un(u.target) || l(n);
546
+ dn(u.target) || l(n);
546
547
  },
547
548
  [l, n]
548
549
  );
@@ -558,28 +559,28 @@ const Ln = () => {
558
559
  "data-aqmx-panel-frame": t,
559
560
  "data-aqmx-maximized": d ? "true" : "false",
560
561
  "data-testid": "markdown-explorer-panel-frame",
561
- ...d ? Me : {},
562
+ ...d ? ke : {},
562
563
  onDoubleClick: d ? void 0 : w,
563
564
  children: /* @__PURE__ */ A(r, { docPath: n, panelId: t, maximized: d, title: p, onContentShown: k })
564
565
  }
565
566
  )
566
567
  );
567
- }, yt = Ze(wt), Z = (e, n) => {
568
+ }, St = Qe(yt), Q = (e, n) => {
568
569
  const t = e.panelIds.get(n);
569
- if (t === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
570
+ if (t === void 0) throw new Error(`[markdown-explorer] the open document ${J(n)} has no panel id`);
570
571
  return t;
571
- }, Pe = (e) => Object.fromEntries(Sn(e).map((n) => [n, []])), St = (e, n) => {
572
- const t = Un(re(e, n), n.visible);
573
- return Object.fromEntries(t.map((o, r) => [_e(r), o.map((l) => Z(e, l))]));
574
- }, xt = (e, n) => {
575
- const t = X(e);
576
- return De(Object.keys(n)).map(
572
+ }, be = (e) => Object.fromEntries(xn(e).map((n) => [n, []])), xt = (e, n) => {
573
+ const t = jn(le(e, n), n.visible);
574
+ return Object.fromEntries(t.map((o, r) => [ze(r), o.map((l) => Q(e, l))]));
575
+ }, Et = (e, n) => {
576
+ const t = Z(e);
577
+ return _e(Object.keys(n)).map(
577
578
  (o) => (n[o] ?? []).flatMap((r) => {
578
579
  const l = t.get(r);
579
580
  return l === void 0 ? [] : [l];
580
581
  })
581
582
  );
582
- }, Et = (e) => ({
583
+ }, Ot = (e) => ({
583
584
  switchToCustomDragMode: e.panelSwitchToCustomDrag,
584
585
  switchToNormalDragMode: e.panelSwitchToNormalDrag,
585
586
  hidePanel: e.panelHide,
@@ -603,62 +604,62 @@ const Ln = () => {
603
604
  emptyColumn: e.multiColumnEmpty,
604
605
  dropZone: e.multiColumnRegion,
605
606
  dropHere: e.panelDropHere
606
- }), Ot = "--aqmx-multi-stage-bar-gutter", Pt = Object.freeze({ [Ot]: `${String(mn)}px` }), bt = Object.freeze({ blockSize: "100%", paddingInlineEnd: pn }), Ct = Object.freeze({ [xn]: "", style: Object.freeze({ display: "flex" }) }), Tt = (e) => /* @__PURE__ */ A("div", { ...Ct, children: /* @__PURE__ */ A(ke, { scroller: e, kind: "content" }) }), Nt = ({ props: e, children: n }) => /* @__PURE__ */ A(In, { scrollerProps: { ...e, style: bt }, renderScrollBar: Tt, barInlineSize: fn, children: n }), At = (e) => /* @__PURE__ */ A(ke, { scroller: e, kind: "stage" }), fe = "--aqmx-stage-block", Mt = "--aqmx-multi-panel-body-floor", kt = `calc(var(${fe}) * ${String(tn)})`, It = `max(calc(var(${fe}) * ${String(nn)}), calc(var(${ae}) + var(${Mt})))`, Lt = (e, n) => {
607
+ }), Pt = "--aqmx-multi-stage-bar-gutter", bt = Object.freeze({ [Pt]: `${String(fn)}px` }), Ct = Object.freeze({ blockSize: "100%", paddingInlineEnd: gn }), Tt = Object.freeze({ [En]: "", style: Object.freeze({ display: "flex" }) }), Nt = (e) => /* @__PURE__ */ A("div", { ...Tt, children: /* @__PURE__ */ A(Ie, { scroller: e, kind: "content" }) }), At = ({ props: e, children: n }) => /* @__PURE__ */ A(Ln, { scrollerProps: { ...e, style: Ct }, renderScrollBar: Nt, barInlineSize: pn, children: n }), Mt = (e) => /* @__PURE__ */ A(Ie, { scroller: e, kind: "stage" }), pe = "--aqmx-stage-block", kt = "--aqmx-multi-panel-body-floor", It = `calc(var(${pe}) * ${String(on)})`, Lt = `max(calc(var(${pe}) * ${String(tn)}), calc(var(${ce}) + var(${kt})))`, Rt = (e, n) => {
607
608
  const t = Object.entries(e);
608
609
  return t.length !== Object.keys(n).length ? !1 : t.every(([o, r]) => {
609
610
  const l = n[o];
610
611
  return l !== void 0 && l.length === r.length && l.every((a, d) => r[d] === a);
611
612
  });
612
613
  }, K = (e, n, t, o) => {
613
- Ie(e);
614
- const r = e.querySelector(`[${Q}="${n}"]`);
614
+ Le(e);
615
+ const r = e.querySelector(`[${ee}="${n}"]`);
615
616
  if (!(r instanceof HTMLElement)) return;
616
- const l = t !== null && r.contains(t) ? t : null, a = [{ element: r, boundary: r.closest(te) }];
617
- l !== null && a.push({ element: l, boundary: r }), gn(
617
+ const l = t !== null && r.contains(t) ? t : null, a = [{ element: r, boundary: r.closest(oe) }];
618
+ l !== null && a.push({ element: l, boundary: r }), hn(
618
619
  e,
619
- () => r.isConnected ? (r.scrollIntoView(Le), l?.isConnected !== !0 ? r : (o(l), l)) : null,
620
+ () => r.isConnected ? (r.scrollIntoView(Re), l?.isConnected !== !0 ? r : (o(l), l)) : null,
620
621
  a
621
622
  );
622
- }, ne = (e) => {
623
- e.scrollIntoView(Le);
624
- }, We = (e, n) => {
623
+ }, te = (e) => {
624
+ e.scrollIntoView(Re);
625
+ }, Ke = (e, n) => {
626
+ const t = e.querySelector(`[${ne}="${n}"]`);
627
+ return t instanceof HTMLElement ? (K(e, n, null, te), t.focus({ preventScroll: !0 }), !0) : !1;
628
+ }, ge = (e, n) => {
625
629
  const t = e.querySelector(`[${ee}="${n}"]`);
626
- return t instanceof HTMLElement ? (K(e, n, null, ne), t.focus({ preventScroll: !0 }), !0) : !1;
627
- }, pe = (e, n) => {
628
- const t = e.querySelector(`[${Q}="${n}"]`);
629
630
  return t instanceof HTMLElement && t.contains(e.ownerDocument.activeElement);
630
- }, be = (e, n) => {
631
- if (!pe(e, n)) return null;
632
- const t = [...e.querySelectorAll(`[${ee}]`)].map((a) => a.getAttribute(ee)), o = t.indexOf(n), r = t[o + 1];
631
+ }, Ce = (e, n) => {
632
+ if (!ge(e, n)) return null;
633
+ const t = [...e.querySelectorAll(`[${ne}]`)].map((a) => a.getAttribute(ne)), o = t.indexOf(n), r = t[o + 1];
633
634
  if (o >= 0 && typeof r == "string") return { kind: "panel", panelId: r };
634
635
  const l = t[o - 1];
635
636
  return o > 0 && typeof l == "string" ? { kind: "panel", panelId: l } : { kind: "stage" };
636
- }, Ce = (e, n) => {
637
+ }, Te = (e, n) => {
637
638
  requestAnimationFrame(() => {
638
639
  const t = e.current;
639
- t !== null && (n.kind === "panel" && We(t, n.panelId) || t.focus({ preventScroll: !0 }));
640
+ t !== null && (n.kind === "panel" && Ke(t, n.panelId) || t.focus({ preventScroll: !0 }));
640
641
  });
641
- }, Ke = (e, n) => {
642
+ }, Je = (e, n) => {
642
643
  requestAnimationFrame(() => {
643
644
  const t = e.current;
644
- t !== null && We(t, n);
645
+ t !== null && Ke(t, n);
645
646
  });
646
- }, Rt = (e, n, t) => {
647
+ }, Dt = (e, n, t) => {
647
648
  requestAnimationFrame(() => {
648
649
  const o = e.current;
649
650
  if (o === null) return;
650
651
  const { activeElement: r, body: l } = o.ownerDocument;
651
- if (K(o, n, t && pe(o, n) ? r : null, ne), !t || r !== null && r !== l && r.isConnected) return;
652
- const a = o.querySelector(`[${ee}="${n}"]`);
652
+ if (K(o, n, t && ge(o, n) ? r : null, te), !t || r !== null && r !== l && r.isConnected) return;
653
+ const a = o.querySelector(`[${ne}="${n}"]`);
653
654
  a instanceof HTMLElement && a.focus({ preventScroll: !0 });
654
655
  });
655
- }, Dt = ({ store: e, stageRef: n }) => {
656
- const { config: t, labels: o, announcer: r, edits: l } = J(), { maximize: a } = ue(), d = t.multiView.columns, p = _(e, (S) => S.layout), i = _(e, (S) => S.visibleColumns), y = _(e, (S) => S.titles), E = _(e, (S) => S.layout.maximized !== null || S.splitDragging), [b, k] = $(!1), [w] = $(() => Pe(i)), u = D(() => Et(o), [o]), v = R(
656
+ }, _t = ({ store: e, stageRef: n }) => {
657
+ const { config: t, labels: o, announcer: r, edits: l } = X(), { maximize: a } = de(), d = t.multiView.columns, p = _(e, (S) => S.layout), i = _(e, (S) => S.visibleColumns), y = _(e, (S) => S.titles), E = _(e, (S) => S.layout.maximized !== null || S.splitDragging), [b, k] = $(!1), [w] = $(() => be(i)), u = D(() => Ot(o), [o]), v = R(
657
658
  (S) => {
658
- e.arrange(xt(e.getSnapshot().layout, S));
659
+ e.arrange(Et(e.getSnapshot().layout, S));
659
660
  },
660
661
  [e]
661
- ), g = En({ initialColumnPanels: w, initialPanelVisibility: {}, debugConfig: ve, onColumnPanelsChange: v }), { columnPanels: O, setColumnPanels: C } = g, M = q(E), N = q(O);
662
+ ), g = On({ initialColumnPanels: w, initialPanelVisibility: {}, debugConfig: we, onColumnPanelsChange: v }), { columnPanels: O, setColumnPanels: C } = g, M = q(E), N = q(O);
662
663
  F(() => {
663
664
  M.current = E, N.current = O;
664
665
  }, [E, O]);
@@ -666,9 +667,9 @@ const Ln = () => {
666
667
  (S) => {
667
668
  const x = n.current;
668
669
  if (x === null) return;
669
- const { plan: B, stageBlockSize: z } = lt(x, d);
670
- if (Number.isFinite(z) && z > 0 && x.style.setProperty(fe, `${String(z)}px`), M.current && !S) return;
671
- const H = en(e.getSnapshot().visibleColumns, B);
670
+ const { plan: B, stageBlockSize: z } = st(x, d);
671
+ if (Number.isFinite(z) && z > 0 && x.style.setProperty(pe, `${String(z)}px`), M.current && !S) return;
672
+ const H = nn(e.getSnapshot().visibleColumns, B);
672
673
  H !== null && e.setVisibleColumns(H);
673
674
  },
674
675
  [e, n, d]
@@ -683,47 +684,47 @@ const Ln = () => {
683
684
  x === null && (x = requestAnimationFrame(() => {
684
685
  x = null, c(!1);
685
686
  }));
686
- }), z = S.querySelector(te)?.firstElementChild, H = S.querySelector(`[${me}]`);
687
+ }), z = S.querySelector(oe)?.firstElementChild, H = S.querySelector(`[${fe}]`);
687
688
  return z instanceof Element && B.observe(z), H instanceof Element && B.observe(H), () => {
688
689
  B.disconnect(), x !== null && cancelAnimationFrame(x);
689
690
  };
690
691
  }, [n, c]), U(() => {
691
692
  E || c(!1);
692
693
  }, [E, c]);
693
- const f = D(() => b ? St(p, { logical: d, visible: i }) : Pe(i), [b, p, d, i]);
694
+ const f = D(() => b ? xt(p, { logical: d, visible: i }) : be(i), [b, p, d, i]);
694
695
  F(() => {
695
- Lt(N.current, f) || C(f);
696
+ Rt(N.current, f) || C(f);
696
697
  }, [f, C]);
697
- const m = D(() => De(Object.keys(O)).map((S) => ({ id: S, key: S, className: "aqmx-multi-column" })), [O]), T = D(
698
+ const m = D(() => _e(Object.keys(O)).map((S) => ({ id: S, key: S, className: "aqmx-multi-column" })), [O]), T = D(
698
699
  () => p.docs.map((S) => {
699
- const x = Z(p, S);
700
- return { id: x, component: yt, title: de(y, S), props: { docPath: S, panelId: x }, minHeight: kt, maxHeight: It };
700
+ const x = Q(p, S);
701
+ return { id: x, component: St, title: me(y, S), props: { docPath: S, panelId: x }, minHeight: It, maxHeight: Lt };
701
702
  }),
702
703
  [p, y]
703
- ), L = D(() => Object.fromEntries(p.docs.map((S) => [Z(p, S), !p.hidden.has(S)])), [p]), s = p.maximized === null ? null : Z(p, p.maximized), h = R(
704
+ ), L = D(() => Object.fromEntries(p.docs.map((S) => [Q(p, S), !p.hidden.has(S)])), [p]), s = p.maximized === null ? null : Q(p, p.maximized), h = R(
704
705
  (S) => {
705
706
  const { layout: x } = e.getSnapshot();
706
- for (const [B, z] of X(x)) {
707
+ for (const [B, z] of Z(x)) {
707
708
  const H = S[B];
708
709
  if (H === void 0 || H !== x.hidden.has(z)) continue;
709
710
  const j = e.titleOf(z);
710
711
  if (H) {
711
712
  if (!e.setHidden(z, !1)) continue;
712
- r.announce(o.panelShown(j)), Ke(n, B);
713
+ r.announce(o.panelShown(j)), Je(n, B);
713
714
  continue;
714
715
  }
715
- const G = n.current, ge = G === null ? null : be(G, B);
716
- e.setHidden(z, !0) && (r.announce(o.panelHidden(j)), ge !== null && Ce(n, ge));
716
+ const G = n.current, he = G === null ? null : Ce(G, B);
717
+ e.setHidden(z, !0) && (r.announce(o.panelHidden(j)), he !== null && Te(n, he));
717
718
  }
718
719
  },
719
720
  [e, n, r, o]
720
721
  ), P = R(
721
722
  (S) => {
722
- const x = X(e.getSnapshot().layout).get(S);
723
+ const x = Z(e.getSnapshot().layout).get(S);
723
724
  if (x === void 0) return;
724
725
  const B = () => {
725
- const H = e.titleOf(x), j = n.current, G = j === null ? null : be(j, S);
726
- e.close(x) && (r.announce(o.panelClosed(H)), G !== null && Ce(n, G));
726
+ const H = e.titleOf(x), j = n.current, G = j === null ? null : Ce(j, S);
727
+ e.close(x) && (r.announce(o.panelClosed(H)), G !== null && Te(n, G));
727
728
  }, z = l.unsavedAmong([x]);
728
729
  z.length === 0 ? B() : l.askToDiscard(z).then((H) => {
729
730
  H && B();
@@ -736,13 +737,13 @@ const Ln = () => {
736
737
  a(null);
737
738
  return;
738
739
  }
739
- const x = X(e.getSnapshot().layout).get(S);
740
+ const x = Z(e.getSnapshot().layout).get(S);
740
741
  x !== void 0 && a(x);
741
742
  },
742
743
  [e, a]
743
744
  );
744
745
  return /* @__PURE__ */ A("div", { className: "aqmx-multi-layout", "aria-busy": !b, children: /* @__PURE__ */ A(
745
- On,
746
+ Pn,
746
747
  {
747
748
  columns: m,
748
749
  panels: T,
@@ -754,7 +755,7 @@ const Ln = () => {
754
755
  dragOverPosition: g.dragOverPosition,
755
756
  originalPanelPosition: g.originalPanelPosition,
756
757
  dragModes: g.dragModes,
757
- debugConfig: ve,
758
+ debugConfig: we,
758
759
  panelSizes: g.panelSizes,
759
760
  customDrag: g.customDrag,
760
761
  setPanelRef: g.setPanelRef,
@@ -774,11 +775,11 @@ const Ln = () => {
774
775
  dragHandle: "header",
775
776
  labels: u,
776
777
  panelClassName: "aqmx-multi-panel",
777
- renderPanelScrollArea: Nt,
778
- renderStageScrollBar: At
778
+ renderPanelScrollArea: At,
779
+ renderStageScrollBar: Mt
779
780
  }
780
781
  ) });
781
- }, se = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, _t = (e, n) => {
782
+ }, ie = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, zt = (e, n) => {
782
783
  const t = n.getBoundingClientRect(), o = [t.left + 1, t.left + t.width / 2, t.right - 1], r = [t.top + 1, t.top + t.height / 2, t.bottom - 1];
783
784
  return o.some(
784
785
  (l) => r.some((a) => {
@@ -786,16 +787,16 @@ const Ln = () => {
786
787
  return p !== -1 && i !== -1 && i < p;
787
788
  })
788
789
  );
789
- }, zt = (e, n) => {
790
+ }, Ht = (e, n) => {
790
791
  const t = n.getBoundingClientRect(), o = n.ownerDocument.documentElement.clientWidth, r = getComputedStyle(n).direction === "rtl";
791
- return e.style.setProperty(se.blockStart, `${String(t.top)}px`), e.style.setProperty(se.inlineEnd, `${String(r ? t.left : o - t.right)}px`), e.style.setProperty(se.room, `${String(t.width)}px`), e.showPopover(), () => {
792
+ return e.style.setProperty(ie.blockStart, `${String(t.top)}px`), e.style.setProperty(ie.inlineEnd, `${String(r ? t.left : o - t.right)}px`), e.style.setProperty(ie.room, `${String(t.width)}px`), e.showPopover(), () => {
792
793
  e.isConnected && e.hidePopover();
793
794
  };
794
- }, Ht = ({ store: e, body: n, limitNotice: t, onLimitNoticeCovered: o, ref: r }) => {
795
- const { config: l, labels: a, announcer: d, edits: p } = J(), i = q(null), y = q(null), E = _(e, (c) => c.ready), b = _(e, (c) => c.layout.docs.length > 0), k = _(e, (c) => c.visibleColumns), w = Ne(vn), u = R(
795
+ }, Bt = ({ store: e, body: n, limitNotice: t, onLimitNoticeCovered: o, ref: r }) => {
796
+ const { config: l, labels: a, announcer: d, edits: p } = X(), i = q(null), y = q(null), E = _(e, (c) => c.ready), b = _(e, (c) => c.layout.docs.length > 0), k = _(e, (c) => c.visibleColumns), w = Ae(wn), u = R(
796
797
  (c) => {
797
- const { layout: f } = e.getSnapshot(), m = f.maximized, T = c === null && m !== null ? f.panelIds.get(m) : void 0, L = i.current, s = T !== void 0 && L !== null && pe(L, T);
798
- e.maximize(c) && (c !== null ? d.announce(a.panelMaximized(e.titleOf(c))) : m !== null && d.announce(a.panelRestored(e.titleOf(m))), T !== void 0 && Rt(i, T, s));
798
+ const { layout: f } = e.getSnapshot(), m = f.maximized, T = c === null && m !== null ? f.panelIds.get(m) : void 0, L = i.current, s = T !== void 0 && L !== null && ge(L, T);
799
+ e.maximize(c) && (c !== null ? d.announce(a.panelMaximized(e.titleOf(c))) : m !== null && d.announce(a.panelRestored(e.titleOf(m))), T !== void 0 && Dt(i, T, s));
799
800
  },
800
801
  [e, d, a]
801
802
  ), v = R(
@@ -818,15 +819,15 @@ const Ln = () => {
818
819
  }
819
820
  if (s !== "existing") return;
820
821
  const { layout: h } = e.getSnapshot(), P = h.panelIds.get(m);
821
- P !== void 0 && (d.announce(a.panelAlreadyOpen(e.titleOf(m))), h.maximized === null ? e.setHidden(m, !1) : u(m), e.setPendingHash(P, T), Ke(i, P));
822
+ P !== void 0 && (d.announce(a.panelAlreadyOpen(e.titleOf(m))), h.maximized === null ? e.setHidden(m, !1) : u(m), e.setPendingHash(P, T), Je(i, P));
822
823
  },
823
824
  [e, d, a, u, p]
824
825
  );
825
826
  F(() => {
826
- if (t === null || w !== null || !Se()) return;
827
+ if (t === null || w !== null || !xe()) return;
827
828
  const c = y.current, f = i.current;
828
829
  if (c === null || f === null) throw new Error("[markdown-explorer] the panel-limit notice and the stage must be mounted together");
829
- return zt(c, f);
830
+ return Ht(c, f);
830
831
  }, [t, w]), U(() => {
831
832
  const c = y.current;
832
833
  if (t === null || c === null) return;
@@ -835,19 +836,19 @@ const Ln = () => {
835
836
  const T = (L) => {
836
837
  const s = L.target;
837
838
  s instanceof Element && (m !== null && cancelAnimationFrame(m), m = requestAnimationFrame(() => {
838
- m = null, f.activeElement === s && c.isConnected && _t(c, s) && o();
839
+ m = null, f.activeElement === s && c.isConnected && zt(c, s) && o();
839
840
  }));
840
841
  };
841
842
  return f.addEventListener("focusin", T, !0), () => {
842
843
  f.removeEventListener("focusin", T, !0), m !== null && cancelAnimationFrame(m);
843
844
  };
844
- }, [t, w, o]), Qe(
845
+ }, [t, w, o]), en(
845
846
  r,
846
847
  () => ({
847
848
  bringIntoView: (c) => {
848
849
  requestAnimationFrame(() => {
849
850
  const f = i.current, m = e.getSnapshot().layout.panelIds.get(c);
850
- f !== null && m !== void 0 && K(f, m, null, ne);
851
+ f !== null && m !== void 0 && K(f, m, null, te);
851
852
  });
852
853
  }
853
854
  }),
@@ -855,40 +856,40 @@ const Ln = () => {
855
856
  ), U(() => {
856
857
  const c = i.current;
857
858
  return () => {
858
- c !== null && Ie(c);
859
+ c !== null && Le(c);
859
860
  };
860
861
  }, []);
861
862
  const g = R((c, f) => {
862
863
  const m = i.current;
863
- m !== null && K(m, c, f, ne);
864
+ m !== null && K(m, c, f, te);
864
865
  }, []), O = R((c, f, m) => {
865
866
  const T = i.current;
866
- T !== null && K(T, c, m, (L) => hn(f, L));
867
- }, []), [C] = $(Ln), M = D(() => ({ store: e, Body: n, followLink: v, maximize: u, revealInPanel: g, keepAtStartInPanel: O, focusCarry: C }), [e, n, v, u, g, O, C]), N = D(() => Array.from({ length: l.multiView.columns }, (c, f) => _e(f)), [l]);
867
+ T !== null && K(T, c, m, (L) => vn(f, L));
868
+ }, []), [C] = $(Rn), M = D(() => ({ store: e, Body: n, followLink: v, maximize: u, revealInPanel: g, keepAtStartInPanel: O, focusCarry: C }), [e, n, v, u, g, O, C]), N = D(() => Array.from({ length: l.multiView.columns }, (c, f) => ze(f)), [l]);
868
869
  return (
869
- /* @__PURE__ */ ie("section", { ref: i, className: "aqmx-multi-stage", style: Pt, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": b && !E, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": k, ...Me, children: [
870
- /* @__PURE__ */ A("span", { className: "aqmx-multi-probe", "aria-hidden": "true", [me]: "" }),
871
- b ? E ? /* @__PURE__ */ A(ze, { value: M, children: /* @__PURE__ */ A(Dt, { store: e, stageRef: i }) }) : /* @__PURE__ */ A("div", { className: "aqmx-multi-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-stage-skeleton", children: N.map((c) => /* @__PURE__ */ ie("div", { className: "aqmx-skeleton aqmx-multi-skeleton-column", children: [
870
+ /* @__PURE__ */ ae("section", { ref: i, className: "aqmx-multi-stage", style: bt, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": b && !E, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": k, ...ke, children: [
871
+ /* @__PURE__ */ A("span", { className: "aqmx-multi-probe", "aria-hidden": "true", [fe]: "" }),
872
+ b ? E ? /* @__PURE__ */ A(He, { value: M, children: /* @__PURE__ */ A(_t, { store: e, stageRef: i }) }) : /* @__PURE__ */ A("div", { className: "aqmx-multi-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-stage-skeleton", children: N.map((c) => /* @__PURE__ */ ae("div", { className: "aqmx-skeleton aqmx-multi-skeleton-column", children: [
872
873
  /* @__PURE__ */ A("span", {}),
873
874
  /* @__PURE__ */ A("span", {}),
874
875
  /* @__PURE__ */ A("span", {})
875
876
  ] }, c)) }) : /* @__PURE__ */ A("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-multi-empty", children: /* @__PURE__ */ A("p", { className: "aqmx-empty-title", children: a.multiEmpty }) }),
876
- t === null ? null : w !== null ? kn(
877
+ t === null ? null : w !== null ? In(
877
878
  /* @__PURE__ */ A("div", { ref: y, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t }),
878
879
  w
879
880
  ) : (
880
- /* @__PURE__ */ A("div", { ref: y, popover: Se() ? "manual" : void 0, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t })
881
+ /* @__PURE__ */ A("div", { ref: y, popover: xe() ? "manual" : void 0, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t })
881
882
  )
882
883
  ] })
883
884
  );
884
- }, Bt = 3e3, qt = (e, n) => {
885
+ }, qt = 3e3, Ft = (e, n) => {
885
886
  if (n !== null) return n;
886
887
  const [t] = e;
887
888
  return t === void 0 ? null : t;
888
- }, Te = (e, n, t) => {
889
+ }, Ne = (e, n, t) => {
889
890
  const o = new Set(e), r = n.filter((a) => !o.has(a)), l = r.length > 0 ? r.at(-1) : t !== null && n.includes(t) ? t : n.at(-1);
890
891
  return l === void 0 ? null : l;
891
- }, Ft = (e, n, t) => {
892
+ }, Vt = (e, n, t) => {
892
893
  switch (n) {
893
894
  case "opened":
894
895
  return e.panelOpened(t);
@@ -898,12 +899,12 @@ const Ln = () => {
898
899
  return e.panelClosed(t);
899
900
  default: {
900
901
  const o = n;
901
- throw new RangeError(`[markdown-explorer] unknown toggle outcome ${JSON.stringify(o)}`);
902
+ throw new RangeError(`[markdown-explorer] unknown toggle outcome ${J(o)}`);
902
903
  }
903
904
  }
904
- }, Qt = ({ location: e }) => {
905
- const { config: n, labels: t, announcer: o } = J(), r = nt(e), l = _(r, (m) => m.layout.docs), a = _(r, (m) => m.layout.maximized), d = _(r, (m) => m.layout.markup), p = _(r, (m) => m.source), [i, y] = $(() => ({ docs: l, latest: Te([], l, null) }));
906
- i.docs !== l && y({ docs: l, latest: Te(i.docs, l, i.latest) });
905
+ }, no = ({ location: e }) => {
906
+ const { config: n, labels: t, announcer: o } = X(), r = tt(e), l = _(r, (m) => m.layout.docs), a = _(r, (m) => m.layout.maximized), d = _(r, (m) => m.layout.markup), p = _(r, (m) => m.source), [i, y] = $(() => ({ docs: l, latest: Ne([], l, null) }));
907
+ i.docs !== l && y({ docs: l, latest: Ne(i.docs, l, i.latest) });
907
908
  const E = a !== null ? a : i.latest, [b, k] = $(!1), w = q(null), [u, v] = $(0), g = q(null), O = q(null);
908
909
  F(() => {
909
910
  const m = g.current;
@@ -917,14 +918,14 @@ const Ln = () => {
917
918
  const C = R(() => {
918
919
  w.current !== null && clearTimeout(w.current), k(!0), w.current = setTimeout(() => {
919
920
  w.current = null, k(!1);
920
- }, Bt);
921
+ }, qt);
921
922
  }, []), M = R(() => {
922
923
  w.current !== null && clearTimeout(w.current), w.current = null, k(!1);
923
924
  }, []), N = R(
924
925
  (m) => {
925
926
  const T = r.titleOf(m), L = r.toggle(m);
926
927
  L === "rejected" && C();
927
- const s = L === "rejected" ? t.panelLimit(n.multiView.maxPanels) : Ft(t, L, T);
928
+ const s = L === "rejected" ? t.panelLimit(n.multiView.maxPanels) : Vt(t, L, T);
928
929
  if (L === "shown") {
929
930
  g.current = { doc: m, announcement: s }, v((h) => h + 1);
930
931
  return;
@@ -935,15 +936,15 @@ const Ln = () => {
935
936
  },
936
937
  [r, C, o, t, n]
937
938
  ), c = D(() => new Set(l), [l]), f = D(() => {
938
- const m = qt(l, a);
939
- return { href: Ae(n, { view: "tree", source: p, doc: m, markup: m !== null && d.has(m) }), target: "tree" };
939
+ const m = Ft(l, a);
940
+ return { href: Me(n, { view: "tree", source: p, doc: m, markup: m !== null && d.has(m) }), target: "tree" };
940
941
  }, [n, p, l, a, d]);
941
942
  return /* @__PURE__ */ A(
942
- wn,
943
+ yn,
943
944
  {
944
945
  view: "multi",
945
- explorer: /* @__PURE__ */ A(yn, { mode: "multi", sourceId: p, currentPath: E, openPaths: c, onOpenDocument: N, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: f }),
946
- content: /* @__PURE__ */ A(Ht, { ref: O, store: r, body: ot, limitNotice: b ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: M }),
946
+ explorer: /* @__PURE__ */ A(Sn, { mode: "multi", sourceId: p, currentPath: E, openPaths: c, onOpenDocument: N, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: f }),
947
+ content: /* @__PURE__ */ A(Bt, { ref: O, store: r, body: rt, limitNotice: b ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: M }),
947
948
  contentCoversPage: a !== null,
948
949
  sheetDismissals: u,
949
950
  onDraggingChange: r.setSplitDragging
@@ -951,8 +952,8 @@ const Ln = () => {
951
952
  );
952
953
  };
953
954
  export {
954
- Qt as MultiLayout,
955
- Bt as PANEL_LIMIT_NOTICE_MS,
956
- Te as latestOpenedDocument,
957
- qt as treeSwitchDocument
955
+ no as MultiLayout,
956
+ qt as PANEL_LIMIT_NOTICE_MS,
957
+ Ne as latestOpenedDocument,
958
+ Ft as treeSwitchDocument
958
959
  };