p-bda78a0c.js 35 KB

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