@aiquants/markdown-explorer 0.17.0 → 0.19.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 (34) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +7 -5
  3. package/dist/{EditSurface-D-nhilRk.cjs → EditSurface-4VX20isB.cjs} +1 -1
  4. package/dist/{EditSurface-0owpPyLE.js → EditSurface-Ckg-3iTA.js} +3 -3
  5. package/dist/ExplorerSplit-BDkBN8A0.cjs +1 -0
  6. package/dist/{ExplorerSplit-8c93p1hy.js → ExplorerSplit-LiI3IUZn.js} +4 -4
  7. package/dist/{MultiLayout-BXfzR6XC.cjs → MultiLayout-BOaQK8fp.cjs} +1 -1
  8. package/dist/{MultiLayout-Dy3DD_09.js → MultiLayout-KWacTPP8.js} +251 -247
  9. package/dist/{NativeScrollBar-Ddn0iHjv.cjs → NativeScrollBar-BPgV3kp-.cjs} +1 -1
  10. package/dist/{NativeScrollBar-CI9fTvkt.js → NativeScrollBar-zzpty31a.js} +1 -1
  11. package/dist/{TreeLayout-eFQmzpNj.js → TreeLayout-C8IP4cjY.js} +3 -3
  12. package/dist/{TreeLayout-CKZ-XQgn.cjs → TreeLayout-S5TMf8_A.cjs} +1 -1
  13. package/dist/core/geometry.d.cts +1 -1
  14. package/dist/core/geometry.d.ts +1 -1
  15. package/dist/core/labels.d.cts +1 -0
  16. package/dist/core/labels.d.ts +1 -0
  17. package/dist/{index-5gwNJ8CB.cjs → index-DrKHJNY4.cjs} +4 -4
  18. package/dist/{index-h9e3p5Pd.js → index-Dz01kBab.js} +7 -5
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/{location-G7psbmv_.js → location-B-m9scLf.js} +82 -82
  22. package/dist/{location-D85EXiPt.cjs → location-BVEN_Ihk.cjs} +1 -1
  23. package/dist/{merge-C_g05UGC.cjs → merge-B7Lkcdz0.cjs} +1 -1
  24. package/dist/{merge-CS3p9BVw.js → merge-ClVgYrkS.js} +1 -1
  25. package/dist/server.cjs +1 -1
  26. package/dist/server.js +1 -1
  27. package/dist/styles/markdown-explorer.css +1 -1
  28. package/dist/{useSplitPersistence-DRjsPZdH.cjs → useSplitPersistence-Ba-v64n-.cjs} +1 -1
  29. package/dist/{useSplitPersistence-B1b5Lg5E.js → useSplitPersistence-Cc4tDxB4.js} +1 -1
  30. package/docs/behavior/dom-hooks.md +1 -1
  31. package/docs/behavior/layout.md +16 -11
  32. package/docs/behavior/localization.md +2 -1
  33. package/package.json +9 -9
  34. package/dist/ExplorerSplit-bpEvHrCo.cjs +0 -1
@@ -1,16 +1,16 @@
1
- import { jsxs as ie, jsx as M } from "react/jsx-runtime";
2
- import { createContext as Ke, use as Ne, useRef as q, useState as $, useLayoutEffect as F, useMemo as R, useSyncExternalStore as Je, useCallback as D, memo as Xe, useEffect as U, useImperativeHandle as Ze } from "react";
3
- import { k as ce, e as ke, l as Qe, P as en, m as nn } from "./location-G7psbmv_.js";
4
- import { H as tn, u as J, I as on, J as rn, D as ln, f as sn, N as an, K as V, e as Le, L as cn, M as Ae } from "./index-h9e3p5Pd.js";
5
- import { S as un, a as dn, b as mn } from "./ExplorerSplit-8c93p1hy.js";
6
- import { SCROLL_AREA_SELECTOR as Ie, SCROLL_ROOT_SELECTOR as te, generateColumnIds as fn, sortColumnIds as De, generateColumnId as Re, NO_PANEL_DRAG_ATTRIBUTE as pn, useDragDropColumns as gn, DEFAULT_DEBUG_CONFIG as he, DragDropLayout as hn } from "@aiquants/drag-drop-panels";
7
- import { useNavigate as vn, useLocation as wn } from "react-router";
8
- import { s as yn, r as Sn, w as xn } from "./storage-CmGHg7OA.js";
9
- import { F as En, i as On } from "./dataRoute-CObbjNxG.js";
10
- import { createPortal as bn } from "react-dom";
11
- import { HostedScrollArea as Pn } from "@aiquants/markdown";
12
- import { N as Cn } from "./scrollBarGeometry-DOBdGNV-.js";
13
- const Tn = () => {
1
+ import { jsxs as ie, jsx as N } from "react/jsx-runtime";
2
+ import { createContext as Je, use as ke, 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 { k as ce, e as Ae, l as en, P as nn, m as tn } from "./location-B-m9scLf.js";
4
+ import { H as on, u as J, I as rn, J as ln, D as sn, f as an, N as cn, K as V, e as Le, L as un, M as Ie } from "./index-Dz01kBab.js";
5
+ import { S as dn, a as mn, b as fn } from "./ExplorerSplit-LiI3IUZn.js";
6
+ import { SCROLL_AREA_SELECTOR as Re, SCROLL_ROOT_SELECTOR as te, PANEL_ACTION_ATTRIBUTE as he, generateColumnIds as pn, sortColumnIds as De, generateColumnId as _e, NO_PANEL_DRAG_ATTRIBUTE as gn, useDragDropColumns as hn, DEFAULT_DEBUG_CONFIG as ve, DragDropLayout as vn } from "@aiquants/drag-drop-panels";
7
+ import { useNavigate as wn, useLocation as yn } from "react-router";
8
+ import { s as Sn, r as xn, w as En } from "./storage-CmGHg7OA.js";
9
+ import { F as On, i as bn } from "./dataRoute-CObbjNxG.js";
10
+ import { createPortal as Pn } from "react-dom";
11
+ import { HostedScrollArea as Cn } from "@aiquants/markdown";
12
+ import { N as Tn } from "./scrollBarGeometry-DOBdGNV-.js";
13
+ const Nn = () => {
14
14
  const e = /* @__PURE__ */ new Map();
15
15
  return {
16
16
  hold: (n, t) => {
@@ -23,34 +23,34 @@ const Tn = () => {
23
23
  return e.delete(n), t === void 0 ? null : t;
24
24
  }
25
25
  };
26
- }, _e = Ke(null), ue = () => {
27
- const e = Ne(_e);
26
+ }, ze = Je(null), ue = () => {
27
+ const e = ke(ze);
28
28
  if (e === null) throw new Error("[markdown-explorer] multi-view panels must be rendered inside the multi-view stage");
29
29
  return e;
30
30
  }, Mn = (e, n) => {
31
31
  const t = e.pendingHashes.get(n);
32
32
  return t === void 0 ? null : t;
33
- }, Nn = 0xcbf29ce484222325n, kn = 0x100000001b3n, Ln = (1n << 64n) - 1n, An = (1n << 53n) - 1n, In = new TextEncoder(), Dn = (e) => {
34
- let n = Nn;
35
- for (const t of In.encode(e))
36
- n = (n ^ BigInt(t)) * kn & Ln;
37
- return Number(n & An);
38
- }, oe = 256, Rn = (e) => `aqmx-p-${Dn(e).toString(36)}`, ze = (e, n) => {
39
- const t = Rn(e);
33
+ }, kn = 0xcbf29ce484222325n, An = 0x100000001b3n, Ln = (1n << 64n) - 1n, In = (1n << 53n) - 1n, Rn = new TextEncoder(), Dn = (e) => {
34
+ let n = kn;
35
+ for (const t of Rn.encode(e))
36
+ n = (n ^ BigInt(t)) * An & Ln;
37
+ return Number(n & In);
38
+ }, oe = 256, _n = (e) => `aqmx-p-${Dn(e).toString(36)}`, He = (e, n) => {
39
+ const t = _n(e);
40
40
  let o = t;
41
41
  for (let r = 2; n.has(o); r += 1) o = `${t}-${String(r)}`;
42
42
  return o;
43
- }, _n = /* @__PURE__ */ new Map(), zn = (e, n = _n) => {
43
+ }, zn = /* @__PURE__ */ new Map(), Hn = (e, n = zn) => {
44
44
  const t = new Set(e.flatMap((r) => n.get(r) ?? [])), o = /* @__PURE__ */ new Map();
45
45
  for (const r of e) {
46
- const l = n.get(r) ?? ze(r, t);
46
+ const l = n.get(r) ?? He(r, t);
47
47
  t.add(l), o.set(r, l);
48
48
  }
49
49
  return o;
50
- }, He = (e, n, t) => {
50
+ }, Be = (e, n, t) => {
51
51
  const o = e.columnOf.get(n);
52
52
  return o === void 0 ? void 0 : Math.min(t - 1, Math.max(0, o));
53
- }, Be = (e, n) => {
53
+ }, qe = (e, n) => {
54
54
  const [t, ...o] = ce(n.logical, n.visible);
55
55
  if (t === void 0) throw new RangeError("[markdown-explorer] there must be at least one visible column");
56
56
  const r = ([c, m]) => e.slice(c, m).reduce((s, v) => s + v.length, 0);
@@ -62,12 +62,12 @@ const Tn = () => {
62
62
  }, re = (e, n) => {
63
63
  const t = Array.from({ length: n.logical }, () => []), o = [];
64
64
  for (const r of e.docs) {
65
- const l = He(e, r, n.logical);
65
+ const l = Be(e, r, n.logical);
66
66
  l === void 0 ? o.push(r) : t[l]?.push(r);
67
67
  }
68
- for (const r of o) t[Be(t, n)]?.push(r);
68
+ for (const r of o) t[qe(t, n)]?.push(r);
69
69
  return t;
70
- }, Hn = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), Bn = (e, n, t) => {
70
+ }, Bn = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), qn = (e, n, t) => {
71
71
  const [o, r] = n, l = r - o, a = e.length, c = Array.from({ length: l }, (x, d) => {
72
72
  const h = [0];
73
73
  for (const f of e) h.push((h.at(-1) ?? 0) + (t(f) === o + d ? 1 : 0));
@@ -81,13 +81,13 @@ const Tn = () => {
81
81
  P && T && f > (P[d] ?? Number.NEGATIVE_INFINITY) && (P[d] = f, T[d] = h);
82
82
  }
83
83
  const O = Array.from({ length: l }, () => []);
84
- let N = a;
84
+ let M = a;
85
85
  for (let x = l; x > 0; x -= 1) {
86
- const d = v[x]?.[N] ?? 0;
87
- O[x - 1] = e.slice(d, N), N = d;
86
+ const d = v[x]?.[M] ?? 0;
87
+ O[x - 1] = e.slice(d, M), M = d;
88
88
  }
89
89
  return O;
90
- }, qe = (e, n) => {
90
+ }, Fe = (e, n) => {
91
91
  const t = n.flat(), o = new Map(e.columnOf);
92
92
  for (const [r, l] of n.entries())
93
93
  for (const a of l)
@@ -97,14 +97,14 @@ const Tn = () => {
97
97
  o.delete(r);
98
98
  }
99
99
  return { docs: t, columnOf: o };
100
- }, qn = (e, n, t, o) => {
100
+ }, Fn = (e, n, t, o) => {
101
101
  if (e.docs.includes(n)) return { state: e, outcome: "existing" };
102
102
  if (e.docs.length >= o) return { state: e, outcome: "rejected" };
103
- const r = re(e, t), l = He(e, n, t.logical) ?? Be(r, t);
103
+ const r = re(e, t), l = Be(e, n, t.logical) ?? qe(r, t);
104
104
  r[l]?.push(n);
105
105
  const a = new Map(e.panelIds);
106
- return a.set(n, ze(n, new Set(a.values()))), { state: { ...e, ...qe(e, r), panelIds: a }, outcome: "opened" };
107
- }, Fe = (e, n) => {
106
+ return a.set(n, He(n, new Set(a.values()))), { state: { ...e, ...Fe(e, r), panelIds: a }, outcome: "opened" };
107
+ }, Ve = (e, n) => {
108
108
  if (!e.docs.includes(n)) return e;
109
109
  const t = new Set(e.hidden);
110
110
  t.delete(n);
@@ -112,12 +112,12 @@ const Tn = () => {
112
112
  o.delete(n);
113
113
  const r = new Map(e.panelIds);
114
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 };
115
- }, Fn = (e, n, t, o) => {
116
- if (e.hidden.has(n)) return { state: Ve(e, n, !1), outcome: "shown" };
117
- if (e.docs.includes(n)) return { state: Fe(e, n), outcome: "closed" };
118
- const r = qn(e, n, t, o);
115
+ }, Vn = (e, n, t, o) => {
116
+ if (e.hidden.has(n)) return { state: $e(e, n, !1), outcome: "shown" };
117
+ if (e.docs.includes(n)) return { state: Ve(e, n), outcome: "closed" };
118
+ const r = Fn(e, n, t, o);
119
119
  return { state: r.state, outcome: r.outcome === "rejected" ? "rejected" : "opened" };
120
- }, Vn = (e, n, t) => {
120
+ }, $n = (e, n, t) => {
121
121
  if (n === t || !e.docs.includes(n)) return { state: e, outcome: "ignored" };
122
122
  if (e.docs.includes(t)) return { state: e, outcome: "existing" };
123
123
  const o = new Map(e.columnOf), r = o.get(n);
@@ -132,20 +132,20 @@ const Tn = () => {
132
132
  state: { docs: e.docs.map((s) => s === n ? t : s), maximized: e.maximized === n ? t : e.maximized, columnOf: o, hidden: l, markup: m, panelIds: a },
133
133
  outcome: "navigated"
134
134
  };
135
- }, Ve = (e, n, t) => {
135
+ }, $e = (e, n, t) => {
136
136
  if (!e.docs.includes(n) || e.hidden.has(n) === t) return e;
137
137
  const o = new Set(e.hidden);
138
138
  return t ? o.add(n) : o.delete(n), { ...e, hidden: o, maximized: t && e.maximized === n ? null : e.maximized };
139
- }, $n = (e, n, t) => {
139
+ }, Un = (e, n, t) => {
140
140
  if (!e.docs.includes(n) || e.markup.has(n) === t) return e;
141
141
  const o = new Set(e.markup);
142
142
  return t ? o.add(n) : o.delete(n), { ...e, markup: o };
143
- }, Un = (e, n) => {
143
+ }, jn = (e, n) => {
144
144
  if (e.maximized === n || n !== null && !e.docs.includes(n)) return e;
145
145
  if (n === null || !e.hidden.has(n)) return { ...e, maximized: n };
146
146
  const t = new Set(e.hidden);
147
147
  return t.delete(n), { ...e, maximized: n, hidden: t };
148
- }, jn = (e, n, t) => {
148
+ }, Yn = (e, n, t) => {
149
149
  const o = re(e, t), r = /* @__PURE__ */ new Map();
150
150
  for (const [s, v] of o.entries())
151
151
  for (const S of v) r.set(S, s);
@@ -153,12 +153,12 @@ const Tn = () => {
153
153
  for (const [s, v] of c.entries()) {
154
154
  const S = (n[s] ?? []).filter((O) => l.has(O) && !a.has(O));
155
155
  for (const O of S) a.add(O);
156
- for (const [O, N] of Bn(S, v, (x) => r.get(x)).entries())
157
- m[v[0] + O]?.push(...N);
156
+ for (const [O, M] of qn(S, v, (x) => r.get(x)).entries())
157
+ m[v[0] + O]?.push(...M);
158
158
  }
159
159
  for (const s of e.docs)
160
160
  a.has(s) || m[r.get(s) ?? 0]?.push(s);
161
- return m.every((s, v) => s.length === o[v]?.length && s.every((S, O) => o[v]?.[O] === S)) ? e : { ...e, ...qe(e, m) };
161
+ return m.every((s, v) => s.length === o[v]?.length && s.every((S, O) => o[v]?.[O] === S)) ? e : { ...e, ...Fe(e, m) };
162
162
  }, le = (e, n) => {
163
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;
164
164
  return {
@@ -167,9 +167,9 @@ const Tn = () => {
167
167
  columnOf: e.stored.columnOf,
168
168
  hidden: new Set([...e.stored.hidden].filter((l) => o.has(l) && l !== r)),
169
169
  markup: new Set(e.markup.filter((l) => o.has(l))),
170
- panelIds: zn(t, e.panelIds)
170
+ panelIds: Hn(t, e.panelIds)
171
171
  };
172
- }, ve = (e, n) => {
172
+ }, we = (e, n) => {
173
173
  if (e.docs.every((o) => e.columnOf.has(o))) return e;
174
174
  const t = new Map(e.columnOf);
175
175
  for (const [o, r] of re(e, n).entries())
@@ -180,7 +180,7 @@ const Tn = () => {
180
180
  t.delete(o);
181
181
  }
182
182
  return { ...e, columnOf: t };
183
- }, $e = 1, G = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Yn = (e, n) => {
183
+ }, Ue = 1, G = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Gn = (e, n) => {
184
184
  if (e === null || e === "") return G;
185
185
  let t;
186
186
  try {
@@ -190,28 +190,28 @@ const Tn = () => {
190
190
  }
191
191
  if (t === null || typeof t != "object" || Array.isArray(t)) return G;
192
192
  const o = t;
193
- if (o.v !== $e) return G;
193
+ if (o.v !== Ue) return G;
194
194
  const r = /* @__PURE__ */ new Map();
195
195
  if (Array.isArray(o.columnOf))
196
196
  for (const a of o.columnOf.slice(-oe))
197
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]));
198
198
  const l = new Set(Array.isArray(o.hidden) ? o.hidden.filter((a) => typeof a == "string" && a !== "") : []);
199
199
  return { columnOf: r, hidden: l };
200
- }, Gn = (e) => JSON.stringify({
201
- v: $e,
200
+ }, Wn = (e) => JSON.stringify({
201
+ v: Ue,
202
202
  columnOf: [...e.columnOf.entries()].slice(-oe),
203
203
  hidden: e.docs.filter((n) => e.hidden.has(n))
204
204
  }), de = (e, n) => {
205
205
  const t = e.get(n);
206
- return t === void 0 ? En(n) : t;
206
+ return t === void 0 ? On(n) : t;
207
207
  }, X = (e) => {
208
208
  const n = /* @__PURE__ */ new Map();
209
209
  for (const [t, o] of e.panelIds) n.set(o, t);
210
210
  return n;
211
- }, we = (e) => {
212
- if (!On(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${JSON.stringify(e.slice(0, 80))}`);
213
- }, Wn = ({ config: e, location: n, writeUrl: t, persist: o }) => {
214
- const { maxPanels: r, columns: l } = e.multiView, a = tn(), c = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
211
+ }, ye = (e) => {
212
+ if (!bn(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${JSON.stringify(e.slice(0, 80))}`);
213
+ }, Kn = ({ config: e, location: n, writeUrl: t, persist: o }) => {
214
+ const { maxPanels: r, columns: l } = e.multiView, a = on(), c = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
215
215
  let s = {
216
216
  layout: le({ docs: n.docs, maximized: n.maximized, markup: n.markup, stored: G }, r),
217
217
  source: n.source,
@@ -221,21 +221,21 @@ const Tn = () => {
221
221
  titles: /* @__PURE__ */ new Map(),
222
222
  pendingHashes: /* @__PURE__ */ new Map()
223
223
  }, v = !1;
224
- const S = (i) => v ? ve(i, { logical: l, visible: s.visibleColumns }) : i, O = (i, p) => ke(e, { view: "multi", source: i, docs: p.docs, maximized: p.maximized, markup: p.markup }), N = (i) => ({ docs: i.docs, maximized: i.maximized, markup: [...i.markup] });
224
+ const S = (i) => v ? we(i, { logical: l, visible: s.visibleColumns }) : i, O = (i, p) => Ae(e, { view: "multi", source: i, docs: p.docs, maximized: p.maximized, markup: p.markup }), M = (i) => ({ docs: i.docs, maximized: i.maximized, markup: [...i.markup] });
225
225
  let x = O(n.source, n), d = n.source, h = x;
226
226
  const f = [], P = [];
227
227
  let T = null;
228
- const L = () => {
228
+ const A = () => {
229
229
  if (!(f.length > 0))
230
230
  for (const i of P.splice(0)) i();
231
231
  }, u = (i) => {
232
232
  s = { ...s, ...i }, a.emit();
233
233
  }, w = () => {
234
234
  if (!s.ready) return;
235
- const i = Gn(s.layout);
235
+ const i = Wn(s.layout);
236
236
  i !== T && (T = i, o(i));
237
237
  }, g = (i, p, C) => {
238
- const I = O(i, N(p));
238
+ const I = O(i, M(p));
239
239
  I !== x && (x = I, d = i, f.push(I), t(I, C));
240
240
  }, y = (i) => {
241
241
  const p = new Set(i.panelIds.values());
@@ -243,27 +243,27 @@ const Tn = () => {
243
243
  for (const b of [...m.keys()]) p.has(b) || m.delete(b);
244
244
  const C = new Set(i.docs), I = [...s.titles.keys()].every((b) => C.has(b)) ? s.titles : new Map([...s.titles].filter(([b]) => C.has(b))), E = [...s.pendingHashes.keys()].every((b) => p.has(b)) ? s.pendingHashes : new Map([...s.pendingHashes].filter(([b]) => p.has(b)));
245
245
  return { titles: I, pendingHashes: E };
246
- }, k = (i) => i === s.layout ? !1 : (u({ layout: i, ...y(i) }), g(d, i, "replace"), w(), !0), A = () => ({ logical: l, visible: s.visibleColumns });
246
+ }, k = (i) => i === s.layout ? !1 : (u({ layout: i, ...y(i) }), g(d, i, "replace"), w(), !0), L = () => ({ logical: l, visible: s.visibleColumns });
247
247
  return {
248
248
  getSnapshot: () => s,
249
249
  subscribe: a.subscribe,
250
250
  toggle: (i) => {
251
- we(i);
252
- const { state: p, outcome: C } = Fn(s.layout, i, A(), r);
251
+ ye(i);
252
+ const { state: p, outcome: C } = Vn(s.layout, i, L(), r);
253
253
  return k(p), C;
254
254
  },
255
- close: (i) => k(Fe(s.layout, i)),
255
+ close: (i) => k(Ve(s.layout, i)),
256
256
  navigate: (i, p) => {
257
- we(p);
258
- const { state: C, outcome: I } = Vn(s.layout, i, p);
257
+ ye(p);
258
+ const { state: C, outcome: I } = $n(s.layout, i, p);
259
259
  if (I !== "navigated") return I;
260
260
  const E = C.panelIds.get(p);
261
261
  return E !== void 0 && (c.delete(E), m.delete(E)), k(C), I;
262
262
  },
263
- setHidden: (i, p) => k(Ve(s.layout, i, p)),
264
- maximize: (i) => k(Un(s.layout, i)),
265
- setMarkup: (i, p) => k($n(s.layout, i, p)),
266
- arrange: (i) => k(jn(s.layout, i, { logical: l, visible: i.length })),
263
+ setHidden: (i, p) => k($e(s.layout, i, p)),
264
+ maximize: (i) => k(jn(s.layout, i)),
265
+ setMarkup: (i, p) => k(Un(s.layout, i, p)),
266
+ arrange: (i) => k(Yn(s.layout, i, { logical: l, visible: i.length })),
267
267
  changeSource: (i) => {
268
268
  g(i, s.layout, "push");
269
269
  },
@@ -273,18 +273,18 @@ const Tn = () => {
273
273
  observeLocation: (i) => {
274
274
  const p = O(i.source, i);
275
275
  if (p === x)
276
- return f.length = 0, h = p, i.source !== s.source && u({ source: i.source }), L(), !1;
276
+ return f.length = 0, h = p, i.source !== s.source && u({ source: i.source }), A(), !1;
277
277
  if (p === h) return !1;
278
278
  h = p;
279
279
  const C = f.indexOf(p);
280
280
  if (C >= 0)
281
- return f.splice(0, C + 1), i.source !== s.source && u({ source: i.source }), L(), !1;
281
+ return f.splice(0, C + 1), i.source !== s.source && u({ source: i.source }), A(), !1;
282
282
  f.length = 0, x = p, d = i.source;
283
283
  const I = S(le({ docs: i.docs, maximized: i.maximized, markup: i.markup, stored: { columnOf: s.layout.columnOf, hidden: s.layout.hidden }, panelIds: s.layout.panelIds }, r));
284
- return u({ layout: I, source: i.source, ...y(I) }), w(), L(), !0;
284
+ return u({ layout: I, source: i.source, ...y(I) }), w(), A(), !0;
285
285
  },
286
286
  whenUrlRendered: (i) => {
287
- P.push(i), L();
287
+ P.push(i), A();
288
288
  },
289
289
  loadStored: (i) => {
290
290
  u({ layout: S(le({ docs: s.layout.docs, maximized: s.layout.maximized, markup: [...s.layout.markup], stored: i, panelIds: s.layout.panelIds }, r)), ready: !0 }), w();
@@ -292,7 +292,7 @@ const Tn = () => {
292
292
  setVisibleColumns: (i) => {
293
293
  if (!Number.isInteger(i) || i < 1 || i > l) throw new RangeError(`[markdown-explorer] visible columns must be an integer in 1..${String(l)}; got ${String(i)}`);
294
294
  v = !0;
295
- const p = ve(s.layout, { logical: l, visible: i });
295
+ const p = we(s.layout, { logical: l, visible: i });
296
296
  i === s.visibleColumns && p === s.layout || (u({ visibleColumns: i, layout: p }), p !== s.layout && w());
297
297
  },
298
298
  setSplitDragging: (i) => {
@@ -329,101 +329,104 @@ const Tn = () => {
329
329
  };
330
330
  }, _ = (e, n) => {
331
331
  const t = () => n(e.getSnapshot());
332
- return Je(e.subscribe, t, t);
333
- }, Kn = (e) => {
334
- const { config: n, storageNamespace: t } = J(), o = vn(), r = q(o), l = yn(t).multiLayout, [a] = $(
335
- () => Wn({
332
+ return Xe(e.subscribe, t, t);
333
+ }, Jn = (e) => {
334
+ const { config: n, storageNamespace: t } = J(), o = wn(), r = q(o), l = Sn(t).multiLayout, [a] = $(
335
+ () => Kn({
336
336
  config: n,
337
337
  location: e,
338
338
  writeUrl: (s, v) => {
339
- r.current(s, on(v === "replace" ? "browse" : "switch-source"));
339
+ r.current(s, rn(v === "replace" ? "browse" : "switch-source"));
340
340
  },
341
- persist: (s) => xn(l, s)
341
+ persist: (s) => En(l, s)
342
342
  })
343
343
  );
344
344
  F(() => {
345
345
  r.current = o;
346
346
  }, [o]);
347
- const c = wn(), m = R(() => ({ location: e, navigated: c }), [e, c]);
347
+ const c = yn(), m = D(() => ({ location: e, navigated: c }), [e, c]);
348
348
  return F(() => {
349
349
  a.observeLocation(m.location);
350
350
  }, [a, m]), F(() => {
351
- a.loadStored(Yn(Sn(l), n.multiView.columns));
351
+ a.loadStored(Gn(xn(l), n.multiView.columns));
352
352
  }, [a, l, n]), a;
353
- }, Jn = (e) => {
354
- const n = e.closest(Ie);
353
+ }, Xn = (e) => {
354
+ const n = e.closest(Re);
355
355
  if (n === null) throw new Error("[markdown-explorer] a panel's document region is not inside the panel's scroll area");
356
356
  return n;
357
- }, Xn = ({ docPath: e, panelId: n, maximized: t, title: o, onContentShown: r }) => {
358
- const { store: l, followLink: a, revealInPanel: c } = ue(), { announcer: m } = J(), s = _(l, (u) => Mn(u, n)), v = _(l, (u) => u.layout.markup.has(e)), S = D((u, w) => a(n, e, u, w), [a, n, e]), O = D(() => l.setPendingHash(n, null), [l, n]), N = R(() => ({ read: (u) => l.imageViewOf(n, u), save: (u, w) => l.saveImageView(n, u, w) }), [l, n]), x = D(
357
+ }, Zn = ({ docPath: e, panelId: n, maximized: t, title: o, onContentShown: r }) => {
358
+ const { store: l, followLink: a, revealInPanel: c } = ue(), { announcer: m } = J(), s = _(l, (u) => Mn(u, n)), v = _(l, (u) => u.layout.markup.has(e)), S = R((u, w) => a(n, e, u, w), [a, n, e]), O = R(() => l.setPendingHash(n, null), [l, n]), M = D(() => ({ read: (u) => l.imageViewOf(n, u), save: (u, w) => l.saveImageView(n, u, w) }), [l, n]), x = R(
359
359
  (u, w) => {
360
360
  w.kind !== "failure" && l.setTitle(u, w.name), r(u);
361
361
  },
362
362
  [l, r]
363
- ), d = D(
363
+ ), d = R(
364
364
  (u) => {
365
365
  l.whenUrlRendered(() => m.announce(u));
366
366
  },
367
367
  [l, m]
368
- ), h = R(() => ({ scrollerOf: Jn, reveal: (u) => c(n, u) }), [c, n]), f = R(
368
+ ), h = D(() => ({ scrollerOf: Xn, reveal: (u) => c(n, u) }), [c, n]), f = D(
369
369
  () => ({ kind: "panel", maximized: t, onDocumentLink: S, pendingHash: s, onHashConsumed: O, announceFailure: d, paneScroll: h }),
370
370
  [t, S, s, O, d, h]
371
- ), P = R(() => ({ kind: "panel", documentName: o, maximized: t }), [o, t]), T = D(() => l.setMarkup(e, !l.getSnapshot().layout.markup.has(e)), [l, e]), L = R(() => ({ shown: v, toggle: T }), [v, T]);
372
- return /* @__PURE__ */ ie(rn, { value: N, children: [
373
- /* @__PURE__ */ M(ln, { path: e, placement: P, markup: L }),
374
- /* @__PURE__ */ M(sn, { path: e, absence: an, markup: v, variant: f, onDocumentShown: x })
371
+ ), P = D(() => ({ kind: "panel", documentName: o, maximized: t }), [o, t]), T = R(() => l.setMarkup(e, !l.getSnapshot().layout.markup.has(e)), [l, e]), A = D(() => ({ shown: v, toggle: T }), [v, T]);
372
+ return /* @__PURE__ */ ie(ln, { value: M, children: [
373
+ /* @__PURE__ */ N(sn, { path: e, placement: P, markup: A }),
374
+ /* @__PURE__ */ N(an, { path: e, absence: cn, markup: v, variant: f, onDocumentShown: x })
375
375
  ] });
376
- }, ye = () => 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", Zn = (e) => e === "normal" ? 0 : V(e), Qn = (e, n) => {
376
+ }, 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", Qn = (e) => e === "normal" ? 0 : V(e), et = (e, n) => {
377
377
  const t = e.querySelector(te)?.firstElementChild, o = e.querySelector(`[${me}]`), r = o instanceof HTMLElement ? o.getBoundingClientRect().width : Number.NaN;
378
378
  if (!(t instanceof HTMLElement))
379
379
  return { plan: { trackInlineSize: Number.NaN, gap: Number.NaN, minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: Number.NaN };
380
380
  const l = getComputedStyle(t), a = t.clientWidth - V(l.paddingLeft) - V(l.paddingRight), c = t.clientHeight - V(l.paddingTop) - V(l.paddingBottom);
381
- return { plan: { trackInlineSize: a, gap: Zn(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: c };
382
- }, et = (e, n) => {
381
+ return { plan: { trackInlineSize: a, gap: Qn(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: c };
382
+ }, nt = (e, n) => {
383
383
  if (e.getClientRects().length === 0) return Number.NaN;
384
384
  const t = getComputedStyle(e);
385
385
  return n.getBoundingClientRect().top - e.getBoundingClientRect().top + V(t.paddingBottom) + V(t.borderBottomWidth);
386
- }, ee = "data-aqmx-panel-frame", Se = "--aqmx-multi-panel-pinned-block-size", nt = (e) => {
386
+ }, ee = "data-aqmx-panel-frame", xe = "--aqmx-multi-panel-pinned-block-size", tt = (e) => {
387
387
  const { docPath: n, panelId: t } = e;
388
388
  if (typeof n != "string" || typeof t != "string") throw new TypeError("[markdown-explorer] a multi-view panel needs string docPath and panelId props");
389
389
  return { docPath: n, panelId: t };
390
- }, tt = (e) => {
390
+ }, ot = (e) => {
391
391
  const n = getComputedStyle(e), t = Number.parseFloat(n.lineHeight);
392
392
  return Number.isFinite(t) ? t : Number.parseFloat(n.fontSize);
393
- }, ot = (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) => {
394
- const n = e.closest(Ie);
393
+ }, rt = (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) => {
394
+ const n = e.closest(Re);
395
395
  return n instanceof HTMLElement ? n : null;
396
- }, Ue = (e) => {
396
+ }, je = (e) => {
397
397
  const n = e.firstElementChild;
398
398
  return n instanceof HTMLElement && getComputedStyle(n).position === "sticky" ? n : null;
399
- }, je = (e, n) => {
400
- const t = n.getBoundingClientRect().top, o = Ue(e);
399
+ }, Ye = (e, n) => {
400
+ const t = n.getBoundingClientRect().top, o = je(e);
401
401
  return o === null ? t : Math.max(t, o.getBoundingClientRect().bottom);
402
- }, xe = (e, n) => {
402
+ }, Ee = (e, n) => {
403
403
  let t = 0, o = e.length;
404
404
  for (; t < o; ) {
405
405
  const r = t + o >>> 1;
406
406
  (e[r]?.getBoundingClientRect().bottom ?? Number.NEGATIVE_INFINITY) > n ? o = r : t = r + 1;
407
407
  }
408
408
  return t < e.length ? t : -1;
409
- }, rt = (e, n) => {
410
- const t = je(e, n), o = [];
409
+ }, lt = (e, n) => {
410
+ const t = Ye(e, n), o = [];
411
411
  let r = e;
412
- for (let a = xe([...r.children], t); a >= 0; a = xe([...r.children], t)) {
412
+ for (let a = Ee([...r.children], t); a >= 0; a = Ee([...r.children], t)) {
413
413
  const c = r.children[a];
414
414
  if (c === void 0) break;
415
415
  o.push(a), r = c;
416
416
  }
417
417
  const l = r.getBoundingClientRect();
418
418
  return { scrollTop: n.scrollTop, anchor: o.length === 0 ? null : { path: o, offset: l.top - t, height: l.height } };
419
- }, Ee = (e, n, t) => {
419
+ }, Oe = (e, n, t) => {
420
420
  if (n.scrollTop = t.scrollTop, t.anchor === null) return;
421
421
  let o = e;
422
422
  for (const m of t.anchor.path) o = o?.children[m];
423
423
  if (o === void 0) return;
424
424
  const r = o.getBoundingClientRect(), { offset: l, height: a } = t.anchor, c = l < 0 && a > 0 ? l / a * r.height : l;
425
- n.scrollTop += r.top - je(e, n) - c;
426
- }, lt = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ye = (e) => JSON.stringify([e.tagName, ...lt.map((n) => e.getAttribute(n))]), st = (e, n) => {
425
+ n.scrollTop += r.top - Ye(e, n) - c;
426
+ }, st = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ge = (e) => {
427
+ const n = e.getAttribute(he);
428
+ return JSON.stringify(n === null ? [e.tagName, ...st.map((t) => e.getAttribute(t))] : [e.tagName, he, n]);
429
+ }, it = (e, n) => {
427
430
  if (n === null || !e.contains(n)) return null;
428
431
  const t = [];
429
432
  for (let o = n; o !== e; ) {
@@ -431,24 +434,24 @@ const Tn = () => {
431
434
  if (r === null) return null;
432
435
  t.unshift([...r.children].indexOf(o)), o = r;
433
436
  }
434
- return { path: t, signature: Ye(n) };
435
- }, it = (e, n, t) => {
437
+ return { path: t, signature: Ge(n) };
438
+ }, at = (e, n, t) => {
436
439
  let o = e;
437
440
  for (const r of t.path) o = o?.children[r];
438
- o instanceof HTMLElement && Ye(o) === t.signature && cn(o) || n.focus({ preventScroll: !0 });
439
- }, at = (e, n, t) => {
441
+ o instanceof HTMLElement && Ge(o) === t.signature && un(o) || n.focus({ preventScroll: !0 });
442
+ }, ct = (e, n, t) => {
440
443
  if (e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
441
444
  const o = e.ctrlKey || e.metaKey, r = o ? W(n) : n.closest(te);
442
445
  if (!(r instanceof HTMLElement)) return;
443
- const l = ot(e, r, t);
444
- (o || ct(r, l)) && (e.preventDefault(), r.scrollTop += l);
445
- }, ct = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, ut = (e) => e.scrollHeight > e.clientHeight, dt = (e, n, t) => {
446
+ const l = rt(e, r, t);
447
+ (o || ut(r, l)) && (e.preventDefault(), r.scrollTop += l);
448
+ }, ut = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, dt = (e) => e.scrollHeight > e.clientHeight, mt = (e, n, t) => {
446
449
  let o = Number.NaN, r = Number.NaN;
447
- const l = Ue(t), a = () => {
448
- const s = et(e, n);
450
+ const l = je(t), a = () => {
451
+ const s = nt(e, n);
449
452
  if (!Number.isFinite(s)) return;
450
453
  const v = l === null ? 0 : l.getBoundingClientRect().height;
451
- v !== r && (r = v, t.style.setProperty(Se, `${String(v)}px`));
454
+ v !== r && (r = v, t.style.setProperty(xe, `${String(v)}px`));
452
455
  const S = s + v;
453
456
  S !== o && (o = S, e.style.setProperty(ae, `${String(S)}px`));
454
457
  };
@@ -460,23 +463,23 @@ const Tn = () => {
460
463
  }));
461
464
  });
462
465
  return m?.observe(e), m?.observe(n), l !== null && m?.observe(l), () => {
463
- m?.disconnect(), c !== null && cancelAnimationFrame(c), e.style.removeProperty(ae), t.style.removeProperty(Se);
466
+ m?.disconnect(), c !== null && cancelAnimationFrame(c), e.style.removeProperty(ae), t.style.removeProperty(xe);
464
467
  };
465
- }, mt = (e) => {
466
- const { docPath: n, panelId: t } = nt(e), { store: o, Body: r, maximize: l, focusCarry: a } = ue(), c = _(o, (d) => d.layout.maximized === n), m = _(o, (d) => de(d.titles, n)), s = q(null), v = q(null), S = q(null), O = q(null);
468
+ }, ft = (e) => {
469
+ const { docPath: n, panelId: t } = tt(e), { store: o, Body: r, maximize: l, focusCarry: a } = ue(), c = _(o, (d) => d.layout.maximized === n), m = _(o, (d) => de(d.titles, n)), s = q(null), v = q(null), S = q(null), O = q(null);
467
470
  U(() => {
468
471
  const d = s.current, h = d === null ? null : W(d);
469
472
  if (d === null || h === null || c) return;
470
473
  const f = /* @__PURE__ */ new Map(), P = (g) => {
471
474
  const y = f.get(g);
472
475
  if (y !== void 0) return y;
473
- const k = tt(g);
476
+ const k = ot(g);
474
477
  return f.set(g, k), k;
475
- }, T = (g) => at(g, d, P);
476
- let L = !1;
478
+ }, T = (g) => ct(g, d, P);
479
+ let A = !1;
477
480
  const u = () => {
478
- const g = ut(h);
479
- g !== L && (L = g, g ? d.addEventListener("wheel", T, { capture: !0, passive: !1 }) : d.removeEventListener("wheel", T, { capture: !0 }));
481
+ const g = dt(h);
482
+ g !== A && (A = g, g ? d.addEventListener("wheel", T, { capture: !0, passive: !1 }) : d.removeEventListener("wheel", T, { capture: !0 }));
480
483
  };
481
484
  u();
482
485
  const w = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
@@ -486,29 +489,29 @@ const Tn = () => {
486
489
  }, [c]), F(() => {
487
490
  const d = s.current, h = d === null ? null : W(d), f = d === null ? null : d.closest(`[${Q}]`);
488
491
  if (!(d === null || h === null || !(f instanceof HTMLElement)))
489
- return dt(f, h, d);
492
+ return mt(f, h, d);
490
493
  }, []), F(() => {
491
494
  const d = s.current, h = d === null ? null : W(d);
492
495
  if (d === null || h === null) return;
493
496
  const f = (g) => {
494
- Ee(d, h, g), O.current = h.scrollTop;
497
+ Oe(d, h, g), O.current = h.scrollTop;
495
498
  }, P = o.readingPositionOf(t, n);
496
499
  v.current = P === null ? null : { doc: n, position: P }, P !== null && f(P);
497
- let T = null, L = d.getBoundingClientRect().width;
500
+ let T = null, A = d.getBoundingClientRect().width;
498
501
  const u = () => {
499
502
  T === null && (T = requestAnimationFrame(() => {
500
503
  T = null;
501
504
  const g = O.current;
502
- if (O.current = null, g !== null && h.scrollTop === g || d.getBoundingClientRect().width !== L) return;
505
+ if (O.current = null, g !== null && h.scrollTop === g || d.getBoundingClientRect().width !== A) return;
503
506
  const y = S.current;
504
- y !== null && o.saveReadingPosition(t, y, rt(d, h));
507
+ y !== null && o.saveReadingPosition(t, y, lt(d, h));
505
508
  }));
506
509
  };
507
510
  h.addEventListener("scroll", u, { passive: !0 });
508
511
  const w = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
509
512
  const g = d.getBoundingClientRect().width;
510
- if (g === L) return;
511
- L = g;
513
+ if (g === A) return;
514
+ A = g;
512
515
  const y = o.readingPositionOf(t, n);
513
516
  y !== null && f(y);
514
517
  });
@@ -519,21 +522,21 @@ const Tn = () => {
519
522
  const d = s.current, h = d === null ? null : d.closest(`[${Q}]`);
520
523
  if (d === null || h === null) return;
521
524
  const f = a.take(t);
522
- return f !== null && it(h, d, f), () => {
523
- const P = st(h, h.ownerDocument.activeElement);
525
+ return f !== null && at(h, d, f), () => {
526
+ const P = it(h, h.ownerDocument.activeElement);
524
527
  P !== null && a.hold(t, P);
525
528
  };
526
529
  }, [a, t]);
527
- const N = D((d) => {
530
+ const M = R((d) => {
528
531
  const h = s.current, f = h === null ? null : W(h);
529
532
  if (h === null || f === null) return;
530
533
  const P = S.current;
531
534
  S.current = d;
532
535
  const T = v.current;
533
- v.current = null, T !== null && T.doc === d ? (Ee(h, f, T.position), O.current = f.scrollTop) : P !== null && P !== d && (f.scrollTop = 0);
534
- }, []), x = D(() => l(n), [l, n]);
536
+ v.current = null, T !== null && T.doc === d ? (Oe(h, f, T.position), O.current = f.scrollTop) : P !== null && P !== d && (f.scrollTop = 0);
537
+ }, []), x = R(() => l(n), [l, n]);
535
538
  return (
536
- /* @__PURE__ */ M(
539
+ /* @__PURE__ */ N(
537
540
  "div",
538
541
  {
539
542
  ref: s,
@@ -546,18 +549,18 @@ const Tn = () => {
546
549
  "data-testid": "markdown-explorer-panel-frame",
547
550
  ...c ? Le : {},
548
551
  onDoubleClick: c ? void 0 : x,
549
- children: /* @__PURE__ */ M(r, { docPath: n, panelId: t, maximized: c, title: m, onContentShown: N })
552
+ children: /* @__PURE__ */ N(r, { docPath: n, panelId: t, maximized: c, title: m, onContentShown: M })
550
553
  }
551
554
  )
552
555
  );
553
- }, ft = Xe(mt), Z = (e, n) => {
556
+ }, pt = Ze(ft), Z = (e, n) => {
554
557
  const t = e.panelIds.get(n);
555
558
  if (t === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
556
559
  return t;
557
- }, Oe = (e) => Object.fromEntries(fn(e).map((n) => [n, []])), pt = (e, n) => {
558
- const t = Hn(re(e, n), n.visible);
559
- return Object.fromEntries(t.map((o, r) => [Re(r), o.map((l) => Z(e, l))]));
560
- }, gt = (e, n) => {
560
+ }, be = (e) => Object.fromEntries(pn(e).map((n) => [n, []])), gt = (e, n) => {
561
+ const t = Bn(re(e, n), n.visible);
562
+ return Object.fromEntries(t.map((o, r) => [_e(r), o.map((l) => Z(e, l))]));
563
+ }, ht = (e, n) => {
561
564
  const t = X(e);
562
565
  return De(Object.keys(n)).map(
563
566
  (o) => (n[o] ?? []).flatMap((r) => {
@@ -565,13 +568,14 @@ const Tn = () => {
565
568
  return l === void 0 ? [] : [l];
566
569
  })
567
570
  );
568
- }, ht = (e) => ({
571
+ }, vt = (e) => ({
569
572
  switchToCustomDragMode: e.panelSwitchToCustomDrag,
570
573
  switchToNormalDragMode: e.panelSwitchToNormalDrag,
571
574
  hidePanel: e.panelHide,
572
575
  maximizePanel: e.panelMaximize,
573
576
  restorePanel: e.panelRestore,
574
577
  closePanel: e.panelClose,
578
+ movePanel: e.panelMove,
575
579
  movePanelToPreviousColumn: e.panelMovePreviousColumn,
576
580
  movePanelToNextColumn: e.panelMoveNextColumn,
577
581
  movePanelUp: e.panelMoveUp,
@@ -587,13 +591,13 @@ const Tn = () => {
587
591
  emptyColumn: e.multiColumnEmpty,
588
592
  dropZone: e.multiColumnRegion,
589
593
  dropHere: e.panelDropHere
590
- }), vt = "--aqmx-multi-stage-bar-gutter", wt = Object.freeze({ [vt]: `${String(Cn)}px` }), yt = Object.freeze({ blockSize: "100%" }), St = Object.freeze({ [pn]: "", style: Object.freeze({ display: "flex" }) }), xt = (e) => /* @__PURE__ */ M("div", { ...St, children: /* @__PURE__ */ M(Ae, { scroller: e, withCircle: !0 }) }), Et = ({ props: e, children: n }) => /* @__PURE__ */ M(Pn, { scrollerProps: { ...e, style: yt }, renderScrollBar: xt, children: n }), Ot = (e) => /* @__PURE__ */ M(Ae, { scroller: e, withCircle: !1 }), fe = "--aqmx-stage-block", bt = "--aqmx-multi-panel-body-floor", Pt = `calc(var(${fe}) * ${String(nn)})`, Ct = `max(calc(var(${fe}) * ${String(en)}), calc(var(${ae}) + var(${bt})))`, Tt = (e, n) => {
594
+ }), wt = "--aqmx-multi-stage-bar-gutter", yt = Object.freeze({ [wt]: `${String(Tn)}px` }), St = Object.freeze({ blockSize: "100%" }), xt = Object.freeze({ [gn]: "", style: Object.freeze({ display: "flex" }) }), Et = (e) => /* @__PURE__ */ N("div", { ...xt, children: /* @__PURE__ */ N(Ie, { scroller: e, withCircle: !0 }) }), Ot = ({ props: e, children: n }) => /* @__PURE__ */ N(Cn, { scrollerProps: { ...e, style: St }, renderScrollBar: Et, children: n }), bt = (e) => /* @__PURE__ */ N(Ie, { scroller: e, withCircle: !1 }), fe = "--aqmx-stage-block", Pt = "--aqmx-multi-panel-body-floor", Ct = `calc(var(${fe}) * ${String(tn)})`, Tt = `max(calc(var(${fe}) * ${String(nn)}), calc(var(${ae}) + var(${Pt})))`, Nt = (e, n) => {
591
595
  const t = Object.entries(e);
592
596
  return t.length !== Object.keys(n).length ? !1 : t.every(([o, r]) => {
593
597
  const l = n[o];
594
598
  return l !== void 0 && l.length === r.length && l.every((a, c) => r[c] === a);
595
599
  });
596
- }, be = ["keydown", "pointerdown", "wheel", "touchstart"], K = /* @__PURE__ */ new WeakMap(), Pe = (e, n, t) => {
600
+ }, Pe = ["keydown", "pointerdown", "wheel", "touchstart"], K = /* @__PURE__ */ new WeakMap(), Ce = (e, n, t) => {
597
601
  for (let o = n; o !== null && o !== t; o = o.parentElement) {
598
602
  e.observe(o);
599
603
  for (let r = o.previousElementSibling; r !== null; r = r.previousElementSibling) e.observe(r);
@@ -616,42 +620,42 @@ const Tn = () => {
616
620
  };
617
621
  if (a(), typeof ResizeObserver > "u") return;
618
622
  const c = new ResizeObserver(a);
619
- Pe(c, o, o.closest(te)), r !== null && Pe(c, r, o);
623
+ Ce(c, o, o.closest(te)), r !== null && Ce(c, r, o);
620
624
  const { ownerDocument: m } = e, s = (S) => {
621
625
  const O = S.target === m ? m.scrollingElement : S.target;
622
626
  if (!(O instanceof Element)) return;
623
- const N = l.get(O);
624
- N !== void 0 && (O.scrollTop !== N.top || O.scrollLeft !== N.left) && v();
627
+ const M = l.get(O);
628
+ M !== void 0 && (O.scrollTop !== M.top || O.scrollLeft !== M.left) && v();
625
629
  }, v = () => {
626
630
  c.disconnect();
627
- for (const S of be) m.removeEventListener(S, v, !0);
631
+ for (const S of Pe) m.removeEventListener(S, v, !0);
628
632
  m.removeEventListener("scroll", s, !0), K.get(e) === v && K.delete(e);
629
633
  };
630
- for (const S of be) m.addEventListener(S, v, { capture: !0, passive: !0 });
634
+ for (const S of Pe) m.addEventListener(S, v, { capture: !0, passive: !0 });
631
635
  m.addEventListener("scroll", s, { capture: !0, passive: !0 }), K.set(e, v);
632
- }, Ge = (e, n) => {
636
+ }, We = (e, n) => {
633
637
  const t = e.querySelector(`[${ee}="${n}"]`);
634
638
  return t instanceof HTMLElement ? (ne(e, n, null), t.focus({ preventScroll: !0 }), !0) : !1;
635
639
  }, pe = (e, n) => {
636
640
  const t = e.querySelector(`[${Q}="${n}"]`);
637
641
  return t instanceof HTMLElement && t.contains(e.ownerDocument.activeElement);
638
- }, Ce = (e, n) => {
642
+ }, Te = (e, n) => {
639
643
  if (!pe(e, n)) return null;
640
644
  const t = [...e.querySelectorAll(`[${ee}]`)].map((a) => a.getAttribute(ee)), o = t.indexOf(n), r = t[o + 1];
641
645
  if (o >= 0 && typeof r == "string") return { kind: "panel", panelId: r };
642
646
  const l = t[o - 1];
643
647
  return o > 0 && typeof l == "string" ? { kind: "panel", panelId: l } : { kind: "stage" };
644
- }, Te = (e, n) => {
648
+ }, Ne = (e, n) => {
645
649
  requestAnimationFrame(() => {
646
650
  const t = e.current;
647
- t !== null && (n.kind === "panel" && Ge(t, n.panelId) || t.focus({ preventScroll: !0 }));
651
+ t !== null && (n.kind === "panel" && We(t, n.panelId) || t.focus({ preventScroll: !0 }));
648
652
  });
649
- }, We = (e, n) => {
653
+ }, Ke = (e, n) => {
650
654
  requestAnimationFrame(() => {
651
655
  const t = e.current;
652
- t !== null && Ge(t, n);
656
+ t !== null && We(t, n);
653
657
  });
654
- }, Nt = (e, n, t) => {
658
+ }, kt = (e, n, t) => {
655
659
  requestAnimationFrame(() => {
656
660
  const o = e.current;
657
661
  if (o === null) return;
@@ -660,29 +664,29 @@ const Tn = () => {
660
664
  const a = o.querySelector(`[${ee}="${n}"]`);
661
665
  a instanceof HTMLElement && a.focus({ preventScroll: !0 });
662
666
  });
663
- }, kt = ({ store: e, stageRef: n }) => {
664
- const { config: t, labels: o, announcer: r, edits: l } = J(), { maximize: a } = ue(), c = t.multiView.columns, m = _(e, (E) => E.layout), s = _(e, (E) => E.visibleColumns), v = _(e, (E) => E.titles), S = _(e, (E) => E.layout.maximized !== null || E.splitDragging), [O, N] = $(!1), [x] = $(() => Oe(s)), d = R(() => ht(o), [o]), h = D(
667
+ }, At = ({ store: e, stageRef: n }) => {
668
+ const { config: t, labels: o, announcer: r, edits: l } = J(), { maximize: a } = ue(), c = t.multiView.columns, m = _(e, (E) => E.layout), s = _(e, (E) => E.visibleColumns), v = _(e, (E) => E.titles), S = _(e, (E) => E.layout.maximized !== null || E.splitDragging), [O, M] = $(!1), [x] = $(() => be(s)), d = D(() => vt(o), [o]), h = R(
665
669
  (E) => {
666
- e.arrange(gt(e.getSnapshot().layout, E));
670
+ e.arrange(ht(e.getSnapshot().layout, E));
667
671
  },
668
672
  [e]
669
- ), f = gn({ initialColumnPanels: x, initialPanelVisibility: {}, debugConfig: he, onColumnPanelsChange: h }), { columnPanels: P, setColumnPanels: T } = f, L = q(S), u = q(P);
673
+ ), f = hn({ initialColumnPanels: x, initialPanelVisibility: {}, debugConfig: ve, onColumnPanelsChange: h }), { columnPanels: P, setColumnPanels: T } = f, A = q(S), u = q(P);
670
674
  F(() => {
671
- L.current = S, u.current = P;
675
+ A.current = S, u.current = P;
672
676
  }, [S, P]);
673
- const w = D(
677
+ const w = R(
674
678
  (E) => {
675
679
  const b = n.current;
676
680
  if (b === null) return;
677
- const { plan: B, stageBlockSize: z } = Qn(b, c);
678
- if (Number.isFinite(z) && z > 0 && b.style.setProperty(fe, `${String(z)}px`), L.current && !E) return;
679
- const H = Qe(e.getSnapshot().visibleColumns, B);
681
+ const { plan: B, stageBlockSize: z } = et(b, c);
682
+ if (Number.isFinite(z) && z > 0 && b.style.setProperty(fe, `${String(z)}px`), A.current && !E) return;
683
+ const H = en(e.getSnapshot().visibleColumns, B);
680
684
  H !== null && e.setVisibleColumns(H);
681
685
  },
682
686
  [e, n, c]
683
687
  );
684
688
  F(() => {
685
- w(!0), N(!0);
689
+ w(!0), M(!0);
686
690
  }, [w]), U(() => {
687
691
  const E = n.current;
688
692
  if (E === null || typeof ResizeObserver > "u") return;
@@ -698,17 +702,17 @@ const Tn = () => {
698
702
  }, [n, w]), U(() => {
699
703
  S || w(!1);
700
704
  }, [S, w]);
701
- const g = R(() => O ? pt(m, { logical: c, visible: s }) : Oe(s), [O, m, c, s]);
705
+ const g = D(() => O ? gt(m, { logical: c, visible: s }) : be(s), [O, m, c, s]);
702
706
  F(() => {
703
- Tt(u.current, g) || T(g);
707
+ Nt(u.current, g) || T(g);
704
708
  }, [g, T]);
705
- const y = R(() => De(Object.keys(P)).map((E) => ({ id: E, key: E, className: "aqmx-multi-column" })), [P]), k = R(
709
+ const y = D(() => De(Object.keys(P)).map((E) => ({ id: E, key: E, className: "aqmx-multi-column" })), [P]), k = D(
706
710
  () => m.docs.map((E) => {
707
711
  const b = Z(m, E);
708
- return { id: b, component: ft, title: de(v, E), props: { docPath: E, panelId: b }, minHeight: Pt, maxHeight: Ct };
712
+ return { id: b, component: pt, title: de(v, E), props: { docPath: E, panelId: b }, minHeight: Ct, maxHeight: Tt };
709
713
  }),
710
714
  [m, v]
711
- ), A = R(() => Object.fromEntries(m.docs.map((E) => [Z(m, E), !m.hidden.has(E)])), [m]), i = m.maximized === null ? null : Z(m, m.maximized), p = D(
715
+ ), L = D(() => Object.fromEntries(m.docs.map((E) => [Z(m, E), !m.hidden.has(E)])), [m]), i = m.maximized === null ? null : Z(m, m.maximized), p = R(
712
716
  (E) => {
713
717
  const { layout: b } = e.getSnapshot();
714
718
  for (const [B, z] of X(b)) {
@@ -717,28 +721,28 @@ const Tn = () => {
717
721
  const j = e.titleOf(z);
718
722
  if (H) {
719
723
  if (!e.setHidden(z, !1)) continue;
720
- r.announce(o.panelShown(j)), We(n, B);
724
+ r.announce(o.panelShown(j)), Ke(n, B);
721
725
  continue;
722
726
  }
723
- const Y = n.current, ge = Y === null ? null : Ce(Y, B);
724
- e.setHidden(z, !0) && (r.announce(o.panelHidden(j)), ge !== null && Te(n, ge));
727
+ const Y = n.current, ge = Y === null ? null : Te(Y, B);
728
+ e.setHidden(z, !0) && (r.announce(o.panelHidden(j)), ge !== null && Ne(n, ge));
725
729
  }
726
730
  },
727
731
  [e, n, r, o]
728
- ), C = D(
732
+ ), C = R(
729
733
  (E) => {
730
734
  const b = X(e.getSnapshot().layout).get(E);
731
735
  if (b === void 0) return;
732
736
  const B = () => {
733
- const H = e.titleOf(b), j = n.current, Y = j === null ? null : Ce(j, E);
734
- e.close(b) && (r.announce(o.panelClosed(H)), Y !== null && Te(n, Y));
737
+ const H = e.titleOf(b), j = n.current, Y = j === null ? null : Te(j, E);
738
+ e.close(b) && (r.announce(o.panelClosed(H)), Y !== null && Ne(n, Y));
735
739
  }, z = l.unsavedAmong([b]);
736
740
  z.length === 0 ? B() : l.askToDiscard(z).then((H) => {
737
741
  H && B();
738
742
  });
739
743
  },
740
744
  [e, n, r, o, l]
741
- ), I = D(
745
+ ), I = R(
742
746
  (E) => {
743
747
  if (E === null) {
744
748
  a(null);
@@ -749,20 +753,20 @@ const Tn = () => {
749
753
  },
750
754
  [e, a]
751
755
  );
752
- return /* @__PURE__ */ M("div", { className: "aqmx-multi-layout", "aria-busy": !O, children: /* @__PURE__ */ M(
753
- hn,
756
+ return /* @__PURE__ */ N("div", { className: "aqmx-multi-layout", "aria-busy": !O, children: /* @__PURE__ */ N(
757
+ vn,
754
758
  {
755
759
  columns: y,
756
760
  panels: k,
757
761
  columnPanels: P,
758
762
  onColumnPanelsChange: h,
759
- panelVisibility: A,
763
+ panelVisibility: L,
760
764
  onPanelVisibilityChange: p,
761
765
  dragState: f.dragState,
762
766
  dragOverPosition: f.dragOverPosition,
763
767
  originalPanelPosition: f.originalPanelPosition,
764
768
  dragModes: f.dragModes,
765
- debugConfig: he,
769
+ debugConfig: ve,
766
770
  panelSizes: f.panelSizes,
767
771
  customDrag: f.customDrag,
768
772
  setPanelRef: f.setPanelRef,
@@ -782,8 +786,8 @@ const Tn = () => {
782
786
  dragHandle: "header",
783
787
  labels: d,
784
788
  panelClassName: "aqmx-multi-panel",
785
- renderPanelScrollArea: Et,
786
- renderStageScrollBar: Ot
789
+ renderPanelScrollArea: Ot,
790
+ renderStageScrollBar: bt
787
791
  }
788
792
  ) });
789
793
  }, se = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, Lt = (e, n) => {
@@ -794,19 +798,19 @@ const Tn = () => {
794
798
  return m !== -1 && s !== -1 && s < m;
795
799
  })
796
800
  );
797
- }, At = (e, n) => {
801
+ }, It = (e, n) => {
798
802
  const t = n.getBoundingClientRect(), o = n.ownerDocument.documentElement.clientWidth, r = getComputedStyle(n).direction === "rtl";
799
803
  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(), () => {
800
804
  e.isConnected && e.hidePopover();
801
805
  };
802
- }, It = ({ store: e, body: n, limitNotice: t, onLimitNoticeCovered: o, ref: r }) => {
803
- const { config: l, labels: a, announcer: c, edits: m } = J(), s = q(null), v = q(null), S = _(e, (u) => u.ready), O = _(e, (u) => u.layout.docs.length > 0), N = _(e, (u) => u.visibleColumns), x = Ne(un), d = D(
806
+ }, Rt = ({ store: e, body: n, limitNotice: t, onLimitNoticeCovered: o, ref: r }) => {
807
+ const { config: l, labels: a, announcer: c, edits: m } = J(), s = q(null), v = q(null), S = _(e, (u) => u.ready), O = _(e, (u) => u.layout.docs.length > 0), M = _(e, (u) => u.visibleColumns), x = ke(dn), d = R(
804
808
  (u) => {
805
- const { layout: w } = e.getSnapshot(), g = w.maximized, y = u === null && g !== null ? w.panelIds.get(g) : void 0, k = s.current, A = y !== void 0 && k !== null && pe(k, y);
806
- e.maximize(u) && (u !== null ? c.announce(a.panelMaximized(e.titleOf(u))) : g !== null && c.announce(a.panelRestored(e.titleOf(g))), y !== void 0 && Nt(s, y, A));
809
+ const { layout: w } = e.getSnapshot(), g = w.maximized, y = u === null && g !== null ? w.panelIds.get(g) : void 0, k = s.current, L = y !== void 0 && k !== null && pe(k, y);
810
+ e.maximize(u) && (u !== null ? c.announce(a.panelMaximized(e.titleOf(u))) : g !== null && c.announce(a.panelRestored(e.titleOf(g))), y !== void 0 && kt(s, y, L));
807
811
  },
808
812
  [e, c, a]
809
- ), h = D(
813
+ ), h = R(
810
814
  (u, w, g, y) => {
811
815
  if (g === w) {
812
816
  e.setPendingHash(u, y);
@@ -819,37 +823,37 @@ const Tn = () => {
819
823
  });
820
824
  return;
821
825
  }
822
- const A = e.navigate(w, g);
823
- if (A === "navigated") {
826
+ const L = e.navigate(w, g);
827
+ if (L === "navigated") {
824
828
  e.setPendingHash(u, y);
825
829
  return;
826
830
  }
827
- if (A !== "existing") return;
831
+ if (L !== "existing") return;
828
832
  const { layout: i } = e.getSnapshot(), p = i.panelIds.get(g);
829
- p !== void 0 && (c.announce(a.panelAlreadyOpen(e.titleOf(g))), i.maximized === null ? e.setHidden(g, !1) : d(g), e.setPendingHash(p, y), We(s, p));
833
+ p !== void 0 && (c.announce(a.panelAlreadyOpen(e.titleOf(g))), i.maximized === null ? e.setHidden(g, !1) : d(g), e.setPendingHash(p, y), Ke(s, p));
830
834
  },
831
835
  [e, c, a, d, m]
832
836
  );
833
837
  F(() => {
834
- if (t === null || x !== null || !ye()) return;
838
+ if (t === null || x !== null || !Se()) return;
835
839
  const u = v.current, w = s.current;
836
840
  if (u === null || w === null) throw new Error("[markdown-explorer] the panel-limit notice and the stage must be mounted together");
837
- return At(u, w);
841
+ return It(u, w);
838
842
  }, [t, x]), U(() => {
839
843
  const u = v.current;
840
844
  if (t === null || u === null) return;
841
845
  const { ownerDocument: w } = u;
842
846
  let g = null;
843
847
  const y = (k) => {
844
- const A = k.target;
845
- A instanceof Element && (g !== null && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
846
- g = null, w.activeElement === A && u.isConnected && Lt(u, A) && o();
848
+ const L = k.target;
849
+ L instanceof Element && (g !== null && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
850
+ g = null, w.activeElement === L && u.isConnected && Lt(u, L) && o();
847
851
  }));
848
852
  };
849
853
  return w.addEventListener("focusin", y, !0), () => {
850
854
  w.removeEventListener("focusin", y, !0), g !== null && cancelAnimationFrame(g);
851
855
  };
852
- }, [t, x, o]), Ze(
856
+ }, [t, x, o]), Qe(
853
857
  r,
854
858
  () => ({
855
859
  bringIntoView: (u) => {
@@ -866,34 +870,34 @@ const Tn = () => {
866
870
  u !== null && K.get(u)?.();
867
871
  };
868
872
  }, []);
869
- const f = D((u, w) => {
873
+ const f = R((u, w) => {
870
874
  const g = s.current;
871
875
  g !== null && ne(g, u, w);
872
- }, []), [P] = $(Tn), T = R(() => ({ store: e, Body: n, followLink: h, maximize: d, revealInPanel: f, focusCarry: P }), [e, n, h, d, f, P]), L = R(() => Array.from({ length: l.multiView.columns }, (u, w) => Re(w)), [l]);
876
+ }, []), [P] = $(Nn), T = D(() => ({ store: e, Body: n, followLink: h, maximize: d, revealInPanel: f, focusCarry: P }), [e, n, h, d, f, P]), A = D(() => Array.from({ length: l.multiView.columns }, (u, w) => _e(w)), [l]);
873
877
  return (
874
- /* @__PURE__ */ ie("section", { ref: s, className: "aqmx-multi-stage", style: wt, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": O && !S, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": N, ...Le, children: [
875
- /* @__PURE__ */ M("span", { className: "aqmx-multi-probe", "aria-hidden": "true", [me]: "" }),
876
- O ? S ? /* @__PURE__ */ M(_e, { value: T, children: /* @__PURE__ */ M(kt, { store: e, stageRef: s }) }) : /* @__PURE__ */ M("div", { className: "aqmx-multi-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-stage-skeleton", children: L.map((u) => /* @__PURE__ */ ie("div", { className: "aqmx-skeleton aqmx-multi-skeleton-column", children: [
877
- /* @__PURE__ */ M("span", {}),
878
- /* @__PURE__ */ M("span", {}),
879
- /* @__PURE__ */ M("span", {})
880
- ] }, u)) }) : /* @__PURE__ */ M("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-multi-empty", children: /* @__PURE__ */ M("p", { className: "aqmx-empty-title", children: a.multiEmpty }) }),
881
- t === null ? null : x !== null ? bn(
882
- /* @__PURE__ */ M("div", { ref: v, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t }),
878
+ /* @__PURE__ */ ie("section", { ref: s, className: "aqmx-multi-stage", style: yt, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": O && !S, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": M, ...Le, children: [
879
+ /* @__PURE__ */ N("span", { className: "aqmx-multi-probe", "aria-hidden": "true", [me]: "" }),
880
+ O ? S ? /* @__PURE__ */ N(ze, { value: T, children: /* @__PURE__ */ N(At, { store: e, stageRef: s }) }) : /* @__PURE__ */ N("div", { className: "aqmx-multi-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-stage-skeleton", children: A.map((u) => /* @__PURE__ */ ie("div", { className: "aqmx-skeleton aqmx-multi-skeleton-column", children: [
881
+ /* @__PURE__ */ N("span", {}),
882
+ /* @__PURE__ */ N("span", {}),
883
+ /* @__PURE__ */ N("span", {})
884
+ ] }, u)) }) : /* @__PURE__ */ N("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-multi-empty", children: /* @__PURE__ */ N("p", { className: "aqmx-empty-title", children: a.multiEmpty }) }),
885
+ t === null ? null : x !== null ? Pn(
886
+ /* @__PURE__ */ N("div", { ref: v, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t }),
883
887
  x
884
888
  ) : (
885
- /* @__PURE__ */ M("div", { ref: v, popover: ye() ? "manual" : void 0, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t })
889
+ /* @__PURE__ */ N("div", { ref: v, popover: Se() ? "manual" : void 0, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t })
886
890
  )
887
891
  ] })
888
892
  );
889
- }, Dt = 3e3, Rt = (e, n) => {
893
+ }, Dt = 3e3, _t = (e, n) => {
890
894
  if (n !== null) return n;
891
895
  const [t] = e;
892
896
  return t === void 0 ? null : t;
893
897
  }, Me = (e, n, t) => {
894
898
  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);
895
899
  return l === void 0 ? null : l;
896
- }, _t = (e, n, t) => {
900
+ }, zt = (e, n, t) => {
897
901
  switch (n) {
898
902
  case "opened":
899
903
  return e.panelOpened(t);
@@ -906,10 +910,10 @@ const Tn = () => {
906
910
  throw new RangeError(`[markdown-explorer] unknown toggle outcome ${JSON.stringify(o)}`);
907
911
  }
908
912
  }
909
- }, Kt = ({ location: e }) => {
910
- const { config: n, labels: t, announcer: o } = J(), r = Kn(e), l = _(r, (y) => y.layout.docs), a = _(r, (y) => y.layout.maximized), c = _(r, (y) => y.layout.markup), m = _(r, (y) => y.source), [s, v] = $(() => ({ docs: l, latest: Me([], l, null) }));
913
+ }, Jt = ({ location: e }) => {
914
+ const { config: n, labels: t, announcer: o } = J(), r = Jn(e), l = _(r, (y) => y.layout.docs), a = _(r, (y) => y.layout.maximized), c = _(r, (y) => y.layout.markup), m = _(r, (y) => y.source), [s, v] = $(() => ({ docs: l, latest: Me([], l, null) }));
911
915
  s.docs !== l && v({ docs: l, latest: Me(s.docs, l, s.latest) });
912
- const S = a !== null ? a : s.latest, [O, N] = $(!1), x = q(null), [d, h] = $(0), f = q(null), P = q(null);
916
+ const S = a !== null ? a : s.latest, [O, M] = $(!1), x = q(null), [d, h] = $(0), f = q(null), P = q(null);
913
917
  F(() => {
914
918
  const y = f.current;
915
919
  f.current = null, y !== null && (r.whenUrlRendered(() => o.announce(y.announcement)), P.current?.bringIntoView(y.doc));
@@ -919,36 +923,36 @@ const Tn = () => {
919
923
  },
920
924
  []
921
925
  );
922
- const T = D(() => {
923
- x.current !== null && clearTimeout(x.current), N(!0), x.current = setTimeout(() => {
924
- x.current = null, N(!1);
926
+ const T = R(() => {
927
+ x.current !== null && clearTimeout(x.current), M(!0), x.current = setTimeout(() => {
928
+ x.current = null, M(!1);
925
929
  }, Dt);
926
- }, []), L = D(() => {
927
- x.current !== null && clearTimeout(x.current), x.current = null, N(!1);
928
- }, []), u = D(
930
+ }, []), A = R(() => {
931
+ x.current !== null && clearTimeout(x.current), x.current = null, M(!1);
932
+ }, []), u = R(
929
933
  (y) => {
930
- const k = r.titleOf(y), A = r.toggle(y);
931
- A === "rejected" && T();
932
- const i = A === "rejected" ? t.panelLimit(n.multiView.maxPanels) : _t(t, A, k);
933
- if (A === "shown") {
934
+ const k = r.titleOf(y), L = r.toggle(y);
935
+ L === "rejected" && T();
936
+ const i = L === "rejected" ? t.panelLimit(n.multiView.maxPanels) : zt(t, L, k);
937
+ if (L === "shown") {
934
938
  f.current = { doc: y, announcement: i }, h((p) => p + 1);
935
939
  return;
936
940
  }
937
941
  r.whenUrlRendered(() => {
938
- o.announce(i), A === "opened" && P.current?.bringIntoView(y);
942
+ o.announce(i), L === "opened" && P.current?.bringIntoView(y);
939
943
  });
940
944
  },
941
945
  [r, T, o, t, n]
942
- ), w = R(() => new Set(l), [l]), g = R(() => {
943
- const y = Rt(l, a);
944
- return { href: ke(n, { view: "tree", source: m, doc: y, markup: y !== null && c.has(y) }), target: "tree" };
946
+ ), w = D(() => new Set(l), [l]), g = D(() => {
947
+ const y = _t(l, a);
948
+ return { href: Ae(n, { view: "tree", source: m, doc: y, markup: y !== null && c.has(y) }), target: "tree" };
945
949
  }, [n, m, l, a, c]);
946
- return /* @__PURE__ */ M(
947
- dn,
950
+ return /* @__PURE__ */ N(
951
+ mn,
948
952
  {
949
953
  view: "multi",
950
- explorer: /* @__PURE__ */ M(mn, { mode: "multi", sourceId: m, currentPath: S, openPaths: w, onOpenDocument: u, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: g }),
951
- content: /* @__PURE__ */ M(It, { ref: P, store: r, body: Xn, limitNotice: O ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: L }),
954
+ explorer: /* @__PURE__ */ N(fn, { mode: "multi", sourceId: m, currentPath: S, openPaths: w, onOpenDocument: u, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: g }),
955
+ content: /* @__PURE__ */ N(Rt, { ref: P, store: r, body: Zn, limitNotice: O ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: A }),
952
956
  contentCoversPage: a !== null,
953
957
  sheetDismissals: d,
954
958
  onDraggingChange: r.setSplitDragging
@@ -956,8 +960,8 @@ const Tn = () => {
956
960
  );
957
961
  };
958
962
  export {
959
- Kt as MultiLayout,
963
+ Jt as MultiLayout,
960
964
  Dt as PANEL_LIMIT_NOTICE_MS,
961
965
  Me as latestOpenedDocument,
962
- Rt as treeSwitchDocument
966
+ _t as treeSwitchDocument
963
967
  };