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

smooth-dnd

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smooth-dnd - npm Package Compare versions

Comparing version 0.6.3 to 0.7.0

dist/index.d.ts

2

dist/index.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SmoothDnD=t():e.SmoothDnD=t()}(this,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(o=window)}e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.containerInstance="smooth-dnd-container-instance",t.containersInDraggable="smooth-dnd-containers-in-draggable",t.defaultGroupName="@@smooth-dnd-default-group@@",t.wrapperClass="smooth-dnd-draggable-wrapper",t.defaultGrabHandleClass="smooth-dnd-default-grap-handle",t.animationClass="animated",t.translationValue="__smooth_dnd_draggable_translation_value",t.visibilityValue="__smooth_dnd_draggable_visibility_value",t.ghostClass="smooth-dnd-ghost",t.containerClass="smooth-dnd-container",t.extraSizeForInsertion="smooth-dnd-extra-size-for-insertion",t.stretcherElementClass="smooth-dnd-stretcher-element",t.stretcherElementInstance="smooth-dnd-stretcher-instance",t.isDraggableDetached="smoth-dnd-is-draggable-detached",t.disbaleTouchActions="smooth-dnd-disable-touch-action",t.noUserSelectClass="smooth-dnd-no-user-select"},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});t.getIntersection=function(e,t){return{left:Math.max(e.left,t.left),top:Math.max(e.top,t.top),right:Math.min(e.right,t.right),bottom:Math.min(e.bottom,t.bottom)}};var n=t.getIntersectionOnAxis=function(e,t,n){return"x"===n?{left:Math.max(e.left,t.left),top:e.top,right:Math.min(e.right,t.right),bottom:e.bottom}:{left:e.left,top:Math.max(e.top,t.top),right:e.right,bottom:Math.min(e.bottom,t.bottom)}},o=t.getContainerRect=function(e){var t=e.getBoundingClientRect(),n={left:t.left,right:t.right+10,top:t.top,bottom:t.bottom};if(a(e,"x")&&!i(e,"x")){var o=n.right-n.left;n.right=n.right+e.scrollWidth-o}if(a(e,"y")&&!i(e,"y")){var r=n.bottom-n.top;n.bottom=n.bottom+e.scrollHeight-r}return n},r=(t.getScrollingAxis=function(t){var n=e.getComputedStyle(t),o=n.overflow;if("auto"===o||"scroll"===o)return"xy";var r=n["overflow-x"],i="auto"===r||"scroll"===r,a=n["overflow-y"];return(i?"x":"")+("auto"===a||"scroll"===a?"y":"")||null},t.isScrolling=function(t,n){var o=e.getComputedStyle(t),r=o.overflow,i=o["overflow-"+n];return"auto"===r||"scroll"===r||("auto"===i||"scroll"===i)}),i=t.isScrollingOrHidden=function(t,n){var o=e.getComputedStyle(t),r=o.overflow,i=o["overflow-"+n];return"auto"===r||"scroll"===r||"hidden"===r||("auto"===i||"scroll"===i||"hidden"===i)},a=t.hasBiggerChild=function(e,t){return"x"===t?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight};t.hasScrollBar=function(e,t){return a(e,t)&&r(e,t)},t.getVisibleRect=function(e,t){var r=e,l=t||o(e);for(r=e.parentElement;r;)a(r,"x")&&i(r,"x")&&(l=n(l,r.getBoundingClientRect(),"x")),a(r,"y")&&i(r,"y")&&(l=n(l,r.getBoundingClientRect(),"y")),r=r.parentElement;return l},t.listenScrollParent=function(t,n){var o=[];return setTimeout(function(){for(var i=t;i;)(r(i,"x")||r(i,"y"))&&(i.addEventListener("scroll",n),o.push(i)),i=i.parentElement;e.addEventListener("scroll",n)},10),{dispose:function(){o.forEach(function(e){e.removeEventListener("scroll",n)}),e.removeEventListener("scroll",n)}}},t.hasParent=function(e,t){for(var n=e;n;){if(n===t)return!0;n=n.parentElement}return!1},t.getParent=function(e,t){for(var n=e;n;){if(n.matches(t))return n;n=n.parentElement}return null},t.hasClass=function(e,t){return e.className.split(" ").map(function(e){return e}).indexOf(t)>-1},t.addClass=function(e,t){if(e){var n=e.className.split(" ").filter(function(e){return e});-1===n.indexOf(t)&&(n.unshift(t),e.className=n.join(" "))}},t.removeClass=function(e,t){if(e){var n=e.className.split(" ").filter(function(e){return e&&e!==t});e.className=n.join(" ")}},t.debounce=function(e,t,n){var o=null;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];o&&clearTimeout(o),n&&!o?e.call.apply(e,[void 0].concat(i)):o=setTimeout(function(){o=null,e.call.apply(e,[void 0].concat(i))},t)}},t.removeChildAt=function(e,t){return e.removeChild(e.children[t])},t.addChildAt=function(e,t,n){n>=e.children.lenght?e.appendChild(t):e.insertBefore(t,e.children[n])},t.isMobile=function(){return"undefined"!=typeof window&&!!(e.navigator.userAgent.match(/Android/i)||e.navigator.userAgent.match(/webOS/i)||e.navigator.userAgent.match(/iPhone/i)||e.navigator.userAgent.match(/iPad/i)||e.navigator.userAgent.match(/iPod/i)||e.navigator.userAgent.match(/BlackBerry/i)||e.navigator.userAgent.match(/Windows Phone/i))},t.clearSelection=function(){e.getSelection?e.getSelection().empty?e.getSelection().empty():e.getSelection().removeAllRanges&&e.getSelection().removeAllRanges():e.document.selection&&e.document.selection.empty()},t.getElementCursor=function(t){if(t){var n=e.getComputedStyle(t);if(n)return n.cursor}return null}}).call(this,n(0))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.domDropHandler=function(t){var n=t.element,i=t.draggables;t.layout,t.options;return function(t,a){var l=t.removedIndex,s=t.addedIndex,u=t.droppedElement,c=null;if(null!==l&&(c=(0,o.removeChildAt)(n,l),i.splice(l,1)),null!==s){var d=e.document.createElement("div");d.className=""+r.wrapperClass,d.appendChild(c.firstElementChild||u),d[r.containersInDraggable]=[],(0,o.addChildAt)(n,d,s),s>=i.length?i.push(d):i.splice(s,0,d)}a&&a(t)}},t.reactDropHandler=function(){return{handler:function(e){e.element,e.draggables,e.layout,e.options;return function(e,t){t&&t(e)}}}};var o=n(2),r=n(1)}).call(this,n(0))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t,n,l){t[r.extraSizeForInsertion]=0;var s=l,u=function(e){return{get:function(t,n){var o=e[n];return t[o||n]},set:function(t,n,o){requestAnimationFrame(function(){t[e[n]]=e.setters[n]?e.setters[n](o):o})}}}("horizontal"===n?i:a),c={translation:0},d=null;e.addEventListener("resize",function(){m(t)}),setTimeout(function(){g()},10);var f=o.listenScrollParent(t,function(){m(t),d&&d()});function g(){m(t),function(e){var t=e.getBoundingClientRect();c.scaleX=e.offsetWidth?(t.right-t.left)/e.offsetWidth:1,c.scaleY=e.offsetHeight?(t.bottom-t.top)/e.offsetHeight:1}(t)}var p=void 0;function m(e){c.rect=o.getContainerRect(e),c.visibleRect=o.getVisibleRect(e,c.rect)}function v(e){return u.get(e,"size")*u.get(c,"scale")}function h(e){return u.get(e,"dragPosition")}function y(e,t){var o=c.visibleRect,r=o.left,i=o.top,a=o.right,l=o.bottom;l-i<2&&(l=i+30);var s=c.rect;return"vertical"===n?e>s.left&&e<s.right&&t>i&&t<l:e>r&&e<a&&t>s.top&&t<s.bottom}return{getSize:v,getContainerRectangles:function(){return{rect:c.rect,visibleRect:c.visibleRect}},getBeginEndOfDOMRect:function(e){return{begin:u.get(e,"begin"),end:u.get(e,"end")}},getBeginEndOfContainer:function(){var e=u.get(c.rect,"begin")+c.translation,t=u.get(c.rect,"end")+c.translation;return{begin:e,end:t}},getBeginEndOfContainerVisibleRect:function(){var e=u.get(c.visibleRect,"begin")+c.translation,t=u.get(c.visibleRect,"end")+c.translation;return{begin:e,end:t}},getBeginEnd:function(e){var n=function(e){return(u.get(e,"distanceToParent")+(e[r.translationValue]||0))*u.get(c,"scale")}(e)+(u.get(c.rect,"begin")+c.translation)-u.get(t,"scrollValue");return{begin:n,end:n+v(e)*u.get(c,"scale")}},getAxisValue:h,setTranslation:function(e,t){t?u.set(e.style,"translate",t):e.style.removeProperty("transform");e[r.translationValue]=t,e[r.containersInDraggable]&&setTimeout(function(){e[r.containersInDraggable].forEach(function(e){!function e(t){t.layout.invalidateRects();t.onTranslated();t.getChildContainers()&&t.getChildContainers().forEach(function(t){return e(t)})}(e)})},s+20)},getTranslation:function(e){return e[r.translationValue]},setVisibility:function(e,t){void 0!==e[r.visibilityValue]&&e[r.visibilityValue]===t||(t?e.style.removeProperty("visibility"):e.style.visibility="hidden",e[r.visibilityValue]=t)},isVisible:function(e){return void 0===e[r.visibilityValue]||e[r.visibilityValue]},isInVisibleRect:y,dispose:function(){f&&f.dispose();p&&(p.parentNode.removeChild(p),p=null)},getContainerScale:function(){return{scaleX:c.scaleX,scaleY:c.scaleY}},setScrollListener:function(e){d=e},setSize:function(e,t){u.set(e,"setSize",t)},getTopLeftOfElementBegin:function(e){var t=0,o=0;"horizontal"===n?(o=e,t=c.rect.top):(o=c.rect.left,t=e);return{top:t,left:o}},getScrollSize:function(e){return u.get(e,"scrollSize")},getScrollValue:function(e){return u.get(e,"scrollValue")},setScrollValue:function(e,t){return u.set(e,"scrollValue",t)},invalidate:g,invalidateRects:function(){m(t)},getPosition:function(e){return y(e.x,e.y)?h(e):null}}};var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2)),r=n(1);var i={size:"offsetWidth",distanceToParent:"offsetLeft",translate:"transform",begin:"left",end:"right",dragPosition:"x",scrollSize:"scrollWidth",offsetSize:"offsetWidth",scrollValue:"scrollLeft",scale:"scaleX",setSize:"width",setters:{translate:function(e){return"translate3d("+e+"px, 0, 0)"}}},a={size:"offsetHeight",distanceToParent:"offsetTop",translate:"transform",begin:"top",end:"bottom",dragPosition:"y",scrollSize:"scrollHeight",offsetSize:"offsetHeight",scrollValue:"scrollTop",scale:"scaleY",setSize:"height",setters:{translate:function(e){return"translate3d(0,"+e+"px, 0)"}}}}).call(this,n(0))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var o=n(2);function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",n=!1,o=null,r=null,i=null,a=null;return{animate:function(l,s){i=l,a=s,(n=!0)&&function n(){null===o&&(o=requestAnimationFrame(function(l){null===r&&(r=l);var s=l-r;r=l;var u=s/1e3*a;(function(e,t,n){e&&(e!==window?"x"===t?e.scrollLeft+=n:e.scrollTop+=n:"x"===t?e.scrollBy(n,0):e.scrollBy(0,n))})(e,t,u="begin"===i?0-u:u),o=null,n()}))}()},stop:function(){n&&(cancelAnimationFrame(o),n=!1,r=null,o=null)}}};function a(e){var t={element:e,rect:(0,o.getVisibleRect)(e,e.getBoundingClientRect()),descendants:[],invalidate:n,axis:null,dispose:function(){e.removeEventListener("scroll",n)}};function n(){t.rect=(0,o.getVisibleRect)(e,e.getBoundingClientRect()),t.descendants.forEach(function(e){return e.invalidate()})}return e.addEventListener("scroll",n),t}function l(e){return Object.assign(e,i(e.element,e.axis))}t.default=function(t){var n,s,u,c=(n=t.map(function(e){return e.element}),s=[],u=null,n.forEach(function(e){var t=e;for(u=null;t;){var n=(0,o.getScrollingAxis)(t);if(n&&!s.some(function(e){return e.element===t})){var r=a(t);u&&r.descendants.push(u),u=r,"xy"===n?(s.push(Object.assign({},r,{axis:"x"})),s.push(Object.assign({},r,{axis:"y"},{descendants:[]}))):s.push(Object.assign({},r,{axis:n}))}t=t.parentElement}}),s),d=[].concat(r(c.map(l)),r(function(){function t(){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}return[Object.assign({rect:t(),axis:"y"},i(e)),Object.assign({rect:t(),axis:"x"},i(e,"x"))]}()));return function(e){var t=e.draggableInfo,n=e.reset;if(d.length){if(n)return d.forEach(function(e){return e.stop()}),c.forEach(function(e){return e.dispose()}),null;d.forEach(function(e){var n=function(e,t){var n=t.rect,o=n.left,r=n.right,i=n.top,a=n.bottom,l=e.x,s=e.y;if(l<o||l>r||s<i||s>a)return null;var u=void 0,c=void 0,d=void 0;return"x"===t.axis?(u=o,c=r,d=l):(u=i,c=a,d=s),c-d<100?{direction:"end",speedFactor:(100-(c-d))/100}:d-u<100?{direction:"begin",speedFactor:(100-(d-u))/100}:void 0}(t.mousePosition,e);n?e.animate(n.direction,1500*n.speedFactor):e.stop()})}}}}).call(this,n(0))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.removeStyle=t.addCursorStyleToBody=t.addStyleToHead=void 0;var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1));function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l={overflow:"hidden",display:"block"},s={height:"100%",display:"inline-block","vertical-align":"top","white-space":"normal"},u=(a(o={},"."+i.containerClass,{position:"relative"}),a(o,"."+i.containerClass+" *",{"box-sizing":"border-box"}),a(o,"."+i.containerClass+".horizontal",{"white-space":"nowrap"}),a(o,"."+i.containerClass+".horizontal > ."+i.stretcherElementClass,{display:"inline-block"}),a(o,"."+i.containerClass+".horizontal > ."+i.wrapperClass,s),a(o,"."+i.containerClass+".vertical > ."+i.wrapperClass,l),a(o,"."+i.wrapperClass,{}),a(o,"."+i.wrapperClass+".horizontal",s),a(o,"."+i.wrapperClass+".vertical",l),a(o,"."+i.wrapperClass+".animated",{transition:"transform ease"}),a(o,"."+i.ghostClass+" *",{"box-sizing":"border-box"}),a(o,"."+i.ghostClass+".animated",{transition:"all ease-in-out"}),a(o,"."+i.disbaleTouchActions+" *",{"touch-actions":"none","-ms-touch-actions":"none"}),a(o,"."+i.noUserSelectClass+" *",{"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),o);function c(e){return Object.keys(e).reduce(function(t,n){var o=e[n];return"object"===(void 0===o?"undefined":r(o))?""+t+n+"{"+c(o)+"}":""+t+n+":"+o+";"},"")}t.addStyleToHead=function(){if("undefined"!=typeof window){var t=e.document.head||e.document.getElementsByTagName("head")[0],n=e.document.createElement("style"),o=c(u);n.type="text/css",n.styleSheet?n.styleSheet.cssText=o:n.appendChild(e.document.createTextNode(o)),t.appendChild(n)}},t.addCursorStyleToBody=function(t){if(t&&"undefined"!=typeof window){var n=e.document.head||e.document.getElementsByTagName("head")[0],o=e.document.createElement("style"),r=c({"body *":{cursor:t+" !important"}});return o.type="text/css",o.styleSheet?o.styleSheet.cssText=r:o.appendChild(e.document.createTextNode(r)),n.appendChild(o),o}return null},t.removeStyle=function(t){t&&"undefined"!=typeof window&&(e.document.head||e.document.getElementsByTagName("head")[0]).removeChild(t)}}).call(this,n(0))},function(e,t,n){"use strict";(function(e){var t;(t=e.Node||e.Element)&&t.prototype&&!t.prototype.matches&&(t.prototype.matches=t.prototype.matchesSelector||t.prototype.mozMatchesSelector||t.prototype.msMatchesSelector||t.prototype.oMatchesSelector||t.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1}),function(e){e&&e.prototype&&null==e.prototype.firstElementChild&&Object.defineProperty(e.prototype,"firstElementChild",{get:function(){for(var e,t=this.childNodes,n=0;e=t[n++];)if(1===e.nodeType)return e;return null}})}(e.Node||e.Element),Array.prototype.some||(Array.prototype.some=function(e){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof e)throw new TypeError;for(var t=Object(this),n=t.length>>>0,o=arguments.length>=2?arguments[1]:void 0,r=0;r<n;r++)if(r in t&&e.call(o,t[r],r,t))return!0;return!1})}).call(this,n(0))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),n(7);var o,r=u(n(2)),i=u(n(1)),a=n(6),l=n(5),s=(o=l)&&o.__esModule?o:{default:o};function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var c=["mousedown","touchstart"],d=["mousemove","touchmove"],f=["mouseup","touchend"],g=null,p=null,m=null,v=null,h=[],y=!1,b=null,C=null,x=null,E=null,S=r.isMobile();function O(){"undefined"!=typeof window&&c.forEach(function(t){e.document.addEventListener(t,I,{passive:!1})})}function w(){return v.ghostParent?v.ghostParent:p&&p.parentElement||e.document.body}var D=function(){var t=void 0,n=void 0,o=void 0,r=null,i=1,a=5;function l(e){var o=R(e),r=o.clientX,l=o.clientY;if(n)(Math.abs(t.clientX-r)>a||Math.abs(t.clientY-l)>a)&&c();else if(Math.abs(t.clientX-r)>i||Math.abs(t.clientY-l)>i)return g()}function s(){c()}function u(){c()}function c(){clearTimeout(r),d.forEach(function(t){return e.document.removeEventListener(t,l)},{passive:!1}),f.forEach(function(t){return e.document.removeEventListener(t,s)},{passive:!1}),e.document.removeEventListener("drag",u,{passive:!1})}function g(){clearTimeout(r),c(),o()}return function(i,a,c){t=R(i),o=c,(n="number"==typeof a?a:S?200:0)&&(r=setTimeout(g,n)),d.forEach(function(t){return e.document.addEventListener(t,l)},{passive:!1}),f.forEach(function(t){return e.document.addEventListener(t,s)},{passive:!1}),e.document.addEventListener("drag",u,{passive:!1})}}();function I(t){var n=R(t);if(!y&&(void 0===n.button||0===n.button)&&(p=r.getParent(n.target,"."+i.wrapperClass))){var o=r.getParent(p,"."+i.containerClass),a=h.filter(function(e){return e.element===o})[0],l=a.getOptions().dragHandleSelector,s=a.getOptions().nonDragAreaSelector,u=!0;l&&!r.getParent(n.target,l)&&(u=!1),s&&r.getParent(n.target,s)&&(u=!1),u&&D(n,a.getOptions().dragBeginDelay,function(){r.clearSelection(),B(n,r.getElementCursor(t.target)),d.forEach(function(t){e.document.addEventListener(t,A,{passive:!1})}),f.forEach(function(t){e.document.addEventListener(t,P,{passive:!1})})})}}function P(){d.forEach(function(t){e.document.removeEventListener(t,A,{passive:!1})}),f.forEach(function(t){e.document.removeEventListener(t,P,{passive:!1})}),C({reset:!0}),E&&((0,a.removeStyle)(E),E=null),v&&function(e){function t(){r.removeClass(m.ghost,"animated"),m.ghost.style.transitionDuration=null,w().removeChild(m.ghost),e()}function n(e,n,o){var i=e.top,a=e.left;r.addClass(m.ghost,"animated"),o&&r.addClass(m.ghost.firstElementChild,o),m.ghost.style.transitionDuration=n+"ms",m.ghost.style.left=a+"px",m.ghost.style.top=i+"px",setTimeout(function(){t()},n+20)}if(v.targetElement){var o=h.filter(function(e){return e.element===v.targetElement})[0];!(p=o.getOptions()).shouldAnimateDrop||p.shouldAnimateDrop(v.container.getOptions(),v.payload)?n(o.getDragResult().shadowBeginEnd.rect,Math.max(150,o.getOptions().animationDuration/2),o.getOptions().dropClass):t()}else{var i=h.filter(function(e){return e===v.container})[0],a=i.getOptions(),l=a.behaviour,s=a.removeOnDropOut;if("move"===l&&!s&&i.getDragResult()){var u=i.getDragResult(),c=u.removedIndex,d=u.elementSize,f=i.layout;i.getTranslateCalculator({dragResult:{removedIndex:c,addedIndex:c,elementSize:d}});var g=c>0?f.getBeginEnd(i.draggables[c-1]).end:f.getBeginEndOfContainer().begin;n(f.getTopLeftOfElementBegin(g),i.getOptions().animationDuration,i.getOptions().dropClass)}else r.addClass(m.ghost,"animated"),m.ghost.style.transitionDuration=i.getOptions().animationDuration+"ms",m.ghost.style.opacity="0",m.ghost.style.transform="scale(0.90)",setTimeout(function(){t()},i.getOptions().animationDuration)}var p}(function(){r.removeClass(e.document.body,i.disbaleTouchActions),r.removeClass(e.document.body,i.noUserSelectClass),T(!1),(g||[]).forEach(function(e){e.handleDrop(v)}),g=null,p=null,m=null,v=null,y=!1,null,x=null,b=null})}function R(e){return e.touches?e.touches[0]:e}function T(e){h.forEach(function(t){var n=e?t.getOptions().onDragStart:t.getOptions().onDragEnd;if(n){var o={isSource:t===v.container,payload:v.payload};t.isDragRelevant(v.container,v.payload)?o.willAcceptDrop=!0:o.willAcceptDrop=!1,n(o)}})}function B(t,n){y=!0;var o=h.filter(function(e){return p.parentElement===e.element})[0];o.setDraggables(),o,x=o.getOptions().lockAxis?o.getOptions().lockAxis.toLowerCase():null,v=function(e){var t=h.filter(function(t){return e.parentElement===t.element})[0],n=t.draggables.indexOf(e),o=t.getOptions().getGhostParent;return{container:t,element:e,elementIndex:n,payload:t.getOptions().getChildPayload?t.getOptions().getChildPayload(n):void 0,targetElement:null,position:{x:0,y:0},groupName:t.getOptions().groupName,ghostParent:o?o():null}}(p),m=function(t,n,o,l){var s=n.x,u=n.y,c=o.getScale(),d=(c.scaleX,c.scaleY,t.getBoundingClientRect()),f=d.left,g=d.top,p=d.right,m=d.bottom,v=f+(p-f)/2,h=g+(m-g)/2,y=t.cloneNode(!0);return y.style.zIndex=1e3,y.style.boxSizing="border-box",y.style.position="fixed",y.style.left=f+"px",y.style.top=g+"px",y.style.width=p-f+"px",y.style.height=m-g+"px",y.style.overflow="visible",y.style.transition=null,y.style.removeProperty("transition"),y.style.pointerEvents="none",o.getOptions().dragClass?setTimeout(function(){r.addClass(y.firstElementChild,o.getOptions().dragClass);var t=e.getComputedStyle(y.firstElementChild).cursor;E=(0,a.addCursorStyleToBody)(t)}):E=(0,a.addCursorStyleToBody)(l),r.addClass(y,o.getOptions().orientation),r.addClass(y,i.ghostClass),{ghost:y,centerDelta:{x:v-s,y:h-u},positionDelta:{left:f-s,top:g-u}}}(p,{x:t.clientX,y:t.clientY},v.container,n),v.position={x:t.clientX+m.centerDelta.x,y:t.clientY+m.centerDelta.y},v.mousePosition={x:t.clientX,y:t.clientY},r.addClass(e.document.body,i.disbaleTouchActions),r.addClass(e.document.body,i.noUserSelectClass),g=h.filter(function(e){return e.isDragRelevant(o,v.payload)}),b=function(e){var t=e;return function(e){var n=!1;t.forEach(function(t){var o=t.handleDrag(e);n|=o.containerBoxChanged||!1,o.containerBoxChanged=!1}),C({draggableInfo:e}),n&&(n=!1,setTimeout(function(){h.forEach(function(e){e.layout.invalidateRects(),e.onTranslated()})},10))}}(g),C&&C({reset:!0}),C=function(e,t){return e.getOptions().autoScrollEnabled?(0,s.default)(t):function(){return null}}(o,g),g.forEach(function(e){return e.prepareDrag(e,g)}),T(!0),b(v),w().appendChild(m.ghost)}function A(e){e.preventDefault();var t=R(e);v?(x?"y"===x?(m.ghost.style.top=t.clientY+m.positionDelta.top+"px",v.position.y=t.clientY+m.centerDelta.y,v.mousePosition.y=t.clientY):"x"===x&&(m.ghost.style.left=t.clientX+m.positionDelta.left+"px",v.position.x=t.clientX+m.centerDelta.x,v.mousePosition.x=t.clientX):(m.ghost.style.left=t.clientX+m.positionDelta.left+"px",m.ghost.style.top=t.clientY+m.positionDelta.top+"px",v.position.x=t.clientX+m.centerDelta.x,v.position.y=t.clientY+m.centerDelta.y,v.mousePosition.x=t.clientX,v.mousePosition.y=t.clientY),b(v)):B(t,r.getElementCursor(e.target))}(0,a.addStyleToHead)(),t.default=(O(),{register:function(e){h.push(e)},unregister:function(e){h.splice(h.indexOf(e),1)}})}).call(this,n(0))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var o=s(n(8)),r=s(n(4)),i=n(2),a=n(3),l=n(1);function s(e){return e&&e.__esModule?e:{default:e}}var u={groupName:null,behaviour:"move",orientation:"vertical",getChildPayload:null,animationDuration:250,autoScrollEnabled:!0,shouldAcceptDrop:null,shouldAnimateDrop:null};function c(e,t,n){t?((0,i.addClass)(e,l.animationClass),e.style.transitionDuration=n+"ms"):((0,i.removeClass)(e,l.animationClass),e.style.removeProperty("transition-duration"))}function d(e){return e?e[l.containerInstance]:null}function f(t){if(N.wrapChild)return N.wrapChild(t);var n=e.document.createElement("div");return n.className=""+l.wrapperClass,t.parentElement.insertBefore(n,t),n.appendChild(t),n}function g(e){var t=[];return Array.prototype.map.call(e.children,function(n){if(n.nodeType===Node.ELEMENT_NODE){var o=n;(0,i.hasClass)(n,l.wrapperClass)||(o=f(n)),o[l.containersInDraggable]=[],o[l.translationValue]=0,t.push(o)}else e.removeChild(n)}),t}function p(e){var t=e.layout;return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function e(n,o,r,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(i<r)return r;if(r===i){var l=t.getBeginEnd(n[r]),s=l.begin,u=l.end;return o>s&&o<=u?a?o<(u+s)/2?r:r+1:r:null}var c=Math.floor((i+r)/2),d=t.getBeginEnd(n[c]),f=d.begin,g=d.end;return o<f?e(n,o,r,c-1,a):o>g?e(n,o,c+1,i,a):a?o<(g+f)/2?c:c+1:c}(e,n,0,e.length-1,o)}}function m(e){var t=e.element,n=e.draggables,o=e.layout,r=e.options,i=function(e){var t=e.element,n=e.draggables,o=e.layout;return e.options,function(){n.forEach(function(e){c(e,!1),o.setTranslation(e,0),o.setVisibility(e,!0),e[l.containersInDraggable]=[]}),t[l.stretcherElementInstance]&&(t[l.stretcherElementInstance].parentNode.removeChild(t[l.stretcherElementInstance]),t[l.stretcherElementInstance]=null)}}({element:t,draggables:n,layout:o,options:r}),s=(N.dropHandler||a.domDropHandler)({element:t,draggables:n,layout:o,options:r});return function(e,t){var n=t.addedIndex,o=t.removedIndex;if(i(),e.targetElement||r.removeOnDropOut){var a={removedIndex:o,addedIndex:null!==n?null!==o&&o<n?n-1:n:null,payload:e.payload,droppedElement:e.element.firstElementChild};s(a,r.onDrop)}}}function v(e,t){var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return Object.assign({},u,e)}(t),o=g(e,n.orientation,n.animationDuration);return(0,i.addClass)(e,l.containerClass+" "+n.orientation),{element:e,draggables:o,options:n,layout:(0,r.default)(e,n.orientation,n.animationDuration)}}function h(e,t){var n=function(e,t){for(var n=e.element;n;){var o=d(n.parentElement);if(o&&t.indexOf(o)>-1)return{container:o,draggable:n};n=n.parentElement}return null}(e,t);n&&(n.container.getChildContainers().push(e),e.setParentContainer(n.container),n.draggable[l.containersInDraggable].push(e))}function y(e){e.draggables;var t=e.element,n=e.options,o=null;return function(e){var r=e.draggableInfo,i=(e.dragResult,o);return null==o&&r.container.element===t&&"copy"!==n.behaviour&&(i=o=r.elementIndex),{removedIndex:i}}}function b(e){var t=e.draggables,n=e.layout;return function(e){e.draggableInfo;var o=e.dragResult;null!==o.removedIndex&&n.setVisibility(t[o.removedIndex],!1)}}function C(e){var t=e.element,n=e.layout;return function(e){var o=e.draggableInfo;return{pos:d(t).isPosInChildContainer()?null:n.getPosition(o.position)}}}function x(e){var t=e.element,n=!1;return function(e){e.draggableInfo;var o=e.dragResult;d(t).getParentContainer()&&n!==(null!==o.pos)&&(n=null!==o.pos,d(t).getParentContainer().onChildPositionCaptured(n))}}function E(e){var t=e.layout,n=null;return function(e){var o=e.draggableInfo;return null===e.dragResult.pos?n=null:{elementSize:n=n||t.getSize(o.element)}}}function S(e){var t=e.element;return function(e){var n=e.draggableInfo,o=e.dragResult;!function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t&&n?e.targetElement=t:e.targetElement===t&&(e.targetElement=null)}(n,t,!!o.pos)}}function O(e){e.draggables,e.layout;return function(e){return null!==e.dragResult.pos?{addedIndex:0}:{addedIndex:null}}}function w(e){e.draggables;var t=e.layout,n=null;return function(e){var o=e.dragResult.addedIndex;if(o!==n){n=o;var r=t.getBeginEndOfContainer(),i=r.begin,a=r.end;return{shadowBeginEnd:{rect:t.getTopLeftOfElementBegin(i,a)}}}}}function D(e){var t=B(e);return function(e){var n=e.draggableInfo,o=e.dragResult;return n.invalidateShadow?t({draggableInfo:n,dragResult:o}):null}}function I(e){var t,n,o,r=(n=(t=e).draggables,o=p({layout:t.layout}),function(e){var t=e.dragResult,r=t.shadowBeginEnd,i=t.pos;if(!r){var a=o(n,i,!0);return null!==a?a:n.length}return r.begin+r.beginAdjustment<=i&&r.end>=i?null:i<r.begin+r.beginAdjustment?o(n,i):i>r.end?o(n,i)+1:n.length});return function(e){var t=e.dragResult,n=null;return null!==t.pos&&null===(n=r({dragResult:t}))&&(n=t.addedIndex),{addedIndex:n}}}function P(){var e=null;return function(t){var n=t.dragResult,o=n.addedIndex,r=n.shadowBeginEnd;o!==e&&null!==e&&r&&(r.beginAdjustment=0),e=o}}function R(t){var n=t.element,o=t.draggables,r=t.layout,i=t.options,a=null;return function(t){var s=t.dragResult,u=s.addedIndex,c=s.removedIndex,d=s.elementSize;if(null===c)if(null!==u){if(!a){var f=r.getBeginEndOfContainer();f.end=f.begin+r.getSize(n);var g=r.getScrollSize(n)>r.getSize(n)?f.begin+r.getScrollSize(n)-r.getScrollValue(n):f.end,p=o.length>0?r.getBeginEnd(o[o.length-1]).end-o[o.length-1][l.translationValue]:f.begin;if(p+d>g){(a=e.document.createElement("div")).className=l.stretcherElementClass+" "+i.orientation;var m=d+p-g;return r.setSize(a.style,m+"px"),n.appendChild(a),n[l.stretcherElementInstance]=a,{containerBoxChanged:!0}}}}else if(a){r.setTranslation(a,0);var v=a;return a=null,n.removeChild(v),n[l.stretcherElementInstance]=null,{containerBoxChanged:!0}}}}function T(e){e.element;var t=e.draggables,n=e.layout,o=null,r=null;return function(e){var i=e.dragResult,a=i.addedIndex,l=i.removedIndex,s=i.elementSize;if(a!==o||l!==r){for(var u=0;u<t.length;u++)if(u!==l){var c=t[u],d=0;null!==l&&l<u&&(d-=n.getSize(t[l])),null!==a&&a<=u&&(d+=s),n.setTranslation(c,d)}return o=a,r=l,{addedIndex:a,removedIndex:l}}}}function B(e){var t=e.draggables,n=e.layout,o=null;return function(e){var r=e.draggableInfo,i=e.dragResult,a=i.addedIndex,l=i.removedIndex,s=i.elementSize,u=i.pos,c=i.shadowBeginEnd;if(null!==u){if(null===a||!r.invalidateShadow&&a===o)return null;o&&(o=a);var d=a-1,f=0,g=null,p=null;if(d===l&&d--,d>-1){var m=n.getSize(t[d]);if(p=n.getBeginEnd(t[d]),s<m){var v=(m-s)/2;f=p.end-v}else f=p.end}else p={end:n.getBeginEndOfContainer().begin};var h=1e4,y=a;if(y===l&&y++,y<t.length){var b=n.getSize(t[y]);if(g=n.getBeginEnd(t[y]),s<b){var C=(b-s)/2;h=g.begin+C}else h=g.begin}else g={begin:n.getContainerRectangles().end};return{shadowBeginEnd:{begin:f,end:h,rect:p&&g?n.getTopLeftOfElementBegin(p.end,g.begin):null,beginAdjustment:c?c.beginAdjustment:0}}}return o=null,{shadowBeginEnd:null}}}function A(){var e=null;return function(t){var n=t.dragResult,o=n.pos,r=n.addedIndex,i=n.shadowBeginEnd;t.draggableInfo.invalidateShadow;if(null!==o){if(null!=r&&null===e){if(o<i.begin){var a=o-i.begin-5;i.beginAdjustment=a}e=r}}else e=null}}function _(e){var t=e.options,n=!1;return function(e){var o=!!e.dragResult.pos;if(o!==n){if(n=o,!o)return t.onDragLeave&&t.onDragLeave(),{dragLeft:!0};t.onDragEnter&&t.onDragEnter()}}}function z(e){var t=e.options,n=null;return function(e){var o=e.dragResult,r=o.addedIndex,i=o.removedIndex,a=e.draggableInfo,l=a.payload,s=a.element;if(t.onDropReady&&n!==r){n=r;var u=r;null!==i&&r>i&&u--,t.onDropReady({addedIndex:u,removedIndex:i,payload:l,element:s.firstElementChild})}}}function j(e){return"drop-zone"===e.options.behaviour?M(e)(y,b,C,x,E,S,O,w,_,z):M(e)(y,b,C,x,E,S,D,I,P,R,T,B,A,_,z)}function M(e){return function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var r=n.map(function(t){return t(e)}),i=null;return function(e){return i=r.reduce(function(t,n){return Object.assign(t,n({draggableInfo:e,dragResult:t}))},i||{addedIndex:null,removedIndex:null,elementSize:null,pos:null,shadowBeginEnd:null})}}}function L(e){return function(t){var n=null,o=null,r=v(e,t),a=j(r),s=m(r),u=null,d=!1,p=[];function y(){null!==o&&(o.invalidateShadow=!0,n=a(o),o.invalidateShadow=!1)}function b(e){d=e,u&&(u.onChildPositionCaptured(e),o&&(n=a(o)))}function C(e,t,n){for(var o=g(t,n.orientation,n.animationDuration),r=0;r<o.length;r++)e[r]=o[r];for(var i=0;i<e.length-o.length;i++)e.pop()}return r.layout.setScrollListener(function(){y()}),{element:e,draggables:r.draggables,isDragRelevant:function(e){var t=e.element,n=e.options;return function(e,o){if(n.shouldAcceptDrop)return n.shouldAcceptDrop(e.getOptions(),o);var r=e.getOptions();return"copy"!==n.behaviour&&(0,i.getParent)(t,"."+l.wrapperClass)!==e.element&&(e.element===t||!(!r.groupName||r.groupName!==n.groupName))}}(r),getScale:r.layout.getContainerScale,layout:r.layout,getChildContainers:function(){return p},onChildPositionCaptured:b,dispose:function(e){var t;t=e.element,Array.prototype.map.call(t.children,function(e){if(e.nodeType===Node.ELEMENT_NODE){var n=e;(0,i.hasClass)(e,l.wrapperClass)&&(t.insertBefore(n,f.firstElementChild),t.removeChild(n))}})},prepareDrag:function(e,t){var n=e.element,o=r.draggables,i=e.getOptions();C(o,n,i),e.layout.invalidateRects(),h(e,t),o.forEach(function(e){return c(e,!0,i.animationDuration)})},isPosInChildContainer:function(){return d},handleDrag:function(e){return o=e,(n=a(e)).dragLeft&&"drop-zone"!==r.options.behaviour&&(n.dragLeft=!1,setTimeout(function(){n&&T(r)({dragResult:n})},20)),n},handleDrop:function(e){o=null,b(!1),a=j(r),s(e,n),n=null,u=null,p=[]},getDragResult:function(){return n},getTranslateCalculator:function(){return T(r).apply(void 0,arguments)},setParentContainer:function(e){u=e},getParentContainer:function(){return u},onTranslated:function(){y()},getOptions:function(){return r.options},setDraggables:function(){C(r.draggables,e,r.options)}}}}function N(e,t){var n=L(e)(t);return e[l.containerInstance]=n,o.default.register(n),{dispose:function(){o.default.unregister(n),n.layout.dispose(),n.dispose(n)}}}t.default=N}).call(this,n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dropHandlers=t.constants=void 0;var o,r=n(9),i=(o=r)&&o.__esModule?o:{default:o},a=s(n(1)),l=s(n(3));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default=i.default,t.constants=a,t.dropHandlers=l}])});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).SmoothDnD={})}(this,function(e){"use strict";var t,n,o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(t=o.Node||o.Element)&&t.prototype&&!t.prototype.matches&&(t.prototype.matches=t.prototype.matchesSelector||t.prototype.mozMatchesSelector||t.prototype.msMatchesSelector||t.prototype.oMatchesSelector||t.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n}),(n=o.Node||o.Element)&&n.prototype&&null==n.prototype.firstElementChild&&Object.defineProperty(n.prototype,"firstElementChild",{get:function(){for(var e,t=this.childNodes,n=0;e=t[n++];)if(1===e.nodeType)return e;return null}}),Array.prototype.some||(Array.prototype.some=function(e){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof e)throw new TypeError;for(var t=Object(this),n=t.length>>>0,o=2<=arguments.length?arguments[1]:void 0,r=0;r<n;r++)if(r in t&&e.call(o,t[r],r,t))return!0;return!1});var r,i=function(e,t,n){return"x"===n?{left:Math.max(e.left,t.left),top:e.top,right:Math.min(e.right,t.right),bottom:e.bottom}:{left:e.left,top:Math.max(e.top,t.top),right:e.right,bottom:Math.min(e.bottom,t.bottom)}},p=function(e){var t=e.getBoundingClientRect(),n={left:t.left,right:t.right+10,top:t.top,bottom:t.bottom};if(s(e,"x")&&!u(e,"x")){var o=n.right-n.left;n.right=n.right+e.scrollWidth-o}if(s(e,"y")&&!u(e,"y")){var r=n.bottom-n.top;n.bottom=n.bottom+e.scrollHeight-r}return n},l=function(e){var t=global.getComputedStyle(e),n=t.overflow;if("auto"===n||"scroll"===n)return"xy";var o=t["overflow-x"],r="auto"===o||"scroll"===o,i=t["overflow-y"],l="auto"===i||"scroll"===i;return"".concat(r?"x":"").concat(l?"y":"")||null},a=function(e,t){var n=global.getComputedStyle(e),o=n.overflow,r=n["overflow-".concat(t)];return"auto"===o||"scroll"===o||("auto"===r||"scroll"===r)},u=function(e,t){var n=global.getComputedStyle(e),o=n.overflow,r=n["overflow-".concat(t)];return"auto"===o||"scroll"===o||"hidden"===o||("auto"===r||"scroll"===r||"hidden"===r)},s=function(e,t){return"x"===t?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight},m=function(e,t){var n=e,o=t||p(e);for(n=e.parentElement;n;)s(n,"x")&&u(n,"x")&&(o=i(o,n.getBoundingClientRect(),"x")),s(n,"y")&&u(n,"y")&&(o=i(o,n.getBoundingClientRect(),"y")),n=n.parentElement;return o},h=function(t,n){var o=[];return setTimeout(function(){for(var e=t;e;)(a(e,"x")||a(e,"y"))&&(e.addEventListener("scroll",n),o.push(e)),e=e.parentElement;global.addEventListener("scroll",n)},10),{dispose:function(){o.forEach(function(e){e.removeEventListener("scroll",n)}),global.removeEventListener("scroll",n)}}},v=function(e,t){for(var n=e;n;){if(n.matches(t))return n;n=n.parentElement}return null},b=function(e,t){return-1<e.className.split(" ").map(function(e){return e}).indexOf(t)},S=function(e,t){if(e){var n=e.className.split(" ").filter(function(e){return e});-1===n.indexOf(t)&&(n.unshift(t),e.className=n.join(" "))}},y=function(e,t){if(e){var n=e.className.split(" ").filter(function(e){return e&&e!==t});e.className=n.join(" ")}},c=function(e,t){return e.removeChild(e.children[t])},d=function(e,t,n){n>=e.children.length?e.appendChild(t):e.insertBefore(t,e.children[n])},g=function(){global.getSelection?global.getSelection().empty?global.getSelection().empty():global.getSelection().removeAllRanges&&global.getSelection().removeAllRanges():global.document.selection&&global.document.selection.empty()},f=function(e){if(e){var t=global.getComputedStyle(e);if(t)return t.cursor}return null},E="smooth-dnd-container-instance",x="smooth-dnd-containers-in-draggable",C="smooth-dnd-draggable-wrapper",D="animated",w="__smooth_dnd_draggable_translation_value",O="__smooth_dnd_draggable_visibility_value",I="smooth-dnd-ghost",R="smooth-dnd-container",B="smooth-dnd-extra-size-for-insertion",z="smooth-dnd-stretcher-element",T="smooth-dnd-stretcher-instance",A="smooth-dnd-disable-touch-action",P="smooth-dnd-no-user-select",L=Object.freeze({containerInstance:E,containersInDraggable:x,defaultGroupName:"@@smooth-dnd-default-group@@",wrapperClass:C,defaultGrabHandleClass:"smooth-dnd-default-grap-handle",animationClass:D,translationValue:w,visibilityValue:O,ghostClass:I,containerClass:R,extraSizeForInsertion:B,stretcherElementClass:z,stretcherElementInstance:T,isDraggableDetached:"smoth-dnd-is-draggable-detached",disbaleTouchActions:A,noUserSelectClass:P});function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var M={overflow:"hidden",display:"block"},V={height:"100%",display:"inline-block","vertical-align":"top","white-space":"normal"},X=(j(r={},".".concat(R),{position:"relative"}),j(r,".".concat(R," *"),{"box-sizing":"border-box"}),j(r,".".concat(R,".horizontal"),{"white-space":"nowrap"}),j(r,".".concat(R,".horizontal > .").concat(z),{display:"inline-block"}),j(r,".".concat(R,".horizontal > .").concat(C),V),j(r,".".concat(R,".vertical > .").concat(C),M),j(r,".".concat(C),{}),j(r,".".concat(C,".horizontal"),V),j(r,".".concat(C,".vertical"),M),j(r,".".concat(C,".animated"),{transition:"transform ease"}),j(r,".".concat(I," *"),{"box-sizing":"border-box"}),j(r,".".concat(I,".animated"),{transition:"all ease-in-out"}),j(r,".".concat(A," *"),{"touch-actions":"none","-ms-touch-actions":"none"}),j(r,".".concat(P," *"),{"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),r);function Y(o){return Object.keys(o).reduce(function(e,t){var n=o[t];return"object"===N(n)?"".concat(e).concat(t,"{").concat(Y(n),"}"):"".concat(e).concat(t,":").concat(n,";")},"")}function _(e){if(e&&"undefined"!=typeof window){var t=global.document.head||global.document.getElementsByTagName("head")[0],n=global.document.createElement("style"),o=Y({"body *":{cursor:"".concat(e," !important")}});return n.type="text/css",n.styleSheet?n.styleSheet.cssText=o:n.appendChild(global.document.createTextNode(o)),t.appendChild(n),n}return null}var k=function(a){var u=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"y",n=!1,s=null,c=null,d=null,g=null;return{animate:function(e,t){d=e,g=t,(n=!0)&&function l(){null===s&&(s=requestAnimationFrame(function(e){null===c&&(c=e);var t=e-c;c=e;var n,o,r,i=t/1e3*g;o=u,r=i="begin"===d?0-i:i,(n=a)&&(n!==window?"x"===o?n.scrollLeft+=r:n.scrollTop+=r:"x"===o?n.scrollBy(r,0):n.scrollBy(0,r)),s=null,l()}))}()},stop:function(){n&&(cancelAnimationFrame(s),n=!1,s=c=null)}}};function W(e){var t={element:e,rect:m(e,e.getBoundingClientRect()),descendants:[],invalidate:n,axis:"y",dispose:function(){e.removeEventListener("scroll",n)}};function n(){t.rect=m(e,e.getBoundingClientRect()),t.descendants.forEach(function(e){return e.invalidate()})}return e.addEventListener("scroll",n),t}function F(e){return Object.assign(e,k(e.element,e.axis))}var q=function(e){var t,r,i,n=(t=e.map(function(e){return e.element}),r=[],i=null,t.forEach(function(e){var t=e;for(i=null;t;){var n=l(t);if(n&&!r.some(function(e){return e.element===t})){var o=W(t);i&&o.descendants.push(i),i=o,"xy"===n?(r.push(Object.assign({},o,{axis:"x"})),r.push(Object.assign({},o,{axis:"y"},{descendants:[]}))):r.push(Object.assign({},o,{axis:n}))}t=t.parentElement}}),r),o=[].concat(H(n.map(F)),H(function(){function e(){return{left:0,right:global.innerWidth,top:0,bottom:global.innerHeight}}return[Object.assign({rect:e(),axis:"y"},k(global)),Object.assign({rect:e(),axis:"x"},k(global,"x"))]}()));return function(e){var p=e.draggableInfo,t=e.reset;if(o.length){if(t)return o.forEach(function(e){return e.stop()}),void n.forEach(function(e){return e.dispose()});o.forEach(function(e){var t,n,o,r,i,l,a,u,s,c,d,g,f=(t=p.mousePosition,l=(n=e).rect,a=l.left,u=l.right,s=l.top,c=l.bottom,d=t.x,g=t.y,d<a||u<d||g<s||c<g?null:(i="x"===n.axis?(o=a,r=u,d):(o=s,r=c,g),r-i<100?{direction:"end",speedFactor:(100-(r-i))/100}:i-o<100?{direction:"begin",speedFactor:(100-(i-o))/100}:null));f?e.animate(f.direction,1500*f.speedFactor):e.stop()})}}},G=["mousedown","touchstart"],U=["mousemove","touchmove"],J=["mouseup","touchend"],K=null,Q=null,Z=null,$=null,ee=[],te=!1,ne=null,oe=null,re=null,ie=null,le="undefined"!=typeof window&&!!(global.navigator.userAgent.match(/Android/i)||global.navigator.userAgent.match(/webOS/i)||global.navigator.userAgent.match(/iPhone/i)||global.navigator.userAgent.match(/iPad/i)||global.navigator.userAgent.match(/iPod/i)||global.navigator.userAgent.match(/BlackBerry/i)||global.navigator.userAgent.match(/Windows Phone/i));function ae(){"undefined"!=typeof window&&G.forEach(function(e){global.document.addEventListener(e,ce,{passive:!1})})}function ue(){return $&&$.ghostParent?$.ghostParent:Q&&Q.parentElement||global.document.body}var se=function(){var r,i,o,l=null,a=1,u=5;function s(e){var t=ge(e),n=t.clientX,o=t.clientY;if(i)(Math.abs(r.clientX-n)>u||Math.abs(r.clientY-o)>u)&&g();else if(Math.abs(r.clientX-n)>a||Math.abs(r.clientY-o)>a)return f()}function c(){g()}function d(){g()}function g(){clearTimeout(l),U.forEach(function(e){return global.document.removeEventListener(e,s)},{passive:!1}),J.forEach(function(e){return global.document.removeEventListener(e,c)},{passive:!1}),global.document.removeEventListener("drag",d,{passive:!1})}function f(){clearTimeout(l),g(),o()}return function(e,t,n){r=ge(e),o=n,(i="number"==typeof t?t:le?200:0)&&(l=setTimeout(f,i)),U.forEach(function(e){return global.document.addEventListener(e,s)},{passive:!1}),J.forEach(function(e){return global.document.addEventListener(e,c)},{passive:!1}),global.document.addEventListener("drag",d,{passive:!1})}}();function ce(e){var t=ge(e);if(!te&&(void 0===t.button||0===t.button)&&(Q=v(t.target,"."+C))){var n=v(Q,"."+R),o=ee.filter(function(e){return e.element===n})[0],r=o.getOptions().dragHandleSelector,i=o.getOptions().nonDragAreaSelector,l=!0;r&&!v(t.target,r)&&(l=!1),i&&v(t.target,i)&&(l=!1),l&&se(t,o.getOptions().dragBeginDelay,function(){g(),pe(t,f(e.target)),U.forEach(function(e){global.document.addEventListener(e,me,{passive:!1})}),J.forEach(function(e){global.document.addEventListener(e,de,{passive:!1})})})}}function de(){var e;U.forEach(function(e){global.document.removeEventListener(e,me,{passive:!1})}),J.forEach(function(e){global.document.removeEventListener(e,de,{passive:!1})}),oe({reset:!0}),ie&&((e=ie)&&"undefined"!=typeof window&&(global.document.head||global.document.getElementsByTagName("head")[0]).removeChild(e),ie=null),$&&function(e){function i(){y(Z.ghost,"animated"),Z.ghost.style.transitionDuration=null,ue().removeChild(Z.ghost),e()}function t(e,t,n){var o=e.top,r=e.left;S(Z.ghost,"animated"),n&&S(Z.ghost.firstElementChild,n),Z.ghost.style.transitionDuration=t+"ms",Z.ghost.style.left=r+"px",Z.ghost.style.top=o+"px",setTimeout(function(){i()},t+20)}if($.targetElement){var n=ee.filter(function(e){return e.element===$.targetElement})[0];!(f=n.getOptions()).shouldAnimateDrop||f.shouldAnimateDrop($.container.getOptions(),$.payload)?t(n.getDragResult().shadowBeginEnd.rect,Math.max(150,n.getOptions().animationDuration/2),n.getOptions().dropClass):i()}else{var o=ee.filter(function(e){return e===$.container})[0],r=o.getOptions(),l=r.behaviour,a=r.removeOnDropOut;if("move"===l&&!a&&o.getDragResult()){var u=o.getDragResult(),s=u.removedIndex,c=u.elementSize,d=o.layout;o.getTranslateCalculator({dragResult:{removedIndex:s,addedIndex:s,elementSize:c,pos:void 0,shadowBeginEnd:void 0}});var g=0<s?d.getBeginEnd(o.draggables[s-1]).end:d.getBeginEndOfContainer().begin;t(d.getTopLeftOfElementBegin(g),o.getOptions().animationDuration,o.getOptions().dropClass)}else S(Z.ghost,"animated"),Z.ghost.style.transitionDuration=o.getOptions().animationDuration+"ms",Z.ghost.style.opacity="0",Z.ghost.style.transform="scale(0.90)",setTimeout(function(){i()},o.getOptions().animationDuration)}var f}(function(){y(global.document.body,A),y(global.document.body,P),fe(!1),(K||[]).forEach(function(e){e.handleDrop($)}),te=!1,ne=re=$=Z=Q=K=null})}function ge(e){return e.touches?e.touches[0]:e}function fe(o){ee.forEach(function(e){var t=o?e.getOptions().onDragStart:e.getOptions().onDragEnd;if(t){var n={isSource:e===$.container,payload:$.payload};e.isDragRelevant($.container,$.payload)?n.willAcceptDrop=!0:n.willAcceptDrop=!1,t(n)}})}function pe(e,t){if(null!==Q){te=!0;var n=ee.filter(function(e){return Q.parentElement===e.element})[0];n.setDraggables(),re=n.getOptions().lockAxis?n.getOptions().lockAxis.toLowerCase():null,y=Q,E=ee.filter(function(e){return y.parentElement===e.element})[0],x=E.draggables.indexOf(y),C=E.getOptions().getGhostParent,$={container:E,element:y,elementIndex:x,payload:E.getOptions().getChildPayload?E.getOptions().getChildPayload(x):void 0,targetElement:null,position:{x:0,y:0},groupName:E.getOptions().groupName,ghostParent:C?C():null,invalidateShadow:null,mousePosition:null},i=Q,l={x:e.clientX,y:e.clientY},a=$.container,u=t,s=l.x,c=l.y,d=i.getBoundingClientRect(),g=d.left,f=d.top,p=d.right,m=d.bottom,h=g+(p-g)/2,v=f+(m-f)/2,(b=i.cloneNode(!0)).style.zIndex="1000",b.style.boxSizing="border-box",b.style.position="fixed",b.style.left=g+"px",b.style.top=f+"px",b.style.width=p-g+"px",b.style.height=m-f+"px",b.style.overflow="visible",b.style.transition=null,b.style.removeProperty("transition"),b.style.pointerEvents="none",a.getOptions().dragClass?setTimeout(function(){S(b.firstElementChild,a.getOptions().dragClass);var e=global.getComputedStyle(b.firstElementChild).cursor;ie=_(e)}):ie=_(u),S(b,a.getOptions().orientation||"vertical"),S(b,I),Z={ghost:b,centerDelta:{x:h-s,y:v-c},positionDelta:{left:g-s,top:f-c}},$.position={x:e.clientX+Z.centerDelta.x,y:e.clientY+Z.centerDelta.y},$.mousePosition={x:e.clientX,y:e.clientY},S(global.document.body,A),S(global.document.body,P),K=ee.filter(function(e){return e.isDragRelevant(n,$.payload)}),r=K,ne=function(n){var o=!1;r.forEach(function(e){var t=e.handleDrag(n);o=!!t.containerBoxChanged||!1,t.containerBoxChanged=!1}),oe({draggableInfo:n}),o&&(o=!1,setTimeout(function(){ee.forEach(function(e){e.layout.invalidateRects(),e.onTranslated()})},10))},oe&&oe({reset:!0,draggableInfo:void 0}),o=K,oe=n.getOptions().autoScrollEnabled?q(o):function(e){return null},K.forEach(function(e){return e.prepareDrag(e,K)}),fe(!0),ne($),ue().appendChild(Z.ghost)}var o,r,i,l,a,u,s,c,d,g,f,p,m,h,v,b,y,E,x,C}function me(e){e.preventDefault();var t=ge(e);$?(re?"y"===re?(Z.ghost.style.top="".concat(t.clientY+Z.positionDelta.top,"px"),$.position.y=t.clientY+Z.centerDelta.y,$.mousePosition.y=t.clientY):"x"===re&&(Z.ghost.style.left="".concat(t.clientX+Z.positionDelta.left,"px"),$.position.x=t.clientX+Z.centerDelta.x,$.mousePosition.x=t.clientX):(Z.ghost.style.left="".concat(t.clientX+Z.positionDelta.left,"px"),Z.ghost.style.top="".concat(t.clientY+Z.positionDelta.top,"px"),$.position.x=t.clientX+Z.centerDelta.x,$.position.y=t.clientY+Z.centerDelta.y,$.mousePosition.x=t.clientX,$.mousePosition.y=t.clientY),ne($)):pe(t,f(e.target))}!function(){if("undefined"!=typeof window){var e=global.document.head||global.document.getElementsByTagName("head")[0],t=global.document.createElement("style"),n=Y(X);t.type="text/css",t.styleSheet?t.styleSheet.cssText=n:t.appendChild(global.document.createTextNode(n)),e.appendChild(t)}}();var he=(ae(),{register:function(e){ee.push(e)},unregister:function(e){ee.splice(ee.indexOf(e),1)}}),ve={size:"offsetWidth",distanceToParent:"offsetLeft",translate:"transform",begin:"left",end:"right",dragPosition:"x",scrollSize:"scrollWidth",offsetSize:"offsetWidth",scrollValue:"scrollLeft",scale:"scaleX",setSize:"width",setters:{translate:function(e){return"translate3d(".concat(e,"px, 0, 0)")}}},be={size:"offsetHeight",distanceToParent:"offsetTop",translate:"transform",begin:"top",end:"bottom",dragPosition:"y",scrollSize:"scrollHeight",offsetSize:"offsetHeight",scrollValue:"scrollTop",scale:"scaleY",setSize:"height",setters:{translate:function(e){return"translate3d(0,".concat(e,"px, 0)")}}};function ye(o,u,e){o[B]=0;var r,n=e,i=(r="horizontal"===u?ve:be,{get:function(e,t){return e[r[t]||t]},set:function(e,t,n){requestAnimationFrame(function(){e[r[t]]=r.setters[t]?r.setters[t](n):n})}}),s={translation:0},t=null;global.addEventListener("resize",function(){c(o)}),setTimeout(function(){a()},10);var l=h(o,function(){c(o),t&&t()});function a(){var e,t;c(o),t=(e=o).getBoundingClientRect(),s.scaleX=e.offsetWidth?(t.right-t.left)/e.offsetWidth:1,s.scaleY=e.offsetHeight?(t.bottom-t.top)/e.offsetHeight:1}function c(e){s.rect=p(e),s.visibleRect=m(e,s.rect)}function d(e){return i.get(e,"size")*i.get(s,"scale")}function g(e){return i.get(e,"dragPosition")}function f(e,t){var n=s.visibleRect,o=n.left,r=n.top,i=n.right,l=n.bottom;l-r<2&&(l=r+30);var a=s.rect;return"vertical"===u?e>a.left&&e<a.right&&r<t&&t<l:o<e&&e<i&&t>a.top&&t<a.bottom}return{getSize:d,getContainerRectangles:function(){return{rect:s.rect,visibleRect:s.visibleRect}},getBeginEndOfDOMRect:function(e){return{begin:i.get(e,"begin"),end:i.get(e,"end")}},getBeginEndOfContainer:function(){return{begin:i.get(s.rect,"begin")+s.translation,end:i.get(s.rect,"end")+s.translation}},getBeginEndOfContainerVisibleRect:function(){return{begin:i.get(s.visibleRect,"begin")+s.translation,end:i.get(s.visibleRect,"end")+s.translation}},getBeginEnd:function(e){var t,n=(t=e,(i.get(t,"distanceToParent")+(t[w]||0))*i.get(s,"scale")+(i.get(s.rect,"begin")+s.translation)-i.get(o,"scrollValue"));return{begin:n,end:n+d(e)*i.get(s,"scale")}},getAxisValue:g,setTranslation:function(e,t){t?i.set(e.style,"translate",t):e.style.removeProperty("transform"),e[w]=t,e[x]&&setTimeout(function(){e[x].forEach(function(e){!function t(e){e.layout.invalidateRects(),e.onTranslated(),e.getChildContainers()&&e.getChildContainers().forEach(function(e){return t(e)})}(e)})},n+20)},getTranslation:function(e){return e[w]},setVisibility:function(e,t){void 0!==e[O]&&e[O]===t||(t?e.style.removeProperty("visibility"):e.style.visibility="hidden",e[O]=t)},isVisible:function(e){return void 0===e[O]||e[O]},isInVisibleRect:f,dispose:function(){l&&l.dispose()},getContainerScale:function(){return{scaleX:s.scaleX,scaleY:s.scaleY}},setScrollListener:function(e){t=e},setSize:function(e,t){i.set(e,"setSize",t)},getTopLeftOfElementBegin:function(e){var t=0;return{top:"horizontal"===u?(t=e,s.rect.top):(t=s.rect.left,e),left:t}},getScrollSize:function(e){return i.get(e,"scrollSize")},getScrollValue:function(e){return i.get(e,"scrollValue")},setScrollValue:function(e,t){return i.set(e,"scrollValue",t)},invalidate:a,invalidateRects:function(){c(o)},getPosition:function(e){return f(e.x,e.y)?g(e):null}}}function Ee(e){var u=e.element,s=e.draggables;return function(e,t){var n=e,o=n.removedIndex,r=n.addedIndex,i=n.droppedElement,l=null;if(null!==o&&(l=c(u,o),s.splice(o,1)),null!==r){var a=global.document.createElement("div");a.className="".concat(C),a.appendChild(l&&l.firstElementChild?l.firstElementChild:i),a[x]=[],d(u,a,r),r>=s.length?s.push(a):s.splice(r,0,a)}t&&t(e)}}var xe=Object.freeze({domDropHandler:Ee,reactDropHandler:function(){return{handler:function(){return function(e,t){t&&t(e)}}}}}),Ce={groupName:void 0,behaviour:"move",orientation:"vertical",getChildPayload:void 0,animationDuration:250,autoScrollEnabled:!0,shouldAcceptDrop:void 0,shouldAnimateDrop:void 0};function Se(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Ce.animationDuration;t?(S(e,D),e.style.transitionDuration=n+"ms"):(y(e,D),e.style.removeProperty("transition-duration"))}function De(e){return e?e[E]:null}function we(n){var o=[];return Array.prototype.forEach.call(n.children,function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e;b(e,C)||(t=function(e){if(Ke.wrapChild){var t=global.document.createElement("div");return t.className="".concat(C),e.parentElement.insertBefore(t,e),t.appendChild(e),t}return e}(e)),t[x]=[],t[w]=0,o.push(t)}else n.removeChild(e)}),o}function Oe(e){var f=e.layout;return function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return function e(t,n,o,r){var i=4<arguments.length&&void 0!==arguments[4]&&arguments[4];if(r<o)return o;if(o===r){var l=f.getBeginEnd(t[o]),a=l.begin,u=l.end;return a<n&&n<=u?i?n<(u+a)/2?o:o+1:o:null}var s=Math.floor((r+o)/2),c=f.getBeginEnd(t[s]),d=c.begin,g=c.end;return n<d?e(t,n,o,s-1,i):g<n?e(t,n,s+1,r,i):i?n<(g+d)/2?s:s+1:s}(e,t,0,e.length-1,n)}}function Ie(e){var t,n,o,r,i=e.element,l=e.draggables,a=e.layout,u=e.options,s=(n=(t={element:i,draggables:l,layout:a,options:u}).element,o=t.draggables,r=t.layout,function(){o.forEach(function(e){Se(e,!1),r.setTranslation(e,0),r.setVisibility(e,!0),e[x]=[]}),n[T]&&(n[T].parentNode.removeChild(n[T]),n[T]=null)}),c=(Ke.dropHandler||Ee)({element:i,draggables:l,layout:a,options:u});return function(e,t){var n=t.addedIndex,o=t.removedIndex;if(s(),e.targetElement||u.removeOnDropOut){var r={removedIndex:o,addedIndex:null!==n?null!==o&&o<n?n-1:n:null,payload:e.payload,droppedElement:e.element.firstElementChild};c(r,u.onDrop)}}}function Re(e,t){var n=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Ce;return Object.assign({},Ce,e)}(t),o=we(e);return S(e,"".concat(R," ").concat(n.orientation)),{element:e,draggables:o,options:n,layout:ye(e,n.orientation,n.animationDuration)}}function Be(e,t){var n=function(e,t){for(var n=e.element;n;){var o=De(n.parentElement);if(o&&-1<t.indexOf(o))return{container:o,draggable:n};n=n.parentElement}return null}(e,t);n&&(n.container.getChildContainers().push(e),e.setParentContainer(n.container),n.draggable[x].push(e))}function ze(e){var o=e.element,r=e.options,i=null;return function(e){var t=e.draggableInfo,n=i;return null==i&&t.container.element===o&&"copy"!==r.behaviour&&(n=i=t.elementIndex),{removedIndex:n}}}function Te(e){var n=e.draggables,o=e.layout;return function(e){var t=e.dragResult;null!==t.removedIndex&&o.setVisibility(n[t.removedIndex],!1)}}function Ae(e){var n=e.element,o=e.layout;return function(e){var t=e.draggableInfo;return{pos:De(n).isPosInChildContainer()?null:o.getPosition(t.position)}}}function Pe(e){var n=e.element,o=!1;return function(e){var t=e.dragResult;De(n).getParentContainer()&&o!==(null!==t.pos)&&(o=null!==t.pos,De(n).getParentContainer().onChildPositionCaptured(o))}}function Le(e){var n=e.layout,o=null;return function(e){var t=e.draggableInfo;return null===e.dragResult.pos?o=null:{elementSize:o=o||n.getSize(t.element)}}}function Ne(e){var o=e.element;return function(e){var t=e.draggableInfo,n=e.dragResult;!function(e,t){var n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];t&&n?e.targetElement=t:e.targetElement===t&&(e.targetElement=null)}(t,o,!!n.pos)}}function je(){return function(e){return null!==e.dragResult.pos?{addedIndex:0}:{addedIndex:null}}}function He(e){e.draggables;var r=e.layout,i=null;return function(e){var t=e.dragResult.addedIndex;if(t===i)return null;i=t;var n=r.getBeginEndOfContainer(),o=n.begin;n.end;return{shadowBeginEnd:{rect:r.getTopLeftOfElementBegin(o)}}}}function Me(e){var o=ke(e);return function(e){var t=e.draggableInfo,n=e.dragResult;return t.invalidateShadow?o({draggableInfo:t,dragResult:n}):null}}function Ve(e){var t,i,l,o=(i=(t=e).draggables,l=Oe({layout:t.layout}),function(e){var t=e.dragResult,n=t.shadowBeginEnd,o=t.pos;if(n)return n.begin+n.beginAdjustment<=o&&n.end>=o?null:o<n.begin+n.beginAdjustment?l(i,o):o>n.end?l(i,o)+1:i.length;var r=l(i,o,!0);return null!==r?r:i.length});return function(e){var t=e.dragResult,n=null;return null!==t.pos&&null===(n=o({dragResult:t}))&&(n=t.addedIndex),{addedIndex:n}}}function Xe(){var r=null;return function(e){var t=e.dragResult,n=t.addedIndex,o=t.shadowBeginEnd;n!==r&&null!==r&&o&&(o.beginAdjustment=0),r=n}}function Ye(e){var c=e.element,d=e.draggables,g=e.layout,f=e.options,p=null;return function(e){var t=e.dragResult,n=t.addedIndex,o=t.removedIndex,r=t.elementSize;if(null===o)if(null!==n){if(!p){var i=g.getBeginEndOfContainer();i.end=i.begin+g.getSize(c);var l=g.getScrollSize(c)>g.getSize(c)?i.begin+g.getScrollSize(c)-g.getScrollValue(c):i.end,a=0<d.length?g.getBeginEnd(d[d.length-1]).end-d[d.length-1][w]:i.begin;if(l<a+r){(p=global.document.createElement("div")).className=z+" "+f.orientation;var u=r+a-l;return g.setSize(p.style,"".concat(u,"px")),c.appendChild(p),c[T]=p,{containerBoxChanged:!0}}}}else if(p){g.setTranslation(p,0);var s=p;return p=null,c.removeChild(s),{containerBoxChanged:!(c[T]=null)}}}}function _e(e){var u=e.draggables,s=e.layout,c=null,d=null;return function(e){var t=e.dragResult,n=t.addedIndex,o=t.removedIndex,r=t.elementSize;if(n!==c||o!==d){for(var i=0;i<u.length;i++)if(i!==o){var l=u[i],a=0;null!==o&&o<i&&(a-=s.getSize(u[o])),null!==n&&n<=i&&(a+=r),s.setTranslation(l,a)}return{addedIndex:c=n,removedIndex:d=o}}}}function ke(e){var b=e.draggables,y=e.layout,E=null;return function(e){var t=e.draggableInfo,n=e.dragResult,o=n.addedIndex,r=n.removedIndex,i=n.elementSize,l=n.pos,a=n.shadowBeginEnd;if(null===l)return{shadowBeginEnd:E=null};if(null===o||!t.invalidateShadow&&o===E)return null;E&&(E=o);var u=o-1,s=0,c=null,d=null;if(u===r&&u--,-1<u){var g=y.getSize(b[u]);if(d=y.getBeginEnd(b[u]),i<g){var f=(g-i)/2;s=d.end-f}else s=d.end}else d={end:y.getBeginEndOfContainer().begin};var p=1e4,m=o;if(m===r&&m++,m<b.length){var h=y.getSize(b[m]);if(c=y.getBeginEnd(b[m]),i<h){var v=(h-i)/2;p=c.begin+v}else p=c.begin}else c={begin:y.getContainerRectangles().rect.end};return{shadowBeginEnd:{begin:s,end:p,rect:d&&c?y.getTopLeftOfElementBegin(d.end):null,beginAdjustment:a?a.beginAdjustment:0}}}}function We(){var l=null;return function(e){var t=e.dragResult,n=t.pos,o=t.addedIndex,r=t.shadowBeginEnd;if(null!==n){if(null!=o&&null===l){if(n<r.begin){var i=n-r.begin-5;r.beginAdjustment=i}l=o}}else l=null}}function Fe(e){var n=e.options,o=!1;return function(e){var t=!!e.dragResult.pos;if(t!==o){if(!(o=t))return n.onDragLeave&&n.onDragLeave(),{dragLeft:!0};n.onDragEnter&&n.onDragEnter()}}}function qe(e){var u=e.options,s=null;return function(e){var t=e.dragResult,n=t.addedIndex,o=t.removedIndex,r=e.draggableInfo,i=r.payload,l=r.element;if(u.onDropReady&&null!==n&&s!==n){var a=s=n;null!==o&&o<n&&a--,u.onDropReady({addedIndex:a,removedIndex:o,payload:i,element:l.firstElementChild})}}}function Ge(e){return"drop-zone"===e.options.behaviour?Ue(e)(ze,Te,Ae,Pe,Le,Ne,je,He,Fe,qe):Ue(e)(ze,Te,Ae,Pe,Le,Ne,Me,Ve,Xe,Ye,_e,ke,We,Fe,qe)}function Ue(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t.map(function(e){return e(i)}),r=null;return function(n){return r=o.reduce(function(e,t){return Object.assign(e,t({draggableInfo:n,dragResult:e}))},r||{addedIndex:null,removedIndex:null,elementSize:null,pos:null,shadowBeginEnd:null})}}}function Je(m){return function(e){var t,o,r,n=null,i=null,l=Re(m,e),a=Ge(l),u=Ie(l),s=null,c=!1,d=[];function g(){null!==i&&(i.invalidateShadow=!0,n=a(i),i.invalidateShadow=!1)}function f(e){c=e,s&&(s.onChildPositionCaptured(e),i&&(n=a(i)))}function p(e,t){for(var n=we(t),o=0;o<n.length;o++)e[o]=n[o];for(var r=0;r<e.length-n.length;r++)e.pop()}return l.layout.setScrollListener(function(){g()}),{element:m,draggables:l.draggables,isDragRelevant:(t=l,o=t.element,r=t.options,function(e,t){if(r.shouldAcceptDrop)return r.shouldAcceptDrop(e.getOptions(),t);var n=e.getOptions();return"copy"!==r.behaviour&&v(o,"."+C)!==e.element&&(e.element===o||!(!n.groupName||n.groupName!==r.groupName))}),getScale:l.layout.getContainerScale,layout:l.layout,getChildContainers:function(){return d},onChildPositionCaptured:f,dispose:function(e){var t;t=e.element,Ke.wrapChild&&Array.prototype.forEach.call(t.children,function(e){e.nodeType===Node.ELEMENT_NODE&&b(e,C)&&(t.insertBefore(e.firstElementChild,e),t.removeChild(e))})},prepareDrag:function(e,t){var n=e.element,o=l.draggables,r=e.getOptions();p(o,n),e.layout.invalidateRects(),Be(e,t),o.forEach(function(e){return Se(e,!0,r.animationDuration)})},isPosInChildContainer:function(){return c},handleDrag:function(e){return(n=a(i=e))&&n.dragLeft&&"drop-zone"!==l.options.behaviour&&(n.dragLeft=!1,setTimeout(function(){n&&_e(l)({dragResult:n})},20)),n},handleDrop:function(e){i=null,f(!1),a=Ge(l),u(e,n),s=n=null,d=[]},getDragResult:function(){return n},getTranslateCalculator:function(e){return _e(l)(e)},setParentContainer:function(e){s=e},getParentContainer:function(){return s},onTranslated:function(){g()},getOptions:function(){return l.options},setDraggables:function(){p(l.draggables,m)}}}}var Ke=function(e,t){var n=Je(e)(t);return e[E]=n,he.register(n),{dispose:function(){he.unregister(n),n.layout.dispose(),n.dispose(n)}}};Ke.wrapChild=!0;e.smoothDnD=Ke,e.constants=L,e.dropHandlers=xe,e.default=function e(t,n){return console.warn('default export is deprecated. please use named export "smoothDnD"'),void 0!==e.dropHandler&&(Ke.dropHandler=e.dropHandler),void 0!==e.wrapChild&&(Ke.wrapChild=e.wrapChild),Ke(t,n)},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "smooth-dnd",
"version": "0.6.3",
"version": "0.7.0",
"description": "Drag and Drop library",
"main": "./dist/index.js",
"scripts": {
"build": "webpack --mode production"
"bundle": "rollup -c --environment INCLUDE_DEPS,BUILD:production",
"tsc": "tsc --emitDeclarationOnly --outDir dist",
"build": "npm run tsc && npm run bundle"
},
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"keywords": [

@@ -22,3 +28,3 @@ "sortable",

},
"license": "ISC",
"license": "MIT",
"repository": {

@@ -29,8 +35,11 @@ "type": "git",

"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"webpack": "^4.2.0",
"webpack-cli": "^2.0.13"
"@babel/core": "7.3.4",
"@babel/preset-env": "7.3.4",
"@babel/preset-typescript": "7.3.3",
"rollup": "1.4.0",
"rollup-plugin-babel": "4.3.2",
"rollup-plugin-commonjs": "^9.2.1",
"rollup-plugin-uglify": "6.0.2",
"typescript": "3.3.3333"
}
}

@@ -71,2 +71,3 @@ # smooth-dnd

|dropClass|string|`undefined`|Class to be added to the ghost item just before the drop animation begins.|
|removeOnDropOut|boolean|`undefined`|When set true onDrop will be called with a removedIndex if you drop element out of any relevant container|
|onDragStart|function|`undefined`|*See descriptions below*|

@@ -157,2 +158,13 @@ |onDragEnd|function|`undefined`|*See descriptions below*|

### getGhostParent
The function to be called to get the element that the dragged ghost will be appended. Default parent element is the container itself.
The ghost element is positioned as 'fixed' and appended to given parent element.
But if any anchestor of container has a transform property, ghost element will be positioned relative to that element which breaks the calculations. Thats why if you have any transformed parent element of Containers you should set this property so that it returns any element that has not transformed parent element.
```js
function getGhostParent() {
// i.e return document.body;
}
```
### shouldAnimateDrop

@@ -159,0 +171,0 @@

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