Files
PandaX/static/assets/sortable.esm.31e56bbd.js
feilong.teng@rheinchina.com cd824b7f0c 集成完成
2021-12-12 19:49:39 +08:00

7 lines
35 KiB
JavaScript

/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function lt(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,o)}return t}function W(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lt(Object(t),!0).forEach(function(o){Pt(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lt(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Ae(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ae=function(e){return typeof e}:Ae=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(n)}function Pt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function q(){return q=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},q.apply(this,arguments)}function Nt(n,e){if(n==null)return{};var t={},o=Object.keys(n),i,r;for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function xt(n,e){if(n==null)return{};var t=Nt(n,e),o,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,o)||(t[o]=n[o]))}return t}var Mt="1.14.0";function $(n){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(n)}var V=$(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),be=$(/Edge/i),st=$(/firefox/i),Ee=$(/safari/i)&&!$(/chrome/i)&&!$(/android/i),ut=$(/iP(ad|od|hone)/i),Ft=$(/chrome/i)&&$(/android/i),ft={capture:!1,passive:!1};function E(n,e,t){n.addEventListener(e,t,!V&&ft)}function b(n,e,t){n.removeEventListener(e,t,!V&&ft)}function Pe(n,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function Xt(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function G(n,e,t,o){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&Pe(n,e):Pe(n,e))||o&&n===t)return n;if(n===t)break}while(n=Xt(n))}return null}var ct=/\s+/g;function M(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var o=(" "+n.className+" ").replace(ct," ").replace(" "+e+" "," ");n.className=(o+(t?" "+e:"")).replace(ct," ")}}function h(n,e,t){var o=n&&n.style;if(o){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=t+(typeof t=="string"?"":"px")}}function le(n,e){var t="";if(typeof n=="string")t=n;else do{var o=h(n,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!e&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function dt(n,e,t){if(n){var o=n.getElementsByTagName(e),i=0,r=o.length;if(t)for(;i<r;i++)t(o[i],i);return o}return[]}function z(){var n=document.scrollingElement;return n||document.documentElement}function C(n,e,t,o,i){if(!(!n.getBoundingClientRect&&n!==window)){var r,a,l,s,u,d,c;if(n!==window&&n.parentNode&&n!==z()?(r=n.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,u=r.right,d=r.height,c=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,c=window.innerWidth),(e||t)&&n!==window&&(i=i||n.parentNode,!V))do if(i&&i.getBoundingClientRect&&(h(i,"transform")!=="none"||t&&h(i,"position")!=="static")){var m=i.getBoundingClientRect();a-=m.top+parseInt(h(i,"border-top-width")),l-=m.left+parseInt(h(i,"border-left-width")),s=a+r.height,u=l+r.width;break}while(i=i.parentNode);if(o&&n!==window){var y=le(i||n),v=y&&y.a,w=y&&y.d;y&&(a/=w,l/=v,c/=v,d/=w,s=a+d,u=l+c)}return{top:a,left:l,bottom:s,right:u,width:c,height:d}}}function ht(n,e,t){for(var o=Q(n,!0),i=C(n)[e];o;){var r=C(o)[t],a=void 0;if(t==="top"||t==="left"?a=i>=r:a=i<=r,!a)return o;if(o===z())break;o=Q(o,!1)}return!1}function se(n,e,t,o){for(var i=0,r=0,a=n.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==p.ghost&&(o||a[r]!==p.dragged)&&G(a[r],t.draggable,n,!1)){if(i===e)return a[r];i++}r++}return null}function ze(n,e){for(var t=n.lastElementChild;t&&(t===p.ghost||h(t,"display")==="none"||e&&!Pe(t,e));)t=t.previousElementSibling;return t||null}function Y(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==p.clone&&(!e||Pe(n,e))&&t++;return t}function pt(n){var e=0,t=0,o=z();if(n)do{var i=le(n),r=i.a,a=i.d;e+=n.scrollLeft*r,t+=n.scrollTop*a}while(n!==o&&(n=n.parentNode));return[e,t]}function Yt(n,e){for(var t in n)if(!!n.hasOwnProperty(t)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===n[t][o])return Number(t)}return-1}function Q(n,e){if(!n||!n.getBoundingClientRect)return z();var t=n,o=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=h(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return z();if(o||e)return t;o=!0}}while(t=t.parentNode);return z()}function kt(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function je(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var we;function gt(n,e){return function(){if(!we){var t=arguments,o=this;t.length===1?n.call(o,t[0]):n.apply(o,t),we=setTimeout(function(){we=void 0},e)}}}function Rt(){clearTimeout(we),we=void 0}function mt(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function vt(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}var F="Sortable"+new Date().getTime();function Bt(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(h(i,"display")==="none"||i===p.ghost)){n.push({target:i,rect:C(i)});var r=W({},n[n.length-1].rect);if(i.thisAnimationDuration){var a=le(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(o){n.push(o)},removeAnimationState:function(o){n.splice(Yt(n,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var r=!1,a=0;n.forEach(function(l){var s=0,u=l.target,d=u.fromRect,c=C(u),m=u.prevFromRect,y=u.prevToRect,v=l.rect,w=le(u,!0);w&&(c.top-=w.f,c.left-=w.e),u.toRect=c,u.thisAnimationDuration&&je(m,c)&&!je(d,c)&&(v.top-c.top)/(v.left-c.left)==(d.top-c.top)/(d.left-c.left)&&(s=Lt(v,m,y,i.options)),je(c,d)||(u.prevFromRect=d,u.prevToRect=c,s||(s=i.options.animation),i.animate(u,v,c,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},s),u.thisAnimationDuration=s)}),clearTimeout(e),r?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),n=[]},animate:function(o,i,r,a){if(a){h(o,"transition",""),h(o,"transform","");var l=le(this.el),s=l&&l.a,u=l&&l.d,d=(i.left-r.left)/(s||1),c=(i.top-r.top)/(u||1);o.animatingX=!!d,o.animatingY=!!c,h(o,"transform","translate3d("+d+"px,"+c+"px,0)"),this.forRepaintDummy=Ht(o),h(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){h(o,"transition",""),h(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Ht(n){return n.offsetWidth}function Lt(n,e,t,o){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*o.animation}var ue=[],Ue={initializeByDefault:!0},ye={mount:function(e){for(var t in Ue)Ue.hasOwnProperty(t)&&!(t in e)&&(e[t]=Ue[t]);ue.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ue.push(e)},pluginEvent:function(e,t,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=e+"Global";ue.forEach(function(a){!t[a.pluginName]||(t[a.pluginName][r]&&t[a.pluginName][r](W({sortable:t},o)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](W({sortable:t},o)))})},initializePlugins:function(e,t,o,i){ue.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var u=new l(e,t,e.options);u.sortable=e,u.options=e.options,e[s]=u,q(o,u.defaults)}});for(var r in e.options)if(!!e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a!="undefined"&&(e.options[r]=a)}},getEventProperties:function(e,t){var o={};return ue.forEach(function(i){typeof i.eventProperties=="function"&&q(o,i.eventProperties.call(t[i.pluginName],e))}),o},modifyOption:function(e,t,o){var i;return ue.forEach(function(r){!e[r.pluginName]||r.optionListeners&&typeof r.optionListeners[t]=="function"&&(i=r.optionListeners[t].call(e[r.pluginName],o))}),i}};function Wt(n){var e=n.sortable,t=n.rootEl,o=n.name,i=n.targetEl,r=n.cloneEl,a=n.toEl,l=n.fromEl,s=n.oldIndex,u=n.newIndex,d=n.oldDraggableIndex,c=n.newDraggableIndex,m=n.originalEvent,y=n.putSortable,v=n.extraEventProperties;if(e=e||t&&t[F],!!e){var w,k=e.options,j="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!V&&!be?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||t,w.from=l||t,w.item=i||t,w.clone=r,w.oldIndex=s,w.newIndex=u,w.oldDraggableIndex=d,w.newDraggableIndex=c,w.originalEvent=m,w.pullMode=y?y.lastPutMode:void 0;var A=W(W({},v),ye.getEventProperties(o,e));for(var R in A)w[R]=A[R];t&&t.dispatchEvent(w),k[j]&&k[j].call(e,w)}}var Gt=["evt"],N=function(e,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=xt(o,Gt);ye.pluginEvent.bind(p)(e,t,W({dragEl:f,parentEl:D,ghostEl:g,rootEl:_,nextEl:ie,lastDownEl:Ne,cloneEl:S,cloneHidden:J,dragStarted:De,putSortable:O,activeSortable:p.active,originalEvent:i,oldIndex:fe,oldDraggableIndex:_e,newIndex:X,newDraggableIndex:ee,hideGhostForTarget:St,unhideGhostForTarget:Tt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(l){P({sortable:t,name:l,originalEvent:i})}},r))};function P(n){Wt(W({putSortable:O,cloneEl:S,targetEl:f,rootEl:_,oldIndex:fe,oldDraggableIndex:_e,newIndex:X,newDraggableIndex:ee},n))}var f,D,g,_,ie,Ne,S,J,fe,X,_e,ee,xe,O,ce=!1,Me=!1,Fe=[],re,B,qe,$e,bt,Et,De,de,Se,Te=!1,Xe=!1,Ye,I,Ve=[],Ke=!1,ke=[],Re=typeof document!="undefined",Be=ut,wt=be||V?"cssFloat":"float",zt=Re&&!Ft&&!ut&&"draggable"in document.createElement("div"),yt=function(){if(!!Re){if(V)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),_t=function(e,t){var o=h(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=se(e,0,t),a=se(e,1,t),l=r&&h(r),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var c=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===c)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=i&&o[wt]==="none"||a&&o[wt]==="none"&&u+d>i)?"vertical":"horizontal"},jt=function(e,t,o){var i=o?e.left:e.top,r=o?e.right:e.bottom,a=o?e.width:e.height,l=o?t.left:t.top,s=o?t.right:t.bottom,u=o?t.width:t.height;return i===l||r===s||i+a/2===l+u/2},Ut=function(e,t){var o;return Fe.some(function(i){var r=i[F].options.emptyInsertThreshold;if(!(!r||ze(i))){var a=C(i),l=e>=a.left-r&&e<=a.right+r,s=t>=a.top-r&&t<=a.bottom+r;if(l&&s)return o=i}}),o},Dt=function(e){function t(r,a){return function(l,s,u,d){var c=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(r==null&&(a||c))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return t(r(l,s,u,d),a)(l,s,u,d);var m=(a?l:s).options.group.name;return r===!0||typeof r=="string"&&r===m||r.join&&r.indexOf(m)>-1}}var o={},i=e.group;(!i||Ae(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=t(i.pull,!0),o.checkPut=t(i.put),o.revertClone=i.revertClone,e.group=o},St=function(){!yt&&g&&h(g,"display","none")},Tt=function(){!yt&&g&&h(g,"display","")};Re&&document.addEventListener("click",function(n){if(Me)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Me=!1,!1},!0);var ae=function(e){if(f){e=e.touches?e.touches[0]:e;var t=Ut(e.clientX,e.clientY);if(t){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=t,o.preventDefault=void 0,o.stopPropagation=void 0,t[F]._onDragOver(o)}}},qt=function(e){f&&f.parentNode[F]._isOutsideThisEl(e.target)};function p(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=q({},e),n[F]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _t(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ee,emptyInsertThreshold:5};ye.initializePlugins(this,n,t);for(var o in t)!(o in e)&&(e[o]=t[o]);Dt(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:zt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?E(n,"pointerdown",this._onTapStart):(E(n,"mousedown",this._onTapStart),E(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(n,"dragover",this),E(n,"dragenter",this)),Fe.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),q(this,Bt())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(de=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,f):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,o=this.el,i=this.options,r=i.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=i.filter;if(tn(o),!f&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ee&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=G(s,i.draggable,o,!1),!(s&&s.animated)&&Ne!==s)){if(fe=Y(s),_e=Y(s,i.draggable),typeof d=="function"){if(d.call(this,e,s,this)){P({sortable:t,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),N("filter",t,{evt:e}),r&&e.cancelable&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(c){if(c=G(u,c.trim(),o,!1),c)return P({sortable:t,rootEl:c,name:"filter",targetEl:s,fromEl:o,toEl:o}),N("filter",t,{evt:e}),!0}),d)){r&&e.cancelable&&e.preventDefault();return}i.handle&&!G(u,i.handle,o,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,t,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,s;if(o&&!f&&o.parentNode===r){var u=C(o);if(_=r,f=o,D=f.parentNode,ie=f.nextSibling,Ne=o,xe=a.group,p.dragged=f,re={target:f,clientX:(t||e).clientX,clientY:(t||e).clientY},bt=re.clientX-u.left,Et=re.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,f.style["will-change"]="all",s=function(){if(N("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!st&&i.nativeDraggable&&(f.draggable=!0),i._triggerDragStart(e,t),P({sortable:i,name:"choose",originalEvent:e}),M(f,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){dt(f,d.trim(),Ze)}),E(l,"dragover",ae),E(l,"mousemove",ae),E(l,"touchmove",ae),E(l,"mouseup",i._onDrop),E(l,"touchend",i._onDrop),E(l,"touchcancel",i._onDrop),st&&this.nativeDraggable&&(this.options.touchStartThreshold=4,f.draggable=!0),N("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(be||V))){if(p.eventCanceled){this._onDrop();return}E(l,"mouseup",i._disableDelayedDrag),E(l,"touchend",i._disableDelayedDrag),E(l,"touchcancel",i._disableDelayedDrag),E(l,"mousemove",i._delayedDragTouchMoveHandler),E(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&E(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){f&&Ze(f),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(f,"dragend",this),E(_,"dragstart",this._onDragStart));try{document.selection?Le(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ce=!1,_&&f){N("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",qt);var o=this.options;!e&&M(f,o.dragClass,!1),M(f,o.ghostClass,!0),p.active=this,e&&this._appendGhost(),P({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(B){this._lastX=B.clientX,this._lastY=B.clientY,St();for(var e=document.elementFromPoint(B.clientX,B.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(B.clientX,B.clientY),e!==t);)t=e;if(f.parentNode[F]._isOutsideThisEl(e),t)do{if(t[F]){var o=void 0;if(o=t[F]._onDragOver({clientX:B.clientX,clientY:B.clientY,target:e,rootEl:t}),o&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Tt()}},_onTouchMove:function(e){if(re){var t=this.options,o=t.fallbackTolerance,i=t.fallbackOffset,r=e.touches?e.touches[0]:e,a=g&&le(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Be&&I&&pt(I),d=(r.clientX-re.clientX+i.x)/(l||1)+(u?u[0]-Ve[0]:0)/(l||1),c=(r.clientY-re.clientY+i.y)/(s||1)+(u?u[1]-Ve[1]:0)/(s||1);if(!p.active&&!ce){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(g){a?(a.e+=d-(qe||0),a.f+=c-($e||0)):a={a:1,b:0,c:0,d:1,e:d,f:c};var m="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(g,"webkitTransform",m),h(g,"mozTransform",m),h(g,"msTransform",m),h(g,"transform",m),qe=d,$e=c,B=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!g){var e=this.options.fallbackOnBody?document.body:_,t=C(f,!0,Be,!0,e),o=this.options;if(Be){for(I=e;h(I,"position")==="static"&&h(I,"transform")==="none"&&I!==document;)I=I.parentNode;I!==document.body&&I!==document.documentElement?(I===document&&(I=z()),t.top+=I.scrollTop,t.left+=I.scrollLeft):I=z(),Ve=pt(I)}g=f.cloneNode(!0),M(g,o.ghostClass,!1),M(g,o.fallbackClass,!0),M(g,o.dragClass,!0),h(g,"transition",""),h(g,"transform",""),h(g,"box-sizing","border-box"),h(g,"margin",0),h(g,"top",t.top),h(g,"left",t.left),h(g,"width",t.width),h(g,"height",t.height),h(g,"opacity","0.8"),h(g,"position",Be?"absolute":"fixed"),h(g,"zIndex","100000"),h(g,"pointerEvents","none"),p.ghost=g,e.appendChild(g),h(g,"transform-origin",bt/parseInt(g.style.width)*100+"% "+Et/parseInt(g.style.height)*100+"%")}},_onDragStart:function(e,t){var o=this,i=e.dataTransfer,r=o.options;if(N("dragStart",this,{evt:e}),p.eventCanceled){this._onDrop();return}N("setupClone",this),p.eventCanceled||(S=vt(f),S.draggable=!1,S.style["will-change"]="",this._hideClone(),M(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=Le(function(){N("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||_.insertBefore(S,f),o._hideClone(),P({sortable:o,name:"clone"}))}),!t&&M(f,r.dragClass,!0),t?(Me=!0,o._loopId=setInterval(o._emulateDragOver,50)):(b(document,"mouseup",o._onDrop),b(document,"touchend",o._onDrop),b(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,f)),E(document,"drop",o),h(f,"transform","translateZ(0)")),ce=!0,o._dragStartId=Le(o._dragStarted.bind(o,t,e)),E(document,"selectstart",o),De=!0,Ee&&h(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,o=e.target,i,r,a,l=this.options,s=l.group,u=p.active,d=xe===s,c=l.sort,m=O||u,y,v=this,w=!1;if(Ke)return;function k(ve,It){N(ve,v,W({evt:e,isOwner:d,axis:y?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:c,fromSortable:m,target:o,completed:A,onMove:function(at,At){return He(_,t,f,i,at,C(at),e,At)},changed:R},It))}function j(){k("dragOverAnimationCapture"),v.captureAnimationState(),v!==m&&m.captureAnimationState()}function A(ve){return k("dragOverCompleted",{insertion:ve}),ve&&(d?u._hideClone():u._showClone(v),v!==m&&(M(f,O?O.options.ghostClass:u.options.ghostClass,!1),M(f,l.ghostClass,!0)),O!==v&&v!==p.active?O=v:v===p.active&&O&&(O=null),m===v&&(v._ignoreWhileAnimating=o),v.animateAll(function(){k("dragOverAnimationComplete"),v._ignoreWhileAnimating=null}),v!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(o===f&&!f.animated||o===t&&!o.animated)&&(de=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(f.parentNode[F]._isOutsideThisEl(e.target),!ve&&ae(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),w=!0}function R(){X=Y(f),ee=Y(f,l.draggable),P({sortable:v,name:"change",toEl:t,newIndex:X,newDraggableIndex:ee,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=G(o,l.draggable,t,!0),k("dragOver"),p.eventCanceled)return w;if(f.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||v._ignoreWhileAnimating===o)return A(!1);if(Me=!1,u&&!l.disabled&&(d?c||(a=D!==_):O===this||(this.lastPutMode=xe.checkPull(this,u,f,e))&&s.checkPut(this,u,f,e))){if(y=this._getDirection(e,o)==="vertical",i=C(f),k("dragOverValid"),p.eventCanceled)return w;if(a)return D=_,j(),this._hideClone(),k("revert"),p.eventCanceled||(ie?_.insertBefore(f,ie):_.appendChild(f)),A(!0);var H=ze(t,l.draggable);if(!H||Zt(e,y,this)&&!H.animated){if(H===f)return A(!1);if(H&&t===e.target&&(o=H),o&&(r=C(o)),He(_,t,f,i,o,r,e,!!o)!==!1)return j(),t.appendChild(f),D=t,R(),A(!0)}else if(H&&Kt(e,y,this)){var te=se(t,0,l,!0);if(te===f)return A(!1);if(o=te,r=C(o),He(_,t,f,i,o,r,e,!1)!==!1)return j(),t.insertBefore(f,te),D=t,R(),A(!0)}else if(o.parentNode===t){r=C(o);var L=0,ne,he=f.parentNode!==t,x=!jt(f.animated&&f.toRect||i,o.animated&&o.toRect||r,y),pe=y?"top":"left",K=ht(o,"top","top")||ht(f,"top","top"),ge=K?K.scrollTop:void 0;de!==o&&(ne=r[pe],Te=!1,Xe=!x&&l.invertSwap||he),L=Qt(e,o,r,y,x?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Xe,de===o);var U;if(L!==0){var oe=Y(f);do oe-=L,U=D.children[oe];while(U&&(h(U,"display")==="none"||U===g))}if(L===0||U===o)return A(!1);de=o,Se=L;var me=o.nextElementSibling,Z=!1;Z=L===1;var Ie=He(_,t,f,i,o,r,e,Z);if(Ie!==!1)return(Ie===1||Ie===-1)&&(Z=Ie===1),Ke=!0,setTimeout(Vt,30),j(),Z&&!me?t.appendChild(f):o.parentNode.insertBefore(f,Z?me:o),K&&mt(K,0,ge-K.scrollTop),D=f.parentNode,ne!==void 0&&!Xe&&(Ye=Math.abs(ne-C(o)[pe])),R(),A(!0)}if(t.contains(f))return A(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",ae),b(document,"mousemove",ae),b(document,"touchmove",ae)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var t=this.el,o=this.options;if(X=Y(f),ee=Y(f,o.draggable),N("drop",this,{evt:e}),D=f&&f.parentNode,X=Y(f),ee=Y(f,o.draggable),p.eventCanceled){this._nulling();return}ce=!1,Xe=!1,Te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Qe(this.cloneId),Qe(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ee&&h(document.body,"user-select",""),h(f,"transform",""),e&&(De&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),g&&g.parentNode&&g.parentNode.removeChild(g),(_===D||O&&O.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),f&&(this.nativeDraggable&&b(f,"dragend",this),Ze(f),f.style["will-change"]="",De&&!ce&&M(f,O?O.options.ghostClass:this.options.ghostClass,!1),M(f,this.options.chosenClass,!1),P({sortable:this,name:"unchoose",toEl:D,newIndex:null,newDraggableIndex:null,originalEvent:e}),_!==D?(X>=0&&(P({rootEl:D,name:"add",toEl:D,fromEl:_,originalEvent:e}),P({sortable:this,name:"remove",toEl:D,originalEvent:e}),P({rootEl:D,name:"sort",toEl:D,fromEl:_,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),O&&O.save()):X!==fe&&X>=0&&(P({sortable:this,name:"update",toEl:D,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((X==null||X===-1)&&(X=fe,ee=_e),P({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){N("nulling",this),_=f=D=g=ie=S=Ne=J=re=B=De=X=ee=fe=_e=de=Se=O=xe=p.dragged=p.ghost=p.clone=p.active=null,ke.forEach(function(e){e.checked=!0}),ke.length=qe=$e=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":f&&(this._onDragOver(e),$t(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)t=o[i],G(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||en(t));return e},sort:function(e,t){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];G(l,this.options.draggable,i,!1)&&(o[r]=l)},this),t&&this.captureAnimationState(),e.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return G(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var o=this.options;if(t===void 0)return o[e];var i=ye.modifyOption(this,e,t);typeof i!="undefined"?o[e]=i:o[e]=t,e==="group"&&Dt(o)},destroy:function(){N("destroy",this);var e=this.el;e[F]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Fe.splice(Fe.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!J){if(N("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),J=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(J){if(N("showClone",this),p.eventCanceled)return;f.parentNode==_&&!this.options.group.revertClone?_.insertBefore(S,f):ie?_.insertBefore(S,ie):_.appendChild(S),this.options.group.revertClone&&this.animate(f,S),h(S,"display",""),J=!1}}};function $t(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function He(n,e,t,o,i,r,a,l){var s,u=n[F],d=u.options.onMove,c;return window.CustomEvent&&!V&&!be?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=n,s.dragged=t,s.draggedRect=o,s.related=i||e,s.relatedRect=r||C(e),s.willInsertAfter=l,s.originalEvent=a,n.dispatchEvent(s),d&&(c=d.call(u,s,a)),c}function Ze(n){n.draggable=!1}function Vt(){Ke=!1}function Kt(n,e,t){var o=C(se(t.el,0,t.options,!0)),i=10;return e?n.clientX<o.left-i||n.clientY<o.top&&n.clientX<o.right:n.clientY<o.top-i||n.clientY<o.bottom&&n.clientX<o.left}function Zt(n,e,t){var o=C(ze(t.el,t.options.draggable)),i=10;return e?n.clientX>o.right+i||n.clientX<=o.right&&n.clientY>o.bottom&&n.clientX>=o.left:n.clientX>o.right&&n.clientY>o.top||n.clientX<=o.right&&n.clientY>o.bottom+i}function Qt(n,e,t,o,i,r,a,l){var s=o?n.clientY:n.clientX,u=o?t.height:t.width,d=o?t.top:t.left,c=o?t.bottom:t.right,m=!1;if(!a){if(l&&Ye<u*i){if(!Te&&(Se===1?s>d+u*r/2:s<c-u*r/2)&&(Te=!0),Te)m=!0;else if(Se===1?s<d+Ye:s>c-Ye)return-Se}else if(s>d+u*(1-i)/2&&s<c-u*(1-i)/2)return Jt(e)}return m=m||a,m&&(s<d+u*r/2||s>c-u*r/2)?s>d+u/2?1:-1:0}function Jt(n){return Y(f)<Y(n)?1:-1}function en(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,o=0;t--;)o+=e.charCodeAt(t);return o.toString(36)}function tn(n){ke.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var o=e[t];o.checked&&ke.push(o)}}function Le(n){return setTimeout(n,0)}function Qe(n){return clearTimeout(n)}Re&&E(document,"touchmove",function(n){(p.active||ce)&&n.cancelable&&n.preventDefault()});p.utils={on:E,off:b,css:h,find:dt,is:function(e,t){return!!G(e,t,e,!1)},extend:kt,throttle:gt,closest:G,toggleClass:M,clone:vt,index:Y,nextTick:Le,cancelNextTick:Qe,detectDirection:_t,getChild:se};p.get=function(n){return n[F]};p.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(p.utils=W(W({},p.utils),o.utils)),ye.mount(o)})};p.create=function(n,e){return new p(n,e)};p.version=Mt;var T=[],Ce,Je,et=!1,tt,nt,We,Oe;function nn(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var o=t.originalEvent;this.sortable.nativeDraggable?E(document,"dragover",this._handleAutoScroll):this.options.supportPointer?E(document,"pointermove",this._handleFallbackAutoScroll):o.touches?E(document,"touchmove",this._handleFallbackAutoScroll):E(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var o=t.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?b(document,"dragover",this._handleAutoScroll):(b(document,"pointermove",this._handleFallbackAutoScroll),b(document,"touchmove",this._handleFallbackAutoScroll),b(document,"mousemove",this._handleFallbackAutoScroll)),Ct(),Ge(),Rt()},nulling:function(){We=Je=Ce=et=Oe=tt=nt=null,T.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,o){var i=this,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=document.elementFromPoint(r,a);if(We=t,o||this.options.forceAutoScrollFallback||be||V||Ee){ot(t,this.options,l,o);var s=Q(l,!0);et&&(!Oe||r!==tt||a!==nt)&&(Oe&&Ct(),Oe=setInterval(function(){var u=Q(document.elementFromPoint(r,a),!0);u!==s&&(s=u,Ge()),ot(t,i.options,u,o)},10),tt=r,nt=a)}else{if(!this.options.bubbleScroll||Q(l,!0)===z()){Ge();return}ot(t,this.options,Q(l,!1),!1)}}},q(n,{pluginName:"scroll",initializeByDefault:!0})}function Ge(){T.forEach(function(n){clearInterval(n.pid)}),T=[]}function Ct(){clearInterval(Oe)}var ot=gt(function(n,e,t,o){if(!!e.scroll){var i=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,s=z(),u=!1,d;Je!==t&&(Je=t,Ge(),Ce=e.scroll,d=e.scrollFn,Ce===!0&&(Ce=Q(t,!0)));var c=0,m=Ce;do{var y=m,v=C(y),w=v.top,k=v.bottom,j=v.left,A=v.right,R=v.width,H=v.height,te=void 0,L=void 0,ne=y.scrollWidth,he=y.scrollHeight,x=h(y),pe=y.scrollLeft,K=y.scrollTop;y===s?(te=R<ne&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),L=H<he&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(te=R<ne&&(x.overflowX==="auto"||x.overflowX==="scroll"),L=H<he&&(x.overflowY==="auto"||x.overflowY==="scroll"));var ge=te&&(Math.abs(A-i)<=a&&pe+R<ne)-(Math.abs(j-i)<=a&&!!pe),U=L&&(Math.abs(k-r)<=a&&K+H<he)-(Math.abs(w-r)<=a&&!!K);if(!T[c])for(var oe=0;oe<=c;oe++)T[oe]||(T[oe]={});(T[c].vx!=ge||T[c].vy!=U||T[c].el!==y)&&(T[c].el=y,T[c].vx=ge,T[c].vy=U,clearInterval(T[c].pid),(ge!=0||U!=0)&&(u=!0,T[c].pid=setInterval(function(){o&&this.layer===0&&p.active._onTouchMove(We);var me=T[this.layer].vy?T[this.layer].vy*l:0,Z=T[this.layer].vx?T[this.layer].vx*l:0;typeof d=="function"&&d.call(p.dragged.parentNode[F],Z,me,n,We,T[this.layer].el)!=="continue"||mt(T[this.layer].el,Z,me)}.bind({layer:c}),24))),c++}while(e.bubbleScroll&&m!==s&&(m=Q(m,!1)));et=u}},30),Ot=function(e){var t=e.originalEvent,o=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(!!t){var u=o||r;l();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);s(),u&&!u.el.contains(c)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function it(){}it.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=se(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),o&&o.animateAll()},drop:Ot};q(it,{pluginName:"revertOnSpill"});function rt(){}rt.prototype={onSpill:function(e){var t=e.dragEl,o=e.putSortable,i=o||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:Ot};q(rt,{pluginName:"removeOnSpill"});p.mount(new nn);p.mount(rt,it);export{p as S};