react-resizable-panels 4.5.2 → 4.5.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,11 +1,11 @@
1
1
  "use client";
2
- import { jsx as q } from "react/jsx-runtime";
3
- import { useState as Y, useCallback as K, useId as tt, useLayoutEffect as Te, useEffect as Oe, useRef as k, createContext as nt, useImperativeHandle as _e, useMemo as Ae, useSyncExternalStore as ot, useContext as it } from "react";
2
+ import { jsx as Y } from "react/jsx-runtime";
3
+ import { useState as Z, useCallback as X, useId as tt, useLayoutEffect as Te, useEffect as Oe, useRef as k, createContext as nt, useImperativeHandle as _e, useMemo as Ae, useSyncExternalStore as ot, useContext as it } from "react";
4
4
  function x(e, t = "Assertion error") {
5
5
  if (!e)
6
6
  throw Error(t);
7
7
  }
8
- function U({
8
+ function W({
9
9
  group: e
10
10
  }) {
11
11
  const { orientation: t, panels: n } = e;
@@ -143,7 +143,7 @@ function $e(e) {
143
143
  }
144
144
  l.push({
145
145
  group: e,
146
- groupSize: U({ group: e }),
146
+ groupSize: W({ group: e }),
147
147
  panels: [a, h],
148
148
  separator: "width" in d ? void 0 : d,
149
149
  rect: p
@@ -224,7 +224,7 @@ function D(e) {
224
224
  return parseFloat(e.toFixed(3));
225
225
  }
226
226
  function ve(e) {
227
- const { panels: t } = e, n = U({ group: e });
227
+ const { panels: t } = e, n = W({ group: e });
228
228
  return n === 0 ? t.map((o) => ({
229
229
  collapsedSize: 0,
230
230
  collapsible: o.panelConstraints.collapsible === !0,
@@ -329,7 +329,7 @@ let I = {
329
329
  },
330
330
  mountedGroups: /* @__PURE__ */ new Map()
331
331
  };
332
- const A = new ht();
332
+ const N = new ht();
333
333
  function G() {
334
334
  return I;
335
335
  }
@@ -341,7 +341,7 @@ function M(e) {
341
341
  return I = {
342
342
  ...I,
343
343
  ...t
344
- }, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
344
+ }, t.cursorFlags !== void 0 && N.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && N.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
345
345
  o.derivedPanelConstraints.forEach((s) => {
346
346
  if (s.collapsible) {
347
347
  const { layout: l } = n.mountedGroups.get(i) ?? {};
@@ -357,7 +357,7 @@ function M(e) {
357
357
  }
358
358
  }
359
359
  });
360
- }), A.emit("mountedGroupsChange", I.mountedGroups)), I;
360
+ }), N.emit("mountedGroupsChange", I.mountedGroups)), I;
361
361
  }
362
362
  function mt(e, t, n) {
363
363
  let o, i = {
@@ -388,8 +388,8 @@ function gt(e) {
388
388
  function yt(e, t) {
389
389
  if (e === t) throw new Error("Cannot compare node with itself");
390
390
  const n = {
391
- a: be(e),
392
- b: be(t)
391
+ a: we(e),
392
+ b: we(t)
393
393
  };
394
394
  let o;
395
395
  for (; n.a.at(-1) === n.b.at(-1); )
@@ -436,7 +436,7 @@ function ze(e) {
436
436
  function xe(e) {
437
437
  return e && Number(getComputedStyle(e).zIndex) || 0;
438
438
  }
439
- function be(e) {
439
+ function we(e) {
440
440
  const t = [];
441
441
  for (; e; )
442
442
  t.push(e), e = He(e);
@@ -449,7 +449,7 @@ function He(e) {
449
449
  function xt(e, t) {
450
450
  return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
451
451
  }
452
- function bt({
452
+ function wt({
453
453
  groupElement: e,
454
454
  hitRegion: t,
455
455
  pointerEventTarget: n
@@ -477,14 +477,14 @@ function pe(e, t) {
477
477
  x: e.clientX,
478
478
  y: e.clientY
479
479
  });
480
- l && l.distance.x <= 0 && l.distance.y <= 0 && bt({
480
+ l && l.distance.x <= 0 && l.distance.y <= 0 && wt({
481
481
  groupElement: i.element,
482
482
  hitRegion: l.hitRegion.rect,
483
483
  pointerEventTarget: e.target
484
484
  }) && n.push(l.hitRegion);
485
485
  }), n;
486
486
  }
487
- function wt(e, t) {
487
+ function bt(e, t) {
488
488
  if (e.length !== t.length)
489
489
  return !1;
490
490
  for (let n = 0; n < e.length; n++)
@@ -492,10 +492,10 @@ function wt(e, t) {
492
492
  return !1;
493
493
  return !0;
494
494
  }
495
- function Z(e, t) {
495
+ function O(e, t) {
496
496
  return R(e, t) ? 0 : e > t ? 1 : -1;
497
497
  }
498
- function V({
498
+ function U({
499
499
  panelConstraints: e,
500
500
  size: t
501
501
  }) {
@@ -505,10 +505,10 @@ function V({
505
505
  maxSize: i = 100,
506
506
  minSize: s = 0
507
507
  } = e;
508
- if (Z(t, s) < 0)
508
+ if (O(t, s) < 0)
509
509
  if (o) {
510
510
  const l = (n + s) / 2;
511
- Z(t, l) < 0 ? t = n : t = s;
511
+ O(t, l) < 0 ? t = n : t = s;
512
512
  } else
513
513
  t = s;
514
514
  return t = Math.min(i, t), t = D(t), t;
@@ -526,50 +526,70 @@ function J({
526
526
  const l = Object.values(t), r = Object.values(i), a = [...l], [u, c] = o;
527
527
  x(u != null, "Invalid first pivot index"), x(c != null, "Invalid second pivot index");
528
528
  let h = 0;
529
- if (s === "keyboard") {
530
- {
531
- const f = e < 0 ? c : u, d = n[f];
532
- x(
533
- d,
534
- `Panel constraints not found for index ${f}`
535
- );
536
- const {
537
- collapsedSize: p = 0,
538
- collapsible: g,
539
- minSize: v = 0
540
- } = d;
541
- if (g) {
542
- const z = l[f];
543
- if (x(
544
- z != null,
545
- `Previous layout not found for panel index ${f}`
546
- ), R(z, p)) {
547
- const S = v - z;
548
- Z(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
529
+ switch (s) {
530
+ case "keyboard": {
531
+ {
532
+ const f = e < 0 ? c : u, d = n[f];
533
+ x(
534
+ d,
535
+ `Panel constraints not found for index ${f}`
536
+ );
537
+ const {
538
+ collapsedSize: p = 0,
539
+ collapsible: g,
540
+ minSize: v = 0
541
+ } = d;
542
+ if (g) {
543
+ const z = l[f];
544
+ if (x(
545
+ z != null,
546
+ `Previous layout not found for panel index ${f}`
547
+ ), R(z, p)) {
548
+ const S = v - z;
549
+ O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
550
+ }
549
551
  }
550
552
  }
553
+ {
554
+ const f = e < 0 ? u : c, d = n[f];
555
+ x(
556
+ d,
557
+ `No panel constraints found for index ${f}`
558
+ );
559
+ const {
560
+ collapsedSize: p = 0,
561
+ collapsible: g,
562
+ minSize: v = 0
563
+ } = d;
564
+ if (g) {
565
+ const z = l[f];
566
+ if (x(
567
+ z != null,
568
+ `Previous layout not found for panel index ${f}`
569
+ ), R(z, v)) {
570
+ const S = z - p;
571
+ O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
572
+ }
573
+ }
574
+ }
575
+ break;
551
576
  }
552
- {
553
- const f = e < 0 ? u : c, d = n[f];
577
+ default: {
578
+ const f = e < 0 ? c : u, d = n[f];
554
579
  x(
555
580
  d,
556
- `No panel constraints found for index ${f}`
581
+ `Panel constraints not found for index ${f}`
557
582
  );
558
- const {
559
- collapsedSize: p = 0,
560
- collapsible: g,
561
- minSize: v = 0
562
- } = d;
563
- if (g) {
564
- const z = l[f];
565
- if (x(
566
- z != null,
567
- `Previous layout not found for panel index ${f}`
568
- ), R(z, v)) {
569
- const S = z - p;
570
- Z(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
583
+ const { collapsible: p, collapsedSize: g, minSize: v } = d;
584
+ if (p)
585
+ if (e > 0) {
586
+ const z = v - g, S = z / 2;
587
+ O(e, v) < 0 && (e = O(e, S) <= 0 ? 0 : z);
588
+ } else {
589
+ const z = v - g, S = 100 - z / 2;
590
+ O(100 + e, v) > 0 && (e = O(100 + e, S) > 0 ? 0 : -z);
571
591
  }
572
- }
592
+ break;
573
593
  }
574
594
  }
575
595
  {
@@ -581,7 +601,7 @@ function J({
581
601
  v != null,
582
602
  `Previous layout not found for panel index ${d}`
583
603
  );
584
- const S = V({
604
+ const S = U({
585
605
  panelConstraints: n[d],
586
606
  size: 100
587
607
  }) - v;
@@ -599,7 +619,7 @@ function J({
599
619
  g != null,
600
620
  `Previous layout not found for panel index ${d}`
601
621
  );
602
- const v = g - p, z = V({
622
+ const v = g - p, z = U({
603
623
  panelConstraints: n[d],
604
624
  size: v
605
625
  });
@@ -610,7 +630,7 @@ function J({
610
630
  e < 0 ? d-- : d++;
611
631
  }
612
632
  }
613
- if (wt(r, a))
633
+ if (bt(r, a))
614
634
  return i;
615
635
  {
616
636
  const f = e < 0 ? c : u, d = l[f];
@@ -618,23 +638,23 @@ function J({
618
638
  d != null,
619
639
  `Previous layout not found for panel index ${f}`
620
640
  );
621
- const p = d + h, g = V({
641
+ const p = d + h, g = U({
622
642
  panelConstraints: n[f],
623
643
  size: p
624
644
  });
625
645
  if (a[f] = g, !R(g, p)) {
626
646
  let v = p - g, S = e < 0 ? c : u;
627
647
  for (; S >= 0 && S < n.length; ) {
628
- const w = a[S];
648
+ const b = a[S];
629
649
  x(
630
- w != null,
650
+ b != null,
631
651
  `Previous layout not found for panel index ${S}`
632
652
  );
633
- const C = w + v, P = V({
653
+ const C = b + v, P = U({
634
654
  panelConstraints: n[S],
635
655
  size: C
636
656
  });
637
- if (R(w, P) || (v -= P - w, a[S] = P), R(v, 0))
657
+ if (R(b, P) || (v -= P - b, a[S] = P), R(v, 0))
638
658
  break;
639
659
  e > 0 ? S-- : S++;
640
660
  }
@@ -649,15 +669,15 @@ function J({
649
669
  const m = Object.keys(i);
650
670
  return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
651
671
  }
652
- function N(e, t) {
672
+ function F(e, t) {
653
673
  if (Object.keys(e).length !== Object.keys(t).length)
654
674
  return !1;
655
675
  for (const n in e)
656
- if (t[n] === void 0 || Z(e[n], t[n]) !== 0)
676
+ if (t[n] === void 0 || O(e[n], t[n]) !== 0)
657
677
  return !1;
658
678
  return !0;
659
679
  }
660
- function F({
680
+ function $({
661
681
  layout: e,
662
682
  panelConstraints: t
663
683
  }) {
@@ -680,7 +700,7 @@ function F({
680
700
  for (let r = 0; r < t.length; r++) {
681
701
  const a = o[r];
682
702
  x(a != null, `No layout data found for index ${r}`);
683
- const u = V({
703
+ const u = U({
684
704
  panelConstraints: t[r],
685
705
  size: a
686
706
  });
@@ -690,7 +710,7 @@ function F({
690
710
  for (let r = 0; r < t.length; r++) {
691
711
  const a = o[r];
692
712
  x(a != null, `No layout data found for index ${r}`);
693
- const u = a + s, c = V({
713
+ const u = a + s, c = U({
694
714
  panelConstraints: t[r],
695
715
  size: u
696
716
  });
@@ -758,11 +778,11 @@ function je({
758
778
  pivotIndices: d ? [f - 1, f] : [f, f + 1],
759
779
  prevLayout: y,
760
780
  trigger: "imperative-api"
761
- }), g = F({
781
+ }), g = $({
762
782
  layout: p,
763
783
  panelConstraints: c
764
784
  });
765
- N(y, g) || M((v) => ({
785
+ F(y, g) || M((v) => ({
766
786
  mountedGroups: new Map(v.mountedGroups).set(h, {
767
787
  defaultLayoutDeferred: u,
768
788
  derivedPanelConstraints: c,
@@ -799,7 +819,7 @@ function je({
799
819
  let u;
800
820
  switch (typeof r) {
801
821
  case "number": {
802
- const { group: c } = n(), h = U({ group: c });
822
+ const { group: c } = n(), h = W({ group: c });
803
823
  u = D(r / h * 100);
804
824
  break;
805
825
  }
@@ -813,7 +833,7 @@ function je({
813
833
  }
814
834
  };
815
835
  }
816
- function we(e) {
836
+ function be(e) {
817
837
  if (e.defaultPrevented)
818
838
  return;
819
839
  const { mountedGroups: t } = G();
@@ -863,11 +883,11 @@ function Ve({
863
883
  group: s,
864
884
  layout: l,
865
885
  separatorToPanels: r
866
- } = t(), a = F({
886
+ } = t(), a = $({
867
887
  layout: n,
868
888
  panelConstraints: i
869
889
  });
870
- return o ? l : (N(l, a) || M((u) => ({
890
+ return o ? l : (F(l, a) || M((u) => ({
871
891
  mountedGroups: new Map(u.mountedGroups).set(s, {
872
892
  defaultLayoutDeferred: o,
873
893
  derivedPanelConstraints: i,
@@ -882,7 +902,7 @@ function Ue(e) {
882
902
  const { mountedGroups: t } = G(), n = t.get(e);
883
903
  return x(n, `Mounted Group ${e.id} not found`), n;
884
904
  }
885
- function _(e, t) {
905
+ function A(e, t) {
886
906
  const n = ae(e), o = Ue(n), i = n.separators.find(
887
907
  (h) => h.element === e
888
908
  );
@@ -896,11 +916,11 @@ function _(e, t) {
896
916
  pivotIndices: l,
897
917
  prevLayout: a,
898
918
  trigger: "keyboard"
899
- }), c = F({
919
+ }), c = $({
900
920
  layout: u,
901
921
  panelConstraints: o.derivedPanelConstraints
902
922
  });
903
- N(a, c) || M((h) => ({
923
+ F(a, c) || M((h) => ({
904
924
  mountedGroups: new Map(h.mountedGroups).set(n, {
905
925
  defaultLayoutDeferred: o.defaultLayoutDeferred,
906
926
  derivedPanelConstraints: o.derivedPanelConstraints,
@@ -916,23 +936,23 @@ function Le(e) {
916
936
  if (!n.disabled)
917
937
  switch (e.key) {
918
938
  case "ArrowDown": {
919
- e.preventDefault(), n.orientation === "vertical" && _(t, 5);
939
+ e.preventDefault(), n.orientation === "vertical" && A(t, 5);
920
940
  break;
921
941
  }
922
942
  case "ArrowLeft": {
923
- e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
943
+ e.preventDefault(), n.orientation === "horizontal" && A(t, -5);
924
944
  break;
925
945
  }
926
946
  case "ArrowRight": {
927
- e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
947
+ e.preventDefault(), n.orientation === "horizontal" && A(t, 5);
928
948
  break;
929
949
  }
930
950
  case "ArrowUp": {
931
- e.preventDefault(), n.orientation === "vertical" && _(t, -5);
951
+ e.preventDefault(), n.orientation === "vertical" && A(t, -5);
932
952
  break;
933
953
  }
934
954
  case "End": {
935
- e.preventDefault(), _(t, 100);
955
+ e.preventDefault(), A(t, 100);
936
956
  break;
937
957
  }
938
958
  case "Enter": {
@@ -948,7 +968,7 @@ function Le(e) {
948
968
  );
949
969
  if (x(c, "Panel metadata not found"), c.collapsible) {
950
970
  const h = s[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
951
- _(t, y - h);
971
+ A(t, y - h);
952
972
  }
953
973
  break;
954
974
  }
@@ -965,7 +985,7 @@ function Le(e) {
965
985
  break;
966
986
  }
967
987
  case "Home": {
968
- e.preventDefault(), _(t, -100);
988
+ e.preventDefault(), A(t, -100);
969
989
  break;
970
990
  }
971
991
  }
@@ -1090,9 +1110,9 @@ function qe({
1090
1110
  defaultLayoutDeferred: v,
1091
1111
  derivedPanelConstraints: z,
1092
1112
  layout: S,
1093
- separatorToPanels: w
1113
+ separatorToPanels: b
1094
1114
  } = i.get(h) ?? { defaultLayoutDeferred: !1 };
1095
- if (z && g && S && w) {
1115
+ if (z && g && S && b) {
1096
1116
  const C = J({
1097
1117
  delta: p,
1098
1118
  initialLayout: g,
@@ -1101,7 +1121,7 @@ function qe({
1101
1121
  prevLayout: S,
1102
1122
  trigger: "mouse-or-touch"
1103
1123
  });
1104
- if (N(C, S)) {
1124
+ if (F(C, S)) {
1105
1125
  if (p !== 0 && !m)
1106
1126
  switch (f) {
1107
1127
  case "horizontal": {
@@ -1118,7 +1138,7 @@ function qe({
1118
1138
  defaultLayoutDeferred: v,
1119
1139
  derivedPanelConstraints: z,
1120
1140
  layout: C,
1121
- separatorToPanels: w
1141
+ separatorToPanels: b
1122
1142
  });
1123
1143
  const P = c.group.panels.map(({ id: T }) => T).join(",");
1124
1144
  c.group.inMemoryLayouts[P] = C;
@@ -1234,7 +1254,7 @@ function Pt(e, t, n) {
1234
1254
  const i = e.panels.find((u) => u.element === t);
1235
1255
  if (!i || !i.onResize)
1236
1256
  return;
1237
- const s = U({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
1257
+ const s = W({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
1238
1258
  asPercentage: D(l / s * 100),
1239
1259
  inPixels: l
1240
1260
  };
@@ -1257,7 +1277,7 @@ function Mt(e, t) {
1257
1277
  return !1;
1258
1278
  return !0;
1259
1279
  }
1260
- const j = /* @__PURE__ */ new Map();
1280
+ const V = /* @__PURE__ */ new Map();
1261
1281
  function Et(e) {
1262
1282
  let t = !0;
1263
1283
  x(
@@ -1269,22 +1289,22 @@ function Et(e) {
1269
1289
  const { borderBoxSize: p, target: g } = d;
1270
1290
  if (g === e.element) {
1271
1291
  if (t) {
1272
- if (U({ group: e }) === 0)
1292
+ if (W({ group: e }) === 0)
1273
1293
  return;
1274
1294
  M((z) => {
1275
1295
  const S = z.mountedGroups.get(e);
1276
1296
  if (S) {
1277
- const w = ve(e), C = S.defaultLayoutDeferred ? De(w) : S.layout, P = F({
1297
+ const b = ve(e), C = S.defaultLayoutDeferred ? De(b) : S.layout, P = $({
1278
1298
  layout: C,
1279
- panelConstraints: w
1299
+ panelConstraints: b
1280
1300
  });
1281
- return !S.defaultLayoutDeferred && N(C, P) && Rt(
1301
+ return !S.defaultLayoutDeferred && F(C, P) && Rt(
1282
1302
  S.derivedPanelConstraints,
1283
- w
1303
+ b
1284
1304
  ) ? z : {
1285
1305
  mountedGroups: new Map(z.mountedGroups).set(e, {
1286
1306
  defaultLayoutDeferred: !1,
1287
- derivedPanelConstraints: w,
1307
+ derivedPanelConstraints: b,
1288
1308
  layout: P,
1289
1309
  separatorToPanels: S.separatorToPanels
1290
1310
  })
@@ -1303,18 +1323,18 @@ function Et(e) {
1303
1323
  `Panel ids must be unique; id "${f.id}" was used more than once`
1304
1324
  ), o.add(f.id), f.onResize && s.observe(f.element);
1305
1325
  });
1306
- const l = U({ group: e }), r = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
1326
+ const l = W({ group: e }), r = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
1307
1327
  let u = e.defaultLayout;
1308
1328
  u && (Mt(e.panels, u) || (u = void 0));
1309
- const c = e.inMemoryLayouts[a] ?? u ?? De(r), h = F({
1329
+ const c = e.inMemoryLayouts[a] ?? u ?? De(r), h = $({
1310
1330
  layout: c,
1311
1331
  panelConstraints: r
1312
1332
  }), y = $e(e), m = e.element.ownerDocument;
1313
1333
  return M((f) => {
1314
1334
  const d = /* @__PURE__ */ new Map();
1315
- return j.set(
1335
+ return V.set(
1316
1336
  m,
1317
- (j.get(m) ?? 0) + 1
1337
+ (V.get(m) ?? 0) + 1
1318
1338
  ), y.forEach((p) => {
1319
1339
  p.separator && d.set(p.separator, p.panels);
1320
1340
  }), {
@@ -1330,18 +1350,18 @@ function Et(e) {
1330
1350
  !i.has(f.id),
1331
1351
  `Separator ids must be unique; id "${f.id}" was used more than once`
1332
1352
  ), i.add(f.id), f.element.addEventListener("keydown", Le);
1333
- }), j.get(m) === 1 && (m.addEventListener("dblclick", we, !0), m.addEventListener("pointerdown", Ce, !0), m.addEventListener("pointerleave", ke), m.addEventListener("pointermove", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
1334
- t = !1, j.set(
1353
+ }), V.get(m) === 1 && (m.addEventListener("dblclick", be, !0), m.addEventListener("pointerdown", Ce, !0), m.addEventListener("pointerleave", ke), m.addEventListener("pointermove", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
1354
+ t = !1, V.set(
1335
1355
  m,
1336
- Math.max(0, (j.get(m) ?? 0) - 1)
1356
+ Math.max(0, (V.get(m) ?? 0) - 1)
1337
1357
  ), M((d) => {
1338
1358
  const p = new Map(d.mountedGroups);
1339
1359
  return p.delete(e), { mountedGroups: p };
1340
1360
  }), e.separators.forEach((d) => {
1341
1361
  d.element.removeEventListener("keydown", Le);
1342
- }), j.get(m) || (m.removeEventListener(
1362
+ }), V.get(m) || (m.removeEventListener(
1343
1363
  "dblclick",
1344
- we,
1364
+ be,
1345
1365
  !0
1346
1366
  ), m.removeEventListener(
1347
1367
  "pointerdown",
@@ -1351,25 +1371,25 @@ function Et(e) {
1351
1371
  };
1352
1372
  }
1353
1373
  function Ye() {
1354
- const [e, t] = Y({}), n = K(() => t({}), []);
1374
+ const [e, t] = Z({}), n = X(() => t({}), []);
1355
1375
  return [e, n];
1356
1376
  }
1357
1377
  function me(e) {
1358
1378
  const t = tt();
1359
1379
  return `${e ?? t}`;
1360
1380
  }
1361
- const $ = typeof window < "u" ? Te : Oe;
1362
- function X(e) {
1381
+ const H = typeof window < "u" ? Te : Oe;
1382
+ function q(e) {
1363
1383
  const t = k(e);
1364
- return $(() => {
1384
+ return H(() => {
1365
1385
  t.current = e;
1366
- }, [e]), K(
1386
+ }, [e]), X(
1367
1387
  (...n) => t.current?.(...n),
1368
1388
  [t]
1369
1389
  );
1370
1390
  }
1371
1391
  function ge(...e) {
1372
- return X((t) => {
1392
+ return q((t) => {
1373
1393
  e.forEach((n) => {
1374
1394
  if (n)
1375
1395
  switch (typeof n) {
@@ -1387,7 +1407,7 @@ function ge(...e) {
1387
1407
  }
1388
1408
  function kt(e) {
1389
1409
  const t = k({ ...e });
1390
- return $(() => {
1410
+ return H(() => {
1391
1411
  for (const n in e)
1392
1412
  t.current[n] = e[n];
1393
1413
  }, [e]), t.current;
@@ -1398,7 +1418,7 @@ function Gt(e, t) {
1398
1418
  getLayout: () => ({}),
1399
1419
  setLayout: Lt
1400
1420
  });
1401
- _e(t, () => n.current, []), $(() => {
1421
+ _e(t, () => n.current, []), H(() => {
1402
1422
  Object.assign(
1403
1423
  n.current,
1404
1424
  Ve({ groupId: e })
@@ -1427,11 +1447,11 @@ function It({
1427
1447
  const f = k({
1428
1448
  onLayoutChange: {},
1429
1449
  onLayoutChanged: {}
1430
- }), d = X((b) => {
1431
- N(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
1432
- }), p = X((b) => {
1433
- N(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
1434
- }), g = me(r), v = k(null), [z, S] = Ye(), w = k({
1450
+ }), d = q((w) => {
1451
+ F(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, a?.(w));
1452
+ }), p = q((w) => {
1453
+ F(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, u?.(w));
1454
+ }), g = me(r), v = k(null), [z, S] = Ye(), b = k({
1435
1455
  lastExpandedPanelSizes: {},
1436
1456
  layouts: {},
1437
1457
  panels: [],
@@ -1439,13 +1459,13 @@ function It({
1439
1459
  separators: []
1440
1460
  }), C = ge(v, s);
1441
1461
  Gt(g, l);
1442
- const P = X(
1443
- (b, L) => {
1462
+ const P = q(
1463
+ (w, L) => {
1444
1464
  const { interactionState: E, mountedGroups: Q } = G();
1445
1465
  for (const ee of Q.keys())
1446
- if (ee.id === b) {
1447
- const W = Q.get(ee);
1448
- if (W) {
1466
+ if (ee.id === w) {
1467
+ const B = Q.get(ee);
1468
+ if (B) {
1449
1469
  let te = !1;
1450
1470
  switch (E.state) {
1451
1471
  case "active": {
@@ -1456,7 +1476,7 @@ function It({
1456
1476
  }
1457
1477
  }
1458
1478
  return {
1459
- flexGrow: W.layout[L] ?? 1,
1479
+ flexGrow: B.layout[L] ?? 1,
1460
1480
  pointerEvents: te ? "none" : void 0
1461
1481
  };
1462
1482
  }
@@ -1470,70 +1490,70 @@ function It({
1470
1490
  getPanelStyles: P,
1471
1491
  id: g,
1472
1492
  orientation: c,
1473
- registerPanel: (b) => {
1474
- const L = w.current;
1493
+ registerPanel: (w) => {
1494
+ const L = b.current;
1475
1495
  return L.panels = de(c, [
1476
1496
  ...L.panels,
1477
- b
1497
+ w
1478
1498
  ]), S(), () => {
1479
1499
  L.panels = L.panels.filter(
1480
- (E) => E !== b
1500
+ (E) => E !== w
1481
1501
  ), S();
1482
1502
  };
1483
1503
  },
1484
- registerSeparator: (b) => {
1485
- const L = w.current;
1504
+ registerSeparator: (w) => {
1505
+ const L = b.current;
1486
1506
  return L.separators = de(c, [
1487
1507
  ...L.separators,
1488
- b
1508
+ w
1489
1509
  ]), S(), () => {
1490
1510
  L.separators = L.separators.filter(
1491
- (E) => E !== b
1511
+ (E) => E !== w
1492
1512
  ), S();
1493
1513
  };
1494
1514
  }
1495
1515
  }),
1496
1516
  [P, g, S, c]
1497
- ), H = kt({
1517
+ ), j = kt({
1498
1518
  defaultLayout: n,
1499
1519
  disableCursor: o
1500
- }), O = k(null);
1501
- return $(() => {
1502
- const b = v.current;
1503
- if (b === null)
1520
+ }), _ = k(null);
1521
+ return H(() => {
1522
+ const w = v.current;
1523
+ if (w === null)
1504
1524
  return;
1505
- const L = w.current, E = {
1506
- defaultLayout: H.defaultLayout,
1507
- disableCursor: !!H.disableCursor,
1525
+ const L = b.current, E = {
1526
+ defaultLayout: j.defaultLayout,
1527
+ disableCursor: !!j.disableCursor,
1508
1528
  disabled: !!i,
1509
- element: b,
1529
+ element: w,
1510
1530
  id: g,
1511
- inMemoryLastExpandedPanelSizes: w.current.lastExpandedPanelSizes,
1512
- inMemoryLayouts: w.current.layouts,
1531
+ inMemoryLastExpandedPanelSizes: b.current.lastExpandedPanelSizes,
1532
+ inMemoryLayouts: b.current.layouts,
1513
1533
  orientation: c,
1514
1534
  panels: L.panels,
1515
1535
  resizeTargetMinimumSize: L.resizeTargetMinimumSize,
1516
1536
  separators: L.separators
1517
1537
  };
1518
- O.current = E;
1519
- const Q = Et(E), W = G().mountedGroups.get(E);
1520
- if (W) {
1521
- const { defaultLayoutDeferred: B, derivedPanelConstraints: ne, layout: oe } = W;
1522
- !B && ne.length > 0 && (d(oe), p(oe), L.panels.forEach((ue) => {
1538
+ _.current = E;
1539
+ const Q = Et(E), B = G().mountedGroups.get(E);
1540
+ if (B) {
1541
+ const { defaultLayoutDeferred: K, derivedPanelConstraints: ne, layout: oe } = B;
1542
+ !K && ne.length > 0 && (d(oe), p(oe), L.panels.forEach((ue) => {
1523
1543
  ue.scheduleUpdate();
1524
1544
  }));
1525
1545
  }
1526
- const te = A.addListener(
1546
+ const te = N.addListener(
1527
1547
  "interactionStateChange",
1528
1548
  () => {
1529
- L.panels.forEach((B) => {
1530
- B.scheduleUpdate();
1549
+ L.panels.forEach((K) => {
1550
+ K.scheduleUpdate();
1531
1551
  });
1532
1552
  }
1533
- ), le = A.addListener(
1553
+ ), le = N.addListener(
1534
1554
  "mountedGroupsChange",
1535
- (B) => {
1536
- const ne = B.get(E);
1555
+ (K) => {
1556
+ const ne = K.get(E);
1537
1557
  if (ne) {
1538
1558
  const { defaultLayoutDeferred: oe, derivedPanelConstraints: ue, layout: Se } = ne;
1539
1559
  if (oe || ue.length === 0)
@@ -1546,7 +1566,7 @@ function It({
1546
1566
  }
1547
1567
  );
1548
1568
  return () => {
1549
- O.current = null, Q(), te(), le();
1569
+ _.current = null, Q(), te(), le();
1550
1570
  };
1551
1571
  }, [
1552
1572
  i,
@@ -1555,11 +1575,11 @@ function It({
1555
1575
  d,
1556
1576
  c,
1557
1577
  z,
1558
- H
1578
+ j
1559
1579
  ]), Oe(() => {
1560
- const b = O.current;
1561
- b && (b.defaultLayout = n, b.disableCursor = !!o);
1562
- }), /* @__PURE__ */ q(Ze.Provider, { value: T, children: /* @__PURE__ */ q(
1580
+ const w = _.current;
1581
+ w && (w.defaultLayout = n, w.disableCursor = !!o);
1582
+ }), /* @__PURE__ */ Y(Ze.Provider, { value: T, children: /* @__PURE__ */ Y(
1563
1583
  "div",
1564
1584
  {
1565
1585
  ...m,
@@ -1599,14 +1619,14 @@ function Ht({
1599
1619
  ), a = Ae(
1600
1620
  () => r ? JSON.parse(r) : void 0,
1601
1621
  [r]
1602
- ), u = k(null), c = K(() => {
1622
+ ), u = k(null), c = X(() => {
1603
1623
  const m = u.current;
1604
1624
  m && (u.current = null, clearTimeout(m));
1605
1625
  }, []);
1606
1626
  Te(() => () => {
1607
1627
  c();
1608
1628
  }, [c]);
1609
- const h = K(
1629
+ const h = X(
1610
1630
  (m) => {
1611
1631
  c();
1612
1632
  let f;
@@ -1618,7 +1638,7 @@ function Ht({
1618
1638
  }
1619
1639
  },
1620
1640
  [c, i, s, n]
1621
- ), y = K(
1641
+ ), y = X(
1622
1642
  (m) => {
1623
1643
  c(), e === 0 ? h(m) : u.current = setTimeout(() => {
1624
1644
  h(m);
@@ -1648,7 +1668,7 @@ function Dt() {
1648
1668
  };
1649
1669
  }
1650
1670
  function jt() {
1651
- return Y(null);
1671
+ return Z(null);
1652
1672
  }
1653
1673
  function Vt() {
1654
1674
  return k(null);
@@ -1671,7 +1691,7 @@ function Tt(e, t) {
1671
1691
  isCollapsed: () => !1,
1672
1692
  resize: ce
1673
1693
  });
1674
- _e(t, () => o.current, []), $(() => {
1694
+ _e(t, () => o.current, []), H(() => {
1675
1695
  Object.assign(
1676
1696
  o.current,
1677
1697
  je({ groupId: n, panelId: e })
@@ -1693,12 +1713,12 @@ function Ot({
1693
1713
  style: h,
1694
1714
  ...y
1695
1715
  }) {
1696
- const m = !!l, f = me(l), d = k(null), p = ge(d, s), [, g] = Ye(), { getPanelStyles: v, id: z, registerPanel: S } = ye(), w = u !== null, C = X(
1697
- (T, H, O) => {
1698
- u?.(T, l, O);
1716
+ const m = !!l, f = me(l), d = k(null), p = ge(d, s), [, g] = Ye(), { getPanelStyles: v, id: z, registerPanel: S } = ye(), b = u !== null, C = q(
1717
+ (T, j, _) => {
1718
+ u?.(T, l, _);
1699
1719
  }
1700
1720
  );
1701
- $(() => {
1721
+ H(() => {
1702
1722
  const T = d.current;
1703
1723
  if (T !== null)
1704
1724
  return S({
@@ -1709,7 +1729,7 @@ function Ot({
1709
1729
  expandToSize: void 0,
1710
1730
  prevSize: void 0
1711
1731
  },
1712
- onResize: w ? C : void 0,
1732
+ onResize: b ? C : void 0,
1713
1733
  panelConstraints: {
1714
1734
  collapsedSize: n,
1715
1735
  collapsible: o,
@@ -1724,7 +1744,7 @@ function Ot({
1724
1744
  o,
1725
1745
  i,
1726
1746
  g,
1727
- w,
1747
+ b,
1728
1748
  f,
1729
1749
  m,
1730
1750
  r,
@@ -1733,7 +1753,7 @@ function Ot({
1733
1753
  S
1734
1754
  ]), Tt(f, c);
1735
1755
  const P = v(z, f);
1736
- return /* @__PURE__ */ q(
1756
+ return /* @__PURE__ */ Y(
1737
1757
  "div",
1738
1758
  {
1739
1759
  ...y,
@@ -1750,11 +1770,13 @@ function Ot({
1750
1770
  overflow: "hidden",
1751
1771
  ...P
1752
1772
  },
1753
- children: /* @__PURE__ */ q(
1773
+ children: /* @__PURE__ */ Y(
1754
1774
  "div",
1755
1775
  {
1756
1776
  className: t,
1757
1777
  style: {
1778
+ maxHeight: "100%",
1779
+ maxWidth: "100%",
1758
1780
  flexGrow: 1,
1759
1781
  ...h
1760
1782
  },
@@ -1778,7 +1800,7 @@ const _t = {
1778
1800
  margin: 0
1779
1801
  };
1780
1802
  function Ut() {
1781
- return Y(null);
1803
+ return Z(null);
1782
1804
  }
1783
1805
  function Wt() {
1784
1806
  return k(null);
@@ -1795,24 +1817,22 @@ function At({
1795
1817
  );
1796
1818
  if (r) {
1797
1819
  const a = r.maxSize, u = s = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
1798
- s = F({
1820
+ s = $({
1799
1821
  layout: J({
1800
1822
  delta: u - l,
1801
1823
  initialLayout: e,
1802
1824
  panelConstraints: t,
1803
1825
  pivotIndices: c,
1804
- prevLayout: e,
1805
- trigger: "keyboard"
1826
+ prevLayout: e
1806
1827
  }),
1807
1828
  panelConstraints: t
1808
- })[n], i = F({
1829
+ })[n], i = $({
1809
1830
  layout: J({
1810
1831
  delta: a - l,
1811
1832
  initialLayout: e,
1812
1833
  panelConstraints: t,
1813
1834
  pivotIndices: c,
1814
- prevLayout: e,
1815
- trigger: "keyboard"
1835
+ prevLayout: e
1816
1836
  }),
1817
1837
  panelConstraints: t
1818
1838
  })[n];
@@ -1832,18 +1852,18 @@ function Nt({
1832
1852
  style: i,
1833
1853
  ...s
1834
1854
  }) {
1835
- const l = me(o), [r, a] = Y({}), [u, c] = Y("inactive"), h = k(null), y = ge(h, n), {
1855
+ const l = me(o), [r, a] = Z({}), [u, c] = Z("inactive"), h = k(null), y = ge(h, n), {
1836
1856
  id: m,
1837
1857
  orientation: f,
1838
1858
  registerSeparator: d
1839
1859
  } = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
1840
- return $(() => {
1860
+ return H(() => {
1841
1861
  const g = h.current;
1842
1862
  if (g !== null) {
1843
1863
  const v = {
1844
1864
  element: g,
1845
1865
  id: l
1846
- }, z = d(v), S = A.addListener(
1866
+ }, z = d(v), S = N.addListener(
1847
1867
  "interactionStateChange",
1848
1868
  (C) => {
1849
1869
  c(
@@ -1852,15 +1872,15 @@ function Nt({
1852
1872
  ) ? C.state : "inactive"
1853
1873
  );
1854
1874
  }
1855
- ), w = A.addListener(
1875
+ ), b = N.addListener(
1856
1876
  "mountedGroupsChange",
1857
1877
  (C) => {
1858
1878
  C.forEach(
1859
- ({ derivedPanelConstraints: P, layout: T, separatorToPanels: H }, O) => {
1860
- if (O.id === m) {
1861
- const b = H.get(v);
1862
- if (b) {
1863
- const L = b[0], E = O.panels.indexOf(L);
1879
+ ({ derivedPanelConstraints: P, layout: T, separatorToPanels: j }, _) => {
1880
+ if (_.id === m) {
1881
+ const w = j.get(v);
1882
+ if (w) {
1883
+ const L = w[0], E = _.panels.indexOf(L);
1864
1884
  a(
1865
1885
  At({
1866
1886
  layout: T,
@@ -1876,10 +1896,10 @@ function Nt({
1876
1896
  }
1877
1897
  );
1878
1898
  return () => {
1879
- S(), w(), z();
1899
+ S(), b(), z();
1880
1900
  };
1881
1901
  }
1882
- }, [m, l, d]), /* @__PURE__ */ q(
1902
+ }, [m, l, d]), /* @__PURE__ */ Y(
1883
1903
  "div",
1884
1904
  {
1885
1905
  ...s,