react-resizable-panels 4.13.0 → 4.13.2

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,21 +1,21 @@
1
1
  "use client";
2
- import { jsx as B, jsxs as zt } from "react/jsx-runtime";
3
- import { useState as Z, useCallback as ce, useId as wt, useLayoutEffect as Ze, useEffect as Se, useRef as D, createContext as Pt, useContext as Lt, isValidElement as Ct, useImperativeHandle as Qe, useMemo as Pe, useSyncExternalStore as et } from "react";
4
- function Rt(e, t) {
2
+ import { jsx as B, jsxs as wt } from "react/jsx-runtime";
3
+ import { useState as Z, useCallback as ce, useId as Pt, useLayoutEffect as Qe, useEffect as Se, useRef as D, createContext as Lt, useContext as Ct, isValidElement as Rt, useImperativeHandle as et, useMemo as Pe, useSyncExternalStore as tt } from "react";
4
+ function Mt(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
7
7
  }
8
- function Mt(e, t) {
8
+ function Et(e, t) {
9
9
  const n = getComputedStyle(e.ownerDocument.documentElement), o = parseFloat(n.fontSize);
10
10
  return t * o;
11
11
  }
12
- function Et(e) {
12
+ function It(e) {
13
13
  return e / 100 * window.innerHeight;
14
14
  }
15
- function It(e) {
15
+ function kt(e) {
16
16
  return e / 100 * window.innerWidth;
17
17
  }
18
- function kt(e) {
18
+ function Ot(e) {
19
19
  switch (typeof e) {
20
20
  case "number":
21
21
  return [e, "px"];
@@ -31,7 +31,7 @@ function ie({
31
31
  styleProp: n
32
32
  }) {
33
33
  let o;
34
- const [r, i] = kt(n);
34
+ const [r, i] = Ot(n);
35
35
  switch (i) {
36
36
  case "%": {
37
37
  o = r / 100 * e;
@@ -42,25 +42,25 @@ function ie({
42
42
  break;
43
43
  }
44
44
  case "rem": {
45
- o = Mt(t, r);
45
+ o = Et(t, r);
46
46
  break;
47
47
  }
48
48
  case "em": {
49
- o = Rt(t, r);
49
+ o = Mt(t, r);
50
50
  break;
51
51
  }
52
52
  case "vh": {
53
- o = Et(r);
53
+ o = It(r);
54
54
  break;
55
55
  }
56
56
  case "vw": {
57
- o = It(r);
57
+ o = kt(r);
58
58
  break;
59
59
  }
60
60
  }
61
61
  return o;
62
62
  }
63
- function A(e) {
63
+ function F(e) {
64
64
  return parseFloat(e.toFixed(3));
65
65
  }
66
66
  function ae({
@@ -82,65 +82,65 @@ function Le(e) {
82
82
  panelId: o.id
83
83
  })) : t.map((o) => {
84
84
  const { element: r, panelConstraints: i } = o;
85
- let c = 0;
85
+ let s = 0;
86
86
  if (i.collapsedSize !== void 0) {
87
87
  const f = ie({
88
88
  groupSize: n,
89
89
  panelElement: r,
90
90
  styleProp: i.collapsedSize
91
91
  });
92
- c = A(f / n * 100);
92
+ s = F(f / n * 100);
93
93
  }
94
- let l;
94
+ let u;
95
95
  if (i.collapsedThreshold !== void 0) {
96
96
  const f = ie({
97
97
  groupSize: n,
98
98
  panelElement: r,
99
99
  styleProp: i.collapsedThreshold
100
100
  });
101
- l = A(f / n * 100);
101
+ u = F(f / n * 100);
102
102
  }
103
- let a;
103
+ let c;
104
104
  if (i.defaultSize !== void 0) {
105
105
  const f = ie({
106
106
  groupSize: n,
107
107
  panelElement: r,
108
108
  styleProp: i.defaultSize
109
109
  });
110
- a = A(f / n * 100);
110
+ c = F(f / n * 100);
111
111
  }
112
- let s = 0;
112
+ let a = 0;
113
113
  if (i.minSize !== void 0) {
114
114
  const f = ie({
115
115
  groupSize: n,
116
116
  panelElement: r,
117
117
  styleProp: i.minSize
118
118
  });
119
- s = A(f / n * 100);
119
+ a = F(f / n * 100);
120
120
  }
121
- let u = 100;
121
+ let l = 100;
122
122
  if (i.maxSize !== void 0) {
123
123
  const f = ie({
124
124
  groupSize: n,
125
125
  panelElement: r,
126
126
  styleProp: i.maxSize
127
127
  });
128
- u = A(f / n * 100);
128
+ l = F(f / n * 100);
129
129
  }
130
130
  return {
131
131
  groupResizeBehavior: i.groupResizeBehavior,
132
- collapsedSize: c,
133
- collapsedThreshold: l,
132
+ collapsedSize: s,
133
+ collapsedThreshold: u,
134
134
  collapsible: i.collapsible === !0,
135
- defaultSize: a,
135
+ defaultSize: c,
136
136
  disabled: i.disabled,
137
- minSize: s,
138
- maxSize: u,
137
+ minSize: a,
138
+ maxSize: l,
139
139
  panelId: o.id
140
140
  };
141
141
  });
142
142
  }
143
- class tt {
143
+ class nt {
144
144
  #e = {};
145
145
  addListener(t, n) {
146
146
  const o = this.#e[t];
@@ -155,13 +155,13 @@ class tt {
155
155
  o[0].call(null, n);
156
156
  else {
157
157
  let r = !1, i = null;
158
- const c = Array.from(o);
159
- for (let l = 0; l < c.length; l++) {
160
- const a = c[l];
158
+ const s = Array.from(o);
159
+ for (let u = 0; u < s.length; u++) {
160
+ const c = s[u];
161
161
  try {
162
- a.call(null, n);
163
- } catch (s) {
164
- i === null && (r = !0, i = s);
162
+ c.call(null, n);
163
+ } catch (a) {
164
+ i === null && (r = !0, i = a);
165
165
  }
166
166
  }
167
167
  if (r)
@@ -183,36 +183,38 @@ let k = {
183
183
  cursorFlags: 0,
184
184
  state: "inactive"
185
185
  };
186
- const Re = new tt();
187
- function X() {
186
+ const Re = new nt();
187
+ function q() {
188
188
  return k;
189
189
  }
190
- function nt(e) {
190
+ function ot(e) {
191
191
  return Re.addListener("change", e);
192
192
  }
193
- function Tt(e, t = [], n) {
194
- const o = k, r = { ...k };
195
- r.cursorFlags = e, r.state === "active" && (r.previews = t, n && (r.previewLayoutMap = n)), k = r, Re.emit("change", {
196
- prev: o,
197
- next: r
193
+ function Tt(e, t = [], n, o = !1) {
194
+ const r = k, i = { ...k };
195
+ i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), k = i, Re.emit("change", {
196
+ prev: r,
197
+ next: i
198
198
  });
199
199
  }
200
- function U(e) {
200
+ function W(e) {
201
201
  const t = k;
202
- k = e, Re.emit("change", {
202
+ k = e, t.state === "active" && e.state !== "active" && t.didPointerMove && t.hitRegions.forEach(({ separator: n }) => {
203
+ n && n.element.ownerDocument.activeElement === n.element && n.element.blur();
204
+ }), Re.emit("change", {
203
205
  prev: t,
204
206
  next: e
205
207
  });
206
208
  }
207
- function Ot(e) {
208
- k.state !== "active" || !k.previews.some((t) => t.separator === e) || U({
209
+ function Dt(e) {
210
+ k.state !== "active" || !k.previews.some((t) => t.separator === e) || W({
209
211
  ...k,
210
212
  previews: k.previews.map(
211
213
  (t) => t.separator === e ? { ...t } : t
212
214
  )
213
215
  });
214
216
  }
215
- function Dt(e) {
217
+ function Nt(e) {
216
218
  if (k.state === "inactive")
217
219
  return !1;
218
220
  const t = k.hitRegions.filter(
@@ -221,10 +223,10 @@ function Dt(e) {
221
223
  if (t.length === k.hitRegions.length && !n)
222
224
  return !1;
223
225
  if (t.length === 0)
224
- U({ cursorFlags: 0, state: "inactive" });
226
+ W({ cursorFlags: 0, state: "inactive" });
225
227
  else if (k.state === "active") {
226
228
  const o = new Map(k.initialLayoutMap), r = new Map(k.previewLayoutMap);
227
- o.delete(e), r.delete(e), U({
229
+ o.delete(e), r.delete(e), W({
228
230
  ...k,
229
231
  cursorFlags: 0,
230
232
  hitRegions: t,
@@ -233,16 +235,16 @@ function Dt(e) {
233
235
  previews: k.previews.filter((i) => i.group !== e)
234
236
  });
235
237
  } else
236
- U({ ...k, hitRegions: t });
238
+ W({ ...k, hitRegions: t });
237
239
  return !0;
238
240
  }
239
- const At = (e) => e, we = () => {
240
- }, ot = 1, rt = 2, it = 4, st = 8, Ge = 3, Fe = 12;
241
+ const Gt = (e) => e, we = () => {
242
+ }, rt = 1, it = 2, st = 4, at = 8, Ae = 3, Fe = 12;
241
243
  let me;
242
- function Ne() {
244
+ function _e() {
243
245
  return me === void 0 && (me = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (me = !0)), me;
244
246
  }
245
- function Gt({
247
+ function At({
246
248
  cursorFlags: e,
247
249
  groups: t,
248
250
  state: n
@@ -268,39 +270,39 @@ function Gt({
268
270
  if (!(o === 0 && r === 0)) {
269
271
  switch (n) {
270
272
  case "active": {
271
- if (e && Ne()) {
272
- const i = (e & ot) !== 0, c = (e & rt) !== 0, l = (e & it) !== 0, a = (e & st) !== 0;
273
+ if (e && _e()) {
274
+ const i = (e & rt) !== 0, s = (e & it) !== 0, u = (e & st) !== 0, c = (e & at) !== 0;
273
275
  if (i)
274
- return l ? "se-resize" : a ? "ne-resize" : "e-resize";
275
- if (c)
276
- return l ? "sw-resize" : a ? "nw-resize" : "w-resize";
277
- if (l)
276
+ return u ? "se-resize" : c ? "ne-resize" : "e-resize";
277
+ if (s)
278
+ return u ? "sw-resize" : c ? "nw-resize" : "w-resize";
279
+ if (u)
278
280
  return "s-resize";
279
- if (a)
281
+ if (c)
280
282
  return "n-resize";
281
283
  }
282
284
  break;
283
285
  }
284
286
  }
285
- return Ne() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
287
+ return _e() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
286
288
  }
287
289
  }
288
- const _e = /* @__PURE__ */ new WeakMap();
290
+ const $e = /* @__PURE__ */ new WeakMap();
289
291
  function fe(e) {
290
292
  if (!e.defaultView || !e.adoptedStyleSheets)
291
293
  return;
292
- let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
294
+ let { prevStyle: t, styleSheet: n } = $e.get(e) ?? {};
293
295
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
294
296
  ...e.adoptedStyleSheets,
295
297
  n
296
298
  ]));
297
- const o = X();
299
+ const o = q();
298
300
  switch (o.state) {
299
301
  case "active":
300
302
  case "hover": {
301
- const r = Gt({
303
+ const r = At({
302
304
  cursorFlags: o.cursorFlags,
303
- groups: o.hitRegions.map((c) => c.group),
305
+ groups: o.hitRegions.map((s) => s.group),
304
306
  state: o.state
305
307
  }), i = `*, *:hover {cursor: ${r} !important; }`;
306
308
  if (t === i)
@@ -313,32 +315,36 @@ function fe(e) {
313
315
  break;
314
316
  }
315
317
  }
316
- _e.set(e, {
318
+ $e.set(e, {
317
319
  prevStyle: t,
318
320
  styleSheet: n
319
321
  });
320
322
  }
321
- function R(e, t = "Assertion error") {
323
+ function L(e, t = "Assertion error") {
322
324
  if (!e)
323
325
  throw Error(t);
324
326
  }
325
327
  function Ce(e, t) {
326
- return Array.from(t).sort(
327
- e === "horizontal" ? Ft : Nt
328
- );
328
+ return Array.from(t).sort((n, o) => {
329
+ const r = e === "horizontal" ? Ft(n, o) : _t(n, o);
330
+ if (r !== 0)
331
+ return r;
332
+ const i = n.element.compareDocumentPosition(o.element);
333
+ return i & Node.DOCUMENT_POSITION_DISCONNECTED ? 0 : i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
334
+ });
329
335
  }
330
336
  function Ft(e, t) {
331
337
  const n = e.element.offsetLeft - t.element.offsetLeft;
332
338
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
333
339
  }
334
- function Nt(e, t) {
340
+ function _t(e, t) {
335
341
  const n = e.element.offsetTop - t.element.offsetTop;
336
342
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
337
343
  }
338
- function at(e) {
344
+ function lt(e) {
339
345
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
340
346
  }
341
- function lt(e, t) {
347
+ function ct(e, t) {
342
348
  return {
343
349
  x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
344
350
  Math.abs(e.x - t.left),
@@ -350,7 +356,7 @@ function lt(e, t) {
350
356
  )
351
357
  };
352
358
  }
353
- function _t({
359
+ function $t({
354
360
  orientation: e,
355
361
  rects: t,
356
362
  targetRect: n
@@ -360,14 +366,14 @@ function _t({
360
366
  y: n.y + n.height / 2
361
367
  };
362
368
  let r, i = Number.MAX_VALUE;
363
- for (const c of t) {
364
- const { x: l, y: a } = lt(o, c), s = e === "horizontal" ? l : a;
365
- s < i && (i = s, r = c);
369
+ for (const s of t) {
370
+ const { x: u, y: c } = ct(o, s), a = e === "horizontal" ? u : c;
371
+ a < i && (i = a, r = s);
366
372
  }
367
- return R(r, "No rect found"), r;
373
+ return L(r, "No rect found"), r;
368
374
  }
369
375
  let ge;
370
- function $t() {
376
+ function Ht() {
371
377
  return ge === void 0 && (typeof matchMedia == "function" ? ge = !!matchMedia("(pointer:coarse)").matches : ge = !1), ge;
372
378
  }
373
379
  function Me({
@@ -375,158 +381,158 @@ function Me({
375
381
  group: t,
376
382
  includeDisabled: n = !1
377
383
  }) {
378
- const { element: o, orientation: r, panels: i, separators: c } = t, l = Ce(
384
+ const { element: o, orientation: r, panels: i, separators: s } = t, u = Ce(
379
385
  r,
380
- Array.from(o.children).filter(at).filter((h) => !h.hasAttribute("data-resize-preview")).map((h) => ({ element: h }))
381
- ).map(({ element: h }) => h), a = [];
382
- let s = !1, u = !1, f = -1, d = -1, v = 0, z, p = [];
386
+ Array.from(o.children).filter(lt).filter((h) => !h.hasAttribute("data-resize-preview")).map((h) => ({ element: h }))
387
+ ).map(({ element: h }) => h), c = [];
388
+ let a = !1, l = !1, f = -1, y, p = -1, g = 0, d, v = [];
383
389
  {
384
390
  let h = -1;
385
- for (const g of l)
386
- g.hasAttribute("data-panel") && (h++, g.hasAttribute("data-disabled") || (v++, f === -1 && (f = h), d = h));
391
+ for (const m of u)
392
+ m.hasAttribute("data-panel") && (h++, m.hasAttribute("data-disabled") || (g++, f === -1 && (f = h), p = h));
387
393
  }
388
- if (n || v > 1) {
394
+ if (n || g > 1) {
389
395
  let h = -1;
390
- for (const g of l)
391
- if (g.hasAttribute("data-panel")) {
396
+ for (const m of u)
397
+ if (m.hasAttribute("data-panel")) {
392
398
  h++;
393
- const y = i.find(
394
- (m) => m.element === g
399
+ const x = i.find(
400
+ (S) => S.element === m
395
401
  );
396
- if (y) {
397
- if (z) {
398
- const m = z.element.getBoundingClientRect(), b = g.getBoundingClientRect();
399
- let x;
400
- if (u) {
401
- const L = r === "horizontal" ? new DOMRect(
402
- m.right,
403
- m.top,
402
+ if (x) {
403
+ if (d) {
404
+ const S = d.element.getBoundingClientRect(), P = m.getBoundingClientRect();
405
+ let C;
406
+ if (l) {
407
+ const E = r === "horizontal" ? new DOMRect(
408
+ S.right,
409
+ S.top,
404
410
  0,
405
- m.height
411
+ S.height
406
412
  ) : new DOMRect(
407
- m.left,
408
- m.bottom,
409
- m.width,
413
+ S.left,
414
+ S.bottom,
415
+ S.width,
410
416
  0
411
- ), w = r === "horizontal" ? new DOMRect(b.left, b.top, 0, b.height) : new DOMRect(b.left, b.top, b.width, 0);
412
- switch (p.length) {
417
+ ), w = r === "horizontal" ? new DOMRect(P.left, P.top, 0, P.height) : new DOMRect(P.left, P.top, P.width, 0);
418
+ switch (v.length) {
413
419
  case 0: {
414
- x = [
415
- L,
420
+ C = [
421
+ E,
416
422
  w
417
423
  ];
418
424
  break;
419
425
  }
420
426
  case 1: {
421
- const C = p[0], M = _t({
427
+ const R = v[0], N = $t({
422
428
  orientation: r,
423
- rects: [m, b],
424
- targetRect: C.element.getBoundingClientRect()
429
+ rects: [S, P],
430
+ targetRect: R.element.getBoundingClientRect()
425
431
  });
426
- x = [
427
- C,
428
- M === m ? w : L
432
+ C = [
433
+ R,
434
+ N === S ? w : E
429
435
  ];
430
436
  break;
431
437
  }
432
438
  default: {
433
- x = p;
439
+ C = v;
434
440
  break;
435
441
  }
436
442
  }
437
443
  } else
438
- p.length ? x = p : x = [
444
+ v.length ? C = v : C = [
439
445
  r === "horizontal" ? new DOMRect(
440
- m.right,
441
- b.top,
442
- b.left - m.right,
443
- b.height
446
+ S.right,
447
+ P.top,
448
+ P.left - S.right,
449
+ P.height
444
450
  ) : new DOMRect(
445
- b.left,
446
- m.bottom,
447
- b.width,
448
- b.top - m.bottom
451
+ P.left,
452
+ S.bottom,
453
+ P.width,
454
+ P.top - S.bottom
449
455
  )
450
456
  ];
451
- for (const L of x) {
452
- let w = "width" in L ? L : L.element.getBoundingClientRect();
453
- const C = e ? $t() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
454
- if (w.width < C) {
455
- const T = C - w.width;
457
+ for (const E of C) {
458
+ let w = "width" in E ? E : E.element.getBoundingClientRect();
459
+ const R = e ? Ht() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
460
+ if (w.width < R) {
461
+ const O = R - w.width;
456
462
  w = new DOMRect(
457
- w.x - T / 2,
463
+ w.x - O / 2,
458
464
  w.y,
459
- w.width + T,
465
+ w.width + O,
460
466
  w.height
461
467
  );
462
468
  }
463
- if (w.height < C) {
464
- const T = C - w.height;
469
+ if (w.height < R) {
470
+ const O = R - w.height;
465
471
  w = new DOMRect(
466
472
  w.x,
467
- w.y - T / 2,
473
+ w.y - O / 2,
468
474
  w.width,
469
- w.height + T
475
+ w.height + O
470
476
  );
471
477
  }
472
- const M = h <= f || h > d;
473
- (n || !s && !M) && a.push({
478
+ const N = h <= f || h > p;
479
+ (n || !a && !N) && (y ??= ae({ group: t }), c.push({
474
480
  group: t,
475
- groupSize: ae({ group: t }),
476
- panels: [z, y],
477
- separator: "width" in L ? void 0 : L,
481
+ groupSize: y,
482
+ panels: [d, x],
483
+ separator: "width" in E ? void 0 : E,
478
484
  rect: w
479
- }), s = !1;
485
+ })), a = !1;
480
486
  }
481
487
  }
482
- u = !1, z = y, p = [];
488
+ l = !1, d = x, v = [];
483
489
  }
484
- } else if (g.hasAttribute("data-separator")) {
485
- g.ariaDisabled !== null && (s = !0);
486
- const y = c.find(
487
- (m) => m.element === g
490
+ } else if (m.hasAttribute("data-separator")) {
491
+ m.ariaDisabled !== null && (a = !0);
492
+ const x = s.find(
493
+ (S) => S.element === m
488
494
  );
489
- y ? p.push(y) : (z = void 0, p = []);
495
+ x ? v.push(x) : (d = void 0, v = []);
490
496
  } else
491
- u = !0;
497
+ l = !0;
492
498
  }
493
- return a;
499
+ return c;
494
500
  }
495
- let V = /* @__PURE__ */ new Map();
496
- const ct = new tt();
497
- function jt(e) {
498
- V = new Map(V), V.delete(e);
501
+ let U = /* @__PURE__ */ new Map();
502
+ const ut = new nt();
503
+ function Vt(e) {
504
+ U = new Map(U), U.delete(e);
499
505
  }
500
- function ut(e, t) {
501
- for (const [n] of V)
506
+ function ft(e, t) {
507
+ for (const [n] of U)
502
508
  if (n.id === e)
503
509
  return n;
504
510
  }
505
511
  function Q(e, t) {
506
- for (const [n, o] of V)
512
+ for (const [n, o] of U)
507
513
  if (n.id === e)
508
514
  return o;
509
515
  if (t)
510
516
  throw Error(`Could not find data for Group with id ${e}`);
511
517
  }
512
518
  function ee() {
513
- return V;
519
+ return U;
514
520
  }
515
521
  function Ee(e, t) {
516
- return ct.addListener("groupChange", (n) => {
522
+ return ut.addListener("groupChange", (n) => {
517
523
  n.group.id === e && t(n);
518
524
  });
519
525
  }
520
- function K(e, t, n) {
521
- const o = V.get(e);
522
- V = new Map(V), V.set(e, t), ct.emit("groupChange", {
526
+ function X(e, t, n) {
527
+ const o = U.get(e);
528
+ U = new Map(U), U.set(e, t), ut.emit("groupChange", {
523
529
  group: e,
524
530
  isUserInteraction: n?.isUserInteraction === !0,
525
531
  prev: o,
526
532
  next: t
527
533
  });
528
534
  }
529
- function Ht(e, t) {
535
+ function jt(e, t) {
530
536
  if (e.length !== t.length)
531
537
  return !1;
532
538
  for (let n = 0; n < e.length; n++)
@@ -534,11 +540,11 @@ function Ht(e, t) {
534
540
  return !1;
535
541
  return !0;
536
542
  }
537
- function O(e, t, n = 0) {
538
- return Math.abs(A(e) - A(t)) <= n;
543
+ function T(e, t, n = 0) {
544
+ return Math.abs(F(e) - F(t)) <= n;
539
545
  }
540
- function H(e, t) {
541
- return O(e, t) ? 0 : e > t ? 1 : -1;
546
+ function j(e, t) {
547
+ return T(e, t) ? 0 : e > t ? 1 : -1;
542
548
  }
543
549
  function se({
544
550
  overrideDisabledPanels: e,
@@ -549,20 +555,20 @@ function se({
549
555
  const {
550
556
  collapsedSize: r = 0,
551
557
  collapsedThreshold: i,
552
- collapsible: c,
553
- disabled: l,
554
- maxSize: a = 100,
555
- minSize: s = 0
558
+ collapsible: s,
559
+ disabled: u,
560
+ maxSize: c = 100,
561
+ minSize: a = 0
556
562
  } = t;
557
- if (l && !e)
563
+ if (u && !e)
558
564
  return n;
559
- if (H(o, s) < 0)
560
- if (c) {
561
- const u = i ?? (s - r) / 2, f = H(n, r) <= 0, d = f ? r + u : s - u, v = H(o, d);
562
- H(o, r) <= 0 || v < 0 || i !== void 0 && f && v === 0 ? o = r : o = s;
565
+ if (j(o, a) < 0)
566
+ if (s) {
567
+ const l = i ?? (a - r) / 2, f = j(n, r) <= 0, y = f ? r + l : a - l, p = j(o, y);
568
+ j(o, r) <= 0 || p < 0 || i !== void 0 && f && p === 0 ? o = r : o = a;
563
569
  } else
564
- o = s;
565
- return o = Math.min(a, o), o = A(o), o;
570
+ o = a;
571
+ return o = Math.min(c, o), o = F(o), o;
566
572
  }
567
573
  function de({
568
574
  delta: e,
@@ -572,166 +578,167 @@ function de({
572
578
  prevLayout: r,
573
579
  trigger: i
574
580
  }) {
575
- if (O(e, 0))
581
+ if (T(e, 0))
576
582
  return t;
577
- const c = i === "imperative-api", l = Object.values(t), a = Object.values(r), s = [...l], [u, f] = o;
578
- R(u != null, "Invalid first pivot index"), R(f != null, "Invalid second pivot index");
579
- let d = 0;
583
+ const s = i === "imperative-api", u = n.map(
584
+ ({ panelId: g }) => t[g]
585
+ ), c = n.map(
586
+ ({ panelId: g }) => r[g]
587
+ ), a = [...u], [l, f] = o;
588
+ L(l != null, "Invalid first pivot index"), L(f != null, "Invalid second pivot index");
589
+ let y = 0;
580
590
  switch (i) {
581
591
  case "keyboard": {
582
592
  {
583
- const p = e < 0 ? f : u, h = n[p];
584
- R(
585
- h,
586
- `Panel constraints not found for index ${p}`
593
+ const g = e < 0 ? f : l, d = n[g];
594
+ L(
595
+ d,
596
+ `Panel constraints not found for index ${g}`
587
597
  );
588
598
  const {
589
- collapsedSize: g = 0,
590
- collapsible: y,
599
+ collapsedSize: v = 0,
600
+ collapsible: h,
591
601
  minSize: m = 0
592
- } = h;
593
- if (y) {
594
- const b = l[p];
595
- if (R(
596
- b != null,
597
- `Previous layout not found for panel index ${p}`
598
- ), O(b, g)) {
599
- const x = m - b;
600
- H(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
602
+ } = d;
603
+ if (h) {
604
+ const x = u[g];
605
+ if (L(
606
+ x != null,
607
+ `Previous layout not found for panel index ${g}`
608
+ ), T(x, v)) {
609
+ const S = m - x;
610
+ j(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
601
611
  }
602
612
  }
603
613
  }
604
614
  {
605
- const p = e < 0 ? u : f, h = n[p];
606
- R(
607
- h,
608
- `No panel constraints found for index ${p}`
615
+ const g = e < 0 ? l : f, d = n[g];
616
+ L(
617
+ d,
618
+ `No panel constraints found for index ${g}`
609
619
  );
610
620
  const {
611
- collapsedSize: g = 0,
612
- collapsible: y,
621
+ collapsedSize: v = 0,
622
+ collapsible: h,
613
623
  minSize: m = 0
614
- } = h;
615
- if (y) {
616
- const b = l[p];
617
- if (R(
618
- b != null,
619
- `Previous layout not found for panel index ${p}`
620
- ), O(b, m)) {
621
- const x = b - g;
622
- H(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
624
+ } = d;
625
+ if (h) {
626
+ const x = u[g];
627
+ if (L(
628
+ x != null,
629
+ `Previous layout not found for panel index ${g}`
630
+ ), T(x, m)) {
631
+ const S = x - v;
632
+ j(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
623
633
  }
624
634
  }
625
635
  }
626
636
  break;
627
637
  }
628
638
  default: {
629
- const p = e < 0 ? f : u, h = n[p];
630
- R(
631
- h,
632
- `Panel constraints not found for index ${p}`
639
+ const g = e < 0 ? f : l, d = n[g];
640
+ L(
641
+ d,
642
+ `Panel constraints not found for index ${g}`
633
643
  );
634
- const g = l[p], { collapsedSize: y, collapsedThreshold: m, collapsible: b, minSize: x } = h;
635
- if (b && H(g, x) < 0) {
636
- const L = x - y, w = m ?? L / 2, C = g + Math.abs(e);
637
- if (H(C, x) < 0) {
638
- const M = H(Math.abs(e), w), T = m === void 0 && e < 0;
639
- M > 0 || M === 0 && T ? e = e < 0 ? -L : L : e = 0;
644
+ const v = u[g], { collapsedSize: h, collapsedThreshold: m, collapsible: x, minSize: S } = d;
645
+ if (x && j(v, S) < 0) {
646
+ const P = S - h, C = m ?? P / 2, E = v + Math.abs(e);
647
+ if (j(E, S) < 0) {
648
+ const w = j(Math.abs(e), C), R = m === void 0 && e < 0;
649
+ w > 0 || w === 0 && R ? e = e < 0 ? -P : P : e = 0;
640
650
  }
641
651
  }
642
652
  break;
643
653
  }
644
654
  }
645
655
  {
646
- const p = e < 0 ? 1 : -1;
647
- let h = e < 0 ? f : u, g = 0;
656
+ const g = e < 0 ? 1 : -1;
657
+ let d = e < 0 ? f : l, v = 0;
648
658
  for (; ; ) {
649
- const m = l[h];
650
- R(
659
+ const m = u[d];
660
+ L(
651
661
  m != null,
652
- `Previous layout not found for panel index ${h}`
662
+ `Previous layout not found for panel index ${d}`
653
663
  );
654
- const x = se({
655
- overrideDisabledPanels: c,
656
- panelConstraints: n[h],
664
+ const S = se({
665
+ overrideDisabledPanels: s,
666
+ panelConstraints: n[d],
657
667
  prevSize: m,
658
668
  size: 100
659
669
  }) - m;
660
- if (g += x, h += p, h < 0 || h >= n.length)
670
+ if (v += S, d += g, d < 0 || d >= n.length)
661
671
  break;
662
672
  }
663
- const y = Math.min(Math.abs(e), Math.abs(g));
664
- e = e < 0 ? 0 - y : y;
673
+ const h = Math.min(Math.abs(e), Math.abs(v));
674
+ e = e < 0 ? 0 - h : h;
665
675
  }
666
676
  {
667
- let h = e < 0 ? u : f;
668
- for (; h >= 0 && h < n.length; ) {
669
- const g = Math.abs(e) - Math.abs(d), y = l[h];
670
- R(
671
- y != null,
672
- `Previous layout not found for panel index ${h}`
677
+ let d = e < 0 ? l : f;
678
+ for (; d >= 0 && d < n.length; ) {
679
+ const v = Math.abs(e) - Math.abs(y), h = u[d];
680
+ L(
681
+ h != null,
682
+ `Previous layout not found for panel index ${d}`
673
683
  );
674
- const m = y - g, b = se({
675
- overrideDisabledPanels: c,
676
- panelConstraints: n[h],
677
- prevSize: y,
684
+ const m = h - v, x = se({
685
+ overrideDisabledPanels: s,
686
+ panelConstraints: n[d],
687
+ prevSize: h,
678
688
  size: m
679
689
  });
680
- if (!O(y, b) && (d += y - b, s[h] = b, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
690
+ if (!T(h, x) && (y += h - x, a[d] = x, y.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
681
691
  numeric: !0
682
692
  }) >= 0))
683
693
  break;
684
- e < 0 ? h-- : h++;
694
+ e < 0 ? d-- : d++;
685
695
  }
686
696
  }
687
- if (Ht(a, s))
697
+ if (jt(c, a))
688
698
  return r;
689
699
  {
690
- const p = e < 0 ? f : u, h = l[p];
691
- R(
692
- h != null,
693
- `Previous layout not found for panel index ${p}`
700
+ const g = e < 0 ? f : l, d = u[g];
701
+ L(
702
+ d != null,
703
+ `Previous layout not found for panel index ${g}`
694
704
  );
695
- const g = h + d, y = se({
696
- overrideDisabledPanels: c,
697
- panelConstraints: n[p],
698
- prevSize: h,
699
- size: g
705
+ const v = d + y, h = se({
706
+ overrideDisabledPanels: s,
707
+ panelConstraints: n[g],
708
+ prevSize: d,
709
+ size: v
700
710
  });
701
- if (s[p] = y, !O(y, g)) {
702
- let m = g - y, x = e < 0 ? f : u;
703
- for (; x >= 0 && x < n.length; ) {
704
- const L = s[x];
705
- R(
706
- L != null,
707
- `Previous layout not found for panel index ${x}`
711
+ if (a[g] = h, !T(h, v)) {
712
+ let m = v - h, S = e < 0 ? f : l;
713
+ for (; S >= 0 && S < n.length; ) {
714
+ const P = a[S];
715
+ L(
716
+ P != null,
717
+ `Previous layout not found for panel index ${S}`
708
718
  );
709
- const w = L + m, C = se({
710
- overrideDisabledPanels: c,
711
- panelConstraints: n[x],
712
- prevSize: L,
713
- size: w
719
+ const C = P + m, E = se({
720
+ overrideDisabledPanels: s,
721
+ panelConstraints: n[S],
722
+ prevSize: P,
723
+ size: C
714
724
  });
715
- if (O(L, C) || (m -= C - L, s[x] = C), O(m, 0))
725
+ if (T(P, E) || (m -= E - P, a[S] = E), T(m, 0))
716
726
  break;
717
- e > 0 ? x-- : x++;
727
+ e > 0 ? S-- : S++;
718
728
  }
719
729
  }
720
730
  }
721
- const v = Object.values(s).reduce(
722
- (p, h) => h + p,
731
+ const p = Object.values(a).reduce(
732
+ (g, d) => d + g,
723
733
  0
724
734
  );
725
- if (!O(v, 100, 0.1))
726
- return r;
727
- const z = Object.keys(r);
728
- return s.reduce((p, h, g) => (p[z[g]] = h, p), {});
735
+ return T(p, 100, 0.1) ? a.reduce((g, d, v) => (g[n[v].panelId] = d, g), {}) : r;
729
736
  }
730
- function W(e, t) {
737
+ function K(e, t) {
731
738
  if (Object.keys(e).length !== Object.keys(t).length)
732
739
  return !1;
733
740
  for (const n in e)
734
- if (t[n] === void 0 || H(e[n], t[n]) !== 0)
741
+ if (t[n] === void 0 || j(e[n], t[n]) !== 0)
735
742
  return !1;
736
743
  return !0;
737
744
  }
@@ -742,77 +749,79 @@ function Ie({
742
749
  hitRegions: o,
743
750
  initialLayoutMap: r,
744
751
  mountedGroups: i,
745
- pointerDownAtPoint: c,
746
- prevCursorFlags: l
752
+ pointerDownAtPoint: s,
753
+ prevCursorFlags: u
747
754
  }) {
748
- let a = 0;
749
- const s = X();
750
- let u = s.state === "active" ? s.previews : [];
755
+ let c = 0;
756
+ const a = q();
757
+ let l = a.state === "active" ? a.previews : [];
751
758
  const f = new Map(
752
- s.state === "active" ? s.previewLayoutMap : void 0
759
+ a.state === "active" ? a.previewLayoutMap : void 0
753
760
  );
754
- o.forEach((v) => {
755
- const { group: z, groupSize: p } = v, { orientation: h, panels: g } = z;
756
- if (e && z.resizePreviewMode !== "separator")
761
+ o.forEach((g) => {
762
+ const { group: d, groupSize: v } = g, { orientation: h, panels: m } = d;
763
+ if (e && d.resizePreviewMode !== "separator")
757
764
  return;
758
- const { disableCursor: y } = z.mutableState;
759
- let m = 0;
760
- c ? h === "horizontal" ? m = (n.clientX - c.x) / p * 100 : m = (n.clientY - c.y) / p * 100 : h === "horizontal" ? m = n.clientX < 0 ? -100 : 100 : m = n.clientY < 0 ? -100 : 100;
761
- const b = r.get(z), x = i.get(z);
762
- if (!b || !x)
765
+ const { disableCursor: x } = d.mutableState;
766
+ let S = 0;
767
+ s ? h === "horizontal" ? S = (n.clientX - s.x) / v * 100 : S = (n.clientY - s.y) / v * 100 : h === "horizontal" ? S = n.clientX < 0 ? -100 : 100 : S = n.clientY < 0 ? -100 : 100;
768
+ const P = r.get(d), C = i.get(d);
769
+ if (!P || !C)
763
770
  return;
764
771
  const {
765
- defaultLayoutDeferred: L,
772
+ defaultLayoutDeferred: E,
766
773
  derivedPanelConstraints: w,
767
- groupSize: C,
768
- layout: M,
769
- separatorToPanels: T
770
- } = x;
771
- if (w && M && T) {
772
- const G = z.resizePreviewMode === "separator" ? f.get(z) ?? M : M, E = de({
773
- delta: m,
774
- initialLayout: b,
774
+ groupSize: R,
775
+ layout: N,
776
+ separatorToPanels: O
777
+ } = C;
778
+ if (w && N && O) {
779
+ const I = d.resizePreviewMode === "separator" ? f.get(d) ?? N : N, G = de({
780
+ delta: S,
781
+ initialLayout: P,
775
782
  panelConstraints: w,
776
- pivotIndices: v.panels.map((N) => g.indexOf(N)),
777
- prevLayout: G,
783
+ pivotIndices: g.panels.map((_) => m.indexOf(_)),
784
+ prevLayout: I,
778
785
  trigger: "mouse-or-touch"
779
786
  });
780
- if (z.resizePreviewMode === "separator" && !e && !W(E, G)) {
781
- f.set(z, E);
782
- let N = 0;
783
- const _ = g.map((S) => (N += E[S.id] - b[S.id], N * (p / 100)));
784
- u = u.map((S) => {
785
- if (S.group !== z)
786
- return S;
787
- const P = _[S.panelIndex];
788
- return P === S.offset ? S : { ...S, offset: P };
787
+ if (d.resizePreviewMode === "separator" && !e && !K(G, I)) {
788
+ f.set(d, G);
789
+ let _ = 0;
790
+ const b = m.map((z) => (_ += G[z.id] - P[z.id], _ * (v / 100)));
791
+ l = l.map((z) => {
792
+ if (z.group !== d)
793
+ return z;
794
+ const M = b[z.panelIndex];
795
+ return M === z.offset ? z : { ...z, offset: M };
789
796
  });
790
797
  }
791
- if (W(E, G) && m !== 0 && !y)
798
+ if (K(G, I) && S !== 0 && !x)
792
799
  switch (h) {
793
800
  case "horizontal": {
794
- a |= m < 0 ? ot : rt;
801
+ c |= S < 0 ? rt : it;
795
802
  break;
796
803
  }
797
804
  case "vertical": {
798
- a |= m < 0 ? it : st;
805
+ c |= S < 0 ? st : at;
799
806
  break;
800
807
  }
801
808
  }
802
- (z.resizePreviewMode !== "separator" || e) && !W(E, M) && K(v.group, {
803
- defaultLayoutDeferred: L,
809
+ (d.resizePreviewMode !== "separator" || e) && !K(G, N) && X(g.group, {
810
+ defaultLayoutDeferred: E,
804
811
  derivedPanelConstraints: w,
805
- groupSize: C,
806
- layout: E,
807
- separatorToPanels: T
812
+ groupSize: R,
813
+ layout: G,
814
+ separatorToPanels: O
808
815
  });
809
816
  }
810
817
  });
811
- let d = 0;
812
- n.movementX === 0 ? d |= l & Ge : d |= a & Ge, n.movementY === 0 ? d |= l & Fe : d |= a & Fe, Tt(d, u, f), fe(t);
818
+ let y = 0;
819
+ n.movementX === 0 ? y |= u & Ae : y |= c & Ae, n.movementY === 0 ? y |= u & Fe : y |= c & Fe;
820
+ const p = a.state === "active" && (n.clientX !== a.pointerDownAtPoint.x || n.clientY !== a.pointerDownAtPoint.y);
821
+ Tt(y, l, f, p), fe(t);
813
822
  }
814
- function ft(e, t) {
815
- const n = X(), o = ee();
823
+ function dt(e, t) {
824
+ const n = q(), o = ee();
816
825
  let r = !1;
817
826
  switch (n.state) {
818
827
  case "active":
@@ -825,37 +834,37 @@ function ft(e, t) {
825
834
  mountedGroups: o,
826
835
  pointerDownAtPoint: n.pointerDownAtPoint,
827
836
  prevCursorFlags: n.cursorFlags
828
- }), U({
837
+ }), W({
829
838
  cursorFlags: 0,
830
839
  state: "inactive"
831
840
  }), n.hitRegions.length > 0 && (fe(e), r = !0, n.hitRegions.forEach((i) => {
832
841
  if (!o.has(i.group))
833
842
  return;
834
- const c = Q(i.group.id, !0);
835
- K(i.group, c, {
843
+ const s = Q(i.group.id, !0);
844
+ X(i.group, s, {
836
845
  isUserInteraction: !0
837
846
  });
838
847
  }));
839
848
  }
840
849
  return r;
841
850
  }
842
- function $e(e) {
843
- e.defaultPrevented || ft(e.currentTarget, e);
851
+ function He(e) {
852
+ e.defaultPrevented || dt(e.currentTarget, e);
844
853
  }
845
- function Vt(e, t, n) {
854
+ function Ut(e, t, n) {
846
855
  let o, r = {
847
856
  x: 1 / 0,
848
857
  y: 1 / 0
849
858
  };
850
859
  for (const i of t) {
851
- const c = lt(n, i.rect);
860
+ const s = ct(n, i.rect);
852
861
  switch (e) {
853
862
  case "horizontal": {
854
- c.x <= r.x && (o = i, r = c);
863
+ s.x <= r.x && (o = i, r = s);
855
864
  break;
856
865
  }
857
866
  case "vertical": {
858
- c.y <= r.y && (o = i, r = c);
867
+ s.y <= r.y && (o = i, r = s);
859
868
  break;
860
869
  }
861
870
  }
@@ -868,83 +877,83 @@ function Vt(e, t, n) {
868
877
  function Bt(e) {
869
878
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
870
879
  }
871
- function Ut(e, t) {
880
+ function Wt(e, t) {
872
881
  if (e === t) throw new Error("Cannot compare node with itself");
873
882
  const n = {
874
- a: Ve(e),
875
- b: Ve(t)
883
+ a: Ue(e),
884
+ b: Ue(t)
876
885
  };
877
886
  let o;
878
887
  for (; n.a.at(-1) === n.b.at(-1); )
879
888
  o = n.a.pop(), n.b.pop();
880
- R(
889
+ L(
881
890
  o,
882
891
  "Stacking order can only be calculated for elements with a common ancestor"
883
892
  );
884
893
  const r = {
885
- a: He(je(n.a)),
886
- b: He(je(n.b))
894
+ a: je(Ve(n.a)),
895
+ b: je(Ve(n.b))
887
896
  };
888
897
  if (r.a === r.b) {
889
- const i = o.childNodes, c = {
898
+ const i = o.childNodes, s = {
890
899
  a: n.a.at(-1),
891
900
  b: n.b.at(-1)
892
901
  };
893
- let l = i.length;
894
- for (; l--; ) {
895
- const a = i[l];
896
- if (a === c.a) return 1;
897
- if (a === c.b) return -1;
902
+ let u = i.length;
903
+ for (; u--; ) {
904
+ const c = i[u];
905
+ if (c === s.a) return 1;
906
+ if (c === s.b) return -1;
898
907
  }
899
908
  }
900
909
  return Math.sign(r.a - r.b);
901
910
  }
902
- const Wt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
903
- function Kt(e) {
904
- const t = getComputedStyle(dt(e) ?? e).display;
911
+ const Kt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
912
+ function Xt(e) {
913
+ const t = getComputedStyle(pt(e) ?? e).display;
905
914
  return t === "flex" || t === "inline-flex";
906
915
  }
907
916
  function qt(e) {
908
917
  const t = getComputedStyle(e);
909
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Kt(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" || Wt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
918
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Xt(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" || Kt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
910
919
  }
911
- function je(e) {
920
+ function Ve(e) {
912
921
  let t = e.length;
913
922
  for (; t--; ) {
914
923
  const n = e[t];
915
- if (R(n, "Missing node"), qt(n)) return n;
924
+ if (L(n, "Missing node"), qt(n)) return n;
916
925
  }
917
926
  return null;
918
927
  }
919
- function He(e) {
928
+ function je(e) {
920
929
  return e && Number(getComputedStyle(e).zIndex) || 0;
921
930
  }
922
- function Ve(e) {
931
+ function Ue(e) {
923
932
  const t = [];
924
933
  for (; e; )
925
- t.push(e), e = dt(e);
934
+ t.push(e), e = pt(e);
926
935
  return t;
927
936
  }
928
- function dt(e) {
937
+ function pt(e) {
929
938
  const { parentNode: t } = e;
930
939
  return Bt(t) ? t.host : t;
931
940
  }
932
- function Xt(e, t) {
941
+ function Yt(e, t) {
933
942
  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;
934
943
  }
935
- function Yt({
944
+ function Jt({
936
945
  groupElement: e,
937
946
  hitRegion: t,
938
947
  pointerEventTarget: n
939
948
  }) {
940
- if (!at(n) || n.contains(e) || e.contains(n))
949
+ if (!lt(n) || n.contains(e) || e.contains(n))
941
950
  return !0;
942
- if (Ut(n, e) > 0) {
951
+ if (Wt(n, e) > 0) {
943
952
  let o = n;
944
953
  for (; o; ) {
945
954
  if (o.contains(e))
946
955
  return !0;
947
- if (Xt(o.getBoundingClientRect(), t))
956
+ if (Yt(o.getBoundingClientRect(), t))
948
957
  return !1;
949
958
  o = o.parentElement;
950
959
  }
@@ -956,192 +965,191 @@ function ke(e, t) {
956
965
  return t.forEach((o, r) => {
957
966
  if (r.disabled)
958
967
  return;
959
- const i = Me({ group: r }), c = Vt(r.orientation, i, {
968
+ const i = Me({ group: r }), s = Ut(r.orientation, i, {
960
969
  x: e.clientX,
961
970
  y: e.clientY
962
971
  });
963
- c && c.distance.x <= 0 && c.distance.y <= 0 && Yt({
972
+ s && s.distance.x <= 0 && s.distance.y <= 0 && Jt({
964
973
  groupElement: r.element,
965
- hitRegion: c.hitRegion.rect,
974
+ hitRegion: s.hitRegion.rect,
966
975
  pointerEventTarget: e.target
967
- }) && n.push(c.hitRegion);
976
+ }) && n.push(s.hitRegion);
968
977
  }), n;
969
978
  }
970
979
  function ne({
971
980
  layout: e,
972
981
  panelConstraints: t
973
982
  }) {
974
- const n = Object.values(e), o = [...n], r = o.reduce(
975
- (l, a) => l + a,
983
+ const n = t.map(({ panelId: s }) => e[s]), o = [...n], r = o.reduce(
984
+ (s, u) => s + u,
976
985
  0
977
986
  );
978
- if (o.length !== t.length)
987
+ if (Object.keys(e).length !== t.length)
979
988
  throw Error(
980
- `Invalid ${t.length} panel layout: ${o.map((l) => `${l}%`).join(", ")}`
989
+ `Invalid ${t.length} panel layout: ${Object.values(e).map((s) => `${s}%`).join(", ")}`
981
990
  );
982
- if (!O(r, 100) && o.length > 0)
983
- for (let l = 0; l < t.length; l++) {
984
- const a = o[l];
985
- R(a != null, `No layout data found for index ${l}`);
986
- const s = 100 / r * a;
987
- o[l] = s;
991
+ if (!T(r, 100) && o.length > 0)
992
+ for (let s = 0; s < t.length; s++) {
993
+ const u = o[s];
994
+ L(u != null, `No layout data found for index ${s}`);
995
+ const c = 100 / r * u;
996
+ o[s] = c;
988
997
  }
989
998
  let i = 0;
990
- for (let l = 0; l < t.length; l++) {
991
- const a = n[l];
992
- R(a != null, `No layout data found for index ${l}`);
993
- const s = o[l];
994
- R(s != null, `No layout data found for index ${l}`);
995
- const u = se({
999
+ for (let s = 0; s < t.length; s++) {
1000
+ const u = n[s];
1001
+ L(u != null, `No layout data found for index ${s}`);
1002
+ const c = o[s];
1003
+ L(c != null, `No layout data found for index ${s}`);
1004
+ const a = se({
996
1005
  overrideDisabledPanels: !0,
997
- panelConstraints: t[l],
998
- prevSize: a,
999
- size: s
1006
+ panelConstraints: t[s],
1007
+ prevSize: u,
1008
+ size: c
1000
1009
  });
1001
- s != u && (i += s - u, o[l] = u);
1010
+ c != a && (i += c - a, o[s] = a);
1002
1011
  }
1003
- if (!O(i, 0))
1004
- for (let l = 0; l < t.length; l++) {
1005
- const a = o[l];
1006
- R(a != null, `No layout data found for index ${l}`);
1007
- const s = a + i, u = se({
1012
+ if (!T(i, 0))
1013
+ for (let s = 0; s < t.length; s++) {
1014
+ const u = o[s];
1015
+ L(u != null, `No layout data found for index ${s}`);
1016
+ const c = u + i, a = se({
1008
1017
  overrideDisabledPanels: !0,
1009
- panelConstraints: t[l],
1010
- prevSize: a,
1011
- size: s
1018
+ panelConstraints: t[s],
1019
+ prevSize: u,
1020
+ size: c
1012
1021
  });
1013
- if (a !== u && (i -= u - a, o[l] = u, O(i, 0)))
1022
+ if (u !== a && (i -= a - u, o[s] = a, T(i, 0)))
1014
1023
  break;
1015
1024
  }
1016
- const c = Object.keys(e);
1017
- return o.reduce((l, a, s) => (l[c[s]] = a, l), {});
1025
+ return o.reduce((s, u, c) => (s[t[c].panelId] = u, s), {});
1018
1026
  }
1019
- function pt({
1027
+ function ht({
1020
1028
  groupId: e,
1021
1029
  panelId: t
1022
1030
  }) {
1023
1031
  const n = () => {
1024
- const a = ee();
1032
+ const c = ee();
1025
1033
  for (const [
1026
- s,
1034
+ a,
1027
1035
  {
1028
- defaultLayoutDeferred: u,
1036
+ defaultLayoutDeferred: l,
1029
1037
  derivedPanelConstraints: f,
1030
- layout: d,
1031
- groupSize: v,
1032
- separatorToPanels: z
1038
+ layout: y,
1039
+ groupSize: p,
1040
+ separatorToPanels: g
1033
1041
  }
1034
- ] of a)
1035
- if (s.id === e)
1042
+ ] of c)
1043
+ if (a.id === e)
1036
1044
  return {
1037
- defaultLayoutDeferred: u,
1045
+ defaultLayoutDeferred: l,
1038
1046
  derivedPanelConstraints: f,
1039
- group: s,
1040
- groupSize: v,
1041
- layout: d,
1042
- separatorToPanels: z
1047
+ group: a,
1048
+ groupSize: p,
1049
+ layout: y,
1050
+ separatorToPanels: g
1043
1051
  };
1044
1052
  throw Error(`Group ${e} not found`);
1045
1053
  }, o = () => {
1046
- const a = n().derivedPanelConstraints.find(
1047
- (s) => s.panelId === t
1054
+ const c = n().derivedPanelConstraints.find(
1055
+ (a) => a.panelId === t
1048
1056
  );
1049
- if (a !== void 0)
1050
- return a;
1057
+ if (c !== void 0)
1058
+ return c;
1051
1059
  throw Error(`Panel constraints not found for Panel ${t}`);
1052
1060
  }, r = () => {
1053
- const a = n().group.panels.find((s) => s.id === t);
1054
- if (a !== void 0)
1055
- return a;
1061
+ const c = n().group.panels.find((a) => a.id === t);
1062
+ if (c !== void 0)
1063
+ return c;
1056
1064
  throw Error(`Layout not found for Panel ${t}`);
1057
1065
  }, i = () => {
1058
- const a = n().layout[t];
1059
- if (a !== void 0)
1060
- return a;
1066
+ const c = n().layout[t];
1067
+ if (c !== void 0)
1068
+ return c;
1061
1069
  throw Error(`Layout not found for Panel ${t}`);
1062
- }, c = ({
1063
- nextSize: a,
1064
- panels: s,
1065
- prevLayout: u,
1070
+ }, s = ({
1071
+ nextSize: c,
1072
+ panels: a,
1073
+ prevLayout: l,
1066
1074
  derivedPanelConstraints: f
1067
1075
  }) => {
1068
- const d = i(), v = s.findIndex((g) => g.id === t), z = v === 0, p = v === s.length - 1;
1069
- if (p && a < d && (z || s.slice(0, v).every((g, y) => {
1070
- const m = f[y];
1071
- return m?.collapsible && O(m.collapsedSize, u[m.panelId]);
1076
+ const y = i(), p = a.findIndex((h) => h.id === t), g = p === 0, d = p === a.length - 1;
1077
+ if (d && c < y && (g || a.slice(0, p).every((h, m) => {
1078
+ const x = f[m];
1079
+ return x?.collapsible && T(x.collapsedSize, l[x.panelId]);
1072
1080
  }))) {
1073
- const g = s.slice(0, v).reduce((y, m) => y + u[m.id], 0);
1081
+ const h = a.slice(0, p).reduce((m, x) => m + l[x.id], 0);
1074
1082
  return {
1075
- ...u,
1076
- [t]: A(100 - g)
1083
+ ...l,
1084
+ [t]: F(100 - h)
1077
1085
  };
1078
1086
  }
1079
1087
  return de({
1080
- delta: p ? d - a : a - d,
1081
- initialLayout: u,
1088
+ delta: d ? y - c : c - y,
1089
+ initialLayout: l,
1082
1090
  panelConstraints: f,
1083
- pivotIndices: p ? [v - 1, v] : [v, v + 1],
1084
- prevLayout: u,
1091
+ pivotIndices: d ? [p - 1, p] : [p, p + 1],
1092
+ prevLayout: l,
1085
1093
  trigger: "imperative-api"
1086
1094
  });
1087
- }, l = (a) => {
1088
- const s = i();
1089
- if (a === s)
1095
+ }, u = (c) => {
1096
+ const a = i();
1097
+ if (c === a)
1090
1098
  return;
1091
1099
  const {
1092
- defaultLayoutDeferred: u,
1100
+ defaultLayoutDeferred: l,
1093
1101
  derivedPanelConstraints: f,
1094
- group: d,
1095
- groupSize: v,
1096
- layout: z,
1097
- separatorToPanels: p
1098
- } = n(), h = c({
1099
- nextSize: a,
1100
- panels: d.panels,
1101
- prevLayout: z,
1102
+ group: y,
1103
+ groupSize: p,
1104
+ layout: g,
1105
+ separatorToPanels: d
1106
+ } = n(), v = s({
1107
+ nextSize: c,
1108
+ panels: y.panels,
1109
+ prevLayout: g,
1102
1110
  derivedPanelConstraints: f
1103
- }), g = ne({
1104
- layout: h,
1111
+ }), h = ne({
1112
+ layout: v,
1105
1113
  panelConstraints: f
1106
1114
  });
1107
- W(z, g) || K(d, {
1108
- defaultLayoutDeferred: u,
1115
+ K(g, h) || X(y, {
1116
+ defaultLayoutDeferred: l,
1109
1117
  derivedPanelConstraints: f,
1110
- groupSize: v,
1111
- layout: g,
1112
- separatorToPanels: p
1118
+ groupSize: p,
1119
+ layout: h,
1120
+ separatorToPanels: d
1113
1121
  });
1114
1122
  };
1115
1123
  return {
1116
1124
  collapse: () => {
1117
- const { collapsible: a, collapsedSize: s } = o(), { mutableValues: u } = r(), f = i();
1118
- a && f !== s && (u.expandToSize = f, l(s));
1125
+ const { collapsible: c, collapsedSize: a } = o(), { mutableValues: l } = r(), f = i();
1126
+ c && f !== a && (l.expandToSize = f, u(a));
1119
1127
  },
1120
1128
  expand: () => {
1121
- const { collapsible: a, collapsedSize: s, minSize: u } = o(), { mutableValues: f } = r(), d = i();
1122
- if (a && d === s) {
1123
- let v = f.expandToSize ?? u;
1124
- v === 0 && (v = 1), l(v);
1129
+ const { collapsible: c, collapsedSize: a, minSize: l } = o(), { mutableValues: f } = r(), y = i();
1130
+ if (c && y === a) {
1131
+ let p = f.expandToSize ?? l;
1132
+ p === 0 && (p = 1), u(p);
1125
1133
  }
1126
1134
  },
1127
1135
  getSize: () => {
1128
- const { group: a } = n(), s = i(), { element: u } = r(), f = a.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
1136
+ const { group: c } = n(), a = i(), { element: l } = r(), f = c.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
1129
1137
  return {
1130
- asPercentage: s,
1138
+ asPercentage: a,
1131
1139
  inPixels: f
1132
1140
  };
1133
1141
  },
1134
1142
  isCollapsed: () => {
1135
- const { collapsible: a, collapsedSize: s } = o(), u = i();
1136
- return a && O(s, u);
1143
+ const { collapsible: c, collapsedSize: a } = o(), l = i();
1144
+ return c && T(a, l);
1137
1145
  },
1138
- resize: (a) => {
1139
- const { group: s } = n(), { element: u } = r(), f = ae({ group: s }), d = ie({
1146
+ resize: (c) => {
1147
+ const { group: a } = n(), { element: l } = r(), f = ae({ group: a }), y = ie({
1140
1148
  groupSize: f,
1141
- panelElement: u,
1142
- styleProp: a
1143
- }), v = A(d / f * 100);
1144
- l(v);
1149
+ panelElement: l,
1150
+ styleProp: c
1151
+ }), p = F(y / f * 100);
1152
+ u(p);
1145
1153
  }
1146
1154
  };
1147
1155
  }
@@ -1155,11 +1163,11 @@ function Be(e) {
1155
1163
  (i) => i.panelConstraints.defaultSize !== void 0
1156
1164
  );
1157
1165
  if (r) {
1158
- const i = r.panelConstraints.defaultSize, c = pt({
1166
+ const i = r.panelConstraints.defaultSize, s = ht({
1159
1167
  groupId: o.group.id,
1160
1168
  panelId: r.id
1161
1169
  });
1162
- c && i !== void 0 && (c.resize(i), e.preventDefault());
1170
+ s && i !== void 0 && (s.resize(i), e.preventDefault());
1163
1171
  }
1164
1172
  }
1165
1173
  });
@@ -1173,7 +1181,7 @@ function ye(e) {
1173
1181
  return n;
1174
1182
  throw Error("Could not find parent Group for separator element");
1175
1183
  }
1176
- function ht({
1184
+ function mt({
1177
1185
  groupId: e
1178
1186
  }) {
1179
1187
  const t = () => {
@@ -1193,20 +1201,20 @@ function ht({
1193
1201
  defaultLayoutDeferred: o,
1194
1202
  derivedPanelConstraints: r,
1195
1203
  group: i,
1196
- groupSize: c,
1197
- layout: l,
1198
- separatorToPanels: a
1199
- } = t(), s = ne({
1204
+ groupSize: s,
1205
+ layout: u,
1206
+ separatorToPanels: c
1207
+ } = t(), a = ne({
1200
1208
  layout: n,
1201
1209
  panelConstraints: r
1202
1210
  });
1203
- return o ? l : (W(l, s) || K(i, {
1211
+ return o ? u : (K(u, a) || X(i, {
1204
1212
  defaultLayoutDeferred: o,
1205
1213
  derivedPanelConstraints: r,
1206
- groupSize: c,
1207
- layout: s,
1208
- separatorToPanels: a
1209
- }), s);
1214
+ groupSize: s,
1215
+ layout: a,
1216
+ separatorToPanels: c
1217
+ }), a);
1210
1218
  }
1211
1219
  };
1212
1220
  }
@@ -1214,27 +1222,27 @@ function te(e, t) {
1214
1222
  const n = ye(e), o = Q(n.id, !0), r = n.separators.find(
1215
1223
  (f) => f.element === e
1216
1224
  );
1217
- R(r, "Matching separator not found");
1225
+ L(r, "Matching separator not found");
1218
1226
  const i = o.separatorToPanels.get(r);
1219
- R(i, "Matching panels not found");
1220
- const c = i.map((f) => n.panels.indexOf(f)), a = ht({ groupId: n.id }).getLayout(), s = de({
1227
+ L(i, "Matching panels not found");
1228
+ const s = i.map((f) => n.panels.indexOf(f)), c = mt({ groupId: n.id }).getLayout(), a = de({
1221
1229
  delta: t,
1222
- initialLayout: a,
1230
+ initialLayout: c,
1223
1231
  panelConstraints: o.derivedPanelConstraints,
1224
- pivotIndices: c,
1225
- prevLayout: a,
1232
+ pivotIndices: s,
1233
+ prevLayout: c,
1226
1234
  trigger: "keyboard"
1227
- }), u = ne({
1228
- layout: s,
1235
+ }), l = ne({
1236
+ layout: a,
1229
1237
  panelConstraints: o.derivedPanelConstraints
1230
1238
  });
1231
- W(a, u) || K(
1239
+ K(c, l) || X(
1232
1240
  n,
1233
1241
  {
1234
1242
  defaultLayoutDeferred: o.defaultLayoutDeferred,
1235
1243
  derivedPanelConstraints: o.derivedPanelConstraints,
1236
1244
  groupSize: o.groupSize,
1237
- layout: u,
1245
+ layout: l,
1238
1246
  separatorToPanels: o.separatorToPanels
1239
1247
  },
1240
1248
  // Keyboard resizes (arrow keys, Home/End, Enter collapse/expand) originate
@@ -1244,11 +1252,13 @@ function te(e, t) {
1244
1252
  { isUserInteraction: !0 }
1245
1253
  );
1246
1254
  }
1247
- function Ue(e) {
1255
+ function We(e) {
1248
1256
  if (e.defaultPrevented)
1249
1257
  return;
1250
1258
  const t = e.currentTarget, n = ye(t);
1251
- if (!n.disabled)
1259
+ if (!(n.disabled || n.separators.find(
1260
+ (r) => r.element === t
1261
+ )?.disabled))
1252
1262
  switch (e.key) {
1253
1263
  case "ArrowDown": {
1254
1264
  e.preventDefault(), n.orientation === "vertical" && te(t, 5);
@@ -1272,31 +1282,31 @@ function Ue(e) {
1272
1282
  }
1273
1283
  case "Enter": {
1274
1284
  e.preventDefault();
1275
- const o = ye(t), r = Q(o.id, !0), { derivedPanelConstraints: i, layout: c, separatorToPanels: l } = r, a = o.separators.find(
1276
- (d) => d.element === t
1285
+ const r = ye(t), i = Q(r.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: c } = i, a = r.separators.find(
1286
+ (p) => p.element === t
1277
1287
  );
1278
- R(a, "Matching separator not found");
1279
- const s = l.get(a);
1280
- R(s, "Matching panels not found");
1281
- const u = s[0], f = i.find(
1282
- (d) => d.panelId === u.id
1288
+ L(a, "Matching separator not found");
1289
+ const l = c.get(a);
1290
+ L(l, "Matching panels not found");
1291
+ const f = l[0], y = s.find(
1292
+ (p) => p.panelId === f.id
1283
1293
  );
1284
- if (R(f, "Panel metadata not found"), f.collapsible) {
1285
- const d = c[u.id], v = f.collapsedSize === d ? o.mutableState.expandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
1286
- te(t, v - d);
1294
+ if (L(y, "Panel metadata not found"), y.collapsible) {
1295
+ const p = u[f.id], g = y.collapsedSize === p ? r.mutableState.expandedPanelSizes[f.id] ?? y.minSize : y.collapsedSize;
1296
+ te(t, g - p);
1287
1297
  }
1288
1298
  break;
1289
1299
  }
1290
1300
  case "F6": {
1291
1301
  e.preventDefault();
1292
- const r = ye(t).separators.map(
1302
+ const i = ye(t).separators.map(
1293
1303
  (a) => a.element
1294
- ), i = Array.from(r).findIndex(
1304
+ ), s = Array.from(i).findIndex(
1295
1305
  (a) => a === e.currentTarget
1296
1306
  );
1297
- R(i !== null, "Index not found");
1298
- const c = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
1299
- r[c].focus({
1307
+ L(s !== null, "Index not found");
1308
+ const u = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
1309
+ i[u].focus({
1300
1310
  preventScroll: !0
1301
1311
  });
1302
1312
  break;
@@ -1307,70 +1317,74 @@ function Ue(e) {
1307
1317
  }
1308
1318
  }
1309
1319
  }
1310
- function Jt(e, t) {
1311
- const { element: n, orientation: o, panels: r } = e, i = n.getBoundingClientRect(), c = o === "horizontal";
1320
+ function Zt(e, t) {
1321
+ const { element: n, orientation: o, panels: r } = e, i = n.getBoundingClientRect(), s = o === "horizontal";
1312
1322
  return Me({
1313
1323
  expandHitTargets: !1,
1314
1324
  group: e,
1315
1325
  includeDisabled: !0
1316
1326
  }).map(
1317
- ({ panels: a, rect: s, separator: u }, f) => {
1318
- const d = r.indexOf(a[0]), v = c ? s.left + s.width / 2 : s.top + s.height / 2;
1327
+ ({ panels: c, rect: a, separator: l }, f) => {
1328
+ const y = r.indexOf(c[0]), p = s ? a.left + a.width / 2 : a.top + a.height / 2;
1319
1329
  return {
1320
- active: t.some((p) => {
1321
- if (p.group !== e || p.panels[0] !== a[0])
1330
+ active: t.some((d) => {
1331
+ if (d.group !== e || d.panels[0] !== c[0])
1322
1332
  return !1;
1323
- if (u || p.separator)
1324
- return p.separator === u;
1325
- const h = c ? p.rect.left + p.rect.width / 2 : p.rect.top + p.rect.height / 2;
1326
- return O(v, h);
1333
+ if (l || d.separator)
1334
+ return d.separator === l;
1335
+ const v = s ? d.rect.left + d.rect.width / 2 : d.rect.top + d.rect.height / 2;
1336
+ return T(p, v);
1327
1337
  }),
1328
1338
  group: e,
1329
- key: u ? `separator-${u.id}` : `panel-${a[0].id}-${f}`,
1339
+ key: l ? `separator-${l.id}` : `panel-${c[0].id}-${f}`,
1330
1340
  offset: 0,
1331
- panelIndex: d,
1341
+ panelIndex: y,
1332
1342
  rect: new DOMRect(
1333
- (c && !u ? v : s.left) - i.left - n.clientLeft + n.scrollLeft,
1334
- (!c && !u ? v : s.top) - i.top - n.clientTop + n.scrollTop,
1335
- c && !u ? 0 : s.width,
1336
- !c && !u ? 0 : s.height
1343
+ (s && !l ? p : a.left) - i.left - n.clientLeft + n.scrollLeft,
1344
+ (!s && !l ? p : a.top) - i.top - n.clientTop + n.scrollTop,
1345
+ s && !l ? 0 : a.width,
1346
+ !s && !l ? 0 : a.height
1337
1347
  ),
1338
- separator: u
1348
+ separator: l
1339
1349
  };
1340
1350
  }
1341
1351
  );
1342
1352
  }
1343
- function We(e) {
1353
+ function Ke(e) {
1344
1354
  if (e.defaultPrevented)
1345
1355
  return;
1346
1356
  if (e.pointerType === "mouse" && e.button > 0)
1347
1357
  return;
1348
- const t = ee(), n = ke(e, t), o = /* @__PURE__ */ new Map();
1358
+ const t = ee(), n = ke(e, t);
1359
+ if (n.length === 0)
1360
+ return;
1361
+ const o = /* @__PURE__ */ new Map();
1349
1362
  let r = !1;
1350
- n.forEach((c) => {
1351
- c.separator && (r || (r = !0, c.separator.element.focus({
1363
+ n.forEach((s) => {
1364
+ s.separator && (r || (r = !0, s.separator.element.focus({
1352
1365
  // @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
1353
1366
  focusVisible: !1,
1354
1367
  preventScroll: !0
1355
1368
  })));
1356
- const l = t.get(c.group);
1357
- l && o.set(c.group, l.layout);
1369
+ const u = t.get(s.group);
1370
+ u && o.set(s.group, u.layout);
1358
1371
  });
1359
1372
  const i = Array.from(o.keys()).flatMap(
1360
- (c) => c.resizePreviewMode === "separator" ? Jt(c, n) : []
1373
+ (s) => s.resizePreviewMode === "separator" ? Zt(s, n) : []
1361
1374
  );
1362
- U({
1375
+ W({
1363
1376
  cursorFlags: 0,
1377
+ didPointerMove: !1,
1364
1378
  hitRegions: n,
1365
1379
  initialLayoutMap: o,
1366
1380
  pointerDownAtPoint: { x: e.clientX, y: e.clientY },
1367
1381
  previewLayoutMap: new Map(o),
1368
1382
  previews: i,
1369
1383
  state: "active"
1370
- }), n.length && e.preventDefault();
1384
+ }), e.preventDefault();
1371
1385
  }
1372
- function Ke(e) {
1373
- const t = ee(), n = X();
1386
+ function Xe(e) {
1387
+ const t = ee(), n = q();
1374
1388
  switch (n.state) {
1375
1389
  case "active":
1376
1390
  Ie({
@@ -1387,7 +1401,7 @@ function Ke(e) {
1387
1401
  function qe(e) {
1388
1402
  if (e.defaultPrevented)
1389
1403
  return;
1390
- const t = X(), n = ee();
1404
+ const t = q(), n = ee();
1391
1405
  switch (t.state) {
1392
1406
  case "active": {
1393
1407
  if (
@@ -1396,15 +1410,15 @@ function qe(e) {
1396
1410
  ) {
1397
1411
  t.previewLayoutMap.forEach((o, r) => {
1398
1412
  const i = n.get(r);
1399
- r.resizePreviewMode === "separator" && i && !W(o, i.layout) && K(r, { ...i, layout: o });
1400
- }), U({
1413
+ r.resizePreviewMode === "separator" && i && !K(o, i.layout) && X(r, { ...i, layout: o });
1414
+ }), W({
1401
1415
  cursorFlags: 0,
1402
1416
  state: "inactive"
1403
1417
  }), t.hitRegions.forEach((o) => {
1404
1418
  if (!n.has(o.group))
1405
1419
  return;
1406
1420
  const r = Q(o.group.id, !0);
1407
- K(o.group, r, {
1421
+ X(o.group, r, {
1408
1422
  isUserInteraction: !0
1409
1423
  });
1410
1424
  }), fe(e.currentTarget);
@@ -1429,10 +1443,10 @@ function qe(e) {
1429
1443
  }
1430
1444
  default: {
1431
1445
  const o = ke(e, n);
1432
- o.length === 0 ? t.state !== "inactive" && U({
1446
+ o.length === 0 ? t.state !== "inactive" && W({
1433
1447
  cursorFlags: 0,
1434
1448
  state: "inactive"
1435
- }) : U({
1449
+ }) : W({
1436
1450
  cursorFlags: 0,
1437
1451
  hitRegions: o,
1438
1452
  state: "hover"
@@ -1441,57 +1455,73 @@ function qe(e) {
1441
1455
  }
1442
1456
  }
1443
1457
  }
1444
- function Xe(e) {
1458
+ function Ye(e) {
1445
1459
  if (e.relatedTarget instanceof HTMLIFrameElement)
1446
- switch (X().state) {
1460
+ switch (q().state) {
1447
1461
  case "hover":
1448
- U({
1462
+ W({
1449
1463
  cursorFlags: 0,
1450
1464
  state: "inactive"
1451
1465
  });
1452
1466
  }
1453
1467
  }
1454
- function Ye(e) {
1468
+ function Je(e) {
1455
1469
  if (e.defaultPrevented)
1456
1470
  return;
1457
1471
  if (e.pointerType === "mouse" && e.button > 0)
1458
1472
  return;
1459
- ft(
1473
+ dt(
1460
1474
  e.currentTarget,
1461
1475
  e
1462
1476
  ) && e.preventDefault();
1463
1477
  }
1464
- function Je(e) {
1478
+ function Qt(e) {
1465
1479
  let t = 0, n = 0;
1466
1480
  const o = {};
1467
1481
  for (const i of e)
1468
1482
  if (i.defaultSize !== void 0) {
1469
1483
  t++;
1470
- const c = A(i.defaultSize);
1471
- n += c, o[i.panelId] = c;
1484
+ const s = F(i.defaultSize);
1485
+ n += s, o[i.panelId] = s;
1472
1486
  } else
1473
1487
  o[i.panelId] = void 0;
1474
1488
  const r = e.length - t;
1475
1489
  if (r !== 0) {
1476
- const i = A((100 - n) / r);
1477
- for (const c of e)
1478
- c.defaultSize === void 0 && (o[c.panelId] = i);
1490
+ const i = F((100 - n) / r);
1491
+ for (const s of e)
1492
+ s.defaultSize === void 0 && (o[s.panelId] = i);
1479
1493
  }
1480
1494
  return o;
1481
1495
  }
1482
- function Zt(e, t, n) {
1496
+ function en(e, t) {
1497
+ const n = e.map((r) => r.id), o = Object.keys(t);
1498
+ if (n.length !== o.length)
1499
+ return !1;
1500
+ for (const r of n)
1501
+ if (!o.includes(r))
1502
+ return !1;
1503
+ return !0;
1504
+ }
1505
+ function Ze({
1506
+ group: e,
1507
+ panelConstraints: t
1508
+ }) {
1509
+ const n = e.panels.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
1510
+ return e.mutableState.layouts[n] ?? (o && en(e.panels, o) ? o : Qt(t));
1511
+ }
1512
+ function tn(e, t, n) {
1483
1513
  if (!n[0])
1484
1514
  return;
1485
- const r = e.panels.find((s) => s.element === t);
1515
+ const r = e.panels.find((a) => a.element === t);
1486
1516
  if (!r || !r.onResize)
1487
1517
  return;
1488
- const i = ae({ group: e }), c = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, l = r.mutableValues.prevSize, a = {
1489
- asPercentage: A(c / i * 100),
1490
- inPixels: c
1518
+ const i = ae({ group: e }), s = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, u = r.mutableValues.prevSize, c = {
1519
+ asPercentage: F(s / i * 100),
1520
+ inPixels: s
1491
1521
  };
1492
- r.mutableValues.prevSize = a, r.onResize(a, r.id, l);
1522
+ r.mutableValues.prevSize = c, r.onResize(c, r.id, u);
1493
1523
  }
1494
- function mt(e, t) {
1524
+ function gt(e, t) {
1495
1525
  if (Object.keys(e).length !== Object.keys(t).length)
1496
1526
  return !1;
1497
1527
  for (const o in e)
@@ -1499,10 +1529,10 @@ function mt(e, t) {
1499
1529
  return !1;
1500
1530
  return !0;
1501
1531
  }
1502
- function Qt(e, t) {
1503
- return e.length !== t.length ? !1 : e.every((n, o) => mt(n, t[o]));
1532
+ function nn(e, t) {
1533
+ return e.length !== t.length ? !1 : e.every((n, o) => gt(n, t[o]));
1504
1534
  }
1505
- function en({
1535
+ function on({
1506
1536
  group: e,
1507
1537
  nextGroupSize: t,
1508
1538
  prevGroupSize: n,
@@ -1510,171 +1540,165 @@ function en({
1510
1540
  }) {
1511
1541
  if (n <= 0 || t <= 0 || n === t)
1512
1542
  return o;
1513
- let r = 0, i = 0, c = !1;
1514
- const l = /* @__PURE__ */ new Map(), a = [];
1543
+ let r = 0, i = 0, s = !1;
1544
+ const u = /* @__PURE__ */ new Map(), c = [];
1515
1545
  for (const f of e.panels) {
1516
- const d = o[f.id] ?? 0;
1546
+ const y = o[f.id] ?? 0;
1517
1547
  switch (f.panelConstraints.groupResizeBehavior) {
1518
1548
  case "preserve-pixel-size": {
1519
- c = !0;
1520
- const v = d / 100 * n, z = A(
1521
- v / t * 100
1549
+ s = !0;
1550
+ const p = y / 100 * n, g = F(
1551
+ p / t * 100
1522
1552
  );
1523
- l.set(f.id, z), r += z;
1553
+ u.set(f.id, g), r += g;
1524
1554
  break;
1525
1555
  }
1526
1556
  case "preserve-relative-size":
1527
1557
  default: {
1528
- a.push(f.id), i += d;
1558
+ c.push(f.id), i += y;
1529
1559
  break;
1530
1560
  }
1531
1561
  }
1532
1562
  }
1533
- if (!c || a.length === 0)
1563
+ if (!s || c.length === 0)
1534
1564
  return o;
1535
- const s = 100 - r, u = { ...o };
1536
- if (l.forEach((f, d) => {
1537
- u[d] = f;
1565
+ const a = 100 - r, l = { ...o };
1566
+ if (u.forEach((f, y) => {
1567
+ l[y] = f;
1538
1568
  }), i > 0)
1539
- for (const f of a) {
1540
- const d = o[f] ?? 0;
1541
- u[f] = A(
1542
- d / i * s
1569
+ for (const f of c) {
1570
+ const y = o[f] ?? 0;
1571
+ l[f] = F(
1572
+ y / i * a
1543
1573
  );
1544
1574
  }
1545
1575
  else {
1546
- const f = A(
1547
- s / a.length
1576
+ const f = F(
1577
+ a / c.length
1548
1578
  );
1549
- for (const d of a)
1550
- u[d] = f;
1579
+ for (const y of c)
1580
+ l[y] = f;
1551
1581
  }
1552
- return u;
1553
- }
1554
- function tn(e, t) {
1555
- const n = e.map((r) => r.id), o = Object.keys(t);
1556
- if (n.length !== o.length)
1557
- return !1;
1558
- for (const r of n)
1559
- if (!o.includes(r))
1560
- return !1;
1561
- return !0;
1582
+ return l;
1562
1583
  }
1563
1584
  const re = /* @__PURE__ */ new Map();
1564
- function nn(e) {
1585
+ function rn(e) {
1565
1586
  let t = !0;
1566
- R(
1587
+ L(
1567
1588
  e.element.ownerDocument.defaultView,
1568
1589
  "Cannot register an unmounted Group"
1569
1590
  );
1570
1591
  const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((p) => {
1571
- for (const h of p) {
1572
- const { borderBoxSize: g, target: y } = h;
1573
- if (y === e.element) {
1592
+ for (const g of p) {
1593
+ const { borderBoxSize: d, target: v } = g;
1594
+ if (v === e.element) {
1574
1595
  if (t) {
1575
- const m = ae({ group: e });
1576
- if (m === 0)
1596
+ const h = ae({ group: e });
1597
+ if (h === 0)
1577
1598
  return;
1578
- const b = Q(e.id);
1579
- if (!b)
1599
+ const m = Q(e.id);
1600
+ if (!m)
1580
1601
  return;
1581
- const x = Le(e), L = b.defaultLayoutDeferred ? Je(x) : b.layout, w = en({
1602
+ const x = Le(e), S = m.defaultLayoutDeferred ? Ze({
1582
1603
  group: e,
1583
- nextGroupSize: m,
1584
- prevGroupSize: b.groupSize,
1585
- prevLayout: L
1604
+ panelConstraints: x
1605
+ }) : m.layout, P = on({
1606
+ group: e,
1607
+ nextGroupSize: h,
1608
+ prevGroupSize: m.groupSize,
1609
+ prevLayout: S
1586
1610
  }), C = ne({
1587
- layout: w,
1611
+ layout: P,
1588
1612
  panelConstraints: x
1589
1613
  });
1590
- if (!b.defaultLayoutDeferred && W(b.layout, C) && Qt(
1591
- b.derivedPanelConstraints,
1614
+ if (!m.defaultLayoutDeferred && K(m.layout, C) && nn(
1615
+ m.derivedPanelConstraints,
1592
1616
  x
1593
- ) && b.groupSize === m)
1617
+ ) && m.groupSize === h)
1594
1618
  continue;
1595
- K(e, {
1619
+ X(e, {
1596
1620
  defaultLayoutDeferred: !1,
1597
1621
  derivedPanelConstraints: x,
1598
- groupSize: m,
1622
+ groupSize: h,
1599
1623
  layout: C,
1600
- separatorToPanels: b.separatorToPanels
1624
+ separatorToPanels: m.separatorToPanels
1601
1625
  });
1602
1626
  }
1603
1627
  } else
1604
- Zt(e, y, g);
1628
+ tn(e, v, d);
1605
1629
  }
1606
1630
  });
1607
1631
  i.observe(e.element), e.panels.forEach((p) => {
1608
- R(
1632
+ L(
1609
1633
  !o.has(p.id),
1610
1634
  `Panel ids must be unique; id "${p.id}" was used more than once`
1611
1635
  ), o.add(p.id), p.onResize && i.observe(p.element);
1612
1636
  });
1613
- const c = ae({ group: e }), l = Le(e), a = e.panels.map(({ id: p }) => p).join(",");
1614
- let s = e.mutableState.defaultLayout;
1615
- s && (tn(e.panels, s) || (s = void 0));
1616
- const u = e.mutableState.layouts[a] ?? s ?? Je(l), f = ne({
1617
- layout: u,
1618
- panelConstraints: l
1619
- }), d = e.element.ownerDocument;
1637
+ const s = ae({ group: e }), u = Le(e), c = Ze({
1638
+ group: e,
1639
+ panelConstraints: u
1640
+ }), a = ne({
1641
+ layout: c,
1642
+ panelConstraints: u
1643
+ }), l = e.element.ownerDocument;
1620
1644
  re.set(
1621
- d,
1622
- (re.get(d) ?? 0) + 1
1645
+ l,
1646
+ (re.get(l) ?? 0) + 1
1623
1647
  );
1624
- const v = /* @__PURE__ */ new Map();
1625
- return Me({ group: e }).forEach((p) => {
1626
- p.separator && v.set(p.separator, p.panels);
1627
- }), K(e, {
1628
- defaultLayoutDeferred: c === 0,
1629
- derivedPanelConstraints: l,
1630
- groupSize: c,
1631
- layout: f,
1632
- separatorToPanels: v
1648
+ const f = /* @__PURE__ */ new Map();
1649
+ return Me({ group: e, includeDisabled: !0 }).forEach((p) => {
1650
+ p.separator && f.set(p.separator, p.panels);
1651
+ }), X(e, {
1652
+ defaultLayoutDeferred: s === 0,
1653
+ derivedPanelConstraints: u,
1654
+ groupSize: s,
1655
+ layout: a,
1656
+ separatorToPanels: f
1633
1657
  }), e.separators.forEach((p) => {
1634
- R(
1658
+ L(
1635
1659
  !r.has(p.id),
1636
1660
  `Separator ids must be unique; id "${p.id}" was used more than once`
1637
- ), r.add(p.id), p.element.addEventListener("keydown", Ue);
1638
- }), re.get(d) === 1 && (d.addEventListener("contextmenu", $e, !0), d.addEventListener("dblclick", Be, !0), d.addEventListener("pointerdown", We, !0), d.addEventListener("pointerleave", Ke), d.addEventListener("pointermove", qe), d.addEventListener("pointerout", Xe), d.addEventListener("pointerup", Ye, !0)), function() {
1661
+ ), r.add(p.id), p.element.addEventListener("keydown", We);
1662
+ }), re.get(l) === 1 && (l.addEventListener("contextmenu", He, !0), l.addEventListener("dblclick", Be, !0), l.addEventListener("pointerdown", Ke, !0), l.addEventListener("pointerleave", Xe), l.addEventListener("pointermove", qe), l.addEventListener("pointerout", Ye), l.addEventListener("pointerup", Je, !0)), function() {
1639
1663
  t = !1, re.set(
1640
- d,
1641
- Math.max(0, (re.get(d) ?? 0) - 1)
1642
- ), jt(e), Dt(e) && fe(d), e.separators.forEach((h) => {
1643
- h.element.removeEventListener("keydown", Ue);
1644
- }), re.get(d) || (d.removeEventListener(
1664
+ l,
1665
+ Math.max(0, (re.get(l) ?? 0) - 1)
1666
+ ), Vt(e), Nt(e) && fe(l), e.separators.forEach((g) => {
1667
+ g.element.removeEventListener("keydown", We);
1668
+ }), re.get(l) || (l.removeEventListener(
1645
1669
  "contextmenu",
1646
- $e,
1670
+ He,
1647
1671
  !0
1648
- ), d.removeEventListener(
1672
+ ), l.removeEventListener(
1649
1673
  "dblclick",
1650
1674
  Be,
1651
1675
  !0
1652
- ), d.removeEventListener(
1676
+ ), l.removeEventListener(
1653
1677
  "pointerdown",
1654
- We,
1678
+ Ke,
1655
1679
  !0
1656
- ), d.removeEventListener("pointerleave", Ke), d.removeEventListener("pointermove", qe), d.removeEventListener("pointerout", Xe), d.removeEventListener("pointerup", Ye, !0)), i.disconnect();
1680
+ ), l.removeEventListener("pointerleave", Xe), l.removeEventListener("pointermove", qe), l.removeEventListener("pointerout", Ye), l.removeEventListener("pointerup", Je, !0)), i.disconnect();
1657
1681
  };
1658
1682
  }
1659
- function on() {
1683
+ function sn() {
1660
1684
  const [e, t] = Z({}), n = ce(() => t({}), []);
1661
1685
  return [e, n];
1662
1686
  }
1663
- function Te(e) {
1664
- const t = wt();
1687
+ function Oe(e) {
1688
+ const t = Pt();
1665
1689
  return `${e ?? t}`;
1666
1690
  }
1667
- const j = typeof window < "u" ? Ze : Se;
1691
+ const V = typeof window < "u" ? Qe : Se;
1668
1692
  function ue(e) {
1669
1693
  const t = D(e);
1670
- return j(() => {
1694
+ return V(() => {
1671
1695
  t.current = e;
1672
1696
  }, [e]), ce(
1673
1697
  (...n) => t.current?.(...n),
1674
1698
  [t]
1675
1699
  );
1676
1700
  }
1677
- function Oe(...e) {
1701
+ function Te(...e) {
1678
1702
  return ue((t) => {
1679
1703
  e.forEach((n) => {
1680
1704
  if (n)
@@ -1693,31 +1717,31 @@ function Oe(...e) {
1693
1717
  }
1694
1718
  function De(e) {
1695
1719
  const t = D({ ...e });
1696
- return j(() => {
1720
+ return V(() => {
1697
1721
  for (const n in e)
1698
1722
  t.current[n] = e[n];
1699
1723
  }, [e]), t.current;
1700
1724
  }
1701
- const gt = Pt(null);
1702
- function rn({
1725
+ const yt = Lt(null);
1726
+ function an({
1703
1727
  separator: e
1704
1728
  }) {
1705
1729
  const { element: t } = e, n = D(null);
1706
- return j(() => {
1707
- const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], c = t.ownerDocument.defaultView;
1708
- return r.forEach((l, a) => {
1709
- const s = i[a];
1710
- if (s instanceof c.HTMLElement || s instanceof c.SVGElement) {
1711
- const u = c.getComputedStyle(l);
1712
- for (let f = 0; f < u.length; f++) {
1713
- const d = u.item(f);
1714
- s.style.setProperty(
1715
- d,
1716
- u.getPropertyValue(d)
1730
+ return V(() => {
1731
+ const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], s = t.ownerDocument.defaultView;
1732
+ return r.forEach((u, c) => {
1733
+ const a = i[c];
1734
+ if (a instanceof s.HTMLElement || a instanceof s.SVGElement) {
1735
+ const l = s.getComputedStyle(u);
1736
+ for (let f = 0; f < l.length; f++) {
1737
+ const y = l.item(f);
1738
+ a.style.setProperty(
1739
+ y,
1740
+ l.getPropertyValue(y)
1717
1741
  );
1718
1742
  }
1719
1743
  }
1720
- s.removeAttribute("data-testid"), s.removeAttribute("id");
1744
+ a.removeAttribute("data-testid"), a.removeAttribute("id");
1721
1745
  }), Object.assign(o.style, {
1722
1746
  boxSizing: "border-box",
1723
1747
  height: "100%",
@@ -1740,23 +1764,23 @@ function rn({
1740
1764
  );
1741
1765
  }
1742
1766
  function be() {
1743
- const e = Lt(gt);
1744
- return R(
1767
+ const e = Ct(yt);
1768
+ return L(
1745
1769
  e,
1746
1770
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1747
1771
  ), e;
1748
1772
  }
1749
- function yt(e) {
1773
+ function vt(e) {
1750
1774
  const { registerOverlay: t } = be(), n = D(e);
1751
- mt(n.current, e) || (n.current = e);
1775
+ gt(n.current, e) || (n.current = e);
1752
1776
  const o = n.current;
1753
- return j(
1777
+ return V(
1754
1778
  () => t(o),
1755
1779
  [t, o]
1756
1780
  ), null;
1757
1781
  }
1758
- yt.displayName = "SeparatorOverlay";
1759
- function sn({
1782
+ vt.displayName = "SeparatorOverlay";
1783
+ function ln({
1760
1784
  active: e,
1761
1785
  orientation: t,
1762
1786
  style: n,
@@ -1793,20 +1817,20 @@ function sn({
1793
1817
  }
1794
1818
  );
1795
1819
  }
1796
- function an({
1820
+ function cn({
1797
1821
  overlay: e,
1798
1822
  preview: t
1799
1823
  }) {
1800
- const { group: n, offset: o, rect: r, separator: i } = t, c = n.orientation === "horizontal";
1801
- let l = i?.preview, a = e;
1802
- return Ct(l) && l.type === yt && (a = l.props, l = void 0), l == null && (a ? l = /* @__PURE__ */ B(
1803
- sn,
1824
+ const { group: n, offset: o, rect: r, separator: i } = t, s = n.orientation === "horizontal";
1825
+ let u = i?.preview, c = e;
1826
+ return Rt(u) && u.type === vt && (c = u.props, u = void 0), u == null && (c ? u = /* @__PURE__ */ B(
1827
+ ln,
1804
1828
  {
1805
- ...a,
1829
+ ...c,
1806
1830
  active: t.active,
1807
1831
  orientation: n.orientation
1808
1832
  }
1809
- ) : i && (l = /* @__PURE__ */ B(rn, { separator: i }))), /* @__PURE__ */ B(
1833
+ ) : i && (u = /* @__PURE__ */ B(an, { separator: i }))), /* @__PURE__ */ B(
1810
1834
  "div",
1811
1835
  {
1812
1836
  "aria-hidden": "true",
@@ -1818,273 +1842,275 @@ function an({
1818
1842
  pointerEvents: "none",
1819
1843
  position: "absolute",
1820
1844
  top: r.top,
1821
- transform: c ? `translateX(${o}px)` : `translateY(${o}px)`,
1845
+ transform: s ? `translateX(${o}px)` : `translateY(${o}px)`,
1822
1846
  width: r.width
1823
1847
  },
1824
- children: l
1848
+ children: u
1825
1849
  }
1826
1850
  );
1827
1851
  }
1828
- function ln(e, t) {
1852
+ function un(e, t) {
1829
1853
  const n = D({
1830
1854
  getLayout: () => ({}),
1831
- setLayout: At
1855
+ setLayout: Gt
1832
1856
  });
1833
- Qe(t, () => n.current, []), j(() => {
1857
+ et(t, () => n.current, []), V(() => {
1834
1858
  Object.assign(
1835
1859
  n.current,
1836
- ht({ groupId: e })
1860
+ mt({ groupId: e })
1837
1861
  );
1838
1862
  });
1839
1863
  }
1840
- function cn({
1864
+ function fn({
1841
1865
  groupId: e,
1842
1866
  resizePreviewMode: t
1843
1867
  }) {
1844
1868
  const [n, o] = Z([]), r = D(n);
1845
- return j(() => {
1846
- const i = (l) => {
1847
- const a = ut(e), s = t === "separator" && l.state === "active" ? l.previews.filter(
1848
- (f) => f.group === a && (f.active || !O(f.offset, 0))
1849
- ) : [], u = r.current;
1850
- u.length === s.length && s.every(
1851
- (f, d) => f === u[d]
1852
- ) || (r.current = s, o(s));
1869
+ return V(() => {
1870
+ const i = (u) => {
1871
+ const c = ft(e), a = t === "separator" && u.state === "active" ? u.previews.filter(
1872
+ (f) => f.group === c && (f.active || !T(f.offset, 0))
1873
+ ) : [], l = r.current;
1874
+ l.length === a.length && a.every(
1875
+ (f, y) => f === l[y]
1876
+ ) || (r.current = a, o(a));
1853
1877
  };
1854
1878
  if (t !== "separator") {
1855
- i(X());
1879
+ i(q());
1856
1880
  return;
1857
1881
  }
1858
- const c = nt(
1859
- ({ next: l }) => i(l)
1882
+ const s = ot(
1883
+ ({ next: u }) => i(u)
1860
1884
  );
1861
- return i(X()), c;
1885
+ return i(q()), s;
1862
1886
  }, [e, t]), n;
1863
1887
  }
1864
- function un({
1888
+ function dn({
1865
1889
  children: e,
1866
1890
  className: t,
1867
1891
  defaultLayout: n,
1868
1892
  disableCursor: o,
1869
1893
  disabled: r,
1870
1894
  elementRef: i,
1871
- groupRef: c,
1872
- id: l,
1873
- onLayoutChange: a,
1874
- onLayoutChanged: s,
1875
- orientation: u = "horizontal",
1895
+ groupRef: s,
1896
+ id: u,
1897
+ onLayoutChange: c,
1898
+ onLayoutChanged: a,
1899
+ orientation: l = "horizontal",
1876
1900
  resizePreviewMode: f = "panel",
1877
- resizeTargetMinimumSize: d = {
1901
+ resizeTargetMinimumSize: y = {
1878
1902
  coarse: 20,
1879
1903
  fine: 10
1880
1904
  },
1881
- style: v,
1882
- ...z
1905
+ style: p,
1906
+ ...g
1883
1907
  }) {
1884
- const p = D({
1908
+ const d = D({
1885
1909
  onLayoutChange: {},
1886
1910
  onLayoutChanged: {}
1887
- }), h = ue((S) => {
1888
- W(p.current.onLayoutChange, S) || (p.current.onLayoutChange = S, a?.(S));
1889
- }), g = ue(
1890
- (S, P) => {
1891
- W(p.current.onLayoutChanged, S) || (p.current.onLayoutChanged = S, s?.(S, { isUserInteraction: P }));
1911
+ }), v = ue((b) => {
1912
+ K(d.current.onLayoutChange, b) || (d.current.onLayoutChange = b, c?.(b));
1913
+ }), h = ue(
1914
+ (b, z) => {
1915
+ K(d.current.onLayoutChanged, b) || (d.current.onLayoutChanged = b, a?.(b, { isUserInteraction: z }));
1892
1916
  }
1893
- ), y = Te(l), [m, b] = Z(), x = cn({
1894
- groupId: y,
1917
+ ), m = Oe(u), [x, S] = Z(), P = fn({
1918
+ groupId: m,
1895
1919
  resizePreviewMode: f
1896
- }), L = D(null), [w, C] = on(), M = D({
1920
+ }), C = D(null), [E, w] = sn(), R = D({
1897
1921
  lastExpandedPanelSizes: {},
1898
1922
  layouts: {},
1899
1923
  panels: [],
1900
- resizeTargetMinimumSize: d,
1901
1924
  separators: []
1902
- }), T = Oe(L, i);
1903
- ln(y, c);
1904
- const G = ue(
1905
- (S, P) => {
1906
- const I = Q(S);
1907
- if (I)
1925
+ }), N = Te(C, i);
1926
+ un(m, s);
1927
+ const O = ue(
1928
+ (b, z) => {
1929
+ const M = Q(b);
1930
+ if (M)
1908
1931
  return {
1909
- flexGrow: I.layout[P] ?? 1
1932
+ flexGrow: M.layout[z] ?? 1
1910
1933
  };
1911
- if (n?.[P])
1934
+ if (n?.[z])
1912
1935
  return {
1913
- flexGrow: n?.[P]
1936
+ flexGrow: n?.[z]
1914
1937
  };
1915
1938
  }
1916
- ), E = De({
1939
+ ), I = De({
1917
1940
  defaultLayout: n,
1918
- disableCursor: o
1919
- }), N = Pe(
1941
+ disableCursor: o,
1942
+ resizeTargetMinimumSize: y
1943
+ }), G = Pe(
1920
1944
  () => ({
1921
1945
  get disableCursor() {
1922
- return !!E.disableCursor;
1946
+ return !!I.disableCursor;
1923
1947
  },
1924
- getPanelStyles: G,
1925
- id: y,
1926
- orientation: u,
1927
- registerPanel: (S) => {
1928
- const P = M.current;
1929
- return P.panels = Ce(u, [
1930
- ...P.panels,
1931
- S
1932
- ]), C(), () => {
1933
- P.panels = P.panels.filter(
1934
- (I) => I !== S
1935
- ), C();
1948
+ getPanelStyles: O,
1949
+ id: m,
1950
+ orientation: l,
1951
+ registerPanel: (b) => {
1952
+ const z = R.current;
1953
+ return z.panels = Ce(l, [
1954
+ ...z.panels,
1955
+ b
1956
+ ]), w(), () => {
1957
+ z.panels = z.panels.filter(
1958
+ (M) => M !== b
1959
+ ), w();
1936
1960
  };
1937
1961
  },
1938
- registerOverlay: (S) => (b(S), () => {
1939
- b(void 0);
1962
+ registerOverlay: (b) => (S(b), () => {
1963
+ S(void 0);
1940
1964
  }),
1941
- registerSeparator: (S) => {
1942
- const P = M.current;
1943
- return P.separators = Ce(u, [
1944
- ...P.separators,
1945
- S
1946
- ]), C(), () => {
1947
- P.separators = P.separators.filter(
1948
- (I) => I !== S
1949
- ), C();
1965
+ registerSeparator: (b) => {
1966
+ const z = R.current;
1967
+ return z.separators = Ce(l, [
1968
+ ...z.separators,
1969
+ b
1970
+ ]), w(), () => {
1971
+ z.separators = z.separators.filter(
1972
+ (M) => M !== b
1973
+ ), w();
1950
1974
  };
1951
1975
  },
1952
- updatePanelProps: (S, { disabled: P }) => {
1953
- const F = M.current.panels.find(
1954
- (oe) => oe.id === S
1976
+ updatePanelProps: (b, { disabled: z }) => {
1977
+ const A = R.current.panels.find(
1978
+ (oe) => oe.id === b
1955
1979
  );
1956
- F && (F.panelConstraints.disabled = P);
1957
- const $ = ut(y), Y = Q(y);
1958
- $ && Y && K($, {
1980
+ A && (A.panelConstraints.disabled = z);
1981
+ const $ = ft(m), Y = Q(m);
1982
+ $ && Y && X($, {
1959
1983
  ...Y,
1960
1984
  derivedPanelConstraints: Le($)
1961
1985
  });
1962
1986
  },
1963
- updateSeparatorProps: (S, {
1964
- disabled: P,
1965
- disableDoubleClick: I
1987
+ updateSeparatorProps: (b, {
1988
+ disabled: z,
1989
+ disableDoubleClick: M
1966
1990
  }) => {
1967
- const $ = M.current.separators.find(
1968
- (Y) => Y.id === S
1991
+ const $ = R.current.separators.find(
1992
+ (Y) => Y.id === b
1969
1993
  );
1970
- $ && ($.disabled = P, $.disableDoubleClick = I);
1994
+ $ && ($.disabled = z, $.disableDoubleClick = M);
1971
1995
  }
1972
1996
  }),
1973
- [G, y, C, u, E]
1997
+ [O, m, w, l, I]
1974
1998
  ), _ = D(null);
1975
- return j(() => {
1976
- const S = L.current;
1977
- if (S === null)
1999
+ return V(() => {
2000
+ const b = C.current;
2001
+ if (b === null)
1978
2002
  return;
1979
- const P = M.current;
1980
- let I;
1981
- if (E.defaultLayout !== void 0 && Object.keys(E.defaultLayout).length === P.panels.length) {
1982
- I = {};
1983
- for (const J of P.panels) {
1984
- const pe = E.defaultLayout[J.id];
1985
- pe !== void 0 && (I[J.id] = pe);
2003
+ const z = R.current;
2004
+ let M;
2005
+ if (I.defaultLayout !== void 0 && Object.keys(I.defaultLayout).length === z.panels.length) {
2006
+ M = {};
2007
+ for (const J of z.panels) {
2008
+ const pe = I.defaultLayout[J.id];
2009
+ pe !== void 0 && (M[J.id] = pe);
1986
2010
  }
1987
2011
  }
1988
- const F = {
2012
+ const A = {
1989
2013
  disabled: !!r,
1990
- element: S,
1991
- id: y,
2014
+ element: b,
2015
+ id: m,
1992
2016
  mutableState: {
1993
- defaultLayout: I,
1994
- disableCursor: !!E.disableCursor,
1995
- expandedPanelSizes: M.current.lastExpandedPanelSizes,
1996
- layouts: M.current.layouts
2017
+ defaultLayout: M,
2018
+ disableCursor: !!I.disableCursor,
2019
+ expandedPanelSizes: R.current.lastExpandedPanelSizes,
2020
+ layouts: R.current.layouts
1997
2021
  },
1998
- orientation: u,
1999
- panels: P.panels,
2022
+ orientation: l,
2023
+ panels: z.panels,
2000
2024
  resizePreviewMode: f,
2001
- resizeTargetMinimumSize: P.resizeTargetMinimumSize,
2002
- separators: P.separators
2025
+ get resizeTargetMinimumSize() {
2026
+ return I.resizeTargetMinimumSize;
2027
+ },
2028
+ separators: z.separators
2003
2029
  };
2004
- _.current = F;
2005
- const $ = nn(F), { defaultLayoutDeferred: Y, derivedPanelConstraints: oe, layout: le } = Q(F.id, !0);
2006
- !Y && oe.length > 0 && (h(le), g(le, !1));
2007
- const xe = Ee(y, (J) => {
2008
- const { defaultLayoutDeferred: pe, derivedPanelConstraints: Ae, layout: he } = J.next;
2009
- if (pe || Ae.length === 0)
2030
+ _.current = A;
2031
+ const $ = rn(A), { defaultLayoutDeferred: Y, derivedPanelConstraints: oe, layout: le } = Q(A.id, !0);
2032
+ !Y && oe.length > 0 && (v(le), h(le, !1));
2033
+ const xe = Ee(m, (J) => {
2034
+ const { defaultLayoutDeferred: pe, derivedPanelConstraints: Ne, layout: he } = J.next;
2035
+ if (pe || Ne.length === 0)
2010
2036
  return;
2011
- const vt = F.panels.map(({ id: q }) => q).join(",");
2012
- F.mutableState.layouts[vt] = he, Ae.forEach((q) => {
2013
- if (q.collapsible) {
2037
+ const St = A.panels.map(({ id: H }) => H).join(",");
2038
+ A.mutableState.layouts[St] = he, Ne.forEach((H) => {
2039
+ if (H.collapsible) {
2014
2040
  const { layout: ze } = J.prev ?? {};
2015
2041
  if (ze) {
2016
- const bt = O(
2017
- q.collapsedSize,
2018
- he[q.panelId]
2019
- ), xt = O(
2020
- q.collapsedSize,
2021
- ze[q.panelId]
2042
+ const xt = T(
2043
+ H.collapsedSize,
2044
+ he[H.panelId]
2045
+ ), zt = T(
2046
+ H.collapsedSize,
2047
+ ze[H.panelId]
2022
2048
  );
2023
- bt && !xt && (F.mutableState.expandedPanelSizes[q.panelId] = ze[q.panelId]);
2049
+ xt && !zt && (A.mutableState.expandedPanelSizes[H.panelId] = ze[H.panelId]);
2024
2050
  }
2025
2051
  }
2026
2052
  });
2027
- const St = X().state !== "active";
2028
- h(he), St && g(he, J.isUserInteraction);
2053
+ const Ge = q(), bt = Ge.state !== "active" || !Ge.hitRegions.some((H) => H.group === A);
2054
+ v(he), bt && h(he, J.isUserInteraction);
2029
2055
  });
2030
2056
  return () => {
2031
2057
  _.current = null, $(), xe();
2032
2058
  };
2033
2059
  }, [
2034
2060
  r,
2035
- y,
2036
- g,
2061
+ m,
2037
2062
  h,
2038
- u,
2039
- w,
2063
+ v,
2064
+ l,
2065
+ E,
2040
2066
  f,
2041
- E
2067
+ I
2042
2068
  ]), Se(() => {
2043
- const S = _.current;
2044
- S && (S.mutableState.defaultLayout = n, S.mutableState.disableCursor = !!o);
2045
- }), /* @__PURE__ */ B(gt.Provider, { value: N, children: /* @__PURE__ */ zt(
2069
+ const b = _.current;
2070
+ b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
2071
+ }), /* @__PURE__ */ B(yt.Provider, { value: G, children: /* @__PURE__ */ wt(
2046
2072
  "div",
2047
2073
  {
2048
- ...z,
2074
+ ...g,
2049
2075
  className: t,
2050
2076
  "data-group": !0,
2051
- "data-testid": y,
2052
- id: y,
2053
- ref: T,
2077
+ "data-testid": m,
2078
+ id: m,
2079
+ ref: N,
2054
2080
  style: {
2055
2081
  height: "100%",
2056
2082
  width: "100%",
2057
2083
  overflow: "hidden",
2058
2084
  position: f === "separator" ? "relative" : void 0,
2059
- ...v,
2085
+ ...p,
2060
2086
  display: "flex",
2061
- flexDirection: u === "horizontal" ? "row" : "column",
2087
+ flexDirection: l === "horizontal" ? "row" : "column",
2062
2088
  flexWrap: "nowrap",
2063
2089
  // Inform the browser that the library is handling touch events for this element
2064
2090
  // but still allow users to scroll content within panels in the non-resizing direction
2065
2091
  // NOTE This is not an inherited style
2066
2092
  // See github.com/bvaughn/react-resizable-panels/issues/662
2067
- touchAction: u === "horizontal" ? "pan-y" : "pan-x"
2093
+ touchAction: l === "horizontal" ? "pan-y" : "pan-x"
2068
2094
  },
2069
2095
  children: [
2070
2096
  e,
2071
- x.map((S) => /* @__PURE__ */ B(
2072
- an,
2097
+ P.map((b) => /* @__PURE__ */ B(
2098
+ cn,
2073
2099
  {
2074
- overlay: m,
2075
- preview: S
2100
+ overlay: x,
2101
+ preview: b
2076
2102
  },
2077
- S.key
2103
+ b.key
2078
2104
  ))
2079
2105
  ]
2080
2106
  }
2081
2107
  ) });
2082
2108
  }
2083
- un.displayName = "Group";
2109
+ dn.displayName = "Group";
2084
2110
  function ve(e, t) {
2085
2111
  return `react-resizable-panels:${[e, ...t].join(":")}`;
2086
2112
  }
2087
- function fn({
2113
+ function pn({
2088
2114
  id: e,
2089
2115
  panelIds: t,
2090
2116
  storage: n
@@ -2094,24 +2120,24 @@ function fn({
2094
2120
  try {
2095
2121
  const i = JSON.parse(r);
2096
2122
  if (t) {
2097
- const c = t.join(","), l = i[c];
2098
- if (l && Array.isArray(l.layout) && t.length === l.layout.length) {
2099
- const a = {};
2100
- for (let s = 0; s < t.length; s++)
2101
- a[t[s]] = l.layout[s];
2102
- return a;
2123
+ const s = t.join(","), u = i[s];
2124
+ if (u && Array.isArray(u.layout) && t.length === u.layout.length) {
2125
+ const c = {};
2126
+ for (let a = 0; a < t.length; a++)
2127
+ c[t[a]] = u.layout[a];
2128
+ return c;
2103
2129
  }
2104
2130
  } else {
2105
- const c = Object.keys(i);
2106
- if (c.length === 1) {
2107
- const l = i[c[0]];
2108
- if (l && Array.isArray(l.layout)) {
2109
- const a = c[0].split(",");
2110
- if (a.length === l.layout.length) {
2111
- const s = {};
2112
- for (let u = 0; u < a.length; u++)
2113
- s[a[u]] = l.layout[u];
2114
- return s;
2131
+ const s = Object.keys(i);
2132
+ if (s.length === 1) {
2133
+ const u = i[s[0]];
2134
+ if (u && Array.isArray(u.layout)) {
2135
+ const c = s[0].split(",");
2136
+ if (c.length === u.layout.length) {
2137
+ const a = {};
2138
+ for (let l = 0; l < c.length; l++)
2139
+ a[c[l]] = u.layout[l];
2140
+ return a;
2115
2141
  }
2116
2142
  }
2117
2143
  }
@@ -2119,69 +2145,69 @@ function fn({
2119
2145
  } catch {
2120
2146
  }
2121
2147
  }
2122
- function xn({
2148
+ function zn({
2123
2149
  debounceSaveMs: e = 100,
2124
2150
  onlySaveAfterUserInteractions: t,
2125
2151
  panelIds: n,
2126
2152
  storage: o = localStorage,
2127
2153
  ...r
2128
2154
  }) {
2129
- const i = n !== void 0, c = "id" in r ? r.id : r.groupId, l = ve(c, n ?? []), a = et(
2130
- dn,
2131
- () => o.getItem(l),
2132
- () => o.getItem(l)
2133
- ), s = Pe(() => {
2134
- if (a) {
2135
- const h = JSON.parse(a), g = Object.values(h);
2136
- if (Array.from(g).every((y) => typeof y == "number"))
2137
- return h;
2155
+ const i = n !== void 0, s = "id" in r ? r.id : r.groupId, u = ve(s, n ?? []), c = tt(
2156
+ hn,
2157
+ () => o.getItem(u),
2158
+ () => o.getItem(u)
2159
+ ), a = Pe(() => {
2160
+ if (c) {
2161
+ const v = JSON.parse(c), h = Object.values(v);
2162
+ if (Array.from(h).every((m) => typeof m == "number"))
2163
+ return v;
2138
2164
  }
2139
- }, [a]), u = Pe(() => {
2140
- if (!s)
2141
- return fn({
2142
- id: c,
2165
+ }, [c]), l = Pe(() => {
2166
+ if (!a)
2167
+ return pn({
2168
+ id: s,
2143
2169
  panelIds: n,
2144
2170
  storage: o
2145
2171
  });
2146
- }, [s, c, n, o]), f = s ?? u, d = D(null), v = ce(() => {
2147
- const h = d.current;
2148
- h && (d.current = null, clearTimeout(h));
2172
+ }, [a, s, n, o]), f = a ?? l, y = D(null), p = ce(() => {
2173
+ const v = y.current;
2174
+ v && (y.current = null, clearTimeout(v));
2149
2175
  }, []);
2150
- Ze(() => () => {
2151
- v();
2152
- }, [v]);
2153
- const z = ce(
2176
+ Qe(() => () => {
2177
+ p();
2178
+ }, [p]);
2179
+ const g = ce(
2154
2180
  // The hook persists every layout commit -- including library-driven ones --
2155
2181
  // because it owns its own storage and the goal is to remember whatever
2156
2182
  // layout the user is currently looking at. Consumers that only want to
2157
2183
  // persist on user interaction should branch on `isUserInteraction` in
2158
2184
  // their own callback (see #716) rather than via this hook.
2159
- (h, g) => {
2160
- if (t && !g.isUserInteraction)
2185
+ (v, h) => {
2186
+ if (t && !h.isUserInteraction)
2161
2187
  return;
2162
- v();
2163
- let y;
2164
- i ? y = ve(c, Object.keys(h)) : y = ve(c, []);
2188
+ p();
2189
+ let m;
2190
+ i ? m = ve(s, Object.keys(v)) : m = ve(s, []);
2165
2191
  try {
2166
- o.setItem(y, JSON.stringify(h));
2167
- } catch (m) {
2168
- console.error(m);
2192
+ o.setItem(m, JSON.stringify(v));
2193
+ } catch (x) {
2194
+ console.error(x);
2169
2195
  }
2170
2196
  },
2171
2197
  [
2172
- v,
2198
+ p,
2173
2199
  i,
2174
- c,
2200
+ s,
2175
2201
  t,
2176
2202
  o
2177
2203
  ]
2178
- ), p = ce(
2179
- (h) => {
2180
- v(), e === 0 ? z(h, { isUserInteraction: !1 }) : d.current = setTimeout(() => {
2181
- z(h, { isUserInteraction: !1 });
2204
+ ), d = ce(
2205
+ (v) => {
2206
+ p(), e === 0 ? g(v, { isUserInteraction: !1 }) : y.current = setTimeout(() => {
2207
+ g(v, { isUserInteraction: !1 });
2182
2208
  }, e);
2183
2209
  },
2184
- [v, e, z]
2210
+ [p, e, g]
2185
2211
  );
2186
2212
  return {
2187
2213
  /**
@@ -2193,24 +2219,24 @@ function xn({
2193
2219
  *
2194
2220
  * @deprecated Use the {@link onLayoutChanged} prop instead.
2195
2221
  */
2196
- onLayoutChange: p,
2222
+ onLayoutChange: d,
2197
2223
  /**
2198
2224
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
2199
2225
  */
2200
- onLayoutChanged: z
2226
+ onLayoutChanged: g
2201
2227
  };
2202
2228
  }
2203
- function dn() {
2229
+ function hn() {
2204
2230
  return function() {
2205
2231
  };
2206
2232
  }
2207
- function zn() {
2233
+ function wn() {
2208
2234
  return Z(null);
2209
2235
  }
2210
- function wn() {
2236
+ function Pn() {
2211
2237
  return D(null);
2212
2238
  }
2213
- function pn(e, t) {
2239
+ function mn(e, t) {
2214
2240
  const { id: n } = be(), o = D({
2215
2241
  collapse: we,
2216
2242
  expand: we,
@@ -2221,111 +2247,111 @@ function pn(e, t) {
2221
2247
  isCollapsed: () => !1,
2222
2248
  resize: we
2223
2249
  });
2224
- Qe(t, () => o.current, []), j(() => {
2250
+ et(t, () => o.current, []), V(() => {
2225
2251
  Object.assign(
2226
2252
  o.current,
2227
- pt({ groupId: n, panelId: e })
2253
+ ht({ groupId: n, panelId: e })
2228
2254
  );
2229
2255
  });
2230
2256
  }
2231
- function hn({
2257
+ function gn({
2232
2258
  children: e,
2233
2259
  className: t,
2234
2260
  collapsedSize: n = "0%",
2235
2261
  collapsedThreshold: o,
2236
2262
  collapsible: r = !1,
2237
2263
  defaultSize: i,
2238
- disabled: c,
2239
- elementRef: l,
2240
- groupResizeBehavior: a = "preserve-relative-size",
2241
- id: s,
2242
- maxSize: u = "100%",
2264
+ disabled: s,
2265
+ elementRef: u,
2266
+ groupResizeBehavior: c = "preserve-relative-size",
2267
+ id: a,
2268
+ maxSize: l = "100%",
2243
2269
  minSize: f = "0%",
2244
- onResize: d,
2245
- panelRef: v,
2246
- style: z,
2247
- ...p
2270
+ onResize: y,
2271
+ panelRef: p,
2272
+ style: g,
2273
+ ...d
2248
2274
  }) {
2249
- const h = !!s, g = Te(s), y = De({
2250
- disabled: c
2251
- }), m = D(null), b = Oe(m, l), {
2252
- getPanelStyles: x,
2253
- id: L,
2254
- orientation: w,
2255
- registerPanel: C,
2256
- updatePanelProps: M
2257
- } = be(), T = d !== null, G = ue(
2258
- (S, P, I) => {
2259
- d?.(S, s, I);
2275
+ const v = !!a, h = Oe(a), m = De({
2276
+ disabled: s
2277
+ }), x = D(null), S = Te(x, u), {
2278
+ getPanelStyles: P,
2279
+ id: C,
2280
+ orientation: E,
2281
+ registerPanel: w,
2282
+ updatePanelProps: R
2283
+ } = be(), N = y !== null, O = ue(
2284
+ (b, z, M) => {
2285
+ y?.(b, a, M);
2260
2286
  }
2261
2287
  );
2262
- j(() => {
2263
- const S = m.current;
2264
- if (S !== null) {
2265
- const P = {
2266
- element: S,
2267
- id: g,
2268
- idIsStable: h,
2288
+ V(() => {
2289
+ const b = x.current;
2290
+ if (b !== null) {
2291
+ const z = {
2292
+ element: b,
2293
+ id: h,
2294
+ idIsStable: v,
2269
2295
  mutableValues: {
2270
2296
  expandToSize: void 0,
2271
2297
  prevSize: void 0
2272
2298
  },
2273
- onResize: T ? G : void 0,
2299
+ onResize: N ? O : void 0,
2274
2300
  panelConstraints: {
2275
- groupResizeBehavior: a,
2301
+ groupResizeBehavior: c,
2276
2302
  collapsedSize: n,
2277
2303
  collapsedThreshold: o,
2278
2304
  collapsible: r,
2279
2305
  defaultSize: i,
2280
- disabled: y.disabled,
2281
- maxSize: u,
2306
+ disabled: m.disabled,
2307
+ maxSize: l,
2282
2308
  minSize: f
2283
2309
  }
2284
2310
  };
2285
- return C(P);
2311
+ return w(z);
2286
2312
  }
2287
2313
  }, [
2288
- a,
2314
+ c,
2289
2315
  n,
2290
2316
  o,
2291
2317
  r,
2292
2318
  i,
2293
- T,
2294
- g,
2319
+ N,
2295
2320
  h,
2296
- u,
2321
+ v,
2322
+ l,
2297
2323
  f,
2298
- G,
2299
- C,
2300
- y
2324
+ O,
2325
+ w,
2326
+ m
2301
2327
  ]), Se(() => {
2302
- M(g, { disabled: c });
2303
- }, [c, g, M]), pn(g, v);
2304
- const E = () => {
2305
- const S = x(L, g);
2306
- if (S)
2307
- return JSON.stringify(S);
2308
- }, N = et(
2309
- (S) => Ee(L, S),
2310
- E,
2311
- E
2328
+ R(h, { disabled: s });
2329
+ }, [s, h, R]), mn(h, p);
2330
+ const I = () => {
2331
+ const b = P(C, h);
2332
+ if (b)
2333
+ return JSON.stringify(b);
2334
+ }, G = tt(
2335
+ (b) => Ee(C, b),
2336
+ I,
2337
+ I
2312
2338
  );
2313
2339
  let _;
2314
- return N ? _ = JSON.parse(N) : i !== void 0 ? _ = {
2340
+ return G ? _ = JSON.parse(G) : i !== void 0 ? _ = {
2315
2341
  flexGrow: void 0,
2316
2342
  flexShrink: void 0,
2317
2343
  flexBasis: i
2318
2344
  } : _ = { flexGrow: 1 }, /* @__PURE__ */ B(
2319
2345
  "div",
2320
2346
  {
2321
- ...p,
2322
- "data-disabled": c || void 0,
2347
+ ...d,
2348
+ "data-disabled": s || void 0,
2323
2349
  "data-panel": !0,
2324
- "data-testid": g,
2325
- id: g,
2326
- ref: b,
2350
+ "data-testid": h,
2351
+ id: h,
2352
+ ref: S,
2327
2353
  style: {
2328
- ...mn,
2354
+ ...yn,
2329
2355
  display: "flex",
2330
2356
  flexBasis: 0,
2331
2357
  flexShrink: 1,
@@ -2341,12 +2367,12 @@ function hn({
2341
2367
  maxWidth: "100%",
2342
2368
  flexGrow: 1,
2343
2369
  overflow: "auto",
2344
- ...z,
2370
+ ...g,
2345
2371
  // Inform the browser that the library is handling touch events for this element
2346
2372
  // but still allow users to scroll content within panels in the non-resizing direction
2347
2373
  // NOTE This is not an inherited style
2348
2374
  // See github.com/bvaughn/react-resizable-panels/issues/662
2349
- touchAction: w === "horizontal" ? "pan-y" : "pan-x"
2375
+ touchAction: E === "horizontal" ? "pan-y" : "pan-x"
2350
2376
  },
2351
2377
  children: e
2352
2378
  }
@@ -2354,8 +2380,8 @@ function hn({
2354
2380
  }
2355
2381
  );
2356
2382
  }
2357
- hn.displayName = "Panel";
2358
- const mn = {
2383
+ gn.displayName = "Panel";
2384
+ const yn = {
2359
2385
  minHeight: 0,
2360
2386
  maxHeight: "100%",
2361
2387
  height: "auto",
@@ -2367,39 +2393,39 @@ const mn = {
2367
2393
  padding: 0,
2368
2394
  margin: 0
2369
2395
  };
2370
- function Pn() {
2396
+ function Ln() {
2371
2397
  return Z(null);
2372
2398
  }
2373
- function Ln() {
2399
+ function Cn() {
2374
2400
  return D(null);
2375
2401
  }
2376
- function gn({
2402
+ function vn({
2377
2403
  layout: e,
2378
2404
  panelConstraints: t,
2379
2405
  panelId: n,
2380
2406
  panelIndex: o
2381
2407
  }) {
2382
2408
  let r, i;
2383
- const c = e[n], l = t.find(
2384
- (a) => a.panelId === n
2409
+ const s = e[n], u = t.find(
2410
+ (c) => c.panelId === n
2385
2411
  );
2386
- if (l) {
2387
- const a = l.maxSize, s = l.collapsible ? l.collapsedSize : l.minSize, u = [o, o + 1];
2412
+ if (u) {
2413
+ const c = u.maxSize, a = u.collapsible ? u.collapsedSize : u.minSize, l = [o, o + 1];
2388
2414
  i = ne({
2389
2415
  layout: de({
2390
- delta: s - c,
2416
+ delta: a - s,
2391
2417
  initialLayout: e,
2392
2418
  panelConstraints: t,
2393
- pivotIndices: u,
2419
+ pivotIndices: l,
2394
2420
  prevLayout: e
2395
2421
  }),
2396
2422
  panelConstraints: t
2397
2423
  })[n], r = ne({
2398
2424
  layout: de({
2399
- delta: a - c,
2425
+ delta: c - s,
2400
2426
  initialLayout: e,
2401
2427
  panelConstraints: t,
2402
- pivotIndices: u,
2428
+ pivotIndices: l,
2403
2429
  prevLayout: e
2404
2430
  }),
2405
2431
  panelConstraints: t
@@ -2409,76 +2435,76 @@ function gn({
2409
2435
  valueControls: n,
2410
2436
  valueMax: r,
2411
2437
  valueMin: i,
2412
- valueNow: c
2438
+ valueNow: s
2413
2439
  };
2414
2440
  }
2415
- function yn({
2441
+ function Sn({
2416
2442
  children: e,
2417
2443
  className: t,
2418
2444
  disabled: n,
2419
2445
  disableDoubleClick: o,
2420
2446
  elementRef: r,
2421
2447
  id: i,
2422
- preview: c,
2423
- style: l,
2424
- ...a
2448
+ preview: s,
2449
+ style: u,
2450
+ ...c
2425
2451
  }) {
2426
- const s = Te(i), u = De({
2452
+ const a = Oe(i), l = De({
2427
2453
  disabled: n,
2428
2454
  disableDoubleClick: o,
2429
2455
  children: e,
2430
2456
  className: t,
2431
- preview: c,
2432
- style: l
2433
- }), [f, d] = Z({}), [v, z] = Z("inactive"), [p, h] = Z(!1), g = D(null), y = D(null), m = Oe(g, r), {
2434
- disableCursor: b,
2435
- id: x,
2436
- orientation: L,
2437
- registerSeparator: w,
2438
- updateSeparatorProps: C
2439
- } = be(), M = L === "horizontal" ? "vertical" : "horizontal";
2440
- j(() => {
2441
- const E = g.current;
2442
- if (E !== null) {
2443
- const N = {
2444
- disabled: u.disabled,
2445
- disableDoubleClick: u.disableDoubleClick,
2446
- element: E,
2447
- id: s,
2457
+ preview: s,
2458
+ style: u
2459
+ }), [f, y] = Z({}), [p, g] = Z("inactive"), [d, v] = Z(!1), h = D(null), m = D(null), x = Te(h, r), {
2460
+ disableCursor: S,
2461
+ id: P,
2462
+ orientation: C,
2463
+ registerSeparator: E,
2464
+ updateSeparatorProps: w
2465
+ } = be(), R = C === "horizontal" ? "vertical" : "horizontal";
2466
+ V(() => {
2467
+ const I = h.current;
2468
+ if (I !== null) {
2469
+ const G = {
2470
+ disabled: l.disabled,
2471
+ disableDoubleClick: l.disableDoubleClick,
2472
+ element: I,
2473
+ id: a,
2448
2474
  get children() {
2449
- return u.children;
2475
+ return l.children;
2450
2476
  },
2451
2477
  get className() {
2452
- return u.className;
2478
+ return l.className;
2453
2479
  },
2454
2480
  get preview() {
2455
- return u.preview;
2481
+ return l.preview;
2456
2482
  },
2457
2483
  get style() {
2458
- return u.style;
2484
+ return l.style;
2459
2485
  }
2460
2486
  };
2461
- y.current = N;
2462
- const _ = w(N), S = nt(
2463
- (I) => {
2464
- z(
2465
- I.next.state !== "inactive" && I.next.hitRegions.some(
2466
- (F) => F.separator === N
2467
- ) ? I.next.state : "inactive"
2487
+ m.current = G;
2488
+ const _ = E(G), b = ot(
2489
+ (M) => {
2490
+ g(
2491
+ M.next.state !== "inactive" && M.next.hitRegions.some(
2492
+ (A) => A.separator === G
2493
+ ) ? M.next.state : "inactive"
2468
2494
  );
2469
2495
  }
2470
- ), P = Ee(
2471
- x,
2472
- (I) => {
2473
- const { derivedPanelConstraints: F, layout: $, separatorToPanels: Y } = I.next, oe = Y.get(N);
2496
+ ), z = Ee(
2497
+ P,
2498
+ (M) => {
2499
+ const { derivedPanelConstraints: A, layout: $, separatorToPanels: Y } = M.next, oe = Y.get(G);
2474
2500
  if (oe) {
2475
- const le = oe[0], xe = F.findIndex(
2501
+ const le = oe[0], xe = A.findIndex(
2476
2502
  (J) => J.panelId === le.id
2477
2503
  );
2478
- d(
2479
- gn({
2504
+ y(
2505
+ vn({
2480
2506
  layout: $,
2481
- panelConstraints: F,
2507
+ panelConstraints: A,
2482
2508
  panelId: le.id,
2483
2509
  panelIndex: xe
2484
2510
  })
@@ -2487,52 +2513,52 @@ function yn({
2487
2513
  }
2488
2514
  );
2489
2515
  return () => {
2490
- y.current = null, S(), P(), _();
2516
+ m.current = null, b(), z(), _();
2491
2517
  };
2492
2518
  }
2493
- }, [x, s, w, u]), j(() => {
2494
- const E = y.current;
2495
- E && Ot(E);
2496
- }, [c]), Se(() => {
2497
- C(s, { disabled: n, disableDoubleClick: o });
2498
- }, [n, o, s, C]);
2499
- let T;
2500
- n && !b && (T = "not-allowed");
2501
- let G;
2519
+ }, [P, a, E, l]), V(() => {
2520
+ const I = m.current;
2521
+ I && Dt(I);
2522
+ }, [s]), Se(() => {
2523
+ w(a, { disabled: n, disableDoubleClick: o });
2524
+ }, [n, o, a, w]);
2525
+ let N;
2526
+ n && !S && (N = "not-allowed");
2527
+ let O;
2502
2528
  if (n)
2503
- G = "disabled";
2529
+ O = "disabled";
2504
2530
  else
2505
- switch (v) {
2531
+ switch (p) {
2506
2532
  case "active": {
2507
- G = "active";
2533
+ O = "active";
2508
2534
  break;
2509
2535
  }
2510
2536
  default:
2511
- p ? G = "focus" : G = v;
2537
+ d ? O = "focus" : O = p;
2512
2538
  }
2513
2539
  return /* @__PURE__ */ B(
2514
2540
  "div",
2515
2541
  {
2516
- ...a,
2542
+ ...c,
2517
2543
  "aria-controls": f.valueControls,
2518
2544
  "aria-disabled": n || void 0,
2519
- "aria-orientation": M,
2545
+ "aria-orientation": R,
2520
2546
  "aria-valuemax": f.valueMax,
2521
2547
  "aria-valuemin": f.valueMin,
2522
2548
  "aria-valuenow": f.valueNow,
2523
2549
  children: e,
2524
2550
  className: t,
2525
- "data-separator": G,
2526
- "data-testid": s,
2527
- id: s,
2528
- onBlur: () => h(!1),
2529
- onFocus: () => h(!0),
2530
- ref: m,
2551
+ "data-separator": O,
2552
+ "data-testid": a,
2553
+ id: a,
2554
+ onBlur: () => v(!1),
2555
+ onFocus: () => v(!0),
2556
+ ref: x,
2531
2557
  role: "separator",
2532
2558
  style: {
2533
2559
  flexBasis: "auto",
2534
- cursor: T,
2535
- ...l,
2560
+ cursor: N,
2561
+ ...u,
2536
2562
  flexGrow: 0,
2537
2563
  flexShrink: 0,
2538
2564
  // Inform the browser that the library is handling touch events for this element
@@ -2543,17 +2569,17 @@ function yn({
2543
2569
  }
2544
2570
  );
2545
2571
  }
2546
- yn.displayName = "Separator";
2572
+ Sn.displayName = "Separator";
2547
2573
  export {
2548
- un as Group,
2549
- hn as Panel,
2550
- yn as Separator,
2551
- yt as SeparatorOverlay,
2552
- $t as isCoarsePointer,
2553
- xn as useDefaultLayout,
2554
- zn as useGroupCallbackRef,
2555
- wn as useGroupRef,
2556
- Pn as usePanelCallbackRef,
2557
- Ln as usePanelRef
2574
+ dn as Group,
2575
+ gn as Panel,
2576
+ Sn as Separator,
2577
+ vt as SeparatorOverlay,
2578
+ Ht as isCoarsePointer,
2579
+ zn as useDefaultLayout,
2580
+ wn as useGroupCallbackRef,
2581
+ Pn as useGroupRef,
2582
+ Ln as usePanelCallbackRef,
2583
+ Cn as usePanelRef
2558
2584
  };
2559
2585
  //# sourceMappingURL=react-resizable-panels.js.map