react-resizable-panels 4.14.6 → 4.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as Y, jsxs as En } from "react/jsx-runtime";
3
- import { useId as Mn, useLayoutEffect as tn, useEffect as He, useRef as B, useCallback as re, createContext as nn, useContext as on, useState as ge, useMemo as Me, useImperativeHandle as mt, useSyncExternalStore as tt, Children as Pn, isValidElement as rn } from "react";
2
+ import { jsx as Y, jsxs as Mn } from "react/jsx-runtime";
3
+ import { useId as Pn, useLayoutEffect as en, useEffect as qe, useRef as B, useCallback as re, createContext as tn, useContext as nn, useState as ge, useMemo as Me, useImperativeHandle as ft, useSyncExternalStore as tt, Children as Tn, isValidElement as on } from "react";
4
4
  function et(e) {
5
5
  return (typeof e == "number" || typeof e == "string") && e !== "";
6
6
  }
7
- function Te(e) {
8
- const t = Mn();
7
+ function Pe(e) {
8
+ const t = Pn();
9
9
  return et(e) ? `${e}` : t;
10
10
  }
11
- const ne = typeof window < "u" ? tn : He;
11
+ const ne = typeof window < "u" ? en : qe;
12
12
  function Se(e) {
13
13
  const t = B(e);
14
14
  return ne(() => {
@@ -18,7 +18,7 @@ function Se(e) {
18
18
  [t]
19
19
  );
20
20
  }
21
- function Ve(...e) {
21
+ function He(...e) {
22
22
  return Se((t) => {
23
23
  e.forEach((n) => {
24
24
  if (n)
@@ -35,24 +35,24 @@ function Ve(...e) {
35
35
  });
36
36
  });
37
37
  }
38
- function je(e, t) {
38
+ function Ve(e, t) {
39
39
  const n = e?.["data-testid"];
40
40
  return et(n) ? `${n}` : et(t) ? `${t}` : void 0;
41
41
  }
42
42
  function lt(e, t) {
43
43
  return t ? e * 2 + 1 : e + 1;
44
44
  }
45
- function Tn(e, t) {
45
+ function $n(e, t) {
46
46
  return t ? e * 2 - 1 : e;
47
47
  }
48
- function Lt(e, t, n) {
48
+ function Ct(e, t, n) {
49
49
  const o = lt(e, n);
50
- return t === void 0 ? `${o} / -1` : `${o} / span ${Tn(t, n)}`;
50
+ return t === void 0 ? `${o} / -1` : `${o} / span ${$n(t, n)}`;
51
51
  }
52
- function Dn(e) {
52
+ function kn(e) {
53
53
  return `${e * 2} / span 1`;
54
54
  }
55
- function kn({
55
+ function An({
56
56
  crossCount: e,
57
57
  crossSpan: t,
58
58
  crossStart: n,
@@ -61,73 +61,73 @@ function kn({
61
61
  const r = t === void 0 ? e : n + t;
62
62
  if (n === 0 && r === e)
63
63
  return "1 / -1";
64
- let i = lt(n, o), a = lt(r - 1, o) + 1;
65
- return o && (n > 0 && i--, r < e && a++), `${i} / ${a}`;
64
+ let i = lt(n, o), s = lt(r - 1, o) + 1;
65
+ return o && (n > 0 && i--, r < e && s++), `${i} / ${s}`;
66
66
  }
67
- function pt(e, t) {
67
+ function mt(e, t) {
68
68
  return Number.isInteger(e) && e >= 1 && e < t;
69
69
  }
70
- function N(e, t = "Assertion error") {
70
+ function D(e, t = "Assertion error") {
71
71
  if (!e)
72
72
  throw Error(t);
73
73
  }
74
- const sn = nn(null);
75
- function an() {
76
- const e = on(sn);
77
- return N(
74
+ const rn = tn(null);
75
+ function sn() {
76
+ const e = nn(rn);
77
+ return D(
78
78
  e,
79
79
  "Grid Context not found; did you render a Cell or Gridline outside of a Grid?"
80
80
  ), e;
81
81
  }
82
- function An({
82
+ function Dn({
83
83
  children: e,
84
84
  className: t,
85
85
  column: n,
86
86
  columnSpan: o = 1,
87
87
  elementRef: r,
88
88
  id: i,
89
- row: a,
90
- rowSpan: c = 1,
91
- style: s,
92
- ...u
89
+ row: s,
90
+ rowSpan: a = 1,
91
+ style: u,
92
+ ...l
93
93
  }) {
94
- const l = Te(i), { gutters: d, registerCell: h } = an(), p = B(null), m = Ve(p, r);
94
+ const c = Pe(i), { gutters: d, registerCell: p } = sn(), g = B(null), f = He(g, r);
95
95
  return ne(() => {
96
- const f = p.current;
97
- if (f !== null)
98
- return h({
96
+ const m = g.current;
97
+ if (m !== null)
98
+ return p({
99
99
  column: n,
100
100
  columnSpan: o,
101
- element: f,
102
- id: l,
103
- row: a,
104
- rowSpan: c
101
+ element: m,
102
+ id: c,
103
+ row: s,
104
+ rowSpan: a
105
105
  });
106
- }, [n, o, l, h, a, c]), /* @__PURE__ */ Y(
106
+ }, [n, o, c, p, s, a]), /* @__PURE__ */ Y(
107
107
  "div",
108
108
  {
109
- ...u,
109
+ ...l,
110
110
  className: t,
111
111
  "data-cell": !0,
112
- "data-testid": je(u, i),
113
- id: l,
114
- ref: m,
112
+ "data-testid": Ve(l, i),
113
+ id: c,
114
+ ref: f,
115
115
  style: {
116
116
  overflow: "auto",
117
- ...s,
117
+ ...u,
118
118
  // Allow cells to shrink smaller than their content
119
119
  minHeight: 0,
120
120
  minWidth: 0,
121
- gridColumn: Lt(n, o, d.column),
122
- gridRow: Lt(a, c, d.row)
121
+ gridColumn: Ct(n, o, d.column),
122
+ gridRow: Ct(s, a, d.row)
123
123
  },
124
124
  children: e
125
125
  }
126
126
  );
127
127
  }
128
- An.displayName = "Cell";
128
+ Dn.displayName = "Cell";
129
129
  let Xe;
130
- function $n() {
130
+ function On() {
131
131
  return Xe === void 0 && (typeof matchMedia == "function" ? Xe = !!matchMedia("(pointer:coarse)").matches : Xe = !1), Xe;
132
132
  }
133
133
  function ut({
@@ -135,7 +135,7 @@ function ut({
135
135
  axis: t,
136
136
  rect: n
137
137
  }) {
138
- const o = e ? $n() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
138
+ const o = e ? On() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
139
139
  if (n.width < o) {
140
140
  const r = o - n.width;
141
141
  n = new DOMRect(
@@ -156,7 +156,7 @@ function ut({
156
156
  }
157
157
  return n;
158
158
  }
159
- function Ct({
159
+ function Rt({
160
160
  axis: e,
161
161
  cells: t,
162
162
  index: n,
@@ -164,111 +164,111 @@ function Ct({
164
164
  }) {
165
165
  let r = [o];
166
166
  for (const i of t) {
167
- const a = e === "column" ? i.column : i.row, c = e === "column" ? i.columnSpan : i.rowSpan;
168
- if (a >= n || a + c <= n)
167
+ const s = e === "column" ? i.column : i.row, a = e === "column" ? i.columnSpan : i.rowSpan;
168
+ if (s >= n || s + a <= n)
169
169
  continue;
170
- const s = i.element.getBoundingClientRect(), u = e === "column" ? s.top : s.left, l = e === "column" ? s.bottom : s.right;
171
- l <= u || (r = r.flatMap((d) => {
172
- const h = e === "column" ? d.top : d.left, p = e === "column" ? d.bottom : d.right;
173
- if (u >= p || l <= h)
170
+ const u = i.element.getBoundingClientRect(), l = e === "column" ? u.top : u.left, c = e === "column" ? u.bottom : u.right;
171
+ c <= l || (r = r.flatMap((d) => {
172
+ const p = e === "column" ? d.top : d.left, g = e === "column" ? d.bottom : d.right;
173
+ if (l >= g || c <= p)
174
174
  return [d];
175
- const m = [], f = (y, g) => {
176
- m.push(
177
- e === "column" ? new DOMRect(d.x, y, d.width, g - y) : new DOMRect(y, d.y, g - y, d.height)
175
+ const f = [], m = (h, S) => {
176
+ f.push(
177
+ e === "column" ? new DOMRect(d.x, h, d.width, S - h) : new DOMRect(h, d.y, S - h, d.height)
178
178
  );
179
179
  };
180
- return h < u && f(h, u), p > l && f(l, p), m;
180
+ return p < l && m(p, l), g > c && m(c, g), f;
181
181
  }));
182
182
  }
183
183
  return r;
184
184
  }
185
- function On({
185
+ function Nn({
186
186
  axis: e,
187
187
  cells: t,
188
188
  crossTrackCount: n,
189
189
  expandHitTargets: o,
190
190
  resizeAxis: r,
191
191
  axisSize: i,
192
- includeDisabled: a,
193
- separatorPlacements: c
192
+ includeDisabled: s,
193
+ separatorPlacements: a
194
194
  }) {
195
- const { items: s, separators: u } = r, l = s.length;
196
- let d = -1, h = -1, p = 0;
197
- if (s.forEach((x, w) => {
198
- x.constraintProps.disabled || (p++, d === -1 && (d = w), h = w);
199
- }), !a && p < 2)
195
+ const { items: u, separators: l } = r, c = u.length;
196
+ let d = -1, p = -1, g = 0;
197
+ if (u.forEach((w, x) => {
198
+ w.constraintProps.disabled || (g++, d === -1 && (d = x), p = x);
199
+ }), !s && g < 2)
200
200
  return [];
201
- const m = (x) => a || x > d && x <= h, f = [], y = (x, w, v) => ({
201
+ const f = (w) => s || w > d && w <= p, m = [], h = (w, x, v) => ({
202
202
  axis: r,
203
203
  axisSize: i,
204
- items: [s[x - 1], s[x]],
205
- rect: w,
204
+ items: [u[w - 1], u[w]],
205
+ rect: x,
206
206
  separator: v
207
- }), g = (x, w) => {
207
+ }), S = (w, x) => {
208
208
  let v;
209
209
  for (const M of t) {
210
210
  const k = e === "column" ? M.row : M.column, P = e === "column" ? M.rowSpan : M.columnSpan;
211
- if (w === "start" ? k === x : k + P - 1 === x) {
212
- const $ = M.element.getBoundingClientRect();
213
- if (w === "start") {
214
- const C = e === "column" ? $.top : $.left;
211
+ if (x === "start" ? k === w : k + P - 1 === w) {
212
+ const A = M.element.getBoundingClientRect();
213
+ if (x === "start") {
214
+ const C = e === "column" ? A.top : A.left;
215
215
  v = v === void 0 ? C : Math.min(v, C);
216
216
  } else {
217
- const C = e === "column" ? $.bottom : $.right;
217
+ const C = e === "column" ? A.bottom : A.right;
218
218
  v = v === void 0 ? C : Math.max(v, C);
219
219
  }
220
220
  }
221
221
  }
222
222
  return v;
223
- }, S = /* @__PURE__ */ new Set();
224
- for (const x of u) {
225
- const w = c.get(x);
226
- if (!w || w.index < 1 || w.index >= l || (S.add(w.index), !a && (x.disabled || x.element.hasAttribute("aria-disabled"))) || !m(w.index))
223
+ }, y = /* @__PURE__ */ new Set();
224
+ for (const w of l) {
225
+ const x = a.get(w);
226
+ if (!x || x.index < 1 || x.index >= c || (y.add(x.index), !s && (w.disabled || w.element.hasAttribute("aria-disabled"))) || !f(x.index))
227
227
  continue;
228
- let v = x.element.getBoundingClientRect();
229
- const { crossSpan: M, crossStart: k } = w, P = M === void 0 ? n : k + M;
230
- let $ = e === "column" ? v.top : v.left, C = e === "column" ? v.bottom : v.right;
228
+ let v = w.element.getBoundingClientRect();
229
+ const { crossSpan: M, crossStart: k } = x, P = M === void 0 ? n : k + M;
230
+ let A = e === "column" ? v.top : v.left, C = e === "column" ? v.bottom : v.right;
231
231
  if (k > 0) {
232
- const I = g(k - 1, "end");
233
- I !== void 0 && I < $ && ($ = I);
232
+ const I = S(k - 1, "end");
233
+ I !== void 0 && I < A && (A = I);
234
234
  }
235
235
  if (P < n) {
236
- const I = g(P, "start");
236
+ const I = S(P, "start");
237
237
  I !== void 0 && I > C && (C = I);
238
238
  }
239
- v = e === "column" ? new DOMRect(v.x, $, v.width, C - $) : new DOMRect($, v.y, C - $, v.height), v = ut({ expandHitTargets: o, axis: r, rect: v }), a ? f.push(y(w.index, v, x)) : Ct({
239
+ v = e === "column" ? new DOMRect(v.x, A, v.width, C - A) : new DOMRect(A, v.y, C - A, v.height), v = ut({ expandHitTargets: o, axis: r, rect: v }), s ? m.push(h(x.index, v, w)) : Rt({
240
240
  axis: e,
241
241
  cells: t,
242
- index: w.index,
242
+ index: x.index,
243
243
  rect: v
244
244
  }).forEach((I) => {
245
- f.push(y(w.index, I, x));
245
+ m.push(h(x.index, I, w));
246
246
  });
247
247
  }
248
- const z = (x, w) => {
249
- Ct({
248
+ const z = (w, x) => {
249
+ Rt({
250
250
  axis: e,
251
251
  cells: t,
252
- index: x,
253
- rect: ut({ expandHitTargets: o, axis: r, rect: w })
252
+ index: w,
253
+ rect: ut({ expandHitTargets: o, axis: r, rect: x })
254
254
  }).forEach((v) => {
255
- f.push(y(x, v));
255
+ m.push(h(w, v));
256
256
  });
257
257
  }, b = Array.from(
258
258
  { length: n },
259
- () => new Array(l)
259
+ () => new Array(c)
260
260
  );
261
- for (const x of t) {
262
- const [w, v, M, k] = e === "column" ? [x.column, x.columnSpan, x.row, x.rowSpan] : [x.row, x.rowSpan, x.column, x.columnSpan];
261
+ for (const w of t) {
262
+ const [x, v, M, k] = e === "column" ? [w.column, w.columnSpan, w.row, w.rowSpan] : [w.row, w.rowSpan, w.column, w.columnSpan];
263
263
  for (let P = Math.max(0, M); P < Math.min(n, M + k); P++)
264
- for (let $ = Math.max(0, w); $ < Math.min(l, w + v); $++)
265
- b[P][$] ??= x;
264
+ for (let A = Math.max(0, x); A < Math.min(c, x + v); A++)
265
+ b[P][A] ??= w;
266
266
  }
267
- const R = /* @__PURE__ */ new Map(), O = (x) => {
268
- let w = R.get(x);
269
- if (!w) {
270
- const v = x.element.getBoundingClientRect();
271
- w = e === "column" ? {
267
+ const E = /* @__PURE__ */ new Map(), F = (w) => {
268
+ let x = E.get(w);
269
+ if (!x) {
270
+ const v = w.element.getBoundingClientRect();
271
+ x = e === "column" ? {
272
272
  crossEnd: v.bottom,
273
273
  crossStart: v.top,
274
274
  end: v.right,
@@ -278,48 +278,48 @@ function On({
278
278
  crossStart: v.left,
279
279
  end: v.bottom,
280
280
  start: v.top
281
- }, R.set(x, w);
281
+ }, E.set(w, x);
282
282
  }
283
- return w;
284
- }, A = ({ crossEnd: x, crossStart: w, end: v, start: M }) => e === "column" ? new DOMRect(M, w, v - M, x - w) : new DOMRect(w, M, x - w, v - M);
285
- for (let x = 1; x < l; x++) {
286
- if (S.has(x) || !m(x))
283
+ return x;
284
+ }, N = ({ crossEnd: w, crossStart: x, end: v, start: M }) => e === "column" ? new DOMRect(M, x, v - M, w - x) : new DOMRect(x, M, w - x, v - M);
285
+ for (let w = 1; w < c; w++) {
286
+ if (y.has(w) || !f(w))
287
287
  continue;
288
- let w;
288
+ let x;
289
289
  for (let v = 0; v < n; v++) {
290
- const M = b[v][x - 1], k = b[v][x];
290
+ const M = b[v][w - 1], k = b[v][w];
291
291
  let P;
292
292
  if ((M || k) && M !== k) {
293
- const $ = M ? O(M) : void 0, C = k ? O(k) : void 0, I = $?.end ?? C.start, E = C?.start ?? $.end, q = Math.max(
294
- $?.crossStart ?? -1 / 0,
293
+ const A = M ? F(M) : void 0, C = k ? F(k) : void 0, I = A?.end ?? C.start, R = C?.start ?? A.end, q = Math.max(
294
+ A?.crossStart ?? -1 / 0,
295
295
  C?.crossStart ?? -1 / 0
296
- ), Z = Math.min(
297
- $?.crossEnd ?? 1 / 0,
296
+ ), K = Math.min(
297
+ A?.crossEnd ?? 1 / 0,
298
298
  C?.crossEnd ?? 1 / 0
299
299
  );
300
300
  P = {
301
- crossEnd: Math.max(q, Z),
301
+ crossEnd: Math.max(q, K),
302
302
  crossStart: q,
303
- end: Math.max(I, E),
304
- start: Math.min(I, E)
303
+ end: Math.max(I, R),
304
+ start: Math.min(I, R)
305
305
  };
306
306
  }
307
- P ? w = w ? {
308
- crossEnd: Math.max(w.crossEnd, P.crossEnd),
309
- crossStart: Math.min(w.crossStart, P.crossStart),
310
- end: Math.max(w.end, P.end),
311
- start: Math.min(w.start, P.start)
312
- } : P : w && (z(x, A(w)), w = void 0);
313
- }
314
- w && z(x, A(w));
307
+ P ? x = x ? {
308
+ crossEnd: Math.max(x.crossEnd, P.crossEnd),
309
+ crossStart: Math.min(x.crossStart, P.crossStart),
310
+ end: Math.max(x.end, P.end),
311
+ start: Math.min(x.start, P.start)
312
+ } : P : x && (z(w, N(x)), x = void 0);
313
+ }
314
+ x && z(w, N(x));
315
315
  }
316
- return f;
316
+ return m;
317
317
  }
318
318
  function le(e) {
319
319
  const t = parseFloat(e ?? "");
320
320
  return Number.isFinite(t) ? t : 0;
321
321
  }
322
- function Nn({
322
+ function Gn({
323
323
  axis: e,
324
324
  element: t,
325
325
  gutterSizes: n,
@@ -327,31 +327,31 @@ function Nn({
327
327
  layout: r,
328
328
  trackIds: i
329
329
  }) {
330
- const a = i.length, c = o ? a * 2 - 1 : a, s = t.ownerDocument.defaultView?.getComputedStyle(t), u = e === "column" ? s?.gridTemplateColumns : s?.gridTemplateRows;
331
- if (u) {
332
- const f = u.trim().split(/\s+/);
333
- if (f.length === c && f.every((y) => /^-?[\d.]+px$/.test(y))) {
334
- const y = i.map(
335
- (g, S) => le(f[o ? S * 2 : S])
330
+ const s = i.length, a = o ? s * 2 - 1 : s, u = t.ownerDocument.defaultView?.getComputedStyle(t), l = e === "column" ? u?.gridTemplateColumns : u?.gridTemplateRows;
331
+ if (l) {
332
+ const m = l.trim().split(/\s+/);
333
+ if (m.length === a && m.every((h) => /^-?[\d.]+px$/.test(h))) {
334
+ const h = i.map(
335
+ (S, y) => le(m[o ? y * 2 : y])
336
336
  );
337
337
  return {
338
- availableSize: y.reduce((g, S) => g + S, 0),
339
- trackSizes: y
338
+ availableSize: h.reduce((S, y) => S + y, 0),
339
+ trackSizes: h
340
340
  };
341
341
  }
342
342
  }
343
- const l = e === "column" ? t.offsetWidth : t.offsetHeight, d = e === "column" ? le(s?.paddingLeft) + le(s?.paddingRight) + le(s?.borderLeftWidth) + le(s?.borderRightWidth) : le(s?.paddingTop) + le(s?.paddingBottom) + le(s?.borderTopWidth) + le(s?.borderBottomWidth), h = le(e === "column" ? s?.columnGap : s?.rowGap), p = n.reduce((f, y) => f + y, 0), m = Math.max(
343
+ const c = e === "column" ? t.offsetWidth : t.offsetHeight, d = e === "column" ? le(u?.paddingLeft) + le(u?.paddingRight) + le(u?.borderLeftWidth) + le(u?.borderRightWidth) : le(u?.paddingTop) + le(u?.paddingBottom) + le(u?.borderTopWidth) + le(u?.borderBottomWidth), p = le(e === "column" ? u?.columnGap : u?.rowGap), g = n.reduce((m, h) => m + h, 0), f = Math.max(
344
344
  0,
345
- l - d - h * Math.max(0, c - 1) - p
345
+ c - d - p * Math.max(0, a - 1) - g
346
346
  );
347
347
  return {
348
- availableSize: m,
348
+ availableSize: f,
349
349
  trackSizes: i.map(
350
- (f) => r && r[f] !== void 0 ? r[f] / 100 * m : m / a
350
+ (m) => r && r[m] !== void 0 ? r[m] / 100 * f : f / s
351
351
  )
352
352
  };
353
353
  }
354
- function cn(e) {
354
+ function an(e) {
355
355
  switch (typeof e) {
356
356
  case "number":
357
357
  return [e, "px"];
@@ -361,7 +361,7 @@ function cn(e) {
361
361
  }
362
362
  }
363
363
  }
364
- class ln {
364
+ class cn {
365
365
  #e = {};
366
366
  addListener(t, n) {
367
367
  const o = this.#e[t];
@@ -378,12 +378,12 @@ class ln {
378
378
  }
379
379
  let r;
380
380
  const i = Array.from(o);
381
- for (let a = 0; a < i.length; a++) {
382
- const c = i[a];
381
+ for (let s = 0; s < i.length; s++) {
382
+ const a = i[s];
383
383
  try {
384
- c.call(null, n);
385
- } catch (s) {
386
- r ??= { error: s };
384
+ a.call(null, n);
385
+ } catch (u) {
386
+ r ??= { error: u };
387
387
  }
388
388
  }
389
389
  if (r)
@@ -405,16 +405,16 @@ let H = {
405
405
  cursorFlags: 0,
406
406
  state: "inactive"
407
407
  };
408
- const ht = new ln();
408
+ const pt = new cn();
409
409
  function ie() {
410
410
  return H;
411
411
  }
412
- function gt(e) {
413
- return ht.addListener("change", e);
412
+ function ht(e) {
413
+ return pt.addListener("change", e);
414
414
  }
415
- function Gn(e, t = [], n, o = !1) {
415
+ function Fn(e, t = [], n, o = !1) {
416
416
  const r = H, i = { ...H };
417
- i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), H = i, ht.emit("change", {
417
+ i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), H = i, pt.emit("change", {
418
418
  prev: r,
419
419
  next: i
420
420
  });
@@ -423,12 +423,12 @@ function fe(e) {
423
423
  const t = H;
424
424
  H = e, t.state === "active" && e.state !== "active" && t.didPointerMove && t.hitRegions.forEach(({ separator: n }) => {
425
425
  n && n.element.ownerDocument.activeElement === n.element && n.element.blur();
426
- }), ht.emit("change", {
426
+ }), pt.emit("change", {
427
427
  prev: t,
428
428
  next: e
429
429
  });
430
430
  }
431
- function Fn(e) {
431
+ function _n(e) {
432
432
  H.state !== "active" || !H.previews.some((t) => t.separator === e) || fe({
433
433
  ...H,
434
434
  previews: H.previews.map(
@@ -436,7 +436,7 @@ function Fn(e) {
436
436
  )
437
437
  });
438
438
  }
439
- function _n(e) {
439
+ function Bn(e) {
440
440
  if (H.state === "inactive")
441
441
  return;
442
442
  const t = H.hitRegions.filter((o) => o.axis !== e), n = H.state === "active" && H.previews.some((o) => o.axis === e);
@@ -456,13 +456,13 @@ function _n(e) {
456
456
  } else
457
457
  fe({ ...H, hitRegions: t });
458
458
  }
459
- const Bn = (e) => e, ct = () => {
460
- }, un = 1, dn = 2, fn = 4, mn = 8, Rt = 3, Et = 12;
459
+ const qn = (e) => e, ct = () => {
460
+ }, ln = 1, un = 2, dn = 4, fn = 8, Et = 3, Mt = 12;
461
461
  let Ke;
462
- function Mt() {
462
+ function Pt() {
463
463
  return Ke === void 0 && (Ke = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (Ke = !0)), Ke;
464
464
  }
465
- function qn({
465
+ function Hn({
466
466
  cursorFlags: e,
467
467
  axes: t,
468
468
  state: n
@@ -488,28 +488,28 @@ function qn({
488
488
  if (!(o === 0 && r === 0)) {
489
489
  switch (n) {
490
490
  case "active": {
491
- if (e && Mt()) {
492
- const i = (e & un) !== 0, a = (e & dn) !== 0, c = (e & fn) !== 0, s = (e & mn) !== 0;
491
+ if (e && Pt()) {
492
+ const i = (e & ln) !== 0, s = (e & un) !== 0, a = (e & dn) !== 0, u = (e & fn) !== 0;
493
493
  if (i)
494
- return c ? "se-resize" : s ? "ne-resize" : "e-resize";
494
+ return a ? "se-resize" : u ? "ne-resize" : "e-resize";
495
+ if (s)
496
+ return a ? "sw-resize" : u ? "nw-resize" : "w-resize";
495
497
  if (a)
496
- return c ? "sw-resize" : s ? "nw-resize" : "w-resize";
497
- if (c)
498
498
  return "s-resize";
499
- if (s)
499
+ if (u)
500
500
  return "n-resize";
501
501
  }
502
502
  break;
503
503
  }
504
504
  }
505
- return Mt() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
505
+ return Pt() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
506
506
  }
507
507
  }
508
- const Pt = /* @__PURE__ */ new WeakMap();
509
- function Tt(e) {
508
+ const Tt = /* @__PURE__ */ new WeakMap();
509
+ function $t(e) {
510
510
  if (!e.defaultView || !e.adoptedStyleSheets)
511
511
  return;
512
- let { prevStyle: t, styleSheet: n } = Pt.get(e) ?? {};
512
+ let { prevStyle: t, styleSheet: n } = Tt.get(e) ?? {};
513
513
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
514
514
  ...e.adoptedStyleSheets,
515
515
  n
@@ -518,9 +518,9 @@ function Tt(e) {
518
518
  switch (o.state !== "inactive" && o.ownerDocument !== e && (o = { cursorFlags: 0, state: "inactive" }), o.state) {
519
519
  case "active":
520
520
  case "hover": {
521
- const r = qn({
521
+ const r = Hn({
522
522
  cursorFlags: o.cursorFlags,
523
- axes: o.hitRegions.map((a) => a.axis),
523
+ axes: o.hitRegions.map((s) => s.axis),
524
524
  state: o.state
525
525
  }), i = `*, *:hover {cursor: ${r} !important; }`;
526
526
  if (t === i)
@@ -533,49 +533,49 @@ function Tt(e) {
533
533
  break;
534
534
  }
535
535
  }
536
- Pt.set(e, {
536
+ Tt.set(e, {
537
537
  prevStyle: t,
538
538
  styleSheet: n
539
539
  });
540
540
  }
541
- function Dt(e) {
541
+ function kt(e) {
542
542
  return e.state === "inactive" ? void 0 : e.ownerDocument;
543
543
  }
544
- function Hn({
544
+ function Vn({
545
545
  next: e,
546
546
  prev: t
547
547
  }) {
548
- const n = Dt(t), o = Dt(e);
549
- n && n !== o && Tt(n), o && Tt(o);
548
+ const n = kt(t), o = kt(e);
549
+ n && n !== o && $t(n), o && $t(o);
550
550
  }
551
- function Pe({
551
+ function je({
552
552
  axis: e
553
553
  }) {
554
554
  const { layoutStrategy: t, orientation: n, items: o } = e;
555
555
  return t ? t.calculateAvailableSize() : o.reduce((r, i) => (r += n === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r), 0);
556
556
  }
557
- function yt(e, t) {
557
+ function gt(e, t) {
558
558
  const n = e.compareDocumentPosition(t);
559
559
  return n & Node.DOCUMENT_POSITION_DISCONNECTED ? 0 : n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
560
560
  }
561
- function Ge(e, t) {
561
+ function Ne(e, t) {
562
562
  return Array.from(t).sort((n, o) => {
563
- const r = e === "horizontal" ? Vn(n, o) : jn(n, o);
564
- return r !== 0 ? r : yt(n.element, o.element);
563
+ const r = e === "horizontal" ? jn(n, o) : Un(n, o);
564
+ return r !== 0 ? r : gt(n.element, o.element);
565
565
  });
566
566
  }
567
- function Vn(e, t) {
567
+ function jn(e, t) {
568
568
  const n = e.element.offsetLeft - t.element.offsetLeft;
569
569
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
570
570
  }
571
- function jn(e, t) {
571
+ function Un(e, t) {
572
572
  const n = e.element.offsetTop - t.element.offsetTop;
573
573
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
574
574
  }
575
575
  function dt(e) {
576
576
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
577
577
  }
578
- function pn(e, t) {
578
+ function mn(e, t) {
579
579
  return {
580
580
  x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
581
581
  Math.abs(e.x - t.left),
@@ -587,7 +587,7 @@ function pn(e, t) {
587
587
  )
588
588
  };
589
589
  }
590
- function Un({
590
+ function Wn({
591
591
  orientation: e,
592
592
  rects: t,
593
593
  targetRect: n
@@ -597,13 +597,13 @@ function Un({
597
597
  y: n.y + n.height / 2
598
598
  };
599
599
  let r, i = Number.MAX_VALUE;
600
- for (const a of t) {
601
- const { x: c, y: s } = pn(o, a), u = e === "horizontal" ? c : s;
602
- u < i && (i = u, r = a);
600
+ for (const s of t) {
601
+ const { x: a, y: u } = mn(o, s), l = e === "horizontal" ? a : u;
602
+ l < i && (i = l, r = s);
603
603
  }
604
- return N(r, "No rect found"), r;
604
+ return D(r, "No rect found"), r;
605
605
  }
606
- function St({
606
+ function yt({
607
607
  expandHitTargets: e = !0,
608
608
  axis: t,
609
609
  includeDisabled: n = !1
@@ -614,30 +614,30 @@ function St({
614
614
  axis: t,
615
615
  includeDisabled: n
616
616
  });
617
- const { element: o, orientation: r, items: i, separators: a } = t, c = Ge(
617
+ const { element: o, orientation: r, items: i, separators: s } = t, a = Ne(
618
618
  r,
619
- Array.from(o.children).filter(dt).filter((g) => !g.hasAttribute("data-resize-preview")).map((g) => ({ element: g }))
620
- ).map(({ element: g }) => g), s = [];
621
- let u = !1, l = !1, d = -1, h, p = -1, m = 0, f, y = [];
619
+ Array.from(o.children).filter(dt).filter((S) => !S.hasAttribute("data-resize-preview")).map((S) => ({ element: S }))
620
+ ).map(({ element: S }) => S), u = [];
621
+ let l = !1, c = !1, d = -1, p, g = -1, f = 0, m, h = [];
622
622
  {
623
- let g = -1;
624
- for (const S of c)
625
- S.hasAttribute("data-panel") && (g++, S.hasAttribute("data-disabled") || (m++, d === -1 && (d = g), p = g));
623
+ let S = -1;
624
+ for (const y of a)
625
+ y.hasAttribute("data-panel") && (S++, y.hasAttribute("data-disabled") || (f++, d === -1 && (d = S), g = S));
626
626
  }
627
- if (n || m > 1) {
628
- let g = -1;
629
- for (const S of c)
630
- if (S.hasAttribute("data-panel")) {
631
- g++;
627
+ if (n || f > 1) {
628
+ let S = -1;
629
+ for (const y of a)
630
+ if (y.hasAttribute("data-panel")) {
631
+ S++;
632
632
  const z = i.find(
633
- (b) => b.element === S
633
+ (b) => b.element === y
634
634
  );
635
635
  if (z) {
636
- if (f) {
637
- const b = f.element.getBoundingClientRect(), R = S.getBoundingClientRect();
638
- let O;
639
- if (l) {
640
- const A = r === "horizontal" ? new DOMRect(
636
+ if (m) {
637
+ const b = m.element.getBoundingClientRect(), E = y.getBoundingClientRect();
638
+ let F;
639
+ if (c) {
640
+ const N = r === "horizontal" ? new DOMRect(
641
641
  b.right,
642
642
  b.top,
643
643
  0,
@@ -647,86 +647,86 @@ function St({
647
647
  b.bottom,
648
648
  b.width,
649
649
  0
650
- ), x = r === "horizontal" ? new DOMRect(R.left, R.top, 0, R.height) : new DOMRect(R.left, R.top, R.width, 0);
651
- switch (y.length) {
650
+ ), w = r === "horizontal" ? new DOMRect(E.left, E.top, 0, E.height) : new DOMRect(E.left, E.top, E.width, 0);
651
+ switch (h.length) {
652
652
  case 0: {
653
- O = [
654
- A,
655
- x
653
+ F = [
654
+ N,
655
+ w
656
656
  ];
657
657
  break;
658
658
  }
659
659
  case 1: {
660
- const w = y[0], v = Un({
660
+ const x = h[0], v = Wn({
661
661
  orientation: r,
662
- rects: [b, R],
663
- targetRect: w.element.getBoundingClientRect()
662
+ rects: [b, E],
663
+ targetRect: x.element.getBoundingClientRect()
664
664
  });
665
- O = [
666
- w,
667
- v === b ? x : A
665
+ F = [
666
+ x,
667
+ v === b ? w : N
668
668
  ];
669
669
  break;
670
670
  }
671
671
  default: {
672
- O = y;
672
+ F = h;
673
673
  break;
674
674
  }
675
675
  }
676
676
  } else
677
- y.length ? O = y : O = [
677
+ h.length ? F = h : F = [
678
678
  r === "horizontal" ? new DOMRect(
679
679
  b.right,
680
- R.top,
681
- R.left - b.right,
682
- R.height
680
+ E.top,
681
+ E.left - b.right,
682
+ E.height
683
683
  ) : new DOMRect(
684
- R.left,
684
+ E.left,
685
685
  b.bottom,
686
- R.width,
687
- R.top - b.bottom
686
+ E.width,
687
+ E.top - b.bottom
688
688
  )
689
689
  ];
690
- for (const A of O) {
691
- const x = ut({
690
+ for (const N of F) {
691
+ const w = ut({
692
692
  expandHitTargets: e,
693
693
  axis: t,
694
- rect: "width" in A ? A : A.element.getBoundingClientRect()
695
- }), w = g <= d || g > p;
696
- (n || !u && !w) && (h ??= Pe({ axis: t }), s.push({
694
+ rect: "width" in N ? N : N.element.getBoundingClientRect()
695
+ }), x = S <= d || S > g;
696
+ (n || !l && !x) && (p ??= je({ axis: t }), u.push({
697
697
  axis: t,
698
- axisSize: h,
699
- items: [f, z],
700
- separator: "width" in A ? void 0 : A,
701
- rect: x
702
- })), u = !1;
698
+ axisSize: p,
699
+ items: [m, z],
700
+ separator: "width" in N ? void 0 : N,
701
+ rect: w
702
+ })), l = !1;
703
703
  }
704
704
  }
705
- l = !1, f = z, y = [];
705
+ c = !1, m = z, h = [];
706
706
  }
707
- } else if (S.hasAttribute("data-separator")) {
708
- S.ariaDisabled !== null && (u = !0);
709
- const z = a.find(
710
- (b) => b.element === S
707
+ } else if (y.hasAttribute("data-separator")) {
708
+ y.ariaDisabled !== null && (l = !0);
709
+ const z = s.find(
710
+ (b) => b.element === y
711
711
  );
712
- z ? y.push(z) : (f = void 0, y = []);
712
+ z ? h.push(z) : (m = void 0, h = []);
713
713
  } else
714
- l = !0;
714
+ c = !0;
715
715
  }
716
- return s;
716
+ return u;
717
717
  }
718
- function Wn(e, t) {
718
+ function Yn(e, t) {
719
719
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
720
720
  return t * o;
721
721
  }
722
- function Yn(e, t) {
722
+ function Xn(e, t) {
723
723
  const n = getComputedStyle(e.ownerDocument.documentElement), o = parseFloat(n.fontSize);
724
724
  return t * o;
725
725
  }
726
- function Xn(e) {
726
+ function Kn(e) {
727
727
  return e / 100 * window.innerHeight;
728
728
  }
729
- function Kn(e) {
729
+ function Jn(e) {
730
730
  return e / 100 * window.innerWidth;
731
731
  }
732
732
  function Le({
@@ -735,7 +735,7 @@ function Le({
735
735
  styleProp: n
736
736
  }) {
737
737
  let o;
738
- const [r, i] = cn(n);
738
+ const [r, i] = an(n);
739
739
  switch (i) {
740
740
  case "%": {
741
741
  o = r / 100 * e;
@@ -746,30 +746,30 @@ function Le({
746
746
  break;
747
747
  }
748
748
  case "rem": {
749
- o = Yn(t, r);
749
+ o = Xn(t, r);
750
750
  break;
751
751
  }
752
752
  case "em": {
753
- o = Wn(t, r);
753
+ o = Yn(t, r);
754
754
  break;
755
755
  }
756
756
  case "vh": {
757
- o = Xn(r);
757
+ o = Kn(r);
758
758
  break;
759
759
  }
760
760
  case "vw": {
761
- o = Kn(r);
761
+ o = Jn(r);
762
762
  break;
763
763
  }
764
764
  }
765
765
  return o;
766
766
  }
767
- function J(e) {
767
+ function Z(e) {
768
768
  return parseFloat(e.toFixed(3));
769
769
  }
770
- function ft(e) {
771
- const { items: t } = e, n = Pe({ axis: e });
772
- return n === 0 ? t.map((o) => ({
770
+ function St(e, t = je({ axis: e })) {
771
+ const { items: n } = e;
772
+ return t === 0 ? n.map((o) => ({
773
773
  groupResizeBehavior: o.constraintProps.groupResizeBehavior,
774
774
  collapsedSize: 0,
775
775
  collapsible: o.constraintProps.collapsible === !0,
@@ -778,73 +778,73 @@ function ft(e) {
778
778
  minSize: 0,
779
779
  maxSize: 100,
780
780
  itemId: o.id
781
- })) : t.map((o) => {
781
+ })) : n.map((o) => {
782
782
  const { element: r, constraintProps: i } = o;
783
- let a = 0;
783
+ let s = 0;
784
784
  if (i.collapsedSize !== void 0) {
785
785
  const d = Le({
786
- axisSize: n,
786
+ axisSize: t,
787
787
  itemElement: r,
788
788
  styleProp: i.collapsedSize
789
789
  });
790
- a = J(d / n * 100);
790
+ s = Z(d / t * 100);
791
791
  }
792
- let c;
792
+ let a;
793
793
  if (i.collapsedThreshold !== void 0) {
794
794
  const d = Le({
795
- axisSize: n,
795
+ axisSize: t,
796
796
  itemElement: r,
797
797
  styleProp: i.collapsedThreshold
798
798
  });
799
- c = J(d / n * 100);
799
+ a = Z(d / t * 100);
800
800
  }
801
- let s;
801
+ let u;
802
802
  if (i.defaultSize !== void 0) {
803
803
  const d = Le({
804
- axisSize: n,
804
+ axisSize: t,
805
805
  itemElement: r,
806
806
  styleProp: i.defaultSize
807
807
  });
808
- s = J(d / n * 100);
808
+ u = Z(d / t * 100);
809
809
  }
810
- let u = 0;
810
+ let l = 0;
811
811
  if (i.minSize !== void 0) {
812
812
  const d = Le({
813
- axisSize: n,
813
+ axisSize: t,
814
814
  itemElement: r,
815
815
  styleProp: i.minSize
816
816
  });
817
- u = J(d / n * 100);
817
+ l = Z(d / t * 100);
818
818
  }
819
- let l = 100;
819
+ let c = 100;
820
820
  if (i.maxSize !== void 0) {
821
821
  const d = Le({
822
- axisSize: n,
822
+ axisSize: t,
823
823
  itemElement: r,
824
824
  styleProp: i.maxSize
825
825
  });
826
- l = J(d / n * 100);
826
+ c = Z(d / t * 100);
827
827
  }
828
828
  return {
829
829
  groupResizeBehavior: i.groupResizeBehavior,
830
- collapsedSize: a,
831
- collapsedThreshold: c,
830
+ collapsedSize: s,
831
+ collapsedThreshold: a,
832
832
  collapsible: i.collapsible === !0,
833
- defaultSize: s,
833
+ defaultSize: u,
834
834
  disabled: i.disabled,
835
- minSize: u,
836
- maxSize: l,
835
+ minSize: l,
836
+ maxSize: c,
837
837
  itemId: o.id
838
838
  };
839
839
  });
840
840
  }
841
841
  let de = /* @__PURE__ */ new Map();
842
- const vt = new ln();
843
- let Fe = 0;
842
+ const vt = new cn();
843
+ let Ge = 0;
844
844
  const Je = [];
845
845
  let Ze;
846
846
  function nt() {
847
- Fe++;
847
+ Ge++;
848
848
  }
849
849
  function bt() {
850
850
  for (let e = 0; e < Je.length; e++)
@@ -856,12 +856,12 @@ function bt() {
856
856
  Je.length = 0;
857
857
  }
858
858
  function ot() {
859
- if (Fe === 1 && bt(), Fe--, Fe === 0 && Ze) {
859
+ if (Ge === 1 && bt(), Ge--, Ge === 0 && Ze) {
860
860
  const { error: e } = Ze;
861
861
  throw Ze = void 0, e;
862
862
  }
863
863
  }
864
- function Jn(e) {
864
+ function Zn(e) {
865
865
  de = new Map(de), de.delete(e);
866
866
  }
867
867
  function Re(e, t) {
@@ -879,7 +879,7 @@ function ce(e, t) {
879
879
  function ye() {
880
880
  return de;
881
881
  }
882
- function Be(e, t) {
882
+ function _e(e, t) {
883
883
  return vt.addListener("axisChange", (n) => {
884
884
  n.axis.id === e && t(n);
885
885
  });
@@ -893,16 +893,16 @@ function me(e, t, n) {
893
893
  prev: o,
894
894
  next: t
895
895
  };
896
- Fe > 0 ? Je.push(r) : vt.emit("axisChange", r);
896
+ Ge > 0 ? Je.push(r) : vt.emit("axisChange", r);
897
897
  }
898
- function hn(e, { pointerId: t, pointerType: n }) {
898
+ function pn(e, { pointerId: t, pointerType: n }) {
899
899
  return t === e.pointerId || // There is only one pen, but it may be assigned a new pointerId each time it comes into range
900
900
  n === "pen" && e.pointerType === "pen";
901
901
  }
902
902
  function rt(e, t, n = {}) {
903
- return e.ownerDocument === t && (n.pointerId === void 0 || hn(e, n));
903
+ return e.ownerDocument === t && (n.pointerId === void 0 || pn(e, n));
904
904
  }
905
- function Zn(e, t) {
905
+ function Qn(e, t) {
906
906
  if (e.length !== t.length)
907
907
  return !1;
908
908
  for (let n = 0; n < e.length; n++)
@@ -911,7 +911,7 @@ function Zn(e, t) {
911
911
  return !0;
912
912
  }
913
913
  function W(e, t, n = 0) {
914
- return Math.abs(J(e) - J(t)) <= n;
914
+ return Math.abs(Z(e) - Z(t)) <= n;
915
915
  }
916
916
  function ue(e, t) {
917
917
  return W(e, t) ? 0 : e > t ? 1 : -1;
@@ -925,22 +925,22 @@ function Ee({
925
925
  const {
926
926
  collapsedSize: r = 0,
927
927
  collapsedThreshold: i,
928
- collapsible: a,
929
- disabled: c,
930
- maxSize: s = 100,
931
- minSize: u = 0
928
+ collapsible: s,
929
+ disabled: a,
930
+ maxSize: u = 100,
931
+ minSize: l = 0
932
932
  } = t;
933
- if (c && !e)
933
+ if (a && !e)
934
934
  return n;
935
- if (ue(o, u) < 0)
936
- if (a) {
937
- const l = i ?? (u - r) / 2, d = ue(n, r) <= 0, h = d ? r + l : u - l, p = ue(o, h);
938
- ue(o, r) <= 0 || p < 0 || i !== void 0 && d && p === 0 ? o = r : o = u;
935
+ if (ue(o, l) < 0)
936
+ if (s) {
937
+ const c = i ?? (l - r) / 2, d = ue(n, r) <= 0, p = d ? r + c : l - c, g = ue(o, p);
938
+ ue(o, r) <= 0 || g < 0 || i !== void 0 && d && g === 0 ? o = r : o = l;
939
939
  } else
940
- o = u;
941
- return o = Math.min(s, o), o = J(o), o;
940
+ o = l;
941
+ return o = Math.min(u, o), o = Z(o), o;
942
942
  }
943
- function qe({
943
+ function Be({
944
944
  delta: e,
945
945
  initialLayout: t,
946
946
  itemConstraints: n,
@@ -950,55 +950,55 @@ function qe({
950
950
  }) {
951
951
  if (W(e, 0))
952
952
  return t;
953
- const a = i === "imperative-api", c = n.map(
954
- ({ itemId: m }) => t[m]
955
- ), s = n.map(
956
- ({ itemId: m }) => r[m]
957
- ), u = [...c], [l, d] = o;
958
- N(l != null, "Invalid first pivot index"), N(d != null, "Invalid second pivot index");
959
- let h = 0;
953
+ const s = i === "imperative-api", a = n.map(
954
+ ({ itemId: f }) => t[f]
955
+ ), u = n.map(
956
+ ({ itemId: f }) => r[f]
957
+ ), l = [...a], [c, d] = o;
958
+ D(c != null, "Invalid first pivot index"), D(d != null, "Invalid second pivot index");
959
+ let p = 0;
960
960
  switch (i) {
961
961
  case "keyboard": {
962
962
  {
963
- const m = e < 0 ? d : l, f = n[m];
964
- N(
965
- f,
966
- `Panel constraints not found for index ${m}`
963
+ const f = e < 0 ? d : c, m = n[f];
964
+ D(
965
+ m,
966
+ `Panel constraints not found for index ${f}`
967
967
  );
968
968
  const {
969
- collapsedSize: y = 0,
970
- collapsible: g,
971
- minSize: S = 0
972
- } = f;
973
- if (g) {
974
- const z = c[m];
975
- if (N(
969
+ collapsedSize: h = 0,
970
+ collapsible: S,
971
+ minSize: y = 0
972
+ } = m;
973
+ if (S) {
974
+ const z = a[f];
975
+ if (D(
976
976
  z != null,
977
- `Previous layout not found for panel index ${m}`
978
- ), W(z, y)) {
979
- const b = S - z;
977
+ `Previous layout not found for panel index ${f}`
978
+ ), W(z, h)) {
979
+ const b = y - z;
980
980
  ue(b, Math.abs(e)) > 0 && (e = e < 0 ? 0 - b : b);
981
981
  }
982
982
  }
983
983
  }
984
984
  {
985
- const m = e < 0 ? l : d, f = n[m];
986
- N(
987
- f,
988
- `No panel constraints found for index ${m}`
985
+ const f = e < 0 ? c : d, m = n[f];
986
+ D(
987
+ m,
988
+ `No panel constraints found for index ${f}`
989
989
  );
990
990
  const {
991
- collapsedSize: y = 0,
992
- collapsible: g,
993
- minSize: S = 0
994
- } = f;
995
- if (g) {
996
- const z = c[m];
997
- if (N(
991
+ collapsedSize: h = 0,
992
+ collapsible: S,
993
+ minSize: y = 0
994
+ } = m;
995
+ if (S) {
996
+ const z = a[f];
997
+ if (D(
998
998
  z != null,
999
- `Previous layout not found for panel index ${m}`
1000
- ), W(z, S)) {
1001
- const b = z - y;
999
+ `Previous layout not found for panel index ${f}`
1000
+ ), W(z, y)) {
1001
+ const b = z - h;
1002
1002
  ue(b, Math.abs(e)) > 0 && (e = e < 0 ? 0 - b : b);
1003
1003
  }
1004
1004
  }
@@ -1006,103 +1006,103 @@ function qe({
1006
1006
  break;
1007
1007
  }
1008
1008
  default: {
1009
- const m = e < 0 ? d : l, f = n[m];
1010
- N(
1011
- f,
1012
- `Panel constraints not found for index ${m}`
1009
+ const f = e < 0 ? d : c, m = n[f];
1010
+ D(
1011
+ m,
1012
+ `Panel constraints not found for index ${f}`
1013
1013
  );
1014
- const y = c[m], { collapsedSize: g, collapsedThreshold: S, collapsible: z, minSize: b } = f;
1015
- if (z && ue(y, b) < 0) {
1016
- const R = b - g, O = S ?? R / 2, A = y + Math.abs(e);
1017
- if (ue(A, b) < 0) {
1018
- const x = ue(Math.abs(e), O), w = S === void 0 && e < 0;
1019
- x > 0 || x === 0 && w ? e = e < 0 ? -R : R : e = 0;
1014
+ const h = a[f], { collapsedSize: S, collapsedThreshold: y, collapsible: z, minSize: b } = m;
1015
+ if (z && ue(h, b) < 0) {
1016
+ const E = b - S, F = y ?? E / 2, N = h + Math.abs(e);
1017
+ if (ue(N, b) < 0) {
1018
+ const w = ue(Math.abs(e), F), x = y === void 0 && e < 0;
1019
+ w > 0 || w === 0 && x ? e = e < 0 ? -E : E : e = 0;
1020
1020
  }
1021
1021
  }
1022
1022
  break;
1023
1023
  }
1024
1024
  }
1025
1025
  {
1026
- const m = e < 0 ? 1 : -1;
1027
- let f = e < 0 ? d : l, y = 0;
1026
+ const f = e < 0 ? 1 : -1;
1027
+ let m = e < 0 ? d : c, h = 0;
1028
1028
  for (; ; ) {
1029
- const S = c[f];
1030
- N(
1031
- S != null,
1032
- `Previous layout not found for panel index ${f}`
1029
+ const y = a[m];
1030
+ D(
1031
+ y != null,
1032
+ `Previous layout not found for panel index ${m}`
1033
1033
  );
1034
1034
  const b = Ee({
1035
- overrideDisabledItems: a,
1036
- itemConstraints: n[f],
1037
- prevSize: S,
1035
+ overrideDisabledItems: s,
1036
+ itemConstraints: n[m],
1037
+ prevSize: y,
1038
1038
  size: 100
1039
- }) - S;
1040
- if (y += b, f += m, f < 0 || f >= n.length)
1039
+ }) - y;
1040
+ if (h += b, m += f, m < 0 || m >= n.length)
1041
1041
  break;
1042
1042
  }
1043
- const g = Math.min(Math.abs(e), Math.abs(y));
1044
- e = e < 0 ? 0 - g : g;
1043
+ const S = Math.min(Math.abs(e), Math.abs(h));
1044
+ e = e < 0 ? 0 - S : S;
1045
1045
  }
1046
1046
  {
1047
- let f = e < 0 ? l : d;
1048
- for (; f >= 0 && f < n.length; ) {
1049
- const y = Math.abs(e) - Math.abs(h), g = c[f];
1050
- N(
1051
- g != null,
1052
- `Previous layout not found for panel index ${f}`
1047
+ let m = e < 0 ? c : d;
1048
+ for (; m >= 0 && m < n.length; ) {
1049
+ const h = Math.abs(e) - Math.abs(p), S = a[m];
1050
+ D(
1051
+ S != null,
1052
+ `Previous layout not found for panel index ${m}`
1053
1053
  );
1054
- const S = g - y, z = Ee({
1055
- overrideDisabledItems: a,
1056
- itemConstraints: n[f],
1057
- prevSize: g,
1058
- size: S
1054
+ const y = S - h, z = Ee({
1055
+ overrideDisabledItems: s,
1056
+ itemConstraints: n[m],
1057
+ prevSize: S,
1058
+ size: y
1059
1059
  });
1060
- if (!W(g, z) && (h += g - z, u[f] = z, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
1060
+ if (!W(S, z) && (p += S - z, l[m] = z, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
1061
1061
  numeric: !0
1062
1062
  }) >= 0))
1063
1063
  break;
1064
- e < 0 ? f-- : f++;
1064
+ e < 0 ? m-- : m++;
1065
1065
  }
1066
1066
  }
1067
- if (Zn(s, u))
1067
+ if (Qn(u, l))
1068
1068
  return r;
1069
1069
  {
1070
- const m = e < 0 ? d : l, f = c[m];
1071
- N(
1072
- f != null,
1073
- `Previous layout not found for panel index ${m}`
1070
+ const f = e < 0 ? d : c, m = a[f];
1071
+ D(
1072
+ m != null,
1073
+ `Previous layout not found for panel index ${f}`
1074
1074
  );
1075
- const y = f + h, g = Ee({
1076
- overrideDisabledItems: a,
1077
- itemConstraints: n[m],
1078
- prevSize: f,
1079
- size: y
1075
+ const h = m + p, S = Ee({
1076
+ overrideDisabledItems: s,
1077
+ itemConstraints: n[f],
1078
+ prevSize: m,
1079
+ size: h
1080
1080
  });
1081
- if (u[m] = g, !W(g, y)) {
1082
- let S = y - g, b = e < 0 ? d : l;
1081
+ if (l[f] = S, !W(S, h)) {
1082
+ let y = h - S, b = e < 0 ? d : c;
1083
1083
  for (; b >= 0 && b < n.length; ) {
1084
- const R = u[b];
1085
- N(
1086
- R != null,
1084
+ const E = l[b];
1085
+ D(
1086
+ E != null,
1087
1087
  `Previous layout not found for panel index ${b}`
1088
1088
  );
1089
- const O = R + S, A = Ee({
1090
- overrideDisabledItems: a,
1089
+ const F = E + y, N = Ee({
1090
+ overrideDisabledItems: s,
1091
1091
  itemConstraints: n[b],
1092
- prevSize: R,
1093
- size: O
1092
+ prevSize: E,
1093
+ size: F
1094
1094
  });
1095
- if (W(R, A) || (S -= A - R, u[b] = A), W(S, 0))
1095
+ if (W(E, N) || (y -= N - E, l[b] = N), W(y, 0))
1096
1096
  break;
1097
1097
  e > 0 ? b-- : b++;
1098
1098
  }
1099
1099
  }
1100
1100
  }
1101
- const p = Object.values(u).reduce(
1102
- (m, f) => f + m,
1101
+ const g = Object.values(l).reduce(
1102
+ (f, m) => m + f,
1103
1103
  0
1104
1104
  );
1105
- return W(p, 100, 0.1) ? u.reduce((m, f, y) => (m[n[y].itemId] = f, m), {}) : r;
1105
+ return W(g, 100, 0.1) ? l.reduce((f, m, h) => (f[n[h].itemId] = m, f), {}) : r;
1106
1106
  }
1107
1107
  function se(e, t) {
1108
1108
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -1112,101 +1112,101 @@ function se(e, t) {
1112
1112
  return !1;
1113
1113
  return !0;
1114
1114
  }
1115
- function xt(e) {
1115
+ function wt(e) {
1116
1116
  nt();
1117
1117
  try {
1118
- Qn(e);
1118
+ eo(e);
1119
1119
  } finally {
1120
1120
  ot();
1121
1121
  }
1122
1122
  }
1123
- function Qn({
1123
+ function eo({
1124
1124
  commit: e,
1125
1125
  event: t,
1126
1126
  hitRegions: n,
1127
1127
  initialLayoutMap: o,
1128
1128
  mountedAxes: r,
1129
1129
  pointerDownAtPoint: i,
1130
- prevCursorFlags: a
1130
+ prevCursorFlags: s
1131
1131
  }) {
1132
- let c = 0;
1133
- const s = ie();
1134
- let u = s.state === "active" ? s.previews : [];
1135
- const l = new Map(
1136
- s.state === "active" ? s.previewLayoutMap : void 0
1132
+ let a = 0;
1133
+ const u = ie();
1134
+ let l = u.state === "active" ? u.previews : [];
1135
+ const c = new Map(
1136
+ u.state === "active" ? u.previewLayoutMap : void 0
1137
1137
  );
1138
- n.forEach((p) => {
1139
- const { axis: m, axisSize: f } = p, { orientation: y, items: g } = m;
1140
- if (e && m.resizePreviewMode !== "separator")
1138
+ n.forEach((g) => {
1139
+ const { axis: f, axisSize: m } = g, { orientation: h, items: S } = f;
1140
+ if (e && f.resizePreviewMode !== "separator")
1141
1141
  return;
1142
- const { disableCursor: S } = m.mutableState;
1142
+ const { disableCursor: y } = f.mutableState;
1143
1143
  let z = 0;
1144
- i ? y === "horizontal" ? z = (t.clientX - i.x) / f * 100 : z = (t.clientY - i.y) / f * 100 : y === "horizontal" ? z = t.clientX < 0 ? -100 : 100 : z = t.clientY < 0 ? -100 : 100;
1145
- const b = o.get(m), R = r.get(m);
1146
- if (!b || !R)
1144
+ i ? h === "horizontal" ? z = (t.clientX - i.x) / m * 100 : z = (t.clientY - i.y) / m * 100 : h === "horizontal" ? z = t.clientX < 0 ? -100 : 100 : z = t.clientY < 0 ? -100 : 100;
1145
+ const b = o.get(f), E = r.get(f);
1146
+ if (!b || !E)
1147
1147
  return;
1148
1148
  const {
1149
- defaultLayoutDeferred: O,
1150
- derivedItemConstraints: A,
1151
- axisSize: x,
1152
- layout: w,
1149
+ defaultLayoutDeferred: F,
1150
+ derivedItemConstraints: N,
1151
+ axisSize: w,
1152
+ layout: x,
1153
1153
  separatorToItems: v
1154
- } = R;
1155
- if (A && w && v) {
1156
- const M = m.resizePreviewMode === "separator" ? l.get(m) ?? w : w, k = qe({
1154
+ } = E;
1155
+ if (N && x && v) {
1156
+ const M = f.resizePreviewMode === "separator" ? c.get(f) ?? x : x, k = Be({
1157
1157
  delta: z,
1158
1158
  initialLayout: b,
1159
- itemConstraints: A,
1160
- pivotIndices: p.items.map((P) => g.indexOf(P)),
1159
+ itemConstraints: N,
1160
+ pivotIndices: g.items.map((P) => S.indexOf(P)),
1161
1161
  prevLayout: M,
1162
1162
  trigger: "mouse-or-touch"
1163
1163
  });
1164
- if (m.resizePreviewMode === "separator" && !e && !se(k, M)) {
1165
- l.set(m, k);
1164
+ if (f.resizePreviewMode === "separator" && !e && !se(k, M)) {
1165
+ c.set(f, k);
1166
1166
  let P = 0;
1167
- const $ = g.map((C) => (P += k[C.id] - b[C.id], P * (f / 100)));
1168
- u = u.map((C) => {
1169
- if (C.axis !== m)
1167
+ const A = S.map((C) => (P += k[C.id] - b[C.id], P * (m / 100)));
1168
+ l = l.map((C) => {
1169
+ if (C.axis !== f)
1170
1170
  return C;
1171
- const I = $[C.itemIndex];
1171
+ const I = A[C.itemIndex];
1172
1172
  return I === C.offset ? C : { ...C, offset: I };
1173
1173
  });
1174
1174
  }
1175
- if (se(k, M) && z !== 0 && !S)
1176
- switch (y) {
1175
+ if (se(k, M) && z !== 0 && !y)
1176
+ switch (h) {
1177
1177
  case "horizontal": {
1178
- c |= z < 0 ? un : dn;
1178
+ a |= z < 0 ? ln : un;
1179
1179
  break;
1180
1180
  }
1181
1181
  case "vertical": {
1182
- c |= z < 0 ? fn : mn;
1182
+ a |= z < 0 ? dn : fn;
1183
1183
  break;
1184
1184
  }
1185
1185
  }
1186
- (m.resizePreviewMode !== "separator" || e) && !se(k, w) && me(p.axis, {
1187
- defaultLayoutDeferred: O,
1188
- derivedItemConstraints: A,
1189
- axisSize: x,
1186
+ (f.resizePreviewMode !== "separator" || e) && !se(k, x) && me(g.axis, {
1187
+ defaultLayoutDeferred: F,
1188
+ derivedItemConstraints: N,
1189
+ axisSize: w,
1190
1190
  layout: k,
1191
- requestedAxisSize: x,
1191
+ requestedAxisSize: w,
1192
1192
  requestedLayout: k,
1193
1193
  separatorToItems: v
1194
1194
  });
1195
1195
  }
1196
1196
  });
1197
1197
  let d = 0;
1198
- t.movementX === 0 ? d |= a & Rt : d |= c & Rt, t.movementY === 0 ? d |= a & Et : d |= c & Et;
1199
- const h = s.state === "active" && (t.clientX !== s.pointerDownAtPoint.x || t.clientY !== s.pointerDownAtPoint.y);
1200
- Gn(d, u, l, h);
1198
+ t.movementX === 0 ? d |= s & Et : d |= a & Et, t.movementY === 0 ? d |= s & Mt : d |= a & Mt;
1199
+ const p = u.state === "active" && (t.clientX !== u.pointerDownAtPoint.x || t.clientY !== u.pointerDownAtPoint.y);
1200
+ Fn(d, l, c, p);
1201
1201
  }
1202
- function gn(e, t) {
1202
+ function hn(e, t) {
1203
1203
  const n = ie();
1204
1204
  if (n.state !== "active" || !rt(n, e, t))
1205
1205
  return;
1206
1206
  const o = ye();
1207
1207
  nt();
1208
1208
  try {
1209
- xt({
1209
+ wt({
1210
1210
  commit: !0,
1211
1211
  event: t,
1212
1212
  hitRegions: n.hitRegions,
@@ -1229,31 +1229,31 @@ function gn(e, t) {
1229
1229
  ot();
1230
1230
  }
1231
1231
  }
1232
- function kt(e) {
1232
+ function At(e) {
1233
1233
  if (e.defaultPrevented)
1234
1234
  return;
1235
1235
  const { clientX: t, clientY: n, movementX: o, movementY: r } = e;
1236
- gn(e.currentTarget, {
1236
+ hn(e.currentTarget, {
1237
1237
  clientX: t,
1238
1238
  clientY: n,
1239
1239
  movementX: o,
1240
1240
  movementY: r
1241
1241
  });
1242
1242
  }
1243
- function eo(e, t, n) {
1243
+ function to(e, t, n) {
1244
1244
  let o, r = {
1245
1245
  x: 1 / 0,
1246
1246
  y: 1 / 0
1247
1247
  };
1248
1248
  for (const i of t) {
1249
- const a = pn(n, i.rect);
1249
+ const s = mn(n, i.rect);
1250
1250
  switch (e) {
1251
1251
  case "horizontal": {
1252
- (a.x < r.x || a.x === r.x && a.y <= r.y) && (o = i, r = a);
1252
+ (s.x < r.x || s.x === r.x && s.y <= r.y) && (o = i, r = s);
1253
1253
  break;
1254
1254
  }
1255
1255
  case "vertical": {
1256
- (a.y < r.y || a.y === r.y && a.x <= r.x) && (o = i, r = a);
1256
+ (s.y < r.y || s.y === r.y && s.x <= r.x) && (o = i, r = s);
1257
1257
  break;
1258
1258
  }
1259
1259
  }
@@ -1263,304 +1263,443 @@ function eo(e, t, n) {
1263
1263
  hitRegion: o
1264
1264
  } : void 0;
1265
1265
  }
1266
- function to(e) {
1266
+ function no(e) {
1267
1267
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
1268
1268
  }
1269
- function no(e, t) {
1269
+ function oo(e, t) {
1270
1270
  if (e === t) throw new Error("Cannot compare node with itself");
1271
1271
  const n = {
1272
- a: Ot(e),
1273
- b: Ot(t)
1272
+ a: Nt(e),
1273
+ b: Nt(t)
1274
1274
  };
1275
1275
  let o;
1276
1276
  for (; n.a.at(-1) === n.b.at(-1); )
1277
1277
  o = n.a.pop(), n.b.pop();
1278
- N(
1278
+ D(
1279
1279
  o,
1280
1280
  "Stacking order can only be calculated for elements with a common ancestor"
1281
1281
  );
1282
1282
  const r = {
1283
- a: $t(At(n.a)),
1284
- b: $t(At(n.b))
1283
+ a: Ot(Dt(n.a)),
1284
+ b: Ot(Dt(n.b))
1285
1285
  };
1286
1286
  if (r.a === r.b) {
1287
- const i = o.childNodes, a = {
1287
+ const i = o.childNodes, s = {
1288
1288
  a: n.a.at(-1),
1289
1289
  b: n.b.at(-1)
1290
1290
  };
1291
- let c = i.length;
1292
- for (; c--; ) {
1293
- const s = i[c];
1294
- if (s === a.a) return 1;
1295
- if (s === a.b) return -1;
1291
+ let a = i.length;
1292
+ for (; a--; ) {
1293
+ const u = i[a];
1294
+ if (u === s.a) return 1;
1295
+ if (u === s.b) return -1;
1296
1296
  }
1297
1297
  }
1298
1298
  return Math.sign(r.a - r.b);
1299
1299
  }
1300
- const oo = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
1301
- function ro(e) {
1302
- const t = getComputedStyle(yn(e) ?? e).display;
1300
+ const ro = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
1301
+ function io(e) {
1302
+ const t = getComputedStyle(gn(e) ?? e).display;
1303
1303
  return t === "flex" || t === "inline-flex";
1304
1304
  }
1305
- function io(e) {
1305
+ function so(e) {
1306
1306
  const t = getComputedStyle(e);
1307
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ro(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || oo.test(t.willChange) || t.webkitOverflowScrolling === "touch");
1307
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || io(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || ro.test(t.willChange) || t.webkitOverflowScrolling === "touch");
1308
1308
  }
1309
- function At(e) {
1309
+ function Dt(e) {
1310
1310
  let t = e.length;
1311
1311
  for (; t--; ) {
1312
1312
  const n = e[t];
1313
- if (N(n, "Missing node"), io(n)) return n;
1313
+ if (D(n, "Missing node"), so(n)) return n;
1314
1314
  }
1315
1315
  return null;
1316
1316
  }
1317
- function $t(e) {
1317
+ function Ot(e) {
1318
1318
  return e && Number(getComputedStyle(e).zIndex) || 0;
1319
1319
  }
1320
- function Ot(e) {
1320
+ function Nt(e) {
1321
1321
  const t = [];
1322
1322
  for (; e; )
1323
- t.push(e), e = yn(e);
1323
+ t.push(e), e = gn(e);
1324
1324
  return t;
1325
1325
  }
1326
- function yn(e) {
1326
+ function gn(e) {
1327
1327
  const { parentNode: t } = e;
1328
- return to(t) ? t.host : t;
1328
+ return no(t) ? t.host : t;
1329
1329
  }
1330
- function so(e, t) {
1330
+ function ao(e, t) {
1331
1331
  return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
1332
1332
  }
1333
- function ao(e) {
1333
+ function co(e) {
1334
1334
  try {
1335
1335
  return e.matches(":modal");
1336
1336
  } catch {
1337
1337
  return !1;
1338
1338
  }
1339
1339
  }
1340
- function co({
1340
+ function lo({
1341
1341
  axisElement: e,
1342
1342
  hitRegion: t,
1343
1343
  pointerEventTarget: n
1344
1344
  }) {
1345
1345
  if (dt(n)) {
1346
1346
  const o = n.closest("dialog");
1347
- if (o && !o.contains(e) && ao(o))
1347
+ if (o && !o.contains(e) && co(o))
1348
1348
  return !1;
1349
1349
  }
1350
- if (!dt(n) || n.contains(e) || e.contains(n))
1350
+ if (!dt(n) || n.contains(e) || e.contains(n) || !n.isConnected || !e.isConnected)
1351
1351
  return !0;
1352
- if (no(n, e) > 0) {
1352
+ if (oo(n, e) > 0) {
1353
1353
  let o = n;
1354
1354
  for (; o; ) {
1355
1355
  if (o.contains(e))
1356
1356
  return !0;
1357
- if (so(o.getBoundingClientRect(), t))
1357
+ if (ao(o.getBoundingClientRect(), t))
1358
1358
  return !1;
1359
1359
  o = o.parentElement;
1360
1360
  }
1361
1361
  }
1362
1362
  return !0;
1363
1363
  }
1364
- function wt(e, t, n) {
1364
+ function xt(e, t, n) {
1365
1365
  const o = [];
1366
1366
  return t.forEach((r, i) => {
1367
1367
  if (i.disabled || i.element.ownerDocument !== n)
1368
1368
  return;
1369
- const a = St({ axis: i }), c = eo(i.orientation, a, {
1369
+ const s = yt({ axis: i }), a = to(i.orientation, s, {
1370
1370
  x: e.clientX,
1371
1371
  y: e.clientY
1372
1372
  });
1373
- c && c.distance.x <= 0 && c.distance.y <= 0 && co({
1373
+ a && a.distance.x <= 0 && a.distance.y <= 0 && lo({
1374
1374
  axisElement: i.element,
1375
- hitRegion: c.hitRegion.rect,
1375
+ hitRegion: a.hitRegion.rect,
1376
1376
  pointerEventTarget: e.target
1377
- }) && o.push(c.hitRegion);
1377
+ }) && o.push(a.hitRegion);
1378
1378
  }), o;
1379
1379
  }
1380
+ function uo(e) {
1381
+ let t = 0, n = 0;
1382
+ const o = {};
1383
+ for (const i of e)
1384
+ if (i.defaultSize !== void 0) {
1385
+ t++;
1386
+ const s = Z(i.defaultSize);
1387
+ n += s, o[i.itemId] = s;
1388
+ } else
1389
+ o[i.itemId] = void 0;
1390
+ const r = e.length - t;
1391
+ if (r !== 0) {
1392
+ const i = Z((100 - n) / r);
1393
+ for (const s of e)
1394
+ s.defaultSize === void 0 && (o[s.itemId] = i);
1395
+ }
1396
+ return o;
1397
+ }
1398
+ function fo(e, t) {
1399
+ const n = e.map((r) => r.id), o = Object.keys(t);
1400
+ if (n.length !== o.length)
1401
+ return !1;
1402
+ for (const r of n)
1403
+ if (!o.includes(r))
1404
+ return !1;
1405
+ return !0;
1406
+ }
1407
+ function yn({
1408
+ axis: e,
1409
+ itemConstraints: t
1410
+ }) {
1411
+ const n = e.items.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
1412
+ return e.mutableState.layouts[n] ?? (o && fo(e.items, o) ? o : uo(t));
1413
+ }
1414
+ function Sn(e, t) {
1415
+ if (Object.keys(e).length !== Object.keys(t).length)
1416
+ return !1;
1417
+ for (const o in e)
1418
+ if (e[o] !== t[o])
1419
+ return !1;
1420
+ return !0;
1421
+ }
1422
+ function mo(e, t) {
1423
+ return e.length !== t.length ? !1 : e.every((n, o) => Sn(n, t[o]));
1424
+ }
1380
1425
  function ve({
1381
1426
  layout: e,
1382
1427
  itemConstraints: t
1383
1428
  }) {
1384
- const n = t.map(({ itemId: a }) => e[a]), o = [...n], r = o.reduce(
1385
- (a, c) => a + c,
1429
+ const n = t.map(({ itemId: s }) => e[s]), o = [...n], r = o.reduce(
1430
+ (s, a) => s + a,
1386
1431
  0
1387
1432
  );
1388
1433
  if (Object.keys(e).length !== t.length)
1389
1434
  throw Error(
1390
- `Invalid ${t.length} panel layout: ${Object.values(e).map((a) => `${a}%`).join(", ")}`
1435
+ `Invalid ${t.length} panel layout: ${Object.values(e).map((s) => `${s}%`).join(", ")}`
1391
1436
  );
1392
1437
  if (!W(r, 100) && o.length > 0)
1393
- for (let a = 0; a < t.length; a++) {
1394
- const c = o[a];
1395
- N(c != null, `No layout data found for index ${a}`);
1396
- const s = 100 / r * c;
1397
- o[a] = s;
1438
+ for (let s = 0; s < t.length; s++) {
1439
+ const a = o[s];
1440
+ D(a != null, `No layout data found for index ${s}`);
1441
+ const u = 100 / r * a;
1442
+ o[s] = u;
1398
1443
  }
1399
1444
  let i = 0;
1400
- for (let a = 0; a < t.length; a++) {
1401
- const c = n[a];
1402
- N(c != null, `No layout data found for index ${a}`);
1403
- const s = o[a];
1404
- N(s != null, `No layout data found for index ${a}`);
1405
- const u = Ee({
1445
+ for (let s = 0; s < t.length; s++) {
1446
+ const a = n[s];
1447
+ D(a != null, `No layout data found for index ${s}`);
1448
+ const u = o[s];
1449
+ D(u != null, `No layout data found for index ${s}`);
1450
+ const l = Ee({
1406
1451
  overrideDisabledItems: !0,
1407
- itemConstraints: t[a],
1408
- prevSize: c,
1409
- size: s
1452
+ itemConstraints: t[s],
1453
+ prevSize: a,
1454
+ size: u
1410
1455
  });
1411
- s != u && (i += s - u, o[a] = u);
1456
+ u != l && (i += u - l, o[s] = l);
1412
1457
  }
1413
1458
  if (!W(i, 0))
1414
- for (let a = 0; a < t.length; a++) {
1415
- const c = o[a];
1416
- N(c != null, `No layout data found for index ${a}`);
1417
- const s = c + i, u = Ee({
1459
+ for (let s = 0; s < t.length; s++) {
1460
+ const a = o[s];
1461
+ D(a != null, `No layout data found for index ${s}`);
1462
+ const u = a + i, l = Ee({
1418
1463
  overrideDisabledItems: !0,
1419
- itemConstraints: t[a],
1420
- prevSize: c,
1421
- size: s
1464
+ itemConstraints: t[s],
1465
+ prevSize: a,
1466
+ size: u
1422
1467
  });
1423
- if (c !== u && (i -= u - c, o[a] = u, W(i, 0)))
1468
+ if (a !== l && (i -= l - a, o[s] = l, W(i, 0)))
1469
+ break;
1470
+ }
1471
+ return o.reduce((s, a, u) => (s[t[u].itemId] = a, s), {});
1472
+ }
1473
+ function vn({
1474
+ itemIds: e,
1475
+ layout: t
1476
+ }) {
1477
+ return ve({
1478
+ layout: t,
1479
+ itemConstraints: e.map((n) => ({
1480
+ collapsedSize: 0,
1481
+ collapsible: !1,
1482
+ defaultSize: void 0,
1483
+ disabled: void 0,
1484
+ itemId: n,
1485
+ maxSize: 100,
1486
+ minSize: 0
1487
+ }))
1488
+ });
1489
+ }
1490
+ function po({
1491
+ axis: e,
1492
+ nextAxisSize: t,
1493
+ prevAxisSize: n,
1494
+ prevLayout: o
1495
+ }) {
1496
+ if (n <= 0 || t <= 0 || n === t)
1497
+ return o;
1498
+ let r = 0, i = 0, s = !1;
1499
+ const a = /* @__PURE__ */ new Map(), u = [];
1500
+ for (const d of e.items) {
1501
+ const p = o[d.id] ?? 0;
1502
+ switch (d.constraintProps.groupResizeBehavior) {
1503
+ case "preserve-pixel-size": {
1504
+ s = !0;
1505
+ const g = p / 100 * n, f = Z(
1506
+ g / t * 100
1507
+ );
1508
+ a.set(d.id, f), r += f;
1424
1509
  break;
1510
+ }
1511
+ case "preserve-relative-size":
1512
+ default: {
1513
+ u.push(d.id), i += p;
1514
+ break;
1515
+ }
1425
1516
  }
1426
- return o.reduce((a, c, s) => (a[t[s].itemId] = c, a), {});
1517
+ }
1518
+ if (!s || u.length === 0)
1519
+ return o;
1520
+ const l = 100 - r, c = { ...o };
1521
+ if (a.forEach((d, p) => {
1522
+ c[p] = d;
1523
+ }), i > 0)
1524
+ for (const d of u) {
1525
+ const p = o[d] ?? 0;
1526
+ c[d] = Z(
1527
+ p / i * l
1528
+ );
1529
+ }
1530
+ else {
1531
+ const d = Z(l / u.length);
1532
+ for (const p of u)
1533
+ c[p] = d;
1534
+ }
1535
+ return c;
1427
1536
  }
1428
1537
  function zt({
1538
+ axis: e,
1539
+ axisState: t
1540
+ }) {
1541
+ const n = je({ axis: e });
1542
+ if (n === 0)
1543
+ return;
1544
+ const o = St(e, n);
1545
+ let r = t.requestedAxisSize, i = t.requestedLayout;
1546
+ t.defaultLayoutDeferred && (r = n, i = vn({
1547
+ itemIds: e.items.map(({ id: l }) => l),
1548
+ layout: yn({
1549
+ axis: e,
1550
+ itemConstraints: o
1551
+ })
1552
+ }));
1553
+ const s = po({
1554
+ axis: e,
1555
+ nextAxisSize: n,
1556
+ prevAxisSize: r,
1557
+ prevLayout: i
1558
+ }), a = ve({
1559
+ layout: s,
1560
+ itemConstraints: o
1561
+ });
1562
+ return {
1563
+ changed: t.defaultLayoutDeferred || !se(t.layout, a) || !mo(
1564
+ t.derivedItemConstraints,
1565
+ o
1566
+ ) || t.axisSize !== n,
1567
+ state: {
1568
+ defaultLayoutDeferred: !1,
1569
+ derivedItemConstraints: o,
1570
+ axisSize: n,
1571
+ layout: a,
1572
+ requestedAxisSize: r,
1573
+ requestedLayout: i,
1574
+ separatorToItems: t.separatorToItems
1575
+ }
1576
+ };
1577
+ }
1578
+ function It({
1429
1579
  axisId: e,
1430
1580
  itemId: t
1431
1581
  }) {
1432
1582
  const n = () => {
1433
- const s = ye();
1434
- for (const [
1435
- u,
1436
- {
1437
- defaultLayoutDeferred: l,
1438
- derivedItemConstraints: d,
1439
- layout: h,
1440
- axisSize: p,
1441
- separatorToItems: m
1442
- }
1443
- ] of s)
1444
- if (u.id === e)
1445
- return {
1446
- defaultLayoutDeferred: l,
1447
- derivedItemConstraints: d,
1448
- axis: u,
1449
- axisSize: p,
1450
- layout: h,
1451
- separatorToItems: m
1452
- };
1583
+ const l = ye();
1584
+ for (const [c, d] of l)
1585
+ if (c.id === e)
1586
+ return { axis: c, ...d };
1453
1587
  throw Error(`Group ${e} not found`);
1454
1588
  }, o = () => {
1455
- const s = n().derivedItemConstraints.find(
1456
- (u) => u.itemId === t
1589
+ const l = n().derivedItemConstraints.find(
1590
+ (c) => c.itemId === t
1457
1591
  );
1458
- if (s !== void 0)
1459
- return s;
1592
+ if (l !== void 0)
1593
+ return l;
1460
1594
  throw Error(`Panel constraints not found for Panel ${t}`);
1461
1595
  }, r = () => {
1462
- const s = n().axis.items.find((u) => u.id === t);
1463
- if (s !== void 0)
1464
- return s;
1465
- throw Error(`Layout not found for Panel ${t}`);
1596
+ const { axis: l, ...c } = n(), d = zt({ axis: l, axisState: c }), p = d?.state ?? c, g = p.derivedItemConstraints.find(
1597
+ (m) => m.itemId === t
1598
+ );
1599
+ if (g === void 0)
1600
+ throw Error(`Panel constraints not found for Panel ${t}`);
1601
+ const f = p.layout[t];
1602
+ if (f === void 0)
1603
+ throw Error(`Layout not found for Panel ${t}`);
1604
+ return {
1605
+ axis: l,
1606
+ changed: d?.changed === !0,
1607
+ itemConstraints: g,
1608
+ itemSize: f,
1609
+ state: p
1610
+ };
1466
1611
  }, i = () => {
1467
- const s = n().layout[t];
1468
- if (s !== void 0)
1469
- return s;
1612
+ const l = n().axis.items.find((c) => c.id === t);
1613
+ if (l !== void 0)
1614
+ return l;
1615
+ throw Error(`Layout not found for Panel ${t}`);
1616
+ }, s = () => {
1617
+ const l = n().layout[t];
1618
+ if (l !== void 0)
1619
+ return l;
1470
1620
  throw Error(`Layout not found for Panel ${t}`);
1471
1621
  }, a = ({
1472
- nextSize: s,
1473
- items: u,
1474
- prevLayout: l,
1475
- derivedItemConstraints: d
1622
+ nextSize: l,
1623
+ items: c,
1624
+ prevLayout: d,
1625
+ derivedItemConstraints: p
1476
1626
  }) => {
1477
- const h = i(), p = u.findIndex((g) => g.id === t), m = p === 0, f = p === u.length - 1;
1478
- if (f && s < h && (m || u.slice(0, p).every((g, S) => {
1479
- const z = d[S];
1480
- return z?.collapsible && W(z.collapsedSize, l[z.itemId]);
1627
+ const g = d[t], f = c.findIndex((y) => y.id === t), m = f === 0, h = f === c.length - 1;
1628
+ if (h && l < g && (m || c.slice(0, f).every((y, z) => {
1629
+ const b = p[z];
1630
+ return b?.collapsible && W(b.collapsedSize, d[b.itemId]);
1481
1631
  }))) {
1482
- const g = u.slice(0, p).reduce((S, z) => S + l[z.id], 0);
1632
+ const y = c.slice(0, f).reduce((z, b) => z + d[b.id], 0);
1483
1633
  return {
1484
- ...l,
1485
- [t]: J(100 - g)
1634
+ ...d,
1635
+ [t]: Z(100 - y)
1486
1636
  };
1487
1637
  }
1488
- return qe({
1489
- delta: f ? h - s : s - h,
1490
- initialLayout: l,
1491
- itemConstraints: d,
1492
- pivotIndices: f ? [p - 1, p] : [p, p + 1],
1493
- prevLayout: l,
1638
+ return Be({
1639
+ delta: h ? g - l : l - g,
1640
+ initialLayout: d,
1641
+ itemConstraints: p,
1642
+ pivotIndices: h ? [f - 1, f] : [f, f + 1],
1643
+ prevLayout: d,
1494
1644
  trigger: "imperative-api"
1495
1645
  });
1496
- }, c = (s) => {
1497
- const u = i();
1498
- if (s === u)
1646
+ }, u = (l, { axis: c, changed: d, itemSize: p, state: g }) => {
1647
+ if (l === p)
1499
1648
  return;
1500
- const {
1501
- defaultLayoutDeferred: l,
1502
- derivedItemConstraints: d,
1503
- axis: h,
1504
- axisSize: p,
1505
- layout: m,
1506
- separatorToItems: f
1507
- } = n(), y = a({
1508
- nextSize: s,
1509
- items: h.items,
1510
- prevLayout: m,
1511
- derivedItemConstraints: d
1512
- }), g = ve({
1513
- layout: y,
1514
- itemConstraints: d
1649
+ const { derivedItemConstraints: f, axisSize: m, layout: h } = g, S = a({
1650
+ nextSize: l,
1651
+ items: c.items,
1652
+ prevLayout: h,
1653
+ derivedItemConstraints: f
1654
+ }), y = ve({
1655
+ layout: S,
1656
+ itemConstraints: f
1515
1657
  });
1516
- se(m, g) || me(h, {
1517
- defaultLayoutDeferred: l,
1518
- derivedItemConstraints: d,
1519
- axisSize: p,
1520
- layout: g,
1521
- requestedAxisSize: p,
1522
- requestedLayout: g,
1523
- separatorToItems: f
1658
+ (d || !se(h, y)) && me(c, {
1659
+ ...g,
1660
+ layout: y,
1661
+ requestedAxisSize: m,
1662
+ requestedLayout: y
1524
1663
  });
1525
1664
  };
1526
1665
  return {
1527
1666
  collapse: () => {
1528
- const { collapsible: s, collapsedSize: u } = o(), { mutableValues: l } = r(), d = i();
1529
- s && d !== u && (l.expandToSize = d, c(u));
1667
+ const l = r(), { collapsible: c, collapsedSize: d } = l.itemConstraints, { mutableValues: p } = i(), g = l.itemSize;
1668
+ c && g !== d && (p.expandToSize = g, u(d, l));
1530
1669
  },
1531
1670
  expand: () => {
1532
- const { collapsible: s, collapsedSize: u, minSize: l } = o(), { mutableValues: d } = r(), h = i();
1533
- if (s && h === u) {
1534
- let p = d.expandToSize ?? l;
1535
- p === 0 && (p = 1), c(p);
1671
+ const l = r(), { collapsible: c, collapsedSize: d, minSize: p } = l.itemConstraints, { mutableValues: g } = i(), f = l.itemSize;
1672
+ if (c && f === d) {
1673
+ let m = g.expandToSize ?? p;
1674
+ m === 0 && (m = 1), u(m, l);
1536
1675
  }
1537
1676
  },
1538
1677
  getSize: () => {
1539
- const { axis: s } = n(), u = i(), { element: l } = r(), d = s.layoutStrategy ? s.layoutStrategy.getItemSizeInPixels(t) : s.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
1678
+ const { axis: l } = n(), c = s(), { element: d } = i(), p = l.layoutStrategy ? l.layoutStrategy.getItemSizeInPixels(t) : l.orientation === "horizontal" ? d.offsetWidth : d.offsetHeight;
1540
1679
  return {
1541
- asPercentage: u,
1542
- inPixels: d
1680
+ asPercentage: c,
1681
+ inPixels: p
1543
1682
  };
1544
1683
  },
1545
1684
  isCollapsed: () => {
1546
- const { collapsible: s, collapsedSize: u } = o(), l = i();
1547
- return s && W(u, l);
1685
+ const { collapsible: l, collapsedSize: c } = o(), d = s();
1686
+ return l && W(c, d);
1548
1687
  },
1549
- resize: (s) => {
1550
- const { axis: u } = n(), { element: l } = r(), d = Pe({ axis: u }), h = Le({
1688
+ resize: (l) => {
1689
+ const c = r(), { axisSize: d } = c.state, { element: p } = i(), g = Le({
1551
1690
  axisSize: d,
1552
- itemElement: l,
1553
- styleProp: s
1554
- }), p = J(h / d * 100);
1555
- c(p);
1691
+ itemElement: p,
1692
+ styleProp: l
1693
+ }), f = Z(g / d * 100);
1694
+ u(f, c);
1556
1695
  }
1557
1696
  };
1558
1697
  }
1559
- function Nt(e) {
1698
+ function Gt(e) {
1560
1699
  if (e.defaultPrevented)
1561
1700
  return;
1562
1701
  const t = ye();
1563
- wt(
1702
+ xt(
1564
1703
  e,
1565
1704
  t,
1566
1705
  e.currentTarget
@@ -1570,16 +1709,16 @@ function Nt(e) {
1570
1709
  (i) => i.constraintProps.defaultSize !== void 0
1571
1710
  );
1572
1711
  if (r) {
1573
- const i = r.constraintProps.defaultSize, a = zt({
1712
+ const i = r.constraintProps.defaultSize, s = It({
1574
1713
  axisId: o.axis.id,
1575
1714
  itemId: r.id
1576
1715
  });
1577
- a && i !== void 0 && (a.resize(i), e.preventDefault());
1716
+ s && i !== void 0 && (s.resize(i), e.preventDefault());
1578
1717
  }
1579
1718
  }
1580
1719
  });
1581
1720
  }
1582
- function Sn(e) {
1721
+ function bn(e) {
1583
1722
  const t = ye();
1584
1723
  for (const [n] of t)
1585
1724
  if (n.separators.some(
@@ -1588,7 +1727,7 @@ function Sn(e) {
1588
1727
  return n;
1589
1728
  throw Error("Could not find parent Group for separator element");
1590
1729
  }
1591
- function _e({
1730
+ function Fe({
1592
1731
  axisId: e
1593
1732
  }) {
1594
1733
  const t = () => {
@@ -1604,56 +1743,51 @@ function _e({
1604
1743
  return n ? {} : o;
1605
1744
  },
1606
1745
  setLayout(n) {
1607
- const {
1608
- defaultLayoutDeferred: o,
1609
- derivedItemConstraints: r,
1610
- axis: i,
1611
- axisSize: a,
1612
- layout: c,
1613
- separatorToItems: s
1614
- } = t(), u = ve({
1746
+ const { axis: o, ...r } = t(), i = zt({ axis: o, axisState: r }), s = i?.state ?? r, {
1747
+ defaultLayoutDeferred: a,
1748
+ derivedItemConstraints: u,
1749
+ axisSize: l,
1750
+ layout: c
1751
+ } = s, d = ve({
1615
1752
  layout: n,
1616
- itemConstraints: r
1753
+ itemConstraints: u
1617
1754
  });
1618
- return o ? c : (se(c, u) || me(i, {
1619
- defaultLayoutDeferred: o,
1620
- derivedItemConstraints: r,
1621
- axisSize: a,
1622
- layout: u,
1623
- requestedAxisSize: a,
1624
- requestedLayout: u,
1625
- separatorToItems: s
1626
- }), u);
1755
+ return a ? c : ((i?.changed || !se(c, d)) && me(o, {
1756
+ ...s,
1757
+ layout: d,
1758
+ requestedAxisSize: l,
1759
+ requestedLayout: d
1760
+ }), d);
1627
1761
  }
1628
1762
  };
1629
1763
  }
1630
- function xe(e, t) {
1631
- const n = Sn(e), o = ce(n.id, !0), r = n.separators.find(
1764
+ function we(e, t) {
1765
+ const n = bn(e), o = ce(n.id, !0), r = n.separators.find(
1632
1766
  (d) => d.element === e
1633
1767
  );
1634
- N(r, "Matching separator not found");
1768
+ D(r, "Matching separator not found");
1635
1769
  const i = o.separatorToItems.get(r);
1636
- N(i, "Matching panels not found");
1637
- const a = i.map((d) => n.items.indexOf(d)), s = _e({ axisId: n.id }).getLayout(), u = qe({
1770
+ D(i, "Matching panels not found");
1771
+ const s = i.map((d) => n.items.indexOf(d)), u = Fe({ axisId: n.id }).getLayout(), l = Be({
1638
1772
  delta: t,
1639
- initialLayout: s,
1773
+ initialLayout: u,
1640
1774
  itemConstraints: o.derivedItemConstraints,
1641
- pivotIndices: a,
1642
- prevLayout: s,
1775
+ pivotIndices: s,
1776
+ prevLayout: u,
1643
1777
  trigger: "keyboard"
1644
- }), l = ve({
1645
- layout: u,
1778
+ }), c = ve({
1779
+ layout: l,
1646
1780
  itemConstraints: o.derivedItemConstraints
1647
1781
  });
1648
- se(s, l) || me(
1782
+ se(u, c) || me(
1649
1783
  n,
1650
1784
  {
1651
1785
  defaultLayoutDeferred: o.defaultLayoutDeferred,
1652
1786
  derivedItemConstraints: o.derivedItemConstraints,
1653
1787
  axisSize: o.axisSize,
1654
- layout: l,
1788
+ layout: c,
1655
1789
  requestedAxisSize: o.axisSize,
1656
- requestedLayout: l,
1790
+ requestedLayout: c,
1657
1791
  separatorToItems: o.separatorToItems
1658
1792
  },
1659
1793
  // Keyboard resizes (arrow keys, Home/End, Enter collapse/expand) originate
@@ -1663,75 +1797,75 @@ function xe(e, t) {
1663
1797
  { isUserInteraction: !0 }
1664
1798
  );
1665
1799
  }
1666
- function lo(e) {
1800
+ function ho(e) {
1667
1801
  return e.separators.filter((t) => !t.disabled);
1668
1802
  }
1669
- function Gt(e) {
1803
+ function Ft(e) {
1670
1804
  if (e.defaultPrevented)
1671
1805
  return;
1672
- const t = e.currentTarget, n = Sn(t);
1806
+ const t = e.currentTarget, n = bn(t);
1673
1807
  if (!(n.disabled || n.separators.find(
1674
1808
  (r) => r.element === t
1675
1809
  )?.disabled))
1676
1810
  switch (e.key) {
1677
1811
  case "ArrowDown": {
1678
- e.preventDefault(), n.orientation === "vertical" && xe(t, 5);
1812
+ e.preventDefault(), n.orientation === "vertical" && we(t, 5);
1679
1813
  break;
1680
1814
  }
1681
1815
  case "ArrowLeft": {
1682
- e.preventDefault(), n.orientation === "horizontal" && xe(t, -5);
1816
+ e.preventDefault(), n.orientation === "horizontal" && we(t, -5);
1683
1817
  break;
1684
1818
  }
1685
1819
  case "ArrowRight": {
1686
- e.preventDefault(), n.orientation === "horizontal" && xe(t, 5);
1820
+ e.preventDefault(), n.orientation === "horizontal" && we(t, 5);
1687
1821
  break;
1688
1822
  }
1689
1823
  case "ArrowUp": {
1690
- e.preventDefault(), n.orientation === "vertical" && xe(t, -5);
1824
+ e.preventDefault(), n.orientation === "vertical" && we(t, -5);
1691
1825
  break;
1692
1826
  }
1693
1827
  case "End": {
1694
- e.preventDefault(), xe(t, 100);
1828
+ e.preventDefault(), we(t, 100);
1695
1829
  break;
1696
1830
  }
1697
1831
  case "Enter": {
1698
1832
  e.preventDefault();
1699
- const r = ce(n.id, !0), { derivedItemConstraints: i, layout: a, separatorToItems: c } = r, s = n.separators.find(
1700
- (h) => h.element === t
1833
+ const r = ce(n.id, !0), { derivedItemConstraints: i, layout: s, separatorToItems: a } = r, u = n.separators.find(
1834
+ (p) => p.element === t
1701
1835
  );
1702
- N(s, "Matching separator not found");
1703
- const u = c.get(s);
1704
- N(u, "Matching panels not found");
1705
- const l = u[0], d = i.find(
1706
- (h) => h.itemId === l.id
1836
+ D(u, "Matching separator not found");
1837
+ const l = a.get(u);
1838
+ D(l, "Matching panels not found");
1839
+ const c = l[0], d = i.find(
1840
+ (p) => p.itemId === c.id
1707
1841
  );
1708
- if (N(d, "Panel metadata not found"), d.collapsible) {
1709
- const h = a[l.id], p = d.collapsedSize === h ? n.mutableState.expandedItemSizes[l.id] ?? d.minSize : d.collapsedSize;
1710
- xe(t, p - h);
1842
+ if (D(d, "Panel metadata not found"), d.collapsible) {
1843
+ const p = s[c.id], g = d.collapsedSize === p ? n.mutableState.expandedItemSizes[c.id] ?? d.minSize : d.collapsedSize;
1844
+ we(t, g - p);
1711
1845
  }
1712
1846
  break;
1713
1847
  }
1714
1848
  case "F6": {
1715
1849
  e.preventDefault();
1716
- const r = lo(n).map(
1717
- (s) => s.element
1850
+ const r = ho(n).map(
1851
+ (u) => u.element
1718
1852
  ), i = r.findIndex(
1719
- (s) => s === e.currentTarget
1853
+ (u) => u === e.currentTarget
1720
1854
  );
1721
- N(i !== -1, "Index not found");
1722
- const a = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
1723
- r[a].focus({
1855
+ D(i !== -1, "Index not found");
1856
+ const s = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
1857
+ r[s].focus({
1724
1858
  preventScroll: !0
1725
1859
  });
1726
1860
  break;
1727
1861
  }
1728
1862
  case "Home": {
1729
- e.preventDefault(), xe(t, -100);
1863
+ e.preventDefault(), we(t, -100);
1730
1864
  break;
1731
1865
  }
1732
1866
  }
1733
1867
  }
1734
- function De(e, t) {
1868
+ function Te(e, t) {
1735
1869
  const n = ie();
1736
1870
  if (n.state !== "active" || !rt(n, e, t))
1737
1871
  return !1;
@@ -1739,11 +1873,11 @@ function De(e, t) {
1739
1873
  nt();
1740
1874
  try {
1741
1875
  n.previewLayoutMap.forEach((r, i) => {
1742
- const a = o.get(i);
1743
- i.resizePreviewMode === "separator" && a && !se(r, a.layout) && me(i, {
1744
- ...a,
1876
+ const s = o.get(i);
1877
+ i.resizePreviewMode === "separator" && s && !se(r, s.layout) && me(i, {
1878
+ ...s,
1745
1879
  layout: r,
1746
- requestedAxisSize: a.axisSize,
1880
+ requestedAxisSize: s.axisSize,
1747
1881
  requestedLayout: r
1748
1882
  });
1749
1883
  }), bt(), fe({
@@ -1762,7 +1896,7 @@ function De(e, t) {
1762
1896
  }
1763
1897
  return !0;
1764
1898
  }
1765
- function Ft(e) {
1899
+ function _t(e) {
1766
1900
  const t = ie();
1767
1901
  if (t.state !== "active")
1768
1902
  return;
@@ -1771,56 +1905,56 @@ function Ft(e) {
1771
1905
  );
1772
1906
  !n.some((o) => o === e.target) || n.some(
1773
1907
  (o) => o.hasPointerCapture?.(e.pointerId)
1774
- ) || De(e.currentTarget, e);
1908
+ ) || Te(e.currentTarget, e);
1775
1909
  }
1776
- function _t(e) {
1777
- De(e.currentTarget, e);
1910
+ function Bt(e) {
1911
+ Te(e.currentTarget, e);
1778
1912
  }
1779
- function uo(e, t) {
1780
- const { element: n, orientation: o, items: r } = e, i = n.getBoundingClientRect(), a = o === "horizontal";
1781
- return St({
1913
+ function go(e, t) {
1914
+ const { element: n, orientation: o, items: r } = e, i = n.getBoundingClientRect(), s = o === "horizontal";
1915
+ return yt({
1782
1916
  expandHitTargets: !1,
1783
1917
  axis: e,
1784
1918
  includeDisabled: !0
1785
- }).map(({ items: s, rect: u, separator: l }, d) => {
1786
- const h = r.indexOf(s[0]), p = a ? u.left + u.width / 2 : u.top + u.height / 2;
1919
+ }).map(({ items: u, rect: l, separator: c }, d) => {
1920
+ const p = r.indexOf(u[0]), g = s ? l.left + l.width / 2 : l.top + l.height / 2;
1787
1921
  return {
1788
- active: t.some((f) => {
1789
- if (f.axis !== e || f.items[0] !== s[0])
1922
+ active: t.some((m) => {
1923
+ if (m.axis !== e || m.items[0] !== u[0])
1790
1924
  return !1;
1791
- if (l || f.separator)
1792
- return f.separator === l;
1793
- const y = a ? f.rect.left + f.rect.width / 2 : f.rect.top + f.rect.height / 2;
1794
- return W(p, y);
1925
+ if (c || m.separator)
1926
+ return m.separator === c;
1927
+ const h = s ? m.rect.left + m.rect.width / 2 : m.rect.top + m.rect.height / 2;
1928
+ return W(g, h);
1795
1929
  }),
1796
1930
  axis: e,
1797
- key: l ? `separator-${l.id}` : `panel-${s[0].id}-${d}`,
1931
+ key: c ? `separator-${c.id}` : `panel-${u[0].id}-${d}`,
1798
1932
  offset: 0,
1799
- itemIndex: h,
1933
+ itemIndex: p,
1800
1934
  rect: new DOMRect(
1801
- (a && !l ? p : u.left) - i.left - n.clientLeft + n.scrollLeft,
1802
- (!a && !l ? p : u.top) - i.top - n.clientTop + n.scrollTop,
1803
- a && !l ? 0 : u.width,
1804
- !a && !l ? 0 : u.height
1935
+ (s && !c ? g : l.left) - i.left - n.clientLeft + n.scrollLeft,
1936
+ (!s && !c ? g : l.top) - i.top - n.clientTop + n.scrollTop,
1937
+ s && !c ? 0 : l.width,
1938
+ !s && !c ? 0 : l.height
1805
1939
  ),
1806
- separator: l
1940
+ separator: c
1807
1941
  };
1808
1942
  });
1809
1943
  }
1810
- function Bt(e) {
1944
+ function qt(e) {
1811
1945
  if (e.defaultPrevented)
1812
1946
  return;
1813
1947
  if (e.pointerType === "mouse" && e.button > 0)
1814
1948
  return;
1815
1949
  const t = ie();
1816
1950
  if (t.state === "active") {
1817
- hn(t, e) && De(
1951
+ pn(t, e) && Te(
1818
1952
  t.ownerDocument,
1819
1953
  t
1820
1954
  );
1821
1955
  return;
1822
1956
  }
1823
- const n = ye(), o = wt(
1957
+ const n = ye(), o = xt(
1824
1958
  e,
1825
1959
  n,
1826
1960
  e.currentTarget
@@ -1829,17 +1963,17 @@ function Bt(e) {
1829
1963
  return;
1830
1964
  const r = /* @__PURE__ */ new Map();
1831
1965
  let i = !1;
1832
- o.forEach((c) => {
1833
- c.separator && (i || (i = !0, c.separator.element.focus({
1966
+ o.forEach((a) => {
1967
+ a.separator && (i || (i = !0, a.separator.element.focus({
1834
1968
  // @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
1835
1969
  focusVisible: !1,
1836
1970
  preventScroll: !0
1837
1971
  })));
1838
- const s = n.get(c.axis);
1839
- s && r.set(c.axis, s.layout);
1972
+ const u = n.get(a.axis);
1973
+ u && r.set(a.axis, u.layout);
1840
1974
  });
1841
- const a = Array.from(r.keys()).flatMap(
1842
- (c) => c.resizePreviewMode === "separator" ? uo(c, o) : []
1975
+ const s = Array.from(r.keys()).flatMap(
1976
+ (a) => a.resizePreviewMode === "separator" ? go(a, o) : []
1843
1977
  );
1844
1978
  fe({
1845
1979
  cursorFlags: 0,
@@ -1851,17 +1985,17 @@ function Bt(e) {
1851
1985
  pointerId: e.pointerId,
1852
1986
  pointerType: e.pointerType,
1853
1987
  previewLayoutMap: new Map(r),
1854
- previews: a,
1988
+ previews: s,
1855
1989
  state: "active"
1856
1990
  }), e.preventDefault();
1857
1991
  }
1858
- function qt(e) {
1992
+ function Ht(e) {
1859
1993
  const t = e.currentTarget, n = ye(), o = ie();
1860
1994
  switch (o.state) {
1861
1995
  case "active": {
1862
1996
  if (!rt(o, t, e))
1863
1997
  return;
1864
- xt({
1998
+ wt({
1865
1999
  commit: !1,
1866
2000
  event: e,
1867
2001
  hitRegions: o.hitRegions,
@@ -1872,7 +2006,7 @@ function qt(e) {
1872
2006
  }
1873
2007
  }
1874
2008
  }
1875
- function Ht(e) {
2009
+ function Vt(e) {
1876
2010
  if (e.defaultPrevented)
1877
2011
  return;
1878
2012
  const t = e.currentTarget, n = ie(), o = ye();
@@ -1884,7 +2018,7 @@ function Ht(e) {
1884
2018
  // Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
1885
2019
  e.buttons === 0
1886
2020
  ) {
1887
- De(t, e);
2021
+ Te(t, e);
1888
2022
  return;
1889
2023
  }
1890
2024
  for (const r of n.hitRegions)
@@ -1892,7 +2026,7 @@ function Ht(e) {
1892
2026
  const { element: i } = r.separator;
1893
2027
  i.isConnected && !i.hasPointerCapture?.(e.pointerId) && i.setPointerCapture?.(e.pointerId);
1894
2028
  }
1895
- xt({
2029
+ wt({
1896
2030
  commit: !1,
1897
2031
  event: e,
1898
2032
  hitRegions: n.hitRegions,
@@ -1904,7 +2038,7 @@ function Ht(e) {
1904
2038
  break;
1905
2039
  }
1906
2040
  default: {
1907
- const r = wt(
2041
+ const r = xt(
1908
2042
  e,
1909
2043
  o,
1910
2044
  t
@@ -1922,7 +2056,7 @@ function Ht(e) {
1922
2056
  }
1923
2057
  }
1924
2058
  }
1925
- function Vt(e) {
2059
+ function jt(e) {
1926
2060
  if (e.relatedTarget instanceof HTMLIFrameElement) {
1927
2061
  const t = ie();
1928
2062
  switch (t.state) {
@@ -1934,275 +2068,137 @@ function Vt(e) {
1934
2068
  }
1935
2069
  }
1936
2070
  }
1937
- function jt(e) {
1938
- e.defaultPrevented || e.pointerType === "mouse" && e.button > 0 || gn(e.currentTarget, e);
1939
- }
1940
2071
  function Ut(e) {
1941
- e.target === e.currentTarget && De(e.currentTarget.document);
2072
+ e.defaultPrevented || e.pointerType === "mouse" && e.button > 0 || hn(e.currentTarget, e);
1942
2073
  }
1943
2074
  function Wt(e) {
1944
- De(e.currentTarget.document);
1945
- }
1946
- function fo(e) {
1947
- let t = 0, n = 0;
1948
- const o = {};
1949
- for (const i of e)
1950
- if (i.defaultSize !== void 0) {
1951
- t++;
1952
- const a = J(i.defaultSize);
1953
- n += a, o[i.itemId] = a;
1954
- } else
1955
- o[i.itemId] = void 0;
1956
- const r = e.length - t;
1957
- if (r !== 0) {
1958
- const i = J((100 - n) / r);
1959
- for (const a of e)
1960
- a.defaultSize === void 0 && (o[a.itemId] = i);
1961
- }
1962
- return o;
2075
+ e.target === e.currentTarget && Te(e.currentTarget.document);
1963
2076
  }
1964
- function mo(e, t) {
1965
- const n = e.map((r) => r.id), o = Object.keys(t);
1966
- if (n.length !== o.length)
1967
- return !1;
1968
- for (const r of n)
1969
- if (!o.includes(r))
1970
- return !1;
1971
- return !0;
1972
- }
1973
- function Yt({
1974
- axis: e,
1975
- itemConstraints: t
1976
- }) {
1977
- const n = e.items.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
1978
- return e.mutableState.layouts[n] ?? (o && mo(e.items, o) ? o : fo(t));
1979
- }
1980
- function Xt({
1981
- itemIds: e,
1982
- layout: t
1983
- }) {
1984
- return ve({
1985
- layout: t,
1986
- itemConstraints: e.map((n) => ({
1987
- collapsedSize: 0,
1988
- collapsible: !1,
1989
- defaultSize: void 0,
1990
- disabled: void 0,
1991
- itemId: n,
1992
- maxSize: 100,
1993
- minSize: 0
1994
- }))
1995
- });
2077
+ function Yt(e) {
2078
+ Te(e.currentTarget.document);
1996
2079
  }
1997
- function po(e, t, n) {
2080
+ function yo(e, t, n) {
1998
2081
  if (!n[0])
1999
2082
  return;
2000
- const r = e.items.find((u) => u.element === t);
2083
+ const r = e.items.find((l) => l.element === t);
2001
2084
  if (!r || !r.onResize)
2002
2085
  return;
2003
- const i = Pe({ axis: e }), a = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, c = r.mutableValues.prevSize, s = {
2004
- asPercentage: J(a / i * 100),
2005
- inPixels: a
2086
+ const i = je({ axis: e }), s = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, a = r.mutableValues.prevSize, u = {
2087
+ asPercentage: Z(s / i * 100),
2088
+ inPixels: s
2006
2089
  };
2007
- r.mutableValues.prevSize = s, r.onResize(s, r.id, c);
2008
- }
2009
- function vn(e, t) {
2010
- if (Object.keys(e).length !== Object.keys(t).length)
2011
- return !1;
2012
- for (const o in e)
2013
- if (e[o] !== t[o])
2014
- return !1;
2015
- return !0;
2016
- }
2017
- function ho(e, t) {
2018
- return e.length !== t.length ? !1 : e.every((n, o) => vn(n, t[o]));
2019
- }
2020
- function go({
2021
- axis: e,
2022
- nextAxisSize: t,
2023
- prevAxisSize: n,
2024
- prevLayout: o
2025
- }) {
2026
- if (n <= 0 || t <= 0 || n === t)
2027
- return o;
2028
- let r = 0, i = 0, a = !1;
2029
- const c = /* @__PURE__ */ new Map(), s = [];
2030
- for (const d of e.items) {
2031
- const h = o[d.id] ?? 0;
2032
- switch (d.constraintProps.groupResizeBehavior) {
2033
- case "preserve-pixel-size": {
2034
- a = !0;
2035
- const p = h / 100 * n, m = J(
2036
- p / t * 100
2037
- );
2038
- c.set(d.id, m), r += m;
2039
- break;
2040
- }
2041
- case "preserve-relative-size":
2042
- default: {
2043
- s.push(d.id), i += h;
2044
- break;
2045
- }
2046
- }
2047
- }
2048
- if (!a || s.length === 0)
2049
- return o;
2050
- const u = 100 - r, l = { ...o };
2051
- if (c.forEach((d, h) => {
2052
- l[h] = d;
2053
- }), i > 0)
2054
- for (const d of s) {
2055
- const h = o[d] ?? 0;
2056
- l[d] = J(
2057
- h / i * u
2058
- );
2059
- }
2060
- else {
2061
- const d = J(u / s.length);
2062
- for (const h of s)
2063
- l[h] = d;
2064
- }
2065
- return l;
2090
+ r.mutableValues.prevSize = u, r.onResize(u, r.id, a);
2066
2091
  }
2067
2092
  const Ie = /* @__PURE__ */ new Map();
2068
- let Kt = !1;
2069
- function bn(e) {
2093
+ let Xt = !1;
2094
+ function wn(e) {
2070
2095
  let t = !0;
2071
- N(
2096
+ D(
2072
2097
  e.element.ownerDocument.defaultView,
2073
2098
  "Cannot register an unmounted Group"
2074
2099
  );
2075
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((m) => {
2076
- let f;
2100
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((f) => {
2101
+ let m;
2077
2102
  nt();
2078
2103
  try {
2079
- for (const y of m) {
2080
- const { borderBoxSize: g, target: S } = y;
2081
- if (S === e.element) {
2104
+ for (const h of f) {
2105
+ const { borderBoxSize: S, target: y } = h;
2106
+ if (y === e.element) {
2082
2107
  if (t) {
2083
- const z = Pe({ axis: e });
2084
- if (z === 0)
2108
+ const z = ce(e.id);
2109
+ if (!z)
2085
2110
  break;
2086
- const b = ce(e.id);
2111
+ const b = zt({ axis: e, axisState: z });
2087
2112
  if (!b)
2088
2113
  break;
2089
- const R = ft(e);
2090
- let O = b.requestedAxisSize, A = b.requestedLayout;
2091
- b.defaultLayoutDeferred && (O = z, A = Xt({
2092
- itemIds: e.items.map(({ id: v }) => v),
2093
- layout: Yt({
2094
- axis: e,
2095
- itemConstraints: R
2096
- })
2097
- }));
2098
- const x = go({
2099
- axis: e,
2100
- nextAxisSize: z,
2101
- prevAxisSize: O,
2102
- prevLayout: A
2103
- }), w = ve({
2104
- layout: x,
2105
- itemConstraints: R
2106
- });
2107
- if (!b.defaultLayoutDeferred && se(b.layout, w) && ho(
2108
- b.derivedItemConstraints,
2109
- R
2110
- ) && b.axisSize === z)
2114
+ if (!b.changed)
2111
2115
  continue;
2112
- me(e, {
2113
- defaultLayoutDeferred: !1,
2114
- derivedItemConstraints: R,
2115
- axisSize: z,
2116
- layout: w,
2117
- requestedAxisSize: O,
2118
- requestedLayout: A,
2119
- separatorToItems: b.separatorToItems
2120
- });
2116
+ me(e, b.state);
2121
2117
  }
2122
2118
  } else
2123
2119
  try {
2124
- po(e, S, g);
2120
+ yo(e, y, S);
2125
2121
  } catch (z) {
2126
- f ??= { error: z };
2122
+ m ??= { error: z };
2127
2123
  }
2128
2124
  }
2129
2125
  } finally {
2130
2126
  ot();
2131
2127
  }
2132
- if (f)
2133
- throw f.error;
2128
+ if (m)
2129
+ throw m.error;
2134
2130
  });
2135
- i.observe(e.element), e.items.forEach((m) => {
2136
- N(
2137
- !o.has(m.id),
2138
- `Panel ids must be unique; id "${m.id}" was used more than once`
2139
- ), o.add(m.id), m.onResize && i.observe(m.element);
2131
+ i.observe(e.element), e.items.forEach((f) => {
2132
+ D(
2133
+ !o.has(f.id),
2134
+ `Panel ids must be unique; id "${f.id}" was used more than once`
2135
+ ), o.add(f.id), f.onResize && i.observe(f.element);
2140
2136
  });
2141
- const a = Pe({ axis: e }), c = ft(e), s = Yt({
2137
+ const s = je({ axis: e }), a = St(e, s), u = yn({
2142
2138
  axis: e,
2143
- itemConstraints: c
2144
- }), u = ve({
2145
- layout: s,
2146
- itemConstraints: c
2147
- }), l = e.element.ownerDocument, d = l.defaultView;
2139
+ itemConstraints: a
2140
+ }), l = ve({
2141
+ layout: u,
2142
+ itemConstraints: a
2143
+ }), c = e.element.ownerDocument, d = c.defaultView;
2148
2144
  Ie.set(
2149
- l,
2150
- (Ie.get(l) ?? 0) + 1
2145
+ c,
2146
+ (Ie.get(c) ?? 0) + 1
2151
2147
  );
2152
- const h = /* @__PURE__ */ new Map();
2153
- return St({ axis: e, includeDisabled: !0 }).forEach((m) => {
2154
- m.separator && h.set(m.separator, m.items);
2148
+ const p = /* @__PURE__ */ new Map();
2149
+ return yt({ axis: e, includeDisabled: !0 }).forEach((f) => {
2150
+ f.separator && p.set(f.separator, f.items);
2155
2151
  }), me(e, {
2156
- defaultLayoutDeferred: a === 0,
2157
- derivedItemConstraints: c,
2158
- axisSize: a,
2159
- layout: u,
2160
- requestedAxisSize: a,
2161
- requestedLayout: Xt({
2162
- itemIds: e.items.map(({ id: m }) => m),
2163
- layout: s
2152
+ defaultLayoutDeferred: s === 0,
2153
+ derivedItemConstraints: a,
2154
+ axisSize: s,
2155
+ layout: l,
2156
+ requestedAxisSize: s,
2157
+ requestedLayout: vn({
2158
+ itemIds: e.items.map(({ id: f }) => f),
2159
+ layout: u
2164
2160
  }),
2165
- separatorToItems: h
2166
- }), e.separators.forEach((m) => {
2167
- N(
2168
- !r.has(m.id),
2169
- `Separator ids must be unique; id "${m.id}" was used more than once`
2170
- ), r.add(m.id), m.element.addEventListener("keydown", Gt);
2171
- }), Kt || (Kt = !0, gt(Hn)), Ie.get(l) === 1 && (l.addEventListener("contextmenu", kt, !0), l.addEventListener("dblclick", Nt, !0), l.addEventListener(
2161
+ separatorToItems: p
2162
+ }), e.separators.forEach((f) => {
2163
+ D(
2164
+ !r.has(f.id),
2165
+ `Separator ids must be unique; id "${f.id}" was used more than once`
2166
+ ), r.add(f.id), f.element.addEventListener("keydown", Ft);
2167
+ }), Xt || (Xt = !0, ht(Vn)), Ie.get(c) === 1 && (c.addEventListener("contextmenu", At, !0), c.addEventListener("dblclick", Gt, !0), c.addEventListener(
2172
2168
  "lostpointercapture",
2173
- Ft,
2169
+ _t,
2174
2170
  !0
2175
- ), l.addEventListener(
2171
+ ), c.addEventListener(
2176
2172
  "pointercancel",
2177
- _t,
2173
+ Bt,
2178
2174
  !0
2179
- ), l.addEventListener("pointerdown", Bt, !0), l.addEventListener("pointerleave", qt), l.addEventListener("pointermove", Ht), l.addEventListener("pointerout", Vt), l.addEventListener("pointerup", jt, !0), d?.addEventListener("blur", Ut), d?.addEventListener("pagehide", Wt)), function() {
2175
+ ), c.addEventListener("pointerdown", qt, !0), c.addEventListener("pointerleave", Ht), c.addEventListener("pointermove", Vt), c.addEventListener("pointerout", jt), c.addEventListener("pointerup", Ut, !0), d?.addEventListener("blur", Wt), d?.addEventListener("pagehide", Yt)), function() {
2180
2176
  t = !1, Ie.set(
2181
- l,
2182
- Math.max(0, (Ie.get(l) ?? 0) - 1)
2183
- ), Jn(e), _n(e), e.separators.forEach((f) => {
2184
- f.element.removeEventListener("keydown", Gt);
2185
- }), Ie.get(l) || (l.removeEventListener(
2177
+ c,
2178
+ Math.max(0, (Ie.get(c) ?? 0) - 1)
2179
+ ), Zn(e), Bn(e), e.separators.forEach((m) => {
2180
+ m.element.removeEventListener("keydown", Ft);
2181
+ }), Ie.get(c) || (c.removeEventListener(
2186
2182
  "contextmenu",
2187
- kt,
2183
+ At,
2188
2184
  !0
2189
- ), l.removeEventListener(
2185
+ ), c.removeEventListener(
2190
2186
  "dblclick",
2191
- Nt,
2187
+ Gt,
2192
2188
  !0
2193
- ), l.removeEventListener(
2189
+ ), c.removeEventListener(
2194
2190
  "lostpointercapture",
2195
- Ft,
2191
+ _t,
2196
2192
  !0
2197
- ), l.removeEventListener(
2193
+ ), c.removeEventListener(
2198
2194
  "pointercancel",
2199
- _t,
2195
+ Bt,
2200
2196
  !0
2201
- ), l.removeEventListener(
2197
+ ), c.removeEventListener(
2202
2198
  "pointerdown",
2203
- Bt,
2199
+ qt,
2204
2200
  !0
2205
- ), l.removeEventListener("pointerleave", qt), l.removeEventListener("pointermove", Ht), l.removeEventListener("pointerout", Vt), l.removeEventListener("pointerup", jt, !0), d?.removeEventListener("blur", Ut), d?.removeEventListener("pagehide", Wt)), i.disconnect();
2201
+ ), c.removeEventListener("pointerleave", Ht), c.removeEventListener("pointermove", Vt), c.removeEventListener("pointerout", jt), c.removeEventListener("pointerup", Ut, !0), d?.removeEventListener("blur", Wt), d?.removeEventListener("pagehide", Yt)), i.disconnect();
2206
2202
  };
2207
2203
  }
2208
2204
  function xn({
@@ -2212,21 +2208,21 @@ function xn({
2212
2208
  prevLayout: o,
2213
2209
  requestedLayout: r
2214
2210
  }) {
2215
- const i = t.items.map(({ id: a }) => a).join(",");
2216
- t.mutableState.layouts[i] = r, o && e.forEach((a) => {
2217
- if (a.collapsible) {
2218
- const c = W(
2219
- a.collapsedSize,
2220
- n[a.itemId]
2221
- ), s = W(
2222
- a.collapsedSize,
2223
- o[a.itemId]
2211
+ const i = t.items.map(({ id: s }) => s).join(",");
2212
+ t.mutableState.layouts[i] = r, o && e.forEach((s) => {
2213
+ if (s.collapsible) {
2214
+ const a = W(
2215
+ s.collapsedSize,
2216
+ n[s.itemId]
2217
+ ), u = W(
2218
+ s.collapsedSize,
2219
+ o[s.itemId]
2224
2220
  );
2225
- c && !s && (t.mutableState.expandedItemSizes[a.itemId] = o[a.itemId]);
2221
+ a && !u && (t.mutableState.expandedItemSizes[s.itemId] = o[s.itemId]);
2226
2222
  }
2227
2223
  });
2228
2224
  }
2229
- function wn() {
2225
+ function zn() {
2230
2226
  const [e, t] = ge({}), n = re(() => t({}), []);
2231
2227
  return [e, n];
2232
2228
  }
@@ -2237,34 +2233,34 @@ function it(e) {
2237
2233
  t.current[n] = e[n];
2238
2234
  }, [e]), t.current;
2239
2235
  }
2240
- const It = nn(null);
2241
- function yo({
2236
+ const Lt = tn(null);
2237
+ function So({
2242
2238
  layout: e,
2243
2239
  itemConstraints: t,
2244
2240
  itemId: n,
2245
2241
  itemIndex: o
2246
2242
  }) {
2247
2243
  let r, i;
2248
- const a = e[n], c = t.find(
2249
- (s) => s.itemId === n
2244
+ const s = e[n], a = t.find(
2245
+ (u) => u.itemId === n
2250
2246
  );
2251
- if (c) {
2252
- const s = c.maxSize, u = c.collapsible ? c.collapsedSize : c.minSize, l = [o, o + 1];
2247
+ if (a) {
2248
+ const u = a.maxSize, l = a.collapsible ? a.collapsedSize : a.minSize, c = [o, o + 1];
2253
2249
  i = ve({
2254
- layout: qe({
2255
- delta: u - a,
2250
+ layout: Be({
2251
+ delta: l - s,
2256
2252
  initialLayout: e,
2257
2253
  itemConstraints: t,
2258
- pivotIndices: l,
2254
+ pivotIndices: c,
2259
2255
  prevLayout: e
2260
2256
  }),
2261
2257
  itemConstraints: t
2262
2258
  })[n], r = ve({
2263
- layout: qe({
2264
- delta: s - a,
2259
+ layout: Be({
2260
+ delta: u - s,
2265
2261
  initialLayout: e,
2266
2262
  itemConstraints: t,
2267
- pivotIndices: l,
2263
+ pivotIndices: c,
2268
2264
  prevLayout: e
2269
2265
  }),
2270
2266
  itemConstraints: t
@@ -2274,46 +2270,46 @@ function yo({
2274
2270
  valueControls: n,
2275
2271
  valueMax: r,
2276
2272
  valueMin: i,
2277
- valueNow: a
2273
+ valueNow: s
2278
2274
  };
2279
2275
  }
2280
- function zn({
2276
+ function In({
2281
2277
  attributes: e,
2282
2278
  axisId: t,
2283
2279
  axisOrientation: n,
2284
2280
  children: o,
2285
2281
  className: r,
2286
2282
  "data-testid": i,
2287
- disableCursor: a,
2288
- disabled: c,
2289
- disableDoubleClick: s,
2290
- elementRef: u,
2291
- id: l,
2283
+ disableCursor: s,
2284
+ disabled: a,
2285
+ disableDoubleClick: u,
2286
+ elementRef: l,
2287
+ id: c,
2292
2288
  isSharedHitRegion: d,
2293
- preview: h,
2294
- registerSeparator: p,
2295
- requiredStyle: m,
2296
- style: f,
2297
- styleDefaults: y,
2298
- tabIndex: g = 0,
2299
- updateSeparatorProps: S
2289
+ preview: p,
2290
+ registerSeparator: g,
2291
+ requiredStyle: f,
2292
+ style: m,
2293
+ styleDefaults: h,
2294
+ tabIndex: S = 0,
2295
+ updateSeparatorProps: y
2300
2296
  }) {
2301
2297
  const z = it({
2302
- disabled: c,
2303
- disableDoubleClick: s,
2298
+ disabled: a,
2299
+ disableDoubleClick: u,
2304
2300
  children: o,
2305
2301
  className: r,
2306
- preview: h,
2307
- style: f
2308
- }), [b, R] = ge({}), [O, A] = ge("inactive"), [x, w] = ge(!1), v = B(null), M = B(null), k = Ve(v, u), P = n === "horizontal" ? "vertical" : "horizontal";
2302
+ preview: p,
2303
+ style: m
2304
+ }), [b, E] = ge({}), [F, N] = ge("inactive"), [w, x] = ge(!1), v = B(null), M = B(null), k = He(v, l), P = n === "horizontal" ? "vertical" : "horizontal";
2309
2305
  ne(() => {
2310
2306
  const I = v.current;
2311
2307
  if (I !== null) {
2312
- const E = {
2308
+ const R = {
2313
2309
  disabled: z.disabled,
2314
2310
  disableDoubleClick: z.disableDoubleClick,
2315
2311
  element: I,
2316
- id: l,
2312
+ id: c,
2317
2313
  get children() {
2318
2314
  return z.children;
2319
2315
  },
@@ -2327,33 +2323,33 @@ function zn({
2327
2323
  return z.style;
2328
2324
  }
2329
2325
  };
2330
- M.current = E;
2331
- const q = p(E), Z = gt(
2332
- (K) => {
2333
- A(
2334
- K.next.state !== "inactive" && K.next.hitRegions.some(
2335
- (ae) => ae.separator === E || (d?.(ae) ?? !1)
2336
- ) ? K.next.state : "inactive"
2326
+ M.current = R;
2327
+ const q = g(R), K = ht(
2328
+ (J) => {
2329
+ N(
2330
+ J.next.state !== "inactive" && J.next.hitRegions.some(
2331
+ (ae) => ae.separator === R || (d?.(ae) ?? !1)
2332
+ ) ? J.next.state : "inactive"
2337
2333
  );
2338
2334
  }
2339
- ), X = Be(
2335
+ ), X = _e(
2340
2336
  t,
2341
- (K) => {
2342
- const { derivedItemConstraints: ae, layout: we, separatorToItems: ke } = K.next, ze = ke.get(E);
2337
+ (J) => {
2338
+ const { derivedItemConstraints: ae, layout: xe, separatorToItems: $e } = J.next, ze = $e.get(R);
2343
2339
  if (ze) {
2344
2340
  const L = ze[0], T = ae.findIndex(
2345
- (G) => G.itemId === L.id
2346
- ), { layoutStrategy: F } = K.axis;
2347
- R({
2348
- ...yo({
2349
- layout: we,
2341
+ (O) => O.itemId === L.id
2342
+ ), { layoutStrategy: G } = J.axis;
2343
+ E({
2344
+ ...So({
2345
+ layout: xe,
2350
2346
  itemConstraints: ae,
2351
2347
  itemId: L.id,
2352
2348
  itemIndex: T
2353
2349
  }),
2354
2350
  // Items without DOM elements of their own (e.g. Grid tracks) control other elements
2355
- ...F?.getItemAriaControls && {
2356
- valueControls: F.getItemAriaControls(
2351
+ ...G?.getItemAriaControls && {
2352
+ valueControls: G.getItemAriaControls(
2357
2353
  L.id
2358
2354
  )
2359
2355
  }
@@ -2362,35 +2358,35 @@ function zn({
2362
2358
  }
2363
2359
  );
2364
2360
  return () => {
2365
- M.current = null, Z(), X(), q();
2361
+ M.current = null, K(), X(), q();
2366
2362
  };
2367
2363
  }
2368
- }, [t, l, d, p, z]), ne(() => {
2364
+ }, [t, c, d, g, z]), ne(() => {
2369
2365
  const I = M.current;
2370
- I && Fn(I);
2371
- }, [h]), He(() => {
2372
- S(l, { disabled: c, disableDoubleClick: s });
2373
- }, [c, s, l, S]);
2374
- let $;
2375
- c && !a && ($ = "not-allowed");
2366
+ I && _n(I);
2367
+ }, [p]), qe(() => {
2368
+ y(c, { disabled: a, disableDoubleClick: u });
2369
+ }, [a, u, c, y]);
2370
+ let A;
2371
+ a && !s && (A = "not-allowed");
2376
2372
  let C;
2377
- if (c)
2373
+ if (a)
2378
2374
  C = "disabled";
2379
2375
  else
2380
- switch (O) {
2376
+ switch (F) {
2381
2377
  case "active": {
2382
2378
  C = "active";
2383
2379
  break;
2384
2380
  }
2385
2381
  default:
2386
- x ? C = "focus" : C = O;
2382
+ w ? C = "focus" : C = F;
2387
2383
  }
2388
2384
  return /* @__PURE__ */ Y(
2389
2385
  "div",
2390
2386
  {
2391
2387
  ...e,
2392
2388
  "aria-controls": b.valueControls,
2393
- "aria-disabled": c || void 0,
2389
+ "aria-disabled": a || void 0,
2394
2390
  "aria-orientation": P,
2395
2391
  "aria-valuemax": b.valueMax,
2396
2392
  "aria-valuemin": b.valueMin,
@@ -2399,99 +2395,99 @@ function zn({
2399
2395
  className: r,
2400
2396
  "data-separator": C,
2401
2397
  "data-testid": i,
2402
- id: l,
2403
- onBlur: () => w(!1),
2404
- onFocus: () => w(!0),
2398
+ id: c,
2399
+ onBlur: () => x(!1),
2400
+ onFocus: () => x(!0),
2405
2401
  ref: k,
2406
2402
  role: "separator",
2407
2403
  style: {
2408
- ...y,
2409
- cursor: $,
2410
- ...f,
2404
+ ...h,
2405
+ cursor: A,
2411
2406
  ...m,
2407
+ ...f,
2412
2408
  // Inform the browser that the library is handling touch events for this element
2413
2409
  // See github.com/bvaughn/react-resizable-panels/issues/662
2414
2410
  touchAction: "none"
2415
2411
  },
2416
- tabIndex: c ? void 0 : g
2412
+ tabIndex: a ? void 0 : S
2417
2413
  }
2418
2414
  );
2419
2415
  }
2420
- function Jt({
2416
+ function Kt({
2421
2417
  axis: e,
2422
2418
  children: t,
2423
2419
  className: n,
2424
2420
  crossSpan: o,
2425
2421
  crossStart: r,
2426
2422
  disabled: i,
2427
- elementRef: a,
2428
- index: c,
2429
- style: s
2423
+ elementRef: s,
2424
+ index: a,
2425
+ style: u
2430
2426
  }) {
2431
- const u = Te(void 0), {
2432
- getDisableCursor: l,
2427
+ const l = Pe(void 0), {
2428
+ getDisableCursor: c,
2433
2429
  getResizeAxisId: d,
2434
- gutters: h,
2435
- registerSeparator: p,
2436
- separatorPlacements: m,
2437
- trackCounts: f,
2438
- updateSeparatorProps: y
2439
- } = an(), g = d(e), S = e === "column" ? "row" : "column", z = f[S], b = !!i || !pt(c, f[e]);
2440
- let R = !0;
2441
- for (const v of m.values())
2442
- if (v.axis === e && v.index === c && !v.disabled && v.crossStart < r) {
2443
- R = !1;
2430
+ gutters: p,
2431
+ registerSeparator: g,
2432
+ separatorPlacements: f,
2433
+ trackCounts: m,
2434
+ updateSeparatorProps: h
2435
+ } = sn(), S = d(e), y = e === "column" ? "row" : "column", z = m[y], b = !!i || !mt(a, m[e]);
2436
+ let E = !0;
2437
+ for (const v of f.values())
2438
+ if (v.axis === e && v.index === a && !v.disabled && v.crossStart < r) {
2439
+ E = !1;
2444
2440
  break;
2445
2441
  }
2446
- const O = re(
2447
- (v) => v.axis.id === g && v.axis.items.indexOf(v.items[1]) === c,
2448
- [g, c]
2449
- ), A = re(
2450
- (v) => p(
2442
+ const F = re(
2443
+ (v) => v.axis.id === S && v.axis.items.indexOf(v.items[1]) === a,
2444
+ [S, a]
2445
+ ), N = re(
2446
+ (v) => g(
2451
2447
  {
2452
2448
  axis: e,
2453
2449
  crossSpan: o,
2454
2450
  crossStart: r,
2455
2451
  disabled: !!i,
2456
- index: c
2452
+ index: a
2457
2453
  },
2458
2454
  v
2459
2455
  ),
2460
- [e, o, r, i, c, p]
2461
- ), x = Dn(c), w = kn({
2456
+ [e, o, r, i, a, g]
2457
+ ), w = kn(a), x = An({
2462
2458
  crossCount: z,
2463
2459
  crossSpan: o,
2464
2460
  crossStart: r,
2465
- hasGutters: h[S]
2461
+ hasGutters: p[y]
2466
2462
  });
2467
2463
  return /* @__PURE__ */ Y(
2468
- zn,
2464
+ In,
2469
2465
  {
2470
- axisId: g,
2466
+ axisId: S,
2471
2467
  axisOrientation: e === "column" ? "horizontal" : "vertical",
2472
2468
  className: n,
2473
- disableCursor: l(),
2469
+ disableCursor: c(),
2474
2470
  disabled: b,
2475
2471
  disableDoubleClick: void 0,
2476
- elementRef: a,
2477
- id: u,
2478
- isSharedHitRegion: O,
2479
- registerSeparator: A,
2472
+ elementRef: s,
2473
+ id: l,
2474
+ isSharedHitRegion: F,
2475
+ registerSeparator: N,
2480
2476
  requiredStyle: {
2481
- gridColumn: e === "column" ? x : w,
2482
- gridRow: e === "row" ? x : w
2477
+ gridColumn: e === "column" ? w : x,
2478
+ gridRow: e === "row" ? w : x
2483
2479
  },
2484
- style: s,
2485
- tabIndex: R ? 0 : -1,
2486
- updateSeparatorProps: y,
2480
+ style: u,
2481
+ tabIndex: E ? 0 : -1,
2482
+ updateSeparatorProps: h,
2487
2483
  children: t
2488
2484
  }
2489
2485
  );
2490
2486
  }
2491
- function In(e) {
2487
+ function Ln(e) {
2492
2488
  const { children: t, className: n, disabled: o, elementRef: r, style: i } = e;
2493
2489
  return e.type === "column" ? /* @__PURE__ */ Y(
2494
- Jt,
2490
+ Kt,
2495
2491
  {
2496
2492
  axis: "column",
2497
2493
  className: n,
@@ -2504,7 +2500,7 @@ function In(e) {
2504
2500
  children: t
2505
2501
  }
2506
2502
  ) : /* @__PURE__ */ Y(
2507
- Jt,
2503
+ Kt,
2508
2504
  {
2509
2505
  axis: "row",
2510
2506
  className: n,
@@ -2518,41 +2514,41 @@ function In(e) {
2518
2514
  }
2519
2515
  );
2520
2516
  }
2521
- In.displayName = "Gridline";
2522
- const Ce = ["column", "row"], Zt = { columns: {}, rows: {} };
2523
- function So({
2517
+ Ln.displayName = "Gridline";
2518
+ const Ce = ["column", "row"], Jt = { columns: {}, rows: {} };
2519
+ function vo({
2524
2520
  children: e,
2525
2521
  className: t,
2526
2522
  columns: n,
2527
2523
  defaultLayout: o,
2528
2524
  disableCursor: r,
2529
2525
  disabled: i,
2530
- elementRef: a,
2531
- gridRef: c,
2532
- id: s,
2533
- onLayoutChange: u,
2534
- onLayoutChanged: l,
2526
+ elementRef: s,
2527
+ gridRef: a,
2528
+ id: u,
2529
+ onLayoutChange: l,
2530
+ onLayoutChanged: c,
2535
2531
  resizeTargetMinimumSize: d = {
2536
2532
  coarse: 20,
2537
2533
  fine: 10
2538
2534
  },
2539
- rows: h,
2540
- style: p,
2541
- ...m
2535
+ rows: p,
2536
+ style: g,
2537
+ ...f
2542
2538
  }) {
2543
- const f = Te(s), y = re(
2544
- (L) => L === "column" ? `${f}:columns` : `${f}:rows`,
2545
- [f]
2546
- ), g = Qt(n, "columns"), S = Qt(h, "rows"), z = (L) => L === "column" ? g : S, b = B({
2547
- onLayoutChange: Zt,
2548
- onLayoutChanged: Zt
2549
- }), R = Se((L) => {
2550
- en(b.current.onLayoutChange, L) || (b.current.onLayoutChange = L, u?.(L));
2551
- }), O = Se(
2552
- (L, T, F) => {
2553
- en(b.current.onLayoutChanged, L) || (b.current.onLayoutChanged = L, l?.(L, { isUserInteraction: T, requestedLayout: F }));
2554
- }
2555
- ), A = B(null), x = Ve(A, a), [w, v] = wn(), M = B({
2539
+ const m = Pe(u), h = re(
2540
+ (L) => L === "column" ? `${m}:columns` : `${m}:rows`,
2541
+ [m]
2542
+ ), S = Zt(n, "columns"), y = Zt(p, "rows"), z = (L) => L === "column" ? S : y, b = B({
2543
+ onLayoutChange: Jt,
2544
+ onLayoutChanged: Jt
2545
+ }), E = Se((L) => {
2546
+ Qt(b.current.onLayoutChange, L) || (b.current.onLayoutChange = L, l?.(L));
2547
+ }), F = Se(
2548
+ (L, T, G) => {
2549
+ Qt(b.current.onLayoutChanged, L) || (b.current.onLayoutChanged = L, c?.(L, { isUserInteraction: T, requestedLayout: G }));
2550
+ }
2551
+ ), N = B(null), w = He(N, s), [x, v] = zn(), M = B({
2556
2552
  cells: [],
2557
2553
  column: { expandedItemSizes: {}, layouts: {} },
2558
2554
  loggedErrors: /* @__PURE__ */ new Set(),
@@ -2561,84 +2557,84 @@ function So({
2561
2557
  }), k = { column: !1, row: !1 };
2562
2558
  for (const L of M.current.separators.values())
2563
2559
  k[L.axis] = !0;
2564
- Ln(e, k);
2560
+ Cn(e, k);
2565
2561
  const P = it({
2566
2562
  defaultLayout: o,
2567
2563
  disableCursor: r,
2568
2564
  resizeTargetMinimumSize: d
2569
- }), $ = Se(() => !!P.disableCursor), C = re(
2565
+ }), A = Se(() => !!P.disableCursor), C = re(
2570
2566
  (L) => {
2571
2567
  const T = M.current;
2572
2568
  return T.cells = [...T.cells, L], v(), () => {
2573
2569
  T.cells = T.cells.filter(
2574
- (F) => F !== L
2570
+ (G) => G !== L
2575
2571
  ), v();
2576
2572
  };
2577
2573
  },
2578
2574
  [v]
2579
2575
  ), I = re(
2580
2576
  (L, T) => {
2581
- const F = M.current;
2582
- return F.separators = new Map(F.separators), F.separators.set(T, L), v(), () => {
2583
- F.separators = new Map(F.separators), F.separators.delete(T), v();
2577
+ const G = M.current;
2578
+ return G.separators = new Map(G.separators), G.separators.set(T, L), v(), () => {
2579
+ G.separators = new Map(G.separators), G.separators.delete(T), v();
2584
2580
  };
2585
2581
  },
2586
2582
  [v]
2587
- ), E = re(
2583
+ ), R = re(
2588
2584
  (L, {
2589
2585
  disabled: T,
2590
- disableDoubleClick: F
2586
+ disableDoubleClick: G
2591
2587
  }) => {
2592
- for (const G of M.current.separators.keys())
2593
- G.id === L && (G.disabled = T, G.disableDoubleClick = F);
2588
+ for (const O of M.current.separators.keys())
2589
+ O.id === L && (O.disabled = T, O.disableDoubleClick = G);
2594
2590
  },
2595
2591
  []
2596
- ), q = M.current.separators, Z = Me(
2592
+ ), q = M.current.separators, K = Me(
2597
2593
  () => ({
2598
- getDisableCursor: $,
2599
- getResizeAxisId: y,
2594
+ getDisableCursor: A,
2595
+ getResizeAxisId: h,
2600
2596
  gutters: {
2601
2597
  column: k.column,
2602
2598
  row: k.row
2603
2599
  },
2604
- id: f,
2600
+ id: m,
2605
2601
  registerCell: C,
2606
2602
  registerSeparator: I,
2607
2603
  separatorPlacements: q,
2608
2604
  trackCounts: {
2609
- column: g.length,
2610
- row: S.length
2605
+ column: S.length,
2606
+ row: y.length
2611
2607
  },
2612
- updateSeparatorProps: E
2608
+ updateSeparatorProps: R
2613
2609
  }),
2614
2610
  [
2615
- g.length,
2616
- $,
2617
- y,
2611
+ S.length,
2612
+ A,
2613
+ h,
2618
2614
  k.column,
2619
2615
  k.row,
2620
- f,
2616
+ m,
2621
2617
  C,
2622
2618
  I,
2623
- S.length,
2619
+ y.length,
2624
2620
  q,
2625
- E
2621
+ R
2626
2622
  ]
2627
2623
  ), X = B([]);
2628
2624
  ne(() => {
2629
- const L = A.current;
2625
+ const L = N.current;
2630
2626
  if (L === null)
2631
2627
  return;
2632
- const T = M.current, F = bo({
2628
+ const T = M.current, G = wo({
2633
2629
  cells: T.cells,
2634
2630
  separatorPlacements: T.separators,
2635
- trackCounts: { column: g.length, row: S.length }
2631
+ trackCounts: { column: S.length, row: y.length }
2636
2632
  });
2637
- F.forEach((D) => {
2638
- T.loggedErrors.has(D) || console.error(D);
2639
- }), T.loggedErrors = new Set(F);
2640
- const G = (D) => Array.from(T.separators.entries()).filter(([, U]) => U.axis === D).sort(([, U], [, pe]) => U.index - pe.index).map(([U]) => U), _ = (D) => {
2641
- const U = D === "column" ? g : S, pe = D === "column" ? S : g, he = U.map((Q) => Q.id), Ue = y(D), We = G(D), be = We.length > 0, Ye = U.map(
2633
+ G.forEach(($) => {
2634
+ T.loggedErrors.has($) || console.error($);
2635
+ }), T.loggedErrors = new Set(G);
2636
+ const O = ($) => Array.from(T.separators.entries()).filter(([, U]) => U.axis === $).sort(([, U], [, pe]) => U.index - pe.index).map(([U]) => U), _ = ($) => {
2637
+ const U = $ === "column" ? S : y, pe = $ === "column" ? y : S, he = U.map((Q) => Q.id), Ue = h($), We = O($), be = We.length > 0, Ye = U.map(
2642
2638
  ({ id: Q, ...oe }, ee) => ({
2643
2639
  // Tracks don't have DOM elements of their own;
2644
2640
  // the Grid element is used to resolve relative size constraints (e.g. "em")
@@ -2652,20 +2648,20 @@ function So({
2652
2648
  onResize: void 0,
2653
2649
  constraintProps: oe
2654
2650
  })
2655
- ), $e = () => {
2651
+ ), Ae = () => {
2656
2652
  const Q = [];
2657
2653
  if (be) {
2658
2654
  for (const [oe, ee] of T.separators)
2659
- if (ee.axis === D && pt(ee.index, U.length)) {
2660
- const Ne = oe.element.getBoundingClientRect();
2655
+ if (ee.axis === $ && mt(ee.index, U.length)) {
2656
+ const Oe = oe.element.getBoundingClientRect();
2661
2657
  Q[ee.index] = Math.max(
2662
2658
  Q[ee.index] ?? 0,
2663
- D === "column" ? Ne.width : Ne.height
2659
+ $ === "column" ? Oe.width : Oe.height
2664
2660
  );
2665
2661
  }
2666
2662
  }
2667
- return Nn({
2668
- axis: D,
2663
+ return Gn({
2664
+ axis: $,
2669
2665
  element: L,
2670
2666
  gutterSizes: Q.filter((oe) => oe !== void 0),
2671
2667
  hasGutters: be,
@@ -2673,13 +2669,13 @@ function So({
2673
2669
  trackIds: he
2674
2670
  });
2675
2671
  };
2676
- let Oe;
2677
- const at = P.defaultLayout?.[D === "column" ? "columns" : "rows"];
2672
+ let De;
2673
+ const at = P.defaultLayout?.[$ === "column" ? "columns" : "rows"];
2678
2674
  if (at !== void 0 && Object.keys(at).length === he.length) {
2679
- Oe = {};
2675
+ De = {};
2680
2676
  for (const Q of he) {
2681
2677
  const oe = at[Q];
2682
- oe !== void 0 && (Oe[Q] = oe);
2678
+ oe !== void 0 && (De[Q] = oe);
2683
2679
  }
2684
2680
  }
2685
2681
  return {
@@ -2690,34 +2686,34 @@ function So({
2690
2686
  getItemAriaControls: (Q) => {
2691
2687
  const oe = he.indexOf(Q);
2692
2688
  return T.cells.filter((ee) => {
2693
- const Ne = D === "column" ? ee.column : ee.row, Rn = D === "column" ? ee.columnSpan : ee.rowSpan;
2694
- return Ne <= oe && oe < Ne + Rn;
2689
+ const Oe = $ === "column" ? ee.column : ee.row, En = $ === "column" ? ee.columnSpan : ee.rowSpan;
2690
+ return Oe <= oe && oe < Oe + En;
2695
2691
  }).map((ee) => ee.element.id).filter(Boolean).join(" ") || void 0;
2696
2692
  },
2697
- calculateAvailableSize: () => $e().availableSize,
2693
+ calculateAvailableSize: () => Ae().availableSize,
2698
2694
  calculateHitRegions: ({
2699
2695
  expandHitTargets: Q,
2700
2696
  axis: oe,
2701
2697
  includeDisabled: ee
2702
- }) => On({
2703
- axis: D,
2698
+ }) => Nn({
2699
+ axis: $,
2704
2700
  cells: T.cells,
2705
2701
  crossTrackCount: pe.length,
2706
2702
  expandHitTargets: Q,
2707
2703
  resizeAxis: oe,
2708
- axisSize: $e().availableSize,
2704
+ axisSize: Ae().availableSize,
2709
2705
  includeDisabled: ee,
2710
2706
  separatorPlacements: T.separators
2711
2707
  }),
2712
- getItemSizeInPixels: (Q) => $e().trackSizes[he.indexOf(Q)] ?? 0
2708
+ getItemSizeInPixels: (Q) => Ae().trackSizes[he.indexOf(Q)] ?? 0
2713
2709
  },
2714
2710
  mutableState: {
2715
- defaultLayout: Oe,
2711
+ defaultLayout: De,
2716
2712
  disableCursor: !!P.disableCursor,
2717
- expandedItemSizes: T[D].expandedItemSizes,
2718
- layouts: T[D].layouts
2713
+ expandedItemSizes: T[$].expandedItemSizes,
2714
+ layouts: T[$].layouts
2719
2715
  },
2720
- orientation: D === "column" ? "horizontal" : "vertical",
2716
+ orientation: $ === "column" ? "horizontal" : "vertical",
2721
2717
  items: Ye,
2722
2718
  resizePreviewMode: "panel",
2723
2719
  get resizeTargetMinimumSize() {
@@ -2727,38 +2723,38 @@ function So({
2727
2723
  };
2728
2724
  }, V = Ce.map(_);
2729
2725
  X.current = V;
2730
- const j = V.map((D) => bn(D)), te = () => {
2731
- const [D, U] = V.map(
2726
+ const j = V.map(($) => wn($)), te = () => {
2727
+ const [$, U] = V.map(
2732
2728
  (pe) => ce(pe.id)
2733
2729
  );
2734
- if (!(!D || !U || D.defaultLayoutDeferred || U.defaultLayoutDeferred))
2730
+ if (!(!$ || !U || $.defaultLayoutDeferred || U.defaultLayoutDeferred))
2735
2731
  return {
2736
- layout: { columns: D.layout, rows: U.layout },
2732
+ layout: { columns: $.layout, rows: U.layout },
2737
2733
  requestedLayout: {
2738
- columns: D.requestedLayout,
2734
+ columns: $.requestedLayout,
2739
2735
  rows: U.requestedLayout
2740
2736
  }
2741
2737
  };
2742
2738
  };
2743
2739
  {
2744
- const D = te();
2745
- if (D)
2740
+ const $ = te();
2741
+ if ($)
2746
2742
  try {
2747
2743
  try {
2748
- R(D.layout);
2744
+ E($.layout);
2749
2745
  } finally {
2750
- O(
2751
- D.layout,
2746
+ F(
2747
+ $.layout,
2752
2748
  !1,
2753
- D.requestedLayout
2749
+ $.requestedLayout
2754
2750
  );
2755
2751
  }
2756
2752
  } catch (U) {
2757
2753
  throw X.current = [], j.forEach((pe) => pe()), U;
2758
2754
  }
2759
2755
  }
2760
- const Ae = V.map(
2761
- (D) => Be(D.id, (U) => {
2756
+ const ke = V.map(
2757
+ ($) => _e($.id, (U) => {
2762
2758
  const {
2763
2759
  defaultLayoutDeferred: pe,
2764
2760
  derivedItemConstraints: he,
@@ -2769,20 +2765,20 @@ function So({
2769
2765
  return;
2770
2766
  xn({
2771
2767
  derivedItemConstraints: he,
2772
- axis: D,
2768
+ axis: $,
2773
2769
  layout: Ue,
2774
2770
  prevLayout: U.prev?.layout,
2775
2771
  requestedLayout: We
2776
2772
  });
2777
2773
  const be = te();
2778
2774
  if (be) {
2779
- const Ye = ie(), $e = Ye.state !== "active" || !Ye.hitRegions.some(
2780
- (Oe) => V.includes(Oe.axis)
2775
+ const Ye = ie(), Ae = Ye.state !== "active" || !Ye.hitRegions.some(
2776
+ (De) => V.includes(De.axis)
2781
2777
  );
2782
2778
  try {
2783
- R(be.layout);
2779
+ E(be.layout);
2784
2780
  } finally {
2785
- $e && O(
2781
+ Ae && F(
2786
2782
  be.layout,
2787
2783
  U.isUserInteraction,
2788
2784
  be.requestedLayout
@@ -2792,38 +2788,38 @@ function So({
2792
2788
  })
2793
2789
  );
2794
2790
  return () => {
2795
- X.current = [], j.forEach((D) => D()), Ae.forEach((D) => D());
2791
+ X.current = [], j.forEach(($) => $()), ke.forEach(($) => $());
2796
2792
  };
2797
2793
  }, [
2798
- g,
2794
+ S,
2799
2795
  i,
2796
+ h,
2797
+ m,
2798
+ F,
2799
+ E,
2800
2800
  y,
2801
- f,
2802
- O,
2803
- R,
2804
- S,
2805
- w,
2801
+ x,
2806
2802
  P
2807
- ]), He(() => {
2803
+ ]), qe(() => {
2808
2804
  X.current.forEach((L) => {
2809
2805
  L.mutableState.defaultLayout = o?.[L.orientation === "horizontal" ? "columns" : "rows"], L.mutableState.disableCursor = !!r;
2810
2806
  });
2811
- }), mt(c, () => {
2807
+ }), ft(a, () => {
2812
2808
  const L = () => {
2813
- const [G, _] = Ce.map(y);
2814
- return !Re(G) || !Re(_) ? { columns: {}, rows: {} } : {
2815
- columns: _e({
2816
- axisId: G
2809
+ const [O, _] = Ce.map(h);
2810
+ return !Re(O) || !Re(_) ? { columns: {}, rows: {} } : {
2811
+ columns: Fe({
2812
+ axisId: O
2817
2813
  }).getLayout(),
2818
- rows: _e({ axisId: _ }).getLayout()
2814
+ rows: Fe({ axisId: _ }).getLayout()
2819
2815
  };
2820
- }, T = (G) => G.map((_) => `"${_}"`).join(", "), F = (G, _) => {
2821
- const V = y(G), j = () => {
2816
+ }, T = (O) => O.map((_) => `"${_}"`).join(", "), G = (O, _) => {
2817
+ const V = h(O), j = () => {
2822
2818
  const te = Re(V);
2823
- return N(te, `Grid "${f}" has not been mounted`), N(
2824
- te.items.some((Ae) => Ae.id === _),
2825
- `Grid "${f}" no longer contains a ${G} with id "${_}"; ${G} ids are ${T(te.items.map((Ae) => Ae.id))}`
2826
- ), zt({ axisId: V, itemId: _ });
2819
+ return D(te, `Grid "${m}" has not been mounted`), D(
2820
+ te.items.some((ke) => ke.id === _),
2821
+ `Grid "${m}" no longer contains a ${O} with id "${_}"; ${O} ids are ${T(te.items.map((ke) => ke.id))}`
2822
+ ), It({ axisId: V, itemId: _ });
2827
2823
  };
2828
2824
  return {
2829
2825
  collapse: () => j().collapse(),
@@ -2835,101 +2831,101 @@ function So({
2835
2831
  };
2836
2832
  return {
2837
2833
  getLayout: L,
2838
- getTrackById: (G, _) => {
2839
- const V = G === "column" ? g : S, j = `${_}`;
2840
- return N(
2834
+ getTrackById: (O, _) => {
2835
+ const V = O === "column" ? S : y, j = `${_}`;
2836
+ return D(
2841
2837
  V.some((te) => te.id === j),
2842
- `Grid "${f}" does not contain a ${G} with id "${j}"; ${G} ids are ${T(V.map((te) => te.id))}`
2843
- ), F(G, j);
2838
+ `Grid "${m}" does not contain a ${O} with id "${j}"; ${O} ids are ${T(V.map((te) => te.id))}`
2839
+ ), G(O, j);
2844
2840
  },
2845
- getTrackByIndex: (G, _) => {
2846
- const V = G === "column" ? g : S, j = Number.isInteger(_) ? V[_] : void 0;
2847
- return N(
2841
+ getTrackByIndex: (O, _) => {
2842
+ const V = O === "column" ? S : y, j = Number.isInteger(_) ? V[_] : void 0;
2843
+ return D(
2848
2844
  j,
2849
- `Grid "${f}" does not contain a ${G} at index ${_}; it has ${V.length} ${G}s`
2850
- ), F(G, j.id);
2845
+ `Grid "${m}" does not contain a ${O} at index ${_}; it has ${V.length} ${O}s`
2846
+ ), G(O, j.id);
2851
2847
  },
2852
- setLayout: (G) => (Ce.forEach((_) => {
2853
- const V = G[_ === "column" ? "columns" : "rows"], j = y(_);
2854
- V && Re(j) && _e({ axisId: j }).setLayout(V);
2848
+ setLayout: (O) => (Ce.forEach((_) => {
2849
+ const V = O[_ === "column" ? "columns" : "rows"], j = h(_);
2850
+ V && Re(j) && Fe({ axisId: j }).setLayout(V);
2855
2851
  }), L())
2856
2852
  };
2857
- }, [g, y, f, S]);
2858
- const K = () => Ce.map((L) => {
2859
- const T = ce(y(L)), F = z(L);
2860
- return (T && !T.defaultLayoutDeferred ? F.map((_) => `minmax(0, ${T.layout[_.id] ?? 1}fr)`) : vo(
2861
- F,
2853
+ }, [S, h, m, y]);
2854
+ const J = () => Ce.map((L) => {
2855
+ const T = ce(h(L)), G = z(L);
2856
+ return (T && !T.defaultLayoutDeferred ? G.map((_) => `minmax(0, ${T.layout[_.id] ?? 1}fr)`) : bo(
2857
+ G,
2862
2858
  o?.[L === "column" ? "columns" : "rows"]
2863
2859
  )).join(k[L] ? " auto " : " ");
2864
2860
  }).join("|"), ae = re(
2865
2861
  (L) => {
2866
2862
  const T = Ce.map(
2867
- (F) => Be(y(F), L)
2863
+ (G) => _e(h(G), L)
2868
2864
  );
2869
- return () => T.forEach((F) => F());
2865
+ return () => T.forEach((G) => G());
2870
2866
  },
2871
- [y]
2872
- ), we = tt(
2867
+ [h]
2868
+ ), xe = tt(
2873
2869
  ae,
2874
- K,
2875
- K
2876
- ), [ke, ze] = we.split("|");
2877
- return /* @__PURE__ */ Y(sn.Provider, { value: Z, children: /* @__PURE__ */ Y(
2870
+ J,
2871
+ J
2872
+ ), [$e, ze] = xe.split("|");
2873
+ return /* @__PURE__ */ Y(rn.Provider, { value: K, children: /* @__PURE__ */ Y(
2878
2874
  "div",
2879
2875
  {
2880
- ...m,
2876
+ ...f,
2881
2877
  className: t,
2882
2878
  "data-grid": !0,
2883
- "data-testid": je(m, s),
2884
- id: f,
2885
- ref: x,
2879
+ "data-testid": Ve(f, u),
2880
+ id: m,
2881
+ ref: w,
2886
2882
  style: {
2887
2883
  height: "100%",
2888
2884
  width: "100%",
2889
2885
  overflow: "hidden",
2890
- ...p,
2886
+ ...g,
2891
2887
  display: "grid",
2892
- gridTemplateColumns: ke,
2888
+ gridTemplateColumns: $e,
2893
2889
  gridTemplateRows: ze,
2894
2890
  // Inform the browser that the library is handling touch events for this element
2895
2891
  // NOTE This is not an inherited style
2896
2892
  touchAction: "none"
2897
2893
  },
2898
- children: /* @__PURE__ */ Y(It.Provider, { value: null, children: e })
2894
+ children: /* @__PURE__ */ Y(Lt.Provider, { value: null, children: e })
2899
2895
  }
2900
2896
  ) });
2901
2897
  }
2902
- So.displayName = "Grid";
2903
- function Qt(e, t) {
2898
+ vo.displayName = "Grid";
2899
+ function Zt(e, t) {
2904
2900
  const n = JSON.stringify(e);
2905
2901
  return Me(() => {
2906
2902
  const o = typeof e == "number" ? Array.from({ length: e }, (r, i) => ({ id: `${i}` })) : e.map((r, i) => ({
2907
2903
  ...r,
2908
2904
  id: `${r.id ?? i}`
2909
2905
  }));
2910
- return N(
2906
+ return D(
2911
2907
  o.length > 0,
2912
2908
  `Grid must have at least one track; "${t}" is ${n}`
2913
2909
  ), o;
2914
2910
  }, [n]);
2915
2911
  }
2916
- function Ln(e, t) {
2917
- Pn.forEach(e, (n) => {
2918
- if (rn(n))
2919
- if (n.type === In) {
2912
+ function Cn(e, t) {
2913
+ Tn.forEach(e, (n) => {
2914
+ if (on(n))
2915
+ if (n.type === Ln) {
2920
2916
  const { type: o } = n.props;
2921
2917
  o === "column" ? t.column = !0 : o === "row" && (t.row = !0);
2922
2918
  } else // Fragments
2923
- typeof n.type == "symbol" && n.props !== null && typeof n.props == "object" && "children" in n.props && Ln(n.props.children, t);
2919
+ typeof n.type == "symbol" && n.props !== null && typeof n.props == "object" && "children" in n.props && Cn(n.props.children, t);
2924
2920
  });
2925
2921
  }
2926
- function vo(e, t) {
2922
+ function bo(e, t) {
2927
2923
  if (t)
2928
2924
  return e.map(
2929
2925
  (i) => `minmax(0, ${t[i.id] ?? 1}fr)`
2930
2926
  );
2931
2927
  const n = e.map(
2932
- (i) => i.defaultSize === void 0 ? void 0 : cn(i.defaultSize)
2928
+ (i) => i.defaultSize === void 0 ? void 0 : an(i.defaultSize)
2933
2929
  );
2934
2930
  let o = 100, r = 0;
2935
2931
  return n.forEach((i) => {
@@ -2937,74 +2933,74 @@ function vo(e, t) {
2937
2933
  }), n.map((i) => {
2938
2934
  if (i === void 0)
2939
2935
  return `minmax(0, ${Math.max(0, o) / Math.max(1, r)}fr)`;
2940
- const [a, c] = i;
2941
- return c === "%" ? `minmax(0, ${a}fr)` : `${a}${c}`;
2936
+ const [s, a] = i;
2937
+ return a === "%" ? `minmax(0, ${s}fr)` : `${s}${a}`;
2942
2938
  });
2943
2939
  }
2944
- function bo({
2940
+ function wo({
2945
2941
  cells: e,
2946
2942
  separatorPlacements: t,
2947
2943
  trackCounts: n
2948
2944
  }) {
2949
2945
  const o = [];
2950
- for (const c of e)
2951
- Ce.forEach((s) => {
2952
- const [u, l] = s === "column" ? [c.column, c.columnSpan] : [c.row, c.rowSpan], d = n[s];
2953
- (!Number.isInteger(u) || !Number.isInteger(l) || u < 0 || l < 1 || u + l > d) && o.push(
2954
- `Invalid Cell ${s} placement (${s}: ${u}, ${s}Span: ${l}); Grid has ${d} ${s}s`
2946
+ for (const a of e)
2947
+ Ce.forEach((u) => {
2948
+ const [l, c] = u === "column" ? [a.column, a.columnSpan] : [a.row, a.rowSpan], d = n[u];
2949
+ (!Number.isInteger(l) || !Number.isInteger(c) || l < 0 || c < 1 || l + c > d) && o.push(
2950
+ `Invalid Cell ${u} placement (${u}: ${l}, ${u}Span: ${c}); Grid has ${d} ${u}s`
2955
2951
  );
2956
2952
  });
2957
2953
  const r = ({
2958
- axis: c,
2959
- crossSpan: s,
2960
- crossStart: u,
2961
- disabled: l,
2954
+ axis: a,
2955
+ crossSpan: u,
2956
+ crossStart: l,
2957
+ disabled: c,
2962
2958
  index: d
2963
2959
  }) => {
2964
- const h = c === "column" ? "row" : "column";
2965
- let p = `type="${c}" ${c}={${d}}`;
2966
- return (u !== 0 || s !== void 0) && (p += ` ${h}={${u}}`), s !== void 0 && (p += ` ${h}Span={${s}}`), l && (p += " disabled"), `<Gridline ${p} />`;
2960
+ const p = a === "column" ? "row" : "column";
2961
+ let g = `type="${a}" ${a}={${d}}`;
2962
+ return (l !== 0 || u !== void 0) && (g += ` ${p}={${l}}`), u !== void 0 && (g += ` ${p}Span={${u}}`), c && (g += " disabled"), `<Gridline ${g} />`;
2967
2963
  }, i = Array.from(t.values()).filter(
2968
- (c) => {
2969
- const { axis: s, crossSpan: u, crossStart: l, index: d } = c, h = s === "column" ? "row" : "column", p = n[s], m = n[h];
2970
- let f = !0;
2971
- return pt(d, p) || (o.push(
2972
- `Invalid ${s} Gridline ${s} (${d}); must be between 1 and ${p - 1}`
2973
- ), f = !1), !Number.isInteger(l) || l < 0 || l >= m ? (o.push(
2974
- `Invalid ${s} Gridline ${h} (${l}); must be between 0 and ${m - 1}`
2975
- ), f = !1) : u !== void 0 && (!Number.isInteger(u) || u < 1 || l + u > m) && (o.push(
2976
- `Invalid ${s} Gridline ${h}Span (${u}); Grid has ${m} ${h}s`
2977
- ), f = !1), f;
2978
- }
2979
- ), a = (c) => {
2980
- const s = n[c.axis === "column" ? "row" : "column"];
2964
+ (a) => {
2965
+ const { axis: u, crossSpan: l, crossStart: c, index: d } = a, p = u === "column" ? "row" : "column", g = n[u], f = n[p];
2966
+ let m = !0;
2967
+ return mt(d, g) || (o.push(
2968
+ `Invalid ${u} Gridline ${u} (${d}); must be between 1 and ${g - 1}`
2969
+ ), m = !1), !Number.isInteger(c) || c < 0 || c >= f ? (o.push(
2970
+ `Invalid ${u} Gridline ${p} (${c}); must be between 0 and ${f - 1}`
2971
+ ), m = !1) : l !== void 0 && (!Number.isInteger(l) || l < 1 || c + l > f) && (o.push(
2972
+ `Invalid ${u} Gridline ${p}Span (${l}); Grid has ${f} ${p}s`
2973
+ ), m = !1), m;
2974
+ }
2975
+ ), s = (a) => {
2976
+ const u = n[a.axis === "column" ? "row" : "column"];
2981
2977
  return [
2982
- c.crossStart,
2983
- c.crossSpan === void 0 ? s : c.crossStart + c.crossSpan
2978
+ a.crossStart,
2979
+ a.crossSpan === void 0 ? u : a.crossStart + a.crossSpan
2984
2980
  ];
2985
2981
  };
2986
- return i.forEach((c, s) => {
2987
- const { axis: u, index: l } = c, [d, h] = a(c);
2988
- for (const p of e) {
2989
- const [m, f, y, g] = u === "column" ? [p.column, p.columnSpan, p.row, p.rowSpan] : [p.row, p.rowSpan, p.column, p.columnSpan];
2990
- if (m < l && l < m + f && y < h && d < y + g) {
2991
- const S = u === "column" ? "row" : "column";
2982
+ return i.forEach((a, u) => {
2983
+ const { axis: l, index: c } = a, [d, p] = s(a);
2984
+ for (const g of e) {
2985
+ const [f, m, h, S] = l === "column" ? [g.column, g.columnSpan, g.row, g.rowSpan] : [g.row, g.rowSpan, g.column, g.columnSpan];
2986
+ if (f < c && c < f + m && h < p && d < h + S) {
2987
+ const y = l === "column" ? "row" : "column";
2992
2988
  o.push(
2993
- `${r(c)} overlaps a Cell that spans across it (${u}: ${m}, ${u}Span: ${f}, ${S}: ${y}, ${S}Span: ${g}); use the ${S} and ${S}Span props to render gridlines beside the Cell instead`
2989
+ `${r(a)} overlaps a Cell that spans across it (${l}: ${f}, ${l}Span: ${m}, ${y}: ${h}, ${y}Span: ${S}); use the ${y} and ${y}Span props to render gridlines beside the Cell instead`
2994
2990
  );
2995
2991
  }
2996
2992
  }
2997
- for (const p of i.slice(s + 1))
2998
- if (p.axis === u && p.index === l) {
2999
- const [m, f] = a(p);
3000
- m < h && d < f && o.push(`${r(c)} overlaps ${r(p)}`);
2993
+ for (const g of i.slice(u + 1))
2994
+ if (g.axis === l && g.index === c) {
2995
+ const [f, m] = s(g);
2996
+ f < p && d < m && o.push(`${r(a)} overlaps ${r(g)}`);
3001
2997
  }
3002
2998
  }), o;
3003
2999
  }
3004
- function en(e, t) {
3000
+ function Qt(e, t) {
3005
3001
  return se(e.columns, t.columns) && se(e.rows, t.rows);
3006
3002
  }
3007
- function _o({
3003
+ function Bo({
3008
3004
  id: e,
3009
3005
  onlySaveAfterUserInteractions: t,
3010
3006
  storage: n = localStorage
@@ -3016,21 +3012,21 @@ function _o({
3016
3012
  ), i = Me(() => {
3017
3013
  if (r)
3018
3014
  try {
3019
- const c = JSON.parse(r);
3020
- if (c !== null && typeof c == "object")
3021
- return c;
3015
+ const a = JSON.parse(r);
3016
+ if (a !== null && typeof a == "object")
3017
+ return a;
3022
3018
  } catch {
3023
3019
  }
3024
- }, [r]), a = re(
3025
- (c, s) => {
3026
- if (!(t && !s.isUserInteraction))
3020
+ }, [r]), s = re(
3021
+ (a, u) => {
3022
+ if (!(t && !u.isUserInteraction))
3027
3023
  try {
3028
3024
  n.setItem(
3029
3025
  o,
3030
- JSON.stringify(s.requestedLayout ?? c)
3026
+ JSON.stringify(u.requestedLayout ?? a)
3031
3027
  );
3032
- } catch (u) {
3033
- console.error(u);
3028
+ } catch (l) {
3029
+ console.error(l);
3034
3030
  }
3035
3031
  },
3036
3032
  [t, n, o]
@@ -3043,44 +3039,44 @@ function _o({
3043
3039
  /**
3044
3040
  * Attach this callback on the `Grid` as the `onLayoutChanged` prop.
3045
3041
  */
3046
- onLayoutChanged: a
3042
+ onLayoutChanged: s
3047
3043
  };
3048
3044
  }
3049
3045
  function xo() {
3050
3046
  return function() {
3051
3047
  };
3052
3048
  }
3053
- function Bo() {
3049
+ function qo() {
3054
3050
  return ge(null);
3055
3051
  }
3056
- function qo() {
3052
+ function Ho() {
3057
3053
  return B(null);
3058
3054
  }
3059
- function wo(e) {
3055
+ function zo(e) {
3060
3056
  for (let t = 1; t < e.length; t++)
3061
- if (yt(e[t - 1], e[t]) > 0)
3057
+ if (gt(e[t - 1], e[t]) > 0)
3062
3058
  return !1;
3063
3059
  return !0;
3064
3060
  }
3065
- function zo({
3061
+ function Io({
3066
3062
  separator: e
3067
3063
  }) {
3068
3064
  const { element: t } = e, n = B(null);
3069
3065
  return ne(() => {
3070
- const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], a = t.ownerDocument.defaultView;
3071
- return r.forEach((c, s) => {
3072
- const u = i[s];
3073
- if (u instanceof a.HTMLElement || u instanceof a.SVGElement) {
3074
- const l = a.getComputedStyle(c);
3075
- for (let d = 0; d < l.length; d++) {
3076
- const h = l.item(d);
3077
- u.style.setProperty(
3078
- h,
3079
- l.getPropertyValue(h)
3066
+ const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], s = t.ownerDocument.defaultView;
3067
+ return r.forEach((a, u) => {
3068
+ const l = i[u];
3069
+ if (l instanceof s.HTMLElement || l instanceof s.SVGElement) {
3070
+ const c = s.getComputedStyle(a);
3071
+ for (let d = 0; d < c.length; d++) {
3072
+ const p = c.item(d);
3073
+ l.style.setProperty(
3074
+ p,
3075
+ c.getPropertyValue(p)
3080
3076
  );
3081
3077
  }
3082
3078
  }
3083
- u.removeAttribute("data-testid"), u.removeAttribute("id");
3079
+ l.removeAttribute("data-testid"), l.removeAttribute("id");
3084
3080
  }), Object.assign(o.style, {
3085
3081
  boxSizing: "border-box",
3086
3082
  height: "100%",
@@ -3103,23 +3099,23 @@ function zo({
3103
3099
  );
3104
3100
  }
3105
3101
  function st() {
3106
- const e = on(It);
3107
- return N(
3102
+ const e = nn(Lt);
3103
+ return D(
3108
3104
  e,
3109
3105
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
3110
3106
  ), e;
3111
3107
  }
3112
- function Cn(e) {
3108
+ function Rn(e) {
3113
3109
  const { registerOverlay: t } = st(), n = B(e);
3114
- vn(n.current, e) || (n.current = e);
3110
+ Sn(n.current, e) || (n.current = e);
3115
3111
  const o = n.current;
3116
3112
  return ne(
3117
3113
  () => t(o),
3118
3114
  [t, o]
3119
3115
  ), null;
3120
3116
  }
3121
- Cn.displayName = "SeparatorOverlay";
3122
- function Io({
3117
+ Rn.displayName = "SeparatorOverlay";
3118
+ function Lo({
3123
3119
  active: e,
3124
3120
  orientation: t,
3125
3121
  style: n,
@@ -3156,20 +3152,20 @@ function Io({
3156
3152
  }
3157
3153
  );
3158
3154
  }
3159
- function Lo({
3155
+ function Co({
3160
3156
  overlay: e,
3161
3157
  preview: t
3162
3158
  }) {
3163
- const { axis: n, offset: o, rect: r, separator: i } = t, a = n.orientation === "horizontal";
3164
- let c = i?.preview, s = e;
3165
- return rn(c) && c.type === Cn && (s = c.props, c = void 0), c == null && (s ? c = /* @__PURE__ */ Y(
3166
- Io,
3159
+ const { axis: n, offset: o, rect: r, separator: i } = t, s = n.orientation === "horizontal";
3160
+ let a = i?.preview, u = e;
3161
+ return on(a) && a.type === Rn && (u = a.props, a = void 0), a == null && (u ? a = /* @__PURE__ */ Y(
3162
+ Lo,
3167
3163
  {
3168
- ...s,
3164
+ ...u,
3169
3165
  active: t.active,
3170
3166
  orientation: n.orientation
3171
3167
  }
3172
- ) : i && (c = /* @__PURE__ */ Y(zo, { separator: i }))), /* @__PURE__ */ Y(
3168
+ ) : i && (a = /* @__PURE__ */ Y(Io, { separator: i }))), /* @__PURE__ */ Y(
3173
3169
  "div",
3174
3170
  {
3175
3171
  "aria-hidden": "true",
@@ -3181,243 +3177,245 @@ function Lo({
3181
3177
  pointerEvents: "none",
3182
3178
  position: "absolute",
3183
3179
  top: r.top,
3184
- transform: a ? `translateX(${o}px)` : `translateY(${o}px)`,
3180
+ transform: s ? `translateX(${o}px)` : `translateY(${o}px)`,
3185
3181
  width: r.width
3186
3182
  },
3187
- children: c
3183
+ children: a
3188
3184
  }
3189
3185
  );
3190
3186
  }
3191
- function Co(e) {
3192
- return Array.from(e).sort(yt);
3187
+ function Ro(e) {
3188
+ return Array.from(e).sort(gt);
3193
3189
  }
3194
- function Ro(e, t) {
3190
+ function Eo(e, t) {
3195
3191
  const n = B({
3196
3192
  getLayout: () => ({}),
3197
- setLayout: Bn
3193
+ setLayout: qn
3198
3194
  });
3199
- mt(t, () => n.current, []), ne(() => {
3195
+ ft(t, () => n.current, []), ne(() => {
3200
3196
  Object.assign(
3201
3197
  n.current,
3202
- _e({ axisId: e })
3198
+ Fe({ axisId: e })
3203
3199
  );
3204
3200
  });
3205
3201
  }
3206
- function Eo({
3202
+ function Mo({
3207
3203
  groupId: e,
3208
3204
  resizePreviewMode: t
3209
3205
  }) {
3210
3206
  const [n, o] = ge([]), r = B(n);
3211
3207
  return ne(() => {
3212
- const i = (c) => {
3213
- const s = Re(e), u = t === "separator" && c.state === "active" ? c.previews.filter(
3214
- (d) => d.axis === s && (d.active || !W(d.offset, 0))
3215
- ) : [], l = r.current;
3216
- l.length === u.length && u.every(
3217
- (d, h) => d === l[h]
3218
- ) || (r.current = u, o(u));
3208
+ const i = (a) => {
3209
+ const u = Re(e), l = t === "separator" && a.state === "active" ? a.previews.filter(
3210
+ (d) => d.axis === u && (d.active || !W(d.offset, 0))
3211
+ ) : [], c = r.current;
3212
+ c.length === l.length && l.every(
3213
+ (d, p) => d === c[p]
3214
+ ) || (r.current = l, o(l));
3219
3215
  };
3220
3216
  if (t !== "separator") {
3221
3217
  i(ie());
3222
3218
  return;
3223
3219
  }
3224
- const a = gt(
3225
- ({ next: c }) => i(c)
3220
+ const s = ht(
3221
+ ({ next: a }) => i(a)
3226
3222
  );
3227
- return i(ie()), a;
3223
+ return i(ie()), s;
3228
3224
  }, [e, t]), n;
3229
3225
  }
3230
- function Mo({
3226
+ function Po({
3231
3227
  children: e,
3232
3228
  className: t,
3233
3229
  defaultLayout: n,
3234
3230
  disableCursor: o,
3235
3231
  disabled: r,
3236
3232
  elementRef: i,
3237
- groupRef: a,
3238
- id: c,
3239
- onLayoutChange: s,
3240
- onLayoutChanged: u,
3241
- orientation: l = "horizontal",
3233
+ groupRef: s,
3234
+ id: a,
3235
+ onLayoutChange: u,
3236
+ onLayoutChanged: l,
3237
+ orientation: c = "horizontal",
3242
3238
  resizePreviewMode: d = "panel",
3243
- resizeTargetMinimumSize: h = {
3239
+ resizeTargetMinimumSize: p = {
3244
3240
  coarse: 20,
3245
3241
  fine: 10
3246
3242
  },
3247
- style: p,
3248
- ...m
3243
+ style: g,
3244
+ ...f
3249
3245
  }) {
3250
- const f = B({
3246
+ const m = B({
3251
3247
  onLayoutChange: {},
3252
3248
  onLayoutChanged: {}
3253
- }), y = Se((I) => {
3254
- se(f.current.onLayoutChange, I) || (f.current.onLayoutChange = I, s?.(I));
3255
- }), g = Se(
3256
- (I, E, q) => {
3257
- se(f.current.onLayoutChanged, I) || (f.current.onLayoutChanged = I, u?.(I, { isUserInteraction: E, requestedLayout: q }));
3258
- }
3259
- ), S = Te(c), [z, b] = ge(), R = Eo({
3260
- groupId: S,
3249
+ }), h = Se((I) => {
3250
+ se(m.current.onLayoutChange, I) || (m.current.onLayoutChange = I, u?.(I));
3251
+ }), S = Se(
3252
+ (I, R, q) => {
3253
+ se(m.current.onLayoutChanged, I) || (m.current.onLayoutChanged = I, l?.(I, { isUserInteraction: R, requestedLayout: q }));
3254
+ }
3255
+ ), y = Pe(a), [z, b] = ge(), E = Mo({
3256
+ groupId: y,
3261
3257
  resizePreviewMode: d
3262
- }), O = B(null), [A, x] = wn(), w = B([]), v = B({
3258
+ }), F = B(null), [N, w] = zn(), x = B([]), v = B({
3263
3259
  lastExpandedPanelSizes: {},
3264
3260
  layouts: {},
3265
3261
  panels: [],
3266
3262
  separators: []
3267
- }), M = Ve(O, i);
3268
- Ro(S, a);
3263
+ }), M = He(F, i);
3264
+ Eo(y, s);
3269
3265
  const k = Se(
3270
- (I, E) => {
3266
+ (I, R) => {
3271
3267
  const q = ce(I);
3272
3268
  if (q)
3273
3269
  return {
3274
- flexGrow: q.layout[E] ?? 1
3270
+ flexGrow: q.layout[R] ?? 1
3275
3271
  };
3276
- if (n?.[E])
3272
+ if (n?.[R])
3277
3273
  return {
3278
- flexGrow: n?.[E]
3274
+ flexGrow: n?.[R]
3279
3275
  };
3280
3276
  }
3281
3277
  ), P = it({
3282
3278
  defaultLayout: n,
3283
3279
  disableCursor: o,
3284
- resizeTargetMinimumSize: h
3285
- }), $ = Me(
3280
+ resizeTargetMinimumSize: p
3281
+ }), A = Me(
3286
3282
  () => ({
3287
3283
  get disableCursor() {
3288
3284
  return !!P.disableCursor;
3289
3285
  },
3290
3286
  getPanelStyles: k,
3291
- id: S,
3292
- orientation: l,
3287
+ id: y,
3288
+ orientation: c,
3293
3289
  registerPanel: (I) => {
3294
- const E = v.current;
3295
- return E.panels = Ge(l, [
3296
- ...E.panels,
3290
+ const R = v.current;
3291
+ return R.panels = Ne(c, [
3292
+ ...R.panels,
3297
3293
  I
3298
- ]), x(), () => {
3299
- E.panels = E.panels.filter(
3294
+ ]), w(), () => {
3295
+ R.panels = R.panels.filter(
3300
3296
  (q) => q !== I
3301
- ), x();
3297
+ ), w();
3302
3298
  };
3303
3299
  },
3304
3300
  registerOverlay: (I) => (b(I), () => {
3305
3301
  b(void 0);
3306
3302
  }),
3307
3303
  registerSeparator: (I) => {
3308
- const E = v.current;
3309
- return E.separators = Ge(l, [
3310
- ...E.separators,
3304
+ const R = v.current;
3305
+ return R.separators = Ne(c, [
3306
+ ...R.separators,
3311
3307
  I
3312
- ]), x(), () => {
3313
- E.separators = E.separators.filter(
3308
+ ]), w(), () => {
3309
+ R.separators = R.separators.filter(
3314
3310
  (q) => q !== I
3315
- ), x();
3311
+ ), w();
3316
3312
  };
3317
3313
  },
3318
- updatePanelProps: (I, { disabled: E }) => {
3319
- const Z = v.current.panels.find(
3314
+ updatePanelProps: (I, { disabled: R }) => {
3315
+ const K = v.current.panels.find(
3320
3316
  (ae) => ae.id === I
3321
3317
  );
3322
- Z && (Z.constraintProps.disabled = E);
3323
- const X = Re(S), K = ce(S);
3324
- X && K && me(X, {
3325
- ...K,
3326
- derivedItemConstraints: ft(X)
3318
+ if (!K || K.constraintProps.disabled === R)
3319
+ return;
3320
+ K.constraintProps.disabled = R;
3321
+ const X = Re(y), J = ce(y);
3322
+ X && J && me(X, {
3323
+ ...J,
3324
+ derivedItemConstraints: St(X)
3327
3325
  });
3328
3326
  },
3329
3327
  updateSeparatorProps: (I, {
3330
- disabled: E,
3328
+ disabled: R,
3331
3329
  disableDoubleClick: q
3332
3330
  }) => {
3333
3331
  const X = v.current.separators.find(
3334
- (K) => K.id === I
3332
+ (J) => J.id === I
3335
3333
  );
3336
- X && (X.disabled = E, X.disableDoubleClick = q);
3334
+ X && (X.disabled = R, X.disableDoubleClick = q);
3337
3335
  }
3338
3336
  }),
3339
- [k, S, x, l, P]
3337
+ [k, y, w, c, P]
3340
3338
  ), C = B(null);
3341
3339
  return ne(() => {
3342
- const I = O.current;
3340
+ const I = F.current;
3343
3341
  if (I === null)
3344
3342
  return;
3345
- const E = v.current;
3346
- E.panels = Ge(
3347
- l,
3348
- E.panels
3349
- ), E.separators = Ge(
3350
- l,
3351
- E.separators
3352
- ), w.current = Co([
3353
- ...E.panels.map(({ element: L }) => L),
3354
- ...E.separators.map(({ element: L }) => L)
3343
+ const R = v.current;
3344
+ R.panels = Ne(
3345
+ c,
3346
+ R.panels
3347
+ ), R.separators = Ne(
3348
+ c,
3349
+ R.separators
3350
+ ), x.current = Ro([
3351
+ ...R.panels.map(({ element: L }) => L),
3352
+ ...R.separators.map(({ element: L }) => L)
3355
3353
  ]);
3356
3354
  let q;
3357
- if (P.defaultLayout !== void 0 && Object.keys(P.defaultLayout).length === E.panels.length) {
3355
+ if (P.defaultLayout !== void 0 && Object.keys(P.defaultLayout).length === R.panels.length) {
3358
3356
  q = {};
3359
- for (const L of E.panels) {
3357
+ for (const L of R.panels) {
3360
3358
  const T = P.defaultLayout[L.id];
3361
3359
  T !== void 0 && (q[L.id] = T);
3362
3360
  }
3363
3361
  }
3364
- const Z = {
3362
+ const K = {
3365
3363
  disabled: !!r,
3366
3364
  element: I,
3367
- id: S,
3365
+ id: y,
3368
3366
  mutableState: {
3369
3367
  defaultLayout: q,
3370
3368
  disableCursor: !!P.disableCursor,
3371
3369
  expandedItemSizes: v.current.lastExpandedPanelSizes,
3372
3370
  layouts: v.current.layouts
3373
3371
  },
3374
- orientation: l,
3375
- items: E.panels,
3372
+ orientation: c,
3373
+ items: R.panels,
3376
3374
  resizePreviewMode: d,
3377
3375
  get resizeTargetMinimumSize() {
3378
3376
  return P.resizeTargetMinimumSize;
3379
3377
  },
3380
- separators: E.separators
3378
+ separators: R.separators
3381
3379
  };
3382
- C.current = Z;
3383
- const X = bn(Z), {
3384
- defaultLayoutDeferred: K,
3380
+ C.current = K;
3381
+ const X = wn(K), {
3382
+ defaultLayoutDeferred: J,
3385
3383
  derivedItemConstraints: ae,
3386
- layout: we,
3387
- requestedLayout: ke
3388
- } = ce(Z.id, !0);
3389
- if (!K && ae.length > 0)
3384
+ layout: xe,
3385
+ requestedLayout: $e
3386
+ } = ce(K.id, !0);
3387
+ if (!J && ae.length > 0)
3390
3388
  try {
3391
3389
  try {
3392
- y(we);
3390
+ h(xe);
3393
3391
  } finally {
3394
- g(we, !1, ke);
3392
+ S(xe, !1, $e);
3395
3393
  }
3396
3394
  } catch (L) {
3397
3395
  throw C.current = null, X(), L;
3398
3396
  }
3399
- const ze = Be(S, (L) => {
3397
+ const ze = _e(y, (L) => {
3400
3398
  const {
3401
3399
  defaultLayoutDeferred: T,
3402
- derivedItemConstraints: F,
3403
- layout: G,
3400
+ derivedItemConstraints: G,
3401
+ layout: O,
3404
3402
  requestedLayout: _
3405
3403
  } = L.next;
3406
- if (T || F.length === 0)
3404
+ if (T || G.length === 0)
3407
3405
  return;
3408
3406
  xn({
3409
- derivedItemConstraints: F,
3410
- axis: Z,
3411
- layout: G,
3407
+ derivedItemConstraints: G,
3408
+ axis: K,
3409
+ layout: O,
3412
3410
  prevLayout: L.prev?.layout,
3413
3411
  requestedLayout: _
3414
3412
  });
3415
- const V = ie(), j = V.state !== "active" || !V.hitRegions.some((te) => te.axis === Z);
3413
+ const V = ie(), j = V.state !== "active" || !V.hitRegions.some((te) => te.axis === K);
3416
3414
  try {
3417
- y(G);
3415
+ h(O);
3418
3416
  } finally {
3419
- j && g(
3420
- G,
3417
+ j && S(
3418
+ O,
3421
3419
  L.isUserInteraction,
3422
3420
  _
3423
3421
  );
@@ -3428,46 +3426,46 @@ function Mo({
3428
3426
  };
3429
3427
  }, [
3430
3428
  r,
3431
- S,
3432
- g,
3433
3429
  y,
3434
- l,
3435
- A,
3430
+ S,
3431
+ h,
3432
+ c,
3433
+ N,
3436
3434
  d,
3437
3435
  P
3438
3436
  ]), ne(() => {
3439
- wo(w.current) || x();
3440
- }), He(() => {
3437
+ zo(x.current) || w();
3438
+ }), qe(() => {
3441
3439
  const I = C.current;
3442
3440
  I && (I.mutableState.defaultLayout = n, I.mutableState.disableCursor = !!o);
3443
- }), /* @__PURE__ */ Y(It.Provider, { value: $, children: /* @__PURE__ */ En(
3441
+ }), /* @__PURE__ */ Y(Lt.Provider, { value: A, children: /* @__PURE__ */ Mn(
3444
3442
  "div",
3445
3443
  {
3446
- ...m,
3444
+ ...f,
3447
3445
  className: t,
3448
3446
  "data-group": !0,
3449
- "data-testid": je(m, c),
3450
- id: S,
3447
+ "data-testid": Ve(f, a),
3448
+ id: y,
3451
3449
  ref: M,
3452
3450
  style: {
3453
3451
  height: "100%",
3454
3452
  width: "100%",
3455
3453
  overflow: "hidden",
3456
3454
  position: d === "separator" ? "relative" : void 0,
3457
- ...p,
3455
+ ...g,
3458
3456
  display: "flex",
3459
- flexDirection: l === "horizontal" ? "row" : "column",
3457
+ flexDirection: c === "horizontal" ? "row" : "column",
3460
3458
  flexWrap: "nowrap",
3461
3459
  // Inform the browser that the library is handling touch events for this element
3462
3460
  // but still allow users to scroll content within panels in the non-resizing direction
3463
3461
  // NOTE This is not an inherited style
3464
3462
  // See github.com/bvaughn/react-resizable-panels/issues/662
3465
- touchAction: l === "horizontal" ? "pan-y" : "pan-x"
3463
+ touchAction: c === "horizontal" ? "pan-y" : "pan-x"
3466
3464
  },
3467
3465
  children: [
3468
3466
  e,
3469
- R.map((I) => /* @__PURE__ */ Y(
3470
- Lo,
3467
+ E.map((I) => /* @__PURE__ */ Y(
3468
+ Co,
3471
3469
  {
3472
3470
  overlay: z,
3473
3471
  preview: I
@@ -3478,11 +3476,11 @@ function Mo({
3478
3476
  }
3479
3477
  ) });
3480
3478
  }
3481
- Mo.displayName = "Group";
3479
+ Po.displayName = "Group";
3482
3480
  function Qe(e, t) {
3483
3481
  return `react-resizable-panels:${[e, ...t].join(":")}`;
3484
3482
  }
3485
- function Po({
3483
+ function To({
3486
3484
  id: e,
3487
3485
  panelIds: t,
3488
3486
  storage: n
@@ -3492,24 +3490,24 @@ function Po({
3492
3490
  try {
3493
3491
  const i = JSON.parse(r);
3494
3492
  if (t) {
3495
- const a = t.join(","), c = i[a];
3496
- if (c && Array.isArray(c.layout) && t.length === c.layout.length) {
3497
- const s = {};
3498
- for (let u = 0; u < t.length; u++)
3499
- s[t[u]] = c.layout[u];
3500
- return s;
3493
+ const s = t.join(","), a = i[s];
3494
+ if (a && Array.isArray(a.layout) && t.length === a.layout.length) {
3495
+ const u = {};
3496
+ for (let l = 0; l < t.length; l++)
3497
+ u[t[l]] = a.layout[l];
3498
+ return u;
3501
3499
  }
3502
3500
  } else {
3503
- const a = Object.keys(i);
3504
- if (a.length === 1) {
3505
- const c = i[a[0]];
3506
- if (c && Array.isArray(c.layout)) {
3507
- const s = a[0].split(",");
3508
- if (s.length === c.layout.length) {
3509
- const u = {};
3510
- for (let l = 0; l < s.length; l++)
3511
- u[s[l]] = c.layout[l];
3512
- return u;
3501
+ const s = Object.keys(i);
3502
+ if (s.length === 1) {
3503
+ const a = i[s[0]];
3504
+ if (a && Array.isArray(a.layout)) {
3505
+ const u = s[0].split(",");
3506
+ if (u.length === a.layout.length) {
3507
+ const l = {};
3508
+ for (let c = 0; c < u.length; c++)
3509
+ l[u[c]] = a.layout[c];
3510
+ return l;
3513
3511
  }
3514
3512
  }
3515
3513
  }
@@ -3517,70 +3515,70 @@ function Po({
3517
3515
  } catch {
3518
3516
  }
3519
3517
  }
3520
- function Ho({
3518
+ function Vo({
3521
3519
  debounceSaveMs: e = 100,
3522
3520
  onlySaveAfterUserInteractions: t,
3523
3521
  panelIds: n,
3524
3522
  storage: o = localStorage,
3525
3523
  ...r
3526
3524
  }) {
3527
- const i = n !== void 0, a = "id" in r ? r.id : r.groupId, c = Qe(a, n ?? []), s = tt(
3528
- To,
3529
- () => o.getItem(c),
3530
- () => o.getItem(c)
3531
- ), u = Me(() => {
3532
- if (s) {
3533
- const y = JSON.parse(s), g = Object.values(y);
3534
- if (Array.from(g).every((S) => typeof S == "number"))
3535
- return y;
3536
- }
3537
- }, [s]), l = Me(() => {
3538
- if (!u)
3539
- return Po({
3540
- id: a,
3525
+ const i = n !== void 0, s = "id" in r ? r.id : r.groupId, a = Qe(s, n ?? []), u = tt(
3526
+ $o,
3527
+ () => o.getItem(a),
3528
+ () => o.getItem(a)
3529
+ ), l = Me(() => {
3530
+ if (u) {
3531
+ const h = JSON.parse(u), S = Object.values(h);
3532
+ if (Array.from(S).every((y) => typeof y == "number"))
3533
+ return h;
3534
+ }
3535
+ }, [u]), c = Me(() => {
3536
+ if (!l)
3537
+ return To({
3538
+ id: s,
3541
3539
  panelIds: n,
3542
3540
  storage: o
3543
3541
  });
3544
- }, [u, a, n, o]), d = u ?? l, h = B(null), p = re(() => {
3545
- const y = h.current;
3546
- y && (h.current = null, clearTimeout(y));
3542
+ }, [l, s, n, o]), d = l ?? c, p = B(null), g = re(() => {
3543
+ const h = p.current;
3544
+ h && (p.current = null, clearTimeout(h));
3547
3545
  }, []);
3548
- tn(() => () => {
3549
- p();
3550
- }, [p]);
3551
- const m = re(
3546
+ en(() => () => {
3547
+ g();
3548
+ }, [g]);
3549
+ const f = re(
3552
3550
  // The hook persists every layout commit -- including library-driven ones --
3553
3551
  // because it owns its own storage and the goal is to remember whatever
3554
3552
  // layout the user is currently looking at. Consumers that only want to
3555
3553
  // persist on user interaction should branch on `isUserInteraction` in
3556
3554
  // their own callback (see #716) rather than via this hook.
3557
- (y, g) => {
3558
- if (t && !g.isUserInteraction)
3555
+ (h, S) => {
3556
+ if (t && !S.isUserInteraction)
3559
3557
  return;
3560
- p();
3561
- const S = g.requestedLayout ?? y;
3558
+ g();
3559
+ const y = S.requestedLayout ?? h;
3562
3560
  let z;
3563
- i ? z = Qe(a, Object.keys(S)) : z = Qe(a, []);
3561
+ i ? z = Qe(s, Object.keys(y)) : z = Qe(s, []);
3564
3562
  try {
3565
- o.setItem(z, JSON.stringify(S));
3563
+ o.setItem(z, JSON.stringify(y));
3566
3564
  } catch (b) {
3567
3565
  console.error(b);
3568
3566
  }
3569
3567
  },
3570
3568
  [
3571
- p,
3569
+ g,
3572
3570
  i,
3573
- a,
3571
+ s,
3574
3572
  t,
3575
3573
  o
3576
3574
  ]
3577
- ), f = re(
3578
- (y) => {
3579
- p(), e === 0 ? m(y, { isUserInteraction: !1 }) : h.current = setTimeout(() => {
3580
- m(y, { isUserInteraction: !1 });
3575
+ ), m = re(
3576
+ (h) => {
3577
+ g(), e === 0 ? f(h, { isUserInteraction: !1 }) : p.current = setTimeout(() => {
3578
+ f(h, { isUserInteraction: !1 });
3581
3579
  }, e);
3582
3580
  },
3583
- [p, e, m]
3581
+ [g, e, f]
3584
3582
  );
3585
3583
  return {
3586
3584
  /**
@@ -3592,24 +3590,24 @@ function Ho({
3592
3590
  *
3593
3591
  * @deprecated Use the {@link onLayoutChanged} prop instead.
3594
3592
  */
3595
- onLayoutChange: f,
3593
+ onLayoutChange: m,
3596
3594
  /**
3597
3595
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
3598
3596
  */
3599
- onLayoutChanged: m
3597
+ onLayoutChanged: f
3600
3598
  };
3601
3599
  }
3602
- function To() {
3600
+ function $o() {
3603
3601
  return function() {
3604
3602
  };
3605
3603
  }
3606
- function Vo() {
3604
+ function jo() {
3607
3605
  return ge(null);
3608
3606
  }
3609
- function jo() {
3607
+ function Uo() {
3610
3608
  return B(null);
3611
3609
  }
3612
- function Do(e, t) {
3610
+ function ko(e, t) {
3613
3611
  const { id: n } = st(), o = B({
3614
3612
  collapse: ct,
3615
3613
  expand: ct,
@@ -3620,42 +3618,42 @@ function Do(e, t) {
3620
3618
  isCollapsed: () => !1,
3621
3619
  resize: ct
3622
3620
  });
3623
- mt(t, () => o.current, []), ne(() => {
3621
+ ft(t, () => o.current, []), ne(() => {
3624
3622
  Object.assign(
3625
3623
  o.current,
3626
- zt({ axisId: n, itemId: e })
3624
+ It({ axisId: n, itemId: e })
3627
3625
  );
3628
3626
  });
3629
3627
  }
3630
- function ko({
3628
+ function Ao({
3631
3629
  children: e,
3632
3630
  className: t,
3633
3631
  collapsedSize: n = "0%",
3634
3632
  collapsedThreshold: o,
3635
3633
  collapsible: r = !1,
3636
3634
  defaultSize: i,
3637
- disabled: a,
3638
- elementRef: c,
3639
- groupResizeBehavior: s = "preserve-relative-size",
3640
- id: u,
3641
- maxSize: l = "100%",
3635
+ disabled: s,
3636
+ elementRef: a,
3637
+ groupResizeBehavior: u = "preserve-relative-size",
3638
+ id: l,
3639
+ maxSize: c = "100%",
3642
3640
  minSize: d = "0%",
3643
- onResize: h,
3644
- panelRef: p,
3645
- style: m,
3646
- ...f
3641
+ onResize: p,
3642
+ panelRef: g,
3643
+ style: f,
3644
+ ...m
3647
3645
  }) {
3648
- const y = et(u), g = Te(u), S = it({
3649
- disabled: a
3650
- }), z = B(null), b = Ve(z, c), {
3651
- getPanelStyles: R,
3652
- id: O,
3653
- orientation: A,
3654
- registerPanel: x,
3655
- updatePanelProps: w
3656
- } = st(), v = h !== null, M = Se(
3657
- (C, I, E) => {
3658
- h?.(C, u, E);
3646
+ const h = et(l), S = Pe(l), y = it({
3647
+ disabled: s
3648
+ }), z = B(null), b = He(z, a), {
3649
+ getPanelStyles: E,
3650
+ id: F,
3651
+ orientation: N,
3652
+ registerPanel: w,
3653
+ updatePanelProps: x
3654
+ } = st(), v = p !== null, M = Se(
3655
+ (C, I, R) => {
3656
+ p?.(C, l, R);
3659
3657
  }
3660
3658
  );
3661
3659
  ne(() => {
@@ -3663,73 +3661,73 @@ function ko({
3663
3661
  if (C !== null) {
3664
3662
  const I = {
3665
3663
  element: C,
3666
- id: g,
3667
- idIsStable: y,
3664
+ id: S,
3665
+ idIsStable: h,
3668
3666
  mutableValues: {
3669
3667
  expandToSize: void 0,
3670
3668
  prevSize: void 0
3671
3669
  },
3672
3670
  onResize: v ? M : void 0,
3673
3671
  constraintProps: {
3674
- groupResizeBehavior: s,
3672
+ groupResizeBehavior: u,
3675
3673
  collapsedSize: n,
3676
3674
  collapsedThreshold: o,
3677
3675
  collapsible: r,
3678
3676
  defaultSize: i,
3679
- disabled: S.disabled,
3680
- maxSize: l,
3677
+ disabled: y.disabled,
3678
+ maxSize: c,
3681
3679
  minSize: d
3682
3680
  }
3683
3681
  };
3684
- return x(I);
3682
+ return w(I);
3685
3683
  }
3686
3684
  }, [
3687
- s,
3685
+ u,
3688
3686
  n,
3689
3687
  o,
3690
3688
  r,
3691
3689
  i,
3692
3690
  v,
3693
- g,
3694
- y,
3695
- l,
3691
+ S,
3692
+ h,
3693
+ c,
3696
3694
  d,
3697
3695
  M,
3698
- x,
3699
- S
3700
- ]), He(() => {
3701
- w(g, { disabled: a });
3702
- }, [a, g, w]), Do(g, p);
3696
+ w,
3697
+ y
3698
+ ]), qe(() => {
3699
+ x(S, { disabled: s });
3700
+ }, [s, S, x]), ko(S, g);
3703
3701
  const k = () => {
3704
- const C = R(O, g);
3702
+ const C = E(F, S);
3705
3703
  if (C)
3706
3704
  return JSON.stringify(C);
3707
3705
  }, P = tt(
3708
- (C) => Be(O, C),
3706
+ (C) => _e(F, C),
3709
3707
  k,
3710
3708
  k
3711
3709
  );
3712
- let $;
3713
- return P ? $ = JSON.parse(P) : i !== void 0 ? $ = {
3710
+ let A;
3711
+ return P ? A = JSON.parse(P) : i !== void 0 ? A = {
3714
3712
  flexGrow: void 0,
3715
3713
  flexShrink: void 0,
3716
3714
  flexBasis: i
3717
- } : $ = { flexGrow: 1 }, /* @__PURE__ */ Y(
3715
+ } : A = { flexGrow: 1 }, /* @__PURE__ */ Y(
3718
3716
  "div",
3719
3717
  {
3720
- ...f,
3721
- "data-disabled": a || void 0,
3718
+ ...m,
3719
+ "data-disabled": s || void 0,
3722
3720
  "data-panel": !0,
3723
- "data-testid": je(f, u),
3724
- id: g,
3721
+ "data-testid": Ve(m, l),
3722
+ id: S,
3725
3723
  ref: b,
3726
3724
  style: {
3727
- ...Ao,
3725
+ ...Do,
3728
3726
  display: "flex",
3729
3727
  flexBasis: 0,
3730
3728
  flexShrink: 1,
3731
3729
  overflow: "visible",
3732
- ...$
3730
+ ...A
3733
3731
  },
3734
3732
  children: /* @__PURE__ */ Y(
3735
3733
  "div",
@@ -3740,12 +3738,12 @@ function ko({
3740
3738
  maxWidth: "100%",
3741
3739
  flexGrow: 1,
3742
3740
  overflow: "auto",
3743
- ...m,
3741
+ ...f,
3744
3742
  // Inform the browser that the library is handling touch events for this element
3745
3743
  // but still allow users to scroll content within panels in the non-resizing direction
3746
3744
  // NOTE This is not an inherited style
3747
3745
  // See github.com/bvaughn/react-resizable-panels/issues/662
3748
- touchAction: A === "horizontal" ? "pan-y" : "pan-x"
3746
+ touchAction: N === "horizontal" ? "pan-y" : "pan-x"
3749
3747
  },
3750
3748
  children: e
3751
3749
  }
@@ -3753,8 +3751,8 @@ function ko({
3753
3751
  }
3754
3752
  );
3755
3753
  }
3756
- ko.displayName = "Panel";
3757
- const Ao = {
3754
+ Ao.displayName = "Panel";
3755
+ const Do = {
3758
3756
  minHeight: 0,
3759
3757
  maxHeight: "100%",
3760
3758
  height: "auto",
@@ -3766,71 +3764,71 @@ const Ao = {
3766
3764
  padding: 0,
3767
3765
  margin: 0
3768
3766
  };
3769
- function Uo() {
3767
+ function Wo() {
3770
3768
  return ge(null);
3771
3769
  }
3772
- function Wo() {
3770
+ function Yo() {
3773
3771
  return B(null);
3774
3772
  }
3775
- const $o = { flexBasis: "auto" }, Oo = { flexGrow: 0, flexShrink: 0 };
3776
- function No({
3773
+ const Oo = { flexBasis: "auto" }, No = { flexGrow: 0, flexShrink: 0 };
3774
+ function Go({
3777
3775
  children: e,
3778
3776
  className: t,
3779
3777
  disabled: n,
3780
3778
  disableDoubleClick: o,
3781
3779
  elementRef: r,
3782
3780
  id: i,
3783
- preview: a,
3784
- style: c,
3785
- ...s
3781
+ preview: s,
3782
+ style: a,
3783
+ ...u
3786
3784
  }) {
3787
- const u = Te(i), {
3788
- disableCursor: l,
3785
+ const l = Pe(i), {
3786
+ disableCursor: c,
3789
3787
  id: d,
3790
- orientation: h,
3791
- registerSeparator: p,
3792
- updateSeparatorProps: m
3788
+ orientation: p,
3789
+ registerSeparator: g,
3790
+ updateSeparatorProps: f
3793
3791
  } = st();
3794
3792
  return /* @__PURE__ */ Y(
3795
- zn,
3793
+ In,
3796
3794
  {
3797
- attributes: s,
3795
+ attributes: u,
3798
3796
  axisId: d,
3799
- axisOrientation: h,
3797
+ axisOrientation: p,
3800
3798
  className: t,
3801
- "data-testid": je(s, i),
3802
- disableCursor: l,
3799
+ "data-testid": Ve(u, i),
3800
+ disableCursor: c,
3803
3801
  disabled: n,
3804
3802
  disableDoubleClick: o,
3805
3803
  elementRef: r,
3806
- id: u,
3807
- preview: a,
3808
- registerSeparator: p,
3809
- requiredStyle: Oo,
3810
- style: c,
3811
- styleDefaults: $o,
3812
- updateSeparatorProps: m,
3804
+ id: l,
3805
+ preview: s,
3806
+ registerSeparator: g,
3807
+ requiredStyle: No,
3808
+ style: a,
3809
+ styleDefaults: Oo,
3810
+ updateSeparatorProps: f,
3813
3811
  children: e
3814
3812
  }
3815
3813
  );
3816
3814
  }
3817
- No.displayName = "Separator";
3815
+ Go.displayName = "Separator";
3818
3816
  export {
3819
- An as Cell,
3820
- So as Grid,
3821
- In as Gridline,
3822
- Mo as Group,
3823
- ko as Panel,
3824
- No as Separator,
3825
- Cn as SeparatorOverlay,
3826
- $n as isCoarsePointer,
3827
- _o as useDefaultGridLayout,
3828
- Ho as useDefaultLayout,
3829
- Bo as useGridCallbackRef,
3830
- qo as useGridRef,
3831
- Vo as useGroupCallbackRef,
3832
- jo as useGroupRef,
3833
- Uo as usePanelCallbackRef,
3834
- Wo as usePanelRef
3817
+ Dn as Cell,
3818
+ vo as Grid,
3819
+ Ln as Gridline,
3820
+ Po as Group,
3821
+ Ao as Panel,
3822
+ Go as Separator,
3823
+ Rn as SeparatorOverlay,
3824
+ On as isCoarsePointer,
3825
+ Bo as useDefaultGridLayout,
3826
+ Vo as useDefaultLayout,
3827
+ qo as useGridCallbackRef,
3828
+ Ho as useGridRef,
3829
+ jo as useGroupCallbackRef,
3830
+ Uo as useGroupRef,
3831
+ Wo as usePanelCallbackRef,
3832
+ Yo as usePanelRef
3835
3833
  };
3836
3834
  //# sourceMappingURL=react-resizable-panels.js.map