react-resizable-panels 4.0.7 → 4.0.8-alpha.1

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,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsx as W } from "react/jsx-runtime";
3
- import { useId as $e, useLayoutEffect as Ne, useEffect as _e, useRef as T, useCallback as xe, createContext as Fe, useImperativeHandle as ze, useState as G, useMemo as be, useSyncExternalStore as He, useContext as We } from "react";
3
+ import { useId as _e, useLayoutEffect as Fe, useEffect as He, useRef as T, useCallback as ze, createContext as We, useImperativeHandle as be, useSyncExternalStore as we, useState as G, useMemo as Le, useContext as je } from "react";
4
4
  function z(e, t = "Assertion error") {
5
5
  if (!e)
6
6
  throw Error(t);
7
7
  }
8
8
  function re(e, t) {
9
9
  return t.sort(
10
- e === "horizontal" ? je : Be
10
+ e === "horizontal" ? Ve : Be
11
11
  );
12
12
  }
13
- function je(e, t) {
13
+ function Ve(e, t) {
14
14
  const n = e.element.offsetLeft - t.element.offsetLeft;
15
15
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
16
16
  }
@@ -18,13 +18,13 @@ function Be(e, t) {
18
18
  const n = e.element.offsetTop - t.element.offsetTop;
19
19
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
20
20
  }
21
- function te({
21
+ function ee({
22
22
  group: e
23
23
  }) {
24
24
  const { orientation: t, panels: n } = e;
25
25
  return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
26
26
  }
27
- function we(e) {
27
+ function Pe(e) {
28
28
  const { element: t, orientation: n, panels: o, separators: r } = e, s = re(
29
29
  n,
30
30
  Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
@@ -36,29 +36,29 @@ function we(e) {
36
36
  );
37
37
  if (f) {
38
38
  if (i) {
39
- const u = i.element.getBoundingClientRect(), m = l.getBoundingClientRect();
39
+ const u = i.element.getBoundingClientRect(), h = l.getBoundingClientRect();
40
40
  c.push({
41
41
  group: e,
42
- groupSize: te({ group: e }),
42
+ groupSize: ee({ group: e }),
43
43
  panels: [i, f],
44
44
  separator: a,
45
45
  rect: n === "horizontal" ? new DOMRect(
46
46
  u.right,
47
- m.top,
48
- m.left - u.right,
49
- m.height
47
+ h.top,
48
+ h.left - u.right,
49
+ h.height
50
50
  ) : new DOMRect(
51
- m.left,
51
+ h.left,
52
52
  u.bottom,
53
- m.width,
54
- m.top - u.bottom
53
+ h.width,
54
+ h.top - u.bottom
55
55
  )
56
56
  });
57
57
  }
58
58
  i = f, a = void 0;
59
59
  } else {
60
60
  const u = r.find(
61
- (m) => m.element === l
61
+ (h) => h.element === l
62
62
  );
63
63
  u ? a = u : (i = void 0, a = void 0);
64
64
  }
@@ -73,13 +73,13 @@ function Ke(e, t) {
73
73
  const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
74
74
  return t * o;
75
75
  }
76
- function Ve(e) {
76
+ function Xe(e) {
77
77
  return e / 100 * window.innerHeight;
78
78
  }
79
- function Xe(e) {
79
+ function Ye(e) {
80
80
  return e / 100 * window.innerWidth;
81
81
  }
82
- function Ye(e) {
82
+ function qe(e) {
83
83
  switch (typeof e) {
84
84
  case "number":
85
85
  return [e, "px"];
@@ -89,13 +89,13 @@ function Ye(e) {
89
89
  }
90
90
  }
91
91
  }
92
- function J({
92
+ function Z({
93
93
  groupSize: e,
94
94
  panelElement: t,
95
95
  styleProp: n
96
96
  }) {
97
97
  let o;
98
- const [r, s] = Ye(n);
98
+ const [r, s] = qe(n);
99
99
  switch (s) {
100
100
  case "%": {
101
101
  o = r / 100 * e;
@@ -114,11 +114,11 @@ function J({
114
114
  break;
115
115
  }
116
116
  case "vh": {
117
- o = Ve(r);
117
+ o = Xe(r);
118
118
  break;
119
119
  }
120
120
  case "vw": {
121
- o = Xe(r);
121
+ o = Ye(r);
122
122
  break;
123
123
  }
124
124
  }
@@ -127,13 +127,20 @@ function J({
127
127
  function I(e) {
128
128
  return parseFloat(e.toFixed(3));
129
129
  }
130
- function pe(e) {
131
- const { panels: t } = e, n = te({ group: e });
132
- return t.map((o) => {
130
+ function me(e) {
131
+ const { panels: t } = e, n = ee({ group: e });
132
+ return n === 0 ? t.map((o) => ({
133
+ collapsedSize: 0,
134
+ collapsible: o.panelConstraints.collapsible === !0,
135
+ defaultSize: void 0,
136
+ minSize: 0,
137
+ maxSize: 100,
138
+ panelId: o.id
139
+ })) : t.map((o) => {
133
140
  const { element: r, panelConstraints: s } = o;
134
141
  let c = 0;
135
142
  if (s.collapsedSize) {
136
- const f = J({
143
+ const f = Z({
137
144
  groupSize: n,
138
145
  panelElement: r,
139
146
  styleProp: s.collapsedSize
@@ -142,7 +149,7 @@ function pe(e) {
142
149
  }
143
150
  let i;
144
151
  if (s.defaultSize) {
145
- const f = J({
152
+ const f = Z({
146
153
  groupSize: n,
147
154
  panelElement: r,
148
155
  styleProp: s.defaultSize
@@ -151,7 +158,7 @@ function pe(e) {
151
158
  }
152
159
  let a = 0;
153
160
  if (s.minSize) {
154
- const f = J({
161
+ const f = Z({
155
162
  groupSize: n,
156
163
  panelElement: r,
157
164
  styleProp: s.minSize
@@ -160,7 +167,7 @@ function pe(e) {
160
167
  }
161
168
  let l = 100;
162
169
  if (s.maxSize) {
163
- const f = J({
170
+ const f = Z({
164
171
  groupSize: n,
165
172
  panelElement: r,
166
173
  styleProp: s.maxSize
@@ -177,7 +184,7 @@ function pe(e) {
177
184
  };
178
185
  });
179
186
  }
180
- class qe {
187
+ class Ze {
181
188
  #e = {};
182
189
  addListener(t, n) {
183
190
  const o = this.#e[t];
@@ -226,7 +233,7 @@ let R = {
226
233
  },
227
234
  mountedGroups: /* @__PURE__ */ new Map()
228
235
  };
229
- const A = new qe();
236
+ const A = new Ze();
230
237
  function O() {
231
238
  return R;
232
239
  }
@@ -256,12 +263,12 @@ function C(e) {
256
263
  });
257
264
  }), A.emit("mountedGroupsChange", R.mountedGroups)), R;
258
265
  }
259
- const Ze = (e) => e, ie = () => {
260
- }, Le = 1, Pe = 2, Ee = 4, Re = 8, me = {
266
+ const Je = (e) => e, ie = () => {
267
+ }, Ee = 1, Re = 2, Ce = 4, Me = 8, he = {
261
268
  coarse: 10,
262
269
  precise: 5
263
270
  };
264
- function Je({
271
+ function Qe({
265
272
  cursorFlags: e,
266
273
  groups: t,
267
274
  state: n
@@ -288,7 +295,7 @@ function Je({
288
295
  return null;
289
296
  switch (n) {
290
297
  case "active": {
291
- const s = (e & Le) !== 0, c = (e & Pe) !== 0, i = (e & Ee) !== 0, a = (e & Re) !== 0;
298
+ const s = (e & Ee) !== 0, c = (e & Re) !== 0, i = (e & Ce) !== 0, a = (e & Me) !== 0;
292
299
  if (e) {
293
300
  if (s)
294
301
  return i ? "se-resize" : a ? "ne-resize" : "e-resize";
@@ -311,7 +318,7 @@ function le() {
311
318
  switch (t.state) {
312
319
  case "active":
313
320
  case "hover": {
314
- const n = Je({
321
+ const n = Qe({
315
322
  cursorFlags: e,
316
323
  groups: t.hitRegions.map((r) => r.group),
317
324
  state: t.state
@@ -327,7 +334,7 @@ function le() {
327
334
  }
328
335
  }
329
336
  }
330
- function Qe(e, t) {
337
+ function et(e, t) {
331
338
  if (e.length !== t.length)
332
339
  return !1;
333
340
  for (let n = 0; n < e.length; n++)
@@ -356,7 +363,7 @@ function F({
356
363
  t = s;
357
364
  return t = Math.min(r, t), t = I(t), t;
358
365
  }
359
- function B({
366
+ function V({
360
367
  delta: e,
361
368
  initialLayout: t,
362
369
  panelConstraints: n,
@@ -377,18 +384,18 @@ function B({
377
384
  `Panel constraints not found for index ${d}`
378
385
  );
379
386
  const {
380
- collapsedSize: h = 0,
381
- collapsible: v,
387
+ collapsedSize: v = 0,
388
+ collapsible: m,
382
389
  minSize: x = 0
383
390
  } = p;
384
- if (v) {
391
+ if (m) {
385
392
  const S = c[d];
386
393
  if (z(
387
394
  S != null,
388
395
  `Previous layout not found for panel index ${d}`
389
- ), w(S, h)) {
390
- const y = x - S;
391
- j(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
396
+ ), w(S, v)) {
397
+ const g = x - S;
398
+ j(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
392
399
  }
393
400
  }
394
401
  }
@@ -399,61 +406,61 @@ function B({
399
406
  `No panel constraints found for index ${d}`
400
407
  );
401
408
  const {
402
- collapsedSize: h = 0,
403
- collapsible: v,
409
+ collapsedSize: v = 0,
410
+ collapsible: m,
404
411
  minSize: x = 0
405
412
  } = p;
406
- if (v) {
413
+ if (m) {
407
414
  const S = c[d];
408
415
  if (z(
409
416
  S != null,
410
417
  `Previous layout not found for panel index ${d}`
411
418
  ), w(S, x)) {
412
- const y = S - h;
413
- j(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
419
+ const g = S - v;
420
+ j(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
414
421
  }
415
422
  }
416
423
  }
417
424
  }
418
425
  {
419
426
  const d = e < 0 ? 1 : -1;
420
- let p = e < 0 ? f : l, h = 0;
427
+ let p = e < 0 ? f : l, v = 0;
421
428
  for (; ; ) {
422
429
  const x = c[p];
423
430
  z(
424
431
  x != null,
425
432
  `Previous layout not found for panel index ${p}`
426
433
  );
427
- const y = F({
434
+ const g = F({
428
435
  panelConstraints: n[p],
429
436
  size: 100
430
437
  }) - x;
431
- if (h += y, p += d, p < 0 || p >= n.length)
438
+ if (v += g, p += d, p < 0 || p >= n.length)
432
439
  break;
433
440
  }
434
- const v = Math.min(Math.abs(e), Math.abs(h));
435
- e = e < 0 ? 0 - v : v;
441
+ const m = Math.min(Math.abs(e), Math.abs(v));
442
+ e = e < 0 ? 0 - m : m;
436
443
  }
437
444
  {
438
445
  let p = e < 0 ? l : f;
439
446
  for (; p >= 0 && p < n.length; ) {
440
- const h = Math.abs(e) - Math.abs(u), v = c[p];
447
+ const v = Math.abs(e) - Math.abs(u), m = c[p];
441
448
  z(
442
- v != null,
449
+ m != null,
443
450
  `Previous layout not found for panel index ${p}`
444
451
  );
445
- const x = v - h, S = F({
452
+ const x = m - v, S = F({
446
453
  panelConstraints: n[p],
447
454
  size: x
448
455
  });
449
- if (!w(v, S) && (u += v - S, a[p] = S, u.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
456
+ if (!w(m, S) && (u += m - S, a[p] = S, u.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
450
457
  numeric: !0
451
458
  }) >= 0))
452
459
  break;
453
460
  e < 0 ? p-- : p++;
454
461
  }
455
462
  }
456
- if (Qe(i, a))
463
+ if (et(i, a))
457
464
  return r;
458
465
  {
459
466
  const d = e < 0 ? f : l, p = c[d];
@@ -461,38 +468,38 @@ function B({
461
468
  p != null,
462
469
  `Previous layout not found for panel index ${d}`
463
470
  );
464
- const h = p + u, v = F({
471
+ const v = p + u, m = F({
465
472
  panelConstraints: n[d],
466
- size: h
473
+ size: v
467
474
  });
468
- if (a[d] = v, !w(v, h)) {
469
- let x = h - v, y = e < 0 ? f : l;
470
- for (; y >= 0 && y < n.length; ) {
471
- const L = a[y];
475
+ if (a[d] = m, !w(m, v)) {
476
+ let x = v - m, g = e < 0 ? f : l;
477
+ for (; g >= 0 && g < n.length; ) {
478
+ const L = a[g];
472
479
  z(
473
480
  L != null,
474
- `Previous layout not found for panel index ${y}`
481
+ `Previous layout not found for panel index ${g}`
475
482
  );
476
483
  const P = L + x, E = F({
477
- panelConstraints: n[y],
484
+ panelConstraints: n[g],
478
485
  size: P
479
486
  });
480
- if (w(L, E) || (x -= E - L, a[y] = E), w(x, 0))
487
+ if (w(L, E) || (x -= E - L, a[g] = E), w(x, 0))
481
488
  break;
482
- e > 0 ? y-- : y++;
489
+ e > 0 ? g-- : g++;
483
490
  }
484
491
  }
485
492
  }
486
- const m = Object.values(a).reduce(
493
+ const h = Object.values(a).reduce(
487
494
  (d, p) => p + d,
488
495
  0
489
496
  );
490
- if (!w(m, 100, 0.1))
497
+ if (!w(h, 100, 0.1))
491
498
  return r;
492
- const g = Object.keys(r);
493
- return a.reduce((d, p, h) => (d[g[h]] = p, d), {});
499
+ const y = Object.keys(r);
500
+ return a.reduce((d, p, v) => (d[y[v]] = p, d), {});
494
501
  }
495
- function U(e, t) {
502
+ function B(e, t) {
496
503
  if (Object.keys(e).length !== Object.keys(t).length)
497
504
  return !1;
498
505
  for (const n in e)
@@ -500,7 +507,7 @@ function U(e, t) {
500
507
  return !1;
501
508
  return !0;
502
509
  }
503
- function Ce({
510
+ function Ge({
504
511
  event: e,
505
512
  hitRegions: t,
506
513
  initialLayoutMap: n,
@@ -510,32 +517,32 @@ function Ce({
510
517
  let s = 0;
511
518
  const c = new Map(o);
512
519
  t.forEach((i) => {
513
- const { group: a, groupSize: l } = i, { disableCursor: f, orientation: u, panels: m } = a;
514
- let g = 0;
515
- r ? u === "horizontal" ? g = (e.clientX - r.x) / l * 100 : g = (e.clientY - r.y) / l * 100 : u === "horizontal" ? g = e.clientX < 0 ? -100 : 100 : g = e.clientY < 0 ? -100 : 100;
520
+ const { group: a, groupSize: l } = i, { disableCursor: f, orientation: u, panels: h } = a;
521
+ let y = 0;
522
+ r ? u === "horizontal" ? y = (e.clientX - r.x) / l * 100 : y = (e.clientY - r.y) / l * 100 : u === "horizontal" ? y = e.clientX < 0 ? -100 : 100 : y = e.clientY < 0 ? -100 : 100;
516
523
  const d = n.get(a), {
517
524
  derivedPanelConstraints: p,
518
- layout: h,
519
- separatorToPanels: v
525
+ layout: v,
526
+ separatorToPanels: m
520
527
  } = o.get(a) ?? {};
521
- if (p && d && h && v) {
522
- const x = B({
523
- delta: g,
528
+ if (p && d && v && m) {
529
+ const x = V({
530
+ delta: y,
524
531
  initialLayout: d,
525
532
  panelConstraints: p,
526
- pivotIndices: i.panels.map((S) => m.indexOf(S)),
527
- prevLayout: h,
533
+ pivotIndices: i.panels.map((S) => h.indexOf(S)),
534
+ prevLayout: v,
528
535
  trigger: "mouse-or-touch"
529
536
  });
530
- if (U(x, h)) {
531
- if (g !== 0 && !f)
537
+ if (B(x, v)) {
538
+ if (y !== 0 && !f)
532
539
  switch (u) {
533
540
  case "horizontal": {
534
- s |= g < 0 ? Le : Pe;
541
+ s |= y < 0 ? Ee : Re;
535
542
  break;
536
543
  }
537
544
  case "vertical": {
538
- s |= g < 0 ? Ee : Re;
545
+ s |= y < 0 ? Ce : Me;
539
546
  break;
540
547
  }
541
548
  }
@@ -543,9 +550,9 @@ function Ce({
543
550
  c.set(i.group, {
544
551
  derivedPanelConstraints: p,
545
552
  layout: x,
546
- separatorToPanels: v
553
+ separatorToPanels: m
547
554
  });
548
- const S = i.group.panels.map(({ id: y }) => y).join(",");
555
+ const S = i.group.panels.map(({ id: g }) => g).join(",");
549
556
  i.group.inMemoryLayouts[S] = x;
550
557
  }
551
558
  }
@@ -554,7 +561,7 @@ function Ce({
554
561
  mountedGroups: c
555
562
  }), le();
556
563
  }
557
- function he(e) {
564
+ function ve(e) {
558
565
  if (e.defaultPrevented)
559
566
  return;
560
567
  if (e.relatedTarget !== null)
@@ -565,7 +572,7 @@ function he(e) {
565
572
  switch (t.state) {
566
573
  case "active":
567
574
  t.hitRegions.forEach((o) => {
568
- e.currentTarget === o.group.element && Ce({
575
+ e.currentTarget === o.group.element && Ge({
569
576
  event: e,
570
577
  hitRegions: t.hitRegions,
571
578
  initialLayoutMap: t.initialLayoutMap,
@@ -574,7 +581,7 @@ function he(e) {
574
581
  });
575
582
  }
576
583
  }
577
- function ee(e) {
584
+ function Q(e) {
578
585
  const t = e.parentElement;
579
586
  z(t, "Parent group element not found");
580
587
  const { mountedGroups: n } = O();
@@ -626,7 +633,7 @@ function $({
626
633
  const c = Object.keys(e);
627
634
  return o.reduce((i, a, l) => (i[c[l]] = a, i), {});
628
635
  }
629
- function Me({
636
+ function Ie({
630
637
  groupId: e
631
638
  }) {
632
639
  const t = () => {
@@ -651,7 +658,7 @@ function Me({
651
658
  layout: n,
652
659
  panelConstraints: o
653
660
  });
654
- return U(s, i) || C((a) => ({
661
+ return B(s, i) || C((a) => ({
655
662
  mountedGroups: new Map(a.mountedGroups).set(r, {
656
663
  derivedPanelConstraints: o,
657
664
  layout: i,
@@ -661,18 +668,18 @@ function Me({
661
668
  }
662
669
  };
663
670
  }
664
- function Ge(e) {
671
+ function ke(e) {
665
672
  const { mountedGroups: t } = O(), n = t.get(e);
666
673
  return z(n, `Mounted Group ${e.id} not found`), n;
667
674
  }
668
675
  function D(e, t) {
669
- const n = ee(e), o = Ge(n), r = n.separators.find(
676
+ const n = Q(e), o = ke(n), r = n.separators.find(
670
677
  (u) => u.element === e
671
678
  );
672
679
  z(r, "Matching separator not found");
673
680
  const s = o.separatorToPanels.get(r);
674
681
  z(s, "Matching panels not found");
675
- const c = s.map((u) => n.panels.indexOf(u)), a = Me({ groupId: n.id }).getLayout(), l = B({
682
+ const c = s.map((u) => n.panels.indexOf(u)), a = Ie({ groupId: n.id }).getLayout(), l = V({
676
683
  delta: t,
677
684
  initialLayout: a,
678
685
  panelConstraints: o.derivedPanelConstraints,
@@ -683,7 +690,7 @@ function D(e, t) {
683
690
  layout: l,
684
691
  panelConstraints: o.derivedPanelConstraints
685
692
  });
686
- U(a, f) || C((u) => ({
693
+ B(a, f) || C((u) => ({
687
694
  mountedGroups: new Map(u.mountedGroups).set(n, {
688
695
  derivedPanelConstraints: o.derivedPanelConstraints,
689
696
  layout: f,
@@ -691,10 +698,10 @@ function D(e, t) {
691
698
  })
692
699
  }));
693
700
  }
694
- function ve(e) {
701
+ function ye(e) {
695
702
  if (e.defaultPrevented)
696
703
  return;
697
- const t = e.currentTarget, n = ee(t);
704
+ const t = e.currentTarget, n = Q(t);
698
705
  if (!n.disabled)
699
706
  switch (e.key) {
700
707
  case "ArrowDown": {
@@ -719,7 +726,7 @@ function ve(e) {
719
726
  }
720
727
  case "Enter": {
721
728
  e.preventDefault();
722
- const o = ee(t), { derivedPanelConstraints: r, layout: s, separatorToPanels: c } = Ge(o), i = o.separators.find(
729
+ const o = Q(t), { derivedPanelConstraints: r, layout: s, separatorToPanels: c } = ke(o), i = o.separators.find(
723
730
  (u) => u.element === t
724
731
  );
725
732
  z(i, "Matching separator not found");
@@ -729,14 +736,14 @@ function ve(e) {
729
736
  (u) => u.panelId === l.id
730
737
  );
731
738
  if (z(f, "Panel metadata not found"), f.collapsible) {
732
- const u = s[l.id], m = f.collapsedSize === u ? o.inMemoryLastExpandedPanelSizes[l.id] ?? f.minSize : f.collapsedSize;
733
- D(t, m - u);
739
+ const u = s[l.id], h = f.collapsedSize === u ? o.inMemoryLastExpandedPanelSizes[l.id] ?? f.minSize : f.collapsedSize;
740
+ D(t, h - u);
734
741
  }
735
742
  break;
736
743
  }
737
744
  case "F6": {
738
745
  e.preventDefault();
739
- const r = ee(t).separators.map(
746
+ const r = Q(t).separators.map(
740
747
  (a) => a.element
741
748
  ), s = Array.from(r).findIndex(
742
749
  (a) => a === e.currentTarget
@@ -752,7 +759,7 @@ function ve(e) {
752
759
  }
753
760
  }
754
761
  }
755
- function et(e, t) {
762
+ function tt(e, t) {
756
763
  return {
757
764
  x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
758
765
  Math.abs(e.x - t.left),
@@ -764,13 +771,13 @@ function et(e, t) {
764
771
  )
765
772
  };
766
773
  }
767
- function tt(e, t, n) {
774
+ function nt(e, t, n) {
768
775
  let o, r = {
769
776
  x: 1 / 0,
770
777
  y: 1 / 0
771
778
  };
772
779
  for (const s of t) {
773
- const c = et(n, s.rect);
780
+ const c = tt(n, s.rect);
774
781
  switch (e) {
775
782
  case "horizontal": {
776
783
  c.x <= r.x && (o = s, r = c);
@@ -787,16 +794,16 @@ function tt(e, t, n) {
787
794
  hitRegion: o
788
795
  } : void 0;
789
796
  }
790
- let Q;
791
- function nt() {
792
- return Q === void 0 && (typeof matchMedia == "function" ? Q = !!matchMedia("(pointer:coarse)").matches : Q = !1), Q;
797
+ let J;
798
+ function ot() {
799
+ return J === void 0 && (typeof matchMedia == "function" ? J = !!matchMedia("(pointer:coarse)").matches : J = !1), J;
793
800
  }
794
- function Ie(e, t) {
801
+ function Oe(e, t) {
795
802
  const n = [];
796
803
  return t.forEach((o, r) => {
797
804
  if (r.disabled)
798
805
  return;
799
- const s = nt() ? me.coarse : me.precise, c = we(r), i = tt(r.orientation, c, {
806
+ const s = ot() ? he.coarse : he.precise, c = Pe(r), i = nt(r.orientation, c, {
800
807
  x: e.clientX,
801
808
  y: e.clientY
802
809
  });
@@ -806,7 +813,7 @@ function Ie(e, t) {
806
813
  function ge(e) {
807
814
  if (e.defaultPrevented)
808
815
  return;
809
- const { mountedGroups: t } = O(), n = Ie(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
816
+ const { mountedGroups: t } = O(), n = Oe(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
810
817
  let i = !1;
811
818
  n.forEach((a) => {
812
819
  o.add(a.group), a.panels.forEach((f) => {
@@ -823,7 +830,7 @@ function ge(e) {
823
830
  }
824
831
  }), n.length && e.preventDefault();
825
832
  }
826
- function ye(e) {
833
+ function Se(e) {
827
834
  if (e.defaultPrevented)
828
835
  return;
829
836
  const { interactionState: t, mountedGroups: n } = O();
@@ -843,7 +850,7 @@ function ye(e) {
843
850
  );
844
851
  return;
845
852
  }
846
- Ce({
853
+ Ge({
847
854
  event: e,
848
855
  hitRegions: t.hitRegions,
849
856
  initialLayoutMap: t.initialLayoutMap,
@@ -853,7 +860,7 @@ function ye(e) {
853
860
  break;
854
861
  }
855
862
  default: {
856
- const o = Ie(e, n);
863
+ const o = Oe(e, n);
857
864
  o.length === 0 ? t.state !== "inactive" && C({
858
865
  interactionState: { state: "inactive" }
859
866
  }) : C({
@@ -866,7 +873,7 @@ function ye(e) {
866
873
  }
867
874
  }
868
875
  }
869
- function Se(e) {
876
+ function xe(e) {
870
877
  if (e.defaultPrevented)
871
878
  return;
872
879
  e.preventDefault();
@@ -881,7 +888,7 @@ function Se(e) {
881
888
  }), le();
882
889
  }
883
890
  }
884
- function ot(e) {
891
+ function it(e) {
885
892
  let t = 0, n = 0;
886
893
  const o = {};
887
894
  for (const s of e)
@@ -899,14 +906,14 @@ function ot(e) {
899
906
  }
900
907
  return o;
901
908
  }
902
- function it(e, t, n) {
909
+ function st(e, t, n) {
903
910
  const o = n[0];
904
911
  if (!o)
905
912
  return;
906
913
  const r = e.panels.find((c) => c.element === t);
907
914
  if (!r || !r.onResize)
908
915
  return;
909
- const s = te({ group: e });
916
+ const s = ee({ group: e });
910
917
  r.onResize(
911
918
  {
912
919
  asPercentage: I(
@@ -917,32 +924,32 @@ function it(e, t, n) {
917
924
  r.id
918
925
  );
919
926
  }
920
- function st(e) {
927
+ function rt(e) {
921
928
  let t = !0;
922
929
  z(
923
930
  e.separators.length === 0 || e.separators.length < e.panels.length,
924
931
  "Invalid Group configuration; too many Separator components"
925
932
  );
926
933
  const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((u) => {
927
- for (const m of u) {
928
- const { borderBoxSize: g, target: d } = m;
934
+ for (const h of u) {
935
+ const { borderBoxSize: y, target: d } = h;
929
936
  d === e.element ? t && C((p) => {
930
- const h = p.mountedGroups.get(e);
931
- if (h) {
932
- const v = pe(e), x = h.layout, S = $({
937
+ const v = p.mountedGroups.get(e);
938
+ if (v) {
939
+ const m = me(e), x = v.layout, S = $({
933
940
  layout: x,
934
- panelConstraints: v
941
+ panelConstraints: m
935
942
  });
936
943
  return {
937
944
  mountedGroups: new Map(p.mountedGroups).set(e, {
938
- derivedPanelConstraints: v,
945
+ derivedPanelConstraints: m,
939
946
  layout: S,
940
- separatorToPanels: h.separatorToPanels
947
+ separatorToPanels: v.separatorToPanels
941
948
  })
942
949
  };
943
950
  }
944
951
  return p;
945
- }) : it(e, d, g);
952
+ }) : st(e, d, y);
946
953
  }
947
954
  });
948
955
  r.observe(e.element), e.panels.forEach((u) => {
@@ -951,44 +958,44 @@ function st(e) {
951
958
  `Panel ids must be unique; id "${u.id}" was used more than once`
952
959
  ), n.add(u.id), u.onResize && r.observe(u.element);
953
960
  });
954
- const s = pe(e), c = e.panels.map(({ id: u }) => u).join(","), i = e.inMemoryLayouts[c] ?? e.defaultLayout ?? ot(s), a = $({
961
+ const s = me(e), c = e.panels.map(({ id: u }) => u).join(","), i = e.inMemoryLayouts[c] ?? e.defaultLayout ?? it(s), a = $({
955
962
  layout: i,
956
963
  panelConstraints: s
957
- }), l = we(e), f = C((u) => ({
964
+ }), l = Pe(e), f = C((u) => ({
958
965
  mountedGroups: new Map(u.mountedGroups).set(e, {
959
966
  derivedPanelConstraints: s,
960
967
  layout: a,
961
968
  separatorToPanels: new Map(
962
- l.filter((m) => m.separator).map((m) => [m.separator, m.panels])
969
+ l.filter((h) => h.separator).map((h) => [h.separator, h.panels])
963
970
  )
964
971
  })
965
972
  }));
966
- return e.element.addEventListener("pointerleave", he), e.separators.forEach((u) => {
973
+ return e.element.addEventListener("pointerleave", ve), e.separators.forEach((u) => {
967
974
  z(
968
975
  !o.has(u.id),
969
976
  `Separator ids must be unique; id "${u.id}" was used more than once`
970
- ), o.add(u.id), u.element.addEventListener("keydown", ve);
971
- }), f.mountedGroups.size === 1 && (window.addEventListener("pointerdown", ge), window.addEventListener("pointermove", ye), window.addEventListener("pointerup", Se)), function() {
977
+ ), o.add(u.id), u.element.addEventListener("keydown", ye);
978
+ }), f.mountedGroups.size === 1 && (window.addEventListener("pointerdown", ge), window.addEventListener("pointermove", Se), window.addEventListener("pointerup", xe)), function() {
972
979
  t = !1;
973
- const m = C((g) => {
974
- const d = new Map(g.mountedGroups);
980
+ const h = C((y) => {
981
+ const d = new Map(y.mountedGroups);
975
982
  return d.delete(e), { mountedGroups: d };
976
983
  });
977
- e.element.removeEventListener("pointerleave", he), e.separators.forEach((g) => {
978
- g.element.removeEventListener("keydown", ve);
979
- }), m.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", ge), window.removeEventListener("pointermove", ye), window.removeEventListener("pointerup", Se)), r.disconnect();
984
+ e.element.removeEventListener("pointerleave", ve), e.separators.forEach((y) => {
985
+ y.element.removeEventListener("keydown", ye);
986
+ }), h.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", ge), window.removeEventListener("pointermove", Se), window.removeEventListener("pointerup", xe)), r.disconnect();
980
987
  };
981
988
  }
982
989
  function ce(e) {
983
- const t = $e();
990
+ const t = _e();
984
991
  return `${e ?? t}`;
985
992
  }
986
- const H = typeof window < "u" ? Ne : _e;
993
+ const H = typeof window < "u" ? Fe : He;
987
994
  function ue(e) {
988
995
  const t = T(e);
989
996
  return H(() => {
990
997
  t.current = e;
991
- }, [e]), xe((n) => t.current?.(n), [t]);
998
+ }, [e]), ze((n) => t.current?.(n), [t]);
992
999
  }
993
1000
  function fe(...e) {
994
1001
  return ue((t) => {
@@ -1007,25 +1014,40 @@ function fe(...e) {
1007
1014
  });
1008
1015
  });
1009
1016
  }
1010
- const ke = "--react-resizable-panels--panel--pointer-events";
1011
- function Oe(e, t) {
1017
+ const Te = "--react-resizable-panels--panel--pointer-events";
1018
+ function De(e, t) {
1012
1019
  const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
1013
1020
  return `--react-resizable-panels--${n}--${o}`;
1014
1021
  }
1015
- const Te = Fe(null);
1016
- function rt(e, t) {
1022
+ const Ae = We(null);
1023
+ function at(e, t) {
1017
1024
  const n = T({
1018
1025
  getLayout: () => ({}),
1019
- setLayout: Ze
1026
+ setLayout: Je
1020
1027
  });
1021
- ze(t, () => n.current, []), H(() => {
1028
+ be(t, () => n.current, []), H(() => {
1022
1029
  Object.assign(
1023
1030
  n.current,
1024
- Me({ groupId: e })
1031
+ Ie({ groupId: e })
1025
1032
  );
1026
1033
  });
1027
1034
  }
1028
- function ht({
1035
+ function lt(e) {
1036
+ return we(
1037
+ (t) => (e?.addEventListener(
1038
+ "contentvisibilityautostatechange",
1039
+ t
1040
+ ), () => {
1041
+ e?.removeEventListener(
1042
+ "contentvisibilityautostatechange",
1043
+ t
1044
+ );
1045
+ }),
1046
+ () => typeof e?.checkVisibility == "function" ? e.checkVisibility() : !0,
1047
+ () => !0
1048
+ );
1049
+ }
1050
+ function yt({
1029
1051
  children: e,
1030
1052
  className: t,
1031
1053
  defaultLayout: n,
@@ -1039,21 +1061,21 @@ function ht({
1039
1061
  style: f,
1040
1062
  ...u
1041
1063
  }) {
1042
- const m = T({}), g = ue((b) => {
1043
- U(m.current, b) || (m.current = b, a?.(b));
1044
- }), d = ce(i), [p, h] = G(!1), [v, x] = G(null), [S, y] = G(n ?? {}), [L, P] = G([]), [E, K] = G([]), ne = T({}), V = T({}), X = fe(x, s);
1045
- rt(d, c);
1046
- const Y = be(
1064
+ const h = T({}), y = ue((b) => {
1065
+ B(h.current, b) || (h.current = b, a?.(b));
1066
+ }), d = ce(i), [p, v] = G(!1), [m, x] = G(null), [S, g] = G(n ?? {}), [L, P] = G([]), [E, U] = G([]), te = lt(m), K = T({}), X = T({}), Y = fe(x, s);
1067
+ at(d, c);
1068
+ const ne = Le(
1047
1069
  () => ({
1048
1070
  id: d,
1049
1071
  orientation: l,
1050
1072
  registerPanel: (b) => (P((M) => re(l, [...M, b])), () => {
1051
1073
  P((M) => M.filter((N) => N !== b));
1052
1074
  }),
1053
- registerSeparator: (b) => (K(
1075
+ registerSeparator: (b) => (U(
1054
1076
  (M) => re(l, [...M, b])
1055
1077
  ), () => {
1056
- K(
1078
+ U(
1057
1079
  (M) => M.filter((N) => N !== b)
1058
1080
  );
1059
1081
  })
@@ -1061,68 +1083,69 @@ function ht({
1061
1083
  [d, l]
1062
1084
  );
1063
1085
  H(() => {
1064
- if (v !== null && L.length > 0) {
1065
- const b = {
1066
- defaultLayout: n,
1067
- disableCursor: !!o,
1068
- disabled: !!r,
1069
- element: v,
1070
- id: d,
1071
- inMemoryLastExpandedPanelSizes: ne.current,
1072
- inMemoryLayouts: V.current,
1073
- orientation: l,
1074
- panels: L,
1075
- separators: E
1076
- }, M = st(b), oe = O().mountedGroups.get(b);
1077
- oe && (y(oe.layout), g?.(oe.layout));
1078
- const De = A.addListener(
1079
- "interactionStateChange",
1080
- (Z) => {
1081
- switch (Z.state) {
1082
- case "active": {
1083
- h(
1084
- Z.hitRegions.some(
1085
- (_) => _.group === b
1086
- )
1087
- );
1088
- break;
1089
- }
1090
- default: {
1091
- h(!1);
1092
- break;
1093
- }
1086
+ if (m === null || L.length === 0)
1087
+ return;
1088
+ const b = {
1089
+ defaultLayout: n,
1090
+ disableCursor: !!o,
1091
+ disabled: !!r,
1092
+ element: m,
1093
+ id: d,
1094
+ inMemoryLastExpandedPanelSizes: K.current,
1095
+ inMemoryLayouts: X.current,
1096
+ orientation: l,
1097
+ panels: L,
1098
+ separators: E
1099
+ }, M = rt(b), oe = O().mountedGroups.get(b);
1100
+ oe && (g(oe.layout), y?.(oe.layout));
1101
+ const $e = A.addListener(
1102
+ "interactionStateChange",
1103
+ (q) => {
1104
+ switch (q.state) {
1105
+ case "active": {
1106
+ v(
1107
+ q.hitRegions.some(
1108
+ (_) => _.group === b
1109
+ )
1110
+ );
1111
+ break;
1112
+ }
1113
+ default: {
1114
+ v(!1);
1115
+ break;
1094
1116
  }
1095
1117
  }
1096
- ), Ae = A.addListener(
1097
- "mountedGroupsChange",
1098
- (Z) => {
1099
- const _ = Z.get(b);
1100
- _ && _.derivedPanelConstraints.length > 0 && (y(_.layout), g?.(_.layout));
1101
- }
1102
- );
1103
- return () => {
1104
- M(), De(), Ae();
1105
- };
1106
- }
1118
+ }
1119
+ ), Ne = A.addListener(
1120
+ "mountedGroupsChange",
1121
+ (q) => {
1122
+ const _ = q.get(b);
1123
+ _ && _.derivedPanelConstraints.length > 0 && (g(_.layout), y?.(_.layout));
1124
+ }
1125
+ );
1126
+ return () => {
1127
+ M(), $e(), Ne();
1128
+ };
1107
1129
  }, [
1108
1130
  n,
1109
1131
  o,
1110
1132
  r,
1111
- v,
1133
+ m,
1112
1134
  d,
1113
- g,
1135
+ te,
1136
+ y,
1114
1137
  l,
1115
1138
  L,
1116
1139
  E
1117
1140
  ]);
1118
- const q = {
1119
- [ke]: p ? "none" : void 0
1141
+ const pe = {
1142
+ [Te]: p ? "none" : void 0
1120
1143
  };
1121
1144
  for (const b in S) {
1122
- const M = Oe(d, b), N = S[b];
1123
- q[M] = N;
1145
+ const M = De(d, b), N = S[b];
1146
+ pe[M] = N;
1124
1147
  }
1125
- return /* @__PURE__ */ W(Te.Provider, { value: Y, children: /* @__PURE__ */ W(
1148
+ return /* @__PURE__ */ W(Ae.Provider, { value: ne, children: /* @__PURE__ */ W(
1126
1149
  "div",
1127
1150
  {
1128
1151
  ...u,
@@ -1131,10 +1154,11 @@ function ht({
1131
1154
  "data-group": !0,
1132
1155
  "data-testid": d,
1133
1156
  id: d,
1134
- ref: X,
1157
+ ref: Y,
1135
1158
  style: {
1136
1159
  ...f,
1137
- ...q,
1160
+ ...pe,
1161
+ contentVisibility: "auto",
1138
1162
  display: "flex",
1139
1163
  flexDirection: l === "horizontal" ? "row" : "column",
1140
1164
  flexWrap: "nowrap"
@@ -1146,7 +1170,7 @@ function ht({
1146
1170
  function ae(e) {
1147
1171
  return `react-resizable-panels:${e}`;
1148
1172
  }
1149
- function at({
1173
+ function ct({
1150
1174
  id: e,
1151
1175
  layout: t,
1152
1176
  storage: n
@@ -1158,19 +1182,19 @@ function at({
1158
1182
  console.error(o);
1159
1183
  }
1160
1184
  }
1161
- function vt({
1185
+ function gt({
1162
1186
  groupId: e,
1163
1187
  storage: t
1164
1188
  }) {
1165
- const n = He(
1166
- lt,
1189
+ const n = we(
1190
+ ut,
1167
1191
  () => t.getItem(ae(e)),
1168
1192
  () => t.getItem(ae(e))
1169
- ), o = be(
1193
+ ), o = Le(
1170
1194
  () => n ? JSON.parse(n) : void 0,
1171
1195
  [n]
1172
- ), r = xe(
1173
- (s) => at({
1196
+ ), r = ze(
1197
+ (s) => ct({
1174
1198
  id: e,
1175
1199
  layout: s,
1176
1200
  storage: t
@@ -1182,24 +1206,24 @@ function vt({
1182
1206
  onLayoutChange: r
1183
1207
  };
1184
1208
  }
1185
- function lt() {
1209
+ function ut() {
1186
1210
  return function() {
1187
1211
  };
1188
1212
  }
1189
- function gt() {
1213
+ function St() {
1190
1214
  return G(null);
1191
1215
  }
1192
- function yt() {
1216
+ function xt() {
1193
1217
  return T(null);
1194
1218
  }
1195
1219
  function de() {
1196
- const e = We(Te);
1220
+ const e = je(Ae);
1197
1221
  return z(
1198
1222
  e,
1199
1223
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1200
1224
  ), e;
1201
1225
  }
1202
- function ct({
1226
+ function ft({
1203
1227
  groupId: e,
1204
1228
  panelId: t
1205
1229
  }) {
@@ -1237,23 +1261,23 @@ function ct({
1237
1261
  derivedPanelConstraints: l,
1238
1262
  group: f,
1239
1263
  layout: u,
1240
- separatorToPanels: m
1241
- } = n(), g = f.panels.findIndex((v) => v.id === t), d = g === f.panels.length - 1, p = B({
1264
+ separatorToPanels: h
1265
+ } = n(), y = f.panels.findIndex((m) => m.id === t), d = y === f.panels.length - 1, p = V({
1242
1266
  delta: d ? a - i : i - a,
1243
1267
  initialLayout: u,
1244
1268
  panelConstraints: l,
1245
- pivotIndices: d ? [g - 1, g] : [g, g + 1],
1269
+ pivotIndices: d ? [y - 1, y] : [y, y + 1],
1246
1270
  prevLayout: u,
1247
1271
  trigger: "imperative-api"
1248
- }), h = $({
1272
+ }), v = $({
1249
1273
  layout: p,
1250
1274
  panelConstraints: l
1251
1275
  });
1252
- U(u, h) || C((v) => ({
1253
- mountedGroups: new Map(v.mountedGroups).set(f, {
1276
+ B(u, v) || C((m) => ({
1277
+ mountedGroups: new Map(m.mountedGroups).set(f, {
1254
1278
  derivedPanelConstraints: l,
1255
- layout: h,
1256
- separatorToPanels: m
1279
+ layout: v,
1280
+ separatorToPanels: h
1257
1281
  })
1258
1282
  }));
1259
1283
  };
@@ -1282,7 +1306,7 @@ function ct({
1282
1306
  let l;
1283
1307
  switch (typeof i) {
1284
1308
  case "number": {
1285
- const { group: f } = n(), u = te({ group: f });
1309
+ const { group: f } = n(), u = ee({ group: f });
1286
1310
  l = I(i / u * 100);
1287
1311
  break;
1288
1312
  }
@@ -1296,7 +1320,7 @@ function ct({
1296
1320
  }
1297
1321
  };
1298
1322
  }
1299
- function ut(e, t) {
1323
+ function dt(e, t) {
1300
1324
  const { id: n } = de(), o = T({
1301
1325
  collapse: ie,
1302
1326
  expand: ie,
@@ -1307,14 +1331,14 @@ function ut(e, t) {
1307
1331
  isCollapsed: () => !1,
1308
1332
  resize: ie
1309
1333
  });
1310
- ze(t, () => o.current, []), H(() => {
1334
+ be(t, () => o.current, []), H(() => {
1311
1335
  Object.assign(
1312
1336
  o.current,
1313
- ct({ groupId: n, panelId: e })
1337
+ ft({ groupId: n, panelId: e })
1314
1338
  );
1315
1339
  });
1316
1340
  }
1317
- function St({
1341
+ function zt({
1318
1342
  children: e,
1319
1343
  className: t,
1320
1344
  collapsedSize: n = "0%",
@@ -1327,9 +1351,9 @@ function St({
1327
1351
  onResize: l,
1328
1352
  panelRef: f,
1329
1353
  style: u,
1330
- ...m
1354
+ ...h
1331
1355
  }) {
1332
- const g = !!c, d = ce(c), [p, h] = G(null), v = fe(h, s), { id: x, registerPanel: S } = de(), y = l !== null, L = ue((E) => {
1356
+ const y = !!c, d = ce(c), [p, v] = G(null), m = fe(v, s), { id: x, registerPanel: S } = de(), g = l !== null, L = ue((E) => {
1333
1357
  l?.(E, c);
1334
1358
  });
1335
1359
  H(() => {
@@ -1337,8 +1361,8 @@ function St({
1337
1361
  return S({
1338
1362
  element: p,
1339
1363
  id: d,
1340
- idIsStable: g,
1341
- onResize: y ? L : void 0,
1364
+ idIsStable: y,
1365
+ onResize: g ? L : void 0,
1342
1366
  panelConstraints: {
1343
1367
  collapsedSize: n,
1344
1368
  collapsible: o,
@@ -1352,25 +1376,25 @@ function St({
1352
1376
  o,
1353
1377
  r,
1354
1378
  p,
1355
- y,
1356
- d,
1357
1379
  g,
1380
+ d,
1381
+ y,
1358
1382
  i,
1359
1383
  a,
1360
1384
  L,
1361
1385
  S
1362
- ]), ut(d, f);
1363
- const P = Oe(x, d);
1386
+ ]), dt(d, f);
1387
+ const P = De(x, d);
1364
1388
  return /* @__PURE__ */ W(
1365
1389
  "div",
1366
1390
  {
1367
- ...m,
1391
+ ...h,
1368
1392
  "data-panel": !0,
1369
1393
  "data-testid": d,
1370
1394
  id: d,
1371
- ref: v,
1395
+ ref: m,
1372
1396
  style: {
1373
- ...ft,
1397
+ ...pt,
1374
1398
  flexBasis: 0,
1375
1399
  flexGrow: `var(${P}, 1)`,
1376
1400
  flexShrink: 1,
@@ -1378,7 +1402,7 @@ function St({
1378
1402
  overflow: "hidden",
1379
1403
  // Disable pointer events inside of a panel during resize
1380
1404
  // This avoid edge cases like nested iframes
1381
- pointerEvents: `var(${ke})`
1405
+ pointerEvents: `var(${Te})`
1382
1406
  },
1383
1407
  children: /* @__PURE__ */ W(
1384
1408
  "div",
@@ -1395,7 +1419,7 @@ function St({
1395
1419
  }
1396
1420
  );
1397
1421
  }
1398
- const ft = {
1422
+ const pt = {
1399
1423
  minHeight: "unset",
1400
1424
  maxHeight: "unset",
1401
1425
  height: "unset",
@@ -1411,13 +1435,13 @@ const ft = {
1411
1435
  padding: "unset",
1412
1436
  margin: "unset"
1413
1437
  };
1414
- function xt() {
1438
+ function bt() {
1415
1439
  return G(null);
1416
1440
  }
1417
- function zt() {
1441
+ function wt() {
1418
1442
  return T(null);
1419
1443
  }
1420
- function dt({
1444
+ function mt({
1421
1445
  layout: e,
1422
1446
  panelConstraints: t,
1423
1447
  panelId: n,
@@ -1430,7 +1454,7 @@ function dt({
1430
1454
  if (i) {
1431
1455
  const a = i.maxSize, l = s = i.collapsible ? i.collapsedSize : i.minSize, f = [o, o + 1];
1432
1456
  s = $({
1433
- layout: B({
1457
+ layout: V({
1434
1458
  delta: l - c,
1435
1459
  initialLayout: e,
1436
1460
  panelConstraints: t,
@@ -1440,7 +1464,7 @@ function dt({
1440
1464
  }),
1441
1465
  panelConstraints: t
1442
1466
  })[n], r = $({
1443
- layout: B({
1467
+ layout: V({
1444
1468
  delta: a - c,
1445
1469
  initialLayout: e,
1446
1470
  panelConstraints: t,
@@ -1458,7 +1482,7 @@ function dt({
1458
1482
  valueNow: c
1459
1483
  };
1460
1484
  }
1461
- function bt({
1485
+ function Lt({
1462
1486
  children: e,
1463
1487
  className: t,
1464
1488
  elementRef: n,
@@ -1466,17 +1490,17 @@ function bt({
1466
1490
  style: r,
1467
1491
  ...s
1468
1492
  }) {
1469
- const c = ce(o), [i, a] = G({}), [l, f] = G("inactive"), [u, m] = G(null), g = fe(m, n), {
1493
+ const c = ce(o), [i, a] = G({}), [l, f] = G("inactive"), [u, h] = G(null), y = fe(h, n), {
1470
1494
  id: d,
1471
1495
  orientation: p,
1472
- registerSeparator: h
1473
- } = de(), v = p === "horizontal" ? "vertical" : "horizontal";
1496
+ registerSeparator: v
1497
+ } = de(), m = p === "horizontal" ? "vertical" : "horizontal";
1474
1498
  return H(() => {
1475
1499
  if (u !== null) {
1476
1500
  const x = {
1477
1501
  element: u,
1478
1502
  id: c
1479
- }, S = h(x), y = A.addListener(
1503
+ }, S = v(x), g = A.addListener(
1480
1504
  "interactionStateChange",
1481
1505
  (P) => {
1482
1506
  f(
@@ -1489,17 +1513,17 @@ function bt({
1489
1513
  "mountedGroupsChange",
1490
1514
  (P) => {
1491
1515
  P.forEach(
1492
- ({ derivedPanelConstraints: E, layout: K, separatorToPanels: ne }, V) => {
1493
- if (V.id === d) {
1494
- const X = ne.get(x);
1516
+ ({ derivedPanelConstraints: E, layout: U, separatorToPanels: te }, K) => {
1517
+ if (K.id === d) {
1518
+ const X = te.get(x);
1495
1519
  if (X) {
1496
- const Y = X[0], q = V.panels.indexOf(Y);
1520
+ const Y = X[0], ne = K.panels.indexOf(Y);
1497
1521
  a(
1498
- dt({
1499
- layout: K,
1522
+ mt({
1523
+ layout: U,
1500
1524
  panelConstraints: E,
1501
1525
  panelId: Y.id,
1502
- panelIndex: q
1526
+ panelIndex: ne
1503
1527
  })
1504
1528
  );
1505
1529
  }
@@ -1509,15 +1533,15 @@ function bt({
1509
1533
  }
1510
1534
  );
1511
1535
  return () => {
1512
- y(), L(), S();
1536
+ g(), L(), S();
1513
1537
  };
1514
1538
  }
1515
- }, [u, d, c, h]), /* @__PURE__ */ W(
1539
+ }, [u, d, c, v]), /* @__PURE__ */ W(
1516
1540
  "div",
1517
1541
  {
1518
1542
  ...s,
1519
1543
  "aria-controls": i.valueControls,
1520
- "aria-orientation": v,
1544
+ "aria-orientation": m,
1521
1545
  "aria-valuemax": i.valueMax,
1522
1546
  "aria-valuemin": i.valueMin,
1523
1547
  "aria-valuenow": i.valueNow,
@@ -1526,7 +1550,7 @@ function bt({
1526
1550
  "data-separator": l,
1527
1551
  "data-testid": c,
1528
1552
  id: c,
1529
- ref: g,
1553
+ ref: y,
1530
1554
  role: "separator",
1531
1555
  style: {
1532
1556
  flexBasis: "auto",
@@ -1539,13 +1563,13 @@ function bt({
1539
1563
  );
1540
1564
  }
1541
1565
  export {
1542
- ht as Group,
1543
- St as Panel,
1544
- bt as Separator,
1545
- vt as useDefaultLayout,
1546
- gt as useGroupCallbackRef,
1547
- yt as useGroupRef,
1548
- xt as usePanelCallbackRef,
1549
- zt as usePanelRef
1566
+ yt as Group,
1567
+ zt as Panel,
1568
+ Lt as Separator,
1569
+ gt as useDefaultLayout,
1570
+ St as useGroupCallbackRef,
1571
+ xt as useGroupRef,
1572
+ bt as usePanelCallbackRef,
1573
+ wt as usePanelRef
1550
1574
  };
1551
1575
  //# sourceMappingURL=react-resizable-panels.js.map