@clevertask/react-sortable-tree 0.0.4 → 0.0.6

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,10 +1,10 @@
1
1
  import { jsx as $, jsxs as fn } from "react/jsx-runtime";
2
- import F, { useMemo as T, useLayoutEffect as Qn, useEffect as P, useRef as k, useCallback as z, useState as V, createContext as Ke, memo as ut, useReducer as Nt, useContext as De, cloneElement as er, forwardRef as dt } from "react";
2
+ import F, { useMemo as N, useLayoutEffect as Qn, useEffect as P, useRef as k, useCallback as z, useState as K, createContext as Ke, memo as ut, useReducer as Mt, useContext as De, cloneElement as er, forwardRef as dt } from "react";
3
3
  import { unstable_batchedUpdates as je, createPortal as gn } from "react-dom";
4
4
  function tr() {
5
5
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
6
6
  t[n] = arguments[n];
7
- return T(
7
+ return N(
8
8
  () => (r) => {
9
9
  t.forEach((o) => o(r));
10
10
  },
@@ -13,7 +13,7 @@ function tr() {
13
13
  );
14
14
  }
15
15
  const ft = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
16
- function Me(e) {
16
+ function Ne(e) {
17
17
  const t = Object.prototype.toString.call(e);
18
18
  return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
19
19
  t === "[object global]";
@@ -23,7 +23,7 @@ function Lt(e) {
23
23
  }
24
24
  function J(e) {
25
25
  var t, n;
26
- return e ? Me(e) ? e : Lt(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
26
+ return e ? Ne(e) ? e : Lt(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
27
27
  }
28
28
  function Pt(e) {
29
29
  const {
@@ -32,13 +32,13 @@ function Pt(e) {
32
32
  return e instanceof t;
33
33
  }
34
34
  function Ue(e) {
35
- return Me(e) ? !1 : e instanceof J(e).HTMLElement;
35
+ return Ne(e) ? !1 : e instanceof J(e).HTMLElement;
36
36
  }
37
37
  function hn(e) {
38
38
  return e instanceof J(e).SVGElement;
39
39
  }
40
- function Ne(e) {
41
- return e ? Me(e) ? e.document : Lt(e) ? Pt(e) ? e : Ue(e) || hn(e) ? e.ownerDocument : document : document : document;
40
+ function Me(e) {
41
+ return e ? Ne(e) ? e.document : Lt(e) ? Pt(e) ? e : Ue(e) || hn(e) ? e.ownerDocument : document : document : document;
42
42
  }
43
43
  const ie = ft ? Qn : P;
44
44
  function gt(e) {
@@ -68,7 +68,7 @@ function Ye(e, t) {
68
68
  }
69
69
  function We(e, t) {
70
70
  const n = k();
71
- return T(
71
+ return N(
72
72
  () => {
73
73
  const r = e(n.current);
74
74
  return n.current = r, r;
@@ -95,7 +95,7 @@ function it(e) {
95
95
  }
96
96
  let wt = {};
97
97
  function Je(e, t) {
98
- return T(() => {
98
+ return N(() => {
99
99
  if (t)
100
100
  return t;
101
101
  const n = wt[e] == null ? 0 : wt[e] + 1;
@@ -118,7 +118,7 @@ function pn(e) {
118
118
  });
119
119
  };
120
120
  }
121
- const Ae = /* @__PURE__ */ pn(1), st = /* @__PURE__ */ pn(-1);
121
+ const Te = /* @__PURE__ */ pn(1), st = /* @__PURE__ */ pn(-1);
122
122
  function rr(e) {
123
123
  return "clientX" in e && "clientY" in e;
124
124
  }
@@ -248,7 +248,7 @@ function lr(e) {
248
248
  }, n);
249
249
  }
250
250
  function cr() {
251
- const [e, t] = V("");
251
+ const [e, t] = K("");
252
252
  return {
253
253
  announce: z((r) => {
254
254
  r != null && t(r);
@@ -266,7 +266,7 @@ function ur(e) {
266
266
  }, [e, t]);
267
267
  }
268
268
  function dr() {
269
- const [e] = V(() => /* @__PURE__ */ new Set()), t = z((r) => (e.add(r), () => e.delete(r)), [e]);
269
+ const [e] = K(() => /* @__PURE__ */ new Set()), t = z((r) => (e.add(r), () => e.delete(r)), [e]);
270
270
  return [z((r) => {
271
271
  let {
272
272
  type: o,
@@ -322,10 +322,10 @@ function hr(e) {
322
322
  const {
323
323
  announce: i,
324
324
  announcement: s
325
- } = cr(), a = Je("DndLiveRegion"), [l, c] = V(!1);
325
+ } = cr(), a = Je("DndLiveRegion"), [l, c] = K(!1);
326
326
  if (P(() => {
327
327
  c(!0);
328
- }, []), ur(T(() => ({
328
+ }, []), ur(N(() => ({
329
329
  onDragStart(d) {
330
330
  let {
331
331
  active: h
@@ -392,7 +392,7 @@ var X;
392
392
  function lt() {
393
393
  }
394
394
  function Gt(e, t) {
395
- return T(
395
+ return N(
396
396
  () => ({
397
397
  sensor: e,
398
398
  options: t ?? {}
@@ -404,7 +404,7 @@ function Gt(e, t) {
404
404
  function pr() {
405
405
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
406
406
  t[n] = arguments[n];
407
- return T(
407
+ return N(
408
408
  () => [...t].filter((r) => r != null),
409
409
  // eslint-disable-next-line react-hooks/exhaustive-deps
410
410
  [...t]
@@ -680,7 +680,7 @@ function Er(e) {
680
680
  function Or(e, t) {
681
681
  return t === void 0 && (t = J(e).getComputedStyle(e)), t.position === "fixed";
682
682
  }
683
- function Ar(e, t) {
683
+ function Tr(e, t) {
684
684
  t === void 0 && (t = J(e).getComputedStyle(e));
685
685
  const n = /(auto|scroll|overlay)/;
686
686
  return ["overflow", "overflowX", "overflowY"].some((o) => {
@@ -698,7 +698,7 @@ function kt(e, t) {
698
698
  if (!Ue(o) || hn(o) || n.includes(o))
699
699
  return n;
700
700
  const i = J(e).getComputedStyle(o);
701
- return o !== e && Ar(o, i) && n.push(o), Or(o, i) ? n : r(o.parentNode);
701
+ return o !== e && Tr(o, i) && n.push(o), Or(o, i) ? n : r(o.parentNode);
702
702
  }
703
703
  return e ? r(e) : n;
704
704
  }
@@ -707,13 +707,13 @@ function Dn(e) {
707
707
  return t ?? null;
708
708
  }
709
709
  function xt(e) {
710
- return !ft || !e ? null : Me(e) ? e : Lt(e) ? Pt(e) || e === Ne(e).scrollingElement ? window : Ue(e) ? e : null : null;
710
+ return !ft || !e ? null : Ne(e) ? e : Lt(e) ? Pt(e) || e === Me(e).scrollingElement ? window : Ue(e) ? e : null : null;
711
711
  }
712
712
  function Cn(e) {
713
- return Me(e) ? e.scrollX : e.scrollLeft;
713
+ return Ne(e) ? e.scrollX : e.scrollLeft;
714
714
  }
715
715
  function Sn(e) {
716
- return Me(e) ? e.scrollY : e.scrollTop;
716
+ return Ne(e) ? e.scrollY : e.scrollTop;
717
717
  }
718
718
  function Rt(e) {
719
719
  return {
@@ -721,10 +721,10 @@ function Rt(e) {
721
721
  y: Sn(e)
722
722
  };
723
723
  }
724
- var Y;
724
+ var V;
725
725
  (function(e) {
726
726
  e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
727
- })(Y || (Y = {}));
727
+ })(V || (V = {}));
728
728
  function In(e) {
729
729
  return !ft || !e ? !1 : e === document.scrollingElement;
730
730
  }
@@ -751,18 +751,18 @@ function Rn(e) {
751
751
  minScroll: t
752
752
  };
753
753
  }
754
- const Tr = {
754
+ const Ar = {
755
755
  x: 0.2,
756
756
  y: 0.2
757
757
  };
758
- function Mr(e, t, n, r, o) {
758
+ function Nr(e, t, n, r, o) {
759
759
  let {
760
760
  top: i,
761
761
  left: s,
762
762
  right: a,
763
763
  bottom: l
764
764
  } = n;
765
- r === void 0 && (r = 10), o === void 0 && (o = Tr);
765
+ r === void 0 && (r = 10), o === void 0 && (o = Ar);
766
766
  const {
767
767
  isTop: c,
768
768
  isBottom: u,
@@ -778,12 +778,12 @@ function Mr(e, t, n, r, o) {
778
778
  height: t.height * o.y,
779
779
  width: t.width * o.x
780
780
  };
781
- return !c && i <= t.top + g.height ? (f.y = Y.Backward, m.y = r * Math.abs((t.top + g.height - i) / g.height)) : !u && l >= t.bottom - g.height && (f.y = Y.Forward, m.y = r * Math.abs((t.bottom - g.height - l) / g.height)), !h && a >= t.right - g.width ? (f.x = Y.Forward, m.x = r * Math.abs((t.right - g.width - a) / g.width)) : !d && s <= t.left + g.width && (f.x = Y.Backward, m.x = r * Math.abs((t.left + g.width - s) / g.width)), {
781
+ return !c && i <= t.top + g.height ? (f.y = V.Backward, m.y = r * Math.abs((t.top + g.height - i) / g.height)) : !u && l >= t.bottom - g.height && (f.y = V.Forward, m.y = r * Math.abs((t.bottom - g.height - l) / g.height)), !h && a >= t.right - g.width ? (f.x = V.Forward, m.x = r * Math.abs((t.right - g.width - a) / g.width)) : !d && s <= t.left + g.width && (f.x = V.Backward, m.x = r * Math.abs((t.left + g.width - s) / g.width)), {
782
782
  direction: f,
783
783
  speed: m
784
784
  };
785
785
  }
786
- function Nr(e) {
786
+ function Mr(e) {
787
787
  if (e === document.scrollingElement) {
788
788
  const {
789
789
  innerWidth: i,
@@ -814,7 +814,7 @@ function Nr(e) {
814
814
  };
815
815
  }
816
816
  function En(e) {
817
- return e.reduce((t, n) => Ae(t, Rt(n)), de);
817
+ return e.reduce((t, n) => Te(t, Rt(n)), de);
818
818
  }
819
819
  function Lr(e) {
820
820
  return e.reduce((t, n) => t + Cn(n), 0);
@@ -837,7 +837,7 @@ function On(e, t) {
837
837
  });
838
838
  }
839
839
  const kr = [["x", ["left", "right"], Lr], ["y", ["top", "bottom"], Pr]];
840
- class zt {
840
+ class Bt {
841
841
  constructor(t, n) {
842
842
  this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
843
843
  const r = kt(n), o = En(r);
@@ -872,11 +872,11 @@ class Fe {
872
872
  (o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
873
873
  }
874
874
  }
875
- function zr(e) {
875
+ function Br(e) {
876
876
  const {
877
877
  EventTarget: t
878
878
  } = J(e);
879
- return e instanceof t ? e : Ne(e);
879
+ return e instanceof t ? e : Me(e);
880
880
  }
881
881
  function Dt(e, t) {
882
882
  const n = Math.abs(e.x), r = Math.abs(e.y);
@@ -889,45 +889,45 @@ var oe;
889
889
  function tn(e) {
890
890
  e.preventDefault();
891
891
  }
892
- function Br(e) {
892
+ function zr(e) {
893
893
  e.stopPropagation();
894
894
  }
895
- var S;
895
+ var I;
896
896
  (function(e) {
897
897
  e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter";
898
- })(S || (S = {}));
899
- const An = {
900
- start: [S.Space, S.Enter],
901
- cancel: [S.Esc],
902
- end: [S.Space, S.Enter]
898
+ })(I || (I = {}));
899
+ const Tn = {
900
+ start: [I.Space, I.Enter],
901
+ cancel: [I.Esc],
902
+ end: [I.Space, I.Enter]
903
903
  }, $r = (e, t) => {
904
904
  let {
905
905
  currentCoordinates: n
906
906
  } = t;
907
907
  switch (e.code) {
908
- case S.Right:
908
+ case I.Right:
909
909
  return {
910
910
  ...n,
911
911
  x: n.x + 25
912
912
  };
913
- case S.Left:
913
+ case I.Left:
914
914
  return {
915
915
  ...n,
916
916
  x: n.x - 25
917
917
  };
918
- case S.Down:
918
+ case I.Down:
919
919
  return {
920
920
  ...n,
921
921
  y: n.y + 25
922
922
  };
923
- case S.Up:
923
+ case I.Up:
924
924
  return {
925
925
  ...n,
926
926
  y: n.y - 25
927
927
  };
928
928
  }
929
929
  };
930
- class Bt {
930
+ class zt {
931
931
  constructor(t) {
932
932
  this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
933
933
  const {
@@ -935,7 +935,7 @@ class Bt {
935
935
  target: n
936
936
  }
937
937
  } = t;
938
- this.props = t, this.listeners = new Fe(Ne(n)), this.windowListeners = new Fe(J(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
938
+ this.props = t, this.listeners = new Fe(Me(n)), this.windowListeners = new Fe(J(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
939
939
  }
940
940
  attach() {
941
941
  this.handleStart(), this.windowListeners.add(oe.Resize, this.handleCancel), this.windowListeners.add(oe.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(oe.Keydown, this.handleKeyDown));
@@ -954,7 +954,7 @@ class Bt {
954
954
  context: r,
955
955
  options: o
956
956
  } = this.props, {
957
- keyboardCodes: i = An,
957
+ keyboardCodes: i = Tn,
958
958
  coordinateGetter: s = $r,
959
959
  scrollBehavior: a = "smooth"
960
960
  } = o, {
@@ -990,46 +990,46 @@ class Bt {
990
990
  for (const g of m) {
991
991
  const p = t.code, {
992
992
  isTop: b,
993
- isRight: D,
993
+ isRight: x,
994
994
  isLeft: y,
995
- isBottom: R,
996
- maxScroll: x,
995
+ isBottom: S,
996
+ maxScroll: D,
997
997
  minScroll: w
998
- } = Rn(g), I = Nr(g), E = {
999
- x: Math.min(p === S.Right ? I.right - I.width / 2 : I.right, Math.max(p === S.Right ? I.left : I.left + I.width / 2, d.x)),
1000
- y: Math.min(p === S.Down ? I.bottom - I.height / 2 : I.bottom, Math.max(p === S.Down ? I.top : I.top + I.height / 2, d.y))
1001
- }, N = p === S.Right && !D || p === S.Left && !y, _ = p === S.Down && !R || p === S.Up && !b;
1002
- if (N && E.x !== d.x) {
1003
- const A = g.scrollLeft + h.x, Z = p === S.Right && A <= x.x || p === S.Left && A >= w.x;
998
+ } = Rn(g), R = Mr(g), E = {
999
+ x: Math.min(p === I.Right ? R.right - R.width / 2 : R.right, Math.max(p === I.Right ? R.left : R.left + R.width / 2, d.x)),
1000
+ y: Math.min(p === I.Down ? R.bottom - R.height / 2 : R.bottom, Math.max(p === I.Down ? R.top : R.top + R.height / 2, d.y))
1001
+ }, M = p === I.Right && !x || p === I.Left && !y, _ = p === I.Down && !S || p === I.Up && !b;
1002
+ if (M && E.x !== d.x) {
1003
+ const T = g.scrollLeft + h.x, Z = p === I.Right && T <= D.x || p === I.Left && T >= w.x;
1004
1004
  if (Z && !h.y) {
1005
1005
  g.scrollTo({
1006
- left: A,
1006
+ left: T,
1007
1007
  behavior: a
1008
1008
  });
1009
1009
  return;
1010
1010
  }
1011
- Z ? f.x = g.scrollLeft - A : f.x = p === S.Right ? g.scrollLeft - x.x : g.scrollLeft - w.x, f.x && g.scrollBy({
1011
+ Z ? f.x = g.scrollLeft - T : f.x = p === I.Right ? g.scrollLeft - D.x : g.scrollLeft - w.x, f.x && g.scrollBy({
1012
1012
  left: -f.x,
1013
1013
  behavior: a
1014
1014
  });
1015
1015
  break;
1016
1016
  } else if (_ && E.y !== d.y) {
1017
- const A = g.scrollTop + h.y, Z = p === S.Down && A <= x.y || p === S.Up && A >= w.y;
1017
+ const T = g.scrollTop + h.y, Z = p === I.Down && T <= D.y || p === I.Up && T >= w.y;
1018
1018
  if (Z && !h.x) {
1019
1019
  g.scrollTo({
1020
- top: A,
1020
+ top: T,
1021
1021
  behavior: a
1022
1022
  });
1023
1023
  return;
1024
1024
  }
1025
- Z ? f.y = g.scrollTop - A : f.y = p === S.Down ? g.scrollTop - x.y : g.scrollTop - w.y, f.y && g.scrollBy({
1025
+ Z ? f.y = g.scrollTop - T : f.y = p === I.Down ? g.scrollTop - D.y : g.scrollTop - w.y, f.y && g.scrollBy({
1026
1026
  top: -f.y,
1027
1027
  behavior: a
1028
1028
  });
1029
1029
  break;
1030
1030
  }
1031
1031
  }
1032
- this.handleMove(t, Ae(st(d, this.referenceCoordinates), f));
1032
+ this.handleMove(t, Te(st(d, this.referenceCoordinates), f));
1033
1033
  }
1034
1034
  }
1035
1035
  }
@@ -1055,11 +1055,11 @@ class Bt {
1055
1055
  this.listeners.removeAll(), this.windowListeners.removeAll();
1056
1056
  }
1057
1057
  }
1058
- Bt.activators = [{
1058
+ zt.activators = [{
1059
1059
  eventName: "onKeyDown",
1060
1060
  handler: (e, t, n) => {
1061
1061
  let {
1062
- keyboardCodes: r = An,
1062
+ keyboardCodes: r = Tn,
1063
1063
  onActivation: o
1064
1064
  } = t, {
1065
1065
  active: i
@@ -1085,13 +1085,13 @@ function rn(e) {
1085
1085
  class $t {
1086
1086
  constructor(t, n, r) {
1087
1087
  var o;
1088
- r === void 0 && (r = zr(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
1088
+ r === void 0 && (r = Br(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
1089
1089
  const {
1090
1090
  event: i
1091
1091
  } = t, {
1092
1092
  target: s
1093
1093
  } = i;
1094
- this.props = t, this.events = n, this.document = Ne(s), this.documentListeners = new Fe(this.document), this.listeners = new Fe(r), this.windowListeners = new Fe(J(s)), this.initialCoordinates = (o = at(i)) != null ? o : de, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
1094
+ this.props = t, this.events = n, this.document = Me(s), this.documentListeners = new Fe(this.document), this.listeners = new Fe(r), this.windowListeners = new Fe(J(s)), this.initialCoordinates = (o = at(i)) != null ? o : de, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
1095
1095
  }
1096
1096
  attach() {
1097
1097
  const {
@@ -1130,7 +1130,7 @@ class $t {
1130
1130
  } = this, {
1131
1131
  onStart: n
1132
1132
  } = this.props;
1133
- t && (this.activated = !0, this.documentListeners.add(oe.Click, Br, {
1133
+ t && (this.activated = !0, this.documentListeners.add(oe.Click, zr, {
1134
1134
  capture: !0
1135
1135
  }), this.removeTextSelection(), this.documentListeners.add(oe.SelectionChange, this.removeTextSelection), n(t));
1136
1136
  }
@@ -1173,7 +1173,7 @@ class $t {
1173
1173
  this.detach(), t();
1174
1174
  }
1175
1175
  handleKeydown(t) {
1176
- t.code === S.Esc && this.handleCancel();
1176
+ t.code === I.Esc && this.handleCancel();
1177
1177
  }
1178
1178
  removeTextSelection() {
1179
1179
  var t;
@@ -1192,7 +1192,7 @@ class _t extends $t {
1192
1192
  constructor(t) {
1193
1193
  const {
1194
1194
  event: n
1195
- } = t, r = Ne(n.target);
1195
+ } = t, r = Me(n.target);
1196
1196
  super(t, _r, r);
1197
1197
  }
1198
1198
  }
@@ -1223,7 +1223,7 @@ var Et;
1223
1223
  })(Et || (Et = {}));
1224
1224
  class Fr extends $t {
1225
1225
  constructor(t) {
1226
- super(t, jr, Ne(t.event.target));
1226
+ super(t, jr, Me(t.event.target));
1227
1227
  }
1228
1228
  }
1229
1229
  Fr.activators = [{
@@ -1310,7 +1310,7 @@ function Xr(e) {
1310
1310
  }), b = k({
1311
1311
  x: 0,
1312
1312
  y: 0
1313
- }), D = T(() => {
1313
+ }), x = N(() => {
1314
1314
  switch (n) {
1315
1315
  case He.Pointer:
1316
1316
  return l ? {
@@ -1322,33 +1322,33 @@ function Xr(e) {
1322
1322
  case He.DraggableRect:
1323
1323
  return o;
1324
1324
  }
1325
- }, [n, o, l]), y = k(null), R = z(() => {
1325
+ }, [n, o, l]), y = k(null), S = z(() => {
1326
1326
  const w = y.current;
1327
1327
  if (!w)
1328
1328
  return;
1329
- const I = p.current.x * b.current.x, E = p.current.y * b.current.y;
1330
- w.scrollBy(I, E);
1331
- }, []), x = T(() => a === ct.TreeOrder ? [...c].reverse() : c, [a, c]);
1329
+ const R = p.current.x * b.current.x, E = p.current.y * b.current.y;
1330
+ w.scrollBy(R, E);
1331
+ }, []), D = N(() => a === ct.TreeOrder ? [...c].reverse() : c, [a, c]);
1332
1332
  P(
1333
1333
  () => {
1334
- if (!i || !c.length || !D) {
1334
+ if (!i || !c.length || !x) {
1335
1335
  g();
1336
1336
  return;
1337
1337
  }
1338
- for (const w of x) {
1338
+ for (const w of D) {
1339
1339
  if ((r == null ? void 0 : r(w)) === !1)
1340
1340
  continue;
1341
- const I = c.indexOf(w), E = u[I];
1341
+ const R = c.indexOf(w), E = u[R];
1342
1342
  if (!E)
1343
1343
  continue;
1344
1344
  const {
1345
- direction: N,
1345
+ direction: M,
1346
1346
  speed: _
1347
- } = Mr(w, E, D, t, h);
1348
- for (const A of ["x", "y"])
1349
- f[A][N[A]] || (_[A] = 0, N[A] = 0);
1347
+ } = Nr(w, E, x, t, h);
1348
+ for (const T of ["x", "y"])
1349
+ f[T][M[T]] || (_[T] = 0, M[T] = 0);
1350
1350
  if (_.x > 0 || _.y > 0) {
1351
- g(), y.current = w, m(R, s), p.current = _, b.current = N;
1351
+ g(), y.current = w, m(S, s), p.current = _, b.current = M;
1352
1352
  return;
1353
1353
  }
1354
1354
  }
@@ -1363,18 +1363,18 @@ function Xr(e) {
1363
1363
  // eslint-disable-next-line react-hooks/exhaustive-deps
1364
1364
  [
1365
1365
  t,
1366
- R,
1366
+ S,
1367
1367
  r,
1368
1368
  g,
1369
1369
  i,
1370
1370
  s,
1371
1371
  // eslint-disable-next-line react-hooks/exhaustive-deps
1372
- JSON.stringify(D),
1372
+ JSON.stringify(x),
1373
1373
  // eslint-disable-next-line react-hooks/exhaustive-deps
1374
1374
  JSON.stringify(f),
1375
1375
  m,
1376
1376
  c,
1377
- x,
1377
+ D,
1378
1378
  u,
1379
1379
  // eslint-disable-next-line react-hooks/exhaustive-deps
1380
1380
  JSON.stringify(h)
@@ -1383,12 +1383,12 @@ function Xr(e) {
1383
1383
  }
1384
1384
  const Yr = {
1385
1385
  x: {
1386
- [Y.Backward]: !1,
1387
- [Y.Forward]: !1
1386
+ [V.Backward]: !1,
1387
+ [V.Forward]: !1
1388
1388
  },
1389
1389
  y: {
1390
- [Y.Backward]: !1,
1391
- [Y.Forward]: !1
1390
+ [V.Backward]: !1,
1391
+ [V.Forward]: !1
1392
1392
  }
1393
1393
  };
1394
1394
  function Vr(e) {
@@ -1406,12 +1406,12 @@ function Vr(e) {
1406
1406
  };
1407
1407
  return {
1408
1408
  x: {
1409
- [Y.Backward]: o.x[Y.Backward] || i.x === -1,
1410
- [Y.Forward]: o.x[Y.Forward] || i.x === 1
1409
+ [V.Backward]: o.x[V.Backward] || i.x === -1,
1410
+ [V.Forward]: o.x[V.Forward] || i.x === 1
1411
1411
  },
1412
1412
  y: {
1413
- [Y.Backward]: o.y[Y.Backward] || i.y === -1,
1414
- [Y.Forward]: o.y[Y.Forward] || i.y === 1
1413
+ [V.Backward]: o.y[V.Backward] || i.y === -1,
1414
+ [V.Forward]: o.y[V.Forward] || i.y === 1
1415
1415
  }
1416
1416
  };
1417
1417
  }, [n, t, r]);
@@ -1424,7 +1424,7 @@ function Kr(e, t) {
1424
1424
  }, [r, t]);
1425
1425
  }
1426
1426
  function Ur(e, t) {
1427
- return T(() => e.reduce((n, r) => {
1427
+ return N(() => e.reduce((n, r) => {
1428
1428
  const {
1429
1429
  sensor: o
1430
1430
  } = r, i = o.activators.map((s) => ({
@@ -1434,10 +1434,10 @@ function Ur(e, t) {
1434
1434
  return [...n, ...i];
1435
1435
  }, []), [e, t]);
1436
1436
  }
1437
- var Te;
1437
+ var Ae;
1438
1438
  (function(e) {
1439
1439
  e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
1440
- })(Te || (Te = {}));
1440
+ })(Ae || (Ae = {}));
1441
1441
  var Ot;
1442
1442
  (function(e) {
1443
1443
  e.Optimized = "optimized";
@@ -1449,28 +1449,28 @@ function Wr(e, t) {
1449
1449
  dependencies: r,
1450
1450
  config: o
1451
1451
  } = t;
1452
- const [i, s] = V(null), {
1452
+ const [i, s] = K(null), {
1453
1453
  frequency: a,
1454
1454
  measure: l,
1455
1455
  strategy: c
1456
1456
  } = o, u = k(e), d = p(), h = Ye(d), f = z(function(b) {
1457
- b === void 0 && (b = []), !h.current && s((D) => D === null ? b : D.concat(b.filter((y) => !D.includes(y))));
1457
+ b === void 0 && (b = []), !h.current && s((x) => x === null ? b : x.concat(b.filter((y) => !x.includes(y))));
1458
1458
  }, [h]), m = k(null), g = We((b) => {
1459
1459
  if (d && !n)
1460
1460
  return on;
1461
1461
  if (!b || b === on || u.current !== e || i != null) {
1462
- const D = /* @__PURE__ */ new Map();
1462
+ const x = /* @__PURE__ */ new Map();
1463
1463
  for (let y of e) {
1464
1464
  if (!y)
1465
1465
  continue;
1466
1466
  if (i && i.length > 0 && !i.includes(y.id) && y.rect.current) {
1467
- D.set(y.id, y.rect.current);
1467
+ x.set(y.id, y.rect.current);
1468
1468
  continue;
1469
1469
  }
1470
- const R = y.node.current, x = R ? new zt(l(R), R) : null;
1471
- y.rect.current = x, x && D.set(y.id, x);
1470
+ const S = y.node.current, D = S ? new Bt(l(S), S) : null;
1471
+ y.rect.current = D, D && x.set(y.id, D);
1472
1472
  }
1473
- return D;
1473
+ return x;
1474
1474
  }
1475
1475
  return b;
1476
1476
  }, [e, i, n, d, l]);
@@ -1503,9 +1503,9 @@ function Wr(e, t) {
1503
1503
  };
1504
1504
  function p() {
1505
1505
  switch (c) {
1506
- case Te.Always:
1506
+ case Ae.Always:
1507
1507
  return !1;
1508
- case Te.BeforeDragging:
1508
+ case Ae.BeforeDragging:
1509
1509
  return n;
1510
1510
  default:
1511
1511
  return !n;
@@ -1523,7 +1523,7 @@ function qr(e) {
1523
1523
  callback: t,
1524
1524
  disabled: n
1525
1525
  } = e;
1526
- const r = gt(t), o = T(() => {
1526
+ const r = gt(t), o = N(() => {
1527
1527
  if (n || typeof window > "u" || typeof window.MutationObserver > "u")
1528
1528
  return;
1529
1529
  const {
@@ -1538,7 +1538,7 @@ function pt(e) {
1538
1538
  callback: t,
1539
1539
  disabled: n
1540
1540
  } = e;
1541
- const r = gt(t), o = T(
1541
+ const r = gt(t), o = N(
1542
1542
  () => {
1543
1543
  if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
1544
1544
  return;
@@ -1553,11 +1553,11 @@ function pt(e) {
1553
1553
  return P(() => () => o == null ? void 0 : o.disconnect(), [o]), o;
1554
1554
  }
1555
1555
  function Gr(e) {
1556
- return new zt(Le(e), e);
1556
+ return new Bt(Le(e), e);
1557
1557
  }
1558
1558
  function sn(e, t, n) {
1559
1559
  t === void 0 && (t = Gr);
1560
- const [r, o] = Nt(a, null), i = qr({
1560
+ const [r, o] = Mt(a, null), i = qr({
1561
1561
  callback(l) {
1562
1562
  if (e)
1563
1563
  for (const c of l) {
@@ -1603,7 +1603,7 @@ function Qr(e) {
1603
1603
  }, [e]), n;
1604
1604
  }
1605
1605
  function eo(e) {
1606
- const [t, n] = V(null), r = k(e), o = z((i) => {
1606
+ const [t, n] = K(null), r = k(e), o = z((i) => {
1607
1607
  const s = xt(i.target);
1608
1608
  s && n((a) => a ? (a.set(s, Rt(s)), new Map(a)) : null);
1609
1609
  }, []);
@@ -1628,7 +1628,7 @@ function eo(e) {
1628
1628
  c == null || c.removeEventListener("scroll", o);
1629
1629
  });
1630
1630
  }
1631
- }, [o, e]), T(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => Ae(i, s), de) : En(e) : de, [e, t]);
1631
+ }, [o, e]), N(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => Te(i, s), de) : En(e) : de, [e, t]);
1632
1632
  }
1633
1633
  function ln(e, t) {
1634
1634
  t === void 0 && (t = []);
@@ -1671,7 +1671,7 @@ function to(e) {
1671
1671
  );
1672
1672
  }
1673
1673
  function no(e, t) {
1674
- return T(() => e.reduce((n, r) => {
1674
+ return N(() => e.reduce((n, r) => {
1675
1675
  let {
1676
1676
  eventName: o,
1677
1677
  handler: i
@@ -1681,23 +1681,23 @@ function no(e, t) {
1681
1681
  }, n;
1682
1682
  }, {}), [e, t]);
1683
1683
  }
1684
- function Tn(e) {
1685
- return T(() => e ? Er(e) : null, [e]);
1684
+ function An(e) {
1685
+ return N(() => e ? Er(e) : null, [e]);
1686
1686
  }
1687
1687
  const St = [];
1688
1688
  function ro(e, t) {
1689
1689
  t === void 0 && (t = Le);
1690
- const [n] = e, r = Tn(n ? J(n) : null), [o, i] = Nt(a, St), s = pt({
1690
+ const [n] = e, r = An(n ? J(n) : null), [o, i] = Mt(a, St), s = pt({
1691
1691
  callback: i
1692
1692
  });
1693
1693
  return e.length > 0 && o === St && i(), ie(() => {
1694
1694
  e.length ? e.forEach((l) => s == null ? void 0 : s.observe(l)) : (s == null || s.disconnect(), i());
1695
1695
  }, [e]), o;
1696
1696
  function a() {
1697
- return e.length ? e.map((l) => In(l) ? r : new zt(t(l), l)) : St;
1697
+ return e.length ? e.map((l) => In(l) ? r : new Bt(t(l), l)) : St;
1698
1698
  }
1699
1699
  }
1700
- function Mn(e) {
1700
+ function Nn(e) {
1701
1701
  if (!e)
1702
1702
  return null;
1703
1703
  if (e.children.length > 1)
@@ -1709,7 +1709,7 @@ function oo(e) {
1709
1709
  let {
1710
1710
  measure: t
1711
1711
  } = e;
1712
- const [n, r] = V(null), o = z((c) => {
1712
+ const [n, r] = K(null), o = z((c) => {
1713
1713
  for (const {
1714
1714
  target: u
1715
1715
  } of c)
@@ -1727,10 +1727,10 @@ function oo(e) {
1727
1727
  }, [t]), i = pt({
1728
1728
  callback: o
1729
1729
  }), s = z((c) => {
1730
- const u = Mn(c);
1730
+ const u = Nn(c);
1731
1731
  i == null || i.disconnect(), u && (i == null || i.observe(u)), r(u ? t(u) : null);
1732
1732
  }, [t, i]), [a, l] = ot(s);
1733
- return T(() => ({
1733
+ return N(() => ({
1734
1734
  nodeRef: a,
1735
1735
  rect: n,
1736
1736
  setRef: l
@@ -1740,7 +1740,7 @@ const io = [{
1740
1740
  sensor: _t,
1741
1741
  options: {}
1742
1742
  }, {
1743
- sensor: Bt,
1743
+ sensor: zt,
1744
1744
  options: {}
1745
1745
  }], so = {
1746
1746
  current: {}
@@ -1750,7 +1750,7 @@ const io = [{
1750
1750
  },
1751
1751
  droppable: {
1752
1752
  measure: en,
1753
- strategy: Te.WhileDragging,
1753
+ strategy: Ae.WhileDragging,
1754
1754
  frequency: Ot.Optimized
1755
1755
  },
1756
1756
  dragOverlay: {
@@ -1802,7 +1802,7 @@ const ao = {
1802
1802
  measureDroppableContainers: lt,
1803
1803
  windowRect: null,
1804
1804
  measuringScheduled: !1
1805
- }, Nn = {
1805
+ }, Mn = {
1806
1806
  activatorEvent: null,
1807
1807
  activators: [],
1808
1808
  active: null,
@@ -1814,7 +1814,7 @@ const ao = {
1814
1814
  draggableNodes: /* @__PURE__ */ new Map(),
1815
1815
  over: null,
1816
1816
  measureDroppableContainers: lt
1817
- }, qe = /* @__PURE__ */ Ke(Nn), Ln = /* @__PURE__ */ Ke(ao);
1817
+ }, qe = /* @__PURE__ */ Ke(Mn), Ln = /* @__PURE__ */ Ke(ao);
1818
1818
  function lo() {
1819
1819
  return {
1820
1820
  draggable: {
@@ -1974,7 +1974,7 @@ function Pn(e, t) {
1974
1974
  }), n) : n;
1975
1975
  }
1976
1976
  function fo(e) {
1977
- return T(
1977
+ return N(
1978
1978
  () => ({
1979
1979
  draggable: {
1980
1980
  ...rt.draggable,
@@ -2049,45 +2049,45 @@ const ho = /* @__PURE__ */ ut(function(t) {
2049
2049
  modifiers: f,
2050
2050
  ...m
2051
2051
  } = t;
2052
- const g = Nt(co, void 0, lo), [p, b] = g, [D, y] = dr(), [R, x] = V(xe.Uninitialized), w = R === xe.Initialized, {
2052
+ const g = Mt(co, void 0, lo), [p, b] = g, [x, y] = dr(), [S, D] = K(xe.Uninitialized), w = S === xe.Initialized, {
2053
2053
  draggable: {
2054
- active: I,
2054
+ active: R,
2055
2055
  nodes: E,
2056
- translate: N
2056
+ translate: M
2057
2057
  },
2058
2058
  droppable: {
2059
2059
  containers: _
2060
2060
  }
2061
- } = p, A = I ? E.get(I) : null, Z = k({
2061
+ } = p, T = R ? E.get(R) : null, Z = k({
2062
2062
  initial: null,
2063
2063
  translated: null
2064
- }), Q = T(() => {
2065
- var K;
2066
- return I != null ? {
2067
- id: I,
2064
+ }), Q = N(() => {
2065
+ var U;
2066
+ return R != null ? {
2067
+ id: R,
2068
2068
  // It's possible for the active node to unmount while dragging
2069
- data: (K = A == null ? void 0 : A.data) != null ? K : so,
2069
+ data: (U = T == null ? void 0 : T.data) != null ? U : so,
2070
2070
  rect: Z
2071
2071
  } : null;
2072
- }, [I, A]), ne = k(null), [fe, Ce] = V(null), [W, Se] = V(null), pe = Ye(m, Object.values(m)), ve = Je("DndDescribedBy", s), Pe = T(() => _.getEnabled(), [_]), v = fo(h), {
2072
+ }, [R, T]), ne = k(null), [fe, Ce] = K(null), [W, Se] = K(null), pe = Ye(m, Object.values(m)), ve = Je("DndDescribedBy", s), Pe = N(() => _.getEnabled(), [_]), v = fo(h), {
2073
2073
  droppableRects: C,
2074
2074
  measureDroppableContainers: B,
2075
2075
  measuringScheduled: L
2076
2076
  } = Wr(Pe, {
2077
2077
  dragging: w,
2078
- dependencies: [N.x, N.y],
2078
+ dependencies: [M.x, M.y],
2079
2079
  config: v.droppable
2080
- }), M = Kr(E, I), q = T(() => W ? at(W) : null, [W]), H = Zn(), U = Jr(M, v.draggable.measure);
2080
+ }), A = Kr(E, R), q = N(() => W ? at(W) : null, [W]), H = Zn(), Y = Jr(A, v.draggable.measure);
2081
2081
  go({
2082
- activeNode: I ? E.get(I) : null,
2082
+ activeNode: R ? E.get(R) : null,
2083
2083
  config: H.layoutShiftCompensation,
2084
- initialRect: U,
2084
+ initialRect: Y,
2085
2085
  measure: v.draggable.measure
2086
2086
  });
2087
- const O = sn(M, v.draggable.measure, U), se = sn(M ? M.parentElement : null), G = k({
2087
+ const O = sn(A, v.draggable.measure, Y), se = sn(A ? A.parentElement : null), G = k({
2088
2088
  activatorEvent: null,
2089
2089
  active: null,
2090
- activeNode: M,
2090
+ activeNode: A,
2091
2091
  collisionRect: null,
2092
2092
  collisions: null,
2093
2093
  droppableRects: C,
@@ -2100,10 +2100,10 @@ const ho = /* @__PURE__ */ ut(function(t) {
2100
2100
  scrollAdjustedTranslate: null
2101
2101
  }), j = _.getNodeFor((n = G.current.over) == null ? void 0 : n.id), ae = oo({
2102
2102
  measure: v.dragOverlay.measure
2103
- }), be = (r = ae.nodeRef.current) != null ? r : M, Ie = w ? (o = ae.rect) != null ? o : O : null, Ft = !!(ae.nodeRef.current && ae.rect), Ht = Zr(Ft ? null : O), mt = Tn(be ? J(be) : null), me = Qr(w ? j ?? M : null), Ge = ro(me), Ze = Pn(f, {
2103
+ }), be = (r = ae.nodeRef.current) != null ? r : A, Ie = w ? (o = ae.rect) != null ? o : O : null, Ft = !!(ae.nodeRef.current && ae.rect), Ht = Zr(Ft ? null : O), mt = An(be ? J(be) : null), me = Qr(w ? j ?? A : null), Ge = ro(me), Ze = Pn(f, {
2104
2104
  transform: {
2105
- x: N.x - Ht.x,
2106
- y: N.y - Ht.y,
2105
+ x: M.x - Ht.x,
2106
+ y: M.y - Ht.y,
2107
2107
  scaleX: 1,
2108
2108
  scaleY: 1
2109
2109
  },
@@ -2117,14 +2117,14 @@ const ho = /* @__PURE__ */ ut(function(t) {
2117
2117
  scrollableAncestors: me,
2118
2118
  scrollableAncestorRects: Ge,
2119
2119
  windowRect: mt
2120
- }), Xt = q ? Ae(q, N) : null, Yt = eo(me), Vn = ln(Yt), Kn = ln(Yt, [O]), Re = Ae(Ze, Vn), Ee = Ie ? Sr(Ie, Ze) : null, ke = Q && Ee ? d({
2120
+ }), Xt = q ? Te(q, M) : null, Yt = eo(me), Vn = ln(Yt), Kn = ln(Yt, [O]), Re = Te(Ze, Vn), Ee = Ie ? Sr(Ie, Ze) : null, ke = Q && Ee ? d({
2121
2121
  active: Q,
2122
2122
  collisionRect: Ee,
2123
2123
  droppableRects: C,
2124
2124
  droppableContainers: Pe,
2125
2125
  pointerCoordinates: Xt
2126
- }) : null, Vt = yn(ke, "id"), [ye, Kt] = V(null), Un = Ft ? Ze : Ae(Ze, Kn), Wn = Dr(Un, (i = ye == null ? void 0 : ye.rect) != null ? i : null, O), Ut = z(
2127
- (K, ee) => {
2126
+ }) : null, Vt = yn(ke, "id"), [ye, Kt] = K(null), Un = Ft ? Ze : Te(Ze, Kn), Wn = Dr(Un, (i = ye == null ? void 0 : ye.rect) != null ? i : null, O), Ut = z(
2127
+ (U, ee) => {
2128
2128
  let {
2129
2129
  sensor: te,
2130
2130
  options: we
@@ -2134,7 +2134,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2134
2134
  const re = E.get(ne.current);
2135
2135
  if (!re)
2136
2136
  return;
2137
- const le = K.nativeEvent, ge = new te({
2137
+ const le = U.nativeEvent, ge = new te({
2138
2138
  active: ne.current,
2139
2139
  activeNode: re,
2140
2140
  event: le,
@@ -2143,27 +2143,27 @@ const ho = /* @__PURE__ */ ut(function(t) {
2143
2143
  // otherwise they are frozen in time with the stale arguments
2144
2144
  context: G,
2145
2145
  onStart(ce) {
2146
- const ze = ne.current;
2147
- if (ze == null)
2146
+ const Be = ne.current;
2147
+ if (Be == null)
2148
2148
  return;
2149
- const Be = E.get(ze);
2150
- if (!Be)
2149
+ const ze = E.get(Be);
2150
+ if (!ze)
2151
2151
  return;
2152
2152
  const {
2153
2153
  onDragStart: Qe
2154
2154
  } = pe.current, et = {
2155
2155
  active: {
2156
- id: ze,
2157
- data: Be.data,
2156
+ id: Be,
2157
+ data: ze.data,
2158
2158
  rect: Z
2159
2159
  }
2160
2160
  };
2161
2161
  je(() => {
2162
- Qe == null || Qe(et), x(xe.Initializing), b({
2162
+ Qe == null || Qe(et), D(xe.Initializing), b({
2163
2163
  type: X.DragStart,
2164
2164
  initialCoordinates: ce,
2165
- active: ze
2166
- }), D({
2165
+ active: Be
2166
+ }), x({
2167
2167
  type: "onDragStart",
2168
2168
  event: et
2169
2169
  });
@@ -2179,24 +2179,24 @@ const ho = /* @__PURE__ */ ut(function(t) {
2179
2179
  onCancel: Oe(X.DragCancel)
2180
2180
  });
2181
2181
  je(() => {
2182
- Ce(ge), Se(K.nativeEvent);
2182
+ Ce(ge), Se(U.nativeEvent);
2183
2183
  });
2184
2184
  function Oe(ce) {
2185
2185
  return async function() {
2186
2186
  const {
2187
- active: Be,
2187
+ active: ze,
2188
2188
  collisions: Qe,
2189
2189
  over: et,
2190
2190
  scrollAdjustedTranslate: Jt
2191
2191
  } = G.current;
2192
2192
  let $e = null;
2193
- if (Be && Jt) {
2193
+ if (ze && Jt) {
2194
2194
  const {
2195
2195
  cancelDrop: _e
2196
2196
  } = pe.current;
2197
2197
  $e = {
2198
2198
  activatorEvent: le,
2199
- active: Be,
2199
+ active: ze,
2200
2200
  collisions: Qe,
2201
2201
  delta: Jt,
2202
2202
  over: et
@@ -2205,11 +2205,11 @@ const ho = /* @__PURE__ */ ut(function(t) {
2205
2205
  ne.current = null, je(() => {
2206
2206
  b({
2207
2207
  type: ce
2208
- }), x(xe.Uninitialized), Kt(null), Ce(null), Se(null);
2208
+ }), D(xe.Uninitialized), Kt(null), Ce(null), Se(null);
2209
2209
  const _e = ce === X.DragEnd ? "onDragEnd" : "onDragCancel";
2210
2210
  if ($e) {
2211
2211
  const yt = pe.current[_e];
2212
- yt == null || yt($e), D({
2212
+ yt == null || yt($e), x({
2213
2213
  type: _e,
2214
2214
  event: $e
2215
2215
  });
@@ -2220,7 +2220,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2220
2220
  },
2221
2221
  // eslint-disable-next-line react-hooks/exhaustive-deps
2222
2222
  [E]
2223
- ), Jn = z((K, ee) => (te, we) => {
2223
+ ), Jn = z((U, ee) => (te, we) => {
2224
2224
  const re = te.nativeEvent, le = E.get(we);
2225
2225
  if (
2226
2226
  // Another sensor is already instantiating
@@ -2232,16 +2232,16 @@ const ho = /* @__PURE__ */ ut(function(t) {
2232
2232
  const ge = {
2233
2233
  active: le
2234
2234
  };
2235
- K(te, ee.options, ge) === !0 && (re.dndKit = {
2235
+ U(te, ee.options, ge) === !0 && (re.dndKit = {
2236
2236
  capturedBy: ee.sensor
2237
2237
  }, ne.current = we, Ut(te, ee));
2238
2238
  }, [E, Ut]), Wt = Ur(u, Jn);
2239
2239
  to(u), ie(() => {
2240
- O && R === xe.Initializing && x(xe.Initialized);
2241
- }, [O, R]), P(
2240
+ O && S === xe.Initializing && D(xe.Initialized);
2241
+ }, [O, S]), P(
2242
2242
  () => {
2243
2243
  const {
2244
- onDragMove: K
2244
+ onDragMove: U
2245
2245
  } = pe.current, {
2246
2246
  active: ee,
2247
2247
  activatorEvent: te,
@@ -2261,7 +2261,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2261
2261
  over: re
2262
2262
  };
2263
2263
  je(() => {
2264
- K == null || K(le), D({
2264
+ U == null || U(le), x({
2265
2265
  type: "onDragMove",
2266
2266
  event: le
2267
2267
  });
@@ -2272,13 +2272,13 @@ const ho = /* @__PURE__ */ ut(function(t) {
2272
2272
  ), P(
2273
2273
  () => {
2274
2274
  const {
2275
- active: K,
2275
+ active: U,
2276
2276
  activatorEvent: ee,
2277
2277
  collisions: te,
2278
2278
  droppableContainers: we,
2279
2279
  scrollAdjustedTranslate: re
2280
2280
  } = G.current;
2281
- if (!K || ne.current == null || !ee || !re)
2281
+ if (!U || ne.current == null || !ee || !re)
2282
2282
  return;
2283
2283
  const {
2284
2284
  onDragOver: le
@@ -2288,7 +2288,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2288
2288
  data: ge.data,
2289
2289
  disabled: ge.disabled
2290
2290
  } : null, ce = {
2291
- active: K,
2291
+ active: U,
2292
2292
  activatorEvent: ee,
2293
2293
  collisions: te,
2294
2294
  delta: {
@@ -2298,7 +2298,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2298
2298
  over: Oe
2299
2299
  };
2300
2300
  je(() => {
2301
- Kt(Oe), le == null || le(ce), D({
2301
+ Kt(Oe), le == null || le(ce), x({
2302
2302
  type: "onDragOver",
2303
2303
  event: ce
2304
2304
  });
@@ -2310,7 +2310,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2310
2310
  G.current = {
2311
2311
  activatorEvent: W,
2312
2312
  active: Q,
2313
- activeNode: M,
2313
+ activeNode: A,
2314
2314
  collisionRect: Ee,
2315
2315
  collisions: ke,
2316
2316
  droppableRects: C,
@@ -2325,17 +2325,17 @@ const ho = /* @__PURE__ */ ut(function(t) {
2325
2325
  initial: Ie,
2326
2326
  translated: Ee
2327
2327
  };
2328
- }, [Q, M, ke, Ee, E, be, Ie, C, _, ye, me, Re]), Xr({
2328
+ }, [Q, A, ke, Ee, E, be, Ie, C, _, ye, me, Re]), Xr({
2329
2329
  ...H,
2330
- delta: N,
2330
+ delta: M,
2331
2331
  draggingRect: Ee,
2332
2332
  pointerCoordinates: Xt,
2333
2333
  scrollableAncestors: me,
2334
2334
  scrollableAncestorRects: Ge
2335
2335
  });
2336
- const qn = T(() => ({
2336
+ const qn = N(() => ({
2337
2337
  active: Q,
2338
- activeNode: M,
2338
+ activeNode: A,
2339
2339
  activeNodeRect: O,
2340
2340
  activatorEvent: W,
2341
2341
  collisions: ke,
@@ -2351,7 +2351,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2351
2351
  measuringConfiguration: v,
2352
2352
  measuringScheduled: L,
2353
2353
  windowRect: mt
2354
- }), [Q, M, O, W, ke, se, ae, E, _, C, ye, B, me, Ge, v, L, mt]), Gn = T(() => ({
2354
+ }), [Q, A, O, W, ke, se, ae, E, _, C, ye, B, me, Ge, v, L, mt]), Gn = N(() => ({
2355
2355
  activatorEvent: W,
2356
2356
  activators: Wt,
2357
2357
  active: Q,
@@ -2379,7 +2379,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2379
2379
  hiddenTextDescribedById: ve
2380
2380
  }));
2381
2381
  function Zn() {
2382
- const K = (fe == null ? void 0 : fe.autoScrollEnabled) === !1, ee = typeof l == "object" ? l.enabled === !1 : l === !1, te = w && !K && !ee;
2382
+ const U = (fe == null ? void 0 : fe.autoScrollEnabled) === !1, ee = typeof l == "object" ? l.enabled === !1 : l === !1, te = w && !U && !ee;
2383
2383
  return typeof l == "object" ? {
2384
2384
  ...l,
2385
2385
  enabled: te
@@ -2407,22 +2407,22 @@ function bo(e) {
2407
2407
  role: f = cn,
2408
2408
  roleDescription: m = "draggable",
2409
2409
  tabIndex: g = 0
2410
- } = o ?? {}, p = (l == null ? void 0 : l.id) === t, b = De(p ? vt : po), [D, y] = ot(), [R, x] = ot(), w = no(s, t), I = Ye(n);
2410
+ } = o ?? {}, p = (l == null ? void 0 : l.id) === t, b = De(p ? vt : po), [x, y] = ot(), [S, D] = ot(), w = no(s, t), R = Ye(n);
2411
2411
  ie(
2412
2412
  () => (d.set(t, {
2413
2413
  id: t,
2414
2414
  key: i,
2415
- node: D,
2416
- activatorNode: R,
2417
- data: I
2415
+ node: x,
2416
+ activatorNode: S,
2417
+ data: R
2418
2418
  }), () => {
2419
- const N = d.get(t);
2420
- N && N.key === i && d.delete(t);
2419
+ const M = d.get(t);
2420
+ M && M.key === i && d.delete(t);
2421
2421
  }),
2422
2422
  // eslint-disable-next-line react-hooks/exhaustive-deps
2423
2423
  [d, t]
2424
2424
  );
2425
- const E = T(() => ({
2425
+ const E = N(() => ({
2426
2426
  role: f,
2427
2427
  tabIndex: g,
2428
2428
  "aria-disabled": r,
@@ -2437,10 +2437,10 @@ function bo(e) {
2437
2437
  attributes: E,
2438
2438
  isDragging: p,
2439
2439
  listeners: r ? void 0 : w,
2440
- node: D,
2440
+ node: x,
2441
2441
  over: h,
2442
2442
  setNodeRef: y,
2443
- setActivatorNodeRef: x,
2443
+ setActivatorNodeRef: D,
2444
2444
  transform: b
2445
2445
  };
2446
2446
  }
@@ -2471,7 +2471,7 @@ function wo(e) {
2471
2471
  } = {
2472
2472
  ...yo,
2473
2473
  ...o
2474
- }, b = Ye(g ?? r), D = z(
2474
+ }, b = Ye(g ?? r), x = z(
2475
2475
  () => {
2476
2476
  if (!d.current) {
2477
2477
  d.current = !0;
@@ -2484,23 +2484,23 @@ function wo(e) {
2484
2484
  //eslint-disable-next-line react-hooks/exhaustive-deps
2485
2485
  [p]
2486
2486
  ), y = pt({
2487
- callback: D,
2487
+ callback: x,
2488
2488
  disabled: m || !s
2489
- }), R = z((E, N) => {
2490
- y && (N && (y.unobserve(N), d.current = !1), E && y.observe(E));
2491
- }, [y]), [x, w] = ot(R), I = Ye(t);
2489
+ }), S = z((E, M) => {
2490
+ y && (M && (y.unobserve(M), d.current = !1), E && y.observe(E));
2491
+ }, [y]), [D, w] = ot(S), R = Ye(t);
2492
2492
  return P(() => {
2493
- !y || !x.current || (y.disconnect(), d.current = !1, y.observe(x.current));
2494
- }, [x, y]), ie(
2493
+ !y || !D.current || (y.disconnect(), d.current = !1, y.observe(D.current));
2494
+ }, [D, y]), ie(
2495
2495
  () => (a({
2496
2496
  type: X.RegisterDroppable,
2497
2497
  element: {
2498
2498
  id: r,
2499
2499
  key: i,
2500
2500
  disabled: n,
2501
- node: x,
2501
+ node: D,
2502
2502
  rect: h,
2503
- data: I
2503
+ data: R
2504
2504
  }
2505
2505
  }), () => a({
2506
2506
  type: X.UnregisterDroppable,
@@ -2520,7 +2520,7 @@ function wo(e) {
2520
2520
  active: s,
2521
2521
  rect: h,
2522
2522
  isOver: (l == null ? void 0 : l.id) === r,
2523
- node: x,
2523
+ node: D,
2524
2524
  over: l,
2525
2525
  setNodeRef: w
2526
2526
  };
@@ -2530,7 +2530,7 @@ function xo(e) {
2530
2530
  animation: t,
2531
2531
  children: n
2532
2532
  } = e;
2533
- const [r, o] = V(null), [i, s] = V(null), a = it(n);
2533
+ const [r, o] = K(null), [i, s] = K(null), a = it(n);
2534
2534
  return !n && !r && a && o(a), ie(() => {
2535
2535
  if (!i)
2536
2536
  return;
@@ -2557,7 +2557,7 @@ function Co(e) {
2557
2557
  children: t
2558
2558
  } = e;
2559
2559
  return F.createElement(qe.Provider, {
2560
- value: Nn
2560
+ value: Mn
2561
2561
  }, F.createElement(vt.Provider, {
2562
2562
  value: Do
2563
2563
  }, t));
@@ -2631,7 +2631,7 @@ const So = {
2631
2631
  }, {
2632
2632
  transform: he.Transform.toString(n)
2633
2633
  }];
2634
- }, At = {
2634
+ }, Tt = {
2635
2635
  duration: 250,
2636
2636
  easing: "ease",
2637
2637
  keyframes: Oo,
@@ -2643,7 +2643,7 @@ const So = {
2643
2643
  }
2644
2644
  })
2645
2645
  };
2646
- function Ao(e) {
2646
+ function To(e) {
2647
2647
  let {
2648
2648
  config: t,
2649
2649
  draggableNodes: n,
@@ -2659,7 +2659,7 @@ function Ao(e) {
2659
2659
  const l = a.node.current;
2660
2660
  if (!l)
2661
2661
  return;
2662
- const c = Mn(s);
2662
+ const c = Nn(s);
2663
2663
  if (!c)
2664
2664
  return;
2665
2665
  const {
@@ -2667,7 +2667,7 @@ function Ao(e) {
2667
2667
  } = J(s).getComputedStyle(s), d = xn(u);
2668
2668
  if (!d)
2669
2669
  return;
2670
- const h = typeof t == "function" ? t : To(t);
2670
+ const h = typeof t == "function" ? t : Ao(t);
2671
2671
  return On(l, o.draggable.measure), h({
2672
2672
  active: {
2673
2673
  id: i,
@@ -2686,14 +2686,14 @@ function Ao(e) {
2686
2686
  });
2687
2687
  });
2688
2688
  }
2689
- function To(e) {
2689
+ function Ao(e) {
2690
2690
  const {
2691
2691
  duration: t,
2692
2692
  easing: n,
2693
2693
  sideEffects: r,
2694
2694
  keyframes: o
2695
2695
  } = {
2696
- ...At,
2696
+ ...Tt,
2697
2697
  ...e
2698
2698
  };
2699
2699
  return (i) => {
@@ -2735,21 +2735,21 @@ function To(e) {
2735
2735
  easing: n,
2736
2736
  fill: "forwards"
2737
2737
  });
2738
- return new Promise((D) => {
2738
+ return new Promise((x) => {
2739
2739
  b.onfinish = () => {
2740
- p == null || p(), D();
2740
+ p == null || p(), x();
2741
2741
  };
2742
2742
  });
2743
2743
  };
2744
2744
  }
2745
2745
  let un = 0;
2746
- function Mo(e) {
2747
- return T(() => {
2746
+ function No(e) {
2747
+ return N(() => {
2748
2748
  if (e != null)
2749
2749
  return un++, un;
2750
2750
  }, [e]);
2751
2751
  }
2752
- const No = /* @__PURE__ */ F.memo((e) => {
2752
+ const Mo = /* @__PURE__ */ F.memo((e) => {
2753
2753
  let {
2754
2754
  adjustScale: t = !1,
2755
2755
  children: n,
@@ -2770,11 +2770,11 @@ const No = /* @__PURE__ */ F.memo((e) => {
2770
2770
  droppableContainers: g,
2771
2771
  dragOverlay: p,
2772
2772
  over: b,
2773
- measuringConfiguration: D,
2773
+ measuringConfiguration: x,
2774
2774
  scrollableAncestors: y,
2775
- scrollableAncestorRects: R,
2776
- windowRect: x
2777
- } = kn(), w = De(vt), I = Mo(d == null ? void 0 : d.id), E = Pn(s, {
2775
+ scrollableAncestorRects: S,
2776
+ windowRect: D
2777
+ } = kn(), w = De(vt), R = No(d == null ? void 0 : d.id), E = Pn(s, {
2778
2778
  activatorEvent: u,
2779
2779
  active: d,
2780
2780
  activeNodeRect: h,
@@ -2783,27 +2783,27 @@ const No = /* @__PURE__ */ F.memo((e) => {
2783
2783
  over: b,
2784
2784
  overlayNodeRect: p.rect,
2785
2785
  scrollableAncestors: y,
2786
- scrollableAncestorRects: R,
2786
+ scrollableAncestorRects: S,
2787
2787
  transform: w,
2788
- windowRect: x
2789
- }), N = jt(h), _ = Ao({
2788
+ windowRect: D
2789
+ }), M = jt(h), _ = To({
2790
2790
  config: r,
2791
2791
  draggableNodes: m,
2792
2792
  droppableContainers: g,
2793
- measuringConfiguration: D
2794
- }), A = N ? p.setRef : void 0;
2793
+ measuringConfiguration: x
2794
+ }), T = M ? p.setRef : void 0;
2795
2795
  return F.createElement(Co, null, F.createElement(xo, {
2796
2796
  animation: _
2797
- }, d && I ? F.createElement(Ro, {
2798
- key: I,
2797
+ }, d && R ? F.createElement(Ro, {
2798
+ key: R,
2799
2799
  id: d.id,
2800
- ref: A,
2800
+ ref: T,
2801
2801
  as: a,
2802
2802
  activatorEvent: u,
2803
2803
  adjustScale: t,
2804
2804
  className: l,
2805
2805
  transition: i,
2806
- rect: N,
2806
+ rect: M,
2807
2807
  style: {
2808
2808
  zIndex: c,
2809
2809
  ...o
@@ -2840,7 +2840,7 @@ function ko(e) {
2840
2840
  droppable: e
2841
2841
  } : e;
2842
2842
  }
2843
- const zn = (e) => {
2843
+ const Bn = (e) => {
2844
2844
  let {
2845
2845
  rects: t,
2846
2846
  activeIndex: n,
@@ -2857,7 +2857,7 @@ const zn = (e) => {
2857
2857
  }, nt = {
2858
2858
  scaleX: 1,
2859
2859
  scaleY: 1
2860
- }, zo = (e) => {
2860
+ }, Bo = (e) => {
2861
2861
  var t;
2862
2862
  let {
2863
2863
  activeIndex: n,
@@ -2877,7 +2877,7 @@ const zn = (e) => {
2877
2877
  ...nt
2878
2878
  } : null;
2879
2879
  }
2880
- const l = Bo(i, o, n);
2880
+ const l = zo(i, o, n);
2881
2881
  return o > n && o <= s ? {
2882
2882
  x: 0,
2883
2883
  y: -a.height - l,
@@ -2892,19 +2892,19 @@ const zn = (e) => {
2892
2892
  ...nt
2893
2893
  };
2894
2894
  };
2895
- function Bo(e, t, n) {
2895
+ function zo(e, t, n) {
2896
2896
  const r = e[t], o = e[t - 1], i = e[t + 1];
2897
2897
  return r ? n < t ? o ? r.top - (o.top + o.height) : i ? i.top - (r.top + r.height) : 0 : i ? i.top - (r.top + r.height) : o ? r.top - (o.top + o.height) : 0 : 0;
2898
2898
  }
2899
- const Bn = "Sortable", $n = /* @__PURE__ */ F.createContext({
2899
+ const zn = "Sortable", $n = /* @__PURE__ */ F.createContext({
2900
2900
  activeIndex: -1,
2901
- containerId: Bn,
2901
+ containerId: zn,
2902
2902
  disableTransforms: !1,
2903
2903
  items: [],
2904
2904
  overIndex: -1,
2905
2905
  useDragOverlay: !1,
2906
2906
  sortedRects: [],
2907
- strategy: zn,
2907
+ strategy: Bn,
2908
2908
  disabled: {
2909
2909
  draggable: !1,
2910
2910
  droppable: !1
@@ -2915,7 +2915,7 @@ function $o(e) {
2915
2915
  children: t,
2916
2916
  id: n,
2917
2917
  items: r,
2918
- strategy: o = zn,
2918
+ strategy: o = Bn,
2919
2919
  disabled: i = !1
2920
2920
  } = e;
2921
2921
  const {
@@ -2924,17 +2924,17 @@ function $o(e) {
2924
2924
  droppableRects: l,
2925
2925
  over: c,
2926
2926
  measureDroppableContainers: u
2927
- } = kn(), d = Je(Bn, n), h = a.rect !== null, f = T(() => r.map((w) => typeof w == "object" && "id" in w ? w.id : w), [r]), m = s != null, g = s ? f.indexOf(s.id) : -1, p = c ? f.indexOf(c.id) : -1, b = k(f), D = !Po(f, b.current), y = p !== -1 && g === -1 || D, R = ko(i);
2927
+ } = kn(), d = Je(zn, n), h = a.rect !== null, f = N(() => r.map((w) => typeof w == "object" && "id" in w ? w.id : w), [r]), m = s != null, g = s ? f.indexOf(s.id) : -1, p = c ? f.indexOf(c.id) : -1, b = k(f), x = !Po(f, b.current), y = p !== -1 && g === -1 || x, S = ko(i);
2928
2928
  ie(() => {
2929
- D && m && u(f);
2930
- }, [D, f, m, u]), P(() => {
2929
+ x && m && u(f);
2930
+ }, [x, f, m, u]), P(() => {
2931
2931
  b.current = f;
2932
2932
  }, [f]);
2933
- const x = T(
2933
+ const D = N(
2934
2934
  () => ({
2935
2935
  activeIndex: g,
2936
2936
  containerId: d,
2937
- disabled: R,
2937
+ disabled: S,
2938
2938
  disableTransforms: y,
2939
2939
  items: f,
2940
2940
  overIndex: p,
@@ -2943,10 +2943,10 @@ function $o(e) {
2943
2943
  strategy: o
2944
2944
  }),
2945
2945
  // eslint-disable-next-line react-hooks/exhaustive-deps
2946
- [g, d, R.draggable, R.droppable, y, f, p, l, h, o]
2946
+ [g, d, S.draggable, S.droppable, y, f, p, l, h, o]
2947
2947
  );
2948
2948
  return F.createElement($n.Provider, {
2949
- value: x
2949
+ value: D
2950
2950
  }, t);
2951
2951
  }
2952
2952
  const _o = (e) => {
@@ -2987,7 +2987,7 @@ function Yo(e) {
2987
2987
  node: r,
2988
2988
  rect: o
2989
2989
  } = e;
2990
- const [i, s] = V(null), a = k(n);
2990
+ const [i, s] = K(null), a = k(n);
2991
2991
  return ie(() => {
2992
2992
  if (!t && n !== a.current && r.current) {
2993
2993
  const l = o.current;
@@ -3029,29 +3029,29 @@ function Vo(e) {
3029
3029
  sortedRects: g,
3030
3030
  overIndex: p,
3031
3031
  useDragOverlay: b,
3032
- strategy: D
3033
- } = De($n), y = Ko(r, f), R = u.indexOf(s), x = T(() => ({
3032
+ strategy: x
3033
+ } = De($n), y = Ko(r, f), S = u.indexOf(s), D = N(() => ({
3034
3034
  sortable: {
3035
3035
  containerId: d,
3036
- index: R,
3036
+ index: S,
3037
3037
  items: u
3038
3038
  },
3039
3039
  ...o
3040
- }), [d, o, R, u]), w = T(() => u.slice(u.indexOf(s)), [u, s]), {
3041
- rect: I,
3040
+ }), [d, o, S, u]), w = N(() => u.slice(u.indexOf(s)), [u, s]), {
3041
+ rect: R,
3042
3042
  node: E,
3043
- isOver: N,
3043
+ isOver: M,
3044
3044
  setNodeRef: _
3045
3045
  } = wo({
3046
3046
  id: s,
3047
- data: x,
3047
+ data: D,
3048
3048
  disabled: y.droppable,
3049
3049
  resizeObserverConfig: {
3050
3050
  updateMeasurementsFor: w,
3051
3051
  ...l
3052
3052
  }
3053
3053
  }), {
3054
- active: A,
3054
+ active: T,
3055
3055
  activatorEvent: Z,
3056
3056
  activeNodeRect: Q,
3057
3057
  attributes: ne,
@@ -3063,35 +3063,35 @@ function Vo(e) {
3063
3063
  transform: ve
3064
3064
  } = bo({
3065
3065
  id: s,
3066
- data: x,
3066
+ data: D,
3067
3067
  attributes: {
3068
3068
  ...Xo,
3069
3069
  ...n
3070
3070
  },
3071
3071
  disabled: y.draggable
3072
- }), Pe = tr(_, fe), v = !!A, C = v && !m && tt(h) && tt(p), B = !b && W, L = B && C ? ve : null, q = C ? L ?? (a ?? D)({
3072
+ }), Pe = tr(_, fe), v = !!T, C = v && !m && tt(h) && tt(p), B = !b && W, L = B && C ? ve : null, q = C ? L ?? (a ?? x)({
3073
3073
  rects: g,
3074
3074
  activeNodeRect: Q,
3075
3075
  activeIndex: h,
3076
3076
  overIndex: p,
3077
- index: R
3077
+ index: S
3078
3078
  }) : null, H = tt(h) && tt(p) ? i({
3079
3079
  id: s,
3080
3080
  items: u,
3081
3081
  activeIndex: h,
3082
3082
  overIndex: p
3083
- }) : R, U = A == null ? void 0 : A.id, O = k({
3084
- activeId: U,
3083
+ }) : S, Y = T == null ? void 0 : T.id, O = k({
3084
+ activeId: Y,
3085
3085
  items: u,
3086
3086
  newIndex: H,
3087
3087
  containerId: d
3088
3088
  }), se = u !== O.current.items, G = t({
3089
- active: A,
3089
+ active: T,
3090
3090
  containerId: d,
3091
3091
  isDragging: W,
3092
3092
  isSorting: v,
3093
3093
  id: s,
3094
- index: R,
3094
+ index: S,
3095
3095
  items: u,
3096
3096
  newIndex: O.current.newIndex,
3097
3097
  previousItems: O.current.items,
@@ -3100,33 +3100,33 @@ function Vo(e) {
3100
3100
  wasDragging: O.current.activeId != null
3101
3101
  }), j = Yo({
3102
3102
  disabled: !G,
3103
- index: R,
3103
+ index: S,
3104
3104
  node: E,
3105
- rect: I
3105
+ rect: R
3106
3106
  });
3107
3107
  return P(() => {
3108
3108
  v && O.current.newIndex !== H && (O.current.newIndex = H), d !== O.current.containerId && (O.current.containerId = d), u !== O.current.items && (O.current.items = u);
3109
3109
  }, [v, H, d, u]), P(() => {
3110
- if (U === O.current.activeId)
3110
+ if (Y === O.current.activeId)
3111
3111
  return;
3112
- if (U && !O.current.activeId) {
3113
- O.current.activeId = U;
3112
+ if (Y && !O.current.activeId) {
3113
+ O.current.activeId = Y;
3114
3114
  return;
3115
3115
  }
3116
3116
  const be = setTimeout(() => {
3117
- O.current.activeId = U;
3117
+ O.current.activeId = Y;
3118
3118
  }, 50);
3119
3119
  return () => clearTimeout(be);
3120
- }, [U]), {
3121
- active: A,
3120
+ }, [Y]), {
3121
+ active: T,
3122
3122
  activeIndex: h,
3123
3123
  attributes: ne,
3124
- data: x,
3125
- rect: I,
3126
- index: R,
3124
+ data: D,
3125
+ rect: R,
3126
+ index: S,
3127
3127
  newIndex: H,
3128
3128
  items: u,
3129
- isOver: N,
3129
+ isOver: M,
3130
3130
  isSorting: v,
3131
3131
  isDragging: W,
3132
3132
  listeners: Ce,
@@ -3144,7 +3144,7 @@ function Vo(e) {
3144
3144
  if (
3145
3145
  // Temporarily disable transitions for a single frame to set up derived transforms
3146
3146
  j || // Or to prevent items jumping to back to their "new" position when items change
3147
- se && O.current.newIndex === R
3147
+ se && O.current.newIndex === S
3148
3148
  )
3149
3149
  return Ho;
3150
3150
  if (!(B && !ht(Z) || !c) && (v || G))
@@ -3165,20 +3165,20 @@ function Ko(e, t) {
3165
3165
  droppable: (r = e == null ? void 0 : e.droppable) != null ? r : t.droppable
3166
3166
  };
3167
3167
  }
3168
- S.Down, S.Right, S.Up, S.Left;
3168
+ I.Down, I.Right, I.Up, I.Left;
3169
3169
  const Uo = /iPad|iPhone|iPod/.test(navigator.platform);
3170
3170
  function Wo(e, t) {
3171
3171
  return Math.round(e / t);
3172
3172
  }
3173
- function Tt(e, t, n, r, o) {
3173
+ function At(e, t, n, r, o) {
3174
3174
  const i = e.findIndex(({ id: b }) => b === n), s = e.findIndex(({ id: b }) => b === t), a = e[s], l = Ve(e, s, i), c = l[i - 1], u = l[i + 1], d = Wo(r, o), h = a.depth + d, f = Jo({
3175
3175
  previousItem: c
3176
3176
  }), m = qo({ nextItem: u });
3177
3177
  let g = h;
3178
3178
  return h >= f ? g = f : h < m && (g = m), { depth: g, maxDepth: f, minDepth: m, parentId: p() };
3179
3179
  function p() {
3180
- var D;
3181
- return g === 0 || !c ? null : g === c.depth ? c.parentId : g > c.depth ? c.id : ((D = l.slice(0, i).reverse().find((y) => y.depth === g)) == null ? void 0 : D.parentId) ?? null;
3180
+ var x;
3181
+ return g === 0 || !c ? null : g === c.depth ? c.parentId : g > c.depth ? c.id : ((x = l.slice(0, i).reverse().find((y) => y.depth === g)) == null ? void 0 : x.parentId) ?? null;
3182
3182
  }
3183
3183
  }
3184
3184
  function Jo({ previousItem: e }) {
@@ -3208,64 +3208,68 @@ function Qo(e, t) {
3208
3208
  return Fn(e, t);
3209
3209
  }
3210
3210
  function ei(e, t) {
3211
- const { items: n, itemMap: r } = e, o = new Map(r);
3212
- function i(a) {
3213
- return a.filter((l) => l.id === t ? (o.delete(t), !1) : (l.children.length && (l.children = i(l.children)), !0));
3211
+ function n(o) {
3212
+ return o.filter((i) => i.id !== t).map((i) => ({
3213
+ ...i,
3214
+ children: n(i.children || [])
3215
+ }));
3214
3216
  }
3215
- return { items: i(n), itemMap: o };
3217
+ return n(e);
3216
3218
  }
3217
3219
  function ti(e, t, n) {
3218
- const { items: r, itemMap: o } = e, i = Fn(e, t);
3219
- if (!i) return e;
3220
- const s = { ...i, ...n(i) }, a = new Map(o);
3221
- a.set(t, s);
3222
- function l(u) {
3223
- return u.map((d) => d.id === t ? (s.children && s.children.forEach((h) => {
3224
- a.set(h.id, h);
3225
- }), s) : d.children.length ? { ...d, children: l(d.children) } : d);
3220
+ function r(i) {
3221
+ return i.map((s) => {
3222
+ if (s.id === t) {
3223
+ const a = { ...s, ...n(s) };
3224
+ return a.children && a.children.length > 0 && (a.children = r(a.children)), a;
3225
+ } else return s.children && s.children.length > 0 ? {
3226
+ ...s,
3227
+ children: r(s.children)
3228
+ } : s;
3229
+ });
3226
3230
  }
3227
- return { items: l(r), itemMap: a };
3231
+ return r(e);
3228
3232
  }
3229
3233
  function Fn(e, t) {
3230
- const { itemMap: n } = e;
3231
- return n.get(t);
3232
- }
3233
- function ni(e) {
3234
- const t = /* @__PURE__ */ new Map();
3235
- function n(r) {
3236
- t.set(r.id, r), r.children.forEach(n);
3234
+ for (const n of e) {
3235
+ if (n.id === t)
3236
+ return n;
3237
+ if (n.children && n.children.length > 0) {
3238
+ const r = Fn(n.children, t);
3239
+ if (r)
3240
+ return r;
3241
+ }
3237
3242
  }
3238
- return e.forEach(n), { items: e, itemMap: t };
3239
3243
  }
3240
3244
  function Hn(e, t = 0) {
3241
3245
  return e.reduce((n, { children: r }) => r.length ? Hn(r, n + 1) : n + 1, t);
3242
3246
  }
3243
- function ri(e, t) {
3247
+ function ni(e, t) {
3244
3248
  const n = Qo(e, t);
3245
3249
  return n ? Hn(n.children) : 0;
3246
3250
  }
3247
- function oi(e, t) {
3251
+ function ri(e, t) {
3248
3252
  const n = [...t];
3249
3253
  return e.filter((r) => r.parentId && n.includes(r.parentId) ? (r.children.length && n.push(r.id), !1) : !0);
3250
3254
  }
3251
- const ii = [
3252
- S.Down,
3253
- S.Right,
3254
- S.Up,
3255
- S.Left
3256
- ], si = [S.Left, S.Right], ai = (e, t, n) => (r, {
3255
+ const oi = [
3256
+ I.Down,
3257
+ I.Right,
3258
+ I.Up,
3259
+ I.Left
3260
+ ], ii = [I.Left, I.Right], si = (e, t, n) => (r, {
3257
3261
  currentCoordinates: o,
3258
3262
  context: { active: i, over: s, collisionRect: a, droppableRects: l, droppableContainers: c }
3259
3263
  }) => {
3260
- if (ii.includes(r.code)) {
3264
+ if (oi.includes(r.code)) {
3261
3265
  if (!i || !a)
3262
3266
  return;
3263
3267
  r.preventDefault();
3264
3268
  const {
3265
3269
  current: { items: u, offset: d }
3266
3270
  } = e;
3267
- if (si.includes(r.code) && (s != null && s.id)) {
3268
- const { depth: g, maxDepth: p, minDepth: b } = Tt(
3271
+ if (ii.includes(r.code) && (s != null && s.id)) {
3272
+ const { depth: g, maxDepth: p, minDepth: b } = At(
3269
3273
  u,
3270
3274
  i.id,
3271
3275
  s.id,
@@ -3273,14 +3277,14 @@ const ii = [
3273
3277
  n
3274
3278
  );
3275
3279
  switch (r.code) {
3276
- case S.Left:
3280
+ case I.Left:
3277
3281
  if (g > b)
3278
3282
  return {
3279
3283
  ...o,
3280
3284
  x: o.x - n
3281
3285
  };
3282
3286
  break;
3283
- case S.Right:
3287
+ case I.Right:
3284
3288
  if (g < p)
3285
3289
  return {
3286
3290
  ...o,
@@ -3297,10 +3301,10 @@ const ii = [
3297
3301
  const p = l.get(g.id);
3298
3302
  if (p)
3299
3303
  switch (r.code) {
3300
- case S.Down:
3304
+ case I.Down:
3301
3305
  a.top < p.top && h.push(g);
3302
3306
  break;
3303
- case S.Up:
3307
+ case I.Up:
3304
3308
  a.top > p.top && h.push(g);
3305
3309
  break;
3306
3310
  }
@@ -3316,37 +3320,37 @@ const ii = [
3316
3320
  if (m === (s == null ? void 0 : s.id) && f.length > 1 && (m = f[1].id), m && (s != null && s.id)) {
3317
3321
  const g = l.get(i.id), p = l.get(m), b = c.get(m);
3318
3322
  if (g && p && b) {
3319
- const D = u.findIndex(({ id: w }) => w === m), y = u[D], R = u.findIndex(({ id: w }) => w === i.id), x = u[R];
3320
- if (y && x) {
3321
- const { depth: w } = Tt(
3323
+ const x = u.findIndex(({ id: w }) => w === m), y = u[x], S = u.findIndex(({ id: w }) => w === i.id), D = u[S];
3324
+ if (y && D) {
3325
+ const { depth: w } = At(
3322
3326
  u,
3323
3327
  i.id,
3324
3328
  m,
3325
- (y.depth - x.depth) * n,
3329
+ (y.depth - D.depth) * n,
3326
3330
  n
3327
- ), E = D > R ? 1 : -1, N = t ? (a.height - g.height) / 2 : 0;
3331
+ ), E = x > S ? 1 : -1, M = t ? (a.height - g.height) / 2 : 0;
3328
3332
  return {
3329
3333
  x: p.left + w * n,
3330
- y: p.top + E * N
3334
+ y: p.top + E * M
3331
3335
  };
3332
3336
  }
3333
3337
  }
3334
3338
  }
3335
3339
  }
3336
- }, li = "_Wrapper_wguit_1", ci = "_clone_wguit_8", ui = "_TreeItem_wguit_16", di = "_ghost_wguit_23", fi = "_indicator_wguit_23", gi = "_Text_wguit_78", hi = "_Count_wguit_90", pi = "_disableInteraction_wguit_106", vi = "_disableSelection_wguit_110", bi = "_Collapse_wguit_118", mi = "_collapsed_wguit_122", ue = {
3337
- Wrapper: li,
3338
- clone: ci,
3339
- TreeItem: ui,
3340
- ghost: di,
3341
- indicator: fi,
3342
- Text: gi,
3343
- Count: hi,
3344
- disableInteraction: pi,
3345
- disableSelection: vi,
3346
- Collapse: bi,
3347
- collapsed: mi
3340
+ }, ai = "_Wrapper_wguit_1", li = "_clone_wguit_8", ci = "_TreeItem_wguit_16", ui = "_ghost_wguit_23", di = "_indicator_wguit_23", fi = "_Text_wguit_78", gi = "_Count_wguit_90", hi = "_disableInteraction_wguit_106", pi = "_disableSelection_wguit_110", vi = "_Collapse_wguit_118", bi = "_collapsed_wguit_122", ue = {
3341
+ Wrapper: ai,
3342
+ clone: li,
3343
+ TreeItem: ci,
3344
+ ghost: ui,
3345
+ indicator: di,
3346
+ Text: fi,
3347
+ Count: gi,
3348
+ disableInteraction: hi,
3349
+ disableSelection: pi,
3350
+ Collapse: vi,
3351
+ collapsed: bi
3348
3352
  };
3349
- function yi(e) {
3353
+ function mi(e) {
3350
3354
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3351
3355
  }
3352
3356
  var Xn = { exports: {} };
@@ -3385,16 +3389,16 @@ var Xn = { exports: {} };
3385
3389
  e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
3386
3390
  })();
3387
3391
  })(Xn);
3388
- var wi = Xn.exports;
3389
- const Mt = /* @__PURE__ */ yi(wi), xi = "_Action_7i4a4_1", Di = {
3390
- Action: xi
3392
+ var yi = Xn.exports;
3393
+ const Nt = /* @__PURE__ */ mi(yi), wi = "_Action_7i4a4_1", xi = {
3394
+ Action: wi
3391
3395
  }, bt = dt(
3392
3396
  ({ active: e, className: t, cursor: n, style: r, ...o }, i) => /* @__PURE__ */ $(
3393
3397
  "button",
3394
3398
  {
3395
3399
  ref: i,
3396
3400
  ...o,
3397
- className: Mt(Di.Action, t),
3401
+ className: Nt(xi.Action, t),
3398
3402
  tabIndex: 0,
3399
3403
  style: {
3400
3404
  ...r,
@@ -3404,8 +3408,8 @@ const Mt = /* @__PURE__ */ yi(wi), xi = "_Action_7i4a4_1", Di = {
3404
3408
  }
3405
3409
  }
3406
3410
  )
3407
- ), Ci = dt((e, t) => /* @__PURE__ */ $(bt, { ref: t, cursor: "grab", "data-cypress": "draggable-handle", ...e, children: /* @__PURE__ */ $("svg", { viewBox: "0 0 20 20", width: "12", children: /* @__PURE__ */ $("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }) }) }));
3408
- function Si(e) {
3411
+ ), Di = dt((e, t) => /* @__PURE__ */ $(bt, { ref: t, cursor: "grab", "data-cypress": "draggable-handle", ...e, children: /* @__PURE__ */ $("svg", { viewBox: "0 0 20 20", width: "12", children: /* @__PURE__ */ $("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }) }) }));
3412
+ function Ci(e) {
3409
3413
  return /* @__PURE__ */ $(
3410
3414
  bt,
3411
3415
  {
@@ -3428,7 +3432,7 @@ function Si(e) {
3428
3432
  }
3429
3433
  );
3430
3434
  }
3431
- function Ii(e) {
3435
+ function Si(e) {
3432
3436
  return /* @__PURE__ */ $(
3433
3437
  bt,
3434
3438
  {
@@ -3451,7 +3455,7 @@ function Ii(e) {
3451
3455
  }
3452
3456
  );
3453
3457
  }
3454
- const Ri = dt(
3458
+ const Ii = dt(
3455
3459
  ({
3456
3460
  childCount: e,
3457
3461
  clone: t,
@@ -3471,11 +3475,12 @@ const Ri = dt(
3471
3475
  style: g,
3472
3476
  value: p,
3473
3477
  wrapperRef: b,
3474
- ...D
3475
- }, y) => /* @__PURE__ */ $(
3478
+ renderedItem: x,
3479
+ ...y
3480
+ }, S) => /* @__PURE__ */ $(
3476
3481
  "li",
3477
3482
  {
3478
- className: Mt(
3483
+ className: Nt(
3479
3484
  ue.Wrapper,
3480
3485
  t && ue.clone,
3481
3486
  s && ue.ghost,
@@ -3487,25 +3492,26 @@ const Ri = dt(
3487
3492
  style: {
3488
3493
  "--spacing": `${l * n}px`
3489
3494
  },
3490
- ...D,
3491
- children: /* @__PURE__ */ fn("div", { className: ue.TreeItem, ref: y, style: g, children: [
3492
- !i && /* @__PURE__ */ $(Ci, { ...a }),
3495
+ ...y,
3496
+ children: /* @__PURE__ */ fn("div", { className: ue.TreeItem, ref: S, style: g, children: [
3497
+ !i && /* @__PURE__ */ $(Di, { ...a }),
3493
3498
  d && /* @__PURE__ */ $(
3494
3499
  bt,
3495
3500
  {
3496
3501
  onClick: d,
3497
- className: Mt(ue.Collapse, u && ue.collapsed),
3498
- children: Ei
3502
+ className: Nt(ue.Collapse, u && ue.collapsed),
3503
+ children: Ri
3499
3504
  }
3500
3505
  ),
3501
3506
  /* @__PURE__ */ $("span", { onClick: m, className: ue.Text, children: p }),
3502
- !t && h && /* @__PURE__ */ $(Si, { onClick: h }),
3503
- !t && f && /* @__PURE__ */ $(Ii, { onClick: f }),
3507
+ !t && x && x,
3508
+ !t && h && /* @__PURE__ */ $(Ci, { onClick: h }),
3509
+ !t && f && /* @__PURE__ */ $(Si, { onClick: f }),
3504
3510
  t && e && e > 1 ? /* @__PURE__ */ $("span", { className: ue.Count, children: e }) : null
3505
3511
  ] })
3506
3512
  }
3507
3513
  )
3508
- ), Ei = /* @__PURE__ */ $("svg", { width: "10", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 70 41", children: /* @__PURE__ */ $("path", { d: "M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z" }) }), Oi = ut(Ri), Ai = ({ isSorting: e, wasDragging: t }) => !(e || t);
3514
+ ), Ri = /* @__PURE__ */ $("svg", { width: "10", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 70 41", children: /* @__PURE__ */ $("path", { d: "M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z" }) }), Ei = ut(Ii), Oi = ({ isSorting: e, wasDragging: t }) => !(e || t);
3509
3515
  function Ti({ id: e, depth: t, ...n }) {
3510
3516
  const {
3511
3517
  attributes: r,
@@ -3518,13 +3524,13 @@ function Ti({ id: e, depth: t, ...n }) {
3518
3524
  transition: u
3519
3525
  } = Vo({
3520
3526
  id: e,
3521
- animateLayoutChanges: Ai
3527
+ animateLayoutChanges: Oi
3522
3528
  }), d = {
3523
3529
  transform: he.Translate.toString(c),
3524
3530
  transition: u
3525
3531
  };
3526
3532
  return /* @__PURE__ */ $(
3527
- Oi,
3533
+ Ei,
3528
3534
  {
3529
3535
  ref: a,
3530
3536
  wrapperRef: l,
@@ -3541,9 +3547,9 @@ function Ti({ id: e, depth: t, ...n }) {
3541
3547
  }
3542
3548
  );
3543
3549
  }
3544
- const dn = ut(Ti), Mi = {
3550
+ const dn = ut(Ti), Ai = {
3545
3551
  droppable: {
3546
- strategy: Te.Always
3552
+ strategy: Ae.Always
3547
3553
  }
3548
3554
  }, Ni = {
3549
3555
  keyframes({ transform: e }) {
@@ -3562,14 +3568,14 @@ const dn = ut(Ti), Mi = {
3562
3568
  easing: "ease-out",
3563
3569
  sideEffects({ active: e }) {
3564
3570
  e.node.animate([{ opacity: 0 }, { opacity: 1 }], {
3565
- duration: At.duration,
3566
- easing: At.easing
3571
+ duration: Tt.duration,
3572
+ easing: Tt.easing
3567
3573
  });
3568
3574
  }
3569
3575
  };
3570
- function Li({
3571
- treeStructure: e,
3572
- setTreeStructure: t,
3576
+ function Mi({
3577
+ items: e,
3578
+ setItems: t,
3573
3579
  isCollapsible: n,
3574
3580
  onLazyLoadChildren: r,
3575
3581
  showDropIndicator: o = !1,
@@ -3579,10 +3585,11 @@ function Li({
3579
3585
  allowNestedItemAddition: l,
3580
3586
  onAddItem: c,
3581
3587
  onDragEnd: u,
3582
- onItemClick: d
3588
+ onItemClick: d,
3589
+ renderItem: h
3583
3590
  }) {
3584
- const h = T(() => e.items, [e.items]), [f, m] = V(null), [g, p] = V(null), [b, D] = V(0), [y, R] = V(null), x = T(() => {
3585
- let v = It(h);
3591
+ const [f, m] = K(null), [g, p] = K(null), [b, x] = K(0), [y, S] = K(null), D = N(() => {
3592
+ let v = It(e);
3586
3593
  const C = v.filter(({ parentId: L }) => !L);
3587
3594
  C.length === 1 && (v = v.map(
3588
3595
  (L) => L.id === C[0].id ? {
@@ -3591,56 +3598,56 @@ function Li({
3591
3598
  } : L
3592
3599
  ));
3593
3600
  const B = v.reduce(
3594
- (L, { children: M, collapsed: q, id: H }) => (q && M.length && L.push(H), L),
3601
+ (L, { children: A, collapsed: q, id: H }) => (q && A.length && L.push(H), L),
3595
3602
  []
3596
3603
  );
3597
- return oi(
3604
+ return ri(
3598
3605
  v,
3599
3606
  f ? [f, ...B] : B
3600
3607
  );
3601
- }, [f, h]), w = f && g ? Tt(x, f, g, b, i) : null, I = k({
3602
- items: x,
3608
+ }, [f, e]), w = f && g ? At(D, f, g, b, i) : null, R = k({
3609
+ items: D,
3603
3610
  offset: b
3604
- }), [E] = V(
3605
- () => ai(I, o, i)
3606
- ), N = pr(
3611
+ }), [E] = K(
3612
+ () => si(R, o, i)
3613
+ ), M = pr(
3607
3614
  Gt(_t),
3608
- Gt(Bt, {
3615
+ Gt(zt, {
3609
3616
  coordinateGetter: E
3610
3617
  })
3611
- ), _ = T(() => x.map(({ id: v }) => v), [x]), A = f ? x.find(({ id: v }) => v === f) : null;
3618
+ ), _ = N(() => D.map(({ id: v }) => v), [D]), T = f ? D.find(({ id: v }) => v === f) : null;
3612
3619
  P(() => {
3613
- I.current = {
3614
- items: x,
3620
+ R.current = {
3621
+ items: D,
3615
3622
  offset: b
3616
3623
  };
3617
- }, [x, b]);
3624
+ }, [D, b]);
3618
3625
  const Z = z(
3619
3626
  ({ active: { id: v } }) => {
3620
3627
  m(v), p(v);
3621
- const C = x.find(({ id: B }) => B === v);
3622
- C && R({
3628
+ const C = D.find(({ id: B }) => B === v);
3629
+ C && S({
3623
3630
  parentId: C.parentId,
3624
3631
  overId: v
3625
3632
  }), document.body.style.setProperty("cursor", "grabbing");
3626
3633
  },
3627
- [x]
3634
+ [D]
3628
3635
  ), Q = z(({ delta: v }) => {
3629
- D(v.x);
3636
+ x(v.x);
3630
3637
  }, []), ne = z(({ over: v }) => {
3631
3638
  p((v == null ? void 0 : v.id) ?? null);
3632
3639
  }, []), fe = z(() => {
3633
- p(null), m(null), D(0), R(null), document.body.style.setProperty("cursor", "");
3640
+ p(null), m(null), x(0), S(null), document.body.style.setProperty("cursor", "");
3634
3641
  }, []), Ce = z(
3635
3642
  ({ active: v, over: C }) => {
3636
3643
  if (fe(), w && C) {
3637
- const { depth: B, parentId: L } = w, M = JSON.parse(JSON.stringify(It(h))), q = M.findIndex(({ id: j }) => j === C.id), H = M.findIndex(({ id: j }) => j === v.id), U = M[H];
3638
- M[H] = { ...U, depth: B, parentId: L };
3639
- const O = Ve(M, H, q), se = Go(O), G = Yn(se, M[H].id, L);
3640
- t(ni(se)), u == null || u(G);
3644
+ const { depth: B, parentId: L } = w, A = JSON.parse(JSON.stringify(It(e))), q = A.findIndex(({ id: j }) => j === C.id), H = A.findIndex(({ id: j }) => j === v.id), Y = A[H];
3645
+ A[H] = { ...Y, depth: B, parentId: L };
3646
+ const O = Ve(A, H, q), se = Go(O), G = Yn(se, A[H].id, L);
3647
+ t(se), u == null || u(G);
3641
3648
  }
3642
3649
  },
3643
- [h, w, u, fe, t]
3650
+ [e, w, u, fe, t]
3644
3651
  ), W = z(() => {
3645
3652
  fe();
3646
3653
  }, [fe]), Se = z(
@@ -3654,7 +3661,7 @@ function Li({
3654
3661
  canFetchChildren: C,
3655
3662
  collapsed: B
3656
3663
  }) => C ? r == null ? void 0 : r(v, !!B) : t(
3657
- (L) => ti(L, v, (M) => ({ collapsed: !M.collapsed }))
3664
+ (L) => ti(L, v, (A) => ({ collapsed: !A.collapsed }))
3658
3665
  ),
3659
3666
  [r, t]
3660
3667
  ), ve = z(
@@ -3663,19 +3670,19 @@ function Li({
3663
3670
  if (v !== "onDragEnd") {
3664
3671
  if (y && w.parentId === y.parentId && B === y.overId)
3665
3672
  return;
3666
- R({
3673
+ S({
3667
3674
  parentId: w.parentId,
3668
3675
  overId: B
3669
3676
  });
3670
3677
  }
3671
- const L = JSON.parse(JSON.stringify(It(h))), M = L.findIndex(({ id: j }) => j === B), q = L.findIndex(({ id: j }) => j === C), H = Ve(L, q, M), U = H[M - 1];
3678
+ const L = JSON.parse(JSON.stringify(It(e))), A = L.findIndex(({ id: j }) => j === B), q = L.findIndex(({ id: j }) => j === C), H = Ve(L, q, A), Y = H[A - 1];
3672
3679
  let O;
3673
3680
  const se = v === "onDragEnd" ? "dropped" : "moved", G = v === "onDragEnd" ? "dropped" : "nested";
3674
- if (U)
3675
- if (w.depth > U.depth)
3676
- O = `${C} was ${G} under ${U.id}.`;
3681
+ if (Y)
3682
+ if (w.depth > Y.depth)
3683
+ O = `${C} was ${G} under ${Y.id}.`;
3677
3684
  else {
3678
- let j = U;
3685
+ let j = Y;
3679
3686
  for (; j && w.depth < j.depth; ) {
3680
3687
  const ae = j.parentId;
3681
3688
  j = H.find(({ id: be }) => be === ae);
@@ -3683,13 +3690,13 @@ function Li({
3683
3690
  j && (O = `${C} was ${se} after ${j.id}.`);
3684
3691
  }
3685
3692
  else {
3686
- const j = H[M + 1];
3693
+ const j = H[A + 1];
3687
3694
  O = `${C} was ${se} before ${j.id}.`;
3688
3695
  }
3689
3696
  return O;
3690
3697
  }
3691
3698
  },
3692
- [y, h, w]
3699
+ [y, e, w]
3693
3700
  );
3694
3701
  return /* @__PURE__ */ $(
3695
3702
  ho,
@@ -3711,48 +3718,58 @@ function Li({
3711
3718
  return `Moving was cancelled. ${v.id} was dropped in its original position.`;
3712
3719
  }
3713
3720
  } },
3714
- sensors: N,
3721
+ sensors: M,
3715
3722
  collisionDetection: mr,
3716
- measuring: Mi,
3723
+ measuring: Ai,
3717
3724
  onDragStart: Z,
3718
3725
  onDragMove: Q,
3719
3726
  onDragOver: ne,
3720
3727
  onDragEnd: Ce,
3721
3728
  onDragCancel: W,
3722
- children: /* @__PURE__ */ fn($o, { items: _, strategy: zo, children: [
3723
- x.map(
3724
- ({ id: v, label: C, children: B, collapsed: L, depth: M, canFetchChildren: q, disableDragging: H }) => /* @__PURE__ */ $(
3729
+ children: /* @__PURE__ */ fn($o, { items: _, strategy: Bo, children: [
3730
+ D.map(
3731
+ ({
3732
+ id: v,
3733
+ label: C,
3734
+ children: B,
3735
+ collapsed: L,
3736
+ depth: A,
3737
+ canFetchChildren: q,
3738
+ disableDragging: H,
3739
+ ...Y
3740
+ }) => /* @__PURE__ */ $(
3725
3741
  dn,
3726
3742
  {
3727
3743
  id: v,
3728
3744
  value: C,
3729
3745
  disableDragging: !!H,
3730
- depth: v === f && w ? w.depth : M,
3746
+ depth: v === f && w ? w.depth : A,
3731
3747
  indentationWidth: i,
3732
3748
  indicator: o,
3733
3749
  collapsed: !!(L && (B.length || q)),
3734
3750
  onCollapse: n && (B.length || q) ? () => pe({ id: v, canFetchChildren: q, collapsed: L }) : void 0,
3735
3751
  onRemove: s ? () => a ? a(v) : Se(v) : void 0,
3736
3752
  onAdd: l ? () => c == null ? void 0 : c(v) : void 0,
3737
- onLabelClick: d ? () => d(v) : void 0
3753
+ onLabelClick: d ? () => d(v) : void 0,
3754
+ renderedItem: h == null ? void 0 : h({ id: v, label: C, children: B, ...Y })
3738
3755
  },
3739
3756
  v
3740
3757
  )
3741
3758
  ),
3742
3759
  gn(
3743
3760
  /* @__PURE__ */ $(
3744
- No,
3761
+ Mo,
3745
3762
  {
3746
3763
  dropAnimation: Ni,
3747
- modifiers: o ? [Pi] : void 0,
3748
- children: f && A ? /* @__PURE__ */ $(
3764
+ modifiers: o ? [Li] : void 0,
3765
+ children: f && T ? /* @__PURE__ */ $(
3749
3766
  dn,
3750
3767
  {
3751
3768
  id: f,
3752
- depth: A.depth,
3769
+ depth: T.depth,
3753
3770
  clone: !0,
3754
- childCount: ri(e, f) + 1,
3755
- value: A.label,
3771
+ childCount: ni(e, f) + 1,
3772
+ value: T.label,
3756
3773
  indentationWidth: i
3757
3774
  }
3758
3775
  ) : null
@@ -3764,7 +3781,7 @@ function Li({
3764
3781
  }
3765
3782
  );
3766
3783
  }
3767
- const Pi = ({ transform: e }) => ({
3784
+ const Li = ({ transform: e }) => ({
3768
3785
  ...e,
3769
3786
  y: e.y - 25
3770
3787
  });
@@ -3781,10 +3798,9 @@ function Yn(e, t, n = null) {
3781
3798
  }
3782
3799
  return null;
3783
3800
  }
3784
- const $i = ut(Li);
3801
+ const zi = ut(Mi);
3785
3802
  export {
3786
- $i as SortableTree,
3787
- ni as createOptimizedTreeStructure,
3803
+ zi as SortableTree,
3788
3804
  Fn as getItemById,
3789
3805
  ei as removeItemById,
3790
3806
  ti as setTreeItemProperties