@aiquants/markdown-explorer 0.32.0 → 0.34.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 (57) hide show
  1. package/CHANGELOG.md +327 -0
  2. package/README.md +33 -19
  3. package/dist/{EditSurface-BPqqykro.cjs → EditSurface-CF82jZQg.cjs} +5 -5
  4. package/dist/{EditSurface-BmbDSrrw.js → EditSurface-CqHk2R3k.js} +73 -63
  5. package/dist/ExplorerSplit-D325YGEf.cjs +1 -0
  6. package/dist/ExplorerSplit-DGH9bckm.js +1500 -0
  7. package/dist/MultiLayout-CzR7yJ0m.cjs +1 -0
  8. package/dist/{MultiLayout-DKgZ1sBK.js → MultiLayout-kcZyVnvK.js} +176 -176
  9. package/dist/NativeScrollBar-UNed10Na.js +62 -0
  10. package/dist/NativeScrollBar-pUbA4Zq3.cjs +1 -0
  11. package/dist/TreeLayout-BnIU87HX.js +96 -0
  12. package/dist/TreeLayout-DtvIpuOe.cjs +1 -0
  13. package/dist/core/geometry.d.cts +1 -0
  14. package/dist/core/geometry.d.ts +1 -0
  15. package/dist/core/labels.d.cts +10 -0
  16. package/dist/core/labels.d.ts +10 -0
  17. package/dist/core/location.d.cts +2 -0
  18. package/dist/core/location.d.ts +2 -0
  19. package/dist/core/viewSettings.d.cts +2 -0
  20. package/dist/core/viewSettings.d.ts +2 -0
  21. package/dist/{dataRoute-DLhQfdoW.js → dataRoute-D6KiSHIc.js} +20 -20
  22. package/dist/index-BDCbvHDs.cjs +15 -0
  23. package/dist/{index-CcXMPCRS.js → index-DR31S_-4.js} +2029 -1929
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +17 -17
  26. package/dist/{location-perTmwct.js → location-C44b9H1S.js} +291 -278
  27. package/dist/location-hGLhCCg4.cjs +1 -0
  28. package/dist/{merge-DZI4pkWI.cjs → merge-BziXxZkE.cjs} +1 -1
  29. package/dist/{merge-3xGYZqbE.js → merge-C1MWvhCS.js} +1 -1
  30. package/dist/{sanitizePolicy-By0tKOpZ.js → sanitizePolicy-CwvyPpp5.js} +1 -1
  31. package/dist/sanitizeWorker.js +1 -1
  32. package/dist/server.cjs +1 -1
  33. package/dist/server.js +4 -4
  34. package/dist/styles/markdown-explorer.css +1 -1
  35. package/dist/tapScrollCircle-D_BpaLwY.js +14 -0
  36. package/dist/tapScrollCircle-DigcJCsu.cjs +1 -0
  37. package/dist/useSplitPersistence-DCeYbJMx.js +38 -0
  38. package/dist/useSplitPersistence-QGcvyMAa.cjs +1 -0
  39. package/docs/behavior/dom-hooks.md +12 -3
  40. package/docs/behavior/layout.md +73 -23
  41. package/docs/behavior/localization.md +4 -3
  42. package/docs/behavior/security.md +2 -1
  43. package/docs/behavior/url-contract.md +11 -5
  44. package/package.json +11 -11
  45. package/dist/ExplorerSplit-CQxr6b0v.cjs +0 -1
  46. package/dist/ExplorerSplit-DPuXOBqs.js +0 -1493
  47. package/dist/MultiLayout-TXbet9k3.cjs +0 -1
  48. package/dist/NativeScrollBar-C1CtjwBm.js +0 -64
  49. package/dist/NativeScrollBar-UpjxjLlB.cjs +0 -1
  50. package/dist/TreeLayout-BpazybVQ.js +0 -72
  51. package/dist/TreeLayout-C0O1OGi4.cjs +0 -1
  52. package/dist/index-DSkK8iLE.cjs +0 -15
  53. package/dist/location-BxiJRTyw.cjs +0 -1
  54. package/dist/tapScrollCircle-Cbf17x8g.cjs +0 -1
  55. package/dist/tapScrollCircle-DacgW2F_.js +0 -12
  56. package/dist/useSplitPersistence-Du01PHNg.js +0 -42
  57. package/dist/useSplitPersistence-pPmE4GTT.cjs +0 -1
@@ -1,15 +1,15 @@
1
- import { jsxs as ie, jsx as M } 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 L, memo as Ze, useEffect as U, useImperativeHandle as Qe } from "react";
3
- import { n as ce, e as Me, o as en, P as nn, q as tn } from "./location-perTmwct.js";
4
- import { M as on, u as J, O as rn, Q as ln, D as sn, i as an, f as cn, R as V, G as un, h as Ae, S as dn, N as mn, U as ke, V as fn, W as Ie, X as pn, Y as Re, Z as gn } from "./index-CcXMPCRS.js";
5
- import { S as hn, a as vn, b as wn } from "./ExplorerSplit-DPuXOBqs.js";
6
- import { SCROLL_AREA_SELECTOR as Le, SCROLL_ROOT_SELECTOR as te, PANEL_ACTION_ATTRIBUTE as he, generateColumnIds as yn, sortColumnIds as De, generateColumnId as _e, NO_PANEL_DRAG_ATTRIBUTE as Sn, useDragDropColumns as xn, DEFAULT_DEBUG_CONFIG as ve, DragDropLayout as En } from "@aiquants/drag-drop-panels";
7
- import { useNavigate as On, useLocation as Pn } from "react-router";
8
- import { s as bn, r as Cn, w as Tn } from "./storage-CmGHg7OA.js";
9
- import { H as Nn, i as Mn } from "./dataRoute-DLhQfdoW.js";
10
- import { createPortal as An } from "react-dom";
11
- import { HostedScrollArea as kn } from "@aiquants/markdown";
12
- const In = () => {
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 = () => {
13
13
  const e = /* @__PURE__ */ new Map();
14
14
  return {
15
15
  hold: (n, t) => {
@@ -29,17 +29,17 @@ const In = () => {
29
29
  }, Rn = (e, n) => {
30
30
  const t = e.pendingHashes.get(n);
31
31
  return t === void 0 ? null : t;
32
- }, Ln = 0xcbf29ce484222325n, Dn = 0x100000001b3n, _n = (1n << 64n) - 1n, zn = (1n << 53n) - 1n, Hn = new TextEncoder(), Bn = (e) => {
33
- let n = Ln;
34
- for (const t of Hn.encode(e))
35
- n = (n ^ BigInt(t)) * Dn & _n;
36
- return Number(n & zn);
37
- }, oe = 256, qn = (e) => `aqmx-p-${Bn(e).toString(36)}`, He = (e, n) => {
38
- const t = qn(e);
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);
39
39
  let o = t;
40
40
  for (let r = 2; n.has(o); r += 1) o = `${t}-${String(r)}`;
41
41
  return o;
42
- }, Fn = /* @__PURE__ */ new Map(), Vn = (e, n = Fn) => {
42
+ }, Vn = /* @__PURE__ */ new Map(), $n = (e, n = Vn) => {
43
43
  const t = new Set(e.flatMap((r) => n.get(r) ?? [])), o = /* @__PURE__ */ new Map();
44
44
  for (const r of e) {
45
45
  const l = n.get(r) ?? He(r, t);
@@ -66,7 +66,7 @@ const In = () => {
66
66
  }
67
67
  for (const r of o) t[qe(t, n)]?.push(r);
68
68
  return t;
69
- }, $n = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), Un = (e, n, t) => {
69
+ }, Un = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), jn = (e, n, t) => {
70
70
  const [o, r] = n, l = r - o, a = e.length, d = Array.from({ length: l }, (w, u) => {
71
71
  const v = [0];
72
72
  for (const g of e) v.push((v.at(-1) ?? 0) + (t(g) === o + u ? 1 : 0));
@@ -96,7 +96,7 @@ const In = () => {
96
96
  o.delete(r);
97
97
  }
98
98
  return { docs: t, columnOf: o };
99
- }, jn = (e, n, t, o) => {
99
+ }, Gn = (e, n, t, o) => {
100
100
  if (e.docs.includes(n)) return { state: e, outcome: "existing" };
101
101
  if (e.docs.length >= o) return { state: e, outcome: "rejected" };
102
102
  const r = re(e, t), l = Be(e, n, t.logical) ?? qe(r, t);
@@ -111,12 +111,12 @@ const In = () => {
111
111
  o.delete(n);
112
112
  const r = new Map(e.panelIds);
113
113
  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
- }, Gn = (e, n, t, o) => {
114
+ }, Yn = (e, n, t, o) => {
115
115
  if (e.hidden.has(n)) return { state: $e(e, n, !1), outcome: "shown" };
116
116
  if (e.docs.includes(n)) return { state: Ve(e, n), outcome: "closed" };
117
- const r = jn(e, n, t, o);
117
+ const r = Gn(e, n, t, o);
118
118
  return { state: r.state, outcome: r.outcome === "rejected" ? "rejected" : "opened" };
119
- }, Yn = (e, n, t) => {
119
+ }, Wn = (e, n, t) => {
120
120
  if (n === t || !e.docs.includes(n)) return { state: e, outcome: "ignored" };
121
121
  if (e.docs.includes(t)) return { state: e, outcome: "existing" };
122
122
  const o = new Map(e.columnOf), r = o.get(n);
@@ -135,16 +135,16 @@ const In = () => {
135
135
  if (!e.docs.includes(n) || e.hidden.has(n) === t) return e;
136
136
  const o = new Set(e.hidden);
137
137
  return t ? o.add(n) : o.delete(n), { ...e, hidden: o, maximized: t && e.maximized === n ? null : e.maximized };
138
- }, Wn = (e, n, t) => {
138
+ }, Kn = (e, n, t) => {
139
139
  if (!e.docs.includes(n) || e.markup.has(n) === t) return e;
140
140
  const o = new Set(e.markup);
141
141
  return t ? o.add(n) : o.delete(n), { ...e, markup: o };
142
- }, Kn = (e, n) => {
142
+ }, Jn = (e, n) => {
143
143
  if (e.maximized === n || n !== null && !e.docs.includes(n)) return e;
144
144
  if (n === null || !e.hidden.has(n)) return { ...e, maximized: n };
145
145
  const t = new Set(e.hidden);
146
146
  return t.delete(n), { ...e, maximized: n, hidden: t };
147
- }, Jn = (e, n, t) => {
147
+ }, Xn = (e, n, t) => {
148
148
  const o = re(e, t), r = /* @__PURE__ */ new Map();
149
149
  for (const [i, y] of o.entries())
150
150
  for (const E of y) r.set(E, i);
@@ -152,7 +152,7 @@ const In = () => {
152
152
  for (const [i, y] of d.entries()) {
153
153
  const E = (n[i] ?? []).filter((b) => l.has(b) && !a.has(b));
154
154
  for (const b of E) a.add(b);
155
- for (const [b, k] of Un(E, y, (w) => r.get(w)).entries())
155
+ for (const [b, k] of jn(E, y, (w) => r.get(w)).entries())
156
156
  p[y[0] + b]?.push(...k);
157
157
  }
158
158
  for (const i of e.docs)
@@ -166,7 +166,7 @@ const In = () => {
166
166
  columnOf: e.stored.columnOf,
167
167
  hidden: new Set([...e.stored.hidden].filter((l) => o.has(l) && l !== r)),
168
168
  markup: new Set(e.markup.filter((l) => o.has(l))),
169
- panelIds: Vn(t, e.panelIds)
169
+ panelIds: $n(t, e.panelIds)
170
170
  };
171
171
  }, we = (e, n) => {
172
172
  if (e.docs.every((o) => e.columnOf.has(o))) return e;
@@ -179,7 +179,7 @@ const In = () => {
179
179
  t.delete(o);
180
180
  }
181
181
  return { ...e, columnOf: t };
182
- }, Ue = 1, Y = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Xn = (e, n) => {
182
+ }, Ue = 1, Y = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Zn = (e, n) => {
183
183
  if (e === null || e === "") return Y;
184
184
  let t;
185
185
  try {
@@ -196,20 +196,20 @@ const In = () => {
196
196
  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
197
  const l = new Set(Array.isArray(o.hidden) ? o.hidden.filter((a) => typeof a == "string" && a !== "") : []);
198
198
  return { columnOf: r, hidden: l };
199
- }, Zn = (e) => JSON.stringify({
199
+ }, Qn = (e) => JSON.stringify({
200
200
  v: Ue,
201
201
  columnOf: [...e.columnOf.entries()].slice(-oe),
202
202
  hidden: e.docs.filter((n) => e.hidden.has(n))
203
203
  }), de = (e, n) => {
204
204
  const t = e.get(n);
205
- return t === void 0 ? Nn(n) : t;
205
+ return t === void 0 ? An(n) : t;
206
206
  }, X = (e) => {
207
207
  const n = /* @__PURE__ */ new Map();
208
208
  for (const [t, o] of e.panelIds) n.set(o, t);
209
209
  return n;
210
210
  }, ye = (e) => {
211
211
  if (!Mn(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${JSON.stringify(e.slice(0, 80))}`);
212
- }, Qn = ({ config: e, location: n, writeUrl: t, persist: o }) => {
212
+ }, et = ({ config: e, location: n, writeUrl: t, persist: o }) => {
213
213
  const { maxPanels: r, columns: l } = e.multiView, a = on(), d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
214
214
  let i = {
215
215
  layout: le({ docs: n.docs, maximized: n.maximized, markup: n.markup, stored: Y }, r),
@@ -220,18 +220,18 @@ const In = () => {
220
220
  titles: /* @__PURE__ */ new Map(),
221
221
  pendingHashes: /* @__PURE__ */ new Map()
222
222
  }, y = !1;
223
- const E = (s) => y ? we(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] });
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
224
  let w = b(n.source, n), u = n.source, v = w;
225
225
  const g = [], O = [];
226
226
  let C = null;
227
- const A = () => {
227
+ const M = () => {
228
228
  if (!(g.length > 0))
229
229
  for (const s of O.splice(0)) s();
230
230
  }, N = (s) => {
231
231
  i = { ...i, ...s }, a.emit();
232
232
  }, c = () => {
233
233
  if (!i.ready) return;
234
- const s = Zn(i.layout);
234
+ const s = Qn(i.layout);
235
235
  s !== C && (C = s, o(s));
236
236
  }, f = (s, h, P) => {
237
237
  const I = b(s, k(h));
@@ -242,27 +242,27 @@ const In = () => {
242
242
  for (const x of [...p.keys()]) h.has(x) || p.delete(x);
243
243
  const P = new Set(s.docs), I = [...i.titles.keys()].every((x) => P.has(x)) ? i.titles : new Map([...i.titles].filter(([x]) => P.has(x))), S = [...i.pendingHashes.keys()].every((x) => h.has(x)) ? i.pendingHashes : new Map([...i.pendingHashes].filter(([x]) => h.has(x)));
244
244
  return { titles: I, pendingHashes: S };
245
- }, T = (s) => s === i.layout ? !1 : (N({ layout: s, ...m(s) }), f(u, s, "replace"), c(), !0), R = () => ({ logical: l, visible: i.visibleColumns });
245
+ }, T = (s) => s === i.layout ? !1 : (N({ layout: s, ...m(s) }), f(u, s, "replace"), c(), !0), L = () => ({ logical: l, visible: i.visibleColumns });
246
246
  return {
247
247
  getSnapshot: () => i,
248
248
  subscribe: a.subscribe,
249
249
  toggle: (s) => {
250
250
  ye(s);
251
- const { state: h, outcome: P } = Gn(i.layout, s, R(), r);
251
+ const { state: h, outcome: P } = Yn(i.layout, s, L(), r);
252
252
  return T(h), P;
253
253
  },
254
254
  close: (s) => T(Ve(i.layout, s)),
255
255
  navigate: (s, h) => {
256
256
  ye(h);
257
- const { state: P, outcome: I } = Yn(i.layout, s, h);
257
+ const { state: P, outcome: I } = Wn(i.layout, s, h);
258
258
  if (I !== "navigated") return I;
259
259
  const S = P.panelIds.get(h);
260
260
  return S !== void 0 && (d.delete(S), p.delete(S)), T(P), I;
261
261
  },
262
262
  setHidden: (s, h) => T($e(i.layout, s, h)),
263
- maximize: (s) => T(Kn(i.layout, s)),
264
- setMarkup: (s, h) => T(Wn(i.layout, s, h)),
265
- arrange: (s) => T(Jn(i.layout, s, { logical: l, visible: s.length })),
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 })),
266
266
  changeSource: (s) => {
267
267
  f(s, i.layout, "push");
268
268
  },
@@ -272,18 +272,18 @@ const In = () => {
272
272
  observeLocation: (s) => {
273
273
  const h = b(s.source, s);
274
274
  if (h === w)
275
- return g.length = 0, v = h, s.source !== i.source && N({ source: s.source }), A(), !1;
275
+ return g.length = 0, v = h, s.source !== i.source && N({ source: s.source }), M(), !1;
276
276
  if (h === v) return !1;
277
277
  v = h;
278
278
  const P = g.indexOf(h);
279
279
  if (P >= 0)
280
- return g.splice(0, P + 1), s.source !== i.source && N({ source: s.source }), A(), !1;
280
+ return g.splice(0, P + 1), s.source !== i.source && N({ source: s.source }), M(), !1;
281
281
  g.length = 0, w = h, u = s.source;
282
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
- return N({ layout: I, source: s.source, ...m(I) }), c(), A(), !0;
283
+ return N({ layout: I, source: s.source, ...m(I) }), c(), M(), !0;
284
284
  },
285
285
  whenUrlRendered: (s) => {
286
- O.push(s), A();
286
+ O.push(s), M();
287
287
  },
288
288
  loadStored: (s) => {
289
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();
@@ -329,44 +329,44 @@ const In = () => {
329
329
  }, _ = (e, n) => {
330
330
  const t = () => n(e.getSnapshot());
331
331
  return Xe(e.subscribe, t, t);
332
- }, et = (e) => {
333
- const { config: n, storageNamespace: t } = J(), o = On(), r = q(o), l = bn(t).multiLayout, [a] = $(
334
- () => Qn({
332
+ }, nt = (e) => {
333
+ const { config: n, storageNamespace: t } = J(), o = Pn(), r = q(o), l = Cn(t).multiLayout, [a] = $(
334
+ () => et({
335
335
  config: n,
336
336
  location: e,
337
337
  writeUrl: (i, y) => {
338
338
  r.current(i, rn(y === "replace" ? "browse" : "switch-source"));
339
339
  },
340
- persist: (i) => Tn(l, i)
340
+ persist: (i) => Nn(l, i)
341
341
  })
342
342
  );
343
343
  F(() => {
344
344
  r.current = o;
345
345
  }, [o]);
346
- const d = Pn(), p = D(() => ({ location: e, navigated: d }), [e, d]);
346
+ const d = bn(), p = D(() => ({ location: e, navigated: d }), [e, d]);
347
347
  return F(() => {
348
348
  a.observeLocation(p.location);
349
349
  }, [a, p]), F(() => {
350
- a.loadStored(Xn(Cn(l), n.multiView.columns));
350
+ a.loadStored(Zn(Tn(l), n.multiView.columns));
351
351
  }, [a, l, n]), a;
352
- }, nt = (e) => {
353
- const n = e.closest(Le);
352
+ }, tt = (e) => {
353
+ const n = e.closest(Re);
354
354
  if (n === null) throw new Error("[markdown-explorer] a panel's document region is not inside the panel's scroll area");
355
355
  return n;
356
- }, tt = ({ 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 = L((c, f) => a(n, e, c, f), [a, n, e]), k = L(() => 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 = L(
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(
358
358
  (c, f) => {
359
359
  f.kind !== "failure" && l.setTitle(c, f.name), r(c);
360
360
  },
361
361
  [l, r]
362
- ), v = L(
362
+ ), v = R(
363
363
  (c) => {
364
364
  l.whenUrlRendered(() => i.announce(c));
365
365
  },
366
366
  [l, i]
367
367
  ), g = D(
368
368
  () => ({
369
- scrollerOf: nt,
369
+ scrollerOf: tt,
370
370
  reveal: (c) => d(n, c),
371
371
  keepAtStart: (c, f) => p(n, c, f)
372
372
  }),
@@ -374,30 +374,30 @@ const In = () => {
374
374
  ), O = D(
375
375
  () => ({ kind: "panel", maximized: t, onDocumentLink: b, pendingHash: y, onHashConsumed: k, announceFailure: v, paneScroll: g }),
376
376
  [t, b, y, k, v, g]
377
- ), C = D(() => ({ kind: "panel", documentName: o, maximized: t }), [o, t]), A = L(() => l.setMarkup(e, !l.getSnapshot().layout.markup.has(e)), [l, e]), N = D(() => ({ shown: E, toggle: A }), [E, A]);
377
+ ), 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
378
  return /* @__PURE__ */ ie(ln, { value: w, children: [
379
- /* @__PURE__ */ M(sn, { path: e, placement: C, markup: N }),
380
- /* @__PURE__ */ M(an, { path: e, absence: cn, markup: E, variant: O, onDocumentShown: u })
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 })
381
381
  ] });
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", ot = (e) => e === "normal" ? 0 : V(e), rt = (e, n) => {
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
383
  const t = e.querySelector(te)?.firstElementChild, o = e.querySelector(`[${me}]`), r = o instanceof HTMLElement ? o.getBoundingClientRect().width : Number.NaN;
384
384
  if (!(t instanceof HTMLElement))
385
385
  return { plan: { trackInlineSize: Number.NaN, gap: Number.NaN, minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: Number.NaN };
386
386
  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: ot(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: d };
388
- }, lt = (e, n) => {
387
+ return { plan: { trackInlineSize: a, gap: rt(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: d };
388
+ }, st = (e, n) => {
389
389
  if (e.getClientRects().length === 0) return Number.NaN;
390
390
  const t = getComputedStyle(e);
391
391
  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", st = (e) => {
392
+ }, ee = "data-aqmx-panel-frame", xe = "--aqmx-multi-panel-pinned-block-size", it = (e) => {
393
393
  const { docPath: n, panelId: t } = e;
394
394
  if (typeof n != "string" || typeof t != "string") throw new TypeError("[markdown-explorer] a multi-view panel needs string docPath and panelId props");
395
395
  return { docPath: n, panelId: t };
396
- }, it = (e) => {
396
+ }, at = (e) => {
397
397
  const n = getComputedStyle(e), t = Number.parseFloat(n.lineHeight);
398
398
  return Number.isFinite(t) ? t : Number.parseFloat(n.fontSize);
399
- }, at = (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(Le);
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);
401
401
  return n instanceof HTMLElement ? n : null;
402
402
  }, je = (e) => {
403
403
  const n = e.firstElementChild;
@@ -412,7 +412,7 @@ const In = () => {
412
412
  (e[r]?.getBoundingClientRect().bottom ?? Number.NEGATIVE_INFINITY) > n ? o = r : t = r + 1;
413
413
  }
414
414
  return t < e.length ? t : -1;
415
- }, ct = (e, n) => {
415
+ }, ut = (e, n) => {
416
416
  const t = Ge(e, n), o = [];
417
417
  let r = e;
418
418
  for (let a = Ee([...r.children], t); a >= 0; a = Ee([...r.children], t)) {
@@ -429,10 +429,10 @@ const In = () => {
429
429
  if (o === void 0) return;
430
430
  const r = o.getBoundingClientRect(), { offset: l, height: a } = t.anchor, d = l < 0 && a > 0 ? l / a * r.height : l;
431
431
  n.scrollTop += r.top - Ge(e, n) - d;
432
- }, ut = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ye = (e) => {
432
+ }, dt = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ye = (e) => {
433
433
  const n = e.getAttribute(he);
434
- return JSON.stringify(n === null ? [e.tagName, ...ut.map((t) => e.getAttribute(t))] : [e.tagName, he, n]);
435
- }, dt = (e, n) => {
434
+ return JSON.stringify(n === null ? [e.tagName, ...dt.map((t) => e.getAttribute(t))] : [e.tagName, he, n]);
435
+ }, mt = (e, n) => {
436
436
  if (n === null || !e.contains(n)) return null;
437
437
  const t = [];
438
438
  for (let o = n; o !== e; ) {
@@ -441,20 +441,20 @@ const In = () => {
441
441
  t.unshift([...r.children].indexOf(o)), o = r;
442
442
  }
443
443
  return { path: t, signature: Ye(n) };
444
- }, mt = (e, n, t) => {
444
+ }, ft = (e, n, t) => {
445
445
  let o = e;
446
446
  for (const r of t.path) o = o?.children[r];
447
447
  o instanceof HTMLElement && Ye(o) === t.signature && dn(o) || n.focus({ preventScroll: !0 });
448
- }, ft = (e, n, t) => {
448
+ }, pt = (e, n, t) => {
449
449
  if (e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
450
450
  const o = e.ctrlKey || e.metaKey, r = o ? W(n) : n.closest(te);
451
451
  if (!(r instanceof HTMLElement)) return;
452
- const l = at(e, r, t);
453
- (o || pt(r, l)) && (e.preventDefault(), r.scrollTop += l);
454
- }, pt = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, gt = (e) => e.scrollHeight > e.clientHeight, ht = (e, n, t) => {
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) => {
455
455
  let o = Number.NaN, r = Number.NaN;
456
456
  const l = je(t), a = () => {
457
- const i = lt(e, n);
457
+ const i = st(e, n);
458
458
  if (!Number.isFinite(i)) return;
459
459
  const y = l === null ? 0 : l.getBoundingClientRect().height;
460
460
  y !== r && (r = y, t.style.setProperty(xe, `${String(y)}px`));
@@ -471,21 +471,21 @@ const In = () => {
471
471
  return p?.observe(e), p?.observe(n), l !== null && p?.observe(l), () => {
472
472
  p?.disconnect(), d !== null && cancelAnimationFrame(d), e.style.removeProperty(ae), t.style.removeProperty(xe);
473
473
  };
474
- }, vt = (e) => {
475
- const { docPath: n, panelId: t } = st(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);
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);
476
476
  U(() => {
477
477
  const u = i.current, v = u === null ? null : W(u);
478
478
  if (u === null || v === null || d) return;
479
479
  const g = /* @__PURE__ */ new Map(), O = (f) => {
480
480
  const m = g.get(f);
481
481
  if (m !== void 0) return m;
482
- const T = it(f);
482
+ const T = at(f);
483
483
  return g.set(f, T), T;
484
- }, C = (f) => ft(f, u, O);
485
- let A = !1;
484
+ }, C = (f) => pt(f, u, O);
485
+ let M = !1;
486
486
  const N = () => {
487
- const f = gt(v);
488
- f !== A && (A = f, f ? u.addEventListener("wheel", C, { capture: !0, passive: !1 }) : u.removeEventListener("wheel", C, { capture: !0 }));
487
+ const f = ht(v);
488
+ f !== M && (M = f, f ? u.addEventListener("wheel", C, { capture: !0, passive: !1 }) : u.removeEventListener("wheel", C, { capture: !0 }));
489
489
  };
490
490
  N();
491
491
  const c = typeof ResizeObserver > "u" ? null : new ResizeObserver(N);
@@ -495,7 +495,7 @@ const In = () => {
495
495
  }, [d]), F(() => {
496
496
  const u = i.current, v = u === null ? null : W(u), g = u === null ? null : u.closest(`[${Q}]`);
497
497
  if (!(u === null || v === null || !(g instanceof HTMLElement)))
498
- return ht(g, v, u);
498
+ return vt(g, v, u);
499
499
  }, []), F(() => {
500
500
  const u = i.current, v = u === null ? null : W(u);
501
501
  if (u === null || v === null) return;
@@ -503,21 +503,21 @@ const In = () => {
503
503
  Oe(u, v, f), b.current = v.scrollTop;
504
504
  }, O = o.readingPositionOf(t, n);
505
505
  y.current = O === null ? null : { doc: n, position: O }, O !== null && g(O);
506
- let C = null, A = u.getBoundingClientRect().width;
506
+ let C = null, M = u.getBoundingClientRect().width;
507
507
  const N = () => {
508
508
  C === null && (C = requestAnimationFrame(() => {
509
509
  C = null;
510
510
  const f = b.current;
511
- if (b.current = null, f !== null && v.scrollTop === f || u.getBoundingClientRect().width !== A) return;
511
+ if (b.current = null, f !== null && v.scrollTop === f || u.getBoundingClientRect().width !== M) return;
512
512
  const m = E.current;
513
- m !== null && o.saveReadingPosition(t, m, ct(u, v));
513
+ m !== null && o.saveReadingPosition(t, m, ut(u, v));
514
514
  }));
515
515
  };
516
516
  v.addEventListener("scroll", N, { passive: !0 });
517
517
  const c = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
518
518
  const f = u.getBoundingClientRect().width;
519
- if (f === A) return;
520
- A = f;
519
+ if (f === M) return;
520
+ M = f;
521
521
  const m = o.readingPositionOf(t, n);
522
522
  m !== null && g(m);
523
523
  });
@@ -528,26 +528,26 @@ const In = () => {
528
528
  const u = i.current, v = u === null ? null : u.closest(`[${Q}]`);
529
529
  if (u === null || v === null) return;
530
530
  const g = a.take(t);
531
- return g !== null && mt(v, u, g), () => {
532
- const O = dt(v, v.ownerDocument.activeElement);
531
+ return g !== null && ft(v, u, g), () => {
532
+ const O = mt(v, v.ownerDocument.activeElement);
533
533
  O !== null && a.hold(t, O);
534
534
  };
535
535
  }, [a, t]);
536
- const k = L((u) => {
536
+ const k = R((u) => {
537
537
  const v = i.current, g = v === null ? null : W(v);
538
538
  if (v === null || g === null) return;
539
539
  const O = E.current;
540
540
  E.current = u;
541
541
  const C = y.current;
542
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
- }, []), w = L(
543
+ }, []), w = R(
544
544
  (u) => {
545
545
  un(u.target) || l(n);
546
546
  },
547
547
  [l, n]
548
548
  );
549
549
  return (
550
- /* @__PURE__ */ M(
550
+ /* @__PURE__ */ A(
551
551
  "div",
552
552
  {
553
553
  ref: i,
@@ -558,20 +558,20 @@ const In = () => {
558
558
  "data-aqmx-panel-frame": t,
559
559
  "data-aqmx-maximized": d ? "true" : "false",
560
560
  "data-testid": "markdown-explorer-panel-frame",
561
- ...d ? Ae : {},
561
+ ...d ? Me : {},
562
562
  onDoubleClick: d ? void 0 : w,
563
- children: /* @__PURE__ */ M(r, { docPath: n, panelId: t, maximized: d, title: p, onContentShown: k })
563
+ children: /* @__PURE__ */ A(r, { docPath: n, panelId: t, maximized: d, title: p, onContentShown: k })
564
564
  }
565
565
  )
566
566
  );
567
- }, wt = Ze(vt), Z = (e, n) => {
567
+ }, yt = Ze(wt), Z = (e, n) => {
568
568
  const t = e.panelIds.get(n);
569
569
  if (t === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
570
570
  return t;
571
- }, Pe = (e) => Object.fromEntries(yn(e).map((n) => [n, []])), yt = (e, n) => {
572
- const t = $n(re(e, n), n.visible);
571
+ }, Pe = (e) => Object.fromEntries(Sn(e).map((n) => [n, []])), St = (e, n) => {
572
+ const t = Un(re(e, n), n.visible);
573
573
  return Object.fromEntries(t.map((o, r) => [_e(r), o.map((l) => Z(e, l))]));
574
- }, St = (e, n) => {
574
+ }, xt = (e, n) => {
575
575
  const t = X(e);
576
576
  return De(Object.keys(n)).map(
577
577
  (o) => (n[o] ?? []).flatMap((r) => {
@@ -579,7 +579,7 @@ const In = () => {
579
579
  return l === void 0 ? [] : [l];
580
580
  })
581
581
  );
582
- }, xt = (e) => ({
582
+ }, Et = (e) => ({
583
583
  switchToCustomDragMode: e.panelSwitchToCustomDrag,
584
584
  switchToNormalDragMode: e.panelSwitchToNormalDrag,
585
585
  hidePanel: e.panelHide,
@@ -603,7 +603,7 @@ const In = () => {
603
603
  emptyColumn: e.multiColumnEmpty,
604
604
  dropZone: e.multiColumnRegion,
605
605
  dropHere: e.panelDropHere
606
- }), Et = "--aqmx-multi-stage-bar-gutter", Ot = Object.freeze({ [Et]: `${String(mn)}px` }), Pt = Object.freeze({ blockSize: "100%", paddingInlineEnd: `${String(fn)}px` }), bt = Object.freeze({ [Sn]: "", style: Object.freeze({ display: "flex" }) }), Ct = (e) => /* @__PURE__ */ M("div", { ...bt, children: /* @__PURE__ */ M(ke, { scroller: e, withCircle: !0 }) }), Tt = ({ props: e, children: n }) => /* @__PURE__ */ M(kn, { scrollerProps: { ...e, style: Pt }, renderScrollBar: Ct, children: n }), Nt = (e) => /* @__PURE__ */ M(ke, { scroller: e, withCircle: !1 }), fe = "--aqmx-stage-block", Mt = "--aqmx-multi-panel-body-floor", At = `calc(var(${fe}) * ${String(tn)})`, kt = `max(calc(var(${fe}) * ${String(nn)}), calc(var(${ae}) + var(${Mt})))`, It = (e, n) => {
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
607
  const t = Object.entries(e);
608
608
  return t.length !== Object.keys(n).length ? !1 : t.every(([o, r]) => {
609
609
  const l = n[o];
@@ -614,13 +614,13 @@ const In = () => {
614
614
  const r = e.querySelector(`[${Q}="${n}"]`);
615
615
  if (!(r instanceof HTMLElement)) return;
616
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 }), pn(
617
+ l !== null && a.push({ element: l, boundary: r }), gn(
618
618
  e,
619
- () => r.isConnected ? (r.scrollIntoView(Re), l?.isConnected !== !0 ? r : (o(l), l)) : null,
619
+ () => r.isConnected ? (r.scrollIntoView(Le), l?.isConnected !== !0 ? r : (o(l), l)) : null,
620
620
  a
621
621
  );
622
622
  }, ne = (e) => {
623
- e.scrollIntoView(Re);
623
+ e.scrollIntoView(Le);
624
624
  }, We = (e, n) => {
625
625
  const t = e.querySelector(`[${ee}="${n}"]`);
626
626
  return t instanceof HTMLElement ? (K(e, n, null, ne), t.focus({ preventScroll: !0 }), !0) : !1;
@@ -652,22 +652,22 @@ const In = () => {
652
652
  const a = o.querySelector(`[${ee}="${n}"]`);
653
653
  a instanceof HTMLElement && a.focus({ preventScroll: !0 });
654
654
  });
655
- }, Lt = ({ 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(() => xt(o), [o]), v = L(
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(
657
657
  (S) => {
658
- e.arrange(St(e.getSnapshot().layout, S));
658
+ e.arrange(xt(e.getSnapshot().layout, S));
659
659
  },
660
660
  [e]
661
- ), g = xn({ initialColumnPanels: w, initialPanelVisibility: {}, debugConfig: ve, onColumnPanelsChange: v }), { columnPanels: O, setColumnPanels: C } = g, A = q(E), N = q(O);
661
+ ), g = En({ initialColumnPanels: w, initialPanelVisibility: {}, debugConfig: ve, onColumnPanelsChange: v }), { columnPanels: O, setColumnPanels: C } = g, M = q(E), N = q(O);
662
662
  F(() => {
663
- A.current = E, N.current = O;
663
+ M.current = E, N.current = O;
664
664
  }, [E, O]);
665
- const c = L(
665
+ const c = R(
666
666
  (S) => {
667
667
  const x = n.current;
668
668
  if (x === null) return;
669
- const { plan: B, stageBlockSize: z } = rt(x, d);
670
- if (Number.isFinite(z) && z > 0 && x.style.setProperty(fe, `${String(z)}px`), A.current && !S) 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
671
  const H = en(e.getSnapshot().visibleColumns, B);
672
672
  H !== null && e.setVisibleColumns(H);
673
673
  },
@@ -690,17 +690,17 @@ const In = () => {
690
690
  }, [n, c]), U(() => {
691
691
  E || c(!1);
692
692
  }, [E, c]);
693
- const f = D(() => b ? yt(p, { logical: d, visible: i }) : Pe(i), [b, p, d, i]);
693
+ const f = D(() => b ? St(p, { logical: d, visible: i }) : Pe(i), [b, p, d, i]);
694
694
  F(() => {
695
- It(N.current, f) || C(f);
695
+ Lt(N.current, f) || C(f);
696
696
  }, [f, C]);
697
697
  const m = D(() => De(Object.keys(O)).map((S) => ({ id: S, key: S, className: "aqmx-multi-column" })), [O]), T = D(
698
698
  () => p.docs.map((S) => {
699
699
  const x = Z(p, S);
700
- return { id: x, component: wt, title: de(y, S), props: { docPath: S, panelId: x }, minHeight: At, maxHeight: kt };
700
+ return { id: x, component: yt, title: de(y, S), props: { docPath: S, panelId: x }, minHeight: kt, maxHeight: It };
701
701
  }),
702
702
  [p, y]
703
- ), R = 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 = L(
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
704
  (S) => {
705
705
  const { layout: x } = e.getSnapshot();
706
706
  for (const [B, z] of X(x)) {
@@ -717,7 +717,7 @@ const In = () => {
717
717
  }
718
718
  },
719
719
  [e, n, r, o]
720
- ), P = L(
720
+ ), P = R(
721
721
  (S) => {
722
722
  const x = X(e.getSnapshot().layout).get(S);
723
723
  if (x === void 0) return;
@@ -730,7 +730,7 @@ const In = () => {
730
730
  });
731
731
  },
732
732
  [e, n, r, o, l]
733
- ), I = L(
733
+ ), I = R(
734
734
  (S) => {
735
735
  if (S === null) {
736
736
  a(null);
@@ -741,14 +741,14 @@ const In = () => {
741
741
  },
742
742
  [e, a]
743
743
  );
744
- return /* @__PURE__ */ M("div", { className: "aqmx-multi-layout", "aria-busy": !b, children: /* @__PURE__ */ M(
745
- En,
744
+ return /* @__PURE__ */ A("div", { className: "aqmx-multi-layout", "aria-busy": !b, children: /* @__PURE__ */ A(
745
+ On,
746
746
  {
747
747
  columns: m,
748
748
  panels: T,
749
749
  columnPanels: O,
750
750
  onColumnPanelsChange: v,
751
- panelVisibility: R,
751
+ panelVisibility: L,
752
752
  onPanelVisibilityChange: h,
753
753
  dragState: g.dragState,
754
754
  dragOverPosition: g.dragOverPosition,
@@ -774,11 +774,11 @@ const In = () => {
774
774
  dragHandle: "header",
775
775
  labels: u,
776
776
  panelClassName: "aqmx-multi-panel",
777
- renderPanelScrollArea: Tt,
778
- renderStageScrollBar: Nt
777
+ renderPanelScrollArea: Nt,
778
+ renderStageScrollBar: At
779
779
  }
780
780
  ) });
781
- }, se = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, Dt = (e, n) => {
781
+ }, se = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, _t = (e, n) => {
782
782
  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
783
  return o.some(
784
784
  (l) => r.some((a) => {
@@ -786,27 +786,27 @@ const In = () => {
786
786
  return p !== -1 && i !== -1 && i < p;
787
787
  })
788
788
  );
789
- }, _t = (e, n) => {
789
+ }, zt = (e, n) => {
790
790
  const t = n.getBoundingClientRect(), o = n.ownerDocument.documentElement.clientWidth, r = getComputedStyle(n).direction === "rtl";
791
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
792
  e.isConnected && e.hidePopover();
793
793
  };
794
- }, zt = ({ 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(hn), u = L(
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(
796
796
  (c) => {
797
- const { layout: f } = e.getSnapshot(), m = f.maximized, T = c === null && m !== null ? f.panelIds.get(m) : void 0, R = i.current, s = T !== void 0 && R !== null && pe(R, T);
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
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));
799
799
  },
800
800
  [e, d, a]
801
- ), v = L(
801
+ ), v = R(
802
802
  (c, f, m, T) => {
803
803
  if (m === f) {
804
804
  e.setPendingHash(c, T);
805
805
  return;
806
806
  }
807
- const R = p.unsavedAmong([f]);
808
- if (R.length > 0) {
809
- p.askToDiscard(R).then((I) => {
807
+ const L = p.unsavedAmong([f]);
808
+ if (L.length > 0) {
809
+ p.askToDiscard(L).then((I) => {
810
810
  I && v(c, f, m, T);
811
811
  });
812
812
  return;
@@ -826,16 +826,16 @@ const In = () => {
826
826
  if (t === null || w !== null || !Se()) return;
827
827
  const c = y.current, f = i.current;
828
828
  if (c === null || f === null) throw new Error("[markdown-explorer] the panel-limit notice and the stage must be mounted together");
829
- return _t(c, f);
829
+ return zt(c, f);
830
830
  }, [t, w]), U(() => {
831
831
  const c = y.current;
832
832
  if (t === null || c === null) return;
833
833
  const { ownerDocument: f } = c;
834
834
  let m = null;
835
- const T = (R) => {
836
- const s = R.target;
835
+ const T = (L) => {
836
+ const s = L.target;
837
837
  s instanceof Element && (m !== null && cancelAnimationFrame(m), m = requestAnimationFrame(() => {
838
- m = null, f.activeElement === s && c.isConnected && Dt(c, s) && o();
838
+ m = null, f.activeElement === s && c.isConnected && _t(c, s) && o();
839
839
  }));
840
840
  };
841
841
  return f.addEventListener("focusin", T, !0), () => {
@@ -858,37 +858,37 @@ const In = () => {
858
858
  c !== null && Ie(c);
859
859
  };
860
860
  }, []);
861
- const g = L((c, f) => {
861
+ const g = R((c, f) => {
862
862
  const m = i.current;
863
863
  m !== null && K(m, c, f, ne);
864
- }, []), O = L((c, f, m) => {
864
+ }, []), O = R((c, f, m) => {
865
865
  const T = i.current;
866
- T !== null && K(T, c, m, (R) => gn(f, R));
867
- }, []), [C] = $(In), A = 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]);
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]);
868
868
  return (
869
- /* @__PURE__ */ ie("section", { ref: i, className: "aqmx-multi-stage", style: Ot, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": b && !E, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": k, ...Ae, children: [
870
- /* @__PURE__ */ M("span", { className: "aqmx-multi-probe", "aria-hidden": "true", [me]: "" }),
871
- b ? E ? /* @__PURE__ */ M(ze, { value: A, children: /* @__PURE__ */ M(Lt, { store: e, stageRef: i }) }) : /* @__PURE__ */ M("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: [
872
- /* @__PURE__ */ M("span", {}),
873
- /* @__PURE__ */ M("span", {}),
874
- /* @__PURE__ */ M("span", {})
875
- ] }, c)) }) : /* @__PURE__ */ M("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-multi-empty", children: /* @__PURE__ */ M("p", { className: "aqmx-empty-title", children: a.multiEmpty }) }),
876
- t === null ? null : w !== null ? An(
877
- /* @__PURE__ */ M("div", { ref: y, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t }),
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: [
872
+ /* @__PURE__ */ A("span", {}),
873
+ /* @__PURE__ */ A("span", {}),
874
+ /* @__PURE__ */ A("span", {})
875
+ ] }, 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
+ /* @__PURE__ */ A("div", { ref: y, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t }),
878
878
  w
879
879
  ) : (
880
- /* @__PURE__ */ M("div", { ref: y, popover: Se() ? "manual" : void 0, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t })
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
881
  )
882
882
  ] })
883
883
  );
884
- }, Ht = 3e3, Bt = (e, n) => {
884
+ }, Bt = 3e3, qt = (e, n) => {
885
885
  if (n !== null) return n;
886
886
  const [t] = e;
887
887
  return t === void 0 ? null : t;
888
888
  }, Te = (e, n, t) => {
889
889
  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
890
  return l === void 0 ? null : l;
891
- }, qt = (e, n, t) => {
891
+ }, Ft = (e, n, t) => {
892
892
  switch (n) {
893
893
  case "opened":
894
894
  return e.panelOpened(t);
@@ -901,8 +901,8 @@ const In = () => {
901
901
  throw new RangeError(`[markdown-explorer] unknown toggle outcome ${JSON.stringify(o)}`);
902
902
  }
903
903
  }
904
- }, Zt = ({ location: e }) => {
905
- const { config: n, labels: t, announcer: o } = J(), r = et(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) }));
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
906
  i.docs !== l && y({ docs: l, latest: Te(i.docs, l, i.latest) });
907
907
  const E = a !== null ? a : i.latest, [b, k] = $(!1), w = q(null), [u, v] = $(0), g = q(null), O = q(null);
908
908
  F(() => {
@@ -914,36 +914,36 @@ const In = () => {
914
914
  },
915
915
  []
916
916
  );
917
- const C = L(() => {
917
+ const C = R(() => {
918
918
  w.current !== null && clearTimeout(w.current), k(!0), w.current = setTimeout(() => {
919
919
  w.current = null, k(!1);
920
- }, Ht);
921
- }, []), A = L(() => {
920
+ }, Bt);
921
+ }, []), M = R(() => {
922
922
  w.current !== null && clearTimeout(w.current), w.current = null, k(!1);
923
- }, []), N = L(
923
+ }, []), N = R(
924
924
  (m) => {
925
- const T = r.titleOf(m), R = r.toggle(m);
926
- R === "rejected" && C();
927
- const s = R === "rejected" ? t.panelLimit(n.multiView.maxPanels) : qt(t, R, T);
928
- if (R === "shown") {
925
+ const T = r.titleOf(m), L = r.toggle(m);
926
+ L === "rejected" && C();
927
+ const s = L === "rejected" ? t.panelLimit(n.multiView.maxPanels) : Ft(t, L, T);
928
+ if (L === "shown") {
929
929
  g.current = { doc: m, announcement: s }, v((h) => h + 1);
930
930
  return;
931
931
  }
932
932
  r.whenUrlRendered(() => {
933
- o.announce(s), R === "opened" && O.current?.bringIntoView(m);
933
+ o.announce(s), L === "opened" && O.current?.bringIntoView(m);
934
934
  });
935
935
  },
936
936
  [r, C, o, t, n]
937
937
  ), c = D(() => new Set(l), [l]), f = D(() => {
938
- const m = Bt(l, a);
939
- return { href: Me(n, { view: "tree", source: p, doc: m, markup: m !== null && d.has(m) }), target: "tree" };
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" };
940
940
  }, [n, p, l, a, d]);
941
- return /* @__PURE__ */ M(
942
- vn,
941
+ return /* @__PURE__ */ A(
942
+ wn,
943
943
  {
944
944
  view: "multi",
945
- explorer: /* @__PURE__ */ M(wn, { mode: "multi", sourceId: p, currentPath: E, openPaths: c, onOpenDocument: N, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: f }),
946
- content: /* @__PURE__ */ M(zt, { ref: O, store: r, body: tt, limitNotice: b ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: A }),
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 }),
947
947
  contentCoversPage: a !== null,
948
948
  sheetDismissals: u,
949
949
  onDraggingChange: r.setSplitDragging
@@ -951,8 +951,8 @@ const In = () => {
951
951
  );
952
952
  };
953
953
  export {
954
- Zt as MultiLayout,
955
- Ht as PANEL_LIMIT_NOTICE_MS,
954
+ Qt as MultiLayout,
955
+ Bt as PANEL_LIMIT_NOTICE_MS,
956
956
  Te as latestOpenedDocument,
957
- Bt as treeSwitchDocument
957
+ qt as treeSwitchDocument
958
958
  };