fluid-dnd 1.3.3-beta.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -55,7 +55,7 @@ library for lists with support for Vue, react and Svelte](https://fluid-dnd.netl
55
55
 
56
56
  - 📚 Check out all the [docs](https://fluid-dnd.netlify.app/).
57
57
  - 🛠️ Edit the previous [here](https://codesandbox.io/s/nifty-hooks-5plkpl).
58
- - 📘 See others examples [here](https://fluid-dnd.netlify.app/example/vertical-list/single-vertical-list/).
58
+ - 📘 See others examples [here](https://fluid-dnd.netlify.app/vue/example/vertical-list/single-vertical-list/).
59
59
 
60
60
  ## 📚 Libraries Support
61
61
  - **Vue** >=3.0.0
@@ -68,5 +68,4 @@ If you're interested in contributing to [fluid-dnd](https://github.com/carlosjor
68
68
 
69
69
  ## 🔑 License
70
70
 
71
- - [MIT](https://github.com/carlosjorger/fluid-dnd/blob/main/LICENSE).
72
- <!-- TODO: all tes project inside test folder-->
71
+ - [MIT](https://github.com/carlosjorger/fluid-dnd/blob/main/LICENSE).
@@ -1,7 +1,7 @@
1
1
  var d = Object.defineProperty;
2
2
  var e = (a, s, l) => s in a ? d(a, s, { enumerable: !0, configurable: !0, writable: !0, value: l }) : a[s] = l;
3
3
  var r = (a, s, l) => e(a, typeof s != "symbol" ? s + "" : s, l);
4
- import { a as h, t as n, G as t } from "./index-8zYdjZIf.js";
4
+ import { a as h, t as n, G as t } from "./index-BQUYvZRn.js";
5
5
  class c {
6
6
  constructor() {
7
7
  r(this, "handlers");
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-C37ab-rG.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
1
+ "use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-DNmnvxhi.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
@@ -3,8 +3,8 @@
3
3
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
4
  viewBox="0 0 29.11 30.13" style="enable-background:new 0 0 29.11 30.13;" xml:space="preserve">
5
5
  <style type="text/css">
6
- .st0{fill:#00B4D8;}
7
- .st1{fill:none;stroke:#00B4D8;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
6
+ .st0{fill:#95d4e9;}
7
+ .st1{fill:none;stroke:#95d4e9;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
8
8
  </style>
9
9
  <g>
10
10
  <path class="st0" d="M28.15,15.78c0,0.5-0.07,0.96-0.15,1.34c-0.14,0.57-0.31,0.95-0.33,0.95c0.04-0.2,0.07-0.49,0.1-0.8
@@ -1,29 +1,63 @@
1
1
  var Te = Object.defineProperty;
2
2
  var Ee = (t, e, n) => e in t ? Te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var j = (t, e, n) => Ee(t, typeof e != "symbol" ? e + "" : e, n);
4
- const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging", Wt = "dragging-handler-class", Vt = "dropping", oe = "grabbing", ye = "grab", Kt = "disable-transition", nt = (t, e) => t.classList.contains(e), bt = (t, e, n = !1) => {
4
+ const V = "horizontal", tt = "vertical", U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging", Wt = "dragging-handler-class", Vt = "dropping", oe = "grabbing", ye = "grab", Kt = "disable-transition", Ce = (t, e) => {
5
+ const n = (l, f) => t.removeAtEvent(l, f), s = (l, f, g) => t.insertEvent(l, f, g), o = () => t.getLength(), r = (l) => t.getValue(l), c = (l) => l;
6
+ return {
7
+ direction: (e == null ? void 0 : e.direction) ?? tt,
8
+ handlerSelector: (e == null ? void 0 : e.handlerSelector) ?? U,
9
+ draggingClass: (e == null ? void 0 : e.draggingClass) ?? "dragging",
10
+ droppableClass: (e == null ? void 0 : e.droppableClass) ?? "droppable-hover",
11
+ isDraggable: (e == null ? void 0 : e.isDraggable) ?? (() => !0),
12
+ onDragStart: (e == null ? void 0 : e.onDragStart) ?? (() => {
13
+ }),
14
+ onDragEnd: (e == null ? void 0 : e.onDragEnd) ?? (() => {
15
+ }),
16
+ droppableGroup: e == null ? void 0 : e.droppableGroup,
17
+ onRemoveAtEvent: n,
18
+ onInsertEvent: s,
19
+ onGetLegth: o,
20
+ onGetValue: r,
21
+ animationDuration: (e == null ? void 0 : e.animationDuration) ?? 200,
22
+ removingClass: (e == null ? void 0 : e.removingClass) ?? "removing",
23
+ insertingFromClass: (e == null ? void 0 : e.insertingFromClass) ?? "from-inserting",
24
+ delayBeforeRemove: (e == null ? void 0 : e.delayBeforeRemove) ?? 200,
25
+ delayBeforeInsert: (e == null ? void 0 : e.delayBeforeInsert) ?? 200,
26
+ mapFrom: (e == null ? void 0 : e.mapFrom) ?? c
27
+ };
28
+ }, Ae = (t, e) => {
29
+ const { config: n, droppable: s } = t, { onInsertEvent: o, onDragEnd: r } = n;
30
+ return {
31
+ ...n,
32
+ onDragEnd: (f) => {
33
+ const { index: g, value: m } = f;
34
+ r({ index: g, value: e(m, s) });
35
+ },
36
+ onInsertEvent: (f, g) => o(f, e(g, s), !0)
37
+ };
38
+ }, nt = (t, e) => t.classList.contains(e), bt = (t, e, n = !1) => {
5
39
  t.classList.toggle(e, n);
6
40
  }, st = (t, e) => {
7
41
  t.classList.add(e);
8
42
  }, Ct = (t, e) => {
9
43
  t.classList.remove(e);
10
- }, Ce = (t, e) => At(e).every(
44
+ }, xe = (t, e) => At(e).every(
11
45
  (n) => nt(t, n)
12
- ), gt = (t) => t ? `.${At(t).join(".")}` : "", Ae = (t, e) => {
46
+ ), gt = (t) => t ? `.${At(t).join(".")}` : "", we = (t, e) => {
13
47
  if (!e)
14
48
  return;
15
49
  const n = At(e);
16
50
  t.classList.add(...n);
17
- }, At = (t) => t ? t.split(" ").filter((e) => e) : [], V = "horizontal", tt = "vertical", xe = () => {
51
+ }, At = (t) => t ? t.split(" ").filter((e) => e) : [], Be = () => {
18
52
  const { scrollX: t, scrollY: e } = window;
19
53
  return { scrollX: t, scrollY: e };
20
- }, zt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), we = (t) => t ? parseInt(t) : -1, Be = (t) => {
54
+ }, zt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), Me = (t) => t ? parseInt(t) : -1, Re = (t) => {
21
55
  const e = getComputedStyle(t), n = new DOMMatrixReadOnly(e.transform);
22
56
  return {
23
57
  x: n.m41,
24
58
  y: n.m42
25
59
  };
26
- }, re = (t, e) => t.x1 > e.x1 ? re(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, pt = (t, e) => !Me(t, e), Me = (t, e) => {
60
+ }, re = (t, e) => t.x1 > e.x1 ? re(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, pt = (t, e) => !Le(t, e), Le = (t, e) => {
27
61
  const n = Ot(t), s = Ot(e), o = Qt(n, s, tt), r = Qt(n, s, V);
28
62
  return o >= Math.min(n.height, s.height) / 2 && r >= Math.min(n.width, s.width) / 2;
29
63
  }, Qt = (t, e, n) => {
@@ -63,9 +97,9 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
63
97
  paddingBefore: e ? "paddingLeft" : "paddingTop",
64
98
  getRect: Ot
65
99
  };
66
- }, Mt = (t, e) => Re(t, e), ie = (t) => [...t.children].filter(
100
+ }, Mt = (t, e) => Oe(t, e), ie = (t) => [...t.children].filter(
67
101
  (n) => nt(n, U)
68
- ), Re = (t, e) => {
102
+ ), Oe = (t, e) => {
69
103
  const n = [...e.children].filter(
70
104
  (o) => nt(o, U) && !o.isEqualNode(t)
71
105
  ).toReversed(), s = [...e.children].findLastIndex(
@@ -76,7 +110,7 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
76
110
  s,
77
111
  e
78
112
  ];
79
- }, Le = (t) => {
113
+ }, Ne = (t) => {
80
114
  let e = t.parentElement;
81
115
  for (; e; ) {
82
116
  if (window.getComputedStyle(e).position === "fixed")
@@ -88,13 +122,13 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
88
122
  const {
89
123
  before: n,
90
124
  borderBeforeWidth: s
91
- } = B(e), o = Le(t);
125
+ } = B(e), o = Ne(t);
92
126
  return o ? Ot(o)[n] + L(o, s) : 0;
93
- }, Tt = (t) => window.TouchEvent && t instanceof TouchEvent, it = (t) => t instanceof HTMLElement, ae = (t) => t instanceof MouseEvent, Oe = ["onmouseup", "onmousedown", "onmousemove"], Ne = (t, e, n) => {
127
+ }, Tt = (t) => window.TouchEvent && t instanceof TouchEvent, it = (t) => t instanceof HTMLElement, ae = (t) => t instanceof MouseEvent, Fe = ["onmouseup", "onmousedown", "onmousemove"], Pe = (t, e, n) => {
94
128
  t && (t.style.height = `${e}px`, t.style.width = `${n}px`);
95
129
  }, Et = (t, e, n) => {
96
130
  !t || !it(t) || (n == 0 && e == 0 ? t.style.transform = "" : t.style.transform = `translate(${n}px,${e}px)`);
97
- }, Fe = (t, e, n, s) => {
131
+ }, $e = (t, e, n, s) => {
98
132
  t[e] = (o) => {
99
133
  if (o.defaultPrevented)
100
134
  return;
@@ -103,8 +137,8 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
103
137
  n(r);
104
138
  };
105
139
  }, It = (t, e, n, s) => {
106
- n && (Pe(e) ? t[e] = n : Fe(t, e, n, s));
107
- }, Pe = (t) => Oe.includes(t), $e = (t) => {
140
+ n && (Ge(e) ? t[e] = n : $e(t, e, n, s));
141
+ }, Ge = (t) => Fe.includes(t), Ie = (t) => {
108
142
  const { target: e } = t;
109
143
  return {
110
144
  clientX: 0,
@@ -117,8 +151,8 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
117
151
  offsetX: 0,
118
152
  offsetY: 0
119
153
  };
120
- }, Ge = (t, e) => {
121
- const n = (s, o) => Ye(e, window, o, s);
154
+ }, Ye = (t, e) => {
155
+ const n = (s, o) => We(e, window, o, s);
122
156
  if (ae(t)) {
123
157
  const { offsetX: s, offsetY: o } = t;
124
158
  return [s, o];
@@ -130,10 +164,10 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
130
164
  ];
131
165
  }
132
166
  }, _t = (t) => {
133
- const e = Ie(t);
167
+ const e = Xe(t);
134
168
  if (!e)
135
- return $e(t);
136
- const [n, s] = Ge(t, e), { clientX: o, clientY: r, pageX: c, pageY: l, screenX: f, screenY: g, target: m } = e;
169
+ return Ie(t);
170
+ const [n, s] = Ye(t, e), { clientX: o, clientY: r, pageX: c, pageY: l, screenX: f, screenY: g, target: m } = e;
137
171
  return {
138
172
  clientX: o,
139
173
  clientY: r,
@@ -145,12 +179,12 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
145
179
  offsetX: n,
146
180
  offsetY: s
147
181
  };
148
- }, Ie = (t) => {
182
+ }, Xe = (t) => {
149
183
  if (Tt(t))
150
184
  return t.touches[0] ?? t.changedTouches[0];
151
185
  if (ae(t))
152
186
  return t;
153
- }, Ye = (t, e, n, s) => {
187
+ }, We = (t, e, n, s) => {
154
188
  const { page: o, scroll: r, before: c, borderBeforeWidth: l, getRect: f } = B(n), g = f(s);
155
189
  return t[o] - e[r] - g[c] - L(s, l);
156
190
  }, Pt = (t, e, n = "ease-out", s = "transform") => {
@@ -159,14 +193,14 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
159
193
  !t || !it(t) || (t[e] = () => {
160
194
  n();
161
195
  });
162
- }, Xe = (t) => {
196
+ }, Ve = (t) => {
163
197
  var e = t.querySelector("style");
164
198
  if (!e) {
165
199
  var n = document.createElement("style");
166
200
  return t.appendChild(n), n;
167
201
  }
168
202
  return e;
169
- }, We = (t, e) => {
203
+ }, _e = (t, e) => {
170
204
  const n = /\.-?[_a-zA-Z0-9-*\s<>():]+/g, [s] = e.match(n) || [];
171
205
  for (const o of t.cssRules) {
172
206
  const [r] = o.cssText.match(n) || [];
@@ -174,20 +208,106 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
174
208
  return !0;
175
209
  }
176
210
  return !1;
177
- }, Ve = (t, e) => {
211
+ }, He = (t, e) => {
178
212
  e.forEach((n) => {
179
- _e(t, n);
213
+ qe(t, n);
180
214
  });
181
- }, _e = (t, e) => {
215
+ }, qe = (t, e) => {
182
216
  var s;
183
- var n = Xe(t);
184
- n.sheet && (We(n.sheet, e) || (s = n.sheet) == null || s.insertRule(e, n.sheet.cssRules.length));
217
+ var n = Ve(t);
218
+ n.sheet && (_e(n.sheet, e) || (s = n.sheet) == null || s.insertRule(e, n.sheet.cssRules.length));
185
219
  }, ue = (t, e = {}) => {
186
220
  for (const n of Object.keys(e)) {
187
221
  const s = e[n];
188
- s != null && He(t, `--${n}`, s);
222
+ s != null && ze(t, `--${n}`, s);
189
223
  }
190
- }, He = (t, e, n) => t && t.style.setProperty(e, n), fe = "startDrag", Nt = "drag", jt = "startDrop", qe = "drop", at = "temp-child", de = "cubic-bezier(0.2, 0, 0, 1)", ze = (t) => t === qe || t === jt, Ht = (t) => !t || t.length == 0 ? 0 : zt(t.replace("px", "")), je = (t, e) => {
224
+ }, ze = (t, e, n) => t && t.style.setProperty(e, n), je = (t, e, n) => {
225
+ n != 0 && (e === "vertical" ? t.scrollBy(0, n) : t.scrollBy(n, 0));
226
+ }, Ze = (t, e, n) => {
227
+ const { scrollDistance: s, clientDistance: o, scrollElement: r } = B(t);
228
+ return n[r] / (e[s] - e[o]);
229
+ }, ke = (t) => {
230
+ let e = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
231
+ const o = (f) => {
232
+ t.style.transform = `translate( ${f.x}px, ${f.y}px)`;
233
+ }, r = (f) => {
234
+ t.style.top = `${f.top}px`, t.style.left = `${f.left}px`;
235
+ };
236
+ return [
237
+ (f, g, m, b) => {
238
+ const M = (y) => {
239
+ const {
240
+ beforeMargin: p,
241
+ borderBeforeWidth: E,
242
+ before: R,
243
+ offset: w,
244
+ scroll: P,
245
+ page: X,
246
+ inner: Z,
247
+ distance: _,
248
+ axis: H,
249
+ getRect: $
250
+ } = B(y), k = m[X], q = window[P], J = window[Z], I = $(f)[_], z = L(f, E), W = L(f, p), Y = k - e[w], et = ce(f, y);
251
+ if (Y >= q - I / 2 && Y <= q + J) {
252
+ const ot = Y - n[R] - z - W - q - et;
253
+ return O(y), ot;
254
+ }
255
+ return s[H];
256
+ }, O = (y) => {
257
+ if (f && nt(f, Ft) && y === b) {
258
+ const { before: p, distance: E, axis: R, getRect: w } = B(b), P = w(f)[E], X = w(g), Z = n[p] - X[p] + s[R], H = X[E] - P, $ = Z / H, k = P / H, q = 0.1, J = 0.2, I = 0.8;
259
+ let z = 0;
260
+ const W = pt(f, g);
261
+ !W && $ < J && $ > -k ? z = $ / J - 1 : !W && $ > I && $ < 1 + k && (z = 1 / (1 - I) * ($ - I));
262
+ const Y = q * P * z;
263
+ je(g, b, Y);
264
+ }
265
+ }, F = (y) => {
266
+ const { axis: p } = B(y);
267
+ s[p] = M(y), o(s);
268
+ };
269
+ F(V), F(tt);
270
+ },
271
+ (f, g) => {
272
+ const [m, b, M, O] = Qe(
273
+ f,
274
+ g,
275
+ t
276
+ );
277
+ n = {
278
+ top: m,
279
+ left: b
280
+ }, r(n), e = { offsetX: M, offsetY: O };
281
+ }
282
+ ];
283
+ }, Rt = (t, e, n) => {
284
+ const { borderBeforeWidth: s, before: o, getRect: r } = B(t);
285
+ return r(e)[o] - r(n)[o] - L(n, s);
286
+ }, Je = (t, e) => {
287
+ let { offsetX: n, offsetY: s, target: o } = t, r = Ke(o, e);
288
+ const c = o;
289
+ return c && r && !c.isSameNode(r) && (n += Rt(V, c, r), s += Rt(tt, c, r)), r && e != o && (n += Rt(V, r, e), s += Rt(tt, r, e)), [n, s];
290
+ }, Ke = (t, e) => {
291
+ const n = t == null ? void 0 : t.closest(`.${Lt}`);
292
+ return n && n.isSameNode(e) ? t : n;
293
+ }, te = (t, e, n, s) => {
294
+ const { offset: o, beforeMargin: r, page: c, borderBeforeWidth: l, scroll: f } = B(t), g = ce(n, t);
295
+ return e[c] - s[o] - L(n, r) - L(n, l) - window[f] - g;
296
+ }, Qe = (t, e, n) => {
297
+ const [s, o] = Je(t, n);
298
+ return [
299
+ te(tt, t, e, {
300
+ offsetX: s,
301
+ offsetY: o
302
+ }),
303
+ te(V, t, e, {
304
+ offsetX: s,
305
+ offsetY: o
306
+ }),
307
+ s,
308
+ o
309
+ ];
310
+ }, fe = "startDrag", Nt = "drag", jt = "startDrop", Ue = "drop", at = "temp-child", de = "cubic-bezier(0.2, 0, 0, 1)", tn = (t) => t === Ue || t === jt, Ht = (t) => !t || t.length == 0 ? 0 : zt(t.replace("px", "")), en = (t, e) => {
191
311
  const n = getComputedStyle(t)[e];
192
312
  if (n.match("%")) {
193
313
  const o = zt(n.replace("%", "")), { width: r } = t.getBoundingClientRect();
@@ -200,17 +320,17 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
200
320
  0,
201
321
  !1
202
322
  ];
203
- const n = je(t, e), s = getComputedStyle(t).display, o = n > 0 || s === "flex";
323
+ const n = en(t, e), s = getComputedStyle(t).display, o = n > 0 || s === "flex";
204
324
  return [n, o];
205
- }, Ze = (t) => {
325
+ }, nn = (t) => {
206
326
  const { top: e, left: n } = getComputedStyle(t);
207
327
  return [Ht(e), Ht(n)];
208
- }, ke = (t, e) => {
328
+ }, sn = (t, e) => {
209
329
  const { gap: n } = B(e), [s, o] = Zt(t, n);
210
330
  return o ? s : 0;
211
331
  };
212
332
  function yt(t, e, n, s, o = t.previousElementSibling, r = t.nextElementSibling) {
213
- let { height: c, width: l } = Je(
333
+ let { height: c, width: l } = on(
214
334
  n,
215
335
  t,
216
336
  o,
@@ -218,7 +338,7 @@ function yt(t, e, n, s, o = t.previousElementSibling, r = t.nextElementSibling)
218
338
  );
219
339
  return pt(t, s) && e == Nt && (c = 0, l = 0), { height: c, width: l };
220
340
  }
221
- const Je = (t, e, n, s) => {
341
+ const on = (t, e, n, s) => {
222
342
  const {
223
343
  afterMargin: o,
224
344
  beforeMargin: r,
@@ -230,16 +350,16 @@ const Je = (t, e, n, s) => {
230
350
  l
231
351
  ), F = f(e)[c];
232
352
  if (O)
233
- return te(F, m, g, M, 0, t);
234
- const [y, p, E] = Ke(
353
+ return ee(F, m, g, M, 0, t);
354
+ const [y, p, E] = rn(
235
355
  n,
236
356
  b,
237
357
  g,
238
358
  m,
239
359
  o
240
360
  );
241
- return te(F, p, y, 0, E, t);
242
- }, Ke = (t, e, n, s, o) => {
361
+ return ee(F, p, y, 0, E, t);
362
+ }, rn = (t, e, n, s, o) => {
243
363
  const r = Math.max(e, n);
244
364
  let c = s, l = e;
245
365
  if (t) {
@@ -250,7 +370,7 @@ const Je = (t, e, n, s) => {
250
370
  c = Math.max(f, s), l = Math.max(l, f);
251
371
  }
252
372
  return [r, c, l];
253
- }, te = (t, e, n, s, o, r) => Qe(r, t + e + n + s - o), Qe = (t, e) => t == V ? { width: e, height: 0 } : { width: 0, height: e }, ee = (t, e) => {
373
+ }, ee = (t, e, n, s, o, r) => cn(r, t + e + n + s - o), cn = (t, e) => t == V ? { width: e, height: 0 } : { width: 0, height: e }, ne = (t, e) => {
254
374
  const {
255
375
  borderBeforeWidth: n,
256
376
  paddingBefore: s,
@@ -258,27 +378,27 @@ const Je = (t, e, n, s) => {
258
378
  getRect: r
259
379
  } = B(t), c = L(e, n), l = L(e, s), f = r(e)[o];
260
380
  return c + l + f;
261
- }, Ue = (t, e) => {
262
- const [n, s] = Ze(e), o = ee(tt, t);
381
+ }, an = (t, e) => {
382
+ const [n, s] = nn(e), o = ne(tt, t);
263
383
  return [
264
- ee(V, t) - s,
384
+ ne(V, t) - s,
265
385
  o - n
266
386
  ];
267
387
  };
268
- function tn(t, e, n, s, o, r, c, l, f) {
388
+ function ln(t, e, n, s, o, r, c, l, f) {
269
389
  let g = 0, m = 0;
270
390
  const b = !!(n < 0 && f);
271
391
  if (n === s && !b)
272
- return ne(
392
+ return se(
273
393
  { height: g, width: m },
274
394
  t,
275
395
  o,
276
396
  c,
277
397
  b
278
398
  );
279
- const [M, O, F, y] = sn(e, n, s, f);
399
+ const [M, O, F, y] = dn(e, n, s, f);
280
400
  if (b) {
281
- const [et, ut] = Ue(l, f);
401
+ const [et, ut] = an(l, f);
282
402
  g += ut, m += et;
283
403
  }
284
404
  const {
@@ -291,7 +411,7 @@ function tn(t, e, n, s, o, r, c, l, f) {
291
411
  _,
292
412
  H,
293
413
  $
294
- ] = rn(
414
+ ] = pn(
295
415
  E,
296
416
  R,
297
417
  M,
@@ -299,22 +419,22 @@ function tn(t, e, n, s, o, r, c, l, f) {
299
419
  y,
300
420
  Z,
301
421
  b
302
- ), [k, q, J] = on(
422
+ ), [k, q, J] = gn(
303
423
  E,
304
424
  R,
305
425
  w,
306
426
  F,
307
427
  X,
308
428
  Z
309
- ), I = nn(
429
+ ), I = fn(
310
430
  q,
311
431
  k,
312
432
  J,
313
433
  H,
314
434
  _,
315
435
  X
316
- ), z = b ? l[p] : en(p, l, r), Y = (y ? I - $ : $ - I) - z;
317
- return t === tt ? g += Y : t === V && (m += Y), ne(
436
+ ), z = b ? l[p] : un(p, l, r), Y = (y ? I - $ : $ - I) - z;
437
+ return t === tt ? g += Y : t === V && (m += Y), se(
318
438
  { height: g, width: m },
319
439
  t,
320
440
  o,
@@ -322,13 +442,13 @@ function tn(t, e, n, s, o, r, c, l, f) {
322
442
  b
323
443
  );
324
444
  }
325
- const en = (t, e, n) => {
445
+ const un = (t, e, n) => {
326
446
  const s = e[t], o = n[t];
327
447
  return s - o;
328
- }, nn = (t, e, n, s, o, r) => {
448
+ }, fn = (t, e, n, s, o, r) => {
329
449
  const c = Math.max(e, o);
330
450
  return Math.max(n, s) + t + c + r;
331
- }, sn = (t, e, n, s) => {
451
+ }, dn = (t, e, n, s) => {
332
452
  const o = e < n, [r, c] = [e, n].toSorted(
333
453
  (m, b) => m - b
334
454
  ), l = t[e] ?? s, f = t[n];
@@ -339,7 +459,7 @@ const en = (t, e, n) => {
339
459
  g,
340
460
  o
341
461
  ];
342
- }, on = (t, e, n, s, o, r) => {
462
+ }, gn = (t, e, n, s, o, r) => {
343
463
  if (s.length == 0)
344
464
  return [0, 0, 0];
345
465
  const c = L(s[0], t);
@@ -349,12 +469,12 @@ const en = (t, e, n) => {
349
469
  r && (l += M), r && g > 0 ? l += o : l = Math.max(l, M), f += l + b, l = L(m, e);
350
470
  }
351
471
  return [c, f, l];
352
- }, ne = (t, e, n, s, o) => {
472
+ }, se = (t, e, n, s, o) => {
353
473
  const { scroll: r, distance: c } = B(e), l = window[r], f = n[r], g = o ? 0 : f - 2 * l + s[r];
354
474
  return t[c] += g, t;
355
- }, rn = (t, e, n, s, o, r, c) => {
475
+ }, pn = (t, e, n, s, o, r, c) => {
356
476
  const l = o ? n.previousElementSibling : s;
357
- return cn(
477
+ return hn(
358
478
  t,
359
479
  e,
360
480
  l,
@@ -362,7 +482,7 @@ const en = (t, e, n) => {
362
482
  r,
363
483
  c
364
484
  );
365
- }, cn = (t, e, n, s, o, r) => {
485
+ }, hn = (t, e, n, s, o, r) => {
366
486
  if (o)
367
487
  return [0, 0, 0];
368
488
  const c = L(
@@ -379,46 +499,41 @@ const en = (t, e, n) => {
379
499
  }
380
500
  });
381
501
  return o.observe(e, n), o;
382
- }, an = (t, e, n) => {
383
- n != 0 && (e === "vertical" ? t.scrollBy(0, n) : t.scrollBy(n, 0));
384
- }, ln = (t, e, n) => {
385
- const { scrollDistance: s, clientDistance: o, scrollElement: r } = B(t);
386
- return n[r] / (e[s] - e[o]);
387
- }, un = "startDrag", ge = "cubic-bezier(0.2, 0, 0, 1)", pe = 50, qt = (t) => it(t) ? t.classList.contains(at) : !1, fn = (t, e, n) => {
502
+ }, mn = "startDrag", ge = "cubic-bezier(0.2, 0, 0, 1)", pe = 50, qt = (t) => it(t) ? t.classList.contains(at) : !1, Sn = (t, e, n) => {
388
503
  let s = yt(
389
504
  e,
390
- un,
505
+ mn,
391
506
  n,
392
507
  t
393
508
  );
394
- const o = ke(t, n), { distance: r } = B(n);
509
+ const o = sn(t, n), { distance: r } = B(n);
395
510
  s[r] -= o;
396
- const [c, l] = dn(n, e);
511
+ const [c, l] = Dn(n, e);
397
512
  return s[l] = c, s;
398
- }, dn = (t, e) => {
513
+ }, Dn = (t, e) => {
399
514
  const n = t == V ? tt : V, { distance: s, getRect: o } = B(n);
400
515
  return [
401
516
  o(e)[s],
402
517
  s
403
518
  ];
404
519
  }, ht = (t, e, n) => {
405
- Ne(t, e, n), t.style.minWidth = `${n}px`;
406
- }, gn = (t, e, n) => (s) => {
520
+ Pe(t, e, n), t.style.minWidth = `${n}px`;
521
+ }, vn = (t, e, n) => (s) => {
407
522
  e.contains(t) && (ht(t, n.height, n.width), s.disconnect());
408
- }, pn = (t, e) => {
523
+ }, bn = (t, e) => {
409
524
  if (!e)
410
525
  return;
411
- const { droppable: n, config: s, scroll: o } = t, { direction: r } = s, c = ln(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: f, scrollElement: g } = B(r);
526
+ const { droppable: n, config: s, scroll: o } = t, { direction: r } = s, c = Ze(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: f, scrollElement: g } = B(r);
412
527
  c && (n[g] = n[l] - n[f]);
413
528
  }, he = (t, e, n, s) => {
414
529
  if (!n)
415
530
  return;
416
531
  const { droppable: o, config: r } = n, { direction: c, animationDuration: l } = r;
417
- if (pn(n, e), o.querySelector(`.${at}`) || !t)
532
+ if (bn(n, e), o.querySelector(`.${at}`) || !t)
418
533
  return;
419
534
  var f = t.tagName == "LI" ? "DIV" : t.tagName, g = document.createElement(f);
420
535
  st(g, at), ht(g, 0, 0);
421
- const m = fn(o, t, c);
536
+ const m = Sn(o, t, c);
422
537
  return Pt(
423
538
  g,
424
539
  l,
@@ -431,20 +546,20 @@ const en = (t, e, n) => {
431
546
  return;
432
547
  const [c, l, f] = r;
433
548
  e.isSameNode(f) && ht(c, l.height, l.width), kt(
434
- gn(c, f, l),
549
+ vn(c, f, l),
435
550
  f,
436
551
  {
437
552
  childList: !0,
438
553
  subtree: !0
439
554
  }
440
555
  ), f.appendChild(c);
441
- }, hn = (t, e, n) => {
556
+ }, Tn = (t, e, n) => {
442
557
  const s = he(t, e, n);
443
558
  if (!s)
444
559
  return;
445
560
  const [o, r, c] = s;
446
- c.appendChild(o), mn(o, r);
447
- }, mn = (t, e) => requestAnimationFrame(() => {
561
+ c.appendChild(o), En(o, r);
562
+ }, En = (t, e) => requestAnimationFrame(() => {
448
563
  ht(t, e.height, e.width), requestAnimationFrame(() => {
449
564
  Pt(
450
565
  t,
@@ -453,7 +568,7 @@ const en = (t, e, n) => {
453
568
  "width, min-width, height"
454
569
  );
455
570
  });
456
- }), Sn = (t, e, n, s, o = !0) => {
571
+ }), yn = (t, e, n, s, o = !0) => {
457
572
  if (n) {
458
573
  var r = document.querySelectorAll(
459
574
  `${gt(n)} > .${at}`
@@ -476,8 +591,8 @@ const en = (t, e, n) => {
476
591
  t.contains(r) && t.removeChild(r);
477
592
  }, e + pe)) : t.removeChild(o);
478
593
  });
479
- }, Dn = 50;
480
- function vn(t, e, n, s, o, r) {
594
+ }, Cn = 50;
595
+ function An(t, e, n, s, o, r) {
481
596
  let c = e;
482
597
  const {
483
598
  direction: l,
@@ -495,7 +610,7 @@ function vn(t, e, n, s, o, r) {
495
610
  v.direction,
496
611
  T
497
612
  );
498
- ze(a) ? Z(
613
+ tn(a) ? Z(
499
614
  u,
500
615
  a,
501
616
  A,
@@ -570,7 +685,7 @@ function vn(t, e, n, s, o, r) {
570
685
  ), a === fe ? P(x, h) : a === Nt && X(x, h);
571
686
  }
572
687
  }, R = (u, a, h, D) => {
573
- const { before: C, distance: T, axis: v, getRect: A } = B(u), N = A(a), x = A(h), G = N[C], K = x[C], mt = x[T], ft = K + mt / 2, St = Be(h)[v], rt = ft - St;
688
+ const { before: C, distance: T, axis: v, getRect: A } = B(u), N = A(a), x = A(h), G = N[C], K = x[C], mt = x[T], ft = K + mt / 2, St = Re(h)[v], rt = ft - St;
574
689
  return G > rt ? { height: 0, width: 0 } : D;
575
690
  }, w = (u, a, h, D) => {
576
691
  const C = D.filter(
@@ -603,7 +718,7 @@ function vn(t, e, n, s, o, r) {
603
718
  ft,
604
719
  St
605
720
  );
606
- const $t = xe(), xt = tn(
721
+ const $t = Be(), xt = ln(
607
722
  N.direction,
608
723
  K,
609
724
  G,
@@ -668,7 +783,7 @@ function vn(t, e, n, s, o, r) {
668
783
  }, q = (u) => {
669
784
  setTimeout(() => {
670
785
  Ct(u, M);
671
- }, Dn);
786
+ }, Cn);
672
787
  }, J = (u, a, h, D) => {
673
788
  setTimeout(() => {
674
789
  D && D(), I(a, h), z(h), et(u), W(u, a), W(u, h);
@@ -708,7 +823,7 @@ function vn(t, e, n, s, o, r) {
708
823
  ot
709
824
  ];
710
825
  }
711
- const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length > 0, me = (t, e, n) => {
826
+ const xn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length > 0, me = (t, e, n) => {
712
827
  const { insertingFromClass: s, animationDuration: o } = n, r = kt(() => {
713
828
  const l = ie(e)[t];
714
829
  st(l, s), st(l, Kt), setTimeout(() => {
@@ -716,7 +831,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
716
831
  }, o);
717
832
  }, e, {
718
833
  childList: !0
719
- }, bn);
834
+ }, xn);
720
835
  }, Nn = (t, e, n, s) => {
721
836
  if (!e)
722
837
  return;
@@ -724,121 +839,6 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
724
839
  setTimeout(() => {
725
840
  o(n, s), me(n, e, t);
726
841
  }, r);
727
- }, Tn = (t, e) => {
728
- const n = (l, f) => t.removeAtEvent(l, f), s = (l, f, g) => t.insertEvent(l, f, g), o = () => t.getLength(), r = (l) => t.getValue(l), c = (l) => l;
729
- return {
730
- direction: (e == null ? void 0 : e.direction) ?? tt,
731
- handlerSelector: (e == null ? void 0 : e.handlerSelector) ?? U,
732
- draggingClass: (e == null ? void 0 : e.draggingClass) ?? "dragging",
733
- droppableClass: (e == null ? void 0 : e.droppableClass) ?? "droppable-hover",
734
- isDraggable: (e == null ? void 0 : e.isDraggable) ?? (() => !0),
735
- onDragStart: (e == null ? void 0 : e.onDragStart) ?? (() => {
736
- }),
737
- onDragEnd: (e == null ? void 0 : e.onDragEnd) ?? (() => {
738
- }),
739
- droppableGroup: e == null ? void 0 : e.droppableGroup,
740
- onRemoveAtEvent: n,
741
- onInsertEvent: s,
742
- onGetLegth: o,
743
- onGetValue: r,
744
- animationDuration: (e == null ? void 0 : e.animationDuration) ?? 200,
745
- removingClass: (e == null ? void 0 : e.removingClass) ?? "removing",
746
- insertingFromClass: (e == null ? void 0 : e.insertingFromClass) ?? "from-inserting",
747
- delayBeforeRemove: (e == null ? void 0 : e.delayBeforeRemove) ?? 200,
748
- delayBeforeInsert: (e == null ? void 0 : e.delayBeforeInsert) ?? 200,
749
- mapFrom: (e == null ? void 0 : e.mapFrom) ?? c
750
- };
751
- }, En = (t, e) => {
752
- const { config: n, droppable: s } = t, { onInsertEvent: o, onDragEnd: r } = n;
753
- return {
754
- ...n,
755
- onDragEnd: (f) => {
756
- const { index: g, value: m } = f;
757
- r({ index: g, value: e(m, s) });
758
- },
759
- onInsertEvent: (f, g) => o(f, e(g, s), !0)
760
- };
761
- }, yn = (t) => {
762
- let e = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
763
- const o = (f) => {
764
- t.style.transform = `translate( ${f.x}px, ${f.y}px)`;
765
- }, r = (f) => {
766
- t.style.top = `${f.top}px`, t.style.left = `${f.left}px`;
767
- };
768
- return [
769
- (f, g, m, b) => {
770
- const M = (y) => {
771
- const {
772
- beforeMargin: p,
773
- borderBeforeWidth: E,
774
- before: R,
775
- offset: w,
776
- scroll: P,
777
- page: X,
778
- inner: Z,
779
- distance: _,
780
- axis: H,
781
- getRect: $
782
- } = B(y), k = m[X], q = window[P], J = window[Z], I = $(f)[_], z = L(f, E), W = L(f, p), Y = k - e[w], et = ce(f, y);
783
- if (Y >= q - I / 2 && Y <= q + J) {
784
- const ot = Y - n[R] - z - W - q - et;
785
- return O(y), ot;
786
- }
787
- return s[H];
788
- }, O = (y) => {
789
- if (f && nt(f, Ft) && y === b) {
790
- const { before: p, distance: E, axis: R, getRect: w } = B(b), P = w(f)[E], X = w(g), Z = n[p] - X[p] + s[R], H = X[E] - P, $ = Z / H, k = P / H, q = 0.1, J = 0.2, I = 0.8;
791
- let z = 0;
792
- const W = pt(f, g);
793
- !W && $ < J && $ > -k ? z = $ / J - 1 : !W && $ > I && $ < 1 + k && (z = 1 / (1 - I) * ($ - I));
794
- const Y = q * P * z;
795
- an(g, b, Y);
796
- }
797
- }, F = (y) => {
798
- const { axis: p } = B(y);
799
- s[p] = M(y), o(s);
800
- };
801
- F(V), F(tt);
802
- },
803
- (f, g) => {
804
- const [m, b, M, O] = xn(
805
- f,
806
- g,
807
- t
808
- );
809
- n = {
810
- top: m,
811
- left: b
812
- }, r(n), e = { offsetX: M, offsetY: O };
813
- }
814
- ];
815
- }, Rt = (t, e, n) => {
816
- const { borderBeforeWidth: s, before: o, getRect: r } = B(t);
817
- return r(e)[o] - r(n)[o] - L(n, s);
818
- }, Cn = (t, e) => {
819
- let { offsetX: n, offsetY: s, target: o } = t, r = An(o, e);
820
- const c = o;
821
- return c && r && !c.isSameNode(r) && (n += Rt(V, c, r), s += Rt(tt, c, r)), r && e != o && (n += Rt(V, r, e), s += Rt(tt, r, e)), [n, s];
822
- }, An = (t, e) => {
823
- const n = t == null ? void 0 : t.closest(`.${Lt}`);
824
- return n && n.isSameNode(e) ? t : n;
825
- }, se = (t, e, n, s) => {
826
- const { offset: o, beforeMargin: r, page: c, borderBeforeWidth: l, scroll: f } = B(t), g = ce(n, t);
827
- return e[c] - s[o] - L(n, r) - L(n, l) - window[f] - g;
828
- }, xn = (t, e, n) => {
829
- const [s, o] = Cn(t, n);
830
- return [
831
- se(tt, t, e, {
832
- offsetX: s,
833
- offsetY: o
834
- }),
835
- se(V, t, e, {
836
- offsetX: s,
837
- offsetY: o
838
- }),
839
- s,
840
- o
841
- ];
842
842
  }, Q = class Q {
843
843
  static addConfig(e, n) {
844
844
  const s = Q.configs.filter(
@@ -853,7 +853,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
853
853
  static updateScrolls(e, n) {
854
854
  for (const s of Q.configs) {
855
855
  const { droppable: o } = s;
856
- (n && Ce(o, n) || o.isSameNode(e)) && (s.scroll = Ut(o));
856
+ (n && xe(o, n) || o.isSameNode(e)) && (s.scroll = Ut(o));
857
857
  }
858
858
  }
859
859
  static getConfig(e) {
@@ -925,7 +925,7 @@ class wn {
925
925
  if (n)
926
926
  return e.isSameNode(this.parent) ? n : {
927
927
  ...n,
928
- config: En(n, this.mapFrom)
928
+ config: Ae(n, this.mapFrom)
929
929
  };
930
930
  }
931
931
  getCurrentConfig(e) {
@@ -965,7 +965,7 @@ function Bn(t, e, n, s, o) {
965
965
  scrollX: 0,
966
966
  scrollY: 0
967
967
  }, R = { pageX: 0, pageY: 0 }, w, P;
968
- const [X, Z] = yn(
968
+ const [X, Z] = ke(
969
969
  t
970
970
  ), [
971
971
  _,
@@ -973,7 +973,7 @@ function Bn(t, e, n, s, o) {
973
973
  $,
974
974
  k,
975
975
  q
976
- ] = vn(
976
+ ] = An(
977
977
  n,
978
978
  e,
979
979
  s,
@@ -1060,7 +1060,7 @@ function Bn(t, e, n, s, o) {
1060
1060
  if (!a.current)
1061
1061
  return;
1062
1062
  const { droppable: d } = a.current;
1063
- Sn(
1063
+ yn(
1064
1064
  d,
1065
1065
  s,
1066
1066
  y,
@@ -1198,7 +1198,7 @@ function Bn(t, e, n, s, o) {
1198
1198
  s,
1199
1199
  d,
1200
1200
  () => {
1201
- hn(
1201
+ Tn(
1202
1202
  t,
1203
1203
  p == 1,
1204
1204
  a.initial
@@ -1209,9 +1209,9 @@ function Bn(t, e, n, s, o) {
1209
1209
  return W(), et(t), [ve, be];
1210
1210
  }
1211
1211
  const Mn = (t, e) => {
1212
- t && Ae(e, t);
1212
+ t && we(e, t);
1213
1213
  }, Rn = () => {
1214
- Ve(document.body, [
1214
+ He(document.body, [
1215
1215
  `.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,
1216
1216
  `.${Lt}{pointer-events:auto!important;}`,
1217
1217
  `.${ye}{cursor:grab;}`,
@@ -1236,7 +1236,7 @@ function Ln(t, e, n, s = "index") {
1236
1236
  const f = At(l).map((g) => `droppable-group-${g}`).join(" ");
1237
1237
  Rn(), Mn(f, n);
1238
1238
  for (const g of n.children) {
1239
- const m = g.getAttribute(o), b = we(m), M = g;
1239
+ const m = g.getAttribute(o), b = Me(m), M = g;
1240
1240
  if (M && b >= 0) {
1241
1241
  const [O, F] = Bn(
1242
1242
  M,
@@ -1255,7 +1255,7 @@ function Ln(t, e, n, s = "index") {
1255
1255
  }
1256
1256
  function Fn(t, e, n, s = "index") {
1257
1257
  let o = [], r = [], c;
1258
- const l = Tn(t, n), f = (p) => {
1258
+ const l = Ce(t, n), f = (p) => {
1259
1259
  for (const E of o)
1260
1260
  E(p);
1261
1261
  }, g = (p, E) => {
@@ -0,0 +1 @@
1
+ "use strict";var Ee=Object.defineProperty;var ye=(t,e,n)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);const _="horizontal",et="vertical",U="draggable",Xt="droppable",Mt="handler-class",Ft="dragging",Wt="dragging-handler-class",_t="dropping",oe="grabbing",re="grab",Kt="disable-transition",Ce=(t,e)=>{const n=(l,f)=>t.removeAtEvent(l,f),s=(l,f,g)=>t.insertEvent(l,f,g),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??et,handlerSelector:(e==null?void 0:e.handlerSelector)??U,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??c}},Ae=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:g,value:m}=f;r({index:g,value:e(m,s)})},onInsertEvent:(f,g)=>o(f,e(g,s),!0)}},st=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},tt=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},xe=(t,e)=>At(e).every(n=>st(t,n)),pt=t=>t?`.${At(t).join(".")}`:"",we=(t,e)=>{if(!e)return;const n=At(e);t.classList.add(...n)},At=t=>t?t.split(" ").filter(e=>e):[],Be=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},zt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),Re=t=>t?parseInt(t):-1,Le=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ie=(t,e)=>t.x1>e.x1?ie(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Me(t,e),Me=(t,e)=>{const n=Ot(t),s=Ot(e),o=Qt(n,s,et),r=Qt(n,s,_);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Qt=(t,e,n)=>{const{before:s,distance:o}=B(n);return ie({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},M=(t,e)=>t?zt(getComputedStyle(t)[e]):0,Ut=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Ot=t=>t.getBoundingClientRect(),B=t=>{const e=t==_;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Ot}},Rt=(t,e)=>Oe(t,e),ce=t=>[...t.children].filter(n=>st(n,U)),Oe=(t,e)=>{const n=[...e.children].filter(o=>st(o,U)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ne=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ae=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Ne(t);return o?Ot(o)[n]+M(o,s):0},Tt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,le=t=>t instanceof MouseEvent,Fe=["onmouseup","onmousedown","onmousemove"],Pe=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Et=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},$e=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Vt(o);n(r)}},It=(t,e,n,s)=>{n&&(Ge(e)?t[e]=n:$e(t,e,n,s))},Ge=t=>Fe.includes(t),Ie=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Ye=(t,e)=>{const n=(s,o)=>We(e,window,o,s);if(le(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,et)]}},Vt=t=>{const e=Xe(t);if(!e)return Ie(t);const[n,s]=Ye(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m,offsetX:n,offsetY:s}},Xe=t=>{if(Tt(t))return t.touches[0]??t.changedTouches[0];if(le(t))return t},We=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:f}=B(n),g=f(s);return t[o]-e[r]-g[c]-M(s,l)},Pt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ue=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},_e=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Ve=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},He=(t,e)=>{e.forEach(n=>{qe(t,n)})},qe=(t,e)=>{var s;var n=_e(t);n.sheet&&(Ve(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},fe=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&ze(t,`--${n}`,s)}},ze=(t,e,n)=>t&&t.style.setProperty(e,n),je=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},Ze=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=B(t);return n[r]/(e[s]-e[o])},ke=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=f=>{t.style.transform=`translate( ${f.x}px, ${f.y}px)`},r=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,m,b)=>{const R=y=>{const{beforeMargin:p,borderBeforeWidth:E,before:L,offset:w,scroll:P,page:X,inner:Z,distance:V,axis:H,getRect:$}=B(y),k=m[X],q=window[P],J=window[Z],I=$(f)[V],z=M(f,E),W=M(f,p),Y=k-e[w],nt=ae(f,y);if(Y>=q-I/2&&Y<=q+J){const ot=Y-n[L]-z-W-q-nt;return O(y),ot}return s[H]},O=y=>{if(f&&st(f,Ft)&&y===b){const{before:p,distance:E,axis:L,getRect:w}=B(b),P=w(f)[E],X=w(g),Z=n[p]-X[p]+s[L],H=X[E]-P,$=Z/H,k=P/H,q=.1,J=.2,I=.8;let z=0;const W=ht(f,g);!W&&$<J&&$>-k?z=$/J-1:!W&&$>I&&$<1+k&&(z=1/(1-I)*($-I));const Y=q*P*z;je(g,b,Y)}},F=y=>{const{axis:p}=B(y);s[p]=R(y),o(s)};F(_),F(et)},(f,g)=>{const[m,b,R,O]=Qe(f,g,t);n={top:m,left:b},r(n),e={offsetX:R,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=B(t);return r(e)[o]-r(n)[o]-M(n,s)},Je=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=Ke(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(_,c,r),s+=Lt(et,c,r)),r&&e!=o&&(n+=Lt(_,r,e),s+=Lt(et,r,e)),[n,s]},Ke=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&n.isSameNode(e)?t:n},te=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:f}=B(t),g=ae(n,t);return e[c]-s[o]-M(n,r)-M(n,l)-window[f]-g},Qe=(t,e,n)=>{const[s,o]=Je(t,n);return[te(et,t,e,{offsetX:s,offsetY:o}),te(_,t,e,{offsetX:s,offsetY:o}),s,o]},de="startDrag",Nt="drag",jt="startDrop",Ue="drop",at="temp-child",ge="cubic-bezier(0.2, 0, 0, 1)",tn=t=>t===Ue||t===jt,Ht=t=>!t||t.length==0?0:zt(t.replace("px","")),en=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=zt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Ht(n)},Zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=en(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},nn=t=>{const{top:e,left:n}=getComputedStyle(t);return[Ht(e),Ht(n)]},sn=(t,e)=>{const{gap:n}=B(e),[s,o]=Zt(t,n);return o?s:0};function yt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=on(n,t,o,r);return ht(t,s)&&e==Nt&&(c=0,l=0),{height:c,width:l}}const on=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:f}=B(t),g=M(e,o),m=M(e,r),b=M(s,r),[R,O]=Zt(e.parentElement,l),F=f(e)[c];if(O)return ee(F,m,g,R,0,t);const[y,p,E]=rn(n,b,g,m,o);return ee(F,p,y,0,E,t)},rn=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const f=M(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[r,c,l]},ee=(t,e,n,s,o,r)=>cn(r,t+e+n+s-o),cn=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},ne=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=B(t),c=M(e,n),l=M(e,s),f=r(e)[o];return c+l+f},an=(t,e)=>{const[n,s]=nn(e),o=ne(et,t);return[ne(_,t)-s,o-n]};function ln(t,e,n,s,o,r,c,l,f){let g=0,m=0;const b=!!(n<0&&f);if(n===s&&!b)return se({height:g,width:m},t,o,c,b);const[R,O,F,y]=dn(e,n,s,f);if(b){const[nt,ut]=an(l,f);g+=ut,m+=nt}const{scrollElement:p,beforeMargin:E,afterMargin:L,distance:w,gap:P}=B(t),[X,Z]=Zt(l,P),[V,H,$]=pn(E,L,R,O==null?void 0:O.previousElementSibling,y,Z,b),[k,q,J]=gn(E,L,w,F,X,Z),I=fn(q,k,J,H,V,X),z=b?l[p]:un(p,l,r),Y=(y?I-$:$-I)-z;return t===et?g+=Y:t===_&&(m+=Y),se({height:g,width:m},t,o,c,b)}const un=(t,e,n)=>{const s=e[t],o=n[t];return s-o},fn=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},dn=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,b)=>m-b),l=t[e]??s,f=t[n];let g=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(g=t.slice(r+1,c)),[l,f,g,o]},gn=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=M(s[0],t);let l=0,f=-c;for(const[g,m]of s.entries()){const b=m.getBoundingClientRect()[n],R=M(m,t);r&&(l+=R),r&&g>0?l+=o:l=Math.max(l,R),f+=l+b,l=M(m,e)}return[c,f,l]},se=(t,e,n,s,o)=>{const{scroll:r,distance:c}=B(e),l=window[r],f=n[r],g=o?0:f-2*l+s[r];return t[c]+=g,t},pn=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return hn(t,e,l,n,r,c)},hn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=M(r?null:n,e),l=M(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},mn="startDrag",pe="cubic-bezier(0.2, 0, 0, 1)",he=50,qt=t=>it(t)?t.classList.contains(at):!1,Sn=(t,e,n)=>{let s=yt(e,mn,n,t);const o=sn(t,n),{distance:r}=B(n);s[r]-=o;const[c,l]=Dn(n,e);return s[l]=c,s},Dn=(t,e)=>{const n=t==_?et:_,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},mt=(t,e,n)=>{Pe(t,e,n),t.style.minWidth=`${n}px`},vn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},bn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=Ze(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:g}=B(r);c&&(n[g]=n[l]-n[f])},me=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(bn(n,e),o.querySelector(`.${at}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);tt(g,at),mt(g,0,0);const m=Sn(o,t,c);return Pt(g,l,pe,"width, min-width, height"),[g,m,o]},Yt=(t,e,n,s,o)=>{const r=me(t,n,s);if(!r)return;const[c,l,f]=r;e.isSameNode(f)&&mt(c,l.height,l.width),kt(vn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},Tn=(t,e,n)=>{const s=me(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),En(o,r)},En=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Pt(t,0,pe,"width, min-width, height")})}),yn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s+he)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+he)):t.removeChild(o)})},Cn=50;function An(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:g,animationDuration:m,delayBeforeInsert:b,draggingClass:R}=t,O=(u,a,h,D,C)=>{if(!D)return;const{droppable:T,config:v}=D,A=yt(u,a,v.direction,T);tn(a)?Z(u,a,A,h,D,C):E(u,a,A,D)},F=(u,a,h,D,C)=>{const T=yt(a,"insert",t.direction,h),{onInsertEvent:v}=t,A=ce(h);for(const[N,x]of A.entries())st(x,U)&&N>=u&&X(x,T);C(),setTimeout(()=>{v(u,D),Se(u,h,t),nt(a),W(a,n),bt(n,0,!0)},b)},y=(u,a,h,D)=>{if(!h||!h.droppable||!h.config)return;const{droppable:C,config:T}=h;let[v]=Rt(a,C);v=[a,...v].toReversed();const A=yt(a,"remove",T.direction,C);for(const[N,x]of v.entries())N>=u&&(P(x,A),setTimeout(()=>{D(x)},m))},p=u=>{bt(n,m,!0),setTimeout(()=>{nt(u),W(u,n)},m)},E=(u,a,h,D)=>{const{config:C,droppable:T}=D,[v]=Rt(u,T),A=ht(u,T);v.length==0&&w(h,1,C.direction,v);for(const[N,x]of v.entries()){if(!st(x,U))continue;const G=L(C.direction,u,x,h);if(!A&&G)h=G;else if(!A)continue;const K=v.length-N;w(h,K,C.direction,v),a===de?P(x,h):a===Nt&&X(x,h)}},L=(u,a,h,D)=>{const{before:C,distance:T,axis:v,getRect:A}=B(u),N=A(a),x=A(h),G=N[C],K=x[C],St=x[T],ft=K+St/2,Dt=Le(h)[v],rt=ft-Dt;return G>rt?{height:0,width:0}:D},w=(u,a,h,D)=>{const C=D.filter(v=>st(v,U)).length,{distance:T}=B(h);u[T]==0?c=Math.max(c,a):c=Math.min(c,a-1),c=Math.min(c,C)},P=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h)},X=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h),Pt(u,m,ge)},Z=(u,a,h,D,C,T)=>{const{droppable:v,scroll:A,config:N}=C,[x,G]=Rt(u,v),K=x.toReversed(),St=G===-1?K.length:G;K.splice(St,0,u);const[ft,Dt,rt]=V(u,G,K,v);h=yt(u,a,N.direction,n,ft,Dt);const $t=Be(),xt=ln(N.direction,K,G,rt,$t,A,D,v,u);x.length==0&&H(void 0,h,u,xt);for(const[Gt,wt]of x.toReversed().entries()){let Bt=h;rt-1>=Gt&&(Bt={height:0,width:0}),a===jt&&!st(wt,at)&&H(wt,Bt,u,xt)}$(rt,u,N,v,T)},V=(u,a,h,D)=>{const T=ht(u,D)?a:c,v=()=>a<T?[T,T+1]:a>T?[T-1,T]:[T-1,T+1],[A,N]=v(),x=h[A]??null,G=h[N]??null;return[x,G,T]},H=(u,a,h,D)=>{Et(u,a.height,a.width),Et(h,D.height,D.width)},$=(u,a,h,D,C)=>{const{onInsertEvent:T,onDragEnd:v}=h;tt(a,_t),J(a,n,D,()=>{if(Ct(a,_t),C!=null){const A=g(C,!0);A!=null&&(T(u,A,!0),v({value:A,index:u})),q(a),k()}})},k=()=>{if(s){var u=document.querySelectorAll(`${pt(s)} > .${U}`);for(const a of u)Y(a)}},q=u=>{setTimeout(()=>{Ct(u,R)},Cn)},J=(u,a,h,D)=>{setTimeout(()=>{D&&D(),I(a,h),z(h),nt(u),W(u,a),W(u,h)},m)},I=(u,a)=>{u.isSameNode(a)?bt(u,m):(bt(u,m,!0),bt(a,m))},z=u=>{if(n.isSameNode(u))return;var[a]=n.querySelectorAll(`.${at}`);if(!a)return;const{distance:h}=B(l);it(a)&&(a.style[h]="0px")},W=(u,a)=>{const[h]=Rt(u,a);for(const D of[...h,u])Y(D)},Y=u=>{it(u)&&(u.style.transition="",u.style.transform="")},nt=u=>{r(),ot(u,!1),u.style.transform="",u.style.transition="",u.style.top="",u.style.left="",fe(u,{fixedHeight:"",fixedWidth:""})},ut=(u,a)=>{const h=a.querySelector(f);gt(document.body,oe,u),gt(h||a,Wt,u)},ot=(u,a)=>{gt(u,Ft,a),ut(a,u),o.toggleGrabClass(!a)};return[O,y,F,p,ot]}const xn=t=>t.addedNodes.values().filter(n=>!qt(n)).toArray().length>0,Se=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ce(e)[t];tt(l,s),tt(l,Kt),setTimeout(()=>{Ct(l,Kt),Ct(l,s),r.disconnect()},o)},e,{childList:!0},xn)},wn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),Se(n,e,t)},r)},Q=class Q{static addConfig(e,n){const s=Q.configs.filter(r=>!r.droppable.isSameNode(e)),o=Ut(e);s.push({droppable:e,config:n,scroll:o}),Q.configs=s}static updateScrolls(e,n){for(const s of Q.configs){const{droppable:o}=s;(n&&xe(o,n)||o.isSameNode(e))&&(s.scroll=Ut(o))}}static getConfig(e){return Q.configs.find(({droppable:s})=>s.isSameNode(e))}};j(Q,"configs",[]),j(Q,"removeObsoleteConfigs",()=>{const e=Q.configs.filter(({droppable:n})=>document.contains(n));Q.configs=e});let lt=Q;class Bn{constructor(e,n,s,o,r,c){j(this,"initial");j(this,"current");j(this,"parent");j(this,"draggableElement");j(this,"groupClass");j(this,"dragEvent");j(this,"changeDroppable");j(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ue(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=lt.getConfig(e);if(n)return e.isSameNode(this.parent)?n:{...n,config:Ae(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function Rn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:g,draggingClass:m,removingClass:b,onRemoveAtEvent:R,droppableClass:O,onDragStart:F}=n,y=At(l).map(i=>`droppable-group-${i}`).join(" ");let p=0,E={scrollX:0,scrollY:0},L={pageX:0,pageY:0},w,P;const[X,Z]=ke(t),[V,H,$,k,q]=An(n,e,s,y,o,()=>p=0),J=()=>{tt(t,U)},I=i=>{tt(i,Mt),o.addSubscriber(i)},z=()=>{if(c(t)){const i=t.querySelector(r);I(i||t)}},W=()=>{z(),J()},Y=i=>{const d=i==null?void 0:i.querySelector(`.${Mt}`),S=d==null?void 0:d.parentElement;return d&&S&&st(S,Xt)&&!S.isSameNode(s)?null:d},nt=i=>{const d=Y(i)??i;d&&c(i)&&(It(d,"onmousedown",G("mousemove","mouseup")),It(d,"ontouchstart",G("touchmove","touchend"),S=>{P={x:S.touches[0].clientX,y:S.touches[0].clientY}}),ut(d)),i!=null&&i.isSameNode(d)||It(i,"onmousedown",K),tt(s,Xt)},ut=i=>{const d=i.querySelectorAll("img");Array.from(d).forEach(S=>{S.onmousedown=()=>!1})},ot=()=>{if(L.pageX==0&&L.pageY==0||!a.current)return;const{droppable:i,config:d}=a.current;X(t,i,L,d.direction),V(t,Nt,E,a.current)},u=(i,d)=>{d&&p==2&&!(i!=null&&i.droppable.isSameNode(d.droppable))&&V(t,Nt,E,d)},a=new Bn(t,y,s,ot,u,n.mapFrom),h=i=>{if(!a.current)return;const d=y?Array.from(document.querySelectorAll(pt(y))):[s];for(const S of d)S.classList.toggle(O,!i&&S.isSameNode(a.current.droppable))},D=(i,d=!1)=>{a.updateConfig(i);const S=a.isOutside(i);h(S),p===1&&!d?rt(i):p===2&&(C(S),xt(i))},C=(i=!0)=>{if(!a.current)return;const{droppable:d}=a.current;yn(d,s,y,f,i),!i&&Yt(t,s,p==1,a.current)},T=i=>{if(Tt(i)&&P&&p==1){const d=Math.abs(i.touches[0].clientX-P.x),S=Math.abs(i.touches[0].clientY-P.y);if(Math.abs(d)>5&&Math.abs(S)>5)return clearTimeout(w),!1}return!0},v=i=>{clearTimeout(w);const d=Vt(i);if(Tt(i)&&i.cancelable&&i.preventDefault(),Tt(i)&&!i.cancelable||!T(i)){ft("touchmove",i);return}D(d,Tt(i))},A=(i,d)=>{i=="touchmove"?w=setTimeout(()=>{d()},150):d()},N=(i,d)=>{const{clientX:S,clientY:dt}=i,ct=document.elementFromPoint(S,dt),vt=ct==null?void 0:ct.closest(`.${U}`);return vt&&d.isSameNode(vt)},x=i=>{const d=n.onGetValue(e);return{index:e,element:i,value:d}},G=(i,d)=>S=>{if(!N(S,t))return;lt.updateScrolls(s,y);const{scrollX:dt,scrollY:ct}=window;if(E={scrollX:dt,scrollY:ct},p===0){p=1;const vt=x(t);vt&&F(vt),A(i,()=>{i=="touchmove"&&(a.updateConfig(S),h(a.isOutside(S)),rt(S))}),document.addEventListener(i,v,{passive:!1}),Gt(s),document.addEventListener(d,St(i),{once:!0})}},K=i=>a.updateConfig(i),St=i=>d=>{ft(i,d)},ft=(i,d)=>{h(!0);const S=Vt(d);Bt(a.isOutside(S,!1)),clearTimeout(w),document.removeEventListener(i,v),a.updateConfig(S);const dt=a.getCurrentConfig(S);if(dt){const{droppable:ct}=dt;Dt(ct)}s.onscroll=null},Dt=i=>{if(i.onscroll=null,!y)return;const d=Array.from(document.querySelectorAll(pt(y)));for(const S of d)it(S)&&(S.onscroll=null)},rt=i=>{Yt(t,s,p==1,a.current),$t(),V(t,de,E,a.current),De(t),Z(i,t)},$t=()=>{p=2},xt=i=>{const{pageX:d,pageY:S}=i;L={pageX:d,pageY:S},ot()},Gt=i=>ue(i,"onscroll",wt),wt=()=>ot(),Bt=i=>{if(p!==2&&p!==1){p=0;return}p=3,Jt(t),t.classList.contains(Ft)&&V(t,jt,E,i?a.initial:a.current,e)},Jt=i=>{Pt(i,f,ge),Et(i,0,0)},De=i=>{const{height:d,width:S}=i.getBoundingClientRect();fe(i,{fixedHeight:`${d}px`,fixedWidth:`${S}px`}),q(i,!0),gt(i,m,!0),i.style.transition=""},ve=(i,d)=>{Ct(t,b),Yt(t,s,p==1,a.initial),H(i,t,d,S=>{Jt(S),k(t)}),R(e,!0)},be=i=>{if(!a.initial)return;const d=a.initial;i==e&&(tt(t,b),setTimeout(()=>{ve(i,d)},g))},Te=(i,d)=>{(i===e||i===n.onGetLegth()&&e===i-1)&&$(i,t,s,d,()=>{Tn(t,p==1,a.initial)})};return W(),nt(t),[be,Te]}const Ln=(t,e)=>{t&&we(e,t)},Mn=()=>{He(document.body,[`.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${re}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ft}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${_t}{pointer-events:none!important;}`,`.${oe}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function On(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const f=At(l).map(g=>`droppable-group-${g}`).join(" ");Mn(),Ln(f,n);for(const g of n.children){const m=g.getAttribute(o),b=Re(m),R=g;if(R&&b>=0){const[O,F]=Rn(R,b,t,n,e);r.push(O),c.push(F)}}return[r,c]}function Nn(t,e,n,s="index"){let o=[],r=[],c;const l=Ce(t,n),f=p=>{for(const E of o)E(p)},g=(p,E)=>{if(l.onGetLegth()===0)t.insertToListEmpty(l,p,E);else for(const w of r)w(p,E)},m=p=>{const[E,L]=On(l,e,p,s);o=E,r=L},b=p=>{const E=p.addedNodes.values().filter(w=>!qt(w)).toArray(),L=p.removedNodes.values().filter(w=>!qt(w)).toArray();return E.length>0||L.length>0},R=p=>{c=kt(()=>{m(p)},p,{childList:!0},b)},O=p=>{tt(p,Xt)},F=p=>{lt.addConfig(p,l)};return[f,g,p=>{if(p)return O(p),F(p),R(p),m(p),lt.removeObsoleteConfigs(),c}]}exports.GRAB_CLASS=re;exports.addClass=tt;exports.dragAndDrop=Nn;exports.insertToListEmpty=wn;exports.toggleClass=gt;
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DNmnvxhi.cjs");exports.dragAndDrop=e.dragAndDrop;
package/dist/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ import { d as o } from "./index-BQUYvZRn.js";
2
+ export {
3
+ o as dragAndDrop
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),y=require("../HandlerPublisher-F9_9P96L.cjs"),b=require("../index-C37ab-rG.cjs"),S=require("react-dom");function A(a,f){const[e,n]=s.useState(a),i=s.useRef(e);s.useEffect(()=>{i.current=e},[e]);function g(t,r=!1){const c=i.current[t],o=()=>{n(u=>[...u.slice(0,t),...u.slice(t+1)])};return r?S.flushSync(o):o(),c}function d(t,r,c=!1){const o=()=>{n(u=>[...u.slice(0,t),r,...u.slice(t)])};c?S.flushSync(o):o()}function h(){return e.length}function m(t){return e[t]}function l(t,r,c){b.insertToListEmpty(t,f.current,r,c)}return[e,n,{removeAtEvent:g,insertEvent:d,getLength:h,getValue:m,insertToListEmpty:l}]}const D=new y.HandlerPublisher;function E(a,f){const e=s.useRef(null),[n,i,g]=A(a,e),[d,h,m]=s.useMemo(()=>b.dragAndDrop(g,D,f,"data-index"),[n.length]);return s.useEffect(()=>{const l=m(e.current);return()=>{l&&(console.log("disconnect"),l.disconnect())}},[n.length]),[e,n,i,h,d]}exports.useDragAndDrop=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),y=require("../HandlerPublisher-C-jTncuG.cjs"),b=require("../index-DNmnvxhi.cjs"),S=require("react-dom");function A(a,f){const[e,n]=s.useState(a),i=s.useRef(e);s.useEffect(()=>{i.current=e},[e]);function g(t,r=!1){const c=i.current[t],o=()=>{n(u=>[...u.slice(0,t),...u.slice(t+1)])};return r?S.flushSync(o):o(),c}function d(t,r,c=!1){const o=()=>{n(u=>[...u.slice(0,t),r,...u.slice(t)])};c?S.flushSync(o):o()}function h(){return e.length}function m(t){return e[t]}function l(t,r,c){b.insertToListEmpty(t,f.current,r,c)}return[e,n,{removeAtEvent:g,insertEvent:d,getLength:h,getValue:m,insertToListEmpty:l}]}const D=new y.HandlerPublisher;function E(a,f){const e=s.useRef(null),[n,i,g]=A(a,e),[d,h,m]=s.useMemo(()=>b.dragAndDrop(g,D,f,"data-index"),[n.length]);return s.useEffect(()=>{const l=m(e.current);return()=>{l&&(console.log("disconnect"),l.disconnect())}},[n.length]),[e,n,i,h,d]}exports.useDragAndDrop=E;
@@ -1,6 +1,6 @@
1
1
  import { useState as S, useRef as p, useEffect as E, useMemo as b } from "react";
2
- import { H as A } from "../HandlerPublisher-BbQeSll4.js";
3
- import { i as C, d as L } from "../index-8zYdjZIf.js";
2
+ import { H as A } from "../HandlerPublisher-BYI2bw4n.js";
3
+ import { i as C, d as L } from "../index-BQUYvZRn.js";
4
4
  import { flushSync as h } from "react-dom";
5
5
  function v(a, l) {
6
6
  const [t, n] = S(a), i = p(t);
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-F9_9P96L.cjs"),o=require("../index-C37ab-rG.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
1
+ "use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-C-jTncuG.cjs"),o=require("../index-DNmnvxhi.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
@@ -1,8 +1,8 @@
1
1
  var l = Object.defineProperty;
2
2
  var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var r = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { H as c } from "../HandlerPublisher-BbQeSll4.js";
5
- import { i as m, d as u } from "../index-8zYdjZIf.js";
4
+ import { H as c } from "../HandlerPublisher-BYI2bw4n.js";
5
+ import { i as m, d as u } from "../index-BQUYvZRn.js";
6
6
  class h {
7
7
  constructor(t) {
8
8
  r(this, "items");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-F9_9P96L.cjs"),u=require("../index-C37ab-rG.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
1
+ "use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-C-jTncuG.cjs"),u=require("../index-DNmnvxhi.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
@@ -2,8 +2,8 @@ var l = Object.defineProperty;
2
2
  var u = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var r = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { ref as c, watch as m } from "vue";
5
- import { H as h } from "../HandlerPublisher-BbQeSll4.js";
6
- import { i as p, d as v } from "../index-8zYdjZIf.js";
5
+ import { H as h } from "../HandlerPublisher-BYI2bw4n.js";
6
+ import { i as p, d as v } from "../index-BQUYvZRn.js";
7
7
  const g = (n, t) => {
8
8
  const e = n.value;
9
9
  if (e.length <= 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-dnd",
3
- "version": "1.3.3-beta.0",
3
+ "version": "2.0.1",
4
4
  "description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue, react and svelte",
5
5
  "type": "module",
6
6
  "homepage": "https://fluid-dnd.netlify.app",
@@ -11,7 +11,7 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "main": ".dist/index.cjs",
14
+ "main": "./dist/index.cjs",
15
15
  "exports": {
16
16
  "./vue": {
17
17
  "types": "./dist/vue/index.d.ts",
@@ -31,10 +31,10 @@
31
31
  ".": {
32
32
  "types": "./dist/index.d.ts",
33
33
  "import": "./dist/index.mjs",
34
- "require": "./dist/index.umd.cjs"
34
+ "require": "./dist/index.cjs"
35
35
  }
36
36
  },
37
- "types": "./index.d.ts",
37
+ "types": "./dist/index.d.ts",
38
38
  "keywords": [
39
39
  "vue",
40
40
  "react",
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "scripts": {
77
77
  "dev": "cd my-test-examples && vite",
78
- "build": "tsc && vite build",
78
+ "build": "vite build",
79
79
  "preview": "vite preview",
80
80
  "test": "vitest"
81
81
  }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-C37ab-rG.cjs");exports.dragAndDrop=e.dragAndDrop;
@@ -1,4 +0,0 @@
1
- import { d as o } from "../index-8zYdjZIf.js";
2
- export {
3
- o as dragAndDrop
4
- };
@@ -1 +0,0 @@
1
- "use strict";var Ee=Object.defineProperty;var ye=(t,e,n)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);const U="draggable",Xt="droppable",Mt="handler-class",Ft="dragging",Wt="dragging-handler-class",_t="dropping",oe="grabbing",re="grab",Kt="disable-transition",st=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},tt=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},Ce=(t,e)=>At(e).every(n=>st(t,n)),pt=t=>t?`.${At(t).join(".")}`:"",Ae=(t,e)=>{if(!e)return;const n=At(e);t.classList.add(...n)},At=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",et="vertical",xe=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},zt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),we=t=>t?parseInt(t):-1,Be=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ie=(t,e)=>t.x1>e.x1?ie(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Re(t,e),Re=(t,e)=>{const n=Ot(t),s=Ot(e),o=Qt(n,s,et),r=Qt(n,s,_);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Qt=(t,e,n)=>{const{before:s,distance:o}=B(n);return ie({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},M=(t,e)=>t?zt(getComputedStyle(t)[e]):0,Ut=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Ot=t=>t.getBoundingClientRect(),B=t=>{const e=t==_;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Ot}},Rt=(t,e)=>Le(t,e),ce=t=>[...t.children].filter(n=>st(n,U)),Le=(t,e)=>{const n=[...e.children].filter(o=>st(o,U)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Me=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ae=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Me(t);return o?Ot(o)[n]+M(o,s):0},Tt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,le=t=>t instanceof MouseEvent,Oe=["onmouseup","onmousedown","onmousemove"],Ne=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Et=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Fe=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Vt(o);n(r)}},It=(t,e,n,s)=>{n&&(Pe(e)?t[e]=n:Fe(t,e,n,s))},Pe=t=>Oe.includes(t),$e=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Ge=(t,e)=>{const n=(s,o)=>Ye(e,window,o,s);if(le(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,et)]}},Vt=t=>{const e=Ie(t);if(!e)return $e(t);const[n,s]=Ge(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m,offsetX:n,offsetY:s}},Ie=t=>{if(Tt(t))return t.touches[0]??t.changedTouches[0];if(le(t))return t},Ye=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:f}=B(n),g=f(s);return t[o]-e[r]-g[c]-M(s,l)},Pt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ue=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},Xe=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},We=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},_e=(t,e)=>{e.forEach(n=>{Ve(t,n)})},Ve=(t,e)=>{var s;var n=Xe(t);n.sheet&&(We(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},fe=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&He(t,`--${n}`,s)}},He=(t,e,n)=>t&&t.style.setProperty(e,n),de="startDrag",Nt="drag",jt="startDrop",qe="drop",at="temp-child",ge="cubic-bezier(0.2, 0, 0, 1)",ze=t=>t===qe||t===jt,Ht=t=>!t||t.length==0?0:zt(t.replace("px","")),je=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=zt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Ht(n)},Zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=je(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ze=t=>{const{top:e,left:n}=getComputedStyle(t);return[Ht(e),Ht(n)]},ke=(t,e)=>{const{gap:n}=B(e),[s,o]=Zt(t,n);return o?s:0};function yt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=Je(n,t,o,r);return ht(t,s)&&e==Nt&&(c=0,l=0),{height:c,width:l}}const Je=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:f}=B(t),g=M(e,o),m=M(e,r),b=M(s,r),[R,O]=Zt(e.parentElement,l),F=f(e)[c];if(O)return te(F,m,g,R,0,t);const[y,p,E]=Ke(n,b,g,m,o);return te(F,p,y,0,E,t)},Ke=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const f=M(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[r,c,l]},te=(t,e,n,s,o,r)=>Qe(r,t+e+n+s-o),Qe=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},ee=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=B(t),c=M(e,n),l=M(e,s),f=r(e)[o];return c+l+f},Ue=(t,e)=>{const[n,s]=Ze(e),o=ee(et,t);return[ee(_,t)-s,o-n]};function tn(t,e,n,s,o,r,c,l,f){let g=0,m=0;const b=!!(n<0&&f);if(n===s&&!b)return ne({height:g,width:m},t,o,c,b);const[R,O,F,y]=sn(e,n,s,f);if(b){const[nt,ut]=Ue(l,f);g+=ut,m+=nt}const{scrollElement:p,beforeMargin:E,afterMargin:L,distance:w,gap:P}=B(t),[X,Z]=Zt(l,P),[V,H,$]=rn(E,L,R,O==null?void 0:O.previousElementSibling,y,Z,b),[k,q,J]=on(E,L,w,F,X,Z),I=nn(q,k,J,H,V,X),z=b?l[p]:en(p,l,r),Y=(y?I-$:$-I)-z;return t===et?g+=Y:t===_&&(m+=Y),ne({height:g,width:m},t,o,c,b)}const en=(t,e,n)=>{const s=e[t],o=n[t];return s-o},nn=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},sn=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,b)=>m-b),l=t[e]??s,f=t[n];let g=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(g=t.slice(r+1,c)),[l,f,g,o]},on=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=M(s[0],t);let l=0,f=-c;for(const[g,m]of s.entries()){const b=m.getBoundingClientRect()[n],R=M(m,t);r&&(l+=R),r&&g>0?l+=o:l=Math.max(l,R),f+=l+b,l=M(m,e)}return[c,f,l]},ne=(t,e,n,s,o)=>{const{scroll:r,distance:c}=B(e),l=window[r],f=n[r],g=o?0:f-2*l+s[r];return t[c]+=g,t},rn=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return cn(t,e,l,n,r,c)},cn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=M(r?null:n,e),l=M(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},an=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},ln=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=B(t);return n[r]/(e[s]-e[o])},un="startDrag",pe="cubic-bezier(0.2, 0, 0, 1)",he=50,qt=t=>it(t)?t.classList.contains(at):!1,fn=(t,e,n)=>{let s=yt(e,un,n,t);const o=ke(t,n),{distance:r}=B(n);s[r]-=o;const[c,l]=dn(n,e);return s[l]=c,s},dn=(t,e)=>{const n=t==_?et:_,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},mt=(t,e,n)=>{Ne(t,e,n),t.style.minWidth=`${n}px`},gn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},pn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=ln(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:g}=B(r);c&&(n[g]=n[l]-n[f])},me=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(pn(n,e),o.querySelector(`.${at}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);tt(g,at),mt(g,0,0);const m=fn(o,t,c);return Pt(g,l,pe,"width, min-width, height"),[g,m,o]},Yt=(t,e,n,s,o)=>{const r=me(t,n,s);if(!r)return;const[c,l,f]=r;e.isSameNode(f)&&mt(c,l.height,l.width),kt(gn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},hn=(t,e,n)=>{const s=me(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),mn(o,r)},mn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Pt(t,0,pe,"width, min-width, height")})}),Sn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s+he)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+he)):t.removeChild(o)})},Dn=50;function vn(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:g,animationDuration:m,delayBeforeInsert:b,draggingClass:R}=t,O=(u,a,h,D,C)=>{if(!D)return;const{droppable:T,config:v}=D,A=yt(u,a,v.direction,T);ze(a)?Z(u,a,A,h,D,C):E(u,a,A,D)},F=(u,a,h,D,C)=>{const T=yt(a,"insert",t.direction,h),{onInsertEvent:v}=t,A=ce(h);for(const[N,x]of A.entries())st(x,U)&&N>=u&&X(x,T);C(),setTimeout(()=>{v(u,D),Se(u,h,t),nt(a),W(a,n),bt(n,0,!0)},b)},y=(u,a,h,D)=>{if(!h||!h.droppable||!h.config)return;const{droppable:C,config:T}=h;let[v]=Rt(a,C);v=[a,...v].toReversed();const A=yt(a,"remove",T.direction,C);for(const[N,x]of v.entries())N>=u&&(P(x,A),setTimeout(()=>{D(x)},m))},p=u=>{bt(n,m,!0),setTimeout(()=>{nt(u),W(u,n)},m)},E=(u,a,h,D)=>{const{config:C,droppable:T}=D,[v]=Rt(u,T),A=ht(u,T);v.length==0&&w(h,1,C.direction,v);for(const[N,x]of v.entries()){if(!st(x,U))continue;const G=L(C.direction,u,x,h);if(!A&&G)h=G;else if(!A)continue;const K=v.length-N;w(h,K,C.direction,v),a===de?P(x,h):a===Nt&&X(x,h)}},L=(u,a,h,D)=>{const{before:C,distance:T,axis:v,getRect:A}=B(u),N=A(a),x=A(h),G=N[C],K=x[C],St=x[T],ft=K+St/2,Dt=Be(h)[v],rt=ft-Dt;return G>rt?{height:0,width:0}:D},w=(u,a,h,D)=>{const C=D.filter(v=>st(v,U)).length,{distance:T}=B(h);u[T]==0?c=Math.max(c,a):c=Math.min(c,a-1),c=Math.min(c,C)},P=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h)},X=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h),Pt(u,m,ge)},Z=(u,a,h,D,C,T)=>{const{droppable:v,scroll:A,config:N}=C,[x,G]=Rt(u,v),K=x.toReversed(),St=G===-1?K.length:G;K.splice(St,0,u);const[ft,Dt,rt]=V(u,G,K,v);h=yt(u,a,N.direction,n,ft,Dt);const $t=xe(),xt=tn(N.direction,K,G,rt,$t,A,D,v,u);x.length==0&&H(void 0,h,u,xt);for(const[Gt,wt]of x.toReversed().entries()){let Bt=h;rt-1>=Gt&&(Bt={height:0,width:0}),a===jt&&!st(wt,at)&&H(wt,Bt,u,xt)}$(rt,u,N,v,T)},V=(u,a,h,D)=>{const T=ht(u,D)?a:c,v=()=>a<T?[T,T+1]:a>T?[T-1,T]:[T-1,T+1],[A,N]=v(),x=h[A]??null,G=h[N]??null;return[x,G,T]},H=(u,a,h,D)=>{Et(u,a.height,a.width),Et(h,D.height,D.width)},$=(u,a,h,D,C)=>{const{onInsertEvent:T,onDragEnd:v}=h;tt(a,_t),J(a,n,D,()=>{if(Ct(a,_t),C!=null){const A=g(C,!0);A!=null&&(T(u,A,!0),v({value:A,index:u})),q(a),k()}})},k=()=>{if(s){var u=document.querySelectorAll(`${pt(s)} > .${U}`);for(const a of u)Y(a)}},q=u=>{setTimeout(()=>{Ct(u,R)},Dn)},J=(u,a,h,D)=>{setTimeout(()=>{D&&D(),I(a,h),z(h),nt(u),W(u,a),W(u,h)},m)},I=(u,a)=>{u.isSameNode(a)?bt(u,m):(bt(u,m,!0),bt(a,m))},z=u=>{if(n.isSameNode(u))return;var[a]=n.querySelectorAll(`.${at}`);if(!a)return;const{distance:h}=B(l);it(a)&&(a.style[h]="0px")},W=(u,a)=>{const[h]=Rt(u,a);for(const D of[...h,u])Y(D)},Y=u=>{it(u)&&(u.style.transition="",u.style.transform="")},nt=u=>{r(),ot(u,!1),u.style.transform="",u.style.transition="",u.style.top="",u.style.left="",fe(u,{fixedHeight:"",fixedWidth:""})},ut=(u,a)=>{const h=a.querySelector(f);gt(document.body,oe,u),gt(h||a,Wt,u)},ot=(u,a)=>{gt(u,Ft,a),ut(a,u),o.toggleGrabClass(!a)};return[O,y,F,p,ot]}const bn=t=>t.addedNodes.values().filter(n=>!qt(n)).toArray().length>0,Se=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ce(e)[t];tt(l,s),tt(l,Kt),setTimeout(()=>{Ct(l,Kt),Ct(l,s),r.disconnect()},o)},e,{childList:!0},bn)},Tn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),Se(n,e,t)},r)},En=(t,e)=>{const n=(l,f)=>t.removeAtEvent(l,f),s=(l,f,g)=>t.insertEvent(l,f,g),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??et,handlerSelector:(e==null?void 0:e.handlerSelector)??U,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??c}},yn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:g,value:m}=f;r({index:g,value:e(m,s)})},onInsertEvent:(f,g)=>o(f,e(g,s),!0)}},Cn=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=f=>{t.style.transform=`translate( ${f.x}px, ${f.y}px)`},r=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,m,b)=>{const R=y=>{const{beforeMargin:p,borderBeforeWidth:E,before:L,offset:w,scroll:P,page:X,inner:Z,distance:V,axis:H,getRect:$}=B(y),k=m[X],q=window[P],J=window[Z],I=$(f)[V],z=M(f,E),W=M(f,p),Y=k-e[w],nt=ae(f,y);if(Y>=q-I/2&&Y<=q+J){const ot=Y-n[L]-z-W-q-nt;return O(y),ot}return s[H]},O=y=>{if(f&&st(f,Ft)&&y===b){const{before:p,distance:E,axis:L,getRect:w}=B(b),P=w(f)[E],X=w(g),Z=n[p]-X[p]+s[L],H=X[E]-P,$=Z/H,k=P/H,q=.1,J=.2,I=.8;let z=0;const W=ht(f,g);!W&&$<J&&$>-k?z=$/J-1:!W&&$>I&&$<1+k&&(z=1/(1-I)*($-I));const Y=q*P*z;an(g,b,Y)}},F=y=>{const{axis:p}=B(y);s[p]=R(y),o(s)};F(_),F(et)},(f,g)=>{const[m,b,R,O]=wn(f,g,t);n={top:m,left:b},r(n),e={offsetX:R,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=B(t);return r(e)[o]-r(n)[o]-M(n,s)},An=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=xn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(_,c,r),s+=Lt(et,c,r)),r&&e!=o&&(n+=Lt(_,r,e),s+=Lt(et,r,e)),[n,s]},xn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&n.isSameNode(e)?t:n},se=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:f}=B(t),g=ae(n,t);return e[c]-s[o]-M(n,r)-M(n,l)-window[f]-g},wn=(t,e,n)=>{const[s,o]=An(t,n);return[se(et,t,e,{offsetX:s,offsetY:o}),se(_,t,e,{offsetX:s,offsetY:o}),s,o]},Q=class Q{static addConfig(e,n){const s=Q.configs.filter(r=>!r.droppable.isSameNode(e)),o=Ut(e);s.push({droppable:e,config:n,scroll:o}),Q.configs=s}static updateScrolls(e,n){for(const s of Q.configs){const{droppable:o}=s;(n&&Ce(o,n)||o.isSameNode(e))&&(s.scroll=Ut(o))}}static getConfig(e){return Q.configs.find(({droppable:s})=>s.isSameNode(e))}};j(Q,"configs",[]),j(Q,"removeObsoleteConfigs",()=>{const e=Q.configs.filter(({droppable:n})=>document.contains(n));Q.configs=e});let lt=Q;class Bn{constructor(e,n,s,o,r,c){j(this,"initial");j(this,"current");j(this,"parent");j(this,"draggableElement");j(this,"groupClass");j(this,"dragEvent");j(this,"changeDroppable");j(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ue(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=lt.getConfig(e);if(n)return e.isSameNode(this.parent)?n:{...n,config:yn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function Rn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:g,draggingClass:m,removingClass:b,onRemoveAtEvent:R,droppableClass:O,onDragStart:F}=n,y=At(l).map(i=>`droppable-group-${i}`).join(" ");let p=0,E={scrollX:0,scrollY:0},L={pageX:0,pageY:0},w,P;const[X,Z]=Cn(t),[V,H,$,k,q]=vn(n,e,s,y,o,()=>p=0),J=()=>{tt(t,U)},I=i=>{tt(i,Mt),o.addSubscriber(i)},z=()=>{if(c(t)){const i=t.querySelector(r);I(i||t)}},W=()=>{z(),J()},Y=i=>{const d=i==null?void 0:i.querySelector(`.${Mt}`),S=d==null?void 0:d.parentElement;return d&&S&&st(S,Xt)&&!S.isSameNode(s)?null:d},nt=i=>{const d=Y(i)??i;d&&c(i)&&(It(d,"onmousedown",G("mousemove","mouseup")),It(d,"ontouchstart",G("touchmove","touchend"),S=>{P={x:S.touches[0].clientX,y:S.touches[0].clientY}}),ut(d)),i!=null&&i.isSameNode(d)||It(i,"onmousedown",K),tt(s,Xt)},ut=i=>{const d=i.querySelectorAll("img");Array.from(d).forEach(S=>{S.onmousedown=()=>!1})},ot=()=>{if(L.pageX==0&&L.pageY==0||!a.current)return;const{droppable:i,config:d}=a.current;X(t,i,L,d.direction),V(t,Nt,E,a.current)},u=(i,d)=>{d&&p==2&&!(i!=null&&i.droppable.isSameNode(d.droppable))&&V(t,Nt,E,d)},a=new Bn(t,y,s,ot,u,n.mapFrom),h=i=>{if(!a.current)return;const d=y?Array.from(document.querySelectorAll(pt(y))):[s];for(const S of d)S.classList.toggle(O,!i&&S.isSameNode(a.current.droppable))},D=(i,d=!1)=>{a.updateConfig(i);const S=a.isOutside(i);h(S),p===1&&!d?rt(i):p===2&&(C(S),xt(i))},C=(i=!0)=>{if(!a.current)return;const{droppable:d}=a.current;Sn(d,s,y,f,i),!i&&Yt(t,s,p==1,a.current)},T=i=>{if(Tt(i)&&P&&p==1){const d=Math.abs(i.touches[0].clientX-P.x),S=Math.abs(i.touches[0].clientY-P.y);if(Math.abs(d)>5&&Math.abs(S)>5)return clearTimeout(w),!1}return!0},v=i=>{clearTimeout(w);const d=Vt(i);if(Tt(i)&&i.cancelable&&i.preventDefault(),Tt(i)&&!i.cancelable||!T(i)){ft("touchmove",i);return}D(d,Tt(i))},A=(i,d)=>{i=="touchmove"?w=setTimeout(()=>{d()},150):d()},N=(i,d)=>{const{clientX:S,clientY:dt}=i,ct=document.elementFromPoint(S,dt),vt=ct==null?void 0:ct.closest(`.${U}`);return vt&&d.isSameNode(vt)},x=i=>{const d=n.onGetValue(e);return{index:e,element:i,value:d}},G=(i,d)=>S=>{if(!N(S,t))return;lt.updateScrolls(s,y);const{scrollX:dt,scrollY:ct}=window;if(E={scrollX:dt,scrollY:ct},p===0){p=1;const vt=x(t);vt&&F(vt),A(i,()=>{i=="touchmove"&&(a.updateConfig(S),h(a.isOutside(S)),rt(S))}),document.addEventListener(i,v,{passive:!1}),Gt(s),document.addEventListener(d,St(i),{once:!0})}},K=i=>a.updateConfig(i),St=i=>d=>{ft(i,d)},ft=(i,d)=>{h(!0);const S=Vt(d);Bt(a.isOutside(S,!1)),clearTimeout(w),document.removeEventListener(i,v),a.updateConfig(S);const dt=a.getCurrentConfig(S);if(dt){const{droppable:ct}=dt;Dt(ct)}s.onscroll=null},Dt=i=>{if(i.onscroll=null,!y)return;const d=Array.from(document.querySelectorAll(pt(y)));for(const S of d)it(S)&&(S.onscroll=null)},rt=i=>{Yt(t,s,p==1,a.current),$t(),V(t,de,E,a.current),De(t),Z(i,t)},$t=()=>{p=2},xt=i=>{const{pageX:d,pageY:S}=i;L={pageX:d,pageY:S},ot()},Gt=i=>ue(i,"onscroll",wt),wt=()=>ot(),Bt=i=>{if(p!==2&&p!==1){p=0;return}p=3,Jt(t),t.classList.contains(Ft)&&V(t,jt,E,i?a.initial:a.current,e)},Jt=i=>{Pt(i,f,ge),Et(i,0,0)},De=i=>{const{height:d,width:S}=i.getBoundingClientRect();fe(i,{fixedHeight:`${d}px`,fixedWidth:`${S}px`}),q(i,!0),gt(i,m,!0),i.style.transition=""},ve=(i,d)=>{Ct(t,b),Yt(t,s,p==1,a.initial),H(i,t,d,S=>{Jt(S),k(t)}),R(e,!0)},be=i=>{if(!a.initial)return;const d=a.initial;i==e&&(tt(t,b),setTimeout(()=>{ve(i,d)},g))},Te=(i,d)=>{(i===e||i===n.onGetLegth()&&e===i-1)&&$(i,t,s,d,()=>{hn(t,p==1,a.initial)})};return W(),nt(t),[be,Te]}const Ln=(t,e)=>{t&&Ae(e,t)},Mn=()=>{_e(document.body,[`.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${re}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ft}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${_t}{pointer-events:none!important;}`,`.${oe}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function On(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const f=At(l).map(g=>`droppable-group-${g}`).join(" ");Mn(),Ln(f,n);for(const g of n.children){const m=g.getAttribute(o),b=we(m),R=g;if(R&&b>=0){const[O,F]=Rn(R,b,t,n,e);r.push(O),c.push(F)}}return[r,c]}function Nn(t,e,n,s="index"){let o=[],r=[],c;const l=En(t,n),f=p=>{for(const E of o)E(p)},g=(p,E)=>{if(l.onGetLegth()===0)t.insertToListEmpty(l,p,E);else for(const w of r)w(p,E)},m=p=>{const[E,L]=On(l,e,p,s);o=E,r=L},b=p=>{const E=p.addedNodes.values().filter(w=>!qt(w)).toArray(),L=p.removedNodes.values().filter(w=>!qt(w)).toArray();return E.length>0||L.length>0},R=p=>{c=kt(()=>{m(p)},p,{childList:!0},b)},O=p=>{tt(p,Xt)},F=p=>{lt.addConfig(p,l)};return[f,g,p=>{if(p)return O(p),F(p),R(p),m(p),lt.removeObsoleteConfigs(),c}]}exports.GRAB_CLASS=re;exports.addClass=tt;exports.dragAndDrop=Nn;exports.insertToListEmpty=Tn;exports.toggleClass=gt;