@pantograph/sortable 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var Gt=Object.defineProperty;var zt=(i,e,t)=>e in i?Gt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var q=(i,e,t)=>zt(i,typeof e!="symbol"?e+"":e,t);const Et="2.2.1";function oe(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}const re=oe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ae=oe(/Edge/i),mt=oe(/firefox/i),Ce=oe(/safari/i)&&!oe(/chrome/i)&&!oe(/android/i),ut=oe(/iP(ad|od|hone)/i),xt=oe(/chrome/i)&&oe(/android/i),Mt={capture:!1,passive:!1};function w(i,e,t){i.addEventListener(e,t,!re&&Mt)}function v(i,e,t){i.removeEventListener(e,t,!re&&Mt)}function $e(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function It(i){return i.host&&i!==document&&i.host.nodeType&&i.host!==i?i.host:i.parentNode}function R(i,e,t,n,o){if(i){t=t||document;do{if(!(o!=null&&o.some(r=>r===i))&&(e!=null&&(e[0]===">"?i.parentNode===t&&$e(i,e):$e(i,e))||n&&i===t))return i;if(i===t)break}while(i=It(i))}return null}const bt=/\s+/g;function I(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{let n=(" "+i.className+" ").replace(bt," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(bt," ")}}function p(i,e,t){let n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function Se(i,e){let t="";if(typeof i=="string")t=i;else do{let o=p(i,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!e&&(i=i.parentNode));const n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(t)}function lt(i,e,t){if(i){let n=i.getElementsByTagName(e),o=0,r=n.length;if(t)for(;o<r;o++)t(n[o],o);return n}return[]}function J(){let i=document.scrollingElement;return i||document.documentElement}function P(i,e,t,n,o){if(!i.getBoundingClientRect&&i!==window)return;let r,l,a,s,f,d,h;if(i!==window&&i.parentNode&&i!==J()?(r=i.getBoundingClientRect(),l=r.top,a=r.left,s=r.bottom,f=r.right,d=r.height,h=r.width):(l=0,a=0,s=window.innerHeight,f=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(e||t)&&i!==window&&(o=o||i.parentNode,!re))do if(o&&o.getBoundingClientRect&&(p(o,"transform")!=="none"||t&&p(o,"position")!=="static")){let m=o.getBoundingClientRect();l-=m.top+parseInt(p(o,"border-top-width")),a-=m.left+parseInt(p(o,"border-left-width")),s=l+r.height,f=a+r.width;break}while(o=o.parentNode);if(n&&i!==window){let m=Se(o||i),y=m&&m.a,u=m&&m.d;m&&(l/=u,a/=y,h/=y,d/=u,s=l+d,f=a+h)}return{top:l,left:a,bottom:s,right:f,width:h,height:d}}function vt(i,e,t){let n=fe(i,!0),o=P(i)[e];for(;n;){let r=P(n)[t],l;if(l=o>=r,!l)return n;if(n===J())break;n=fe(n,!1)}return!1}function be(i,e,t,n,o){let r=0,l=0,a=i.children;for(;l<a.length;){if(!(o!=null&&o.some(s=>s===a[l]))&&a[l].style.display!=="none"&&a[l]!==E.ghost&&(n||a[l]!==E.dragged)&&R(a[l],t.draggable,i,!1,o)){if(r===e)return a[l];r++}l++}return null}function pt(i,e){let t=i.lastElementChild;for(;t&&(t===E.ghost||p(t,"display")==="none"||e&&!$e(t,e));)t=t.previousElementSibling;return t||null}function k(i,e,t){let n=0;if(!i||!i.parentNode)return-1;for(;i=i.previousElementSibling;)i.nodeName.toUpperCase()!=="TEMPLATE"&&i!==E.clone&&(!e||$e(i,e))&&!(t!=null&&t.some(o=>o===i))&&n++;return n}function wt(i){let e=0,t=0,n=J();if(i)do{let o=Se(i),r=o.a,l=o.d;e+=i.scrollLeft*r,t+=i.scrollTop*l}while(i!==n&&(i=i.parentNode));return[e,t]}function $t(i,e){for(let t in i)if(i.hasOwnProperty(t)){for(let n in e)if(e.hasOwnProperty(n)&&e[n]===i[t][n])return Number(t)}return-1}function fe(i,e){if(!i||!i.getBoundingClientRect)return J();let t=i,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){let o=p(t);if(t.clientWidth<t.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return J();if(n||e)return t;n=!0}}while(t=t.parentNode);return J()}function Ot(i,e){if(i&&e)for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function Ze(i,e){return Math.round(i.top)===Math.round(e.top)&&Math.round(i.left)===Math.round(e.left)&&Math.round(i.height)===Math.round(e.height)&&Math.round(i.width)===Math.round(e.width)}let Me;function gt(i,e){return function(){if(!Me){let t=arguments,n=this;t.length===1?i.call(n,t[0]):i.apply(n,t),Me=setTimeout(function(){Me=void 0},e)}}}function jt(){clearTimeout(Me),Me=void 0}function At(i,e,t){i.scrollLeft+=e,i.scrollTop+=t}function at(i){let e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(i).cloneNode(!0):t?t(i).clone(!0)[0]:i.cloneNode(!0)}function Nt(i,e,t,n){const o={};return Array.from(i.children).forEach(r=>{if(!R(r,e.draggable,i,!1,n)||r.animated||r===t)return;const l=P(r);o.left=Math.min(o.left??1/0,l.left),o.top=Math.min(o.top??1/0,l.top),o.right=Math.max(o.right??-1/0,l.right),o.bottom=Math.max(o.bottom??-1/0,l.bottom)}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}const N="Sortable"+new Date().getTime();function Vt(){let i=[],e;return{captureAnimationState(){if(i=[],!this.options.animation)return;[].slice.call(this.el.children).forEach(n=>{if(p(n,"display")==="none"||n===E.ghost)return;i.push({target:n,rect:P(n)});let o={...i[i.length-1].rect};if(n.thisAnimationDuration){let r=Se(n,!0);r&&(o.top-=r.f,o.left-=r.e)}n.fromRect=o})},addAnimationState(t){i.push(t)},removeAnimationState(t){i.splice($t(i,{target:t}),1)},animateAll(t){if(!this.options.animation){clearTimeout(e),typeof t=="function"&&t();return}let n=!1,o=0;i.forEach(r=>{let l=0,a=r.target,s=a.fromRect,f=P(a),d=a.prevFromRect,h=a.prevToRect,m=r.rect,y=Se(a,!0);y&&(f.top-=y.f,f.left-=y.e),a.toRect=f,a.thisAnimationDuration&&Ze(d,f)&&!Ze(s,f)&&(m.top-f.top)/(m.left-f.left)===(s.top-f.top)/(s.left-f.left)&&(l=Ut(m,d,h,this.options)),Ze(f,s)||(a.prevFromRect=s,a.prevToRect=f,l||(l=this.options.animation),this.animate(a,m,f,l)),l&&(n=!0,o=Math.max(o,l),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},l),a.thisAnimationDuration=l)}),clearTimeout(e),n?e=setTimeout(function(){typeof t=="function"&&t()},o):typeof t=="function"&&t(),i=[]},animate(t,n,o,r){if(r){p(t,"transition",""),p(t,"transform","");let l=Se(this.el),a=l&&l.a,s=l&&l.d,f=(n.left-o.left)/(a||1),d=(n.top-o.top)/(s||1);t.animatingX=!!f,t.animatingY=!!d,p(t,"transform","translate3d("+f+"px,"+d+"px,0)"),this.forRepaintDummy=qt(t),p(t,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),p(t,"transform","translate3d(0,0,0)"),typeof t.animated=="number"&&clearTimeout(t.animated),t.animated=setTimeout(function(){p(t,"transition",""),p(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},r)}}}}function qt(i){return i.offsetWidth}function Ut(i,e,t,n){return Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}let ve=[];const Ke={initializeByDefault:!0},me={mount(i){for(let e in Ke)Ke.hasOwnProperty(e)&&!(e in i)&&(i[e]=Ke[e]);ve.some(e=>e.pluginName===i.pluginName)||ve.push(i)},pluginEvent(i,e,t){this.eventCanceled=!1,t.cancel=()=>{this.eventCanceled=!0};const n=i+"Global";ve.forEach(o=>{e[o.pluginName]&&(e[o.pluginName][n]&&e[o.pluginName][n]({sortable:e,...t}),e.options[o.pluginName]&&e[o.pluginName][i]&&e[o.pluginName][i]({sortable:e,...t}))})},initializePlugins(i,e,t,n){ve.forEach(o=>{const r=o.pluginName;if(!i.options[r]&&!o.initializeByDefault)return;let l=new o(i,e,i.options);l.sortable=i,l.options=i.options,i[r]=l,Object.assign(t,l.defaults)});for(let o in i.options){if(!i.options.hasOwnProperty(o))continue;let r=this.modifyOption(i,o,i.options[o]);typeof r<"u"&&(i.options[o]=r)}},getEventProperties(i,e){let t={};return ve.forEach(n=>{typeof n.eventProperties=="function"&&Object.assign(t,n.eventProperties.call(e[n.pluginName],i))}),t},modifyOption(i,e,t){let n;return ve.forEach(o=>{i[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(n=o.optionListeners[e].call(i[o.pluginName],t))}),n}};function Xt({sortable:i,rootEl:e,name:t,targetEl:n,cloneEl:o,toEl:r,fromEl:l,oldIndex:a,newIndex:s,oldDraggableIndex:f,newDraggableIndex:d,originalEvent:h,putSortable:m,extraEventProperties:y}){if(i=i||e&&e[N],!i)return;let u;window.CustomEvent&&!re&&!Ae?u=new CustomEvent(t,{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent(t,!0,!0)),u.to=r||e,u.from=l||e,u.item=n||e,u.clone=o,u.oldIndex=a,u.newIndex=s,u.oldDraggableIndex=f,u.newDraggableIndex=d,u.originalEvent=h,u.pullMode=m?m.lastPutMode:void 0;let X={...y,...me.getEventProperties(t,i)};for(let x in X)u[x]=X[x];return u}function Zt({sortable:i,rootEl:e,name:t,targetEl:n,cloneEl:o,toEl:r,fromEl:l,oldIndex:a,newIndex:s,oldDraggableIndex:f,newDraggableIndex:d,originalEvent:h,putSortable:m,extraEventProperties:y}){if(i=i||e&&e[N],!i)return;let u=i.options,X="on"+t.charAt(0).toUpperCase()+t.substr(1);const x=Xt({sortable:i,rootEl:e,name:t,targetEl:n,cloneEl:o,toEl:r,fromEl:l,oldIndex:a,newIndex:s,oldDraggableIndex:f,newDraggableIndex:d,originalEvent:h,putSortable:m,extraEventProperties:y});e&&e.dispatchEvent(x),u[X]&&u[X].call(i,x)}/**!
1
+ "use strict";var Gt=Object.defineProperty;var zt=(i,e,t)=>e in i?Gt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var q=(i,e,t)=>zt(i,typeof e!="symbol"?e+"":e,t);const Et="2.2.3";function oe(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}const re=oe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ae=oe(/Edge/i),mt=oe(/firefox/i),Ce=oe(/safari/i)&&!oe(/chrome/i)&&!oe(/android/i),ut=oe(/iP(ad|od|hone)/i),xt=oe(/chrome/i)&&oe(/android/i),Mt={capture:!1,passive:!1};function w(i,e,t){i.addEventListener(e,t,!re&&Mt)}function v(i,e,t){i.removeEventListener(e,t,!re&&Mt)}function $e(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function It(i){return i.host&&i!==document&&i.host.nodeType&&i.host!==i?i.host:i.parentNode}function R(i,e,t,n,o){if(i){t=t||document;do{if(!(o!=null&&o.some(r=>r===i))&&(e!=null&&(e[0]===">"?i.parentNode===t&&$e(i,e):$e(i,e))||n&&i===t))return i;if(i===t)break}while(i=It(i))}return null}const bt=/\s+/g;function I(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{let n=(" "+i.className+" ").replace(bt," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(bt," ")}}function p(i,e,t){let n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function Se(i,e){let t="";if(typeof i=="string")t=i;else do{let o=p(i,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!e&&(i=i.parentNode));const n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(t)}function lt(i,e,t){if(i){let n=i.getElementsByTagName(e),o=0,r=n.length;if(t)for(;o<r;o++)t(n[o],o);return n}return[]}function J(){let i=document.scrollingElement;return i||document.documentElement}function P(i,e,t,n,o){if(!i.getBoundingClientRect&&i!==window)return;let r,l,a,s,f,d,h;if(i!==window&&i.parentNode&&i!==J()?(r=i.getBoundingClientRect(),l=r.top,a=r.left,s=r.bottom,f=r.right,d=r.height,h=r.width):(l=0,a=0,s=window.innerHeight,f=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(e||t)&&i!==window&&(o=o||i.parentNode,!re))do if(o&&o.getBoundingClientRect&&(p(o,"transform")!=="none"||t&&p(o,"position")!=="static")){let m=o.getBoundingClientRect();l-=m.top+parseInt(p(o,"border-top-width")),a-=m.left+parseInt(p(o,"border-left-width")),s=l+r.height,f=a+r.width;break}while(o=o.parentNode);if(n&&i!==window){let m=Se(o||i),y=m&&m.a,u=m&&m.d;m&&(l/=u,a/=y,h/=y,d/=u,s=l+d,f=a+h)}return{top:l,left:a,bottom:s,right:f,width:h,height:d}}function vt(i,e,t){let n=fe(i,!0),o=P(i)[e];for(;n;){let r=P(n)[t],l;if(l=o>=r,!l)return n;if(n===J())break;n=fe(n,!1)}return!1}function be(i,e,t,n,o){let r=0,l=0,a=i.children;for(;l<a.length;){if(!(o!=null&&o.some(s=>s===a[l]))&&a[l].style.display!=="none"&&a[l]!==E.ghost&&(n||a[l]!==E.dragged)&&R(a[l],t.draggable,i,!1,o)){if(r===e)return a[l];r++}l++}return null}function pt(i,e){let t=i.lastElementChild;for(;t&&(t===E.ghost||p(t,"display")==="none"||e&&!$e(t,e));)t=t.previousElementSibling;return t||null}function k(i,e,t){let n=0;if(!i||!i.parentNode)return-1;for(;i=i.previousElementSibling;)i.nodeName.toUpperCase()!=="TEMPLATE"&&i!==E.clone&&(!e||$e(i,e))&&!(t!=null&&t.some(o=>o===i))&&n++;return n}function wt(i){let e=0,t=0,n=J();if(i)do{let o=Se(i),r=o.a,l=o.d;e+=i.scrollLeft*r,t+=i.scrollTop*l}while(i!==n&&(i=i.parentNode));return[e,t]}function $t(i,e){for(let t in i)if(i.hasOwnProperty(t)){for(let n in e)if(e.hasOwnProperty(n)&&e[n]===i[t][n])return Number(t)}return-1}function fe(i,e){if(!i||!i.getBoundingClientRect)return J();let t=i,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){let o=p(t);if(t.clientWidth<t.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return J();if(n||e)return t;n=!0}}while(t=t.parentNode);return J()}function Ot(i,e){if(i&&e)for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function Ze(i,e){return Math.round(i.top)===Math.round(e.top)&&Math.round(i.left)===Math.round(e.left)&&Math.round(i.height)===Math.round(e.height)&&Math.round(i.width)===Math.round(e.width)}let Me;function gt(i,e){return function(){if(!Me){let t=arguments,n=this;t.length===1?i.call(n,t[0]):i.apply(n,t),Me=setTimeout(function(){Me=void 0},e)}}}function jt(){clearTimeout(Me),Me=void 0}function At(i,e,t){i.scrollLeft+=e,i.scrollTop+=t}function at(i){let e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(i).cloneNode(!0):t?t(i).clone(!0)[0]:i.cloneNode(!0)}function Nt(i,e,t,n){const o={};return Array.from(i.children).forEach(r=>{if(!R(r,e.draggable,i,!1,n)||r.animated||r===t)return;const l=P(r);o.left=Math.min(o.left??1/0,l.left),o.top=Math.min(o.top??1/0,l.top),o.right=Math.max(o.right??-1/0,l.right),o.bottom=Math.max(o.bottom??-1/0,l.bottom)}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}const N="Sortable"+new Date().getTime();function Vt(){let i=[],e;return{captureAnimationState(){if(i=[],!this.options.animation)return;[].slice.call(this.el.children).forEach(n=>{if(p(n,"display")==="none"||n===E.ghost)return;i.push({target:n,rect:P(n)});let o={...i[i.length-1].rect};if(n.thisAnimationDuration){let r=Se(n,!0);r&&(o.top-=r.f,o.left-=r.e)}n.fromRect=o})},addAnimationState(t){i.push(t)},removeAnimationState(t){i.splice($t(i,{target:t}),1)},animateAll(t){if(!this.options.animation){clearTimeout(e),typeof t=="function"&&t();return}let n=!1,o=0;i.forEach(r=>{let l=0,a=r.target,s=a.fromRect,f=P(a),d=a.prevFromRect,h=a.prevToRect,m=r.rect,y=Se(a,!0);y&&(f.top-=y.f,f.left-=y.e),a.toRect=f,a.thisAnimationDuration&&Ze(d,f)&&!Ze(s,f)&&(m.top-f.top)/(m.left-f.left)===(s.top-f.top)/(s.left-f.left)&&(l=Ut(m,d,h,this.options)),Ze(f,s)||(a.prevFromRect=s,a.prevToRect=f,l||(l=this.options.animation),this.animate(a,m,f,l)),l&&(n=!0,o=Math.max(o,l),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},l),a.thisAnimationDuration=l)}),clearTimeout(e),n?e=setTimeout(function(){typeof t=="function"&&t()},o):typeof t=="function"&&t(),i=[]},animate(t,n,o,r){if(r){p(t,"transition",""),p(t,"transform","");let l=Se(this.el),a=l&&l.a,s=l&&l.d,f=(n.left-o.left)/(a||1),d=(n.top-o.top)/(s||1);t.animatingX=!!f,t.animatingY=!!d,p(t,"transform","translate3d("+f+"px,"+d+"px,0)"),this.forRepaintDummy=qt(t),p(t,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),p(t,"transform","translate3d(0,0,0)"),typeof t.animated=="number"&&clearTimeout(t.animated),t.animated=setTimeout(function(){p(t,"transition",""),p(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},r)}}}}function qt(i){return i.offsetWidth}function Ut(i,e,t,n){return Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}let ve=[];const Ke={initializeByDefault:!0},me={mount(i){for(let e in Ke)Ke.hasOwnProperty(e)&&!(e in i)&&(i[e]=Ke[e]);ve.some(e=>e.pluginName===i.pluginName)||ve.push(i)},pluginEvent(i,e,t){this.eventCanceled=!1,t.cancel=()=>{this.eventCanceled=!0};const n=i+"Global";ve.forEach(o=>{e[o.pluginName]&&(e[o.pluginName][n]&&e[o.pluginName][n]({sortable:e,...t}),e.options[o.pluginName]&&e[o.pluginName][i]&&e[o.pluginName][i]({sortable:e,...t}))})},initializePlugins(i,e,t,n){ve.forEach(o=>{const r=o.pluginName;if(!i.options[r]&&!o.initializeByDefault)return;let l=new o(i,e,i.options);l.sortable=i,l.options=i.options,i[r]=l,Object.assign(t,l.defaults)});for(let o in i.options){if(!i.options.hasOwnProperty(o))continue;let r=this.modifyOption(i,o,i.options[o]);typeof r<"u"&&(i.options[o]=r)}},getEventProperties(i,e){let t={};return ve.forEach(n=>{typeof n.eventProperties=="function"&&Object.assign(t,n.eventProperties.call(e[n.pluginName],i))}),t},modifyOption(i,e,t){let n;return ve.forEach(o=>{i[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(n=o.optionListeners[e].call(i[o.pluginName],t))}),n}};function Xt({sortable:i,rootEl:e,name:t,targetEl:n,cloneEl:o,toEl:r,fromEl:l,oldIndex:a,newIndex:s,oldDraggableIndex:f,newDraggableIndex:d,originalEvent:h,putSortable:m,extraEventProperties:y}){if(i=i||e&&e[N],!i)return;let u;window.CustomEvent&&!re&&!Ae?u=new CustomEvent(t,{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent(t,!0,!0)),u.to=r||e,u.from=l||e,u.item=n||e,u.clone=o,u.oldIndex=a,u.newIndex=s,u.oldDraggableIndex=f,u.newDraggableIndex=d,u.originalEvent=h,u.pullMode=m?m.lastPutMode:void 0;let L={...y,...me.getEventProperties(t,i)};for(let x in L)u[x]=L[x];return u}function Zt({sortable:i,rootEl:e,name:t,targetEl:n,cloneEl:o,toEl:r,fromEl:l,oldIndex:a,newIndex:s,oldDraggableIndex:f,newDraggableIndex:d,originalEvent:h,putSortable:m,extraEventProperties:y}){if(i=i||e&&e[N],!i)return;let u=i.options,L="on"+t.charAt(0).toUpperCase()+t.substr(1);const x=Xt({sortable:i,rootEl:e,name:t,targetEl:n,cloneEl:o,toEl:r,fromEl:l,oldIndex:a,newIndex:s,oldDraggableIndex:f,newDraggableIndex:d,originalEvent:h,putSortable:m,extraEventProperties:y});e&&e.dispatchEvent(x),u[L]&&u[L].call(i,x)}/**!
2
2
  * Sortable
3
3
  * @author Sedmedgh <sedmedgh@gmail.com>
4
4
  * @license MIT
5
- */let F=function(i,e,{evt:t,...n}={}){me.pluginEvent.bind(E)(i,e,{dragEl:c,originalDragEl:g,originalDragElDisplay:Re,parentEl:T,ghostEl:b,rootEl:D,nextEl:pe,lastDownEl:Be,cloneEl:_,cloneHidden:ce,dragStarted:Te,putSortable:A,activeSortable:E.active,originalEvent:t,oldIndex:ge,oldDraggableIndex:De,newIndex:G,newDraggableIndex:ne,hideGhostForTarget:kt,unhideGhostForTarget:Ft,cloneNowHidden(){ce=!0},cloneNowShown(){ce=!1},dispatchSortableEvent(o){Y({sortable:e,name:o,originalEvent:t})},...n})};function Y(i){Zt({putSortable:A,cloneEl:_,targetEl:g||c,rootEl:D,oldIndex:ge,oldDraggableIndex:De,newIndex:G,newDraggableIndex:ne,...i})}function yt(i){return Xt({putSortable:A,cloneEl:_,targetEl:g||c,rootEl:D,oldIndex:ge,oldDraggableIndex:De,newIndex:G,newDraggableIndex:ne,...i})}let c,g,Re,T,b,D,pe,Be,_,ce,ge,G,De,ne,Xe,A,ye=!1,je=!1,He=[],he,U,Qe,Je,St,Dt,Te,we,Ie,Oe=!1,Le=!1,We,L,et=[],st=!1,Ve=[];const Ue=typeof document<"u",ke=ut,_t=Ae||re?"cssFloat":"float",Kt=Ue&&!xt&&!ut&&"draggable"in document.createElement("div"),Lt=function(){if(!Ue)return;if(re)return!1;let i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}(),ct=function(i,e){let t=p(i),n=parseInt(t.width)-parseInt(t.paddingLeft)-parseInt(t.paddingRight)-parseInt(t.borderLeftWidth)-parseInt(t.borderRightWidth),o=be(i,0,e,!1,[g]),r=be(i,1,e,!1,[g]),l=o&&p(o),a=r&&p(r),s=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+P(o).width,f=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+P(r).width;if(t.display==="flex")return t.flexDirection==="column"||t.flexDirection==="column-reverse"?"vertical":"horizontal";if(t.display==="grid")return t.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&l.float&&l.float!=="none"){let d=l.float==="left"?"left":"right";return r&&(a.clear==="both"||a.clear===d)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||s>=n&&t[_t]==="none"||r&&t[_t]==="none"&&s+f>n)?"vertical":"horizontal"},Qt=function(i,e,t){let n=t?i.left:i.top,o=t?i.right:i.bottom,r=t?i.width:i.height,l=t?e.left:e.top,a=t?e.right:e.bottom,s=t?e.width:e.height;return n===l||o===a||n+r/2===l+s/2},Jt=function(i,e){let t;return He.some(n=>{const o=n[N].options.emptyInsertThreshold;if(!o||pt(n))return;const r=P(n),l=i>=r.left-o&&i<=r.right+o,a=e>=r.top-o&&e<=r.bottom+o;if(l&&a)return t=n}),t},Ct=function(i){function e(o,r){return function(l,a,s,f){let d=l.options.group.name&&a.options.group.name&&l.options.group.name===a.options.group.name;if(o==null&&(r||d))return!0;if(o==null||o===!1)return!1;if(r&&o==="clone")return o;if(typeof o=="function")return e(o(l,a,s,f),r)(l,a,s,f);{let h=(r?l:a).options.group.name;return o===!0||typeof o=="string"&&o===h||o.join&&o.indexOf(h)>-1}}}let t={},n=i.group;(!n||typeof n!="object")&&(n={name:n}),t.name=n.name,t.checkPull=e(n.pull,!0),t.checkPut=e(n.put),t.revertClone=n.revertClone,i.group=t},kt=function(){!Lt&&b&&p(b,"display","none")},Ft=function(){!Lt&&b&&p(b,"display","")};Ue&&!xt&&document.addEventListener("click",function(i){if(je)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),je=!1,!1},!0);let ue=function(i){if(c){i=i.touches?i.touches[0]:i;let e=Jt(i.clientX,i.clientY);if(e){let t={};for(let n in i)i.hasOwnProperty(n)&&(t[n]=i[n]);t.target=t.rootEl=e,t.preventDefault=void 0,t.stopPropagation=void 0,e[N]._onDragOver(t)}}},ei=function(i){c&&c.parentNode[N]._isOutsideThisEl(i.target)};const S=class S{constructor(e,t){q(this,"_ignoreWhileAnimating",null);if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Object.assign({},t),e[N]=this;let n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ct(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,getGhostFallback:void 0,getPlaceholder:void 0,getPlaceholderOnMove:void 0,tree:!1,treeItemLevelAttr:"data-level",treeIndentThreshold:10,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.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:S.supportPointer!==!1&&"PointerEvent"in window&&(!Ce||ut),emptyInsertThreshold:5};me.initializePlugins(this,e,n);for(let o in n)!(o in t)&&(t[o]=n[o]);Ct(t);for(let o of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:Kt,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),He.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Object.assign(this,Vt())}static get(e){return e[N]}static mount(...e){e[0].constructor===Array&&(e=e[0]),e.forEach(t=>{if(!t.prototype||!t.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(t)}`;t.utils&&(S.utils={...S.utils,...t.utils}),me.mount(t)})}static create(e,t){return new S(e,t)}_isOutsideThisEl(e){!this.el.contains(e)&&e!==this.el&&(we=null)}_getDirection(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,g||c):this.options.direction}_onTapStart(e){if(!e.cancelable)return;let t=this,n=this.el,o=this.options,r=o.preventOnFilter,l=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(a||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=o.filter;if(si(n),!c&&!(/mousedown|pointerdown/.test(l)&&e.button!==0||o.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Ce&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=R(s,o.draggable,n,!1,[g]),!(s&&s.animated)&&Be!==s)){if(ge=k(s,void 0,[g]),De=k(s,o.draggable,[g]),typeof d=="function"){if(d.call(this,e,s,this)){Y({sortable:t,rootEl:f,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),r&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(h){if(h=R(f,h.trim(),n,!1,[g]),h)return Y({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),d)){r&&e.preventDefault();return}o.handle&&!R(f,o.handle,n,!1,[g])||this._prepareDragStart(e,a,s)}}_prepareDragStart(e,t,n){let o=this,r=o.el,l=o.options,a=r.ownerDocument,s;if(n&&!c&&n.parentNode===r){let f=P(n);if(D=r,c=n,T=c.parentNode,pe=c.nextSibling,Be=n,Xe=l.group,S.dragged=c,he={target:c,clientX:(t||e).clientX,clientY:(t||e).clientY},St=he.clientX-f.left,Dt=he.clientY-f.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,c.style["will-change"]="all",s=function(){if(F("delayEnded",o,{evt:e}),S.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!mt&&o.nativeDraggable&&(c.draggable=!0),o._triggerDragStart(e,t),Y({sortable:o,name:"choose",originalEvent:e}),I(c,l.chosenClass,!0)},l.ignore.split(",").forEach(function(d){lt(c,d.trim(),tt)}),w(a,"dragover",ue),w(a,"mousemove",ue),w(a,"touchmove",ue),l.supportPointer?(w(a,"pointerup",o._onDrop),!this.nativeDraggable&&w(a,"pointercancel",o._onDrop)):(w(a,"mouseup",o._onDrop),w(a,"touchend",o._onDrop),w(a,"touchcancel",o._onDrop)),mt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),F("delayStart",this,{evt:e}),l.delay&&(!l.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ae||re))){if(S.eventCanceled){this._onDrop();return}l.supportPointer?(w(a,"pointerup",o._disableDelayedDrag),w(a,"pointercancel",o._disableDelayedDrag)):(w(a,"mouseup",o._disableDelayedDrag),w(a,"touchend",o._disableDelayedDrag),w(a,"touchcancel",o._disableDelayedDrag)),w(a,"mousemove",o._delayedDragTouchMoveHandler),w(a,"touchmove",o._delayedDragTouchMoveHandler),l.supportPointer&&w(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(s,l.delay)}else s()}}_delayedDragTouchMoveHandler(e){let 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(){c&&tt(c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()}_disableDelayedDragEvents(){let e=this.el.ownerDocument;v(e,"mouseup",this._disableDelayedDrag),v(e,"touchend",this._disableDelayedDrag),v(e,"touchcancel",this._disableDelayedDrag),v(e,"pointerup",this._disableDelayedDrag),v(e,"pointercancel",this._disableDelayedDrag),v(e,"mousemove",this._delayedDragTouchMoveHandler),v(e,"touchmove",this._delayedDragTouchMoveHandler),v(e,"pointermove",this._delayedDragTouchMoveHandler)}_triggerDragStart(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):t?w(document,"touchmove",this._onTouchMove):w(document,"mousemove",this._onTouchMove):(w(c,"dragend",this),w(D,"dragstart",this._onDragStart));try{document.selection?Pe(()=>{document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}}_getPlaceholder(e){if(typeof this.options.getPlaceholder=="function"){const t=this.options.getPlaceholder(yt({sortable:this,name:"getPlaceholder",originalEvent:e}));t&&(g=c,Re=c.style.display,c=t),c&&g&&(g.after(c),p(g,"display","none"),p(g,"transform",""),I(g,this.options.dragClass,!1),I(g,this.options.ghostClass,!1),I(g,this.options.chosenClass,!1)),F("getPlaceholder",this)}}_removeClonedSelectedItem(){(typeof this.options.getPlaceholder=="function"||typeof this.options.getPlaceholderOnMove=="function")&&c&&g&&(p(g,"display",Re||""),c.remove())}_replacePlaceholder(e){const t=c.parentNode;t?t.replaceChild(e,c):c.remove(),c=e}_getPlaceholderOnMove(e,t,n,o,r,l){if(typeof this.options.getPlaceholderOnMove=="function"){const a=this.options.getPlaceholderOnMove(Yt(D,e,g||c,t,n,o,r,l));a&&this._replacePlaceholder(a)}}_dragStarted(e,t){if(ye=!1,D&&c){this._getPlaceholder(t),F("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",ei);let n=this.options;!e&&I(c,n.dragClass,!1),I(c,n.ghostClass,!0),S.active=this,e&&this._appendGhost(),Y({sortable:this,name:"start",originalEvent:t})}else this._nulling()}_emulateDragOver(){if(U){this._lastX=U.clientX,this._lastY=U.clientY,kt();let e=document.elementFromPoint(U.clientX,U.clientY),t=e;for(;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(U.clientX,U.clientY),e!==t);)t=e;if(c.parentNode[N]._isOutsideThisEl(e),t)do{if(t[N]){let n;if(n=t[N]._onDragOver({clientX:U.clientX,clientY:U.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=It(t));Ft()}}_onTouchMove(e){if(he){let t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,r=e.touches?e.touches[0]:e,l=b&&Se(b,!0),a=b&&l&&l.a,s=b&&l&&l.d,f=ke&&L&&wt(L),d=(r.clientX-he.clientX+o.x)/(a||1)+(f?f[0]-et[0]:0)/(a||1),h=(r.clientY-he.clientY+o.y)/(s||1)+(f?f[1]-et[1]:0)/(s||1);if(!S.active&&!ye){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(b){l?(l.e+=d-(Qe||0),l.f+=h-(Je||0)):l={a:1,b:0,c:0,d:1,e:d,f:h};let m=`matrix(${l.a},${l.b},${l.c},${l.d},${l.e},${l.f})`;p(b,"webkitTransform",m),p(b,"mozTransform",m),p(b,"msTransform",m),p(b,"transform",m),Qe=d,Je=h,U=r}e.cancelable&&e.preventDefault()}}_appendGhost(){if(!b){let e=this.options.fallbackOnBody?document.body:D,t=P(c,!0,ke,!0,e),n=this.options;if(ke){for(L=e;p(L,"position")==="static"&&p(L,"transform")==="none"&&L!==document;)L=L.parentNode;L!==document.body&&L!==document.documentElement?(L===document&&(L=J()),t.top+=L.scrollTop,t.left+=L.scrollLeft):L=J(),et=wt(L)}b=this.options.getGhostFallback&&typeof this.options.getGhostFallback=="function"?this.options.getGhostFallback(yt({sortable:this,name:"getGhostFallback"})):c.cloneNode(!0),I(b,n.ghostClass,!1),I(b,n.fallbackClass,!0),I(b,n.dragClass,!0),p(b,"transition",""),p(b,"transform",""),p(b,"box-sizing","border-box"),p(b,"margin",0),p(b,"top",t.top),p(b,"left",t.left),p(b,"width",t.width),p(b,"height",t.height),p(b,"opacity","0.8"),p(b,"position",ke?"absolute":"fixed"),p(b,"zIndex","100000"),p(b,"pointerEvents","none"),S.ghost=b,e.appendChild(b),p(b,"transform-origin",St/parseInt(b.style.width)*100+"% "+Dt/parseInt(b.style.height)*100+"%")}}_onDragStart(e,t){let n=this,o=e.dataTransfer,r=n.options;if(F("dragStart",this,{evt:e}),S.eventCanceled){this._onDrop();return}F("setupClone",this),S.eventCanceled||(_=at(c),_.removeAttribute("id"),_.draggable=!1,_.style["will-change"]="",this._hideClone(),I(_,this.options.chosenClass,!1),S.clone=_),n.cloneId=Pe(function(){F("clone",n),!S.eventCanceled&&(n.options.removeCloneOnHide||D.insertBefore(_,c),n._hideClone(),Y({sortable:n,name:"clone"}))}),!t&&I(c,r.dragClass,!0),t?(je=!0,n._loopId=setInterval(n._emulateDragOver,50)):(v(document,"mouseup",n._onDrop),v(document,"touchend",n._onDrop),v(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",r.setData&&r.setData.call(n,o,c)),w(document,"drop",n),p(c,"transform","translateZ(0)")),ye=!0,n._dragStartId=Pe(n._dragStarted.bind(n,t,e)),w(document,"selectstart",n),Te=!0,window.getSelection().removeAllRanges(),Ce&&p(document.body,"user-select","none")}_onDragOver(e){let t=this.el,n=e.target,o,r,l,a=this.options,s=a.group,f=S.active,d=Xe===s,h=a.sort,m=A||f,y,u=this,X=!1;if(st)return;function x(C,O){F(C,u,{evt:e,isOwner:d,axis:y?"vertical":"horizontal",revert:l,dragRect:o,targetRect:r,canSort:h,fromSortable:m,target:n,completed:B,onMove(H,ee){return Fe(D,t,g||c,o,H,P(H),e,ee)},changed:$,...O})}function V(){x("dragOverAnimationCapture"),u.captureAnimationState(),u!==m&&m.captureAnimationState()}function B(C){return x("dragOverCompleted",{insertion:C}),C&&(d?f._hideClone():f._showClone(u),u!==m&&(I(c,A?A.options.ghostClass:f.options.ghostClass,!1),I(c,a.ghostClass,!0)),A!==u&&u!==S.active?A=u:u===S.active&&A&&(A=null),m===u&&(u._ignoreWhileAnimating=n),u.animateAll(function(){x("dragOverAnimationComplete"),u._ignoreWhileAnimating=null}),u!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(n===c&&!c.animated||n===t&&!n.animated)&&(we=null),!a.dragoverBubble&&!e.rootEl&&n!==document&&(c.parentNode[N]._isOutsideThisEl(e.target),!C&&ue(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),X=!0}function $(){G=k(c,void 0,[g]),ne=k(c,a.draggable,[g]),Y({sortable:u,name:"change",toEl:t,newIndex:G,newDraggableIndex:ne,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=R(n,a.draggable,t,!0,[g]),x("dragOver"),S.eventCanceled)return X;if(c.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||u._ignoreWhileAnimating===n)return B(!1);if(je=!1,f&&!a.disabled&&(d?h||(l=T!==D):A===this||(this.lastPutMode=Xe.checkPull(this,f,g||c,e))&&s.checkPut(this,f,g||c,e))){if(y=this._getDirection(e,n)==="vertical",o=P(c),x("dragOverValid"),S.eventCanceled)return X;if(l)return T=D,V(),this._hideClone(),x("revert"),S.eventCanceled||(pe?D.insertBefore(c,pe):D.appendChild(c)),B(!0);let C=pt(t,a.draggable);if(!C||oi(e,y,this)&&!C.animated){if(C===c)return B(!1);if(C&&t===e.target&&(n=C),n&&(r=P(n)),Fe(D,t,g||c,o,n,r,e,!!n)!==!1)return V(),this._getPlaceholderOnMove(t,o,n,r,e,!!n),C&&C.nextSibling?t.insertBefore(c,C.nextSibling):t.appendChild(c),T=t,$(),B(!0)}else if(C&&ni(e,y,this)){let O=be(t,0,a,!0,[g]);if(O===c)return B(!1);if(n=O,r=P(n),Fe(D,t,g||c,o,n,r,e,!1)!==!1)return this._getPlaceholderOnMove(t,o,n,r,e,!1),V(),t.insertBefore(c,O),T=t,$(),B(!0)}else if(n.parentNode===t){r=P(n);let O=0,H,ee=c.parentNode!==t,de=!Qt(c.animated&&c.toRect||o,n.animated&&n.toRect||r,y),z=y?"top":"left",le=vt(n,"top","top")||vt(c,"top","top"),Ne=le?le.scrollTop:void 0;we!==n&&(H=r[z],Oe=!1,Le=!de&&a.invertSwap||ee),O=ri(e,n,r,y,de?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Le,we===n);let te;if(O!==0){let ae=k(c,void 0,[g]);do ae-=O,te=T.children[ae];while(te&&(p(te,"display")==="none"||te===b))}if(O===0||te===n)return B(!1);we=n,Ie=O;let K=!1;K=O===1;let j=Fe(D,t,g||c,o,n,r,e,K);if(j!==!1){(j===1||j===-1)&&(K=j===1),st=!0,setTimeout(ii,30),V(),this._getPlaceholderOnMove(t,o,n,r,e,K);let ae=n.nextElementSibling;return K&&!ae?t.appendChild(c):n.parentNode.insertBefore(c,K?ae:n),le&&At(le,0,Ne-le.scrollTop),T=c.parentNode,H!==void 0&&!Le&&(We=Math.abs(H-P(n)[z])),$(),B(!0)}}if(t.contains(c))return B(!1)}return!1}_offMoveEvents(){v(document,"mousemove",this._onTouchMove),v(document,"touchmove",this._onTouchMove),v(document,"pointermove",this._onTouchMove),v(document,"dragover",ue),v(document,"mousemove",ue),v(document,"touchmove",ue)}_offUpEvents(){let e=this.el.ownerDocument;v(e,"mouseup",this._onDrop),v(e,"touchend",this._onDrop),v(e,"pointerup",this._onDrop),v(e,"pointercancel",this._onDrop),v(e,"touchcancel",this._onDrop),v(document,"selectstart",this)}_onDrop(e){let t=this.el,n=this.options;if(G=k(c,void 0,[g]),ne=k(c,n.draggable,[g]),F("drop",this,{evt:e}),T=c&&c.parentNode,G=k(c,void 0,[g]),ne=k(c,n.draggable,[g]),S.eventCanceled){this._nulling();return}ye=!1,Le=!1,Oe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ge(this.cloneId),Ge(this._dragStartId),this.nativeDraggable&&(v(document,"drop",this),v(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ce&&p(document.body,"user-select",""),p(c,"transform",""),e&&(Te&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),b&&b.parentNode&&b.parentNode.removeChild(b),(D===T||A&&A.lastPutMode!=="clone")&&_&&_.parentNode&&_.parentNode.removeChild(_),c&&(this.nativeDraggable&&v(c,"dragend",this),tt(c),c.style["will-change"]="",Te&&!ye&&I(c,A?A.options.ghostClass:this.options.ghostClass,!1),I(c,this.options.chosenClass,!1),Y({sortable:this,name:"unchoose",toEl:T,newIndex:null,newDraggableIndex:null,originalEvent:e}),D!==T?(G>=0&&(Y({rootEl:T,name:"add",toEl:T,fromEl:D,originalEvent:e}),Y({sortable:this,name:"remove",toEl:T,originalEvent:e}),Y({rootEl:T,name:"sort",toEl:T,fromEl:D,originalEvent:e}),Y({sortable:this,name:"sort",toEl:T,originalEvent:e})),A&&A.save()):G!==ge&&G>=0&&(Y({sortable:this,name:"update",toEl:T,originalEvent:e}),Y({sortable:this,name:"sort",toEl:T,originalEvent:e})),S.active&&((G==null||G===-1)&&(G=ge,ne=De),Y({sortable:this,name:"end",toEl:T,originalEvent:e}),this.save()))),this._nulling()}_nulling(){F("nulling",this),this._removeClonedSelectedItem(),D=c=g=Re=T=b=pe=_=Be=ce=he=U=Te=G=ne=ge=De=we=Ie=A=Xe=S.dragged=S.ghost=S.clone=S.active=null;let e=this.el;Ve.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Ve.length=Qe=Je=0}handleEvent(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":c&&(this._onDragOver(e),ti(e));break;case"selectstart":e.preventDefault();break}}toArray(){let e=[],t,n=this.el.children,o=0,r=n.length,l=this.options;for(;o<r;o++)t=n[o],R(t,l.draggable,this.el,!1,[g])&&e.push(t.getAttribute(l.dataIdAttr)||ai(t));return e}sort(e,t){let n={},o=this.el;this.toArray().forEach(function(r,l){let a=o.children[l];R(a,this.options.draggable,o,!1,[g])&&(n[r]=a)},this),t&&this.captureAnimationState(),e.forEach(function(r){n[r]&&(o.removeChild(n[r]),o.appendChild(n[r]))}),t&&this.animateAll()}save(){let e=this.options.store;e&&e.set&&e.set(this)}closest(e,t){return R(e,t||this.options.draggable,this.el,!1,[g])}option(e,t){let n=this.options;if(t===void 0)return n[e];{let o=me.modifyOption(this,e,t);typeof o<"u"?n[e]=o:n[e]=t,e==="group"&&Ct(n)}}destroy(){F("destroy",this);let e=this.el;e[N]=null,v(e,"mousedown",this._onTapStart),v(e,"touchstart",this._onTapStart),v(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(v(e,"dragover",this),v(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),He.splice(He.indexOf(this.el),1),this.el=e=null}_hideClone(){if(!ce){if(F("hideClone",this),S.eventCanceled)return;p(_,"display","none"),this.options.removeCloneOnHide&&_.parentNode&&_.parentNode.removeChild(_),ce=!0}}_showClone(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ce){if(F("showClone",this),S.eventCanceled)return;typeof this.options.getPlaceholder!="function"&&typeof this.options.getPlaceholderOnMove!="function"&&(c.parentNode==D&&!this.options.group.revertClone?D.insertBefore(_,c):pe?D.insertBefore(_,pe):D.appendChild(_)),this.options.group.revertClone&&this.animate(c,_),p(_,"display",""),ce=!1}}};q(S,"utils",{on:w,off:v,css:p,find:lt,is:function(e,t){return!!R(e,t,e,!1,[g])},extend:Ot,throttle:gt,closest:R,toggleClass:I,clone:at,index:k,nextTick:Pe,cancelNextTick:Ge,detectDirection:ct,getChild:be,expando:N}),q(S,"version",Et);let E=S;function ti(i){i.dataTransfer&&(i.dataTransfer.dropEffect="move"),i.cancelable&&i.preventDefault()}const Yt=(i,e,t,n,o,r,l,a)=>{let s;window.CustomEvent&&!re&&!Ae?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=i,s.dragged=t,s.draggedRect=n,s.related=o||e,s.relatedRect=r||P(e),s.willInsertAfter=a,s.originalEvent=l;const f=i[N];if(f){let d={...me.getEventProperties("move",f)};for(let h in d)s[h]=d[h]}return s};function Fe(i,e,t,n,o,r,l,a){let s=i[N],f=s.options.onMove,d;const h=Yt(i,e,t,n,o,r,l,a);return i.dispatchEvent(h),f&&(d=f.call(s,h)),d}function tt(i){i.draggable=!1}function ii(){st=!1}function ni(i,e,t){let n=P(be(t.el,0,t.options,!0,[g]));const o=Nt(t.el,t.options,b,[g]),r=10;return e?i.clientX<o.left-r||i.clientY<n.top&&i.clientX<n.right:i.clientY<o.top-r||i.clientY<n.bottom&&i.clientX<n.left}function oi(i,e,t){const n=P(pt(t.el,t.options.draggable)),o=Nt(t.el,t.options,b,[g]),r=10;return e?i.clientX>o.right+r||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>o.bottom+r||i.clientX>n.right&&i.clientY>n.top}function ri(i,e,t,n,o,r,l,a){let s=n?i.clientY:i.clientX,f=n?t.height:t.width,d=n?t.top:t.left,h=n?t.bottom:t.right,m=!1;if(!l){if(a&&We<f*o){if(!Oe&&(Ie===1?s>d+f*r/2:s<h-f*r/2)&&(Oe=!0),Oe)m=!0;else if(Ie===1?s<d+We:s>h-We)return-Ie}else if(s>d+f*(1-o)/2&&s<h-f*(1-o)/2)return li(e)}return m=m||l,m&&(s<d+f*r/2||s>h-f*r/2)?s>d+f/2?1:-1:0}function li(i){return k(c,void 0,[g])<k(i,void 0,[g])?1:-1}function ai(i){let e=i.tagName+i.className+i.src+i.href+i.textContent,t=e.length,n=0;for(;t--;)n+=e.charCodeAt(t);return n.toString(36)}function si(i){Ve.length=0;let e=i.getElementsByTagName("input"),t=e.length;for(;t--;){let n=e[t];n.checked&&Ve.push(n)}}function Pe(i){return setTimeout(i,0)}function Ge(i){return clearTimeout(i)}Ue&&w(document,"touchmove",function(i){(E.active||ye)&&i.cancelable&&i.preventDefault()});E.utils={on:w,off:v,css:p,find:lt,is:function(i,e){return!!R(i,e,i,!1,[g])},extend:Ot,throttle:gt,closest:R,toggleClass:I,clone:at,index:k,nextTick:Pe,cancelNextTick:Ge,detectDirection:ct,getChild:be,expando:N};E.get=function(i){return i[N]};E.mount=function(...i){i[0].constructor===Array&&(i=i[0]),i.forEach(e=>{if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(E.utils={...E.utils,...e.utils}),me.mount(e)})};E.create=function(i,e){return new E(i,e)};E.version=Et;let ie,_e,Ye;class Rt{static eventProperties(){const e={swapItem:ie};return Ye!==void 0&&(e.newIndex=Ye),e}constructor(e){this.sortable=e,this.options=e.options,this.defaults={swapClass:"sortable-swap-highlight"};for(let t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}dragStart({dragEl:e}){this.setLastSwapEl(e)}getPlaceholder({originalDragEl:e}){_e=e}dragOverValid({completed:e,target:t,onMove:n,activeSortable:o,changed:r,cancel:l}){if(!o.options.swap)return;let a=this.sortable.el,s=this.options;if(t&&t!==a){let f=ie;n(t)!==!1?(I(t,s.swapClass,!0),this.setLastSwapEl(t)):this.setLastSwapEl(null),f&&f!==ie&&I(f,s.swapClass,!1)}r(),e(!0),l()}setLastSwapEl(e){ie=e;const t=e==null?void 0:e.parentNode;let n=-1;t&&e&&typeof this.options.getPlaceholder=="function"&&(n=k(e,this.options.draggable,[_e])),n>-1?Ye=n:Ye=void 0}swapNodes(e,t,n,o){var r;if(typeof n.options.getPlaceholder!="function"&&typeof((r=o==null?void 0:o.options)==null?void 0:r.getPlaceholder)!="function"){let l=e.parentNode,a=t.parentNode,s,f;if(!l||!a||l.isEqualNode(t)||a.isEqualNode(e))return;s=k(e,this.options.draggable,[_e]),f=k(t,this.options.draggable,[_e]),l.isEqualNode(a)&&s<f&&f++,l.insertBefore(t,l.children[s]),a.insertBefore(e,a.children[f])}}drop({activeSortable:e,putSortable:t,dragEl:n,...o}){let r=t||this.sortable,l=this.options;ie&&I(ie,l.swapClass,!1),ie&&(l.swap||t&&t.options.swap)&&n!==ie&&(r.captureAnimationState(),r!==e&&e.captureAnimationState(),this.swapNodes(n,ie,e,t),r.animateAll(),r!==e&&e.animateAll())}nulling(){this.setLastSwapEl(null),_e=null}}q(Rt,"pluginName","swap");let se,Q,W,Z;class Bt{static eventProperties(){const e={};return se!==void 0&&(e.draggedTreeItemParent=se),Q!==void 0&&(e.draggedTreeItemLevel=Q),W!==void 0&&(e.draggedTreeItemBefore=W),Z!==void 0&&(e.draggedTreeItemAfter=Z),e}constructor(e){this.sortable=e,this.options=e.options,this.startX=0,this.startLevel=1,this.beforeElement=null}mount(){this.options.tree}dragStarted({originalEvent:e,dragEl:t,originalDragEl:n,sortable:o}){this.options.tree&&(this.startX=e.clientX,this.startLevel=it(n||t,this.options),Q=this.startLevel,this._getDraggedTreeItemParent(t,n,o))}_findPrevSibling(e,t,n=void 0){let o=e.previousElementSibling;const r=this.options.treeItemLevelAttr||"data-level";for(;o;){const l=R(o,this.options.draggable,this.sortable.el,!1,[t]);if(l&&(typeof n=="number"&&l.getAttribute(r)===n.toString()||n===void 0))return l;o=o.previousElementSibling}return null}_findNextSibling(e,t){let n=e.nextElementSibling;for(;n;){const o=R(n,this.options.draggable,this.sortable.el,!1,[t]);if(o)return o;n=n.nextElementSibling}return null}_getDraggedTreeItemParent(e,t,n){se=this._findPrevSibling(e,t,Q-1)??n.el}dragOver({axis:e,originalEvent:t,dragEl:n,originalDragEl:o,sortable:r,fromSortable:l,onMove:a,ghostEl:s,changed:f,...d}){var C,O;if(!this.options.tree||e==="vertical")return;const h=t.clientX-this.startX,m=this.options.treeIndentThreshold||10,y=this.options.treeItemLevelAttr||"data-level";W=this._findPrevSibling(n,o),Z=this._findNextSibling(n,o);const u=W?it(W,this.options):1,X=Z?it(Z,this.options):1;W&&(W.level=u),Z&&(Z.level=X);let x=1,V=1;W&&Z?(x=Math.min(u+1,X),u>=X&&(x=Math.min(x,u)),V=Math.max(u+1,X)):Z?x=V=1:(x=1,V=u+1);const B=Math.floor(h/m),$=Math.max(x,Math.min(V,this.startLevel+B));if($!==Q||this.beforeElement!==W||r!==l){this.removeDragPrent(),this.beforeElement=W,Q=$,this._getDraggedTreeItemParent(n,o,r);const H=W||Z||this.sortable.el,ee=P(H);a(H,!!W)!==!1&&(o&&!(typeof this.options.getPlaceholder=="function"||typeof this.options.getPlaceholderOnMove=="function")&&o.setAttribute(y,Q),(C=n==null?void 0:n.setAttribute)==null||C.call(n,y,Q),(O=s==null?void 0:s.setAttribute)==null||O.call(s,y,Q),$>1&&se&&se.setAttribute("data-drag-parent","true"),this.sortable._getPlaceholderOnMove(this.sortable.el,P(n),H,ee,t,!!W),f())}}drop(e){this.options.tree}removeDragPrent(){se&&se.removeAttribute("data-drag-parent"),se=null}nulling(){this.removeDragPrent(),this.startX=0,this.startLevel=1,Q=W=Z=void 0}}q(Bt,"pluginName","tree");function it(i,e){const t=e.treeItemLevelAttr||"data-level";return parseInt(i.getAttribute(t))||1}let Tt;class Ht{constructor(e){q(this,"startIndex",null);this.sortable=e,this.options=e.options}dragStart({oldDraggableIndex:e}){this.startIndex=e}getPlaceholder({originalDragEl:e}){Tt=e}onSpill({dragEl:e,putSortable:t}){this.sortable.captureAnimationState(),t&&t.captureAnimationState();let n=be(this.sortable.el,this.startIndex,this.options,[Tt]);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),t&&t.animateAll()}drop({originalEvent:e,putSortable:t,dragEl:n,activeSortable:o,dispatchSortableEvent:r,hideGhostForTarget:l,unhideGhostForTarget:a}){if(!e)return;let s=t||o;l();let f=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(f.clientX,f.clientY);a(),s&&!s.el.contains(d)&&(r("spill"),this.onSpill({dragEl:n,putSortable:t}))}}q(Ht,"pluginName","revertOnSpill");class Wt{constructor(e){this.sortable=e,this.options=e.options}onSpill({dragEl:e,putSortable:t}){const n=t||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()}drop({originalEvent:e,putSortable:t,dragEl:n,activeSortable:o,dispatchSortableEvent:r,hideGhostForTarget:l,unhideGhostForTarget:a}){if(!e)return;let s=t||o;l();let f=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(f.clientX,f.clientY);a(),s&&!s.el.contains(d)&&(r("spill"),this.onSpill({dragEl:n,putSortable:t}))}}q(Wt,"pluginName","removeOnSpill");let M=[],Ee,ft,dt=!1,nt,ot,qe,xe;class ht{constructor(e){this.sortable=e,this.options=e.options,this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(let t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}dragStarted({originalEvent:e}){this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):e.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)}dragOverCompleted({originalEvent:e}){!this.options.dragOverBubble&&!e.rootEl&&this._handleAutoScroll(e)}drop(){this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):(v(document,"pointermove",this._handleFallbackAutoScroll),v(document,"touchmove",this._handleFallbackAutoScroll),v(document,"mousemove",this._handleFallbackAutoScroll)),Pt(),ze(),jt()}nulling(){qe=ft=Ee=dt=xe=nt=ot=null,M.length=0}_handleFallbackAutoScroll(e){this._handleAutoScroll(e,!0)}_handleAutoScroll(e,t){const n=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(n,o);if(qe=e,t||this.options.forceAutoScrollFallback||Ae||re||Ce){rt(e,this.options,r,t);let l=fe(r,!0);dt&&(!xe||n!==nt||o!==ot)&&(xe&&Pt(),xe=setInterval(()=>{let a=fe(document.elementFromPoint(n,o),!0);a!==l&&(l=a,ze()),rt(e,this.options,a,t)},10),nt=n,ot=o)}else{if(!this.options.bubbleScroll||fe(r,!0)===J()){ze();return}rt(e,this.options,fe(r,!1),!1)}}}q(ht,"pluginName","scroll"),q(ht,"initializeByDefault",!0);function ze(){M.forEach(function(i){clearInterval(i.pid)}),M=[]}function Pt(){clearInterval(xe)}const rt=gt(function(i,e,t,n){if(!e.scroll)return;const o=(i.touches?i.touches[0]:i).clientX,r=(i.touches?i.touches[0]:i).clientY,l=e.scrollSensitivity,a=e.scrollSpeed,s=J();let f=!1,d;ft!==t&&(ft=t,ze(),Ee=e.scroll,d=e.scrollFn,Ee===!0&&(Ee=fe(t,!0)));let h=0,m=Ee;do{let y=m,u=P(y),X=u.top,x=u.bottom,V=u.left,B=u.right,$=u.width,C=u.height,O,H,ee=y.scrollWidth,de=y.scrollHeight,z=p(y),le=y.scrollLeft,Ne=y.scrollTop;y===s?(O=$<ee&&(z.overflowX==="auto"||z.overflowX==="scroll"||z.overflowX==="visible"),H=C<de&&(z.overflowY==="auto"||z.overflowY==="scroll"||z.overflowY==="visible")):(O=$<ee&&(z.overflowX==="auto"||z.overflowX==="scroll"),H=C<de&&(z.overflowY==="auto"||z.overflowY==="scroll"));let te=O&&(Math.abs(B-o)<=l&&le+$<ee)-(Math.abs(V-o)<=l&&!!le),K=H&&(Math.abs(x-r)<=l&&Ne+C<de)-(Math.abs(X-r)<=l&&!!Ne);if(!M[h])for(let j=0;j<=h;j++)M[j]||(M[j]={});(M[h].vx!=te||M[h].vy!=K||M[h].el!==y)&&(M[h].el=y,M[h].vx=te,M[h].vy=K,clearInterval(M[h].pid),(te!=0||K!=0)&&(f=!0,M[h].pid=setInterval((function(){n&&this.layer===0&&E.active._onTouchMove(qe);let j=M[this.layer].vy?M[this.layer].vy*a:0,ae=M[this.layer].vx?M[this.layer].vx*a:0;typeof d=="function"&&d.call(E.dragged.parentNode[N],ae,j,i,qe,M[this.layer].el)!=="continue"||At(M[this.layer].el,ae,j)}).bind({layer:h}),24))),h++}while(e.bubbleScroll&&m!==s&&(m=fe(m,!1)));dt=f},30);E.mount(ht,Wt,Ht,Bt,Rt);module.exports=E;
5
+ */let F=function(i,e,{evt:t,...n}={}){me.pluginEvent.bind(E)(i,e,{dragEl:c,originalDragEl:g,originalDragElDisplay:Re,parentEl:T,ghostEl:b,rootEl:D,nextEl:pe,lastDownEl:Be,cloneEl:_,cloneHidden:ce,dragStarted:Te,putSortable:A,activeSortable:E.active,originalEvent:t,oldIndex:ge,oldDraggableIndex:De,newIndex:G,newDraggableIndex:ne,hideGhostForTarget:kt,unhideGhostForTarget:Ft,cloneNowHidden(){ce=!0},cloneNowShown(){ce=!1},dispatchSortableEvent(o){Y({sortable:e,name:o,originalEvent:t})},...n})};function Y(i){Zt({putSortable:A,cloneEl:_,targetEl:g||c,rootEl:D,oldIndex:ge,oldDraggableIndex:De,newIndex:G,newDraggableIndex:ne,...i})}function yt(i){return Xt({putSortable:A,cloneEl:_,targetEl:g||c,rootEl:D,oldIndex:ge,oldDraggableIndex:De,newIndex:G,newDraggableIndex:ne,...i})}let c,g,Re,T,b,D,pe,Be,_,ce,ge,G,De,ne,Xe,A,ye=!1,je=!1,He=[],he,U,Qe,Je,St,Dt,Te,we,Ie,Oe=!1,Le=!1,We,X,et=[],st=!1,Ve=[];const Ue=typeof document<"u",ke=ut,_t=Ae||re?"cssFloat":"float",Kt=Ue&&!xt&&!ut&&"draggable"in document.createElement("div"),Lt=function(){if(!Ue)return;if(re)return!1;let i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}(),ct=function(i,e){let t=p(i),n=parseInt(t.width)-parseInt(t.paddingLeft)-parseInt(t.paddingRight)-parseInt(t.borderLeftWidth)-parseInt(t.borderRightWidth),o=be(i,0,e,!1,[g]),r=be(i,1,e,!1,[g]),l=o&&p(o),a=r&&p(r),s=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+P(o).width,f=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+P(r).width;if(t.display==="flex")return t.flexDirection==="column"||t.flexDirection==="column-reverse"?"vertical":"horizontal";if(t.display==="grid")return t.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&l.float&&l.float!=="none"){let d=l.float==="left"?"left":"right";return r&&(a.clear==="both"||a.clear===d)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||s>=n&&t[_t]==="none"||r&&t[_t]==="none"&&s+f>n)?"vertical":"horizontal"},Qt=function(i,e,t){let n=t?i.left:i.top,o=t?i.right:i.bottom,r=t?i.width:i.height,l=t?e.left:e.top,a=t?e.right:e.bottom,s=t?e.width:e.height;return n===l||o===a||n+r/2===l+s/2},Jt=function(i,e){let t;return He.some(n=>{const o=n[N].options.emptyInsertThreshold;if(!o||pt(n))return;const r=P(n),l=i>=r.left-o&&i<=r.right+o,a=e>=r.top-o&&e<=r.bottom+o;if(l&&a)return t=n}),t},Ct=function(i){function e(o,r){return function(l,a,s,f){let d=l.options.group.name&&a.options.group.name&&l.options.group.name===a.options.group.name;if(o==null&&(r||d))return!0;if(o==null||o===!1)return!1;if(r&&o==="clone")return o;if(typeof o=="function")return e(o(l,a,s,f),r)(l,a,s,f);{let h=(r?l:a).options.group.name;return o===!0||typeof o=="string"&&o===h||o.join&&o.indexOf(h)>-1}}}let t={},n=i.group;(!n||typeof n!="object")&&(n={name:n}),t.name=n.name,t.checkPull=e(n.pull,!0),t.checkPut=e(n.put),t.revertClone=n.revertClone,i.group=t},kt=function(){!Lt&&b&&p(b,"display","none")},Ft=function(){!Lt&&b&&p(b,"display","")};Ue&&!xt&&document.addEventListener("click",function(i){if(je)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),je=!1,!1},!0);let ue=function(i){if(c){i=i.touches?i.touches[0]:i;let e=Jt(i.clientX,i.clientY);if(e){let t={};for(let n in i)i.hasOwnProperty(n)&&(t[n]=i[n]);t.target=t.rootEl=e,t.preventDefault=void 0,t.stopPropagation=void 0,e[N]._onDragOver(t)}}},ei=function(i){c&&c.parentNode[N]._isOutsideThisEl(i.target)};const S=class S{constructor(e,t){q(this,"_ignoreWhileAnimating",null);if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Object.assign({},t),e[N]=this;let n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ct(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,getGhostFallback:void 0,getPlaceholder:void 0,getPlaceholderOnMove:void 0,tree:!1,treeItemLevelAttr:"data-level",treeIndentThreshold:10,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.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:S.supportPointer!==!1&&"PointerEvent"in window&&(!Ce||ut),emptyInsertThreshold:5};me.initializePlugins(this,e,n);for(let o in n)!(o in t)&&(t[o]=n[o]);Ct(t);for(let o of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:Kt,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),He.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Object.assign(this,Vt())}static get(e){return e[N]}static mount(...e){e[0].constructor===Array&&(e=e[0]),e.forEach(t=>{if(!t.prototype||!t.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(t)}`;t.utils&&(S.utils={...S.utils,...t.utils}),me.mount(t)})}static create(e,t){return new S(e,t)}_isOutsideThisEl(e){!this.el.contains(e)&&e!==this.el&&(we=null)}_getDirection(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,g||c):this.options.direction}_onTapStart(e){if(!e.cancelable)return;let t=this,n=this.el,o=this.options,r=o.preventOnFilter,l=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(a||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=o.filter;if(si(n),!c&&!(/mousedown|pointerdown/.test(l)&&e.button!==0||o.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Ce&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=R(s,o.draggable,n,!1,[g]),!(s&&s.animated)&&Be!==s)){if(ge=k(s,void 0,[g]),De=k(s,o.draggable,[g]),typeof d=="function"){if(d.call(this,e,s,this)){Y({sortable:t,rootEl:f,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),r&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(h){if(h=R(f,h.trim(),n,!1,[g]),h)return Y({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),d)){r&&e.preventDefault();return}o.handle&&!R(f,o.handle,n,!1,[g])||this._prepareDragStart(e,a,s)}}_prepareDragStart(e,t,n){let o=this,r=o.el,l=o.options,a=r.ownerDocument,s;if(n&&!c&&n.parentNode===r){let f=P(n);if(D=r,c=n,T=c.parentNode,pe=c.nextSibling,Be=n,Xe=l.group,S.dragged=c,he={target:c,clientX:(t||e).clientX,clientY:(t||e).clientY},St=he.clientX-f.left,Dt=he.clientY-f.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,c.style["will-change"]="all",s=function(){if(F("delayEnded",o,{evt:e}),S.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!mt&&o.nativeDraggable&&(c.draggable=!0),o._triggerDragStart(e,t),Y({sortable:o,name:"choose",originalEvent:e}),I(c,l.chosenClass,!0)},l.ignore.split(",").forEach(function(d){lt(c,d.trim(),tt)}),w(a,"dragover",ue),w(a,"mousemove",ue),w(a,"touchmove",ue),l.supportPointer?(w(a,"pointerup",o._onDrop),!this.nativeDraggable&&w(a,"pointercancel",o._onDrop)):(w(a,"mouseup",o._onDrop),w(a,"touchend",o._onDrop),w(a,"touchcancel",o._onDrop)),mt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),F("delayStart",this,{evt:e}),l.delay&&(!l.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ae||re))){if(S.eventCanceled){this._onDrop();return}l.supportPointer?(w(a,"pointerup",o._disableDelayedDrag),w(a,"pointercancel",o._disableDelayedDrag)):(w(a,"mouseup",o._disableDelayedDrag),w(a,"touchend",o._disableDelayedDrag),w(a,"touchcancel",o._disableDelayedDrag)),w(a,"mousemove",o._delayedDragTouchMoveHandler),w(a,"touchmove",o._delayedDragTouchMoveHandler),l.supportPointer&&w(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(s,l.delay)}else s()}}_delayedDragTouchMoveHandler(e){let 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(){c&&tt(c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()}_disableDelayedDragEvents(){let e=this.el.ownerDocument;v(e,"mouseup",this._disableDelayedDrag),v(e,"touchend",this._disableDelayedDrag),v(e,"touchcancel",this._disableDelayedDrag),v(e,"pointerup",this._disableDelayedDrag),v(e,"pointercancel",this._disableDelayedDrag),v(e,"mousemove",this._delayedDragTouchMoveHandler),v(e,"touchmove",this._delayedDragTouchMoveHandler),v(e,"pointermove",this._delayedDragTouchMoveHandler)}_triggerDragStart(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):t?w(document,"touchmove",this._onTouchMove):w(document,"mousemove",this._onTouchMove):(w(c,"dragend",this),w(D,"dragstart",this._onDragStart));try{document.selection?Pe(()=>{document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}}_getPlaceholder(e){if(typeof this.options.getPlaceholder=="function"){const t=this.options.getPlaceholder(yt({sortable:this,name:"getPlaceholder",originalEvent:e}));t&&(g=c,Re=c.style.display,c=t),c&&g&&(g.after(c),p(g,"display","none"),p(g,"transform",""),I(g,this.options.dragClass,!1),I(g,this.options.ghostClass,!1),I(g,this.options.chosenClass,!1)),F("getPlaceholder",this)}}_removeClonedSelectedItem(){(typeof this.options.getPlaceholder=="function"||typeof this.options.getPlaceholderOnMove=="function")&&c&&g&&(p(g,"display",Re||""),c.remove())}_replacePlaceholder(e){const t=c.parentNode;t?t.replaceChild(e,c):c.remove(),c=e}_getPlaceholderOnMove(e,t,n,o,r,l){if(typeof this.options.getPlaceholderOnMove=="function"){const a=this.options.getPlaceholderOnMove(Yt(D,e,g||c,t,n,o,r,l));a&&this._replacePlaceholder(a)}}_dragStarted(e,t){if(ye=!1,D&&c){this._getPlaceholder(t),F("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",ei);let n=this.options;!e&&I(c,n.dragClass,!1),I(c,n.ghostClass,!0),S.active=this,e&&this._appendGhost(),Y({sortable:this,name:"start",originalEvent:t})}else this._nulling()}_emulateDragOver(){var e,t,n;if(U){this._lastX=U.clientX,this._lastY=U.clientY,kt();let o=document.elementFromPoint(U.clientX,U.clientY),r=o;for(;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(U.clientX,U.clientY),o!==r);)r=o;if((n=(t=(e=c==null?void 0:c.parentNode)==null?void 0:e[N])==null?void 0:t._isOutsideThisEl)==null||n.call(t,o),r)do{if(r[N]){let l;if(l=r[N]._onDragOver({clientX:U.clientX,clientY:U.clientY,target:o,rootEl:r}),l&&!this.options.dragoverBubble)break}o=r}while(r=It(r));Ft()}}_onTouchMove(e){if(he){let t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,r=e.touches?e.touches[0]:e,l=b&&Se(b,!0),a=b&&l&&l.a,s=b&&l&&l.d,f=ke&&X&&wt(X),d=(r.clientX-he.clientX+o.x)/(a||1)+(f?f[0]-et[0]:0)/(a||1),h=(r.clientY-he.clientY+o.y)/(s||1)+(f?f[1]-et[1]:0)/(s||1);if(!S.active&&!ye){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(b){l?(l.e+=d-(Qe||0),l.f+=h-(Je||0)):l={a:1,b:0,c:0,d:1,e:d,f:h};let m=`matrix(${l.a},${l.b},${l.c},${l.d},${l.e},${l.f})`;p(b,"webkitTransform",m),p(b,"mozTransform",m),p(b,"msTransform",m),p(b,"transform",m),Qe=d,Je=h,U=r}e.cancelable&&e.preventDefault()}}_appendGhost(){if(!b){let e=this.options.fallbackOnBody?document.body:D,t=P(c,!0,ke,!0,e),n=this.options;if(ke){for(X=e;p(X,"position")==="static"&&p(X,"transform")==="none"&&X&&X!==document;)X=X.parentNode;X!==document.body&&X!==document.documentElement?(X===document&&(X=J()),t.top+=X.scrollTop,t.left+=X.scrollLeft):X=J(),et=wt(X)}b=this.options.getGhostFallback&&typeof this.options.getGhostFallback=="function"?this.options.getGhostFallback(yt({sortable:this,name:"getGhostFallback"})):c.cloneNode(!0),I(b,n.ghostClass,!1),I(b,n.fallbackClass,!0),I(b,n.dragClass,!0),p(b,"transition",""),p(b,"transform",""),p(b,"box-sizing","border-box"),p(b,"margin",0),p(b,"top",t.top),p(b,"left",t.left),p(b,"width",t.width),p(b,"height",t.height),p(b,"opacity","0.8"),p(b,"position",ke?"absolute":"fixed"),p(b,"zIndex","100000"),p(b,"pointerEvents","none"),S.ghost=b,e.appendChild(b),p(b,"transform-origin",St/parseInt(b.style.width)*100+"% "+Dt/parseInt(b.style.height)*100+"%")}}_onDragStart(e,t){let n=this,o=e.dataTransfer,r=n.options;if(F("dragStart",this,{evt:e}),S.eventCanceled){this._onDrop();return}F("setupClone",this),S.eventCanceled||(_=at(c),_.removeAttribute("id"),_.draggable=!1,_.style["will-change"]="",this._hideClone(),I(_,this.options.chosenClass,!1),S.clone=_),n.cloneId=Pe(function(){F("clone",n),!S.eventCanceled&&(n.options.removeCloneOnHide||D.insertBefore(_,c),n._hideClone(),Y({sortable:n,name:"clone"}))}),!t&&I(c,r.dragClass,!0),t?(je=!0,n._loopId=setInterval(n._emulateDragOver,50)):(v(document,"mouseup",n._onDrop),v(document,"touchend",n._onDrop),v(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",r.setData&&r.setData.call(n,o,c)),w(document,"drop",n),p(c,"transform","translateZ(0)")),ye=!0,n._dragStartId=Pe(n._dragStarted.bind(n,t,e)),w(document,"selectstart",n),Te=!0,window.getSelection().removeAllRanges(),Ce&&p(document.body,"user-select","none")}_onDragOver(e){let t=this.el,n=e.target,o,r,l,a=this.options,s=a.group,f=S.active,d=Xe===s,h=a.sort,m=A||f,y,u=this,L=!1;if(st)return;function x(C,O){F(C,u,{evt:e,isOwner:d,axis:y?"vertical":"horizontal",revert:l,dragRect:o,targetRect:r,canSort:h,fromSortable:m,target:n,completed:B,onMove(H,ee){return Fe(D,t,g||c,o,H,P(H),e,ee)},changed:$,...O})}function V(){x("dragOverAnimationCapture"),u.captureAnimationState(),u!==m&&m.captureAnimationState()}function B(C){return x("dragOverCompleted",{insertion:C}),C&&(d?f._hideClone():f._showClone(u),u!==m&&(I(c,A?A.options.ghostClass:f.options.ghostClass,!1),I(c,a.ghostClass,!0)),A!==u&&u!==S.active?A=u:u===S.active&&A&&(A=null),m===u&&(u._ignoreWhileAnimating=n),u.animateAll(function(){x("dragOverAnimationComplete"),u._ignoreWhileAnimating=null}),u!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(n===c&&!c.animated||n===t&&!n.animated)&&(we=null),!a.dragoverBubble&&!e.rootEl&&n!==document&&(c.parentNode[N]._isOutsideThisEl(e.target),!C&&ue(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),L=!0}function $(){G=k(c,void 0,[g]),ne=k(c,a.draggable,[g]),Y({sortable:u,name:"change",toEl:t,newIndex:G,newDraggableIndex:ne,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=R(n,a.draggable,t,!0,[g]),x("dragOver"),S.eventCanceled)return L;if(c.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||u._ignoreWhileAnimating===n)return B(!1);if(je=!1,f&&!a.disabled&&(d?h||(l=T!==D):A===this||(this.lastPutMode=Xe.checkPull(this,f,g||c,e))&&s.checkPut(this,f,g||c,e))){if(y=this._getDirection(e,n)==="vertical",o=P(c),x("dragOverValid"),S.eventCanceled)return L;if(l)return T=D,V(),this._hideClone(),x("revert"),S.eventCanceled||(pe?D.insertBefore(c,pe):D.appendChild(c)),B(!0);let C=pt(t,a.draggable);if(!C||oi(e,y,this)&&!C.animated){if(C===c)return B(!1);if(C&&t===e.target&&(n=C),n&&(r=P(n)),Fe(D,t,g||c,o,n,r,e,!!n)!==!1)return V(),this._getPlaceholderOnMove(t,o,n,r,e,!!n),C&&C.nextSibling?t.insertBefore(c,C.nextSibling):t.appendChild(c),T=t,$(),B(!0)}else if(C&&ni(e,y,this)){let O=be(t,0,a,!0,[g]);if(O===c)return B(!1);if(n=O,r=P(n),Fe(D,t,g||c,o,n,r,e,!1)!==!1)return this._getPlaceholderOnMove(t,o,n,r,e,!1),V(),t.insertBefore(c,O),T=t,$(),B(!0)}else if(n.parentNode===t){r=P(n);let O=0,H,ee=c.parentNode!==t,de=!Qt(c.animated&&c.toRect||o,n.animated&&n.toRect||r,y),z=y?"top":"left",le=vt(n,"top","top")||vt(c,"top","top"),Ne=le?le.scrollTop:void 0;we!==n&&(H=r[z],Oe=!1,Le=!de&&a.invertSwap||ee),O=ri(e,n,r,y,de?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Le,we===n);let te;if(O!==0){let ae=k(c,void 0,[g]);do ae-=O,te=T.children[ae];while(te&&(p(te,"display")==="none"||te===b))}if(O===0||te===n)return B(!1);we=n,Ie=O;let K=!1;K=O===1;let j=Fe(D,t,g||c,o,n,r,e,K);if(j!==!1){(j===1||j===-1)&&(K=j===1),st=!0,setTimeout(ii,30),V(),this._getPlaceholderOnMove(t,o,n,r,e,K);let ae=n.nextElementSibling;return K&&!ae?t.appendChild(c):n.parentNode.insertBefore(c,K?ae:n),le&&At(le,0,Ne-le.scrollTop),T=c.parentNode,H!==void 0&&!Le&&(We=Math.abs(H-P(n)[z])),$(),B(!0)}}if(t.contains(c))return B(!1)}return!1}_offMoveEvents(){v(document,"mousemove",this._onTouchMove),v(document,"touchmove",this._onTouchMove),v(document,"pointermove",this._onTouchMove),v(document,"dragover",ue),v(document,"mousemove",ue),v(document,"touchmove",ue)}_offUpEvents(){let e=this.el.ownerDocument;v(e,"mouseup",this._onDrop),v(e,"touchend",this._onDrop),v(e,"pointerup",this._onDrop),v(e,"pointercancel",this._onDrop),v(e,"touchcancel",this._onDrop),v(document,"selectstart",this)}_onDrop(e){let t=this.el,n=this.options;if(G=k(c,void 0,[g]),ne=k(c,n.draggable,[g]),F("drop",this,{evt:e}),T=c&&c.parentNode,G=k(c,void 0,[g]),ne=k(c,n.draggable,[g]),S.eventCanceled){this._nulling();return}ye=!1,Le=!1,Oe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ge(this.cloneId),Ge(this._dragStartId),this.nativeDraggable&&(v(document,"drop",this),v(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ce&&p(document.body,"user-select",""),p(c,"transform",""),e&&(Te&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),b&&b.parentNode&&b.parentNode.removeChild(b),(D===T||A&&A.lastPutMode!=="clone")&&_&&_.parentNode&&_.parentNode.removeChild(_),c&&(this.nativeDraggable&&v(c,"dragend",this),tt(c),c.style["will-change"]="",Te&&!ye&&I(c,A?A.options.ghostClass:this.options.ghostClass,!1),I(c,this.options.chosenClass,!1),Y({sortable:this,name:"unchoose",toEl:T,newIndex:null,newDraggableIndex:null,originalEvent:e}),D!==T?(G>=0&&(Y({rootEl:T,name:"add",toEl:T,fromEl:D,originalEvent:e}),Y({sortable:this,name:"remove",toEl:T,originalEvent:e}),Y({rootEl:T,name:"sort",toEl:T,fromEl:D,originalEvent:e}),Y({sortable:this,name:"sort",toEl:T,originalEvent:e})),A&&A.save()):G!==ge&&G>=0&&(Y({sortable:this,name:"update",toEl:T,originalEvent:e}),Y({sortable:this,name:"sort",toEl:T,originalEvent:e})),S.active&&((G==null||G===-1)&&(G=ge,ne=De),Y({sortable:this,name:"end",toEl:T,originalEvent:e}),this.save()))),this._nulling()}_nulling(){F("nulling",this),this._removeClonedSelectedItem(),D=c=g=Re=T=b=pe=_=Be=ce=he=U=Te=G=ne=ge=De=we=Ie=A=Xe=S.dragged=S.ghost=S.clone=S.active=null;let e=this.el;Ve.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Ve.length=Qe=Je=0}handleEvent(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":c&&(this._onDragOver(e),ti(e));break;case"selectstart":e.preventDefault();break}}toArray(){let e=[],t,n=this.el.children,o=0,r=n.length,l=this.options;for(;o<r;o++)t=n[o],R(t,l.draggable,this.el,!1,[g])&&e.push(t.getAttribute(l.dataIdAttr)||ai(t));return e}sort(e,t){let n={},o=this.el;this.toArray().forEach(function(r,l){let a=o.children[l];R(a,this.options.draggable,o,!1,[g])&&(n[r]=a)},this),t&&this.captureAnimationState(),e.forEach(function(r){n[r]&&(o.removeChild(n[r]),o.appendChild(n[r]))}),t&&this.animateAll()}save(){let e=this.options.store;e&&e.set&&e.set(this)}closest(e,t){return R(e,t||this.options.draggable,this.el,!1,[g])}option(e,t){let n=this.options;if(t===void 0)return n[e];{let o=me.modifyOption(this,e,t);typeof o<"u"?n[e]=o:n[e]=t,e==="group"&&Ct(n)}}destroy(){F("destroy",this);let e=this.el;e[N]=null,v(e,"mousedown",this._onTapStart),v(e,"touchstart",this._onTapStart),v(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(v(e,"dragover",this),v(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),He.splice(He.indexOf(this.el),1),this.el=e=null}_hideClone(){if(!ce){if(F("hideClone",this),S.eventCanceled)return;p(_,"display","none"),this.options.removeCloneOnHide&&(_!=null&&_.parentNode)&&_.parentNode.removeChild(_),ce=!0}}_showClone(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ce){if(F("showClone",this),S.eventCanceled)return;typeof this.options.getPlaceholder!="function"&&typeof this.options.getPlaceholderOnMove!="function"&&(c.parentNode==D&&!this.options.group.revertClone?D.insertBefore(_,c):pe?D.insertBefore(_,pe):D.appendChild(_)),this.options.group.revertClone&&this.animate(c,_),p(_,"display",""),ce=!1}}};q(S,"utils",{on:w,off:v,css:p,find:lt,is:function(e,t){return!!R(e,t,e,!1,[g])},extend:Ot,throttle:gt,closest:R,toggleClass:I,clone:at,index:k,nextTick:Pe,cancelNextTick:Ge,detectDirection:ct,getChild:be,expando:N}),q(S,"version",Et);let E=S;function ti(i){i.dataTransfer&&(i.dataTransfer.dropEffect="move"),i.cancelable&&i.preventDefault()}const Yt=(i,e,t,n,o,r,l,a)=>{let s;window.CustomEvent&&!re&&!Ae?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=i,s.dragged=t,s.draggedRect=n,s.related=o||e,s.relatedRect=r||P(e),s.willInsertAfter=a,s.originalEvent=l;const f=i[N];if(f){let d={...me.getEventProperties("move",f)};for(let h in d)s[h]=d[h]}return s};function Fe(i,e,t,n,o,r,l,a){let s=i[N],f=s.options.onMove,d;const h=Yt(i,e,t,n,o,r,l,a);return i.dispatchEvent(h),f&&(d=f.call(s,h)),d}function tt(i){i.draggable=!1}function ii(){st=!1}function ni(i,e,t){let n=P(be(t.el,0,t.options,!0,[g]));const o=Nt(t.el,t.options,b,[g]),r=10;return e?i.clientX<o.left-r||i.clientY<n.top&&i.clientX<n.right:i.clientY<o.top-r||i.clientY<n.bottom&&i.clientX<n.left}function oi(i,e,t){const n=P(pt(t.el,t.options.draggable)),o=Nt(t.el,t.options,b,[g]),r=10;return e?i.clientX>o.right+r||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>o.bottom+r||i.clientX>n.right&&i.clientY>n.top}function ri(i,e,t,n,o,r,l,a){let s=n?i.clientY:i.clientX,f=n?t.height:t.width,d=n?t.top:t.left,h=n?t.bottom:t.right,m=!1;if(!l){if(a&&We<f*o){if(!Oe&&(Ie===1?s>d+f*r/2:s<h-f*r/2)&&(Oe=!0),Oe)m=!0;else if(Ie===1?s<d+We:s>h-We)return-Ie}else if(s>d+f*(1-o)/2&&s<h-f*(1-o)/2)return li(e)}return m=m||l,m&&(s<d+f*r/2||s>h-f*r/2)?s>d+f/2?1:-1:0}function li(i){return k(c,void 0,[g])<k(i,void 0,[g])?1:-1}function ai(i){let e=i.tagName+i.className+i.src+i.href+i.textContent,t=e.length,n=0;for(;t--;)n+=e.charCodeAt(t);return n.toString(36)}function si(i){Ve.length=0;let e=i.getElementsByTagName("input"),t=e.length;for(;t--;){let n=e[t];n.checked&&Ve.push(n)}}function Pe(i){return setTimeout(i,0)}function Ge(i){return clearTimeout(i)}Ue&&w(document,"touchmove",function(i){(E.active||ye)&&i.cancelable&&i.preventDefault()});E.utils={on:w,off:v,css:p,find:lt,is:function(i,e){return!!R(i,e,i,!1,[g])},extend:Ot,throttle:gt,closest:R,toggleClass:I,clone:at,index:k,nextTick:Pe,cancelNextTick:Ge,detectDirection:ct,getChild:be,expando:N};E.get=function(i){return i[N]};E.mount=function(...i){i[0].constructor===Array&&(i=i[0]),i.forEach(e=>{if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(E.utils={...E.utils,...e.utils}),me.mount(e)})};E.create=function(i,e){return new E(i,e)};E.version=Et;let ie,_e,Ye;class Rt{static eventProperties(){const e={swapItem:ie};return Ye!==void 0&&(e.newIndex=Ye),e}constructor(e){this.sortable=e,this.options=e.options,this.defaults={swapClass:"sortable-swap-highlight"};for(let t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}dragStart({dragEl:e}){this.setLastSwapEl(e)}getPlaceholder({originalDragEl:e}){_e=e}dragOverValid({completed:e,target:t,onMove:n,activeSortable:o,changed:r,cancel:l}){if(!o.options.swap)return;let a=this.sortable.el,s=this.options;if(t&&t!==a){let f=ie;n(t)!==!1?(I(t,s.swapClass,!0),this.setLastSwapEl(t)):this.setLastSwapEl(null),f&&f!==ie&&I(f,s.swapClass,!1)}r(),e(!0),l()}setLastSwapEl(e){ie=e;const t=e==null?void 0:e.parentNode;let n=-1;t&&e&&typeof this.options.getPlaceholder=="function"&&(n=k(e,this.options.draggable,[_e])),n>-1?Ye=n:Ye=void 0}swapNodes(e,t,n,o){var r;if(typeof n.options.getPlaceholder!="function"&&typeof((r=o==null?void 0:o.options)==null?void 0:r.getPlaceholder)!="function"){let l=e.parentNode,a=t.parentNode,s,f;if(!l||!a||l.isEqualNode(t)||a.isEqualNode(e))return;s=k(e,this.options.draggable,[_e]),f=k(t,this.options.draggable,[_e]),l.isEqualNode(a)&&s<f&&f++,l.insertBefore(t,l.children[s]),a.insertBefore(e,a.children[f])}}drop({activeSortable:e,putSortable:t,dragEl:n,...o}){let r=t||this.sortable,l=this.options;ie&&I(ie,l.swapClass,!1),ie&&(l.swap||t&&t.options.swap)&&n!==ie&&(r.captureAnimationState(),r!==e&&e.captureAnimationState(),this.swapNodes(n,ie,e,t),r.animateAll(),r!==e&&e.animateAll())}nulling(){this.setLastSwapEl(null),_e=null}}q(Rt,"pluginName","swap");let se,Q,W,Z;class Bt{static eventProperties(){const e={};return se!==void 0&&(e.draggedTreeItemParent=se),Q!==void 0&&(e.draggedTreeItemLevel=Q),W!==void 0&&(e.draggedTreeItemBefore=W),Z!==void 0&&(e.draggedTreeItemAfter=Z),e}constructor(e){this.sortable=e,this.options=e.options,this.startX=0,this.startLevel=1,this.beforeElement=null}mount(){this.options.tree}dragStarted({originalEvent:e,dragEl:t,originalDragEl:n,sortable:o}){this.options.tree&&(this.startX=e.clientX,this.startLevel=it(n||t,this.options),Q=this.startLevel,this._getDraggedTreeItemParent(t,n,o))}_findPrevSibling(e,t,n=void 0){let o=e.previousElementSibling;const r=this.options.treeItemLevelAttr||"data-level";for(;o;){const l=R(o,this.options.draggable,this.sortable.el,!1,[t]);if(l&&(typeof n=="number"&&l.getAttribute(r)===n.toString()||n===void 0))return l;o=o.previousElementSibling}return null}_findNextSibling(e,t){let n=e.nextElementSibling;for(;n;){const o=R(n,this.options.draggable,this.sortable.el,!1,[t]);if(o)return o;n=n.nextElementSibling}return null}_getDraggedTreeItemParent(e,t,n){se=this._findPrevSibling(e,t,Q-1)??n.el}dragOver({axis:e,originalEvent:t,dragEl:n,originalDragEl:o,sortable:r,fromSortable:l,onMove:a,ghostEl:s,changed:f,...d}){var C,O;if(!this.options.tree||e==="vertical")return;const h=t.clientX-this.startX,m=this.options.treeIndentThreshold||10,y=this.options.treeItemLevelAttr||"data-level";W=this._findPrevSibling(n,o),Z=this._findNextSibling(n,o);const u=W?it(W,this.options):1,L=Z?it(Z,this.options):1;W&&(W.level=u),Z&&(Z.level=L);let x=1,V=1;W&&Z?(x=Math.min(u+1,L),u>=L&&(x=Math.min(x,u)),V=Math.max(u+1,L)):Z?x=V=1:(x=1,V=u+1);const B=Math.floor(h/m),$=Math.max(x,Math.min(V,this.startLevel+B));if($!==Q||this.beforeElement!==W||r!==l){this.removeDragPrent(),this.beforeElement=W,Q=$,this._getDraggedTreeItemParent(n,o,r);const H=W||Z||this.sortable.el,ee=P(H);a(H,!!W)!==!1&&(o&&!(typeof this.options.getPlaceholder=="function"||typeof this.options.getPlaceholderOnMove=="function")&&o.setAttribute(y,Q),(C=n==null?void 0:n.setAttribute)==null||C.call(n,y,Q),(O=s==null?void 0:s.setAttribute)==null||O.call(s,y,Q),$>1&&se&&se.setAttribute("data-drag-parent","true"),this.sortable._getPlaceholderOnMove(this.sortable.el,P(n),H,ee,t,!!W),f())}}drop(e){this.options.tree}removeDragPrent(){se&&se.removeAttribute("data-drag-parent"),se=null}nulling(){this.removeDragPrent(),this.startX=0,this.startLevel=1,Q=W=Z=void 0}}q(Bt,"pluginName","tree");function it(i,e){const t=e.treeItemLevelAttr||"data-level";return parseInt(i.getAttribute(t))||1}let Tt;class Ht{constructor(e){q(this,"startIndex",null);this.sortable=e,this.options=e.options}dragStart({oldDraggableIndex:e}){this.startIndex=e}getPlaceholder({originalDragEl:e}){Tt=e}onSpill({dragEl:e,putSortable:t}){this.sortable.captureAnimationState(),t&&t.captureAnimationState();let n=be(this.sortable.el,this.startIndex,this.options,[Tt]);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),t&&t.animateAll()}drop({originalEvent:e,putSortable:t,dragEl:n,activeSortable:o,dispatchSortableEvent:r,hideGhostForTarget:l,unhideGhostForTarget:a}){if(!e)return;let s=t||o;l();let f=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(f.clientX,f.clientY);a(),s&&!s.el.contains(d)&&(r("spill"),this.onSpill({dragEl:n,putSortable:t}))}}q(Ht,"pluginName","revertOnSpill");class Wt{constructor(e){this.sortable=e,this.options=e.options}onSpill({dragEl:e,putSortable:t}){const n=t||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()}drop({originalEvent:e,putSortable:t,dragEl:n,activeSortable:o,dispatchSortableEvent:r,hideGhostForTarget:l,unhideGhostForTarget:a}){if(!e)return;let s=t||o;l();let f=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(f.clientX,f.clientY);a(),s&&!s.el.contains(d)&&(r("spill"),this.onSpill({dragEl:n,putSortable:t}))}}q(Wt,"pluginName","removeOnSpill");let M=[],Ee,ft,dt=!1,nt,ot,qe,xe;class ht{constructor(e){this.sortable=e,this.options=e.options,this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(let t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}dragStarted({originalEvent:e}){this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):e.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)}dragOverCompleted({originalEvent:e}){!this.options.dragOverBubble&&!e.rootEl&&this._handleAutoScroll(e)}drop(){this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):(v(document,"pointermove",this._handleFallbackAutoScroll),v(document,"touchmove",this._handleFallbackAutoScroll),v(document,"mousemove",this._handleFallbackAutoScroll)),Pt(),ze(),jt()}nulling(){qe=ft=Ee=dt=xe=nt=ot=null,M.length=0}_handleFallbackAutoScroll(e){this._handleAutoScroll(e,!0)}_handleAutoScroll(e,t){const n=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(n,o);if(qe=e,t||this.options.forceAutoScrollFallback||Ae||re||Ce){rt(e,this.options,r,t);let l=fe(r,!0);dt&&(!xe||n!==nt||o!==ot)&&(xe&&Pt(),xe=setInterval(()=>{let a=fe(document.elementFromPoint(n,o),!0);a!==l&&(l=a,ze()),rt(e,this.options,a,t)},10),nt=n,ot=o)}else{if(!this.options.bubbleScroll||fe(r,!0)===J()){ze();return}rt(e,this.options,fe(r,!1),!1)}}}q(ht,"pluginName","scroll"),q(ht,"initializeByDefault",!0);function ze(){M.forEach(function(i){clearInterval(i.pid)}),M=[]}function Pt(){clearInterval(xe)}const rt=gt(function(i,e,t,n){if(!e.scroll)return;const o=(i.touches?i.touches[0]:i).clientX,r=(i.touches?i.touches[0]:i).clientY,l=e.scrollSensitivity,a=e.scrollSpeed,s=J();let f=!1,d;ft!==t&&(ft=t,ze(),Ee=e.scroll,d=e.scrollFn,Ee===!0&&(Ee=fe(t,!0)));let h=0,m=Ee;do{let y=m,u=P(y),L=u.top,x=u.bottom,V=u.left,B=u.right,$=u.width,C=u.height,O,H,ee=y.scrollWidth,de=y.scrollHeight,z=p(y),le=y.scrollLeft,Ne=y.scrollTop;y===s?(O=$<ee&&(z.overflowX==="auto"||z.overflowX==="scroll"||z.overflowX==="visible"),H=C<de&&(z.overflowY==="auto"||z.overflowY==="scroll"||z.overflowY==="visible")):(O=$<ee&&(z.overflowX==="auto"||z.overflowX==="scroll"),H=C<de&&(z.overflowY==="auto"||z.overflowY==="scroll"));let te=O&&(Math.abs(B-o)<=l&&le+$<ee)-(Math.abs(V-o)<=l&&!!le),K=H&&(Math.abs(x-r)<=l&&Ne+C<de)-(Math.abs(L-r)<=l&&!!Ne);if(!M[h])for(let j=0;j<=h;j++)M[j]||(M[j]={});(M[h].vx!=te||M[h].vy!=K||M[h].el!==y)&&(M[h].el=y,M[h].vx=te,M[h].vy=K,clearInterval(M[h].pid),(te!=0||K!=0)&&(f=!0,M[h].pid=setInterval((function(){n&&this.layer===0&&E.active._onTouchMove(qe);let j=M[this.layer].vy?M[this.layer].vy*a:0,ae=M[this.layer].vx?M[this.layer].vx*a:0;typeof d=="function"&&d.call(E.dragged.parentNode[N],ae,j,i,qe,M[this.layer].el)!=="continue"||At(M[this.layer].el,ae,j)}).bind({layer:h}),24))),h++}while(e.bubbleScroll&&m!==s&&(m=fe(m,!1)));dt=f},30);E.mount(ht,Wt,Ht,Bt,Rt);module.exports=E;
package/dist/index.d.ts CHANGED
@@ -231,7 +231,7 @@ declare namespace Sortable {
231
231
  }
232
232
  type Direction = 'vertical' | 'horizontal'
233
233
  export interface SortableOptions {
234
- getGhostFallback?: (event: SortableEvent) => HTMLElement
234
+ getGhostFallback?: (event: SortableEvent) => HTMLElement | undefined
235
235
  getPlaceholder?: (event: SortableEvent) => HTMLElement | undefined
236
236
  getPlaceholderOnMove?: (event: MoveEvent) => HTMLElement | undefined
237
237
  /**
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var Gt = Object.defineProperty;
2
2
  var zt = (i, e, t) => e in i ? Gt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var q = (i, e, t) => zt(i, typeof e != "symbol" ? e + "" : e, t);
4
- const Et = "2.2.1";
4
+ const Et = "2.2.3";
5
5
  function oe(i) {
6
6
  if (typeof window < "u" && window.navigator)
7
7
  return !!/* @__PURE__ */ navigator.userAgent.match(i);
@@ -350,12 +350,12 @@ function Xt({
350
350
  bubbles: !0,
351
351
  cancelable: !0
352
352
  }) : (u = document.createEvent("Event"), u.initEvent(t, !0, !0)), u.to = r || e, u.from = l || e, u.item = n || e, u.clone = o, u.oldIndex = a, u.newIndex = s, u.oldDraggableIndex = f, u.newDraggableIndex = d, u.originalEvent = h, u.pullMode = m ? m.lastPutMode : void 0;
353
- let X = {
353
+ let L = {
354
354
  ...y,
355
355
  ...me.getEventProperties(t, i)
356
356
  };
357
- for (let E in X)
358
- u[E] = X[E];
357
+ for (let E in L)
358
+ u[E] = L[E];
359
359
  return u;
360
360
  }
361
361
  function Zt({
@@ -375,7 +375,7 @@ function Zt({
375
375
  extraEventProperties: y
376
376
  }) {
377
377
  if (i = i || e && e[N], !i) return;
378
- let u = i.options, X = "on" + t.charAt(0).toUpperCase() + t.substr(1);
378
+ let u = i.options, L = "on" + t.charAt(0).toUpperCase() + t.substr(1);
379
379
  const E = Xt({
380
380
  sortable: i,
381
381
  rootEl: e,
@@ -392,7 +392,7 @@ function Zt({
392
392
  putSortable: m,
393
393
  extraEventProperties: y
394
394
  });
395
- e && e.dispatchEvent(E), u[X] && u[X].call(i, E);
395
+ e && e.dispatchEvent(E), u[L] && u[L].call(i, E);
396
396
  }
397
397
  /**!
398
398
  * Sortable
@@ -459,7 +459,7 @@ function yt(i) {
459
459
  ...i
460
460
  });
461
461
  }
462
- let c, g, Re, T, b, D, pe, Be, _, ce, ge, G, De, ne, Xe, A, ye = !1, je = !1, He = [], he, U, Qe, Je, St, Dt, Te, we, Ie, Oe = !1, Le = !1, We, L, et = [], st = !1, Ve = [];
462
+ let c, g, Re, T, b, D, pe, Be, _, ce, ge, G, De, ne, Xe, A, ye = !1, je = !1, He = [], he, U, Qe, Je, St, Dt, Te, we, Ie, Oe = !1, Le = !1, We, X, et = [], st = !1, Ve = [];
463
463
  const Ue = typeof document < "u", ke = ut, _t = Ae || re ? "cssFloat" : "float", Kt = Ue && !xt && !ut && "draggable" in document.createElement("div"), Lt = function() {
464
464
  if (!Ue) return;
465
465
  if (re)
@@ -753,34 +753,35 @@ const S = class S {
753
753
  this._nulling();
754
754
  }
755
755
  _emulateDragOver() {
756
+ var e, t, n;
756
757
  if (U) {
757
758
  this._lastX = U.clientX, this._lastY = U.clientY, kt();
758
- let e = document.elementFromPoint(U.clientX, U.clientY), t = e;
759
- for (; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(U.clientX, U.clientY), e !== t); )
760
- t = e;
761
- if (c.parentNode[N]._isOutsideThisEl(e), t)
759
+ let o = document.elementFromPoint(U.clientX, U.clientY), r = o;
760
+ for (; o && o.shadowRoot && (o = o.shadowRoot.elementFromPoint(U.clientX, U.clientY), o !== r); )
761
+ r = o;
762
+ if ((n = (t = (e = c == null ? void 0 : c.parentNode) == null ? void 0 : e[N]) == null ? void 0 : t._isOutsideThisEl) == null || n.call(t, o), r)
762
763
  do {
763
- if (t[N]) {
764
- let n;
765
- if (n = t[N]._onDragOver({
764
+ if (r[N]) {
765
+ let l;
766
+ if (l = r[N]._onDragOver({
766
767
  clientX: U.clientX,
767
768
  clientY: U.clientY,
768
- target: e,
769
- rootEl: t
770
- }), n && !this.options.dragoverBubble)
769
+ target: o,
770
+ rootEl: r
771
+ }), l && !this.options.dragoverBubble)
771
772
  break;
772
773
  }
773
- e = t;
774
+ o = r;
774
775
  } while (
775
776
  /* jshint boss:true */
776
- t = It(t)
777
+ r = It(r)
777
778
  );
778
779
  Ft();
779
780
  }
780
781
  }
781
782
  _onTouchMove(e) {
782
783
  if (he) {
783
- let t = this.options, n = t.fallbackTolerance, o = t.fallbackOffset, r = e.touches ? e.touches[0] : e, l = b && Se(b, !0), a = b && l && l.a, s = b && l && l.d, f = ke && L && wt(L), d = (r.clientX - he.clientX + o.x) / (a || 1) + (f ? f[0] - et[0] : 0) / (a || 1), h = (r.clientY - he.clientY + o.y) / (s || 1) + (f ? f[1] - et[1] : 0) / (s || 1);
784
+ let t = this.options, n = t.fallbackTolerance, o = t.fallbackOffset, r = e.touches ? e.touches[0] : e, l = b && Se(b, !0), a = b && l && l.a, s = b && l && l.d, f = ke && X && wt(X), d = (r.clientX - he.clientX + o.x) / (a || 1) + (f ? f[0] - et[0] : 0) / (a || 1), h = (r.clientY - he.clientY + o.y) / (s || 1) + (f ? f[1] - et[1] : 0) / (s || 1);
784
785
  if (!S.active && !ye) {
785
786
  if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
786
787
  return;
@@ -805,9 +806,9 @@ const S = class S {
805
806
  if (!b) {
806
807
  let e = this.options.fallbackOnBody ? document.body : D, t = P(c, !0, ke, !0, e), n = this.options;
807
808
  if (ke) {
808
- for (L = e; p(L, "position") === "static" && p(L, "transform") === "none" && L !== document; )
809
- L = L.parentNode;
810
- L !== document.body && L !== document.documentElement ? (L === document && (L = J()), t.top += L.scrollTop, t.left += L.scrollLeft) : L = J(), et = wt(L);
809
+ for (X = e; p(X, "position") === "static" && p(X, "transform") === "none" && X && X !== document; )
810
+ X = X.parentNode;
811
+ X !== document.body && X !== document.documentElement ? (X === document && (X = J()), t.top += X.scrollTop, t.left += X.scrollLeft) : X = J(), et = wt(X);
811
812
  }
812
813
  b = this.options.getGhostFallback && typeof this.options.getGhostFallback == "function" ? this.options.getGhostFallback(
813
814
  yt({
@@ -836,7 +837,7 @@ const S = class S {
836
837
  }
837
838
  // Returns true - if no further action is needed (either inserted or another condition)
838
839
  _onDragOver(e) {
839
- let t = this.el, n = e.target, o, r, l, a = this.options, s = a.group, f = S.active, d = Xe === s, h = a.sort, m = A || f, y, u = this, X = !1;
840
+ let t = this.el, n = e.target, o, r, l, a = this.options, s = a.group, f = S.active, d = Xe === s, h = a.sort, m = A || f, y, u = this, L = !1;
840
841
  if (st) return;
841
842
  function E(C, O) {
842
843
  F(C, u, {
@@ -876,7 +877,7 @@ const S = class S {
876
877
  !1
877
878
  ), I(c, a.ghostClass, !0)), A !== u && u !== S.active ? A = u : u === S.active && A && (A = null), m === u && (u._ignoreWhileAnimating = n), u.animateAll(function() {
878
879
  E("dragOverAnimationComplete"), u._ignoreWhileAnimating = null;
879
- }), u !== m && (m.animateAll(), m._ignoreWhileAnimating = null)), (n === c && !c.animated || n === t && !n.animated) && (we = null), !a.dragoverBubble && !e.rootEl && n !== document && (c.parentNode[N]._isOutsideThisEl(e.target), !C && ue(e)), !a.dragoverBubble && e.stopPropagation && e.stopPropagation(), X = !0;
880
+ }), u !== m && (m.animateAll(), m._ignoreWhileAnimating = null)), (n === c && !c.animated || n === t && !n.animated) && (we = null), !a.dragoverBubble && !e.rootEl && n !== document && (c.parentNode[N]._isOutsideThisEl(e.target), !C && ue(e)), !a.dragoverBubble && e.stopPropagation && e.stopPropagation(), L = !0;
880
881
  }
881
882
  function $() {
882
883
  G = k(c, void 0, [g]), ne = k(c, a.draggable, [g]), Y({
@@ -888,7 +889,7 @@ const S = class S {
888
889
  originalEvent: e
889
890
  });
890
891
  }
891
- if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = R(n, a.draggable, t, !0, [g]), E("dragOver"), S.eventCanceled) return X;
892
+ if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = R(n, a.draggable, t, !0, [g]), E("dragOver"), S.eventCanceled) return L;
892
893
  if (c.contains(e.target) || n.animated && n.animatingX && n.animatingY || u._ignoreWhileAnimating === n)
893
894
  return B(!1);
894
895
  if (je = !1, f && !a.disabled && (d ? h || (l = T !== D) : A === this || (this.lastPutMode = Xe.checkPull(
@@ -897,7 +898,7 @@ const S = class S {
897
898
  g || c,
898
899
  e
899
900
  )) && s.checkPut(this, f, g || c, e))) {
900
- if (y = this._getDirection(e, n) === "vertical", o = P(c), E("dragOverValid"), S.eventCanceled) return X;
901
+ if (y = this._getDirection(e, n) === "vertical", o = P(c), E("dragOverValid"), S.eventCanceled) return L;
901
902
  if (l)
902
903
  return T = D, V(), this._hideClone(), E("revert"), S.eventCanceled || (pe ? D.insertBefore(c, pe) : D.appendChild(c)), B(!0);
903
904
  let C = pt(t, a.draggable);
@@ -1125,7 +1126,7 @@ const S = class S {
1125
1126
  _hideClone() {
1126
1127
  if (!ce) {
1127
1128
  if (F("hideClone", this), S.eventCanceled) return;
1128
- p(_, "display", "none"), this.options.removeCloneOnHide && _.parentNode && _.parentNode.removeChild(_), ce = !0;
1129
+ p(_, "display", "none"), this.options.removeCloneOnHide && (_ != null && _.parentNode) && _.parentNode.removeChild(_), ce = !0;
1129
1130
  }
1130
1131
  }
1131
1132
  _showClone(e) {
@@ -1422,10 +1423,10 @@ class Bt {
1422
1423
  if (!this.options.tree || e === "vertical") return;
1423
1424
  const h = t.clientX - this.startX, m = this.options.treeIndentThreshold || 10, y = this.options.treeItemLevelAttr || "data-level";
1424
1425
  W = this._findPrevSibling(n, o), Z = this._findNextSibling(n, o);
1425
- const u = W ? it(W, this.options) : 1, X = Z ? it(Z, this.options) : 1;
1426
- W && (W.level = u), Z && (Z.level = X);
1426
+ const u = W ? it(W, this.options) : 1, L = Z ? it(Z, this.options) : 1;
1427
+ W && (W.level = u), Z && (Z.level = L);
1427
1428
  let E = 1, V = 1;
1428
- W && Z ? (E = Math.min(u + 1, X), u >= X && (E = Math.min(E, u)), V = Math.max(u + 1, X)) : Z ? E = V = 1 : (E = 1, V = u + 1);
1429
+ W && Z ? (E = Math.min(u + 1, L), u >= L && (E = Math.min(E, u)), V = Math.max(u + 1, L)) : Z ? E = V = 1 : (E = 1, V = u + 1);
1429
1430
  const B = Math.floor(h / m), $ = Math.max(E, Math.min(V, this.startLevel + B));
1430
1431
  if ($ !== Q || this.beforeElement !== W || r !== l) {
1431
1432
  this.removeDragPrent(), this.beforeElement = W, Q = $, this._getDraggedTreeItemParent(n, o, r);
@@ -1576,9 +1577,9 @@ const rt = gt(function(i, e, t, n) {
1576
1577
  ft !== t && (ft = t, ze(), Ee = e.scroll, d = e.scrollFn, Ee === !0 && (Ee = fe(t, !0)));
1577
1578
  let h = 0, m = Ee;
1578
1579
  do {
1579
- let y = m, u = P(y), X = u.top, E = u.bottom, V = u.left, B = u.right, $ = u.width, C = u.height, O, H, ee = y.scrollWidth, de = y.scrollHeight, z = p(y), le = y.scrollLeft, Ne = y.scrollTop;
1580
+ let y = m, u = P(y), L = u.top, E = u.bottom, V = u.left, B = u.right, $ = u.width, C = u.height, O, H, ee = y.scrollWidth, de = y.scrollHeight, z = p(y), le = y.scrollLeft, Ne = y.scrollTop;
1580
1581
  y === s ? (O = $ < ee && (z.overflowX === "auto" || z.overflowX === "scroll" || z.overflowX === "visible"), H = C < de && (z.overflowY === "auto" || z.overflowY === "scroll" || z.overflowY === "visible")) : (O = $ < ee && (z.overflowX === "auto" || z.overflowX === "scroll"), H = C < de && (z.overflowY === "auto" || z.overflowY === "scroll"));
1581
- let te = O && (Math.abs(B - o) <= l && le + $ < ee) - (Math.abs(V - o) <= l && !!le), K = H && (Math.abs(E - r) <= l && Ne + C < de) - (Math.abs(X - r) <= l && !!Ne);
1582
+ let te = O && (Math.abs(B - o) <= l && le + $ < ee) - (Math.abs(V - o) <= l && !!le), K = H && (Math.abs(E - r) <= l && Ne + C < de) - (Math.abs(L - r) <= l && !!Ne);
1582
1583
  if (!M[h])
1583
1584
  for (let j = 0; j <= h; j++)
1584
1585
  M[j] || (M[j] = {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pantograph/sortable",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "id": "sortable",
5
5
  "type": "module",
6
6
  "exportName": "Sortable",