react-resizable-panels 4.13.1 → 4.13.2

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