@senitix/ui 0.4.0

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.
Files changed (206) hide show
  1. package/dist/avatar-C0aVNCG9.cjs +2 -0
  2. package/dist/avatar-C0aVNCG9.cjs.map +1 -0
  3. package/dist/avatar-CN6wcrqY.js +288 -0
  4. package/dist/avatar-CN6wcrqY.js.map +1 -0
  5. package/dist/calendar-BFWc4IB7.js +1182 -0
  6. package/dist/calendar-BFWc4IB7.js.map +1 -0
  7. package/dist/calendar-BUm7YrNf.cjs +2 -0
  8. package/dist/calendar-BUm7YrNf.cjs.map +1 -0
  9. package/dist/calendar-ChJkFXXr.js +11 -0
  10. package/dist/calendar-ChJkFXXr.js.map +1 -0
  11. package/dist/calendar-SwL5isYC.cjs +2 -0
  12. package/dist/calendar-SwL5isYC.cjs.map +1 -0
  13. package/dist/card-K4fxyYwE.js +51 -0
  14. package/dist/card-K4fxyYwE.js.map +1 -0
  15. package/dist/card-tMkUxpmW.cjs +2 -0
  16. package/dist/card-tMkUxpmW.cjs.map +1 -0
  17. package/dist/checkbox-CpOq5hkT.js +289 -0
  18. package/dist/checkbox-CpOq5hkT.js.map +1 -0
  19. package/dist/checkbox-D7-LQyCl.cjs +2 -0
  20. package/dist/checkbox-D7-LQyCl.cjs.map +1 -0
  21. package/dist/chevron-down-DHdXqOqK.cjs +2 -0
  22. package/dist/chevron-down-DHdXqOqK.cjs.map +1 -0
  23. package/dist/chevron-down-DJ1_YIFu.js +8 -0
  24. package/dist/chevron-down-DJ1_YIFu.js.map +1 -0
  25. package/dist/chevron-right-B3bovvh0.js +8 -0
  26. package/dist/chevron-right-B3bovvh0.js.map +1 -0
  27. package/dist/chevron-right-Dvyd11q0.cjs +2 -0
  28. package/dist/chevron-right-Dvyd11q0.cjs.map +1 -0
  29. package/dist/chevron-up-B9fuiZhc.cjs +2 -0
  30. package/dist/chevron-up-B9fuiZhc.cjs.map +1 -0
  31. package/dist/chevron-up-CGtXOr51.js +6 -0
  32. package/dist/chevron-up-CGtXOr51.js.map +1 -0
  33. package/dist/components/charts/index.cjs.js +2 -0
  34. package/dist/components/charts/index.cjs.js.map +1 -0
  35. package/dist/components/charts/index.es.js +12 -0
  36. package/dist/components/charts/index.es.js.map +1 -0
  37. package/dist/components/data-display/index.cjs.js +2 -0
  38. package/dist/components/data-display/index.cjs.js.map +1 -0
  39. package/dist/components/data-display/index.es.js +25 -0
  40. package/dist/components/data-display/index.es.js.map +1 -0
  41. package/dist/components/dnd/index.cjs.js +2 -0
  42. package/dist/components/dnd/index.cjs.js.map +1 -0
  43. package/dist/components/dnd/index.es.js +9 -0
  44. package/dist/components/dnd/index.es.js.map +1 -0
  45. package/dist/components/feedback/index.cjs.js +2 -0
  46. package/dist/components/feedback/index.cjs.js.map +1 -0
  47. package/dist/components/feedback/index.es.js +16 -0
  48. package/dist/components/feedback/index.es.js.map +1 -0
  49. package/dist/components/forms/index.cjs.js +2 -0
  50. package/dist/components/forms/index.cjs.js.map +1 -0
  51. package/dist/components/forms/index.es.js +27 -0
  52. package/dist/components/forms/index.es.js.map +1 -0
  53. package/dist/components/layouts/index.cjs.js +2 -0
  54. package/dist/components/layouts/index.cjs.js.map +1 -0
  55. package/dist/components/layouts/index.es.js +25 -0
  56. package/dist/components/layouts/index.es.js.map +1 -0
  57. package/dist/components/navigation/index.cjs.js +2 -0
  58. package/dist/components/navigation/index.cjs.js.map +1 -0
  59. package/dist/components/navigation/index.es.js +42 -0
  60. package/dist/components/navigation/index.es.js.map +1 -0
  61. package/dist/components/ui/index.cjs.js +2 -0
  62. package/dist/components/ui/index.cjs.js.map +1 -0
  63. package/dist/components/ui/index.es.js +165 -0
  64. package/dist/components/ui/index.es.js.map +1 -0
  65. package/dist/createLucideIcon-BbeNo6vq.js +56 -0
  66. package/dist/createLucideIcon-BbeNo6vq.js.map +1 -0
  67. package/dist/createLucideIcon-i5GEhNMV.cjs +2 -0
  68. package/dist/createLucideIcon-i5GEhNMV.cjs.map +1 -0
  69. package/dist/ellipsis-BW2gWki8.cjs +2 -0
  70. package/dist/ellipsis-BW2gWki8.cjs.map +1 -0
  71. package/dist/ellipsis-CiKEaUNP.js +10 -0
  72. package/dist/ellipsis-CiKEaUNP.js.map +1 -0
  73. package/dist/file-V_hhCUhr.cjs +2 -0
  74. package/dist/file-V_hhCUhr.cjs.map +1 -0
  75. package/dist/file-wzTXnWqz.js +9 -0
  76. package/dist/file-wzTXnWqz.js.map +1 -0
  77. package/dist/filter-tags-DjUaNXHR.cjs +5 -0
  78. package/dist/filter-tags-DjUaNXHR.cjs.map +1 -0
  79. package/dist/filter-tags-i_I8qV1N.js +2658 -0
  80. package/dist/filter-tags-i_I8qV1N.js.map +1 -0
  81. package/dist/full-calendar-7ac2FFU6.js +3518 -0
  82. package/dist/full-calendar-7ac2FFU6.js.map +1 -0
  83. package/dist/full-calendar-Cpeh5xMP.cjs +8 -0
  84. package/dist/full-calendar-Cpeh5xMP.cjs.map +1 -0
  85. package/dist/global-search-UNXjoFlI.cjs +2 -0
  86. package/dist/global-search-UNXjoFlI.cjs.map +1 -0
  87. package/dist/global-search-h1rVbP2q.js +1188 -0
  88. package/dist/global-search-h1rVbP2q.js.map +1 -0
  89. package/dist/hooks/index.cjs.js +2 -0
  90. package/dist/hooks/index.cjs.js.map +1 -0
  91. package/dist/hooks/index.es.js +13 -0
  92. package/dist/hooks/index.es.js.map +1 -0
  93. package/dist/index-Co9o9StL.js +33 -0
  94. package/dist/index-Co9o9StL.js.map +1 -0
  95. package/dist/index-CwJPJKOE.js +2278 -0
  96. package/dist/index-CwJPJKOE.js.map +1 -0
  97. package/dist/index-CzVK9Zyb.cjs +6 -0
  98. package/dist/index-CzVK9Zyb.cjs.map +1 -0
  99. package/dist/index-l828OqQN.js +288 -0
  100. package/dist/index-l828OqQN.js.map +1 -0
  101. package/dist/index-lGzB9daF.cjs +2 -0
  102. package/dist/index-lGzB9daF.cjs.map +1 -0
  103. package/dist/index-lT9bLt9X.cjs +2 -0
  104. package/dist/index-lT9bLt9X.cjs.map +1 -0
  105. package/dist/index.cjs.js +2 -0
  106. package/dist/index.cjs.js.map +1 -0
  107. package/dist/index.es.js +332 -0
  108. package/dist/index.es.js.map +1 -0
  109. package/dist/input-CZrckPLk.cjs +42 -0
  110. package/dist/input-CZrckPLk.cjs.map +1 -0
  111. package/dist/input-D4AoiWxo.js +3629 -0
  112. package/dist/input-D4AoiWxo.js.map +1 -0
  113. package/dist/locale-provider-DHMwuneF.cjs +2 -0
  114. package/dist/locale-provider-DHMwuneF.cjs.map +1 -0
  115. package/dist/locale-provider-DanG6RRG.js +1012 -0
  116. package/dist/locale-provider-DanG6RRG.js.map +1 -0
  117. package/dist/locale-selector-Ppe0KTi-.cjs +2 -0
  118. package/dist/locale-selector-Ppe0KTi-.cjs.map +1 -0
  119. package/dist/locale-selector-xn2GpdP9.js +1745 -0
  120. package/dist/locale-selector-xn2GpdP9.js.map +1 -0
  121. package/dist/minus-BXBFZSZs.cjs +2 -0
  122. package/dist/minus-BXBFZSZs.cjs.map +1 -0
  123. package/dist/minus-DvlYtl96.js +6 -0
  124. package/dist/minus-DvlYtl96.js.map +1 -0
  125. package/dist/multi-container-C2UpSw5f.js +731 -0
  126. package/dist/multi-container-C2UpSw5f.js.map +1 -0
  127. package/dist/multi-container-DMKL8c9B.cjs +2 -0
  128. package/dist/multi-container-DMKL8c9B.cjs.map +1 -0
  129. package/dist/pipeline-By5_8AFg.cjs +2 -0
  130. package/dist/pipeline-By5_8AFg.cjs.map +1 -0
  131. package/dist/pipeline-D-QNSU0U.js +1036 -0
  132. package/dist/pipeline-D-QNSU0U.js.map +1 -0
  133. package/dist/plus-8wKRkVu-.cjs +2 -0
  134. package/dist/plus-8wKRkVu-.cjs.map +1 -0
  135. package/dist/plus-CJD68KQD.js +9 -0
  136. package/dist/plus-CJD68KQD.js.map +1 -0
  137. package/dist/popover-4V4sGe1U.js +765 -0
  138. package/dist/popover-4V4sGe1U.js.map +1 -0
  139. package/dist/popover-ivh-plLc.cjs +2 -0
  140. package/dist/popover-ivh-plLc.cjs.map +1 -0
  141. package/dist/progress-CFnuLqnS.cjs +7 -0
  142. package/dist/progress-CFnuLqnS.cjs.map +1 -0
  143. package/dist/progress-D5AsrWa6.js +222 -0
  144. package/dist/progress-D5AsrWa6.js.map +1 -0
  145. package/dist/providers/index.cjs.js +2 -0
  146. package/dist/providers/index.cjs.js.map +1 -0
  147. package/dist/providers/index.es.js +9 -0
  148. package/dist/providers/index.es.js.map +1 -0
  149. package/dist/scroll-area-DQeqDp3Y.js +952 -0
  150. package/dist/scroll-area-DQeqDp3Y.js.map +1 -0
  151. package/dist/scroll-area-DYOiJMXh.cjs +2 -0
  152. package/dist/scroll-area-DYOiJMXh.cjs.map +1 -0
  153. package/dist/select-C1rNBi6c.js +974 -0
  154. package/dist/select-C1rNBi6c.js.map +1 -0
  155. package/dist/select-m-Mqwxu3.cjs +2 -0
  156. package/dist/select-m-Mqwxu3.cjs.map +1 -0
  157. package/dist/separator-DBUivkHq.cjs +2 -0
  158. package/dist/separator-DBUivkHq.cjs.map +1 -0
  159. package/dist/separator-DsfoJx-2.js +395 -0
  160. package/dist/separator-DsfoJx-2.js.map +1 -0
  161. package/dist/sheet-BVWCpq7E.js +84 -0
  162. package/dist/sheet-BVWCpq7E.js.map +1 -0
  163. package/dist/sheet-mKiFLVnK.cjs +2 -0
  164. package/dist/sheet-mKiFLVnK.cjs.map +1 -0
  165. package/dist/skeleton-BSwwYaQU.cjs +2 -0
  166. package/dist/skeleton-BSwwYaQU.cjs.map +1 -0
  167. package/dist/skeleton-BmGbfJw3.js +9 -0
  168. package/dist/skeleton-BmGbfJw3.js.map +1 -0
  169. package/dist/sortable.esm-Blhf_jh1.js +3391 -0
  170. package/dist/sortable.esm-Blhf_jh1.js.map +1 -0
  171. package/dist/sortable.esm-DcQYlXi3.cjs +6 -0
  172. package/dist/sortable.esm-DcQYlXi3.cjs.map +1 -0
  173. package/dist/sparkline-chart-Da-ehDGv.js +21082 -0
  174. package/dist/sparkline-chart-Da-ehDGv.js.map +1 -0
  175. package/dist/sparkline-chart-ca3uTzVK.cjs +68 -0
  176. package/dist/sparkline-chart-ca3uTzVK.cjs.map +1 -0
  177. package/dist/trending-up-D3Nfrhi3.cjs +2 -0
  178. package/dist/trending-up-D3Nfrhi3.cjs.map +1 -0
  179. package/dist/trending-up-DPwlYzQb.js +9 -0
  180. package/dist/trending-up-DPwlYzQb.js.map +1 -0
  181. package/dist/ui.css +1 -0
  182. package/dist/use-formatters-d97RVcmg.cjs +2 -0
  183. package/dist/use-formatters-d97RVcmg.cjs.map +1 -0
  184. package/dist/use-formatters-l1_2c8z0.js +6682 -0
  185. package/dist/use-formatters-l1_2c8z0.js.map +1 -0
  186. package/dist/use-local-storage-BjlrKzE-.js +42 -0
  187. package/dist/use-local-storage-BjlrKzE-.js.map +1 -0
  188. package/dist/use-local-storage-q-1odzIu.cjs +2 -0
  189. package/dist/use-local-storage-q-1odzIu.cjs.map +1 -0
  190. package/dist/use-mobile-C-LMK4T8.js +15 -0
  191. package/dist/use-mobile-C-LMK4T8.js.map +1 -0
  192. package/dist/use-mobile-DY7TJ5lx.cjs +2 -0
  193. package/dist/use-mobile-DY7TJ5lx.cjs.map +1 -0
  194. package/dist/use-toast-DG2qdYhl.js +97 -0
  195. package/dist/use-toast-DG2qdYhl.js.map +1 -0
  196. package/dist/use-toast-DxZJ8uUm.cjs +2 -0
  197. package/dist/use-toast-DxZJ8uUm.cjs.map +1 -0
  198. package/dist/utils/index.cjs.js +2 -0
  199. package/dist/utils/index.cjs.js.map +1 -0
  200. package/dist/utils/index.es.js +5 -0
  201. package/dist/utils/index.es.js.map +1 -0
  202. package/dist/welcome-card-CPolYl1D.cjs +2 -0
  203. package/dist/welcome-card-CPolYl1D.cjs.map +1 -0
  204. package/dist/welcome-card-CxMJZ8bv.js +963 -0
  205. package/dist/welcome-card-CxMJZ8bv.js.map +1 -0
  206. package/package.json +179 -0
@@ -0,0 +1,3391 @@
1
+ import M, { useLayoutEffect as Fn, useEffect as O, useRef as N, useMemo as A, useCallback as F, useState as $, memo as $n, useReducer as Xn, createContext as Ye, useContext as ve, forwardRef as jn, cloneElement as Yn } from "react";
2
+ import { unstable_batchedUpdates as Ze, createPortal as Kn } from "react-dom";
3
+ function Wn() {
4
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
5
+ t[n] = arguments[n];
6
+ return A(
7
+ () => (r) => {
8
+ t.forEach((o) => o(r));
9
+ },
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps
11
+ t
12
+ );
13
+ }
14
+ const ut = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
15
+ function Re(e) {
16
+ const t = Object.prototype.toString.call(e);
17
+ return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
18
+ t === "[object global]";
19
+ }
20
+ function At(e) {
21
+ return "nodeType" in e;
22
+ }
23
+ function X(e) {
24
+ var t, n;
25
+ return e ? Re(e) ? e : At(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
26
+ }
27
+ function It(e) {
28
+ const {
29
+ Document: t
30
+ } = X(e);
31
+ return e instanceof t;
32
+ }
33
+ function Ke(e) {
34
+ return Re(e) ? !1 : e instanceof X(e).HTMLElement;
35
+ }
36
+ function tn(e) {
37
+ return e instanceof X(e).SVGElement;
38
+ }
39
+ function Ee(e) {
40
+ return e ? Re(e) ? e.document : At(e) ? It(e) ? e : Ke(e) || tn(e) ? e.ownerDocument : document : document : document;
41
+ }
42
+ const _ = ut ? Fn : O;
43
+ function dt(e) {
44
+ const t = N(e);
45
+ return _(() => {
46
+ t.current = e;
47
+ }), F(function() {
48
+ for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
49
+ r[o] = arguments[o];
50
+ return t.current == null ? void 0 : t.current(...r);
51
+ }, []);
52
+ }
53
+ function Un() {
54
+ const e = N(null), t = F((r, o) => {
55
+ e.current = setInterval(r, o);
56
+ }, []), n = F(() => {
57
+ e.current !== null && (clearInterval(e.current), e.current = null);
58
+ }, []);
59
+ return [t, n];
60
+ }
61
+ function $e(e, t) {
62
+ t === void 0 && (t = [e]);
63
+ const n = N(e);
64
+ return _(() => {
65
+ n.current !== e && (n.current = e);
66
+ }, t), n;
67
+ }
68
+ function We(e, t) {
69
+ const n = N();
70
+ return A(
71
+ () => {
72
+ const r = e(n.current);
73
+ return n.current = r, r;
74
+ },
75
+ // eslint-disable-next-line react-hooks/exhaustive-deps
76
+ [...t]
77
+ );
78
+ }
79
+ function ot(e) {
80
+ const t = dt(e), n = N(null), r = F(
81
+ (o) => {
82
+ o !== n.current && t?.(o, n.current), n.current = o;
83
+ },
84
+ //eslint-disable-next-line
85
+ []
86
+ );
87
+ return [n, r];
88
+ }
89
+ function it(e) {
90
+ const t = N();
91
+ return O(() => {
92
+ t.current = e;
93
+ }, [e]), t.current;
94
+ }
95
+ let yt = {};
96
+ function Ue(e, t) {
97
+ return A(() => {
98
+ if (t)
99
+ return t;
100
+ const n = yt[e] == null ? 0 : yt[e] + 1;
101
+ return yt[e] = n, e + "-" + n;
102
+ }, [e, t]);
103
+ }
104
+ function nn(e) {
105
+ return function(t) {
106
+ for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
107
+ r[o - 1] = arguments[o];
108
+ return r.reduce((i, s) => {
109
+ const a = Object.entries(s);
110
+ for (const [l, c] of a) {
111
+ const d = i[l];
112
+ d != null && (i[l] = d + e * c);
113
+ }
114
+ return i;
115
+ }, {
116
+ ...t
117
+ });
118
+ };
119
+ }
120
+ const Se = /* @__PURE__ */ nn(1), Xe = /* @__PURE__ */ nn(-1);
121
+ function Hn(e) {
122
+ return "clientX" in e && "clientY" in e;
123
+ }
124
+ function ft(e) {
125
+ if (!e)
126
+ return !1;
127
+ const {
128
+ KeyboardEvent: t
129
+ } = X(e.target);
130
+ return t && e instanceof t;
131
+ }
132
+ function Vn(e) {
133
+ if (!e)
134
+ return !1;
135
+ const {
136
+ TouchEvent: t
137
+ } = X(e.target);
138
+ return t && e instanceof t;
139
+ }
140
+ function st(e) {
141
+ if (Vn(e)) {
142
+ if (e.touches && e.touches.length) {
143
+ const {
144
+ clientX: t,
145
+ clientY: n
146
+ } = e.touches[0];
147
+ return {
148
+ x: t,
149
+ y: n
150
+ };
151
+ } else if (e.changedTouches && e.changedTouches.length) {
152
+ const {
153
+ clientX: t,
154
+ clientY: n
155
+ } = e.changedTouches[0];
156
+ return {
157
+ x: t,
158
+ y: n
159
+ };
160
+ }
161
+ }
162
+ return Hn(e) ? {
163
+ x: e.clientX,
164
+ y: e.clientY
165
+ } : null;
166
+ }
167
+ const be = /* @__PURE__ */ Object.freeze({
168
+ Translate: {
169
+ toString(e) {
170
+ if (!e)
171
+ return;
172
+ const {
173
+ x: t,
174
+ y: n
175
+ } = e;
176
+ return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
177
+ }
178
+ },
179
+ Scale: {
180
+ toString(e) {
181
+ if (!e)
182
+ return;
183
+ const {
184
+ scaleX: t,
185
+ scaleY: n
186
+ } = e;
187
+ return "scaleX(" + t + ") scaleY(" + n + ")";
188
+ }
189
+ },
190
+ Transform: {
191
+ toString(e) {
192
+ if (e)
193
+ return [be.Translate.toString(e), be.Scale.toString(e)].join(" ");
194
+ }
195
+ },
196
+ Transition: {
197
+ toString(e) {
198
+ let {
199
+ property: t,
200
+ duration: n,
201
+ easing: r
202
+ } = e;
203
+ return t + " " + n + "ms " + r;
204
+ }
205
+ }
206
+ }), Yt = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
207
+ function qn(e) {
208
+ return e.matches(Yt) ? e : e.querySelector(Yt);
209
+ }
210
+ const Gn = {
211
+ display: "none"
212
+ };
213
+ function Jn(e) {
214
+ let {
215
+ id: t,
216
+ value: n
217
+ } = e;
218
+ return M.createElement("div", {
219
+ id: t,
220
+ style: Gn
221
+ }, n);
222
+ }
223
+ function _n(e) {
224
+ let {
225
+ id: t,
226
+ announcement: n,
227
+ ariaLiveType: r = "assertive"
228
+ } = e;
229
+ const o = {
230
+ position: "fixed",
231
+ top: 0,
232
+ left: 0,
233
+ width: 1,
234
+ height: 1,
235
+ margin: -1,
236
+ border: 0,
237
+ padding: 0,
238
+ overflow: "hidden",
239
+ clip: "rect(0 0 0 0)",
240
+ clipPath: "inset(100%)",
241
+ whiteSpace: "nowrap"
242
+ };
243
+ return M.createElement("div", {
244
+ id: t,
245
+ style: o,
246
+ role: "status",
247
+ "aria-live": r,
248
+ "aria-atomic": !0
249
+ }, n);
250
+ }
251
+ function Qn() {
252
+ const [e, t] = $("");
253
+ return {
254
+ announce: F((r) => {
255
+ r != null && t(r);
256
+ }, []),
257
+ announcement: e
258
+ };
259
+ }
260
+ const rn = /* @__PURE__ */ Ye(null);
261
+ function Zn(e) {
262
+ const t = ve(rn);
263
+ O(() => {
264
+ if (!t)
265
+ throw new Error("useDndMonitor must be used within a children of <DndContext>");
266
+ return t(e);
267
+ }, [e, t]);
268
+ }
269
+ function er() {
270
+ const [e] = $(() => /* @__PURE__ */ new Set()), t = F((r) => (e.add(r), () => e.delete(r)), [e]);
271
+ return [F((r) => {
272
+ let {
273
+ type: o,
274
+ event: i
275
+ } = r;
276
+ e.forEach((s) => {
277
+ var a;
278
+ return (a = s[o]) == null ? void 0 : a.call(s, i);
279
+ });
280
+ }, [e]), t];
281
+ }
282
+ const tr = {
283
+ draggable: `
284
+ To pick up a draggable item, press the space bar.
285
+ While dragging, use the arrow keys to move the item.
286
+ Press space again to drop the item in its new position, or press escape to cancel.
287
+ `
288
+ }, nr = {
289
+ onDragStart(e) {
290
+ let {
291
+ active: t
292
+ } = e;
293
+ return "Picked up draggable item " + t.id + ".";
294
+ },
295
+ onDragOver(e) {
296
+ let {
297
+ active: t,
298
+ over: n
299
+ } = e;
300
+ return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
301
+ },
302
+ onDragEnd(e) {
303
+ let {
304
+ active: t,
305
+ over: n
306
+ } = e;
307
+ return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
308
+ },
309
+ onDragCancel(e) {
310
+ let {
311
+ active: t
312
+ } = e;
313
+ return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
314
+ }
315
+ };
316
+ function rr(e) {
317
+ let {
318
+ announcements: t = nr,
319
+ container: n,
320
+ hiddenTextDescribedById: r,
321
+ screenReaderInstructions: o = tr
322
+ } = e;
323
+ const {
324
+ announce: i,
325
+ announcement: s
326
+ } = Qn(), a = Ue("DndLiveRegion"), [l, c] = $(!1);
327
+ if (O(() => {
328
+ c(!0);
329
+ }, []), Zn(A(() => ({
330
+ onDragStart(u) {
331
+ let {
332
+ active: f
333
+ } = u;
334
+ i(t.onDragStart({
335
+ active: f
336
+ }));
337
+ },
338
+ onDragMove(u) {
339
+ let {
340
+ active: f,
341
+ over: h
342
+ } = u;
343
+ t.onDragMove && i(t.onDragMove({
344
+ active: f,
345
+ over: h
346
+ }));
347
+ },
348
+ onDragOver(u) {
349
+ let {
350
+ active: f,
351
+ over: h
352
+ } = u;
353
+ i(t.onDragOver({
354
+ active: f,
355
+ over: h
356
+ }));
357
+ },
358
+ onDragEnd(u) {
359
+ let {
360
+ active: f,
361
+ over: h
362
+ } = u;
363
+ i(t.onDragEnd({
364
+ active: f,
365
+ over: h
366
+ }));
367
+ },
368
+ onDragCancel(u) {
369
+ let {
370
+ active: f,
371
+ over: h
372
+ } = u;
373
+ i(t.onDragCancel({
374
+ active: f,
375
+ over: h
376
+ }));
377
+ }
378
+ }), [i, t])), !l)
379
+ return null;
380
+ const d = M.createElement(M.Fragment, null, M.createElement(Jn, {
381
+ id: r,
382
+ value: o.draggable
383
+ }), M.createElement(_n, {
384
+ id: a,
385
+ announcement: s
386
+ }));
387
+ return n ? Kn(d, n) : d;
388
+ }
389
+ var P;
390
+ (function(e) {
391
+ e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
392
+ })(P || (P = {}));
393
+ function at() {
394
+ }
395
+ function zo(e, t) {
396
+ return A(
397
+ () => ({
398
+ sensor: e,
399
+ options: t ?? {}
400
+ }),
401
+ // eslint-disable-next-line react-hooks/exhaustive-deps
402
+ [e, t]
403
+ );
404
+ }
405
+ function Bo() {
406
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
407
+ t[n] = arguments[n];
408
+ return A(
409
+ () => [...t].filter((r) => r != null),
410
+ // eslint-disable-next-line react-hooks/exhaustive-deps
411
+ [...t]
412
+ );
413
+ }
414
+ const Q = /* @__PURE__ */ Object.freeze({
415
+ x: 0,
416
+ y: 0
417
+ });
418
+ function Ot(e, t) {
419
+ return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
420
+ }
421
+ function or(e, t) {
422
+ const n = st(e);
423
+ if (!n)
424
+ return "0 0";
425
+ const r = {
426
+ x: (n.x - t.left) / t.width * 100,
427
+ y: (n.y - t.top) / t.height * 100
428
+ };
429
+ return r.x + "% " + r.y + "%";
430
+ }
431
+ function Nt(e, t) {
432
+ let {
433
+ data: {
434
+ value: n
435
+ }
436
+ } = e, {
437
+ data: {
438
+ value: r
439
+ }
440
+ } = t;
441
+ return n - r;
442
+ }
443
+ function ir(e, t) {
444
+ let {
445
+ data: {
446
+ value: n
447
+ }
448
+ } = e, {
449
+ data: {
450
+ value: r
451
+ }
452
+ } = t;
453
+ return r - n;
454
+ }
455
+ function Ct(e) {
456
+ let {
457
+ left: t,
458
+ top: n,
459
+ height: r,
460
+ width: o
461
+ } = e;
462
+ return [{
463
+ x: t,
464
+ y: n
465
+ }, {
466
+ x: t + o,
467
+ y: n
468
+ }, {
469
+ x: t,
470
+ y: n + r
471
+ }, {
472
+ x: t + o,
473
+ y: n + r
474
+ }];
475
+ }
476
+ function on(e, t) {
477
+ if (!e || e.length === 0)
478
+ return null;
479
+ const [n] = e;
480
+ return n[t];
481
+ }
482
+ function Kt(e, t, n) {
483
+ return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
484
+ x: t + e.width * 0.5,
485
+ y: n + e.height * 0.5
486
+ };
487
+ }
488
+ const Fo = (e) => {
489
+ let {
490
+ collisionRect: t,
491
+ droppableRects: n,
492
+ droppableContainers: r
493
+ } = e;
494
+ const o = Kt(t, t.left, t.top), i = [];
495
+ for (const s of r) {
496
+ const {
497
+ id: a
498
+ } = s, l = n.get(a);
499
+ if (l) {
500
+ const c = Ot(Kt(l), o);
501
+ i.push({
502
+ id: a,
503
+ data: {
504
+ droppableContainer: s,
505
+ value: c
506
+ }
507
+ });
508
+ }
509
+ }
510
+ return i.sort(Nt);
511
+ }, sr = (e) => {
512
+ let {
513
+ collisionRect: t,
514
+ droppableRects: n,
515
+ droppableContainers: r
516
+ } = e;
517
+ const o = Ct(t), i = [];
518
+ for (const s of r) {
519
+ const {
520
+ id: a
521
+ } = s, l = n.get(a);
522
+ if (l) {
523
+ const c = Ct(l), d = o.reduce((f, h, w) => f + Ot(c[w], h), 0), u = Number((d / 4).toFixed(4));
524
+ i.push({
525
+ id: a,
526
+ data: {
527
+ droppableContainer: s,
528
+ value: u
529
+ }
530
+ });
531
+ }
532
+ }
533
+ return i.sort(Nt);
534
+ };
535
+ function ar(e, t) {
536
+ const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), i = Math.min(t.top + t.height, e.top + e.height), s = o - r, a = i - n;
537
+ if (r < o && n < i) {
538
+ const l = t.width * t.height, c = e.width * e.height, d = s * a, u = d / (l + c - d);
539
+ return Number(u.toFixed(4));
540
+ }
541
+ return 0;
542
+ }
543
+ const lr = (e) => {
544
+ let {
545
+ collisionRect: t,
546
+ droppableRects: n,
547
+ droppableContainers: r
548
+ } = e;
549
+ const o = [];
550
+ for (const i of r) {
551
+ const {
552
+ id: s
553
+ } = i, a = n.get(s);
554
+ if (a) {
555
+ const l = ar(a, t);
556
+ l > 0 && o.push({
557
+ id: s,
558
+ data: {
559
+ droppableContainer: i,
560
+ value: l
561
+ }
562
+ });
563
+ }
564
+ }
565
+ return o.sort(ir);
566
+ };
567
+ function cr(e, t) {
568
+ const {
569
+ top: n,
570
+ left: r,
571
+ bottom: o,
572
+ right: i
573
+ } = t;
574
+ return n <= e.y && e.y <= o && r <= e.x && e.x <= i;
575
+ }
576
+ const $o = (e) => {
577
+ let {
578
+ droppableContainers: t,
579
+ droppableRects: n,
580
+ pointerCoordinates: r
581
+ } = e;
582
+ if (!r)
583
+ return [];
584
+ const o = [];
585
+ for (const i of t) {
586
+ const {
587
+ id: s
588
+ } = i, a = n.get(s);
589
+ if (a && cr(r, a)) {
590
+ const c = Ct(a).reduce((u, f) => u + Ot(r, f), 0), d = Number((c / 4).toFixed(4));
591
+ o.push({
592
+ id: s,
593
+ data: {
594
+ droppableContainer: i,
595
+ value: d
596
+ }
597
+ });
598
+ }
599
+ }
600
+ return o.sort(Nt);
601
+ };
602
+ function ur(e, t, n) {
603
+ return {
604
+ ...e,
605
+ scaleX: t && n ? t.width / n.width : 1,
606
+ scaleY: t && n ? t.height / n.height : 1
607
+ };
608
+ }
609
+ function sn(e, t) {
610
+ return e && t ? {
611
+ x: e.left - t.left,
612
+ y: e.top - t.top
613
+ } : Q;
614
+ }
615
+ function dr(e) {
616
+ return function(n) {
617
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
618
+ o[i - 1] = arguments[i];
619
+ return o.reduce((s, a) => ({
620
+ ...s,
621
+ top: s.top + e * a.y,
622
+ bottom: s.bottom + e * a.y,
623
+ left: s.left + e * a.x,
624
+ right: s.right + e * a.x
625
+ }), {
626
+ ...n
627
+ });
628
+ };
629
+ }
630
+ const fr = /* @__PURE__ */ dr(1);
631
+ function an(e) {
632
+ if (e.startsWith("matrix3d(")) {
633
+ const t = e.slice(9, -1).split(/, /);
634
+ return {
635
+ x: +t[12],
636
+ y: +t[13],
637
+ scaleX: +t[0],
638
+ scaleY: +t[5]
639
+ };
640
+ } else if (e.startsWith("matrix(")) {
641
+ const t = e.slice(7, -1).split(/, /);
642
+ return {
643
+ x: +t[4],
644
+ y: +t[5],
645
+ scaleX: +t[0],
646
+ scaleY: +t[3]
647
+ };
648
+ }
649
+ return null;
650
+ }
651
+ function hr(e, t, n) {
652
+ const r = an(t);
653
+ if (!r)
654
+ return e;
655
+ const {
656
+ scaleX: o,
657
+ scaleY: i,
658
+ x: s,
659
+ y: a
660
+ } = r, l = e.left - s - (1 - o) * parseFloat(n), c = e.top - a - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), d = o ? e.width / o : e.width, u = i ? e.height / i : e.height;
661
+ return {
662
+ width: d,
663
+ height: u,
664
+ top: c,
665
+ right: l + d,
666
+ bottom: c + u,
667
+ left: l
668
+ };
669
+ }
670
+ const gr = {
671
+ ignoreTransform: !1
672
+ };
673
+ function Ae(e, t) {
674
+ t === void 0 && (t = gr);
675
+ let n = e.getBoundingClientRect();
676
+ if (t.ignoreTransform) {
677
+ const {
678
+ transform: c,
679
+ transformOrigin: d
680
+ } = X(e).getComputedStyle(e);
681
+ c && (n = hr(n, c, d));
682
+ }
683
+ const {
684
+ top: r,
685
+ left: o,
686
+ width: i,
687
+ height: s,
688
+ bottom: a,
689
+ right: l
690
+ } = n;
691
+ return {
692
+ top: r,
693
+ left: o,
694
+ width: i,
695
+ height: s,
696
+ bottom: a,
697
+ right: l
698
+ };
699
+ }
700
+ function Wt(e) {
701
+ return Ae(e, {
702
+ ignoreTransform: !0
703
+ });
704
+ }
705
+ function vr(e) {
706
+ const t = e.innerWidth, n = e.innerHeight;
707
+ return {
708
+ top: 0,
709
+ left: 0,
710
+ right: t,
711
+ bottom: n,
712
+ width: t,
713
+ height: n
714
+ };
715
+ }
716
+ function pr(e, t) {
717
+ return t === void 0 && (t = X(e).getComputedStyle(e)), t.position === "fixed";
718
+ }
719
+ function br(e, t) {
720
+ t === void 0 && (t = X(e).getComputedStyle(e));
721
+ const n = /(auto|scroll|overlay)/;
722
+ return ["overflow", "overflowX", "overflowY"].some((o) => {
723
+ const i = t[o];
724
+ return typeof i == "string" ? n.test(i) : !1;
725
+ });
726
+ }
727
+ function ht(e, t) {
728
+ const n = [];
729
+ function r(o) {
730
+ if (t != null && n.length >= t || !o)
731
+ return n;
732
+ if (It(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
733
+ return n.push(o.scrollingElement), n;
734
+ if (!Ke(o) || tn(o) || n.includes(o))
735
+ return n;
736
+ const i = X(e).getComputedStyle(o);
737
+ return o !== e && br(o, i) && n.push(o), pr(o, i) ? n : r(o.parentNode);
738
+ }
739
+ return e ? r(e) : n;
740
+ }
741
+ function ln(e) {
742
+ const [t] = ht(e, 1);
743
+ return t ?? null;
744
+ }
745
+ function wt(e) {
746
+ return !ut || !e ? null : Re(e) ? e : At(e) ? It(e) || e === Ee(e).scrollingElement ? window : Ke(e) ? e : null : null;
747
+ }
748
+ function cn(e) {
749
+ return Re(e) ? e.scrollX : e.scrollLeft;
750
+ }
751
+ function un(e) {
752
+ return Re(e) ? e.scrollY : e.scrollTop;
753
+ }
754
+ function St(e) {
755
+ return {
756
+ x: cn(e),
757
+ y: un(e)
758
+ };
759
+ }
760
+ var k;
761
+ (function(e) {
762
+ e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
763
+ })(k || (k = {}));
764
+ function dn(e) {
765
+ return !ut || !e ? !1 : e === document.scrollingElement;
766
+ }
767
+ function fn(e) {
768
+ const t = {
769
+ x: 0,
770
+ y: 0
771
+ }, n = dn(e) ? {
772
+ height: window.innerHeight,
773
+ width: window.innerWidth
774
+ } : {
775
+ height: e.clientHeight,
776
+ width: e.clientWidth
777
+ }, r = {
778
+ x: e.scrollWidth - n.width,
779
+ y: e.scrollHeight - n.height
780
+ }, o = e.scrollTop <= t.y, i = e.scrollLeft <= t.x, s = e.scrollTop >= r.y, a = e.scrollLeft >= r.x;
781
+ return {
782
+ isTop: o,
783
+ isLeft: i,
784
+ isBottom: s,
785
+ isRight: a,
786
+ maxScroll: r,
787
+ minScroll: t
788
+ };
789
+ }
790
+ const mr = {
791
+ x: 0.2,
792
+ y: 0.2
793
+ };
794
+ function yr(e, t, n, r, o) {
795
+ let {
796
+ top: i,
797
+ left: s,
798
+ right: a,
799
+ bottom: l
800
+ } = n;
801
+ r === void 0 && (r = 10), o === void 0 && (o = mr);
802
+ const {
803
+ isTop: c,
804
+ isBottom: d,
805
+ isLeft: u,
806
+ isRight: f
807
+ } = fn(e), h = {
808
+ x: 0,
809
+ y: 0
810
+ }, w = {
811
+ x: 0,
812
+ y: 0
813
+ }, g = {
814
+ height: t.height * o.y,
815
+ width: t.width * o.x
816
+ };
817
+ return !c && i <= t.top + g.height ? (h.y = k.Backward, w.y = r * Math.abs((t.top + g.height - i) / g.height)) : !d && l >= t.bottom - g.height && (h.y = k.Forward, w.y = r * Math.abs((t.bottom - g.height - l) / g.height)), !f && a >= t.right - g.width ? (h.x = k.Forward, w.x = r * Math.abs((t.right - g.width - a) / g.width)) : !u && s <= t.left + g.width && (h.x = k.Backward, w.x = r * Math.abs((t.left + g.width - s) / g.width)), {
818
+ direction: h,
819
+ speed: w
820
+ };
821
+ }
822
+ function wr(e) {
823
+ if (e === document.scrollingElement) {
824
+ const {
825
+ innerWidth: i,
826
+ innerHeight: s
827
+ } = window;
828
+ return {
829
+ top: 0,
830
+ left: 0,
831
+ right: i,
832
+ bottom: s,
833
+ width: i,
834
+ height: s
835
+ };
836
+ }
837
+ const {
838
+ top: t,
839
+ left: n,
840
+ right: r,
841
+ bottom: o
842
+ } = e.getBoundingClientRect();
843
+ return {
844
+ top: t,
845
+ left: n,
846
+ right: r,
847
+ bottom: o,
848
+ width: e.clientWidth,
849
+ height: e.clientHeight
850
+ };
851
+ }
852
+ function hn(e) {
853
+ return e.reduce((t, n) => Se(t, St(n)), Q);
854
+ }
855
+ function xr(e) {
856
+ return e.reduce((t, n) => t + cn(n), 0);
857
+ }
858
+ function Dr(e) {
859
+ return e.reduce((t, n) => t + un(n), 0);
860
+ }
861
+ function gn(e, t) {
862
+ if (t === void 0 && (t = Ae), !e)
863
+ return;
864
+ const {
865
+ top: n,
866
+ left: r,
867
+ bottom: o,
868
+ right: i
869
+ } = t(e);
870
+ ln(e) && (o <= 0 || i <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
871
+ block: "center",
872
+ inline: "center"
873
+ });
874
+ }
875
+ const Cr = [["x", ["left", "right"], xr], ["y", ["top", "bottom"], Dr]];
876
+ class Tt {
877
+ constructor(t, n) {
878
+ 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;
879
+ const r = ht(n), o = hn(r);
880
+ this.rect = {
881
+ ...t
882
+ }, this.width = t.width, this.height = t.height;
883
+ for (const [i, s, a] of Cr)
884
+ for (const l of s)
885
+ Object.defineProperty(this, l, {
886
+ get: () => {
887
+ const c = a(r), d = o[i] - c;
888
+ return this.rect[l] + d;
889
+ },
890
+ enumerable: !0
891
+ });
892
+ Object.defineProperty(this, "rect", {
893
+ enumerable: !1
894
+ });
895
+ }
896
+ }
897
+ class ze {
898
+ constructor(t) {
899
+ this.target = void 0, this.listeners = [], this.removeAll = () => {
900
+ this.listeners.forEach((n) => {
901
+ var r;
902
+ return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
903
+ });
904
+ }, this.target = t;
905
+ }
906
+ add(t, n, r) {
907
+ var o;
908
+ (o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
909
+ }
910
+ }
911
+ function Sr(e) {
912
+ const {
913
+ EventTarget: t
914
+ } = X(e);
915
+ return e instanceof t ? e : Ee(e);
916
+ }
917
+ function xt(e, t) {
918
+ const n = Math.abs(e.x), r = Math.abs(e.y);
919
+ return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
920
+ }
921
+ var q;
922
+ (function(e) {
923
+ e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
924
+ })(q || (q = {}));
925
+ function Ut(e) {
926
+ e.preventDefault();
927
+ }
928
+ function Rr(e) {
929
+ e.stopPropagation();
930
+ }
931
+ var D;
932
+ (function(e) {
933
+ e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
934
+ })(D || (D = {}));
935
+ const vn = {
936
+ start: [D.Space, D.Enter],
937
+ cancel: [D.Esc],
938
+ end: [D.Space, D.Enter, D.Tab]
939
+ }, Er = (e, t) => {
940
+ let {
941
+ currentCoordinates: n
942
+ } = t;
943
+ switch (e.code) {
944
+ case D.Right:
945
+ return {
946
+ ...n,
947
+ x: n.x + 25
948
+ };
949
+ case D.Left:
950
+ return {
951
+ ...n,
952
+ x: n.x - 25
953
+ };
954
+ case D.Down:
955
+ return {
956
+ ...n,
957
+ y: n.y + 25
958
+ };
959
+ case D.Up:
960
+ return {
961
+ ...n,
962
+ y: n.y - 25
963
+ };
964
+ }
965
+ };
966
+ class pn {
967
+ constructor(t) {
968
+ this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
969
+ const {
970
+ event: {
971
+ target: n
972
+ }
973
+ } = t;
974
+ this.props = t, this.listeners = new ze(Ee(n)), this.windowListeners = new ze(X(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
975
+ }
976
+ attach() {
977
+ this.handleStart(), this.windowListeners.add(q.Resize, this.handleCancel), this.windowListeners.add(q.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(q.Keydown, this.handleKeyDown));
978
+ }
979
+ handleStart() {
980
+ const {
981
+ activeNode: t,
982
+ onStart: n
983
+ } = this.props, r = t.node.current;
984
+ r && gn(r), n(Q);
985
+ }
986
+ handleKeyDown(t) {
987
+ if (ft(t)) {
988
+ const {
989
+ active: n,
990
+ context: r,
991
+ options: o
992
+ } = this.props, {
993
+ keyboardCodes: i = vn,
994
+ coordinateGetter: s = Er,
995
+ scrollBehavior: a = "smooth"
996
+ } = o, {
997
+ code: l
998
+ } = t;
999
+ if (i.end.includes(l)) {
1000
+ this.handleEnd(t);
1001
+ return;
1002
+ }
1003
+ if (i.cancel.includes(l)) {
1004
+ this.handleCancel(t);
1005
+ return;
1006
+ }
1007
+ const {
1008
+ collisionRect: c
1009
+ } = r.current, d = c ? {
1010
+ x: c.left,
1011
+ y: c.top
1012
+ } : Q;
1013
+ this.referenceCoordinates || (this.referenceCoordinates = d);
1014
+ const u = s(t, {
1015
+ active: n,
1016
+ context: r.current,
1017
+ currentCoordinates: d
1018
+ });
1019
+ if (u) {
1020
+ const f = Xe(u, d), h = {
1021
+ x: 0,
1022
+ y: 0
1023
+ }, {
1024
+ scrollableAncestors: w
1025
+ } = r.current;
1026
+ for (const g of w) {
1027
+ const v = t.code, {
1028
+ isTop: b,
1029
+ isRight: m,
1030
+ isLeft: p,
1031
+ isBottom: C,
1032
+ maxScroll: S,
1033
+ minScroll: R
1034
+ } = fn(g), y = wr(g), x = {
1035
+ x: Math.min(v === D.Right ? y.right - y.width / 2 : y.right, Math.max(v === D.Right ? y.left : y.left + y.width / 2, u.x)),
1036
+ y: Math.min(v === D.Down ? y.bottom - y.height / 2 : y.bottom, Math.max(v === D.Down ? y.top : y.top + y.height / 2, u.y))
1037
+ }, T = v === D.Right && !m || v === D.Left && !p, L = v === D.Down && !C || v === D.Up && !b;
1038
+ if (T && x.x !== u.x) {
1039
+ const I = g.scrollLeft + f.x, G = v === D.Right && I <= S.x || v === D.Left && I >= R.x;
1040
+ if (G && !f.y) {
1041
+ g.scrollTo({
1042
+ left: I,
1043
+ behavior: a
1044
+ });
1045
+ return;
1046
+ }
1047
+ G ? h.x = g.scrollLeft - I : h.x = v === D.Right ? g.scrollLeft - S.x : g.scrollLeft - R.x, h.x && g.scrollBy({
1048
+ left: -h.x,
1049
+ behavior: a
1050
+ });
1051
+ break;
1052
+ } else if (L && x.y !== u.y) {
1053
+ const I = g.scrollTop + f.y, G = v === D.Down && I <= S.y || v === D.Up && I >= R.y;
1054
+ if (G && !f.x) {
1055
+ g.scrollTo({
1056
+ top: I,
1057
+ behavior: a
1058
+ });
1059
+ return;
1060
+ }
1061
+ G ? h.y = g.scrollTop - I : h.y = v === D.Down ? g.scrollTop - S.y : g.scrollTop - R.y, h.y && g.scrollBy({
1062
+ top: -h.y,
1063
+ behavior: a
1064
+ });
1065
+ break;
1066
+ }
1067
+ }
1068
+ this.handleMove(t, Se(Xe(u, this.referenceCoordinates), h));
1069
+ }
1070
+ }
1071
+ }
1072
+ handleMove(t, n) {
1073
+ const {
1074
+ onMove: r
1075
+ } = this.props;
1076
+ t.preventDefault(), r(n);
1077
+ }
1078
+ handleEnd(t) {
1079
+ const {
1080
+ onEnd: n
1081
+ } = this.props;
1082
+ t.preventDefault(), this.detach(), n();
1083
+ }
1084
+ handleCancel(t) {
1085
+ const {
1086
+ onCancel: n
1087
+ } = this.props;
1088
+ t.preventDefault(), this.detach(), n();
1089
+ }
1090
+ detach() {
1091
+ this.listeners.removeAll(), this.windowListeners.removeAll();
1092
+ }
1093
+ }
1094
+ pn.activators = [{
1095
+ eventName: "onKeyDown",
1096
+ handler: (e, t, n) => {
1097
+ let {
1098
+ keyboardCodes: r = vn,
1099
+ onActivation: o
1100
+ } = t, {
1101
+ active: i
1102
+ } = n;
1103
+ const {
1104
+ code: s
1105
+ } = e.nativeEvent;
1106
+ if (r.start.includes(s)) {
1107
+ const a = i.activatorNode.current;
1108
+ return a && e.target !== a ? !1 : (e.preventDefault(), o?.({
1109
+ event: e.nativeEvent
1110
+ }), !0);
1111
+ }
1112
+ return !1;
1113
+ }
1114
+ }];
1115
+ function Ht(e) {
1116
+ return !!(e && "distance" in e);
1117
+ }
1118
+ function Vt(e) {
1119
+ return !!(e && "delay" in e);
1120
+ }
1121
+ class Mt {
1122
+ constructor(t, n, r) {
1123
+ var o;
1124
+ r === void 0 && (r = Sr(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;
1125
+ const {
1126
+ event: i
1127
+ } = t, {
1128
+ target: s
1129
+ } = i;
1130
+ this.props = t, this.events = n, this.document = Ee(s), this.documentListeners = new ze(this.document), this.listeners = new ze(r), this.windowListeners = new ze(X(s)), this.initialCoordinates = (o = st(i)) != null ? o : Q, 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();
1131
+ }
1132
+ attach() {
1133
+ const {
1134
+ events: t,
1135
+ props: {
1136
+ options: {
1137
+ activationConstraint: n,
1138
+ bypassActivationConstraint: r
1139
+ }
1140
+ }
1141
+ } = this;
1142
+ if (this.listeners.add(t.move.name, this.handleMove, {
1143
+ passive: !1
1144
+ }), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(q.Resize, this.handleCancel), this.windowListeners.add(q.DragStart, Ut), this.windowListeners.add(q.VisibilityChange, this.handleCancel), this.windowListeners.add(q.ContextMenu, Ut), this.documentListeners.add(q.Keydown, this.handleKeydown), n) {
1145
+ if (r != null && r({
1146
+ event: this.props.event,
1147
+ activeNode: this.props.activeNode,
1148
+ options: this.props.options
1149
+ }))
1150
+ return this.handleStart();
1151
+ if (Vt(n)) {
1152
+ this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
1153
+ return;
1154
+ }
1155
+ if (Ht(n)) {
1156
+ this.handlePending(n);
1157
+ return;
1158
+ }
1159
+ }
1160
+ this.handleStart();
1161
+ }
1162
+ detach() {
1163
+ this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
1164
+ }
1165
+ handlePending(t, n) {
1166
+ const {
1167
+ active: r,
1168
+ onPending: o
1169
+ } = this.props;
1170
+ o(r, t, this.initialCoordinates, n);
1171
+ }
1172
+ handleStart() {
1173
+ const {
1174
+ initialCoordinates: t
1175
+ } = this, {
1176
+ onStart: n
1177
+ } = this.props;
1178
+ t && (this.activated = !0, this.documentListeners.add(q.Click, Rr, {
1179
+ capture: !0
1180
+ }), this.removeTextSelection(), this.documentListeners.add(q.SelectionChange, this.removeTextSelection), n(t));
1181
+ }
1182
+ handleMove(t) {
1183
+ var n;
1184
+ const {
1185
+ activated: r,
1186
+ initialCoordinates: o,
1187
+ props: i
1188
+ } = this, {
1189
+ onMove: s,
1190
+ options: {
1191
+ activationConstraint: a
1192
+ }
1193
+ } = i;
1194
+ if (!o)
1195
+ return;
1196
+ const l = (n = st(t)) != null ? n : Q, c = Xe(o, l);
1197
+ if (!r && a) {
1198
+ if (Ht(a)) {
1199
+ if (a.tolerance != null && xt(c, a.tolerance))
1200
+ return this.handleCancel();
1201
+ if (xt(c, a.distance))
1202
+ return this.handleStart();
1203
+ }
1204
+ if (Vt(a) && xt(c, a.tolerance))
1205
+ return this.handleCancel();
1206
+ this.handlePending(a, c);
1207
+ return;
1208
+ }
1209
+ t.cancelable && t.preventDefault(), s(l);
1210
+ }
1211
+ handleEnd() {
1212
+ const {
1213
+ onAbort: t,
1214
+ onEnd: n
1215
+ } = this.props;
1216
+ this.detach(), this.activated || t(this.props.active), n();
1217
+ }
1218
+ handleCancel() {
1219
+ const {
1220
+ onAbort: t,
1221
+ onCancel: n
1222
+ } = this.props;
1223
+ this.detach(), this.activated || t(this.props.active), n();
1224
+ }
1225
+ handleKeydown(t) {
1226
+ t.code === D.Esc && this.handleCancel();
1227
+ }
1228
+ removeTextSelection() {
1229
+ var t;
1230
+ (t = this.document.getSelection()) == null || t.removeAllRanges();
1231
+ }
1232
+ }
1233
+ const Ar = {
1234
+ cancel: {
1235
+ name: "pointercancel"
1236
+ },
1237
+ move: {
1238
+ name: "pointermove"
1239
+ },
1240
+ end: {
1241
+ name: "pointerup"
1242
+ }
1243
+ };
1244
+ class bn extends Mt {
1245
+ constructor(t) {
1246
+ const {
1247
+ event: n
1248
+ } = t, r = Ee(n.target);
1249
+ super(t, Ar, r);
1250
+ }
1251
+ }
1252
+ bn.activators = [{
1253
+ eventName: "onPointerDown",
1254
+ handler: (e, t) => {
1255
+ let {
1256
+ nativeEvent: n
1257
+ } = e, {
1258
+ onActivation: r
1259
+ } = t;
1260
+ return !n.isPrimary || n.button !== 0 ? !1 : (r?.({
1261
+ event: n
1262
+ }), !0);
1263
+ }
1264
+ }];
1265
+ const Ir = {
1266
+ move: {
1267
+ name: "mousemove"
1268
+ },
1269
+ end: {
1270
+ name: "mouseup"
1271
+ }
1272
+ };
1273
+ var Rt;
1274
+ (function(e) {
1275
+ e[e.RightClick = 2] = "RightClick";
1276
+ })(Rt || (Rt = {}));
1277
+ class Or extends Mt {
1278
+ constructor(t) {
1279
+ super(t, Ir, Ee(t.event.target));
1280
+ }
1281
+ }
1282
+ Or.activators = [{
1283
+ eventName: "onMouseDown",
1284
+ handler: (e, t) => {
1285
+ let {
1286
+ nativeEvent: n
1287
+ } = e, {
1288
+ onActivation: r
1289
+ } = t;
1290
+ return n.button === Rt.RightClick ? !1 : (r?.({
1291
+ event: n
1292
+ }), !0);
1293
+ }
1294
+ }];
1295
+ const Dt = {
1296
+ cancel: {
1297
+ name: "touchcancel"
1298
+ },
1299
+ move: {
1300
+ name: "touchmove"
1301
+ },
1302
+ end: {
1303
+ name: "touchend"
1304
+ }
1305
+ };
1306
+ class Nr extends Mt {
1307
+ constructor(t) {
1308
+ super(t, Dt);
1309
+ }
1310
+ static setup() {
1311
+ return window.addEventListener(Dt.move.name, t, {
1312
+ capture: !1,
1313
+ passive: !1
1314
+ }), function() {
1315
+ window.removeEventListener(Dt.move.name, t);
1316
+ };
1317
+ function t() {
1318
+ }
1319
+ }
1320
+ }
1321
+ Nr.activators = [{
1322
+ eventName: "onTouchStart",
1323
+ handler: (e, t) => {
1324
+ let {
1325
+ nativeEvent: n
1326
+ } = e, {
1327
+ onActivation: r
1328
+ } = t;
1329
+ const {
1330
+ touches: o
1331
+ } = n;
1332
+ return o.length > 1 ? !1 : (r?.({
1333
+ event: n
1334
+ }), !0);
1335
+ }
1336
+ }];
1337
+ var Be;
1338
+ (function(e) {
1339
+ e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
1340
+ })(Be || (Be = {}));
1341
+ var lt;
1342
+ (function(e) {
1343
+ e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
1344
+ })(lt || (lt = {}));
1345
+ function Tr(e) {
1346
+ let {
1347
+ acceleration: t,
1348
+ activator: n = Be.Pointer,
1349
+ canScroll: r,
1350
+ draggingRect: o,
1351
+ enabled: i,
1352
+ interval: s = 5,
1353
+ order: a = lt.TreeOrder,
1354
+ pointerCoordinates: l,
1355
+ scrollableAncestors: c,
1356
+ scrollableAncestorRects: d,
1357
+ delta: u,
1358
+ threshold: f
1359
+ } = e;
1360
+ const h = Lr({
1361
+ delta: u,
1362
+ disabled: !i
1363
+ }), [w, g] = Un(), v = N({
1364
+ x: 0,
1365
+ y: 0
1366
+ }), b = N({
1367
+ x: 0,
1368
+ y: 0
1369
+ }), m = A(() => {
1370
+ switch (n) {
1371
+ case Be.Pointer:
1372
+ return l ? {
1373
+ top: l.y,
1374
+ bottom: l.y,
1375
+ left: l.x,
1376
+ right: l.x
1377
+ } : null;
1378
+ case Be.DraggableRect:
1379
+ return o;
1380
+ }
1381
+ }, [n, o, l]), p = N(null), C = F(() => {
1382
+ const R = p.current;
1383
+ if (!R)
1384
+ return;
1385
+ const y = v.current.x * b.current.x, x = v.current.y * b.current.y;
1386
+ R.scrollBy(y, x);
1387
+ }, []), S = A(() => a === lt.TreeOrder ? [...c].reverse() : c, [a, c]);
1388
+ O(
1389
+ () => {
1390
+ if (!i || !c.length || !m) {
1391
+ g();
1392
+ return;
1393
+ }
1394
+ for (const R of S) {
1395
+ if (r?.(R) === !1)
1396
+ continue;
1397
+ const y = c.indexOf(R), x = d[y];
1398
+ if (!x)
1399
+ continue;
1400
+ const {
1401
+ direction: T,
1402
+ speed: L
1403
+ } = yr(R, x, m, t, f);
1404
+ for (const I of ["x", "y"])
1405
+ h[I][T[I]] || (L[I] = 0, T[I] = 0);
1406
+ if (L.x > 0 || L.y > 0) {
1407
+ g(), p.current = R, w(C, s), v.current = L, b.current = T;
1408
+ return;
1409
+ }
1410
+ }
1411
+ v.current = {
1412
+ x: 0,
1413
+ y: 0
1414
+ }, b.current = {
1415
+ x: 0,
1416
+ y: 0
1417
+ }, g();
1418
+ },
1419
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1420
+ [
1421
+ t,
1422
+ C,
1423
+ r,
1424
+ g,
1425
+ i,
1426
+ s,
1427
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1428
+ JSON.stringify(m),
1429
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1430
+ JSON.stringify(h),
1431
+ w,
1432
+ c,
1433
+ S,
1434
+ d,
1435
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1436
+ JSON.stringify(f)
1437
+ ]
1438
+ );
1439
+ }
1440
+ const Mr = {
1441
+ x: {
1442
+ [k.Backward]: !1,
1443
+ [k.Forward]: !1
1444
+ },
1445
+ y: {
1446
+ [k.Backward]: !1,
1447
+ [k.Forward]: !1
1448
+ }
1449
+ };
1450
+ function Lr(e) {
1451
+ let {
1452
+ delta: t,
1453
+ disabled: n
1454
+ } = e;
1455
+ const r = it(t);
1456
+ return We((o) => {
1457
+ if (n || !r || !o)
1458
+ return Mr;
1459
+ const i = {
1460
+ x: Math.sign(t.x - r.x),
1461
+ y: Math.sign(t.y - r.y)
1462
+ };
1463
+ return {
1464
+ x: {
1465
+ [k.Backward]: o.x[k.Backward] || i.x === -1,
1466
+ [k.Forward]: o.x[k.Forward] || i.x === 1
1467
+ },
1468
+ y: {
1469
+ [k.Backward]: o.y[k.Backward] || i.y === -1,
1470
+ [k.Forward]: o.y[k.Forward] || i.y === 1
1471
+ }
1472
+ };
1473
+ }, [n, t, r]);
1474
+ }
1475
+ function Pr(e, t) {
1476
+ const n = t != null ? e.get(t) : void 0, r = n ? n.node.current : null;
1477
+ return We((o) => {
1478
+ var i;
1479
+ return t == null ? null : (i = r ?? o) != null ? i : null;
1480
+ }, [r, t]);
1481
+ }
1482
+ function kr(e, t) {
1483
+ return A(() => e.reduce((n, r) => {
1484
+ const {
1485
+ sensor: o
1486
+ } = r, i = o.activators.map((s) => ({
1487
+ eventName: s.eventName,
1488
+ handler: t(s.handler, r)
1489
+ }));
1490
+ return [...n, ...i];
1491
+ }, []), [e, t]);
1492
+ }
1493
+ var je;
1494
+ (function(e) {
1495
+ e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
1496
+ })(je || (je = {}));
1497
+ var Et;
1498
+ (function(e) {
1499
+ e.Optimized = "optimized";
1500
+ })(Et || (Et = {}));
1501
+ const qt = /* @__PURE__ */ new Map();
1502
+ function zr(e, t) {
1503
+ let {
1504
+ dragging: n,
1505
+ dependencies: r,
1506
+ config: o
1507
+ } = t;
1508
+ const [i, s] = $(null), {
1509
+ frequency: a,
1510
+ measure: l,
1511
+ strategy: c
1512
+ } = o, d = N(e), u = v(), f = $e(u), h = F(function(b) {
1513
+ b === void 0 && (b = []), !f.current && s((m) => m === null ? b : m.concat(b.filter((p) => !m.includes(p))));
1514
+ }, [f]), w = N(null), g = We((b) => {
1515
+ if (u && !n)
1516
+ return qt;
1517
+ if (!b || b === qt || d.current !== e || i != null) {
1518
+ const m = /* @__PURE__ */ new Map();
1519
+ for (let p of e) {
1520
+ if (!p)
1521
+ continue;
1522
+ if (i && i.length > 0 && !i.includes(p.id) && p.rect.current) {
1523
+ m.set(p.id, p.rect.current);
1524
+ continue;
1525
+ }
1526
+ const C = p.node.current, S = C ? new Tt(l(C), C) : null;
1527
+ p.rect.current = S, S && m.set(p.id, S);
1528
+ }
1529
+ return m;
1530
+ }
1531
+ return b;
1532
+ }, [e, i, n, u, l]);
1533
+ return O(() => {
1534
+ d.current = e;
1535
+ }, [e]), O(
1536
+ () => {
1537
+ u || h();
1538
+ },
1539
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1540
+ [n, u]
1541
+ ), O(
1542
+ () => {
1543
+ i && i.length > 0 && s(null);
1544
+ },
1545
+ //eslint-disable-next-line react-hooks/exhaustive-deps
1546
+ [JSON.stringify(i)]
1547
+ ), O(
1548
+ () => {
1549
+ u || typeof a != "number" || w.current !== null || (w.current = setTimeout(() => {
1550
+ h(), w.current = null;
1551
+ }, a));
1552
+ },
1553
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1554
+ [a, u, h, ...r]
1555
+ ), {
1556
+ droppableRects: g,
1557
+ measureDroppableContainers: h,
1558
+ measuringScheduled: i != null
1559
+ };
1560
+ function v() {
1561
+ switch (c) {
1562
+ case je.Always:
1563
+ return !1;
1564
+ case je.BeforeDragging:
1565
+ return n;
1566
+ default:
1567
+ return !n;
1568
+ }
1569
+ }
1570
+ }
1571
+ function Lt(e, t) {
1572
+ return We((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
1573
+ }
1574
+ function Br(e, t) {
1575
+ return Lt(e, t);
1576
+ }
1577
+ function Fr(e) {
1578
+ let {
1579
+ callback: t,
1580
+ disabled: n
1581
+ } = e;
1582
+ const r = dt(t), o = A(() => {
1583
+ if (n || typeof window > "u" || typeof window.MutationObserver > "u")
1584
+ return;
1585
+ const {
1586
+ MutationObserver: i
1587
+ } = window;
1588
+ return new i(r);
1589
+ }, [r, n]);
1590
+ return O(() => () => o?.disconnect(), [o]), o;
1591
+ }
1592
+ function gt(e) {
1593
+ let {
1594
+ callback: t,
1595
+ disabled: n
1596
+ } = e;
1597
+ const r = dt(t), o = A(
1598
+ () => {
1599
+ if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
1600
+ return;
1601
+ const {
1602
+ ResizeObserver: i
1603
+ } = window;
1604
+ return new i(r);
1605
+ },
1606
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1607
+ [n]
1608
+ );
1609
+ return O(() => () => o?.disconnect(), [o]), o;
1610
+ }
1611
+ function $r(e) {
1612
+ return new Tt(Ae(e), e);
1613
+ }
1614
+ function Gt(e, t, n) {
1615
+ t === void 0 && (t = $r);
1616
+ const [r, o] = $(null);
1617
+ function i() {
1618
+ o((l) => {
1619
+ if (!e)
1620
+ return null;
1621
+ if (e.isConnected === !1) {
1622
+ var c;
1623
+ return (c = l ?? n) != null ? c : null;
1624
+ }
1625
+ const d = t(e);
1626
+ return JSON.stringify(l) === JSON.stringify(d) ? l : d;
1627
+ });
1628
+ }
1629
+ const s = Fr({
1630
+ callback(l) {
1631
+ if (e)
1632
+ for (const c of l) {
1633
+ const {
1634
+ type: d,
1635
+ target: u
1636
+ } = c;
1637
+ if (d === "childList" && u instanceof HTMLElement && u.contains(e)) {
1638
+ i();
1639
+ break;
1640
+ }
1641
+ }
1642
+ }
1643
+ }), a = gt({
1644
+ callback: i
1645
+ });
1646
+ return _(() => {
1647
+ i(), e ? (a?.observe(e), s?.observe(document.body, {
1648
+ childList: !0,
1649
+ subtree: !0
1650
+ })) : (a?.disconnect(), s?.disconnect());
1651
+ }, [e]), r;
1652
+ }
1653
+ function Xr(e) {
1654
+ const t = Lt(e);
1655
+ return sn(e, t);
1656
+ }
1657
+ const Jt = [];
1658
+ function jr(e) {
1659
+ const t = N(e), n = We((r) => e ? r && r !== Jt && e && t.current && e.parentNode === t.current.parentNode ? r : ht(e) : Jt, [e]);
1660
+ return O(() => {
1661
+ t.current = e;
1662
+ }, [e]), n;
1663
+ }
1664
+ function Yr(e) {
1665
+ const [t, n] = $(null), r = N(e), o = F((i) => {
1666
+ const s = wt(i.target);
1667
+ s && n((a) => a ? (a.set(s, St(s)), new Map(a)) : null);
1668
+ }, []);
1669
+ return O(() => {
1670
+ const i = r.current;
1671
+ if (e !== i) {
1672
+ s(i);
1673
+ const a = e.map((l) => {
1674
+ const c = wt(l);
1675
+ return c ? (c.addEventListener("scroll", o, {
1676
+ passive: !0
1677
+ }), [c, St(c)]) : null;
1678
+ }).filter((l) => l != null);
1679
+ n(a.length ? new Map(a) : null), r.current = e;
1680
+ }
1681
+ return () => {
1682
+ s(e), s(i);
1683
+ };
1684
+ function s(a) {
1685
+ a.forEach((l) => {
1686
+ const c = wt(l);
1687
+ c?.removeEventListener("scroll", o);
1688
+ });
1689
+ }
1690
+ }, [o, e]), A(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => Se(i, s), Q) : hn(e) : Q, [e, t]);
1691
+ }
1692
+ function _t(e, t) {
1693
+ t === void 0 && (t = []);
1694
+ const n = N(null);
1695
+ return O(
1696
+ () => {
1697
+ n.current = null;
1698
+ },
1699
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1700
+ t
1701
+ ), O(() => {
1702
+ const r = e !== Q;
1703
+ r && !n.current && (n.current = e), !r && n.current && (n.current = null);
1704
+ }, [e]), n.current ? Xe(e, n.current) : Q;
1705
+ }
1706
+ function Kr(e) {
1707
+ O(
1708
+ () => {
1709
+ if (!ut)
1710
+ return;
1711
+ const t = e.map((n) => {
1712
+ let {
1713
+ sensor: r
1714
+ } = n;
1715
+ return r.setup == null ? void 0 : r.setup();
1716
+ });
1717
+ return () => {
1718
+ for (const n of t)
1719
+ n?.();
1720
+ };
1721
+ },
1722
+ // TO-DO: Sensors length could theoretically change which would not be a valid dependency
1723
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1724
+ e.map((t) => {
1725
+ let {
1726
+ sensor: n
1727
+ } = t;
1728
+ return n;
1729
+ })
1730
+ );
1731
+ }
1732
+ function Wr(e, t) {
1733
+ return A(() => e.reduce((n, r) => {
1734
+ let {
1735
+ eventName: o,
1736
+ handler: i
1737
+ } = r;
1738
+ return n[o] = (s) => {
1739
+ i(s, t);
1740
+ }, n;
1741
+ }, {}), [e, t]);
1742
+ }
1743
+ function mn(e) {
1744
+ return A(() => e ? vr(e) : null, [e]);
1745
+ }
1746
+ const Qt = [];
1747
+ function Ur(e, t) {
1748
+ t === void 0 && (t = Ae);
1749
+ const [n] = e, r = mn(n ? X(n) : null), [o, i] = $(Qt);
1750
+ function s() {
1751
+ i(() => e.length ? e.map((l) => dn(l) ? r : new Tt(t(l), l)) : Qt);
1752
+ }
1753
+ const a = gt({
1754
+ callback: s
1755
+ });
1756
+ return _(() => {
1757
+ a?.disconnect(), s(), e.forEach((l) => a?.observe(l));
1758
+ }, [e]), o;
1759
+ }
1760
+ function yn(e) {
1761
+ if (!e)
1762
+ return null;
1763
+ if (e.children.length > 1)
1764
+ return e;
1765
+ const t = e.children[0];
1766
+ return Ke(t) ? t : e;
1767
+ }
1768
+ function Hr(e) {
1769
+ let {
1770
+ measure: t
1771
+ } = e;
1772
+ const [n, r] = $(null), o = F((c) => {
1773
+ for (const {
1774
+ target: d
1775
+ } of c)
1776
+ if (Ke(d)) {
1777
+ r((u) => {
1778
+ const f = t(d);
1779
+ return u ? {
1780
+ ...u,
1781
+ width: f.width,
1782
+ height: f.height
1783
+ } : f;
1784
+ });
1785
+ break;
1786
+ }
1787
+ }, [t]), i = gt({
1788
+ callback: o
1789
+ }), s = F((c) => {
1790
+ const d = yn(c);
1791
+ i?.disconnect(), d && i?.observe(d), r(d ? t(d) : null);
1792
+ }, [t, i]), [a, l] = ot(s);
1793
+ return A(() => ({
1794
+ nodeRef: a,
1795
+ rect: n,
1796
+ setRef: l
1797
+ }), [n, a, l]);
1798
+ }
1799
+ const Vr = [{
1800
+ sensor: bn,
1801
+ options: {}
1802
+ }, {
1803
+ sensor: pn,
1804
+ options: {}
1805
+ }], qr = {
1806
+ current: {}
1807
+ }, rt = {
1808
+ draggable: {
1809
+ measure: Wt
1810
+ },
1811
+ droppable: {
1812
+ measure: Wt,
1813
+ strategy: je.WhileDragging,
1814
+ frequency: Et.Optimized
1815
+ },
1816
+ dragOverlay: {
1817
+ measure: Ae
1818
+ }
1819
+ };
1820
+ class Fe extends Map {
1821
+ get(t) {
1822
+ var n;
1823
+ return t != null && (n = super.get(t)) != null ? n : void 0;
1824
+ }
1825
+ toArray() {
1826
+ return Array.from(this.values());
1827
+ }
1828
+ getEnabled() {
1829
+ return this.toArray().filter((t) => {
1830
+ let {
1831
+ disabled: n
1832
+ } = t;
1833
+ return !n;
1834
+ });
1835
+ }
1836
+ getNodeFor(t) {
1837
+ var n, r;
1838
+ return (n = (r = this.get(t)) == null ? void 0 : r.node.current) != null ? n : void 0;
1839
+ }
1840
+ }
1841
+ const Gr = {
1842
+ activatorEvent: null,
1843
+ active: null,
1844
+ activeNode: null,
1845
+ activeNodeRect: null,
1846
+ collisions: null,
1847
+ containerNodeRect: null,
1848
+ draggableNodes: /* @__PURE__ */ new Map(),
1849
+ droppableRects: /* @__PURE__ */ new Map(),
1850
+ droppableContainers: /* @__PURE__ */ new Fe(),
1851
+ over: null,
1852
+ dragOverlay: {
1853
+ nodeRef: {
1854
+ current: null
1855
+ },
1856
+ rect: null,
1857
+ setRef: at
1858
+ },
1859
+ scrollableAncestors: [],
1860
+ scrollableAncestorRects: [],
1861
+ measuringConfiguration: rt,
1862
+ measureDroppableContainers: at,
1863
+ windowRect: null,
1864
+ measuringScheduled: !1
1865
+ }, wn = {
1866
+ activatorEvent: null,
1867
+ activators: [],
1868
+ active: null,
1869
+ activeNodeRect: null,
1870
+ ariaDescribedById: {
1871
+ draggable: ""
1872
+ },
1873
+ dispatch: at,
1874
+ draggableNodes: /* @__PURE__ */ new Map(),
1875
+ over: null,
1876
+ measureDroppableContainers: at
1877
+ }, He = /* @__PURE__ */ Ye(wn), xn = /* @__PURE__ */ Ye(Gr);
1878
+ function Jr() {
1879
+ return {
1880
+ draggable: {
1881
+ active: null,
1882
+ initialCoordinates: {
1883
+ x: 0,
1884
+ y: 0
1885
+ },
1886
+ nodes: /* @__PURE__ */ new Map(),
1887
+ translate: {
1888
+ x: 0,
1889
+ y: 0
1890
+ }
1891
+ },
1892
+ droppable: {
1893
+ containers: new Fe()
1894
+ }
1895
+ };
1896
+ }
1897
+ function _r(e, t) {
1898
+ switch (t.type) {
1899
+ case P.DragStart:
1900
+ return {
1901
+ ...e,
1902
+ draggable: {
1903
+ ...e.draggable,
1904
+ initialCoordinates: t.initialCoordinates,
1905
+ active: t.active
1906
+ }
1907
+ };
1908
+ case P.DragMove:
1909
+ return e.draggable.active == null ? e : {
1910
+ ...e,
1911
+ draggable: {
1912
+ ...e.draggable,
1913
+ translate: {
1914
+ x: t.coordinates.x - e.draggable.initialCoordinates.x,
1915
+ y: t.coordinates.y - e.draggable.initialCoordinates.y
1916
+ }
1917
+ }
1918
+ };
1919
+ case P.DragEnd:
1920
+ case P.DragCancel:
1921
+ return {
1922
+ ...e,
1923
+ draggable: {
1924
+ ...e.draggable,
1925
+ active: null,
1926
+ initialCoordinates: {
1927
+ x: 0,
1928
+ y: 0
1929
+ },
1930
+ translate: {
1931
+ x: 0,
1932
+ y: 0
1933
+ }
1934
+ }
1935
+ };
1936
+ case P.RegisterDroppable: {
1937
+ const {
1938
+ element: n
1939
+ } = t, {
1940
+ id: r
1941
+ } = n, o = new Fe(e.droppable.containers);
1942
+ return o.set(r, n), {
1943
+ ...e,
1944
+ droppable: {
1945
+ ...e.droppable,
1946
+ containers: o
1947
+ }
1948
+ };
1949
+ }
1950
+ case P.SetDroppableDisabled: {
1951
+ const {
1952
+ id: n,
1953
+ key: r,
1954
+ disabled: o
1955
+ } = t, i = e.droppable.containers.get(n);
1956
+ if (!i || r !== i.key)
1957
+ return e;
1958
+ const s = new Fe(e.droppable.containers);
1959
+ return s.set(n, {
1960
+ ...i,
1961
+ disabled: o
1962
+ }), {
1963
+ ...e,
1964
+ droppable: {
1965
+ ...e.droppable,
1966
+ containers: s
1967
+ }
1968
+ };
1969
+ }
1970
+ case P.UnregisterDroppable: {
1971
+ const {
1972
+ id: n,
1973
+ key: r
1974
+ } = t, o = e.droppable.containers.get(n);
1975
+ if (!o || r !== o.key)
1976
+ return e;
1977
+ const i = new Fe(e.droppable.containers);
1978
+ return i.delete(n), {
1979
+ ...e,
1980
+ droppable: {
1981
+ ...e.droppable,
1982
+ containers: i
1983
+ }
1984
+ };
1985
+ }
1986
+ default:
1987
+ return e;
1988
+ }
1989
+ }
1990
+ function Qr(e) {
1991
+ let {
1992
+ disabled: t
1993
+ } = e;
1994
+ const {
1995
+ active: n,
1996
+ activatorEvent: r,
1997
+ draggableNodes: o
1998
+ } = ve(He), i = it(r), s = it(n?.id);
1999
+ return O(() => {
2000
+ if (!t && !r && i && s != null) {
2001
+ if (!ft(i) || document.activeElement === i.target)
2002
+ return;
2003
+ const a = o.get(s);
2004
+ if (!a)
2005
+ return;
2006
+ const {
2007
+ activatorNode: l,
2008
+ node: c
2009
+ } = a;
2010
+ if (!l.current && !c.current)
2011
+ return;
2012
+ requestAnimationFrame(() => {
2013
+ for (const d of [l.current, c.current]) {
2014
+ if (!d)
2015
+ continue;
2016
+ const u = qn(d);
2017
+ if (u) {
2018
+ u.focus();
2019
+ break;
2020
+ }
2021
+ }
2022
+ });
2023
+ }
2024
+ }, [r, t, o, s, i]), null;
2025
+ }
2026
+ function Dn(e, t) {
2027
+ let {
2028
+ transform: n,
2029
+ ...r
2030
+ } = t;
2031
+ return e != null && e.length ? e.reduce((o, i) => i({
2032
+ transform: o,
2033
+ ...r
2034
+ }), n) : n;
2035
+ }
2036
+ function Zr(e) {
2037
+ return A(
2038
+ () => ({
2039
+ draggable: {
2040
+ ...rt.draggable,
2041
+ ...e?.draggable
2042
+ },
2043
+ droppable: {
2044
+ ...rt.droppable,
2045
+ ...e?.droppable
2046
+ },
2047
+ dragOverlay: {
2048
+ ...rt.dragOverlay,
2049
+ ...e?.dragOverlay
2050
+ }
2051
+ }),
2052
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2053
+ [e?.draggable, e?.droppable, e?.dragOverlay]
2054
+ );
2055
+ }
2056
+ function eo(e) {
2057
+ let {
2058
+ activeNode: t,
2059
+ measure: n,
2060
+ initialRect: r,
2061
+ config: o = !0
2062
+ } = e;
2063
+ const i = N(!1), {
2064
+ x: s,
2065
+ y: a
2066
+ } = typeof o == "boolean" ? {
2067
+ x: o,
2068
+ y: o
2069
+ } : o;
2070
+ _(() => {
2071
+ if (!s && !a || !t) {
2072
+ i.current = !1;
2073
+ return;
2074
+ }
2075
+ if (i.current || !r)
2076
+ return;
2077
+ const c = t?.node.current;
2078
+ if (!c || c.isConnected === !1)
2079
+ return;
2080
+ const d = n(c), u = sn(d, r);
2081
+ if (s || (u.x = 0), a || (u.y = 0), i.current = !0, Math.abs(u.x) > 0 || Math.abs(u.y) > 0) {
2082
+ const f = ln(c);
2083
+ f && f.scrollBy({
2084
+ top: u.y,
2085
+ left: u.x
2086
+ });
2087
+ }
2088
+ }, [t, s, a, r, n]);
2089
+ }
2090
+ const vt = /* @__PURE__ */ Ye({
2091
+ ...Q,
2092
+ scaleX: 1,
2093
+ scaleY: 1
2094
+ });
2095
+ var ge;
2096
+ (function(e) {
2097
+ e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
2098
+ })(ge || (ge = {}));
2099
+ const Xo = /* @__PURE__ */ $n(function(t) {
2100
+ var n, r, o, i;
2101
+ let {
2102
+ id: s,
2103
+ accessibility: a,
2104
+ autoScroll: l = !0,
2105
+ children: c,
2106
+ sensors: d = Vr,
2107
+ collisionDetection: u = lr,
2108
+ measuring: f,
2109
+ modifiers: h,
2110
+ ...w
2111
+ } = t;
2112
+ const g = Xn(_r, void 0, Jr), [v, b] = g, [m, p] = er(), [C, S] = $(ge.Uninitialized), R = C === ge.Initialized, {
2113
+ draggable: {
2114
+ active: y,
2115
+ nodes: x,
2116
+ translate: T
2117
+ },
2118
+ droppable: {
2119
+ containers: L
2120
+ }
2121
+ } = v, I = y != null ? x.get(y) : null, G = N({
2122
+ initial: null,
2123
+ translated: null
2124
+ }), J = A(() => {
2125
+ var B;
2126
+ return y != null ? {
2127
+ id: y,
2128
+ // It's possible for the active node to unmount while dragging
2129
+ data: (B = I?.data) != null ? B : qr,
2130
+ rect: G
2131
+ } : null;
2132
+ }, [y, I]), Z = N(null), [Ie, Ve] = $(null), [Y, qe] = $(null), re = $e(w, Object.values(w)), Oe = Ue("DndDescribedBy", s), Ge = A(() => L.getEnabled(), [L]), j = Zr(f), {
2133
+ droppableRects: oe,
2134
+ measureDroppableContainers: pe,
2135
+ measuringScheduled: Ne
2136
+ } = zr(Ge, {
2137
+ dragging: R,
2138
+ dependencies: [T.x, T.y],
2139
+ config: j.droppable
2140
+ }), H = Pr(x, y), Je = A(() => Y ? st(Y) : null, [Y]), le = Bn(), ie = Br(H, j.draggable.measure);
2141
+ eo({
2142
+ activeNode: y != null ? x.get(y) : null,
2143
+ config: le.layoutShiftCompensation,
2144
+ initialRect: ie,
2145
+ measure: j.draggable.measure
2146
+ });
2147
+ const E = Gt(H, j.draggable.measure, ie), Te = Gt(H ? H.parentElement : null), ee = N({
2148
+ activatorEvent: null,
2149
+ active: null,
2150
+ activeNode: H,
2151
+ collisionRect: null,
2152
+ collisions: null,
2153
+ droppableRects: oe,
2154
+ draggableNodes: x,
2155
+ draggingNode: null,
2156
+ draggingNodeRect: null,
2157
+ droppableContainers: L,
2158
+ over: null,
2159
+ scrollableAncestors: [],
2160
+ scrollAdjustedTranslate: null
2161
+ }), me = L.getNodeFor((n = ee.current.over) == null ? void 0 : n.id), se = Hr({
2162
+ measure: j.dragOverlay.measure
2163
+ }), ye = (r = se.nodeRef.current) != null ? r : H, we = R ? (o = se.rect) != null ? o : E : null, Pt = !!(se.nodeRef.current && se.rect), kt = Xr(Pt ? null : E), pt = mn(ye ? X(ye) : null), ce = jr(R ? me ?? H : null), _e = Ur(ce), Qe = Dn(h, {
2164
+ transform: {
2165
+ x: T.x - kt.x,
2166
+ y: T.y - kt.y,
2167
+ scaleX: 1,
2168
+ scaleY: 1
2169
+ },
2170
+ activatorEvent: Y,
2171
+ active: J,
2172
+ activeNodeRect: E,
2173
+ containerNodeRect: Te,
2174
+ draggingNodeRect: we,
2175
+ over: ee.current.over,
2176
+ overlayNodeRect: se.rect,
2177
+ scrollableAncestors: ce,
2178
+ scrollableAncestorRects: _e,
2179
+ windowRect: pt
2180
+ }), zt = Je ? Se(Je, T) : null, Bt = Yr(ce), Nn = _t(Bt), Tn = _t(Bt, [E]), xe = Se(Qe, Nn), De = we ? fr(we, Qe) : null, Me = J && De ? u({
2181
+ active: J,
2182
+ collisionRect: De,
2183
+ droppableRects: oe,
2184
+ droppableContainers: Ge,
2185
+ pointerCoordinates: zt
2186
+ }) : null, Ft = on(Me, "id"), [ue, $t] = $(null), Mn = Pt ? Qe : Se(Qe, Tn), Ln = ur(Mn, (i = ue?.rect) != null ? i : null, E), bt = N(null), Xt = F(
2187
+ (B, K) => {
2188
+ let {
2189
+ sensor: W,
2190
+ options: de
2191
+ } = K;
2192
+ if (Z.current == null)
2193
+ return;
2194
+ const V = x.get(Z.current);
2195
+ if (!V)
2196
+ return;
2197
+ const U = B.nativeEvent, te = new W({
2198
+ active: Z.current,
2199
+ activeNode: V,
2200
+ event: U,
2201
+ options: de,
2202
+ // Sensors need to be instantiated with refs for arguments that change over time
2203
+ // otherwise they are frozen in time with the stale arguments
2204
+ context: ee,
2205
+ onAbort(z) {
2206
+ if (!x.get(z))
2207
+ return;
2208
+ const {
2209
+ onDragAbort: ne
2210
+ } = re.current, ae = {
2211
+ id: z
2212
+ };
2213
+ ne?.(ae), m({
2214
+ type: "onDragAbort",
2215
+ event: ae
2216
+ });
2217
+ },
2218
+ onPending(z, fe, ne, ae) {
2219
+ if (!x.get(z))
2220
+ return;
2221
+ const {
2222
+ onDragPending: Pe
2223
+ } = re.current, he = {
2224
+ id: z,
2225
+ constraint: fe,
2226
+ initialCoordinates: ne,
2227
+ offset: ae
2228
+ };
2229
+ Pe?.(he), m({
2230
+ type: "onDragPending",
2231
+ event: he
2232
+ });
2233
+ },
2234
+ onStart(z) {
2235
+ const fe = Z.current;
2236
+ if (fe == null)
2237
+ return;
2238
+ const ne = x.get(fe);
2239
+ if (!ne)
2240
+ return;
2241
+ const {
2242
+ onDragStart: ae
2243
+ } = re.current, Le = {
2244
+ activatorEvent: U,
2245
+ active: {
2246
+ id: fe,
2247
+ data: ne.data,
2248
+ rect: G
2249
+ }
2250
+ };
2251
+ Ze(() => {
2252
+ ae?.(Le), S(ge.Initializing), b({
2253
+ type: P.DragStart,
2254
+ initialCoordinates: z,
2255
+ active: fe
2256
+ }), m({
2257
+ type: "onDragStart",
2258
+ event: Le
2259
+ }), Ve(bt.current), qe(U);
2260
+ });
2261
+ },
2262
+ onMove(z) {
2263
+ b({
2264
+ type: P.DragMove,
2265
+ coordinates: z
2266
+ });
2267
+ },
2268
+ onEnd: Ce(P.DragEnd),
2269
+ onCancel: Ce(P.DragCancel)
2270
+ });
2271
+ bt.current = te;
2272
+ function Ce(z) {
2273
+ return async function() {
2274
+ const {
2275
+ active: ne,
2276
+ collisions: ae,
2277
+ over: Le,
2278
+ scrollAdjustedTranslate: Pe
2279
+ } = ee.current;
2280
+ let he = null;
2281
+ if (ne && Pe) {
2282
+ const {
2283
+ cancelDrop: ke
2284
+ } = re.current;
2285
+ he = {
2286
+ activatorEvent: U,
2287
+ active: ne,
2288
+ collisions: ae,
2289
+ delta: Pe,
2290
+ over: Le
2291
+ }, z === P.DragEnd && typeof ke == "function" && await Promise.resolve(ke(he)) && (z = P.DragCancel);
2292
+ }
2293
+ Z.current = null, Ze(() => {
2294
+ b({
2295
+ type: z
2296
+ }), S(ge.Uninitialized), $t(null), Ve(null), qe(null), bt.current = null;
2297
+ const ke = z === P.DragEnd ? "onDragEnd" : "onDragCancel";
2298
+ if (he) {
2299
+ const mt = re.current[ke];
2300
+ mt?.(he), m({
2301
+ type: ke,
2302
+ event: he
2303
+ });
2304
+ }
2305
+ });
2306
+ };
2307
+ }
2308
+ },
2309
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2310
+ [x]
2311
+ ), Pn = F((B, K) => (W, de) => {
2312
+ const V = W.nativeEvent, U = x.get(de);
2313
+ if (
2314
+ // Another sensor is already instantiating
2315
+ Z.current !== null || // No active draggable
2316
+ !U || // Event has already been captured
2317
+ V.dndKit || V.defaultPrevented
2318
+ )
2319
+ return;
2320
+ const te = {
2321
+ active: U
2322
+ };
2323
+ B(W, K.options, te) === !0 && (V.dndKit = {
2324
+ capturedBy: K.sensor
2325
+ }, Z.current = de, Xt(W, K));
2326
+ }, [x, Xt]), jt = kr(d, Pn);
2327
+ Kr(d), _(() => {
2328
+ E && C === ge.Initializing && S(ge.Initialized);
2329
+ }, [E, C]), O(
2330
+ () => {
2331
+ const {
2332
+ onDragMove: B
2333
+ } = re.current, {
2334
+ active: K,
2335
+ activatorEvent: W,
2336
+ collisions: de,
2337
+ over: V
2338
+ } = ee.current;
2339
+ if (!K || !W)
2340
+ return;
2341
+ const U = {
2342
+ active: K,
2343
+ activatorEvent: W,
2344
+ collisions: de,
2345
+ delta: {
2346
+ x: xe.x,
2347
+ y: xe.y
2348
+ },
2349
+ over: V
2350
+ };
2351
+ Ze(() => {
2352
+ B?.(U), m({
2353
+ type: "onDragMove",
2354
+ event: U
2355
+ });
2356
+ });
2357
+ },
2358
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2359
+ [xe.x, xe.y]
2360
+ ), O(
2361
+ () => {
2362
+ const {
2363
+ active: B,
2364
+ activatorEvent: K,
2365
+ collisions: W,
2366
+ droppableContainers: de,
2367
+ scrollAdjustedTranslate: V
2368
+ } = ee.current;
2369
+ if (!B || Z.current == null || !K || !V)
2370
+ return;
2371
+ const {
2372
+ onDragOver: U
2373
+ } = re.current, te = de.get(Ft), Ce = te && te.rect.current ? {
2374
+ id: te.id,
2375
+ rect: te.rect.current,
2376
+ data: te.data,
2377
+ disabled: te.disabled
2378
+ } : null, z = {
2379
+ active: B,
2380
+ activatorEvent: K,
2381
+ collisions: W,
2382
+ delta: {
2383
+ x: V.x,
2384
+ y: V.y
2385
+ },
2386
+ over: Ce
2387
+ };
2388
+ Ze(() => {
2389
+ $t(Ce), U?.(z), m({
2390
+ type: "onDragOver",
2391
+ event: z
2392
+ });
2393
+ });
2394
+ },
2395
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2396
+ [Ft]
2397
+ ), _(() => {
2398
+ ee.current = {
2399
+ activatorEvent: Y,
2400
+ active: J,
2401
+ activeNode: H,
2402
+ collisionRect: De,
2403
+ collisions: Me,
2404
+ droppableRects: oe,
2405
+ draggableNodes: x,
2406
+ draggingNode: ye,
2407
+ draggingNodeRect: we,
2408
+ droppableContainers: L,
2409
+ over: ue,
2410
+ scrollableAncestors: ce,
2411
+ scrollAdjustedTranslate: xe
2412
+ }, G.current = {
2413
+ initial: we,
2414
+ translated: De
2415
+ };
2416
+ }, [J, H, Me, De, x, ye, we, oe, L, ue, ce, xe]), Tr({
2417
+ ...le,
2418
+ delta: T,
2419
+ draggingRect: De,
2420
+ pointerCoordinates: zt,
2421
+ scrollableAncestors: ce,
2422
+ scrollableAncestorRects: _e
2423
+ });
2424
+ const kn = A(() => ({
2425
+ active: J,
2426
+ activeNode: H,
2427
+ activeNodeRect: E,
2428
+ activatorEvent: Y,
2429
+ collisions: Me,
2430
+ containerNodeRect: Te,
2431
+ dragOverlay: se,
2432
+ draggableNodes: x,
2433
+ droppableContainers: L,
2434
+ droppableRects: oe,
2435
+ over: ue,
2436
+ measureDroppableContainers: pe,
2437
+ scrollableAncestors: ce,
2438
+ scrollableAncestorRects: _e,
2439
+ measuringConfiguration: j,
2440
+ measuringScheduled: Ne,
2441
+ windowRect: pt
2442
+ }), [J, H, E, Y, Me, Te, se, x, L, oe, ue, pe, ce, _e, j, Ne, pt]), zn = A(() => ({
2443
+ activatorEvent: Y,
2444
+ activators: jt,
2445
+ active: J,
2446
+ activeNodeRect: E,
2447
+ ariaDescribedById: {
2448
+ draggable: Oe
2449
+ },
2450
+ dispatch: b,
2451
+ draggableNodes: x,
2452
+ over: ue,
2453
+ measureDroppableContainers: pe
2454
+ }), [Y, jt, J, E, b, Oe, x, ue, pe]);
2455
+ return M.createElement(rn.Provider, {
2456
+ value: p
2457
+ }, M.createElement(He.Provider, {
2458
+ value: zn
2459
+ }, M.createElement(xn.Provider, {
2460
+ value: kn
2461
+ }, M.createElement(vt.Provider, {
2462
+ value: Ln
2463
+ }, c)), M.createElement(Qr, {
2464
+ disabled: a?.restoreFocus === !1
2465
+ })), M.createElement(rr, {
2466
+ ...a,
2467
+ hiddenTextDescribedById: Oe
2468
+ }));
2469
+ function Bn() {
2470
+ const B = Ie?.autoScrollEnabled === !1, K = typeof l == "object" ? l.enabled === !1 : l === !1, W = R && !B && !K;
2471
+ return typeof l == "object" ? {
2472
+ ...l,
2473
+ enabled: W
2474
+ } : {
2475
+ enabled: W
2476
+ };
2477
+ }
2478
+ }), to = /* @__PURE__ */ Ye(null), Zt = "button", no = "Draggable";
2479
+ function ro(e) {
2480
+ let {
2481
+ id: t,
2482
+ data: n,
2483
+ disabled: r = !1,
2484
+ attributes: o
2485
+ } = e;
2486
+ const i = Ue(no), {
2487
+ activators: s,
2488
+ activatorEvent: a,
2489
+ active: l,
2490
+ activeNodeRect: c,
2491
+ ariaDescribedById: d,
2492
+ draggableNodes: u,
2493
+ over: f
2494
+ } = ve(He), {
2495
+ role: h = Zt,
2496
+ roleDescription: w = "draggable",
2497
+ tabIndex: g = 0
2498
+ } = o ?? {}, v = l?.id === t, b = ve(v ? vt : to), [m, p] = ot(), [C, S] = ot(), R = Wr(s, t), y = $e(n);
2499
+ _(
2500
+ () => (u.set(t, {
2501
+ id: t,
2502
+ key: i,
2503
+ node: m,
2504
+ activatorNode: C,
2505
+ data: y
2506
+ }), () => {
2507
+ const T = u.get(t);
2508
+ T && T.key === i && u.delete(t);
2509
+ }),
2510
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2511
+ [u, t]
2512
+ );
2513
+ const x = A(() => ({
2514
+ role: h,
2515
+ tabIndex: g,
2516
+ "aria-disabled": r,
2517
+ "aria-pressed": v && h === Zt ? !0 : void 0,
2518
+ "aria-roledescription": w,
2519
+ "aria-describedby": d.draggable
2520
+ }), [r, h, g, v, w, d.draggable]);
2521
+ return {
2522
+ active: l,
2523
+ activatorEvent: a,
2524
+ activeNodeRect: c,
2525
+ attributes: x,
2526
+ isDragging: v,
2527
+ listeners: r ? void 0 : R,
2528
+ node: m,
2529
+ over: f,
2530
+ setNodeRef: p,
2531
+ setActivatorNodeRef: S,
2532
+ transform: b
2533
+ };
2534
+ }
2535
+ function Cn() {
2536
+ return ve(xn);
2537
+ }
2538
+ const oo = "Droppable", io = {
2539
+ timeout: 25
2540
+ };
2541
+ function so(e) {
2542
+ let {
2543
+ data: t,
2544
+ disabled: n = !1,
2545
+ id: r,
2546
+ resizeObserverConfig: o
2547
+ } = e;
2548
+ const i = Ue(oo), {
2549
+ active: s,
2550
+ dispatch: a,
2551
+ over: l,
2552
+ measureDroppableContainers: c
2553
+ } = ve(He), d = N({
2554
+ disabled: n
2555
+ }), u = N(!1), f = N(null), h = N(null), {
2556
+ disabled: w,
2557
+ updateMeasurementsFor: g,
2558
+ timeout: v
2559
+ } = {
2560
+ ...io,
2561
+ ...o
2562
+ }, b = $e(g ?? r), m = F(
2563
+ () => {
2564
+ if (!u.current) {
2565
+ u.current = !0;
2566
+ return;
2567
+ }
2568
+ h.current != null && clearTimeout(h.current), h.current = setTimeout(() => {
2569
+ c(Array.isArray(b.current) ? b.current : [b.current]), h.current = null;
2570
+ }, v);
2571
+ },
2572
+ //eslint-disable-next-line react-hooks/exhaustive-deps
2573
+ [v]
2574
+ ), p = gt({
2575
+ callback: m,
2576
+ disabled: w || !s
2577
+ }), C = F((x, T) => {
2578
+ p && (T && (p.unobserve(T), u.current = !1), x && p.observe(x));
2579
+ }, [p]), [S, R] = ot(C), y = $e(t);
2580
+ return O(() => {
2581
+ !p || !S.current || (p.disconnect(), u.current = !1, p.observe(S.current));
2582
+ }, [S, p]), O(
2583
+ () => (a({
2584
+ type: P.RegisterDroppable,
2585
+ element: {
2586
+ id: r,
2587
+ key: i,
2588
+ disabled: n,
2589
+ node: S,
2590
+ rect: f,
2591
+ data: y
2592
+ }
2593
+ }), () => a({
2594
+ type: P.UnregisterDroppable,
2595
+ key: i,
2596
+ id: r
2597
+ })),
2598
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2599
+ [r]
2600
+ ), O(() => {
2601
+ n !== d.current.disabled && (a({
2602
+ type: P.SetDroppableDisabled,
2603
+ id: r,
2604
+ key: i,
2605
+ disabled: n
2606
+ }), d.current.disabled = n);
2607
+ }, [r, i, n, a]), {
2608
+ active: s,
2609
+ rect: f,
2610
+ isOver: l?.id === r,
2611
+ node: S,
2612
+ over: l,
2613
+ setNodeRef: R
2614
+ };
2615
+ }
2616
+ function ao(e) {
2617
+ let {
2618
+ animation: t,
2619
+ children: n
2620
+ } = e;
2621
+ const [r, o] = $(null), [i, s] = $(null), a = it(n);
2622
+ return !n && !r && a && o(a), _(() => {
2623
+ if (!i)
2624
+ return;
2625
+ const l = r?.key, c = r?.props.id;
2626
+ if (l == null || c == null) {
2627
+ o(null);
2628
+ return;
2629
+ }
2630
+ Promise.resolve(t(c, i)).then(() => {
2631
+ o(null);
2632
+ });
2633
+ }, [t, r, i]), M.createElement(M.Fragment, null, n, r ? Yn(r, {
2634
+ ref: s
2635
+ }) : null);
2636
+ }
2637
+ const lo = {
2638
+ x: 0,
2639
+ y: 0,
2640
+ scaleX: 1,
2641
+ scaleY: 1
2642
+ };
2643
+ function co(e) {
2644
+ let {
2645
+ children: t
2646
+ } = e;
2647
+ return M.createElement(He.Provider, {
2648
+ value: wn
2649
+ }, M.createElement(vt.Provider, {
2650
+ value: lo
2651
+ }, t));
2652
+ }
2653
+ const uo = {
2654
+ position: "fixed",
2655
+ touchAction: "none"
2656
+ }, fo = (e) => ft(e) ? "transform 250ms ease" : void 0, ho = /* @__PURE__ */ jn((e, t) => {
2657
+ let {
2658
+ as: n,
2659
+ activatorEvent: r,
2660
+ adjustScale: o,
2661
+ children: i,
2662
+ className: s,
2663
+ rect: a,
2664
+ style: l,
2665
+ transform: c,
2666
+ transition: d = fo
2667
+ } = e;
2668
+ if (!a)
2669
+ return null;
2670
+ const u = o ? c : {
2671
+ ...c,
2672
+ scaleX: 1,
2673
+ scaleY: 1
2674
+ }, f = {
2675
+ ...uo,
2676
+ width: a.width,
2677
+ height: a.height,
2678
+ top: a.top,
2679
+ left: a.left,
2680
+ transform: be.Transform.toString(u),
2681
+ transformOrigin: o && r ? or(r, a) : void 0,
2682
+ transition: typeof d == "function" ? d(r) : d,
2683
+ ...l
2684
+ };
2685
+ return M.createElement(n, {
2686
+ className: s,
2687
+ style: f,
2688
+ ref: t
2689
+ }, i);
2690
+ }), go = (e) => (t) => {
2691
+ let {
2692
+ active: n,
2693
+ dragOverlay: r
2694
+ } = t;
2695
+ const o = {}, {
2696
+ styles: i,
2697
+ className: s
2698
+ } = e;
2699
+ if (i != null && i.active)
2700
+ for (const [a, l] of Object.entries(i.active))
2701
+ l !== void 0 && (o[a] = n.node.style.getPropertyValue(a), n.node.style.setProperty(a, l));
2702
+ if (i != null && i.dragOverlay)
2703
+ for (const [a, l] of Object.entries(i.dragOverlay))
2704
+ l !== void 0 && r.node.style.setProperty(a, l);
2705
+ return s != null && s.active && n.node.classList.add(s.active), s != null && s.dragOverlay && r.node.classList.add(s.dragOverlay), function() {
2706
+ for (const [l, c] of Object.entries(o))
2707
+ n.node.style.setProperty(l, c);
2708
+ s != null && s.active && n.node.classList.remove(s.active);
2709
+ };
2710
+ }, vo = (e) => {
2711
+ let {
2712
+ transform: {
2713
+ initial: t,
2714
+ final: n
2715
+ }
2716
+ } = e;
2717
+ return [{
2718
+ transform: be.Transform.toString(t)
2719
+ }, {
2720
+ transform: be.Transform.toString(n)
2721
+ }];
2722
+ }, po = {
2723
+ duration: 250,
2724
+ easing: "ease",
2725
+ keyframes: vo,
2726
+ sideEffects: /* @__PURE__ */ go({
2727
+ styles: {
2728
+ active: {
2729
+ opacity: "0"
2730
+ }
2731
+ }
2732
+ })
2733
+ };
2734
+ function bo(e) {
2735
+ let {
2736
+ config: t,
2737
+ draggableNodes: n,
2738
+ droppableContainers: r,
2739
+ measuringConfiguration: o
2740
+ } = e;
2741
+ return dt((i, s) => {
2742
+ if (t === null)
2743
+ return;
2744
+ const a = n.get(i);
2745
+ if (!a)
2746
+ return;
2747
+ const l = a.node.current;
2748
+ if (!l)
2749
+ return;
2750
+ const c = yn(s);
2751
+ if (!c)
2752
+ return;
2753
+ const {
2754
+ transform: d
2755
+ } = X(s).getComputedStyle(s), u = an(d);
2756
+ if (!u)
2757
+ return;
2758
+ const f = typeof t == "function" ? t : mo(t);
2759
+ return gn(l, o.draggable.measure), f({
2760
+ active: {
2761
+ id: i,
2762
+ data: a.data,
2763
+ node: l,
2764
+ rect: o.draggable.measure(l)
2765
+ },
2766
+ draggableNodes: n,
2767
+ dragOverlay: {
2768
+ node: s,
2769
+ rect: o.dragOverlay.measure(c)
2770
+ },
2771
+ droppableContainers: r,
2772
+ measuringConfiguration: o,
2773
+ transform: u
2774
+ });
2775
+ });
2776
+ }
2777
+ function mo(e) {
2778
+ const {
2779
+ duration: t,
2780
+ easing: n,
2781
+ sideEffects: r,
2782
+ keyframes: o
2783
+ } = {
2784
+ ...po,
2785
+ ...e
2786
+ };
2787
+ return (i) => {
2788
+ let {
2789
+ active: s,
2790
+ dragOverlay: a,
2791
+ transform: l,
2792
+ ...c
2793
+ } = i;
2794
+ if (!t)
2795
+ return;
2796
+ const d = {
2797
+ x: a.rect.left - s.rect.left,
2798
+ y: a.rect.top - s.rect.top
2799
+ }, u = {
2800
+ scaleX: l.scaleX !== 1 ? s.rect.width * l.scaleX / a.rect.width : 1,
2801
+ scaleY: l.scaleY !== 1 ? s.rect.height * l.scaleY / a.rect.height : 1
2802
+ }, f = {
2803
+ x: l.x - d.x,
2804
+ y: l.y - d.y,
2805
+ ...u
2806
+ }, h = o({
2807
+ ...c,
2808
+ active: s,
2809
+ dragOverlay: a,
2810
+ transform: {
2811
+ initial: l,
2812
+ final: f
2813
+ }
2814
+ }), [w] = h, g = h[h.length - 1];
2815
+ if (JSON.stringify(w) === JSON.stringify(g))
2816
+ return;
2817
+ const v = r?.({
2818
+ active: s,
2819
+ dragOverlay: a,
2820
+ ...c
2821
+ }), b = a.node.animate(h, {
2822
+ duration: t,
2823
+ easing: n,
2824
+ fill: "forwards"
2825
+ });
2826
+ return new Promise((m) => {
2827
+ b.onfinish = () => {
2828
+ v?.(), m();
2829
+ };
2830
+ });
2831
+ };
2832
+ }
2833
+ let en = 0;
2834
+ function yo(e) {
2835
+ return A(() => {
2836
+ if (e != null)
2837
+ return en++, en;
2838
+ }, [e]);
2839
+ }
2840
+ const jo = /* @__PURE__ */ M.memo((e) => {
2841
+ let {
2842
+ adjustScale: t = !1,
2843
+ children: n,
2844
+ dropAnimation: r,
2845
+ style: o,
2846
+ transition: i,
2847
+ modifiers: s,
2848
+ wrapperElement: a = "div",
2849
+ className: l,
2850
+ zIndex: c = 999
2851
+ } = e;
2852
+ const {
2853
+ activatorEvent: d,
2854
+ active: u,
2855
+ activeNodeRect: f,
2856
+ containerNodeRect: h,
2857
+ draggableNodes: w,
2858
+ droppableContainers: g,
2859
+ dragOverlay: v,
2860
+ over: b,
2861
+ measuringConfiguration: m,
2862
+ scrollableAncestors: p,
2863
+ scrollableAncestorRects: C,
2864
+ windowRect: S
2865
+ } = Cn(), R = ve(vt), y = yo(u?.id), x = Dn(s, {
2866
+ activatorEvent: d,
2867
+ active: u,
2868
+ activeNodeRect: f,
2869
+ containerNodeRect: h,
2870
+ draggingNodeRect: v.rect,
2871
+ over: b,
2872
+ overlayNodeRect: v.rect,
2873
+ scrollableAncestors: p,
2874
+ scrollableAncestorRects: C,
2875
+ transform: R,
2876
+ windowRect: S
2877
+ }), T = Lt(f), L = bo({
2878
+ config: r,
2879
+ draggableNodes: w,
2880
+ droppableContainers: g,
2881
+ measuringConfiguration: m
2882
+ }), I = T ? v.setRef : void 0;
2883
+ return M.createElement(co, null, M.createElement(ao, {
2884
+ animation: L
2885
+ }, u && y ? M.createElement(ho, {
2886
+ key: y,
2887
+ id: u.id,
2888
+ ref: I,
2889
+ as: a,
2890
+ activatorEvent: d,
2891
+ adjustScale: t,
2892
+ className: l,
2893
+ transition: i,
2894
+ rect: T,
2895
+ style: {
2896
+ zIndex: c,
2897
+ ...o
2898
+ },
2899
+ transform: x
2900
+ }, n) : null));
2901
+ });
2902
+ function Sn(e, t, n) {
2903
+ const r = e.slice();
2904
+ return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
2905
+ }
2906
+ function wo(e, t) {
2907
+ return e.reduce((n, r, o) => {
2908
+ const i = t.get(r);
2909
+ return i && (n[o] = i), n;
2910
+ }, Array(e.length));
2911
+ }
2912
+ function et(e) {
2913
+ return e !== null && e >= 0;
2914
+ }
2915
+ function xo(e, t) {
2916
+ if (e === t)
2917
+ return !0;
2918
+ if (e.length !== t.length)
2919
+ return !1;
2920
+ for (let n = 0; n < e.length; n++)
2921
+ if (e[n] !== t[n])
2922
+ return !1;
2923
+ return !0;
2924
+ }
2925
+ function Do(e) {
2926
+ return typeof e == "boolean" ? {
2927
+ draggable: e,
2928
+ droppable: e
2929
+ } : e;
2930
+ }
2931
+ const tt = {
2932
+ scaleX: 1,
2933
+ scaleY: 1
2934
+ }, Yo = (e) => {
2935
+ var t;
2936
+ let {
2937
+ rects: n,
2938
+ activeNodeRect: r,
2939
+ activeIndex: o,
2940
+ overIndex: i,
2941
+ index: s
2942
+ } = e;
2943
+ const a = (t = n[o]) != null ? t : r;
2944
+ if (!a)
2945
+ return null;
2946
+ const l = Co(n, s, o);
2947
+ if (s === o) {
2948
+ const c = n[i];
2949
+ return c ? {
2950
+ x: o < i ? c.left + c.width - (a.left + a.width) : c.left - a.left,
2951
+ y: 0,
2952
+ ...tt
2953
+ } : null;
2954
+ }
2955
+ return s > o && s <= i ? {
2956
+ x: -a.width - l,
2957
+ y: 0,
2958
+ ...tt
2959
+ } : s < o && s >= i ? {
2960
+ x: a.width + l,
2961
+ y: 0,
2962
+ ...tt
2963
+ } : {
2964
+ x: 0,
2965
+ y: 0,
2966
+ ...tt
2967
+ };
2968
+ };
2969
+ function Co(e, t, n) {
2970
+ const r = e[t], o = e[t - 1], i = e[t + 1];
2971
+ return !r || !o && !i ? 0 : n < t ? o ? r.left - (o.left + o.width) : i.left - (r.left + r.width) : i ? i.left - (r.left + r.width) : r.left - (o.left + o.width);
2972
+ }
2973
+ const Rn = (e) => {
2974
+ let {
2975
+ rects: t,
2976
+ activeIndex: n,
2977
+ overIndex: r,
2978
+ index: o
2979
+ } = e;
2980
+ const i = Sn(t, r, n), s = t[o], a = i[o];
2981
+ return !a || !s ? null : {
2982
+ x: a.left - s.left,
2983
+ y: a.top - s.top,
2984
+ scaleX: a.width / s.width,
2985
+ scaleY: a.height / s.height
2986
+ };
2987
+ }, nt = {
2988
+ scaleX: 1,
2989
+ scaleY: 1
2990
+ }, Ko = (e) => {
2991
+ var t;
2992
+ let {
2993
+ activeIndex: n,
2994
+ activeNodeRect: r,
2995
+ index: o,
2996
+ rects: i,
2997
+ overIndex: s
2998
+ } = e;
2999
+ const a = (t = i[n]) != null ? t : r;
3000
+ if (!a)
3001
+ return null;
3002
+ if (o === n) {
3003
+ const c = i[s];
3004
+ return c ? {
3005
+ x: 0,
3006
+ y: n < s ? c.top + c.height - (a.top + a.height) : c.top - a.top,
3007
+ ...nt
3008
+ } : null;
3009
+ }
3010
+ const l = So(i, o, n);
3011
+ return o > n && o <= s ? {
3012
+ x: 0,
3013
+ y: -a.height - l,
3014
+ ...nt
3015
+ } : o < n && o >= s ? {
3016
+ x: 0,
3017
+ y: a.height + l,
3018
+ ...nt
3019
+ } : {
3020
+ x: 0,
3021
+ y: 0,
3022
+ ...nt
3023
+ };
3024
+ };
3025
+ function So(e, t, n) {
3026
+ const r = e[t], o = e[t - 1], i = e[t + 1];
3027
+ 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;
3028
+ }
3029
+ const En = "Sortable", An = /* @__PURE__ */ M.createContext({
3030
+ activeIndex: -1,
3031
+ containerId: En,
3032
+ disableTransforms: !1,
3033
+ items: [],
3034
+ overIndex: -1,
3035
+ useDragOverlay: !1,
3036
+ sortedRects: [],
3037
+ strategy: Rn,
3038
+ disabled: {
3039
+ draggable: !1,
3040
+ droppable: !1
3041
+ }
3042
+ });
3043
+ function Wo(e) {
3044
+ let {
3045
+ children: t,
3046
+ id: n,
3047
+ items: r,
3048
+ strategy: o = Rn,
3049
+ disabled: i = !1
3050
+ } = e;
3051
+ const {
3052
+ active: s,
3053
+ dragOverlay: a,
3054
+ droppableRects: l,
3055
+ over: c,
3056
+ measureDroppableContainers: d
3057
+ } = Cn(), u = Ue(En, n), f = a.rect !== null, h = A(() => r.map((R) => typeof R == "object" && "id" in R ? R.id : R), [r]), w = s != null, g = s ? h.indexOf(s.id) : -1, v = c ? h.indexOf(c.id) : -1, b = N(h), m = !xo(h, b.current), p = v !== -1 && g === -1 || m, C = Do(i);
3058
+ _(() => {
3059
+ m && w && d(h);
3060
+ }, [m, h, w, d]), O(() => {
3061
+ b.current = h;
3062
+ }, [h]);
3063
+ const S = A(
3064
+ () => ({
3065
+ activeIndex: g,
3066
+ containerId: u,
3067
+ disabled: C,
3068
+ disableTransforms: p,
3069
+ items: h,
3070
+ overIndex: v,
3071
+ useDragOverlay: f,
3072
+ sortedRects: wo(h, l),
3073
+ strategy: o
3074
+ }),
3075
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3076
+ [g, u, C.draggable, C.droppable, p, h, v, l, f, o]
3077
+ );
3078
+ return M.createElement(An.Provider, {
3079
+ value: S
3080
+ }, t);
3081
+ }
3082
+ const Ro = (e) => {
3083
+ let {
3084
+ id: t,
3085
+ items: n,
3086
+ activeIndex: r,
3087
+ overIndex: o
3088
+ } = e;
3089
+ return Sn(n, r, o).indexOf(t);
3090
+ }, Eo = (e) => {
3091
+ let {
3092
+ containerId: t,
3093
+ isSorting: n,
3094
+ wasDragging: r,
3095
+ index: o,
3096
+ items: i,
3097
+ newIndex: s,
3098
+ previousItems: a,
3099
+ previousContainerId: l,
3100
+ transition: c
3101
+ } = e;
3102
+ return !c || !r || a !== i && o === s ? !1 : n ? !0 : s !== o && t === l;
3103
+ }, Ao = {
3104
+ duration: 200,
3105
+ easing: "ease"
3106
+ }, In = "transform", Io = /* @__PURE__ */ be.Transition.toString({
3107
+ property: In,
3108
+ duration: 0,
3109
+ easing: "linear"
3110
+ }), Oo = {
3111
+ roleDescription: "sortable"
3112
+ };
3113
+ function No(e) {
3114
+ let {
3115
+ disabled: t,
3116
+ index: n,
3117
+ node: r,
3118
+ rect: o
3119
+ } = e;
3120
+ const [i, s] = $(null), a = N(n);
3121
+ return _(() => {
3122
+ if (!t && n !== a.current && r.current) {
3123
+ const l = o.current;
3124
+ if (l) {
3125
+ const c = Ae(r.current, {
3126
+ ignoreTransform: !0
3127
+ }), d = {
3128
+ x: l.left - c.left,
3129
+ y: l.top - c.top,
3130
+ scaleX: l.width / c.width,
3131
+ scaleY: l.height / c.height
3132
+ };
3133
+ (d.x || d.y) && s(d);
3134
+ }
3135
+ }
3136
+ n !== a.current && (a.current = n);
3137
+ }, [t, n, r, o]), O(() => {
3138
+ i && s(null);
3139
+ }, [i]), i;
3140
+ }
3141
+ function Uo(e) {
3142
+ let {
3143
+ animateLayoutChanges: t = Eo,
3144
+ attributes: n,
3145
+ disabled: r,
3146
+ data: o,
3147
+ getNewIndex: i = Ro,
3148
+ id: s,
3149
+ strategy: a,
3150
+ resizeObserverConfig: l,
3151
+ transition: c = Ao
3152
+ } = e;
3153
+ const {
3154
+ items: d,
3155
+ containerId: u,
3156
+ activeIndex: f,
3157
+ disabled: h,
3158
+ disableTransforms: w,
3159
+ sortedRects: g,
3160
+ overIndex: v,
3161
+ useDragOverlay: b,
3162
+ strategy: m
3163
+ } = ve(An), p = To(r, h), C = d.indexOf(s), S = A(() => ({
3164
+ sortable: {
3165
+ containerId: u,
3166
+ index: C,
3167
+ items: d
3168
+ },
3169
+ ...o
3170
+ }), [u, o, C, d]), R = A(() => d.slice(d.indexOf(s)), [d, s]), {
3171
+ rect: y,
3172
+ node: x,
3173
+ isOver: T,
3174
+ setNodeRef: L
3175
+ } = so({
3176
+ id: s,
3177
+ data: S,
3178
+ disabled: p.droppable,
3179
+ resizeObserverConfig: {
3180
+ updateMeasurementsFor: R,
3181
+ ...l
3182
+ }
3183
+ }), {
3184
+ active: I,
3185
+ activatorEvent: G,
3186
+ activeNodeRect: J,
3187
+ attributes: Z,
3188
+ setNodeRef: Ie,
3189
+ listeners: Ve,
3190
+ isDragging: Y,
3191
+ over: qe,
3192
+ setActivatorNodeRef: re,
3193
+ transform: Oe
3194
+ } = ro({
3195
+ id: s,
3196
+ data: S,
3197
+ attributes: {
3198
+ ...Oo,
3199
+ ...n
3200
+ },
3201
+ disabled: p.draggable
3202
+ }), Ge = Wn(L, Ie), j = !!I, oe = j && !w && et(f) && et(v), pe = !b && Y, Ne = pe && oe ? Oe : null, Je = oe ? Ne ?? (a ?? m)({
3203
+ rects: g,
3204
+ activeNodeRect: J,
3205
+ activeIndex: f,
3206
+ overIndex: v,
3207
+ index: C
3208
+ }) : null, le = et(f) && et(v) ? i({
3209
+ id: s,
3210
+ items: d,
3211
+ activeIndex: f,
3212
+ overIndex: v
3213
+ }) : C, ie = I?.id, E = N({
3214
+ activeId: ie,
3215
+ items: d,
3216
+ newIndex: le,
3217
+ containerId: u
3218
+ }), Te = d !== E.current.items, ee = t({
3219
+ active: I,
3220
+ containerId: u,
3221
+ isDragging: Y,
3222
+ isSorting: j,
3223
+ id: s,
3224
+ index: C,
3225
+ items: d,
3226
+ newIndex: E.current.newIndex,
3227
+ previousItems: E.current.items,
3228
+ previousContainerId: E.current.containerId,
3229
+ transition: c,
3230
+ wasDragging: E.current.activeId != null
3231
+ }), me = No({
3232
+ disabled: !ee,
3233
+ index: C,
3234
+ node: x,
3235
+ rect: y
3236
+ });
3237
+ return O(() => {
3238
+ j && E.current.newIndex !== le && (E.current.newIndex = le), u !== E.current.containerId && (E.current.containerId = u), d !== E.current.items && (E.current.items = d);
3239
+ }, [j, le, u, d]), O(() => {
3240
+ if (ie === E.current.activeId)
3241
+ return;
3242
+ if (ie != null && E.current.activeId == null) {
3243
+ E.current.activeId = ie;
3244
+ return;
3245
+ }
3246
+ const ye = setTimeout(() => {
3247
+ E.current.activeId = ie;
3248
+ }, 50);
3249
+ return () => clearTimeout(ye);
3250
+ }, [ie]), {
3251
+ active: I,
3252
+ activeIndex: f,
3253
+ attributes: Z,
3254
+ data: S,
3255
+ rect: y,
3256
+ index: C,
3257
+ newIndex: le,
3258
+ items: d,
3259
+ isOver: T,
3260
+ isSorting: j,
3261
+ isDragging: Y,
3262
+ listeners: Ve,
3263
+ node: x,
3264
+ overIndex: v,
3265
+ over: qe,
3266
+ setNodeRef: Ge,
3267
+ setActivatorNodeRef: re,
3268
+ setDroppableNodeRef: L,
3269
+ setDraggableNodeRef: Ie,
3270
+ transform: me ?? Je,
3271
+ transition: se()
3272
+ };
3273
+ function se() {
3274
+ if (
3275
+ // Temporarily disable transitions for a single frame to set up derived transforms
3276
+ me || // Or to prevent items jumping to back to their "new" position when items change
3277
+ Te && E.current.newIndex === C
3278
+ )
3279
+ return Io;
3280
+ if (!(pe && !ft(G) || !c) && (j || ee))
3281
+ return be.Transition.toString({
3282
+ ...c,
3283
+ property: In
3284
+ });
3285
+ }
3286
+ }
3287
+ function To(e, t) {
3288
+ var n, r;
3289
+ return typeof e == "boolean" ? {
3290
+ draggable: e,
3291
+ // Backwards compatibility
3292
+ droppable: !1
3293
+ } : {
3294
+ draggable: (n = e?.draggable) != null ? n : t.draggable,
3295
+ droppable: (r = e?.droppable) != null ? r : t.droppable
3296
+ };
3297
+ }
3298
+ function ct(e) {
3299
+ if (!e)
3300
+ return !1;
3301
+ const t = e.data.current;
3302
+ return !!(t && "sortable" in t && typeof t.sortable == "object" && "containerId" in t.sortable && "items" in t.sortable && "index" in t.sortable);
3303
+ }
3304
+ const Mo = [D.Down, D.Right, D.Up, D.Left], Ho = (e, t) => {
3305
+ let {
3306
+ context: {
3307
+ active: n,
3308
+ collisionRect: r,
3309
+ droppableRects: o,
3310
+ droppableContainers: i,
3311
+ over: s,
3312
+ scrollableAncestors: a
3313
+ }
3314
+ } = t;
3315
+ if (Mo.includes(e.code)) {
3316
+ if (e.preventDefault(), !n || !r)
3317
+ return;
3318
+ const l = [];
3319
+ i.getEnabled().forEach((u) => {
3320
+ if (!u || u != null && u.disabled)
3321
+ return;
3322
+ const f = o.get(u.id);
3323
+ if (f)
3324
+ switch (e.code) {
3325
+ case D.Down:
3326
+ r.top < f.top && l.push(u);
3327
+ break;
3328
+ case D.Up:
3329
+ r.top > f.top && l.push(u);
3330
+ break;
3331
+ case D.Left:
3332
+ r.left > f.left && l.push(u);
3333
+ break;
3334
+ case D.Right:
3335
+ r.left < f.left && l.push(u);
3336
+ break;
3337
+ }
3338
+ });
3339
+ const c = sr({
3340
+ collisionRect: r,
3341
+ droppableRects: o,
3342
+ droppableContainers: l
3343
+ });
3344
+ let d = on(c, "id");
3345
+ if (d === s?.id && c.length > 1 && (d = c[1].id), d != null) {
3346
+ const u = i.get(n.id), f = i.get(d), h = f ? o.get(f.id) : null, w = f?.node.current;
3347
+ if (w && h && u && f) {
3348
+ const v = ht(w).some((R, y) => a[y] !== R), b = On(u, f), m = Lo(u, f), p = v || !b ? {
3349
+ x: 0,
3350
+ y: 0
3351
+ } : {
3352
+ x: m ? r.width - h.width : 0,
3353
+ y: m ? r.height - h.height : 0
3354
+ }, C = {
3355
+ x: h.left,
3356
+ y: h.top
3357
+ };
3358
+ return p.x && p.y ? C : Xe(C, p);
3359
+ }
3360
+ }
3361
+ }
3362
+ };
3363
+ function On(e, t) {
3364
+ return !ct(e) || !ct(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
3365
+ }
3366
+ function Lo(e, t) {
3367
+ return !ct(e) || !ct(t) || !On(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
3368
+ }
3369
+ export {
3370
+ be as C,
3371
+ Xo as D,
3372
+ pn as K,
3373
+ bn as P,
3374
+ Wo as S,
3375
+ Bo as a,
3376
+ zo as b,
3377
+ Sn as c,
3378
+ Fo as d,
3379
+ jo as e,
3380
+ go as f,
3381
+ st as g,
3382
+ Yo as h,
3383
+ so as i,
3384
+ sr as j,
3385
+ $o as p,
3386
+ lr as r,
3387
+ Ho as s,
3388
+ Uo as u,
3389
+ Ko as v
3390
+ };
3391
+ //# sourceMappingURL=sortable.esm-Blhf_jh1.js.map