dragselect
Advanced tools
Comparing version 2.7.2 to 2.7.3
@@ -1,1 +0,1 @@ | ||
function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D(r.key),r)}}function s(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t,e,n){return(e=D(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,n){return u=c()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var s=new(Function.bind.apply(t,r));return n&&l(s,n.prototype),s},u.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return u(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)},d(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function p(t){var e=c();return function(){var n,r=a(t);if(e){var s=a(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return S(this,n)}}function f(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}function g(){return g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=f(t,e);if(r){var s=Object.getOwnPropertyDescriptor(r,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},g.apply(this,arguments)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,i,o,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var _=function(t,e,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{"+":{x:r+i,y:s+o},"-":{x:r-i,y:s-o},"*":{x:r*i,y:s*o},"/":{x:r/i,y:s/o}}[e]},I=function(t){return{x:t.left,y:t.top}},w=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{left:t.x,top:t.y,right:t.x,bottom:t.y,width:e,height:e}},L=function(t,e){var n=e;window.addEventListener("resize",n),window.addEventListener("scroll",n);var r=new MutationObserver(n);t.forEach((function(t,e){r.observe(t,{childList:0!==e,attributes:!0})}));return{observer:r,callback:n,cleanup:function(){return j(r,n)}}},P=function(t,e){var n;return function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];var o=function(){n=null,t.apply(void 0,s)};clearTimeout(n),n=setTimeout(o,e)}},C=function(){var t,e,n,r;return{y:(null===(t=document.body)||void 0===t?void 0:t.scrollTop)||(null===(e=document.documentElement)||void 0===e?void 0:e.scrollTop)||0,x:(null===(n=document.body)||void 0===n?void 0:n.scrollLeft)||(null===(r=document.documentElement)||void 0===r?void 0:r.scrollLeft)||0}},E=function(t){return function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=null===(n=e[r])||void 0===n?void 0:n.parentNode;return s?(e.push(s),t(e,++r)):e}([t])},T=function(t,e){var n={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return z(t).forEach((function(t){var r=e.getRect(t);n.top=Math.min(n.top,r.top),n.left=Math.min(n.left,r.left),n.bottom=Math.max(n.bottom,r.bottom),n.right=Math.max(n.right,r.right)})),n.height=n.bottom-n.top,n.width=n.right-n.left,n},A=function(t){return!t||t instanceof Document?C():{x:t.scrollLeft>=0?t.scrollLeft:C().x,y:t.scrollTop>=0?t.scrollTop:C().y}},x=function(t){var e=t.elementRect,n=t.containerRect,r=t.tolerance,s=void 0===r?{x:0,y:0}:r,i=[];return e.top-s.y<n.top&&i.push("top"),e.left-s.x<n.left&&i.push("left"),e.bottom+s.y>n.bottom&&i.push("bottom"),e.right+s.y>n.right&&i.push("right"),i},k=function(t){var e={x:0,y:0},n=window.getComputedStyle(t);if(!n.transform||"none"===n.transform)return e;if(n.transform.indexOf("3d")>=0){var r=n.transform.trim().match(/matrix3d\((.*?)\)/);if(r&&r.length){var s,i=null===(s=r[1])||void 0===s?void 0:s.split(",");e.x=parseInt(i[12])||0,e.y=parseInt(i[13])||0}return e}var o=n.transform.trim().match(/matrix\((.*?)\)/);if(o&&o.length){var a,l=null===(a=o[1])||void 0===a?void 0:a.split(",");e.x=parseInt(l[4])||0,e.y=parseInt(l[5])||0}return e},N=function(t,e){return e?function(t){var e=t.style.transform;if(!e||e.indexOf("translate")<0)return k(t);var n={x:0,y:0},r=e.trim().match(/translate[3dD]*?\(.*?\)/);if(r){var s,i=null===(s=r[0])||void 0===s?void 0:s.split("(");if(i){var o,a=null===(o=i[1])||void 0===o?void 0:o.split(",");n.x=parseInt(a[0])||0,n.y=parseInt(a[1])||0}}return n.x||n.x?n:k(t)}(t):function(t){var e=t.style,n={x:parseInt(e.left)||0,y:parseInt(e.top)||0};if(!n.x&&!n.x){var r=window.getComputedStyle(t);return{x:parseInt(r.left)||0,y:parseInt(r.top)||0}}return n}(t)},M=function(t){var e=t.computedStyle,n=t.node,r=e.position;n instanceof Document||("absolute"===r||"relative"===r||"fixed"===r)||(n.style.position="relative")},V=function(t,e,n){return console.warn('[DragSelect] TypeIssue: setting "'.concat(t,'" is not of type "').concat(e,'".'))},R=function(t,e,n,r){if(void 0===e)return n?i({},t,r):{};if(null===e)return i({},t,null);var s=!0,o=!1,a="string"==typeof r;a&&(s="string"==typeof e||e instanceof String),a&&!s&&(o=!0,V(t,"string"));var l=!Number.isNaN(r)&&"number"==typeof r;l&&(s=!Number.isNaN(e)&&"number"==typeof e),l&&!s&&(o=!0,V(t,"number"));var c="[object Object]"===Object.prototype.toString.call(r);c&&(s="[object Object]"===Object.prototype.toString.call(e)),c&&!s&&(o=!0,V(t,"object"));var u="boolean"==typeof r;u&&(s="boolean"==typeof e),u&&!s&&(o=!0,V(t,"boolean"));var d=Array.isArray(r);d&&(s=Array.isArray(e)),d&&!s&&(o=!0,V(t,"array"));var h=o||n;return"dragKeys"===t&&s?i({},t,Object.assign(r,e)):"dragKeys"!==t||s?("dropZones"===t&&s&&new Set(e.map((function(t){return t.id}))).size!==e.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),s?i({},t,e):h?i({},t,r):{}):h?i({},t,r):{}},O=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t;if(n>0){var s=(t.right-t.left)*n,i=(t.bottom-t.top)*n;r={left:t.left+s,right:t.right-s,top:t.top+i,bottom:t.bottom-i}}return r.left<e.right&&r.right>e.left&&r.top<e.bottom&&r.bottom>e.top},K=function(t){var e=t.element,n=t.posDirection,r=t.containerRect,s=t.useTransform,i=N(e,s),o=_(i,"+",n);Z(e,o,s);var a=e.getBoundingClientRect();!function(t){var e=t.element,n=t.edges,r=t.elementRect,s=t.containerRect,i=t.elementPos,o=t.useTransform;n.includes("top")&&Z(e,{y:i.y+s.top-r.top,x:i.x},o),n.includes("left")&&Z(e,{y:i.y,x:i.x+s.left-r.left},o),n.includes("bottom")&&Z(e,{y:i.y+s.bottom-r.bottom,x:i.x},o),n.includes("right")&&Z(e,{y:i.y,x:i.x+s.right-r.right},o)}({element:e,edges:x({elementRect:a,containerRect:r}),elementRect:a,containerRect:r,elementPos:o,useTransform:s})},j=function(t,e){window.removeEventListener("resize",e),window.removeEventListener("scroll",e),t.disconnect()},Z=function(t,e,n){if(n){var r=t.style.transform;t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,1px) ").concat(r.replace(/translate.*?\)/g,""))}else t.style.left="".concat(e.x,"px"),t.style.top="".concat(e.y,"px");return t},z=function(t){return t?!Array.isArray(t)&&(t instanceof HTMLElement||t instanceof SVGElement)?[t]:b(new Set(b(t))):[]},B=function(t,e){t.style.left="".concat(e.left,"px"),t.style.top="".concat(e.top,"px"),t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px")},H=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"DS",void 0),i(this,"_observers",void 0),i(this,"_node",void 0),i(this,"_parentNodes",void 0),i(this,"_computedStyle",void 0),i(this,"_computedBorder",void 0),i(this,"_rect",void 0),i(this,"setArea",(function(t){r.reset(),r._node=t,M({computedStyle:r.computedStyle,node:r._node}),setTimeout((function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})}))})),i(this,"start",(function(){r._observers=L(r.parentNodes,P((function(t){r.DS.PubSub.publish("Area:modified:pre",{event:t,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:t,item:r})}),60))})),i(this,"reset",(function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0})),i(this,"stop",(function(){r._observers.cleanup(),r.reset()})),i(this,"scroll",(function(t,e){var n={scroll_directions:t,scroll_multiplier:e};r.DS.PubSub.publish("Area:scroll:pre",n),function(t,e,n){if(e.length){var r=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=t instanceof Document?r||document.body:t,i=e.includes("top")&&s.scrollTop>0,o=e.includes("bottom")&&s.scrollTop<s.scrollHeight,a=e.includes("left")&&s.scrollLeft>0,l=e.includes("right")&&s.scrollLeft<s.scrollWidth;i&&(s.scrollTop-=1*n),o&&(s.scrollTop+=1*n),a&&(s.scrollLeft-=1*n),l&&(s.scrollLeft+=1*n)}}(r._node,t,e),r.DS.PubSub.publish("Area:scroll",n)})),this.DS=s,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.setArea(e.area)})),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return s(t,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof Document?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=function(t,e){if(t instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=t.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(t.clientWidth||n.width)*e,height:(t.clientHeight||n.height)*e}}(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=E(this.HTMLNode)}}]),t}(),F=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevCursorPos",void 0),i(this,"_prevScrollPos",void 0),i(this,"_elements",[]),i(this,"_dragKeys",void 0),i(this,"_dragKeysFlat",[]),i(this,"_selectionRect",void 0),i(this,"assignDragkeys",(function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map((function(t){return t.toLowerCase()})),down:r.DS.stores.SettingsStore.s.dragKeys.down.map((function(t){return t.toLowerCase()})),left:r.DS.stores.SettingsStore.s.dragKeys.left.map((function(t){return t.toLowerCase()})),right:r.DS.stores.SettingsStore.s.dragKeys.right.map((function(t){return t.toLowerCase()}))},r._dragKeysFlat=[].concat(b(r._dragKeys.up),b(r._dragKeys.down),b(r._dragKeys.left),b(r._dragKeys.right))})),i(this,"keyboardDrag",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability&&!r.DS.continue){var s={event:e,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],s),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=T(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var i=function(t){var e=t.shiftKey,n=t.keyboardDragSpeed,r=t.zoom,s=t.key,i=t.dragKeys,o=t.scrollDiff,a=t.canScroll,l=t.scrollCallback,c={x:0,y:0},u=e?4*n*r:n*r;return i.left.includes(s)&&(c.x=o.x||-u,e||o.x||!a||l(["left"],n)),i.right.includes(s)&&(c.x=o.x||u,e||o.x||!a||l(["right"],n)),i.up.includes(s)&&(c.y=o.y||-u,e||o.y||!a||l(["top"],n)),i.down.includes(s)&&(c.y=o.y||u,e||o.y||!a||l(["bottom"],n)),c}({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:n,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(i=r.limitDirection(i)),r._elements.forEach((function(t){return K({element:t,posDirection:i,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})),r.DS.publish(["Interaction:update:pre","Interaction:update"],s)}})),i(this,"keyboardEnd",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability){var s={event:e,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],s)}})),i(this,"start",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;e&&!n&&(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=T(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))})),i(this,"stop",(function(t){null!=t&&t.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])})),i(this,"update",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;if(e&&r._elements.length&&!n&&!r.DS.continue){var s=_(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(s=r.limitDirection(s)),r._elements.forEach((function(t){return K({element:t,posDirection:s,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}))}})),i(this,"limitDirection",(function(t){var e=r.DS.SelectorArea.rect,n=r.DS.stores.ScrollStore.scrollAmount,s={top:e.top-r._selectionRect.top+n.y,left:e.left-r._selectionRect.left+n.x,bottom:e.bottom-r._selectionRect.bottom+n.y,right:e.right-r._selectionRect.right+n.x};return 0===t.x&&0===t.y||(t.y<0&&(t.y=Math.max(t.y,s.top)),t.x<0&&(t.x=Math.max(t.x,s.left)),t.y>0&&(t.y=Math.min(t.y,s.bottom)),t.x>0&&(t.x=Math.min(t.x,s.right)),r._selectionRect.top+=t.y,r._selectionRect.bottom+=t.y,r._selectionRect.left+=t.x,r._selectionRect.right+=t.x),t})),i(this,"handleZIndex",(function(t){r._elements.forEach((function(e){return e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)+t?9999:-9998)}))})),this.DS=s,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(t,[{key:"_cursorDiff",get:function(){var t=this.DS.stores.PointerStore.currentVal,e=this._prevCursorPos?_(t,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=t,e}},{key:"_scrollDiff",get:function(){var t=this.DS.stores.ScrollStore.currentVal,e=this._prevScrollPos?_(t,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=t,e}}]),t}(),Y=function(){function t(e){var r=this,s=e.DS,o=e.id,a=e.element,l=e.droppables;n(this,t),i(this,"id",void 0),i(this,"element",void 0),i(this,"_droppables",void 0),i(this,"_rect",void 0),i(this,"_observers",void 0),i(this,"_timeout",void 0),i(this,"_itemsDropped",[]),i(this,"_itemsInside",void 0),i(this,"setReadyClasses",(function(t){if(!r.isDestroyed){var e=r.droppables.filter((function(t){return r.DS.SelectedSet.has(t)}));e.length&&(e.forEach((function(e){e.classList[t]("".concat(r.Settings.droppableClass)),e.classList[t]("".concat(r.Settings.droppableClass,"-").concat(r.id))})),r.element.classList[t]("".concat(r.Settings.dropZoneReadyClass)))}})),i(this,"handleNoDrop",(function(){var t;r.isDestroyed||(r.DS.SelectedSet.forEach((function(t){t.classList.remove(r.Settings.droppedTargetClass),t.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),r._itemsDropped=r._itemsDropped.filter((function(t){return!r.DS.SelectedSet.has(t)})),null!==(t=r._itemsDropped)&&void 0!==t&&t.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleDrop",(function(){var t,e,n;r.isDestroyed||(r._itemsDropped=b(new Set([].concat(b(r._itemsDropped),b(null===(t=r.droppables)||void 0===t?void 0:t.filter((function(t){return r.DS.SelectedSet.has(t)})))))),null===(e=r._itemsDropped)||void 0===e||e.forEach((function(t){t.classList.add("".concat(r.Settings.droppedTargetClass)),t.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),null!==(n=r._itemsDropped)&&void 0!==n&&n.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleItemsInsideClasses",(function(){var t=!1;r.droppables.forEach((function(e){r.itemsInside.includes(e)?(e.classList.add("".concat(r.Settings.droppedInsideClass)),e.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),t=!0):(e.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),e.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||e.classList.remove("".concat(r.Settings.droppedInsideClass)))})),t?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))})),i(this,"start",(function(t){t.isDragging&&!r.isDestroyed&&r.setReadyClasses("add")})),i(this,"stop",(function(t){t.isDragging&&!r.isDestroyed&&(r.setReadyClasses("remove"),r.handleItemsInsideClasses())})),i(this,"toObject",(function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.id=o,this.element=a,l&&(this.droppables=z(l)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",(function(t){var e=t.settings;r.element&&(r.element.classList.remove(e["dropZoneClass:pre"]),r.element.classList.add(e.dropZoneClass))})),this._observers=L(this.parentNodes,P((function(){return r._rect=null}),this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"destroy",value:function(){var t=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach((function(e){e.classList.remove("".concat(t.Settings.droppedTargetClass)),e.classList.remove("".concat(t.Settings.droppedTargetClass,"-").concat(t.id)),e.classList.remove("".concat(t.Settings.droppableClass)),e.classList.remove("".concat(t.Settings.droppableClass,"-").concat(t.id))})),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var t=this;return this.isDestroyed?null:(this._itemsInside||(this._itemsInside=this.droppables.flatMap((function(e){return O(t.DS.SelectableSet.rects.get(e),t.rect,t.Settings.dropInsideThreshold)?[e]:[]})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._itemsInside=null}),this.Settings.refreshMemoryRate)),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=E(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(t){this._droppables=t}}]),t}(),W=s((function t(r){var s=this,o=r.DS;n(this,t),i(this,"_zoneByElement",new Map),i(this,"_zoneById",new Map),i(this,"_zonesByDroppable",new Map),i(this,"_zones",void 0),i(this,"setDropZones",(function(t){var n=t.dropZones;n&&(s._zones&&s._zones.forEach((function(t){return t.destroy()})),s._zones=n.map((function(t){return new Y(e({DS:s.DS},t))})),s._zones.forEach((function(t){s._zoneByElement.set(t.element,t),s._zoneById.set(t.id,t),t.droppables.forEach((function(e){var n=s._zonesByDroppable.get(e);if(null==n||!n.length)return s._zonesByDroppable.set(e,[t]);s._zonesByDroppable.set(e,b(new Set([].concat(b(n),[t]))))}))})))})),i(this,"_handleDrop",(function(t){s._zones.forEach((function(e){e!==t&&e.handleNoDrop()})),t&&t.handleDrop()})),i(this,"_getZoneByElementsFromPoint",(function(t,e){for(var n=e.x,r=e.y,i=0,o=t.length;i<o;i++){var a=s._zoneByElement.get(t[i]);if(a&&O(a.rect,{left:n,right:n,top:r,bottom:r},Math.min(s.Settings.dropTargetThreshold,.5)))return a}})),i(this,"stop",(function(t){if(t.isDragging){var e=s.getTarget();s._handleDrop(e)}})),i(this,"getItemsDroppedById",(function(t){var e=s._zoneById.get(t);return e?e.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(t,")"))})),i(this,"getItemsInsideById",(function(t,e){var n=s._zoneById.get(t);if(!n)return console.warn("[DragSelect] No zone found (id: ".concat(t,")"));var r=n.itemsInside;return e&&n.handleItemsInsideClasses(),r})),i(this,"getTarget",(function(t){var e;if(null!==(e=s._zones)&&void 0!==e&&e.length){var n=(null==t?void 0:t.x)||s.DS.stores.PointerStore.currentVal.x,r=(null==t?void 0:t.y)||s.DS.stores.PointerStore.currentVal.y,i=document.elementsFromPoint(n,r);return s._getZoneByElementsFromPoint(i,{x:n,y:r})}})),this.DS=o,this.Settings=o.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",(function(t){var e=t.settings;return s.setDropZones(e)})),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)})),G=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"isInteracting",void 0),i(this,"isDragging",void 0),i(this,"init",(function(){return r.DS.publish("Interaction:init:pre",{})})),i(this,"_init",(function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})})),i(this,"start",(function(t){return r.DS.publish("Interaction:start:pre",{event:t,isDragging:r.isDragging})})),i(this,"_start",(function(t){"touchstart"===t.type&&t.preventDefault(),r._canInteract(t)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(t),r.DS.publish("Interaction:start",{event:t,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))})),i(this,"isDragEvent",(function(t){var e=t.target.closest(".".concat(r.Settings.selectableClass));return!(!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(t)||!e)&&(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(e)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(e)):r.DS.SelectedSet.add(e)),!!r.DS.SelectedSet.has(e))})),i(this,"onClick",(function(t){var e=t.event;if(r._canInteract(e)&&!(e.detail>0)){var n=r.DS,s=n.stores,i=s.PointerStore,o=s.KeyStore,a=n.SelectableSet,l=n.SelectedSet;i.start(e);var c=e.target;a.has(c)&&(o.isMultiSelectKeyPressed(e)||l.clear(),l.toggle(c),r.reset())}})),i(this,"stop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(t.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(t.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),t.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)})),i(this,"update",(function(t){var e=t.event,n=t.scroll_directions,s=t.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:e,scroll_directions:n,scroll_multiplier:s,isDragging:r.isDragging})})),i(this,"reset",(function(t){return r.DS.publish("Interaction:end:pre",{event:t,isDragging:r.isDragging})})),i(this,"_reset",(function(t){var e=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:t,isDragging:e})})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.stop(e["area:pre"]),r.init()})),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:start:pre",(function(t){var e=t.event;return r._start(e)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(t){var e=t.event;return r._reset(e)})),this.DS.subscribe("Area:scroll",this.update)}return s(t,[{key:"_canInteract",value:function(t){var e=0===t.clientX&&0===t.clientY&&0===t.detail&&t.target;return!(2===t.button||this.isInteracting||t.target&&!this.DS.SelectorArea.isInside(t.target)||!e&&!this.DS.SelectorArea.isClicked(t))}}]),t}(),U=s((function t(e){var r=this,s=e.DS;n(this,t),i(this,"subscribers",{}),i(this,"subscribe",(function(t,e){return Array.isArray(r.subscribers[t])||(r.subscribers[t]=[]),r.subscribers[t].push(e),r.subscribers[t].length-1})),i(this,"unsubscribe",(function(t,e,n){n>=0?r.subscribers[t].splice(n,1):e&&(r.subscribers[t]=r.subscribers[t].filter((function(t){return t!==e})))})),i(this,"publish",(function(t,e){Array.isArray(t)?t.forEach((function(t){return r._publish(t,e)})):r._publish(t,e)})),i(this,"_publish",(function(t,e){var n=r.subscribers[t];Array.isArray(n)&&(t.includes(":pre")?r._handlePrePublish(n,e):r._handlePublish(n,e))})),i(this,"_handlePublish",(function(t,e){for(var n=0,s=t.length;n<s;n++){if(r.DS.stopped)return;t[n](e)}})),i(this,"_handlePrePublish",(function(t,e){for(var n=t.length;n--;){if(r.DS.stopped)return;t[n](e)}})),this.DS=s})),X=function(t){o(r,d(Set));var e=p(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"_rects",void 0),i(h(s),"_timeout",void 0),i(h(s),"init",(function(){return z(s.Settings.selectables).forEach((function(t){return s.add(t)}))})),i(h(s),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"_onClick",(function(t){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:t})})),i(h(s),"_onPointer",(function(t){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:t})})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),i(h(s),"getRect",(function(t){return s._rects?s.rects.get(t):t.getBoundingClientRect()})),s.DS=o,s.Settings=o.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",(function(){s.clear(),s.init()})),s.DS.subscribe("Settings:updated:selectableClass",(function(t){var e=t.settings;s.forEach((function(t){t.classList.remove(e["selectableClass:pre"]),t.classList.add(e.selectableClass)}))})),s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:added:pre",e),t.classList.add(this.Settings.selectableClass),t.addEventListener("click",this._onClick),this.Settings.usePointerEvents?t.addEventListener("pointerdown",this._onPointer,{passive:!1}):t.addEventListener("mousedown",this._onPointer),t.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&M({computedStyle:window.getComputedStyle(t),node:t}),this.DS.publish("Selectable:added",e),g(a(r.prototype),"add",this).call(this,t)}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:removed:pre",e),t.classList.remove(this.Settings.selectableClass),t.classList.remove(this.Settings.hoverClass),t.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?t.removeEventListener("pointerdown",this._onPointer,{passive:!1}):t.removeEventListener("mousedown",this._onPointer),t.removeEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.publish("Selectable:removed",e),g(a(r.prototype),"delete",this).call(this,t)}}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var t=this;return this._rects||(this._rects=new Map,this.forEach((function(e){return t._rects.set(e,e.getBoundingClientRect())})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._rects=null}),this.Settings.refreshMemoryRate)),this._rects}}]),r}(),q=function(t){o(r,d(Set));var e=p(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),s.DS=o,s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selected:added:pre",e),g(a(r.prototype),"add",this).call(this,t),t.classList.add(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)+1),this.DS.publish("Selected:added",e),this}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};this.DS.publish("Selected:removed:pre",e);var n=g(a(r.prototype),"delete",this).call(this,t);return t.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)-1),this.DS.publish("Selected:removed",e),n}}},{key:"toggle",value:function(t){return this.has(t)?this.delete(t):this.add(t),t}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(),$=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevSelectedSet",void 0),i(this,"start",(function(t){var e=t.event;t.isDragging||(r._storePrevious(e),r._handleInsideSelection(!0,e))})),i(this,"update",(function(t){t.isDragging||r.DS.continue||r._handleInsideSelection()})),i(this,"_handleInsideSelection",(function(t,e){var n,s=r.DS,i=s.SelectableSet,o=s.SelectorArea,a=s.Selector,l=r.DS.stores.KeyStore.isMultiSelectKeyPressed(e)&&r.Settings.multiSelectToggling,c=r.Settings.selectionThreshold,u=i.rects,d=a.rect,h=new Map,S=new Map,p=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=m(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(u);try{for(p.s();!(n=p.n()).done;){var f=v(n.value,2),g=f[0],b=f[1];o.isInside(g,b)&&(O(b,d,c)?h.set(g,b):S.set(g,b))}}catch(t){p.e(t)}finally{p.f()}if(!r.DS.continue){var y=r.filterSelected({select:h,unselect:S,selectorRect:d}),D=y.select,_=y.unselect;D.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.multiSelectionToggle,s=t.SelectedSet,i=t.hoverClassName;e.classList.contains(i)&&!n||(s.has(e)?r&&s.delete(e):s.add(e),e.classList.add(i))}({element:n,force:t,multiSelectionToggle:l,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})})),_.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.SelectedSet,s=t.PrevSelectedSet,i=t.hoverClassName;if(!e.classList.contains(i)&&!n)return!1;var o=r.has(e),a=s.has(e);o&&!a?r.delete(e):!o&&a&&r.add(e),e.classList.remove(i)}({element:n,force:t,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})}))}})),i(this,"filterSelected",(function(t){var e=t.select,n=t.unselect;return t.selectorRect,{select:e,unselect:n}})),this.DS=s,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(t,[{key:"_storePrevious",value:function(t){var e=this.DS,n=e.stores.KeyStore,r=e.SelectedSet;n.isMultiSelectKeyPressed(t)?this._prevSelectedSet=new Set(r):this._prevSelectedSet=new Set}}]),t}(),J=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_rect",void 0),i(this,"attachSelector",(function(){var t,e,n,s;r.HTMLNode&&null!==(t=r.DS.SelectorArea)&&void 0!==t&&t.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||(n=r.DS.stores.SettingsStore.s.customStyles,(s=document.createElement("div")).style.position="absolute",n||(s.style.background="rgba(0, 175, 255, 0.2)",s.style.border="1px solid rgba(0, 175, 255, 0.8)",s.style.display="none",s.style.pointerEvents="none"),s),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&null!==(e=r.DS.SelectorArea)&&void 0!==e&&e.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)})),i(this,"start",(function(t){if(!t.isDragging){var e=r.DS.stores.PointerStore.initialValArea;B(r.HTMLNode,w(e,1)),r.HTMLNode.style.display="block",r._rect=null}})),i(this,"stop",(function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"})),i(this,"update",(function(t){if(!t.isDragging&&!r.DS.continue){var e=r.DS.stores,n=e.ScrollStore,s=e.PointerStore,i=function(t){var e=t.scrollAmount,n=t.initialPointerPos,r=t.pointerPos,s={};return r.x>n.x-e.x?(s.left=n.x-e.x,s.width=r.x-n.x+e.x):(s.left=r.x,s.width=n.x-r.x-e.x),r.y>n.y-e.y?(s.top=n.y-e.y,s.height=r.y-n.y+e.y):(s.top=r.y,s.height=n.y-r.y-e.y),s}({scrollAmount:n.scrollAmount,initialPointerPos:s.initialValArea,pointerPos:s.currentValArea});B(r.HTMLNode,i),r._rect=null}})),this.DS=s,this.DS.subscribe("Settings:updated:selectorClass",(function(t){var e=t.settings;r.HTMLNode.classList.remove(e["selectorClass:pre"]),r.HTMLNode.classList.add(e.selectorClass)})),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),Q=function(){function t(e){var r,s=this,o=e.DS;n(this,t),i(this,"_scrollInterval",void 0),i(this,"_rect",void 0),i(this,"currentEdges",[]),i(this,"start",(function(){s.applyElements("append"),s.updatePos()})),i(this,"applyElements",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",e=document.body?"body":"documentElement",n="".concat(t,"Child");s.HTMLNode[n](s.DS.Selector.HTMLNode),document[e][n](s.HTMLNode)})),i(this,"updatePos",(function(){s._rect=null;var t=s.DS.Area.rect,e=s.DS.Area.computedBorder,n=s.HTMLNode.style,r="".concat(t.top+e.top,"px"),i="".concat(t.left+e.left,"px"),o="".concat(t.width,"px"),a="".concat(t.height,"px");n.top!==r&&(n.top=r),n.left!==i&&(n.left=i),n.width!==o&&(n.width=o),n.height!==a&&(n.height=a)})),i(this,"stop",(function(t){s.stopAutoScroll(),t&&s.applyElements("remove")})),i(this,"startAutoScroll",(function(){s.currentEdges=[],s._scrollInterval=setInterval((function(){return s.handleAutoScroll()}),16)})),i(this,"handleAutoScroll",(function(){if(!s.DS.continue){var t=s.DS,e=t.stores.PointerStore,n=t.Area;s.currentEdges=x({elementRect:w(e.currentVal),containerRect:s.rect,tolerance:s.DS.stores.SettingsStore.s.overflowTolerance}),s.currentEdges.length&&n.scroll(s.currentEdges,s.DS.stores.SettingsStore.s.autoScrollSpeed)}})),i(this,"stopAutoScroll",(function(){s.currentEdges=[],clearInterval(s._scrollInterval)})),i(this,"isInside",(function(t,e){return!(!s.DS.Area.HTMLNode.contains(t)||!s.DS.stores.ScrollStore.canScroll)||O(s.rect,e||t.getBoundingClientRect())})),this.DS=o,this.HTMLNode=((r=document.createElement("div")).style.position="fixed",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="999999999999999999",r),this.DS.subscribe("Settings:updated:selectorAreaClass",(function(t){var e=t.settings;s.HTMLNode.classList.remove(e["selectorAreaClass:pre"]),s.HTMLNode.classList.add(e.selectorAreaClass)})),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",(function(){s.updatePos(),s.stopAutoScroll()}))}return s(t,[{key:"isClicked",value:function(t){var e=this.DS.stores.PointerStore,n=t?e.getPointerPosition(t):e.initialVal;return console.log("isClicked",n,this.rect,this.HTMLNode),O({left:n.x,top:n.y,right:n.x,bottom:n.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),tt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_currentValues",new Set),i(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),i(this,"init",(function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)})),i(this,"keydown",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:t,key:e}),r._currentValues.add(e),r.DS.publish("KeyStore:down",{event:t,key:e})})),i(this,"keyup",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:t,key:e}),r._currentValues.delete(e),r.DS.publish("KeyStore:up",{event:t,key:e})})),i(this,"stop",(function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()})),i(this,"reset",(function(){return r._currentValues.clear()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init)}return s(t,[{key:"isMultiSelectKeyPressed",value:function(t){var e=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var n=this.DS.stores.SettingsStore.s.multiSelectKeys.map((function(t){return t.toLocaleLowerCase()}));return!!this.currentValues.some((function(t){return n.includes(t.toLocaleLowerCase())}))||!(!t||!n.some((function(n){return t[e._keyMapping[n]]})))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),t}(),et=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_isMouseInteraction",!1),i(this,"_initialValArea",void 0),i(this,"_currentValArea",void 0),i(this,"_lastValArea",void 0),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_lastVal",void 0),i(this,"_lastTouch",void 0),i(this,"init",(function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})})),i(this,"getPointerPosition",(function(t){return function(t){var e=t.event;return{x:e.clientX,y:e.clientY}}({event:r._normalizedEvent(t)})})),i(this,"update",(function(t){t&&(r.DS.publish("PointerStore:updated:pre",{event:t}),r.currentVal=r.getPointerPosition(t),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:t}))})),i(this,"stop",(function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout((function(){return r._isMouseInteraction=!1}),100)})),i(this,"reset",(function(t){t&&(r.currentVal=r.lastVal=r.getPointerPosition(t),r.stop(),r.init())})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:end",(function(t){var e=t.event;return r.reset(e)}))}return s(t,[{key:"start",value:function(t){t&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(t))}},{key:"_normalizedEvent",value:function(t){return"touches"in t&&"touchend"!==t.type&&(this._lastTouch=t),"touches"in t?this._lastTouch.touches[0]:t}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(t){this._initialVal=t,this._initialValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(t){this._currentVal=t,this._currentValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(t){this._lastVal=t,this._lastValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}}]),t}(),nt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_canScroll",void 0),i(this,"init",(function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"start",(function(){r._currentVal=r._initialVal=A(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"update",(function(){return r._currentVal=A(r.DS.stores.SettingsStore.s.area)})),i(this,"stop",(function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null})),i(this,"reset",(function(){r.stop(),r.start()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return r.start()})),this.DS.subscribe("Interaction:end",(function(){return r.reset()}))}return s(t,[{key:"canScroll",get:function(){return"boolean"==typeof this._canScroll?this._canScroll:this._canScroll=(t=this.DS.stores.SettingsStore.s.area,!!((e=A(t)).x||e.y||(t instanceof Document?t.body?t.body.scrollTop=1:t.documentElement.scrollTop=1:t.scrollTop=1)));var t,e}},{key:"scrollAmount",get:function(){var t,e=_(this.currentVal,"-",this.initialVal),n={x:t=this.DS.stores.SettingsStore.s.zoom,y:t},r=_(_(e,"*",n),"-",e);return{x:e.x+r.x,y:e.y+r.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=A(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),t}(),rt=s((function t(r){var s=this,o=r.DS,a=r.settings;n(this,t),i(this,"_settings",{}),i(this,"s",{}),i(this,"update",(function(t){var n=t.settings,r=t.init;return s.DS.publish("Settings:updated:pre",e({settings:n},r?{init:r}:{}))})),i(this,"_update",(function(t){for(var n=function(t,n){return e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e({},R("area",t.area,n,document)),R("selectables",t.selectables,n,null)),R("autoScrollSpeed",t.autoScrollSpeed,n,5)),R("overflowTolerance",t.overflowTolerance,n,{x:25,y:25})),R("zoom",t.zoom,n,1)),R("customStyles",t.customStyles,n,!1)),R("multiSelectMode",t.multiSelectMode,n,!1)),R("multiSelectToggling",t.multiSelectToggling,n,!0)),R("multiSelectKeys",t.multiSelectKeys,n,["Control","Shift","Meta"])),R("selector",t.selector,n,null)),R("selectionThreshold",t.selectionThreshold,n,0)),R("draggability",t.draggability,n,!0)),R("immediateDrag",t.immediateDrag,n,!0)),R("keyboardDrag",t.keyboardDrag,n,!0)),R("dragKeys",t.dragKeys,n,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),R("keyboardDragSpeed",t.keyboardDragSpeed,n,10)),R("useTransform",t.useTransform,n,!0)),R("refreshMemoryRate",t.refreshMemoryRate,n,80)),R("dropZones",t.dropZones,n,[])),R("dropInsideThreshold",t.dropInsideThreshold,n,1)),R("dropTargetThreshold",t.dropTargetThreshold,n,0)),R("usePointerEvents",t.usePointerEvents,n,!1)),R("hoverClass",t.hoverClass,n,"ds-hover")),R("selectableClass",t.selectableClass,n,"ds-selectable")),R("selectedClass",t.selectedClass,n,"ds-selected")),R("selectorClass",t.selectorClass,n,"ds-selector")),R("selectorAreaClass",t.selectorAreaClass,n,"ds-selector-area")),R("droppedTargetClass",t.droppedTargetClass,n,"ds-dropped-target")),R("droppedInsideClass",t.droppedInsideClass,n,"ds-dropped-inside")),R("droppableClass",t.droppableClass,n,"ds-droppable")),R("dropZoneClass",t.dropZoneClass,n,"ds-dropzone")),R("dropZoneReadyClass",t.dropZoneReadyClass,n,"ds-dropzone-ready")),R("dropZoneTargetClass",t.dropZoneTargetClass,n,"ds-dropzone-target")),R("dropZoneInsideClass",t.dropZoneInsideClass,n,"ds-dropzone-inside")),R("dragAsBlock",t.dragAsBlock,n,!1))}(t.settings,t.init),r=function(){var t,e=v(a[o],2),n=e[0],r=e[1];n in s._settings||Object.defineProperty(s.s,n,{get:function(){return s._settings[n]},set:function(t){return s.update({settings:i({},n,t)})}}),s._settings["".concat(n,":pre")]=s._settings[n],s._settings[n]=r;var l={settings:(t={},i(t,n,s._settings[n]),i(t,"".concat(n,":pre"),s._settings["".concat(n,":pre")]),t)};s.DS.publish("Settings:updated",l),s.DS.publish("Settings:updated:".concat(n),l)},o=0,a=Object.entries(n);o<a.length;o++)r()})),this.DS=o,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})})),st=function(){function t(r){var s=this;n(this,t),i(this,"continue",!1),i(this,"start",(function(){s.stopped=!1,s.Interaction.init()})),i(this,"break",(function(){return s.continue=!0})),i(this,"setSettings",(function(t){return s.stores.SettingsStore.update({settings:t})})),i(this,"getSelection",(function(){return s.SelectedSet.elements})),i(this,"getSelectables",(function(){return s.SelectableSet.elements})),i(this,"getInitialCursorPosition",(function(){return s.stores.PointerStore.initialVal})),i(this,"getCurrentCursorPosition",(function(){return s.stores.PointerStore.currentVal})),i(this,"getPreviousCursorPosition",(function(){return s.stores.PointerStore.lastVal})),i(this,"getInitialCursorPositionArea",(function(){return s.stores.PointerStore.initialValArea})),i(this,"getCurrentCursorPositionArea",(function(){return s.stores.PointerStore.currentValArea})),i(this,"getPreviousCursorPositionArea",(function(){return s.stores.PointerStore.lastValArea})),i(this,"isMultiSelect",(function(t){return s.stores.KeyStore.isMultiSelectKeyPressed(t)})),i(this,"isDragging",(function(){return s.Interaction.isDragging})),i(this,"getZoneByCoordinates",(function(t){var e;return null===(e=s.DropZones.getTarget(t))||void 0===e?void 0:e.toObject()})),i(this,"getItemsDroppedByZoneId",(function(t){return s.DropZones.getItemsDroppedById(t)})),i(this,"getItemsInsideByZoneId",(function(t,e){return s.DropZones.getItemsInsideById(t,e)})),this.PubSub=new U({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new rt({DS:this,settings:r}),this.stores.PointerStore=new et({DS:this}),this.stores.ScrollStore=new nt({DS:this}),this.stores.KeyStore=new tt({DS:this}),this.Area=new H({DS:this}),this.Selector=new J({DS:this}),this.SelectorArea=new Q({DS:this}),this.SelectableSet=new X({DS:this}),this.SelectedSet=new q({DS:this}),this.Selection=new $({DS:this}),this.Drag=new F({DS:this}),this.DropZones=new W({DS:this}),this.Interaction=new G({DS:this}),function(t){for(var n=t.subscribe,r=t.publish,s=t.Interaction,i=t.SelectedSet,o=t.DropZones,a={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(t){return t.event}}],"Interaction:end":[{name:"callback",extraData:function(){var t=o.getTarget();return e({},t?{dropTarget:t.toObject()}:{})}}]},l=function(){var t=v(u[c],2),o=t[0],a=t[1];["pre",!1].forEach((function(t){return n(t?"".concat(o,":").concat(t):o,(function(n){return a.forEach((function(o){return(!o.condition||o.condition(n))&&r(t?"".concat(t).concat(o.name):o.name,e(e({items:i.elements,isDragging:s.isDragging},n),o.extraData?o.extraData(n):{}))}))}))}))},c=0,u=Object.entries(a);c<u.length;c++)l()}({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",(function(){return s.continue=!1})),this.start()}return s(t,[{key:"stop",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(t),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),t&&this.SelectableSet.clear(),e&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(z(t)),n||this.addSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(z(t)),n&&this.removeSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return z(t).forEach((function(s){return e.SelectedSet.has(s)?e.removeSelection(t,n,r):e.addSelection(t,n,r)})),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(t,e,n),this.getSelection()}},{key:"clearSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.SelectedSet.clear(),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(t,e,n){var r=z(t);return this.SelectableSet.addAll(r),e&&this.SelectedSet.addAll(r),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}},{key:"setSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(t,e),this.addSelectables(t,n)}},{key:"removeSelectables",value:function(t,e,n){return this.SelectableSet.deleteAll(z(t)),e&&this.removeSelection(t),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}}]),t}();st.isCollision=O;export{st as default}; | ||
function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D(r.key),r)}}function s(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t,e,n){return(e=D(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,n){return u=c()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var s=new(Function.bind.apply(t,r));return n&&l(s,n.prototype),s},u.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return u(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)},d(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function p(t){var e=c();return function(){var n,r=a(t);if(e){var s=a(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return S(this,n)}}function f(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}function g(){return g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=f(t,e);if(r){var s=Object.getOwnPropertyDescriptor(r,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},g.apply(this,arguments)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,i,o,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var _=function(t,e,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{"+":{x:r+i,y:s+o},"-":{x:r-i,y:s-o},"*":{x:r*i,y:s*o},"/":{x:r/i,y:s/o}}[e]},I=function(t){return{x:t.left,y:t.top}},w=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{left:t.x,top:t.y,right:t.x,bottom:t.y,width:e,height:e}},L=function(t,e){var n=e;window.addEventListener("resize",n),window.addEventListener("scroll",n);var r=new MutationObserver(n);t.forEach((function(t,e){r.observe(t,{childList:0!==e,attributes:!0})}));return{observer:r,callback:n,cleanup:function(){return j(r,n)}}},P=function(t,e){var n;return function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];var o=function(){n=null,t.apply(void 0,s)};clearTimeout(n),n=setTimeout(o,e)}},C=function(){var t,e,n,r;return{y:(null===(t=document.body)||void 0===t?void 0:t.scrollTop)||(null===(e=document.documentElement)||void 0===e?void 0:e.scrollTop)||0,x:(null===(n=document.body)||void 0===n?void 0:n.scrollLeft)||(null===(r=document.documentElement)||void 0===r?void 0:r.scrollLeft)||0}},E=function(t){return function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=null===(n=e[r])||void 0===n?void 0:n.parentNode;return s?(e.push(s),t(e,++r)):e}([t])},A=function(t,e){var n={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return z(t).forEach((function(t){var r=e.getRect(t);n.top=Math.min(n.top,r.top),n.left=Math.min(n.left,r.left),n.bottom=Math.max(n.bottom,r.bottom),n.right=Math.max(n.right,r.right)})),n.height=n.bottom-n.top,n.width=n.right-n.left,n},T=function(t){return!t||t instanceof Document?C():{x:t.scrollLeft>=0?t.scrollLeft:C().x,y:t.scrollTop>=0?t.scrollTop:C().y}},x=function(t){var e=t.elementRect,n=t.containerRect,r=t.tolerance,s=void 0===r?{x:0,y:0}:r,i=[];return e.top-s.y<n.top&&i.push("top"),e.left-s.x<n.left&&i.push("left"),e.bottom+s.y>n.bottom&&i.push("bottom"),e.right+s.y>n.right&&i.push("right"),i},k=function(t){var e={x:0,y:0},n=window.getComputedStyle(t);if(!n.transform||"none"===n.transform)return e;if(n.transform.indexOf("3d")>=0){var r=n.transform.trim().match(/matrix3d\((.*?)\)/);if(r&&r.length){var s,i=null===(s=r[1])||void 0===s?void 0:s.split(",");e.x=parseInt(i[12])||0,e.y=parseInt(i[13])||0}return e}var o=n.transform.trim().match(/matrix\((.*?)\)/);if(o&&o.length){var a,l=null===(a=o[1])||void 0===a?void 0:a.split(",");e.x=parseInt(l[4])||0,e.y=parseInt(l[5])||0}return e},N=function(t,e){return e?function(t){var e=t.style.transform;if(!e||e.indexOf("translate")<0)return k(t);var n={x:0,y:0},r=e.trim().match(/translate[3dD]*?\(.*?\)/);if(r){var s,i=null===(s=r[0])||void 0===s?void 0:s.split("(");if(i){var o,a=null===(o=i[1])||void 0===o?void 0:o.split(",");n.x=parseInt(a[0])||0,n.y=parseInt(a[1])||0}}return n.x||n.x?n:k(t)}(t):function(t){var e=t.style,n={x:parseInt(e.left)||0,y:parseInt(e.top)||0};if(!n.x&&!n.x){var r=window.getComputedStyle(t);return{x:parseInt(r.left)||0,y:parseInt(r.top)||0}}return n}(t)},M=function(t){var e=t.computedStyle,n=t.node,r=e.position;n instanceof Document||("absolute"===r||"relative"===r||"fixed"===r)||(n.style.position="relative")},V=function(t,e,n){return console.warn('[DragSelect] TypeIssue: setting "'.concat(t,'" is not of type "').concat(e,'".'))},R=function(t,e,n,r){if(void 0===e)return n?i({},t,r):{};if(null===e)return i({},t,null);var s=!0,o=!1,a="string"==typeof r;a&&(s="string"==typeof e||e instanceof String),a&&!s&&(o=!0,V(t,"string"));var l=!Number.isNaN(r)&&"number"==typeof r;l&&(s=!Number.isNaN(e)&&"number"==typeof e),l&&!s&&(o=!0,V(t,"number"));var c="[object Object]"===Object.prototype.toString.call(r);c&&(s="[object Object]"===Object.prototype.toString.call(e)),c&&!s&&(o=!0,V(t,"object"));var u="boolean"==typeof r;u&&(s="boolean"==typeof e),u&&!s&&(o=!0,V(t,"boolean"));var d=Array.isArray(r);d&&(s=Array.isArray(e)),d&&!s&&(o=!0,V(t,"array"));var h=o||n;return"dragKeys"===t&&s?i({},t,Object.assign(r,e)):"dragKeys"!==t||s?("dropZones"===t&&s&&new Set(e.map((function(t){return t.id}))).size!==e.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),s?i({},t,e):h?i({},t,r):{}):h?i({},t,r):{}},O=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t;if(n>0){var s=(t.right-t.left)*n,i=(t.bottom-t.top)*n;r={left:t.left+s,right:t.right-s,top:t.top+i,bottom:t.bottom-i}}return r.left<e.right&&r.right>e.left&&r.top<e.bottom&&r.bottom>e.top},K=function(t){var e=t.element,n=t.posDirection,r=t.containerRect,s=t.useTransform,i=N(e,s),o=_(i,"+",n);Z(e,o,s);var a=e.getBoundingClientRect();!function(t){var e=t.element,n=t.edges,r=t.elementRect,s=t.containerRect,i=t.elementPos,o=t.useTransform;n.includes("top")&&Z(e,{y:i.y+s.top-r.top,x:i.x},o),n.includes("left")&&Z(e,{y:i.y,x:i.x+s.left-r.left},o),n.includes("bottom")&&Z(e,{y:i.y+s.bottom-r.bottom,x:i.x},o),n.includes("right")&&Z(e,{y:i.y,x:i.x+s.right-r.right},o)}({element:e,edges:x({elementRect:a,containerRect:r}),elementRect:a,containerRect:r,elementPos:o,useTransform:s})},j=function(t,e){window.removeEventListener("resize",e),window.removeEventListener("scroll",e),t.disconnect()},Z=function(t,e,n){if(n){var r=t.style.transform;t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,1px) ").concat(r.replace(/translate.*?\)/g,""))}else t.style.left="".concat(e.x,"px"),t.style.top="".concat(e.y,"px");return t},z=function(t){return t?!Array.isArray(t)&&(t instanceof HTMLElement||t instanceof SVGElement)?[t]:b(new Set(b(t))):[]},B=function(t,e){t.style.left="".concat(e.left,"px"),t.style.top="".concat(e.top,"px"),t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px")},H=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"DS",void 0),i(this,"_observers",void 0),i(this,"_node",void 0),i(this,"_parentNodes",void 0),i(this,"_computedStyle",void 0),i(this,"_computedBorder",void 0),i(this,"_rect",void 0),i(this,"setArea",(function(t){r.reset(),r._node=t,M({computedStyle:r.computedStyle,node:r._node}),setTimeout((function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})}))})),i(this,"start",(function(){r._observers=L(r.parentNodes,P((function(t){r.DS.PubSub.publish("Area:modified:pre",{event:t,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:t,item:r})}),60))})),i(this,"reset",(function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0})),i(this,"stop",(function(){r._observers.cleanup(),r.reset()})),i(this,"scroll",(function(t,e){var n={scroll_directions:t,scroll_multiplier:e};r.DS.PubSub.publish("Area:scroll:pre",n),function(t,e,n){if(e.length){var r=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=t instanceof Document?r||document.body:t,i=e.includes("top")&&s.scrollTop>0,o=e.includes("bottom")&&s.scrollTop<s.scrollHeight,a=e.includes("left")&&s.scrollLeft>0,l=e.includes("right")&&s.scrollLeft<s.scrollWidth;i&&(s.scrollTop-=1*n),o&&(s.scrollTop+=1*n),a&&(s.scrollLeft-=1*n),l&&(s.scrollLeft+=1*n)}}(r._node,t,e),r.DS.PubSub.publish("Area:scroll",n)})),this.DS=s,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.setArea(e.area)})),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return s(t,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof Document?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=function(t,e){if(t instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=t.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(t.clientWidth||n.width)*e,height:(t.clientHeight||n.height)*e}}(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=E(this.HTMLNode)}}]),t}(),F=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevCursorPos",void 0),i(this,"_prevScrollPos",void 0),i(this,"_elements",[]),i(this,"_dragKeys",void 0),i(this,"_dragKeysFlat",[]),i(this,"_selectionRect",void 0),i(this,"assignDragkeys",(function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map((function(t){return t.toLowerCase()})),down:r.DS.stores.SettingsStore.s.dragKeys.down.map((function(t){return t.toLowerCase()})),left:r.DS.stores.SettingsStore.s.dragKeys.left.map((function(t){return t.toLowerCase()})),right:r.DS.stores.SettingsStore.s.dragKeys.right.map((function(t){return t.toLowerCase()}))},r._dragKeysFlat=[].concat(b(r._dragKeys.up),b(r._dragKeys.down),b(r._dragKeys.left),b(r._dragKeys.right))})),i(this,"keyboardDrag",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability&&!r.DS.continue){var s={event:e,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],s),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=A(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var i=function(t){var e=t.shiftKey,n=t.keyboardDragSpeed,r=t.zoom,s=t.key,i=t.dragKeys,o=t.scrollDiff,a=t.canScroll,l=t.scrollCallback,c={x:0,y:0},u=e?4*n*r:n*r;return i.left.includes(s)&&(c.x=o.x||-u,e||o.x||!a||l(["left"],n)),i.right.includes(s)&&(c.x=o.x||u,e||o.x||!a||l(["right"],n)),i.up.includes(s)&&(c.y=o.y||-u,e||o.y||!a||l(["top"],n)),i.down.includes(s)&&(c.y=o.y||u,e||o.y||!a||l(["bottom"],n)),c}({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:n,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(i=r.limitDirection(i)),r._elements.forEach((function(t){return K({element:t,posDirection:i,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})),r.DS.publish(["Interaction:update:pre","Interaction:update"],s)}})),i(this,"keyboardEnd",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability){var s={event:e,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],s)}})),i(this,"start",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;e&&!n&&(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=A(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))})),i(this,"stop",(function(t){null!=t&&t.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])})),i(this,"update",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;if(e&&r._elements.length&&!n&&!r.DS.continue){var s=_(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(s=r.limitDirection(s)),r._elements.forEach((function(t){return K({element:t,posDirection:s,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}))}})),i(this,"limitDirection",(function(t){var e=r.DS.SelectorArea.rect,n=r.DS.stores.ScrollStore.scrollAmount,s={top:e.top-r._selectionRect.top+n.y,left:e.left-r._selectionRect.left+n.x,bottom:e.bottom-r._selectionRect.bottom+n.y,right:e.right-r._selectionRect.right+n.x};return 0===t.x&&0===t.y||(t.y<0&&(t.y=Math.max(t.y,s.top)),t.x<0&&(t.x=Math.max(t.x,s.left)),t.y>0&&(t.y=Math.min(t.y,s.bottom)),t.x>0&&(t.x=Math.min(t.x,s.right)),r._selectionRect.top+=t.y,r._selectionRect.bottom+=t.y,r._selectionRect.left+=t.x,r._selectionRect.right+=t.x),t})),i(this,"handleZIndex",(function(t){r._elements.forEach((function(e){return e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)+t?9999:-9998)}))})),this.DS=s,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(t,[{key:"_cursorDiff",get:function(){var t=this.DS.stores.PointerStore.currentVal,e=this._prevCursorPos?_(t,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=t,e}},{key:"_scrollDiff",get:function(){var t=this.DS.stores.ScrollStore.currentVal,e=this._prevScrollPos?_(t,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=t,e}}]),t}(),Y=function(){function t(e){var r=this,s=e.DS,o=e.id,a=e.element,l=e.droppables;n(this,t),i(this,"id",void 0),i(this,"element",void 0),i(this,"_droppables",void 0),i(this,"_rect",void 0),i(this,"_observers",void 0),i(this,"_timeout",void 0),i(this,"_itemsDropped",[]),i(this,"_itemsInside",void 0),i(this,"setReadyClasses",(function(t){if(!r.isDestroyed){var e=r.droppables.filter((function(t){return r.DS.SelectedSet.has(t)}));e.length&&(e.forEach((function(e){e.classList[t]("".concat(r.Settings.droppableClass)),e.classList[t]("".concat(r.Settings.droppableClass,"-").concat(r.id))})),r.element.classList[t]("".concat(r.Settings.dropZoneReadyClass)))}})),i(this,"handleNoDrop",(function(){var t;r.isDestroyed||(r.DS.SelectedSet.forEach((function(t){t.classList.remove(r.Settings.droppedTargetClass),t.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),r._itemsDropped=r._itemsDropped.filter((function(t){return!r.DS.SelectedSet.has(t)})),null!==(t=r._itemsDropped)&&void 0!==t&&t.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleDrop",(function(){var t,e,n;r.isDestroyed||(r._itemsDropped=b(new Set([].concat(b(r._itemsDropped),b(null===(t=r.droppables)||void 0===t?void 0:t.filter((function(t){return r.DS.SelectedSet.has(t)})))))),null===(e=r._itemsDropped)||void 0===e||e.forEach((function(t){t.classList.add("".concat(r.Settings.droppedTargetClass)),t.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),null!==(n=r._itemsDropped)&&void 0!==n&&n.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleItemsInsideClasses",(function(){var t=!1;r.droppables.forEach((function(e){r.itemsInside.includes(e)?(e.classList.add("".concat(r.Settings.droppedInsideClass)),e.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),t=!0):(e.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),e.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||e.classList.remove("".concat(r.Settings.droppedInsideClass)))})),t?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))})),i(this,"start",(function(t){t.isDragging&&!r.isDestroyed&&r.setReadyClasses("add")})),i(this,"stop",(function(t){t.isDragging&&!r.isDestroyed&&(r.setReadyClasses("remove"),r.handleItemsInsideClasses())})),i(this,"toObject",(function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.id=o,this.element=a,l&&(this.droppables=z(l)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",(function(t){var e=t.settings;r.element&&(r.element.classList.remove(e["dropZoneClass:pre"]),r.element.classList.add(e.dropZoneClass))})),this._observers=L(this.parentNodes,P((function(){return r._rect=null}),this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"destroy",value:function(){var t=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach((function(e){e.classList.remove("".concat(t.Settings.droppedTargetClass)),e.classList.remove("".concat(t.Settings.droppedTargetClass,"-").concat(t.id)),e.classList.remove("".concat(t.Settings.droppableClass)),e.classList.remove("".concat(t.Settings.droppableClass,"-").concat(t.id))})),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var t=this;return this.isDestroyed?null:(this._itemsInside||(this._itemsInside=this.droppables.flatMap((function(e){return O(t.DS.SelectableSet.rects.get(e),t.rect,t.Settings.dropInsideThreshold)?[e]:[]})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._itemsInside=null}),this.Settings.refreshMemoryRate)),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=E(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(t){this._droppables=t}}]),t}(),W=s((function t(r){var s=this,o=r.DS;n(this,t),i(this,"_zoneByElement",new Map),i(this,"_zoneById",new Map),i(this,"_zonesByDroppable",new Map),i(this,"_zones",void 0),i(this,"setDropZones",(function(t){var n=t.dropZones;n&&(s._zones&&s._zones.forEach((function(t){return t.destroy()})),s._zones=n.map((function(t){return new Y(e({DS:s.DS},t))})),s._zones.forEach((function(t){s._zoneByElement.set(t.element,t),s._zoneById.set(t.id,t),t.droppables.forEach((function(e){var n=s._zonesByDroppable.get(e);if(null==n||!n.length)return s._zonesByDroppable.set(e,[t]);s._zonesByDroppable.set(e,b(new Set([].concat(b(n),[t]))))}))})))})),i(this,"_handleDrop",(function(t){s._zones.forEach((function(e){e!==t&&e.handleNoDrop()})),t&&t.handleDrop()})),i(this,"_getZoneByElementsFromPoint",(function(t,e){for(var n=e.x,r=e.y,i=0,o=t.length;i<o;i++){var a=s._zoneByElement.get(t[i]);if(a&&O(a.rect,{left:n,right:n,top:r,bottom:r},Math.min(s.Settings.dropTargetThreshold,.5)))return a}})),i(this,"stop",(function(t){if(t.isDragging){var e=s.getTarget();s._handleDrop(e)}})),i(this,"getItemsDroppedById",(function(t){var e=s._zoneById.get(t);return e?e.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(t,")"))})),i(this,"getItemsInsideById",(function(t,e){var n=s._zoneById.get(t);if(!n)return console.warn("[DragSelect] No zone found (id: ".concat(t,")"));var r=n.itemsInside;return e&&n.handleItemsInsideClasses(),r})),i(this,"getTarget",(function(t){var e;if(null!==(e=s._zones)&&void 0!==e&&e.length){var n=(null==t?void 0:t.x)||s.DS.stores.PointerStore.currentVal.x,r=(null==t?void 0:t.y)||s.DS.stores.PointerStore.currentVal.y,i=document.elementsFromPoint(n,r);return s._getZoneByElementsFromPoint(i,{x:n,y:r})}})),this.DS=o,this.Settings=o.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",(function(t){var e=t.settings;return s.setDropZones(e)})),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)})),G=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"isInteracting",void 0),i(this,"isDragging",void 0),i(this,"init",(function(){return r.DS.publish("Interaction:init:pre",{})})),i(this,"_init",(function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})})),i(this,"start",(function(t){return r.DS.publish("Interaction:start:pre",{event:t,isDragging:r.isDragging})})),i(this,"_start",(function(t){"touchstart"===t.type&&t.preventDefault(),r._canInteract(t)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(t),r.DS.publish("Interaction:start",{event:t,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))})),i(this,"isDragEvent",(function(t){var e=t.target.closest(".".concat(r.Settings.selectableClass));return!(!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(t)||!e)&&(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(e)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(e)):r.DS.SelectedSet.add(e)),!!r.DS.SelectedSet.has(e))})),i(this,"onClick",(function(t){var e=t.event;if(r._canInteract(e)&&!(e.detail>0)){var n=r.DS,s=n.stores,i=s.PointerStore,o=s.KeyStore,a=n.SelectableSet,l=n.SelectedSet;i.start(e);var c=e.target;a.has(c)&&(o.isMultiSelectKeyPressed(e)||l.clear(),l.toggle(c),r.reset())}})),i(this,"stop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(t.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(t.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),t.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)})),i(this,"update",(function(t){var e=t.event,n=t.scroll_directions,s=t.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:e,scroll_directions:n,scroll_multiplier:s,isDragging:r.isDragging})})),i(this,"reset",(function(t){return r.DS.publish("Interaction:end:pre",{event:t,isDragging:r.isDragging})})),i(this,"_reset",(function(t){var e=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:t,isDragging:e})})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.stop(e["area:pre"]),r.init()})),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:start:pre",(function(t){var e=t.event;return r._start(e)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(t){var e=t.event;return r._reset(e)})),this.DS.subscribe("Area:scroll",this.update)}return s(t,[{key:"_canInteract",value:function(t){var e=0===t.clientX&&0===t.clientY&&0===t.detail&&t.target;return!(2===t.button||this.isInteracting||t.target&&!this.DS.SelectorArea.isInside(t.target)||!e&&!this.DS.SelectorArea.isClicked(t))}}]),t}(),U=s((function t(e){var r=this,s=e.DS;n(this,t),i(this,"subscribers",{}),i(this,"subscribe",(function(t,e){return Array.isArray(r.subscribers[t])||(r.subscribers[t]=[]),r.subscribers[t].push(e),r.subscribers[t].length-1})),i(this,"unsubscribe",(function(t,e,n){n>=0?r.subscribers[t].splice(n,1):e&&(r.subscribers[t]=r.subscribers[t].filter((function(t){return t!==e})))})),i(this,"publish",(function(t,e){Array.isArray(t)?t.forEach((function(t){return r._publish(t,e)})):r._publish(t,e)})),i(this,"_publish",(function(t,e){var n=r.subscribers[t];Array.isArray(n)&&(t.includes(":pre")?r._handlePrePublish(n,e):r._handlePublish(n,e))})),i(this,"_handlePublish",(function(t,e){for(var n=0,s=t.length;n<s;n++){if(r.DS.stopped)return;t[n](e)}})),i(this,"_handlePrePublish",(function(t,e){for(var n=t.length;n--;){if(r.DS.stopped)return;t[n](e)}})),this.DS=s})),X=function(t){o(r,d(Set));var e=p(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"_rects",void 0),i(h(s),"_timeout",void 0),i(h(s),"init",(function(){return z(s.Settings.selectables).forEach((function(t){return s.add(t)}))})),i(h(s),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"_onClick",(function(t){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:t})})),i(h(s),"_onPointer",(function(t){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:t})})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),i(h(s),"getRect",(function(t){return s._rects?s.rects.get(t):t.getBoundingClientRect()})),s.DS=o,s.Settings=o.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",(function(){s.clear(),s.init()})),s.DS.subscribe("Settings:updated:selectableClass",(function(t){var e=t.settings;s.forEach((function(t){t.classList.remove(e["selectableClass:pre"]),t.classList.add(e.selectableClass)}))})),s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:added:pre",e),t.classList.add(this.Settings.selectableClass),t.addEventListener("click",this._onClick),this.Settings.usePointerEvents?t.addEventListener("pointerdown",this._onPointer,{passive:!1}):t.addEventListener("mousedown",this._onPointer),t.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&M({computedStyle:window.getComputedStyle(t),node:t}),this.DS.publish("Selectable:added",e),g(a(r.prototype),"add",this).call(this,t)}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:removed:pre",e),t.classList.remove(this.Settings.selectableClass),t.classList.remove(this.Settings.hoverClass),t.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?t.removeEventListener("pointerdown",this._onPointer,{passive:!1}):t.removeEventListener("mousedown",this._onPointer),t.removeEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.publish("Selectable:removed",e),g(a(r.prototype),"delete",this).call(this,t)}}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var t=this;return this._rects||(this._rects=new Map,this.forEach((function(e){return t._rects.set(e,e.getBoundingClientRect())})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._rects=null}),this.Settings.refreshMemoryRate)),this._rects}}]),r}(),q=function(t){o(r,d(Set));var e=p(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),s.DS=o,s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selected:added:pre",e),g(a(r.prototype),"add",this).call(this,t),t.classList.add(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)+1),this.DS.publish("Selected:added",e),this}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};this.DS.publish("Selected:removed:pre",e);var n=g(a(r.prototype),"delete",this).call(this,t);return t.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)-1),this.DS.publish("Selected:removed",e),n}}},{key:"toggle",value:function(t){return this.has(t)?this.delete(t):this.add(t),t}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(),$=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevSelectedSet",void 0),i(this,"start",(function(t){var e=t.event;t.isDragging||(r._storePrevious(e),r._handleInsideSelection(!0,e))})),i(this,"update",(function(t){t.isDragging||r.DS.continue||r._handleInsideSelection()})),i(this,"_handleInsideSelection",(function(t,e){var n,s=r.DS,i=s.SelectableSet,o=s.SelectorArea,a=s.Selector,l=r.DS.stores.KeyStore.isMultiSelectKeyPressed(e)&&r.Settings.multiSelectToggling,c=r.Settings.selectionThreshold,u=i.rects,d=a.rect,h=new Map,S=new Map,p=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=m(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(u);try{for(p.s();!(n=p.n()).done;){var f=v(n.value,2),g=f[0],b=f[1];o.isInside(g,b)&&(O(b,d,c)?h.set(g,b):S.set(g,b))}}catch(t){p.e(t)}finally{p.f()}if(!r.DS.continue){var y=r.filterSelected({select:h,unselect:S,selectorRect:d}),D=y.select,_=y.unselect;D.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.multiSelectionToggle,s=t.SelectedSet,i=t.hoverClassName;e.classList.contains(i)&&!n||(s.has(e)?r&&s.delete(e):s.add(e),e.classList.add(i))}({element:n,force:t,multiSelectionToggle:l,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})})),_.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.SelectedSet,s=t.PrevSelectedSet,i=t.hoverClassName;if(!e.classList.contains(i)&&!n)return!1;var o=r.has(e),a=s.has(e);o&&!a?r.delete(e):!o&&a&&r.add(e),e.classList.remove(i)}({element:n,force:t,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})}))}})),i(this,"filterSelected",(function(t){var e=t.select,n=t.unselect;return t.selectorRect,{select:e,unselect:n}})),this.DS=s,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(t,[{key:"_storePrevious",value:function(t){var e=this.DS,n=e.stores.KeyStore,r=e.SelectedSet;n.isMultiSelectKeyPressed(t)?this._prevSelectedSet=new Set(r):this._prevSelectedSet=new Set}}]),t}(),J=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_rect",void 0),i(this,"attachSelector",(function(){var t,e,n,s;r.HTMLNode&&null!==(t=r.DS.SelectorArea)&&void 0!==t&&t.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||(n=r.DS.stores.SettingsStore.s.customStyles,(s=document.createElement("div")).style.position="absolute",n||(s.style.background="rgba(0, 175, 255, 0.2)",s.style.border="1px solid rgba(0, 175, 255, 0.8)",s.style.display="none",s.style.pointerEvents="none"),s),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&null!==(e=r.DS.SelectorArea)&&void 0!==e&&e.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)})),i(this,"start",(function(t){if(!t.isDragging){var e=r.DS.stores.PointerStore.initialValArea;B(r.HTMLNode,w(e,1)),r.HTMLNode.style.display="block",r._rect=null}})),i(this,"stop",(function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"})),i(this,"update",(function(t){if(!t.isDragging&&!r.DS.continue){var e=r.DS.stores,n=e.ScrollStore,s=e.PointerStore,i=function(t){var e=t.scrollAmount,n=t.initialPointerPos,r=t.pointerPos,s={};return r.x>n.x-e.x?(s.left=n.x-e.x,s.width=r.x-n.x+e.x):(s.left=r.x,s.width=n.x-r.x-e.x),r.y>n.y-e.y?(s.top=n.y-e.y,s.height=r.y-n.y+e.y):(s.top=r.y,s.height=n.y-r.y-e.y),s}({scrollAmount:n.scrollAmount,initialPointerPos:s.initialValArea,pointerPos:s.currentValArea});B(r.HTMLNode,i),r._rect=null}})),this.DS=s,this.DS.subscribe("Settings:updated:selectorClass",(function(t){var e=t.settings;r.HTMLNode.classList.remove(e["selectorClass:pre"]),r.HTMLNode.classList.add(e.selectorClass)})),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),Q=function(){function t(e){var r,s=this,o=e.DS;n(this,t),i(this,"_scrollInterval",void 0),i(this,"_rect",void 0),i(this,"currentEdges",[]),i(this,"start",(function(){s.applyElements("append"),s.updatePos()})),i(this,"applyElements",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",e=document.body?"body":"documentElement",n="".concat(t,"Child");s.HTMLNode[n](s.DS.Selector.HTMLNode),document[e][n](s.HTMLNode)})),i(this,"updatePos",(function(){s._rect=null;var t=s.DS.Area.rect,e=s.DS.Area.computedBorder,n=s.HTMLNode.style,r="".concat(t.top+e.top,"px"),i="".concat(t.left+e.left,"px"),o="".concat(t.width,"px"),a="".concat(t.height,"px");n.top!==r&&(n.top=r),n.left!==i&&(n.left=i),n.width!==o&&(n.width=o),n.height!==a&&(n.height=a)})),i(this,"stop",(function(t){s.stopAutoScroll(),t&&s.applyElements("remove")})),i(this,"startAutoScroll",(function(){s.currentEdges=[],s._scrollInterval=setInterval((function(){return s.handleAutoScroll()}),16)})),i(this,"handleAutoScroll",(function(){if(!s.DS.continue){var t=s.DS,e=t.stores.PointerStore,n=t.Area;s.currentEdges=x({elementRect:w(e.currentVal),containerRect:s.rect,tolerance:s.DS.stores.SettingsStore.s.overflowTolerance}),s.currentEdges.length&&n.scroll(s.currentEdges,s.DS.stores.SettingsStore.s.autoScrollSpeed)}})),i(this,"stopAutoScroll",(function(){s.currentEdges=[],clearInterval(s._scrollInterval)})),i(this,"isInside",(function(t,e){return!(!s.DS.Area.HTMLNode.contains(t)||!s.DS.stores.ScrollStore.canScroll)||O(s.rect,e||t.getBoundingClientRect())})),this.DS=o,this.HTMLNode=((r=document.createElement("div")).style.position="fixed",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="999999999999999999",r),this.DS.subscribe("Settings:updated:selectorAreaClass",(function(t){var e=t.settings;s.HTMLNode.classList.remove(e["selectorAreaClass:pre"]),s.HTMLNode.classList.add(e.selectorAreaClass)})),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",(function(){s.updatePos(),s.stopAutoScroll()}))}return s(t,[{key:"isClicked",value:function(t){var e=this.DS.stores.PointerStore,n=t?e.getPointerPosition(t):e.initialVal;return O({left:n.x,top:n.y,right:n.x,bottom:n.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),tt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_currentValues",new Set),i(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),i(this,"init",(function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)})),i(this,"keydown",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:t,key:e}),r._currentValues.add(e),r.DS.publish("KeyStore:down",{event:t,key:e})})),i(this,"keyup",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:t,key:e}),r._currentValues.delete(e),r.DS.publish("KeyStore:up",{event:t,key:e})})),i(this,"stop",(function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()})),i(this,"reset",(function(){return r._currentValues.clear()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init)}return s(t,[{key:"isMultiSelectKeyPressed",value:function(t){var e=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var n=this.DS.stores.SettingsStore.s.multiSelectKeys.map((function(t){return t.toLocaleLowerCase()}));return!!this.currentValues.some((function(t){return n.includes(t.toLocaleLowerCase())}))||!(!t||!n.some((function(n){return t[e._keyMapping[n]]})))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),t}(),et=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_isMouseInteraction",!1),i(this,"_initialValArea",void 0),i(this,"_currentValArea",void 0),i(this,"_lastValArea",void 0),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_lastVal",void 0),i(this,"_lastTouch",void 0),i(this,"init",(function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})})),i(this,"getPointerPosition",(function(t){return function(t){var e=t.event;return{x:e.clientX,y:e.clientY}}({event:r._normalizedEvent(t)})})),i(this,"update",(function(t){t&&(r.DS.publish("PointerStore:updated:pre",{event:t}),r.currentVal=r.getPointerPosition(t),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:t}))})),i(this,"stop",(function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout((function(){return r._isMouseInteraction=!1}),100)})),i(this,"reset",(function(t){t&&(r.currentVal=r.lastVal=r.getPointerPosition(t),r.stop(),r.init())})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:end",(function(t){var e=t.event;return r.reset(e)}))}return s(t,[{key:"start",value:function(t){t&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(t))}},{key:"_normalizedEvent",value:function(t){return"touches"in t&&"touchend"!==t.type&&(this._lastTouch=t),"touches"in t?this._lastTouch.touches[0]:t}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(t){this._initialVal=t,this._initialValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(t){this._currentVal=t,this._currentValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(t){this._lastVal=t,this._lastValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}}]),t}(),nt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_canScroll",void 0),i(this,"init",(function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"start",(function(){r._currentVal=r._initialVal=T(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"update",(function(){return r._currentVal=T(r.DS.stores.SettingsStore.s.area)})),i(this,"stop",(function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null})),i(this,"reset",(function(){r.stop(),r.start()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return r.start()})),this.DS.subscribe("Interaction:end",(function(){return r.reset()}))}return s(t,[{key:"canScroll",get:function(){return"boolean"==typeof this._canScroll?this._canScroll:this._canScroll=(t=this.DS.stores.SettingsStore.s.area,!!((e=T(t)).x||e.y||(t instanceof Document?t.body?t.body.scrollTop=1:t.documentElement.scrollTop=1:t.scrollTop=1)));var t,e}},{key:"scrollAmount",get:function(){var t,e=_(this.currentVal,"-",this.initialVal),n={x:t=this.DS.stores.SettingsStore.s.zoom,y:t},r=_(_(e,"*",n),"-",e);return{x:e.x+r.x,y:e.y+r.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=T(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),t}(),rt=s((function t(r){var s=this,o=r.DS,a=r.settings;n(this,t),i(this,"_settings",{}),i(this,"s",{}),i(this,"update",(function(t){var n=t.settings,r=t.init;return s.DS.publish("Settings:updated:pre",e({settings:n},r?{init:r}:{}))})),i(this,"_update",(function(t){for(var n=function(t,n){return e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e({},R("area",t.area,n,document)),R("selectables",t.selectables,n,null)),R("autoScrollSpeed",t.autoScrollSpeed,n,5)),R("overflowTolerance",t.overflowTolerance,n,{x:25,y:25})),R("zoom",t.zoom,n,1)),R("customStyles",t.customStyles,n,!1)),R("multiSelectMode",t.multiSelectMode,n,!1)),R("multiSelectToggling",t.multiSelectToggling,n,!0)),R("multiSelectKeys",t.multiSelectKeys,n,["Control","Shift","Meta"])),R("selector",t.selector,n,null)),R("selectionThreshold",t.selectionThreshold,n,0)),R("draggability",t.draggability,n,!0)),R("immediateDrag",t.immediateDrag,n,!0)),R("keyboardDrag",t.keyboardDrag,n,!0)),R("dragKeys",t.dragKeys,n,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),R("keyboardDragSpeed",t.keyboardDragSpeed,n,10)),R("useTransform",t.useTransform,n,!0)),R("refreshMemoryRate",t.refreshMemoryRate,n,80)),R("dropZones",t.dropZones,n,[])),R("dropInsideThreshold",t.dropInsideThreshold,n,1)),R("dropTargetThreshold",t.dropTargetThreshold,n,0)),R("usePointerEvents",t.usePointerEvents,n,!1)),R("hoverClass",t.hoverClass,n,"ds-hover")),R("selectableClass",t.selectableClass,n,"ds-selectable")),R("selectedClass",t.selectedClass,n,"ds-selected")),R("selectorClass",t.selectorClass,n,"ds-selector")),R("selectorAreaClass",t.selectorAreaClass,n,"ds-selector-area")),R("droppedTargetClass",t.droppedTargetClass,n,"ds-dropped-target")),R("droppedInsideClass",t.droppedInsideClass,n,"ds-dropped-inside")),R("droppableClass",t.droppableClass,n,"ds-droppable")),R("dropZoneClass",t.dropZoneClass,n,"ds-dropzone")),R("dropZoneReadyClass",t.dropZoneReadyClass,n,"ds-dropzone-ready")),R("dropZoneTargetClass",t.dropZoneTargetClass,n,"ds-dropzone-target")),R("dropZoneInsideClass",t.dropZoneInsideClass,n,"ds-dropzone-inside")),R("dragAsBlock",t.dragAsBlock,n,!1))}(t.settings,t.init),r=function(){var t,e=v(a[o],2),n=e[0],r=e[1];n in s._settings||Object.defineProperty(s.s,n,{get:function(){return s._settings[n]},set:function(t){return s.update({settings:i({},n,t)})}}),s._settings["".concat(n,":pre")]=s._settings[n],s._settings[n]=r;var l={settings:(t={},i(t,n,s._settings[n]),i(t,"".concat(n,":pre"),s._settings["".concat(n,":pre")]),t)};s.DS.publish("Settings:updated",l),s.DS.publish("Settings:updated:".concat(n),l)},o=0,a=Object.entries(n);o<a.length;o++)r()})),this.DS=o,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})})),st=function(){function t(r){var s=this;n(this,t),i(this,"continue",!1),i(this,"start",(function(){s.stopped=!1,s.Interaction.init()})),i(this,"break",(function(){return s.continue=!0})),i(this,"setSettings",(function(t){return s.stores.SettingsStore.update({settings:t})})),i(this,"getSelection",(function(){return s.SelectedSet.elements})),i(this,"getSelectables",(function(){return s.SelectableSet.elements})),i(this,"getInitialCursorPosition",(function(){return s.stores.PointerStore.initialVal})),i(this,"getCurrentCursorPosition",(function(){return s.stores.PointerStore.currentVal})),i(this,"getPreviousCursorPosition",(function(){return s.stores.PointerStore.lastVal})),i(this,"getInitialCursorPositionArea",(function(){return s.stores.PointerStore.initialValArea})),i(this,"getCurrentCursorPositionArea",(function(){return s.stores.PointerStore.currentValArea})),i(this,"getPreviousCursorPositionArea",(function(){return s.stores.PointerStore.lastValArea})),i(this,"isMultiSelect",(function(t){return s.stores.KeyStore.isMultiSelectKeyPressed(t)})),i(this,"isDragging",(function(){return s.Interaction.isDragging})),i(this,"getZoneByCoordinates",(function(t){var e;return null===(e=s.DropZones.getTarget(t))||void 0===e?void 0:e.toObject()})),i(this,"getItemsDroppedByZoneId",(function(t){return s.DropZones.getItemsDroppedById(t)})),i(this,"getItemsInsideByZoneId",(function(t,e){return s.DropZones.getItemsInsideById(t,e)})),this.PubSub=new U({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new rt({DS:this,settings:r}),this.stores.PointerStore=new et({DS:this}),this.stores.ScrollStore=new nt({DS:this}),this.stores.KeyStore=new tt({DS:this}),this.Area=new H({DS:this}),this.Selector=new J({DS:this}),this.SelectorArea=new Q({DS:this}),this.SelectableSet=new X({DS:this}),this.SelectedSet=new q({DS:this}),this.Selection=new $({DS:this}),this.Drag=new F({DS:this}),this.DropZones=new W({DS:this}),this.Interaction=new G({DS:this}),function(t){for(var n=t.subscribe,r=t.publish,s=t.Interaction,i=t.SelectedSet,o=t.DropZones,a={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(t){return t.event}}],"Interaction:end":[{name:"callback",extraData:function(){var t=o.getTarget();return e({},t?{dropTarget:t.toObject()}:{})}}]},l=function(){var t=v(u[c],2),o=t[0],a=t[1];["pre",!1].forEach((function(t){return n(t?"".concat(o,":").concat(t):o,(function(n){return a.forEach((function(o){return(!o.condition||o.condition(n))&&r(t?"".concat(t).concat(o.name):o.name,e(e({items:i.elements,isDragging:s.isDragging},n),o.extraData?o.extraData(n):{}))}))}))}))},c=0,u=Object.entries(a);c<u.length;c++)l()}({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",(function(){return s.continue=!1})),this.start()}return s(t,[{key:"stop",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(t),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),t&&this.SelectableSet.clear(),e&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(z(t)),n||this.addSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(z(t)),n&&this.removeSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return z(t).forEach((function(s){return e.SelectedSet.has(s)?e.removeSelection(t,n,r):e.addSelection(t,n,r)})),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(t,e,n),this.getSelection()}},{key:"clearSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.SelectedSet.clear(),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(t,e,n){var r=z(t);return this.SelectableSet.addAll(r),e&&this.SelectedSet.addAll(r),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}},{key:"setSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(t,e),this.addSelectables(t,n)}},{key:"removeSelectables",value:function(t,e,n){return this.SelectableSet.deleteAll(z(t)),e&&this.removeSelection(t),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}}]),t}();st.isCollision=O;export{st as default}; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).DragSelect=e()}(this,(function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D(r.key),r)}}function s(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t,e,n){return(e=D(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,n){return u=c()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var s=new(Function.bind.apply(t,r));return n&&l(s,n.prototype),s},u.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return u(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)},d(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function S(t){var e=c();return function(){var n,r=a(t);if(e){var s=a(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return p(this,n)}}function f(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}function g(){return g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=f(t,e);if(r){var s=Object.getOwnPropertyDescriptor(r,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},g.apply(this,arguments)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,i,o,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var _=function(t,e,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{"+":{x:r+i,y:s+o},"-":{x:r-i,y:s-o},"*":{x:r*i,y:s*o},"/":{x:r/i,y:s/o}}[e]},I=function(t){return{x:t.left,y:t.top}},w=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{left:t.x,top:t.y,right:t.x,bottom:t.y,width:e,height:e}},L=function(t,e){var n=e;window.addEventListener("resize",n),window.addEventListener("scroll",n);var r=new MutationObserver(n);t.forEach((function(t,e){r.observe(t,{childList:0!==e,attributes:!0})}));return{observer:r,callback:n,cleanup:function(){return j(r,n)}}},P=function(t,e){var n;return function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];var o=function(){n=null,t.apply(void 0,s)};clearTimeout(n),n=setTimeout(o,e)}},T=function(){var t,e,n,r;return{y:(null===(t=document.body)||void 0===t?void 0:t.scrollTop)||(null===(e=document.documentElement)||void 0===e?void 0:e.scrollTop)||0,x:(null===(n=document.body)||void 0===n?void 0:n.scrollLeft)||(null===(r=document.documentElement)||void 0===r?void 0:r.scrollLeft)||0}},C=function(t){return function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=null===(n=e[r])||void 0===n?void 0:n.parentNode;return s?(e.push(s),t(e,++r)):e}([t])},E=function(t,e){var n={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return z(t).forEach((function(t){var r=e.getRect(t);n.top=Math.min(n.top,r.top),n.left=Math.min(n.left,r.left),n.bottom=Math.max(n.bottom,r.bottom),n.right=Math.max(n.right,r.right)})),n.height=n.bottom-n.top,n.width=n.right-n.left,n},A=function(t){return!t||t instanceof Document?T():{x:t.scrollLeft>=0?t.scrollLeft:T().x,y:t.scrollTop>=0?t.scrollTop:T().y}},x=function(t){var e=t.elementRect,n=t.containerRect,r=t.tolerance,s=void 0===r?{x:0,y:0}:r,i=[];return e.top-s.y<n.top&&i.push("top"),e.left-s.x<n.left&&i.push("left"),e.bottom+s.y>n.bottom&&i.push("bottom"),e.right+s.y>n.right&&i.push("right"),i},k=function(t){var e={x:0,y:0},n=window.getComputedStyle(t);if(!n.transform||"none"===n.transform)return e;if(n.transform.indexOf("3d")>=0){var r=n.transform.trim().match(/matrix3d\((.*?)\)/);if(r&&r.length){var s,i=null===(s=r[1])||void 0===s?void 0:s.split(",");e.x=parseInt(i[12])||0,e.y=parseInt(i[13])||0}return e}var o=n.transform.trim().match(/matrix\((.*?)\)/);if(o&&o.length){var a,l=null===(a=o[1])||void 0===a?void 0:a.split(",");e.x=parseInt(l[4])||0,e.y=parseInt(l[5])||0}return e},N=function(t,e){return e?function(t){var e=t.style.transform;if(!e||e.indexOf("translate")<0)return k(t);var n={x:0,y:0},r=e.trim().match(/translate[3dD]*?\(.*?\)/);if(r){var s,i=null===(s=r[0])||void 0===s?void 0:s.split("(");if(i){var o,a=null===(o=i[1])||void 0===o?void 0:o.split(",");n.x=parseInt(a[0])||0,n.y=parseInt(a[1])||0}}return n.x||n.x?n:k(t)}(t):function(t){var e=t.style,n={x:parseInt(e.left)||0,y:parseInt(e.top)||0};if(!n.x&&!n.x){var r=window.getComputedStyle(t);return{x:parseInt(r.left)||0,y:parseInt(r.top)||0}}return n}(t)},M=function(t){var e=t.computedStyle,n=t.node,r=e.position;n instanceof Document||("absolute"===r||"relative"===r||"fixed"===r)||(n.style.position="relative")},V=function(t,e,n){return console.warn('[DragSelect] TypeIssue: setting "'.concat(t,'" is not of type "').concat(e,'".'))},R=function(t,e,n,r){if(void 0===e)return n?i({},t,r):{};if(null===e)return i({},t,null);var s=!0,o=!1,a="string"==typeof r;a&&(s="string"==typeof e||e instanceof String),a&&!s&&(o=!0,V(t,"string"));var l=!Number.isNaN(r)&&"number"==typeof r;l&&(s=!Number.isNaN(e)&&"number"==typeof e),l&&!s&&(o=!0,V(t,"number"));var c="[object Object]"===Object.prototype.toString.call(r);c&&(s="[object Object]"===Object.prototype.toString.call(e)),c&&!s&&(o=!0,V(t,"object"));var u="boolean"==typeof r;u&&(s="boolean"==typeof e),u&&!s&&(o=!0,V(t,"boolean"));var d=Array.isArray(r);d&&(s=Array.isArray(e)),d&&!s&&(o=!0,V(t,"array"));var h=o||n;return"dragKeys"===t&&s?i({},t,Object.assign(r,e)):"dragKeys"!==t||s?("dropZones"===t&&s&&new Set(e.map((function(t){return t.id}))).size!==e.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),s?i({},t,e):h?i({},t,r):{}):h?i({},t,r):{}},O=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t;if(n>0){var s=(t.right-t.left)*n,i=(t.bottom-t.top)*n;r={left:t.left+s,right:t.right-s,top:t.top+i,bottom:t.bottom-i}}return r.left<e.right&&r.right>e.left&&r.top<e.bottom&&r.bottom>e.top},K=function(t){var e=t.element,n=t.posDirection,r=t.containerRect,s=t.useTransform,i=N(e,s),o=_(i,"+",n);Z(e,o,s);var a=e.getBoundingClientRect();!function(t){var e=t.element,n=t.edges,r=t.elementRect,s=t.containerRect,i=t.elementPos,o=t.useTransform;n.includes("top")&&Z(e,{y:i.y+s.top-r.top,x:i.x},o),n.includes("left")&&Z(e,{y:i.y,x:i.x+s.left-r.left},o),n.includes("bottom")&&Z(e,{y:i.y+s.bottom-r.bottom,x:i.x},o),n.includes("right")&&Z(e,{y:i.y,x:i.x+s.right-r.right},o)}({element:e,edges:x({elementRect:a,containerRect:r}),elementRect:a,containerRect:r,elementPos:o,useTransform:s})},j=function(t,e){window.removeEventListener("resize",e),window.removeEventListener("scroll",e),t.disconnect()},Z=function(t,e,n){if(n){var r=t.style.transform;t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,1px) ").concat(r.replace(/translate.*?\)/g,""))}else t.style.left="".concat(e.x,"px"),t.style.top="".concat(e.y,"px");return t},z=function(t){return t?!Array.isArray(t)&&(t instanceof HTMLElement||t instanceof SVGElement)?[t]:b(new Set(b(t))):[]},B=function(t,e){t.style.left="".concat(e.left,"px"),t.style.top="".concat(e.top,"px"),t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px")},H=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"DS",void 0),i(this,"_observers",void 0),i(this,"_node",void 0),i(this,"_parentNodes",void 0),i(this,"_computedStyle",void 0),i(this,"_computedBorder",void 0),i(this,"_rect",void 0),i(this,"setArea",(function(t){r.reset(),r._node=t,M({computedStyle:r.computedStyle,node:r._node}),setTimeout((function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})}))})),i(this,"start",(function(){r._observers=L(r.parentNodes,P((function(t){r.DS.PubSub.publish("Area:modified:pre",{event:t,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:t,item:r})}),60))})),i(this,"reset",(function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0})),i(this,"stop",(function(){r._observers.cleanup(),r.reset()})),i(this,"scroll",(function(t,e){var n={scroll_directions:t,scroll_multiplier:e};r.DS.PubSub.publish("Area:scroll:pre",n),function(t,e,n){if(e.length){var r=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=t instanceof Document?r||document.body:t,i=e.includes("top")&&s.scrollTop>0,o=e.includes("bottom")&&s.scrollTop<s.scrollHeight,a=e.includes("left")&&s.scrollLeft>0,l=e.includes("right")&&s.scrollLeft<s.scrollWidth;i&&(s.scrollTop-=1*n),o&&(s.scrollTop+=1*n),a&&(s.scrollLeft-=1*n),l&&(s.scrollLeft+=1*n)}}(r._node,t,e),r.DS.PubSub.publish("Area:scroll",n)})),this.DS=s,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.setArea(e.area)})),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return s(t,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof Document?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=function(t,e){if(t instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=t.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(t.clientWidth||n.width)*e,height:(t.clientHeight||n.height)*e}}(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=C(this.HTMLNode)}}]),t}(),F=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevCursorPos",void 0),i(this,"_prevScrollPos",void 0),i(this,"_elements",[]),i(this,"_dragKeys",void 0),i(this,"_dragKeysFlat",[]),i(this,"_selectionRect",void 0),i(this,"assignDragkeys",(function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map((function(t){return t.toLowerCase()})),down:r.DS.stores.SettingsStore.s.dragKeys.down.map((function(t){return t.toLowerCase()})),left:r.DS.stores.SettingsStore.s.dragKeys.left.map((function(t){return t.toLowerCase()})),right:r.DS.stores.SettingsStore.s.dragKeys.right.map((function(t){return t.toLowerCase()}))},r._dragKeysFlat=[].concat(b(r._dragKeys.up),b(r._dragKeys.down),b(r._dragKeys.left),b(r._dragKeys.right))})),i(this,"keyboardDrag",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability&&!r.DS.continue){var s={event:e,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],s),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=E(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var i=function(t){var e=t.shiftKey,n=t.keyboardDragSpeed,r=t.zoom,s=t.key,i=t.dragKeys,o=t.scrollDiff,a=t.canScroll,l=t.scrollCallback,c={x:0,y:0},u=e?4*n*r:n*r;return i.left.includes(s)&&(c.x=o.x||-u,e||o.x||!a||l(["left"],n)),i.right.includes(s)&&(c.x=o.x||u,e||o.x||!a||l(["right"],n)),i.up.includes(s)&&(c.y=o.y||-u,e||o.y||!a||l(["top"],n)),i.down.includes(s)&&(c.y=o.y||u,e||o.y||!a||l(["bottom"],n)),c}({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:n,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(i=r.limitDirection(i)),r._elements.forEach((function(t){return K({element:t,posDirection:i,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})),r.DS.publish(["Interaction:update:pre","Interaction:update"],s)}})),i(this,"keyboardEnd",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability){var s={event:e,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],s)}})),i(this,"start",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;e&&!n&&(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=E(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))})),i(this,"stop",(function(t){null!=t&&t.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])})),i(this,"update",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;if(e&&r._elements.length&&!n&&!r.DS.continue){var s=_(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(s=r.limitDirection(s)),r._elements.forEach((function(t){return K({element:t,posDirection:s,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}))}})),i(this,"limitDirection",(function(t){var e=r.DS.SelectorArea.rect,n=r.DS.stores.ScrollStore.scrollAmount,s={top:e.top-r._selectionRect.top+n.y,left:e.left-r._selectionRect.left+n.x,bottom:e.bottom-r._selectionRect.bottom+n.y,right:e.right-r._selectionRect.right+n.x};return 0===t.x&&0===t.y||(t.y<0&&(t.y=Math.max(t.y,s.top)),t.x<0&&(t.x=Math.max(t.x,s.left)),t.y>0&&(t.y=Math.min(t.y,s.bottom)),t.x>0&&(t.x=Math.min(t.x,s.right)),r._selectionRect.top+=t.y,r._selectionRect.bottom+=t.y,r._selectionRect.left+=t.x,r._selectionRect.right+=t.x),t})),i(this,"handleZIndex",(function(t){r._elements.forEach((function(e){return e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)+t?9999:-9998)}))})),this.DS=s,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(t,[{key:"_cursorDiff",get:function(){var t=this.DS.stores.PointerStore.currentVal,e=this._prevCursorPos?_(t,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=t,e}},{key:"_scrollDiff",get:function(){var t=this.DS.stores.ScrollStore.currentVal,e=this._prevScrollPos?_(t,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=t,e}}]),t}(),Y=function(){function t(e){var r=this,s=e.DS,o=e.id,a=e.element,l=e.droppables;n(this,t),i(this,"id",void 0),i(this,"element",void 0),i(this,"_droppables",void 0),i(this,"_rect",void 0),i(this,"_observers",void 0),i(this,"_timeout",void 0),i(this,"_itemsDropped",[]),i(this,"_itemsInside",void 0),i(this,"setReadyClasses",(function(t){if(!r.isDestroyed){var e=r.droppables.filter((function(t){return r.DS.SelectedSet.has(t)}));e.length&&(e.forEach((function(e){e.classList[t]("".concat(r.Settings.droppableClass)),e.classList[t]("".concat(r.Settings.droppableClass,"-").concat(r.id))})),r.element.classList[t]("".concat(r.Settings.dropZoneReadyClass)))}})),i(this,"handleNoDrop",(function(){var t;r.isDestroyed||(r.DS.SelectedSet.forEach((function(t){t.classList.remove(r.Settings.droppedTargetClass),t.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),r._itemsDropped=r._itemsDropped.filter((function(t){return!r.DS.SelectedSet.has(t)})),null!==(t=r._itemsDropped)&&void 0!==t&&t.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleDrop",(function(){var t,e,n;r.isDestroyed||(r._itemsDropped=b(new Set([].concat(b(r._itemsDropped),b(null===(t=r.droppables)||void 0===t?void 0:t.filter((function(t){return r.DS.SelectedSet.has(t)})))))),null===(e=r._itemsDropped)||void 0===e||e.forEach((function(t){t.classList.add("".concat(r.Settings.droppedTargetClass)),t.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),null!==(n=r._itemsDropped)&&void 0!==n&&n.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleItemsInsideClasses",(function(){var t=!1;r.droppables.forEach((function(e){r.itemsInside.includes(e)?(e.classList.add("".concat(r.Settings.droppedInsideClass)),e.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),t=!0):(e.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),e.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||e.classList.remove("".concat(r.Settings.droppedInsideClass)))})),t?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))})),i(this,"start",(function(t){t.isDragging&&!r.isDestroyed&&r.setReadyClasses("add")})),i(this,"stop",(function(t){t.isDragging&&!r.isDestroyed&&(r.setReadyClasses("remove"),r.handleItemsInsideClasses())})),i(this,"toObject",(function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.id=o,this.element=a,l&&(this.droppables=z(l)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",(function(t){var e=t.settings;r.element&&(r.element.classList.remove(e["dropZoneClass:pre"]),r.element.classList.add(e.dropZoneClass))})),this._observers=L(this.parentNodes,P((function(){return r._rect=null}),this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"destroy",value:function(){var t=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach((function(e){e.classList.remove("".concat(t.Settings.droppedTargetClass)),e.classList.remove("".concat(t.Settings.droppedTargetClass,"-").concat(t.id)),e.classList.remove("".concat(t.Settings.droppableClass)),e.classList.remove("".concat(t.Settings.droppableClass,"-").concat(t.id))})),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var t=this;return this.isDestroyed?null:(this._itemsInside||(this._itemsInside=this.droppables.flatMap((function(e){return O(t.DS.SelectableSet.rects.get(e),t.rect,t.Settings.dropInsideThreshold)?[e]:[]})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._itemsInside=null}),this.Settings.refreshMemoryRate)),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=C(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(t){this._droppables=t}}]),t}(),W=s((function t(r){var s=this,o=r.DS;n(this,t),i(this,"_zoneByElement",new Map),i(this,"_zoneById",new Map),i(this,"_zonesByDroppable",new Map),i(this,"_zones",void 0),i(this,"setDropZones",(function(t){var n=t.dropZones;n&&(s._zones&&s._zones.forEach((function(t){return t.destroy()})),s._zones=n.map((function(t){return new Y(e({DS:s.DS},t))})),s._zones.forEach((function(t){s._zoneByElement.set(t.element,t),s._zoneById.set(t.id,t),t.droppables.forEach((function(e){var n=s._zonesByDroppable.get(e);if(null==n||!n.length)return s._zonesByDroppable.set(e,[t]);s._zonesByDroppable.set(e,b(new Set([].concat(b(n),[t]))))}))})))})),i(this,"_handleDrop",(function(t){s._zones.forEach((function(e){e!==t&&e.handleNoDrop()})),t&&t.handleDrop()})),i(this,"_getZoneByElementsFromPoint",(function(t,e){for(var n=e.x,r=e.y,i=0,o=t.length;i<o;i++){var a=s._zoneByElement.get(t[i]);if(a&&O(a.rect,{left:n,right:n,top:r,bottom:r},Math.min(s.Settings.dropTargetThreshold,.5)))return a}})),i(this,"stop",(function(t){if(t.isDragging){var e=s.getTarget();s._handleDrop(e)}})),i(this,"getItemsDroppedById",(function(t){var e=s._zoneById.get(t);return e?e.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(t,")"))})),i(this,"getItemsInsideById",(function(t,e){var n=s._zoneById.get(t);if(!n)return console.warn("[DragSelect] No zone found (id: ".concat(t,")"));var r=n.itemsInside;return e&&n.handleItemsInsideClasses(),r})),i(this,"getTarget",(function(t){var e;if(null!==(e=s._zones)&&void 0!==e&&e.length){var n=(null==t?void 0:t.x)||s.DS.stores.PointerStore.currentVal.x,r=(null==t?void 0:t.y)||s.DS.stores.PointerStore.currentVal.y,i=document.elementsFromPoint(n,r);return s._getZoneByElementsFromPoint(i,{x:n,y:r})}})),this.DS=o,this.Settings=o.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",(function(t){var e=t.settings;return s.setDropZones(e)})),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)})),G=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"isInteracting",void 0),i(this,"isDragging",void 0),i(this,"init",(function(){return r.DS.publish("Interaction:init:pre",{})})),i(this,"_init",(function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})})),i(this,"start",(function(t){return r.DS.publish("Interaction:start:pre",{event:t,isDragging:r.isDragging})})),i(this,"_start",(function(t){"touchstart"===t.type&&t.preventDefault(),r._canInteract(t)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(t),r.DS.publish("Interaction:start",{event:t,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))})),i(this,"isDragEvent",(function(t){var e=t.target.closest(".".concat(r.Settings.selectableClass));return!(!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(t)||!e)&&(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(e)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(e)):r.DS.SelectedSet.add(e)),!!r.DS.SelectedSet.has(e))})),i(this,"onClick",(function(t){var e=t.event;if(r._canInteract(e)&&!(e.detail>0)){var n=r.DS,s=n.stores,i=s.PointerStore,o=s.KeyStore,a=n.SelectableSet,l=n.SelectedSet;i.start(e);var c=e.target;a.has(c)&&(o.isMultiSelectKeyPressed(e)||l.clear(),l.toggle(c),r.reset())}})),i(this,"stop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(t.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(t.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),t.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)})),i(this,"update",(function(t){var e=t.event,n=t.scroll_directions,s=t.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:e,scroll_directions:n,scroll_multiplier:s,isDragging:r.isDragging})})),i(this,"reset",(function(t){return r.DS.publish("Interaction:end:pre",{event:t,isDragging:r.isDragging})})),i(this,"_reset",(function(t){var e=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:t,isDragging:e})})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.stop(e["area:pre"]),r.init()})),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:start:pre",(function(t){var e=t.event;return r._start(e)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(t){var e=t.event;return r._reset(e)})),this.DS.subscribe("Area:scroll",this.update)}return s(t,[{key:"_canInteract",value:function(t){var e=0===t.clientX&&0===t.clientY&&0===t.detail&&t.target;return!(2===t.button||this.isInteracting||t.target&&!this.DS.SelectorArea.isInside(t.target)||!e&&!this.DS.SelectorArea.isClicked(t))}}]),t}(),U=s((function t(e){var r=this,s=e.DS;n(this,t),i(this,"subscribers",{}),i(this,"subscribe",(function(t,e){return Array.isArray(r.subscribers[t])||(r.subscribers[t]=[]),r.subscribers[t].push(e),r.subscribers[t].length-1})),i(this,"unsubscribe",(function(t,e,n){n>=0?r.subscribers[t].splice(n,1):e&&(r.subscribers[t]=r.subscribers[t].filter((function(t){return t!==e})))})),i(this,"publish",(function(t,e){Array.isArray(t)?t.forEach((function(t){return r._publish(t,e)})):r._publish(t,e)})),i(this,"_publish",(function(t,e){var n=r.subscribers[t];Array.isArray(n)&&(t.includes(":pre")?r._handlePrePublish(n,e):r._handlePublish(n,e))})),i(this,"_handlePublish",(function(t,e){for(var n=0,s=t.length;n<s;n++){if(r.DS.stopped)return;t[n](e)}})),i(this,"_handlePrePublish",(function(t,e){for(var n=t.length;n--;){if(r.DS.stopped)return;t[n](e)}})),this.DS=s})),X=function(t){o(r,t);var e=S(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"_rects",void 0),i(h(s),"_timeout",void 0),i(h(s),"init",(function(){return z(s.Settings.selectables).forEach((function(t){return s.add(t)}))})),i(h(s),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"_onClick",(function(t){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:t})})),i(h(s),"_onPointer",(function(t){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:t})})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),i(h(s),"getRect",(function(t){return s._rects?s.rects.get(t):t.getBoundingClientRect()})),s.DS=o,s.Settings=o.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",(function(){s.clear(),s.init()})),s.DS.subscribe("Settings:updated:selectableClass",(function(t){var e=t.settings;s.forEach((function(t){t.classList.remove(e["selectableClass:pre"]),t.classList.add(e.selectableClass)}))})),s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:added:pre",e),t.classList.add(this.Settings.selectableClass),t.addEventListener("click",this._onClick),this.Settings.usePointerEvents?t.addEventListener("pointerdown",this._onPointer,{passive:!1}):t.addEventListener("mousedown",this._onPointer),t.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&M({computedStyle:window.getComputedStyle(t),node:t}),this.DS.publish("Selectable:added",e),g(a(r.prototype),"add",this).call(this,t)}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:removed:pre",e),t.classList.remove(this.Settings.selectableClass),t.classList.remove(this.Settings.hoverClass),t.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?t.removeEventListener("pointerdown",this._onPointer,{passive:!1}):t.removeEventListener("mousedown",this._onPointer),t.removeEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.publish("Selectable:removed",e),g(a(r.prototype),"delete",this).call(this,t)}}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var t=this;return this._rects||(this._rects=new Map,this.forEach((function(e){return t._rects.set(e,e.getBoundingClientRect())})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._rects=null}),this.Settings.refreshMemoryRate)),this._rects}}]),r}(d(Set)),q=function(t){o(r,t);var e=S(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),s.DS=o,s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selected:added:pre",e),g(a(r.prototype),"add",this).call(this,t),t.classList.add(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)+1),this.DS.publish("Selected:added",e),this}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};this.DS.publish("Selected:removed:pre",e);var n=g(a(r.prototype),"delete",this).call(this,t);return t.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)-1),this.DS.publish("Selected:removed",e),n}}},{key:"toggle",value:function(t){return this.has(t)?this.delete(t):this.add(t),t}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(d(Set)),$=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevSelectedSet",void 0),i(this,"start",(function(t){var e=t.event;t.isDragging||(r._storePrevious(e),r._handleInsideSelection(!0,e))})),i(this,"update",(function(t){t.isDragging||r.DS.continue||r._handleInsideSelection()})),i(this,"_handleInsideSelection",(function(t,e){var n,s=r.DS,i=s.SelectableSet,o=s.SelectorArea,a=s.Selector,l=r.DS.stores.KeyStore.isMultiSelectKeyPressed(e)&&r.Settings.multiSelectToggling,c=r.Settings.selectionThreshold,u=i.rects,d=a.rect,h=new Map,p=new Map,S=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=m(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(u);try{for(S.s();!(n=S.n()).done;){var f=v(n.value,2),g=f[0],b=f[1];o.isInside(g,b)&&(O(b,d,c)?h.set(g,b):p.set(g,b))}}catch(t){S.e(t)}finally{S.f()}if(!r.DS.continue){var y=r.filterSelected({select:h,unselect:p,selectorRect:d}),D=y.select,_=y.unselect;D.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.multiSelectionToggle,s=t.SelectedSet,i=t.hoverClassName;e.classList.contains(i)&&!n||(s.has(e)?r&&s.delete(e):s.add(e),e.classList.add(i))}({element:n,force:t,multiSelectionToggle:l,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})})),_.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.SelectedSet,s=t.PrevSelectedSet,i=t.hoverClassName;if(!e.classList.contains(i)&&!n)return!1;var o=r.has(e),a=s.has(e);o&&!a?r.delete(e):!o&&a&&r.add(e),e.classList.remove(i)}({element:n,force:t,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})}))}})),i(this,"filterSelected",(function(t){var e=t.select,n=t.unselect;return t.selectorRect,{select:e,unselect:n}})),this.DS=s,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(t,[{key:"_storePrevious",value:function(t){var e=this.DS,n=e.stores.KeyStore,r=e.SelectedSet;n.isMultiSelectKeyPressed(t)?this._prevSelectedSet=new Set(r):this._prevSelectedSet=new Set}}]),t}(),J=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_rect",void 0),i(this,"attachSelector",(function(){var t,e,n,s;r.HTMLNode&&null!==(t=r.DS.SelectorArea)&&void 0!==t&&t.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||(n=r.DS.stores.SettingsStore.s.customStyles,(s=document.createElement("div")).style.position="absolute",n||(s.style.background="rgba(0, 175, 255, 0.2)",s.style.border="1px solid rgba(0, 175, 255, 0.8)",s.style.display="none",s.style.pointerEvents="none"),s),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&null!==(e=r.DS.SelectorArea)&&void 0!==e&&e.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)})),i(this,"start",(function(t){if(!t.isDragging){var e=r.DS.stores.PointerStore.initialValArea;B(r.HTMLNode,w(e,1)),r.HTMLNode.style.display="block",r._rect=null}})),i(this,"stop",(function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"})),i(this,"update",(function(t){if(!t.isDragging&&!r.DS.continue){var e=r.DS.stores,n=e.ScrollStore,s=e.PointerStore,i=function(t){var e=t.scrollAmount,n=t.initialPointerPos,r=t.pointerPos,s={};return r.x>n.x-e.x?(s.left=n.x-e.x,s.width=r.x-n.x+e.x):(s.left=r.x,s.width=n.x-r.x-e.x),r.y>n.y-e.y?(s.top=n.y-e.y,s.height=r.y-n.y+e.y):(s.top=r.y,s.height=n.y-r.y-e.y),s}({scrollAmount:n.scrollAmount,initialPointerPos:s.initialValArea,pointerPos:s.currentValArea});B(r.HTMLNode,i),r._rect=null}})),this.DS=s,this.DS.subscribe("Settings:updated:selectorClass",(function(t){var e=t.settings;r.HTMLNode.classList.remove(e["selectorClass:pre"]),r.HTMLNode.classList.add(e.selectorClass)})),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),Q=function(){function t(e){var r,s=this,o=e.DS;n(this,t),i(this,"_scrollInterval",void 0),i(this,"_rect",void 0),i(this,"currentEdges",[]),i(this,"start",(function(){s.applyElements("append"),s.updatePos()})),i(this,"applyElements",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",e=document.body?"body":"documentElement",n="".concat(t,"Child");s.HTMLNode[n](s.DS.Selector.HTMLNode),document[e][n](s.HTMLNode)})),i(this,"updatePos",(function(){s._rect=null;var t=s.DS.Area.rect,e=s.DS.Area.computedBorder,n=s.HTMLNode.style,r="".concat(t.top+e.top,"px"),i="".concat(t.left+e.left,"px"),o="".concat(t.width,"px"),a="".concat(t.height,"px");n.top!==r&&(n.top=r),n.left!==i&&(n.left=i),n.width!==o&&(n.width=o),n.height!==a&&(n.height=a)})),i(this,"stop",(function(t){s.stopAutoScroll(),t&&s.applyElements("remove")})),i(this,"startAutoScroll",(function(){s.currentEdges=[],s._scrollInterval=setInterval((function(){return s.handleAutoScroll()}),16)})),i(this,"handleAutoScroll",(function(){if(!s.DS.continue){var t=s.DS,e=t.stores.PointerStore,n=t.Area;s.currentEdges=x({elementRect:w(e.currentVal),containerRect:s.rect,tolerance:s.DS.stores.SettingsStore.s.overflowTolerance}),s.currentEdges.length&&n.scroll(s.currentEdges,s.DS.stores.SettingsStore.s.autoScrollSpeed)}})),i(this,"stopAutoScroll",(function(){s.currentEdges=[],clearInterval(s._scrollInterval)})),i(this,"isInside",(function(t,e){return!(!s.DS.Area.HTMLNode.contains(t)||!s.DS.stores.ScrollStore.canScroll)||O(s.rect,e||t.getBoundingClientRect())})),this.DS=o,this.HTMLNode=((r=document.createElement("div")).style.position="fixed",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="999999999999999999",r),this.DS.subscribe("Settings:updated:selectorAreaClass",(function(t){var e=t.settings;s.HTMLNode.classList.remove(e["selectorAreaClass:pre"]),s.HTMLNode.classList.add(e.selectorAreaClass)})),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",(function(){s.updatePos(),s.stopAutoScroll()}))}return s(t,[{key:"isClicked",value:function(t){var e=this.DS.stores.PointerStore,n=t?e.getPointerPosition(t):e.initialVal;return console.log("isClicked",n,this.rect,this.HTMLNode),O({left:n.x,top:n.y,right:n.x,bottom:n.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),tt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_currentValues",new Set),i(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),i(this,"init",(function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)})),i(this,"keydown",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:t,key:e}),r._currentValues.add(e),r.DS.publish("KeyStore:down",{event:t,key:e})})),i(this,"keyup",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:t,key:e}),r._currentValues.delete(e),r.DS.publish("KeyStore:up",{event:t,key:e})})),i(this,"stop",(function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()})),i(this,"reset",(function(){return r._currentValues.clear()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init)}return s(t,[{key:"isMultiSelectKeyPressed",value:function(t){var e=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var n=this.DS.stores.SettingsStore.s.multiSelectKeys.map((function(t){return t.toLocaleLowerCase()}));return!!this.currentValues.some((function(t){return n.includes(t.toLocaleLowerCase())}))||!(!t||!n.some((function(n){return t[e._keyMapping[n]]})))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),t}(),et=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_isMouseInteraction",!1),i(this,"_initialValArea",void 0),i(this,"_currentValArea",void 0),i(this,"_lastValArea",void 0),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_lastVal",void 0),i(this,"_lastTouch",void 0),i(this,"init",(function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})})),i(this,"getPointerPosition",(function(t){return function(t){var e=t.event;return{x:e.clientX,y:e.clientY}}({event:r._normalizedEvent(t)})})),i(this,"update",(function(t){t&&(r.DS.publish("PointerStore:updated:pre",{event:t}),r.currentVal=r.getPointerPosition(t),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:t}))})),i(this,"stop",(function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout((function(){return r._isMouseInteraction=!1}),100)})),i(this,"reset",(function(t){t&&(r.currentVal=r.lastVal=r.getPointerPosition(t),r.stop(),r.init())})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:end",(function(t){var e=t.event;return r.reset(e)}))}return s(t,[{key:"start",value:function(t){t&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(t))}},{key:"_normalizedEvent",value:function(t){return"touches"in t&&"touchend"!==t.type&&(this._lastTouch=t),"touches"in t?this._lastTouch.touches[0]:t}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(t){this._initialVal=t,this._initialValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(t){this._currentVal=t,this._currentValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(t){this._lastVal=t,this._lastValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}}]),t}(),nt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_canScroll",void 0),i(this,"init",(function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"start",(function(){r._currentVal=r._initialVal=A(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"update",(function(){return r._currentVal=A(r.DS.stores.SettingsStore.s.area)})),i(this,"stop",(function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null})),i(this,"reset",(function(){r.stop(),r.start()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return r.start()})),this.DS.subscribe("Interaction:end",(function(){return r.reset()}))}return s(t,[{key:"canScroll",get:function(){return"boolean"==typeof this._canScroll?this._canScroll:this._canScroll=(t=this.DS.stores.SettingsStore.s.area,!!((e=A(t)).x||e.y||(t instanceof Document?t.body?t.body.scrollTop=1:t.documentElement.scrollTop=1:t.scrollTop=1)));var t,e}},{key:"scrollAmount",get:function(){var t,e=_(this.currentVal,"-",this.initialVal),n={x:t=this.DS.stores.SettingsStore.s.zoom,y:t},r=_(_(e,"*",n),"-",e);return{x:e.x+r.x,y:e.y+r.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=A(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),t}(),rt=s((function t(r){var s=this,o=r.DS,a=r.settings;n(this,t),i(this,"_settings",{}),i(this,"s",{}),i(this,"update",(function(t){var n=t.settings,r=t.init;return s.DS.publish("Settings:updated:pre",e({settings:n},r?{init:r}:{}))})),i(this,"_update",(function(t){for(var n=function(t,n){return e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e({},R("area",t.area,n,document)),R("selectables",t.selectables,n,null)),R("autoScrollSpeed",t.autoScrollSpeed,n,5)),R("overflowTolerance",t.overflowTolerance,n,{x:25,y:25})),R("zoom",t.zoom,n,1)),R("customStyles",t.customStyles,n,!1)),R("multiSelectMode",t.multiSelectMode,n,!1)),R("multiSelectToggling",t.multiSelectToggling,n,!0)),R("multiSelectKeys",t.multiSelectKeys,n,["Control","Shift","Meta"])),R("selector",t.selector,n,null)),R("selectionThreshold",t.selectionThreshold,n,0)),R("draggability",t.draggability,n,!0)),R("immediateDrag",t.immediateDrag,n,!0)),R("keyboardDrag",t.keyboardDrag,n,!0)),R("dragKeys",t.dragKeys,n,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),R("keyboardDragSpeed",t.keyboardDragSpeed,n,10)),R("useTransform",t.useTransform,n,!0)),R("refreshMemoryRate",t.refreshMemoryRate,n,80)),R("dropZones",t.dropZones,n,[])),R("dropInsideThreshold",t.dropInsideThreshold,n,1)),R("dropTargetThreshold",t.dropTargetThreshold,n,0)),R("usePointerEvents",t.usePointerEvents,n,!1)),R("hoverClass",t.hoverClass,n,"ds-hover")),R("selectableClass",t.selectableClass,n,"ds-selectable")),R("selectedClass",t.selectedClass,n,"ds-selected")),R("selectorClass",t.selectorClass,n,"ds-selector")),R("selectorAreaClass",t.selectorAreaClass,n,"ds-selector-area")),R("droppedTargetClass",t.droppedTargetClass,n,"ds-dropped-target")),R("droppedInsideClass",t.droppedInsideClass,n,"ds-dropped-inside")),R("droppableClass",t.droppableClass,n,"ds-droppable")),R("dropZoneClass",t.dropZoneClass,n,"ds-dropzone")),R("dropZoneReadyClass",t.dropZoneReadyClass,n,"ds-dropzone-ready")),R("dropZoneTargetClass",t.dropZoneTargetClass,n,"ds-dropzone-target")),R("dropZoneInsideClass",t.dropZoneInsideClass,n,"ds-dropzone-inside")),R("dragAsBlock",t.dragAsBlock,n,!1))}(t.settings,t.init),r=function(){var t,e=v(a[o],2),n=e[0],r=e[1];n in s._settings||Object.defineProperty(s.s,n,{get:function(){return s._settings[n]},set:function(t){return s.update({settings:i({},n,t)})}}),s._settings["".concat(n,":pre")]=s._settings[n],s._settings[n]=r;var l={settings:(t={},i(t,n,s._settings[n]),i(t,"".concat(n,":pre"),s._settings["".concat(n,":pre")]),t)};s.DS.publish("Settings:updated",l),s.DS.publish("Settings:updated:".concat(n),l)},o=0,a=Object.entries(n);o<a.length;o++)r()})),this.DS=o,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})})),st=function(){function t(r){var s=this;n(this,t),i(this,"continue",!1),i(this,"start",(function(){s.stopped=!1,s.Interaction.init()})),i(this,"break",(function(){return s.continue=!0})),i(this,"setSettings",(function(t){return s.stores.SettingsStore.update({settings:t})})),i(this,"getSelection",(function(){return s.SelectedSet.elements})),i(this,"getSelectables",(function(){return s.SelectableSet.elements})),i(this,"getInitialCursorPosition",(function(){return s.stores.PointerStore.initialVal})),i(this,"getCurrentCursorPosition",(function(){return s.stores.PointerStore.currentVal})),i(this,"getPreviousCursorPosition",(function(){return s.stores.PointerStore.lastVal})),i(this,"getInitialCursorPositionArea",(function(){return s.stores.PointerStore.initialValArea})),i(this,"getCurrentCursorPositionArea",(function(){return s.stores.PointerStore.currentValArea})),i(this,"getPreviousCursorPositionArea",(function(){return s.stores.PointerStore.lastValArea})),i(this,"isMultiSelect",(function(t){return s.stores.KeyStore.isMultiSelectKeyPressed(t)})),i(this,"isDragging",(function(){return s.Interaction.isDragging})),i(this,"getZoneByCoordinates",(function(t){var e;return null===(e=s.DropZones.getTarget(t))||void 0===e?void 0:e.toObject()})),i(this,"getItemsDroppedByZoneId",(function(t){return s.DropZones.getItemsDroppedById(t)})),i(this,"getItemsInsideByZoneId",(function(t,e){return s.DropZones.getItemsInsideById(t,e)})),this.PubSub=new U({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new rt({DS:this,settings:r}),this.stores.PointerStore=new et({DS:this}),this.stores.ScrollStore=new nt({DS:this}),this.stores.KeyStore=new tt({DS:this}),this.Area=new H({DS:this}),this.Selector=new J({DS:this}),this.SelectorArea=new Q({DS:this}),this.SelectableSet=new X({DS:this}),this.SelectedSet=new q({DS:this}),this.Selection=new $({DS:this}),this.Drag=new F({DS:this}),this.DropZones=new W({DS:this}),this.Interaction=new G({DS:this}),function(t){for(var n=t.subscribe,r=t.publish,s=t.Interaction,i=t.SelectedSet,o=t.DropZones,a={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(t){return t.event}}],"Interaction:end":[{name:"callback",extraData:function(){var t=o.getTarget();return e({},t?{dropTarget:t.toObject()}:{})}}]},l=function(){var t=v(u[c],2),o=t[0],a=t[1];["pre",!1].forEach((function(t){return n(t?"".concat(o,":").concat(t):o,(function(n){return a.forEach((function(o){return(!o.condition||o.condition(n))&&r(t?"".concat(t).concat(o.name):o.name,e(e({items:i.elements,isDragging:s.isDragging},n),o.extraData?o.extraData(n):{}))}))}))}))},c=0,u=Object.entries(a);c<u.length;c++)l()}({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",(function(){return s.continue=!1})),this.start()}return s(t,[{key:"stop",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(t),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),t&&this.SelectableSet.clear(),e&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(z(t)),n||this.addSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(z(t)),n&&this.removeSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return z(t).forEach((function(s){return e.SelectedSet.has(s)?e.removeSelection(t,n,r):e.addSelection(t,n,r)})),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(t,e,n),this.getSelection()}},{key:"clearSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.SelectedSet.clear(),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(t,e,n){var r=z(t);return this.SelectableSet.addAll(r),e&&this.SelectedSet.addAll(r),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}},{key:"setSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(t,e),this.addSelectables(t,n)}},{key:"removeSelectables",value:function(t,e,n){return this.SelectableSet.deleteAll(z(t)),e&&this.removeSelection(t),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}}]),t}();return st.isCollision=O,st})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).DragSelect=e()}(this,(function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D(r.key),r)}}function s(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t,e,n){return(e=D(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,n){return u=c()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var s=new(Function.bind.apply(t,r));return n&&l(s,n.prototype),s},u.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return u(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)},d(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function S(t){var e=c();return function(){var n,r=a(t);if(e){var s=a(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return p(this,n)}}function f(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}function g(){return g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=f(t,e);if(r){var s=Object.getOwnPropertyDescriptor(r,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},g.apply(this,arguments)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,i,o,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var _=function(t,e,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{"+":{x:r+i,y:s+o},"-":{x:r-i,y:s-o},"*":{x:r*i,y:s*o},"/":{x:r/i,y:s/o}}[e]},I=function(t){return{x:t.left,y:t.top}},w=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{left:t.x,top:t.y,right:t.x,bottom:t.y,width:e,height:e}},L=function(t,e){var n=e;window.addEventListener("resize",n),window.addEventListener("scroll",n);var r=new MutationObserver(n);t.forEach((function(t,e){r.observe(t,{childList:0!==e,attributes:!0})}));return{observer:r,callback:n,cleanup:function(){return j(r,n)}}},P=function(t,e){var n;return function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];var o=function(){n=null,t.apply(void 0,s)};clearTimeout(n),n=setTimeout(o,e)}},T=function(){var t,e,n,r;return{y:(null===(t=document.body)||void 0===t?void 0:t.scrollTop)||(null===(e=document.documentElement)||void 0===e?void 0:e.scrollTop)||0,x:(null===(n=document.body)||void 0===n?void 0:n.scrollLeft)||(null===(r=document.documentElement)||void 0===r?void 0:r.scrollLeft)||0}},C=function(t){return function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=null===(n=e[r])||void 0===n?void 0:n.parentNode;return s?(e.push(s),t(e,++r)):e}([t])},E=function(t,e){var n={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return z(t).forEach((function(t){var r=e.getRect(t);n.top=Math.min(n.top,r.top),n.left=Math.min(n.left,r.left),n.bottom=Math.max(n.bottom,r.bottom),n.right=Math.max(n.right,r.right)})),n.height=n.bottom-n.top,n.width=n.right-n.left,n},A=function(t){return!t||t instanceof Document?T():{x:t.scrollLeft>=0?t.scrollLeft:T().x,y:t.scrollTop>=0?t.scrollTop:T().y}},x=function(t){var e=t.elementRect,n=t.containerRect,r=t.tolerance,s=void 0===r?{x:0,y:0}:r,i=[];return e.top-s.y<n.top&&i.push("top"),e.left-s.x<n.left&&i.push("left"),e.bottom+s.y>n.bottom&&i.push("bottom"),e.right+s.y>n.right&&i.push("right"),i},k=function(t){var e={x:0,y:0},n=window.getComputedStyle(t);if(!n.transform||"none"===n.transform)return e;if(n.transform.indexOf("3d")>=0){var r=n.transform.trim().match(/matrix3d\((.*?)\)/);if(r&&r.length){var s,i=null===(s=r[1])||void 0===s?void 0:s.split(",");e.x=parseInt(i[12])||0,e.y=parseInt(i[13])||0}return e}var o=n.transform.trim().match(/matrix\((.*?)\)/);if(o&&o.length){var a,l=null===(a=o[1])||void 0===a?void 0:a.split(",");e.x=parseInt(l[4])||0,e.y=parseInt(l[5])||0}return e},N=function(t,e){return e?function(t){var e=t.style.transform;if(!e||e.indexOf("translate")<0)return k(t);var n={x:0,y:0},r=e.trim().match(/translate[3dD]*?\(.*?\)/);if(r){var s,i=null===(s=r[0])||void 0===s?void 0:s.split("(");if(i){var o,a=null===(o=i[1])||void 0===o?void 0:o.split(",");n.x=parseInt(a[0])||0,n.y=parseInt(a[1])||0}}return n.x||n.x?n:k(t)}(t):function(t){var e=t.style,n={x:parseInt(e.left)||0,y:parseInt(e.top)||0};if(!n.x&&!n.x){var r=window.getComputedStyle(t);return{x:parseInt(r.left)||0,y:parseInt(r.top)||0}}return n}(t)},M=function(t){var e=t.computedStyle,n=t.node,r=e.position;n instanceof Document||("absolute"===r||"relative"===r||"fixed"===r)||(n.style.position="relative")},V=function(t,e,n){return console.warn('[DragSelect] TypeIssue: setting "'.concat(t,'" is not of type "').concat(e,'".'))},R=function(t,e,n,r){if(void 0===e)return n?i({},t,r):{};if(null===e)return i({},t,null);var s=!0,o=!1,a="string"==typeof r;a&&(s="string"==typeof e||e instanceof String),a&&!s&&(o=!0,V(t,"string"));var l=!Number.isNaN(r)&&"number"==typeof r;l&&(s=!Number.isNaN(e)&&"number"==typeof e),l&&!s&&(o=!0,V(t,"number"));var c="[object Object]"===Object.prototype.toString.call(r);c&&(s="[object Object]"===Object.prototype.toString.call(e)),c&&!s&&(o=!0,V(t,"object"));var u="boolean"==typeof r;u&&(s="boolean"==typeof e),u&&!s&&(o=!0,V(t,"boolean"));var d=Array.isArray(r);d&&(s=Array.isArray(e)),d&&!s&&(o=!0,V(t,"array"));var h=o||n;return"dragKeys"===t&&s?i({},t,Object.assign(r,e)):"dragKeys"!==t||s?("dropZones"===t&&s&&new Set(e.map((function(t){return t.id}))).size!==e.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),s?i({},t,e):h?i({},t,r):{}):h?i({},t,r):{}},O=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t;if(n>0){var s=(t.right-t.left)*n,i=(t.bottom-t.top)*n;r={left:t.left+s,right:t.right-s,top:t.top+i,bottom:t.bottom-i}}return r.left<e.right&&r.right>e.left&&r.top<e.bottom&&r.bottom>e.top},K=function(t){var e=t.element,n=t.posDirection,r=t.containerRect,s=t.useTransform,i=N(e,s),o=_(i,"+",n);Z(e,o,s);var a=e.getBoundingClientRect();!function(t){var e=t.element,n=t.edges,r=t.elementRect,s=t.containerRect,i=t.elementPos,o=t.useTransform;n.includes("top")&&Z(e,{y:i.y+s.top-r.top,x:i.x},o),n.includes("left")&&Z(e,{y:i.y,x:i.x+s.left-r.left},o),n.includes("bottom")&&Z(e,{y:i.y+s.bottom-r.bottom,x:i.x},o),n.includes("right")&&Z(e,{y:i.y,x:i.x+s.right-r.right},o)}({element:e,edges:x({elementRect:a,containerRect:r}),elementRect:a,containerRect:r,elementPos:o,useTransform:s})},j=function(t,e){window.removeEventListener("resize",e),window.removeEventListener("scroll",e),t.disconnect()},Z=function(t,e,n){if(n){var r=t.style.transform;t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,1px) ").concat(r.replace(/translate.*?\)/g,""))}else t.style.left="".concat(e.x,"px"),t.style.top="".concat(e.y,"px");return t},z=function(t){return t?!Array.isArray(t)&&(t instanceof HTMLElement||t instanceof SVGElement)?[t]:b(new Set(b(t))):[]},B=function(t,e){t.style.left="".concat(e.left,"px"),t.style.top="".concat(e.top,"px"),t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px")},H=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"DS",void 0),i(this,"_observers",void 0),i(this,"_node",void 0),i(this,"_parentNodes",void 0),i(this,"_computedStyle",void 0),i(this,"_computedBorder",void 0),i(this,"_rect",void 0),i(this,"setArea",(function(t){r.reset(),r._node=t,M({computedStyle:r.computedStyle,node:r._node}),setTimeout((function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})}))})),i(this,"start",(function(){r._observers=L(r.parentNodes,P((function(t){r.DS.PubSub.publish("Area:modified:pre",{event:t,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:t,item:r})}),60))})),i(this,"reset",(function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0})),i(this,"stop",(function(){r._observers.cleanup(),r.reset()})),i(this,"scroll",(function(t,e){var n={scroll_directions:t,scroll_multiplier:e};r.DS.PubSub.publish("Area:scroll:pre",n),function(t,e,n){if(e.length){var r=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=t instanceof Document?r||document.body:t,i=e.includes("top")&&s.scrollTop>0,o=e.includes("bottom")&&s.scrollTop<s.scrollHeight,a=e.includes("left")&&s.scrollLeft>0,l=e.includes("right")&&s.scrollLeft<s.scrollWidth;i&&(s.scrollTop-=1*n),o&&(s.scrollTop+=1*n),a&&(s.scrollLeft-=1*n),l&&(s.scrollLeft+=1*n)}}(r._node,t,e),r.DS.PubSub.publish("Area:scroll",n)})),this.DS=s,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.setArea(e.area)})),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return s(t,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof Document?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=function(t,e){if(t instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=t.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(t.clientWidth||n.width)*e,height:(t.clientHeight||n.height)*e}}(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=C(this.HTMLNode)}}]),t}(),F=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevCursorPos",void 0),i(this,"_prevScrollPos",void 0),i(this,"_elements",[]),i(this,"_dragKeys",void 0),i(this,"_dragKeysFlat",[]),i(this,"_selectionRect",void 0),i(this,"assignDragkeys",(function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map((function(t){return t.toLowerCase()})),down:r.DS.stores.SettingsStore.s.dragKeys.down.map((function(t){return t.toLowerCase()})),left:r.DS.stores.SettingsStore.s.dragKeys.left.map((function(t){return t.toLowerCase()})),right:r.DS.stores.SettingsStore.s.dragKeys.right.map((function(t){return t.toLowerCase()}))},r._dragKeysFlat=[].concat(b(r._dragKeys.up),b(r._dragKeys.down),b(r._dragKeys.left),b(r._dragKeys.right))})),i(this,"keyboardDrag",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability&&!r.DS.continue){var s={event:e,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],s),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=E(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var i=function(t){var e=t.shiftKey,n=t.keyboardDragSpeed,r=t.zoom,s=t.key,i=t.dragKeys,o=t.scrollDiff,a=t.canScroll,l=t.scrollCallback,c={x:0,y:0},u=e?4*n*r:n*r;return i.left.includes(s)&&(c.x=o.x||-u,e||o.x||!a||l(["left"],n)),i.right.includes(s)&&(c.x=o.x||u,e||o.x||!a||l(["right"],n)),i.up.includes(s)&&(c.y=o.y||-u,e||o.y||!a||l(["top"],n)),i.down.includes(s)&&(c.y=o.y||u,e||o.y||!a||l(["bottom"],n)),c}({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:n,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(i=r.limitDirection(i)),r._elements.forEach((function(t){return K({element:t,posDirection:i,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})),r.DS.publish(["Interaction:update:pre","Interaction:update"],s)}})),i(this,"keyboardEnd",(function(t){var e=t.event,n=t.key.toLowerCase();if(r.DS.stores.SettingsStore.s.keyboardDrag&&r._dragKeysFlat.includes(n)&&r.DS.SelectedSet.size&&r.DS.stores.SettingsStore.s.draggability){var s={event:e,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],s)}})),i(this,"start",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;e&&!n&&(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=E(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))})),i(this,"stop",(function(t){null!=t&&t.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])})),i(this,"update",(function(t){var e=t.isDragging,n=t.isDraggingKeyboard;if(e&&r._elements.length&&!n&&!r.DS.continue){var s=_(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(s=r.limitDirection(s)),r._elements.forEach((function(t){return K({element:t,posDirection:s,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}))}})),i(this,"limitDirection",(function(t){var e=r.DS.SelectorArea.rect,n=r.DS.stores.ScrollStore.scrollAmount,s={top:e.top-r._selectionRect.top+n.y,left:e.left-r._selectionRect.left+n.x,bottom:e.bottom-r._selectionRect.bottom+n.y,right:e.right-r._selectionRect.right+n.x};return 0===t.x&&0===t.y||(t.y<0&&(t.y=Math.max(t.y,s.top)),t.x<0&&(t.x=Math.max(t.x,s.left)),t.y>0&&(t.y=Math.min(t.y,s.bottom)),t.x>0&&(t.x=Math.min(t.x,s.right)),r._selectionRect.top+=t.y,r._selectionRect.bottom+=t.y,r._selectionRect.left+=t.x,r._selectionRect.right+=t.x),t})),i(this,"handleZIndex",(function(t){r._elements.forEach((function(e){return e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)+t?9999:-9998)}))})),this.DS=s,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(t,[{key:"_cursorDiff",get:function(){var t=this.DS.stores.PointerStore.currentVal,e=this._prevCursorPos?_(t,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=t,e}},{key:"_scrollDiff",get:function(){var t=this.DS.stores.ScrollStore.currentVal,e=this._prevScrollPos?_(t,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=t,e}}]),t}(),Y=function(){function t(e){var r=this,s=e.DS,o=e.id,a=e.element,l=e.droppables;n(this,t),i(this,"id",void 0),i(this,"element",void 0),i(this,"_droppables",void 0),i(this,"_rect",void 0),i(this,"_observers",void 0),i(this,"_timeout",void 0),i(this,"_itemsDropped",[]),i(this,"_itemsInside",void 0),i(this,"setReadyClasses",(function(t){if(!r.isDestroyed){var e=r.droppables.filter((function(t){return r.DS.SelectedSet.has(t)}));e.length&&(e.forEach((function(e){e.classList[t]("".concat(r.Settings.droppableClass)),e.classList[t]("".concat(r.Settings.droppableClass,"-").concat(r.id))})),r.element.classList[t]("".concat(r.Settings.dropZoneReadyClass)))}})),i(this,"handleNoDrop",(function(){var t;r.isDestroyed||(r.DS.SelectedSet.forEach((function(t){t.classList.remove(r.Settings.droppedTargetClass),t.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),r._itemsDropped=r._itemsDropped.filter((function(t){return!r.DS.SelectedSet.has(t)})),null!==(t=r._itemsDropped)&&void 0!==t&&t.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleDrop",(function(){var t,e,n;r.isDestroyed||(r._itemsDropped=b(new Set([].concat(b(r._itemsDropped),b(null===(t=r.droppables)||void 0===t?void 0:t.filter((function(t){return r.DS.SelectedSet.has(t)})))))),null===(e=r._itemsDropped)||void 0===e||e.forEach((function(t){t.classList.add("".concat(r.Settings.droppedTargetClass)),t.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))})),null!==(n=r._itemsDropped)&&void 0!==n&&n.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))})),i(this,"handleItemsInsideClasses",(function(){var t=!1;r.droppables.forEach((function(e){r.itemsInside.includes(e)?(e.classList.add("".concat(r.Settings.droppedInsideClass)),e.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),t=!0):(e.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),e.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||e.classList.remove("".concat(r.Settings.droppedInsideClass)))})),t?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))})),i(this,"start",(function(t){t.isDragging&&!r.isDestroyed&&r.setReadyClasses("add")})),i(this,"stop",(function(t){t.isDragging&&!r.isDestroyed&&(r.setReadyClasses("remove"),r.handleItemsInsideClasses())})),i(this,"toObject",(function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.id=o,this.element=a,l&&(this.droppables=z(l)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",(function(t){var e=t.settings;r.element&&(r.element.classList.remove(e["dropZoneClass:pre"]),r.element.classList.add(e.dropZoneClass))})),this._observers=L(this.parentNodes,P((function(){return r._rect=null}),this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"destroy",value:function(){var t=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach((function(e){e.classList.remove("".concat(t.Settings.droppedTargetClass)),e.classList.remove("".concat(t.Settings.droppedTargetClass,"-").concat(t.id)),e.classList.remove("".concat(t.Settings.droppableClass)),e.classList.remove("".concat(t.Settings.droppableClass,"-").concat(t.id))})),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var t=this;return this.isDestroyed?null:(this._itemsInside||(this._itemsInside=this.droppables.flatMap((function(e){return O(t.DS.SelectableSet.rects.get(e),t.rect,t.Settings.dropInsideThreshold)?[e]:[]})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._itemsInside=null}),this.Settings.refreshMemoryRate)),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=C(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(t){this._droppables=t}}]),t}(),W=s((function t(r){var s=this,o=r.DS;n(this,t),i(this,"_zoneByElement",new Map),i(this,"_zoneById",new Map),i(this,"_zonesByDroppable",new Map),i(this,"_zones",void 0),i(this,"setDropZones",(function(t){var n=t.dropZones;n&&(s._zones&&s._zones.forEach((function(t){return t.destroy()})),s._zones=n.map((function(t){return new Y(e({DS:s.DS},t))})),s._zones.forEach((function(t){s._zoneByElement.set(t.element,t),s._zoneById.set(t.id,t),t.droppables.forEach((function(e){var n=s._zonesByDroppable.get(e);if(null==n||!n.length)return s._zonesByDroppable.set(e,[t]);s._zonesByDroppable.set(e,b(new Set([].concat(b(n),[t]))))}))})))})),i(this,"_handleDrop",(function(t){s._zones.forEach((function(e){e!==t&&e.handleNoDrop()})),t&&t.handleDrop()})),i(this,"_getZoneByElementsFromPoint",(function(t,e){for(var n=e.x,r=e.y,i=0,o=t.length;i<o;i++){var a=s._zoneByElement.get(t[i]);if(a&&O(a.rect,{left:n,right:n,top:r,bottom:r},Math.min(s.Settings.dropTargetThreshold,.5)))return a}})),i(this,"stop",(function(t){if(t.isDragging){var e=s.getTarget();s._handleDrop(e)}})),i(this,"getItemsDroppedById",(function(t){var e=s._zoneById.get(t);return e?e.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(t,")"))})),i(this,"getItemsInsideById",(function(t,e){var n=s._zoneById.get(t);if(!n)return console.warn("[DragSelect] No zone found (id: ".concat(t,")"));var r=n.itemsInside;return e&&n.handleItemsInsideClasses(),r})),i(this,"getTarget",(function(t){var e;if(null!==(e=s._zones)&&void 0!==e&&e.length){var n=(null==t?void 0:t.x)||s.DS.stores.PointerStore.currentVal.x,r=(null==t?void 0:t.y)||s.DS.stores.PointerStore.currentVal.y,i=document.elementsFromPoint(n,r);return s._getZoneByElementsFromPoint(i,{x:n,y:r})}})),this.DS=o,this.Settings=o.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",(function(t){var e=t.settings;return s.setDropZones(e)})),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)})),G=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"isInteracting",void 0),i(this,"isDragging",void 0),i(this,"init",(function(){return r.DS.publish("Interaction:init:pre",{})})),i(this,"_init",(function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})})),i(this,"start",(function(t){return r.DS.publish("Interaction:start:pre",{event:t,isDragging:r.isDragging})})),i(this,"_start",(function(t){"touchstart"===t.type&&t.preventDefault(),r._canInteract(t)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(t),r.DS.publish("Interaction:start",{event:t,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))})),i(this,"isDragEvent",(function(t){var e=t.target.closest(".".concat(r.Settings.selectableClass));return!(!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(t)||!e)&&(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(e)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(e)):r.DS.SelectedSet.add(e)),!!r.DS.SelectedSet.has(e))})),i(this,"onClick",(function(t){var e=t.event;if(r._canInteract(e)&&!(e.detail>0)){var n=r.DS,s=n.stores,i=s.PointerStore,o=s.KeyStore,a=n.SelectableSet,l=n.SelectedSet;i.start(e);var c=e.target;a.has(c)&&(o.isMultiSelectKeyPressed(e)||l.clear(),l.toggle(c),r.reset())}})),i(this,"stop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(t.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(t.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),t.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)})),i(this,"update",(function(t){var e=t.event,n=t.scroll_directions,s=t.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:e,scroll_directions:n,scroll_multiplier:s,isDragging:r.isDragging})})),i(this,"reset",(function(t){return r.DS.publish("Interaction:end:pre",{event:t,isDragging:r.isDragging})})),i(this,"_reset",(function(t){var e=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:t,isDragging:e})})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",(function(t){var e=t.settings;r.stop(e["area:pre"]),r.init()})),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:start:pre",(function(t){var e=t.event;return r._start(e)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(t){var e=t.event;return r._reset(e)})),this.DS.subscribe("Area:scroll",this.update)}return s(t,[{key:"_canInteract",value:function(t){var e=0===t.clientX&&0===t.clientY&&0===t.detail&&t.target;return!(2===t.button||this.isInteracting||t.target&&!this.DS.SelectorArea.isInside(t.target)||!e&&!this.DS.SelectorArea.isClicked(t))}}]),t}(),U=s((function t(e){var r=this,s=e.DS;n(this,t),i(this,"subscribers",{}),i(this,"subscribe",(function(t,e){return Array.isArray(r.subscribers[t])||(r.subscribers[t]=[]),r.subscribers[t].push(e),r.subscribers[t].length-1})),i(this,"unsubscribe",(function(t,e,n){n>=0?r.subscribers[t].splice(n,1):e&&(r.subscribers[t]=r.subscribers[t].filter((function(t){return t!==e})))})),i(this,"publish",(function(t,e){Array.isArray(t)?t.forEach((function(t){return r._publish(t,e)})):r._publish(t,e)})),i(this,"_publish",(function(t,e){var n=r.subscribers[t];Array.isArray(n)&&(t.includes(":pre")?r._handlePrePublish(n,e):r._handlePublish(n,e))})),i(this,"_handlePublish",(function(t,e){for(var n=0,s=t.length;n<s;n++){if(r.DS.stopped)return;t[n](e)}})),i(this,"_handlePrePublish",(function(t,e){for(var n=t.length;n--;){if(r.DS.stopped)return;t[n](e)}})),this.DS=s})),X=function(t){o(r,t);var e=S(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"_rects",void 0),i(h(s),"_timeout",void 0),i(h(s),"init",(function(){return z(s.Settings.selectables).forEach((function(t){return s.add(t)}))})),i(h(s),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"_onClick",(function(t){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:t})})),i(h(s),"_onPointer",(function(t){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:t})})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),i(h(s),"getRect",(function(t){return s._rects?s.rects.get(t):t.getBoundingClientRect()})),s.DS=o,s.Settings=o.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",(function(){s.clear(),s.init()})),s.DS.subscribe("Settings:updated:selectableClass",(function(t){var e=t.settings;s.forEach((function(t){t.classList.remove(e["selectableClass:pre"]),t.classList.add(e.selectableClass)}))})),s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:added:pre",e),t.classList.add(this.Settings.selectableClass),t.addEventListener("click",this._onClick),this.Settings.usePointerEvents?t.addEventListener("pointerdown",this._onPointer,{passive:!1}):t.addEventListener("mousedown",this._onPointer),t.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&M({computedStyle:window.getComputedStyle(t),node:t}),this.DS.publish("Selectable:added",e),g(a(r.prototype),"add",this).call(this,t)}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selectable:removed:pre",e),t.classList.remove(this.Settings.selectableClass),t.classList.remove(this.Settings.hoverClass),t.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?t.removeEventListener("pointerdown",this._onPointer,{passive:!1}):t.removeEventListener("mousedown",this._onPointer),t.removeEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.publish("Selectable:removed",e),g(a(r.prototype),"delete",this).call(this,t)}}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var t=this;return this._rects||(this._rects=new Map,this.forEach((function(e){return t._rects.set(e,e.getBoundingClientRect())})),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((function(){return t._rects=null}),this.Settings.refreshMemoryRate)),this._rects}}]),r}(d(Set)),q=function(t){o(r,t);var e=S(r);function r(t){var s,o=t.DS;return n(this,r),i(h(s=e.call(this)),"clear",(function(){return s.forEach((function(t){return s.delete(t)}))})),i(h(s),"addAll",(function(t){return t.forEach((function(t){return s.add(t)}))})),i(h(s),"deleteAll",(function(t){return t.forEach((function(t){return s.delete(t)}))})),s.DS=o,s}return s(r,[{key:"add",value:function(t){if(!g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selected:added:pre",e),g(a(r.prototype),"add",this).call(this,t),t.classList.add(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)+1),this.DS.publish("Selected:added",e),this}}},{key:"delete",value:function(t){if(g(a(r.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};this.DS.publish("Selected:removed:pre",e);var n=g(a(r.prototype),"delete",this).call(this,t);return t.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)-1),this.DS.publish("Selected:removed",e),n}}},{key:"toggle",value:function(t){return this.has(t)?this.delete(t):this.add(t),t}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(d(Set)),$=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_prevSelectedSet",void 0),i(this,"start",(function(t){var e=t.event;t.isDragging||(r._storePrevious(e),r._handleInsideSelection(!0,e))})),i(this,"update",(function(t){t.isDragging||r.DS.continue||r._handleInsideSelection()})),i(this,"_handleInsideSelection",(function(t,e){var n,s=r.DS,i=s.SelectableSet,o=s.SelectorArea,a=s.Selector,l=r.DS.stores.KeyStore.isMultiSelectKeyPressed(e)&&r.Settings.multiSelectToggling,c=r.Settings.selectionThreshold,u=i.rects,d=a.rect,h=new Map,p=new Map,S=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=m(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(u);try{for(S.s();!(n=S.n()).done;){var f=v(n.value,2),g=f[0],b=f[1];o.isInside(g,b)&&(O(b,d,c)?h.set(g,b):p.set(g,b))}}catch(t){S.e(t)}finally{S.f()}if(!r.DS.continue){var y=r.filterSelected({select:h,unselect:p,selectorRect:d}),D=y.select,_=y.unselect;D.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.multiSelectionToggle,s=t.SelectedSet,i=t.hoverClassName;e.classList.contains(i)&&!n||(s.has(e)?r&&s.delete(e):s.add(e),e.classList.add(i))}({element:n,force:t,multiSelectionToggle:l,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})})),_.forEach((function(e,n){return function(t){var e=t.element,n=t.force,r=t.SelectedSet,s=t.PrevSelectedSet,i=t.hoverClassName;if(!e.classList.contains(i)&&!n)return!1;var o=r.has(e),a=s.has(e);o&&!a?r.delete(e):!o&&a&&r.add(e),e.classList.remove(i)}({element:n,force:t,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})}))}})),i(this,"filterSelected",(function(t){var e=t.select,n=t.unselect;return t.selectorRect,{select:e,unselect:n}})),this.DS=s,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(t,[{key:"_storePrevious",value:function(t){var e=this.DS,n=e.stores.KeyStore,r=e.SelectedSet;n.isMultiSelectKeyPressed(t)?this._prevSelectedSet=new Set(r):this._prevSelectedSet=new Set}}]),t}(),J=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_rect",void 0),i(this,"attachSelector",(function(){var t,e,n,s;r.HTMLNode&&null!==(t=r.DS.SelectorArea)&&void 0!==t&&t.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||(n=r.DS.stores.SettingsStore.s.customStyles,(s=document.createElement("div")).style.position="absolute",n||(s.style.background="rgba(0, 175, 255, 0.2)",s.style.border="1px solid rgba(0, 175, 255, 0.8)",s.style.display="none",s.style.pointerEvents="none"),s),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&null!==(e=r.DS.SelectorArea)&&void 0!==e&&e.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)})),i(this,"start",(function(t){if(!t.isDragging){var e=r.DS.stores.PointerStore.initialValArea;B(r.HTMLNode,w(e,1)),r.HTMLNode.style.display="block",r._rect=null}})),i(this,"stop",(function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"})),i(this,"update",(function(t){if(!t.isDragging&&!r.DS.continue){var e=r.DS.stores,n=e.ScrollStore,s=e.PointerStore,i=function(t){var e=t.scrollAmount,n=t.initialPointerPos,r=t.pointerPos,s={};return r.x>n.x-e.x?(s.left=n.x-e.x,s.width=r.x-n.x+e.x):(s.left=r.x,s.width=n.x-r.x-e.x),r.y>n.y-e.y?(s.top=n.y-e.y,s.height=r.y-n.y+e.y):(s.top=r.y,s.height=n.y-r.y-e.y),s}({scrollAmount:n.scrollAmount,initialPointerPos:s.initialValArea,pointerPos:s.currentValArea});B(r.HTMLNode,i),r._rect=null}})),this.DS=s,this.DS.subscribe("Settings:updated:selectorClass",(function(t){var e=t.settings;r.HTMLNode.classList.remove(e["selectorClass:pre"]),r.HTMLNode.classList.add(e.selectorClass)})),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(t,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),Q=function(){function t(e){var r,s=this,o=e.DS;n(this,t),i(this,"_scrollInterval",void 0),i(this,"_rect",void 0),i(this,"currentEdges",[]),i(this,"start",(function(){s.applyElements("append"),s.updatePos()})),i(this,"applyElements",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",e=document.body?"body":"documentElement",n="".concat(t,"Child");s.HTMLNode[n](s.DS.Selector.HTMLNode),document[e][n](s.HTMLNode)})),i(this,"updatePos",(function(){s._rect=null;var t=s.DS.Area.rect,e=s.DS.Area.computedBorder,n=s.HTMLNode.style,r="".concat(t.top+e.top,"px"),i="".concat(t.left+e.left,"px"),o="".concat(t.width,"px"),a="".concat(t.height,"px");n.top!==r&&(n.top=r),n.left!==i&&(n.left=i),n.width!==o&&(n.width=o),n.height!==a&&(n.height=a)})),i(this,"stop",(function(t){s.stopAutoScroll(),t&&s.applyElements("remove")})),i(this,"startAutoScroll",(function(){s.currentEdges=[],s._scrollInterval=setInterval((function(){return s.handleAutoScroll()}),16)})),i(this,"handleAutoScroll",(function(){if(!s.DS.continue){var t=s.DS,e=t.stores.PointerStore,n=t.Area;s.currentEdges=x({elementRect:w(e.currentVal),containerRect:s.rect,tolerance:s.DS.stores.SettingsStore.s.overflowTolerance}),s.currentEdges.length&&n.scroll(s.currentEdges,s.DS.stores.SettingsStore.s.autoScrollSpeed)}})),i(this,"stopAutoScroll",(function(){s.currentEdges=[],clearInterval(s._scrollInterval)})),i(this,"isInside",(function(t,e){return!(!s.DS.Area.HTMLNode.contains(t)||!s.DS.stores.ScrollStore.canScroll)||O(s.rect,e||t.getBoundingClientRect())})),this.DS=o,this.HTMLNode=((r=document.createElement("div")).style.position="fixed",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="999999999999999999",r),this.DS.subscribe("Settings:updated:selectorAreaClass",(function(t){var e=t.settings;s.HTMLNode.classList.remove(e["selectorAreaClass:pre"]),s.HTMLNode.classList.add(e.selectorAreaClass)})),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",(function(){s.updatePos(),s.stopAutoScroll()}))}return s(t,[{key:"isClicked",value:function(t){var e=this.DS.stores.PointerStore,n=t?e.getPointerPosition(t):e.initialVal;return O({left:n.x,top:n.y,right:n.x,bottom:n.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),tt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_currentValues",new Set),i(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),i(this,"init",(function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)})),i(this,"keydown",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:t,key:e}),r._currentValues.add(e),r.DS.publish("KeyStore:down",{event:t,key:e})})),i(this,"keyup",(function(t){var e=t.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:t,key:e}),r._currentValues.delete(e),r.DS.publish("KeyStore:up",{event:t,key:e})})),i(this,"stop",(function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()})),i(this,"reset",(function(){return r._currentValues.clear()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init)}return s(t,[{key:"isMultiSelectKeyPressed",value:function(t){var e=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var n=this.DS.stores.SettingsStore.s.multiSelectKeys.map((function(t){return t.toLocaleLowerCase()}));return!!this.currentValues.some((function(t){return n.includes(t.toLocaleLowerCase())}))||!(!t||!n.some((function(n){return t[e._keyMapping[n]]})))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),t}(),et=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_isMouseInteraction",!1),i(this,"_initialValArea",void 0),i(this,"_currentValArea",void 0),i(this,"_lastValArea",void 0),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_lastVal",void 0),i(this,"_lastTouch",void 0),i(this,"init",(function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})})),i(this,"getPointerPosition",(function(t){return function(t){var e=t.event;return{x:e.clientX,y:e.clientY}}({event:r._normalizedEvent(t)})})),i(this,"update",(function(t){t&&(r.DS.publish("PointerStore:updated:pre",{event:t}),r.currentVal=r.getPointerPosition(t),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:t}))})),i(this,"stop",(function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout((function(){return r._isMouseInteraction=!1}),100)})),i(this,"reset",(function(t){t&&(r.currentVal=r.lastVal=r.getPointerPosition(t),r.stop(),r.init())})),this.DS=s,this.Settings=s.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(t){var e=t.event;return r.start(e)})),this.DS.subscribe("Interaction:end",(function(t){var e=t.event;return r.reset(e)}))}return s(t,[{key:"start",value:function(t){t&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(t))}},{key:"_normalizedEvent",value:function(t){return"touches"in t&&"touchend"!==t.type&&(this._lastTouch=t),"touches"in t?this._lastTouch.touches[0]:t}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(t){this._initialVal=t,this._initialValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(t){this._currentVal=t,this._currentValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(t){this._lastVal=t,this._lastValArea=t&&_(t,"-",_(I(this.DS.Area.rect),"+",I(this.DS.Area.computedBorder)))}}]),t}(),nt=function(){function t(e){var r=this,s=e.DS;n(this,t),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_canScroll",void 0),i(this,"init",(function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"start",(function(){r._currentVal=r._initialVal=A(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)})),i(this,"update",(function(){return r._currentVal=A(r.DS.stores.SettingsStore.s.area)})),i(this,"stop",(function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null})),i(this,"reset",(function(){r.stop(),r.start()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return r.start()})),this.DS.subscribe("Interaction:end",(function(){return r.reset()}))}return s(t,[{key:"canScroll",get:function(){return"boolean"==typeof this._canScroll?this._canScroll:this._canScroll=(t=this.DS.stores.SettingsStore.s.area,!!((e=A(t)).x||e.y||(t instanceof Document?t.body?t.body.scrollTop=1:t.documentElement.scrollTop=1:t.scrollTop=1)));var t,e}},{key:"scrollAmount",get:function(){var t,e=_(this.currentVal,"-",this.initialVal),n={x:t=this.DS.stores.SettingsStore.s.zoom,y:t},r=_(_(e,"*",n),"-",e);return{x:e.x+r.x,y:e.y+r.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=A(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),t}(),rt=s((function t(r){var s=this,o=r.DS,a=r.settings;n(this,t),i(this,"_settings",{}),i(this,"s",{}),i(this,"update",(function(t){var n=t.settings,r=t.init;return s.DS.publish("Settings:updated:pre",e({settings:n},r?{init:r}:{}))})),i(this,"_update",(function(t){for(var n=function(t,n){return e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e(e({},R("area",t.area,n,document)),R("selectables",t.selectables,n,null)),R("autoScrollSpeed",t.autoScrollSpeed,n,5)),R("overflowTolerance",t.overflowTolerance,n,{x:25,y:25})),R("zoom",t.zoom,n,1)),R("customStyles",t.customStyles,n,!1)),R("multiSelectMode",t.multiSelectMode,n,!1)),R("multiSelectToggling",t.multiSelectToggling,n,!0)),R("multiSelectKeys",t.multiSelectKeys,n,["Control","Shift","Meta"])),R("selector",t.selector,n,null)),R("selectionThreshold",t.selectionThreshold,n,0)),R("draggability",t.draggability,n,!0)),R("immediateDrag",t.immediateDrag,n,!0)),R("keyboardDrag",t.keyboardDrag,n,!0)),R("dragKeys",t.dragKeys,n,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),R("keyboardDragSpeed",t.keyboardDragSpeed,n,10)),R("useTransform",t.useTransform,n,!0)),R("refreshMemoryRate",t.refreshMemoryRate,n,80)),R("dropZones",t.dropZones,n,[])),R("dropInsideThreshold",t.dropInsideThreshold,n,1)),R("dropTargetThreshold",t.dropTargetThreshold,n,0)),R("usePointerEvents",t.usePointerEvents,n,!1)),R("hoverClass",t.hoverClass,n,"ds-hover")),R("selectableClass",t.selectableClass,n,"ds-selectable")),R("selectedClass",t.selectedClass,n,"ds-selected")),R("selectorClass",t.selectorClass,n,"ds-selector")),R("selectorAreaClass",t.selectorAreaClass,n,"ds-selector-area")),R("droppedTargetClass",t.droppedTargetClass,n,"ds-dropped-target")),R("droppedInsideClass",t.droppedInsideClass,n,"ds-dropped-inside")),R("droppableClass",t.droppableClass,n,"ds-droppable")),R("dropZoneClass",t.dropZoneClass,n,"ds-dropzone")),R("dropZoneReadyClass",t.dropZoneReadyClass,n,"ds-dropzone-ready")),R("dropZoneTargetClass",t.dropZoneTargetClass,n,"ds-dropzone-target")),R("dropZoneInsideClass",t.dropZoneInsideClass,n,"ds-dropzone-inside")),R("dragAsBlock",t.dragAsBlock,n,!1))}(t.settings,t.init),r=function(){var t,e=v(a[o],2),n=e[0],r=e[1];n in s._settings||Object.defineProperty(s.s,n,{get:function(){return s._settings[n]},set:function(t){return s.update({settings:i({},n,t)})}}),s._settings["".concat(n,":pre")]=s._settings[n],s._settings[n]=r;var l={settings:(t={},i(t,n,s._settings[n]),i(t,"".concat(n,":pre"),s._settings["".concat(n,":pre")]),t)};s.DS.publish("Settings:updated",l),s.DS.publish("Settings:updated:".concat(n),l)},o=0,a=Object.entries(n);o<a.length;o++)r()})),this.DS=o,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})})),st=function(){function t(r){var s=this;n(this,t),i(this,"continue",!1),i(this,"start",(function(){s.stopped=!1,s.Interaction.init()})),i(this,"break",(function(){return s.continue=!0})),i(this,"setSettings",(function(t){return s.stores.SettingsStore.update({settings:t})})),i(this,"getSelection",(function(){return s.SelectedSet.elements})),i(this,"getSelectables",(function(){return s.SelectableSet.elements})),i(this,"getInitialCursorPosition",(function(){return s.stores.PointerStore.initialVal})),i(this,"getCurrentCursorPosition",(function(){return s.stores.PointerStore.currentVal})),i(this,"getPreviousCursorPosition",(function(){return s.stores.PointerStore.lastVal})),i(this,"getInitialCursorPositionArea",(function(){return s.stores.PointerStore.initialValArea})),i(this,"getCurrentCursorPositionArea",(function(){return s.stores.PointerStore.currentValArea})),i(this,"getPreviousCursorPositionArea",(function(){return s.stores.PointerStore.lastValArea})),i(this,"isMultiSelect",(function(t){return s.stores.KeyStore.isMultiSelectKeyPressed(t)})),i(this,"isDragging",(function(){return s.Interaction.isDragging})),i(this,"getZoneByCoordinates",(function(t){var e;return null===(e=s.DropZones.getTarget(t))||void 0===e?void 0:e.toObject()})),i(this,"getItemsDroppedByZoneId",(function(t){return s.DropZones.getItemsDroppedById(t)})),i(this,"getItemsInsideByZoneId",(function(t,e){return s.DropZones.getItemsInsideById(t,e)})),this.PubSub=new U({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new rt({DS:this,settings:r}),this.stores.PointerStore=new et({DS:this}),this.stores.ScrollStore=new nt({DS:this}),this.stores.KeyStore=new tt({DS:this}),this.Area=new H({DS:this}),this.Selector=new J({DS:this}),this.SelectorArea=new Q({DS:this}),this.SelectableSet=new X({DS:this}),this.SelectedSet=new q({DS:this}),this.Selection=new $({DS:this}),this.Drag=new F({DS:this}),this.DropZones=new W({DS:this}),this.Interaction=new G({DS:this}),function(t){for(var n=t.subscribe,r=t.publish,s=t.Interaction,i=t.SelectedSet,o=t.DropZones,a={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(t){return t.event}}],"Interaction:end":[{name:"callback",extraData:function(){var t=o.getTarget();return e({},t?{dropTarget:t.toObject()}:{})}}]},l=function(){var t=v(u[c],2),o=t[0],a=t[1];["pre",!1].forEach((function(t){return n(t?"".concat(o,":").concat(t):o,(function(n){return a.forEach((function(o){return(!o.condition||o.condition(n))&&r(t?"".concat(t).concat(o.name):o.name,e(e({items:i.elements,isDragging:s.isDragging},n),o.extraData?o.extraData(n):{}))}))}))}))},c=0,u=Object.entries(a);c<u.length;c++)l()}({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",(function(){return s.continue=!1})),this.start()}return s(t,[{key:"stop",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(t),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),t&&this.SelectableSet.clear(),e&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(z(t)),n||this.addSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(z(t)),n&&this.removeSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return z(t).forEach((function(s){return e.SelectedSet.has(s)?e.removeSelection(t,n,r):e.addSelection(t,n,r)})),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(t,e,n),this.getSelection()}},{key:"clearSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.SelectedSet.clear(),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(t,e,n){var r=z(t);return this.SelectableSet.addAll(r),e&&this.SelectedSet.addAll(r),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}},{key:"setSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(t,e),this.addSelectables(t,n)}},{key:"removeSelectables",value:function(t,e,n){return this.SelectableSet.deleteAll(z(t)),e&&this.removeSelection(t),n&&this.PubSub.publish("callback",{items:this.getSelection()}),t}}]),t}();return st.isCollision=O,st})); |
{ | ||
"name": "dragselect", | ||
"version": "2.7.2", | ||
"version": "2.7.3", | ||
"description": "Easy JavaScript library for selecting and moving elements. With no dependencies. Drag-Select & Drag-And-Drop.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/DragSelect.js", |
@@ -159,3 +159,2 @@ // @ts-check | ||
console.log('isClicked', initialVal, this.rect, this.HTMLNode); | ||
return isCollision( | ||
@@ -162,0 +161,0 @@ { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
600293
12662