react-virtual-sortable 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * react-virtual-sortable v1.0.3
2
+ * react-virtual-sortable v1.1.0
3
3
  * open source under the MIT license
4
4
  * https://github.com/mfuu/react-virtual-sortable#readme
5
5
  */
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:{}};
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 l(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(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,l,a=[],s=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=r.call(n)).done)&&(a.push(o.value),a.length!==e);s=!0);}catch(t){c=!0,i=t}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(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 s(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.23
8
+ * sortable-dnd v0.7.1
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(){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 0===t?t===e: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;null===(o=qt.current)||void 0===o||o.onItemResized(t,e),i===K-1&&s.length>K&&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){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),l=i(/Edge/i),a=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),s=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,!(!s&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!s&&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,l,a,s,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,l=o.bottom,a=o.right,s=o.height,c=o.width):(i=0,r=0,l=window.innerHeight,a=window.innerWidth,s=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")),l=i+o.height,a=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:l,right:a,width:c,height:s}}}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===tt.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;)t===tt.ghost||"TEMPLATE"===t.nodeName.toUpperCase()||"none"===w(t,"display")||e&&!S(t,e)||n++;return n}function m(t,e,n,o){for(var i=0,r=0,l=t.children;i<l.length;){if(l[i]!==tt.ghost&&"none"!==w(l[i],"display")&&f(l[i],n,t,!1)&&(o||l[i]!==tt.dragged)){if(r===e)return l[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),a=m(t,1,e),s=i&&w(i),c=a&&w(a),u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(a).width,f=l||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&&s.float&&"none"!==s.float){var p="left"===s.float?"left":"right";return!a||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||u>=o&&"none"===n[f]||a&&"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){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function E(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 T(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function O(e){var n=e.sortable,o=e.name,i=e.evt,r=n.options[o];if("function"==typeof r)return r(t({},i))}function I(t){if("function"==typeof t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return t.apply(void 0,n)}return t}var k="Sortable"+Date.now();function z(t){this.options=t,this.scrollEl=null,this.autoScrollInterval=null}function _(t){this.options=t,this.animationStack=[],this.animationCallbackId=null}function D(t,e){return Math.sqrt(Math.pow(t.left-e.left,2)+Math.pow(t.top-e.top,2))}z.prototype={nulling:function(){this.autoScrollInterval&&(clearInterval(this.autoScrollInterval),this.autoScrollInterval=null)},onStarted:function(){this.nulling(),this.autoScrollInterval=setInterval(this.autoScroll.bind(this))},onMove:function(t,e,n,o){var i=n?n[k].options:o;!n||i.autoScroll?(this.options=i,this.scrollEl=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()}(t,!0),this.moveEvent=e):this.scrollEl=null},autoScroll:function(){var t=this.options,e=this.moveEvent,n=this.scrollEl,o=t.scrollThreshold,i=t.scrollSpeed;if(n&&void 0!==e.clientX&&void 0!==e.clientY){var r=d(n);if(r){var l=e.clientX,a=e.clientY,s=r.top,c=r.right,u=r.bottom,h=r.left,f=r.height,p=r.width;if(!(a<s||l>c||a>u||l<h)){var v=n.scrollTop,g=n.scrollLeft,m=n.scrollHeight,y=n.scrollWidth;n.scrollLeft+=this.getScrollOffset(l,h,c,o,i.x,g,y,p),n.scrollTop+=this.getScrollOffset(a,s,u,o,i.y,v,m,f)}}}},getScrollOffset:function(t,e,n,o,i,r,l,a){return r>0&&t>=e&&t<=e+o?Math.max(-1,(t-e)/o-1)*i:r+a<l&&t<=n&&t>=n-o?Math.min(1,(t-n)/o+1)*i:0}},_.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),l=Array.prototype.slice.call(t.children),a=[],s=0,c=l.length;s<c;s++){var u=l[s];if(u!==tt.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(0===a.length&&u.previousElementSibling){var f=u.previousElementSibling;do{if(f&&f!==tt.ghost&&"none"!==w(f,"display"))break}while(f=f.previousElementSibling);f&&a.push({el:f,rect:d(f)})}if(h.top-h.height>r||h.left-h.width>i){a.push({el:u,rect:h});break}a.push({el:u,rect:h})}}}this.animationStack.push(a)}},animate:function(t){var e=this,n=this.animationStack.pop(),o=this.options.animation;if(!n||!o)return clearTimeout(this.animationCallbackId),void("function"==typeof t&&t());var i=0;n.forEach(function(t){var n=0,r=t.el,l=d(r),a=t.rect,s=r.prevToRect,c=r.prevFromRect;if(r.animating&&c&&s&&x(a,l)){var u=function(t,e){var n="";if("string"==typeof t)n=t;else do{var o=w(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}(r,!0);u&&(n=D({top:l.top-u.f,left:l.left-u.e},l)/D(c,s)*o)}x(a,l)||(r.prevFromRect=a,r.prevToRect=l,n||(n=o),e.execute(r,a,l,n)),n&&(i=Math.max(i,n))}),clearTimeout(this.animationCallbackId),i?this.animationCallbackId=setTimeout(function(){"function"==typeof t&&t()},i):"function"==typeof t&&t()},execute:function(t,e,n,o){var i=this.options.easing||"",r=e.left-n.left,l=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d(".concat(r,"px, ").concat(l,"px, 0)")),this.repaintDummy=function(t){return t.offsetWidth}(t),w(t,"transition","transform ".concat(o,"ms ").concat(i)),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animating&&clearTimeout(t.animating),t.animating=setTimeout(function(){w(t,"transition",""),w(t,"transform",""),t.prevFromRect=null,t.prevToRect=null,t.animating=null},o)}};var C,M,R,N,A,j,B,P,H,L,F,K,Y,W,X,U,q,V,G,$,J,Q=[];function Z(t){var n,o,i,r={},l=t.group;l&&"object"===e(l)||(l={name:l,pull:!0,put:!0,revertDrag:!0}),r.name=l.name,r.pull=null===(n=l.pull)||void 0===n||n,r.put=null===(o=l.put)||void 0===o||o,r.revertDrag=null===(i=l.revertDrag)||void 0===i||i,t.group=r}function tt(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));e[k]=this,this.el=e,this.options=n=t({},n);var o={store:null,group:"",handle:null,draggable:">*",sortable:!0,disabled:!1,customGhost:null,lockAxis:"",direction:"",animation:150,easing:"",chosenClass:"",placeholderClass:"",ghostClass:"",ghostStyle:{},ghostContainer:null,appendToBody:!1,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,swapOnDrop:!0,removeCloneOnDrop:!0,dropOnAnimationEnd:!1,supportTouch:"ontouchstart"in window,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,emptyInsertThreshold:-1};for(var i in o)!(i in n)&&(n[i]=o[i]);for(var r in Z(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(e,n.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new z(n),this.animator=new _(n),Q.push(e)}return tt.prototype={constructor:tt,_onDrag:function(t){var e=this,n=this.el,o=this.options,i=o.handle,s=t.touches&&t.touches[0],u=(s||t).target,h=n.ownerDocument;if(!R&&!o.disabled&&o.group.pull&&!(/mousedown|pointerdown/.test(t.type)&&0!==t.button||a&&u&&"SELECT"===u.tagName.toUpperCase())){var d=f(u,o.draggable,n);d&&!d.animating&&(X={event:t,clientX:(s||t).clientX,clientY:(s||t).clientY},R=d,c(V=s?R:document,"mouseup",this._onDrop),c(V,"touchend",this._onDrop),c(V,"touchcancel",this._onDrop),"function"==typeof i&&!i(t)||"string"==typeof i&&!f(u,i,R)||(!o.delay||o.delayOnTouchOnly&&!s||l||r?this._onStart(s,t):(c(h,"touchmove",this._delayedMoveHandler),c(h,"mousemove",this._delayedMoveHandler),c(h,"mouseup",this._cancelStart),c(h,"touchend",this._cancelStart),c(h,"touchcancel",this._cancelStart),this._dragStartTimer=setTimeout(function(){return e._onStart(s,t)},o.delay))))}},_delayedMoveHandler: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(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),u(t,"touchmove",this._delayedMoveHandler),u(t,"mousemove",this._delayedMoveHandler),u(t,"mouseup",this._cancelStart),u(t,"touchend",this._cancelStart),u(t,"touchcancel",this._cancelStart)},_onStart:function(t,e){T(e);var n=this.el,o=this.options,i=g(R);K=i,Y=i,W=i,C=n,M=n,j=n,H=R,L=R.parentNode,F=o.group.pull,$=R,G={to:n,target:R,newIndex:i,relative:0},B=R.cloneNode(!0),tt.dragged=R,tt.clone=B,tt.active=this,O({sortable:this,name:"onChoose",evt:this._getEventProperties(e)}),b(R,o.chosenClass,!0),c(V,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){return document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}c(document,"selectstart",T),a&&w(document.body,"user-select","none")},_onStarted:function(){var t=this.options;this.animator.collect(L),this._appendGhost(),b(B,t.chosenClass,!0),b(B,t.placeholderClass,!0),R.parentNode.insertBefore(B,R),w(R,"display","none"),O({sortable:this,name:"onDrag",evt:this._getEventProperties(X.event)}),this.animator.animate(),this.autoScroller.onStarted()},_appendGhost:function(){if(!P){var e=this.options,n=e.appendToBody?document.body:I(e.ghostContainer,this)||this.el,o=I(e.customGhost,B)||B;b(P=o.cloneNode(!0),e.ghostClass,!0);var i=d(R),r=t({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.height,margin:0,zIndex:1e5,opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},e.ghostStyle);for(var l in r)w(P,l,r[l]);tt.ghost=P,n.appendChild(P);var a=(X.clientX-i.left)/parseInt(P.style.width)*100,s=(X.clientY-i.top)/parseInt(P.style.height)*100;w(P,"transform-origin","".concat(a,"% ").concat(s,"%")),w(P,"will-change","transform")}},_nearestSortable:function(t){T(t);var e=t.touches&&t.touches[0]||t;if(R&&function(t){var e=U||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}(e)){!U&&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),l=o-X.clientX,a=i-X.clientY;U={event:t,clientX:o,clientY:i},w(P,"transform","translate3d(".concat(l,"px, ").concat(a,"px, 0)"));var s,c,u,h=(s=o,c=i,Q.reduce(function(t,e){var n=e[k].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=s>=o.left-n&&s<=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));h&&h[k]._onMove(t,r),this.autoScroller.onMove(r,U,h,this.options)}},_allowPut:function(){var t=this.options.group,e=j[k].options.group;return this.el===j||!!t.put&&(t.put.join&&t.put.indexOf(e.name)>-1||e.name&&t.name&&e.name===t.name)},_getDirection:function(){var t=this.options.draggable,e=this.options.direction;return e?I(e,U.event,B,this):y(L,t)},_allowSwap:function(){var t=d(N),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=N[e?"offsetHeight":"offsetWidth"],r=e?U.clientY:U.clientX,l=r>=t[n]&&r<t[o]-i/2?-1:1,a=m(L,0,this.options.draggable),s=v(L),c=d(a),u=d(s);if(N===L||p(L,N))return B===a&&r<c[n]?(A=N,!0):B===s&&r>u[o]&&(A=N.nextSibling,!0);var h=E(B,N);return A=h<0?N.nextSibling:N,q!==N?(J=l,!0):J!==l&&(J=l,l<0?h>0:h<0)},_onMove:function(t,e){var n=this.el,o=this.options;if(!o.disabled&&this._allowPut()){if(N=f(e,o.draggable,n),O({sortable:this,name:"onMove",evt:this._getEventProperties(t,{target:N})}),o.sortable||n!==j)return n===M||e!==n&&v(n)?void(N&&!N.animating&&!p(N,B)&&this._allowSwap()&&(N!==B&&A!==B?(n!==M?this._onInsert(t):N!==R&&this._onChange(t),q=N):q=N)):(N=q=null,void this._onInsert(t));M!==j&&(N=q=R,J=0,this._onInsert(t))}},_onInsert:function(t){var e=this.el,n=N||B,o="clone"===F&&e!==j&&M===j,i="clone"===F&&e===j&&M!==j,r=p(N,document),l=N===R&&!r,a=M[k],s=j[k];C=e,K=g(B),H=n,L=r?N.parentNode:e,a.animator.collect(B.parentNode),this.animator.collect(L),o&&(G.target=$,G.newIndex=K,G.relative=$===R?0:E(B,$),w(R,"display",""),s.options.group.revertDrag||B.parentNode.insertBefore(R,B)),i&&(K=g(R),w(R,"display","none")),w(B,"display",l?"none":""),N&&r?L.insertBefore(B,J<0?N:N.nextSibling):L.appendChild(B),Y=l?W:g(B),o&&s.options.group.revertDrag&&(G.target=R,G.newIndex=W,G.relative=0,O({sortable:s,name:"onChange",evt:this._getEventProperties(t,{to:j,target:R,newIndex:W,revertDrag:!0})})),o||O({sortable:a,name:"onRemove",evt:this._getEventProperties(t,{newIndex:-1})}),i&&n!==R&&($=n,O({sortable:this,name:"onChange",evt:this._getEventProperties(t,{from:j,backToOrigin:!0})})),i||O({sortable:this,name:"onAdd",evt:this._getEventProperties(t,{oldIndex:-1})}),a.animator.animate(),this.animator.animate(),M=e},_onChange:function(t){var e=this.el;this.animator.collect(L),K=g(B),L=N.parentNode,H=N,e===j&&($=N),L.insertBefore(B,A),Y=g(B),O({sortable:this,name:"onChange",evt:this._getEventProperties(t)}),this.animator.animate(),M=e},_onDrop:function(t){var e=this,n=this.options;if(this._cancelStart(),u(V,"touchmove",this._nearestSortable),u(V,"mousemove",this._nearestSortable),u(V,"mouseup",this._onDrop),u(V,"touchend",this._onDrop),u(V,"touchcancel",this._onDrop),u(document,"selectstart",T),a&&w(document.body,"user-select",""),P&&P.parentNode&&P.parentNode.removeChild(P),j)if(M=j,K=W,H===B&&(H=R),b(R,n.chosenClass,!1),O({sortable:this,name:"onUnchoose",evt:this._getEventProperties(t)}),U){this.animator.collect(L),b(B,n.chosenClass,!1),b(B,n.placeholderClass,!1);var o=this._getEventProperties(t);!n.dropOnAnimationEnd&&this._onEnd(o),this.animator.animate(function(){n.dropOnAnimationEnd&&e._onEnd(o)})}else this._nulling();else this._nulling()},_onEnd:function(e){var n=this.options,o="clone"===F,i=M===C;o&&!i||!I(n.swapOnDrop,e)||L.insertBefore(R,B),o&&!i||!I(n.removeCloneOnDrop,e)||B&&B.parentNode&&B.parentNode.removeChild(B),w(R,"display",""),M!==C&&O({sortable:M[k],name:"onDrop",evt:t({},e,o?G:{newIndex:-1})}),O({sortable:C[k],name:"onDrop",evt:t({},e,i?{}:{oldIndex:-1})}),this._nulling()},_getEventProperties:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=e,o.to=C,o.from=M,o.node=R,o.clone=B,o.target=H,o.oldIndex=K,o.newIndex=Y,o.pullMode=F,t(o,n),o.relative=H===R?0:E(B,H),o},_nulling:function(){C=M=R=N=A=j=B=P=H=L=F=K=Y=W=X=U=q=V=G=$=J=tt.clone=tt.ghost=tt.active=tt.dragged=null,this.autoScroller.nulling()},destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=Q.indexOf(this.el);t>-1&&Q.splice(t,1),this.el[k]=this.animator=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.autoScroller.options[t]=e,"group"===t&&Z(this.options)}},tt.utils={on:c,off:u,css:w,index:g,matches:S,closest:f,getRect:d,toggleClass:b,detectDirection:y},tt.get=function(t){return t[k]},tt.create=function(t,e){return new tt(t,e)},tt}()}(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),l=0;l<i;l++)r[l]=arguments[l];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();for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];n.apply(this,e)};return o.cancel=function(){n.cancel()},o}function m(t,e){return 0===t&&0===e?1/t==1/e:!(!Number.isNaN(t)||!Number.isNaN(e))||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=function(){return l(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)},[{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){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else if(t<0)this.scrollToOffset(0);else{var n=this.getOffset(),o=this.getClientSize(),i=this.getSize(this.options.uniqueKeys[t]),r=this.getOffsetByRange(0,t)+this.getScrollStartOffset(),l=r+i;if("auto"===e){if(r>=n&&l<=n+o)return;e=r<n?"top":"bottom"}if("top"===e)this.scrollToOffset(r);else if("bottom"===e){var a=Math.max(0,l-o);this.scrollToOffset(a)}}}},{key:"scrollToBottom",value:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout(function(){t.isReachedBottom()||t.scrollToBottom()},5)}},{key:"isReachedBottom",value:function(){return this.getOffset()+this.getClientSize()+1>=this.getScrollSize()}},{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:"updateItemSize",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=s(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){var e=this.range.start!==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),e)}},{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}}])}(),w=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","appendToBody","ghostContainer","scrollThreshold","delayOnTouchOnly","placeholderClass","dropOnAnimationEnd"],x=["size","keeps","scroller","direction","uniqueKeys","debounceTime","throttleTime"],E=function(){return l(function t(e,n){i(this,t),this.el=e,this.options=n,this.initVirtual(),this.initSortable()},[{key:"destroy",value:function(){this.virtual.removeScrollEventListener(),this.sortable.destroy()}},{key:"option",value:function(t,e){this.options[t]=e,x.includes(t)&&this.virtual.option(t,e),w.includes(t)&&this.sortable.option(t,e)}},{key:"call",value:function(t){if(t in this.virtual){var e=this.virtual[t];if("function"==typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.apply(this.virtual,o)}throw new Error("Property ".concat(String(t)," is not a function on Virtual."))}throw new Error("Method ".concat(String(t)," does not exist on Virtual."))}},{key:"initVirtual",value:function(){var t=this,e=x.reduce(function(e,n){return e[n]=t.options[n],e},{});this.virtual=new S(Object.assign(Object.assign({},e),{buffer:this.options.buffer,wrapper:this.options.wrapper,scroller:this.options.scroller,uniqueKeys:this.options.uniqueKeys,onScroll:function(e){return t.onScroll(e)},onUpdate:function(e,n){return t.onUpdate(e,n)}}))}},{key:"onScroll",value:function(t){this.dispatchEvent("onScroll",t)}},{key:"onUpdate",value:function(t,e){"dragging"===this.sortableState&&e&&(this.removeDraggedEl=!0),this.dispatchEvent("onUpdate",t,e)}},{key:"initSortable",value:function(){var t=this,e=w.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:!1,removeCloneOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)}}))}},{key:"onDrag",value:function(t){this.sortableState="dragging";var e=t.node.getAttribute("data-key"),n=this.getIndex(e);this.sortable.option("store",{key:e,index:n}),this.dispatchEvent("onDrag",{key:e,index:n,event:t})}},{key:"onDrop",value:function(t){var e,n,o=p.get(t.from).option("store"),i=o.key,r=o.index,l={key:i,event:t,changed:!1,oldIndex:r,newIndex:r};if(t.from!==t.to||t.node!==t.target){var a=this.getEventProperties(l,t);Object.assign(l,a)}this.dispatchEvent("onDrop",l),t.from===this.el&&this.removeDraggedEl&&(null===(e=p.dragged)||void 0===e||e.remove()),t.from!==t.to&&(null===(n=p.clone)||void 0===n||n.remove()),this.sortableState="",this.removeDraggedEl=!1}},{key:"getEventProperties",value:function(t,e){var n=t.key,o=t.oldIndex,i=e.target.getAttribute("data-key"),r=-1,l=o;return e.from===e.to?((l=this.getIndex(n))<(r=this.getIndex(i))&&-1===e.relative||l>r&&1===e.relative)&&(r+=e.relative):(e.from===this.el&&(l=this.getIndex(n)),e.to===this.el&&(l=-1,r=this.getIndex(i),0===e.relative?r=this.options.uniqueKeys.length:1===e.relative&&(r+=e.relative))),{changed:e.from!==e.to||r!==l,oldIndex:l,newIndex:r}}},{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){if(t in this.options){var e=this.options[t];if("function"==typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.apply(this,o)}}}}])}();function T(t){var e=t.dataKey,o=t.horizontal,i=t.dragging,r=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=o?"offsetWidth":"offsetHeight",n=a.current[t];l(e,n)}),a.current&&(null==t||t.observe(a.current))),function(){t&&(t.disconnect(),t=null)}},[a]);var s=n.useMemo(function(){var t=r.props.style||{},n=m(e,i);return Object.assign(Object.assign({},t),{display:n?"none":""})},[i]);return n.cloneElement(r,{"data-key":e,role:"item",ref:a,style:s,className:r.props.className})}var O,I=n.memo(T);function k(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,l=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,S=void 0===b?{}:b,w=t.className,x=void 0===w?"":w,T=t.wrapStyle,k=void 0===T?{}:T,z=t.wrapClass,_=void 0===z?"":z,D=t.size,C=void 0===D?void 0:D,M=t.keeps,R=void 0===M?30:M,N=t.scroller,A=void 0===N?void 0:N,j=t.direction,B=void 0===j?"vertical":j,P=t.debounceTime,H=void 0===P?0:P,L=t.throttleTime,F=void 0===L?0:L,K=t.delay,Y=void 0===K?0:K,W=t.group,X=void 0===W?"":W,U=t.handle,q=void 0===U?"":U,V=t.lockAxis,G=void 0===V?void 0:V,$=t.disabled,J=void 0!==$&&$,Q=t.sortable,Z=void 0===Q||Q,tt=t.draggable,et=void 0===tt?'[role="item"]':tt,nt=t.animation,ot=void 0===nt?150:nt,it=t.autoScroll,rt=void 0===it||it,lt=t.scrollSpeed,at=void 0===lt?{x:10,y:10}:lt,st=t.ghostClass,ct=void 0===st?"":st,ut=t.ghostStyle,ht=void 0===ut?void 0:ut,dt=t.chosenClass,ft=void 0===dt?"":dt,pt=t.placeholderClass,vt=void 0===pt?"":pt,gt=t.appendToBody,mt=void 0!==gt&&gt,yt=t.scrollThreshold,bt=void 0===yt?55:yt,St=t.delayOnTouchOnly,wt=void 0!==St&&St,xt=t.dropOnAnimationEnd,Et=void 0===xt||xt,Tt=a(n.useState({start:0,end:R-1,front:0,behind:0}),2),Ot=Tt[0],It=Tt[1],kt=n.useRef(""),zt=n.useRef(),_t=n.useRef(),Dt=function(t){return Vt.current.call("getSize",t)},Ct=function(){return Vt.current.call("getOffset")},Mt=function(){return Vt.current.call("getClientSize")},Rt=function(){return Vt.current.call("getScrollSize")},Nt=function(t){Vt.current.call("scrollToOffset",t)},At=function(t,e){Vt.current.call("scrollToIndex",t,e)},jt=function(t,e){var n=Lt.current.indexOf(t);n>-1&&Vt.current.call("scrollToIndex",n,e)},Bt=function(){Nt(0)},Pt=function(){Vt.current.call("scrollToBottom")};n.useImperativeHandle(e,function(){return{getSize:Dt,getOffset:Ct,getClientSize:Mt,getScrollSize:Rt,scrollToTop:Bt,scrollToKey:jt,scrollToIndex:At,scrollToOffset:Nt,scrollToBottom:Pt}});var Ht=n.useRef([]),Lt=n.useRef([]),Ft=n.useRef(0),Kt=n.useRef(0);n.useEffect(function(){var e;if(Ht.current=l,Xt(),Ut(Ft.current,l.length),Kt.current&&t.keepOffset){var n=l.length-Kt.current;n>0&&(null===(e=Vt.current)||void 0===e||e.call("scrollToIndex",n)),Kt.current=0}Ft.current=l.length},[l]),n.useEffect(function(){return $t(),function(){Vt.current.destroy()}},[]);var Yt,Wt,Xt=function(){var t;Lt.current=Ht.current.map(function(t){return y(t,i)}),null===(t=Vt.current)||void 0===t||t.option("uniqueKeys",Lt.current)},Ut=function(t,e){var n,o;if(t!==e){var i=Object.assign({},Ot);t>R&&e>t&&i.end===t-1&&(null===(n=Vt.current)||void 0===n?void 0:n.call("isReachedBottom"))&&i.start++,null===(o=Vt.current)||void 0===o||o.call("updateRange",i)}},qt=function(e){for(var n=t[e],o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n&&n.apply(null,i)},Vt=n.useRef(),Gt={size:C,keeps:R,scroller:A,direction:B,debounceTime:H,throttleTime:F,delay:Y,group:X,handle:q,lockAxis:G,disabled:J,sortable:Z,draggable:et,animation:ot,autoScroll:rt,ghostClass:ct,ghostStyle:ht,chosenClass:ft,scrollSpeed:at,appendToBody:mt,scrollThreshold:bt,delayOnTouchOnly:wt,placeholderClass:vt,dropOnAnimationEnd:Et},$t=function(){Vt.current=new E(zt.current,Object.assign(Object.assign({},Gt),{buffer:Math.round(R/3),wrapper:_t.current,scroller:A||zt.current,uniqueKeys:Lt.current,ghostContainer:_t.current,onDrag:ee,onDrop:ne,onScroll:Zt,onUpdate:te}))};Yt=Gt,Wt=function(){Vt.current&&Object.keys(Gt).forEach(function(e){void 0!==t[e]&&Vt.current.option(e,t[e])})},n.useEffect(Wt,Object.values(Yt));var Jt=g(function(){Kt.current=Ht.current.length,qt("onTop")},50),Qt=g(function(){qt("onBottom")},50),Zt=function(t){Kt.current=0,t.top?Jt():t.bottom&&Qt()},te=function(t,e){It(t),e&&qt("onRangeChange",t)},ee=function(t){var e,n,o=t.key,i=t.index,r=Ht.current[i];kt.current=o,O=r,Z||(null===(e=Vt.current)||void 0===e||e.call("enableScroll",!1),null===(n=Vt.current)||void 0===n||n.option("autoScroll",!1)),qt("onDrag",Object.assign(Object.assign({},t),{item:r}))},ne=function(e){var n=O,o=e.oldIndex,i=e.newIndex,r=s(Ht.current),l=s(Ht.current);-1===o?l.splice(i,0,n):-1===i?l.splice(o,1):(l.splice(o,1),l.splice(i,0,n)),Vt.current.call("enableScroll",!0),Vt.current.option("autoScroll",t.autoScroll),kt.current="",qt("onDrop",Object.assign(Object.assign({},e),{item:n,list:l,oldList:r}))},oe=n.useMemo(function(){var t=Ot.front,e=Ot.behind,n="horizontal"===B,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{rootElStyle:Object.assign(Object.assign({},S),{overflow:h||A?"":o}),wrapElStyle:Object.assign(Object.assign({},k),{padding:h?"":i})}},[Ot,S,k,A,h,B]),ie=oe.rootElStyle,re=oe.wrapElStyle,le=n.useMemo(function(){return{rootElTag:h?"table":f,wrapElTag:h?"tbody":f}},[v,f,h]),ae=le.rootElTag,se=le.wrapElTag,ce=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,l=t.horizontal,a=t.dragging,s=t.children,c=t.onSizeChange;return n.useMemo(function(){return e.slice(o,i+1).map(function(t,e){var i=o+e,u=y(t,r);return n.createElement(I,{key:u,dataKey:u,dragging:a,horizontal:l,onSizeChange:c},"function"==typeof s?s(t,i,u):s)})},[e,o,i,r,l,a,s])}({list:l,start:Ot.start,end:Ot.end,dataKey:i,children:t.children,dragging:kt.current,horizontal:"horizontal"===B,onSizeChange:function(t,e){if(!m(t,kt.current)&&Vt.current){var n=Vt.current.virtual.sizes.size;Vt.current.call("updateItemSize",t,e),n===R-1&&Ht.current.length>R&&Vt.current.call("updateRange",Ot)}}}),ue=function(t,e){var o,i,r,l=(o={padding:0,border:0},i="vertical"===B?"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:l}))};return n.createElement(ae,{ref:zt,style:ie,className:x},[t.header,n.createElement(se,{ref:_t,style:re,className:_},[h&&ue(Ot.front,"front")].concat(s(ce),[h&&ue(Ot.behind,"behind")])),t.footer])}return n.forwardRef(k)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-virtual-sortable",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
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",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://github.com/mfuu/react-virtual-sortable#readme",
40
40
  "dependencies": {
41
- "sortable-dnd": "^0.6.23"
41
+ "sortable-dnd": "^0.7.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.16.7",
package/types/index.d.ts CHANGED
@@ -1,24 +1,31 @@
1
1
  import * as React from 'react';
2
- import { SortableEvent, Group, ScrollSpeed } from 'sortable-dnd';
2
+ import { Group, ScrollSpeed, SortableEvent } from 'sortable-dnd';
3
3
 
4
+ interface Range {
5
+ start: number;
6
+ end: number;
7
+ front: number;
8
+ behind: number;
9
+ }
10
+
11
+ type KeyValueType = string | number;
12
+ type RenderFunc<T> = (item: T, index: number, key: KeyValueType) => React.ReactElement;
4
13
  interface DragEvent<T> {
14
+ key: KeyValueType;
15
+ index: number;
5
16
  item: T;
6
- key: string | number;
7
- index?: number;
8
17
  event: SortableEvent;
9
18
  }
10
19
  interface DropEvent<T> {
11
- key: string | number;
12
- item: T;
20
+ key: KeyValueType;
13
21
  list: T[];
22
+ item: T;
23
+ oldList: T[];
14
24
  event: SortableEvent;
15
25
  changed: boolean;
16
- oldList: T[];
17
26
  oldIndex: number;
18
27
  newIndex: number;
19
28
  }
20
-
21
- declare type RenderFunc<T> = (item: T, index: number, key: string | number) => React.ReactElement;
22
29
  interface VirtualProps<T> {
23
30
  dataKey: string;
24
31
  dataSource: T[];
@@ -41,13 +48,14 @@ interface VirtualProps<T> {
41
48
  keepOffset?: boolean;
42
49
  autoScroll?: boolean;
43
50
  scrollSpeed?: ScrollSpeed;
44
- fallbackOnBody?: boolean;
51
+ appendToBody?: boolean;
45
52
  scrollThreshold?: number;
46
53
  delayOnTouchOnly?: boolean;
54
+ dropOnAnimationEnd?: boolean;
47
55
  rootTag?: string;
48
- wrapTag?: string;
49
56
  style?: CSSStyleDeclaration;
50
57
  className?: string;
58
+ wrapTag?: string;
51
59
  wrapStyle?: CSSStyleDeclaration;
52
60
  wrapClass?: string;
53
61
  ghostStyle?: CSSStyleDeclaration;
@@ -60,14 +68,15 @@ interface VirtualProps<T> {
60
68
  onBottom?: () => void;
61
69
  onDrag?: (event: DragEvent<T>) => void;
62
70
  onDrop?: (event: DropEvent<T>) => void;
71
+ onRangeChange?: (range: Range) => void;
63
72
  }
64
73
  interface VirtualComponentRef {
65
- getSize: (key: string | number) => number;
74
+ getSize: (key: KeyValueType) => number;
66
75
  getOffset: () => number;
67
76
  getClientSize: () => number;
68
77
  getScrollSize: () => number;
69
78
  scrollToTop: () => void;
70
- scrollToKey: (key: string | number) => void;
79
+ scrollToKey: (key: KeyValueType) => void;
71
80
  scrollToIndex: (index: number) => void;
72
81
  scrollToOffset: (offset: number) => void;
73
82
  scrollToBottom: () => void;