@jackbo_vip/admin-kit 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1630 +0,0 @@
1
- /**!
2
- * Sortable 1.15.6
3
- * @author RubaXa <trash@rubaxa.org>
4
- * @author owenm <owen23355@gmail.com>
5
- * @license MIT
6
- */
7
- function _e(o, t) {
8
- var e = Object.keys(o);
9
- if (Object.getOwnPropertySymbols) {
10
- var n = Object.getOwnPropertySymbols(o);
11
- t && (n = n.filter(function(i) {
12
- return Object.getOwnPropertyDescriptor(o, i).enumerable;
13
- })), e.push.apply(e, n);
14
- }
15
- return e;
16
- }
17
- function Q(o) {
18
- for (var t = 1; t < arguments.length; t++) {
19
- var e = arguments[t] != null ? arguments[t] : {};
20
- t % 2 ? _e(Object(e), !0).forEach(function(n) {
21
- Ve(o, n, e[n]);
22
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(e)) : _e(Object(e)).forEach(function(n) {
23
- Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(e, n));
24
- });
25
- }
26
- return o;
27
- }
28
- function zt(o) {
29
- "@babel/helpers - typeof";
30
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? zt = function(t) {
31
- return typeof t;
32
- } : zt = function(t) {
33
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
34
- }, zt(o);
35
- }
36
- function Ve(o, t, e) {
37
- return t in o ? Object.defineProperty(o, t, {
38
- value: e,
39
- enumerable: !0,
40
- configurable: !0,
41
- writable: !0
42
- }) : o[t] = e, o;
43
- }
44
- function $() {
45
- return $ = Object.assign || function(o) {
46
- for (var t = 1; t < arguments.length; t++) {
47
- var e = arguments[t];
48
- for (var n in e)
49
- Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);
50
- }
51
- return o;
52
- }, $.apply(this, arguments);
53
- }
54
- function Ze(o, t) {
55
- if (o == null) return {};
56
- var e = {}, n = Object.keys(o), i, r;
57
- for (r = 0; r < n.length; r++)
58
- i = n[r], !(t.indexOf(i) >= 0) && (e[i] = o[i]);
59
- return e;
60
- }
61
- function Qe(o, t) {
62
- if (o == null) return {};
63
- var e = Ze(o, t), n, i;
64
- if (Object.getOwnPropertySymbols) {
65
- var r = Object.getOwnPropertySymbols(o);
66
- for (i = 0; i < r.length; i++)
67
- n = r[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (e[n] = o[n]);
68
- }
69
- return e;
70
- }
71
- function Je(o) {
72
- return tn(o) || en(o) || nn(o) || on();
73
- }
74
- function tn(o) {
75
- if (Array.isArray(o)) return he(o);
76
- }
77
- function en(o) {
78
- if (typeof Symbol < "u" && o[Symbol.iterator] != null || o["@@iterator"] != null) return Array.from(o);
79
- }
80
- function nn(o, t) {
81
- if (o) {
82
- if (typeof o == "string") return he(o, t);
83
- var e = Object.prototype.toString.call(o).slice(8, -1);
84
- if (e === "Object" && o.constructor && (e = o.constructor.name), e === "Map" || e === "Set") return Array.from(o);
85
- if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return he(o, t);
86
- }
87
- }
88
- function he(o, t) {
89
- (t == null || t > o.length) && (t = o.length);
90
- for (var e = 0, n = new Array(t); e < t; e++) n[e] = o[e];
91
- return n;
92
- }
93
- function on() {
94
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
95
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
96
- }
97
- var rn = "1.15.6";
98
- function et(o) {
99
- if (typeof window < "u" && window.navigator)
100
- return !!/* @__PURE__ */ navigator.userAgent.match(o);
101
- }
102
- var nt = et(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Xt = et(/Edge/i), Ce = et(/firefox/i), Pt = et(/safari/i) && !et(/chrome/i) && !et(/android/i), be = et(/iP(ad|od|hone)/i), Re = et(/chrome/i) && et(/android/i), ke = {
103
- capture: !1,
104
- passive: !1
105
- };
106
- function y(o, t, e) {
107
- o.addEventListener(t, e, !nt && ke);
108
- }
109
- function b(o, t, e) {
110
- o.removeEventListener(t, e, !nt && ke);
111
- }
112
- function Zt(o, t) {
113
- if (t) {
114
- if (t[0] === ">" && (t = t.substring(1)), o)
115
- try {
116
- if (o.matches)
117
- return o.matches(t);
118
- if (o.msMatchesSelector)
119
- return o.msMatchesSelector(t);
120
- if (o.webkitMatchesSelector)
121
- return o.webkitMatchesSelector(t);
122
- } catch {
123
- return !1;
124
- }
125
- return !1;
126
- }
127
- }
128
- function Xe(o) {
129
- return o.host && o !== document && o.host.nodeType ? o.host : o.parentNode;
130
- }
131
- function G(o, t, e, n) {
132
- if (o) {
133
- e = e || document;
134
- do {
135
- if (t != null && (t[0] === ">" ? o.parentNode === e && Zt(o, t) : Zt(o, t)) || n && o === e)
136
- return o;
137
- if (o === e) break;
138
- } while (o = Xe(o));
139
- }
140
- return null;
141
- }
142
- var Oe = /\s+/g;
143
- function I(o, t, e) {
144
- if (o && t)
145
- if (o.classList)
146
- o.classList[e ? "add" : "remove"](t);
147
- else {
148
- var n = (" " + o.className + " ").replace(Oe, " ").replace(" " + t + " ", " ");
149
- o.className = (n + (e ? " " + t : "")).replace(Oe, " ");
150
- }
151
- }
152
- function h(o, t, e) {
153
- var n = o && o.style;
154
- if (n) {
155
- if (e === void 0)
156
- return document.defaultView && document.defaultView.getComputedStyle ? e = document.defaultView.getComputedStyle(o, "") : o.currentStyle && (e = o.currentStyle), t === void 0 ? e : e[t];
157
- !(t in n) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), n[t] = e + (typeof e == "string" ? "" : "px");
158
- }
159
- }
160
- function ht(o, t) {
161
- var e = "";
162
- if (typeof o == "string")
163
- e = o;
164
- else
165
- do {
166
- var n = h(o, "transform");
167
- n && n !== "none" && (e = n + " " + e);
168
- } while (!t && (o = o.parentNode));
169
- var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
170
- return i && new i(e);
171
- }
172
- function Ye(o, t, e) {
173
- if (o) {
174
- var n = o.getElementsByTagName(t), i = 0, r = n.length;
175
- if (e)
176
- for (; i < r; i++)
177
- e(n[i], i);
178
- return n;
179
- }
180
- return [];
181
- }
182
- function Z() {
183
- var o = document.scrollingElement;
184
- return o || document.documentElement;
185
- }
186
- function O(o, t, e, n, i) {
187
- if (!(!o.getBoundingClientRect && o !== window)) {
188
- var r, a, l, s, u, d, c;
189
- if (o !== window && o.parentNode && o !== Z() ? (r = o.getBoundingClientRect(), a = r.top, l = r.left, s = r.bottom, u = r.right, d = r.height, c = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, c = window.innerWidth), (t || e) && o !== window && (i = i || o.parentNode, !nt))
190
- do
191
- if (i && i.getBoundingClientRect && (h(i, "transform") !== "none" || e && h(i, "position") !== "static")) {
192
- var p = i.getBoundingClientRect();
193
- a -= p.top + parseInt(h(i, "border-top-width")), l -= p.left + parseInt(h(i, "border-left-width")), s = a + r.height, u = l + r.width;
194
- break;
195
- }
196
- while (i = i.parentNode);
197
- if (n && o !== window) {
198
- var D = ht(i || o), w = D && D.a, S = D && D.d;
199
- D && (a /= S, l /= w, c /= w, d /= S, s = a + d, u = l + c);
200
- }
201
- return {
202
- top: a,
203
- left: l,
204
- bottom: s,
205
- right: u,
206
- width: c,
207
- height: d
208
- };
209
- }
210
- }
211
- function Te(o, t, e) {
212
- for (var n = lt(o, !0), i = O(o)[t]; n; ) {
213
- var r = O(n)[e], a = void 0;
214
- if (a = i >= r, !a) return n;
215
- if (n === Z()) break;
216
- n = lt(n, !1);
217
- }
218
- return !1;
219
- }
220
- function yt(o, t, e, n) {
221
- for (var i = 0, r = 0, a = o.children; r < a.length; ) {
222
- if (a[r].style.display !== "none" && a[r] !== g.ghost && (n || a[r] !== g.dragged) && G(a[r], e.draggable, o, !1)) {
223
- if (i === t)
224
- return a[r];
225
- i++;
226
- }
227
- r++;
228
- }
229
- return null;
230
- }
231
- function ye(o, t) {
232
- for (var e = o.lastElementChild; e && (e === g.ghost || h(e, "display") === "none" || t && !Zt(e, t)); )
233
- e = e.previousElementSibling;
234
- return e || null;
235
- }
236
- function x(o, t) {
237
- var e = 0;
238
- if (!o || !o.parentNode)
239
- return -1;
240
- for (; o = o.previousElementSibling; )
241
- o.nodeName.toUpperCase() !== "TEMPLATE" && o !== g.clone && (!t || Zt(o, t)) && e++;
242
- return e;
243
- }
244
- function Ae(o) {
245
- var t = 0, e = 0, n = Z();
246
- if (o)
247
- do {
248
- var i = ht(o), r = i.a, a = i.d;
249
- t += o.scrollLeft * r, e += o.scrollTop * a;
250
- } while (o !== n && (o = o.parentNode));
251
- return [t, e];
252
- }
253
- function an(o, t) {
254
- for (var e in o)
255
- if (o.hasOwnProperty(e)) {
256
- for (var n in t)
257
- if (t.hasOwnProperty(n) && t[n] === o[e][n]) return Number(e);
258
- }
259
- return -1;
260
- }
261
- function lt(o, t) {
262
- if (!o || !o.getBoundingClientRect) return Z();
263
- var e = o, n = !1;
264
- do
265
- if (e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight) {
266
- var i = h(e);
267
- if (e.clientWidth < e.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || e.clientHeight < e.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
268
- if (!e.getBoundingClientRect || e === document.body) return Z();
269
- if (n || t) return e;
270
- n = !0;
271
- }
272
- }
273
- while (e = e.parentNode);
274
- return Z();
275
- }
276
- function ln(o, t) {
277
- if (o && t)
278
- for (var e in t)
279
- t.hasOwnProperty(e) && (o[e] = t[e]);
280
- return o;
281
- }
282
- function oe(o, t) {
283
- return Math.round(o.top) === Math.round(t.top) && Math.round(o.left) === Math.round(t.left) && Math.round(o.height) === Math.round(t.height) && Math.round(o.width) === Math.round(t.width);
284
- }
285
- var Mt;
286
- function Be(o, t) {
287
- return function() {
288
- if (!Mt) {
289
- var e = arguments, n = this;
290
- e.length === 1 ? o.call(n, e[0]) : o.apply(n, e), Mt = setTimeout(function() {
291
- Mt = void 0;
292
- }, t);
293
- }
294
- };
295
- }
296
- function sn() {
297
- clearTimeout(Mt), Mt = void 0;
298
- }
299
- function He(o, t, e) {
300
- o.scrollLeft += t, o.scrollTop += e;
301
- }
302
- function we(o) {
303
- var t = window.Polymer, e = window.jQuery || window.Zepto;
304
- return t && t.dom ? t.dom(o).cloneNode(!0) : e ? e(o).clone(!0)[0] : o.cloneNode(!0);
305
- }
306
- function Ie(o, t) {
307
- h(o, "position", "absolute"), h(o, "top", t.top), h(o, "left", t.left), h(o, "width", t.width), h(o, "height", t.height);
308
- }
309
- function ie(o) {
310
- h(o, "position", ""), h(o, "top", ""), h(o, "left", ""), h(o, "width", ""), h(o, "height", "");
311
- }
312
- function Ge(o, t, e) {
313
- var n = {};
314
- return Array.from(o.children).forEach(function(i) {
315
- var r, a, l, s;
316
- if (!(!G(i, t.draggable, o, !1) || i.animated || i === e)) {
317
- var u = O(i);
318
- n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, u.left), n.top = Math.min((a = n.top) !== null && a !== void 0 ? a : 1 / 0, u.top), n.right = Math.max((l = n.right) !== null && l !== void 0 ? l : -1 / 0, u.right), n.bottom = Math.max((s = n.bottom) !== null && s !== void 0 ? s : -1 / 0, u.bottom);
319
- }
320
- }), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
321
- }
322
- var R = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
323
- function un() {
324
- var o = [], t;
325
- return {
326
- captureAnimationState: function() {
327
- if (o = [], !!this.options.animation) {
328
- var n = [].slice.call(this.el.children);
329
- n.forEach(function(i) {
330
- if (!(h(i, "display") === "none" || i === g.ghost)) {
331
- o.push({
332
- target: i,
333
- rect: O(i)
334
- });
335
- var r = Q({}, o[o.length - 1].rect);
336
- if (i.thisAnimationDuration) {
337
- var a = ht(i, !0);
338
- a && (r.top -= a.f, r.left -= a.e);
339
- }
340
- i.fromRect = r;
341
- }
342
- });
343
- }
344
- },
345
- addAnimationState: function(n) {
346
- o.push(n);
347
- },
348
- removeAnimationState: function(n) {
349
- o.splice(an(o, {
350
- target: n
351
- }), 1);
352
- },
353
- animateAll: function(n) {
354
- var i = this;
355
- if (!this.options.animation) {
356
- clearTimeout(t), typeof n == "function" && n();
357
- return;
358
- }
359
- var r = !1, a = 0;
360
- o.forEach(function(l) {
361
- var s = 0, u = l.target, d = u.fromRect, c = O(u), p = u.prevFromRect, D = u.prevToRect, w = l.rect, S = ht(u, !0);
362
- S && (c.top -= S.f, c.left -= S.e), u.toRect = c, u.thisAnimationDuration && oe(p, c) && !oe(d, c) && // Make sure animatingRect is on line between toRect & fromRect
363
- (w.top - c.top) / (w.left - c.left) === (d.top - c.top) / (d.left - c.left) && (s = cn(w, p, D, i.options)), oe(c, d) || (u.prevFromRect = d, u.prevToRect = c, s || (s = i.options.animation), i.animate(u, w, c, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
364
- u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
365
- }, s), u.thisAnimationDuration = s);
366
- }), clearTimeout(t), r ? t = setTimeout(function() {
367
- typeof n == "function" && n();
368
- }, a) : typeof n == "function" && n(), o = [];
369
- },
370
- animate: function(n, i, r, a) {
371
- if (a) {
372
- h(n, "transition", ""), h(n, "transform", "");
373
- var l = ht(this.el), s = l && l.a, u = l && l.d, d = (i.left - r.left) / (s || 1), c = (i.top - r.top) / (u || 1);
374
- n.animatingX = !!d, n.animatingY = !!c, h(n, "transform", "translate3d(" + d + "px," + c + "px,0)"), this.forRepaintDummy = fn(n), h(n, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), h(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
375
- h(n, "transition", ""), h(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
376
- }, a);
377
- }
378
- }
379
- };
380
- }
381
- function fn(o) {
382
- return o.offsetWidth;
383
- }
384
- function cn(o, t, e, n) {
385
- return Math.sqrt(Math.pow(t.top - o.top, 2) + Math.pow(t.left - o.left, 2)) / Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) * n.animation;
386
- }
387
- var pt = [], re = {
388
- initializeByDefault: !0
389
- }, Yt = {
390
- mount: function(t) {
391
- for (var e in re)
392
- re.hasOwnProperty(e) && !(e in t) && (t[e] = re[e]);
393
- pt.forEach(function(n) {
394
- if (n.pluginName === t.pluginName)
395
- throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
396
- }), pt.push(t);
397
- },
398
- pluginEvent: function(t, e, n) {
399
- var i = this;
400
- this.eventCanceled = !1, n.cancel = function() {
401
- i.eventCanceled = !0;
402
- };
403
- var r = t + "Global";
404
- pt.forEach(function(a) {
405
- e[a.pluginName] && (e[a.pluginName][r] && e[a.pluginName][r](Q({
406
- sortable: e
407
- }, n)), e.options[a.pluginName] && e[a.pluginName][t] && e[a.pluginName][t](Q({
408
- sortable: e
409
- }, n)));
410
- });
411
- },
412
- initializePlugins: function(t, e, n, i) {
413
- pt.forEach(function(l) {
414
- var s = l.pluginName;
415
- if (!(!t.options[s] && !l.initializeByDefault)) {
416
- var u = new l(t, e, t.options);
417
- u.sortable = t, u.options = t.options, t[s] = u, $(n, u.defaults);
418
- }
419
- });
420
- for (var r in t.options)
421
- if (t.options.hasOwnProperty(r)) {
422
- var a = this.modifyOption(t, r, t.options[r]);
423
- typeof a < "u" && (t.options[r] = a);
424
- }
425
- },
426
- getEventProperties: function(t, e) {
427
- var n = {};
428
- return pt.forEach(function(i) {
429
- typeof i.eventProperties == "function" && $(n, i.eventProperties.call(e[i.pluginName], t));
430
- }), n;
431
- },
432
- modifyOption: function(t, e, n) {
433
- var i;
434
- return pt.forEach(function(r) {
435
- t[r.pluginName] && r.optionListeners && typeof r.optionListeners[e] == "function" && (i = r.optionListeners[e].call(t[r.pluginName], n));
436
- }), i;
437
- }
438
- };
439
- function At(o) {
440
- var t = o.sortable, e = o.rootEl, n = o.name, i = o.targetEl, r = o.cloneEl, a = o.toEl, l = o.fromEl, s = o.oldIndex, u = o.newIndex, d = o.oldDraggableIndex, c = o.newDraggableIndex, p = o.originalEvent, D = o.putSortable, w = o.extraEventProperties;
441
- if (t = t || e && e[R], !!t) {
442
- var S, X = t.options, j = "on" + n.charAt(0).toUpperCase() + n.substr(1);
443
- window.CustomEvent && !nt && !Xt ? S = new CustomEvent(n, {
444
- bubbles: !0,
445
- cancelable: !0
446
- }) : (S = document.createEvent("Event"), S.initEvent(n, !0, !0)), S.to = a || e, S.from = l || e, S.item = i || e, S.clone = r, S.oldIndex = s, S.newIndex = u, S.oldDraggableIndex = d, S.newDraggableIndex = c, S.originalEvent = p, S.pullMode = D ? D.lastPutMode : void 0;
447
- var E = Q(Q({}, w), Yt.getEventProperties(n, t));
448
- for (var _ in E)
449
- S[_] = E[_];
450
- e && e.dispatchEvent(S), X[j] && X[j].call(t, S);
451
- }
452
- }
453
- var dn = ["evt"], B = function(t, e) {
454
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = Qe(n, dn);
455
- Yt.pluginEvent.bind(g)(t, e, Q({
456
- dragEl: f,
457
- parentEl: N,
458
- ghostEl: v,
459
- rootEl: T,
460
- nextEl: dt,
461
- lastDownEl: Ut,
462
- cloneEl: A,
463
- cloneHidden: at,
464
- dragStarted: It,
465
- putSortable: F,
466
- activeSortable: g.active,
467
- originalEvent: i,
468
- oldIndex: bt,
469
- oldDraggableIndex: Ft,
470
- newIndex: L,
471
- newDraggableIndex: rt,
472
- hideGhostForTarget: je,
473
- unhideGhostForTarget: ze,
474
- cloneNowHidden: function() {
475
- at = !0;
476
- },
477
- cloneNowShown: function() {
478
- at = !1;
479
- },
480
- dispatchSortableEvent: function(l) {
481
- Y({
482
- sortable: e,
483
- name: l,
484
- originalEvent: i
485
- });
486
- }
487
- }, r));
488
- };
489
- function Y(o) {
490
- At(Q({
491
- putSortable: F,
492
- cloneEl: A,
493
- targetEl: f,
494
- rootEl: T,
495
- oldIndex: bt,
496
- oldDraggableIndex: Ft,
497
- newIndex: L,
498
- newDraggableIndex: rt
499
- }, o));
500
- }
501
- var f, N, v, T, dt, Ut, A, at, bt, L, Ft, rt, Ht, F, vt = !1, Qt = !1, Jt = [], ft, q, ae, le, Ne, xe, It, gt, Rt, kt = !1, Gt = !1, $t, k, se = [], pe = !1, te = [], ne = typeof document < "u", Wt = be, Pe = Xt || nt ? "cssFloat" : "float", hn = ne && !Re && !be && "draggable" in document.createElement("div"), We = (function() {
502
- if (ne) {
503
- if (nt)
504
- return !1;
505
- var o = document.createElement("x");
506
- return o.style.cssText = "pointer-events:auto", o.style.pointerEvents === "auto";
507
- }
508
- })(), Ke = function(t, e) {
509
- var n = h(t), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = yt(t, 0, e), a = yt(t, 1, e), l = r && h(r), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + O(r).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + O(a).width;
510
- if (n.display === "flex")
511
- return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
512
- if (n.display === "grid")
513
- return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
514
- if (r && l.float && l.float !== "none") {
515
- var c = l.float === "left" ? "left" : "right";
516
- return a && (s.clear === "both" || s.clear === c) ? "vertical" : "horizontal";
517
- }
518
- return r && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= i && n[Pe] === "none" || a && n[Pe] === "none" && u + d > i) ? "vertical" : "horizontal";
519
- }, pn = function(t, e, n) {
520
- var i = n ? t.left : t.top, r = n ? t.right : t.bottom, a = n ? t.width : t.height, l = n ? e.left : e.top, s = n ? e.right : e.bottom, u = n ? e.width : e.height;
521
- return i === l || r === s || i + a / 2 === l + u / 2;
522
- }, gn = function(t, e) {
523
- var n;
524
- return Jt.some(function(i) {
525
- var r = i[R].options.emptyInsertThreshold;
526
- if (!(!r || ye(i))) {
527
- var a = O(i), l = t >= a.left - r && t <= a.right + r, s = e >= a.top - r && e <= a.bottom + r;
528
- if (l && s)
529
- return n = i;
530
- }
531
- }), n;
532
- }, Le = function(t) {
533
- function e(r, a) {
534
- return function(l, s, u, d) {
535
- var c = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
536
- if (r == null && (a || c))
537
- return !0;
538
- if (r == null || r === !1)
539
- return !1;
540
- if (a && r === "clone")
541
- return r;
542
- if (typeof r == "function")
543
- return e(r(l, s, u, d), a)(l, s, u, d);
544
- var p = (a ? l : s).options.group.name;
545
- return r === !0 || typeof r == "string" && r === p || r.join && r.indexOf(p) > -1;
546
- };
547
- }
548
- var n = {}, i = t.group;
549
- (!i || zt(i) != "object") && (i = {
550
- name: i
551
- }), n.name = i.name, n.checkPull = e(i.pull, !0), n.checkPut = e(i.put), n.revertClone = i.revertClone, t.group = n;
552
- }, je = function() {
553
- !We && v && h(v, "display", "none");
554
- }, ze = function() {
555
- !We && v && h(v, "display", "");
556
- };
557
- ne && !Re && document.addEventListener("click", function(o) {
558
- if (Qt)
559
- return o.preventDefault(), o.stopPropagation && o.stopPropagation(), o.stopImmediatePropagation && o.stopImmediatePropagation(), Qt = !1, !1;
560
- }, !0);
561
- var ct = function(t) {
562
- if (f) {
563
- t = t.touches ? t.touches[0] : t;
564
- var e = gn(t.clientX, t.clientY);
565
- if (e) {
566
- var n = {};
567
- for (var i in t)
568
- t.hasOwnProperty(i) && (n[i] = t[i]);
569
- n.target = n.rootEl = e, n.preventDefault = void 0, n.stopPropagation = void 0, e[R]._onDragOver(n);
570
- }
571
- }
572
- }, mn = function(t) {
573
- f && f.parentNode[R]._isOutsideThisEl(t.target);
574
- };
575
- function g(o, t) {
576
- if (!(o && o.nodeType && o.nodeType === 1))
577
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));
578
- this.el = o, this.options = t = $({}, t), o[R] = this;
579
- var e = {
580
- group: null,
581
- sort: !0,
582
- disabled: !1,
583
- store: null,
584
- handle: null,
585
- draggable: /^[uo]l$/i.test(o.nodeName) ? ">li" : ">*",
586
- swapThreshold: 1,
587
- // percentage; 0 <= x <= 1
588
- invertSwap: !1,
589
- // invert always
590
- invertedSwapThreshold: null,
591
- // will be set to same as swapThreshold if default
592
- removeCloneOnHide: !0,
593
- direction: function() {
594
- return Ke(o, this.options);
595
- },
596
- ghostClass: "sortable-ghost",
597
- chosenClass: "sortable-chosen",
598
- dragClass: "sortable-drag",
599
- ignore: "a, img",
600
- filter: null,
601
- preventOnFilter: !0,
602
- animation: 0,
603
- easing: null,
604
- setData: function(a, l) {
605
- a.setData("Text", l.textContent);
606
- },
607
- dropBubble: !1,
608
- dragoverBubble: !1,
609
- dataIdAttr: "data-id",
610
- delay: 0,
611
- delayOnTouchOnly: !1,
612
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
613
- forceFallback: !1,
614
- fallbackClass: "sortable-fallback",
615
- fallbackOnBody: !1,
616
- fallbackTolerance: 0,
617
- fallbackOffset: {
618
- x: 0,
619
- y: 0
620
- },
621
- // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
622
- supportPointer: g.supportPointer !== !1 && "PointerEvent" in window && (!Pt || be),
623
- emptyInsertThreshold: 5
624
- };
625
- Yt.initializePlugins(this, o, e);
626
- for (var n in e)
627
- !(n in t) && (t[n] = e[n]);
628
- Le(t);
629
- for (var i in this)
630
- i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
631
- this.nativeDraggable = t.forceFallback ? !1 : hn, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? y(o, "pointerdown", this._onTapStart) : (y(o, "mousedown", this._onTapStart), y(o, "touchstart", this._onTapStart)), this.nativeDraggable && (y(o, "dragover", this), y(o, "dragenter", this)), Jt.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), $(this, un());
632
- }
633
- g.prototype = /** @lends Sortable.prototype */
634
- {
635
- constructor: g,
636
- _isOutsideThisEl: function(t) {
637
- !this.el.contains(t) && t !== this.el && (gt = null);
638
- },
639
- _getDirection: function(t, e) {
640
- return typeof this.options.direction == "function" ? this.options.direction.call(this, t, e, f) : this.options.direction;
641
- },
642
- _onTapStart: function(t) {
643
- if (t.cancelable) {
644
- var e = this, n = this.el, i = this.options, r = i.preventOnFilter, a = t.type, l = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, s = (l || t).target, u = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || s, d = i.filter;
645
- if (_n(n), !f && !(/mousedown|pointerdown/.test(a) && t.button !== 0 || i.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Pt && s && s.tagName.toUpperCase() === "SELECT") && (s = G(s, i.draggable, n, !1), !(s && s.animated) && Ut !== s)) {
646
- if (bt = x(s), Ft = x(s, i.draggable), typeof d == "function") {
647
- if (d.call(this, t, s, this)) {
648
- Y({
649
- sortable: e,
650
- rootEl: u,
651
- name: "filter",
652
- targetEl: s,
653
- toEl: n,
654
- fromEl: n
655
- }), B("filter", e, {
656
- evt: t
657
- }), r && t.preventDefault();
658
- return;
659
- }
660
- } else if (d && (d = d.split(",").some(function(c) {
661
- if (c = G(u, c.trim(), n, !1), c)
662
- return Y({
663
- sortable: e,
664
- rootEl: c,
665
- name: "filter",
666
- targetEl: s,
667
- fromEl: n,
668
- toEl: n
669
- }), B("filter", e, {
670
- evt: t
671
- }), !0;
672
- }), d)) {
673
- r && t.preventDefault();
674
- return;
675
- }
676
- i.handle && !G(u, i.handle, n, !1) || this._prepareDragStart(t, l, s);
677
- }
678
- }
679
- },
680
- _prepareDragStart: function(t, e, n) {
681
- var i = this, r = i.el, a = i.options, l = r.ownerDocument, s;
682
- if (n && !f && n.parentNode === r) {
683
- var u = O(n);
684
- if (T = r, f = n, N = f.parentNode, dt = f.nextSibling, Ut = n, Ht = a.group, g.dragged = f, ft = {
685
- target: f,
686
- clientX: (e || t).clientX,
687
- clientY: (e || t).clientY
688
- }, Ne = ft.clientX - u.left, xe = ft.clientY - u.top, this._lastX = (e || t).clientX, this._lastY = (e || t).clientY, f.style["will-change"] = "all", s = function() {
689
- if (B("delayEnded", i, {
690
- evt: t
691
- }), g.eventCanceled) {
692
- i._onDrop();
693
- return;
694
- }
695
- i._disableDelayedDragEvents(), !Ce && i.nativeDraggable && (f.draggable = !0), i._triggerDragStart(t, e), Y({
696
- sortable: i,
697
- name: "choose",
698
- originalEvent: t
699
- }), I(f, a.chosenClass, !0);
700
- }, a.ignore.split(",").forEach(function(d) {
701
- Ye(f, d.trim(), ue);
702
- }), y(l, "dragover", ct), y(l, "mousemove", ct), y(l, "touchmove", ct), a.supportPointer ? (y(l, "pointerup", i._onDrop), !this.nativeDraggable && y(l, "pointercancel", i._onDrop)) : (y(l, "mouseup", i._onDrop), y(l, "touchend", i._onDrop), y(l, "touchcancel", i._onDrop)), Ce && this.nativeDraggable && (this.options.touchStartThreshold = 4, f.draggable = !0), B("delayStart", this, {
703
- evt: t
704
- }), a.delay && (!a.delayOnTouchOnly || e) && (!this.nativeDraggable || !(Xt || nt))) {
705
- if (g.eventCanceled) {
706
- this._onDrop();
707
- return;
708
- }
709
- a.supportPointer ? (y(l, "pointerup", i._disableDelayedDrag), y(l, "pointercancel", i._disableDelayedDrag)) : (y(l, "mouseup", i._disableDelayedDrag), y(l, "touchend", i._disableDelayedDrag), y(l, "touchcancel", i._disableDelayedDrag)), y(l, "mousemove", i._delayedDragTouchMoveHandler), y(l, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && y(l, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(s, a.delay);
710
- } else
711
- s();
712
- }
713
- },
714
- _delayedDragTouchMoveHandler: function(t) {
715
- var e = t.touches ? t.touches[0] : t;
716
- Math.max(Math.abs(e.clientX - this._lastX), Math.abs(e.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
717
- },
718
- _disableDelayedDrag: function() {
719
- f && ue(f), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
720
- },
721
- _disableDelayedDragEvents: function() {
722
- var t = this.el.ownerDocument;
723
- b(t, "mouseup", this._disableDelayedDrag), b(t, "touchend", this._disableDelayedDrag), b(t, "touchcancel", this._disableDelayedDrag), b(t, "pointerup", this._disableDelayedDrag), b(t, "pointercancel", this._disableDelayedDrag), b(t, "mousemove", this._delayedDragTouchMoveHandler), b(t, "touchmove", this._delayedDragTouchMoveHandler), b(t, "pointermove", this._delayedDragTouchMoveHandler);
724
- },
725
- _triggerDragStart: function(t, e) {
726
- e = e || t.pointerType == "touch" && t, !this.nativeDraggable || e ? this.options.supportPointer ? y(document, "pointermove", this._onTouchMove) : e ? y(document, "touchmove", this._onTouchMove) : y(document, "mousemove", this._onTouchMove) : (y(f, "dragend", this), y(T, "dragstart", this._onDragStart));
727
- try {
728
- document.selection ? qt(function() {
729
- document.selection.empty();
730
- }) : window.getSelection().removeAllRanges();
731
- } catch {
732
- }
733
- },
734
- _dragStarted: function(t, e) {
735
- if (vt = !1, T && f) {
736
- B("dragStarted", this, {
737
- evt: e
738
- }), this.nativeDraggable && y(document, "dragover", mn);
739
- var n = this.options;
740
- !t && I(f, n.dragClass, !1), I(f, n.ghostClass, !0), g.active = this, t && this._appendGhost(), Y({
741
- sortable: this,
742
- name: "start",
743
- originalEvent: e
744
- });
745
- } else
746
- this._nulling();
747
- },
748
- _emulateDragOver: function() {
749
- if (q) {
750
- this._lastX = q.clientX, this._lastY = q.clientY, je();
751
- for (var t = document.elementFromPoint(q.clientX, q.clientY), e = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(q.clientX, q.clientY), t !== e); )
752
- e = t;
753
- if (f.parentNode[R]._isOutsideThisEl(t), e)
754
- do {
755
- if (e[R]) {
756
- var n = void 0;
757
- if (n = e[R]._onDragOver({
758
- clientX: q.clientX,
759
- clientY: q.clientY,
760
- target: t,
761
- rootEl: e
762
- }), n && !this.options.dragoverBubble)
763
- break;
764
- }
765
- t = e;
766
- } while (e = Xe(e));
767
- ze();
768
- }
769
- },
770
- _onTouchMove: function(t) {
771
- if (ft) {
772
- var e = this.options, n = e.fallbackTolerance, i = e.fallbackOffset, r = t.touches ? t.touches[0] : t, a = v && ht(v, !0), l = v && a && a.a, s = v && a && a.d, u = Wt && k && Ae(k), d = (r.clientX - ft.clientX + i.x) / (l || 1) + (u ? u[0] - se[0] : 0) / (l || 1), c = (r.clientY - ft.clientY + i.y) / (s || 1) + (u ? u[1] - se[1] : 0) / (s || 1);
773
- if (!g.active && !vt) {
774
- if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
775
- return;
776
- this._onDragStart(t, !0);
777
- }
778
- if (v) {
779
- a ? (a.e += d - (ae || 0), a.f += c - (le || 0)) : a = {
780
- a: 1,
781
- b: 0,
782
- c: 0,
783
- d: 1,
784
- e: d,
785
- f: c
786
- };
787
- var p = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
788
- h(v, "webkitTransform", p), h(v, "mozTransform", p), h(v, "msTransform", p), h(v, "transform", p), ae = d, le = c, q = r;
789
- }
790
- t.cancelable && t.preventDefault();
791
- }
792
- },
793
- _appendGhost: function() {
794
- if (!v) {
795
- var t = this.options.fallbackOnBody ? document.body : T, e = O(f, !0, Wt, !0, t), n = this.options;
796
- if (Wt) {
797
- for (k = t; h(k, "position") === "static" && h(k, "transform") === "none" && k !== document; )
798
- k = k.parentNode;
799
- k !== document.body && k !== document.documentElement ? (k === document && (k = Z()), e.top += k.scrollTop, e.left += k.scrollLeft) : k = Z(), se = Ae(k);
800
- }
801
- v = f.cloneNode(!0), I(v, n.ghostClass, !1), I(v, n.fallbackClass, !0), I(v, n.dragClass, !0), h(v, "transition", ""), h(v, "transform", ""), h(v, "box-sizing", "border-box"), h(v, "margin", 0), h(v, "top", e.top), h(v, "left", e.left), h(v, "width", e.width), h(v, "height", e.height), h(v, "opacity", "0.8"), h(v, "position", Wt ? "absolute" : "fixed"), h(v, "zIndex", "100000"), h(v, "pointerEvents", "none"), g.ghost = v, t.appendChild(v), h(v, "transform-origin", Ne / parseInt(v.style.width) * 100 + "% " + xe / parseInt(v.style.height) * 100 + "%");
802
- }
803
- },
804
- _onDragStart: function(t, e) {
805
- var n = this, i = t.dataTransfer, r = n.options;
806
- if (B("dragStart", this, {
807
- evt: t
808
- }), g.eventCanceled) {
809
- this._onDrop();
810
- return;
811
- }
812
- B("setupClone", this), g.eventCanceled || (A = we(f), A.removeAttribute("id"), A.draggable = !1, A.style["will-change"] = "", this._hideClone(), I(A, this.options.chosenClass, !1), g.clone = A), n.cloneId = qt(function() {
813
- B("clone", n), !g.eventCanceled && (n.options.removeCloneOnHide || T.insertBefore(A, f), n._hideClone(), Y({
814
- sortable: n,
815
- name: "clone"
816
- }));
817
- }), !e && I(f, r.dragClass, !0), e ? (Qt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (b(document, "mouseup", n._onDrop), b(document, "touchend", n._onDrop), b(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, f)), y(document, "drop", n), h(f, "transform", "translateZ(0)")), vt = !0, n._dragStartId = qt(n._dragStarted.bind(n, e, t)), y(document, "selectstart", n), It = !0, window.getSelection().removeAllRanges(), Pt && h(document.body, "user-select", "none");
818
- },
819
- // Returns true - if no further action is needed (either inserted or another condition)
820
- _onDragOver: function(t) {
821
- var e = this.el, n = t.target, i, r, a, l = this.options, s = l.group, u = g.active, d = Ht === s, c = l.sort, p = F || u, D, w = this, S = !1;
822
- if (pe) return;
823
- function X(_t, $e) {
824
- B(_t, w, Q({
825
- evt: t,
826
- isOwner: d,
827
- axis: D ? "vertical" : "horizontal",
828
- revert: a,
829
- dragRect: i,
830
- targetRect: r,
831
- canSort: c,
832
- fromSortable: p,
833
- target: n,
834
- completed: E,
835
- onMove: function(Se, qe) {
836
- return Kt(T, e, f, i, Se, O(Se), t, qe);
837
- },
838
- changed: _
839
- }, $e));
840
- }
841
- function j() {
842
- X("dragOverAnimationCapture"), w.captureAnimationState(), w !== p && p.captureAnimationState();
843
- }
844
- function E(_t) {
845
- return X("dragOverCompleted", {
846
- insertion: _t
847
- }), _t && (d ? u._hideClone() : u._showClone(w), w !== p && (I(f, F ? F.options.ghostClass : u.options.ghostClass, !1), I(f, l.ghostClass, !0)), F !== w && w !== g.active ? F = w : w === g.active && F && (F = null), p === w && (w._ignoreWhileAnimating = n), w.animateAll(function() {
848
- X("dragOverAnimationComplete"), w._ignoreWhileAnimating = null;
849
- }), w !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (n === f && !f.animated || n === e && !n.animated) && (gt = null), !l.dragoverBubble && !t.rootEl && n !== document && (f.parentNode[R]._isOutsideThisEl(t.target), !_t && ct(t)), !l.dragoverBubble && t.stopPropagation && t.stopPropagation(), S = !0;
850
- }
851
- function _() {
852
- L = x(f), rt = x(f, l.draggable), Y({
853
- sortable: w,
854
- name: "change",
855
- toEl: e,
856
- newIndex: L,
857
- newDraggableIndex: rt,
858
- originalEvent: t
859
- });
860
- }
861
- if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), n = G(n, l.draggable, e, !0), X("dragOver"), g.eventCanceled) return S;
862
- if (f.contains(t.target) || n.animated && n.animatingX && n.animatingY || w._ignoreWhileAnimating === n)
863
- return E(!1);
864
- if (Qt = !1, u && !l.disabled && (d ? c || (a = N !== T) : F === this || (this.lastPutMode = Ht.checkPull(this, u, f, t)) && s.checkPut(this, u, f, t))) {
865
- if (D = this._getDirection(t, n) === "vertical", i = O(f), X("dragOverValid"), g.eventCanceled) return S;
866
- if (a)
867
- return N = T, j(), this._hideClone(), X("revert"), g.eventCanceled || (dt ? T.insertBefore(f, dt) : T.appendChild(f)), E(!0);
868
- var M = ye(e, l.draggable);
869
- if (!M || wn(t, D, this) && !M.animated) {
870
- if (M === f)
871
- return E(!1);
872
- if (M && e === t.target && (n = M), n && (r = O(n)), Kt(T, e, f, i, n, r, t, !!n) !== !1)
873
- return j(), M && M.nextSibling ? e.insertBefore(f, M.nextSibling) : e.appendChild(f), N = e, _(), E(!0);
874
- } else if (M && yn(t, D, this)) {
875
- var J = yt(e, 0, l, !0);
876
- if (J === f)
877
- return E(!1);
878
- if (n = J, r = O(n), Kt(T, e, f, i, n, r, t, !1) !== !1)
879
- return j(), e.insertBefore(f, J), N = e, _(), E(!0);
880
- } else if (n.parentNode === e) {
881
- r = O(n);
882
- var z = 0, st, wt = f.parentNode !== e, W = !pn(f.animated && f.toRect || i, n.animated && n.toRect || r, D), Et = D ? "top" : "left", ot = Te(n, "top", "top") || Te(f, "top", "top"), Dt = ot ? ot.scrollTop : void 0;
883
- gt !== n && (st = r[Et], kt = !1, Gt = !W && l.invertSwap || wt), z = En(t, n, r, D, W ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Gt, gt === n);
884
- var tt;
885
- if (z !== 0) {
886
- var ut = x(f);
887
- do
888
- ut -= z, tt = N.children[ut];
889
- while (tt && (h(tt, "display") === "none" || tt === v));
890
- }
891
- if (z === 0 || tt === n)
892
- return E(!1);
893
- gt = n, Rt = z;
894
- var St = n.nextElementSibling, it = !1;
895
- it = z === 1;
896
- var Bt = Kt(T, e, f, i, n, r, t, it);
897
- if (Bt !== !1)
898
- return (Bt === 1 || Bt === -1) && (it = Bt === 1), pe = !0, setTimeout(bn, 30), j(), it && !St ? e.appendChild(f) : n.parentNode.insertBefore(f, it ? St : n), ot && He(ot, 0, Dt - ot.scrollTop), N = f.parentNode, st !== void 0 && !Gt && ($t = Math.abs(st - O(n)[Et])), _(), E(!0);
899
- }
900
- if (e.contains(f))
901
- return E(!1);
902
- }
903
- return !1;
904
- },
905
- _ignoreWhileAnimating: null,
906
- _offMoveEvents: function() {
907
- b(document, "mousemove", this._onTouchMove), b(document, "touchmove", this._onTouchMove), b(document, "pointermove", this._onTouchMove), b(document, "dragover", ct), b(document, "mousemove", ct), b(document, "touchmove", ct);
908
- },
909
- _offUpEvents: function() {
910
- var t = this.el.ownerDocument;
911
- b(t, "mouseup", this._onDrop), b(t, "touchend", this._onDrop), b(t, "pointerup", this._onDrop), b(t, "pointercancel", this._onDrop), b(t, "touchcancel", this._onDrop), b(document, "selectstart", this);
912
- },
913
- _onDrop: function(t) {
914
- var e = this.el, n = this.options;
915
- if (L = x(f), rt = x(f, n.draggable), B("drop", this, {
916
- evt: t
917
- }), N = f && f.parentNode, L = x(f), rt = x(f, n.draggable), g.eventCanceled) {
918
- this._nulling();
919
- return;
920
- }
921
- vt = !1, Gt = !1, kt = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), ge(this.cloneId), ge(this._dragStartId), this.nativeDraggable && (b(document, "drop", this), b(e, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Pt && h(document.body, "user-select", ""), h(f, "transform", ""), t && (It && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), v && v.parentNode && v.parentNode.removeChild(v), (T === N || F && F.lastPutMode !== "clone") && A && A.parentNode && A.parentNode.removeChild(A), f && (this.nativeDraggable && b(f, "dragend", this), ue(f), f.style["will-change"] = "", It && !vt && I(f, F ? F.options.ghostClass : this.options.ghostClass, !1), I(f, this.options.chosenClass, !1), Y({
922
- sortable: this,
923
- name: "unchoose",
924
- toEl: N,
925
- newIndex: null,
926
- newDraggableIndex: null,
927
- originalEvent: t
928
- }), T !== N ? (L >= 0 && (Y({
929
- rootEl: N,
930
- name: "add",
931
- toEl: N,
932
- fromEl: T,
933
- originalEvent: t
934
- }), Y({
935
- sortable: this,
936
- name: "remove",
937
- toEl: N,
938
- originalEvent: t
939
- }), Y({
940
- rootEl: N,
941
- name: "sort",
942
- toEl: N,
943
- fromEl: T,
944
- originalEvent: t
945
- }), Y({
946
- sortable: this,
947
- name: "sort",
948
- toEl: N,
949
- originalEvent: t
950
- })), F && F.save()) : L !== bt && L >= 0 && (Y({
951
- sortable: this,
952
- name: "update",
953
- toEl: N,
954
- originalEvent: t
955
- }), Y({
956
- sortable: this,
957
- name: "sort",
958
- toEl: N,
959
- originalEvent: t
960
- })), g.active && ((L == null || L === -1) && (L = bt, rt = Ft), Y({
961
- sortable: this,
962
- name: "end",
963
- toEl: N,
964
- originalEvent: t
965
- }), this.save()))), this._nulling();
966
- },
967
- _nulling: function() {
968
- B("nulling", this), T = f = N = v = dt = A = Ut = at = ft = q = It = L = rt = bt = Ft = gt = Rt = F = Ht = g.dragged = g.ghost = g.clone = g.active = null, te.forEach(function(t) {
969
- t.checked = !0;
970
- }), te.length = ae = le = 0;
971
- },
972
- handleEvent: function(t) {
973
- switch (t.type) {
974
- case "drop":
975
- case "dragend":
976
- this._onDrop(t);
977
- break;
978
- case "dragenter":
979
- case "dragover":
980
- f && (this._onDragOver(t), vn(t));
981
- break;
982
- case "selectstart":
983
- t.preventDefault();
984
- break;
985
- }
986
- },
987
- /**
988
- * Serializes the item into an array of string.
989
- * @returns {String[]}
990
- */
991
- toArray: function() {
992
- for (var t = [], e, n = this.el.children, i = 0, r = n.length, a = this.options; i < r; i++)
993
- e = n[i], G(e, a.draggable, this.el, !1) && t.push(e.getAttribute(a.dataIdAttr) || Sn(e));
994
- return t;
995
- },
996
- /**
997
- * Sorts the elements according to the array.
998
- * @param {String[]} order order of the items
999
- */
1000
- sort: function(t, e) {
1001
- var n = {}, i = this.el;
1002
- this.toArray().forEach(function(r, a) {
1003
- var l = i.children[a];
1004
- G(l, this.options.draggable, i, !1) && (n[r] = l);
1005
- }, this), e && this.captureAnimationState(), t.forEach(function(r) {
1006
- n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
1007
- }), e && this.animateAll();
1008
- },
1009
- /**
1010
- * Save the current sorting
1011
- */
1012
- save: function() {
1013
- var t = this.options.store;
1014
- t && t.set && t.set(this);
1015
- },
1016
- /**
1017
- * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
1018
- * @param {HTMLElement} el
1019
- * @param {String} [selector] default: `options.draggable`
1020
- * @returns {HTMLElement|null}
1021
- */
1022
- closest: function(t, e) {
1023
- return G(t, e || this.options.draggable, this.el, !1);
1024
- },
1025
- /**
1026
- * Set/get option
1027
- * @param {string} name
1028
- * @param {*} [value]
1029
- * @returns {*}
1030
- */
1031
- option: function(t, e) {
1032
- var n = this.options;
1033
- if (e === void 0)
1034
- return n[t];
1035
- var i = Yt.modifyOption(this, t, e);
1036
- typeof i < "u" ? n[t] = i : n[t] = e, t === "group" && Le(n);
1037
- },
1038
- /**
1039
- * Destroy
1040
- */
1041
- destroy: function() {
1042
- B("destroy", this);
1043
- var t = this.el;
1044
- t[R] = null, b(t, "mousedown", this._onTapStart), b(t, "touchstart", this._onTapStart), b(t, "pointerdown", this._onTapStart), this.nativeDraggable && (b(t, "dragover", this), b(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(e) {
1045
- e.removeAttribute("draggable");
1046
- }), this._onDrop(), this._disableDelayedDragEvents(), Jt.splice(Jt.indexOf(this.el), 1), this.el = t = null;
1047
- },
1048
- _hideClone: function() {
1049
- if (!at) {
1050
- if (B("hideClone", this), g.eventCanceled) return;
1051
- h(A, "display", "none"), this.options.removeCloneOnHide && A.parentNode && A.parentNode.removeChild(A), at = !0;
1052
- }
1053
- },
1054
- _showClone: function(t) {
1055
- if (t.lastPutMode !== "clone") {
1056
- this._hideClone();
1057
- return;
1058
- }
1059
- if (at) {
1060
- if (B("showClone", this), g.eventCanceled) return;
1061
- f.parentNode == T && !this.options.group.revertClone ? T.insertBefore(A, f) : dt ? T.insertBefore(A, dt) : T.appendChild(A), this.options.group.revertClone && this.animate(f, A), h(A, "display", ""), at = !1;
1062
- }
1063
- }
1064
- };
1065
- function vn(o) {
1066
- o.dataTransfer && (o.dataTransfer.dropEffect = "move"), o.cancelable && o.preventDefault();
1067
- }
1068
- function Kt(o, t, e, n, i, r, a, l) {
1069
- var s, u = o[R], d = u.options.onMove, c;
1070
- return window.CustomEvent && !nt && !Xt ? s = new CustomEvent("move", {
1071
- bubbles: !0,
1072
- cancelable: !0
1073
- }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = t, s.from = o, s.dragged = e, s.draggedRect = n, s.related = i || t, s.relatedRect = r || O(t), s.willInsertAfter = l, s.originalEvent = a, o.dispatchEvent(s), d && (c = d.call(u, s, a)), c;
1074
- }
1075
- function ue(o) {
1076
- o.draggable = !1;
1077
- }
1078
- function bn() {
1079
- pe = !1;
1080
- }
1081
- function yn(o, t, e) {
1082
- var n = O(yt(e.el, 0, e.options, !0)), i = Ge(e.el, e.options, v), r = 10;
1083
- return t ? o.clientX < i.left - r || o.clientY < n.top && o.clientX < n.right : o.clientY < i.top - r || o.clientY < n.bottom && o.clientX < n.left;
1084
- }
1085
- function wn(o, t, e) {
1086
- var n = O(ye(e.el, e.options.draggable)), i = Ge(e.el, e.options, v), r = 10;
1087
- return t ? o.clientX > i.right + r || o.clientY > n.bottom && o.clientX > n.left : o.clientY > i.bottom + r || o.clientX > n.right && o.clientY > n.top;
1088
- }
1089
- function En(o, t, e, n, i, r, a, l) {
1090
- var s = n ? o.clientY : o.clientX, u = n ? e.height : e.width, d = n ? e.top : e.left, c = n ? e.bottom : e.right, p = !1;
1091
- if (!a) {
1092
- if (l && $t < u * i) {
1093
- if (!kt && (Rt === 1 ? s > d + u * r / 2 : s < c - u * r / 2) && (kt = !0), kt)
1094
- p = !0;
1095
- else if (Rt === 1 ? s < d + $t : s > c - $t)
1096
- return -Rt;
1097
- } else if (s > d + u * (1 - i) / 2 && s < c - u * (1 - i) / 2)
1098
- return Dn(t);
1099
- }
1100
- return p = p || a, p && (s < d + u * r / 2 || s > c - u * r / 2) ? s > d + u / 2 ? 1 : -1 : 0;
1101
- }
1102
- function Dn(o) {
1103
- return x(f) < x(o) ? 1 : -1;
1104
- }
1105
- function Sn(o) {
1106
- for (var t = o.tagName + o.className + o.src + o.href + o.textContent, e = t.length, n = 0; e--; )
1107
- n += t.charCodeAt(e);
1108
- return n.toString(36);
1109
- }
1110
- function _n(o) {
1111
- te.length = 0;
1112
- for (var t = o.getElementsByTagName("input"), e = t.length; e--; ) {
1113
- var n = t[e];
1114
- n.checked && te.push(n);
1115
- }
1116
- }
1117
- function qt(o) {
1118
- return setTimeout(o, 0);
1119
- }
1120
- function ge(o) {
1121
- return clearTimeout(o);
1122
- }
1123
- ne && y(document, "touchmove", function(o) {
1124
- (g.active || vt) && o.cancelable && o.preventDefault();
1125
- });
1126
- g.utils = {
1127
- on: y,
1128
- off: b,
1129
- css: h,
1130
- find: Ye,
1131
- is: function(t, e) {
1132
- return !!G(t, e, t, !1);
1133
- },
1134
- extend: ln,
1135
- throttle: Be,
1136
- closest: G,
1137
- toggleClass: I,
1138
- clone: we,
1139
- index: x,
1140
- nextTick: qt,
1141
- cancelNextTick: ge,
1142
- detectDirection: Ke,
1143
- getChild: yt,
1144
- expando: R
1145
- };
1146
- g.get = function(o) {
1147
- return o[R];
1148
- };
1149
- g.mount = function() {
1150
- for (var o = arguments.length, t = new Array(o), e = 0; e < o; e++)
1151
- t[e] = arguments[e];
1152
- t[0].constructor === Array && (t = t[0]), t.forEach(function(n) {
1153
- if (!n.prototype || !n.prototype.constructor)
1154
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
1155
- n.utils && (g.utils = Q(Q({}, g.utils), n.utils)), Yt.mount(n);
1156
- });
1157
- };
1158
- g.create = function(o, t) {
1159
- return new g(o, t);
1160
- };
1161
- g.version = rn;
1162
- var P = [], Nt, me, ve = !1, fe, ce, ee, xt;
1163
- function Cn() {
1164
- function o() {
1165
- this.defaults = {
1166
- scroll: !0,
1167
- forceAutoScrollFallback: !1,
1168
- scrollSensitivity: 30,
1169
- scrollSpeed: 10,
1170
- bubbleScroll: !0
1171
- };
1172
- for (var t in this)
1173
- t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
1174
- }
1175
- return o.prototype = {
1176
- dragStarted: function(e) {
1177
- var n = e.originalEvent;
1178
- this.sortable.nativeDraggable ? y(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? y(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? y(document, "touchmove", this._handleFallbackAutoScroll) : y(document, "mousemove", this._handleFallbackAutoScroll);
1179
- },
1180
- dragOverCompleted: function(e) {
1181
- var n = e.originalEvent;
1182
- !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
1183
- },
1184
- drop: function() {
1185
- this.sortable.nativeDraggable ? b(document, "dragover", this._handleAutoScroll) : (b(document, "pointermove", this._handleFallbackAutoScroll), b(document, "touchmove", this._handleFallbackAutoScroll), b(document, "mousemove", this._handleFallbackAutoScroll)), Me(), Vt(), sn();
1186
- },
1187
- nulling: function() {
1188
- ee = me = Nt = ve = xt = fe = ce = null, P.length = 0;
1189
- },
1190
- _handleFallbackAutoScroll: function(e) {
1191
- this._handleAutoScroll(e, !0);
1192
- },
1193
- _handleAutoScroll: function(e, n) {
1194
- var i = this, r = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, l = document.elementFromPoint(r, a);
1195
- if (ee = e, n || this.options.forceAutoScrollFallback || Xt || nt || Pt) {
1196
- de(e, this.options, l, n);
1197
- var s = lt(l, !0);
1198
- ve && (!xt || r !== fe || a !== ce) && (xt && Me(), xt = setInterval(function() {
1199
- var u = lt(document.elementFromPoint(r, a), !0);
1200
- u !== s && (s = u, Vt()), de(e, i.options, u, n);
1201
- }, 10), fe = r, ce = a);
1202
- } else {
1203
- if (!this.options.bubbleScroll || lt(l, !0) === Z()) {
1204
- Vt();
1205
- return;
1206
- }
1207
- de(e, this.options, lt(l, !1), !1);
1208
- }
1209
- }
1210
- }, $(o, {
1211
- pluginName: "scroll",
1212
- initializeByDefault: !0
1213
- });
1214
- }
1215
- function Vt() {
1216
- P.forEach(function(o) {
1217
- clearInterval(o.pid);
1218
- }), P = [];
1219
- }
1220
- function Me() {
1221
- clearInterval(xt);
1222
- }
1223
- var de = Be(function(o, t, e, n) {
1224
- if (t.scroll) {
1225
- var i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, a = t.scrollSensitivity, l = t.scrollSpeed, s = Z(), u = !1, d;
1226
- me !== e && (me = e, Vt(), Nt = t.scroll, d = t.scrollFn, Nt === !0 && (Nt = lt(e, !0)));
1227
- var c = 0, p = Nt;
1228
- do {
1229
- var D = p, w = O(D), S = w.top, X = w.bottom, j = w.left, E = w.right, _ = w.width, M = w.height, J = void 0, z = void 0, st = D.scrollWidth, wt = D.scrollHeight, W = h(D), Et = D.scrollLeft, ot = D.scrollTop;
1230
- D === s ? (J = _ < st && (W.overflowX === "auto" || W.overflowX === "scroll" || W.overflowX === "visible"), z = M < wt && (W.overflowY === "auto" || W.overflowY === "scroll" || W.overflowY === "visible")) : (J = _ < st && (W.overflowX === "auto" || W.overflowX === "scroll"), z = M < wt && (W.overflowY === "auto" || W.overflowY === "scroll"));
1231
- var Dt = J && (Math.abs(E - i) <= a && Et + _ < st) - (Math.abs(j - i) <= a && !!Et), tt = z && (Math.abs(X - r) <= a && ot + M < wt) - (Math.abs(S - r) <= a && !!ot);
1232
- if (!P[c])
1233
- for (var ut = 0; ut <= c; ut++)
1234
- P[ut] || (P[ut] = {});
1235
- (P[c].vx != Dt || P[c].vy != tt || P[c].el !== D) && (P[c].el = D, P[c].vx = Dt, P[c].vy = tt, clearInterval(P[c].pid), (Dt != 0 || tt != 0) && (u = !0, P[c].pid = setInterval((function() {
1236
- n && this.layer === 0 && g.active._onTouchMove(ee);
1237
- var St = P[this.layer].vy ? P[this.layer].vy * l : 0, it = P[this.layer].vx ? P[this.layer].vx * l : 0;
1238
- typeof d == "function" && d.call(g.dragged.parentNode[R], it, St, o, ee, P[this.layer].el) !== "continue" || He(P[this.layer].el, it, St);
1239
- }).bind({
1240
- layer: c
1241
- }), 24))), c++;
1242
- } while (t.bubbleScroll && p !== s && (p = lt(p, !1)));
1243
- ve = u;
1244
- }
1245
- }, 30), Ue = function(t) {
1246
- var e = t.originalEvent, n = t.putSortable, i = t.dragEl, r = t.activeSortable, a = t.dispatchSortableEvent, l = t.hideGhostForTarget, s = t.unhideGhostForTarget;
1247
- if (e) {
1248
- var u = n || r;
1249
- l();
1250
- var d = e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e, c = document.elementFromPoint(d.clientX, d.clientY);
1251
- s(), u && !u.el.contains(c) && (a("spill"), this.onSpill({
1252
- dragEl: i,
1253
- putSortable: n
1254
- }));
1255
- }
1256
- };
1257
- function Ee() {
1258
- }
1259
- Ee.prototype = {
1260
- startIndex: null,
1261
- dragStart: function(t) {
1262
- var e = t.oldDraggableIndex;
1263
- this.startIndex = e;
1264
- },
1265
- onSpill: function(t) {
1266
- var e = t.dragEl, n = t.putSortable;
1267
- this.sortable.captureAnimationState(), n && n.captureAnimationState();
1268
- var i = yt(this.sortable.el, this.startIndex, this.options);
1269
- i ? this.sortable.el.insertBefore(e, i) : this.sortable.el.appendChild(e), this.sortable.animateAll(), n && n.animateAll();
1270
- },
1271
- drop: Ue
1272
- };
1273
- $(Ee, {
1274
- pluginName: "revertOnSpill"
1275
- });
1276
- function De() {
1277
- }
1278
- De.prototype = {
1279
- onSpill: function(t) {
1280
- var e = t.dragEl, n = t.putSortable, i = n || this.sortable;
1281
- i.captureAnimationState(), e.parentNode && e.parentNode.removeChild(e), i.animateAll();
1282
- },
1283
- drop: Ue
1284
- };
1285
- $(De, {
1286
- pluginName: "removeOnSpill"
1287
- });
1288
- var U;
1289
- function On() {
1290
- function o() {
1291
- this.defaults = {
1292
- swapClass: "sortable-swap-highlight"
1293
- };
1294
- }
1295
- return o.prototype = {
1296
- dragStart: function(e) {
1297
- var n = e.dragEl;
1298
- U = n;
1299
- },
1300
- dragOverValid: function(e) {
1301
- var n = e.completed, i = e.target, r = e.onMove, a = e.activeSortable, l = e.changed, s = e.cancel;
1302
- if (a.options.swap) {
1303
- var u = this.sortable.el, d = this.options;
1304
- if (i && i !== u) {
1305
- var c = U;
1306
- r(i) !== !1 ? (I(i, d.swapClass, !0), U = i) : U = null, c && c !== U && I(c, d.swapClass, !1);
1307
- }
1308
- l(), n(!0), s();
1309
- }
1310
- },
1311
- drop: function(e) {
1312
- var n = e.activeSortable, i = e.putSortable, r = e.dragEl, a = i || this.sortable, l = this.options;
1313
- U && I(U, l.swapClass, !1), U && (l.swap || i && i.options.swap) && r !== U && (a.captureAnimationState(), a !== n && n.captureAnimationState(), Tn(r, U), a.animateAll(), a !== n && n.animateAll());
1314
- },
1315
- nulling: function() {
1316
- U = null;
1317
- }
1318
- }, $(o, {
1319
- pluginName: "swap",
1320
- eventProperties: function() {
1321
- return {
1322
- swapItem: U
1323
- };
1324
- }
1325
- });
1326
- }
1327
- function Tn(o, t) {
1328
- var e = o.parentNode, n = t.parentNode, i, r;
1329
- !e || !n || e.isEqualNode(t) || n.isEqualNode(o) || (i = x(o), r = x(t), e.isEqualNode(n) && i < r && r++, e.insertBefore(t, e.children[i]), n.insertBefore(o, n.children[r]));
1330
- }
1331
- var m = [], K = [], Ct, V, Ot = !1, H = !1, mt = !1, C, Tt, Lt;
1332
- function An() {
1333
- function o(t) {
1334
- for (var e in this)
1335
- e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
1336
- t.options.avoidImplicitDeselect || (t.options.supportPointer ? y(document, "pointerup", this._deselectMultiDrag) : (y(document, "mouseup", this._deselectMultiDrag), y(document, "touchend", this._deselectMultiDrag))), y(document, "keydown", this._checkKeyDown), y(document, "keyup", this._checkKeyUp), this.defaults = {
1337
- selectedClass: "sortable-selected",
1338
- multiDragKey: null,
1339
- avoidImplicitDeselect: !1,
1340
- setData: function(i, r) {
1341
- var a = "";
1342
- m.length && V === t ? m.forEach(function(l, s) {
1343
- a += (s ? ", " : "") + l.textContent;
1344
- }) : a = r.textContent, i.setData("Text", a);
1345
- }
1346
- };
1347
- }
1348
- return o.prototype = {
1349
- multiDragKeyDown: !1,
1350
- isMultiDrag: !1,
1351
- delayStartGlobal: function(e) {
1352
- var n = e.dragEl;
1353
- C = n;
1354
- },
1355
- delayEnded: function() {
1356
- this.isMultiDrag = ~m.indexOf(C);
1357
- },
1358
- setupClone: function(e) {
1359
- var n = e.sortable, i = e.cancel;
1360
- if (this.isMultiDrag) {
1361
- for (var r = 0; r < m.length; r++)
1362
- K.push(we(m[r])), K[r].sortableIndex = m[r].sortableIndex, K[r].draggable = !1, K[r].style["will-change"] = "", I(K[r], this.options.selectedClass, !1), m[r] === C && I(K[r], this.options.chosenClass, !1);
1363
- n._hideClone(), i();
1364
- }
1365
- },
1366
- clone: function(e) {
1367
- var n = e.sortable, i = e.rootEl, r = e.dispatchSortableEvent, a = e.cancel;
1368
- this.isMultiDrag && (this.options.removeCloneOnHide || m.length && V === n && (Fe(!0, i), r("clone"), a()));
1369
- },
1370
- showClone: function(e) {
1371
- var n = e.cloneNowShown, i = e.rootEl, r = e.cancel;
1372
- this.isMultiDrag && (Fe(!1, i), K.forEach(function(a) {
1373
- h(a, "display", "");
1374
- }), n(), Lt = !1, r());
1375
- },
1376
- hideClone: function(e) {
1377
- var n = this;
1378
- e.sortable;
1379
- var i = e.cloneNowHidden, r = e.cancel;
1380
- this.isMultiDrag && (K.forEach(function(a) {
1381
- h(a, "display", "none"), n.options.removeCloneOnHide && a.parentNode && a.parentNode.removeChild(a);
1382
- }), i(), Lt = !0, r());
1383
- },
1384
- dragStartGlobal: function(e) {
1385
- e.sortable, !this.isMultiDrag && V && V.multiDrag._deselectMultiDrag(), m.forEach(function(n) {
1386
- n.sortableIndex = x(n);
1387
- }), m = m.sort(function(n, i) {
1388
- return n.sortableIndex - i.sortableIndex;
1389
- }), mt = !0;
1390
- },
1391
- dragStarted: function(e) {
1392
- var n = this, i = e.sortable;
1393
- if (this.isMultiDrag) {
1394
- if (this.options.sort && (i.captureAnimationState(), this.options.animation)) {
1395
- m.forEach(function(a) {
1396
- a !== C && h(a, "position", "absolute");
1397
- });
1398
- var r = O(C, !1, !0, !0);
1399
- m.forEach(function(a) {
1400
- a !== C && Ie(a, r);
1401
- }), H = !0, Ot = !0;
1402
- }
1403
- i.animateAll(function() {
1404
- H = !1, Ot = !1, n.options.animation && m.forEach(function(a) {
1405
- ie(a);
1406
- }), n.options.sort && jt();
1407
- });
1408
- }
1409
- },
1410
- dragOver: function(e) {
1411
- var n = e.target, i = e.completed, r = e.cancel;
1412
- H && ~m.indexOf(n) && (i(!1), r());
1413
- },
1414
- revert: function(e) {
1415
- var n = e.fromSortable, i = e.rootEl, r = e.sortable, a = e.dragRect;
1416
- m.length > 1 && (m.forEach(function(l) {
1417
- r.addAnimationState({
1418
- target: l,
1419
- rect: H ? O(l) : a
1420
- }), ie(l), l.fromRect = a, n.removeAnimationState(l);
1421
- }), H = !1, In(!this.options.removeCloneOnHide, i));
1422
- },
1423
- dragOverCompleted: function(e) {
1424
- var n = e.sortable, i = e.isOwner, r = e.insertion, a = e.activeSortable, l = e.parentEl, s = e.putSortable, u = this.options;
1425
- if (r) {
1426
- if (i && a._hideClone(), Ot = !1, u.animation && m.length > 1 && (H || !i && !a.options.sort && !s)) {
1427
- var d = O(C, !1, !0, !0);
1428
- m.forEach(function(p) {
1429
- p !== C && (Ie(p, d), l.appendChild(p));
1430
- }), H = !0;
1431
- }
1432
- if (!i)
1433
- if (H || jt(), m.length > 1) {
1434
- var c = Lt;
1435
- a._showClone(n), a.options.animation && !Lt && c && K.forEach(function(p) {
1436
- a.addAnimationState({
1437
- target: p,
1438
- rect: Tt
1439
- }), p.fromRect = Tt, p.thisAnimationDuration = null;
1440
- });
1441
- } else
1442
- a._showClone(n);
1443
- }
1444
- },
1445
- dragOverAnimationCapture: function(e) {
1446
- var n = e.dragRect, i = e.isOwner, r = e.activeSortable;
1447
- if (m.forEach(function(l) {
1448
- l.thisAnimationDuration = null;
1449
- }), r.options.animation && !i && r.multiDrag.isMultiDrag) {
1450
- Tt = $({}, n);
1451
- var a = ht(C, !0);
1452
- Tt.top -= a.f, Tt.left -= a.e;
1453
- }
1454
- },
1455
- dragOverAnimationComplete: function() {
1456
- H && (H = !1, jt());
1457
- },
1458
- drop: function(e) {
1459
- var n = e.originalEvent, i = e.rootEl, r = e.parentEl, a = e.sortable, l = e.dispatchSortableEvent, s = e.oldIndex, u = e.putSortable, d = u || this.sortable;
1460
- if (n) {
1461
- var c = this.options, p = r.children;
1462
- if (!mt)
1463
- if (c.multiDragKey && !this.multiDragKeyDown && this._deselectMultiDrag(), I(C, c.selectedClass, !~m.indexOf(C)), ~m.indexOf(C))
1464
- m.splice(m.indexOf(C), 1), Ct = null, At({
1465
- sortable: a,
1466
- rootEl: i,
1467
- name: "deselect",
1468
- targetEl: C,
1469
- originalEvent: n
1470
- });
1471
- else {
1472
- if (m.push(C), At({
1473
- sortable: a,
1474
- rootEl: i,
1475
- name: "select",
1476
- targetEl: C,
1477
- originalEvent: n
1478
- }), n.shiftKey && Ct && a.el.contains(Ct)) {
1479
- var D = x(Ct), w = x(C);
1480
- ~D && ~w && D !== w && (function() {
1481
- var E, _;
1482
- w > D ? (_ = D, E = w) : (_ = w, E = D + 1);
1483
- for (var M = c.filter; _ < E; _++)
1484
- if (!~m.indexOf(p[_]) && G(p[_], c.draggable, r, !1)) {
1485
- var J = M && (typeof M == "function" ? M.call(a, n, p[_], a) : M.split(",").some(function(z) {
1486
- return G(p[_], z.trim(), r, !1);
1487
- }));
1488
- J || (I(p[_], c.selectedClass, !0), m.push(p[_]), At({
1489
- sortable: a,
1490
- rootEl: i,
1491
- name: "select",
1492
- targetEl: p[_],
1493
- originalEvent: n
1494
- }));
1495
- }
1496
- })();
1497
- } else
1498
- Ct = C;
1499
- V = d;
1500
- }
1501
- if (mt && this.isMultiDrag) {
1502
- if (H = !1, (r[R].options.sort || r !== i) && m.length > 1) {
1503
- var S = O(C), X = x(C, ":not(." + this.options.selectedClass + ")");
1504
- if (!Ot && c.animation && (C.thisAnimationDuration = null), d.captureAnimationState(), !Ot && (c.animation && (C.fromRect = S, m.forEach(function(E) {
1505
- if (E.thisAnimationDuration = null, E !== C) {
1506
- var _ = H ? O(E) : S;
1507
- E.fromRect = _, d.addAnimationState({
1508
- target: E,
1509
- rect: _
1510
- });
1511
- }
1512
- })), jt(), m.forEach(function(E) {
1513
- p[X] ? r.insertBefore(E, p[X]) : r.appendChild(E), X++;
1514
- }), s === x(C))) {
1515
- var j = !1;
1516
- m.forEach(function(E) {
1517
- if (E.sortableIndex !== x(E)) {
1518
- j = !0;
1519
- return;
1520
- }
1521
- }), j && (l("update"), l("sort"));
1522
- }
1523
- m.forEach(function(E) {
1524
- ie(E);
1525
- }), d.animateAll();
1526
- }
1527
- V = d;
1528
- }
1529
- (i === r || u && u.lastPutMode !== "clone") && K.forEach(function(E) {
1530
- E.parentNode && E.parentNode.removeChild(E);
1531
- });
1532
- }
1533
- },
1534
- nullingGlobal: function() {
1535
- this.isMultiDrag = mt = !1, K.length = 0;
1536
- },
1537
- destroyGlobal: function() {
1538
- this._deselectMultiDrag(), b(document, "pointerup", this._deselectMultiDrag), b(document, "mouseup", this._deselectMultiDrag), b(document, "touchend", this._deselectMultiDrag), b(document, "keydown", this._checkKeyDown), b(document, "keyup", this._checkKeyUp);
1539
- },
1540
- _deselectMultiDrag: function(e) {
1541
- if (!(typeof mt < "u" && mt) && V === this.sortable && !(e && G(e.target, this.options.draggable, this.sortable.el, !1)) && !(e && e.button !== 0))
1542
- for (; m.length; ) {
1543
- var n = m[0];
1544
- I(n, this.options.selectedClass, !1), m.shift(), At({
1545
- sortable: this.sortable,
1546
- rootEl: this.sortable.el,
1547
- name: "deselect",
1548
- targetEl: n,
1549
- originalEvent: e
1550
- });
1551
- }
1552
- },
1553
- _checkKeyDown: function(e) {
1554
- e.key === this.options.multiDragKey && (this.multiDragKeyDown = !0);
1555
- },
1556
- _checkKeyUp: function(e) {
1557
- e.key === this.options.multiDragKey && (this.multiDragKeyDown = !1);
1558
- }
1559
- }, $(o, {
1560
- // Static methods & properties
1561
- pluginName: "multiDrag",
1562
- utils: {
1563
- /**
1564
- * Selects the provided multi-drag item
1565
- * @param {HTMLElement} el The element to be selected
1566
- */
1567
- select: function(e) {
1568
- var n = e.parentNode[R];
1569
- !n || !n.options.multiDrag || ~m.indexOf(e) || (V && V !== n && (V.multiDrag._deselectMultiDrag(), V = n), I(e, n.options.selectedClass, !0), m.push(e));
1570
- },
1571
- /**
1572
- * Deselects the provided multi-drag item
1573
- * @param {HTMLElement} el The element to be deselected
1574
- */
1575
- deselect: function(e) {
1576
- var n = e.parentNode[R], i = m.indexOf(e);
1577
- !n || !n.options.multiDrag || !~i || (I(e, n.options.selectedClass, !1), m.splice(i, 1));
1578
- }
1579
- },
1580
- eventProperties: function() {
1581
- var e = this, n = [], i = [];
1582
- return m.forEach(function(r) {
1583
- n.push({
1584
- multiDragElement: r,
1585
- index: r.sortableIndex
1586
- });
1587
- var a;
1588
- H && r !== C ? a = -1 : H ? a = x(r, ":not(." + e.options.selectedClass + ")") : a = x(r), i.push({
1589
- multiDragElement: r,
1590
- index: a
1591
- });
1592
- }), {
1593
- items: Je(m),
1594
- clones: [].concat(K),
1595
- oldIndicies: n,
1596
- newIndicies: i
1597
- };
1598
- },
1599
- optionListeners: {
1600
- multiDragKey: function(e) {
1601
- return e = e.toLowerCase(), e === "ctrl" ? e = "Control" : e.length > 1 && (e = e.charAt(0).toUpperCase() + e.substr(1)), e;
1602
- }
1603
- }
1604
- });
1605
- }
1606
- function In(o, t) {
1607
- m.forEach(function(e, n) {
1608
- var i = t.children[e.sortableIndex + (o ? Number(n) : 0)];
1609
- i ? t.insertBefore(e, i) : t.appendChild(e);
1610
- });
1611
- }
1612
- function Fe(o, t) {
1613
- K.forEach(function(e, n) {
1614
- var i = t.children[e.sortableIndex + (o ? Number(n) : 0)];
1615
- i ? t.insertBefore(e, i) : t.appendChild(e);
1616
- });
1617
- }
1618
- function jt() {
1619
- m.forEach(function(o) {
1620
- o !== C && o.parentNode && o.parentNode.removeChild(o);
1621
- });
1622
- }
1623
- g.mount(new Cn());
1624
- g.mount(De, Ee);
1625
- g.mount(new On());
1626
- g.mount(new An());
1627
- export {
1628
- g as default
1629
- };
1630
- //# sourceMappingURL=sortable.complete.esm-Df-311yt.js.map