Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-virtual-draglist

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-virtual-draglist - npm Package Compare versions

Comparing version 3.1.3 to 3.1.4

2

dist/virtual-drag-list.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualDragList=e(t.Vue)}(this,function(z){"use strict";function _(){_=function(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,u=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function r(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{r({},"")}catch(t){r=function(t,e,n){return t[e]=n}}function s(t,e,n,o){var i,r,a,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),o=new S(o||[]);return u(e,"_invoke",{value:(i=t,r=n,a=o,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return O()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var o=n.method,i=e.iterator[o];if(void 0===i)return n.delegate=null,"throw"===o&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;o=c(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,a);if(n){if(n===h)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";n=c(i,r,a);if("normal"===n.type){if(s=a.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}})}),e}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(r(e,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(x([]))),m=(g&&g!==t&&l.call(g,o)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){r(t,e,function(t){return this._invoke(e,t)})})}function y(a,s){var e;u(this,"_invoke",{value:function(n,o){function t(){return new s(function(t,e){!function e(t,n,o,i){var r,t=c(a[t],a,n);if("throw"!==t.type)return(n=(r=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):s.resolve(n).then(function(t){r.value=t,o(r)},function(t){return e("throw",t,o,i)});i(t.arg)}(n,o,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(e){if(e){var n,t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:O}}function O(){return{value:void 0,done:!0}}return u(m,"constructor",{value:d.prototype=p,configurable:!0}),u(p,"constructor",{value:d,configurable:!0}),d.displayName=r(p,i,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,i,"GeneratorFunction")),t.prototype=Object.create(m),t},a.awrap=function(t){return{__await:t}},v(y.prototype),r(y.prototype,n,function(){return this}),a.AsyncIterator=y,a.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var r=new y(s(t,e,n,o),i);return a.isGeneratorFunction(e)?r:r.next().then(function(t){return t.done?t.value:r.next()})},v(m),r(m,i,"Generator"),r(m,o,function(){return this}),r(m,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,n=Object(t),o=[];for(e in n)o.push(e);return o.reverse(),function t(){for(;o.length;){var e=o.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=x,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var o=this;function t(t,e){return r.type="throw",r.arg=n,o.next=t,e&&(o.method="next",o.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],r=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}var r=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return r.type=t,r.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,o,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(o=n.arg,w(i)),o}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},a}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(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,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(o.key),o)}}function A(t,e,n){e&&D(t.prototype,e),n&&D(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function M(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?P(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}(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 P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function R(r,t,e){function n(){for(var t,e=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return a&&clearTimeout(a),u?(t=!a,a=setTimeout(function(){a=null},l),t&&(s=r.apply(this,o))):a=setTimeout(function(){r.apply(e,o)},l),s}var a,s,l=1<arguments.length&&void 0!==t?t:50,u=2<arguments.length&&void 0!==e&&e;return n.prototype.cancel=function(){clearTimeout(a),a=null},n}function K(o,t){var i,r=1<arguments.length&&void 0!==t?t:50;return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];i=i||setTimeout(function(){i=null,o.apply(this,e)},r)}}function B(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}function t(t,a,s,l){return new(s=s||Promise)(function(n,e){function o(t){try{r(l.next(t))}catch(t){e(t)}}function i(t){try{r(l.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(o,i)}r((l=l.apply(t,a||[])).next())})}var H,Y,l,X,d,q,V,U,W,u,s,c,h,f,p,i,g,m,v,G,J,Z,y,b,$,w,S,x,Q;function tt(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function O(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(r),!0).forEach(function(t){var e,n=i,o=r[t];(t="symbol"==typeof(e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?e:String(e))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function et(t){return(et="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})(t)}function e(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function nt(t,e){t.style["".concat(W,"TransitionDuration")]=null==e?"":"".concat(e,"ms")}function k(t,e){t.style["".concat(W,"Transform")]=e?"".concat(e):""}function T(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!U&&d)&&H):window.attachEvent&&t.attachEvent("on"+e,n)}function n(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!U&&d)&&H):window.detachEvent&&t.detachEvent("on"+e,n)}function ot(t){var e=t,n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0],t=n?document.elementFromPoint(n.clientX,n.clientY):t.target;return!n||"clientX"in e||(e.clientX=n.clientX,e.clientY=n.clientY,e.pageX=n.pageX,e.pageY=n.pageY,e.screenX=n.screenX,e.screenY=n.screenY),{touch:n,event:e,target:t}}function E(t,e){for(var n={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth};n.top+=t.offsetTop,n.left+=t.offsetLeft,(t=t.parentNode)&&t!==e;);return n}function it(){return document.scrollingElement||document.documentElement}function N(t){var e,n,o,i,r,a,s,l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},u=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==it()){if(n=(e=t.getBoundingClientRect()).top,o=e.left,i=e.bottom,r=e.right,a=e.height,s=e.width,l.parent&&t.parentNode!==t.ownerDocument.body)for(var c,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((c=h.getBoundingClientRect()).height<a)return n=c.top,o=c.left,i=c.bottom,r=c.right,a=c.height,{top:n,left:o,bottom:i,right:r,width:s=c.width,height:a};h=h.parentNode}}else o=n=0,i=window.innerHeight,r=window.innerWidth,a=window.innerHeight,s=window.innerWidth;if((l.block||l.relative)&&t!==window&&(u=u||t.parentNode,!d))do{if(u&&u.getBoundingClientRect&&("none"!==L(u,"transform")||l.relative&&"static"!==L(u,"position"))){var f=u.getBoundingClientRect();n-=f.top+parseInt(L(u,"border-top-width")),o-=f.left+parseInt(L(u,"border-left-width")),i=n+e.height,r=o+e.width;break}}while(u=u.parentNode);return{top:n,left:o,bottom:i,right:r,width:s,height:a}}}function rt(t,e,n,o){if(t){n=n||document;do{if(null==e){var i=Array.prototype.slice.call(n.children),r=i.indexOf(t);if(-1<r)return i[r];for(var a=0;a<i.length;a++)if(at(t,i[a]))return i[a]}else if((">"!==e[0]||t.parentNode===n)&&lt(t,e)||o&&t===n)return t}while(t=t.parentNode)}return null}function at(t,e){if(t&&e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}}function st(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(Y," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(Y," ")))}function lt(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{return t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e)}catch(t){}}function ut(t,e){return t.top!==e.top||t.left!==e.left}function L(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];o[e=e in o||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function ct(t){this.options=t||{},this.groupName=t.group.name||"group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32)}function ht(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function ft(t){this.options=t,this.animations=[]}function dt(){this.helper=null,this.distance={x:0,y:0}}function r(){var t,e={from:O({},w),to:O({},S)};return v&&(t={from:O({},s),to:O({},c)},e.from=O(O({},t.from),e.from),e.to=O(O({},t.to),e.to)),e}function a(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[u]=this).el=t,this.ownerDocument=t.ownerDocument,this.options=e=Object.assign({},e);var n,o,i={disabled:!1,group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:25,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",fallbackOnBody:!1,stopPropagation:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in i)n in this.options||(this.options[n]=i[n]);for(o in Q(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));T(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),y.push(t),this.multiplayer=new ct(this.options),this.animator=new ft(this.options)}H={capture:!1,passive:!1},Y=/\s+/g,l={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},d=e(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),q=e(/Edge/i),V=e(/safari/i)&&!e(/chrome/i)&&!e(/android/i),X=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return X=!0}}),U=X,W="undefined"==typeof window||"undefined"==typeof document?"":(o=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(o=(Array.prototype.slice.call(o).join("").match(/-(moz|webkit|ms)-/)||""===o.OLink&&["","o"])[1])?o&&o.length?o[0].toUpperCase()+o.substr(1):"":"ms"),u="Sortable"+Date.now(),s=O({},o={sortable:null,nodes:[]}),c=O({},o),h={},ct.prototype={allowDrag:function(t){return this.options.multiple&&h[this.groupName]&&h[this.groupName].length&&-1<h[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return h[this.groupName].forEach(function(t,e){(t=t.cloneNode(!0)).style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n "),n.appendChild(t)}),n},select:function(t,e,n,o){var i;e&&(h[this.groupName]||(h[this.groupName]=[]),i=h[this.groupName].indexOf(e),st(e,this.options.selectedClass,i<0),t=O(O({},o),{},{event:t}),i<0?(h[this.groupName].push(e),o.sortable._dispatchEvent("onSelect",t)):(h[this.groupName].splice(i,1),o.sortable._dispatchEvent("onDeselect",t)),h[this.groupName].sort(function(t,e){return t=E(t,n),e=E(e,n),t.top==e.top?t.left-e.left:t.top-e.top}))},onDrag:function(e,t){s.sortable=t,s.nodes=h[this.groupName].map(function(t){return{node:t,rect:N(t),offset:E(t,e)}}),c.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,null,e.parentNode),h[this.groupName].forEach(function(t){t!=e&&t.parentNode.removeChild(t)}),t.animator.animate()},onChange:function(t,e){var n=N(t),o=E(t,e.el);c.sortable=e,c.nodes=h[this.groupName].map(function(t){return{node:t,rect:n,offset:o}})},onDrop:function(t,n,e,o,i){var r=this,a=(c.sortable.animator.collect(n,null,n.parentNode),h[this.groupName].indexOf(n)),o=(h[this.groupName].forEach(function(t,e){e<a?n.parentNode.insertBefore(t,n):(e=0<e?h[r.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),s.sortable=o.sortable,c.nodes=h[this.groupName].map(function(t){return{node:t,rect:N(t),offset:E(t,e)}}),c.sortable.el!=s.sortable.el||this._offsetChanged(s.nodes,c.nodes)),i=O(O({},i()),{},{changed:o,event:t});c.sortable.el!=s.sortable.el&&s.sortable._dispatchEvent("onDrop",i),c.sortable._dispatchEvent("onDrop",i),c.sortable.animator.animate()},_offsetChanged:function(t,n){return!!t.find(function(e){return ut(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),ht.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,o){var i=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){n&&o&&i.autoScroll(t,e,o),i.update(t,e,n,o)})},autoScroll:function(t,e,n){var o,i,r,a,s,l,u,c,h,f,d,p;t&&(o=n.clientX,n=n.clientY,void 0!==o)&&void 0!==n&&(h=N(t))&&(d=t.scrollTop,i=t.scrollLeft,r=t.scrollHeight,f=t.scrollWidth,a=h.top,s=h.right,l=h.bottom,u=h.left,p=h.height,h=h.width,n<a||s<o||l<n||o<u||(c=0<d&&a<=n&&n<=a+e,h=i+h<f&&o<=s&&s-e<=o,f=d+p<r&&n<=l&&l-e<=n,(p=d=0)<i&&u<=o&&o<=u+e&&(d=Math.floor(Math.max(-1,(o-u)/e-1)*this.speed.x)),h&&(d=Math.ceil(Math.min(1,(o-s)/e+1)*this.speed.x)),c&&(p=Math.floor(Math.max(-1,(n-a)/e-1)*this.speed.y)),(p=f?Math.ceil(Math.min(1,(n-l)/e+1)*this.speed.y):p)&&(t.scrollTop+=p),d&&(t.scrollLeft+=d)))}},ft.prototype={collect:function(t,e,n,o){var i=this;n&&(n=Array.prototype.slice.call(n.children),e=(t=this._getRange(n,t,e,o)).start,t=t.end,this.animations.length=0,n.slice(e,t+1).forEach(function(t){t!==o&&t!==a.helper&&i.animations.push({node:t,rect:N(t)})}))},animate:function(){var n=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;n._excute(e,t)})},_excute:function(t,e){var n=e.left,e=(e=e.top)-(o=N(t)).top,n=n-o.left,o=(nt(t),k(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,this.options.animation);nt(t,o),k(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){nt(t),k(t,""),t.animated=null},o)},_getRange:function(t,e,n){var o,e=t.indexOf(e);return(n=t.indexOf(n))<e&&(e=(o=[n,e])[0],n=o[1]),e<0&&(e=n,n=t.length-1),{start:e,end:n=n<0?t.length-1:n}}},dt.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null,this.distance={x:0,y:0}},move:function(t,e){this.helper&&k(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,o){if(!this.helper){var i,r=o.fallbackOnBody,a=o.ghostClass,o=void 0===(o=o.ghostStyle)?{}:o,r=r?document.body:n,s=(this.helper=e.cloneNode(!0),st(this.helper,a,!0),O({"box-sizing":"border-box",top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none"},o));for(i in s)L(this.helper,i,s[i]);e="none",(n=this.helper).style["".concat(W,"Transition")]=e?"none"===e?"none":"".concat(e):"",k(this.helper,"translate3d(0px, 0px, 0px)"),r.appendChild(this.helper),a=this.distance.x/parseInt(this.helper.style.width)*100,t=this.distance.y/parseInt(this.helper.style.height)*100,L(this.helper,"transform-origin","".concat(a,"% ").concat(t,"%")),L(this.helper,"transform","translateZ(0)"),L(this.helper,"will-change","transform")}}},Z={sortable:null,group:null,node:null,rect:{},offset:{}},y=[],b=new dt,$=new ht,w=O({},Z),S=O({},Z),x={x:0,y:0},Q=function(t){var e={},n=t.group;n&&"object"==et(n)||(n={name:n,pull:!0,put:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,t.group=e},(a.prototype={constructor:a,destroy:function(){this._dispatchEvent("destroy",this),this.el[u]=null;for(var t=0;t<l.start.length;t++)n(this.el,l.start[t],this._onDrag);this._clearState(),y.splice(y.indexOf(this.el),1),this.el=null},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&Q(n)},_onDrag:function(t){if(!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var e=(o=ot(t)).touch,n=o.event,o=o.target;if(!(V&&o&&"SELECT"===o.tagName.toUpperCase()||o===this.el)){var i=this.options,r=i.draggable;if(("function"!=typeof(i=i.handle)||i(t))&&("string"!=typeof i||lt(o,i))){if("function"==typeof r){if(!(i=r(t)))return;!function(t){if(t){var e=document.createElement("div");try{return e.appendChild(t.cloneNode(!0)),1==t.nodeType}catch(e){return t==window||t==document}}}(i)||(p=i)}else p=rt(o,r,this.el,!1);p&&!p.animated&&this._prepareStart(e,n)}}}},_prepareStart:function(t,e){var n=this,o=p.parentNode,i=((g=e).sortable=this,g.group=p.parentNode,(v=this.options.multiple&&this.multiplayer.allowDrag(p))&&this.multiplayer.onDrag(this.el,this),N(p)),r=E(p,this.el);w={sortable:this,group:o,node:p,rect:i,offset:r},S.group=o,S.sortable=this,b.distance={x:e.clientX-i.left,y:e.clientY-i.top},T(document,"touchend",this._onDrop),T(document,"touchcancel",this._onDrop),T(document,"mouseup",this._onDrop);o=(r=this.options).delay,e=r.delayOnTouchOnly;if(!o||e&&!t||q||d)this._onStart(t);else{for(var a=0;a<l.end.length;a++)T(this.ownerDocument,l.end[a],this._cancelStart);for(var s=0;s<l.move.length;s++)T(this.ownerDocument,l.move[s],this._delayMoveHandler);J=setTimeout(function(){return n._onStart(t)},o)}},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-g.clientX),Math.abs(t.clientY-g.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(J);for(var t=0;t<l.end.length;t++)n(this.ownerDocument,l.end[t],this._cancelStart);for(var e=0;e<l.move.length;e++)n(this.ownerDocument,l.move[e],this._delayMoveHandler)},_onStart:function(t){f=this.el,T(document,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;m||(this._dispatchEvent("onDrag",O(O({},r()),{},{event:g})),v&&this.multiplayer.onTrulyStarted(p,this),t=v?this.multiplayer.getHelper():p,b.init(w.rect,t,this.el,this.options),a.helper=b.node,st(p,this.options.chosenClass,!0),V&&L(document.body,"user-select","none"))},_nearestSortable:function(t){var e,n,o,i,r,a,s;this._preventEvent(t),g&&p&&(e=t.clientX,n=t.clientY,o=e-x.x,i=n-x.y,x.x=e,x.y=n,void 0!==e&&void 0!==n&&Math.abs(o)<=0&&Math.abs(i)<=0||(n=(e=ot(t)).event,o=e.target,r=n.clientX,a=n.clientY,y.some(function(t){var e,n,o=t[u].options.emptyInsertThreshold;if(o)return n=N(t,{parent:!0}),e=r>=n.left-o&&r<=n.right+o,n=a>=n.top-o&&a<=n.bottom+o,e&&n?s=t:void 0}),i=s,this._onTrulyStarted(),m=n,b.move(n.clientX-g.clientX,n.clientY-g.clientY),this._autoScroll(o),i&&(f=i)[u]._onMove(n,o)))},_allowPut:function(){var t,e;return g.sortable.el===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=g.sortable.options.group).name)&&t&&e.name===t},_onMove:function(t,e){if(this._dispatchEvent("onMove",O(O({},r()),{},{event:t})),this._allowPut()){if(i=rt(e,this.options.draggable,f,!1)){if(i===G)return;if((G=i)===p)return;if(i.animated||at(i,p))return}f!==w.sortable.el?e!==f&&function(t,e){for(var n=t.lastElementChild;n&&(n===e||"none"===L(n,"display"));)n=n.previousElementSibling;return n}(f,b.node)?i&&this._onInsert(t,!1):this._onInsert(t,!0):i&&this._onChange(t)}},_autoScroll:function(n){var n=function(){if(n&&n.getBoundingClientRect){var t=n;do{if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var e=L(t);if(t.clientWidth<t.scrollWidth&&("auto"==e.overflowX||"scroll"==e.overflowX)||t.clientHeight<t.scrollHeight&&("auto"==e.overflowY||"scroll"==e.overflowY))return t.getBoundingClientRect&&t!==document.body?t:it()}}while(t=t.parentNode)}return it()}(),t=(e=this.options).autoScroll,e=e.scrollThreshold;t&&$.update(n,e,g,m)},_onInsert:function(t,e){var n=e?p:i,o=e?f:i.parentNode;w.sortable.animator.collect(p,null,p.parentNode,p),this.animator.collect(null,n,o,p),v&&this.multiplayer.onChange(p,this),S={sortable:this,group:o,node:n,rect:N(n),offset:E(n,f)},w.sortable._dispatchEvent("onRemove",O(O({},r()),{},{event:t})),e?o.appendChild(p):o.insertBefore(p,i),this._dispatchEvent("onAdd",O(O({},r()),{},{event:t})),w.sortable.animator.animate(),this.animator.animate(),w.group=o,w.sortable=this},_onChange:function(t){var e=i.parentNode;this.animator.collect(p,i,e),v&&this.multiplayer.onChange(p,this),S={sortable:this,group:e,node:i,rect:N(i),offset:E(i,f)},this._dispatchEvent("onChange",O(O({},r()),{},{event:t}));t=(t=E(p,f)).top===S.offset.top?t.left<S.offset.left?i.nextSibling:i:t.top<S.offset.top?i.nextSibling:i;e.insertBefore(p,t),this.animator.animate(),w.group=e,w.sortable=this},_onDrop:function(t){this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),this._cancelStart(),$.clear(),p&&st(p,this.options.chosenClass,!1),p&&g&&m?this._onEnd(t):this.options.multiple&&this.multiplayer.select(t,p,f,O({},w)),this._clearState()},_onEnd:function(t){var e;w.group=g.group,w.sortable=g.sortable,v?this.multiplayer.onDrop(t,p,f,g,r):(S.rect=N(p),S.offset=E(p,f),e=S.sortable.el!==w.sortable.el||ut(w.offset,S.offset),e=O(O({},r()),{},{changed:e,event:t}),S.sortable.el!==w.sortable.el&&w.sortable._dispatchEvent("onDrop",e),S.sortable._dispatchEvent("onDrop",e)),V&&L(document.body,"user-select","")},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&(t&&t.stopPropagation?t.stopPropagation():window.event.cancelBubble=!0)},_dispatchEvent:function(t,e){"function"==typeof(t=this.options[t])&&t(e)},_clearState:function(){p=i=g=m=v=G=J=a.helper=null,x={x:0,y:0},w=S=O({},Z),b.destroy()},_unbindMoveEvents:function(){for(var t=0;t<l.move.length;t++)n(document,l.move[t],this._nearestSortable)},_unbindDropEvents:function(){for(var t=0;t<l.end.length;t++)n(document,l.end[t],this._onDrop)}}).utils={getRect:N,getOffset:E},a.get=function(t){return t[u]},a.create=function(t,e){return new a(t,e)};function pt(n,o,i){function t(){var t=n.event,e=n.dataKey;i(t,o.value?o.value[r.value]:0,e)}var e=null,r=z.computed(function(){return n.isHorizontal?"offsetWidth":"offsetHeight"});z.onMounted(function(){"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(function(){t()}),o.value)&&e.observe(o.value)}),z.onUpdated(function(){t()}),z.onUnmounted(function(){e&&(e.disconnect(),e=null)})}var gt=a,C="virtualSortableState",mt={from:{},to:{}},F=new(function(){function t(){I(this,t)}return A(t,[{key:"clear",value:function(){localStorage.removeItem(C)}},{key:"getStore",value:function(){try{return JSON.parse(localStorage.getItem(C))||mt}catch(t){return mt}}},{key:"getValue",value:function(){return new Promise(function(t,e){try{t(JSON.parse(localStorage.getItem(C))||mt)}catch(t){e(mt)}})}},{key:"setValue",value:function(i){return new Promise(function(t,e){try{var n=JSON.parse(localStorage.getItem(C)),o=JSON.stringify(Object.assign(Object.assign({},n),i));localStorage.setItem(C,o),t(o)}catch(t){e("{}")}})}}]),t}()),vt=["group","handle","disabled","draggable","ghostClass","ghostStyle","chosenClass","animation","autoScroll","scrollThreshold","fallbackOnBody","pressDelay","pressDelayOnTouchOnly"],j=null,yt=function(){function n(t,e){I(this,n),this.context=t,this.callback=e,this.initialList=M(t.list),this.dynamicList=M(t.list),this.sortable=null,this.rangeChanged=!1,this._init()}return A(n,[{key:"destroy",value:function(){this.sortable&&this.sortable.destroy(),this.sortable=null}},{key:"setValue",value:function(t,e){"list"===t?(this.initialList=M(e),j&&this._onDrag(j,!1)):(this.context[t]=e,this.sortable&&this.sortable.option(t,e))}},{key:"_init",value:function(){var o=this,t=vt.reduce(function(t,e){return t["pressDelayOnTouchOnly"===e?"delayOnTouchOnly":"pressDelay"===e?"delay":e]=o.context[e],t},{});this.sortable=new gt(this.context.container,Object.assign(Object.assign({},t),{list:this.dynamicList,onDrag:function(t){t=t.from;return o._onDrag(t.node)},onAdd:function(t){var e=t.from,t=t.to;return o._onAdd(e,t)},onRemove:function(t){var e=t.from,t=t.to;return o._onRemove(e,t)},onChange:function(t){var e=t.from,t=t.to;return o._onChange(e,t)},onDrop:function(t){var e=t.from,n=t.to,t=t.changed;return o._onDrop(e,n,t)}}))}},{key:"_onDrag",value:function(o){var i=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return t(this,void 0,void 0,_().mark(function t(){var e,n;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return j=o,this.dynamicList=M(this.initialList),e=M(this.initialList),n=this._getFromTo({node:o},e),t.next=6,F.setValue({from:Object.assign({list:e},n)});case 6:if(i)return this.rangeChanged=!1,t.next=10,F.getValue();t.next=14;break;case 10:n=t.sent,this.context.emit("drag",Object.assign({list:e},n)),t.next=15;break;case 14:this.rangeChanged=!0;case 15:case"end":return t.stop()}},t,this)}))}},{key:"_onAdd",value:function(i,r){var a;return t(this,void 0,void 0,_().mark(function t(){var e,n,o;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,F.getValue();case 2:e=t.sent,n=M(this.dynamicList),n=this._getIndex(n,r.node.dataset.key),o=Object.assign(Object.assign({},e.from),{index:n}),i.node===r.node?(o.index=this.dynamicList.length,this.dynamicList.push(null==(a=e.from)?void 0:a.item)):this.dynamicList.splice(n,0,null==(a=e.from)?void 0:a.item),delete o.list,this.context.emit("add",Object.assign({},o));case 9:case"end":return t.stop()}},t,this)}))}},{key:"_onRemove",value:function(n){return t(this,void 0,void 0,_().mark(function t(){var e;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=M(this.dynamicList),e=this._getFromTo(n,e),this.dynamicList.splice(e.index,1),this.context.emit("remove",Object.assign({},e));case 4:case"end":return t.stop()}},t,this)}))}},{key:"_onChange",value:function(o,i){return t(this,void 0,void 0,_().mark(function t(){var e,n;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=M(this.dynamicList),n=M(this.dynamicList),e=this._getFromTo(o,e),n=this._getFromTo(i,n),this.dynamicList.splice(e.index,1),this.dynamicList.splice(n.index,0,e.item);case 6:case"end":return t.stop()}},t,this)}))}},{key:"_onDrop",value:function(r,a,s){return t(this,void 0,void 0,_().mark(function t(){var e,n,o,i;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return(this.rangeChanged||r.sortable!==a.sortable)&&j&&j.remove(),e=M(this.dynamicList),o=this._getIndex(e,r.node.dataset.key),i=this.initialList[o],n=B(i,this.context.dataKey),t.next=7,F.setValue({to:{list:M(this.initialList),index:o,item:i,key:n}});case 7:return t.next=9,F.getValue();case 9:o=t.sent,i=Object.assign(Object.assign({list:e},o),{changed:s}),this.context.emit("drop",i),this.callback&&this.callback(i),this.initialList=M(e),this._clear();case 15:case"end":return t.stop()}},t,this)}))}},{key:"_getFromTo",value:function(t,e){var t=t.node.dataset.key,n=this._getIndex(e,t);return{key:t,item:e[n],index:n}}},{key:"_getIndex",value:function(t,e){var n=this;return t.findIndex(function(t){return B(t,n.context.dataKey)==e})}},{key:"_clear",value:function(){j=null,F.clear(),this.rangeChanged=!1}}]),n}(),bt="INIT",wt="FIXED",St="DYNAMIC",xt="FRONT",Ot="BEHIND",_t=function(){function n(t,e){I(this,n),this.options=Object.assign({},t),this.callback=e,this.sizes=new Map,this.calcIndex=0,this.calcType=bt,this.calcSize=Object.create(null),this.direction="",this.offset=0,this.range=Object.create(null),t&&this.checkIfUpdate(0,t.keeps-1)}return A(n,[{key:"updateUniqueKeys",value:function(t){this.options.uniqueKeys=t}},{key:"updateSizes",value:function(n){var o=this;this.sizes.forEach(function(t,e){n.includes(e)||o.sizes.delete(e)})}},{key:"updateRange",value:function(){var t,e,n=this,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;10<o||(t=this.range.start,this.isFront()?t-=2:this.isBehind()&&(t+=2),t=Math.max(t,0),e=Math.min(this.options.keeps,this.options.uniqueKeys.length),this.sizes.size>=e-2?this.handleUpdate(t,this.getEndByStart(t)):window.requestAnimationFrame?window.requestAnimationFrame(function(){return n.updateRange(o++)}):setTimeout(function(){return n.updateRange(o++)},3))}},{key:"handleScroll",value:function(t){this.direction=t<this.offset?xt:Ot,this.offset=t;t=this.getScrollItems(t);this.isFront()?this.handleScrollFront(t):this.isBehind()&&this.handleScrollBehind(t)}},{key:"isFront",value:function(){return this.direction===xt}},{key:"isBehind",value:function(){return this.direction===Ot}},{key:"isFixed",value:function(){return this.calcType===wt}},{key:"getScrollItems",value:function(t){var e=this.calcSize,n=e.fixed,e=e.header;if(e&&(t-=e),t<=0)return 0;if(this.isFixed())return Math.floor(t/n);for(var o,i,r=0,a=this.options.uniqueKeys.length;r<=a;){if(o=r+Math.floor((a-r)/2),(i=this.getOffsetByIndex(o))===t)return o;i<t?r=o+1:t<i&&(a=o-1)}return 0<r?--r:0}},{key:"handleScrollFront",value:function(t){t>this.range.start||(t=Math.max(t-Math.round(this.options.keeps/3),0),this.checkIfUpdate(t,this.getEndByStart(t)))}},{key:"handleScrollBehind",value:function(t){t<this.range.start+Math.round(this.options.keeps/3)||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"checkIfUpdate",value:function(t,e){var n=this.options,o=n.uniqueKeys,n=n.keeps;o.length&&o.length<=n?(t=0,e=o.length-1):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)}},{key:"handleUpdate",value:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.callback(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.getLastIndex();return this.isFixed()?(t-this.range.end)*this.calcSize.fixed:this.calcIndex===t?this.getOffsetByIndex(t)-this.getOffsetByIndex(this.range.end):(t-this.range.end)*this.getItemSize()}},{key:"getOffsetByIndex",value:function(t){if(!t)return 0;for(var e=0,n=0;n<t;n++){var o=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof o?o:this.getItemSize()}return this.calcIndex=Math.max(this.calcIndex,t-1),this.calcIndex=Math.min(this.calcIndex,this.getLastIndex()),e}},{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,t=t.keeps;return 0<e.length?e.length-1:t-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size}},{key:"handleItemSizeChange",value:function(t,e){this.sizes.set(t,e),this.calcType===bt?(this.calcType=wt,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=St,this.calcSize.fixed=0),this.calcType!==wt&&(this.calcSize.total=M(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))}},{key:"handleSlotSizeChange",value:function(t,e){this.calcSize[t]=e}}]),n}(),o={dataSource:{},dataKey:{type:String,default:"",required:!0},draggable:{type:[Function,String]},handle:{type:[Function,String]},group:{type:[Object,String]},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},delay:{type:Number,default:0},animation:{type:Number,default:150},autoScroll:{type:Boolean,default:!0},scrollThreshold:{type:Number,default:55},keepOffset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fallbackOnBody:{type:Boolean,default:!1},pressDelay:{type:Number,default:0},pressDelayOnTouchOnly:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},headerTag:{type:String,default:"div"},footerTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object,default:function(){return{}}},itemStyle:{type:Object,default:function(){return{}}},itemClass:{type:String,default:""},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},kt={tag:{type:String,default:"div"},event:{type:String},dataKey:{type:[String,Number]},isHorizontal:{type:Boolean}},Tt=z.defineComponent({name:"VirtualDraglistItems",props:kt,emits:["resize"],setup:function(n,t){var e=t.emit,o=t.slots,i=z.ref(null);return pt(n,i,e),function(){var t=n.tag,e=n.dataKey;return z.h(t,{ref:i,key:e,"data-key":e},{default:function(){var t;return null==(t=o.default)?void 0:t.call(o)}})}}}),Et=z.defineComponent({name:"VirtualDraglistSlots",props:kt,emits:["resize"],setup:function(n,t){var e=t.emit,o=t.slots,i=z.ref(null);return pt(n,i,e),function(){var t=n.tag,e=n.dataKey;return z.h(t,{ref:i,key:e,"data-key":e},{default:function(){var t;return null==(t=o.default)?void 0:t.call(o)}})}}});return z.defineComponent({props:o,emits:["update:dataSource","top","bottom","drag","drop","add","remove"],setup:function(r,t){var a,o,n=t.emit,s=t.slots,t=t.expose,l=z.ref(Object.create(null)),u=z.ref(null),c=z.ref(null),h=z.ref(null),i=z.ref([]),f=z.ref([]),e=null,d="vertical"!==r.direction,p=d?"scrollWidth":"scrollHeight",g=d?"scrollLeft":"scrollTop",m=d?"offsetLeft":"offsetTop",v=d?"clientWidth":"clientHeight";function y(){return u.value?Math.ceil(u.value[g]):0}function b(){u.value&&(u.value[g]=0)}function w(){h.value&&(x(h.value[m]),setTimeout(function(){u.value&&y()+Math.ceil(u.value[v])+1<Math.ceil(u.value[p])&&w()},5))}function S(t){var e;t>=i.value.length-1?w():void 0!==(e=o.getOffsetByIndex(t))&&(x(e),setTimeout(function(){y()!==o.getOffsetByIndex(t)&&S(t)},5))}function x(t){u.value&&(u.value[g]=t)}function O(t){t=t,(t=z.isRef(t)?t.value:t)&&(i.value=M(t),C(),o.updateUniqueKeys(f.value),o.updateSizes(f.value),z.nextTick(function(){return o.updateRange()}),a?a.setValue("list",M(t)):z.nextTick(_),e)&&r.keepOffset&&(S(E(e)),e=null)}function _(){a=new yt(Object.assign({container:c.value,list:i.value,emit:n},r),function(t){var e=t.list;t.changed&&(a.rangeChanged&&o.direction&&0<l.value.start&&-1<(t=e.indexOf(i.value[l.value.start]))&&(l.value.start=t,l.value.end=t+r.keeps-1),i.value=M(e),C(),o.updateUniqueKeys(f.value),n("update:dataSource",M(e)))})}function k(t,e){o.handleItemSizeChange(e,t)}function T(t,e){o.handleSlotSizeChange(e,t)}function E(e){return i.value.findIndex(function(t){return B(e,r.dataKey)==B(t,r.dataKey)})}function N(t,e){var n=s[t];return n?z.h(Et,{key:t,tag:e,dataKey:t,event:"resize",onResize:T},{default:function(){return null==n?void 0:n()}}):null}function L(){var t=(e=l.value).start,e=e.end;return i.value.slice(t,e+1).map(function(e){var t,n=E(e),o=B(e,r.dataKey),i=Object.assign(Object.assign({},r.itemStyle),(i=o,a&&(t=F.getStore().from.key,a.rangeChanged)&&i==t?{display:"none"}:{}));return s.item?z.h(Tt,{key:o,tag:r.itemTag,class:r.itemClass,style:i,event:"resize",dataKey:o,isHorizontal:d,onResize:k},{default:function(){var t;return null==(t=s.item)?void 0:t.call(s,{record:e,index:n,dataKey:o})}}):null})}var C=function(){f.value=i.value.map(function(t){return B(t,r.dataKey)})},j=R(function(){var t,e,n;u.value&&(t=y(),e=Math.ceil(u.value[v]),n=Math.ceil(u.value[p]),!o||!n||t<0||n+1<t+e||(o.handleScroll(t),o.isFront()?i.value.length&&t<=0&&I():o.isBehind()&&n<=e+t&&D()))},r.delay),I=K(function(){n("top"),e=i.value[0]}),D=K(function(){n("bottom")});z.watch(function(){return r.dataSource},function(t){O(t)},{deep:!0}),z.watch(function(){return r.disabled},function(t){a&&a.setValue("disabled",t)},{immediate:!0}),z.onBeforeMount(function(){o=new _t({size:r.size,keeps:r.keeps,uniqueKeys:f.value},function(t){var e,n;l.value=t,a&&(t=F.getStore(),e=(n=l.value).start,n=n.end,-1<(t=t.from.index))&&!(e<=t&&t<=n)&&(a.rangeChanged=!0)}),O(r.dataSource)}),z.onActivated(function(){o&&x(o.offset)}),z.onUnmounted(function(){a&&a.destroy()});return t({reset:function(){b(),O(r.dataSource)},getSize:function(t){return o.sizes.get(t)},getOffset:y,scrollToTop:b,scrollToBottom:w,scrollToIndex:S,scrollToOffset:x}),function(){var t=r.rootTag,e=r.wrapTag,n=l.value,o=n.front,n=n.behind,i=Object.assign(Object.assign({},r.wrapStyle),{padding:d?"0px ".concat(n,"px 0px ").concat(o,"px"):"".concat(o,"px 0px ").concat(n,"px")});return z.h(t,{ref:u,style:{overflow:d?"auto hidden":"hidden auto"},onScroll:j},{default:function(){return[N("header",r.headerTag),z.h(e,{ref:c,role:"group",class:r.wrapClass,style:i},{default:L}),N("footer",r.footerTag),z.h("div",{ref:h,style:{width:d?"0px":"100%",height:d?"100%":"0px"}})]}})}}})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualDragList=e(t.Vue)}(this,function(Y){"use strict";function _(){_=function(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,u=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function r(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{r({},"")}catch(t){r=function(t,e,n){return t[e]=n}}function s(t,e,n,o){var i,r,a,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),o=new S(o||[]);return u(e,"_invoke",{value:(i=t,r=n,a=o,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return O()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var o=n.method,i=e.iterator[o];if(void 0===i)return n.delegate=null,"throw"===o&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;o=c(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,a);if(n){if(n===h)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";n=c(i,r,a);if("normal"===n.type){if(s=a.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}})}),e}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(r(e,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(x([]))),m=(g&&g!==t&&l.call(g,o)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){r(t,e,function(t){return this._invoke(e,t)})})}function y(a,s){var e;u(this,"_invoke",{value:function(n,o){function t(){return new s(function(t,e){!function e(t,n,o,i){var r,t=c(a[t],a,n);if("throw"!==t.type)return(n=(r=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):s.resolve(n).then(function(t){r.value=t,o(r)},function(t){return e("throw",t,o,i)});i(t.arg)}(n,o,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(e){if(e){var n,t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:O}}function O(){return{value:void 0,done:!0}}return u(m,"constructor",{value:d.prototype=p,configurable:!0}),u(p,"constructor",{value:d,configurable:!0}),d.displayName=r(p,i,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,i,"GeneratorFunction")),t.prototype=Object.create(m),t},a.awrap=function(t){return{__await:t}},v(y.prototype),r(y.prototype,n,function(){return this}),a.AsyncIterator=y,a.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var r=new y(s(t,e,n,o),i);return a.isGeneratorFunction(e)?r:r.next().then(function(t){return t.done?t.value:r.next()})},v(m),r(m,i,"Generator"),r(m,o,function(){return this}),r(m,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,n=Object(t),o=[];for(e in n)o.push(e);return o.reverse(),function t(){for(;o.length;){var e=o.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=x,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var o=this;function t(t,e){return r.type="throw",r.arg=n,o.next=t,e&&(o.method="next",o.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],r=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}var r=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return r.type=t,r.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,o,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(o=n.arg,w(i)),o}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},a}function z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(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,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(o.key),o)}}function I(t,e,n){e&&M(t.prototype,e),n&&M(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function X(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?B(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(t,e):void 0}(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 B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function V(r,t,e){function n(){for(var t,e=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return a&&clearTimeout(a),u?(t=!a,a=setTimeout(function(){a=null},l),t&&(s=r.apply(this,o))):a=setTimeout(function(){r.apply(e,o)},l),s}var a,s,l=1<arguments.length&&void 0!==t?t:50,u=2<arguments.length&&void 0!==e&&e;return n.prototype.cancel=function(){clearTimeout(a),a=null},n}function U(o,t){var i,r=1<arguments.length&&void 0!==t?t:50;return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];i=i||setTimeout(function(){i=null,o.apply(this,e)},r)}}function W(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}function e(t,a,s,l){return new(s=s||Promise)(function(n,e){function o(t){try{r(l.next(t))}catch(t){e(t)}}function i(t){try{r(l.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(o,i)}r((l=l.apply(t,a||[])).next())})}var F,A,l,P,d,R,H,q,G,u,c,h,f,i,p,r,a,g,m,v,J,Z,$,y,b,Q,w,S,x,tt;function et(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function O(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach(function(t){var e,n=i,o=r[t];(t="symbol"==typeof(e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?e:String(e))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function nt(t){return(nt="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})(t)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function ot(t,e){t.style["".concat(G,"TransitionDuration")]=null==e?"":"".concat(e,"ms")}function k(t,e){t.style["".concat(G,"Transform")]=e?"".concat(e):""}function T(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!q&&d)&&F):window.attachEvent&&t.attachEvent("on"+e,n)}function n(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!q&&d)&&F):window.detachEvent&&t.detachEvent("on"+e,n)}function it(t){var e=t,n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0],t=n?document.elementFromPoint(n.clientX,n.clientY):t.target;return!n||"clientX"in e||(e.clientX=n.clientX,e.clientY=n.clientY,e.pageX=n.pageX,e.pageY=n.pageY,e.screenX=n.screenX,e.screenY=n.screenY),{touch:n,event:e,target:t}}function E(t,e){for(var n={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth};n.top+=t.offsetTop,n.left+=t.offsetLeft,(t=t.parentNode)&&t!==e;);return n}function rt(){return document.scrollingElement||document.documentElement}function N(t){var e,n,o,i,r,a,s,l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},u=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==rt()){if(n=(e=t.getBoundingClientRect()).top,o=e.left,i=e.bottom,r=e.right,a=e.height,s=e.width,l.parent&&t.parentNode!==t.ownerDocument.body)for(var c,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((c=h.getBoundingClientRect()).height<a)return n=c.top,o=c.left,i=c.bottom,r=c.right,a=c.height,{top:n,left:o,bottom:i,right:r,width:s=c.width,height:a};h=h.parentNode}}else o=n=0,i=window.innerHeight,r=window.innerWidth,a=window.innerHeight,s=window.innerWidth;if((l.block||l.relative)&&t!==window&&(u=u||t.parentNode,!d))do{if(u&&u.getBoundingClientRect&&("none"!==L(u,"transform")||l.relative&&"static"!==L(u,"position"))){var f=u.getBoundingClientRect();n-=f.top+parseInt(L(u,"border-top-width")),o-=f.left+parseInt(L(u,"border-left-width")),i=n+e.height,r=o+e.width;break}}while(u=u.parentNode);return{top:n,left:o,bottom:i,right:r,width:s,height:a}}}function at(t,e,n,o){if(t){n=n||document;do{if(null==e){var i=Array.prototype.slice.call(n.children),r=i.indexOf(t);if(-1<r)return i[r];for(var a=0;a<i.length;a++)if(st(t,i[a]))return i[a]}else if((">"!==e[0]||t.parentNode===n)&&ut(t,e)||o&&t===n)return t}while(t=t.parentNode)}return null}function st(t,e){if(t&&e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}}function lt(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(A," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(A," ")))}function ut(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{return t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e)}catch(t){}}function ct(t,e){return t.top!==e.top||t.left!==e.left}function L(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];o[e=e in o||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function ht(t,e){return t.sortable.el!==e.sortable.el}function ft(t,e){L(t,"display",e?"":"none")}function dt(t){this.options=t||{},this.groupName=t.group.name||"group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32)}function pt(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function gt(t){this.options=t,this.animations=[]}function mt(){this.helper=null,this.distance={x:0,y:0}}function s(){var t,e={from:O({},w),to:O({},S)};return v&&(t={from:O({},c),to:O({},h)},e.from=O(O({},t.from),e.from),e.to=O(O({},t.to),e.to)),e}function D(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[u]=this).el=t,this.ownerDocument=t.ownerDocument,this.options=e=Object.assign({},e);var n,o,i={disabled:!1,group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:55,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,stopPropagation:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in i)n in this.options||(this.options[n]=i[n]);for(o in tt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));T(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),y.push(t),this.multiplayer=new dt(this.options),this.animator=new gt(this.options)}F={capture:!1,passive:!1},A=/\s+/g,l={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},d=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),R=t(/Edge/i),H=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),P=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return P=!0}}),q=P,G="undefined"==typeof window||"undefined"==typeof document?"":(o=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(o=(Array.prototype.slice.call(o).join("").match(/-(moz|webkit|ms)-/)||""===o.OLink&&["","o"])[1])?o&&o.length?o[0].toUpperCase()+o.substr(1):"":"ms"),u="Sortable"+Date.now(),c=O({},o={sortable:null,nodes:[]}),h=O({},o),f={},dt.prototype={allowDrag:function(t){return this.options.multiple&&f[this.groupName]&&f[this.groupName].length&&-1<f[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return f[this.groupName].forEach(function(t,e){(t=t.cloneNode(!0)).style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n "),n.appendChild(t)}),n},select:function(t,e,n,o){var i;e&&(f[this.groupName]||(f[this.groupName]=[]),i=f[this.groupName].indexOf(e),lt(e,this.options.selectedClass,i<0),t=O(O({},o),{},{event:t}),i<0?(f[this.groupName].push(e),o.sortable._dispatchEvent("onSelect",t)):(f[this.groupName].splice(i,1),o.sortable._dispatchEvent("onDeselect",t)),f[this.groupName].sort(function(t,e){return t=E(t,n),e=E(e,n),t.top==e.top?t.left-e.left:t.top-e.top}))},onDrag:function(e,t){c.sortable=t,c.nodes=f[this.groupName].map(function(t){return{node:t,rect:N(t),offset:E(t,e)}}),h.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,null,e.parentNode),f[this.groupName].forEach(function(t){t!=e&&ft(t,!1)}),t.animator.animate()},onChange:function(t,e){var n=N(t),o=E(t,e.el);h.sortable=e,h.nodes=f[this.groupName].map(function(t){return{node:t,rect:n,offset:o}})},onDrop:function(t,n,e,o,i){var r=this,a=(h.sortable.animator.collect(n,null,n.parentNode),f[this.groupName].indexOf(n));f[this.groupName].forEach(function(t,e){ft(t,!0),e<a?n.parentNode.insertBefore(t,n):(e=0<e?f[r.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),c.sortable=o.sortable,h.nodes=f[this.groupName].map(function(t){return{node:t,rect:N(t),offset:E(t,e)}});var s=(o=ht(c,h))||this._offsetChanged(c.nodes,h.nodes),i=O(O({},i()),{},{changed:s,event:t});o&&c.sortable._dispatchEvent("onDrop",i),h.sortable._dispatchEvent("onDrop",i),h.sortable.animator.animate()},_offsetChanged:function(t,n){return!!t.find(function(e){return ct(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),pt.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,o){var i=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){n&&o&&i.autoScroll(t,e,o),i.update(t,e,n,o)})},autoScroll:function(t,e,n){var o,i,r,a,s,l,u,c,h,f,d,p;t&&(o=n.clientX,n=n.clientY,void 0!==o)&&void 0!==n&&(h=N(t))&&(d=t.scrollTop,i=t.scrollLeft,r=t.scrollHeight,f=t.scrollWidth,a=h.top,s=h.right,l=h.bottom,u=h.left,p=h.height,h=h.width,n<a||s<o||l<n||o<u||(c=0<d&&a<=n&&n<=a+e,h=i+h<f&&o<=s&&s-e<=o,f=d+p<r&&n<=l&&l-e<=n,(p=d=0)<i&&u<=o&&o<=u+e&&(d=Math.floor(Math.max(-1,(o-u)/e-1)*this.speed.x)),h&&(d=Math.ceil(Math.min(1,(o-s)/e+1)*this.speed.x)),c&&(p=Math.floor(Math.max(-1,(n-a)/e-1)*this.speed.y)),(p=f?Math.ceil(Math.min(1,(n-l)/e+1)*this.speed.y):p)&&(t.scrollTop+=p),d&&(t.scrollLeft+=d)))}},gt.prototype={collect:function(t,e,n,o){var i=this;n&&(n=Array.prototype.slice.call(n.children),e=(t=this._getRange(n,t,e,o)).start,t=t.end,this.animations.length=0,n.slice(e,t+1).forEach(function(t){"none"!==L(t,"display")&&t!==o&&t!==D.helper&&i.animations.push({node:t,rect:N(t)})}))},animate:function(){var n=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;n._excute(e,t)})},_excute:function(t,e){var n=e.left,e=(e=e.top)-(o=N(t)).top,n=n-o.left,o=(ot(t),k(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,this.options.animation);ot(t,o),k(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){ot(t),k(t,""),t.animated=null},o)},_getRange:function(t,e,n){var o,e=t.indexOf(e);return(n=t.indexOf(n))<e&&(e=(o=[n,e])[0],n=o[1]),e<0&&(e=n,n=t.length-1),{start:e,end:n=n<0?t.length-1:n}}},mt.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null,this.distance={x:0,y:0}},move:function(t,e){this.helper&&k(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,o){if(!this.helper){var i,r=o.fallbackOnBody,a=o.ghostClass,o=o.ghostStyle,r=r?document.body:n,s=(this.helper=e.cloneNode(!0),lt(this.helper,a,!0),O({top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none","box-sizing":"border-box"},o));for(i in s)L(this.helper,i,s[i]);e="none",(n=this.helper).style["".concat(G,"Transition")]=e?"none"===e?"none":"".concat(e):"",k(this.helper,"translate3d(0px, 0px, 0px)"),r.appendChild(this.helper),a=this.distance.x/parseInt(this.helper.style.width)*100,t=this.distance.y/parseInt(this.helper.style.height)*100,L(this.helper,"transform-origin","".concat(a,"% ").concat(t,"%")),L(this.helper,"transform","translateZ(0)"),L(this.helper,"will-change","transform")}}},$={sortable:null,group:null,node:null,rect:{},offset:{}},y=[],b=new mt,Q=new pt,w=O({},$),S=O({},$),x={x:0,y:0},tt=function(t){var e={},n=t.group;n&&"object"==nt(n)||(n={name:n,pull:!0,put:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,t.group=e},(D.prototype={constructor:D,destroy:function(){this._dispatchEvent("destroy",this),this.el[u]=null;for(var t=0;t<l.start.length;t++)n(this.el,l.start[t],this._onDrag);this._clearState(),y.splice(y.indexOf(this.el),1),this.el=null},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&tt(n)},_onDrag:function(t){if(!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var e=it(t),n=e.touch,o=e.event;if(!((e=e.target)===this.el||H&&e&&"SELECT"===e.tagName.toUpperCase())){var i=this.options,r=i.draggable;if(("function"!=typeof(i=i.handle)||i(t))&&("string"!=typeof i||ut(e,i))){if("function"==typeof r){if(!(i=r(t)))return;!function(t){if(t){var e=document.createElement("div");try{return e.appendChild(t.cloneNode(!0)),1==t.nodeType}catch(e){return t==window||t==document}}}(i)||(p=i)}else p=at(e,r,this.el,!1);p&&!p.animated&&(a=p.cloneNode(!0),this._prepareStart(n,o))}}}},_prepareStart:function(t,e){var n=this,o=p.parentNode,i=((g=e).sortable=this,g.group=p.parentNode,(v=this.options.multiple&&this.multiplayer.allowDrag(p))&&this.multiplayer.onDrag(this.el,this),N(p)),r=E(p,this.el);w={sortable:this,group:o,node:p,rect:i,offset:r},S.group=o,S.sortable=this,b.distance={x:e.clientX-i.left,y:e.clientY-i.top},T(document,"touchend",this._onDrop),T(document,"touchcancel",this._onDrop),T(document,"mouseup",this._onDrop);o=(r=this.options).delay,e=r.delayOnTouchOnly;if(!o||e&&!t||R||d)this._onStart(t);else{for(var a=0;a<l.end.length;a++)T(this.ownerDocument,l.end[a],this._cancelStart);for(var s=0;s<l.move.length;s++)T(this.ownerDocument,l.move[s],this._delayMoveHandler);Z=setTimeout(function(){return n._onStart(t)},o)}},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-g.clientX),Math.abs(t.clientY-g.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z);for(var t=0;t<l.end.length;t++)n(this.ownerDocument,l.end[t],this._cancelStart);for(var e=0;e<l.move.length;e++)n(this.ownerDocument,l.move[e],this._delayMoveHandler)},_onStart:function(t){i=this.el,T(document,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;m||(this._dispatchEvent("onDrag",O(O({},s()),{},{event:g})),v&&this.multiplayer.onTrulyStarted(p,this),t=v?this.multiplayer.getHelper():p,b.init(w.rect,t,this.el,this.options),D.helper=b.node,ft(p,!1),p.parentNode.insertBefore(a,p),lt(a,this.options.chosenClass,!0),H&&L(document.body,"user-select","none"))},_nearestSortable:function(t){var e,n,o,i,r,a,s;this._preventEvent(t),!g||!p||(e=(n=t).clientX,n=n.clientY,o=e-x.x,i=n-x.y,x.x=e,x.y=n,void 0!==e&&void 0!==n&&Math.abs(o)<=0&&Math.abs(i)<=0)||(n=(e=it(t)).event,o=e.target,r=n.clientX,a=n.clientY,y.some(function(t){var e,n,o=t[u].options.emptyInsertThreshold;if(o)return n=N(t,{parent:!0}),e=r>=n.left-o&&r<=n.right+o,n=a>=n.top-o&&a<=n.bottom+o,e&&n?s=t:void 0}),i=s,this._onTrulyStarted(),m=n,b.move(n.clientX-g.clientX,n.clientY-g.clientY),this._autoScroll(o),i&&i[u]._onMove(n,o))},_allowPut:function(){var t,e;return g.sortable.el===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=g.sortable.options.group).name)&&t&&e.name===t},_onMove:function(t,e){if(this._allowPut()){if(this._dispatchEvent("onMove",O(O({},s()),{},{event:t})),i=this.el,r=at(e,this.options.draggable,i,!1)){if(r===J)return;if((J=r)===a)return;if(r.animated||st(r,a))return}i!==w.sortable.el?e!==i&&function(t,e){for(var n=t.lastElementChild;n&&(n===e||"none"===L(n,"display"));)n=n.previousElementSibling;return n}(i,b.node)?r&&this._onInsert(t,!1):this._onInsert(t,!0):r&&this._onChange(t)}},_autoScroll:function(n){var n=function(){if(n&&n.getBoundingClientRect){var t=n;do{if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var e=L(t);if(t.clientWidth<t.scrollWidth&&("auto"==e.overflowX||"scroll"==e.overflowX)||t.clientHeight<t.scrollHeight&&("auto"==e.overflowY||"scroll"==e.overflowY))return t.getBoundingClientRect&&t!==document.body?t:rt()}}while(t=t.parentNode)}return rt()}(),t=(e=this.options).autoScroll,e=e.scrollThreshold;t&&Q.update(n,e,g,m)},_onInsert:function(t,e){var n=e?a:r,o=e?i:r.parentNode;w.sortable.animator.collect(a,null,a.parentNode,a),this.animator.collect(null,n,o,a),v&&this.multiplayer.onChange(a,this),S={sortable:this,group:o,node:n,rect:N(n),offset:E(n,i)},w.sortable._dispatchEvent("onRemove",O(O({},s()),{},{event:t})),e?o.appendChild(a):o.insertBefore(a,r),this._dispatchEvent("onAdd",O(O({},s()),{},{event:t})),w.sortable.animator.animate(),this.animator.animate(),w.group=o,w.sortable=this},_onChange:function(t){var e=r.parentNode;this.animator.collect(a,r,e),v&&this.multiplayer.onChange(a,this),S={sortable:this,group:e,node:r,rect:N(r),offset:E(r,i)},this._dispatchEvent("onChange",O(O({},s()),{},{event:t}));t=(t=E(a,i)).top===S.offset.top?t.left<S.offset.left?r.nextSibling:r:t.top<S.offset.top?r.nextSibling:r;e.insertBefore(a,t),this.animator.animate(),w.group=e,w.sortable=this},_onDrop:function(t){this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),this._cancelStart(),Q.clear(),p&&g&&m?this._onEnd(t):this.options.multiple&&this.multiplayer.select(t,p,i,O({},w)),this._clearState()},_onEnd:function(t){var e,n;this.options.swapOnDrop&&a.parentNode.insertBefore(p,a),w.group=g.group,w.sortable=g.sortable,S.rect=N(a),S.offset=E(a,i),v?this.multiplayer.onDrop(t,p,i,g,s):(S.node===a&&(S.node=p),n=(e=ht(w,S))||ct(w.offset,S.offset),n=O(O({},s()),{},{changed:n,event:t}),e&&w.sortable._dispatchEvent("onDrop",n),S.sortable._dispatchEvent("onDrop",n)),ft(p,!0),a.parentNode.removeChild(a),H&&L(document.body,"user-select","")},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&(t&&t.stopPropagation?t.stopPropagation():window.event.cancelBubble=!0)},_dispatchEvent:function(t,e){"function"==typeof(t=this.options[t])&&t(e)},_clearState:function(){p=r=a=g=m=v=J=Z=D.helper=null,x={x:0,y:0},w=S=O({},$),b.destroy()},_unbindMoveEvents:function(){for(var t=0;t<l.move.length;t++)n(document,l.move[t],this._nearestSortable)},_unbindDropEvents:function(){for(var t=0;t<l.end.length;t++)n(document,l.end[t],this._onDrop)}}).utils={on:T,off:n,css:L,closest:at,getRect:N,getOffset:E},D.get=function(t){return t[u]},D.create=function(t,e){return new D(t,e)};function vt(n,o,i){function t(){var t=n.event,e=n.dataKey;i(t,o.value?o.value[r.value]:0,e)}var e=null,r=Y.computed(function(){return n.isHorizontal?"offsetWidth":"offsetHeight"});Y.onMounted(function(){"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(function(){t()}),o.value)&&e.observe(o.value)}),Y.onUpdated(function(){t()}),Y.onUnmounted(function(){e&&(e.disconnect(),e=null)})}var yt=D,C="virtualSortableState",j={from:{},to:{}},K=new(function(){function t(){z(this,t)}return I(t,[{key:"clear",value:function(){window[C]=null}},{key:"getStore",value:function(){try{return JSON.parse(window[C])||j}catch(t){return j}}},{key:"getValue",value:function(){return new Promise(function(t,e){try{t(JSON.parse(window[C])||j)}catch(t){e(j)}})}},{key:"setValue",value:function(i){return new Promise(function(t,e){try{var n=JSON.parse(window[C]||"{}"),o=Object.assign(Object.assign({},n),i);window[C]=JSON.stringify(o),t(o)}catch(t){e(j)}})}}]),t}()),bt=["group","handle","disabled","draggable","ghostClass","ghostStyle","chosenClass","animation","autoScroll","scrollThreshold","fallbackOnBody","pressDelay","pressDelayOnTouchOnly"],wt=null,St=function(){function n(t,e){z(this,n),this.ctx=t,this.callback=e,this.initialList=X(t.list),this.dynamicList=X(t.list),this.sortable=null,this.rangeChanged=!1,this._init()}return I(n,[{key:"destroy",value:function(){this.sortable&&this.sortable.destroy(),this.sortable=null}},{key:"setValue",value:function(t,e){"list"===t?(this.initialList=X(e),wt&&this._onDrag(wt,!1)):(this.ctx[t]=e,this.sortable&&this.sortable.option(t,e))}},{key:"_init",value:function(){var o=this,t=bt.reduce(function(t,e){return t["pressDelayOnTouchOnly"===e?"delayOnTouchOnly":"pressDelay"===e?"delay":e]=o.ctx[e],t},{});this.sortable=new yt(this.ctx.container,Object.assign(Object.assign({},t),{swapOnDrop:!1,list:this.dynamicList,onDrag:function(t){t=t.from;return o._onDrag(t.node)},onAdd:function(t){var e=t.from,t=t.to;return o._onAdd(e,t)},onRemove:function(t){var e=t.from,t=t.to;return o._onRemove(e,t)},onChange:function(t){var e=t.from,t=t.to;return o._onChange(e,t)},onDrop:function(t){var e=t.from,n=t.to,t=t.changed;return o._onDrop(e,n,t)}}))}},{key:"_onDrag",value:function(o){var i=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return e(this,void 0,void 0,_().mark(function t(){var e,n;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return wt=o,this.dynamicList=X(this.initialList),e=X(this.initialList),n=this._getFromTo({node:o},e),t.next=6,K.setValue({from:Object.assign({list:e},n)});case 6:if(i)return this.rangeChanged=!1,t.next=10,K.getValue();t.next=14;break;case 10:n=t.sent,this.ctx.emit("drag",Object.assign({list:e},n)),t.next=15;break;case 14:this.rangeChanged=!0;case 15:case"end":return t.stop()}},t,this)}))}},{key:"_onAdd",value:function(i,r){var a;return e(this,void 0,void 0,_().mark(function t(){var e,n,o;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,K.getValue();case 2:e=t.sent,n=X(this.dynamicList),n=this._getIndex(n,r.node.dataset.key),o=Object.assign(Object.assign({},e.from),{index:n}),i.node===r.node?(o.index=this.dynamicList.length,this.dynamicList.push(null==(a=e.from)?void 0:a.item)):this.dynamicList.splice(n,0,null==(a=e.from)?void 0:a.item),delete o.list,this.ctx.emit("add",Object.assign({},o));case 9:case"end":return t.stop()}},t,this)}))}},{key:"_onRemove",value:function(n){return e(this,void 0,void 0,_().mark(function t(){var e;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=X(this.dynamicList),e=this._getFromTo(n,e),this.dynamicList.splice(e.index,1),this.ctx.emit("remove",Object.assign({},e));case 4:case"end":return t.stop()}},t,this)}))}},{key:"_onChange",value:function(o,i){return e(this,void 0,void 0,_().mark(function t(){var e,n;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=X(this.dynamicList),n=X(this.dynamicList),e=this._getFromTo(o,e),n=this._getFromTo(i,n),this.dynamicList.splice(e.index,1),this.dynamicList.splice(n.index,0,e.item);case 6:case"end":return t.stop()}},t,this)}))}},{key:"_onDrop",value:function(r,t,a){return e(this,void 0,void 0,_().mark(function t(){var e,n,o,i;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=X(this.dynamicList),o=this._getIndex(e,r.node.dataset.key),i=this.initialList[o],n=W(i,this.ctx.dataKey),t.next=6,K.setValue({to:{list:X(this.initialList),index:o,item:i,key:n}});case 6:return t.next=8,K.getValue();case 8:o=t.sent,i=Object.assign(Object.assign({list:e},o),{changed:a}),this.ctx.emit("drop",i),this.callback&&this.callback(i),this.initialList=X(e),this._clear();case 14:case"end":return t.stop()}},t,this)}))}},{key:"_getFromTo",value:function(t,e){var t=t.node.dataset.key,n=this._getIndex(e,t);return{key:t,item:e[n],index:n}}},{key:"_getIndex",value:function(t,e){for(var n=0;n<t.length;n++)if(W(t[n],this.ctx.dataKey)==e)return n;return-1}},{key:"_clear",value:function(){wt=null,K.clear(),this.rangeChanged=!1}}]),n}(),xt="INIT",Ot="FIXED",_t="DYNAMIC",kt="FRONT",Tt="BEHIND",Et=function(){function n(t,e){z(this,n),this.options=Object.assign({},t),this.callback=e,this.sizes=new Map,this.calcType=xt,this.calcSize=Object.create(null),this.direction="",this.offset=0,this.range=Object.create(null),t&&this.checkIfUpdate(0,t.keeps-1)}return I(n,[{key:"isFront",value:function(){return this.direction===kt}},{key:"isBehind",value:function(){return this.direction===Tt}},{key:"isFixed",value:function(){return this.calcType===Ot}},{key:"updateOptions",value:function(t,n){var o=this;this.options&&t in this.options&&("uniqueKeys"===t&&this.sizes.forEach(function(t,e){n.includes(e)||o.sizes.delete(e)}),this.options[t]=n)}},{key:"updateRange",value:function(){var t=this.range.start;this.isFront()?t-=2:this.isBehind()&&(t+=2),t=Math.max(t,0),this.handleUpdate(t,this.getEndByStart(t))}},{key:"handleItemSizeChange",value:function(t,e){this.sizes.set(t,e),this.calcType===xt?(this.calcType=Ot,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=_t,this.calcSize.fixed=0),this.calcType!==Ot&&(this.calcSize.total=X(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))}},{key:"handleSlotSizeChange",value:function(t,e){this.calcSize[t]=e}},{key:"handleScroll",value:function(t){this.direction=t<this.offset?kt:Tt,this.offset=t,this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();t>this.range.start||(t=Math.max(t-this.options.buffer,0),this.checkIfUpdate(t,this.getEndByStart(t)))}},{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.calcSize.header||0);if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.calcSize.fixed);for(var e,n,o=0,i=this.options.uniqueKeys.length;o<=i;){if(e=o+Math.floor((i-o)/2),(n=this.getOffsetByIndex(e))===t)return e;n<t?o=e+1:t<n&&(i=e-1)}return 0<o?--o:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?(t=0,e=this.getLastIndex()):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)}},{key:"handleUpdate",value:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.callback(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.calcSize.fixed:(e-t)*this.getItemSize()}},{key:"getOffsetByIndex",value:function(t){if(!t)return 0;for(var e=this.calcSize.header||0,n=0;n<t;n++){var o=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof o?o:this.getItemSize()}return e}},{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,t=t.keeps;return 0<e.length?e.length-1:t-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size}}]),n}(),o={dataSource:{},dataKey:{type:String,default:"",required:!0},draggable:{type:[Function,String]},handle:{type:[Function,String]},group:{type:[Object,String]},pageMode:{type:Boolean,default:!1},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},delay:{type:Number,default:0},animation:{type:Number,default:150},autoScroll:{type:Boolean,default:!0},scrollThreshold:{type:Number,default:55},keepOffset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fallbackOnBody:{type:Boolean,default:!1},pressDelay:{type:Number,default:0},pressDelayOnTouchOnly:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},headerTag:{type:String,default:"div"},footerTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object,default:function(){return{}}},itemStyle:{type:Object,default:function(){return{}}},itemClass:{type:String,default:""},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},Nt={tag:{type:String,default:"div"},event:{type:String},dataKey:{type:[String,Number]},isHorizontal:{type:Boolean}},Lt=Y.defineComponent({name:"VirtualDraglistItems",props:Nt,emits:["resize"],setup:function(n,t){var e=t.emit,o=t.slots,i=Y.ref(null);return vt(n,i,e),function(){var t=n.tag,e=n.dataKey;return Y.h(t,{ref:i,key:e,"data-key":e},{default:function(){var t;return null==(t=o.default)?void 0:t.call(o)}})}}}),Dt=Y.defineComponent({name:"VirtualDraglistSlots",props:Nt,emits:["resize"],setup:function(n,t){var e=t.emit,o=t.slots,i=Y.ref(null);return vt(n,i,e),function(){var t=n.tag,e=n.dataKey;return Y.h(t,{ref:i,key:e,"data-key":e},{default:function(){var t;return null==(t=o.default)?void 0:t.call(o)}})}}});return Y.defineComponent({props:o,emits:["update:dataSource","top","bottom","drag","drop","add","remove"],setup:function(u,t){var a,o,n=t.emit,s=t.slots,t=t.expose,c=Y.ref(Object.create(null)),h=Y.ref(null),f=Y.ref(null),d=Y.ref(null),l=Y.ref([]),e=Y.ref([]),p="vertical"!==u.direction,i=p?"scrollWidth":"scrollHeight",r=p?"scrollLeft":"scrollTop",g=p?"offsetLeft":"offsetTop",m=p?"clientWidth":"clientHeight",v=null,y=null;function b(){var t;return u.pageMode?document.documentElement[r]||document.body[r]:(t=h.value)?Math.ceil(t[r]):0}function w(){var t;return u.pageMode?document.documentElement[m]||document.body[m]:(t=h.value)?Math.ceil(t[m]):0}function S(){var t;return u.pageMode?document.documentElement[i]||document.body[i]:(t=h.value)?Math.ceil(t[i]):0}function x(t){u.pageMode?(document.body[r]=t,document.documentElement[r]=t):h.value&&(h.value[r]=t)}function O(t){t>=l.value.length-1?k():x(o.getOffsetByIndex(t))}function _(){x(0)}function k(){d.value&&(x(d.value[g]),setTimeout(function(){I()||k()},5))}t({reset:function(){_(),j(u.dataSource)},getSize:function(t){return o.sizes.get(t)},getOffset:b,getClientSize:w,getScrollSize:S,scrollToTop:_,scrollToBottom:k,scrollToIndex:O,scrollToOffset:x}),Y.watch(function(){return u.dataSource},function(t){j(t)},{deep:!0}),Y.watch(function(){return u.disabled},function(t){a&&a.setValue("disabled",t)}),Y.onBeforeMount(function(){F(),j(u.dataSource)}),Y.onActivated(function(){o&&x(o.offset),u.pageMode&&D()}),Y.onDeactivated(function(){u.pageMode&&C()}),Y.onMounted(function(){u.pageMode&&(B(),D())}),Y.onUnmounted(function(){a&&a.destroy()});function T(t,e){o.handleItemSizeChange(e,t)}function E(t,e){o.handleSlotSizeChange(e,t)}function N(t,e){var n=s[t];return n?Y.h(Dt,{key:t,tag:e,dataKey:t,event:"resize",onResize:E},{default:function(){return null==n?void 0:n()}}):null}function L(){for(var r=[],t=c.value,e=t.start,n=t.end,o=function(e){var n,t,o,i=l.value[e];i&&(n=W(i,u.dataKey),t=Object.assign(Object.assign({},u.itemStyle),(t=n,a&&(o=K.getStore().from.key,a.rangeChanged)&&t==o?{display:"none"}:{})),r.push(s.item?Y.h(Lt,{key:n,tag:u.itemTag,class:u.itemClass,style:t,event:"resize",dataKey:n,isHorizontal:p,onResize:T},{default:function(){var t;return null==(t=s.item)?void 0:t.call(s,{record:i,index:e,dataKey:n})}}):null))},i=e;i<=n;i++)o(i);return r}var D=function(){document.addEventListener("scroll",M,{passive:!1})},C=function(){document.removeEventListener("scroll",M)},B=function(){var t,e=h.value;e&&(t=e.getBoundingClientRect(),e=e.ownerDocument.defaultView,t=p?t.left+e.pageXOffset:t.top+e.pageYOffset,o.handleSlotSizeChange("header",t))},j=function(t){t=t;t=Y.isRef(t)?t.value:t;t&&(l.value=X(t),z(),o.sizes.size?o.updateRange():(clearTimeout(y),y=setTimeout(function(){return o.updateRange()},17)),a?a.setValue("list",X(t)):Y.nextTick(function(){return A()}),v)&&u.keepOffset&&(O(Math.abs(t.length-v)),v=null)},z=function(){e.value=l.value.map(function(t){return W(t,u.dataKey)}),o.updateOptions("uniqueKeys",e.value)},F=function(){o=new Et({size:u.size,keeps:u.keeps,uniqueKeys:e.value,buffer:Math.round(u.keeps/3)},function(t){var e,n;c.value=t,a&&(t=K.getStore(),e=(n=c.value).start,n=n.end,-1<(t=t.from.index))&&!(e<=t&&t<=n)&&(a.rangeChanged=!0)})},A=function(){a=new St(Object.assign({container:f.value,list:l.value,emit:n},u),function(t){var e=t.list;t.changed&&(e.length!==l.value.length&&P(e),l.value=X(e),z(),n("update:dataSource",X(e)))})},P=function(t){var e,n=Object.assign({},c.value);0<n.start&&-1<(e=t.indexOf(l.value[n.start]))&&(n.start=e,n.end=e+u.keeps-1),t.length>l.value.length&&n.end===l.value.length-1&&I()&&(n.end++,n.start=Math.max(0,n.end-u.keeps+1)),o.handleUpdate(n.start,n.end)},M=V(function(){var t=b(),e=w(),n=S();t<0||n+1<t+e||!n||(o.handleScroll(t),o.isFront()&&l.value.length&&t<=0?R():o.isBehind()&&n<=e+t&&H())},u.delay),I=function(){var t=b(),e=w();return S()<=t+e+1},R=U(function(){n("top"),v=l.value.length}),H=U(function(){n("bottom")});return function(){var t=u.rootTag,e=u.wrapTag,n=u.wrapClass,o=u.headerTag,i=u.footerTag,r=u.pageMode,a=c.value,s=a.front,a=a.behind,l=Object.assign(Object.assign({},u.wrapStyle),{padding:p?"0px ".concat(a,"px 0px ").concat(s,"px"):"".concat(s,"px 0px ").concat(a,"px")});return Y.h(t,{ref:h,style:!r&&{overflow:p?"auto hidden":"hidden auto"},onScroll:!r&&M},{default:function(){return[N("header",o),Y.h(e,{ref:f,class:n,style:l},{default:L}),N("footer",i),Y.h("div",{ref:d,style:{width:p?"0px":"100%",height:p?"100%":"0px"}})]}})}}})});
{
"name": "vue-virtual-draglist",
"version": "3.1.3",
"version": "3.1.4",
"description": "A virtual scrolling list component that can be sorted by dragging, support vue3",

@@ -43,3 +43,3 @@ "main": "dist/virtual-drag-list.min.js",

"dependencies": {
"sortable-dnd": "0.5.2"
"sortable-dnd": "0.5.4"
},

@@ -46,0 +46,0 @@ "devDependencies": {

@@ -50,3 +50,3 @@ # vue-virtual-draglist

set(val) {
// trigger when drag state changed if you use then `v-model:dataSource`
// trigger when drag state changed if you use with `v-model:dataSource`
console.log(val);

@@ -76,3 +76,3 @@ }

| `data-key` | String | The unique identifier of each piece of data, in the form of `'a.b.c'` |
| `data-source` | Array/Ref | The list you want to render |
| `data-source` | Array/Ref | The data that needs to be rendered |

@@ -79,0 +79,0 @@ ### Optional props

@@ -19,2 +19,6 @@ import * as vue from 'vue';

};
pageMode: {
type: BooleanConstructor;
default: boolean;
};
direction: {

@@ -133,2 +137,6 @@ type: vue.PropType<"vertical" | "horizontal">;

};
pageMode: {
type: BooleanConstructor;
default: boolean;
};
direction: {

@@ -239,2 +247,3 @@ type: vue.PropType<"vertical" | "horizontal">;

dataKey: string;
pageMode: boolean;
direction: "vertical" | "horizontal";

@@ -241,0 +250,0 @@ keeps: number;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc