react-resizable-panels 4.7.1 → 4.7.3

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,6 +1,6 @@
1
1
  "use client";
2
- import { jsx as oe } from "react/jsx-runtime";
3
- import { useState as ie, useCallback as te, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
2
+ import { jsx as ie } from "react/jsx-runtime";
3
+ import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
4
4
  function gt(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
@@ -25,36 +25,36 @@ function zt(e) {
25
25
  }
26
26
  }
27
27
  }
28
- function le({
28
+ function te({
29
29
  groupSize: e,
30
30
  panelElement: t,
31
31
  styleProp: n
32
32
  }) {
33
33
  let o;
34
- const [r, a] = zt(n);
35
- switch (a) {
34
+ const [i, s] = zt(n);
35
+ switch (s) {
36
36
  case "%": {
37
- o = r / 100 * e;
37
+ o = i / 100 * e;
38
38
  break;
39
39
  }
40
40
  case "px": {
41
- o = r;
41
+ o = i;
42
42
  break;
43
43
  }
44
44
  case "rem": {
45
- o = St(t, r);
45
+ o = St(t, i);
46
46
  break;
47
47
  }
48
48
  case "em": {
49
- o = gt(t, r);
49
+ o = gt(t, i);
50
50
  break;
51
51
  }
52
52
  case "vh": {
53
- o = yt(r);
53
+ o = yt(i);
54
54
  break;
55
55
  }
56
56
  case "vw": {
57
- o = vt(r);
57
+ o = vt(i);
58
58
  break;
59
59
  }
60
60
  }
@@ -67,7 +67,7 @@ function Q({
67
67
  group: e
68
68
  }) {
69
69
  const { orientation: t, panels: n } = e;
70
- return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
70
+ return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
71
71
  }
72
72
  function ge(e) {
73
73
  const { panels: t } = e, n = Q({ group: e });
@@ -81,51 +81,51 @@ function ge(e) {
81
81
  maxSize: 100,
82
82
  panelId: o.id
83
83
  })) : t.map((o) => {
84
- const { element: r, panelConstraints: a } = o;
85
- let u = 0;
86
- if (a.collapsedSize !== void 0) {
87
- const c = le({
84
+ const { element: i, panelConstraints: s } = o;
85
+ let l = 0;
86
+ if (s.collapsedSize !== void 0) {
87
+ const c = te({
88
88
  groupSize: n,
89
- panelElement: r,
90
- styleProp: a.collapsedSize
89
+ panelElement: i,
90
+ styleProp: s.collapsedSize
91
91
  });
92
- u = D(c / n * 100);
92
+ l = D(c / n * 100);
93
93
  }
94
- let i;
95
- if (a.defaultSize !== void 0) {
96
- const c = le({
94
+ let r;
95
+ if (s.defaultSize !== void 0) {
96
+ const c = te({
97
97
  groupSize: n,
98
- panelElement: r,
99
- styleProp: a.defaultSize
98
+ panelElement: i,
99
+ styleProp: s.defaultSize
100
100
  });
101
- i = D(c / n * 100);
101
+ r = D(c / n * 100);
102
102
  }
103
- let s = 0;
104
- if (a.minSize !== void 0) {
105
- const c = le({
103
+ let a = 0;
104
+ if (s.minSize !== void 0) {
105
+ const c = te({
106
106
  groupSize: n,
107
- panelElement: r,
108
- styleProp: a.minSize
107
+ panelElement: i,
108
+ styleProp: s.minSize
109
109
  });
110
- s = D(c / n * 100);
110
+ a = D(c / n * 100);
111
111
  }
112
- let l = 100;
113
- if (a.maxSize !== void 0) {
114
- const c = le({
112
+ let u = 100;
113
+ if (s.maxSize !== void 0) {
114
+ const c = te({
115
115
  groupSize: n,
116
- panelElement: r,
117
- styleProp: a.maxSize
116
+ panelElement: i,
117
+ styleProp: s.maxSize
118
118
  });
119
- l = D(c / n * 100);
119
+ u = D(c / n * 100);
120
120
  }
121
121
  return {
122
- groupResizeBehavior: a.groupResizeBehavior,
123
- collapsedSize: u,
124
- collapsible: a.collapsible === !0,
125
- defaultSize: i,
126
- disabled: a.disabled,
127
- minSize: s,
128
- maxSize: l,
122
+ groupResizeBehavior: s.groupResizeBehavior,
123
+ collapsedSize: l,
124
+ collapsible: s.collapsible === !0,
125
+ defaultSize: r,
126
+ disabled: s.disabled,
127
+ minSize: a,
128
+ maxSize: u,
129
129
  panelId: o.id
130
130
  };
131
131
  });
@@ -171,41 +171,41 @@ function wt({
171
171
  x: n.x + n.width / 2,
172
172
  y: n.y + n.height / 2
173
173
  };
174
- let r, a = Number.MAX_VALUE;
175
- for (const u of t) {
176
- const { x: i, y: s } = qe(o, u), l = e === "horizontal" ? i : s;
177
- l < a && (a = l, r = u);
174
+ let i, s = Number.MAX_VALUE;
175
+ for (const l of t) {
176
+ const { x: r, y: a } = qe(o, l), u = e === "horizontal" ? r : a;
177
+ u < s && (s = u, i = l);
178
178
  }
179
- return L(r, "No rect found"), r;
179
+ return L(i, "No rect found"), i;
180
180
  }
181
181
  let ue;
182
182
  function Pt() {
183
183
  return ue === void 0 && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = !1), ue;
184
184
  }
185
185
  function Ye(e) {
186
- const { element: t, orientation: n, panels: o, separators: r } = e, a = Se(
186
+ const { element: t, orientation: n, panels: o, separators: i } = e, s = Se(
187
187
  n,
188
188
  Array.from(t.children).filter(Xe).map((x) => ({ element: x }))
189
- ).map(({ element: x }) => x), u = [];
190
- let i = !1, s = !1, l = -1, c = -1, m = 0, p, v = [];
189
+ ).map(({ element: x }) => x), l = [];
190
+ let r = !1, a = !1, u = -1, c = -1, m = 0, d, v = [];
191
191
  {
192
192
  let x = -1;
193
- for (const f of a)
194
- f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, l === -1 && (l = x), c = x));
193
+ for (const f of s)
194
+ f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, u === -1 && (u = x), c = x));
195
195
  }
196
196
  if (m > 1) {
197
197
  let x = -1;
198
- for (const f of a)
198
+ for (const f of s)
199
199
  if (f.hasAttribute("data-panel")) {
200
200
  x++;
201
201
  const h = o.find(
202
202
  (g) => g.element === f
203
203
  );
204
204
  if (h) {
205
- if (p) {
206
- const g = p.element.getBoundingClientRect(), y = f.getBoundingClientRect();
205
+ if (d) {
206
+ const g = d.element.getBoundingClientRect(), y = f.getBoundingClientRect();
207
207
  let z;
208
- if (s) {
208
+ if (a) {
209
209
  const S = n === "horizontal" ? new DOMRect(
210
210
  g.right,
211
211
  g.top,
@@ -216,12 +216,12 @@ function Ye(e) {
216
216
  g.bottom,
217
217
  g.width,
218
218
  0
219
- ), d = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
219
+ ), p = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
220
220
  switch (v.length) {
221
221
  case 0: {
222
222
  z = [
223
223
  S,
224
- d
224
+ p
225
225
  ];
226
226
  break;
227
227
  }
@@ -233,7 +233,7 @@ function Ye(e) {
233
233
  });
234
234
  z = [
235
235
  P,
236
- R === g ? d : S
236
+ R === g ? p : S
237
237
  ];
238
238
  break;
239
239
  }
@@ -257,48 +257,48 @@ function Ye(e) {
257
257
  )
258
258
  ];
259
259
  for (const S of z) {
260
- let d = "width" in S ? S : S.element.getBoundingClientRect();
260
+ let p = "width" in S ? S : S.element.getBoundingClientRect();
261
261
  const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
262
- if (d.width < P) {
263
- const C = P - d.width;
264
- d = new DOMRect(
265
- d.x - C / 2,
266
- d.y,
267
- d.width + C,
268
- d.height
262
+ if (p.width < P) {
263
+ const C = P - p.width;
264
+ p = new DOMRect(
265
+ p.x - C / 2,
266
+ p.y,
267
+ p.width + C,
268
+ p.height
269
269
  );
270
270
  }
271
- if (d.height < P) {
272
- const C = P - d.height;
273
- d = new DOMRect(
274
- d.x,
275
- d.y - C / 2,
276
- d.width,
277
- d.height + C
271
+ if (p.height < P) {
272
+ const C = P - p.height;
273
+ p = new DOMRect(
274
+ p.x,
275
+ p.y - C / 2,
276
+ p.width,
277
+ p.height + C
278
278
  );
279
279
  }
280
- const R = x <= l || x > c;
281
- !i && !R && u.push({
280
+ const R = x <= u || x > c;
281
+ !r && !R && l.push({
282
282
  group: e,
283
283
  groupSize: Q({ group: e }),
284
- panels: [p, h],
284
+ panels: [d, h],
285
285
  separator: "width" in S ? void 0 : S,
286
- rect: d
287
- }), i = !1;
286
+ rect: p
287
+ }), r = !1;
288
288
  }
289
289
  }
290
- s = !1, p = h, v = [];
290
+ a = !1, d = h, v = [];
291
291
  }
292
292
  } else if (f.hasAttribute("data-separator")) {
293
- f.ariaDisabled !== null && (i = !0);
294
- const h = r.find(
293
+ f.ariaDisabled !== null && (r = !0);
294
+ const h = i.find(
295
295
  (g) => g.element === f
296
296
  );
297
- h ? v.push(h) : (p = void 0, v = []);
297
+ h ? v.push(h) : (d = void 0, v = []);
298
298
  } else
299
- s = !0;
299
+ a = !0;
300
300
  }
301
- return u;
301
+ return l;
302
302
  }
303
303
  class Je {
304
304
  #e = {};
@@ -314,18 +314,18 @@ class Je {
314
314
  if (o.length === 1)
315
315
  o[0].call(null, n);
316
316
  else {
317
- let r = !1, a = null;
318
- const u = Array.from(o);
319
- for (let i = 0; i < u.length; i++) {
320
- const s = u[i];
317
+ let i = !1, s = null;
318
+ const l = Array.from(o);
319
+ for (let r = 0; r < l.length; r++) {
320
+ const a = l[r];
321
321
  try {
322
- s.call(null, n);
323
- } catch (l) {
324
- a === null && (r = !0, a = l);
322
+ a.call(null, n);
323
+ } catch (u) {
324
+ s === null && (i = !0, s = u);
325
325
  }
326
326
  }
327
- if (r)
328
- throw a;
327
+ if (i)
328
+ throw s;
329
329
  }
330
330
  }
331
331
  removeAllListeners() {
@@ -334,8 +334,8 @@ class Je {
334
334
  removeListener(t, n) {
335
335
  const o = this.#e[t];
336
336
  if (o !== void 0) {
337
- const r = o.indexOf(n);
338
- r >= 0 && o.splice(r, 1);
337
+ const i = o.indexOf(n);
338
+ i >= 0 && o.splice(i, 1);
339
339
  }
340
340
  }
341
341
  }
@@ -364,7 +364,7 @@ function ye(e, t) {
364
364
  n.group.id === e && t(n);
365
365
  });
366
366
  }
367
- function F(e, t) {
367
+ function _(e, t) {
368
368
  const n = A.get(e);
369
369
  A = new Map(A), A.set(e, t), Ze.emit("groupChange", {
370
370
  group: e,
@@ -373,25 +373,25 @@ function F(e, t) {
373
373
  });
374
374
  }
375
375
  function Ct(e, t, n) {
376
- let o, r = {
376
+ let o, i = {
377
377
  x: 1 / 0,
378
378
  y: 1 / 0
379
379
  };
380
- for (const a of t) {
381
- const u = qe(n, a.rect);
380
+ for (const s of t) {
381
+ const l = qe(n, s.rect);
382
382
  switch (e) {
383
383
  case "horizontal": {
384
- u.x <= r.x && (o = a, r = u);
384
+ l.x <= i.x && (o = s, i = l);
385
385
  break;
386
386
  }
387
387
  case "vertical": {
388
- u.y <= r.y && (o = a, r = u);
388
+ l.y <= i.y && (o = s, i = l);
389
389
  break;
390
390
  }
391
391
  }
392
392
  }
393
393
  return o ? {
394
- distance: r,
394
+ distance: i,
395
395
  hitRegion: o
396
396
  } : void 0;
397
397
  }
@@ -411,23 +411,23 @@ function Mt(e, t) {
411
411
  o,
412
412
  "Stacking order can only be calculated for elements with a common ancestor"
413
413
  );
414
- const r = {
414
+ const i = {
415
415
  a: Ie(Ee(n.a)),
416
416
  b: Ie(Ee(n.b))
417
417
  };
418
- if (r.a === r.b) {
419
- const a = o.childNodes, u = {
418
+ if (i.a === i.b) {
419
+ const s = o.childNodes, l = {
420
420
  a: n.a.at(-1),
421
421
  b: n.b.at(-1)
422
422
  };
423
- let i = a.length;
424
- for (; i--; ) {
425
- const s = a[i];
426
- if (s === u.a) return 1;
427
- if (s === u.b) return -1;
423
+ let r = s.length;
424
+ for (; r--; ) {
425
+ const a = s[r];
426
+ if (a === l.a) return 1;
427
+ if (a === l.b) return -1;
428
428
  }
429
429
  }
430
- return Math.sign(r.a - r.b);
430
+ return Math.sign(i.a - i.b);
431
431
  }
432
432
  const Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
433
433
  function It(e) {
@@ -483,18 +483,18 @@ function Tt({
483
483
  }
484
484
  function ve(e, t) {
485
485
  const n = [];
486
- return t.forEach((o, r) => {
487
- if (r.disabled)
486
+ return t.forEach((o, i) => {
487
+ if (i.disabled)
488
488
  return;
489
- const a = Ye(r), u = Ct(r.orientation, a, {
489
+ const s = Ye(i), l = Ct(i.orientation, s, {
490
490
  x: e.clientX,
491
491
  y: e.clientY
492
492
  });
493
- u && u.distance.x <= 0 && u.distance.y <= 0 && Tt({
494
- groupElement: r.element,
495
- hitRegion: u.hitRegion.rect,
493
+ l && l.distance.x <= 0 && l.distance.y <= 0 && Tt({
494
+ groupElement: i.element,
495
+ hitRegion: l.hitRegion.rect,
496
496
  pointerEventTarget: e.target
497
- }) && n.push(u.hitRegion);
497
+ }) && n.push(l.hitRegion);
498
498
  }), n;
499
499
  }
500
500
  function Ot(e, t) {
@@ -518,36 +518,36 @@ function Y({
518
518
  size: o
519
519
  }) {
520
520
  const {
521
- collapsedSize: r = 0,
522
- collapsible: a,
523
- disabled: u,
524
- maxSize: i = 100,
525
- minSize: s = 0
521
+ collapsedSize: i = 0,
522
+ collapsible: s,
523
+ disabled: l,
524
+ maxSize: r = 100,
525
+ minSize: a = 0
526
526
  } = t;
527
- if (u && !e)
527
+ if (l && !e)
528
528
  return n;
529
- if (G(o, s) < 0)
530
- if (a) {
531
- const l = (r + s) / 2;
532
- G(o, l) < 0 ? o = r : o = s;
529
+ if (G(o, a) < 0)
530
+ if (s) {
531
+ const u = (i + a) / 2;
532
+ G(o, u) < 0 ? o = i : o = a;
533
533
  } else
534
- o = s;
535
- return o = Math.min(i, o), o = D(o), o;
534
+ o = a;
535
+ return o = Math.min(r, o), o = D(o), o;
536
536
  }
537
- function re({
537
+ function se({
538
538
  delta: e,
539
539
  initialLayout: t,
540
540
  panelConstraints: n,
541
541
  pivotIndices: o,
542
- prevLayout: r,
543
- trigger: a
542
+ prevLayout: i,
543
+ trigger: s
544
544
  }) {
545
545
  if (I(e, 0))
546
546
  return t;
547
- const u = a === "imperative-api", i = Object.values(t), s = Object.values(r), l = [...i], [c, m] = o;
547
+ const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, m] = o;
548
548
  L(c != null, "Invalid first pivot index"), L(m != null, "Invalid second pivot index");
549
- let p = 0;
550
- switch (a) {
549
+ let d = 0;
550
+ switch (s) {
551
551
  case "keyboard": {
552
552
  {
553
553
  const f = e < 0 ? m : c, h = n[f];
@@ -561,13 +561,13 @@ function re({
561
561
  minSize: z = 0
562
562
  } = h;
563
563
  if (y) {
564
- const S = i[f];
564
+ const S = r[f];
565
565
  if (L(
566
566
  S != null,
567
567
  `Previous layout not found for panel index ${f}`
568
568
  ), I(S, g)) {
569
- const d = z - S;
570
- G(d, Math.abs(e)) > 0 && (e = e < 0 ? 0 - d : d);
569
+ const p = z - S;
570
+ G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
571
571
  }
572
572
  }
573
573
  }
@@ -583,13 +583,13 @@ function re({
583
583
  minSize: z = 0
584
584
  } = h;
585
585
  if (y) {
586
- const S = i[f];
586
+ const S = r[f];
587
587
  if (L(
588
588
  S != null,
589
589
  `Previous layout not found for panel index ${f}`
590
590
  ), I(S, z)) {
591
- const d = S - g;
592
- G(d, Math.abs(e)) > 0 && (e = e < 0 ? 0 - d : d);
591
+ const p = S - g;
592
+ G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
593
593
  }
594
594
  }
595
595
  }
@@ -601,14 +601,14 @@ function re({
601
601
  h,
602
602
  `Panel constraints not found for index ${f}`
603
603
  );
604
- const g = i[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
604
+ const g = r[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
605
605
  if (y && G(g, S) < 0)
606
606
  if (e > 0) {
607
- const d = S - z, P = d / 2, R = g + e;
608
- G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : d);
607
+ const p = S - z, P = p / 2, R = g + e;
608
+ G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : p);
609
609
  } else {
610
- const d = S - z, P = 100 - d / 2, R = g - e;
611
- G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -d);
610
+ const p = S - z, P = 100 - p / 2, R = g - e;
611
+ G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -p);
612
612
  }
613
613
  break;
614
614
  }
@@ -617,18 +617,18 @@ function re({
617
617
  const f = e < 0 ? 1 : -1;
618
618
  let h = e < 0 ? m : c, g = 0;
619
619
  for (; ; ) {
620
- const z = i[h];
620
+ const z = r[h];
621
621
  L(
622
622
  z != null,
623
623
  `Previous layout not found for panel index ${h}`
624
624
  );
625
- const d = Y({
626
- overrideDisabledPanels: u,
625
+ const p = Y({
626
+ overrideDisabledPanels: l,
627
627
  panelConstraints: n[h],
628
628
  prevSize: z,
629
629
  size: 100
630
630
  }) - z;
631
- if (g += d, h += f, h < 0 || h >= n.length)
631
+ if (g += p, h += f, h < 0 || h >= n.length)
632
632
  break;
633
633
  }
634
634
  const y = Math.min(Math.abs(e), Math.abs(g));
@@ -637,66 +637,66 @@ function re({
637
637
  {
638
638
  let h = e < 0 ? c : m;
639
639
  for (; h >= 0 && h < n.length; ) {
640
- const g = Math.abs(e) - Math.abs(p), y = i[h];
640
+ const g = Math.abs(e) - Math.abs(d), y = r[h];
641
641
  L(
642
642
  y != null,
643
643
  `Previous layout not found for panel index ${h}`
644
644
  );
645
645
  const z = y - g, S = Y({
646
- overrideDisabledPanels: u,
646
+ overrideDisabledPanels: l,
647
647
  panelConstraints: n[h],
648
648
  prevSize: y,
649
649
  size: z
650
650
  });
651
- if (!I(y, S) && (p += y - S, l[h] = S, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
651
+ if (!I(y, S) && (d += y - S, u[h] = S, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
652
652
  numeric: !0
653
653
  }) >= 0))
654
654
  break;
655
655
  e < 0 ? h-- : h++;
656
656
  }
657
657
  }
658
- if (Ot(s, l))
659
- return r;
658
+ if (Ot(a, u))
659
+ return i;
660
660
  {
661
- const f = e < 0 ? m : c, h = i[f];
661
+ const f = e < 0 ? m : c, h = r[f];
662
662
  L(
663
663
  h != null,
664
664
  `Previous layout not found for panel index ${f}`
665
665
  );
666
- const g = h + p, y = Y({
667
- overrideDisabledPanels: u,
666
+ const g = h + d, y = Y({
667
+ overrideDisabledPanels: l,
668
668
  panelConstraints: n[f],
669
669
  prevSize: h,
670
670
  size: g
671
671
  });
672
- if (l[f] = y, !I(y, g)) {
673
- let z = g - y, d = e < 0 ? m : c;
674
- for (; d >= 0 && d < n.length; ) {
675
- const P = l[d];
672
+ if (u[f] = y, !I(y, g)) {
673
+ let z = g - y, p = e < 0 ? m : c;
674
+ for (; p >= 0 && p < n.length; ) {
675
+ const P = u[p];
676
676
  L(
677
677
  P != null,
678
- `Previous layout not found for panel index ${d}`
678
+ `Previous layout not found for panel index ${p}`
679
679
  );
680
680
  const R = P + z, C = Y({
681
- overrideDisabledPanels: u,
682
- panelConstraints: n[d],
681
+ overrideDisabledPanels: l,
682
+ panelConstraints: n[p],
683
683
  prevSize: P,
684
684
  size: R
685
685
  });
686
- if (I(P, C) || (z -= C - P, l[d] = C), I(z, 0))
686
+ if (I(P, C) || (z -= C - P, u[p] = C), I(z, 0))
687
687
  break;
688
- e > 0 ? d-- : d++;
688
+ e > 0 ? p-- : p++;
689
689
  }
690
690
  }
691
691
  }
692
- const v = Object.values(l).reduce(
692
+ const v = Object.values(u).reduce(
693
693
  (f, h) => h + f,
694
694
  0
695
695
  );
696
696
  if (!I(v, 100, 0.1))
697
- return r;
698
- const x = Object.keys(r);
699
- return l.reduce((f, h, g) => (f[x[g]] = h, f), {});
697
+ return i;
698
+ const x = Object.keys(i);
699
+ return u.reduce((f, h, g) => (f[x[g]] = h, f), {});
700
700
  }
701
701
  function j(e, t) {
702
702
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -710,107 +710,107 @@ function B({
710
710
  layout: e,
711
711
  panelConstraints: t
712
712
  }) {
713
- const n = Object.values(e), o = [...n], r = o.reduce(
714
- (i, s) => i + s,
713
+ const n = Object.values(e), o = [...n], i = o.reduce(
714
+ (r, a) => r + a,
715
715
  0
716
716
  );
717
717
  if (o.length !== t.length)
718
718
  throw Error(
719
- `Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
719
+ `Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
720
720
  );
721
- if (!I(r, 100) && o.length > 0)
722
- for (let i = 0; i < t.length; i++) {
723
- const s = o[i];
724
- L(s != null, `No layout data found for index ${i}`);
725
- const l = 100 / r * s;
726
- o[i] = l;
721
+ if (!I(i, 100) && o.length > 0)
722
+ for (let r = 0; r < t.length; r++) {
723
+ const a = o[r];
724
+ L(a != null, `No layout data found for index ${r}`);
725
+ const u = 100 / i * a;
726
+ o[r] = u;
727
727
  }
728
- let a = 0;
729
- for (let i = 0; i < t.length; i++) {
730
- const s = n[i];
731
- L(s != null, `No layout data found for index ${i}`);
732
- const l = o[i];
733
- L(l != null, `No layout data found for index ${i}`);
728
+ let s = 0;
729
+ for (let r = 0; r < t.length; r++) {
730
+ const a = n[r];
731
+ L(a != null, `No layout data found for index ${r}`);
732
+ const u = o[r];
733
+ L(u != null, `No layout data found for index ${r}`);
734
734
  const c = Y({
735
735
  overrideDisabledPanels: !0,
736
- panelConstraints: t[i],
737
- prevSize: s,
738
- size: l
736
+ panelConstraints: t[r],
737
+ prevSize: a,
738
+ size: u
739
739
  });
740
- l != c && (a += l - c, o[i] = c);
740
+ u != c && (s += u - c, o[r] = c);
741
741
  }
742
- if (!I(a, 0))
743
- for (let i = 0; i < t.length; i++) {
744
- const s = o[i];
745
- L(s != null, `No layout data found for index ${i}`);
746
- const l = s + a, c = Y({
742
+ if (!I(s, 0))
743
+ for (let r = 0; r < t.length; r++) {
744
+ const a = o[r];
745
+ L(a != null, `No layout data found for index ${r}`);
746
+ const u = a + s, c = Y({
747
747
  overrideDisabledPanels: !0,
748
- panelConstraints: t[i],
749
- prevSize: s,
750
- size: l
748
+ panelConstraints: t[r],
749
+ prevSize: a,
750
+ size: u
751
751
  });
752
- if (s !== c && (a -= c - s, o[i] = c, I(a, 0)))
752
+ if (a !== c && (s -= c - a, o[r] = c, I(s, 0)))
753
753
  break;
754
754
  }
755
- const u = Object.keys(e);
756
- return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
755
+ const l = Object.keys(e);
756
+ return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
757
757
  }
758
758
  function et({
759
759
  groupId: e,
760
760
  panelId: t
761
761
  }) {
762
762
  const n = () => {
763
- const i = U();
763
+ const r = U();
764
764
  for (const [
765
- s,
765
+ a,
766
766
  {
767
- defaultLayoutDeferred: l,
767
+ defaultLayoutDeferred: u,
768
768
  derivedPanelConstraints: c,
769
769
  layout: m,
770
- groupSize: p,
770
+ groupSize: d,
771
771
  separatorToPanels: v
772
772
  }
773
- ] of i)
774
- if (s.id === e)
773
+ ] of r)
774
+ if (a.id === e)
775
775
  return {
776
- defaultLayoutDeferred: l,
776
+ defaultLayoutDeferred: u,
777
777
  derivedPanelConstraints: c,
778
- group: s,
779
- groupSize: p,
778
+ group: a,
779
+ groupSize: d,
780
780
  layout: m,
781
781
  separatorToPanels: v
782
782
  };
783
783
  throw Error(`Group ${e} not found`);
784
784
  }, o = () => {
785
- const i = n().derivedPanelConstraints.find(
786
- (s) => s.panelId === t
785
+ const r = n().derivedPanelConstraints.find(
786
+ (a) => a.panelId === t
787
787
  );
788
- if (i !== void 0)
789
- return i;
788
+ if (r !== void 0)
789
+ return r;
790
790
  throw Error(`Panel constraints not found for Panel ${t}`);
791
- }, r = () => {
792
- const i = n().group.panels.find((s) => s.id === t);
793
- if (i !== void 0)
794
- return i;
791
+ }, i = () => {
792
+ const r = n().group.panels.find((a) => a.id === t);
793
+ if (r !== void 0)
794
+ return r;
795
795
  throw Error(`Layout not found for Panel ${t}`);
796
- }, a = () => {
797
- const i = n().layout[t];
798
- if (i !== void 0)
799
- return i;
796
+ }, s = () => {
797
+ const r = n().layout[t];
798
+ if (r !== void 0)
799
+ return r;
800
800
  throw Error(`Layout not found for Panel ${t}`);
801
- }, u = (i) => {
802
- const s = a();
803
- if (i === s)
801
+ }, l = (r) => {
802
+ const a = s();
803
+ if (r === a)
804
804
  return;
805
805
  const {
806
- defaultLayoutDeferred: l,
806
+ defaultLayoutDeferred: u,
807
807
  derivedPanelConstraints: c,
808
808
  group: m,
809
- groupSize: p,
809
+ groupSize: d,
810
810
  layout: v,
811
811
  separatorToPanels: x
812
- } = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = re({
813
- delta: h ? s - i : i - s,
812
+ } = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = se({
813
+ delta: h ? a - r : r - a,
814
814
  initialLayout: v,
815
815
  panelConstraints: c,
816
816
  pivotIndices: h ? [f - 1, f] : [f, f + 1],
@@ -820,53 +820,44 @@ function et({
820
820
  layout: g,
821
821
  panelConstraints: c
822
822
  });
823
- j(v, y) || F(m, {
824
- defaultLayoutDeferred: l,
823
+ j(v, y) || _(m, {
824
+ defaultLayoutDeferred: u,
825
825
  derivedPanelConstraints: c,
826
- groupSize: p,
826
+ groupSize: d,
827
827
  layout: y,
828
828
  separatorToPanels: x
829
829
  });
830
830
  };
831
831
  return {
832
832
  collapse: () => {
833
- const { collapsible: i, collapsedSize: s } = o(), { mutableValues: l } = r(), c = a();
834
- i && c !== s && (l.expandToSize = c, u(s));
833
+ const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
834
+ r && c !== a && (u.expandToSize = c, l(a));
835
835
  },
836
836
  expand: () => {
837
- const { collapsible: i, collapsedSize: s, minSize: l } = o(), { mutableValues: c } = r(), m = a();
838
- if (i && m === s) {
839
- let p = c.expandToSize ?? l;
840
- p === 0 && (p = 1), u(p);
837
+ const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = s();
838
+ if (r && m === a) {
839
+ let d = c.expandToSize ?? u;
840
+ d === 0 && (d = 1), l(d);
841
841
  }
842
842
  },
843
843
  getSize: () => {
844
- const { group: i } = n(), s = a(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
844
+ const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
845
845
  return {
846
- asPercentage: s,
846
+ asPercentage: a,
847
847
  inPixels: c
848
848
  };
849
849
  },
850
850
  isCollapsed: () => {
851
- const { collapsible: i, collapsedSize: s } = o(), l = a();
852
- return i && I(s, l);
851
+ const { collapsible: r, collapsedSize: a } = o(), u = s();
852
+ return r && I(a, u);
853
853
  },
854
- resize: (i) => {
855
- if (a() !== i) {
856
- let l;
857
- switch (typeof i) {
858
- case "number": {
859
- const { group: c } = n(), m = Q({ group: c });
860
- l = D(i / m * 100);
861
- break;
862
- }
863
- case "string": {
864
- l = parseFloat(i);
865
- break;
866
- }
867
- }
868
- u(l);
869
- }
854
+ resize: (r) => {
855
+ const { group: a } = n(), { element: u } = i(), c = Q({ group: a }), m = te({
856
+ groupSize: c,
857
+ panelElement: u,
858
+ styleProp: r
859
+ }), d = D(m / c * 100);
860
+ l(d);
870
861
  }
871
862
  };
872
863
  }
@@ -876,15 +867,15 @@ function De(e) {
876
867
  const t = U();
877
868
  ve(e, t).forEach((o) => {
878
869
  if (o.separator) {
879
- const r = o.panels.find(
880
- (a) => a.panelConstraints.defaultSize !== void 0
870
+ const i = o.panels.find(
871
+ (s) => s.panelConstraints.defaultSize !== void 0
881
872
  );
882
- if (r) {
883
- const a = r.panelConstraints.defaultSize, u = et({
873
+ if (i) {
874
+ const s = i.panelConstraints.defaultSize, l = et({
884
875
  groupId: o.group.id,
885
- panelId: r.id
876
+ panelId: i.id
886
877
  });
887
- u && a !== void 0 && (u.resize(a), e.preventDefault());
878
+ l && s !== void 0 && (l.resize(s), e.preventDefault());
888
879
  }
889
880
  }
890
881
  });
@@ -903,9 +894,9 @@ function tt({
903
894
  }) {
904
895
  const t = () => {
905
896
  const n = U();
906
- for (const [o, r] of n)
897
+ for (const [o, i] of n)
907
898
  if (o.id === e)
908
- return { group: o, ...r };
899
+ return { group: o, ...i };
909
900
  throw Error(`Could not find Group with id "${e}"`);
910
901
  };
911
902
  return {
@@ -916,44 +907,44 @@ function tt({
916
907
  setLayout(n) {
917
908
  const {
918
909
  defaultLayoutDeferred: o,
919
- derivedPanelConstraints: r,
920
- group: a,
921
- groupSize: u,
922
- layout: i,
923
- separatorToPanels: s
924
- } = t(), l = B({
910
+ derivedPanelConstraints: i,
911
+ group: s,
912
+ groupSize: l,
913
+ layout: r,
914
+ separatorToPanels: a
915
+ } = t(), u = B({
925
916
  layout: n,
926
- panelConstraints: r
917
+ panelConstraints: i
927
918
  });
928
- return o ? i : (j(i, l) || F(a, {
919
+ return o ? r : (j(r, u) || _(s, {
929
920
  defaultLayoutDeferred: o,
930
- derivedPanelConstraints: r,
931
- groupSize: u,
932
- layout: l,
933
- separatorToPanels: s
934
- }), l);
921
+ derivedPanelConstraints: i,
922
+ groupSize: l,
923
+ layout: u,
924
+ separatorToPanels: a
925
+ }), u);
935
926
  }
936
927
  };
937
928
  }
938
929
  function V(e, t) {
939
- const n = fe(e), o = $(n.id, !0), r = n.separators.find(
930
+ const n = fe(e), o = $(n.id, !0), i = n.separators.find(
940
931
  (m) => m.element === e
941
932
  );
942
- L(r, "Matching separator not found");
943
- const a = o.separatorToPanels.get(r);
944
- L(a, "Matching panels not found");
945
- const u = a.map((m) => n.panels.indexOf(m)), s = tt({ groupId: n.id }).getLayout(), l = re({
933
+ L(i, "Matching separator not found");
934
+ const s = o.separatorToPanels.get(i);
935
+ L(s, "Matching panels not found");
936
+ const l = s.map((m) => n.panels.indexOf(m)), a = tt({ groupId: n.id }).getLayout(), u = se({
946
937
  delta: t,
947
- initialLayout: s,
938
+ initialLayout: a,
948
939
  panelConstraints: o.derivedPanelConstraints,
949
- pivotIndices: u,
950
- prevLayout: s,
940
+ pivotIndices: l,
941
+ prevLayout: a,
951
942
  trigger: "keyboard"
952
943
  }), c = B({
953
- layout: l,
944
+ layout: u,
954
945
  panelConstraints: o.derivedPanelConstraints
955
946
  });
956
- j(s, c) || F(n, {
947
+ j(a, c) || _(n, {
957
948
  defaultLayoutDeferred: o.defaultLayoutDeferred,
958
949
  derivedPanelConstraints: o.derivedPanelConstraints,
959
950
  groupSize: o.groupSize,
@@ -989,31 +980,33 @@ function Te(e) {
989
980
  }
990
981
  case "Enter": {
991
982
  e.preventDefault();
992
- const o = fe(t), r = $(o.id, !0), { derivedPanelConstraints: a, layout: u, separatorToPanels: i } = r, s = o.separators.find(
993
- (p) => p.element === t
983
+ const o = fe(t), i = $(o.id, !0), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find(
984
+ (d) => d.element === t
994
985
  );
995
- L(s, "Matching separator not found");
996
- const l = i.get(s);
997
- L(l, "Matching panels not found");
998
- const c = l[0], m = a.find(
999
- (p) => p.panelId === c.id
986
+ L(a, "Matching separator not found");
987
+ const u = r.get(a);
988
+ L(u, "Matching panels not found");
989
+ const c = u[0], m = s.find(
990
+ (d) => d.panelId === c.id
1000
991
  );
1001
992
  if (L(m, "Panel metadata not found"), m.collapsible) {
1002
- const p = u[c.id], v = m.collapsedSize === p ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
1003
- V(t, v - p);
993
+ const d = l[c.id], v = m.collapsedSize === d ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
994
+ V(t, v - d);
1004
995
  }
1005
996
  break;
1006
997
  }
1007
998
  case "F6": {
1008
999
  e.preventDefault();
1009
- const r = fe(t).separators.map(
1010
- (s) => s.element
1011
- ), a = Array.from(r).findIndex(
1012
- (s) => s === e.currentTarget
1000
+ const i = fe(t).separators.map(
1001
+ (a) => a.element
1002
+ ), s = Array.from(i).findIndex(
1003
+ (a) => a === e.currentTarget
1013
1004
  );
1014
- L(a !== null, "Index not found");
1015
- const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
1016
- r[u].focus();
1005
+ L(s !== null, "Index not found");
1006
+ const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
1007
+ i[l].focus({
1008
+ preventScroll: !0
1009
+ });
1017
1010
  break;
1018
1011
  }
1019
1012
  case "Home": {
@@ -1053,11 +1046,13 @@ function Oe(e) {
1053
1046
  if (e.pointerType === "mouse" && e.button > 0)
1054
1047
  return;
1055
1048
  const t = U(), n = ve(e, t), o = /* @__PURE__ */ new Map();
1056
- let r = !1;
1057
- n.forEach((a) => {
1058
- a.separator && (r || (r = !0, a.separator.element.focus()));
1059
- const u = t.get(a.group);
1060
- u && o.set(a.group, u.layout);
1049
+ let i = !1;
1050
+ n.forEach((s) => {
1051
+ s.separator && (i || (i = !0, s.separator.element.focus({
1052
+ preventScroll: !0
1053
+ })));
1054
+ const l = t.get(s.group);
1055
+ l && o.set(s.group, l.layout);
1061
1056
  }), Z({
1062
1057
  cursorFlags: 0,
1063
1058
  hitRegions: n,
@@ -1072,67 +1067,67 @@ let ce;
1072
1067
  function Ne() {
1073
1068
  return ce === void 0 && (ce = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = !0)), ce;
1074
1069
  }
1075
- function Ft({
1070
+ function _t({
1076
1071
  cursorFlags: e,
1077
1072
  groups: t,
1078
1073
  state: n
1079
1074
  }) {
1080
- let o = 0, r = 0;
1075
+ let o = 0, i = 0;
1081
1076
  switch (n) {
1082
1077
  case "active":
1083
1078
  case "hover":
1084
- t.forEach((a) => {
1085
- if (!a.mutableState.disableCursor)
1086
- switch (a.orientation) {
1079
+ t.forEach((s) => {
1080
+ if (!s.mutableState.disableCursor)
1081
+ switch (s.orientation) {
1087
1082
  case "horizontal": {
1088
1083
  o++;
1089
1084
  break;
1090
1085
  }
1091
1086
  case "vertical": {
1092
- r++;
1087
+ i++;
1093
1088
  break;
1094
1089
  }
1095
1090
  }
1096
1091
  });
1097
1092
  }
1098
- if (!(o === 0 && r === 0)) {
1093
+ if (!(o === 0 && i === 0)) {
1099
1094
  switch (n) {
1100
1095
  case "active": {
1101
1096
  if (e && Ne()) {
1102
- const a = (e & nt) !== 0, u = (e & ot) !== 0, i = (e & it) !== 0, s = (e & rt) !== 0;
1103
- if (a)
1104
- return i ? "se-resize" : s ? "ne-resize" : "e-resize";
1105
- if (u)
1106
- return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
1107
- if (i)
1108
- return "s-resize";
1097
+ const s = (e & nt) !== 0, l = (e & ot) !== 0, r = (e & it) !== 0, a = (e & rt) !== 0;
1109
1098
  if (s)
1099
+ return r ? "se-resize" : a ? "ne-resize" : "e-resize";
1100
+ if (l)
1101
+ return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
1102
+ if (r)
1103
+ return "s-resize";
1104
+ if (a)
1110
1105
  return "n-resize";
1111
1106
  }
1112
1107
  break;
1113
1108
  }
1114
1109
  }
1115
- return Ne() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1110
+ return Ne() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1116
1111
  }
1117
1112
  }
1118
- const Fe = /* @__PURE__ */ new WeakMap();
1113
+ const _e = /* @__PURE__ */ new WeakMap();
1119
1114
  function be(e) {
1120
1115
  if (e.defaultView === null || e.defaultView === void 0)
1121
1116
  return;
1122
- let { prevStyle: t, styleSheet: n } = Fe.get(e) ?? {};
1117
+ let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
1123
1118
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
1124
1119
  const o = W();
1125
1120
  switch (o.state) {
1126
1121
  case "active":
1127
1122
  case "hover": {
1128
- const r = Ft({
1123
+ const i = _t({
1129
1124
  cursorFlags: o.cursorFlags,
1130
- groups: o.hitRegions.map((u) => u.group),
1125
+ groups: o.hitRegions.map((l) => l.group),
1131
1126
  state: o.state
1132
- }), a = `*, *:hover {cursor: ${r} !important; }`;
1133
- if (t === a)
1127
+ }), s = `*, *:hover {cursor: ${i} !important; }`;
1128
+ if (t === s)
1134
1129
  return;
1135
- t = a, r ? n.cssRules.length === 0 ? n.insertRule(a) : n.replaceSync(a) : n.cssRules.length === 1 && n.deleteRule(0);
1130
+ t = s, i ? n.cssRules.length === 0 ? n.insertRule(s) : n.replaceSync(s) : n.cssRules.length === 1 && n.deleteRule(0);
1136
1131
  break;
1137
1132
  }
1138
1133
  case "inactive": {
@@ -1140,58 +1135,58 @@ function be(e) {
1140
1135
  break;
1141
1136
  }
1142
1137
  }
1143
- Fe.set(e, {
1138
+ _e.set(e, {
1144
1139
  prevStyle: t,
1145
1140
  styleSheet: n
1146
1141
  });
1147
1142
  }
1148
- function at({
1143
+ function st({
1149
1144
  document: e,
1150
1145
  event: t,
1151
1146
  hitRegions: n,
1152
1147
  initialLayoutMap: o,
1153
- mountedGroups: r,
1154
- pointerDownAtPoint: a,
1155
- prevCursorFlags: u
1148
+ mountedGroups: i,
1149
+ pointerDownAtPoint: s,
1150
+ prevCursorFlags: l
1156
1151
  }) {
1157
- let i = 0;
1158
- n.forEach((l) => {
1159
- const { group: c, groupSize: m } = l, { orientation: p, panels: v } = c, { disableCursor: x } = c.mutableState;
1152
+ let r = 0;
1153
+ n.forEach((u) => {
1154
+ const { group: c, groupSize: m } = u, { orientation: d, panels: v } = c, { disableCursor: x } = c.mutableState;
1160
1155
  let f = 0;
1161
- a ? p === "horizontal" ? f = (t.clientX - a.x) / m * 100 : f = (t.clientY - a.y) / m * 100 : p === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1162
- const h = o.get(c), g = r.get(c);
1156
+ s ? d === "horizontal" ? f = (t.clientX - s.x) / m * 100 : f = (t.clientY - s.y) / m * 100 : d === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1157
+ const h = o.get(c), g = i.get(c);
1163
1158
  if (!h || !g)
1164
1159
  return;
1165
1160
  const {
1166
1161
  defaultLayoutDeferred: y,
1167
1162
  derivedPanelConstraints: z,
1168
1163
  groupSize: S,
1169
- layout: d,
1164
+ layout: p,
1170
1165
  separatorToPanels: P
1171
1166
  } = g;
1172
- if (z && d && P) {
1173
- const R = re({
1167
+ if (z && p && P) {
1168
+ const R = se({
1174
1169
  delta: f,
1175
1170
  initialLayout: h,
1176
1171
  panelConstraints: z,
1177
- pivotIndices: l.panels.map((C) => v.indexOf(C)),
1178
- prevLayout: d,
1172
+ pivotIndices: u.panels.map((C) => v.indexOf(C)),
1173
+ prevLayout: p,
1179
1174
  trigger: "mouse-or-touch"
1180
1175
  });
1181
- if (j(R, d)) {
1176
+ if (j(R, p)) {
1182
1177
  if (f !== 0 && !x)
1183
- switch (p) {
1178
+ switch (d) {
1184
1179
  case "horizontal": {
1185
- i |= f < 0 ? nt : ot;
1180
+ r |= f < 0 ? nt : ot;
1186
1181
  break;
1187
1182
  }
1188
1183
  case "vertical": {
1189
- i |= f < 0 ? it : rt;
1184
+ r |= f < 0 ? it : rt;
1190
1185
  break;
1191
1186
  }
1192
1187
  }
1193
1188
  } else
1194
- F(l.group, {
1189
+ _(u.group, {
1195
1190
  defaultLayoutDeferred: y,
1196
1191
  derivedPanelConstraints: z,
1197
1192
  groupSize: S,
@@ -1200,14 +1195,14 @@ function at({
1200
1195
  });
1201
1196
  }
1202
1197
  });
1203
- let s = 0;
1204
- t.movementX === 0 ? s |= u & Ge : s |= i & Ge, t.movementY === 0 ? s |= u & Ae : s |= i & Ae, At(s), be(e);
1198
+ let a = 0;
1199
+ t.movementX === 0 ? a |= l & Ge : a |= r & Ge, t.movementY === 0 ? a |= l & Ae : a |= r & Ae, At(a), be(e);
1205
1200
  }
1206
- function _e(e) {
1201
+ function Fe(e) {
1207
1202
  const t = U(), n = W();
1208
1203
  switch (n.state) {
1209
1204
  case "active":
1210
- at({
1205
+ st({
1211
1206
  document: e.currentTarget,
1212
1207
  event: e,
1213
1208
  hitRegions: n.hitRegions,
@@ -1231,12 +1226,12 @@ function $e(e) {
1231
1226
  cursorFlags: 0,
1232
1227
  state: "inactive"
1233
1228
  }), t.hitRegions.forEach((o) => {
1234
- const r = $(o.group.id, !0);
1235
- F(o.group, r);
1229
+ const i = $(o.group.id, !0);
1230
+ _(o.group, i);
1236
1231
  });
1237
1232
  return;
1238
1233
  }
1239
- at({
1234
+ st({
1240
1235
  document: e.currentTarget,
1241
1236
  event: e,
1242
1237
  hitRegions: t.hitRegions,
@@ -1284,39 +1279,39 @@ function Ve(e) {
1284
1279
  state: "inactive"
1285
1280
  }), t.hitRegions.length > 0 && (be(e.currentTarget), t.hitRegions.forEach((n) => {
1286
1281
  const o = $(n.group.id, !0);
1287
- F(n.group, o);
1282
+ _(n.group, o);
1288
1283
  }), e.preventDefault());
1289
1284
  }
1290
1285
  }
1291
1286
  function je(e) {
1292
1287
  let t = 0, n = 0;
1293
1288
  const o = {};
1294
- for (const a of e)
1295
- if (a.defaultSize !== void 0) {
1289
+ for (const s of e)
1290
+ if (s.defaultSize !== void 0) {
1296
1291
  t++;
1297
- const u = D(a.defaultSize);
1298
- n += u, o[a.panelId] = u;
1292
+ const l = D(s.defaultSize);
1293
+ n += l, o[s.panelId] = l;
1299
1294
  } else
1300
- o[a.panelId] = void 0;
1301
- const r = e.length - t;
1302
- if (r !== 0) {
1303
- const a = D((100 - n) / r);
1304
- for (const u of e)
1305
- u.defaultSize === void 0 && (o[u.panelId] = a);
1295
+ o[s.panelId] = void 0;
1296
+ const i = e.length - t;
1297
+ if (i !== 0) {
1298
+ const s = D((100 - n) / i);
1299
+ for (const l of e)
1300
+ l.defaultSize === void 0 && (o[l.panelId] = s);
1306
1301
  }
1307
1302
  return o;
1308
1303
  }
1309
- function _t(e, t, n) {
1304
+ function Ft(e, t, n) {
1310
1305
  if (!n[0])
1311
1306
  return;
1312
- const r = e.panels.find((l) => l.element === t);
1313
- if (!r || !r.onResize)
1307
+ const i = e.panels.find((u) => u.element === t);
1308
+ if (!i || !i.onResize)
1314
1309
  return;
1315
- const a = Q({ group: e }), u = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, i = r.mutableValues.prevSize, s = {
1316
- asPercentage: D(u / a * 100),
1317
- inPixels: u
1310
+ const s = Q({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
1311
+ asPercentage: D(l / s * 100),
1312
+ inPixels: l
1318
1313
  };
1319
- r.mutableValues.prevSize = s, r.onResize(s, r.id, i);
1314
+ i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
1320
1315
  }
1321
1316
  function $t(e, t) {
1322
1317
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -1334,53 +1329,53 @@ function Ht({
1334
1329
  }) {
1335
1330
  if (n <= 0 || t <= 0 || n === t)
1336
1331
  return o;
1337
- let r = 0, a = 0, u = !1;
1338
- const i = /* @__PURE__ */ new Map(), s = [];
1332
+ let i = 0, s = 0, l = !1;
1333
+ const r = /* @__PURE__ */ new Map(), a = [];
1339
1334
  for (const m of e.panels) {
1340
- const p = o[m.id] ?? 0;
1335
+ const d = o[m.id] ?? 0;
1341
1336
  switch (m.panelConstraints.groupResizeBehavior) {
1342
1337
  case "preserve-pixel-size": {
1343
- u = !0;
1344
- const v = p / 100 * n, x = D(
1338
+ l = !0;
1339
+ const v = d / 100 * n, x = D(
1345
1340
  v / t * 100
1346
1341
  );
1347
- i.set(m.id, x), r += x;
1342
+ r.set(m.id, x), i += x;
1348
1343
  break;
1349
1344
  }
1350
1345
  case "preserve-relative-size":
1351
1346
  default: {
1352
- s.push(m.id), a += p;
1347
+ a.push(m.id), s += d;
1353
1348
  break;
1354
1349
  }
1355
1350
  }
1356
1351
  }
1357
- if (!u || s.length === 0)
1352
+ if (!l || a.length === 0)
1358
1353
  return o;
1359
- const l = 100 - r, c = { ...o };
1360
- if (i.forEach((m, p) => {
1361
- c[p] = m;
1362
- }), a > 0)
1363
- for (const m of s) {
1364
- const p = o[m] ?? 0;
1354
+ const u = 100 - i, c = { ...o };
1355
+ if (r.forEach((m, d) => {
1356
+ c[d] = m;
1357
+ }), s > 0)
1358
+ for (const m of a) {
1359
+ const d = o[m] ?? 0;
1365
1360
  c[m] = D(
1366
- p / a * l
1361
+ d / s * u
1367
1362
  );
1368
1363
  }
1369
1364
  else {
1370
1365
  const m = D(
1371
- l / s.length
1366
+ u / a.length
1372
1367
  );
1373
- for (const p of s)
1374
- c[p] = m;
1368
+ for (const d of a)
1369
+ c[d] = m;
1375
1370
  }
1376
1371
  return c;
1377
1372
  }
1378
1373
  function Vt(e, t) {
1379
- const n = e.map((r) => r.id), o = Object.keys(t);
1374
+ const n = e.map((i) => i.id), o = Object.keys(t);
1380
1375
  if (n.length !== o.length)
1381
1376
  return !1;
1382
- for (const r of n)
1383
- if (!o.includes(r))
1377
+ for (const i of n)
1378
+ if (!o.includes(i))
1384
1379
  return !1;
1385
1380
  return !0;
1386
1381
  }
@@ -1391,7 +1386,7 @@ function jt(e) {
1391
1386
  e.element.ownerDocument.defaultView,
1392
1387
  "Cannot register an unmounted Group"
1393
1388
  );
1394
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = new n((f) => {
1389
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((f) => {
1395
1390
  for (const h of f) {
1396
1391
  const { borderBoxSize: g, target: y } = h;
1397
1392
  if (y === e.element) {
@@ -1402,82 +1397,82 @@ function jt(e) {
1402
1397
  const S = $(e.id);
1403
1398
  if (!S)
1404
1399
  return;
1405
- const d = ge(e), P = S.defaultLayoutDeferred ? je(d) : S.layout, R = Ht({
1400
+ const p = ge(e), P = S.defaultLayoutDeferred ? je(p) : S.layout, R = Ht({
1406
1401
  group: e,
1407
1402
  nextGroupSize: z,
1408
1403
  prevGroupSize: S.groupSize,
1409
1404
  prevLayout: P
1410
1405
  }), C = B({
1411
1406
  layout: R,
1412
- panelConstraints: d
1407
+ panelConstraints: p
1413
1408
  });
1414
1409
  if (!S.defaultLayoutDeferred && j(S.layout, C) && $t(
1415
1410
  S.derivedPanelConstraints,
1416
- d
1411
+ p
1417
1412
  ) && S.groupSize === z)
1418
1413
  return;
1419
- F(e, {
1414
+ _(e, {
1420
1415
  defaultLayoutDeferred: !1,
1421
- derivedPanelConstraints: d,
1416
+ derivedPanelConstraints: p,
1422
1417
  groupSize: z,
1423
1418
  layout: C,
1424
1419
  separatorToPanels: S.separatorToPanels
1425
1420
  });
1426
1421
  }
1427
1422
  } else
1428
- _t(e, y, g);
1423
+ Ft(e, y, g);
1429
1424
  }
1430
1425
  });
1431
- a.observe(e.element), e.panels.forEach((f) => {
1426
+ s.observe(e.element), e.panels.forEach((f) => {
1432
1427
  L(
1433
1428
  !o.has(f.id),
1434
1429
  `Panel ids must be unique; id "${f.id}" was used more than once`
1435
- ), o.add(f.id), f.onResize && a.observe(f.element);
1430
+ ), o.add(f.id), f.onResize && s.observe(f.element);
1436
1431
  });
1437
- const u = Q({ group: e }), i = ge(e), s = e.panels.map(({ id: f }) => f).join(",");
1438
- let l = e.mutableState.defaultLayout;
1439
- l && (Vt(e.panels, l) || (l = void 0));
1440
- const c = e.mutableState.layouts[s] ?? l ?? je(i), m = B({
1432
+ const l = Q({ group: e }), r = ge(e), a = e.panels.map(({ id: f }) => f).join(",");
1433
+ let u = e.mutableState.defaultLayout;
1434
+ u && (Vt(e.panels, u) || (u = void 0));
1435
+ const c = e.mutableState.layouts[a] ?? u ?? je(r), m = B({
1441
1436
  layout: c,
1442
- panelConstraints: i
1443
- }), p = e.element.ownerDocument;
1437
+ panelConstraints: r
1438
+ }), d = e.element.ownerDocument;
1444
1439
  q.set(
1445
- p,
1446
- (q.get(p) ?? 0) + 1
1440
+ d,
1441
+ (q.get(d) ?? 0) + 1
1447
1442
  );
1448
1443
  const v = /* @__PURE__ */ new Map();
1449
1444
  return Ye(e).forEach((f) => {
1450
1445
  f.separator && v.set(f.separator, f.panels);
1451
- }), F(e, {
1452
- defaultLayoutDeferred: u === 0,
1453
- derivedPanelConstraints: i,
1454
- groupSize: u,
1446
+ }), _(e, {
1447
+ defaultLayoutDeferred: l === 0,
1448
+ derivedPanelConstraints: r,
1449
+ groupSize: l,
1455
1450
  layout: m,
1456
1451
  separatorToPanels: v
1457
1452
  }), e.separators.forEach((f) => {
1458
1453
  L(
1459
- !r.has(f.id),
1454
+ !i.has(f.id),
1460
1455
  `Separator ids must be unique; id "${f.id}" was used more than once`
1461
- ), r.add(f.id), f.element.addEventListener("keydown", Te);
1462
- }), q.get(p) === 1 && (p.addEventListener("dblclick", De, !0), p.addEventListener("pointerdown", Oe, !0), p.addEventListener("pointerleave", _e), p.addEventListener("pointermove", $e), p.addEventListener("pointerout", He), p.addEventListener("pointerup", Ve, !0)), function() {
1456
+ ), i.add(f.id), f.element.addEventListener("keydown", Te);
1457
+ }), q.get(d) === 1 && (d.addEventListener("dblclick", De, !0), d.addEventListener("pointerdown", Oe, !0), d.addEventListener("pointerleave", Fe), d.addEventListener("pointermove", $e), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, !0)), function() {
1463
1458
  t = !1, q.set(
1464
- p,
1465
- Math.max(0, (q.get(p) ?? 0) - 1)
1459
+ d,
1460
+ Math.max(0, (q.get(d) ?? 0) - 1)
1466
1461
  ), Lt(e), e.separators.forEach((h) => {
1467
1462
  h.element.removeEventListener("keydown", Te);
1468
- }), q.get(p) || (p.removeEventListener(
1463
+ }), q.get(d) || (d.removeEventListener(
1469
1464
  "dblclick",
1470
1465
  De,
1471
1466
  !0
1472
- ), p.removeEventListener(
1467
+ ), d.removeEventListener(
1473
1468
  "pointerdown",
1474
1469
  Oe,
1475
1470
  !0
1476
- ), p.removeEventListener("pointerleave", _e), p.removeEventListener("pointermove", $e), p.removeEventListener("pointerout", He), p.removeEventListener("pointerup", Ve, !0)), a.disconnect();
1471
+ ), d.removeEventListener("pointerleave", Fe), d.removeEventListener("pointermove", $e), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, !0)), s.disconnect();
1477
1472
  };
1478
1473
  }
1479
1474
  function Bt() {
1480
- const [e, t] = ie({}), n = te(() => t({}), []);
1475
+ const [e, t] = re({}), n = ne(() => t({}), []);
1481
1476
  return [e, n];
1482
1477
  }
1483
1478
  function xe(e) {
@@ -1485,17 +1480,17 @@ function xe(e) {
1485
1480
  return `${e ?? t}`;
1486
1481
  }
1487
1482
  const K = typeof window < "u" ? Be : de;
1488
- function ne(e) {
1483
+ function oe(e) {
1489
1484
  const t = T(e);
1490
1485
  return K(() => {
1491
1486
  t.current = e;
1492
- }, [e]), te(
1487
+ }, [e]), ne(
1493
1488
  (...n) => t.current?.(...n),
1494
1489
  [t]
1495
1490
  );
1496
1491
  }
1497
1492
  function we(...e) {
1498
- return ne((t) => {
1493
+ return oe((t) => {
1499
1494
  e.forEach((n) => {
1500
1495
  if (n)
1501
1496
  switch (typeof n) {
@@ -1518,7 +1513,7 @@ function Pe(e) {
1518
1513
  t.current[n] = e[n];
1519
1514
  }, [e]), t.current;
1520
1515
  }
1521
- const st = ht(null);
1516
+ const at = ht(null);
1522
1517
  function Wt(e, t) {
1523
1518
  const n = T({
1524
1519
  getLayout: () => ({}),
@@ -1536,36 +1531,36 @@ function Ut({
1536
1531
  className: t,
1537
1532
  defaultLayout: n,
1538
1533
  disableCursor: o,
1539
- disabled: r,
1540
- elementRef: a,
1541
- groupRef: u,
1542
- id: i,
1543
- onLayoutChange: s,
1544
- onLayoutChanged: l,
1534
+ disabled: i,
1535
+ elementRef: s,
1536
+ groupRef: l,
1537
+ id: r,
1538
+ onLayoutChange: a,
1539
+ onLayoutChanged: u,
1545
1540
  orientation: c = "horizontal",
1546
1541
  resizeTargetMinimumSize: m = {
1547
1542
  coarse: 20,
1548
1543
  fine: 10
1549
1544
  },
1550
- style: p,
1545
+ style: d,
1551
1546
  ...v
1552
1547
  }) {
1553
1548
  const x = T({
1554
1549
  onLayoutChange: {},
1555
1550
  onLayoutChanged: {}
1556
- }), f = ne((b) => {
1557
- j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, s?.(b));
1558
- }), h = ne((b) => {
1559
- j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, l?.(b));
1560
- }), g = xe(i), y = T(null), [z, S] = Bt(), d = T({
1551
+ }), f = oe((b) => {
1552
+ j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, a?.(b));
1553
+ }), h = oe((b) => {
1554
+ j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, u?.(b));
1555
+ }), g = xe(r), y = T(null), [z, S] = Bt(), p = T({
1561
1556
  lastExpandedPanelSizes: {},
1562
1557
  layouts: {},
1563
1558
  panels: [],
1564
1559
  resizeTargetMinimumSize: m,
1565
1560
  separators: []
1566
- }), P = we(y, a);
1567
- Wt(g, u);
1568
- const R = ne(
1561
+ }), P = we(y, s);
1562
+ Wt(g, l);
1563
+ const R = oe(
1569
1564
  (b, w) => {
1570
1565
  const E = W(), M = Me(b), k = $(b);
1571
1566
  if (k) {
@@ -1599,7 +1594,7 @@ function Ut({
1599
1594
  id: g,
1600
1595
  orientation: c,
1601
1596
  registerPanel: (b) => {
1602
- const w = d.current;
1597
+ const w = p.current;
1603
1598
  return w.panels = Se(c, [
1604
1599
  ...w.panels,
1605
1600
  b
@@ -1610,7 +1605,7 @@ function Ut({
1610
1605
  };
1611
1606
  },
1612
1607
  registerSeparator: (b) => {
1613
- const w = d.current;
1608
+ const w = p.current;
1614
1609
  return w.separators = Se(c, [
1615
1610
  ...w.separators,
1616
1611
  b
@@ -1621,30 +1616,30 @@ function Ut({
1621
1616
  };
1622
1617
  },
1623
1618
  togglePanelDisabled: (b, w) => {
1624
- const M = d.current.panels.find(
1619
+ const M = p.current.panels.find(
1625
1620
  (H) => H.id === b
1626
1621
  );
1627
1622
  M && (M.panelConstraints.disabled = w);
1628
1623
  const k = Me(g), O = $(g);
1629
- k && O && F(k, {
1624
+ k && O && _(k, {
1630
1625
  ...O,
1631
1626
  derivedPanelConstraints: ge(k)
1632
1627
  });
1633
1628
  },
1634
1629
  toggleSeparatorDisabled: (b, w) => {
1635
- const M = d.current.separators.find(
1630
+ const M = p.current.separators.find(
1636
1631
  (k) => k.id === b
1637
1632
  );
1638
1633
  M && (M.disabled = w);
1639
1634
  }
1640
1635
  }),
1641
1636
  [R, g, S, c, C]
1642
- ), _ = T(null);
1637
+ ), F = T(null);
1643
1638
  return K(() => {
1644
1639
  const b = y.current;
1645
1640
  if (b === null)
1646
1641
  return;
1647
- const w = d.current;
1642
+ const w = p.current;
1648
1643
  let E;
1649
1644
  if (C.defaultLayout !== void 0 && Object.keys(C.defaultLayout).length === w.panels.length) {
1650
1645
  E = {};
@@ -1654,35 +1649,35 @@ function Ut({
1654
1649
  }
1655
1650
  }
1656
1651
  const M = {
1657
- disabled: !!r,
1652
+ disabled: !!i,
1658
1653
  element: b,
1659
1654
  id: g,
1660
1655
  mutableState: {
1661
1656
  defaultLayout: E,
1662
1657
  disableCursor: !!C.disableCursor,
1663
- expandedPanelSizes: d.current.lastExpandedPanelSizes,
1664
- layouts: d.current.layouts
1658
+ expandedPanelSizes: p.current.lastExpandedPanelSizes,
1659
+ layouts: p.current.layouts
1665
1660
  },
1666
1661
  orientation: c,
1667
1662
  panels: w.panels,
1668
1663
  resizeTargetMinimumSize: w.resizeTargetMinimumSize,
1669
1664
  separators: w.separators
1670
1665
  };
1671
- _.current = M;
1666
+ F.current = M;
1672
1667
  const k = jt(M), { defaultLayoutDeferred: O, derivedPanelConstraints: H, layout: Ce } = $(M.id, !0);
1673
1668
  !O && H.length > 0 && (f(Ce), h(Ce));
1674
1669
  const lt = ye(g, (ee) => {
1675
- const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: se } = ee.next;
1670
+ const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: le } = ee.next;
1676
1671
  if (ae || Re.length === 0)
1677
1672
  return;
1678
1673
  const ut = M.panels.map(({ id: N }) => N).join(",");
1679
- M.mutableState.layouts[ut] = se, Re.forEach((N) => {
1674
+ M.mutableState.layouts[ut] = le, Re.forEach((N) => {
1680
1675
  if (N.collapsible) {
1681
1676
  const { layout: pe } = ee.prev ?? {};
1682
1677
  if (pe) {
1683
1678
  const ft = I(
1684
1679
  N.collapsedSize,
1685
- se[N.panelId]
1680
+ le[N.panelId]
1686
1681
  ), dt = I(
1687
1682
  N.collapsedSize,
1688
1683
  pe[N.panelId]
@@ -1692,13 +1687,13 @@ function Ut({
1692
1687
  }
1693
1688
  });
1694
1689
  const ct = W().state !== "active";
1695
- f(se), ct && h(se);
1690
+ f(le), ct && h(le);
1696
1691
  });
1697
1692
  return () => {
1698
- _.current = null, k(), lt();
1693
+ F.current = null, k(), lt();
1699
1694
  };
1700
1695
  }, [
1701
- r,
1696
+ i,
1702
1697
  g,
1703
1698
  h,
1704
1699
  f,
@@ -1706,9 +1701,9 @@ function Ut({
1706
1701
  z,
1707
1702
  C
1708
1703
  ]), de(() => {
1709
- const b = _.current;
1704
+ const b = F.current;
1710
1705
  b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
1711
- }), /* @__PURE__ */ oe(st.Provider, { value: X, children: /* @__PURE__ */ oe(
1706
+ }), /* @__PURE__ */ ie(at.Provider, { value: X, children: /* @__PURE__ */ ie(
1712
1707
  "div",
1713
1708
  {
1714
1709
  ...v,
@@ -1721,7 +1716,7 @@ function Ut({
1721
1716
  height: "100%",
1722
1717
  width: "100%",
1723
1718
  overflow: "hidden",
1724
- ...p,
1719
+ ...d,
1725
1720
  display: "flex",
1726
1721
  flexDirection: c === "horizontal" ? "row" : "column",
1727
1722
  flexWrap: "nowrap",
@@ -1745,35 +1740,35 @@ function nn({
1745
1740
  storage: n = localStorage,
1746
1741
  ...o
1747
1742
  }) {
1748
- const r = t !== void 0, a = "id" in o ? o.id : o.groupId, u = me(a, t ?? []), i = Ke(
1743
+ const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = me(s, t ?? []), r = Ke(
1749
1744
  Kt,
1750
- () => n.getItem(u),
1751
- () => n.getItem(u)
1752
- ), s = Ue(
1753
- () => i ? JSON.parse(i) : void 0,
1754
- [i]
1755
- ), l = T(null), c = te(() => {
1756
- const v = l.current;
1757
- v && (l.current = null, clearTimeout(v));
1745
+ () => n.getItem(l),
1746
+ () => n.getItem(l)
1747
+ ), a = Ue(
1748
+ () => r ? JSON.parse(r) : void 0,
1749
+ [r]
1750
+ ), u = T(null), c = ne(() => {
1751
+ const v = u.current;
1752
+ v && (u.current = null, clearTimeout(v));
1758
1753
  }, []);
1759
1754
  Be(() => () => {
1760
1755
  c();
1761
1756
  }, [c]);
1762
- const m = te(
1757
+ const m = ne(
1763
1758
  (v) => {
1764
1759
  c();
1765
1760
  let x;
1766
- r ? x = me(a, Object.keys(v)) : x = me(a, []);
1761
+ i ? x = me(s, Object.keys(v)) : x = me(s, []);
1767
1762
  try {
1768
1763
  n.setItem(x, JSON.stringify(v));
1769
1764
  } catch (f) {
1770
1765
  console.error(f);
1771
1766
  }
1772
1767
  },
1773
- [c, r, a, n]
1774
- ), p = te(
1768
+ [c, i, s, n]
1769
+ ), d = ne(
1775
1770
  (v) => {
1776
- c(), e === 0 ? m(v) : l.current = setTimeout(() => {
1771
+ c(), e === 0 ? m(v) : u.current = setTimeout(() => {
1777
1772
  m(v);
1778
1773
  }, e);
1779
1774
  },
@@ -1783,13 +1778,13 @@ function nn({
1783
1778
  /**
1784
1779
  * Pass this value to `Group` as the `defaultLayout` prop.
1785
1780
  */
1786
- defaultLayout: s,
1781
+ defaultLayout: a,
1787
1782
  /**
1788
1783
  * Attach this callback on the `Group` as the `onLayoutChange` prop.
1789
1784
  *
1790
1785
  * @deprecated Use the {@link onLayoutChanged} prop instead.
1791
1786
  */
1792
- onLayoutChange: p,
1787
+ onLayoutChange: d,
1793
1788
  /**
1794
1789
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
1795
1790
  */
@@ -1801,13 +1796,13 @@ function Kt() {
1801
1796
  };
1802
1797
  }
1803
1798
  function on() {
1804
- return ie(null);
1799
+ return re(null);
1805
1800
  }
1806
1801
  function rn() {
1807
1802
  return T(null);
1808
1803
  }
1809
1804
  function Le() {
1810
- const e = mt(st);
1805
+ const e = mt(at);
1811
1806
  return L(
1812
1807
  e,
1813
1808
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
@@ -1836,29 +1831,29 @@ function qt({
1836
1831
  className: t,
1837
1832
  collapsedSize: n = "0%",
1838
1833
  collapsible: o = !1,
1839
- defaultSize: r,
1840
- disabled: a,
1841
- elementRef: u,
1842
- groupResizeBehavior: i = "preserve-relative-size",
1843
- id: s,
1844
- maxSize: l = "100%",
1834
+ defaultSize: i,
1835
+ disabled: s,
1836
+ elementRef: l,
1837
+ groupResizeBehavior: r = "preserve-relative-size",
1838
+ id: a,
1839
+ maxSize: u = "100%",
1845
1840
  minSize: c = "0%",
1846
1841
  onResize: m,
1847
- panelRef: p,
1842
+ panelRef: d,
1848
1843
  style: v,
1849
1844
  ...x
1850
1845
  }) {
1851
- const f = !!s, h = xe(s), g = Pe({
1852
- disabled: a
1853
- }), y = T(null), z = we(y, u), {
1846
+ const f = !!a, h = xe(a), g = Pe({
1847
+ disabled: s
1848
+ }), y = T(null), z = we(y, l), {
1854
1849
  getPanelStyles: S,
1855
- id: d,
1850
+ id: p,
1856
1851
  orientation: P,
1857
1852
  registerPanel: R,
1858
1853
  togglePanelDisabled: C
1859
- } = Le(), X = m !== null, _ = ne(
1854
+ } = Le(), X = m !== null, F = oe(
1860
1855
  (w, E, M) => {
1861
- m?.(w, s, M);
1856
+ m?.(w, a, M);
1862
1857
  }
1863
1858
  );
1864
1859
  K(() => {
@@ -1872,47 +1867,47 @@ function qt({
1872
1867
  expandToSize: void 0,
1873
1868
  prevSize: void 0
1874
1869
  },
1875
- onResize: X ? _ : void 0,
1870
+ onResize: X ? F : void 0,
1876
1871
  panelConstraints: {
1877
- groupResizeBehavior: i,
1872
+ groupResizeBehavior: r,
1878
1873
  collapsedSize: n,
1879
1874
  collapsible: o,
1880
- defaultSize: r,
1875
+ defaultSize: i,
1881
1876
  disabled: g.disabled,
1882
- maxSize: l,
1877
+ maxSize: u,
1883
1878
  minSize: c
1884
1879
  }
1885
1880
  };
1886
1881
  return R(E);
1887
1882
  }
1888
1883
  }, [
1889
- i,
1884
+ r,
1890
1885
  n,
1891
1886
  o,
1892
- r,
1887
+ i,
1893
1888
  X,
1894
1889
  h,
1895
1890
  f,
1896
- l,
1891
+ u,
1897
1892
  c,
1898
- _,
1893
+ F,
1899
1894
  R,
1900
1895
  g
1901
1896
  ]), de(() => {
1902
- C(h, !!a);
1903
- }, [a, h, C]), Xt(h, p);
1897
+ C(h, !!s);
1898
+ }, [s, h, C]), Xt(h, d);
1904
1899
  const b = Ke(
1905
- (w) => ye(d, w),
1900
+ (w) => ye(p, w),
1906
1901
  // useSyncExternalStore does not support a custom equality check
1907
1902
  // stringify avoids re-rendering when the style value hasn't changed
1908
- () => JSON.stringify(S(d, h)),
1909
- () => JSON.stringify(S(d, h))
1903
+ () => JSON.stringify(S(p, h)),
1904
+ () => JSON.stringify(S(p, h))
1910
1905
  );
1911
- return /* @__PURE__ */ oe(
1906
+ return /* @__PURE__ */ ie(
1912
1907
  "div",
1913
1908
  {
1914
1909
  ...x,
1915
- "aria-disabled": a || void 0,
1910
+ "aria-disabled": s || void 0,
1916
1911
  "data-panel": !0,
1917
1912
  "data-testid": h,
1918
1913
  id: h,
@@ -1925,7 +1920,7 @@ function qt({
1925
1920
  overflow: "visible",
1926
1921
  ...JSON.parse(b)
1927
1922
  },
1928
- children: /* @__PURE__ */ oe(
1923
+ children: /* @__PURE__ */ ie(
1929
1924
  "div",
1930
1925
  {
1931
1926
  className: t,
@@ -1960,10 +1955,10 @@ const Yt = {
1960
1955
  padding: 0,
1961
1956
  margin: 0
1962
1957
  };
1963
- function an() {
1964
- return ie(null);
1965
- }
1966
1958
  function sn() {
1959
+ return re(null);
1960
+ }
1961
+ function an() {
1967
1962
  return T(null);
1968
1963
  }
1969
1964
  function Jt({
@@ -1972,24 +1967,24 @@ function Jt({
1972
1967
  panelId: n,
1973
1968
  panelIndex: o
1974
1969
  }) {
1975
- let r, a;
1976
- const u = e[n], i = t.find(
1977
- (s) => s.panelId === n
1970
+ let i, s;
1971
+ const l = e[n], r = t.find(
1972
+ (a) => a.panelId === n
1978
1973
  );
1979
- if (i) {
1980
- const s = i.maxSize, l = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
1981
- a = B({
1982
- layout: re({
1983
- delta: l - u,
1974
+ if (r) {
1975
+ const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
1976
+ s = B({
1977
+ layout: se({
1978
+ delta: u - l,
1984
1979
  initialLayout: e,
1985
1980
  panelConstraints: t,
1986
1981
  pivotIndices: c,
1987
1982
  prevLayout: e
1988
1983
  }),
1989
1984
  panelConstraints: t
1990
- })[n], r = B({
1991
- layout: re({
1992
- delta: s - u,
1985
+ })[n], i = B({
1986
+ layout: se({
1987
+ delta: a - l,
1993
1988
  initialLayout: e,
1994
1989
  panelConstraints: t,
1995
1990
  pivotIndices: c,
@@ -2000,9 +1995,9 @@ function Jt({
2000
1995
  }
2001
1996
  return {
2002
1997
  valueControls: n,
2003
- valueMax: r,
2004
- valueMin: a,
2005
- valueNow: u
1998
+ valueMax: i,
1999
+ valueMin: s,
2000
+ valueNow: l
2006
2001
  };
2007
2002
  }
2008
2003
  function Zt({
@@ -2010,13 +2005,13 @@ function Zt({
2010
2005
  className: t,
2011
2006
  disabled: n,
2012
2007
  elementRef: o,
2013
- id: r,
2014
- style: a,
2015
- ...u
2008
+ id: i,
2009
+ style: s,
2010
+ ...l
2016
2011
  }) {
2017
- const i = xe(r), s = Pe({
2012
+ const r = xe(i), a = Pe({
2018
2013
  disabled: n
2019
- }), [l, c] = ie({}), [m, p] = ie("inactive"), v = T(null), x = we(v, o), {
2014
+ }), [u, c] = re({}), [m, d] = re("inactive"), v = T(null), x = we(v, o), {
2020
2015
  disableCursor: f,
2021
2016
  id: h,
2022
2017
  orientation: g,
@@ -2027,18 +2022,18 @@ function Zt({
2027
2022
  const P = v.current;
2028
2023
  if (P !== null) {
2029
2024
  const R = {
2030
- disabled: s.disabled,
2025
+ disabled: a.disabled,
2031
2026
  element: P,
2032
- id: i
2027
+ id: r
2033
2028
  }, C = y(R), X = Gt(
2034
2029
  (b) => {
2035
- p(
2030
+ d(
2036
2031
  b.next.state !== "inactive" && b.next.hitRegions.some(
2037
2032
  (w) => w.separator === R
2038
2033
  ) ? b.next.state : "inactive"
2039
2034
  );
2040
2035
  }
2041
- ), _ = ye(
2036
+ ), F = ye(
2042
2037
  h,
2043
2038
  (b) => {
2044
2039
  const { derivedPanelConstraints: w, layout: E, separatorToPanels: M } = b.next, k = M.get(R);
@@ -2056,34 +2051,34 @@ function Zt({
2056
2051
  }
2057
2052
  );
2058
2053
  return () => {
2059
- X(), _(), C();
2054
+ X(), F(), C();
2060
2055
  };
2061
2056
  }
2062
- }, [h, i, y, s]), de(() => {
2063
- z(i, !!n);
2064
- }, [n, i, z]);
2065
- let d;
2066
- return n && !f && (d = "not-allowed"), /* @__PURE__ */ oe(
2057
+ }, [h, r, y, a]), de(() => {
2058
+ z(r, !!n);
2059
+ }, [n, r, z]);
2060
+ let p;
2061
+ return n && !f && (p = "not-allowed"), /* @__PURE__ */ ie(
2067
2062
  "div",
2068
2063
  {
2069
- ...u,
2070
- "aria-controls": l.valueControls,
2064
+ ...l,
2065
+ "aria-controls": u.valueControls,
2071
2066
  "aria-disabled": n || void 0,
2072
2067
  "aria-orientation": S,
2073
- "aria-valuemax": l.valueMax,
2074
- "aria-valuemin": l.valueMin,
2075
- "aria-valuenow": l.valueNow,
2068
+ "aria-valuemax": u.valueMax,
2069
+ "aria-valuemin": u.valueMin,
2070
+ "aria-valuenow": u.valueNow,
2076
2071
  children: e,
2077
2072
  className: t,
2078
2073
  "data-separator": n ? "disabled" : m,
2079
- "data-testid": i,
2080
- id: i,
2074
+ "data-testid": r,
2075
+ id: r,
2081
2076
  ref: x,
2082
2077
  role: "separator",
2083
2078
  style: {
2084
2079
  flexBasis: "auto",
2085
- cursor: d,
2086
- ...a,
2080
+ cursor: p,
2081
+ ...s,
2087
2082
  flexGrow: 0,
2088
2083
  flexShrink: 0,
2089
2084
  // Inform the browser that the library is handling touch events for this element
@@ -2103,7 +2098,7 @@ export {
2103
2098
  nn as useDefaultLayout,
2104
2099
  on as useGroupCallbackRef,
2105
2100
  rn as useGroupRef,
2106
- an as usePanelCallbackRef,
2107
- sn as usePanelRef
2101
+ sn as usePanelCallbackRef,
2102
+ an as usePanelRef
2108
2103
  };
2109
2104
  //# sourceMappingURL=react-resizable-panels.js.map