var He=Object.defineProperty;var At=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable;var ce=(o,t,n)=>t in o?He(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,jt=(o,t)=>{for(var n in t||(t={}))de.call(t,n)&&ce(o,n,t[n]);if(At)for(var n of At(t))he.call(t,n)&&ce(o,n,t[n]);return o};var pe=(o,t)=>{var n={};for(var e in o)de.call(o,e)&&t.indexOf(e)<0&&(n[e]=o[e]);if(o!=null&&At)for(var e of At(o))t.indexOf(e)<0&&he.call(o,e)&&(n[e]=o[e]);return n};import{i as We,a as Ge,b as Le}from"./index-Ceo5IWGU.js";import{bu as ee,aJ as ze,n as je}from"../jse/index-index-rerQU-kO.js";const $e=We?window.document:void 0;function Ue(o){var t;const n=ee(o);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function ge(o,t){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);t&&(e=e.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),n.push.apply(n,e)}return n}function z(o){for(var t=1;t=0)&&(n[i]=o[i]);return n}function Ke(o,t){if(o==null)return{};var n=Ve(o,t),e,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(o,e)&&(n[e]=o[e])}return n}var Ze="1.15.6";function U(o){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(o)}var V=U(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ct=U(/Edge/i),me=U(/firefox/i),wt=U(/safari/i)&&!U(/chrome/i)&&!U(/android/i),ae=U(/iP(ad|od|hone)/i),Se=U(/chrome/i)&&U(/android/i),Te={capture:!1,passive:!1};function b(o,t,n){o.addEventListener(t,n,!V&&Te)}function v(o,t,n){o.removeEventListener(t,n,!V&&Te)}function Bt(o,t){if(t){if(t[0]===">"&&(t=t.substring(1)),o)try{if(o.matches)return o.matches(t);if(o.msMatchesSelector)return o.msMatchesSelector(t);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(t)}catch(n){return!1}return!1}}function Ce(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function W(o,t,n,e){if(o){n=n||document;do{if(t!=null&&(t[0]===">"?o.parentNode===n&&Bt(o,t):Bt(o,t))||e&&o===n)return o;if(o===n)break}while(o=Ce(o))}return null}var ve=/\s+/g;function R(o,t,n){if(o&&t)if(o.classList)o.classList[n?"add":"remove"](t);else{var e=(" "+o.className+" ").replace(ve," ").replace(" "+t+" "," ");o.className=(e+(n?" "+t:"")).replace(ve," ")}}function h(o,t,n){var e=o&&o.style;if(e){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(n=o.currentStyle),t===void 0?n:n[t];!(t in e)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),e[t]=n+(typeof n=="string"?"":"px")}}function ct(o,t){var n="";if(typeof o=="string")n=o;else do{var e=h(o,"transform");e&&e!=="none"&&(n=e+" "+n)}while(!t&&(o=o.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Oe(o,t,n){if(o){var e=o.getElementsByTagName(t),i=0,r=e.length;if(n)for(;i=r,!a)return e;if(e===L())break;e=tt(e,!1)}return!1}function dt(o,t,n,e){for(var i=0,r=0,a=o.children;r2&&arguments[2]!==void 0?arguments[2]:{},i=e.evt,r=Ke(e,an);Ot.pluginEvent.bind(p)(t,n,z({dragEl:f,parentEl:S,ghostEl:g,rootEl:_,nextEl:at,lastDownEl:Rt,cloneEl:D,cloneHidden:Q,dragStarted:bt,putSortable:O,activeSortable:p.active,originalEvent:i,oldIndex:ft,oldDraggableIndex:Dt,newIndex:X,newDraggableIndex:J,hideGhostForTarget:Re,unhideGhostForTarget:Xe,cloneNowHidden:function(){Q=!0},cloneNowShown:function(){Q=!1},dispatchSortableEvent:function(l){P({sortable:n,name:l,originalEvent:i})}},r))};function P(o){rn(z({putSortable:O,cloneEl:D,targetEl:f,rootEl:_,oldIndex:ft,oldDraggableIndex:Dt,newIndex:X,newDraggableIndex:J},o))}var f,S,g,_,at,Rt,D,Q,ft,X,Dt,J,Pt,O,ut=!1,Ht=!1,Wt=[],it,H,qt,Vt,Ee,we,bt,st,St,Tt=!1,xt=!1,Xt,I,Kt=[],ne=!1,Gt=[],zt=typeof document!="undefined",Nt=ae,_e=Ct||V?"cssFloat":"float",ln=zt&&!Se&&!ae&&"draggable"in document.createElement("div"),Ne=function(){if(zt){if(V)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),Me=function(t,n){var e=h(t),i=parseInt(e.width)-parseInt(e.paddingLeft)-parseInt(e.paddingRight)-parseInt(e.borderLeftWidth)-parseInt(e.borderRightWidth),r=dt(t,0,n),a=dt(t,1,n),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(e.display==="flex")return e.flexDirection==="column"||e.flexDirection==="column-reverse"?"vertical":"horizontal";if(e.display==="grid")return e.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&&e[_e]==="none"||a&&e[_e]==="none"&&u+d>i)?"vertical":"horizontal"},sn=function(t,n,e){var i=e?t.left:t.top,r=e?t.right:t.bottom,a=e?t.width:t.height,l=e?n.left:n.top,s=e?n.right:n.bottom,u=e?n.width:n.height;return i===l||r===s||i+a/2===l+u/2},un=function(t,n){var e;return Wt.some(function(i){var r=i[N].options.emptyInsertThreshold;if(!(!r||le(i))){var a=C(i),l=t>=a.left-r&&t<=a.right+r,s=n>=a.top-r&&n<=a.bottom+r;if(l&&s)return e=i}}),e},Fe=function(t){function n(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 n(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 e={},i=t.group;(!i||Ft(i)!="object")&&(i={name:i}),e.name=i.name,e.checkPull=n(i.pull,!0),e.checkPut=n(i.put),e.revertClone=i.revertClone,t.group=e},Re=function(){!Ne&&g&&h(g,"display","none")},Xe=function(){!Ne&&g&&h(g,"display","")};zt&&!Se&&document.addEventListener("click",function(o){if(Ht)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Ht=!1,!1},!0);var rt=function(t){if(f){t=t.touches?t.touches[0]:t;var n=un(t.clientX,t.clientY);if(n){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.target=e.rootEl=n,e.preventDefault=void 0,e.stopPropagation=void 0,n[N]._onDragOver(e)}}},fn=function(t){f&&f.parentNode[N]._isOutsideThisEl(t.target)};function p(o,t){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=t=q({},t),o[N]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Me(o,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&&(!wt||ae),emptyInsertThreshold:5};Ot.initializePlugins(this,o,n);for(var e in n)!(e in t)&&(t[e]=n[e]);Fe(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:ln,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?b(o,"pointerdown",this._onTapStart):(b(o,"mousedown",this._onTapStart),b(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(b(o,"dragover",this),b(o,"dragenter",this)),Wt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),q(this,en())}p.prototype={constructor:p,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(st=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,f):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,e=this.el,i=this.options,r=i.preventOnFilter,a=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(l||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,d=i.filter;if(bn(e),!f&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&wt&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=W(s,i.draggable,e,!1),!(s&&s.animated)&&Rt!==s)){if(ft=Y(s),Dt=Y(s,i.draggable),typeof d=="function"){if(d.call(this,t,s,this)){P({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:e,fromEl:e}),x("filter",n,{evt:t}),r&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(c){if(c=W(u,c.trim(),e,!1),c)return P({sortable:n,rootEl:c,name:"filter",targetEl:s,fromEl:e,toEl:e}),x("filter",n,{evt:t}),!0}),d)){r&&t.preventDefault();return}i.handle&&!W(u,i.handle,e,!1)||this._prepareDragStart(t,l,s)}}},_prepareDragStart:function(t,n,e){var i=this,r=i.el,a=i.options,l=r.ownerDocument,s;if(e&&!f&&e.parentNode===r){var u=C(e);if(_=r,f=e,S=f.parentNode,at=f.nextSibling,Rt=e,Pt=a.group,p.dragged=f,it={target:f,clientX:(n||t).clientX,clientY:(n||t).clientY},Ee=it.clientX-u.left,we=it.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,f.style["will-change"]="all",s=function(){if(x("delayEnded",i,{evt:t}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!me&&i.nativeDraggable&&(f.draggable=!0),i._triggerDragStart(t,n),P({sortable:i,name:"choose",originalEvent:t}),R(f,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){Oe(f,d.trim(),Zt)}),b(l,"dragover",rt),b(l,"mousemove",rt),b(l,"touchmove",rt),a.supportPointer?(b(l,"pointerup",i._onDrop),!this.nativeDraggable&&b(l,"pointercancel",i._onDrop)):(b(l,"mouseup",i._onDrop),b(l,"touchend",i._onDrop),b(l,"touchcancel",i._onDrop)),me&&this.nativeDraggable&&(this.options.touchStartThreshold=4,f.draggable=!0),x("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Ct||V))){if(p.eventCanceled){this._onDrop();return}a.supportPointer?(b(l,"pointerup",i._disableDelayedDrag),b(l,"pointercancel",i._disableDelayedDrag)):(b(l,"mouseup",i._disableDelayedDrag),b(l,"touchend",i._disableDelayedDrag),b(l,"touchcancel",i._disableDelayedDrag)),b(l,"mousemove",i._delayedDragTouchMoveHandler),b(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&b(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;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(){f&&Zt(f),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;v(t,"mouseup",this._disableDelayedDrag),v(t,"touchend",this._disableDelayedDrag),v(t,"touchcancel",this._disableDelayedDrag),v(t,"pointerup",this._disableDelayedDrag),v(t,"pointercancel",this._disableDelayedDrag),v(t,"mousemove",this._delayedDragTouchMoveHandler),v(t,"touchmove",this._delayedDragTouchMoveHandler),v(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?b(document,"pointermove",this._onTouchMove):n?b(document,"touchmove",this._onTouchMove):b(document,"mousemove",this._onTouchMove):(b(f,"dragend",this),b(_,"dragstart",this._onDragStart));try{document.selection?Yt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(t,n){if(ut=!1,_&&f){x("dragStarted",this,{evt:n}),this.nativeDraggable&&b(document,"dragover",fn);var e=this.options;!t&&R(f,e.dragClass,!1),R(f,e.ghostClass,!0),p.active=this,t&&this._appendGhost(),P({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(H){this._lastX=H.clientX,this._lastY=H.clientY,Re();for(var t=document.elementFromPoint(H.clientX,H.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(H.clientX,H.clientY),t!==n);)n=t;if(f.parentNode[N]._isOutsideThisEl(t),n)do{if(n[N]){var e=void 0;if(e=n[N]._onDragOver({clientX:H.clientX,clientY:H.clientY,target:t,rootEl:n}),e&&!this.options.dragoverBubble)break}t=n}while(n=Ce(n));Xe()}},_onTouchMove:function(t){if(it){var n=this.options,e=n.fallbackTolerance,i=n.fallbackOffset,r=t.touches?t.touches[0]:t,a=g&&ct(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Nt&&I&&ye(I),d=(r.clientX-it.clientX+i.x)/(l||1)+(u?u[0]-Kt[0]:0)/(l||1),c=(r.clientY-it.clientY+i.y)/(s||1)+(u?u[1]-Kt[1]:0)/(s||1);if(!p.active&&!ut){if(e&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(P({rootEl:S,name:"add",toEl:S,fromEl:_,originalEvent:t}),P({sortable:this,name:"remove",toEl:S,originalEvent:t}),P({rootEl:S,name:"sort",toEl:S,fromEl:_,originalEvent:t}),P({sortable:this,name:"sort",toEl:S,originalEvent:t})),O&&O.save()):X!==ft&&X>=0&&(P({sortable:this,name:"update",toEl:S,originalEvent:t}),P({sortable:this,name:"sort",toEl:S,originalEvent:t})),p.active&&((X==null||X===-1)&&(X=ft,J=Dt),P({sortable:this,name:"end",toEl:S,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){x("nulling",this),_=f=S=g=at=D=Rt=Q=it=H=bt=X=J=ft=Dt=st=St=O=Pt=p.dragged=p.ghost=p.clone=p.active=null,Gt.forEach(function(t){t.checked=!0}),Gt.length=qt=Vt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":f&&(this._onDragOver(t),cn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,e=this.el.children,i=0,r=e.length,a=this.options;ii.right+r||o.clientY>e.bottom&&o.clientX>e.left:o.clientY>i.bottom+r||o.clientX>e.right&&o.clientY>e.top}function gn(o,t,n,e,i,r,a,l){var s=e?o.clientY:o.clientX,u=e?n.height:n.width,d=e?n.top:n.left,c=e?n.bottom:n.right,m=!1;if(!a){if(l&&Xtd+u*r/2:sc-Xt)return-St}else if(s>d+u*(1-i)/2&&sc-u*r/2)?s>d+u/2?1:-1:0}function mn(o){return Y(f){_n(t,c.oldIndex,c.newIndex,c)}},l=()=>{const c=typeof o=="string"?i==null?void 0:i.querySelector(o):Ue(o);!c||e!==void 0||(e=new p(c,jt(jt({},a),r)))},s=()=>{e==null||e.destroy(),e=void 0},u=(c,m)=>{if(m!==void 0)e==null||e.option(c,m);else return e==null?void 0:e.option(c)};return Ge(l),Le(s),{stop:s,start:l,option:u}}function En(o,t,n){const e=o.children[n];o.insertBefore(t,e)}function wn(o){o.parentNode&&o.parentNode.removeChild(o)}function _n(o,t,n,e=null){e!=null&&(wn(e.item),En(e.from,e.item,t));const i=ze(o),r=i?[...ee(o)]:ee(o);if(n>=0&&n{r.splice(n,0,a),i&&(o.value=r)})}}export{On as u};