react-virtual-sortable 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-virtual-sortable v1.0.0
2
+ * react-virtual-sortable v1.0.1
3
3
  * open source under the MIT license
4
4
  * https://github.com/mfuu/react-virtual-sortable#readme
5
5
  */
@@ -144,10 +144,10 @@
144
144
 
145
145
  var sortableDnd_min = {exports: {}};
146
146
 
147
- /*!
148
- * sortable-dnd v0.6.22
149
- * open source under the MIT license
150
- * https://github.com/mfuu/sortable-dnd#readme
147
+ /*!
148
+ * sortable-dnd v0.6.23
149
+ * open source under the MIT license
150
+ * https://github.com/mfuu/sortable-dnd#readme
151
151
  */
152
152
  sortableDnd_min.exports;
153
153
  (function (module, exports) {
@@ -155,21 +155,21 @@
155
155
  module.exports = e() ;
156
156
  }(commonjsGlobal, function () {
157
157
 
158
- function t(e) {
159
- return t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
160
- return typeof t;
161
- } : function (t) {
162
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
163
- }, t(e);
164
- }
165
- function e() {
166
- return e = Object.assign ? Object.assign.bind() : function (t) {
158
+ function t() {
159
+ return t = Object.assign ? Object.assign.bind() : function (t) {
167
160
  for (var e = 1; e < arguments.length; e++) {
168
161
  var n = arguments[e];
169
- for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
162
+ for (var o in n) ({}).hasOwnProperty.call(n, o) && (t[o] = n[o]);
170
163
  }
171
164
  return t;
172
- }, e.apply(this, arguments);
165
+ }, t.apply(null, arguments);
166
+ }
167
+ function e(t) {
168
+ return e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
169
+ return typeof t;
170
+ } : function (t) {
171
+ return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
172
+ }, e(t);
173
173
  }
174
174
  var n = {
175
175
  capture: !1,
@@ -310,12 +310,12 @@
310
310
  function x(t) {
311
311
  void 0 !== t.preventDefault && t.cancelable && t.preventDefault();
312
312
  }
313
- function C(t) {
314
- var n = t.sortable,
315
- o = t.name,
316
- i = t.evt,
313
+ function C(e) {
314
+ var n = e.sortable,
315
+ o = e.name,
316
+ i = e.evt,
317
317
  r = n.options[o];
318
- "function" == typeof r && r(e({}, i));
318
+ "function" == typeof r && r(t({}, i));
319
319
  }
320
320
  !function () {
321
321
  if ("undefined" == typeof window || "undefined" == typeof document) return "";
@@ -532,26 +532,26 @@
532
532
  Z,
533
533
  $,
534
534
  tt = [];
535
- function et(e) {
535
+ function et(t) {
536
536
  var n,
537
537
  o,
538
538
  i,
539
539
  r = {},
540
- s = e.group;
541
- s && "object" === t(s) || (s = {
540
+ s = t.group;
541
+ s && "object" === e(s) || (s = {
542
542
  name: s,
543
543
  pull: !0,
544
544
  put: !0,
545
545
  revertDrag: !0
546
- }), r.name = s.name, r.pull = null === (n = s.pull) || void 0 === n || n, r.put = null === (o = s.put) || void 0 === o || o, r.revertDrag = null === (i = s.revertDrag) || void 0 === i || i, e.group = r;
546
+ }), r.name = s.name, r.pull = null === (n = s.pull) || void 0 === n || n, r.put = null === (o = s.put) || void 0 === o || o, r.revertDrag = null === (i = s.revertDrag) || void 0 === i || i, t.group = r;
547
547
  }
548
548
  function nt(t) {
549
549
  var e = F || U;
550
550
  return !(void 0 !== t.clientX && void 0 !== t.clientY && Math.abs(t.clientX - e.clientX) <= 0 && Math.abs(t.clientY - e.clientY) <= 0);
551
551
  }
552
- function ot(t, n) {
553
- if (!t || !t.nodeType || 1 !== t.nodeType) throw "Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
554
- t[M] = this, this.el = t, this.options = n = e({}, n);
552
+ function ot(e, n) {
553
+ if (!e || !e.nodeType || 1 !== e.nodeType) throw "Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
554
+ e[M] = this, this.el = e, this.options = n = t({}, n);
555
555
  var o = {
556
556
  store: null,
557
557
  group: "",
@@ -588,7 +588,7 @@
588
588
  };
589
589
  for (var i in o) !(i in this.options) && (this.options[i] = o[i]);
590
590
  for (var r in et(n), this) "_" === r.charAt(0) && "function" == typeof this[r] && (this[r] = this[r].bind(this));
591
- c(t, this.options.supportTouch ? "touchstart" : "mousedown", this._onDrag), this.autoScroller = new T(this.options), this.multiplayer = new P(this.options), this.animator = new N(this.options), tt.push(t);
591
+ c(e, this.options.supportTouch ? "touchstart" : "mousedown", this._onDrag), this.autoScroller = new T(this.options), this.multiplayer = new P(this.options), this.animator = new N(this.options), tt.push(e);
592
592
  }
593
593
  return ot.prototype = {
594
594
  constructor: ot,
@@ -605,7 +605,7 @@
605
605
  clientY: (n || t).clientY
606
606
  }, k = i, c(Q = n ? k : document, "mouseup", this._onDrop), c(Q, "touchend", this._onDrop), c(Q, "touchcancel", this._onDrop), !this.multiplayer.useSelectHandle(t, o))) {
607
607
  var a = this.options.handle;
608
- if (("function" != typeof a || a(t)) && ("string" != typeof a || b(o, a))) {
608
+ if (("function" != typeof a || a(t)) && ("string" != typeof a || p(o, a, k))) {
609
609
  var h = this.options,
610
610
  u = h.delay,
611
611
  d = h.delayOnTouchOnly;
@@ -660,17 +660,18 @@
660
660
  },
661
661
  _appendGhost: function () {
662
662
  if (!B) {
663
- var t = this.options.fallbackOnBody ? document.body : this.el,
663
+ var e = this.options.fallbackOnBody ? document.body : this.el,
664
664
  n = this._getGhostElement();
665
665
  w(B = n.cloneNode(!0), this.options.ghostClass, !0);
666
666
  var o = d(k),
667
- i = e({
667
+ i = t({
668
668
  position: "fixed",
669
669
  top: o.top,
670
670
  left: o.left,
671
671
  width: o.width,
672
672
  height: o.height,
673
- zIndex: "100000",
673
+ margin: 0,
674
+ zIndex: 1e5,
674
675
  opacity: "0.8",
675
676
  overflow: "hidden",
676
677
  boxSizing: "border-box",
@@ -679,7 +680,7 @@
679
680
  pointerEvents: "none"
680
681
  }, this.options.ghostStyle);
681
682
  for (var r in i) S(B, r, i[r]);
682
- ot.ghost = B, t.appendChild(B);
683
+ ot.ghost = B, e.appendChild(B);
683
684
  var s = (U.clientX - o.left) / parseInt(B.style.width) * 100,
684
685
  l = (U.clientY - o.top) / parseInt(B.style.height) * 100;
685
686
  S(B, "transform-origin", "".concat(s, "% ").concat(l, "%")), S(B, "will-change", "transform");
@@ -829,32 +830,32 @@
829
830
  evt: this._getEventProperties(t)
830
831
  }), F && this._onEnd(t), !F && this.animator.animate()), !nt(t.changedTouches ? t.changedTouches[0] : t) && this.multiplayer.onSelect(t, k, R, this), B && B.parentNode && B.parentNode.removeChild(B), this._nulling();
831
832
  },
832
- _onEnd: function (t) {
833
+ _onEnd: function (e) {
833
834
  w(Y, this.options.chosenClass, !1), w(Y, this.options.placeholderClass, !1);
834
835
  var n = "clone" === z;
835
836
  this.multiplayer.onDrop(H, O, n);
836
- var o = this._getEventProperties(t),
837
+ var o = this._getEventProperties(e),
837
838
  i = this.options,
838
839
  r = i.swapOnDrop,
839
840
  s = i.removeCloneOnDrop;
840
841
  n && H !== O || !("function" == typeof r ? r(o) : r) || A.insertBefore(k, Y), n && H !== O && !this.multiplayer.isActive() || !("function" == typeof s ? s(o) : s) || Y && Y.parentNode && Y.parentNode.removeChild(Y), S(k, "display", ""), this.animator.animate(), H !== O && C({
841
842
  sortable: H[M],
842
843
  name: "onDrop",
843
- evt: e({}, o, n ? J : {
844
+ evt: t({}, o, n ? J : {
844
845
  newIndex: -1
845
846
  })
846
847
  }), C({
847
848
  sortable: O[M],
848
849
  name: "onDrop",
849
- evt: e({}, o, H === O ? {} : {
850
+ evt: t({}, o, H === O ? {} : {
850
851
  oldIndex: -1
851
852
  })
852
853
  });
853
854
  },
854
- _getEventProperties: function (t) {
855
+ _getEventProperties: function (e) {
855
856
  var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
856
857
  o = {};
857
- return o.event = t, o.to = O, o.from = H, o.node = k, o.clone = Y, o.target = W, o.oldIndex = V, o.newIndex = j, o.pullMode = z, e(o, this.multiplayer.eventProperties(), n), o.relative = W === k ? 0 : _(Y, W), o;
858
+ return o.event = e, o.to = O, o.from = H, o.node = k, o.clone = Y, o.target = W, o.oldIndex = V, o.newIndex = j, o.pullMode = z, t(o, this.multiplayer.eventProperties(), n), o.relative = W === k ? 0 : _(Y, W), o;
858
859
  },
859
860
  _nulling: function () {
860
861
  O = H = k = L = X = Y = B = R = W = A = z = V = j = G = U = F = q = J = K = Q = Z = $ = ot.clone = ot.ghost = ot.active = ot.dragged = null, this.multiplayer.nulling(), this.autoScroller.nulling();
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * react-virtual-sortable v1.0.0
2
+ * react-virtual-sortable v1.0.1
3
3
  * open source under the MIT license
4
4
  * https://github.com/mfuu/react-virtual-sortable#readme
5
5
  */
6
6
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualList=e(t.React)}(this,(function(t){"use strict";function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(t);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,c(o.key),o)}}function s(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,i,r,s,l=[],a=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=r.call(n)).done)&&(l.push(o.value),l.length!==e);a=!0);}catch(t){c=!0,i=t}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return l}}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function h(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f={exports:{}};
7
7
  /*!
8
- * sortable-dnd v0.6.22
8
+ * sortable-dnd v0.6.23
9
9
  * open source under the MIT license
10
10
  * https://github.com/mfuu/sortable-dnd#readme
11
- */!function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),l=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,a=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),s=i+o.height,l=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:l,width:c,height:a}}}function f(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function v(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!S(t,e)||"none"===w(t,"display")||n++;return n}function m(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==w(s[i],"display")&&f(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=m(t,0,e),l=m(t,1,e),a=i&&w(i),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=o&&"none"===n[f]||l&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function k(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function E(t){var n=t.sortable,o=t.name,i=t.evt,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"];(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}();var O,I,T,z="Sortable"+Date.now();function C(t){this.options=t,this.scrollEl=null,this.autoScrollInterval=null}function D(t){this.options=t,this.stack=[]}function _(t){this.options=t||{},this.selects=[]}C.prototype={nulling:function(){this.autoScrollInterval&&(clearInterval(this.autoScrollInterval),this.autoScrollInterval=null)},onStarted:function(){var t=this;this.nulling(),this.autoScrollInterval=setInterval((function(){t.autoScroll()}))},onMove:function(t,e,n){this.options=n,this.scrollEl=t,this.moveEvent=e},autoScroll:function(){var t=this.moveEvent,e=this.scrollEl;if(e&&void 0!==t.clientX&&void 0!==t.clientY){var n=d(e);if(n){var o=t.clientX,i=t.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>s||i>l||o<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,v=e.scrollTop,g=e.scrollLeft,m=e.scrollHeight,y=v>0&&i>=r&&i<=r+f,b=g+u<e.scrollWidth&&o<=s&&o>=s-f,S=v+c<m&&i<=l&&i>=l-f;g>0&&o>=a&&o<=a+f&&(e.scrollLeft+=Math.floor(Math.max(-1,(o-a)/f-1)*p.x)),b&&(e.scrollLeft+=Math.ceil(Math.min(1,(o-s)/f+1)*p.x)),y&&(e.scrollTop+=Math.floor(Math.max(-1,(i-r)/f-1)*p.y)),S&&(e.scrollTop+=Math.ceil(Math.min(1,(i-l)/f+1)*p.y))}}}}},D.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),l=[],a=0,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(h.top-h.height>r||h.left-h.width>i)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){var t=this.stack.pop();if(t&&this.options.animation)for(var e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this.execute(i,r)}},execute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d(".concat(o,"px, ").concat(i,"px, 0)")),this.repaintDummy=function(t){return t.offsetWidth}(t);var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform ".concat(s,"ms ").concat(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},_.prototype={eventProperties:function(){return{nodes:O||[],clones:I||[]}},isActive:function(){return!!O},nulling:function(){O=I=T=null},select:function(t){b(t,this.options.selectedClass,!0),this.selects.push(t),this.selects.sort((function(t,e){return x(t,e)}))},deselect:function(t){var e=this.selects.indexOf(t);e>-1&&(b(t,this.options.selectedClass,!1),this.selects.splice(e,1))},useSelectHandle:function(t,e){var n=this.options.selectHandle;return!!(T="function"==typeof n&&n(t)||"string"==typeof n&&S(e,n))},onChoose:function(){!this.options.multiple||0===this.selects.length||this.selects.indexOf(ot.dragged)<0||(this.selects.sort((function(t,e){return x(t,e)})),O=this.selects,this.toggleChosenClass(!0))},onDrop:function(t,e,n){if(O){var o=ot.dragged,i=ot.clone,r=O.indexOf(o);t!==e&&n?(w(i,"display","none"),this.toggleVisible(!0),I=O.map((function(t){return t.cloneNode(!0)})),this.sortElements(I,r,i)):this.sortElements(O,r,i),t!==e&&(e[z].multiplayer.toggleSelected(I||O,"add"),!n&&t[z].multiplayer.toggleSelected(O,"remove"))}},onSelect:function(t,e,n,o){var i=this.options,r=i.multiple,s=i.selectHandle;if(r&&(s&&T||!s&&!n)){var l=this.selects.indexOf(e);b(e,this.options.selectedClass,l<0);var a={from:o.el,event:t,node:e,index:g(e)};l<0?(this.selects.push(e),E({sortable:o,name:"onSelect",evt:a})):(this.selects.splice(l,1),E({sortable:o,name:"onDeselect",evt:a})),this.selects.sort((function(t,e){return x(t,e)}))}},toggleChosenClass:function(t){if(O)for(var e=0,n=O.length;e<n;e++)b(O[e],this.options.chosenClass,t)},toggleVisible:function(t){if(O)for(var e=0,n=O.length;e<n;e++)O[e]!=ot.dragged&&w(O[e],"display",t?"":"none")},toggleSelected:function(t,e){var n=this;"add"===e?t.forEach((function(t){return n.selects.push(t)})):this.selects=this.selects.filter((function(e){return t.indexOf(e)<0}))},sortElements:function(t,e,n){for(var o=0,i=t.length;o<i;o++)if(w(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var r=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],r.nextSibling)}}};var M,R,N,B,j,A,H,P,K,L,F,Y,U,W,X,q,V,G,$,J,Q,Z,tt=[];function et(e){var n,o,i,r={},s=e.group;s&&"object"===t(s)||(s={name:s,pull:!0,put:!0,revertDrag:!0}),r.name=s.name,r.pull=null===(n=s.pull)||void 0===n||n,r.put=null===(o=s.put)||void 0===o||o,r.revertDrag=null===(i=s.revertDrag)||void 0===i||i,e.group=r}function nt(t){var e=q||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[z]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:">*",selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",placeholderClass:"",swapOnDrop:!0,removeCloneOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new C(this.options),this.multiplayer=new _(this.options),this.animator=new D(this.options),tt.push(t)}return ot.prototype={constructor:ot,_onDrag:function(t){var e=this;if(!N&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!l||!o||"SELECT"!==o.tagName.toUpperCase()){var i=f(o,this.options.draggable,this.el);if(i&&!i.animated&&(X={event:t,clientX:(n||t).clientX,clientY:(n||t).clientY},N=i,c(J=n?N:document,"mouseup",this._onDrop),c(J,"touchend",this._onDrop),c(J,"touchcancel",this._onDrop),!this.multiplayer.useSelectHandle(t,o))){var a=this.options.handle;if(("function"!=typeof a||a(t))&&("string"!=typeof a||S(o,a))){var u=this.options,h=u.delay,d=u.delayOnTouchOnly;!h||d&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Z=setTimeout((function(){return e._onStart(n,t)}),h)),c(document,"selectstart",k),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z),u(this.el.ownerDocument,"touchmove",this._delayMoveHandler),u(this.el.ownerDocument,"mousemove",this._delayMoveHandler),u(this.el.ownerDocument,"mouseup",this._cancelStart),u(this.el.ownerDocument,"touchend",this._cancelStart),u(this.el.ownerDocument,"touchcancel",this._cancelStart),u(document,"selectstart",k),l&&w(document.body,"user-select","")},_onStart:function(t,e){k(e);var n=g(N);M=this.el,R=this.el,K=N,Y=n,U=n,W=n,G={to:this.el,target:N,newIndex:n,relative:0},$=N,P=this.el,A=N.cloneNode(!0),L=N.parentNode,F=this.options.group.pull,ot.clone=A,ot.active=this,ot.dragged=N,this.multiplayer.onChoose(),b(N,this.options.chosenClass,!0),E({sortable:this,name:"onChoose",evt:this._getEventProperties(e)}),c(J,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){this.animator.collect(L),b(A,this.options.chosenClass,!0),b(A,this.options.placeholderClass,!0),this._appendGhost(),this.multiplayer.toggleVisible(!1),w(N,"display","none"),N.parentNode.insertBefore(A,N),E({sortable:this,name:"onDrag",evt:this._getEventProperties(X.event)}),this.animator.animate(),this.autoScroller.onStarted()},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selects;return t(this.multiplayer.isActive()?e:[N])}return N},_appendGhost:function(){if(!H){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(H=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(N),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)w(H,r,i[r]);ot.ghost=H,t.appendChild(H);var s=(X.clientX-o.left)/parseInt(H.style.width)*100,l=(X.clientY-o.top)/parseInt(H.style.height)*100;w(H,"transform-origin","".concat(s,"% ").concat(l,"%")),w(H,"will-change","transform")}},_nearestSortable:function(t){k(t);var e=t.touches&&t.touches[0]||t;if(N&&nt(e)){!q&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-X.clientX,l=i-X.clientY;q={event:t,clientX:o,clientY:i},w(H,"transform","translate3d(".concat(s,"px, ").concat(l,"px, 0)"));var a,c,u,f=(a=o,c=i,tt.reduce((function(t,e){var n=e[z].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=a>=o.left-n&&a<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}}),null));f&&f[z]._onMove(t,r);var p=f?f[z].options:null,v=null;(!f||p.autoScroll)&&X&&q&&(v=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(r,!0)),this.autoScroller.onMove(v,q,p||this.options)}},_allowPut:function(){if(P===this.el)return!0;if(!this.options.group.put)return!1;var t=this.options.group,e=t.name,n=t.put,o=P[z].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(q.event,A,this):n:y(L,e)},_allowSwap:function(){var t=d(B),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=B[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,l=m(L,0,this.options.draggable),a=v(L),c=d(l),u=d(a);if(B===L||p(L,B))return A===l&&r<c[n]?(j=B,!0):A===a&&r>u[o]&&(j=B.nextSibling,!0);var h=x(A,B);return j=h<0?B.nextSibling:B,V!==B?(Q=s,!0):Q!==s&&(Q=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(B=f(e,this.options.draggable,this.el),E({sortable:this,name:"onMove",evt:this._getEventProperties(t,{target:B})}),this.options.sortable||this.el!==P)return this.el===R||e!==this.el&&v(this.el)?void(B&&!B.animated&&!p(B,A)&&this._allowSwap()&&(B!==A&&j!==A?(this.el!==R?this._onInsert(t):B!==N&&this._onChange(t),V=B):V=B)):(B=V=null,void this._onInsert(t));R!==P&&(B=V=N,Q=0,this._onInsert(t))}},_onInsert:function(t){var e=B||A,n="clone"===F&&this.el!==P&&R===P,o="clone"===F&&this.el===P&&R!==P,i=p(B,document),r=B===N&&!i,s=R[z],l=P[z];M=this.el,Y=g(A),K=e,L=i?B.parentNode:this.el,s.animator.collect(A.parentNode),this.animator.collect(L),n&&(G.target=$,G.newIndex=Y,G.relative=$===N?0:x(A,$),w(N,"display",""),l.multiplayer.toggleVisible(!0),l.options.group.revertDrag||A.parentNode.insertBefore(N,A)),o&&(Y=g(N),w(N,"display","none"),this.multiplayer.toggleVisible(!1)),w(A,"display",r?"none":""),B&&i?L.insertBefore(A,Q<0?B:B.nextSibling):L.appendChild(A),U=r?W:g(A),n&&l.options.group.revertDrag&&(G.target=N,G.newIndex=W,G.relative=0,E({sortable:l,name:"onChange",evt:this._getEventProperties(t,{to:P,target:N,newIndex:W,revertDrag:!0})})),n||E({sortable:s,name:"onRemove",evt:this._getEventProperties(t,{newIndex:-1})}),o&&e!==N&&($=e,E({sortable:this,name:"onChange",evt:this._getEventProperties(t,{from:P,backToOrigin:!0})})),o||E({sortable:this,name:"onAdd",evt:this._getEventProperties(t,{oldIndex:-1})}),s.animator.animate(),this.animator.animate(),R=this.el},_onChange:function(t){this.animator.collect(L),Y=g(A),L=B.parentNode,K=B,this.el===P&&($=B),L.insertBefore(A,j),U=g(A),E({sortable:this,name:"onChange",evt:this._getEventProperties(t)}),this.animator.animate(),R=this.el},_onDrop:function(t){this._cancelStart(),u(J,"touchmove",this._nearestSortable),u(J,"mousemove",this._nearestSortable),u(J,"mouseup",this._onDrop),u(J,"touchend",this._onDrop),u(J,"touchcancel",this._onDrop),P&&(R=P,Y=W,K===A&&(K=N),this.animator.collect(L),this.multiplayer.toggleChosenClass(!1),b(N,this.options.chosenClass,!1),E({sortable:this,name:"onUnchoose",evt:this._getEventProperties(t)}),q&&this._onEnd(t),!q&&this.animator.animate()),!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,N,P,this),H&&H.parentNode&&H.parentNode.removeChild(H),this._nulling()},_onEnd:function(t){b(A,this.options.chosenClass,!1),b(A,this.options.placeholderClass,!1);var n="clone"===F;this.multiplayer.onDrop(R,M,n);var o=this._getEventProperties(t),i=this.options,r=i.swapOnDrop,s=i.removeCloneOnDrop;n&&R!==M||!("function"==typeof r?r(o):r)||L.insertBefore(N,A),n&&R!==M&&!this.multiplayer.isActive()||!("function"==typeof s?s(o):s)||A&&A.parentNode&&A.parentNode.removeChild(A),w(N,"display",""),this.animator.animate(),R!==M&&E({sortable:R[z],name:"onDrop",evt:e({},o,n?G:{newIndex:-1})}),E({sortable:M[z],name:"onDrop",evt:e({},o,R===M?{}:{oldIndex:-1})})},_getEventProperties:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=M,o.from=R,o.node=N,o.clone=A,o.target=K,o.oldIndex=Y,o.newIndex=U,o.pullMode=F,e(o,this.multiplayer.eventProperties(),n),o.relative=K===N?0:x(A,K),o},_nulling:function(){M=R=N=B=j=A=H=P=K=L=F=Y=U=W=X=q=V=G=$=J=Q=Z=ot.clone=ot.ghost=ot.active=ot.dragged=null,this.multiplayer.nulling(),this.autoScroller.nulling()},destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[z]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selects}},ot.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},ot.get=function(t){return t[z]},ot.create=function(t,e){return new ot(t,e)},ot}()}(f);var p=d(f.exports);function v(t,e){var n,o=function(){for(var o=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=null,t.apply(o,r)}),e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function g(t,e){var n=v(t,e),o=function(){n.cancel(),n.apply(this,arguments)};return o.cancel=function(){n.cancel()},o}function m(t,e){return t==e}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}function b(t){return t instanceof Document&&9===t.nodeType||t instanceof Window}var S=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","fallbackOnBody","scrollThreshold","delayOnTouchOnly","placeholderClass"],w=function(){function t(e,n){i(this,t),this.el=e,this.options=n,this.rangeChanged=!1,this.installSortable()}return s(t,[{key:"destroy",value:function(){this.sortable.destroy(),this.rangeChanged=!1}},{key:"option",value:function(t,e){this.options[t]=e,S.includes(t)&&this.sortable.option(t,e)}},{key:"installSortable",value:function(){var t=this,e=S.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new p(this.el,Object.assign(Object.assign({},e),{emptyInsertThreshold:0,swapOnDrop:function(t){return t.from===t.to},removeCloneOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)},onChoose:function(e){return t.onChoose(e)},onUnchoose:function(e){return t.onUnchoose(e)}}))}},{key:"onChoose",value:function(t){this.dispatchEvent("onChoose",t)}},{key:"onUnchoose",value:function(t){this.dispatchEvent("onUnchoose",t)}},{key:"onDrag",value:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),o=this.options.list[n],i=this.options.uniqueKeys[n];this.sortable.option("store",{item:o,key:i,index:n}),this.dispatchEvent("onDrag",{item:o,key:i,index:n,event:t})}},{key:"onDrop",value:function(t){var e,n,o,i=null===(e=p.get(t.from))||void 0===e?void 0:e.option("store"),r=i.item,s=i.key,l=i.index,c=this.options.list,u={key:s,item:r,list:c,event:t,changed:!1,oldList:a(c),oldIndex:l,newIndex:l};t.from===t.to&&t.node===t.target||this.handleDropEvent(t,u,l),this.dispatchEvent("onDrop",u),t.from===this.el&&this.rangeChanged&&(null===(n=p.dragged)||void 0===n||n.remove()),t.from!==t.to&&(null===(o=p.clone)||void 0===o||o.remove()),this.rangeChanged=!1}},{key:"handleDropEvent",value:function(t,e,n){var o=t.target.getAttribute("data-key"),i=-1,r=n;t.from===t.to?(((r=this.getIndex(e.key))<(i=this.getIndex(o))&&-1===t.relative||r>i&&1===t.relative)&&(i+=t.relative),i!==r&&(e.list.splice(r,1),e.list.splice(i,0,e.item))):(t.from===this.el&&(r=this.getIndex(e.key),e.list.splice(r,1)),t.to===this.el&&(r=-1,i=this.getIndex(o),0===t.relative?i=e.list.length:1===t.relative&&(i+=t.relative),e.list.splice(i,0,e.item))),e.changed=t.from!==t.to||i!==r,e.oldIndex=r,e.newIndex=i}},{key:"getIndex",value:function(t){if(null==t)return-1;for(var e=this.options.uniqueKeys,n=0,o=e.length;n<o;n++)if(m(e[n],t))return n;return-1}},{key:"dispatchEvent",value:function(t,e){var n=this.options[t];n&&n(e)}}]),t}(),x=["size","keeps","scroller","direction","debounceTime","throttleTime"],k=function(){function t(e){i(this,t),this.options=e;var n={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var o in n)!(o in this.options)&&(this.options[o]=n[o]);this.sizes=new Map,this.sizeType="INIT",this.fixedSize=0,this.averageSize=0,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.direction="STATIONARY",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,e.keeps-1)}return s(t,[{key:"isFixed",value:function(){return"FIXED"===this.sizeType}},{key:"isFront",value:function(){return"FRONT"===this.direction}},{key:"isBehind",value:function(){return"BEHIND"===this.direction}},{key:"isHorizontal",value:function(){return"horizontal"===this.options.direction}},{key:"getSize",value:function(t){return this.sizes.get(t)||this.getItemSize()}},{key:"getOffset",value:function(){var t=this.isHorizontal()?"scrollLeft":"scrollTop";return this.scrollEl[t]}},{key:"getScrollSize",value:function(){var t=this.isHorizontal()?"scrollWidth":"scrollHeight";return this.scrollEl[t]}},{key:"getClientSize",value:function(){var t=this.isHorizontal()?"offsetWidth":"offsetHeight";return this.scrollEl[t]}},{key:"scrollToOffset",value:function(t){var e=this.isHorizontal()?"scrollLeft":"scrollTop";this.scrollEl[e]=t}},{key:"scrollToIndex",value:function(t){if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else{var e=this.getOffsetByRange(0,t),n=this.getScrollStartOffset();this.scrollToOffset(e+n)}}},{key:"scrollToBottom",value:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout((function(){var e=t.getClientSize(),n=t.getScrollSize();t.getOffset()+e+1<n&&t.scrollToBottom()}),5)}},{key:"option",value:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,o){e.includes(o)||n.sizes.delete(o)})),"scroller"===t&&(o&&p.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())}},{key:"updateRange",value:function(t){if(t)this.handleUpdate(t.start);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e)}}},{key:"onItemResized",value:function(t,e){e&&this.sizes.get(t)!==e&&(this.sizes.set(t,e),"INIT"===this.sizeType?(this.sizeType="FIXED",this.fixedSize=e):this.isFixed()&&this.fixedSize!==e&&(this.sizeType="DYNAMIC",this.fixedSize=0),this.averageSize||"DYNAMIC"!==this.sizeType||this.sizes.size!==this.options.keeps||this.updateAverageSize())}},{key:"updateAverageSize",value:function(){var t=a(this.sizes.values()).reduce((function(t,e){return t+e}),0);this.averageSize=Math.round(t/this.sizes.size)}},{key:"addScrollEventListener",value:function(){this.options.scroller&&p.utils.on(this.options.scroller,"scroll",this.onScroll)}},{key:"removeScrollEventListener",value:function(){this.options.scroller&&p.utils.off(this.options.scroller,"scroll",this.onScroll)}},{key:"enableScroll",value:function(t){var e=this.options.scroller,n=t?p.utils.off:p.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"preventDefaultForKeyDown",value:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1}},{key:"updateScrollElement",value:function(){var t=this.options.scroller;if(b(t)){var e=document.scrollingElement||document.documentElement||document.body;this.scrollEl=e}else this.scrollEl=t}},{key:"updateOnScrollFunction",value:function(){var t=this,e=this.options,n=e.debounceTime,o=e.throttleTime;this.onScroll=n?g((function(){return t.handleScroll()}),n):o?v((function(){return t.handleScroll()}),o):function(){return t.handleScroll()}}},{key:"handleScroll",value:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.direction="STATIONARY":this.direction=t<this.offset?"FRONT":"BEHIND",this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t+1>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.direction}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();if(!(t>=this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value:function(){var t=this.offset-this.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.fixedSize);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByRange(0,o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?t=0:e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t)}},{key:"handleUpdate",value:function(t){this.range.start=t,this.range.end=this.getEndByStart(t),this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.options.onUpdate(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.fixedSize*this.range.start:this.getOffsetByRange(0,this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.fixedSize:(e-t)*this.getItemSize()}},{key:"getOffsetByRange",value:function(t,e){if(t>=e)return 0;for(var n=0,o=t;o<e;o++){var i=this.sizes.get(this.options.uniqueKeys[o]);n+="number"==typeof i?i:this.getItemSize()}return n}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,n=t.keeps;return e.length>0?e.length-1:n-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.fixedSize:this.options.size||this.averageSize}},{key:"getScrollStartOffset",value:function(){var t=this.options,e=t.wrapper,n=t.scroller;if(n===e)return 0;var o=0;if(n&&e){var i=this.isHorizontal()?"left":"top",r=b(n)?p.utils.getRect(e):p.utils.getRect(e,!0,n);o=this.offset+r[i]}return o}}]),t}();function E(t){var e=t.dataKey,o=t.sizeKey,i=t.dragging,r=t.chosenKey,s=t.children,l=t.onSizeChange,a=n.useRef(null);n.useLayoutEffect((function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":u(ResizeObserver))&&(t=new ResizeObserver((function(){var t=a.current[o];l(e,t)})),a.current&&(null==t||t.observe(a.current))),function(){t&&(t.disconnect(),t=null)}}),[a]);var c=n.useMemo((function(){var t=s.props.style||{},n=m(e,r);return i&&n?Object.assign(t,{display:"none"}):t}),[r,i]);return n.cloneElement(s,{"data-key":e,role:"item",ref:a,style:c,className:s.props.className})}var O=n.memo(E);function I(t,e){n.useEffect(e,Object.values(t))}var T="onDrag",z="onDrop",C="onTop",D="onBottom";function _(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,s=void 0===r?[]:r,u=t.tableMode,h=void 0!==u&&u,d=t.wrapTag,f=void 0===d?"div":d,p=t.rootTag,v=void 0===p?"div":p,b=t.style,E=void 0===b?{}:b,_=t.className,M=void 0===_?"":_,R=t.wrapStyle,N=void 0===R?{}:R,B=t.wrapClass,j=void 0===B?"":B,A=t.size,H=void 0===A?void 0:A,P=t.keeps,K=void 0===P?30:P,L=t.scroller,F=void 0===L?void 0:L,Y=t.direction,U=void 0===Y?"vertical":Y,W=t.debounceTime,X=void 0===W?0:W,q=t.throttleTime,V=void 0===q?0:q,G=t.delay,$=void 0===G?0:G,J=t.group,Q=void 0===J?"":J,Z=t.handle,tt=void 0===Z?"":Z,et=t.lockAxis,nt=void 0===et?void 0:et,ot=t.disabled,it=void 0!==ot&&ot,rt=t.sortable,st=void 0===rt||rt,lt=t.draggable,at=void 0===lt?'[role="item"]':lt,ct=t.animation,ut=void 0===ct?150:ct,ht=t.autoScroll,dt=void 0===ht||ht,ft=t.scrollSpeed,pt=void 0===ft?{x:10,y:10}:ft,vt=t.ghostClass,gt=void 0===vt?"":vt,mt=t.ghostStyle,yt=void 0===mt?void 0:mt,bt=t.chosenClass,St=void 0===bt?"":bt,wt=t.placeholderClass,xt=void 0===wt?"":wt,kt=t.fallbackOnBody,Et=void 0!==kt&&kt,Ot=t.scrollThreshold,It=void 0===Ot?55:Ot,Tt=t.delayOnTouchOnly,zt=void 0!==Tt&&Tt,Ct=l(n.useState({start:0,end:K-1,front:0,behind:0}),2),Dt=Ct[0],_t=Ct[1],Mt=n.useRef(!1),Rt=n.useRef(""),Nt=n.useRef([]),Bt=n.useRef(),jt=n.useRef(),At=function(t){return qt.current.getSize(t)},Ht=function(){return qt.current.getOffset()},Pt=function(){return qt.current.getClientSize()},Kt=function(){return qt.current.getScrollSize()},Lt=function(t){var e;null===(e=qt.current)||void 0===e||e.scrollToOffset(t)},Ft=function(t){var e;null===(e=qt.current)||void 0===e||e.scrollToIndex(t)},Yt=function(t){var e,n=Nt.current.indexOf(t);n>-1&&(null===(e=qt.current)||void 0===e||e.scrollToIndex(n))},Ut=function(){Lt(0)},Wt=function(){var t;null===(t=qt.current)||void 0===t||t.scrollToBottom()};n.useImperativeHandle(e,(function(){return{getSize:At,getOffset:Ht,getClientSize:Pt,getScrollSize:Kt,scrollToTop:Ut,scrollToKey:Yt,scrollToIndex:Ft,scrollToOffset:Lt,scrollToBottom:Wt}})),n.useEffect((function(){return Zt(),le(),function(){var t,e;null===(t=qt.current)||void 0===t||t.removeScrollEventListener(),null===(e=ee.current)||void 0===e||e.destroy()}}),[]);var Xt=n.useRef(!1),qt=n.useRef(),Vt={size:H,keeps:K,scroller:F,direction:U,debounceTime:X,throttleTime:V},Gt=g((function(){var e;Xt.current=!0,null===(e=t[C])||void 0===e||e.call(t)}),50),$t=g((function(){var e;null===(e=t[D])||void 0===e||e.call(t)}),50),Jt=function(t){Xt.current=!1,t.top?Gt():t.bottom&&$t()},Qt=function(t){_t((function(e){return ee.current&&Mt.current&&t.start!==e.start&&(ee.current.rangeChanged=!0),t}))},Zt=function(){qt.current=new k(Object.assign(Object.assign({},Vt),{buffer:Math.round(K/3),wrapper:jt.current,scroller:F||Bt.current,uniqueKeys:Nt.current,onScroll:Jt,onUpdate:Qt}))};I(Vt,(function(){x.forEach((function(e){var n;void 0!==t[e]&&(null===(n=qt.current)||void 0===n||n.option(e,t[e]))}))}));var te=n.useRef(0);n.useEffect((function(){var e;if(te.current&&Xt.current&&t.keepOffset){var n=Math.abs(s.length-te.current);n>0&&(null===(e=qt.current)||void 0===e||e.scrollToIndex(n)),Xt.current=!1}te.current=s.length}),[s]);var ee=n.useRef(),ne={delay:$,group:Q,handle:tt,lockAxis:nt,disabled:it,sortable:st,draggable:at,animation:ut,autoScroll:dt,ghostClass:gt,ghostStyle:yt,chosenClass:St,scrollSpeed:pt,fallbackOnBody:Et,scrollThreshold:It,delayOnTouchOnly:zt,placeholderClass:xt},oe=function(t){Rt.current=t.node.getAttribute("data-key")},ie=function(){Rt.current=""},re=function(e){var n,o,i;Mt.current=!0,st||(null===(n=qt.current)||void 0===n||n.enableScroll(!1),null===(o=ee.current)||void 0===o||o.option("autoScroll",!1)),null===(i=t[T])||void 0===i||i.call(t,e)},se=function(e){var n,o,i;Mt.current=!1,null===(n=qt.current)||void 0===n||n.enableScroll(!0),null===(o=ee.current)||void 0===o||o.option("autoScroll",t.autoScroll);var r=Object.assign(Object.assign({},e),{list:a(e.list)});null===(i=t[z])||void 0===i||i.call(t,r)},le=function(){ee.current=new w(Bt.current,Object.assign(Object.assign({},ne),{list:s,uniqueKeys:Nt.current,onDrag:re,onDrop:se,onChoose:oe,onUnchoose:ie}))};I(ne,(function(){S.forEach((function(e){var n;void 0!==t[e]&&(null===(n=ee.current)||void 0===n||n.option(e,t[e]))}))}));var ae=n.useRef([]);n.useEffect((function(){var t;ce(),ue(ae.current,s),ae.current=s,null===(t=ee.current)||void 0===t||t.option("list",s)}),[s]);var ce=function(){var t,e;Nt.current=s.map((function(t){return y(t,i)})),null===(t=qt.current)||void 0===t||t.option("uniqueKeys",Nt.current),null===(e=ee.current)||void 0===e||e.option("uniqueKeys",Nt.current)},ue=function(t,e){var n;if((t.length||e.length)&&t.length!==e.length){var o=Object.assign({},Dt);t.length>K&&e.length>t.length&&o.end===t.length-1&&he()&&o.start++,null===(n=qt.current)||void 0===n||n.updateRange(o)}},he=function(){return Ht()+Pt()+1>=Kt()},de=n.useMemo((function(){var t=Dt.front,e=Dt.behind,n="vertical"!==U,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{containerStyle:Object.assign(Object.assign({},E),{overflow:h||F?"":o}),wrapperStyle:Object.assign(Object.assign({},N),{padding:h?"":i}),itemSizeKey:n?"offsetWidth":"offsetHeight"}}),[Dt,E,N,F,h,U]),fe=de.containerStyle,pe=de.wrapperStyle,ve=de.itemSizeKey,ge=l(n.useMemo((function(){return[h?"table":f,h?"tbody":f]}),[v,f,h]),2),me=ge[0],ye=ge[1],be=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,s=t.sizeKey,l=t.dragging,a=t.chosenKey,c=t.children,u=t.onSizeChange;return e.slice(o,i+1).map((function(t,e){var i=o+e,h=y(t,r);return n.createElement(O,{key:h,dataKey:h,sizeKey:s,dragging:l,chosenKey:a,onSizeChange:u},"function"==typeof c?c(t,i,h):c)}))}({list:s,start:Dt.start,end:Dt.end,dataKey:i,sizeKey:ve,children:t.children,dragging:Mt.current,chosenKey:Rt.current,onSizeChange:function(t,e){var n,o;if(!m(t,Rt.current)){var i=null===(n=qt.current)||void 0===n?void 0:n.sizes.size,r=Math.min(K,s.length);null===(o=qt.current)||void 0===o||o.onItemResized(t,e),i===r-1&&qt.current.updateRange(Object.assign({},Dt))}}}),Se=function(t,e){var o,i,r,s=(o={padding:0,border:0},i="vertical"===U?"height":"width",r="".concat(t,"px"),(i=c(i))in o?Object.defineProperty(o,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[i]=r,o);return n.createElement("tr",{key:e},n.createElement("td",{style:s}))};return n.createElement(me,{ref:Bt,style:fe,className:M},[t.header,n.createElement(ye,{ref:jt,key:"virtual-table-wrap",style:pe,className:j},[h&&Se(Dt.front,"virtual-table-front")].concat(a(be),[h&&Se(Dt.behind,"virtual-table-behind")])),t.footer])}return n.forwardRef(_)}));
11
+ */!function(t,e){t.exports=function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},t.apply(null,arguments)}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),l=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,a=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),s=i+o.height,l=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:l,width:c,height:a}}}function f(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function v(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!S(t,e)||"none"===w(t,"display")||n++;return n}function m(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==w(s[i],"display")&&f(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=m(t,0,e),l=m(t,1,e),a=i&&w(i),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=o&&"none"===n[f]||l&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function k(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function E(e){var n=e.sortable,o=e.name,i=e.evt,r=n.options[o];"function"==typeof r&&r(t({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"];(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}();var O,I,T,z="Sortable"+Date.now();function C(t){this.options=t,this.scrollEl=null,this.autoScrollInterval=null}function D(t){this.options=t,this.stack=[]}function _(t){this.options=t||{},this.selects=[]}C.prototype={nulling:function(){this.autoScrollInterval&&(clearInterval(this.autoScrollInterval),this.autoScrollInterval=null)},onStarted:function(){var t=this;this.nulling(),this.autoScrollInterval=setInterval((function(){t.autoScroll()}))},onMove:function(t,e,n){this.options=n,this.scrollEl=t,this.moveEvent=e},autoScroll:function(){var t=this.moveEvent,e=this.scrollEl;if(e&&void 0!==t.clientX&&void 0!==t.clientY){var n=d(e);if(n){var o=t.clientX,i=t.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>s||i>l||o<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,v=e.scrollTop,g=e.scrollLeft,m=e.scrollHeight,y=v>0&&i>=r&&i<=r+f,b=g+u<e.scrollWidth&&o<=s&&o>=s-f,S=v+c<m&&i<=l&&i>=l-f;g>0&&o>=a&&o<=a+f&&(e.scrollLeft+=Math.floor(Math.max(-1,(o-a)/f-1)*p.x)),b&&(e.scrollLeft+=Math.ceil(Math.min(1,(o-s)/f+1)*p.x)),y&&(e.scrollTop+=Math.floor(Math.max(-1,(i-r)/f-1)*p.y)),S&&(e.scrollTop+=Math.ceil(Math.min(1,(i-l)/f+1)*p.y))}}}}},D.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),l=[],a=0,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(h.top-h.height>r||h.left-h.width>i)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){var t=this.stack.pop();if(t&&this.options.animation)for(var e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this.execute(i,r)}},execute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d(".concat(o,"px, ").concat(i,"px, 0)")),this.repaintDummy=function(t){return t.offsetWidth}(t);var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform ".concat(s,"ms ").concat(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},_.prototype={eventProperties:function(){return{nodes:O||[],clones:I||[]}},isActive:function(){return!!O},nulling:function(){O=I=T=null},select:function(t){b(t,this.options.selectedClass,!0),this.selects.push(t),this.selects.sort((function(t,e){return x(t,e)}))},deselect:function(t){var e=this.selects.indexOf(t);e>-1&&(b(t,this.options.selectedClass,!1),this.selects.splice(e,1))},useSelectHandle:function(t,e){var n=this.options.selectHandle;return!!(T="function"==typeof n&&n(t)||"string"==typeof n&&S(e,n))},onChoose:function(){!this.options.multiple||0===this.selects.length||this.selects.indexOf(ot.dragged)<0||(this.selects.sort((function(t,e){return x(t,e)})),O=this.selects,this.toggleChosenClass(!0))},onDrop:function(t,e,n){if(O){var o=ot.dragged,i=ot.clone,r=O.indexOf(o);t!==e&&n?(w(i,"display","none"),this.toggleVisible(!0),I=O.map((function(t){return t.cloneNode(!0)})),this.sortElements(I,r,i)):this.sortElements(O,r,i),t!==e&&(e[z].multiplayer.toggleSelected(I||O,"add"),!n&&t[z].multiplayer.toggleSelected(O,"remove"))}},onSelect:function(t,e,n,o){var i=this.options,r=i.multiple,s=i.selectHandle;if(r&&(s&&T||!s&&!n)){var l=this.selects.indexOf(e);b(e,this.options.selectedClass,l<0);var a={from:o.el,event:t,node:e,index:g(e)};l<0?(this.selects.push(e),E({sortable:o,name:"onSelect",evt:a})):(this.selects.splice(l,1),E({sortable:o,name:"onDeselect",evt:a})),this.selects.sort((function(t,e){return x(t,e)}))}},toggleChosenClass:function(t){if(O)for(var e=0,n=O.length;e<n;e++)b(O[e],this.options.chosenClass,t)},toggleVisible:function(t){if(O)for(var e=0,n=O.length;e<n;e++)O[e]!=ot.dragged&&w(O[e],"display",t?"":"none")},toggleSelected:function(t,e){var n=this;"add"===e?t.forEach((function(t){return n.selects.push(t)})):this.selects=this.selects.filter((function(e){return t.indexOf(e)<0}))},sortElements:function(t,e,n){for(var o=0,i=t.length;o<i;o++)if(w(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var r=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],r.nextSibling)}}};var M,R,N,B,j,A,H,P,K,L,F,Y,U,W,X,q,V,G,$,J,Q,Z,tt=[];function et(t){var n,o,i,r={},s=t.group;s&&"object"===e(s)||(s={name:s,pull:!0,put:!0,revertDrag:!0}),r.name=s.name,r.pull=null===(n=s.pull)||void 0===n||n,r.put=null===(o=s.put)||void 0===o||o,r.revertDrag=null===(i=s.revertDrag)||void 0===i||i,t.group=r}function nt(t){var e=q||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));e[z]=this,this.el=e,this.options=n=t({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:">*",selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",placeholderClass:"",swapOnDrop:!0,removeCloneOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(e,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new C(this.options),this.multiplayer=new _(this.options),this.animator=new D(this.options),tt.push(e)}return ot.prototype={constructor:ot,_onDrag:function(t){var e=this;if(!N&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!l||!o||"SELECT"!==o.tagName.toUpperCase()){var i=f(o,this.options.draggable,this.el);if(i&&!i.animated&&(X={event:t,clientX:(n||t).clientX,clientY:(n||t).clientY},N=i,c(J=n?N:document,"mouseup",this._onDrop),c(J,"touchend",this._onDrop),c(J,"touchcancel",this._onDrop),!this.multiplayer.useSelectHandle(t,o))){var a=this.options.handle;if(("function"!=typeof a||a(t))&&("string"!=typeof a||f(o,a,N))){var u=this.options,h=u.delay,d=u.delayOnTouchOnly;!h||d&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Z=setTimeout((function(){return e._onStart(n,t)}),h)),c(document,"selectstart",k),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z),u(this.el.ownerDocument,"touchmove",this._delayMoveHandler),u(this.el.ownerDocument,"mousemove",this._delayMoveHandler),u(this.el.ownerDocument,"mouseup",this._cancelStart),u(this.el.ownerDocument,"touchend",this._cancelStart),u(this.el.ownerDocument,"touchcancel",this._cancelStart),u(document,"selectstart",k),l&&w(document.body,"user-select","")},_onStart:function(t,e){k(e);var n=g(N);M=this.el,R=this.el,K=N,Y=n,U=n,W=n,G={to:this.el,target:N,newIndex:n,relative:0},$=N,P=this.el,A=N.cloneNode(!0),L=N.parentNode,F=this.options.group.pull,ot.clone=A,ot.active=this,ot.dragged=N,this.multiplayer.onChoose(),b(N,this.options.chosenClass,!0),E({sortable:this,name:"onChoose",evt:this._getEventProperties(e)}),c(J,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){this.animator.collect(L),b(A,this.options.chosenClass,!0),b(A,this.options.placeholderClass,!0),this._appendGhost(),this.multiplayer.toggleVisible(!1),w(N,"display","none"),N.parentNode.insertBefore(A,N),E({sortable:this,name:"onDrag",evt:this._getEventProperties(X.event)}),this.animator.animate(),this.autoScroller.onStarted()},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selects;return t(this.multiplayer.isActive()?e:[N])}return N},_appendGhost:function(){if(!H){var e=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(H=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(N),i=t({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,margin:0,zIndex:1e5,opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)w(H,r,i[r]);ot.ghost=H,e.appendChild(H);var s=(X.clientX-o.left)/parseInt(H.style.width)*100,l=(X.clientY-o.top)/parseInt(H.style.height)*100;w(H,"transform-origin","".concat(s,"% ").concat(l,"%")),w(H,"will-change","transform")}},_nearestSortable:function(t){k(t);var e=t.touches&&t.touches[0]||t;if(N&&nt(e)){!q&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-X.clientX,l=i-X.clientY;q={event:t,clientX:o,clientY:i},w(H,"transform","translate3d(".concat(s,"px, ").concat(l,"px, 0)"));var a,c,u,f=(a=o,c=i,tt.reduce((function(t,e){var n=e[z].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=a>=o.left-n&&a<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}}),null));f&&f[z]._onMove(t,r);var p=f?f[z].options:null,v=null;(!f||p.autoScroll)&&X&&q&&(v=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(r,!0)),this.autoScroller.onMove(v,q,p||this.options)}},_allowPut:function(){if(P===this.el)return!0;if(!this.options.group.put)return!1;var t=this.options.group,e=t.name,n=t.put,o=P[z].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(q.event,A,this):n:y(L,e)},_allowSwap:function(){var t=d(B),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=B[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,l=m(L,0,this.options.draggable),a=v(L),c=d(l),u=d(a);if(B===L||p(L,B))return A===l&&r<c[n]?(j=B,!0):A===a&&r>u[o]&&(j=B.nextSibling,!0);var h=x(A,B);return j=h<0?B.nextSibling:B,V!==B?(Q=s,!0):Q!==s&&(Q=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(B=f(e,this.options.draggable,this.el),E({sortable:this,name:"onMove",evt:this._getEventProperties(t,{target:B})}),this.options.sortable||this.el!==P)return this.el===R||e!==this.el&&v(this.el)?void(B&&!B.animated&&!p(B,A)&&this._allowSwap()&&(B!==A&&j!==A?(this.el!==R?this._onInsert(t):B!==N&&this._onChange(t),V=B):V=B)):(B=V=null,void this._onInsert(t));R!==P&&(B=V=N,Q=0,this._onInsert(t))}},_onInsert:function(t){var e=B||A,n="clone"===F&&this.el!==P&&R===P,o="clone"===F&&this.el===P&&R!==P,i=p(B,document),r=B===N&&!i,s=R[z],l=P[z];M=this.el,Y=g(A),K=e,L=i?B.parentNode:this.el,s.animator.collect(A.parentNode),this.animator.collect(L),n&&(G.target=$,G.newIndex=Y,G.relative=$===N?0:x(A,$),w(N,"display",""),l.multiplayer.toggleVisible(!0),l.options.group.revertDrag||A.parentNode.insertBefore(N,A)),o&&(Y=g(N),w(N,"display","none"),this.multiplayer.toggleVisible(!1)),w(A,"display",r?"none":""),B&&i?L.insertBefore(A,Q<0?B:B.nextSibling):L.appendChild(A),U=r?W:g(A),n&&l.options.group.revertDrag&&(G.target=N,G.newIndex=W,G.relative=0,E({sortable:l,name:"onChange",evt:this._getEventProperties(t,{to:P,target:N,newIndex:W,revertDrag:!0})})),n||E({sortable:s,name:"onRemove",evt:this._getEventProperties(t,{newIndex:-1})}),o&&e!==N&&($=e,E({sortable:this,name:"onChange",evt:this._getEventProperties(t,{from:P,backToOrigin:!0})})),o||E({sortable:this,name:"onAdd",evt:this._getEventProperties(t,{oldIndex:-1})}),s.animator.animate(),this.animator.animate(),R=this.el},_onChange:function(t){this.animator.collect(L),Y=g(A),L=B.parentNode,K=B,this.el===P&&($=B),L.insertBefore(A,j),U=g(A),E({sortable:this,name:"onChange",evt:this._getEventProperties(t)}),this.animator.animate(),R=this.el},_onDrop:function(t){this._cancelStart(),u(J,"touchmove",this._nearestSortable),u(J,"mousemove",this._nearestSortable),u(J,"mouseup",this._onDrop),u(J,"touchend",this._onDrop),u(J,"touchcancel",this._onDrop),P&&(R=P,Y=W,K===A&&(K=N),this.animator.collect(L),this.multiplayer.toggleChosenClass(!1),b(N,this.options.chosenClass,!1),E({sortable:this,name:"onUnchoose",evt:this._getEventProperties(t)}),q&&this._onEnd(t),!q&&this.animator.animate()),!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,N,P,this),H&&H.parentNode&&H.parentNode.removeChild(H),this._nulling()},_onEnd:function(e){b(A,this.options.chosenClass,!1),b(A,this.options.placeholderClass,!1);var n="clone"===F;this.multiplayer.onDrop(R,M,n);var o=this._getEventProperties(e),i=this.options,r=i.swapOnDrop,s=i.removeCloneOnDrop;n&&R!==M||!("function"==typeof r?r(o):r)||L.insertBefore(N,A),n&&R!==M&&!this.multiplayer.isActive()||!("function"==typeof s?s(o):s)||A&&A.parentNode&&A.parentNode.removeChild(A),w(N,"display",""),this.animator.animate(),R!==M&&E({sortable:R[z],name:"onDrop",evt:t({},o,n?G:{newIndex:-1})}),E({sortable:M[z],name:"onDrop",evt:t({},o,R===M?{}:{oldIndex:-1})})},_getEventProperties:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=e,o.to=M,o.from=R,o.node=N,o.clone=A,o.target=K,o.oldIndex=Y,o.newIndex=U,o.pullMode=F,t(o,this.multiplayer.eventProperties(),n),o.relative=K===N?0:x(A,K),o},_nulling:function(){M=R=N=B=j=A=H=P=K=L=F=Y=U=W=X=q=V=G=$=J=Q=Z=ot.clone=ot.ghost=ot.active=ot.dragged=null,this.multiplayer.nulling(),this.autoScroller.nulling()},destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[z]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selects}},ot.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},ot.get=function(t){return t[z]},ot.create=function(t,e){return new ot(t,e)},ot}()}(f);var p=d(f.exports);function v(t,e){var n,o=function(){for(var o=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=null,t.apply(o,r)}),e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function g(t,e){var n=v(t,e),o=function(){n.cancel(),n.apply(this,arguments)};return o.cancel=function(){n.cancel()},o}function m(t,e){return t==e}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}function b(t){return t instanceof Document&&9===t.nodeType||t instanceof Window}var S=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","fallbackOnBody","scrollThreshold","delayOnTouchOnly","placeholderClass"],w=function(){function t(e,n){i(this,t),this.el=e,this.options=n,this.rangeChanged=!1,this.installSortable()}return s(t,[{key:"destroy",value:function(){this.sortable.destroy(),this.rangeChanged=!1}},{key:"option",value:function(t,e){this.options[t]=e,S.includes(t)&&this.sortable.option(t,e)}},{key:"installSortable",value:function(){var t=this,e=S.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new p(this.el,Object.assign(Object.assign({},e),{emptyInsertThreshold:0,swapOnDrop:function(t){return t.from===t.to},removeCloneOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)},onChoose:function(e){return t.onChoose(e)},onUnchoose:function(e){return t.onUnchoose(e)}}))}},{key:"onChoose",value:function(t){this.dispatchEvent("onChoose",t)}},{key:"onUnchoose",value:function(t){this.dispatchEvent("onUnchoose",t)}},{key:"onDrag",value:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),o=this.options.list[n],i=this.options.uniqueKeys[n];this.sortable.option("store",{item:o,key:i,index:n}),this.dispatchEvent("onDrag",{item:o,key:i,index:n,event:t})}},{key:"onDrop",value:function(t){var e,n,o,i=null===(e=p.get(t.from))||void 0===e?void 0:e.option("store"),r=i.item,s=i.key,l=i.index,c=this.options.list,u={key:s,item:r,list:c,event:t,changed:!1,oldList:a(c),oldIndex:l,newIndex:l};t.from===t.to&&t.node===t.target||this.handleDropEvent(t,u,l),this.dispatchEvent("onDrop",u),t.from===this.el&&this.rangeChanged&&(null===(n=p.dragged)||void 0===n||n.remove()),t.from!==t.to&&(null===(o=p.clone)||void 0===o||o.remove()),this.rangeChanged=!1}},{key:"handleDropEvent",value:function(t,e,n){var o=t.target.getAttribute("data-key"),i=-1,r=n;t.from===t.to?(((r=this.getIndex(e.key))<(i=this.getIndex(o))&&-1===t.relative||r>i&&1===t.relative)&&(i+=t.relative),i!==r&&(e.list.splice(r,1),e.list.splice(i,0,e.item))):(t.from===this.el&&(r=this.getIndex(e.key),e.list.splice(r,1)),t.to===this.el&&(r=-1,i=this.getIndex(o),0===t.relative?i=e.list.length:1===t.relative&&(i+=t.relative),e.list.splice(i,0,e.item))),e.changed=t.from!==t.to||i!==r,e.oldIndex=r,e.newIndex=i}},{key:"getIndex",value:function(t){if(null==t)return-1;for(var e=this.options.uniqueKeys,n=0,o=e.length;n<o;n++)if(m(e[n],t))return n;return-1}},{key:"dispatchEvent",value:function(t,e){var n=this.options[t];n&&n(e)}}]),t}(),x=["size","keeps","scroller","direction","debounceTime","throttleTime"],k=function(){function t(e){i(this,t),this.options=e;var n={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var o in n)!(o in this.options)&&(this.options[o]=n[o]);this.sizes=new Map,this.sizeType="INIT",this.fixedSize=0,this.averageSize=0,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.direction="STATIONARY",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,e.keeps-1)}return s(t,[{key:"isFixed",value:function(){return"FIXED"===this.sizeType}},{key:"isFront",value:function(){return"FRONT"===this.direction}},{key:"isBehind",value:function(){return"BEHIND"===this.direction}},{key:"isHorizontal",value:function(){return"horizontal"===this.options.direction}},{key:"getSize",value:function(t){return this.sizes.get(t)||this.getItemSize()}},{key:"getOffset",value:function(){var t=this.isHorizontal()?"scrollLeft":"scrollTop";return this.scrollEl[t]}},{key:"getScrollSize",value:function(){var t=this.isHorizontal()?"scrollWidth":"scrollHeight";return this.scrollEl[t]}},{key:"getClientSize",value:function(){var t=this.isHorizontal()?"offsetWidth":"offsetHeight";return this.scrollEl[t]}},{key:"scrollToOffset",value:function(t){var e=this.isHorizontal()?"scrollLeft":"scrollTop";this.scrollEl[e]=t}},{key:"scrollToIndex",value:function(t){if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else{var e=this.getOffsetByRange(0,t),n=this.getScrollStartOffset();this.scrollToOffset(e+n)}}},{key:"scrollToBottom",value:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout((function(){var e=t.getClientSize(),n=t.getScrollSize();t.getOffset()+e+1<n&&t.scrollToBottom()}),5)}},{key:"option",value:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,o){e.includes(o)||n.sizes.delete(o)})),"scroller"===t&&(o&&p.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())}},{key:"updateRange",value:function(t){if(t)this.handleUpdate(t.start);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e)}}},{key:"onItemResized",value:function(t,e){e&&this.sizes.get(t)!==e&&(this.sizes.set(t,e),"INIT"===this.sizeType?(this.sizeType="FIXED",this.fixedSize=e):this.isFixed()&&this.fixedSize!==e&&(this.sizeType="DYNAMIC",this.fixedSize=0),this.averageSize||"DYNAMIC"!==this.sizeType||this.sizes.size!==this.options.keeps||this.updateAverageSize())}},{key:"updateAverageSize",value:function(){var t=a(this.sizes.values()).reduce((function(t,e){return t+e}),0);this.averageSize=Math.round(t/this.sizes.size)}},{key:"addScrollEventListener",value:function(){this.options.scroller&&p.utils.on(this.options.scroller,"scroll",this.onScroll)}},{key:"removeScrollEventListener",value:function(){this.options.scroller&&p.utils.off(this.options.scroller,"scroll",this.onScroll)}},{key:"enableScroll",value:function(t){var e=this.options.scroller,n=t?p.utils.off:p.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"preventDefaultForKeyDown",value:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1}},{key:"updateScrollElement",value:function(){var t=this.options.scroller;if(b(t)){var e=document.scrollingElement||document.documentElement||document.body;this.scrollEl=e}else this.scrollEl=t}},{key:"updateOnScrollFunction",value:function(){var t=this,e=this.options,n=e.debounceTime,o=e.throttleTime;this.onScroll=n?g((function(){return t.handleScroll()}),n):o?v((function(){return t.handleScroll()}),o):function(){return t.handleScroll()}}},{key:"handleScroll",value:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.direction="STATIONARY":this.direction=t<this.offset?"FRONT":"BEHIND",this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t+1>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.direction}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();if(!(t>=this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value:function(){var t=this.offset-this.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.fixedSize);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByRange(0,o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?t=0:e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t)}},{key:"handleUpdate",value:function(t){this.range.start=t,this.range.end=this.getEndByStart(t),this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.options.onUpdate(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.fixedSize*this.range.start:this.getOffsetByRange(0,this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.fixedSize:(e-t)*this.getItemSize()}},{key:"getOffsetByRange",value:function(t,e){if(t>=e)return 0;for(var n=0,o=t;o<e;o++){var i=this.sizes.get(this.options.uniqueKeys[o]);n+="number"==typeof i?i:this.getItemSize()}return n}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,n=t.keeps;return e.length>0?e.length-1:n-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.fixedSize:this.options.size||this.averageSize}},{key:"getScrollStartOffset",value:function(){var t=this.options,e=t.wrapper,n=t.scroller;if(n===e)return 0;var o=0;if(n&&e){var i=this.isHorizontal()?"left":"top",r=b(n)?p.utils.getRect(e):p.utils.getRect(e,!0,n);o=this.offset+r[i]}return o}}]),t}();function E(t){var e=t.dataKey,o=t.sizeKey,i=t.dragging,r=t.chosenKey,s=t.children,l=t.onSizeChange,a=n.useRef(null);n.useLayoutEffect((function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":u(ResizeObserver))&&(t=new ResizeObserver((function(){var t=a.current[o];l(e,t)})),a.current&&(null==t||t.observe(a.current))),function(){t&&(t.disconnect(),t=null)}}),[a]);var c=n.useMemo((function(){var t=s.props.style||{},n=m(e,r);return i&&n?Object.assign(t,{display:"none"}):t}),[r,i]);return n.cloneElement(s,{"data-key":e,role:"item",ref:a,style:c,className:s.props.className})}var O=n.memo(E);function I(t,e){n.useEffect(e,Object.values(t))}var T="onDrag",z="onDrop",C="onTop",D="onBottom";function _(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,s=void 0===r?[]:r,u=t.tableMode,h=void 0!==u&&u,d=t.wrapTag,f=void 0===d?"div":d,p=t.rootTag,v=void 0===p?"div":p,b=t.style,E=void 0===b?{}:b,_=t.className,M=void 0===_?"":_,R=t.wrapStyle,N=void 0===R?{}:R,B=t.wrapClass,j=void 0===B?"":B,A=t.size,H=void 0===A?void 0:A,P=t.keeps,K=void 0===P?30:P,L=t.scroller,F=void 0===L?void 0:L,Y=t.direction,U=void 0===Y?"vertical":Y,W=t.debounceTime,X=void 0===W?0:W,q=t.throttleTime,V=void 0===q?0:q,G=t.delay,$=void 0===G?0:G,J=t.group,Q=void 0===J?"":J,Z=t.handle,tt=void 0===Z?"":Z,et=t.lockAxis,nt=void 0===et?void 0:et,ot=t.disabled,it=void 0!==ot&&ot,rt=t.sortable,st=void 0===rt||rt,lt=t.draggable,at=void 0===lt?'[role="item"]':lt,ct=t.animation,ut=void 0===ct?150:ct,ht=t.autoScroll,dt=void 0===ht||ht,ft=t.scrollSpeed,pt=void 0===ft?{x:10,y:10}:ft,vt=t.ghostClass,gt=void 0===vt?"":vt,mt=t.ghostStyle,yt=void 0===mt?void 0:mt,bt=t.chosenClass,St=void 0===bt?"":bt,wt=t.placeholderClass,xt=void 0===wt?"":wt,kt=t.fallbackOnBody,Et=void 0!==kt&&kt,Ot=t.scrollThreshold,It=void 0===Ot?55:Ot,Tt=t.delayOnTouchOnly,zt=void 0!==Tt&&Tt,Ct=l(n.useState({start:0,end:K-1,front:0,behind:0}),2),Dt=Ct[0],_t=Ct[1],Mt=n.useRef(!1),Rt=n.useRef(""),Nt=n.useRef([]),Bt=n.useRef(),jt=n.useRef(),At=function(t){return qt.current.getSize(t)},Ht=function(){return qt.current.getOffset()},Pt=function(){return qt.current.getClientSize()},Kt=function(){return qt.current.getScrollSize()},Lt=function(t){var e;null===(e=qt.current)||void 0===e||e.scrollToOffset(t)},Ft=function(t){var e;null===(e=qt.current)||void 0===e||e.scrollToIndex(t)},Yt=function(t){var e,n=Nt.current.indexOf(t);n>-1&&(null===(e=qt.current)||void 0===e||e.scrollToIndex(n))},Ut=function(){Lt(0)},Wt=function(){var t;null===(t=qt.current)||void 0===t||t.scrollToBottom()};n.useImperativeHandle(e,(function(){return{getSize:At,getOffset:Ht,getClientSize:Pt,getScrollSize:Kt,scrollToTop:Ut,scrollToKey:Yt,scrollToIndex:Ft,scrollToOffset:Lt,scrollToBottom:Wt}})),n.useEffect((function(){return Zt(),le(),function(){var t,e;null===(t=qt.current)||void 0===t||t.removeScrollEventListener(),null===(e=ee.current)||void 0===e||e.destroy()}}),[]);var Xt=n.useRef(!1),qt=n.useRef(),Vt={size:H,keeps:K,scroller:F,direction:U,debounceTime:X,throttleTime:V},Gt=g((function(){var e;Xt.current=!0,null===(e=t[C])||void 0===e||e.call(t)}),50),$t=g((function(){var e;null===(e=t[D])||void 0===e||e.call(t)}),50),Jt=function(t){Xt.current=!1,t.top?Gt():t.bottom&&$t()},Qt=function(t){_t((function(e){return ee.current&&Mt.current&&t.start!==e.start&&(ee.current.rangeChanged=!0),t}))},Zt=function(){qt.current=new k(Object.assign(Object.assign({},Vt),{buffer:Math.round(K/3),wrapper:jt.current,scroller:F||Bt.current,uniqueKeys:Nt.current,onScroll:Jt,onUpdate:Qt}))};I(Vt,(function(){x.forEach((function(e){var n;void 0!==t[e]&&(null===(n=qt.current)||void 0===n||n.option(e,t[e]))}))}));var te=n.useRef(0);n.useEffect((function(){var e;if(te.current&&Xt.current&&t.keepOffset){var n=Math.abs(s.length-te.current);n>0&&(null===(e=qt.current)||void 0===e||e.scrollToIndex(n)),Xt.current=!1}te.current=s.length}),[s]);var ee=n.useRef(),ne={delay:$,group:Q,handle:tt,lockAxis:nt,disabled:it,sortable:st,draggable:at,animation:ut,autoScroll:dt,ghostClass:gt,ghostStyle:yt,chosenClass:St,scrollSpeed:pt,fallbackOnBody:Et,scrollThreshold:It,delayOnTouchOnly:zt,placeholderClass:xt},oe=function(t){Rt.current=t.node.getAttribute("data-key")},ie=function(){Rt.current=""},re=function(e){var n,o,i;Mt.current=!0,st||(null===(n=qt.current)||void 0===n||n.enableScroll(!1),null===(o=ee.current)||void 0===o||o.option("autoScroll",!1)),null===(i=t[T])||void 0===i||i.call(t,e)},se=function(e){var n,o,i;Mt.current=!1,null===(n=qt.current)||void 0===n||n.enableScroll(!0),null===(o=ee.current)||void 0===o||o.option("autoScroll",t.autoScroll);var r=Object.assign(Object.assign({},e),{list:a(e.list)});null===(i=t[z])||void 0===i||i.call(t,r)},le=function(){ee.current=new w(Bt.current,Object.assign(Object.assign({},ne),{list:s,uniqueKeys:Nt.current,onDrag:re,onDrop:se,onChoose:oe,onUnchoose:ie}))};I(ne,(function(){S.forEach((function(e){var n;void 0!==t[e]&&(null===(n=ee.current)||void 0===n||n.option(e,t[e]))}))}));var ae=n.useRef([]);n.useEffect((function(){var t;ce(),ue(ae.current,s),ae.current=s,null===(t=ee.current)||void 0===t||t.option("list",s)}),[s]);var ce=function(){var t,e;Nt.current=s.map((function(t){return y(t,i)})),null===(t=qt.current)||void 0===t||t.option("uniqueKeys",Nt.current),null===(e=ee.current)||void 0===e||e.option("uniqueKeys",Nt.current)},ue=function(t,e){var n;if((t.length||e.length)&&t.length!==e.length){var o=Object.assign({},Dt);t.length>K&&e.length>t.length&&o.end===t.length-1&&he()&&o.start++,null===(n=qt.current)||void 0===n||n.updateRange(o)}},he=function(){return Ht()+Pt()+1>=Kt()},de=n.useMemo((function(){var t=Dt.front,e=Dt.behind,n="vertical"!==U,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{containerStyle:Object.assign(Object.assign({},E),{overflow:h||F?"":o}),wrapperStyle:Object.assign(Object.assign({},N),{padding:h?"":i}),itemSizeKey:n?"offsetWidth":"offsetHeight"}}),[Dt,E,N,F,h,U]),fe=de.containerStyle,pe=de.wrapperStyle,ve=de.itemSizeKey,ge=l(n.useMemo((function(){return[h?"table":f,h?"tbody":f]}),[v,f,h]),2),me=ge[0],ye=ge[1],be=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,s=t.sizeKey,l=t.dragging,a=t.chosenKey,c=t.children,u=t.onSizeChange;return e.slice(o,i+1).map((function(t,e){var i=o+e,h=y(t,r);return n.createElement(O,{key:h,dataKey:h,sizeKey:s,dragging:l,chosenKey:a,onSizeChange:u},"function"==typeof c?c(t,i,h):c)}))}({list:s,start:Dt.start,end:Dt.end,dataKey:i,sizeKey:ve,children:t.children,dragging:Mt.current,chosenKey:Rt.current,onSizeChange:function(t,e){var n,o;if(!m(t,Rt.current)){var i=null===(n=qt.current)||void 0===n?void 0:n.sizes.size,r=Math.min(K,s.length);null===(o=qt.current)||void 0===o||o.onItemResized(t,e),i===r-1&&qt.current.updateRange(Object.assign({},Dt))}}}),Se=function(t,e){var o,i,r,s=(o={padding:0,border:0},i="vertical"===U?"height":"width",r="".concat(t,"px"),(i=c(i))in o?Object.defineProperty(o,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[i]=r,o);return n.createElement("tr",{key:e},n.createElement("td",{style:s}))};return n.createElement(me,{ref:Bt,style:fe,className:M},[t.header,n.createElement(ye,{ref:jt,key:"virtual-table-wrap",style:pe,className:j},[h&&Se(Dt.front,"virtual-table-front")].concat(a(be),[h&&Se(Dt.behind,"virtual-table-behind")])),t.footer])}return n.forwardRef(_)}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-virtual-sortable",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A virtual scrolling list component that can be sorted by dragging",
5
5
  "main": "dist/virtual-list.js",
6
6
  "types": "types/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://github.com/mfuu/react-virtual-sortable#readme",
39
39
  "dependencies": {
40
- "sortable-dnd": "^0.6.22"
40
+ "sortable-dnd": "^0.6.23"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/core": "^7.16.7",