123456 |
- import{B as Ee,a5 as ln,q as Mt,al as _t,K as Lt,_ as sn,E as Ke,V as un,o as Ze,x as cn,M as A,p as L,A as z,v as ce,N as yt,W as dn,z as ke,n as wt,t as fn,F as hn,C as Rt,a1 as pn,a2 as mn}from"./index.41f763da.js";import{u as gn}from"./hooks.8590c5d3.js";/**!
- * Sortable 1.14.0
- * @author RubaXa <trash@rubaxa.org>
- * @author owenm <owen23355@gmail.com>
- * @license MIT
- */function Et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function U(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(n),!0).forEach(function(o){vn(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Xe(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xe=function(e){return typeof e}:Xe=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xe(t)}function vn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z(){return Z=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Z.apply(this,arguments)}function bn(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function _n(t,e){if(t==null)return{};var n=bn(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(e.indexOf(o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,o)||(n[o]=t[o]))}return n}var yn="1.14.0";function K(t){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(t)}var Q=K(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pe=K(/Edge/i),Dt=K(/firefox/i),Ce=K(/safari/i)&&!K(/chrome/i)&&!K(/android/i),Bt=K(/iP(ad|od|hone)/i),wn=K(/chrome/i)&&K(/android/i),Xt={capture:!1,passive:!1};function _(t,e,n){t.addEventListener(e,n,!Q&&Xt)}function b(t,e,n){t.removeEventListener(e,n,!Q&&Xt)}function ze(t,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function En(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function j(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&ze(t,e):ze(t,e))||o&&t===n)return t;if(t===n)break}while(t=En(t))}return null}var St=/\s+/g;function k(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(St," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(St," ")}}function h(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function me(t,e){var n="";if(typeof t=="string")n=t;else do{var o=h(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function Yt(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function G(){var t=document.scrollingElement;return t||document.documentElement}function C(t,e,n,o,r){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,l,s,u,f,d;if(t!==window&&t.parentNode&&t!==G()?(i=t.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=i.right,f=i.height,d=i.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,f=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!Q))do if(r&&r.getBoundingClientRect&&(h(r,"transform")!=="none"||n&&h(r,"position")!=="static")){var g=r.getBoundingClientRect();a-=g.top+parseInt(h(r,"border-top-width")),l-=g.left+parseInt(h(r,"border-left-width")),s=a+i.height,u=l+i.width;break}while(r=r.parentNode);if(o&&t!==window){var w=me(r||t),v=w&&w.a,y=w&&w.d;w&&(a/=y,l/=v,d/=v,f/=y,s=a+f,u=l+d)}return{top:a,left:l,bottom:s,right:u,width:d,height:f}}}function xt(t,e,n){for(var o=oe(t,!0),r=C(t)[e];o;){var i=C(o)[n],a=void 0;if(n==="top"||n==="left"?a=r>=i:a=r<=i,!a)return o;if(o===G())break;o=oe(o,!1)}return!1}function ge(t,e,n,o){for(var r=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==p.ghost&&(o||a[i]!==p.dragged)&&j(a[i],n.draggable,t,!1)){if(r===e)return a[i];r++}i++}return null}function pt(t,e){for(var n=t.lastElementChild;n&&(n===p.ghost||h(n,"display")==="none"||e&&!ze(n,e));)n=n.previousElementSibling;return n||null}function B(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==p.clone&&(!e||ze(t,e))&&n++;return n}function Ct(t){var e=0,n=0,o=G();if(t)do{var r=me(t),i=r.a,a=r.d;e+=t.scrollLeft*i,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Dn(t,e){for(var n in t)if(!!t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function oe(t,e){if(!t||!t.getBoundingClientRect)return G();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=h(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return G();if(o||e)return n;o=!0}}while(n=n.parentNode);return G()}function Sn(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Qe(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Te;function Vt(t,e){return function(){if(!Te){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Te=setTimeout(function(){Te=void 0},e)}}}function xn(){clearTimeout(Te),Te=void 0}function Ht(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Wt(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var R="Sortable"+new Date().getTime();function Cn(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(h(r,"display")==="none"||r===p.ghost)){t.push({target:r,rect:C(r)});var i=U({},t[t.length-1].rect);if(r.thisAnimationDuration){var a=me(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Dn(t,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var i=!1,a=0;t.forEach(function(l){var s=0,u=l.target,f=u.fromRect,d=C(u),g=u.prevFromRect,w=u.prevToRect,v=l.rect,y=me(u,!0);y&&(d.top-=y.f,d.left-=y.e),u.toRect=d,u.thisAnimationDuration&&Qe(g,d)&&!Qe(f,d)&&(v.top-d.top)/(v.left-d.left)===(f.top-d.top)/(f.left-d.left)&&(s=In(v,g,w,r.options)),Qe(d,f)||(u.prevFromRect=f,u.prevToRect=d,s||(s=r.options.animation),r.animate(u,v,d,s)),s&&(i=!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),i?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,r,i,a){if(a){h(o,"transition",""),h(o,"transform","");var l=me(this.el),s=l&&l.a,u=l&&l.d,f=(r.left-i.left)/(s||1),d=(r.top-i.top)/(u||1);o.animatingX=!!f,o.animatingY=!!d,h(o,"transform","translate3d("+f+"px,"+d+"px,0)"),this.forRepaintDummy=Tn(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 Tn(t){return t.offsetWidth}function In(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var de=[],Je={initializeByDefault:!0},Ne={mount:function(e){for(var n in Je)Je.hasOwnProperty(n)&&!(n in e)&&(e[n]=Je[n]);de.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),de.push(e)},pluginEvent:function(e,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";de.forEach(function(a){!n[a.pluginName]||(n[a.pluginName][i]&&n[a.pluginName][i](U({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](U({sortable:n},o)))})},initializePlugins:function(e,n,o,r){de.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var u=new l(e,n,e.options);u.sortable=e,u.options=e.options,e[s]=u,Z(o,u.defaults)}});for(var i in e.options)if(!!e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a!="undefined"&&(e.options[i]=a)}},getEventProperties:function(e,n){var o={};return de.forEach(function(r){typeof r.eventProperties=="function"&&Z(o,r.eventProperties.call(n[r.pluginName],e))}),o},modifyOption:function(e,n,o){var r;return de.forEach(function(i){!e[i.pluginName]||i.optionListeners&&typeof i.optionListeners[n]=="function"&&(r=i.optionListeners[n].call(e[i.pluginName],o))}),r}};function On(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,u=t.newIndex,f=t.oldDraggableIndex,d=t.newDraggableIndex,g=t.originalEvent,w=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[R],!!e){var y,X=e.options,$="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!Q&&!Pe?y=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(o,!0,!0)),y.to=a||n,y.from=l||n,y.item=r||n,y.clone=i,y.oldIndex=s,y.newIndex=u,y.oldDraggableIndex=f,y.newDraggableIndex=d,y.originalEvent=g,y.pullMode=w?w.lastPutMode:void 0;var O=U(U({},v),Ne.getEventProperties(o,e));for(var Y in O)y[Y]=O[Y];n&&n.dispatchEvent(y),X[$]&&X[$].call(e,y)}}var An=["evt"],N=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=_n(o,An);Ne.pluginEvent.bind(p)(e,n,U({dragEl:c,parentEl:D,ghostEl:m,rootEl:E,nextEl:ue,lastDownEl:Ye,cloneEl:S,cloneHidden:ne,dragStarted:De,putSortable:T,activeSortable:p.active,originalEvent:r,oldIndex:pe,oldDraggableIndex:Ie,newIndex:M,newDraggableIndex:te,hideGhostForTarget:Ut,unhideGhostForTarget:$t,cloneNowHidden:function(){ne=!0},cloneNowShown:function(){ne=!1},dispatchSortableEvent:function(l){P({sortable:n,name:l,originalEvent:r})}},i))};function P(t){On(U({putSortable:T,cloneEl:S,targetEl:c,rootEl:E,oldIndex:pe,oldDraggableIndex:Ie,newIndex:M,newDraggableIndex:te},t))}var c,D,m,E,ue,Ye,S,ne,pe,M,Ie,te,Me,T,he=!1,je=!1,Ge=[],le,V,et,tt,Tt,It,De,fe,Oe,Ae=!1,Le=!1,Ve,I,nt=[],ut=!1,Ue=[],qe=typeof document!="undefined",Re=Bt,Ot=Pe||Q?"cssFloat":"float",Pn=qe&&!wn&&!Bt&&"draggable"in document.createElement("div"),zt=function(){if(!!qe){if(Q)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),jt=function(e,n){var o=h(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=ge(e,0,n),a=ge(e,1,n),l=i&&h(i),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(i).width,f=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(i&&l.float&&l.float!=="none"){var d=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===d)?"vertical":"horizontal"}return i&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=r&&o[Ot]==="none"||a&&o[Ot]==="none"&&u+f>r)?"vertical":"horizontal"},Nn=function(e,n,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,s=o?n.right:n.bottom,u=o?n.width:n.height;return r===l||i===s||r+a/2===l+u/2},Fn=function(e,n){var o;return Ge.some(function(r){var i=r[R].options.emptyInsertThreshold;if(!(!i||pt(r))){var a=C(r),l=e>=a.left-i&&e<=a.right+i,s=n>=a.top-i&&n<=a.bottom+i;if(l&&s)return o=r}}),o},Gt=function(e){function n(i,a){return function(l,s,u,f){var d=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(i==null&&(a||d))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return n(i(l,s,u,f),a)(l,s,u,f);var g=(a?l:s).options.group.name;return i===!0||typeof i=="string"&&i===g||i.join&&i.indexOf(g)>-1}}var o={},r=e.group;(!r||Xe(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=n(r.pull,!0),o.checkPut=n(r.put),o.revertClone=r.revertClone,e.group=o},Ut=function(){!zt&&m&&h(m,"display","none")},$t=function(){!zt&&m&&h(m,"display","")};qe&&document.addEventListener("click",function(t){if(je)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),je=!1,!1},!0);var se=function(e){if(c){e=e.touches?e.touches[0]:e;var n=Fn(e.clientX,e.clientY);if(n){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[R]._onDragOver(o)}}},kn=function(e){c&&c.parentNode[R]._isOutsideThisEl(e.target)};function p(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Z({},e),t[R]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return jt(t,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&&!Ce,emptyInsertThreshold:5};Ne.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);Gt(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:Pn,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?_(t,"pointerdown",this._onTapStart):(_(t,"mousedown",this._onTapStart),_(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(_(t,"dragover",this),_(t,"dragenter",this)),Ge.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Z(this,Cn())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(fe=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,c):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var n=this,o=this.el,r=this.options,i=r.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,f=r.filter;if(Hn(o),!c&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ce&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=j(s,r.draggable,o,!1),!(s&&s.animated)&&Ye!==s)){if(pe=B(s),Ie=B(s,r.draggable),typeof f=="function"){if(f.call(this,e,s,this)){P({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),N("filter",n,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(f&&(f=f.split(",").some(function(d){if(d=j(u,d.trim(),o,!1),d)return P({sortable:n,rootEl:d,name:"filter",targetEl:s,fromEl:o,toEl:o}),N("filter",n,{evt:e}),!0}),f)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!j(u,r.handle,o,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,n,o){var r=this,i=r.el,a=r.options,l=i.ownerDocument,s;if(o&&!c&&o.parentNode===i){var u=C(o);if(E=i,c=o,D=c.parentNode,ue=c.nextSibling,Ye=o,Me=a.group,p.dragged=c,le={target:c,clientX:(n||e).clientX,clientY:(n||e).clientY},Tt=le.clientX-u.left,It=le.clientY-u.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,c.style["will-change"]="all",s=function(){if(N("delayEnded",r,{evt:e}),p.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Dt&&r.nativeDraggable&&(c.draggable=!0),r._triggerDragStart(e,n),P({sortable:r,name:"choose",originalEvent:e}),k(c,a.chosenClass,!0)},a.ignore.split(",").forEach(function(f){Yt(c,f.trim(),ot)}),_(l,"dragover",se),_(l,"mousemove",se),_(l,"touchmove",se),_(l,"mouseup",r._onDrop),_(l,"touchend",r._onDrop),_(l,"touchcancel",r._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),N("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pe||Q))){if(p.eventCanceled){this._onDrop();return}_(l,"mouseup",r._disableDelayedDrag),_(l,"touchend",r._disableDelayedDrag),_(l,"touchcancel",r._disableDelayedDrag),_(l,"mousemove",r._delayedDragTouchMoveHandler),_(l,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&_(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){c&&ot(c),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,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?_(document,"pointermove",this._onTouchMove):n?_(document,"touchmove",this._onTouchMove):_(document,"mousemove",this._onTouchMove):(_(c,"dragend",this),_(E,"dragstart",this._onDragStart));try{document.selection?He(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(he=!1,E&&c){N("dragStarted",this,{evt:n}),this.nativeDraggable&&_(document,"dragover",kn);var o=this.options;!e&&k(c,o.dragClass,!1),k(c,o.ghostClass,!0),p.active=this,e&&this._appendGhost(),P({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(V){this._lastX=V.clientX,this._lastY=V.clientY,Ut();for(var e=document.elementFromPoint(V.clientX,V.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(V.clientX,V.clientY),e!==n);)n=e;if(c.parentNode[R]._isOutsideThisEl(e),n)do{if(n[R]){var o=void 0;if(o=n[R]._onDragOver({clientX:V.clientX,clientY:V.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);$t()}},_onTouchMove:function(e){if(le){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=e.touches?e.touches[0]:e,a=m&&me(m,!0),l=m&&a&&a.a,s=m&&a&&a.d,u=Re&&I&&Ct(I),f=(i.clientX-le.clientX+r.x)/(l||1)+(u?u[0]-nt[0]:0)/(l||1),d=(i.clientY-le.clientY+r.y)/(s||1)+(u?u[1]-nt[1]:0)/(s||1);if(!p.active&&!he){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(m){a?(a.e+=f-(et||0),a.f+=d-(tt||0)):a={a:1,b:0,c:0,d:1,e:f,f:d};var g="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(m,"webkitTransform",g),h(m,"mozTransform",g),h(m,"msTransform",g),h(m,"transform",g),et=f,tt=d,V=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!m){var e=this.options.fallbackOnBody?document.body:E,n=C(c,!0,Re,!0,e),o=this.options;if(Re){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=G()),n.top+=I.scrollTop,n.left+=I.scrollLeft):I=G(),nt=Ct(I)}m=c.cloneNode(!0),k(m,o.ghostClass,!1),k(m,o.fallbackClass,!0),k(m,o.dragClass,!0),h(m,"transition",""),h(m,"transform",""),h(m,"box-sizing","border-box"),h(m,"margin",0),h(m,"top",n.top),h(m,"left",n.left),h(m,"width",n.width),h(m,"height",n.height),h(m,"opacity","0.8"),h(m,"position",Re?"absolute":"fixed"),h(m,"zIndex","100000"),h(m,"pointerEvents","none"),p.ghost=m,e.appendChild(m),h(m,"transform-origin",Tt/parseInt(m.style.width)*100+"% "+It/parseInt(m.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,r=e.dataTransfer,i=o.options;if(N("dragStart",this,{evt:e}),p.eventCanceled){this._onDrop();return}N("setupClone",this),p.eventCanceled||(S=Wt(c),S.draggable=!1,S.style["will-change"]="",this._hideClone(),k(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=He(function(){N("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||E.insertBefore(S,c),o._hideClone(),P({sortable:o,name:"clone"}))}),!n&&k(c,i.dragClass,!0),n?(je=!0,o._loopId=setInterval(o._emulateDragOver,50)):(b(document,"mouseup",o._onDrop),b(document,"touchend",o._onDrop),b(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,c)),_(document,"drop",o),h(c,"transform","translateZ(0)")),he=!0,o._dragStartId=He(o._dragStarted.bind(o,n,e)),_(document,"selectstart",o),De=!0,Ce&&h(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,r,i,a,l=this.options,s=l.group,u=p.active,f=Me===s,d=l.sort,g=T||u,w,v=this,y=!1;if(ut)return;function X(we,rn){N(we,v,U({evt:e,isOwner:f,axis:w?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:d,fromSortable:g,target:o,completed:O,onMove:function(bt,an){return Be(E,n,c,r,bt,C(bt),e,an)},changed:Y},rn))}function $(){X("dragOverAnimationCapture"),v.captureAnimationState(),v!==g&&g.captureAnimationState()}function O(we){return X("dragOverCompleted",{insertion:we}),we&&(f?u._hideClone():u._showClone(v),v!==g&&(k(c,T?T.options.ghostClass:u.options.ghostClass,!1),k(c,l.ghostClass,!0)),T!==v&&v!==p.active?T=v:v===p.active&&T&&(T=null),g===v&&(v._ignoreWhileAnimating=o),v.animateAll(function(){X("dragOverAnimationComplete"),v._ignoreWhileAnimating=null}),v!==g&&(g.animateAll(),g._ignoreWhileAnimating=null)),(o===c&&!c.animated||o===n&&!o.animated)&&(fe=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(c.parentNode[R]._isOutsideThisEl(e.target),!we&&se(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),y=!0}function Y(){M=B(c),te=B(c,l.draggable),P({sortable:v,name:"change",toEl:n,newIndex:M,newDraggableIndex:te,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=j(o,l.draggable,n,!0),X("dragOver"),p.eventCanceled)return y;if(c.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||v._ignoreWhileAnimating===o)return O(!1);if(je=!1,u&&!l.disabled&&(f?d||(a=D!==E):T===this||(this.lastPutMode=Me.checkPull(this,u,c,e))&&s.checkPut(this,u,c,e))){if(w=this._getDirection(e,o)==="vertical",r=C(c),X("dragOverValid"),p.eventCanceled)return y;if(a)return D=E,$(),this._hideClone(),X("revert"),p.eventCanceled||(ue?E.insertBefore(c,ue):E.appendChild(c)),O(!0);var H=pt(n,l.draggable);if(!H||Bn(e,w,this)&&!H.animated){if(H===c)return O(!1);if(H&&n===e.target&&(o=H),o&&(i=C(o)),Be(E,n,c,r,o,i,e,!!o)!==!1)return $(),n.appendChild(c),D=n,Y(),O(!0)}else if(H&&Rn(e,w,this)){var re=ge(n,0,l,!0);if(re===c)return O(!1);if(o=re,i=C(o),Be(E,n,c,r,o,i,e,!1)!==!1)return $(),n.insertBefore(c,re),D=n,Y(),O(!0)}else if(o.parentNode===n){i=C(o);var W=0,ie,ve=c.parentNode!==n,F=!Nn(c.animated&&c.toRect||r,o.animated&&o.toRect||i,w),be=w?"top":"left",J=xt(o,"top","top")||xt(c,"top","top"),_e=J?J.scrollTop:void 0;fe!==o&&(ie=i[be],Ae=!1,Le=!F&&l.invertSwap||ve),W=Xn(e,o,i,w,F?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Le,fe===o);var q;if(W!==0){var ae=B(c);do ae-=W,q=D.children[ae];while(q&&(h(q,"display")==="none"||q===m))}if(W===0||q===o)return O(!1);fe=o,Oe=W;var ye=o.nextElementSibling,ee=!1;ee=W===1;var Fe=Be(E,n,c,r,o,i,e,ee);if(Fe!==!1)return(Fe===1||Fe===-1)&&(ee=Fe===1),ut=!0,setTimeout(Ln,30),$(),ee&&!ye?n.appendChild(c):o.parentNode.insertBefore(c,ee?ye:o),J&&Ht(J,0,_e-J.scrollTop),D=c.parentNode,ie!==void 0&&!Le&&(Ve=Math.abs(ie-C(o)[be])),Y(),O(!0)}if(n.contains(c))return O(!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",se),b(document,"mousemove",se),b(document,"touchmove",se)},_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 n=this.el,o=this.options;if(M=B(c),te=B(c,o.draggable),N("drop",this,{evt:e}),D=c&&c.parentNode,M=B(c),te=B(c,o.draggable),p.eventCanceled){this._nulling();return}he=!1,Le=!1,Ae=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ct(this.cloneId),ct(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ce&&h(document.body,"user-select",""),h(c,"transform",""),e&&(De&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),m&&m.parentNode&&m.parentNode.removeChild(m),(E===D||T&&T.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),c&&(this.nativeDraggable&&b(c,"dragend",this),ot(c),c.style["will-change"]="",De&&!he&&k(c,T?T.options.ghostClass:this.options.ghostClass,!1),k(c,this.options.chosenClass,!1),P({sortable:this,name:"unchoose",toEl:D,newIndex:null,newDraggableIndex:null,originalEvent:e}),E!==D?(M>=0&&(P({rootEl:D,name:"add",toEl:D,fromEl:E,originalEvent:e}),P({sortable:this,name:"remove",toEl:D,originalEvent:e}),P({rootEl:D,name:"sort",toEl:D,fromEl:E,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),T&&T.save()):M!==pe&&M>=0&&(P({sortable:this,name:"update",toEl:D,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((M==null||M===-1)&&(M=pe,te=Ie),P({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){N("nulling",this),E=c=D=m=ue=S=Ye=ne=le=V=De=M=te=pe=Ie=fe=Oe=T=Me=p.dragged=p.ghost=p.clone=p.active=null,Ue.forEach(function(e){e.checked=!0}),Ue.length=et=tt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":c&&(this._onDragOver(e),Mn(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,r=0,i=o.length,a=this.options;r<i;r++)n=o[r],j(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||Vn(n));return e},sort:function(e,n){var o={},r=this.el;this.toArray().forEach(function(i,a){var l=r.children[a];j(l,this.options.draggable,r,!1)&&(o[i]=l)},this),n&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return j(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var r=Ne.modifyOption(this,e,n);typeof r!="undefined"?o[e]=r:o[e]=n,e==="group"&&Gt(o)},destroy:function(){N("destroy",this);var e=this.el;e[R]=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(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ge.splice(Ge.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ne){if(N("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),ne=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ne){if(N("showClone",this),p.eventCanceled)return;c.parentNode==E&&!this.options.group.revertClone?E.insertBefore(S,c):ue?E.insertBefore(S,ue):E.appendChild(S),this.options.group.revertClone&&this.animate(c,S),h(S,"display",""),ne=!1}}};function Mn(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Be(t,e,n,o,r,i,a,l){var s,u=t[R],f=u.options.onMove,d;return window.CustomEvent&&!Q&&!Pe?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=r||e,s.relatedRect=i||C(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),f&&(d=f.call(u,s,a)),d}function ot(t){t.draggable=!1}function Ln(){ut=!1}function Rn(t,e,n){var o=C(ge(n.el,0,n.options,!0)),r=10;return e?t.clientX<o.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-r||t.clientY<o.bottom&&t.clientX<o.left}function Bn(t,e,n){var o=C(pt(n.el,n.options.draggable)),r=10;return e?t.clientX>o.right+r||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+r}function Xn(t,e,n,o,r,i,a,l){var s=o?t.clientY:t.clientX,u=o?n.height:n.width,f=o?n.top:n.left,d=o?n.bottom:n.right,g=!1;if(!a){if(l&&Ve<u*r){if(!Ae&&(Oe===1?s>f+u*i/2:s<d-u*i/2)&&(Ae=!0),Ae)g=!0;else if(Oe===1?s<f+Ve:s>d-Ve)return-Oe}else if(s>f+u*(1-r)/2&&s<d-u*(1-r)/2)return Yn(e)}return g=g||a,g&&(s<f+u*i/2||s>d-u*i/2)?s>f+u/2?1:-1:0}function Yn(t){return B(c)<B(t)?1:-1}function Vn(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Hn(t){Ue.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&Ue.push(o)}}function He(t){return setTimeout(t,0)}function ct(t){return clearTimeout(t)}qe&&_(document,"touchmove",function(t){(p.active||he)&&t.cancelable&&t.preventDefault()});p.utils={on:_,off:b,css:h,find:Yt,is:function(e,n){return!!j(e,n,e,!1)},extend:Sn,throttle:Vt,closest:j,toggleClass:k,clone:Wt,index:B,nextTick:He,cancelNextTick:ct,detectDirection:jt,getChild:ge};p.get=function(t){return t[R]};p.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];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=U(U({},p.utils),o.utils)),Ne.mount(o)})};p.create=function(t,e){return new p(t,e)};p.version=yn;var x=[],Se,dt,ft=!1,rt,it,$e,xe;function Wn(){function t(){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 t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?_(document,"dragover",this._handleAutoScroll):this.options.supportPointer?_(document,"pointermove",this._handleFallbackAutoScroll):o.touches?_(document,"touchmove",this._handleFallbackAutoScroll):_(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.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)),At(),We(),xn()},nulling:function(){$e=dt=Se=ft=xe=rt=it=null,x.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var r=this,i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(i,a);if($e=n,o||this.options.forceAutoScrollFallback||Pe||Q||Ce){at(n,this.options,l,o);var s=oe(l,!0);ft&&(!xe||i!==rt||a!==it)&&(xe&&At(),xe=setInterval(function(){var u=oe(document.elementFromPoint(i,a),!0);u!==s&&(s=u,We()),at(n,r.options,u,o)},10),rt=i,it=a)}else{if(!this.options.bubbleScroll||oe(l,!0)===G()){We();return}at(n,this.options,oe(l,!1),!1)}}},Z(t,{pluginName:"scroll",initializeByDefault:!0})}function We(){x.forEach(function(t){clearInterval(t.pid)}),x=[]}function At(){clearInterval(xe)}var at=Vt(function(t,e,n,o){if(!!e.scroll){var r=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,s=G(),u=!1,f;dt!==n&&(dt=n,We(),Se=e.scroll,f=e.scrollFn,Se===!0&&(Se=oe(n,!0)));var d=0,g=Se;do{var w=g,v=C(w),y=v.top,X=v.bottom,$=v.left,O=v.right,Y=v.width,H=v.height,re=void 0,W=void 0,ie=w.scrollWidth,ve=w.scrollHeight,F=h(w),be=w.scrollLeft,J=w.scrollTop;w===s?(re=Y<ie&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),W=H<ve&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(re=Y<ie&&(F.overflowX==="auto"||F.overflowX==="scroll"),W=H<ve&&(F.overflowY==="auto"||F.overflowY==="scroll"));var _e=re&&(Math.abs(O-r)<=a&&be+Y<ie)-(Math.abs($-r)<=a&&!!be),q=W&&(Math.abs(X-i)<=a&&J+H<ve)-(Math.abs(y-i)<=a&&!!J);if(!x[d])for(var ae=0;ae<=d;ae++)x[ae]||(x[ae]={});(x[d].vx!=_e||x[d].vy!=q||x[d].el!==w)&&(x[d].el=w,x[d].vx=_e,x[d].vy=q,clearInterval(x[d].pid),(_e!=0||q!=0)&&(u=!0,x[d].pid=setInterval(function(){o&&this.layer===0&&p.active._onTouchMove($e);var ye=x[this.layer].vy?x[this.layer].vy*l:0,ee=x[this.layer].vx?x[this.layer].vx*l:0;typeof f=="function"&&f.call(p.dragged.parentNode[R],ee,ye,t,$e,x[this.layer].el)!=="continue"||Ht(x[this.layer].el,ee,ye)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&g!==s&&(g=oe(g,!1)));ft=u}},30),qt=function(e){var n=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(!!n){var u=o||i;l();var f=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(f.clientX,f.clientY);s(),u&&!u.el.contains(d)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function mt(){}mt.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=ge(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:qt};Z(mt,{pluginName:"revertOnSpill"});function gt(){}gt.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:qt};Z(gt,{pluginName:"removeOnSpill"});p.mount(new Wn);p.mount(gt,mt);function lt(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Pt(t,e,n){const o=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function zn(){return typeof window!="undefined"?window.console:global.console}const jn=zn();function Gn(t){const e=Object.create(null);return function(o){return e[o]||(e[o]=t(o))}}const Un=/-(\w)/g,$n=Gn(t=>t.replace(Un,(e,n)=>n.toUpperCase())),Kt=["Start","Add","Remove","Update","End"],Zt=["Choose","Unchoose","Sort","Filter","Clone"],Qt=["Move"],qn=[Qt,Kt,Zt].flatMap(t=>t).map(t=>`on${t}`),ht={manage:Qt,manageAndEmit:Kt,emit:Zt};function Kn(t){return qn.indexOf(t)!==-1}const Zn=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function Qn(t){return Zn.includes(t)}function Jn(t){return["transition-group","TransitionGroup"].includes(t)}function Jt(t){return["id","class","role","style"].includes(t)||t.startsWith("data-")||t.startsWith("aria-")||t.startsWith("on")}function en(t){return t.reduce((e,[n,o])=>(e[n]=o,e),{})}function eo({$attrs:t,componentData:e={}}){return{...en(Object.entries(t).filter(([o,r])=>Jt(o))),...e}}function to({$attrs:t,callBackBuilder:e}){const n=en(tn(t));Object.entries(e).forEach(([r,i])=>{ht[r].forEach(a=>{n[`on${a}`]=i(a)})});const o=`[data-draggable]${n.draggable||""}`;return{...n,draggable:o}}function tn(t){return Object.entries(t).filter(([e,n])=>!Jt(e)).map(([e,n])=>[$n(e),n]).filter(([e,n])=>!Kn(e))}const Nt=({el:t})=>t,no=(t,e)=>t.__draggable_context=e,Ft=t=>t.__draggable_context;class oo{constructor({nodes:{header:e,default:n,footer:o},root:r,realList:i}){this.defaultNodes=n,this.children=[...e,...n,...o],this.externalComponent=r.externalComponent,this.rootTransition=r.transition,this.tag=r.tag,this.realList=i}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,n){const{tag:o,children:r,_isRootComponent:i}=this;return e(o,n,i?{default:()=>r}:r)}updated(){const{defaultNodes:e,realList:n}=this;e.forEach((o,r)=>{no(Nt(o),{element:n[r],index:r})})}getUnderlyingVm(e){return Ft(e)}getVmIndexFromDomIndex(e,n){const{defaultNodes:o}=this,{length:r}=o,i=n.children,a=i.item(e);if(a===null)return r;const l=Ft(a);if(l)return l.index;if(r===0)return 0;const s=Nt(o[0]),u=[...i].findIndex(f=>f===s);return e<u?0:r}}function ro(t,e){const n=t[e];return n?n():[]}function io({$slots:t,realList:e,getKey:n}){const o=e||[],[r,i]=["header","footer"].map(s=>ro(t,s)),{item:a}=t;if(!a)throw new Error("draggable element must have an item slot");const l=o.flatMap((s,u)=>a({element:s,index:u}).map(f=>(f.key=n(s),f.props={...f.props||{},"data-draggable":!0},f)));if(l.length!==o.length)throw new Error("Item slot must have only one child");return{header:r,footer:i,default:l}}function ao(t){const e=Jn(t),n=!Qn(t)&&!e;return{transition:e,externalComponent:n,tag:n?Ee(t):e?ln:t}}function lo({$slots:t,tag:e,realList:n,getKey:o}){const r=io({$slots:t,realList:n,getKey:o}),i=ao(e);return new oo({nodes:r,root:i,realList:n})}function nn(t,e){Lt(()=>this.$emit(t.toLowerCase(),e))}function on(t){return(e,n)=>{if(this.realList!==null)return this[`onDrag${t}`](e,n)}}function so(t){const e=on.call(this,t);return(n,o)=>{e.call(this,n,o),nn.call(this,t,n)}}let st=null;const uo={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},co=["update:modelValue","change",...[...ht.manageAndEmit,...ht.emit].map(t=>t.toLowerCase())],kt=Mt({name:"draggable",inheritAttrs:!1,props:uo,emits:co,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:t,$attrs:e,tag:n,componentData:o,realList:r,getKey:i}=this,a=lo({$slots:t,tag:n,realList:r,getKey:i});this.componentStructure=a;const l=eo({$attrs:e,componentData:o});return a.render(_t,l)}catch(t){return this.error=!0,_t("pre",{style:{color:"red"}},t.stack)}},created(){this.list!==null&&this.modelValue!==null&&jn.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted(){if(this.error)return;const{$attrs:t,$el:e,componentStructure:n}=this;n.updated();const o=to({$attrs:t,callBackBuilder:{manageAndEmit:i=>so.call(this,i),emit:i=>nn.bind(this,i),manage:i=>on.call(this,i)}}),r=e.nodeType===1?e:e.parentElement;this._sortable=new p(r,o),this.targetDomElement=r,r.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){const{list:t}=this;return t||this.modelValue},getKey(){const{itemKey:t}=this;return typeof t=="function"?t:e=>e[t]}},watch:{$attrs:{handler(t){const{_sortable:e}=this;!e||tn(t).forEach(([n,o])=>{e.option(n,o)})},deep:!0}},methods:{getUnderlyingVm(t){return this.componentStructure.getUnderlyingVm(t)||null},getUnderlyingPotencialDraggableComponent(t){return t.__draggable_component__},emitChanges(t){Lt(()=>this.$emit("change",t))},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=o=>o.splice(e,0,o.splice(t,1)[0]);this.alterList(n)},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const o=n.realList,r={list:o,component:n};return t!==e&&o?{...n.getUnderlyingVm(e)||{},...r}:r},getVmIndexFromDomIndex(t){return this.componentStructure.getVmIndexFromDomIndex(t,this.targetDomElement)},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),st=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;lt(t.item);const n=this.getVmIndexFromDomIndex(t.newIndex);this.spliceList(n,0,e);const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(Pt(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){lt(t.clone);return}const{index:e,element:n}=this.context;this.spliceList(e,1);const o={element:n,oldIndex:e};this.emitChanges({removed:o})},onDragUpdate(t){lt(t.item),Pt(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndexFromDomIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter(a=>a.style.display!=="none"),o=n.indexOf(e.related),r=t.component.getVmIndexFromDomIndex(o);return n.indexOf(st)!==-1||!e.willInsertAfter?r:r+1},onDragMove(t,e){const{move:n,realList:o}=this;if(!n||!o)return!0;const r=this.getRelatedContextFromMoveEvent(t),i=this.computeFutureIndex(r,t),a={...this.context,futureIndex:i},l={...t,relatedContext:r,draggedContext:a};return n(l,e)},onDragEnd(){st=null}}});const vt=t=>(pn("data-v-4e5619f6"),t=t(),mn(),t),fo={class:"card-header"},ho=Rt(" \u62D6\u62FD\u7EC4\u4EF6\uFF0C\u91C7\u7528\u5F00\u6E90\u7684 "),po=Rt(" vuedraggable "),mo={class:"drag-container"},go=vt(()=>L("div",{class:"card-header"},[L("span",null,"grid\u5217\u8868\u62D6\u62FD")],-1)),vo=vt(()=>L("div",{class:"card-header"},[L("span",null,"\u5355\u5217\u62D6\u62FD")],-1)),bo={class:"item-single"},_o=vt(()=>L("div",{class:"card-header"},[L("span",null,"\u62D6\u62FD\u5B9E\u73B0\u5143\u7D20\u4F4D\u7F6E\u5207\u6362")],-1)),yo={class:"cut-container"},wo={name:"Draggable"},Eo=Mt({...wo,setup(t){let e=Ke([{grid:"cn",num:1},{grid:"cn",num:2},{grid:"cn",num:3},{grid:"cn",num:4},{grid:"cn",num:5},{grid:"cn",num:6},{grid:"cn",num:7},{grid:"cn",num:8},{grid:"cn",num:9}]),n=Ke([{people:"cn",id:1,name:"www.itxst.com"},{people:"cn",id:2,name:"www.baidu.com"},{people:"cn",id:3,name:"www.taobao.com"},{people:"cn",id:4,name:"www.google.com"}]),o=Ke([{people:"cn",id:1,name:"cut1"},{people:"cn",id:2,name:"cut2"},{people:"cn",id:3,name:"cut3"},{people:"cn",id:4,name:"cut4"}]);const r=i=>{};return un(()=>{new Sortable(document.querySelector(".cut-container"),{swap:!0,forceFallback:!0,chosenClass:"chosen",swapClass:"highlight",animation:300})}),(i,a)=>{const l=Ee("el-link"),s=Ee("el-card"),u=Ee("el-col"),f=Ee("el-row");return Ze(),cn(s,null,{header:A(()=>[L("div",fo,[L("span",null,[ho,z(l,{href:"https://sortablejs.github.io/vue.draggable.next/#/simple",target:"_blank",icon:ce(gn)("rank"),style:{"font-size":"16px",margin:"0 4px 5px"}},{default:A(()=>[po]),_:1},8,["icon"])])])]),default:A(()=>[L("div",mo,[z(f,{gutter:25},{default:A(()=>[z(u,{xs:25,sm:8,md:8,lg:8},{default:A(()=>[z(s,null,{header:A(()=>[go]),default:A(()=>[z(ce(kt),{modelValue:ce(e),"onUpdate:modelValue":a[0]||(a[0]=d=>yt(e)?e.value=d:e=d),class:"grid-container","item-key":"grid",animation:"300",chosenClass:"chosen",forceFallback:"true"},{item:A(({element:d})=>[L("div",{class:dn("item item-"+d.num)},ke(d.num),3)]),_:1},8,["modelValue"])]),_:1})]),_:1}),z(u,{xs:25,sm:8,md:8,lg:8},{default:A(()=>[z(s,null,{header:A(()=>[vo]),default:A(()=>[z(ce(kt),{modelValue:ce(n),"onUpdate:modelValue":a[1]||(a[1]=d=>yt(n)?n.value=d:n=d),"item-key":"name",onChange:r,"chosen-class":"chosen","force-fallback":"true",animation:"300"},{item:A(({element:d,index:g})=>[L("div",bo,ke(d.name)+" "+ke(g),1)]),_:1},8,["modelValue"])]),_:1})]),_:1}),z(u,{xs:25,sm:8,md:8,lg:8},{default:A(()=>[z(s,null,{header:A(()=>[_o]),default:A(()=>[L("div",yo,[(Ze(!0),wt(hn,null,fn(ce(o),(d,g)=>(Ze(),wt("div",{class:"item-cut",key:g},[L("p",null,ke(d.name),1)]))),128))])]),_:1})]),_:1})]),_:1})])]),_:1})}}});var Co=sn(Eo,[["__scopeId","data-v-4e5619f6"]]);export{Co as default};
|