fluid-dnd 1.0.6-beta.0 → 1.0.7-beta.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.
package/README.md CHANGED
@@ -1,22 +1,22 @@
1
1
  <h1 align="center">
2
- <img src="https://github.com/carlosjorger/vue-fluid-dnd/assets/50055316/dab15832-5290-42ca-b425-db177a2e589e" alt="Icon" width="150" height="140" />
2
+ <img src="https://github.com/carlosjorger/fluid-dnd/assets/50055316/dab15832-5290-42ca-b425-db177a2e589e" alt="Icon" width="150" height="140" />
3
3
  <br>Fluid DnD<br>
4
4
  </h1>
5
5
 
6
6
  <div align="center">
7
7
 
8
- ![npm bundle size](https://img.shields.io/bundlephobia/minzip/vue-fluid-dnd)
9
- [![license](https://img.shields.io/github/license/carlosjorger/vue-fluid-dnd?label=license)](https://github.com/carlosjorger/vue-fluid-dnd/blob/main/LICENSE)
10
- [![version](https://img.shields.io/npm/v/vue-fluid-dnd)](https://www.npmjs.com/package/fluid-dnd)
11
- ![GitHub issues](https://img.shields.io/github/issues/carlosjorger/vue-fluid-dnd)
12
- ![GitHub stars](https://img.shields.io/github/stars/carlosjorger/vue-fluid-dnd)
8
+ ![npm bundle size](https://img.shields.io/bundlephobia/minzip/fluid-dnd)
9
+ [![license](https://img.shields.io/github/license/carlosjorger/fluid-dnd?label=license)](https://github.com/carlosjorger/fluid-dnd/blob/main/LICENSE)
10
+ [![version](https://img.shields.io/npm/v/fluid-dnd)](https://www.npmjs.com/package/fluid-dnd)
11
+ ![GitHub issues](https://img.shields.io/github/issues/carlosjorger/fluid-dnd)
12
+ ![GitHub stars](https://img.shields.io/github/stars/carlosjorger/fluid-dnd)
13
13
  [![twitter](https://img.shields.io/twitter/follow/carlosjorgerc)](https://twitter.com/carlosjorgerc)
14
- [![test_coverage](https://api.codeclimate.com/v1/badges/6b27047dcf150ccddfac/test_coverage)](https://codeclimate.com/github/carlosjorger/vue-fluid-dnd/test_coverage)
14
+ [![test_coverage](https://api.codeclimate.com/v1/badges/6b27047dcf150ccddfac/test_coverage)](https://codeclimate.com/github/carlosjorger/fluid-dnd/test_coverage)
15
15
 
16
16
  </div>
17
17
 
18
18
  Fluid DnD is a [**fluid**, **agnostic** and **versatil** drag and drop
19
- library for lists with support for Vue 3 and Svelte](https://vue-fluid-dnd.netlify.app/). It's a**lightweight** tool ~7 Kb (gzip) with no depenencies.
19
+ library for lists with support for Vue 3 and Svelte](https://fluid-dnd.netlify.app/). It's a**lightweight** tool ~7 Kb (gzip) with no depenencies.
20
20
 
21
21
  <img src="https://github.com/user-attachments/assets/b350f9a4-7dd7-40ca-ae3f-ecca166a9081" width="100%"/>
22
22
 
@@ -52,14 +52,14 @@ library for lists with support for Vue 3 and Svelte](https://vue-fluid-dnd.netli
52
52
 
53
53
  3. **Documentation**
54
54
 
55
- - 📚 Check out all the [docs](https://vue-fluid-dnd.netlify.app/).
55
+ - 📚 Check out all the [docs](https://fluid-dnd.netlify.app/).
56
56
  - 🛠️ Edit the previous [here](https://codesandbox.io/s/nifty-hooks-5plkpl).
57
- - 📘 See others examples [here](https://vue-fluid-dnd.netlify.app/example/vertical-list/single-vertical-list/).
57
+ - 📘 See others examples [here](https://fluid-dnd.netlify.app/example/vertical-list/single-vertical-list/).
58
58
 
59
59
  ## 🤝 Contributing
60
60
 
61
- If you're interested in contributing to [vue-fluid-dnd](https://github.com/carlosjorger/vue-fluid-dnd), please read our contributing docs before submitting a pull request [CONTRIBUTING](./CONTRIBUTING.md).
61
+ If you're interested in contributing to [fluid-dnd](https://github.com/carlosjorger/fluid-dnd), please read our contributing docs before submitting a pull request [CONTRIBUTING](./CONTRIBUTING.md).
62
62
 
63
63
  ## 🔑 License
64
64
 
65
- - [MIT](https://github.com/carlosjorger/vue-fluid-dnd/blob/main/LICENSE).
65
+ - [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-D1rUx9iZ.js";
4
+ import { a as h, t as n, G as t } from "./index-B0MByO4j.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-GRcZUS5t.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-B6KgPfpv.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-GRcZUS5t.cjs");exports.dragAndDrop=e.dragAndDrop;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-B6KgPfpv.cjs");exports.dragAndDrop=e.dragAndDrop;
@@ -1,4 +1,4 @@
1
- import { d as o } from "../index-D1rUx9iZ.js";
1
+ import { d as o } from "../index-B0MByO4j.js";
2
2
  export {
3
3
  o as dragAndDrop
4
4
  };
@@ -1,29 +1,29 @@
1
1
  var he = Object.defineProperty;
2
2
  var me = (t, e, n) => e in t ? he(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var J = (t, e, n) => me(t, typeof e != "symbol" ? e + "" : e, n);
4
- const Q = "draggable", It = "droppable", Ot = "handler-class", _t = "dragging", Wt = "dragging-handler-class", Xt = "dropping", ne = "grabbing", Se = "grab", Zt = "disable-transition", et = (t, e) => t.classList.contains(e), bt = (t, e, n = !1) => {
4
+ const Q = "draggable", It = "droppable", Ot = "handler-class", _t = "dragging", Wt = "dragging-handler-class", Xt = "dropping", ne = "grabbing", Se = "grab", Zt = "disable-transition", et = (t, e) => t.classList.contains(e), vt = (t, e, n = !1) => {
5
5
  t.classList.toggle(e, n);
6
6
  }, nt = (t, e) => {
7
7
  t.classList.add(e);
8
8
  }, yt = (t, e) => {
9
9
  t.classList.remove(e);
10
- }, De = (t, e) => Ct(e).every(
10
+ }, De = (t, e) => Et(e).every(
11
11
  (n) => et(t, n)
12
- ), gt = (t) => t ? `.${Ct(t).join(".")}` : "", ve = (t, e) => {
12
+ ), gt = (t) => t ? `.${Et(t).join(".")}` : "", ve = (t, e) => {
13
13
  if (!e)
14
14
  return;
15
- const n = Ct(e);
15
+ const n = Et(e);
16
16
  t.classList.add(...n);
17
- }, Ct = (t) => t ? t.split(" ").filter((e) => e) : [], H = "horizontal", U = "vertical", be = () => {
17
+ }, Et = (t) => t ? t.split(" ").filter((e) => e) : [], H = "horizontal", U = "vertical", be = () => {
18
18
  const { scrollX: t, scrollY: e } = window;
19
19
  return { scrollX: t, scrollY: e };
20
- }, qt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), Te = (t) => t ? parseInt(t) : -1, Ee = (t) => {
20
+ }, qt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), Te = (t) => t ? parseInt(t) : -1, ye = (t) => {
21
21
  const e = getComputedStyle(t), n = new DOMMatrixReadOnly(e.transform);
22
22
  return {
23
23
  x: n.m41,
24
24
  y: n.m42
25
25
  };
26
- }, se = (t, e) => t.x1 > e.x1 ? se(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, dt = (t, e) => !ye(t, e), ye = (t, e) => {
26
+ }, se = (t, e) => t.x1 > e.x1 ? se(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, dt = (t, e) => !Ee(t, e), Ee = (t, e) => {
27
27
  const n = Mt(t), s = Mt(e), o = Jt(n, s, U), i = Jt(n, s, H);
28
28
  return o >= Math.min(n.height, s.height) / 2 && i >= Math.min(n.width, s.width) / 2;
29
29
  }, Jt = (t, e, n) => {
@@ -92,7 +92,7 @@ const Q = "draggable", It = "droppable", Ot = "handler-class", _t = "dragging",
92
92
  return o ? Mt(o)[n] + L(o, s) : 0;
93
93
  }, Yt = (t) => window.TouchEvent && t instanceof TouchEvent, at = (t) => t instanceof HTMLElement, ie = (t) => t instanceof MouseEvent, xe = ["onmouseup", "onmousedown", "onmousemove"], we = (t, e, n) => {
94
94
  t && (t.style.height = `${e}px`, t.style.width = `${n}px`);
95
- }, Tt = (t, e, n) => {
95
+ }, bt = (t, e, n) => {
96
96
  !t || !at(t) || (n == 0 && e == 0 ? t.style.transform = "" : t.style.transform = `translate(${n}px,${e}px)`);
97
97
  }, Be = (t, e, n) => {
98
98
  t[e] = (s) => {
@@ -132,14 +132,14 @@ const Q = "draggable", It = "droppable", Ot = "handler-class", _t = "dragging",
132
132
  const e = Me(t);
133
133
  if (!e)
134
134
  return Le(t);
135
- const [n, s] = Oe(t, e), { clientX: o, clientY: i, pageX: c, pageY: l, screenX: f, screenY: p, target: h } = e;
135
+ const [n, s] = Oe(t, e), { clientX: o, clientY: i, pageX: c, pageY: l, screenX: f, screenY: g, target: h } = e;
136
136
  return {
137
137
  clientX: o,
138
138
  clientY: i,
139
139
  pageX: c,
140
140
  pageY: l,
141
141
  screenX: f,
142
- screenY: p,
142
+ screenY: g,
143
143
  target: h,
144
144
  offsetX: n,
145
145
  offsetY: s
@@ -150,8 +150,8 @@ const Q = "draggable", It = "droppable", Ot = "handler-class", _t = "dragging",
150
150
  if (ie(t))
151
151
  return t;
152
152
  }, Pe = (t, e, n, s) => {
153
- const { page: o, scroll: i, before: c, borderBeforeWidth: l, getRect: f } = w(n), p = f(s);
154
- return t[o] - e[i] - p[c] - L(s, l);
153
+ const { page: o, scroll: i, before: c, borderBeforeWidth: l, getRect: f } = w(n), g = f(s);
154
+ return t[o] - e[i] - g[c] - L(s, l);
155
155
  }, Nt = (t, e, n = "ease-out", s = "transform") => {
156
156
  at(t) && (t.style.transitionDuration = `${e}ms`, t.style.transitionTimingFunction = `${n}`, t.style.transitionProperty = `${s}`);
157
157
  }, ce = (t, e, n) => {
@@ -208,7 +208,7 @@ const Q = "draggable", It = "droppable", Ot = "handler-class", _t = "dragging",
208
208
  const { gap: n } = w(e), [s, o] = jt(t, n);
209
209
  return o ? s : 0;
210
210
  };
211
- function Et(t, e, n, s, o = t.previousElementSibling, i = t.nextElementSibling) {
211
+ function Tt(t, e, n, s, o = t.previousElementSibling, i = t.nextElementSibling) {
212
212
  let { height: c, width: l } = _e(
213
213
  n,
214
214
  t,
@@ -224,16 +224,16 @@ const _e = (t, e, n, s) => {
224
224
  distance: c,
225
225
  gap: l,
226
226
  getRect: f
227
- } = w(t), p = L(e, o), h = L(e, i), b = L(s, i), [B, M] = jt(
227
+ } = w(t), g = L(e, o), h = L(e, i), b = L(s, i), [B, M] = jt(
228
228
  e.parentElement,
229
229
  l
230
230
  ), S = f(e)[c];
231
231
  if (M)
232
- return Qt(S, h, p, B, 0, t);
232
+ return Qt(S, h, g, B, 0, t);
233
233
  const [D, v, R] = qe(
234
234
  n,
235
235
  b,
236
- p,
236
+ g,
237
237
  h,
238
238
  o
239
239
  );
@@ -265,11 +265,11 @@ const _e = (t, e, n, s) => {
265
265
  ];
266
266
  };
267
267
  function ke(t, e, n, s, o, i, c, l, f) {
268
- let p = 0, h = 0;
268
+ let g = 0, h = 0;
269
269
  const b = !!(n < 0 && f);
270
270
  if (n === s && !b)
271
271
  return te(
272
- { height: p, width: h },
272
+ { height: g, width: h },
273
273
  t,
274
274
  o,
275
275
  c,
@@ -278,7 +278,7 @@ function ke(t, e, n, s, o, i, c, l, f) {
278
278
  const [B, M, S, D] = Ke(e, n, s, f);
279
279
  if (b) {
280
280
  const [tt, ot] = je(l, f);
281
- p += ot, h += tt;
281
+ g += ot, h += tt;
282
282
  }
283
283
  const {
284
284
  scrollElement: v,
@@ -313,8 +313,8 @@ function ke(t, e, n, s, o, i, c, l, f) {
313
313
  st,
314
314
  X
315
315
  ), j = b ? l[v] : Ze(v, l, i), $ = (D ? Y - P : P - Y) - j;
316
- return t === U ? p += $ : t === H && (h += $), te(
317
- { height: p, width: h },
316
+ return t === U ? g += $ : t === H && (h += $), te(
317
+ { height: g, width: h },
318
318
  t,
319
319
  o,
320
320
  c,
@@ -331,11 +331,11 @@ const Ze = (t, e, n) => {
331
331
  const o = e < n, [i, c] = [e, n].toSorted(
332
332
  (h, b) => h - b
333
333
  ), l = t[e] ?? s, f = t[n];
334
- let p = o ? t.slice(i + 1, c + 1) : t.slice(i, c);
335
- return i < 0 && s && (p = t.slice(i + 1, c)), [
334
+ let g = o ? t.slice(i + 1, c + 1) : t.slice(i, c);
335
+ return i < 0 && s && (g = t.slice(i + 1, c)), [
336
336
  l,
337
337
  f,
338
- p,
338
+ g,
339
339
  o
340
340
  ];
341
341
  }, Qe = (t, e, n, s, o, i) => {
@@ -343,14 +343,14 @@ const Ze = (t, e, n) => {
343
343
  return [0, 0, 0];
344
344
  const c = L(s[0], t);
345
345
  let l = 0, f = -c;
346
- for (const [p, h] of s.entries()) {
346
+ for (const [g, h] of s.entries()) {
347
347
  const b = h.getBoundingClientRect()[n], B = L(h, t);
348
- i && (l += B), i && p > 0 ? l += o : l = Math.max(l, B), f += l + b, l = L(h, e);
348
+ i && (l += B), i && g > 0 ? l += o : l = Math.max(l, B), f += l + b, l = L(h, e);
349
349
  }
350
350
  return [c, f, l];
351
351
  }, te = (t, e, n, s, o) => {
352
- const { scroll: i, distance: c } = w(e), l = window[i], f = n[i], p = o ? 0 : f - 2 * l + s[i];
353
- return t[c] += p, t;
352
+ const { scroll: i, distance: c } = w(e), l = window[i], f = n[i], g = o ? 0 : f - 2 * l + s[i];
353
+ return t[c] += g, t;
354
354
  }, Ue = (t, e, n, s, o, i, c) => {
355
355
  const l = o ? n.previousElementSibling : s;
356
356
  return tn(
@@ -372,9 +372,10 @@ const Ze = (t, e, n) => {
372
372
  return [c, l, f];
373
373
  }, kt = (t, e, n) => {
374
374
  const s = new MutationObserver((o) => {
375
- o.forEach((i) => {
375
+ if (o.length > 0) {
376
+ const i = o[0];
376
377
  t(s, i);
377
- });
378
+ }
378
379
  });
379
380
  return s.observe(e, n), s;
380
381
  }, en = (t, e, n) => {
@@ -383,7 +384,7 @@ const Ze = (t, e, n) => {
383
384
  const { scrollDistance: s, clientDistance: o, scrollElement: i } = w(t);
384
385
  return n[i] / (e[s] - e[o]);
385
386
  }, sn = "startDrag", fe = "cubic-bezier(0.2, 0, 0, 1)", on = (t, e, n) => {
386
- let s = Et(
387
+ let s = Tt(
387
388
  e,
388
389
  sn,
389
390
  n,
@@ -399,51 +400,53 @@ const Ze = (t, e, n) => {
399
400
  o(e)[s],
400
401
  s
401
402
  ];
402
- }, ht = (t, e, n) => {
403
+ }, Ct = (t, e, n) => {
403
404
  we(t, e, n), t.style.minWidth = `${n}px`;
404
- }, cn = (t, e, n) => (s) => {
405
- e.contains(t) && (ht(t, n.height, n.width), s.disconnect());
406
- }, an = (t, e) => {
405
+ }, cn = (t, e) => {
407
406
  if (!e)
408
407
  return;
409
- const { droppable: n, config: s, scroll: o } = t, { direction: i } = s, c = nn(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: f, scrollElement: p } = w(i);
410
- c && (n[p] = n[l] - n[f]);
408
+ const { droppable: n, config: s, scroll: o } = t, { direction: i } = s, c = nn(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: f, scrollElement: g } = w(i);
409
+ c && (n[g] = n[l] - n[f]);
411
410
  }, ge = (t, e, n, s) => {
412
411
  if (!n)
413
412
  return;
414
413
  const { droppable: o, config: i } = n, { direction: c, animationDuration: l } = i;
415
- if (an(n, e), o.querySelector(`.${pt}`) || !t)
414
+ if (cn(n, e), o.querySelector(`.${pt}`) || !t)
416
415
  return;
417
- var f = t.tagName == "LI" ? "DIV" : t.tagName, p = document.createElement(f);
418
- nt(p, pt), ht(p, 0, 0);
416
+ var f = t.tagName == "LI" ? "DIV" : t.tagName, g = document.createElement(f);
417
+ nt(g, pt), Ct(g, 0, 0);
419
418
  const h = on(o, t, c);
420
419
  return Nt(
421
- p,
420
+ g,
422
421
  l,
423
422
  fe,
424
423
  "width, min-width, height"
425
- ), [p, h, o];
424
+ ), [g, h, o];
426
425
  }, Gt = (t, e, n, s, o) => {
427
426
  const i = ge(t, n, s);
428
427
  if (!i)
429
428
  return;
430
429
  const [c, l, f] = i;
431
- e.isSameNode(f) && ht(c, l.height, l.width), kt(
432
- cn(c, f, l),
430
+ e.isSameNode(f) && Ct(c, l.height, l.width);
431
+ const g = kt(
432
+ () => {
433
+ g.disconnect();
434
+ },
433
435
  f,
434
436
  {
435
437
  childList: !0,
436
438
  subtree: !0
437
439
  }
438
- ), f.appendChild(c);
439
- }, ln = (t, e, n) => {
440
+ );
441
+ f.appendChild(c);
442
+ }, an = (t, e, n) => {
440
443
  const s = ge(t, e, n);
441
444
  if (!s)
442
445
  return;
443
446
  const [o, i, c] = s;
444
- c.appendChild(o), un(o, i);
445
- }, un = (t, e) => requestAnimationFrame(() => {
446
- ht(t, e.height, e.width), requestAnimationFrame(() => {
447
+ c.appendChild(o), ln(o, i);
448
+ }, ln = (t, e) => requestAnimationFrame(() => {
449
+ Ct(t, e.height, e.width), requestAnimationFrame(() => {
447
450
  Nt(
448
451
  t,
449
452
  0,
@@ -451,7 +454,7 @@ const Ze = (t, e, n) => {
451
454
  "width, min-width, height"
452
455
  );
453
456
  });
454
- }), fn = (t, e, n, s, o = !0) => {
457
+ }), un = (t, e, n, s, o = !0) => {
455
458
  if (n) {
456
459
  var i = document.querySelectorAll(
457
460
  `${gt(n)} > .${pt}`
@@ -460,43 +463,43 @@ const Ze = (t, e, n) => {
460
463
  const l = c.parentElement;
461
464
  if (l != null && l.isSameNode(e) || !o && (l != null && l.isSameNode(t)))
462
465
  return;
463
- ht(c, 0, 0), setTimeout(() => {
464
- var p;
465
- (p = c.parentNode) == null || p.removeChild(c);
466
+ Ct(c, 0, 0), setTimeout(() => {
467
+ var g;
468
+ (g = c.parentNode) == null || g.removeChild(c);
466
469
  }, s);
467
470
  });
468
471
  }
469
- }, vt = (t, e, n = !1) => {
472
+ }, Dt = (t, e, n = !1) => {
470
473
  var s = t.querySelectorAll(`.${pt}`);
471
474
  s.forEach((o) => {
472
- n ? (ht(o, 0, 0), setTimeout(() => {
475
+ n ? (Ct(o, 0, 0), setTimeout(() => {
473
476
  t.contains(o) && t.removeChild(o);
474
477
  }, e)) : t.removeChild(o);
475
478
  });
476
- }, gn = 50;
477
- function dn(t, e, n, s, o, i) {
479
+ }, fn = 50;
480
+ function gn(t, e, n, s, o, i) {
478
481
  let c = e;
479
482
  const {
480
483
  direction: l,
481
484
  handlerSelector: f,
482
- onRemoveAtEvent: p,
485
+ onRemoveAtEvent: g,
483
486
  animationDuration: h,
484
487
  delayBeforeInsert: b,
485
488
  draggingClass: B
486
- } = t, M = (r, u, g, m, C) => {
489
+ } = t, M = (r, u, d, m, C) => {
487
490
  if (!m)
488
491
  return;
489
- const { droppable: T, config: E } = m, A = Et(
492
+ const { droppable: T, config: y } = m, A = Tt(
490
493
  r,
491
494
  u,
492
- E.direction,
495
+ y.direction,
493
496
  T
494
497
  );
495
498
  Xe(u) ? F(
496
499
  r,
497
500
  u,
498
501
  A,
499
- g,
502
+ d,
500
503
  m,
501
504
  C
502
505
  ) : R(
@@ -505,100 +508,100 @@ function dn(t, e, n, s, o, i) {
505
508
  A,
506
509
  m
507
510
  );
508
- }, S = (r, u, g, m, C) => {
509
- const T = Et(
511
+ }, S = (r, u, d, m, C) => {
512
+ const T = Tt(
510
513
  u,
511
514
  "insert",
512
515
  t.direction,
513
- g
514
- ), { onInsertEvent: E } = t, A = oe(g);
516
+ d
517
+ ), { onInsertEvent: y } = t, A = oe(d);
515
518
  for (const [O, x] of A.entries())
516
519
  et(x, Q) && O >= r && X(x, T);
517
520
  C(), setTimeout(() => {
518
- E(r, m), vt(n, 0, !0), de(r, g, t), tt(u), V(u, n);
521
+ y(r, m), Dt(n, 0, !0), de(r, d, t), tt(u), V(u, n);
519
522
  }, b);
520
- }, D = (r, u, g, m) => {
521
- if (!g || !g.droppable || !g.config)
523
+ }, D = (r, u, d, m) => {
524
+ if (!d || !d.droppable || !d.config)
522
525
  return;
523
- const { droppable: C, config: T } = g;
524
- let [E] = Rt(u, C);
525
- E = [u, ...E].toReversed();
526
- const A = Et(
526
+ const { droppable: C, config: T } = d;
527
+ let [y] = Rt(u, C);
528
+ y = [u, ...y].toReversed();
529
+ const A = Tt(
527
530
  u,
528
531
  "remove",
529
532
  T.direction,
530
533
  C
531
534
  );
532
- for (const [O, x] of E.entries())
535
+ for (const [O, x] of y.entries())
533
536
  O >= r && (W(x, A), setTimeout(() => {
534
537
  m(x);
535
538
  }, h));
536
539
  }, v = (r) => {
537
- vt(n, h, !0), setTimeout(() => {
540
+ Dt(n, h, !0), setTimeout(() => {
538
541
  tt(r), V(r, n);
539
542
  }, h);
540
- }, R = (r, u, g, m) => {
541
- const { config: C, droppable: T } = m, [E] = Rt(r, T), A = dt(r, T);
542
- E.length == 0 && I(
543
- g,
543
+ }, R = (r, u, d, m) => {
544
+ const { config: C, droppable: T } = m, [y] = Rt(r, T), A = dt(r, T);
545
+ y.length == 0 && I(
546
+ d,
544
547
  1,
545
548
  C.direction,
546
- E
549
+ y
547
550
  );
548
- for (const [O, x] of E.entries()) {
551
+ for (const [O, x] of y.entries()) {
549
552
  if (!et(x, Q))
550
553
  continue;
551
554
  const G = N(
552
555
  C.direction,
553
556
  r,
554
557
  x,
555
- g
558
+ d
556
559
  );
557
560
  if (!A && G)
558
- g = G;
561
+ d = G;
559
562
  else if (!A)
560
563
  continue;
561
- const Z = E.length - O;
564
+ const Z = y.length - O;
562
565
  I(
563
- g,
566
+ d,
564
567
  Z,
565
568
  C.direction,
566
- E
567
- ), u === le ? W(x, g) : u === Pt && X(x, g);
569
+ y
570
+ ), u === le ? W(x, d) : u === Pt && X(x, d);
568
571
  }
569
- }, N = (r, u, g, m) => {
570
- const { before: C, distance: T, axis: E, getRect: A } = w(r), O = A(u), x = A(g), G = O[C], Z = x[C], ut = x[T], mt = Z + ut / 2, St = Ee(g)[E], ct = mt - St;
572
+ }, N = (r, u, d, m) => {
573
+ const { before: C, distance: T, axis: y, getRect: A } = w(r), O = A(u), x = A(d), G = O[C], Z = x[C], ut = x[T], ht = Z + ut / 2, mt = ye(d)[y], ct = ht - mt;
571
574
  return G > ct ? { height: 0, width: 0 } : m;
572
- }, I = (r, u, g, m) => {
575
+ }, I = (r, u, d, m) => {
573
576
  const C = m.filter(
574
- (E) => et(E, Q)
575
- ).length, { distance: T } = w(g);
577
+ (y) => et(y, Q)
578
+ ).length, { distance: T } = w(d);
576
579
  r[T] == 0 ? c = Math.max(c, u) : c = Math.min(c, u - 1), c = Math.min(c, C);
577
580
  }, W = (r, u) => {
578
- const { width: g, height: m } = u;
579
- Tt(r, m, g);
581
+ const { width: d, height: m } = u;
582
+ bt(r, m, d);
580
583
  }, X = (r, u) => {
581
- const { width: g, height: m } = u;
582
- Tt(r, m, g), Nt(r, h, ue);
583
- }, F = (r, u, g, m, C, T) => {
584
- const { droppable: E, scroll: A, config: O } = C, [x, G] = Rt(
584
+ const { width: d, height: m } = u;
585
+ bt(r, m, d), Nt(r, h, ue);
586
+ }, F = (r, u, d, m, C, T) => {
587
+ const { droppable: y, scroll: A, config: O } = C, [x, G] = Rt(
585
588
  r,
586
- E
589
+ y
587
590
  ), Z = x.toReversed(), ut = G === -1 ? Z.length : G;
588
591
  Z.splice(ut, 0, r);
589
- const [mt, St, ct] = st(
592
+ const [ht, mt, ct] = st(
590
593
  r,
591
594
  G,
592
595
  Z,
593
- E
596
+ y
594
597
  );
595
- g = Et(
598
+ d = Tt(
596
599
  r,
597
600
  u,
598
601
  O.direction,
599
602
  n,
600
- mt,
601
- St
603
+ ht,
604
+ mt
602
605
  );
603
606
  const Ft = be(), At = ke(
604
607
  O.direction,
@@ -608,17 +611,17 @@ function dn(t, e, n, s, o, i) {
608
611
  Ft,
609
612
  A,
610
613
  m,
611
- E,
614
+ y,
612
615
  r
613
616
  );
614
617
  x.length == 0 && _(
615
618
  void 0,
616
- g,
619
+ d,
617
620
  r,
618
621
  At
619
622
  );
620
623
  for (const [xt, wt] of x.toReversed().entries()) {
621
- let Bt = g;
624
+ let Bt = d;
622
625
  ct - 1 >= xt && (Bt = { height: 0, width: 0 }), u === zt && !et(wt, pt) && _(
623
626
  wt,
624
627
  Bt,
@@ -630,28 +633,28 @@ function dn(t, e, n, s, o, i) {
630
633
  ct,
631
634
  r,
632
635
  O,
633
- E,
636
+ y,
634
637
  T
635
638
  );
636
- }, st = (r, u, g, m) => {
637
- const T = dt(r, m) ? u : c, E = () => u < T ? [T, T + 1] : u > T ? [T - 1, T] : [T - 1, T + 1], [A, O] = E(), x = g[A] ?? null, G = g[O] ?? null;
639
+ }, st = (r, u, d, m) => {
640
+ const T = dt(r, m) ? u : c, y = () => u < T ? [T, T + 1] : u > T ? [T - 1, T] : [T - 1, T + 1], [A, O] = y(), x = d[A] ?? null, G = d[O] ?? null;
638
641
  return [
639
642
  x,
640
643
  G,
641
644
  T
642
645
  ];
643
- }, _ = (r, u, g, m) => {
644
- Tt(r, u.height, u.width), Tt(
645
- g,
646
+ }, _ = (r, u, d, m) => {
647
+ bt(r, u.height, u.width), bt(
648
+ d,
646
649
  m.height,
647
650
  m.width
648
651
  );
649
- }, P = (r, u, g, m, C) => {
650
- const { onInsertEvent: T, onDragEnd: E } = g;
652
+ }, P = (r, u, d, m, C) => {
653
+ const { onInsertEvent: T, onDragEnd: y } = d;
651
654
  nt(u, Xt), z(u, n, m, () => {
652
655
  if (yt(u, Xt), C != null) {
653
- const A = p(C);
654
- A != null && (T(r, A), E({ value: A, index: r })), q(u), k();
656
+ const A = g(C);
657
+ A != null && (T(r, A), y({ value: A, index: r })), q(u), k();
655
658
  }
656
659
  });
657
660
  }, k = () => {
@@ -665,24 +668,24 @@ function dn(t, e, n, s, o, i) {
665
668
  }, q = (r) => {
666
669
  setTimeout(() => {
667
670
  yt(r, B);
668
- }, gn);
669
- }, z = (r, u, g, m) => {
671
+ }, fn);
672
+ }, z = (r, u, d, m) => {
670
673
  setTimeout(() => {
671
- m && m(), Y(u, g), j(g), tt(r), V(r, u), V(r, g);
674
+ m && m(), Y(u, d), j(d), tt(r), V(r, u), V(r, d);
672
675
  }, h);
673
676
  }, Y = (r, u) => {
674
- r.isSameNode(u) ? vt(r, h) : (vt(r, h, !0), vt(u, h));
677
+ r.isSameNode(u) ? Dt(r, h) : (Dt(r, h, !0), Dt(u, h));
675
678
  }, j = (r) => {
676
679
  if (n.isSameNode(r))
677
680
  return;
678
681
  var [u] = n.querySelectorAll(`.${pt}`);
679
682
  if (!u)
680
683
  return;
681
- const { distance: g } = w(l);
682
- at(u) && (u.style[g] = "0px");
684
+ const { distance: d } = w(l);
685
+ at(u) && (u.style[d] = "0px");
683
686
  }, V = (r, u) => {
684
- const [g] = Rt(r, u);
685
- for (const m of [...g, r])
687
+ const [d] = Rt(r, u);
688
+ for (const m of [...d, r])
686
689
  $(m);
687
690
  }, $ = (r) => {
688
691
  at(r) && (r.style.transition = "", r.style.transform = "");
@@ -692,10 +695,10 @@ function dn(t, e, n, s, o, i) {
692
695
  fixedWidth: ""
693
696
  });
694
697
  }, ot = (r, u) => {
695
- const g = u.querySelector(f);
696
- bt(document.body, ne, r), bt(g || u, Wt, r);
698
+ const d = u.querySelector(f);
699
+ vt(document.body, ne, r), vt(d || u, Wt, r);
697
700
  }, lt = (r, u) => {
698
- bt(r, _t, u), ot(u, r), o.toggleGrabClass(!u);
701
+ vt(r, _t, u), ot(u, r), o.toggleGrabClass(!u);
699
702
  };
700
703
  return [
701
704
  M,
@@ -714,14 +717,14 @@ const de = (t, e, n) => {
714
717
  }, e, {
715
718
  childList: !0
716
719
  });
717
- }, Cn = (t, e, n, s) => {
720
+ }, En = (t, e, n, s) => {
718
721
  if (!e)
719
722
  return;
720
723
  const { onInsertEvent: o, delayBeforeInsert: i } = t;
721
724
  setTimeout(() => {
722
725
  o(n, s), de(n, e, t);
723
726
  }, i);
724
- }, pn = (t, e) => {
727
+ }, dn = (t, e) => {
725
728
  const n = (c) => t.removeAtEvent(c), s = (c, l) => t.insertEvent(c, l), o = () => t.getLength(), i = (c) => t.getValue(c);
726
729
  return {
727
730
  direction: (e == null ? void 0 : e.direction) ?? U,
@@ -744,7 +747,7 @@ const de = (t, e, n) => {
744
747
  delayBeforeRemove: (e == null ? void 0 : e.delayBeforeRemove) ?? 200,
745
748
  delayBeforeInsert: (e == null ? void 0 : e.delayBeforeInsert) ?? 200
746
749
  };
747
- }, hn = (t) => {
750
+ }, pn = (t) => {
748
751
  let e = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
749
752
  const o = (f) => {
750
753
  t.style.transform = `translate( ${f.x}px, ${f.y}px)`;
@@ -752,7 +755,7 @@ const de = (t, e, n) => {
752
755
  t.style.top = `${f.top}px`, t.style.left = `${f.left}px`;
753
756
  };
754
757
  return [
755
- (f, p, h, b) => {
758
+ (f, g, h, b) => {
756
759
  const B = (D) => {
757
760
  const {
758
761
  beforeMargin: v,
@@ -773,12 +776,12 @@ const de = (t, e, n) => {
773
776
  return s[_];
774
777
  }, M = (D) => {
775
778
  if (f && et(f, _t) && D === b) {
776
- const { before: v, distance: R, axis: N, getRect: I } = w(b), W = I(f)[R], X = I(p), F = n[v] - X[v] + s[N], _ = X[R] - W, P = F / _, k = W / _, q = 0.1, z = 0.2, Y = 0.8;
779
+ const { before: v, distance: R, axis: N, getRect: I } = w(b), W = I(f)[R], X = I(g), F = n[v] - X[v] + s[N], _ = X[R] - W, P = F / _, k = W / _, q = 0.1, z = 0.2, Y = 0.8;
777
780
  let j = 0;
778
- const V = dt(f, p);
781
+ const V = dt(f, g);
779
782
  !V && P < z && P > -k ? j = P / z - 1 : !V && P > Y && P < 1 + k && (j = 1 / (1 - Y) * (P - Y));
780
783
  const $ = q * W * j;
781
- en(p, b, $);
784
+ en(g, b, $);
782
785
  }
783
786
  }, S = (D) => {
784
787
  const { axis: v } = w(D);
@@ -786,10 +789,10 @@ const de = (t, e, n) => {
786
789
  };
787
790
  S(H), S(U);
788
791
  },
789
- (f, p) => {
790
- const [h, b, B, M] = Dn(
792
+ (f, g) => {
793
+ const [h, b, B, M] = Sn(
791
794
  f,
792
- p,
795
+ g,
793
796
  t
794
797
  );
795
798
  n = {
@@ -801,18 +804,18 @@ const de = (t, e, n) => {
801
804
  }, Lt = (t, e, n) => {
802
805
  const { borderBeforeWidth: s, before: o, getRect: i } = w(t);
803
806
  return i(e)[o] - i(n)[o] - L(n, s);
804
- }, mn = (t, e) => {
805
- let { offsetX: n, offsetY: s, target: o } = t, i = Sn(o, e);
807
+ }, hn = (t, e) => {
808
+ let { offsetX: n, offsetY: s, target: o } = t, i = mn(o, e);
806
809
  const c = o;
807
810
  return c && i && !c.isSameNode(i) && (n += Lt(H, c, i), s += Lt(U, c, i)), i && e != o && (n += Lt(H, i, e), s += Lt(U, i, e)), [n, s];
808
- }, Sn = (t, e) => {
811
+ }, mn = (t, e) => {
809
812
  const n = t == null ? void 0 : t.closest(`.${Ot}`);
810
813
  return n && n.isSameNode(e) ? t : n;
811
814
  }, ee = (t, e, n, s) => {
812
- const { offset: o, beforeMargin: i, page: c, borderBeforeWidth: l, scroll: f } = w(t), p = re(n, t);
813
- return e[c] - s[o] - L(n, i) - L(n, l) - window[f] - p;
814
- }, Dn = (t, e, n) => {
815
- const [s, o] = mn(t, n);
815
+ const { offset: o, beforeMargin: i, page: c, borderBeforeWidth: l, scroll: f } = w(t), g = re(n, t);
816
+ return e[c] - s[o] - L(n, i) - L(n, l) - window[f] - g;
817
+ }, Sn = (t, e, n) => {
818
+ const [s, o] = hn(t, n);
816
819
  return [
817
820
  ee(U, t, e, {
818
821
  offsetX: s,
@@ -855,7 +858,7 @@ J(K, "configs", []), J(K, "removeObsoleteConfigs", () => {
855
858
  K.configs = e;
856
859
  });
857
860
  let it = K;
858
- class vn {
861
+ class Dn {
859
862
  constructor(e, n, s, o, i) {
860
863
  J(this, "initial");
861
864
  J(this, "current");
@@ -925,24 +928,24 @@ class vn {
925
928
  return !this.getCurrent(s, e, n);
926
929
  }
927
930
  }
928
- function bn(t, e, n, s, o) {
931
+ function vn(t, e, n, s, o) {
929
932
  const {
930
933
  handlerSelector: i,
931
934
  isDraggable: c,
932
935
  droppableGroup: l,
933
936
  animationDuration: f,
934
- delayBeforeRemove: p,
937
+ delayBeforeRemove: g,
935
938
  draggingClass: h,
936
939
  removingClass: b,
937
940
  onRemoveAtEvent: B,
938
941
  droppableClass: M,
939
942
  onDragStart: S
940
- } = n, D = Ct(l).map((a) => `droppable-group-${a}`).join(" ");
943
+ } = n, D = Et(l).map((a) => `droppable-group-${a}`).join(" ");
941
944
  let v = 0, R = {
942
945
  scrollX: 0,
943
946
  scrollY: 0
944
947
  }, N = { pageX: 0, pageY: 0 }, I;
945
- const [W, X] = hn(
948
+ const [W, X] = pn(
946
949
  t
947
950
  ), [
948
951
  F,
@@ -950,7 +953,7 @@ function bn(t, e, n, s, o) {
950
953
  _,
951
954
  P,
952
955
  k
953
- ] = dn(
956
+ ] = gn(
954
957
  n,
955
958
  e,
956
959
  s,
@@ -981,42 +984,42 @@ function bn(t, e, n, s, o) {
981
984
  ".disable-transition{transition:none!important;}"
982
985
  ]), Y(), q();
983
986
  }, V = (a) => {
984
- const d = a == null ? void 0 : a.querySelector(`.${Ot}`), y = d == null ? void 0 : d.parentElement;
985
- return d && y && et(y, It) && !y.isSameNode(s) ? null : d;
987
+ const p = a == null ? void 0 : a.querySelector(`.${Ot}`), E = p == null ? void 0 : p.parentElement;
988
+ return p && E && et(E, It) && !E.isSameNode(s) ? null : p;
986
989
  }, $ = (a) => {
987
- const d = V(a) ?? a;
988
- d && c(a) && ($t(
989
- d,
990
+ const p = V(a) ?? a;
991
+ p && c(a) && ($t(
992
+ p,
990
993
  "onmousedown",
991
994
  O("mousemove", "mouseup")
992
995
  ), $t(
993
- d,
996
+ p,
994
997
  "ontouchstart",
995
998
  O("touchmove", "touchend")
996
- ), tt(d)), a != null && a.isSameNode(d) || $t(a, "onmousedown", x), nt(s, It);
999
+ ), tt(p)), a != null && a.isSameNode(p) || $t(a, "onmousedown", x), nt(s, It);
997
1000
  }, tt = (a) => {
998
- const d = a.querySelectorAll("img");
999
- Array.from(d).forEach((y) => {
1000
- y.onmousedown = () => !1;
1001
+ const p = a.querySelectorAll("img");
1002
+ Array.from(p).forEach((E) => {
1003
+ E.onmousedown = () => !1;
1001
1004
  });
1002
1005
  }, ot = () => {
1003
1006
  if (N.pageX == 0 && N.pageY == 0 || !r.current)
1004
1007
  return;
1005
- const { droppable: a, config: d } = r.current;
1006
- W(t, a, N, d.direction), F(
1008
+ const { droppable: a, config: p } = r.current;
1009
+ W(t, a, N, p.direction), F(
1007
1010
  t,
1008
1011
  Pt,
1009
1012
  R,
1010
1013
  r.current
1011
1014
  );
1012
- }, lt = (a, d) => {
1013
- d && v == 2 && !(a != null && a.droppable.isSameNode(d.droppable)) && F(
1015
+ }, lt = (a, p) => {
1016
+ p && v == 2 && !(a != null && a.droppable.isSameNode(p.droppable)) && F(
1014
1017
  t,
1015
1018
  Pt,
1016
1019
  R,
1017
- d
1020
+ p
1018
1021
  );
1019
- }, r = new vn(
1022
+ }, r = new Dn(
1020
1023
  t,
1021
1024
  D,
1022
1025
  s,
@@ -1025,24 +1028,24 @@ function bn(t, e, n, s, o) {
1025
1028
  ), u = (a) => {
1026
1029
  if (!r.current)
1027
1030
  return;
1028
- const d = D ? Array.from(
1031
+ const p = D ? Array.from(
1029
1032
  document.querySelectorAll(gt(D))
1030
1033
  ) : [s];
1031
- for (const y of d)
1032
- y.classList.toggle(
1034
+ for (const E of p)
1035
+ E.classList.toggle(
1033
1036
  M,
1034
- !a && y.isSameNode(r.current.droppable)
1037
+ !a && E.isSameNode(r.current.droppable)
1035
1038
  );
1036
- }, g = (a) => {
1039
+ }, d = (a) => {
1037
1040
  r.updateConfig(a);
1038
- const d = r.isOutside(a);
1039
- u(d), v === 1 ? ut(a) : v === 2 && (m(d), St(a));
1041
+ const p = r.isOutside(a);
1042
+ u(p), v === 1 ? ut(a) : v === 2 && (m(p), mt(a));
1040
1043
  }, m = (a = !0) => {
1041
1044
  if (!r.current)
1042
1045
  return;
1043
- const { droppable: d } = r.current;
1044
- fn(
1045
- d,
1046
+ const { droppable: p } = r.current;
1047
+ un(
1048
+ p,
1046
1049
  s,
1047
1050
  D,
1048
1051
  f,
@@ -1058,39 +1061,39 @@ function bn(t, e, n, s, o) {
1058
1061
  a.preventDefault();
1059
1062
  else if (Yt(a))
1060
1063
  return;
1061
- const d = Vt(a);
1062
- g(d);
1063
- }, T = (a, d) => {
1064
+ const p = Vt(a);
1065
+ d(p);
1066
+ }, T = (a, p) => {
1064
1067
  a == "touchmove" ? I = setTimeout(() => {
1065
- d();
1066
- }, 200) : d();
1067
- }, E = (a, d) => {
1068
- const { clientX: y, clientY: ft } = a, rt = document.elementFromPoint(y, ft), Dt = rt == null ? void 0 : rt.closest(`.${Q}`);
1069
- return rt && d && Dt && !d.isSameNode(Dt);
1068
+ p();
1069
+ }, 200) : p();
1070
+ }, y = (a, p) => {
1071
+ const { clientX: E, clientY: ft } = a, rt = document.elementFromPoint(E, ft), St = rt == null ? void 0 : rt.closest(`.${Q}`);
1072
+ return rt && p && St && !p.isSameNode(St);
1070
1073
  }, A = (a) => {
1071
- const d = n.onGetValue(e);
1072
- return { index: e, element: a, value: d };
1073
- }, O = (a, d) => (y) => {
1074
- if (E(y, t))
1074
+ const p = n.onGetValue(e);
1075
+ return { index: e, element: a, value: p };
1076
+ }, O = (a, p) => (E) => {
1077
+ if (y(E, t))
1075
1078
  return;
1076
1079
  it.updateScrolls(s, D);
1077
1080
  const { scrollX: ft, scrollY: rt } = window;
1078
1081
  if (R = { scrollX: ft, scrollY: rt }, v === 0) {
1079
1082
  v = 1;
1080
- const Dt = A(t);
1081
- Dt && S(Dt), T(a, () => {
1082
- a == "touchmove" && (r.updateConfig(y), u(r.isOutside(y)), ut(y)), document.addEventListener(a, C, {
1083
+ const St = A(t);
1084
+ St && S(St), T(a, () => {
1085
+ a == "touchmove" && (r.updateConfig(E), u(r.isOutside(E)), ut(E)), document.addEventListener(a, C, {
1083
1086
  passive: !1
1084
1087
  });
1085
- }), ct(s), document.addEventListener(d, G(a), {
1088
+ }), ct(s), document.addEventListener(p, G(a), {
1086
1089
  once: !0
1087
1090
  });
1088
1091
  }
1089
- }, x = (a) => r.updateConfig(a), G = (a) => (d) => {
1092
+ }, x = (a) => r.updateConfig(a), G = (a) => (p) => {
1090
1093
  u(!0);
1091
- const y = Vt(d);
1092
- clearTimeout(I), At(r.isOutside(y, !1)), document.removeEventListener(a, C), r.updateConfig(y);
1093
- const ft = r.getCurrentConfig(y);
1094
+ const E = Vt(p);
1095
+ clearTimeout(I), At(r.isOutside(E, !1)), document.removeEventListener(a, C), r.updateConfig(E);
1096
+ const ft = r.getCurrentConfig(E);
1094
1097
  if (ft) {
1095
1098
  const { droppable: rt } = ft;
1096
1099
  Z(rt);
@@ -1099,28 +1102,28 @@ function bn(t, e, n, s, o) {
1099
1102
  }, Z = (a) => {
1100
1103
  if (a.onscroll = null, !D)
1101
1104
  return;
1102
- const d = Array.from(
1105
+ const p = Array.from(
1103
1106
  document.querySelectorAll(gt(D))
1104
1107
  );
1105
- for (const y of d)
1106
- at(y) && (y.onscroll = null);
1108
+ for (const E of p)
1109
+ at(E) && (E.onscroll = null);
1107
1110
  }, ut = (a) => {
1108
1111
  Gt(
1109
1112
  t,
1110
1113
  s,
1111
1114
  v == 1,
1112
1115
  r.current
1113
- ), mt(), F(
1116
+ ), ht(), F(
1114
1117
  t,
1115
1118
  le,
1116
1119
  R,
1117
1120
  r.current
1118
1121
  ), wt(t), X(a, t);
1119
- }, mt = () => {
1122
+ }, ht = () => {
1120
1123
  v = 2;
1121
- }, St = (a) => {
1122
- const { pageX: d, pageY: y } = a;
1123
- N = { pageX: d, pageY: y }, ot();
1124
+ }, mt = (a) => {
1125
+ const { pageX: p, pageY: E } = a;
1126
+ N = { pageX: p, pageY: E }, ot();
1124
1127
  }, ct = (a) => ce(a, "onscroll", Ft), Ft = () => ot(), At = (a) => {
1125
1128
  if (v !== 2) {
1126
1129
  v = 0;
@@ -1134,17 +1137,17 @@ function bn(t, e, n, s, o) {
1134
1137
  e
1135
1138
  );
1136
1139
  }, xt = (a) => {
1137
- Nt(a, f, ue), Tt(a, 0, 0);
1140
+ Nt(a, f, ue), bt(a, 0, 0);
1138
1141
  }, wt = (a) => {
1139
- const { height: d, width: y } = a.getBoundingClientRect();
1142
+ const { height: p, width: E } = a.getBoundingClientRect();
1140
1143
  ae(a, {
1141
- fixedHeight: `${d}px`,
1142
- fixedWidth: `${y}px`
1143
- }), k(a, !0), bt(a, h, !0), a.style.transition = "";
1144
+ fixedHeight: `${p}px`,
1145
+ fixedWidth: `${E}px`
1146
+ }), k(a, !0), vt(a, h, !0), a.style.transition = "";
1144
1147
  }, Bt = (a) => {
1145
1148
  if (!r.initial)
1146
1149
  return;
1147
- const d = r.initial;
1150
+ const p = r.initial;
1148
1151
  a == e && (nt(t, b), setTimeout(() => {
1149
1152
  B(e), yt(t, b), Gt(
1150
1153
  t,
@@ -1154,20 +1157,20 @@ function bn(t, e, n, s, o) {
1154
1157
  ), st(
1155
1158
  a,
1156
1159
  t,
1157
- d,
1158
- (y) => {
1159
- xt(y), P(t);
1160
+ p,
1161
+ (E) => {
1162
+ xt(E), P(t);
1160
1163
  }
1161
1164
  );
1162
- }, p));
1163
- }, pe = (a, d) => {
1165
+ }, g));
1166
+ }, pe = (a, p) => {
1164
1167
  (a === e || a === n.onGetLegth() && e === a - 1) && _(
1165
1168
  a,
1166
1169
  t,
1167
1170
  s,
1168
- d,
1171
+ p,
1169
1172
  () => {
1170
- ln(
1173
+ an(
1171
1174
  t,
1172
1175
  v == 1,
1173
1176
  r.initial
@@ -1177,10 +1180,10 @@ function bn(t, e, n, s, o) {
1177
1180
  };
1178
1181
  return j(), $(t), [Bt, pe];
1179
1182
  }
1180
- const Tn = (t, e) => {
1183
+ const bn = (t, e) => {
1181
1184
  t && ve(e, t);
1182
1185
  };
1183
- function En(t, e, n, s = "index") {
1186
+ function Tn(t, e, n, s = "index") {
1184
1187
  const o = s;
1185
1188
  let i = [], c = [];
1186
1189
  const { droppableGroup: l } = t;
@@ -1189,12 +1192,12 @@ function En(t, e, n, s = "index") {
1189
1192
  i,
1190
1193
  c
1191
1194
  ];
1192
- const f = Ct(l).map((p) => `droppable-group-${p}`).join(" ");
1193
- Tn(f, n);
1194
- for (const p of n.children) {
1195
- const h = p.getAttribute(o), b = Te(h), B = p;
1195
+ const f = Et(l).map((g) => `droppable-group-${g}`).join(" ");
1196
+ bn(f, n);
1197
+ for (const g of n.children) {
1198
+ const h = g.getAttribute(o), b = Te(h), B = g;
1196
1199
  if (B && b >= 0) {
1197
- const [M, S] = bn(
1200
+ const [M, S] = vn(
1198
1201
  B,
1199
1202
  b,
1200
1203
  t,
@@ -1209,9 +1212,9 @@ function En(t, e, n, s = "index") {
1209
1212
  c
1210
1213
  ];
1211
1214
  }
1212
- function An(t, e, n, s = "index") {
1215
+ function Cn(t, e, n, s = "index") {
1213
1216
  let o = [], i = [];
1214
- const c = pn(t, n), l = (S) => {
1217
+ const c = dn(t, n), l = (S) => {
1215
1218
  for (const D of o)
1216
1219
  D(S);
1217
1220
  }, f = (S, D) => {
@@ -1220,13 +1223,13 @@ function An(t, e, n, s = "index") {
1220
1223
  else
1221
1224
  for (const R of i)
1222
1225
  R(S, D);
1223
- }, p = (S) => {
1224
- const [D, v] = En(c, e, S, s);
1226
+ }, g = (S) => {
1227
+ const [D, v] = Tn(c, e, S, s);
1225
1228
  o = D, i = v;
1226
1229
  }, h = (S) => {
1227
1230
  kt(
1228
1231
  () => {
1229
- p(S);
1232
+ g(S);
1230
1233
  },
1231
1234
  S,
1232
1235
  { childList: !0 }
@@ -1240,13 +1243,13 @@ function An(t, e, n, s = "index") {
1240
1243
  );
1241
1244
  };
1242
1245
  return [l, f, (S) => {
1243
- S && (b(S), B(S), h(S), p(S), it.removeObsoleteConfigs());
1246
+ S && (b(S), B(S), h(S), g(S), it.removeObsoleteConfigs());
1244
1247
  }];
1245
1248
  }
1246
1249
  export {
1247
1250
  Se as G,
1248
1251
  nt as a,
1249
- An as d,
1250
- Cn as i,
1251
- bt as t
1252
+ Cn as d,
1253
+ En as i,
1254
+ vt as t
1252
1255
  };
@@ -0,0 +1 @@
1
+ "use strict";var me=Object.defineProperty;var Se=(t,e,n)=>e in t?me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var J=(t,e,n)=>Se(t,typeof e!="symbol"?e+"":e,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Wt="dragging-handler-class",Xt="dropping",ne="grabbing",se="grab",Zt="disable-transition",nt=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},U=(t,e)=>{t.classList.add(e)},yt=(t,e)=>{t.classList.remove(e)},De=(t,e)=>Et(e).every(n=>nt(t,n)),dt=t=>t?`.${Et(t).join(".")}`:"",ve=(t,e)=>{if(!e)return;const n=Et(e);t.classList.add(...n)},Et=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",tt="vertical",be=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},qt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),Te=t=>t?parseInt(t):-1,ye=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},oe=(t,e)=>t.x1>e.x1?oe(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,pt=(t,e)=>!Ee(t,e),Ee=(t,e)=>{const n=Mt(t),s=Mt(e),o=Jt(n,s,tt),i=Jt(n,s,_);return o>=Math.min(n.height,s.height)/2&&i>=Math.min(n.width,s.width)/2},Jt=(t,e,n)=>{const{before:s,distance:o}=B(n);return oe({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},L=(t,e)=>t?qt(getComputedStyle(t)[e]):0,Kt=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Mt=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:Mt}},Rt=(t,e)=>Ce(t,e),re=t=>[...t.children].filter(n=>nt(n,Q)),Ce=(t,e)=>{const n=[...e.children].filter(o=>nt(o,Q)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ae=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ie=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Ae(t);return o?Mt(o)[n]+L(o,s):0},Yt=t=>window.TouchEvent&&t instanceof TouchEvent,at=t=>t instanceof HTMLElement,ce=t=>t instanceof MouseEvent,xe=["onmouseup","onmousedown","onmousemove"],Be=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},bt=(t,e,n)=>{!t||!at(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},we=(t,e,n)=>{t[e]=s=>{if(s.defaultPrevented)return;const o=Vt(s);n(o)}},$t=(t,e,n)=>{n&&(Re(e)?t[e]=n:we(t,e,n))},Re=t=>xe.includes(t),Le=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Oe=(t,e)=>{const n=(s,o)=>Pe(e,window,o,s);if(ce(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,tt)]}},Vt=t=>{const e=Me(t);if(!e)return Le(t);const[n,s]=Oe(t,e),{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:g,target:h}=e;return{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:g,target:h,offsetX:n,offsetY:s}},Me=t=>{if(Yt(t))return t.touches[0]??t.changedTouches[0];if(ce(t))return t},Pe=(t,e,n,s)=>{const{page:o,scroll:i,before:c,borderBeforeWidth:l,getRect:f}=B(n),g=f(s);return t[o]-e[i]-g[c]-L(s,l)},Nt=(t,e,n="ease-out",s="transform")=>{at(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ae=(t,e,n)=>{!t||!at(t)||(t[e]=()=>{n()})},Ne=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Fe=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[i]=o.cssText.match(n)||[];if(s===i)return!0}return!1},$e=(t,e)=>{e.forEach(n=>{Ge(t,n)})},Ge=(t,e)=>{var s;var n=Ne(t);n.sheet&&(Fe(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},le=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&Ie(t,`--${n}`,s)}},Ie=(t,e,n)=>t&&t.style.setProperty(e,n),ue="startDrag",Pt="drag",zt="startDrop",We="drop",ht="temp-child",fe="cubic-bezier(0.2, 0, 0, 1)",Xe=t=>t===We||t===zt,_t=t=>!t||t.length==0?0:qt(t.replace("px","")),Ye=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=qt(n.replace("%","")),{width:i}=t.getBoundingClientRect();return i*(o/100)}return _t(n)},jt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Ye(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ve=t=>{const{top:e,left:n}=getComputedStyle(t);return[_t(e),_t(n)]},_e=(t,e)=>{const{gap:n}=B(e),[s,o]=jt(t,n);return o?s:0};function Tt(t,e,n,s,o=t.previousElementSibling,i=t.nextElementSibling){let{height:c,width:l}=He(n,t,o,i);return pt(t,s)&&e==Pt&&(c=0,l=0),{height:c,width:l}}const He=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:i,distance:c,gap:l,getRect:f}=B(t),g=L(e,o),h=L(e,i),b=L(s,i),[w,M]=jt(e.parentElement,l),S=f(e)[c];if(M)return Qt(S,h,g,w,0,t);const[D,v,R]=qe(n,b,g,h,o);return Qt(S,v,D,0,R,t)},qe=(t,e,n,s,o)=>{const i=Math.max(e,n);let c=s,l=e;if(t){const f=L(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[i,c,l]},Qt=(t,e,n,s,o,i)=>ze(i,t+e+n+s-o),ze=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},Ut=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:i}=B(t),c=L(e,n),l=L(e,s),f=i(e)[o];return c+l+f},je=(t,e)=>{const[n,s]=Ve(e),o=Ut(tt,t);return[Ut(_,t)-s,o-n]};function ke(t,e,n,s,o,i,c,l,f){let g=0,h=0;const b=!!(n<0&&f);if(n===s&&!b)return te({height:g,width:h},t,o,c,b);const[w,M,S,D]=Ke(e,n,s,f);if(b){const[et,ot]=je(l,f);g+=ot,h+=et}const{scrollElement:v,beforeMargin:R,afterMargin:N,distance:I,gap:W}=B(t),[X,F]=jt(l,W),[st,H,P]=Ue(R,N,w,M==null?void 0:M.previousElementSibling,D,F,b),[k,q,z]=Qe(R,N,I,S,X,F),Y=Je(q,k,z,H,st,X),j=b?l[v]:Ze(v,l,i),$=(D?Y-P:P-Y)-j;return t===tt?g+=$:t===_&&(h+=$),te({height:g,width:h},t,o,c,b)}const Ze=(t,e,n)=>{const s=e[t],o=n[t];return s-o},Je=(t,e,n,s,o,i)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+i},Ke=(t,e,n,s)=>{const o=e<n,[i,c]=[e,n].toSorted((h,b)=>h-b),l=t[e]??s,f=t[n];let g=o?t.slice(i+1,c+1):t.slice(i,c);return i<0&&s&&(g=t.slice(i+1,c)),[l,f,g,o]},Qe=(t,e,n,s,o,i)=>{if(s.length==0)return[0,0,0];const c=L(s[0],t);let l=0,f=-c;for(const[g,h]of s.entries()){const b=h.getBoundingClientRect()[n],w=L(h,t);i&&(l+=w),i&&g>0?l+=o:l=Math.max(l,w),f+=l+b,l=L(h,e)}return[c,f,l]},te=(t,e,n,s,o)=>{const{scroll:i,distance:c}=B(e),l=window[i],f=n[i],g=o?0:f-2*l+s[i];return t[c]+=g,t},Ue=(t,e,n,s,o,i,c)=>{const l=o?n.previousElementSibling:s;return tn(t,e,l,n,i,c)},tn=(t,e,n,s,o,i)=>{if(o)return[0,0,0];const c=L(i?null:n,e),l=L(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n)=>{const s=new MutationObserver(o=>{if(o.length>0){const i=o[0];t(s,i)}});return s.observe(e,n),s},en=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},nn=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:i}=B(t);return n[i]/(e[s]-e[o])},sn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",on=(t,e,n)=>{let s=Tt(e,sn,n,t);const o=_e(t,n),{distance:i}=B(n);s[i]-=o;const[c,l]=rn(n,e);return s[l]=c,s},rn=(t,e)=>{const n=t==_?tt:_,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},Ct=(t,e,n)=>{Be(t,e,n),t.style.minWidth=`${n}px`},cn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:i}=s,c=nn(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:g}=B(i);c&&(n[g]=n[l]-n[f])},de=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:i}=n,{direction:c,animationDuration:l}=i;if(cn(n,e),o.querySelector(`.${ht}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);U(g,ht),Ct(g,0,0);const h=on(o,t,c);return Nt(g,l,ge,"width, min-width, height"),[g,h,o]},Gt=(t,e,n,s,o)=>{const i=de(t,n,s);if(!i)return;const[c,l,f]=i;e.isSameNode(f)&&Ct(c,l.height,l.width);const g=kt(()=>{g.disconnect()},f,{childList:!0,subtree:!0});f.appendChild(c)},an=(t,e,n)=>{const s=de(t,e,n);if(!s)return;const[o,i,c]=s;c.appendChild(o),ln(o,i)},ln=(t,e)=>requestAnimationFrame(()=>{Ct(t,e.height,e.width),requestAnimationFrame(()=>{Nt(t,0,ge,"width, min-width, height")})}),un=(t,e,n,s,o=!0)=>{if(n){var i=document.querySelectorAll(`${dt(n)} > .${ht}`);i.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;Ct(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s)})}},vt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${ht}`);s.forEach(o=>{n?(Ct(o,0,0),setTimeout(()=>{t.contains(o)&&t.removeChild(o)},e)):t.removeChild(o)})},fn=50;function gn(t,e,n,s,o,i){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:g,animationDuration:h,delayBeforeInsert:b,draggingClass:w}=t,M=(r,u,d,m,C)=>{if(!m)return;const{droppable:T,config:y}=m,A=Tt(r,u,y.direction,T);Xe(u)?F(r,u,A,d,m,C):R(r,u,A,m)},S=(r,u,d,m,C)=>{const T=Tt(u,"insert",t.direction,d),{onInsertEvent:y}=t,A=re(d);for(const[O,x]of A.entries())nt(x,Q)&&O>=r&&X(x,T);C(),setTimeout(()=>{y(r,m),vt(n,0,!0),pe(r,d,t),et(u),V(u,n)},b)},D=(r,u,d,m)=>{if(!d||!d.droppable||!d.config)return;const{droppable:C,config:T}=d;let[y]=Rt(u,C);y=[u,...y].toReversed();const A=Tt(u,"remove",T.direction,C);for(const[O,x]of y.entries())O>=r&&(W(x,A),setTimeout(()=>{m(x)},h))},v=r=>{vt(n,h,!0),setTimeout(()=>{et(r),V(r,n)},h)},R=(r,u,d,m)=>{const{config:C,droppable:T}=m,[y]=Rt(r,T),A=pt(r,T);y.length==0&&I(d,1,C.direction,y);for(const[O,x]of y.entries()){if(!nt(x,Q))continue;const G=N(C.direction,r,x,d);if(!A&&G)d=G;else if(!A)continue;const Z=y.length-O;I(d,Z,C.direction,y),u===ue?W(x,d):u===Pt&&X(x,d)}},N=(r,u,d,m)=>{const{before:C,distance:T,axis:y,getRect:A}=B(r),O=A(u),x=A(d),G=O[C],Z=x[C],ut=x[T],mt=Z+ut/2,St=ye(d)[y],ct=mt-St;return G>ct?{height:0,width:0}:m},I=(r,u,d,m)=>{const C=m.filter(y=>nt(y,Q)).length,{distance:T}=B(d);r[T]==0?c=Math.max(c,u):c=Math.min(c,u-1),c=Math.min(c,C)},W=(r,u)=>{const{width:d,height:m}=u;bt(r,m,d)},X=(r,u)=>{const{width:d,height:m}=u;bt(r,m,d),Nt(r,h,fe)},F=(r,u,d,m,C,T)=>{const{droppable:y,scroll:A,config:O}=C,[x,G]=Rt(r,y),Z=x.toReversed(),ut=G===-1?Z.length:G;Z.splice(ut,0,r);const[mt,St,ct]=st(r,G,Z,y);d=Tt(r,u,O.direction,n,mt,St);const Ft=be(),At=ke(O.direction,Z,G,ct,Ft,A,m,y,r);x.length==0&&H(void 0,d,r,At);for(const[xt,Bt]of x.toReversed().entries()){let wt=d;ct-1>=xt&&(wt={height:0,width:0}),u===zt&&!nt(Bt,ht)&&H(Bt,wt,r,At)}P(ct,r,O,y,T)},st=(r,u,d,m)=>{const T=pt(r,m)?u:c,y=()=>u<T?[T,T+1]:u>T?[T-1,T]:[T-1,T+1],[A,O]=y(),x=d[A]??null,G=d[O]??null;return[x,G,T]},H=(r,u,d,m)=>{bt(r,u.height,u.width),bt(d,m.height,m.width)},P=(r,u,d,m,C)=>{const{onInsertEvent:T,onDragEnd:y}=d;U(u,Xt),z(u,n,m,()=>{if(yt(u,Xt),C!=null){const A=g(C);A!=null&&(T(r,A),y({value:A,index:r})),q(u),k()}})},k=()=>{if(s){var r=document.querySelectorAll(`${dt(s)} > .${Q}`);for(const u of r)$(u)}},q=r=>{setTimeout(()=>{yt(r,w)},fn)},z=(r,u,d,m)=>{setTimeout(()=>{m&&m(),Y(u,d),j(d),et(r),V(r,u),V(r,d)},h)},Y=(r,u)=>{r.isSameNode(u)?vt(r,h):(vt(r,h,!0),vt(u,h))},j=r=>{if(n.isSameNode(r))return;var[u]=n.querySelectorAll(`.${ht}`);if(!u)return;const{distance:d}=B(l);at(u)&&(u.style[d]="0px")},V=(r,u)=>{const[d]=Rt(r,u);for(const m of[...d,r])$(m)},$=r=>{at(r)&&(r.style.transition="",r.style.transform="")},et=r=>{i(),lt(r,!1),r.style.transform="",r.style.transition="",r.style.top="",r.style.left="",le(r,{fixedHeight:"",fixedWidth:""})},ot=(r,u)=>{const d=u.querySelector(f);gt(document.body,ne,r),gt(d||u,Wt,r)},lt=(r,u)=>{gt(r,Ht,u),ot(u,r),o.toggleGrabClass(!u)};return[M,D,S,v,lt]}const pe=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,i=kt(()=>{const l=re(e)[t];U(l,s),U(l,Zt),setTimeout(()=>{yt(l,Zt),yt(l,s),i.disconnect()},o)},e,{childList:!0})},dn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:i}=t;setTimeout(()=>{o(n,s),pe(n,e,t)},i)},pn=(t,e)=>{const n=c=>t.removeAtEvent(c),s=(c,l)=>t.insertEvent(c,l),o=()=>t.getLength(),i=c=>t.getValue(c);return{direction:(e==null?void 0:e.direction)??tt,handlerSelector:(e==null?void 0:e.handlerSelector)??Q,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:i,animationDuration:(e==null?void 0:e.animationDuration)??150,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}},hn=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)`},i=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,h,b)=>{const w=D=>{const{beforeMargin:v,borderBeforeWidth:R,before:N,offset:I,scroll:W,page:X,inner:F,distance:st,axis:H,getRect:P}=B(D),k=h[X],q=window[W],z=window[F],Y=P(f)[st],j=L(f,R),V=L(f,v),$=k-e[I],et=ie(f,D);if($>=q-Y/2&&$<=q+z){const lt=$-n[N]-j-V-q-et;return M(D),lt}return s[H]},M=D=>{if(f&&nt(f,Ht)&&D===b){const{before:v,distance:R,axis:N,getRect:I}=B(b),W=I(f)[R],X=I(g),F=n[v]-X[v]+s[N],H=X[R]-W,P=F/H,k=W/H,q=.1,z=.2,Y=.8;let j=0;const V=pt(f,g);!V&&P<z&&P>-k?j=P/z-1:!V&&P>Y&&P<1+k&&(j=1/(1-Y)*(P-Y));const $=q*W*j;en(g,b,$)}},S=D=>{const{axis:v}=B(D);s[v]=w(D),o(s)};S(_),S(tt)},(f,g)=>{const[h,b,w,M]=Dn(f,g,t);n={top:h,left:b},i(n),e={offsetX:w,offsetY:M}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:i}=B(t);return i(e)[o]-i(n)[o]-L(n,s)},mn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,i=Sn(o,e);const c=o;return c&&i&&!c.isSameNode(i)&&(n+=Lt(_,c,i),s+=Lt(tt,c,i)),i&&e!=o&&(n+=Lt(_,i,e),s+=Lt(tt,i,e)),[n,s]},Sn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Ot}`);return n&&n.isSameNode(e)?t:n},ee=(t,e,n,s)=>{const{offset:o,beforeMargin:i,page:c,borderBeforeWidth:l,scroll:f}=B(t),g=ie(n,t);return e[c]-s[o]-L(n,i)-L(n,l)-window[f]-g},Dn=(t,e,n)=>{const[s,o]=mn(t,n);return[ee(tt,t,e,{offsetX:s,offsetY:o}),ee(_,t,e,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(e,n){const s=K.configs.filter(i=>!i.droppable.isSameNode(e)),o=Kt(e);s.push({droppable:e,config:n,scroll:o}),K.configs=s}static updateScrolls(e,n){for(const s of K.configs){const{droppable:o}=s;(n&&De(o,n)||o.isSameNode(e))&&(s.scroll=Kt(o))}}static getConfig(e){return K.configs.find(({droppable:s})=>s.isSameNode(e))}};J(K,"configs",[]),J(K,"removeObsoleteConfigs",()=>{const e=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=e});let it=K;class vn{constructor(e,n,s,o,i){J(this,"initial");J(this,"current");J(this,"parent");J(this,"draggableElement");J(this,"groupClass");J(this,"dragEvent");J(this,"changeDroppable");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.initial=s?it.getConfig(s):void 0,this.changeDroppable=i}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 i=null;return s?(e.hidden=!0,i=o(this),e.hidden=!1):i=o(this),i}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(dt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(dt(this.groupClass))):[this.parent]).every(s=>pt(e,s))}isNotInsideAnotherDroppable(e,n){return!pt(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ae(e,"onscroll",()=>{this.onScrollEvent()})}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?(at(s)&&!s.onscroll&&this.setOnScroll(s),it.getConfig(s)):it.getConfig(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 bn(t,e,n,s,o){const{handlerSelector:i,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:g,draggingClass:h,removingClass:b,onRemoveAtEvent:w,droppableClass:M,onDragStart:S}=n,D=Et(l).map(a=>`droppable-group-${a}`).join(" ");let v=0,R={scrollX:0,scrollY:0},N={pageX:0,pageY:0},I;const[W,X]=hn(t),[F,st,H,P,k]=gn(n,e,s,D,o,()=>v=0),q=()=>{U(t,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},Y=()=>{if(c(t)){const a=t.querySelector(i);z(a||t)}},j=()=>{$e(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${se}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${ne}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"]),Y(),q()},V=a=>{const p=a==null?void 0:a.querySelector(`.${Ot}`),E=p==null?void 0:p.parentElement;return p&&E&&nt(E,It)&&!E.isSameNode(s)?null:p},$=a=>{const p=V(a)??a;p&&c(a)&&($t(p,"onmousedown",O("mousemove","mouseup")),$t(p,"ontouchstart",O("touchmove","touchend")),et(p)),a!=null&&a.isSameNode(p)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const p=a.querySelectorAll("img");Array.from(p).forEach(E=>{E.onmousedown=()=>!1})},ot=()=>{if(N.pageX==0&&N.pageY==0||!r.current)return;const{droppable:a,config:p}=r.current;W(t,a,N,p.direction),F(t,Pt,R,r.current)},lt=(a,p)=>{p&&v==2&&!(a!=null&&a.droppable.isSameNode(p.droppable))&&F(t,Pt,R,p)},r=new vn(t,D,s,ot,lt),u=a=>{if(!r.current)return;const p=D?Array.from(document.querySelectorAll(dt(D))):[s];for(const E of p)E.classList.toggle(M,!a&&E.isSameNode(r.current.droppable))},d=a=>{r.updateConfig(a);const p=r.isOutside(a);u(p),v===1?ut(a):v===2&&(m(p),St(a))},m=(a=!0)=>{if(!r.current)return;const{droppable:p}=r.current;un(p,s,D,f,a),!a&&Gt(t,s,v==1,r.current)},C=a=>{if(Yt(a)&&a.cancelable)a.preventDefault();else if(Yt(a))return;const p=Vt(a);d(p)},T=(a,p)=>{a=="touchmove"?I=setTimeout(()=>{p()},200):p()},y=(a,p)=>{const{clientX:E,clientY:ft}=a,rt=document.elementFromPoint(E,ft),Dt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&p&&Dt&&!p.isSameNode(Dt)},A=a=>{const p=n.onGetValue(e);return{index:e,element:a,value:p}},O=(a,p)=>E=>{if(y(E,t))return;it.updateScrolls(s,D);const{scrollX:ft,scrollY:rt}=window;if(R={scrollX:ft,scrollY:rt},v===0){v=1;const Dt=A(t);Dt&&S(Dt),T(a,()=>{a=="touchmove"&&(r.updateConfig(E),u(r.isOutside(E)),ut(E)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(p,G(a),{once:!0})}},x=a=>r.updateConfig(a),G=a=>p=>{u(!0);const E=Vt(p);clearTimeout(I),At(r.isOutside(E,!1)),document.removeEventListener(a,C),r.updateConfig(E);const ft=r.getCurrentConfig(E);if(ft){const{droppable:rt}=ft;Z(rt)}s.onscroll=null},Z=a=>{if(a.onscroll=null,!D)return;const p=Array.from(document.querySelectorAll(dt(D)));for(const E of p)at(E)&&(E.onscroll=null)},ut=a=>{Gt(t,s,v==1,r.current),mt(),F(t,ue,R,r.current),Bt(t),X(a,t)},mt=()=>{v=2},St=a=>{const{pageX:p,pageY:E}=a;N={pageX:p,pageY:E},ot()},ct=a=>ae(a,"onscroll",Ft),Ft=()=>ot(),At=a=>{if(v!==2){v=0;return}v=3,xt(t),F(t,zt,R,a?r.initial:r.current,e)},xt=a=>{Nt(a,f,fe),bt(a,0,0)},Bt=a=>{const{height:p,width:E}=a.getBoundingClientRect();le(a,{fixedHeight:`${p}px`,fixedWidth:`${E}px`}),k(a,!0),gt(a,h,!0),a.style.transition=""},wt=a=>{if(!r.initial)return;const p=r.initial;a==e&&(U(t,b),setTimeout(()=>{w(e),yt(t,b),Gt(t,s,v==1,r.initial),st(a,t,p,E=>{xt(E),P(t)})},g))},he=(a,p)=>{(a===e||a===n.onGetLegth()&&e===a-1)&&H(a,t,s,p,()=>{an(t,v==1,r.initial)})};return j(),$(t),[wt,he]}const Tn=(t,e)=>{t&&ve(e,t)};function yn(t,e,n,s="index"){const o=s;let i=[],c=[];const{droppableGroup:l}=t;if(!n)return[i,c];const f=Et(l).map(g=>`droppable-group-${g}`).join(" ");Tn(f,n);for(const g of n.children){const h=g.getAttribute(o),b=Te(h),w=g;if(w&&b>=0){const[M,S]=bn(w,b,t,n,e);i.push(M),c.push(S)}}return[i,c]}function En(t,e,n,s="index"){let o=[],i=[];const c=pn(t,n),l=S=>{for(const D of o)D(S)},f=(S,D)=>{if(c.onGetLegth()===0)t.insertToListEmpty(c,S,D);else for(const R of i)R(S,D)},g=S=>{const[D,v]=yn(c,e,S,s);o=D,i=v},h=S=>{kt(()=>{g(S)},S,{childList:!0})},b=S=>{U(S,It)},w=S=>{it.addConfig(S,c)};return[l,f,S=>{S&&(b(S),w(S),h(S),g(S),it.removeObsoleteConfigs())}]}exports.GRAB_CLASS=se;exports.addClass=U;exports.dragAndDrop=En;exports.insertToListEmpty=dn;exports.toggleClass=gt;
@@ -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-Bd4_qrME.cjs"),o=require("../index-GRcZUS5t.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-D-RJfytA.cjs"),o=require("../index-B6KgPfpv.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-BbGTnlu0.js";
5
- import { i as m, d as u } from "../index-D1rUx9iZ.js";
4
+ import { H as c } from "../HandlerPublisher-BUubPiyW.js";
5
+ import { i as m, d as u } from "../index-B0MByO4j.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-Bd4_qrME.cjs"),u=require("../index-GRcZUS5t.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-D-RJfytA.cjs"),u=require("../index-B6KgPfpv.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-BbGTnlu0.js";
6
- import { i as p, d as v } from "../index-D1rUx9iZ.js";
5
+ import { H as h } from "../HandlerPublisher-BUubPiyW.js";
6
+ import { i as p, d as v } from "../index-B0MByO4j.js";
7
7
  const g = (n, t) => {
8
8
  const e = n.value;
9
9
  if (e.length <= 0)
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "fluid-dnd",
3
- "version": "1.0.6-beta.0",
3
+ "version": "1.0.7-beta.0",
4
4
  "description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue 3 and svelte",
5
5
  "type": "module",
6
- "homepage": "https://vue-fluid-dnd.netlify.app",
6
+ "homepage": "https://fluid-dnd.netlify.app",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/carlosjorger/vue-fluid-dnd.git"
9
+ "url": "https://github.com/carlosjorger/fluid-dnd.git"
10
10
  },
11
11
  "files": [
12
12
  "dist"
@@ -1 +0,0 @@
1
- "use strict";var me=Object.defineProperty;var Se=(t,e,n)=>e in t?me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var J=(t,e,n)=>Se(t,typeof e!="symbol"?e+"":e,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Wt="dragging-handler-class",Xt="dropping",ne="grabbing",se="grab",Zt="disable-transition",nt=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},U=(t,e)=>{t.classList.add(e)},yt=(t,e)=>{t.classList.remove(e)},De=(t,e)=>Ct(e).every(n=>nt(t,n)),dt=t=>t?`.${Ct(t).join(".")}`:"",ve=(t,e)=>{if(!e)return;const n=Ct(e);t.classList.add(...n)},Ct=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",tt="vertical",be=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},qt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),Te=t=>t?parseInt(t):-1,Ee=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},oe=(t,e)=>t.x1>e.x1?oe(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,pt=(t,e)=>!ye(t,e),ye=(t,e)=>{const n=Mt(t),s=Mt(e),o=Jt(n,s,tt),i=Jt(n,s,_);return o>=Math.min(n.height,s.height)/2&&i>=Math.min(n.width,s.width)/2},Jt=(t,e,n)=>{const{before:s,distance:o}=w(n);return oe({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},L=(t,e)=>t?qt(getComputedStyle(t)[e]):0,Kt=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Mt=t=>t.getBoundingClientRect(),w=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:Mt}},Rt=(t,e)=>Ce(t,e),re=t=>[...t.children].filter(n=>nt(n,Q)),Ce=(t,e)=>{const n=[...e.children].filter(o=>nt(o,Q)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ae=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ie=(t,e)=>{const{before:n,borderBeforeWidth:s}=w(e),o=Ae(t);return o?Mt(o)[n]+L(o,s):0},Yt=t=>window.TouchEvent&&t instanceof TouchEvent,at=t=>t instanceof HTMLElement,ce=t=>t instanceof MouseEvent,xe=["onmouseup","onmousedown","onmousemove"],we=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Tt=(t,e,n)=>{!t||!at(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Be=(t,e,n)=>{t[e]=s=>{if(s.defaultPrevented)return;const o=Vt(s);n(o)}},$t=(t,e,n)=>{n&&(Re(e)?t[e]=n:Be(t,e,n))},Re=t=>xe.includes(t),Le=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Oe=(t,e)=>{const n=(s,o)=>Pe(e,window,o,s);if(ce(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,tt)]}},Vt=t=>{const e=Me(t);if(!e)return Le(t);const[n,s]=Oe(t,e),{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:p,target:h}=e;return{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:p,target:h,offsetX:n,offsetY:s}},Me=t=>{if(Yt(t))return t.touches[0]??t.changedTouches[0];if(ce(t))return t},Pe=(t,e,n,s)=>{const{page:o,scroll:i,before:c,borderBeforeWidth:l,getRect:f}=w(n),p=f(s);return t[o]-e[i]-p[c]-L(s,l)},Nt=(t,e,n="ease-out",s="transform")=>{at(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ae=(t,e,n)=>{!t||!at(t)||(t[e]=()=>{n()})},Ne=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Fe=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[i]=o.cssText.match(n)||[];if(s===i)return!0}return!1},$e=(t,e)=>{e.forEach(n=>{Ge(t,n)})},Ge=(t,e)=>{var s;var n=Ne(t);n.sheet&&(Fe(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},le=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&Ie(t,`--${n}`,s)}},Ie=(t,e,n)=>t&&t.style.setProperty(e,n),ue="startDrag",Pt="drag",zt="startDrop",We="drop",ht="temp-child",fe="cubic-bezier(0.2, 0, 0, 1)",Xe=t=>t===We||t===zt,_t=t=>!t||t.length==0?0:qt(t.replace("px","")),Ye=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=qt(n.replace("%","")),{width:i}=t.getBoundingClientRect();return i*(o/100)}return _t(n)},jt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Ye(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ve=t=>{const{top:e,left:n}=getComputedStyle(t);return[_t(e),_t(n)]},_e=(t,e)=>{const{gap:n}=w(e),[s,o]=jt(t,n);return o?s:0};function Et(t,e,n,s,o=t.previousElementSibling,i=t.nextElementSibling){let{height:c,width:l}=He(n,t,o,i);return pt(t,s)&&e==Pt&&(c=0,l=0),{height:c,width:l}}const He=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:i,distance:c,gap:l,getRect:f}=w(t),p=L(e,o),h=L(e,i),b=L(s,i),[B,M]=jt(e.parentElement,l),S=f(e)[c];if(M)return Qt(S,h,p,B,0,t);const[D,v,R]=qe(n,b,p,h,o);return Qt(S,v,D,0,R,t)},qe=(t,e,n,s,o)=>{const i=Math.max(e,n);let c=s,l=e;if(t){const f=L(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[i,c,l]},Qt=(t,e,n,s,o,i)=>ze(i,t+e+n+s-o),ze=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},Ut=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:i}=w(t),c=L(e,n),l=L(e,s),f=i(e)[o];return c+l+f},je=(t,e)=>{const[n,s]=Ve(e),o=Ut(tt,t);return[Ut(_,t)-s,o-n]};function ke(t,e,n,s,o,i,c,l,f){let p=0,h=0;const b=!!(n<0&&f);if(n===s&&!b)return te({height:p,width:h},t,o,c,b);const[B,M,S,D]=Ke(e,n,s,f);if(b){const[et,ot]=je(l,f);p+=ot,h+=et}const{scrollElement:v,beforeMargin:R,afterMargin:N,distance:I,gap:W}=w(t),[X,F]=jt(l,W),[st,H,P]=Ue(R,N,B,M==null?void 0:M.previousElementSibling,D,F,b),[k,q,z]=Qe(R,N,I,S,X,F),Y=Je(q,k,z,H,st,X),j=b?l[v]:Ze(v,l,i),$=(D?Y-P:P-Y)-j;return t===tt?p+=$:t===_&&(h+=$),te({height:p,width:h},t,o,c,b)}const Ze=(t,e,n)=>{const s=e[t],o=n[t];return s-o},Je=(t,e,n,s,o,i)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+i},Ke=(t,e,n,s)=>{const o=e<n,[i,c]=[e,n].toSorted((h,b)=>h-b),l=t[e]??s,f=t[n];let p=o?t.slice(i+1,c+1):t.slice(i,c);return i<0&&s&&(p=t.slice(i+1,c)),[l,f,p,o]},Qe=(t,e,n,s,o,i)=>{if(s.length==0)return[0,0,0];const c=L(s[0],t);let l=0,f=-c;for(const[p,h]of s.entries()){const b=h.getBoundingClientRect()[n],B=L(h,t);i&&(l+=B),i&&p>0?l+=o:l=Math.max(l,B),f+=l+b,l=L(h,e)}return[c,f,l]},te=(t,e,n,s,o)=>{const{scroll:i,distance:c}=w(e),l=window[i],f=n[i],p=o?0:f-2*l+s[i];return t[c]+=p,t},Ue=(t,e,n,s,o,i,c)=>{const l=o?n.previousElementSibling:s;return tn(t,e,l,n,i,c)},tn=(t,e,n,s,o,i)=>{if(o)return[0,0,0];const c=L(i?null:n,e),l=L(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n)=>{const s=new MutationObserver(o=>{o.forEach(i=>{t(s,i)})});return s.observe(e,n),s},en=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},nn=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:i}=w(t);return n[i]/(e[s]-e[o])},sn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",on=(t,e,n)=>{let s=Et(e,sn,n,t);const o=_e(t,n),{distance:i}=w(n);s[i]-=o;const[c,l]=rn(n,e);return s[l]=c,s},rn=(t,e)=>{const n=t==_?tt:_,{distance:s,getRect:o}=w(n);return[o(e)[s],s]},mt=(t,e,n)=>{we(t,e,n),t.style.minWidth=`${n}px`},cn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},an=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:i}=s,c=nn(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:p}=w(i);c&&(n[p]=n[l]-n[f])},de=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:i}=n,{direction:c,animationDuration:l}=i;if(an(n,e),o.querySelector(`.${ht}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,p=document.createElement(f);U(p,ht),mt(p,0,0);const h=on(o,t,c);return Nt(p,l,ge,"width, min-width, height"),[p,h,o]},Gt=(t,e,n,s,o)=>{const i=de(t,n,s);if(!i)return;const[c,l,f]=i;e.isSameNode(f)&&mt(c,l.height,l.width),kt(cn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},ln=(t,e,n)=>{const s=de(t,e,n);if(!s)return;const[o,i,c]=s;c.appendChild(o),un(o,i)},un=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Nt(t,0,ge,"width, min-width, height")})}),fn=(t,e,n,s,o=!0)=>{if(n){var i=document.querySelectorAll(`${dt(n)} > .${ht}`);i.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 p;(p=c.parentNode)==null||p.removeChild(c)},s)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${ht}`);s.forEach(o=>{n?(mt(o,0,0),setTimeout(()=>{t.contains(o)&&t.removeChild(o)},e)):t.removeChild(o)})},gn=50;function dn(t,e,n,s,o,i){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:p,animationDuration:h,delayBeforeInsert:b,draggingClass:B}=t,M=(r,u,g,m,C)=>{if(!m)return;const{droppable:T,config:E}=m,A=Et(r,u,E.direction,T);Xe(u)?F(r,u,A,g,m,C):R(r,u,A,m)},S=(r,u,g,m,C)=>{const T=Et(u,"insert",t.direction,g),{onInsertEvent:E}=t,A=re(g);for(const[O,x]of A.entries())nt(x,Q)&&O>=r&&X(x,T);C(),setTimeout(()=>{E(r,m),bt(n,0,!0),pe(r,g,t),et(u),V(u,n)},b)},D=(r,u,g,m)=>{if(!g||!g.droppable||!g.config)return;const{droppable:C,config:T}=g;let[E]=Rt(u,C);E=[u,...E].toReversed();const A=Et(u,"remove",T.direction,C);for(const[O,x]of E.entries())O>=r&&(W(x,A),setTimeout(()=>{m(x)},h))},v=r=>{bt(n,h,!0),setTimeout(()=>{et(r),V(r,n)},h)},R=(r,u,g,m)=>{const{config:C,droppable:T}=m,[E]=Rt(r,T),A=pt(r,T);E.length==0&&I(g,1,C.direction,E);for(const[O,x]of E.entries()){if(!nt(x,Q))continue;const G=N(C.direction,r,x,g);if(!A&&G)g=G;else if(!A)continue;const Z=E.length-O;I(g,Z,C.direction,E),u===ue?W(x,g):u===Pt&&X(x,g)}},N=(r,u,g,m)=>{const{before:C,distance:T,axis:E,getRect:A}=w(r),O=A(u),x=A(g),G=O[C],Z=x[C],ut=x[T],St=Z+ut/2,Dt=Ee(g)[E],ct=St-Dt;return G>ct?{height:0,width:0}:m},I=(r,u,g,m)=>{const C=m.filter(E=>nt(E,Q)).length,{distance:T}=w(g);r[T]==0?c=Math.max(c,u):c=Math.min(c,u-1),c=Math.min(c,C)},W=(r,u)=>{const{width:g,height:m}=u;Tt(r,m,g)},X=(r,u)=>{const{width:g,height:m}=u;Tt(r,m,g),Nt(r,h,fe)},F=(r,u,g,m,C,T)=>{const{droppable:E,scroll:A,config:O}=C,[x,G]=Rt(r,E),Z=x.toReversed(),ut=G===-1?Z.length:G;Z.splice(ut,0,r);const[St,Dt,ct]=st(r,G,Z,E);g=Et(r,u,O.direction,n,St,Dt);const Ft=be(),At=ke(O.direction,Z,G,ct,Ft,A,m,E,r);x.length==0&&H(void 0,g,r,At);for(const[xt,wt]of x.toReversed().entries()){let Bt=g;ct-1>=xt&&(Bt={height:0,width:0}),u===zt&&!nt(wt,ht)&&H(wt,Bt,r,At)}P(ct,r,O,E,T)},st=(r,u,g,m)=>{const T=pt(r,m)?u:c,E=()=>u<T?[T,T+1]:u>T?[T-1,T]:[T-1,T+1],[A,O]=E(),x=g[A]??null,G=g[O]??null;return[x,G,T]},H=(r,u,g,m)=>{Tt(r,u.height,u.width),Tt(g,m.height,m.width)},P=(r,u,g,m,C)=>{const{onInsertEvent:T,onDragEnd:E}=g;U(u,Xt),z(u,n,m,()=>{if(yt(u,Xt),C!=null){const A=p(C);A!=null&&(T(r,A),E({value:A,index:r})),q(u),k()}})},k=()=>{if(s){var r=document.querySelectorAll(`${dt(s)} > .${Q}`);for(const u of r)$(u)}},q=r=>{setTimeout(()=>{yt(r,B)},gn)},z=(r,u,g,m)=>{setTimeout(()=>{m&&m(),Y(u,g),j(g),et(r),V(r,u),V(r,g)},h)},Y=(r,u)=>{r.isSameNode(u)?bt(r,h):(bt(r,h,!0),bt(u,h))},j=r=>{if(n.isSameNode(r))return;var[u]=n.querySelectorAll(`.${ht}`);if(!u)return;const{distance:g}=w(l);at(u)&&(u.style[g]="0px")},V=(r,u)=>{const[g]=Rt(r,u);for(const m of[...g,r])$(m)},$=r=>{at(r)&&(r.style.transition="",r.style.transform="")},et=r=>{i(),lt(r,!1),r.style.transform="",r.style.transition="",r.style.top="",r.style.left="",le(r,{fixedHeight:"",fixedWidth:""})},ot=(r,u)=>{const g=u.querySelector(f);gt(document.body,ne,r),gt(g||u,Wt,r)},lt=(r,u)=>{gt(r,Ht,u),ot(u,r),o.toggleGrabClass(!u)};return[M,D,S,v,lt]}const pe=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,i=kt(()=>{const l=re(e)[t];U(l,s),U(l,Zt),setTimeout(()=>{yt(l,Zt),yt(l,s),i.disconnect()},o)},e,{childList:!0})},pn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:i}=t;setTimeout(()=>{o(n,s),pe(n,e,t)},i)},hn=(t,e)=>{const n=c=>t.removeAtEvent(c),s=(c,l)=>t.insertEvent(c,l),o=()=>t.getLength(),i=c=>t.getValue(c);return{direction:(e==null?void 0:e.direction)??tt,handlerSelector:(e==null?void 0:e.handlerSelector)??Q,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:i,animationDuration:(e==null?void 0:e.animationDuration)??150,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}},mn=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)`},i=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,p,h,b)=>{const B=D=>{const{beforeMargin:v,borderBeforeWidth:R,before:N,offset:I,scroll:W,page:X,inner:F,distance:st,axis:H,getRect:P}=w(D),k=h[X],q=window[W],z=window[F],Y=P(f)[st],j=L(f,R),V=L(f,v),$=k-e[I],et=ie(f,D);if($>=q-Y/2&&$<=q+z){const lt=$-n[N]-j-V-q-et;return M(D),lt}return s[H]},M=D=>{if(f&&nt(f,Ht)&&D===b){const{before:v,distance:R,axis:N,getRect:I}=w(b),W=I(f)[R],X=I(p),F=n[v]-X[v]+s[N],H=X[R]-W,P=F/H,k=W/H,q=.1,z=.2,Y=.8;let j=0;const V=pt(f,p);!V&&P<z&&P>-k?j=P/z-1:!V&&P>Y&&P<1+k&&(j=1/(1-Y)*(P-Y));const $=q*W*j;en(p,b,$)}},S=D=>{const{axis:v}=w(D);s[v]=B(D),o(s)};S(_),S(tt)},(f,p)=>{const[h,b,B,M]=vn(f,p,t);n={top:h,left:b},i(n),e={offsetX:B,offsetY:M}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:i}=w(t);return i(e)[o]-i(n)[o]-L(n,s)},Sn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,i=Dn(o,e);const c=o;return c&&i&&!c.isSameNode(i)&&(n+=Lt(_,c,i),s+=Lt(tt,c,i)),i&&e!=o&&(n+=Lt(_,i,e),s+=Lt(tt,i,e)),[n,s]},Dn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Ot}`);return n&&n.isSameNode(e)?t:n},ee=(t,e,n,s)=>{const{offset:o,beforeMargin:i,page:c,borderBeforeWidth:l,scroll:f}=w(t),p=ie(n,t);return e[c]-s[o]-L(n,i)-L(n,l)-window[f]-p},vn=(t,e,n)=>{const[s,o]=Sn(t,n);return[ee(tt,t,e,{offsetX:s,offsetY:o}),ee(_,t,e,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(e,n){const s=K.configs.filter(i=>!i.droppable.isSameNode(e)),o=Kt(e);s.push({droppable:e,config:n,scroll:o}),K.configs=s}static updateScrolls(e,n){for(const s of K.configs){const{droppable:o}=s;(n&&De(o,n)||o.isSameNode(e))&&(s.scroll=Kt(o))}}static getConfig(e){return K.configs.find(({droppable:s})=>s.isSameNode(e))}};J(K,"configs",[]),J(K,"removeObsoleteConfigs",()=>{const e=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=e});let it=K;class bn{constructor(e,n,s,o,i){J(this,"initial");J(this,"current");J(this,"parent");J(this,"draggableElement");J(this,"groupClass");J(this,"dragEvent");J(this,"changeDroppable");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.initial=s?it.getConfig(s):void 0,this.changeDroppable=i}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 i=null;return s?(e.hidden=!0,i=o(this),e.hidden=!1):i=o(this),i}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(dt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(dt(this.groupClass))):[this.parent]).every(s=>pt(e,s))}isNotInsideAnotherDroppable(e,n){return!pt(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ae(e,"onscroll",()=>{this.onScrollEvent()})}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?(at(s)&&!s.onscroll&&this.setOnScroll(s),it.getConfig(s)):it.getConfig(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 Tn(t,e,n,s,o){const{handlerSelector:i,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:p,draggingClass:h,removingClass:b,onRemoveAtEvent:B,droppableClass:M,onDragStart:S}=n,D=Ct(l).map(a=>`droppable-group-${a}`).join(" ");let v=0,R={scrollX:0,scrollY:0},N={pageX:0,pageY:0},I;const[W,X]=mn(t),[F,st,H,P,k]=dn(n,e,s,D,o,()=>v=0),q=()=>{U(t,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},Y=()=>{if(c(t)){const a=t.querySelector(i);z(a||t)}},j=()=>{$e(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${se}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${ne}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"]),Y(),q()},V=a=>{const d=a==null?void 0:a.querySelector(`.${Ot}`),y=d==null?void 0:d.parentElement;return d&&y&&nt(y,It)&&!y.isSameNode(s)?null:d},$=a=>{const d=V(a)??a;d&&c(a)&&($t(d,"onmousedown",O("mousemove","mouseup")),$t(d,"ontouchstart",O("touchmove","touchend")),et(d)),a!=null&&a.isSameNode(d)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const d=a.querySelectorAll("img");Array.from(d).forEach(y=>{y.onmousedown=()=>!1})},ot=()=>{if(N.pageX==0&&N.pageY==0||!r.current)return;const{droppable:a,config:d}=r.current;W(t,a,N,d.direction),F(t,Pt,R,r.current)},lt=(a,d)=>{d&&v==2&&!(a!=null&&a.droppable.isSameNode(d.droppable))&&F(t,Pt,R,d)},r=new bn(t,D,s,ot,lt),u=a=>{if(!r.current)return;const d=D?Array.from(document.querySelectorAll(dt(D))):[s];for(const y of d)y.classList.toggle(M,!a&&y.isSameNode(r.current.droppable))},g=a=>{r.updateConfig(a);const d=r.isOutside(a);u(d),v===1?ut(a):v===2&&(m(d),Dt(a))},m=(a=!0)=>{if(!r.current)return;const{droppable:d}=r.current;fn(d,s,D,f,a),!a&&Gt(t,s,v==1,r.current)},C=a=>{if(Yt(a)&&a.cancelable)a.preventDefault();else if(Yt(a))return;const d=Vt(a);g(d)},T=(a,d)=>{a=="touchmove"?I=setTimeout(()=>{d()},200):d()},E=(a,d)=>{const{clientX:y,clientY:ft}=a,rt=document.elementFromPoint(y,ft),vt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&d&&vt&&!d.isSameNode(vt)},A=a=>{const d=n.onGetValue(e);return{index:e,element:a,value:d}},O=(a,d)=>y=>{if(E(y,t))return;it.updateScrolls(s,D);const{scrollX:ft,scrollY:rt}=window;if(R={scrollX:ft,scrollY:rt},v===0){v=1;const vt=A(t);vt&&S(vt),T(a,()=>{a=="touchmove"&&(r.updateConfig(y),u(r.isOutside(y)),ut(y)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(d,G(a),{once:!0})}},x=a=>r.updateConfig(a),G=a=>d=>{u(!0);const y=Vt(d);clearTimeout(I),At(r.isOutside(y,!1)),document.removeEventListener(a,C),r.updateConfig(y);const ft=r.getCurrentConfig(y);if(ft){const{droppable:rt}=ft;Z(rt)}s.onscroll=null},Z=a=>{if(a.onscroll=null,!D)return;const d=Array.from(document.querySelectorAll(dt(D)));for(const y of d)at(y)&&(y.onscroll=null)},ut=a=>{Gt(t,s,v==1,r.current),St(),F(t,ue,R,r.current),wt(t),X(a,t)},St=()=>{v=2},Dt=a=>{const{pageX:d,pageY:y}=a;N={pageX:d,pageY:y},ot()},ct=a=>ae(a,"onscroll",Ft),Ft=()=>ot(),At=a=>{if(v!==2){v=0;return}v=3,xt(t),F(t,zt,R,a?r.initial:r.current,e)},xt=a=>{Nt(a,f,fe),Tt(a,0,0)},wt=a=>{const{height:d,width:y}=a.getBoundingClientRect();le(a,{fixedHeight:`${d}px`,fixedWidth:`${y}px`}),k(a,!0),gt(a,h,!0),a.style.transition=""},Bt=a=>{if(!r.initial)return;const d=r.initial;a==e&&(U(t,b),setTimeout(()=>{B(e),yt(t,b),Gt(t,s,v==1,r.initial),st(a,t,d,y=>{xt(y),P(t)})},p))},he=(a,d)=>{(a===e||a===n.onGetLegth()&&e===a-1)&&H(a,t,s,d,()=>{ln(t,v==1,r.initial)})};return j(),$(t),[Bt,he]}const En=(t,e)=>{t&&ve(e,t)};function yn(t,e,n,s="index"){const o=s;let i=[],c=[];const{droppableGroup:l}=t;if(!n)return[i,c];const f=Ct(l).map(p=>`droppable-group-${p}`).join(" ");En(f,n);for(const p of n.children){const h=p.getAttribute(o),b=Te(h),B=p;if(B&&b>=0){const[M,S]=Tn(B,b,t,n,e);i.push(M),c.push(S)}}return[i,c]}function Cn(t,e,n,s="index"){let o=[],i=[];const c=hn(t,n),l=S=>{for(const D of o)D(S)},f=(S,D)=>{if(c.onGetLegth()===0)t.insertToListEmpty(c,S,D);else for(const R of i)R(S,D)},p=S=>{const[D,v]=yn(c,e,S,s);o=D,i=v},h=S=>{kt(()=>{p(S)},S,{childList:!0})},b=S=>{U(S,It)},B=S=>{it.addConfig(S,c)};return[l,f,S=>{S&&(b(S),B(S),h(S),p(S),it.removeObsoleteConfigs())}]}exports.GRAB_CLASS=se;exports.addClass=U;exports.dragAndDrop=Cn;exports.insertToListEmpty=pn;exports.toggleClass=gt;