New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dragselect

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dragselect - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

dist/methods/hydrateSettings.d.ts

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# Next
- Change all Properties dynamically *anytime*. Solves #111 and #95. Very helpful for async libraries like react. You can do so using the `setSettings` method, you can pass any settings in the object and they will be updated. Example: update the drag area at any time by running: `ds.setSettings({ area: document.getElementById("new-area") })`.
- Remove deprecated keys `ctrlKey`, `shiftKey` and `metaKey`. Use `Control`, `Shift` and `Meta` respectively instead.
- Remove deprecated method `getCursorPositionDifference`. Calculate the difference on your own instead.
- Remove deprecated setting property callbacks. Use `DragSelect.subscribe("callback", (callbackObject) => {})` instead.
# 2.3.1

@@ -2,0 +9,0 @@

11

deploying.md

@@ -14,6 +14,6 @@ # Don‘t do this if you are not project owner!

Tipically you don’t have to do this, since you most likely are not the project owner.
Typically you don’t have to do this, since you most likely are not the project owner.
But if you are the project owner:
- Travis will take care of deployment to gh-pages when you push/merge to github (gh-pages will be build by travis)
- Travis will take care of deployment to gh-pages when you push/merge to github (gh-pages will be build by Travis)

@@ -25,3 +25,2 @@ If this was successful, the next step is to publish the new version on `npm`:

npm run rollup
npm publish
```

@@ -33,2 +32,6 @@ Rollup is necessary for npm packages (since `dist` will be deployed to npm but is ignored in repo)

After that push again, just to make sure
After that push again, just to make sure and then publish
```
npm publish
```

@@ -8,3 +8,3 @@ export default DragSelect;

*/
constructor({ area, selectables, autoScrollSpeed, overflowTolerance, zoom, customStyles, multiSelectMode, multiSelectToggling, multiSelectKeys, selector, draggability, immediateDrag, keyboardDrag, dragKeys, keyboardDragSpeed, useTransform, hoverClass, selectableClass, selectedClass, selectorClass, selectorAreaClass, callback, onDragMove, onDragStartBegin, onDragStart, onElementSelect, onElementUnselect, }: Settings);
constructor(settings: Settings);
/**

@@ -18,4 +18,5 @@ * used to skip all current Selection and dragNdrop functionality

unsubscribe: (eventName: DSCallbackNames, callback?: Function, id?: number) => void;
publish: (eventName: "dragstart" | "dragmove" | "autoscroll" | "elementselect" | "elementunselect" | "callback" | "Interaction:init" | "Interaction:start" | "Interaction:end" | "Interaction:update" | "Area:modified" | "Area:scroll" | "PointerStore:updated" | "Selected:added" | "Selected:removed" | "Selectable:click" | "Selectable:pointer" | "KeyStore:down" | "KeyStore:up" | "Interaction:init:pre" | "Interaction:start:pre" | "Interaction:end:pre" | "Interaction:update:pre" | "Area:modified:pre" | "Area:scroll:pre" | "PointerStore:updated:pre" | "Selected:added:pre" | "Selected:removed:pre" | "Selectable:click:pre" | "Selectable:pointer:pre" | "KeyStore:down:pre" | "KeyStore:up:pre" | DSCallbackNames[], data: CallbackObject) => void;
publish: (eventName: DSCallbackNames | DSCallbackNames[], data: CallbackObject) => void;
stores: {
SettingsStore: SettingsStore;
PointerStore: PointerStore;

@@ -33,10 +34,2 @@ ScrollStore: ScrollStore;

Interaction: Interaction;
_callbacksTemp({ callback, onDragMove, onDragStart, onDragStartBegin, onElementSelect, onElementUnselect, }: {
callback: any;
onDragMove: any;
onDragStart: any;
onDragStartBegin: any;
onElementSelect: any;
onElementUnselect: any;
}): void;
/**

@@ -158,10 +151,2 @@ * Initializes the functionality. Automatically triggered when created.

/**
* Utility method that returns the cursor position difference between start and now
* @param {boolean} [usePreviousCursorDifference] if true, it will output the cursor position difference between the previous selection and now
* @param {boolean} [useAreaPositions] if true, it will use cursor positions relative to the area
* @return {Vect2}
* @deprecated
*/
getCursorPositionDifference(usePreviousCursorDifference?: boolean, useAreaPositions?: boolean): Vect2;
/**
* Whether the user is currently drag n dropping elements (instead of selection)

@@ -171,4 +156,11 @@ * @return {boolean}

isDragging: () => boolean;
/**
* Update any setting dynamically
* @param {Settings} settings
* @return {void}
*/
setSettings: (settings: Settings) => void;
}
import { PubSub } from "./modules";
import { SettingsStore } from "./stores";
import { PointerStore } from "./stores";

@@ -175,0 +167,0 @@ import { ScrollStore } from "./stores";

@@ -1,1 +0,1 @@

function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,r){return(c=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&a(i,r.prototype),i}).apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?d(e):t}function f(e){var t=l();return function(){var r,n=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h(this,r)}}function v(e,t,r){return(v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||m(e,t)||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 p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(e)||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(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(e,t,r){var n=e.x,i=e.y,o=r.x,s=r.y;return{"+":{x:n+o,y:i+s},"-":{x:n-o,y:i-s},"*":{x:n*o,y:i*s},"/":{x:n/o,y:i/s}}[t]},y=function(e){return{x:e.left,y:e.top}},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{left:e.x,top:e.y,right:e.x,bottom:e.y,width:t,height:t}},D=function(){var e,t,r,n;return{y:(null===(e=document.body)||void 0===e?void 0:e.scrollTop)||(null===(t=document.documentElement)||void 0===t?void 0:t.scrollTop)||0,x:(null===(r=document.body)||void 0===r?void 0:r.scrollLeft)||(null===(n=document.documentElement)||void 0===n?void 0:n.scrollLeft)||0}},P=function(e){return!e||e instanceof Document?D():{x:e.scrollLeft>=0?e.scrollLeft:D().x,y:e.scrollTop>=0?e.scrollTop:D().y}},w=function(e){var t=e.elementRect,r=e.containerRect,n=e.tolerance,i=void 0===n?{x:0,y:0}:n,o=[];return t.top-i.y<r.top&&o.push("top"),t.left-i.x<r.left&&o.push("left"),t.bottom+i.y>r.bottom&&o.push("bottom"),t.right+i.y>r.right&&o.push("right"),o},k=function(e){var t={x:0,y:0},r=window.getComputedStyle(e);if(!r.transform||"none"===r.transform)return t;if(r.transform.indexOf("3d")>=0){var n=r.transform.trim().match(/matrix3d\((.*?)\)/);if(n&&n.length){var i,o=null===(i=n[1])||void 0===i?void 0:i.split(",");t.x=parseInt(o[12])||0,t.y=parseInt(o[13])||0}return t}var s=r.transform.trim().match(/matrix\((.*?)\)/);if(s&&s.length){var a,l=null===(a=s[1])||void 0===a?void 0:a.split(",");t.x=parseInt(l[4])||0,t.y=parseInt(l[5])||0}return t},E=function(e,t){return t?function(e){var t=e.style.transform;if(!t||t.indexOf("translate")<0)return k(e);var r={x:0,y:0},n=t.trim().match(/translate[3dD]*?\(.*?\)/);if(n){var i,o=null===(i=n[0])||void 0===i?void 0:i.split("(");if(o){var s,a=null===(s=o[1])||void 0===s?void 0:s.split(",");r.x=parseInt(a[0])||0,r.y=parseInt(a[1])||0}}return r.x||r.x?r:k(e)}(e):function(e){var t=e.style,r={x:parseInt(t.left)||0,y:parseInt(t.top)||0};if(!r.x&&!r.x){var n=window.getComputedStyle(e);return{x:parseInt(n.left)||0,y:parseInt(n.top)||0}}return r}(e)},x=function(e){var t=e.computedStyle,r=e.node,n=t.position;r instanceof HTMLDocument||("absolute"===n||"relative"===n||"fixed"===n)||(r.style.position="relative")},I=function(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top},A=function(e){var t=e.element,r=e.posDirection,n=e.containerRect,i=e.useTransform,o=E(t,i),s=b(o,"+",r);C(t,s,i);var a=t.getBoundingClientRect();!function(e){var t=e.element,r=e.edges,n=e.elementRect,i=e.containerRect,o=e.elementPos,s=e.useTransform;r.includes("top")&&C(t,{y:o.y+i.top-n.top,x:o.x},s),r.includes("left")&&C(t,{y:o.y,x:o.x+i.left-n.left},s),r.includes("bottom")&&C(t,{y:o.y+i.bottom-n.bottom,x:o.x},s),r.includes("right")&&C(t,{y:o.y,x:o.x+i.right-n.right},s)}({element:t,edges:w({elementRect:a,containerRect:n}),elementRect:a,containerRect:n,elementPos:s,useTransform:i})},C=function(e,t,r){if(r){var n=e.style.transform;e.style.transform="translate3d(".concat(t.x,"px,").concat(t.y,"px,1px) ").concat(n.replace(/translate.*?\)/g,""))}else e.style.left="".concat(t.x,"px"),e.style.top="".concat(t.y,"px");return e},L=function(e){for(var t=e.subscribe,r=e.publish,o=e.Interaction,s=e.SelectedSet,a=function(){var e=S(c[l],2),a=e[0],u=e[1];["pre",!1].forEach((function(e){return t(e?"".concat(a,":").concat(e):a,(function(t){return u.forEach((function(a){return(!a.condition||a.condition(t))&&r(e?"".concat(e).concat(a.name):a.name,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({items:s.elements,isDragging:o.isDragging},t))}))}))}))},l=0,c=Object.entries({"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(e){return e.event}}],"Interaction:end":[{name:"callback"}]});l<c.length;l++)a()},T=function(e){return e?!Array.isArray(e)&&(e instanceof HTMLElement||e instanceof SVGElement)?[e]:p(e):[]},V=function(e,t){e.style.left="".concat(t.left,"px"),e.style.top="".concat(t.top,"px"),e.style.width="".concat(t.width,"px"),e.style.height="".concat(t.height,"px")},N=function(){function t(r){var i,o,s,a=this,l=r.area,c=r.PS,u=r.zoom;e(this,t),n(this,"_modificationCallback",void 0),n(this,"_modificationObserver",void 0),n(this,"_zoom",void 0),n(this,"_node",void 0),n(this,"_parentNodes",void 0),n(this,"_computedStyle",void 0),n(this,"_computedBorder",void 0),n(this,"_rect",void 0),n(this,"setArea",(function(e){a._node=e,x({computedStyle:a.computedStyle,node:a._node}),setTimeout((function(){a.PubSub.publish("Area:modified:pre",{item:a}),a.reset(),a.PubSub.publish("Area:modified",{item:a})}))})),n(this,"start",(function(){var e,t,r;e=a.parentNodes,t=a._modificationCallback,r=a._modificationObserver,window.addEventListener("resize",t),window.addEventListener("scroll",t),e.forEach((function(e,t){r.observe(e,{childList:0!==t,attributes:!0})}))})),n(this,"reset",(function(){a._computedStyle=void 0,a._rect=void 0,a._computedBorder=void 0,a._parentNodes=void 0})),n(this,"stop",(function(){var e,t;e=a._modificationObserver,t=a._modificationCallback,window.removeEventListener("resize",t),window.removeEventListener("scroll",t),e.disconnect(),a.reset()})),n(this,"scroll",(function(e,t){var r={scroll_directions:e,scroll_multiplier:t};a.PubSub.publish("Area:scroll:pre",r),function(e,t,r){if(t.length){var n=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,i=e instanceof HTMLDocument?n||document.body:e,o=t.includes("top")&&i.scrollTop>0,s=t.includes("bottom")&&i.scrollTop<i.scrollHeight,a=t.includes("left")&&i.scrollLeft>0,l=t.includes("right")&&i.scrollLeft<i.scrollWidth;o&&(i.scrollTop-=1*r),s&&(i.scrollTop+=1*r),a&&(i.scrollLeft-=1*r),l&&(i.scrollLeft+=1*r)}}(a._node,e,t),a.PubSub.publish("Area:scroll",r)})),this._zoom=u,this.PubSub=c,this.setArea(l),this._modificationCallback=(i=function(e){a.PubSub.publish("Area:modified:pre",{event:e,item:a}),a.reset(),a.PubSub.publish("Area:modified",{event:e,item:a})},o=60,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=function(){s=null,i.apply(void 0,t)};clearTimeout(s),s=setTimeout(n,o)}),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return r(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 HTMLDocument?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(e,t){if(e instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=e.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(e.clientWidth||r.width)*t,height:(e.clientHeight||r.height)*t}}(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;return this._parentNodes=function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=null===(r=t[n])||void 0===r?void 0:r.parentNode;return i?(t.push(i),e(t,++n)):t}([this.HTMLNode]),this._parentNodes}}]),t}(),M=function(){function t(r){var i=this,o=r.DS,s=r.dragKeys,a=r.draggability,l=r.keyboardDrag,c=r.keyboardDragSpeed,u=r.useTransform,d=r.zoom;e(this,t),n(this,"_useTransform",void 0),n(this,"_prevCursorPos",void 0),n(this,"_prevScrollPos",void 0),n(this,"_elements",[]),n(this,"_draggability",void 0),n(this,"_dragKeys",void 0),n(this,"_dragKeysFlat",void 0),n(this,"_keyboardDrag",void 0),n(this,"_keyboardDragSpeed",void 0),n(this,"_zoom",void 0),n(this,"keyboardDrag",(function(e){var t=e.event,r=e.key;if(i._keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i._draggability&&!i.DS.continue){var n={event:t,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],n),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var o=function(e){var t=e.shiftKey,r=e.keyboardDragSpeed,n=e.zoom,i=e.key,o=e.dragKeys,s=e.scrollDiff,a=e.canScroll,l=e.scrollCallback,c={x:0,y:0},u=t?4*r*n:r*n;return o.left.includes(i)&&(c.x=s.x||-u,t||s.x||!a||l(["left"],r)),o.right.includes(i)&&(c.x=s.x||u,t||s.x||!a||l(["right"],r)),o.up.includes(i)&&(c.y=s.y||-u,t||s.y||!a||l(["top"],r)),o.down.includes(i)&&(c.y=s.y||u,t||s.y||!a||l(["bottom"],r)),c}({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i._keyboardDragSpeed,zoom:i._zoom,key:r,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach((function(e){return A({element:e,posDirection:o,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})})),i.DS.publish(["Interaction:update:pre","Interaction:update"],n)}})),n(this,"keyboardEnd",(function(e){var t=e.event,r=e.key;if(i._keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i._draggability){var n={event:t,isDragging:i._draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],n)}})),n(this,"start",(function(e){var t=e.isDragging,r=e.isDraggingKeyboard;t&&!r&&(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))})),n(this,"stop",(function(e){null!=e&&e.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])})),n(this,"update",(function(e){var t=e.isDragging,r=e.isDraggingKeyboard;if(t&&i._elements.length&&!r&&!i.DS.continue){var n=b(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach((function(e){return A({element:e,posDirection:n,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})}))}})),n(this,"handleZIndex",(function(e){i._elements.forEach((function(t){return t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)+e?9999:-9998)}))})),this.DS=o,this._useTransform=u,this._keyboardDragSpeed=c,this._keyboardDrag=l,this._zoom=d,this._draggability=a,this._dragKeys={up:s.up.map((function(e){return e.toLowerCase()})),down:s.down.map((function(e){return e.toLowerCase()})),left:s.left.map((function(e){return e.toLowerCase()})),right:s.right.map((function(e){return e.toLowerCase()}))},this._dragKeysFlat=[].concat(p(this._dragKeys.up),p(this._dragKeys.down),p(this._dragKeys.left),p(this._dragKeys.right)),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 r(t,[{key:"_cursorDiff",get:function(){var e=this.DS.stores.PointerStore.currentVal,t=this._prevCursorPos?b(e,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=e,t}},{key:"_scrollDiff",get:function(){var e=this.DS.stores.ScrollStore.currentVal,t=this._prevScrollPos?b(e,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=e,t}}]),t}(),K=function(){function t(r){var i=this,o=r.DS,s=r.areaElement,a=r.draggability,l=r.immediateDrag,c=r.selectableClass;e(this,t),n(this,"_areaElement",void 0),n(this,"_draggability",void 0),n(this,"_immediateDrag",void 0),n(this,"_selectableClass",void 0),n(this,"isInteracting",void 0),n(this,"isDragging",void 0),n(this,"init",(function(){return i.DS.publish("Interaction:init:pre",{})})),n(this,"_init",(function(){i.stop(),i._areaElement.addEventListener("mousedown",i.start),i._areaElement.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})})),n(this,"start",(function(e){return i.DS.publish("Interaction:start:pre",{event:e,isDragging:i.isDragging})})),n(this,"_start",(function(e){"touchstart"===e.type&&e.preventDefault(),i._canInteract(e)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(e),i.DS.publish("Interaction:start",{event:e,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))})),n(this,"isDragEvent",(function(e){var t=e.target.closest(".".concat(i._selectableClass));return!(!i._draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(e)||!t)&&(i._immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(t)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(t)):i.DS.SelectedSet.add(t)),!!i.DS.SelectedSet.has(t))})),n(this,"onClick",(function(e){var t=e.event;if(i._canInteract(t)&&!(t.detail>0)){var r=i.DS,n=r.stores,o=n.PointerStore,s=n.KeyStore,a=r.SelectableSet,l=r.SelectedSet;o.start(t);var c=t.target;a.has(c)&&(s.isMultiSelectKeyPressed(t)||l.clear(),l.toggle(c),i.reset())}})),n(this,"stop",(function(){i.isInteracting=!1,i.isDragging=!1,i._areaElement.removeEventListener("mousedown",i.start),i._areaElement.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)})),n(this,"update",(function(e){var t=e.event,r=e.scroll_directions,n=e.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:t,scroll_directions:r,scroll_multiplier:n,isDragging:i.isDragging})})),n(this,"reset",(function(e){return i.DS.publish("Interaction:end:pre",{event:e,isDragging:i.isDragging})})),n(this,"_reset",(function(e){var t=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:e,isDragging:t})})),this._areaElement=s,this._draggability=a,this._immediateDrag=l,this._selectableClass=c,this.DS=o,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",(function(e){var t=e.event;return i.start(t)})),this.DS.subscribe("Interaction:start:pre",(function(e){var t=e.event;return i._start(t)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(e){var t=e.event;return i._reset(t)})),this.DS.subscribe("Area:scroll",this.update)}return r(t,[{key:"_canInteract",value:function(e){var t=0===e.clientX&&0===e.clientY&&0===e.detail&&e.target;return!(2===e.button||this.isInteracting||e.target&&!this.DS.SelectorArea.isInside(e.target)||!t&&!this.DS.SelectorArea.isClicked(e))}}]),t}(),O=function t(r){var i=this,o=r.DS;e(this,t),n(this,"subscribers",{}),n(this,"subscribe",(function(e,t){return Array.isArray(i.subscribers[e])||(i.subscribers[e]=[]),i.subscribers[e].push(t),i.subscribers[e].length-1})),n(this,"unsubscribe",(function(e,t,r){r>=0?i.subscribers[e].splice(r,1):t&&(i.subscribers[e]=i.subscribers[e].filter((function(e){return e!==t})))})),n(this,"publish",(function(e,t){Array.isArray(e)?e.forEach((function(e){return i._publish(e,t)})):i._publish(e,t)})),n(this,"_publish",(function(e,t){var r=i.subscribers[e];Array.isArray(r)&&(e.includes(":pre")?i._handlePrePublish(r,t):i._handlePublish(r,t))})),n(this,"_handlePublish",(function(e,t){for(var r=0,n=e.length;r<n;r++){if(i.DS.stopped)return;e[r](t)}})),n(this,"_handlePrePublish",(function(e,t){for(var r=e.length;r--;){if(i.DS.stopped)return;e[r](t)}})),this.DS=o},j=function(t){o(a,u(Set));var i=f(a);function a(t){var r,o=t.elements,s=t.className,l=t.hoverClassName,c=t.draggability,u=t.useTransform,h=t.DS;return e(this,a),n(d(r=i.call(this)),"_initElements",void 0),n(d(r),"_className",void 0),n(d(r),"_hoverClassName",void 0),n(d(r),"_useTransform",void 0),n(d(r),"_draggability",void 0),n(d(r),"init",(function(){return r._initElements.forEach((function(e){return r.add(e)}))})),n(d(r),"clear",(function(){return r.forEach((function(e){return r.delete(e)}))})),n(d(r),"_onClick",(function(e){return r.DS.publish(["Selectable:click:pre","Selectable:click"],{event:e})})),n(d(r),"_onPointer",(function(e){return r.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:e})})),n(d(r),"addAll",(function(e){return e.forEach((function(e){return r.add(e)}))})),n(d(r),"deleteAll",(function(e){return e.forEach((function(e){return r.delete(e)}))})),r.DS=h,r._initElements=T(o),r._className=s,r._hoverClassName=l,r._useTransform=u,r._draggability=c,r.DS.subscribe("Interaction:init",r.init),r}return r(a,[{key:"add",value:function(e){return e.classList.add(this._className),e.addEventListener("click",this._onClick),e.addEventListener("mousedown",this._onPointer),e.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&x({computedStyle:window.getComputedStyle(e),node:e}),v(s(a.prototype),"add",this).call(this,e)}},{key:"delete",value:function(e){return e.classList.remove(this._className),e.classList.remove(this._hoverClassName),e.removeEventListener("click",this._onClick),e.removeEventListener("mousedown",this._onPointer),e.removeEventListener("touchstart",this._onPointer,{passive:!1}),v(s(a.prototype),"delete",this).call(this,e)}},{key:"elements",get:function(){return Array.from(this.values())}}]),a}(),z=function(t){o(a,u(Set));var i=f(a);function a(t){var r,o=t.className,s=t.DS;return e(this,a),n(d(r=i.call(this)),"_className",void 0),n(d(r),"clear",(function(){return r.forEach((function(e){return r.delete(e)}))})),n(d(r),"addAll",(function(e){return e.forEach((function(e){return r.add(e)}))})),n(d(r),"deleteAll",(function(e){return e.forEach((function(e){return r.delete(e)}))})),r.DS=s,r._className=o,r}return r(a,[{key:"add",value:function(e){if(!v(s(a.prototype),"has",this).call(this,e)){var t={items:this.elements,item:e};return this.DS.publish("Selected:added:pre",t),v(s(a.prototype),"add",this).call(this,e),e.classList.add(this._className),e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)+1),this.DS.publish("Selected:added",t),this}}},{key:"delete",value:function(e){if(v(s(a.prototype),"has",this).call(this,e)){var t={items:this.elements,item:e};this.DS.publish("Selected:removed:pre",t);var r=v(s(a.prototype),"delete",this).call(this,e);return e.classList.remove(this._className),e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)-1),this.DS.publish("Selected:removed",t),r}}},{key:"toggle",value:function(e){return this.has(e)?this.delete(e):this.add(e),e}},{key:"elements",get:function(){return Array.from(this.values())}}]),a}(),H=function(){function t(r){var i=this,o=r.DS,s=r.hoverClassName,a=r.multiSelectToggling;e(this,t),n(this,"_prevSelectedSet",void 0),n(this,"_hoverClassName",void 0),n(this,"_multiSelectToggling",void 0),n(this,"start",(function(e){var t=e.event;e.isDragging||(i._storePrevious(t),i._handleInsideSelection(!0,t))})),n(this,"update",(function(e){e.isDragging||i.DS.continue||i._handleInsideSelection()})),n(this,"_handleInsideSelection",(function(e,t){for(var r=i.DS,n=r.SelectableSet,o=r.SelectorArea,s=r.Selector,a=n.elements.map((function(e){return[e,e.getBoundingClientRect()]})),l=[],c=[],u=0,d=a.length;u<d;u++)o.isInside(a[u][0],a[u][1])&&(I(a[u][1],s.rect)?l.push(a[u][0]):c.push(a[u][0]));var h=i.DS.stores.KeyStore.isMultiSelectKeyPressed(t)&&i._multiSelectToggling;i.DS.continue||(l.forEach((function(t){return function(e){var t=e.element,r=e.force,n=e.multiSelectionToggle,i=e.SelectedSet,o=e.hoverClassName;t.classList.contains(o)&&!r||(i.has(t)?n&&i.delete(t):i.add(t),t.classList.add(o))}({element:t,force:e,multiSelectionToggle:h,SelectedSet:i.DS.SelectedSet,hoverClassName:i._hoverClassName})})),c.forEach((function(t){return function(e){var t=e.element,r=e.force,n=e.SelectedSet,i=e.PrevSelectedSet,o=e.hoverClassName;if(!t.classList.contains(o)&&!r)return!1;var s=n.has(t),a=i.has(t);s&&!a?n.delete(t):!s&&a&&n.add(t),t.classList.remove(o)}({element:t,force:e,SelectedSet:i.DS.SelectedSet,hoverClassName:i._hoverClassName,PrevSelectedSet:i._prevSelectedSet})})))})),this._hoverClassName=s,this._multiSelectToggling=a,this.DS=o,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return r(t,[{key:"_storePrevious",value:function(e){var t=this.DS,r=t.stores.KeyStore,n=t.SelectedSet;r.isMultiSelectKeyPressed(e)?this._prevSelectedSet=new Set(n):this._prevSelectedSet=new Set}}]),t}(),R=function(){function t(r){var i=this,o=r.DS,s=r.selector,a=r.selectorClass,l=r.customStyles;e(this,t),n(this,"_rect",void 0),n(this,"start",(function(e){if(!e.isDragging){var t=i.DS.stores.PointerStore.initialValArea;V(i.HTMLNode,_(t,1)),i.HTMLNode.style.display="block",i._rect=null}})),n(this,"stop",(function(){i.HTMLNode.style.width="0",i.HTMLNode.style.height="0",i.HTMLNode.style.display="none"})),n(this,"update",(function(e){if(!e.isDragging&&!i.DS.continue){var t=i.DS.stores,r=t.ScrollStore,n=t.PointerStore,o=function(e){var t=e.scrollAmount,r=e.initialPointerPos,n=e.pointerPos,i={};return n.x>r.x-t.x?(i.left=r.x-t.x,i.width=n.x-r.x+t.x):(i.left=n.x,i.width=r.x-n.x-t.x),n.y>r.y-t.y?(i.top=r.y-t.y,i.height=n.y-r.y+t.y):(i.top=n.y,i.height=r.y-n.y-t.y),i}({scrollAmount:r.scrollAmount,initialPointerPos:n.initialValArea,pointerPos:n.currentValArea});V(i.HTMLNode,o),i._rect=null}})),this.DS=o,this.HTMLNode=s||function(e){var t=document.createElement("div");return t.style.position="absolute",e||(t.style.background="rgba(0, 0, 255, 0.1)",t.style.border="1px solid rgba(0, 0, 255, 0.45)",t.style.display="none",t.style.pointerEvents="none"),t}(l),this.HTMLNode.classList.add(a),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return r(t,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),B=function(){function t(r){var i=this,o=r.DS,s=r.selectorAreaClass,a=r.autoScrollSpeed,l=r.overflowTolerance;e(this,t),n(this,"_autoScrollSpeed",void 0),n(this,"_scrollInterval",void 0),n(this,"_rect",void 0),n(this,"currentEdges",[]),n(this,"_overflowTolerance",void 0),n(this,"start",(function(){return i.applyElements("append")})),n(this,"applyElements",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",t=document.body?"body":"documentElement",r="".concat(e,"Child");i.HTMLNode[r](i.DS.Selector.HTMLNode),document[t][r](i.HTMLNode)})),n(this,"updatePos",(function(){i._rect=null;var e=i.DS.Area.rect,t=i.DS.Area.computedBorder,r=i.HTMLNode.style,n="".concat(e.top+t.top,"px"),o="".concat(e.left+t.left,"px"),s="".concat(e.width,"px"),a="".concat(e.height,"px");r.top!==n&&(r.top=n),r.left!==o&&(r.left=o),r.width!==s&&(r.width=s),r.height!==a&&(r.height=a)})),n(this,"stop",(function(e){i.stopAutoScroll(),e&&i.applyElements("remove")})),n(this,"startAutoScroll",(function(){i.currentEdges=[],i._scrollInterval=setInterval((function(){return i.handleAutoScroll()}),16)})),n(this,"handleAutoScroll",(function(){if(!i.DS.continue){var e=i.DS,t=e.stores.PointerStore,r=e.Area;i.currentEdges=w({elementRect:_(t.currentVal),containerRect:i.rect,tolerance:i._overflowTolerance}),i.currentEdges.length&&r.scroll(i.currentEdges,i._autoScrollSpeed)}})),n(this,"stopAutoScroll",(function(){i.currentEdges=[],clearInterval(i._scrollInterval)})),n(this,"isInside",(function(e,t){return!(!i.DS.Area.HTMLNode.contains(e)||!i.DS.stores.ScrollStore.canScroll)||I(i.rect,t||e.getBoundingClientRect())})),this._autoScrollSpeed=a,this._overflowTolerance=l,this.DS=o,this.HTMLNode=function(e){var t=document.createElement("div");return t.style.position="fixed",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex="999999999999999999",t.classList.add(e),t}(s),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(){i.updatePos(),i.stopAutoScroll()}))}return r(t,[{key:"isClicked",value:function(e){var t=this.DS.stores.PointerStore,r=e?t.getPointerPosition(e):t.initialVal;return I({left:r.x,top:r.y,right:r.x,bottom:r.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),U=function(){function t(r){var i=this,o=r.DS,s=r.multiSelectKeys,a=r.multiSelectMode;e(this,t),n(this,"_multiSelectMode",void 0),n(this,"_multiSelectKeys",void 0),n(this,"_currentValues",new Set),n(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),n(this,"init",(function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)})),n(this,"keydown",(function(e){var t=e.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:e,key:t}),i._currentValues.add(t),i.DS.publish("KeyStore:down",{event:e,key:t})})),n(this,"keyup",(function(e){var t=e.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:e,key:t}),i._currentValues.delete(t),i.DS.publish("KeyStore:up",{event:e,key:t})})),n(this,"stop",(function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()})),n(this,"reset",(function(){return i._currentValues.clear()})),this.DS=o,this._multiSelectMode=a,this._multiSelectKeys=s.map((function(e){var t={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"}[e];return t?(console.warn("[DragSelect] ".concat(e,' is deprecated. Use "').concat(t,'" instead. Act Now!. See docs for more info')),t.toLowerCase()):e.toLowerCase()})),this.DS.subscribe("Interaction:init",this.init)}return r(t,[{key:"isMultiSelectKeyPressed",value:function(e){var t=this;return!!this._multiSelectMode||(!!this.currentValues.some((function(e){return t._multiSelectKeys.includes(e)}))||!(!e||!this._multiSelectKeys.some((function(r){return e[t._keyMapping[r]]}))))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),t}(),W=function(){function t(r){var i=this,o=r.DS;e(this,t),n(this,"_isMouseInteraction",!1),n(this,"_initialValArea",void 0),n(this,"_currentValArea",void 0),n(this,"_lastValArea",void 0),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_lastVal",void 0),n(this,"_lastTouch",void 0),n(this,"init",(function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})})),n(this,"getPointerPosition",(function(e){return function(e){var t=e.event;return{x:t.clientX,y:t.clientY}}({event:i._normalizedEvent(e)})})),n(this,"update",(function(e){e&&(i.DS.publish("PointerStore:updated:pre",{event:e}),i.currentVal=i.getPointerPosition(e),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:e}))})),n(this,"stop",(function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout((function(){return i._isMouseInteraction=!1}),100)})),n(this,"reset",(function(e){e&&(i.currentVal=i.lastVal=i.getPointerPosition(e),i.stop(),i.init())})),this.DS=o,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(e){var t=e.event;return i.start(t)})),this.DS.subscribe("Interaction:end",(function(e){var t=e.event;return i.reset(t)}))}return r(t,[{key:"start",value:function(e){e&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(e))}},{key:"_normalizedEvent",value:function(e){return"touches"in e&&"touchend"!==e.type&&(this._lastTouch=e),"touches"in e?this._lastTouch.touches[0]:e}},{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(e){this._initialVal=e,this._initialValArea=e&&b(e,"-",b(y(this.DS.Area.rect),"+",y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(e){this._currentVal=e,this._currentValArea=e&&b(e,"-",b(y(this.DS.Area.rect),"+",y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(e){this._lastVal=e,this._lastValArea=e&&b(e,"-",b(y(this.DS.Area.rect),"+",y(this.DS.Area.computedBorder)))}}]),t}(),F=function(){function t(r){var i=this,o=r.DS,s=r.areaElement,a=r.zoom;e(this,t),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_areaElement",void 0),n(this,"_canScroll",void 0),n(this,"init",(function(){return i._areaElement.addEventListener("scroll",i.update)})),n(this,"start",(function(){i._currentVal=i._initialVal=P(i._areaElement),i._areaElement.addEventListener("scroll",i.update)})),n(this,"update",(function(){return i._currentVal=P(i._areaElement)})),n(this,"stop",(function(){i._areaElement.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null})),n(this,"reset",(function(){i.stop(),i.start()})),this._areaElement=s,this.DS=o,this.zoom=a,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return i.start()})),this.DS.subscribe("Interaction:end",(function(){return i.reset()}))}return r(t,[{key:"canScroll",get:function(){return"boolean"==typeof this._canScroll?this._canScroll:this._canScroll=(e=this._areaElement,!!((t=P(e)).x||t.y||(e instanceof HTMLDocument?e.body?e.body.scrollTop=1:e.documentElement.scrollTop=1:e.scrollTop=1)));var e,t}},{key:"scrollAmount",get:function(){var e,t=b(this.currentVal,"-",this.initialVal),r={x:e=this.zoom,y:e},n=b(b(t,"*",r),"-",t);return{x:t.x+n.x,y:t.y+n.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=P(this._areaElement)),this._currentVal}}]),t}(),Z=function(){function t(r){var i=this,o=r.area,s=void 0===o?document:o,a=r.selectables,l=void 0===a?[]:a,c=r.autoScrollSpeed,u=void 0===c?5:c,d=r.overflowTolerance,h=void 0===d?{x:25,y:25}:d,f=r.zoom,v=void 0===f?1:f,S=r.customStyles,p=void 0!==S&&S,m=r.multiSelectMode,g=void 0!==m&&m,b=r.multiSelectToggling,y=void 0===b||b,_=r.multiSelectKeys,D=void 0===_?["Control","Shift","Meta"]:_,P=r.selector,w=void 0===P?void 0:P,k=r.draggability,E=void 0===k||k,x=r.immediateDrag,I=void 0===x||x,A=r.keyboardDrag,C=void 0===A||A,T=r.dragKeys,V=r.keyboardDragSpeed,Z=void 0===V?10:V,X=r.useTransform,Y=void 0===X||X,G=r.hoverClass,$=void 0===G?"ds-hover":G,q=r.selectableClass,J=void 0===q?"ds-selectable":q,Q=r.selectedClass,ee=void 0===Q?"ds-selected":Q,te=r.selectorClass,re=void 0===te?"ds-selector":te,ne=r.selectorAreaClass,ie=void 0===ne?"ds-selector-area":ne,oe=r.callback,se=r.onDragMove,ae=r.onDragStartBegin,le=r.onDragStart,ce=r.onElementSelect,ue=r.onElementUnselect;e(this,t),n(this,"continue",!1),n(this,"start",(function(){i.stopped=!1,i.Interaction.init()})),n(this,"break",(function(){return i.continue=!0})),n(this,"getSelection",(function(){return i.SelectedSet.elements})),n(this,"getSelectables",(function(){return i.SelectableSet.elements})),n(this,"getInitialCursorPosition",(function(){return i.stores.PointerStore.initialVal})),n(this,"getCurrentCursorPosition",(function(){return i.stores.PointerStore.currentVal})),n(this,"getPreviousCursorPosition",(function(){return i.stores.PointerStore.lastVal})),n(this,"getInitialCursorPositionArea",(function(){return i.stores.PointerStore.initialValArea})),n(this,"getCurrentCursorPositionArea",(function(){return i.stores.PointerStore.currentValArea})),n(this,"getPreviousCursorPositionArea",(function(){return i.stores.PointerStore.lastValArea})),n(this,"isMultiSelect",(function(e){return i.stores.KeyStore.isMultiSelectKeyPressed(e)})),n(this,"isDragging",(function(){return i.Interaction.isDragging})),this.PubSub=new O({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:oe,onDragMove:se,onDragStart:le,onDragStartBegin:ae,onElementSelect:ce,onElementUnselect:ue}),this.stores={PointerStore:new W({DS:this}),ScrollStore:new F({DS:this,areaElement:s,zoom:v}),KeyStore:new U({DS:this,multiSelectKeys:D,multiSelectMode:g})},this.Area=new N({area:s,PS:this.PubSub,zoom:v}),this.Selector=new R({DS:this,selector:w,selectorClass:re,customStyles:p}),this.SelectorArea=new B({DS:this,selectorAreaClass:ie,autoScrollSpeed:u,overflowTolerance:h}),this.SelectableSet=new j({elements:l,DS:this,className:J,hoverClassName:$,useTransform:Y,draggability:E}),this.SelectedSet=new z({DS:this,className:ee}),this.Selection=new H({DS:this,hoverClassName:$,multiSelectToggling:y}),this.Drag=new M({DS:this,draggability:E,useTransform:Y,keyboardDrag:C,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},T),zoom:v,keyboardDragSpeed:Z}),this.Interaction=new K({areaElement:s,DS:this,draggability:E,immediateDrag:I,selectableClass:J}),L({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",(function(){return i.continue=!1})),this.start()}return r(t,[{key:"_callbacksTemp",value:function(e){var t=e.callback,r=e.onDragMove,n=e.onDragStart,i=e.onDragStartBegin,o=e.onElementSelect,s=e.onElementUnselect,a=function(e,t){return console.warn("[DragSelect] ".concat(e,' is deprecated. Use DragSelect.subscribe("').concat(t,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};t&&(a("callback","callback"),this.subscribe("callback",(function(e){var r=e.items,n=(e.item,e.event);return t(r,n)}))),r&&(a("onDragMove","dragmove"),this.subscribe("dragmove",(function(e){e.items,e.item;var t=e.event;return r(t)}))),n&&(a("onDragStart","dragstart"),this.subscribe("dragstart",(function(e){e.items,e.item;var t=e.event;return n(t)}))),i&&(a("onDragStartBegin","dragstart"),this.subscribe("dragstart",(function(e){e.items,e.item;var t=e.event;return i(t)}))),o&&(a("onElementSelect","elementselect"),this.subscribe("elementselect",(function(e){e.items;var t=e.item,r=e.event;return o(t,r)}))),s&&(a("onElementUnselect","elementunselect"),this.subscribe("elementunselect",(function(e){e.items;var t=e.item,r=e.event;return s(t,r)})))}},{key:"stop",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(e),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),e&&this.SelectableSet.clear(),t&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(T(e)),r||this.addSelectables(e),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(T(e)),r&&this.removeSelectables(e),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return T(e).forEach((function(i){return t.SelectedSet.has(i)?t.removeSelection(e,r,n):t.addSelection(e,r,n)})),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(e,t,r),this.getSelection()}},{key:"clearSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.SelectedSet.clear(),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=T(e);return this.SelectableSet.addAll(r),t&&this.SelectedSet.addAll(r),e}},{key:"setSelectables",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.removeSelectables(e,t),this.addSelectables(e,r)}},{key:"removeSelectables",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.SelectableSet.deleteAll(T(e)),t&&this.removeSelection(e),e}},{key:"getCursorPositionDifference",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var r=t?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),n=e?t?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():t?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return b(r,"-",n)}}]),t}();export default Z;
function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return 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}}),e&&c(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,r){return u=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&c(i,r.prototype),i},u.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;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,n)}function n(){return u(t,arguments,a(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,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){return!e||"object"!=typeof e&&"function"!=typeof e?h(t):e}function f(t){var e=l();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S(this,r)}}function p(t,e,r){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}},p(t,e,r||t)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,i=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw s}}return r}(t,e)||b(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 v(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||b(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 b(t,e){if(t){if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var m=function(t,e,r){var n=t.x,i=t.y,s=r.x,o=r.y;return{"+":{x:n+s,y:i+o},"-":{x:n-s,y:i-o},"*":{x:n*s,y:i*o},"/":{x:n/s,y:i/o}}[e]},D=function(t){return{x:t.left,y:t.top}},_=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}},w=function(){var t,e,r,n;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===(r=document.body)||void 0===r?void 0:r.scrollLeft)||(null===(n=document.documentElement)||void 0===n?void 0:n.scrollLeft)||0}},A=function(t){return!t||t instanceof Document?w():{x:t.scrollLeft>=0?t.scrollLeft:w().x,y:t.scrollTop>=0?t.scrollTop:w().y}},P=function(t){var e=t.elementRect,r=t.containerRect,n=t.tolerance,i=void 0===n?{x:0,y:0}:n,s=[];return e.top-i.y<r.top&&s.push("top"),e.left-i.x<r.left&&s.push("left"),e.bottom+i.y>r.bottom&&s.push("bottom"),e.right+i.y>r.right&&s.push("right"),s},L=function(t){var e={x:0,y:0},r=window.getComputedStyle(t);if(!r.transform||"none"===r.transform)return e;if(r.transform.indexOf("3d")>=0){var n=r.transform.trim().match(/matrix3d\((.*?)\)/);if(n&&n.length){var i,s=null===(i=n[1])||void 0===i?void 0:i.split(",");e.x=parseInt(s[12])||0,e.y=parseInt(s[13])||0}return e}var o=r.transform.trim().match(/matrix\((.*?)\)/);if(o&&o.length){var a,c=null===(a=o[1])||void 0===a?void 0:a.split(",");e.x=parseInt(c[4])||0,e.y=parseInt(c[5])||0}return e},x=function(t,e){return e?function(t){var e=t.style.transform;if(!e||e.indexOf("translate")<0)return L(t);var r={x:0,y:0},n=e.trim().match(/translate[3dD]*?\(.*?\)/);if(n){var i,s=null===(i=n[0])||void 0===i?void 0:i.split("(");if(s){var o,a=null===(o=s[1])||void 0===o?void 0:o.split(",");r.x=parseInt(a[0])||0,r.y=parseInt(a[1])||0}}return r.x||r.x?r:L(t)}(t):function(t){var e=t.style,r={x:parseInt(e.left)||0,y:parseInt(e.top)||0};if(!r.x&&!r.x){var n=window.getComputedStyle(t);return{x:parseInt(n.left)||0,y:parseInt(n.top)||0}}return r}(t)},k=function(t){var e=t.computedStyle,r=t.node,n=e.position;r instanceof HTMLDocument||("absolute"===n||"relative"===n||"fixed"===n)||(r.style.position="relative")},I=function(t,e,r){return console.warn('[DragSelect] TypeIssue: setting "'.concat(t,'" is not of type "').concat(e,'".'))},T=function(t,e,r,i){if(void 0===e)return r?n({},t,i):{};if(null===e)return n({},t,null);var s=!0,o=!1,a="string"==typeof i;a&&(s="string"==typeof e||e instanceof String),a&&!s&&(o=!0,I(t,"string"));var c=!isNaN(i)&&"number"==typeof i;c&&(s=!isNaN(e)&&"number"==typeof e),c&&!s&&(o=!0,I(t,"number"));var l="[object Object]"===Object.prototype.toString.call(i);l&&(s="[object Object]"===Object.prototype.toString.call(e)),l&&!s&&(o=!0,I(t,"object"));var u="boolean"==typeof i;u&&(s="boolean"==typeof e),u&&!s&&(o=!0,I(t,"boolean"));var d=Array.isArray(i);d&&(s=Array.isArray(e)),d&&!s&&(o=!0,I(t,"array"));var h=o||r;return"dragKeys"===t&&s?n({},t,Object.assign(i,e)):("dragKeys"!==t||s)&&s?n({},t,e):h?n({},t,i):{}},C=function(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top},E=function(t){var e=t.element,r=t.posDirection,n=t.containerRect,i=t.useTransform,s=x(e,i),o=m(s,"+",r);V(e,o,i);var a=e.getBoundingClientRect();!function(t){var e=t.element,r=t.edges,n=t.elementRect,i=t.containerRect,s=t.elementPos,o=t.useTransform;r.includes("top")&&V(e,{y:s.y+i.top-n.top,x:s.x},o),r.includes("left")&&V(e,{y:s.y,x:s.x+i.left-n.left},o),r.includes("bottom")&&V(e,{y:s.y+i.bottom-n.bottom,x:s.x},o),r.includes("right")&&V(e,{y:s.y,x:s.x+i.right-n.right},o)}({element:e,edges:P({elementRect:a,containerRect:n}),elementRect:a,containerRect:n,elementPos:o,useTransform:i})},V=function(t,e,r){if(r){var n=t.style.transform;t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,1px) ").concat(n.replace(/translate.*?\)/g,""))}else t.style.left="".concat(e.x,"px"),t.style.top="".concat(e.y,"px");return t},M=function(t){return t?!Array.isArray(t)&&(t instanceof HTMLElement||t instanceof SVGElement)?[t]:v(t):[]},N=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")},K=function(){function e(r){var i,s,o,a=this,c=r.DS;t(this,e),n(this,"DS",void 0),n(this,"_modificationCallback",void 0),n(this,"_modificationObserver",void 0),n(this,"_zoom",void 0),n(this,"_node",void 0),n(this,"_parentNodes",void 0),n(this,"_computedStyle",void 0),n(this,"_computedBorder",void 0),n(this,"_rect",void 0),n(this,"setArea",(function(t){a._node=t,k({computedStyle:a.computedStyle,node:a._node}),setTimeout((function(){a.DS.PubSub.publish("Area:modified:pre",{item:a}),a.reset(),a.DS.PubSub.publish("Area:modified",{item:a})}))})),n(this,"start",(function(){var t,e,r;t=a.parentNodes,e=a._modificationCallback,r=a._modificationObserver,window.addEventListener("resize",e),window.addEventListener("scroll",e),t.forEach((function(t,e){r.observe(t,{childList:0!==e,attributes:!0})}))})),n(this,"reset",(function(){a._computedStyle=void 0,a._rect=void 0,a._computedBorder=void 0,a._parentNodes=void 0})),n(this,"stop",(function(){var t,e;t=a._modificationObserver,e=a._modificationCallback,window.removeEventListener("resize",e),window.removeEventListener("scroll",e),t.disconnect(),a.reset()})),n(this,"scroll",(function(t,e){var r={scroll_directions:t,scroll_multiplier:e};a.DS.PubSub.publish("Area:scroll:pre",r),function(t,e,r){if(e.length){var n=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,i=t instanceof HTMLDocument?n||document.body:t,s=e.includes("top")&&i.scrollTop>0,o=e.includes("bottom")&&i.scrollTop<i.scrollHeight,a=e.includes("left")&&i.scrollLeft>0,c=e.includes("right")&&i.scrollLeft<i.scrollWidth;s&&(i.scrollTop-=1*r),o&&(i.scrollTop+=1*r),a&&(i.scrollLeft-=1*r),c&&(i.scrollLeft+=1*r)}}(a._node,t,e),a.DS.PubSub.publish("Area:scroll",r)})),this.DS=c,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",(function(t){var e=t.settings;return a.setArea(e.area)})),this._modificationCallback=(i=function(t){a.DS.PubSub.publish("Area:modified:pre",{event:t,item:a}),a.reset(),a.DS.PubSub.publish("Area:modified",{event:t,item:a})},s=60,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=function(){o=null,i.apply(void 0,e)};clearTimeout(o),o=setTimeout(n,s)}),this._modificationObserver=new MutationObserver(this._modificationCallback),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return r(e,[{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 HTMLDocument?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 r=t.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(t.clientWidth||r.width)*e,height:(t.clientHeight||r.height)*e}}(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;return this._parentNodes=function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=null===(r=e[n])||void 0===r?void 0:r.parentNode;return i?(e.push(i),t(e,++n)):e}([this.HTMLNode]),this._parentNodes}}]),e}(),O=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_prevCursorPos",void 0),n(this,"_prevScrollPos",void 0),n(this,"_elements",[]),n(this,"_dragKeys",void 0),n(this,"_dragKeysFlat",[]),n(this,"assignDragkeys",(function(){i._dragKeys={up:i.DS.stores.SettingsStore.s.dragKeys.up.map((function(t){return t.toLowerCase()})),down:i.DS.stores.SettingsStore.s.dragKeys.down.map((function(t){return t.toLowerCase()})),left:i.DS.stores.SettingsStore.s.dragKeys.left.map((function(t){return t.toLowerCase()})),right:i.DS.stores.SettingsStore.s.dragKeys.right.map((function(t){return t.toLowerCase()}))},i._dragKeysFlat=[].concat(v(i._dragKeys.up),v(i._dragKeys.down),v(i._dragKeys.left),v(i._dragKeys.right))})),n(this,"keyboardDrag",(function(t){var e=t.event,r=t.key.toLowerCase();if(i.DS.stores.SettingsStore.s.keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i.DS.stores.SettingsStore.s.draggability&&!i.DS.continue){var n={event:e,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],n),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var s=function(t){var e=t.shiftKey,r=t.keyboardDragSpeed,n=t.zoom,i=t.key,s=t.dragKeys,o=t.scrollDiff,a=t.canScroll,c=t.scrollCallback,l={x:0,y:0},u=e?4*r*n:r*n;return s.left.includes(i)&&(l.x=o.x||-u,e||o.x||!a||c(["left"],r)),s.right.includes(i)&&(l.x=o.x||u,e||o.x||!a||c(["right"],r)),s.up.includes(i)&&(l.y=o.y||-u,e||o.y||!a||c(["top"],r)),s.down.includes(i)&&(l.y=o.y||u,e||o.y||!a||c(["bottom"],r)),l}({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:i.DS.stores.SettingsStore.s.zoom,key:r,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach((function(t){return E({element:t,posDirection:s,containerRect:i.DS.SelectorArea.rect,useTransform:i.DS.stores.SettingsStore.s.useTransform})})),i.DS.publish(["Interaction:update:pre","Interaction:update"],n)}})),n(this,"keyboardEnd",(function(t){var e=t.event,r=t.key.toLowerCase();if(i.DS.stores.SettingsStore.s.keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i.DS.stores.SettingsStore.s.draggability){var n={event:e,isDragging:i.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],n)}})),n(this,"start",(function(t){var e=t.isDragging,r=t.isDraggingKeyboard;e&&!r&&(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))})),n(this,"stop",(function(t){null!=t&&t.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])})),n(this,"update",(function(t){var e=t.isDragging,r=t.isDraggingKeyboard;if(e&&i._elements.length&&!r&&!i.DS.continue){var n=m(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach((function(t){return E({element:t,posDirection:n,containerRect:i.DS.SelectorArea.rect,useTransform:i.DS.stores.SettingsStore.s.useTransform})}))}})),n(this,"handleZIndex",(function(t){i._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 r(e,[{key:"_cursorDiff",get:function(){var t=this.DS.stores.PointerStore.currentVal,e=this._prevCursorPos?m(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?m(t,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=t,e}}]),e}(),H=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"isInteracting",void 0),n(this,"isDragging",void 0),n(this,"init",(function(){return i.DS.publish("Interaction:init:pre",{})})),n(this,"_init",(function(){i.stop(),i.DS.Area.HTMLNode.addEventListener("mousedown",i.start),i.DS.Area.HTMLNode.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})})),n(this,"start",(function(t){return i.DS.publish("Interaction:start:pre",{event:t,isDragging:i.isDragging})})),n(this,"_start",(function(t){"touchstart"===t.type&&t.preventDefault(),i._canInteract(t)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(t),i.DS.publish("Interaction:start",{event:t,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))})),n(this,"isDragEvent",(function(t){var e=t.target.closest(".".concat(i.DS.stores.SettingsStore.s.selectableClass));return!(!i.DS.stores.SettingsStore.s.draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(t)||!e)&&(i.DS.stores.SettingsStore.s.immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(e)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(e)):i.DS.SelectedSet.add(e)),!!i.DS.SelectedSet.has(e))})),n(this,"onClick",(function(t){var e=t.event;if(i._canInteract(e)&&!(e.detail>0)){var r=i.DS,n=r.stores,s=n.PointerStore,o=n.KeyStore,a=r.SelectableSet,c=r.SelectedSet;s.start(e);var l=e.target;a.has(l)&&(o.isMultiSelectKeyPressed(e)||c.clear(),c.toggle(l),i.reset())}})),n(this,"stop",(function(){i.isInteracting=!1,i.isDragging=!1,i.DS.Area.HTMLNode.removeEventListener("mousedown",i.start),i.DS.Area.HTMLNode.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)})),n(this,"update",(function(t){var e=t.event,r=t.scroll_directions,n=t.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:e,scroll_directions:r,scroll_multiplier:n,isDragging:i.isDragging})})),n(this,"reset",(function(t){return i.DS.publish("Interaction:end:pre",{event:t,isDragging:i.isDragging})})),n(this,"_reset",(function(t){var e=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:t,isDragging:e})})),this.DS=s,this.DS.subscribe("Settings:updated:area",this.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 i.start(e)})),this.DS.subscribe("Interaction:start:pre",(function(t){var e=t.event;return i._start(e)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(t){var e=t.event;return i._reset(e)})),this.DS.subscribe("Area:scroll",this.update)}return r(e,[{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))}}]),e}(),j=function e(r){var i=this,s=r.DS;t(this,e),n(this,"subscribers",{}),n(this,"subscribe",(function(t,e){return Array.isArray(i.subscribers[t])||(i.subscribers[t]=[]),i.subscribers[t].push(e),i.subscribers[t].length-1})),n(this,"unsubscribe",(function(t,e,r){r>=0?i.subscribers[t].splice(r,1):e&&(i.subscribers[t]=i.subscribers[t].filter((function(t){return t!==e})))})),n(this,"publish",(function(t,e){Array.isArray(t)?t.forEach((function(t){return i._publish(t,e)})):i._publish(t,e)})),n(this,"_publish",(function(t,e){var r=i.subscribers[t];Array.isArray(r)&&(t.includes(":pre")?i._handlePrePublish(r,e):i._handlePublish(r,e))})),n(this,"_handlePublish",(function(t,e){for(var r=0,n=t.length;r<n;r++){if(i.DS.stopped)return;t[r](e)}})),n(this,"_handlePrePublish",(function(t,e){for(var r=t.length;r--;){if(i.DS.stopped)return;t[r](e)}})),this.DS=s},R=function(e){o(s,d(Set));var i=f(s);function s(e){var r,o=e.DS;return t(this,s),n(h(r=i.call(this)),"init",(function(){return M(r.DS.stores.SettingsStore.s.selectables).forEach((function(t){return r.add(t)}))})),n(h(r),"clear",(function(){return r.forEach((function(t){return r.delete(t)}))})),n(h(r),"_onClick",(function(t){return r.DS.publish(["Selectable:click:pre","Selectable:click"],{event:t})})),n(h(r),"_onPointer",(function(t){return r.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:t})})),n(h(r),"addAll",(function(t){return t.forEach((function(t){return r.add(t)}))})),n(h(r),"deleteAll",(function(t){return t.forEach((function(t){return r.delete(t)}))})),r.DS=o,r.DS.subscribe("Interaction:init",r.init),r.DS.PubSub.subscribe("Settings:updated:selectables",(function(){r.clear(),r.init()})),r.DS.subscribe("Settings:updated:selectableClass",(function(t){var e=t.settings;r.forEach((function(t){t.classList.remove(e["selectableClass:pre"]),t.classList.add(e.selectableClass)}))})),r}return r(s,[{key:"add",value:function(t){return t.classList.add(this.DS.stores.SettingsStore.s.selectableClass),t.addEventListener("click",this._onClick),t.addEventListener("mousedown",this._onPointer),t.addEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.stores.SettingsStore.s.draggability&&!this.DS.stores.SettingsStore.s.useTransform&&k({computedStyle:window.getComputedStyle(t),node:t}),p(a(s.prototype),"add",this).call(this,t)}},{key:"delete",value:function(t){return t.classList.remove(this.DS.stores.SettingsStore.s.selectableClass),t.classList.remove(this.DS.stores.SettingsStore.s.hoverClass),t.removeEventListener("click",this._onClick),t.removeEventListener("mousedown",this._onPointer),t.removeEventListener("touchstart",this._onPointer,{passive:!1}),p(a(s.prototype),"delete",this).call(this,t)}},{key:"elements",get:function(){return Array.from(this.values())}}]),s}(),z=function(e){o(s,d(Set));var i=f(s);function s(e){var r,o=e.DS;return t(this,s),n(h(r=i.call(this)),"clear",(function(){return r.forEach((function(t){return r.delete(t)}))})),n(h(r),"addAll",(function(t){return t.forEach((function(t){return r.add(t)}))})),n(h(r),"deleteAll",(function(t){return t.forEach((function(t){return r.delete(t)}))})),r.DS=o,r}return r(s,[{key:"add",value:function(t){if(!p(a(s.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selected:added:pre",e),p(a(s.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(p(a(s.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};this.DS.publish("Selected:removed:pre",e);var r=p(a(s.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),r}}},{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())}}]),s}(),B=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_prevSelectedSet",void 0),n(this,"start",(function(t){var e=t.event;t.isDragging||(i._storePrevious(e),i._handleInsideSelection(!0,e))})),n(this,"update",(function(t){t.isDragging||i.DS.continue||i._handleInsideSelection()})),n(this,"_handleInsideSelection",(function(t,e){for(var r=i.DS,n=r.SelectableSet,s=r.SelectorArea,o=r.Selector,a=n.elements.map((function(t){return[t,t.getBoundingClientRect()]})),c=[],l=[],u=0,d=a.length;u<d;u++)s.isInside(a[u][0],a[u][1])&&(C(a[u][1],o.rect)?c.push(a[u][0]):l.push(a[u][0]));var h=i.DS.stores.KeyStore.isMultiSelectKeyPressed(e)&&i.DS.stores.SettingsStore.s.multiSelectToggling;i.DS.continue||(c.forEach((function(e){return function(t){var e=t.element,r=t.force,n=t.multiSelectionToggle,i=t.SelectedSet,s=t.hoverClassName;e.classList.contains(s)&&!r||(i.has(e)?n&&i.delete(e):i.add(e),e.classList.add(s))}({element:e,force:t,multiSelectionToggle:h,SelectedSet:i.DS.SelectedSet,hoverClassName:i.DS.stores.SettingsStore.s.hoverClass})})),l.forEach((function(e){return function(t){var e=t.element,r=t.force,n=t.SelectedSet,i=t.PrevSelectedSet,s=t.hoverClassName;if(!e.classList.contains(s)&&!r)return!1;var o=n.has(e),a=i.has(e);o&&!a?n.delete(e):!o&&a&&n.add(e),e.classList.remove(s)}({element:e,force:t,SelectedSet:i.DS.SelectedSet,hoverClassName:i.DS.stores.SettingsStore.s.hoverClass,PrevSelectedSet:i._prevSelectedSet})})))})),this.DS=s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return r(e,[{key:"_storePrevious",value:function(t){var e=this.DS,r=e.stores.KeyStore,n=e.SelectedSet;r.isMultiSelectKeyPressed(t)?this._prevSelectedSet=new Set(n):this._prevSelectedSet=new Set}}]),e}(),W=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_rect",void 0),n(this,"attachSelector",(function(){var t,e,r,n;i.HTMLNode&&null!==(t=i.DS.SelectorArea)&&void 0!==t&&t.HTMLNode&&i.DS.SelectorArea.HTMLNode.removeChild(i.HTMLNode),i.HTMLNode=i.DS.stores.SettingsStore.s.selector||(r=i.DS.stores.SettingsStore.s.customStyles,(n=document.createElement("div")).style.position="absolute",r||(n.style.background="rgba(0, 0, 255, 0.1)",n.style.border="1px solid rgba(0, 0, 255, 0.45)",n.style.display="none",n.style.pointerEvents="none"),n),i.HTMLNode.classList.add(i.DS.stores.SettingsStore.s.selectorClass),i.HTMLNode&&null!==(e=i.DS.SelectorArea)&&void 0!==e&&e.HTMLNode&&i.DS.SelectorArea.HTMLNode.appendChild(i.HTMLNode)})),n(this,"start",(function(t){if(!t.isDragging){var e=i.DS.stores.PointerStore.initialValArea;N(i.HTMLNode,_(e,1)),i.HTMLNode.style.display="block",i._rect=null}})),n(this,"stop",(function(){i.HTMLNode.style.width="0",i.HTMLNode.style.height="0",i.HTMLNode.style.display="none"})),n(this,"update",(function(t){if(!t.isDragging&&!i.DS.continue){var e=i.DS.stores,r=e.ScrollStore,n=e.PointerStore,s=function(t){var e=t.scrollAmount,r=t.initialPointerPos,n=t.pointerPos,i={};return n.x>r.x-e.x?(i.left=r.x-e.x,i.width=n.x-r.x+e.x):(i.left=n.x,i.width=r.x-n.x-e.x),n.y>r.y-e.y?(i.top=r.y-e.y,i.height=n.y-r.y+e.y):(i.top=n.y,i.height=r.y-n.y-e.y),i}({scrollAmount:r.scrollAmount,initialPointerPos:n.initialValArea,pointerPos:n.currentValArea});N(i.HTMLNode,s),i._rect=null}})),this.DS=s,this.DS.subscribe("Settings:updated:selectorClass",(function(t){var e=t.settings;i.HTMLNode.classList.remove(e["selectorClass:pre"]),i.HTMLNode.classList.add(e.selectorClass)})),this.DS.subscribe("Settings:updated:selector",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 r(e,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),e}(),F=function(){function e(r){var i,s=this,o=r.DS;t(this,e),n(this,"_scrollInterval",void 0),n(this,"_rect",void 0),n(this,"currentEdges",[]),n(this,"start",(function(){return s.applyElements("append")})),n(this,"applyElements",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",e=document.body?"body":"documentElement",r="".concat(t,"Child");s.HTMLNode[r](s.DS.Selector.HTMLNode),document[e][r](s.HTMLNode)})),n(this,"updatePos",(function(){s._rect=null;var t=s.DS.Area.rect,e=s.DS.Area.computedBorder,r=s.HTMLNode.style,n="".concat(t.top+e.top,"px"),i="".concat(t.left+e.left,"px"),o="".concat(t.width,"px"),a="".concat(t.height,"px");r.top!==n&&(r.top=n),r.left!==i&&(r.left=i),r.width!==o&&(r.width=o),r.height!==a&&(r.height=a)})),n(this,"stop",(function(t){s.stopAutoScroll(),t&&s.applyElements("remove")})),n(this,"startAutoScroll",(function(){s.currentEdges=[],s._scrollInterval=setInterval((function(){return s.handleAutoScroll()}),16)})),n(this,"handleAutoScroll",(function(){if(!s.DS.continue){var t=s.DS,e=t.stores.PointerStore,r=t.Area;s.currentEdges=P({elementRect:_(e.currentVal),containerRect:s.rect,tolerance:s.DS.stores.SettingsStore.s.overflowTolerance}),s.currentEdges.length&&r.scroll(s.currentEdges,s.DS.stores.SettingsStore.s.autoScrollSpeed)}})),n(this,"stopAutoScroll",(function(){s.currentEdges=[],clearInterval(s._scrollInterval)})),n(this,"isInside",(function(t,e){return!(!s.DS.Area.HTMLNode.contains(t)||!s.DS.stores.ScrollStore.canScroll)||C(s.rect,e||t.getBoundingClientRect())})),this.DS=o,this.HTMLNode=((i=document.createElement("div")).style.position="fixed",i.style.overflow="hidden",i.style.pointerEvents="none",i.style.zIndex="999999999999999999",i),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 r(e,[{key:"isClicked",value:function(t){var e=this.DS.stores.PointerStore,r=t?e.getPointerPosition(t):e.initialVal;return C({left:r.x,top:r.y,right:r.x,bottom:r.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),e}(),Z=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_currentValues",new Set),n(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),n(this,"init",(function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)})),n(this,"keydown",(function(t){var e=t.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:t,key:e}),i._currentValues.add(e),i.DS.publish("KeyStore:down",{event:t,key:e})})),n(this,"keyup",(function(t){var e=t.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:t,key:e}),i._currentValues.delete(e),i.DS.publish("KeyStore:up",{event:t,key:e})})),n(this,"stop",(function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()})),n(this,"reset",(function(){return i._currentValues.clear()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init)}return r(e,[{key:"isMultiSelectKeyPressed",value:function(t){var e=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var r=this.DS.stores.SettingsStore.s.multiSelectKeys.map((function(t){return t.toLocaleLowerCase()}));return!!this.currentValues.some((function(t){return r.includes(t.toLocaleLowerCase())}))||!(!t||!r.some((function(r){return t[e._keyMapping[r]]})))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),e}(),U=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_isMouseInteraction",!1),n(this,"_initialValArea",void 0),n(this,"_currentValArea",void 0),n(this,"_lastValArea",void 0),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_lastVal",void 0),n(this,"_lastTouch",void 0),n(this,"init",(function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})})),n(this,"getPointerPosition",(function(t){return function(t){var e=t.event;return{x:e.clientX,y:e.clientY}}({event:i._normalizedEvent(t)})})),n(this,"update",(function(t){t&&(i.DS.publish("PointerStore:updated:pre",{event:t}),i.currentVal=i.getPointerPosition(t),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:t}))})),n(this,"stop",(function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout((function(){return i._isMouseInteraction=!1}),100)})),n(this,"reset",(function(t){t&&(i.currentVal=i.lastVal=i.getPointerPosition(t),i.stop(),i.init())})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(t){var e=t.event;return i.start(e)})),this.DS.subscribe("Interaction:end",(function(t){var e=t.event;return i.reset(e)}))}return r(e,[{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&&m(t,"-",m(D(this.DS.Area.rect),"+",D(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&&m(t,"-",m(D(this.DS.Area.rect),"+",D(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&&m(t,"-",m(D(this.DS.Area.rect),"+",D(this.DS.Area.computedBorder)))}}]),e}(),X=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_canScroll",void 0),n(this,"init",(function(){return i.DS.stores.SettingsStore.s.area.addEventListener("scroll",i.update)})),n(this,"start",(function(){i._currentVal=i._initialVal=A(i.DS.stores.SettingsStore.s.area),i.DS.stores.SettingsStore.s.area.addEventListener("scroll",i.update)})),n(this,"update",(function(){return i._currentVal=A(i.DS.stores.SettingsStore.s.area)})),n(this,"stop",(function(){i.DS.stores.SettingsStore.s.area.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null})),n(this,"reset",(function(){i.stop(),i.start()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return i.start()})),this.DS.subscribe("Interaction:end",(function(){return i.reset()}))}return r(e,[{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 HTMLDocument?t.body?t.body.scrollTop=1:t.documentElement.scrollTop=1:t.scrollTop=1)));var t,e}},{key:"scrollAmount",get:function(){var t,e=m(this.currentVal,"-",this.initialVal),r={x:t=this.DS.stores.SettingsStore.s.zoom,y:t},n=m(m(e,"*",r),"-",e);return{x:e.x+n.x,y:e.y+n.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}}]),e}(),Y=function e(r){var i=this,o=r.DS,a=r.settings;t(this,e),n(this,"_settings",{}),n(this,"s",{}),n(this,"update",(function(t){var e=t.settings,r=t.init;return i.DS.publish("Settings:updated:pre",s({settings:e},r?{init:r}:{}))})),n(this,"_update",(function(t){for(var e=function(t,e){return s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s({},T("area",t.area,e,document)),T("selectables",t.selectables,e,null)),T("autoScrollSpeed",t.autoScrollSpeed,e,5)),T("overflowTolerance",t.overflowTolerance,e,{x:25,y:25})),T("zoom",t.zoom,e,1)),T("customStyles",t.customStyles,e,!1)),T("multiSelectMode",t.multiSelectMode,e,!1)),T("multiSelectToggling",t.multiSelectToggling,e,!0)),T("multiSelectKeys",t.multiSelectKeys,e,["Control","Shift","Meta"])),T("selector",t.selector,e,null)),T("draggability",t.draggability,e,!0)),T("immediateDrag",t.immediateDrag,e,!0)),T("keyboardDrag",t.keyboardDrag,e,!0)),T("dragKeys",t.dragKeys,e,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),T("keyboardDragSpeed",t.keyboardDragSpeed,e,10)),T("useTransform",t.useTransform,e,!0)),T("hoverClass",t.hoverClass,e,"ds-hover")),T("selectableClass",t.selectableClass,e,"ds-selectable")),T("selectedClass",t.selectedClass,e,"ds-selected")),T("selectorClass",t.selectorClass,e,"ds-selector")),T("selectorAreaClass",t.selectorAreaClass,e,"ds-selector-area"))}(t.settings,t.init),r=function(){var t,e=g(a[o],2),r=e[0],s=e[1];r in i._settings||Object.defineProperty(i.s,r,{get:function(){return i._settings[r]},set:function(t){return i.update({settings:n({},r,t)})}}),i._settings["".concat(r,":pre")]=i._settings[r],i._settings[r]=s;var c={settings:(t={},n(t,r,i._settings[r]),n(t,"".concat(r,":pre"),i._settings["".concat(r,":pre")]),t)};i.DS.publish("Settings:updated",c),i.DS.publish("Settings:updated:".concat(r),c)},o=0,a=Object.entries(e);o<a.length;o++)r()})),this.DS=o,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})},G=function(){function e(r){var i=this;t(this,e),n(this,"continue",!1),n(this,"start",(function(){i.stopped=!1,i.Interaction.init()})),n(this,"break",(function(){return i.continue=!0})),n(this,"getSelection",(function(){return i.SelectedSet.elements})),n(this,"getSelectables",(function(){return i.SelectableSet.elements})),n(this,"getInitialCursorPosition",(function(){return i.stores.PointerStore.initialVal})),n(this,"getCurrentCursorPosition",(function(){return i.stores.PointerStore.currentVal})),n(this,"getPreviousCursorPosition",(function(){return i.stores.PointerStore.lastVal})),n(this,"getInitialCursorPositionArea",(function(){return i.stores.PointerStore.initialValArea})),n(this,"getCurrentCursorPositionArea",(function(){return i.stores.PointerStore.currentValArea})),n(this,"getPreviousCursorPositionArea",(function(){return i.stores.PointerStore.lastValArea})),n(this,"isMultiSelect",(function(t){return i.stores.KeyStore.isMultiSelectKeyPressed(t)})),n(this,"isDragging",(function(){return i.Interaction.isDragging})),n(this,"setSettings",(function(t){return i.stores.SettingsStore.update({settings:t})})),this.PubSub=new j({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new Y({DS:this,settings:r}),this.stores.PointerStore=new U({DS:this}),this.stores.ScrollStore=new X({DS:this}),this.stores.KeyStore=new Z({DS:this}),this.Area=new K({DS:this}),this.Selector=new W({DS:this}),this.SelectorArea=new F({DS:this}),this.SelectableSet=new R({DS:this}),this.SelectedSet=new z({DS:this}),this.Selection=new B({DS:this}),this.Drag=new O({DS:this}),this.Interaction=new H({DS:this}),function(t){for(var e=t.subscribe,r=t.publish,n=t.Interaction,i=t.SelectedSet,o=function(){var t=g(c[a],2),o=t[0],l=t[1];["pre",!1].forEach((function(t){return e(t?"".concat(o,":").concat(t):o,(function(e){return l.forEach((function(o){return(!o.condition||o.condition(e))&&r(t?"".concat(t).concat(o.name):o.name,s({items:i.elements,isDragging:n.isDragging},e))}))}))}))},a=0,c=Object.entries({"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"}]});a<c.length;a++)o()}({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",(function(){return i.continue=!1})),this.start()}return r(e,[{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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(M(t)),r||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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(M(t)),r&&this.removeSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return M(t).forEach((function(i){return e.SelectedSet.has(i)?e.removeSelection(t,r,n):e.addSelection(t,r,n)})),r&&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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(t,e,r),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){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=M(t);return this.SelectableSet.addAll(r),e&&this.SelectedSet.addAll(r),t}},{key:"setSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=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,r)}},{key:"removeSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.SelectableSet.deleteAll(M(t)),e&&this.removeSelection(t),t}}]),e}();export default G;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DragSelect=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,r){return(c=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&a(i,r.prototype),i}).apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?d(e):t}function f(e){var t=l();return function(){var r,n=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h(this,r)}}function v(e,t,r){return(v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||m(e,t)||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 p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(e)||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(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(e,t,r){var n=e.x,i=e.y,o=r.x,s=r.y;return{"+":{x:n+o,y:i+s},"-":{x:n-o,y:i-s},"*":{x:n*o,y:i*s},"/":{x:n/o,y:i/s}}[t]},y=function(e){return{x:e.left,y:e.top}},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{left:e.x,top:e.y,right:e.x,bottom:e.y,width:t,height:t}},D=function(){var e,t,r,n;return{y:(null===(e=document.body)||void 0===e?void 0:e.scrollTop)||(null===(t=document.documentElement)||void 0===t?void 0:t.scrollTop)||0,x:(null===(r=document.body)||void 0===r?void 0:r.scrollLeft)||(null===(n=document.documentElement)||void 0===n?void 0:n.scrollLeft)||0}},P=function(e){return!e||e instanceof Document?D():{x:e.scrollLeft>=0?e.scrollLeft:D().x,y:e.scrollTop>=0?e.scrollTop:D().y}},w=function(e){var t=e.elementRect,r=e.containerRect,n=e.tolerance,i=void 0===n?{x:0,y:0}:n,o=[];return t.top-i.y<r.top&&o.push("top"),t.left-i.x<r.left&&o.push("left"),t.bottom+i.y>r.bottom&&o.push("bottom"),t.right+i.y>r.right&&o.push("right"),o},k=function(e){var t={x:0,y:0},r=window.getComputedStyle(e);if(!r.transform||"none"===r.transform)return t;if(r.transform.indexOf("3d")>=0){var n=r.transform.trim().match(/matrix3d\((.*?)\)/);if(n&&n.length){var i,o=null===(i=n[1])||void 0===i?void 0:i.split(",");t.x=parseInt(o[12])||0,t.y=parseInt(o[13])||0}return t}var s=r.transform.trim().match(/matrix\((.*?)\)/);if(s&&s.length){var a,l=null===(a=s[1])||void 0===a?void 0:a.split(",");t.x=parseInt(l[4])||0,t.y=parseInt(l[5])||0}return t},E=function(e,t){return t?function(e){var t=e.style.transform;if(!t||t.indexOf("translate")<0)return k(e);var r={x:0,y:0},n=t.trim().match(/translate[3dD]*?\(.*?\)/);if(n){var i,o=null===(i=n[0])||void 0===i?void 0:i.split("(");if(o){var s,a=null===(s=o[1])||void 0===s?void 0:s.split(",");r.x=parseInt(a[0])||0,r.y=parseInt(a[1])||0}}return r.x||r.x?r:k(e)}(e):function(e){var t=e.style,r={x:parseInt(t.left)||0,y:parseInt(t.top)||0};if(!r.x&&!r.x){var n=window.getComputedStyle(e);return{x:parseInt(n.left)||0,y:parseInt(n.top)||0}}return r}(e)},x=function(e){var t=e.computedStyle,r=e.node,n=t.position;r instanceof HTMLDocument||("absolute"===n||"relative"===n||"fixed"===n)||(r.style.position="relative")},I=function(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top},A=function(e){var t=e.element,r=e.posDirection,n=e.containerRect,i=e.useTransform,o=E(t,i),s=b(o,"+",r);C(t,s,i);var a=t.getBoundingClientRect();!function(e){var t=e.element,r=e.edges,n=e.elementRect,i=e.containerRect,o=e.elementPos,s=e.useTransform;r.includes("top")&&C(t,{y:o.y+i.top-n.top,x:o.x},s),r.includes("left")&&C(t,{y:o.y,x:o.x+i.left-n.left},s),r.includes("bottom")&&C(t,{y:o.y+i.bottom-n.bottom,x:o.x},s),r.includes("right")&&C(t,{y:o.y,x:o.x+i.right-n.right},s)}({element:t,edges:w({elementRect:a,containerRect:n}),elementRect:a,containerRect:n,elementPos:s,useTransform:i})},C=function(e,t,r){if(r){var n=e.style.transform;e.style.transform="translate3d(".concat(t.x,"px,").concat(t.y,"px,1px) ").concat(n.replace(/translate.*?\)/g,""))}else e.style.left="".concat(t.x,"px"),e.style.top="".concat(t.y,"px");return e},L=function(e){for(var t=e.subscribe,r=e.publish,o=e.Interaction,s=e.SelectedSet,a=function(){var e=S(c[l],2),a=e[0],u=e[1];["pre",!1].forEach((function(e){return t(e?"".concat(a,":").concat(e):a,(function(t){return u.forEach((function(a){return(!a.condition||a.condition(t))&&r(e?"".concat(e).concat(a.name):a.name,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({items:s.elements,isDragging:o.isDragging},t))}))}))}))},l=0,c=Object.entries({"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(e){return e.event}}],"Interaction:end":[{name:"callback"}]});l<c.length;l++)a()},T=function(e){return e?!Array.isArray(e)&&(e instanceof HTMLElement||e instanceof SVGElement)?[e]:p(e):[]},V=function(e,t){e.style.left="".concat(t.left,"px"),e.style.top="".concat(t.top,"px"),e.style.width="".concat(t.width,"px"),e.style.height="".concat(t.height,"px")},N=function(){function t(r){var i,o,s,a=this,l=r.area,c=r.PS,u=r.zoom;e(this,t),n(this,"_modificationCallback",void 0),n(this,"_modificationObserver",void 0),n(this,"_zoom",void 0),n(this,"_node",void 0),n(this,"_parentNodes",void 0),n(this,"_computedStyle",void 0),n(this,"_computedBorder",void 0),n(this,"_rect",void 0),n(this,"setArea",(function(e){a._node=e,x({computedStyle:a.computedStyle,node:a._node}),setTimeout((function(){a.PubSub.publish("Area:modified:pre",{item:a}),a.reset(),a.PubSub.publish("Area:modified",{item:a})}))})),n(this,"start",(function(){var e,t,r;e=a.parentNodes,t=a._modificationCallback,r=a._modificationObserver,window.addEventListener("resize",t),window.addEventListener("scroll",t),e.forEach((function(e,t){r.observe(e,{childList:0!==t,attributes:!0})}))})),n(this,"reset",(function(){a._computedStyle=void 0,a._rect=void 0,a._computedBorder=void 0,a._parentNodes=void 0})),n(this,"stop",(function(){var e,t;e=a._modificationObserver,t=a._modificationCallback,window.removeEventListener("resize",t),window.removeEventListener("scroll",t),e.disconnect(),a.reset()})),n(this,"scroll",(function(e,t){var r={scroll_directions:e,scroll_multiplier:t};a.PubSub.publish("Area:scroll:pre",r),function(e,t,r){if(t.length){var n=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,i=e instanceof HTMLDocument?n||document.body:e,o=t.includes("top")&&i.scrollTop>0,s=t.includes("bottom")&&i.scrollTop<i.scrollHeight,a=t.includes("left")&&i.scrollLeft>0,l=t.includes("right")&&i.scrollLeft<i.scrollWidth;o&&(i.scrollTop-=1*r),s&&(i.scrollTop+=1*r),a&&(i.scrollLeft-=1*r),l&&(i.scrollLeft+=1*r)}}(a._node,e,t),a.PubSub.publish("Area:scroll",r)})),this._zoom=u,this.PubSub=c,this.setArea(l),this._modificationCallback=(i=function(e){a.PubSub.publish("Area:modified:pre",{event:e,item:a}),a.reset(),a.PubSub.publish("Area:modified",{event:e,item:a})},o=60,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=function(){s=null,i.apply(void 0,t)};clearTimeout(s),s=setTimeout(n,o)}),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return r(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 HTMLDocument?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(e,t){if(e instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=e.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(e.clientWidth||r.width)*t,height:(e.clientHeight||r.height)*t}}(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;return this._parentNodes=function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=null===(r=t[n])||void 0===r?void 0:r.parentNode;return i?(t.push(i),e(t,++n)):t}([this.HTMLNode]),this._parentNodes}}]),t}(),M=function(){function t(r){var i=this,o=r.DS,s=r.dragKeys,a=r.draggability,l=r.keyboardDrag,c=r.keyboardDragSpeed,u=r.useTransform,d=r.zoom;e(this,t),n(this,"_useTransform",void 0),n(this,"_prevCursorPos",void 0),n(this,"_prevScrollPos",void 0),n(this,"_elements",[]),n(this,"_draggability",void 0),n(this,"_dragKeys",void 0),n(this,"_dragKeysFlat",void 0),n(this,"_keyboardDrag",void 0),n(this,"_keyboardDragSpeed",void 0),n(this,"_zoom",void 0),n(this,"keyboardDrag",(function(e){var t=e.event,r=e.key;if(i._keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i._draggability&&!i.DS.continue){var n={event:t,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],n),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var o=function(e){var t=e.shiftKey,r=e.keyboardDragSpeed,n=e.zoom,i=e.key,o=e.dragKeys,s=e.scrollDiff,a=e.canScroll,l=e.scrollCallback,c={x:0,y:0},u=t?4*r*n:r*n;return o.left.includes(i)&&(c.x=s.x||-u,t||s.x||!a||l(["left"],r)),o.right.includes(i)&&(c.x=s.x||u,t||s.x||!a||l(["right"],r)),o.up.includes(i)&&(c.y=s.y||-u,t||s.y||!a||l(["top"],r)),o.down.includes(i)&&(c.y=s.y||u,t||s.y||!a||l(["bottom"],r)),c}({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i._keyboardDragSpeed,zoom:i._zoom,key:r,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach((function(e){return A({element:e,posDirection:o,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})})),i.DS.publish(["Interaction:update:pre","Interaction:update"],n)}})),n(this,"keyboardEnd",(function(e){var t=e.event,r=e.key;if(i._keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i._draggability){var n={event:t,isDragging:i._draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],n)}})),n(this,"start",(function(e){var t=e.isDragging,r=e.isDraggingKeyboard;t&&!r&&(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))})),n(this,"stop",(function(e){null!=e&&e.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])})),n(this,"update",(function(e){var t=e.isDragging,r=e.isDraggingKeyboard;if(t&&i._elements.length&&!r&&!i.DS.continue){var n=b(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach((function(e){return A({element:e,posDirection:n,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})}))}})),n(this,"handleZIndex",(function(e){i._elements.forEach((function(t){return t.style.zIndex="".concat((parseInt(t.style.zIndex)||0)+e?9999:-9998)}))})),this.DS=o,this._useTransform=u,this._keyboardDragSpeed=c,this._keyboardDrag=l,this._zoom=d,this._draggability=a,this._dragKeys={up:s.up.map((function(e){return e.toLowerCase()})),down:s.down.map((function(e){return e.toLowerCase()})),left:s.left.map((function(e){return e.toLowerCase()})),right:s.right.map((function(e){return e.toLowerCase()}))},this._dragKeysFlat=[].concat(p(this._dragKeys.up),p(this._dragKeys.down),p(this._dragKeys.left),p(this._dragKeys.right)),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 r(t,[{key:"_cursorDiff",get:function(){var e=this.DS.stores.PointerStore.currentVal,t=this._prevCursorPos?b(e,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=e,t}},{key:"_scrollDiff",get:function(){var e=this.DS.stores.ScrollStore.currentVal,t=this._prevScrollPos?b(e,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=e,t}}]),t}(),K=function(){function t(r){var i=this,o=r.DS,s=r.areaElement,a=r.draggability,l=r.immediateDrag,c=r.selectableClass;e(this,t),n(this,"_areaElement",void 0),n(this,"_draggability",void 0),n(this,"_immediateDrag",void 0),n(this,"_selectableClass",void 0),n(this,"isInteracting",void 0),n(this,"isDragging",void 0),n(this,"init",(function(){return i.DS.publish("Interaction:init:pre",{})})),n(this,"_init",(function(){i.stop(),i._areaElement.addEventListener("mousedown",i.start),i._areaElement.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})})),n(this,"start",(function(e){return i.DS.publish("Interaction:start:pre",{event:e,isDragging:i.isDragging})})),n(this,"_start",(function(e){"touchstart"===e.type&&e.preventDefault(),i._canInteract(e)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(e),i.DS.publish("Interaction:start",{event:e,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))})),n(this,"isDragEvent",(function(e){var t=e.target.closest(".".concat(i._selectableClass));return!(!i._draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(e)||!t)&&(i._immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(t)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(t)):i.DS.SelectedSet.add(t)),!!i.DS.SelectedSet.has(t))})),n(this,"onClick",(function(e){var t=e.event;if(i._canInteract(t)&&!(t.detail>0)){var r=i.DS,n=r.stores,o=n.PointerStore,s=n.KeyStore,a=r.SelectableSet,l=r.SelectedSet;o.start(t);var c=t.target;a.has(c)&&(s.isMultiSelectKeyPressed(t)||l.clear(),l.toggle(c),i.reset())}})),n(this,"stop",(function(){i.isInteracting=!1,i.isDragging=!1,i._areaElement.removeEventListener("mousedown",i.start),i._areaElement.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)})),n(this,"update",(function(e){var t=e.event,r=e.scroll_directions,n=e.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:t,scroll_directions:r,scroll_multiplier:n,isDragging:i.isDragging})})),n(this,"reset",(function(e){return i.DS.publish("Interaction:end:pre",{event:e,isDragging:i.isDragging})})),n(this,"_reset",(function(e){var t=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:e,isDragging:t})})),this._areaElement=s,this._draggability=a,this._immediateDrag=l,this._selectableClass=c,this.DS=o,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",(function(e){var t=e.event;return i.start(t)})),this.DS.subscribe("Interaction:start:pre",(function(e){var t=e.event;return i._start(t)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(e){var t=e.event;return i._reset(t)})),this.DS.subscribe("Area:scroll",this.update)}return r(t,[{key:"_canInteract",value:function(e){var t=0===e.clientX&&0===e.clientY&&0===e.detail&&e.target;return!(2===e.button||this.isInteracting||e.target&&!this.DS.SelectorArea.isInside(e.target)||!t&&!this.DS.SelectorArea.isClicked(e))}}]),t}(),O=function t(r){var i=this,o=r.DS;e(this,t),n(this,"subscribers",{}),n(this,"subscribe",(function(e,t){return Array.isArray(i.subscribers[e])||(i.subscribers[e]=[]),i.subscribers[e].push(t),i.subscribers[e].length-1})),n(this,"unsubscribe",(function(e,t,r){r>=0?i.subscribers[e].splice(r,1):t&&(i.subscribers[e]=i.subscribers[e].filter((function(e){return e!==t})))})),n(this,"publish",(function(e,t){Array.isArray(e)?e.forEach((function(e){return i._publish(e,t)})):i._publish(e,t)})),n(this,"_publish",(function(e,t){var r=i.subscribers[e];Array.isArray(r)&&(e.includes(":pre")?i._handlePrePublish(r,t):i._handlePublish(r,t))})),n(this,"_handlePublish",(function(e,t){for(var r=0,n=e.length;r<n;r++){if(i.DS.stopped)return;e[r](t)}})),n(this,"_handlePrePublish",(function(e,t){for(var r=e.length;r--;){if(i.DS.stopped)return;e[r](t)}})),this.DS=o},j=function(t){o(a,t);var i=f(a);function a(t){var r,o=t.elements,s=t.className,l=t.hoverClassName,c=t.draggability,u=t.useTransform,h=t.DS;return e(this,a),n(d(r=i.call(this)),"_initElements",void 0),n(d(r),"_className",void 0),n(d(r),"_hoverClassName",void 0),n(d(r),"_useTransform",void 0),n(d(r),"_draggability",void 0),n(d(r),"init",(function(){return r._initElements.forEach((function(e){return r.add(e)}))})),n(d(r),"clear",(function(){return r.forEach((function(e){return r.delete(e)}))})),n(d(r),"_onClick",(function(e){return r.DS.publish(["Selectable:click:pre","Selectable:click"],{event:e})})),n(d(r),"_onPointer",(function(e){return r.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:e})})),n(d(r),"addAll",(function(e){return e.forEach((function(e){return r.add(e)}))})),n(d(r),"deleteAll",(function(e){return e.forEach((function(e){return r.delete(e)}))})),r.DS=h,r._initElements=T(o),r._className=s,r._hoverClassName=l,r._useTransform=u,r._draggability=c,r.DS.subscribe("Interaction:init",r.init),r}return r(a,[{key:"add",value:function(e){return e.classList.add(this._className),e.addEventListener("click",this._onClick),e.addEventListener("mousedown",this._onPointer),e.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&x({computedStyle:window.getComputedStyle(e),node:e}),v(s(a.prototype),"add",this).call(this,e)}},{key:"delete",value:function(e){return e.classList.remove(this._className),e.classList.remove(this._hoverClassName),e.removeEventListener("click",this._onClick),e.removeEventListener("mousedown",this._onPointer),e.removeEventListener("touchstart",this._onPointer,{passive:!1}),v(s(a.prototype),"delete",this).call(this,e)}},{key:"elements",get:function(){return Array.from(this.values())}}]),a}(u(Set)),z=function(t){o(a,t);var i=f(a);function a(t){var r,o=t.className,s=t.DS;return e(this,a),n(d(r=i.call(this)),"_className",void 0),n(d(r),"clear",(function(){return r.forEach((function(e){return r.delete(e)}))})),n(d(r),"addAll",(function(e){return e.forEach((function(e){return r.add(e)}))})),n(d(r),"deleteAll",(function(e){return e.forEach((function(e){return r.delete(e)}))})),r.DS=s,r._className=o,r}return r(a,[{key:"add",value:function(e){if(!v(s(a.prototype),"has",this).call(this,e)){var t={items:this.elements,item:e};return this.DS.publish("Selected:added:pre",t),v(s(a.prototype),"add",this).call(this,e),e.classList.add(this._className),e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)+1),this.DS.publish("Selected:added",t),this}}},{key:"delete",value:function(e){if(v(s(a.prototype),"has",this).call(this,e)){var t={items:this.elements,item:e};this.DS.publish("Selected:removed:pre",t);var r=v(s(a.prototype),"delete",this).call(this,e);return e.classList.remove(this._className),e.style.zIndex="".concat((parseInt(e.style.zIndex)||0)-1),this.DS.publish("Selected:removed",t),r}}},{key:"toggle",value:function(e){return this.has(e)?this.delete(e):this.add(e),e}},{key:"elements",get:function(){return Array.from(this.values())}}]),a}(u(Set)),H=function(){function t(r){var i=this,o=r.DS,s=r.hoverClassName,a=r.multiSelectToggling;e(this,t),n(this,"_prevSelectedSet",void 0),n(this,"_hoverClassName",void 0),n(this,"_multiSelectToggling",void 0),n(this,"start",(function(e){var t=e.event;e.isDragging||(i._storePrevious(t),i._handleInsideSelection(!0,t))})),n(this,"update",(function(e){e.isDragging||i.DS.continue||i._handleInsideSelection()})),n(this,"_handleInsideSelection",(function(e,t){for(var r=i.DS,n=r.SelectableSet,o=r.SelectorArea,s=r.Selector,a=n.elements.map((function(e){return[e,e.getBoundingClientRect()]})),l=[],c=[],u=0,d=a.length;u<d;u++)o.isInside(a[u][0],a[u][1])&&(I(a[u][1],s.rect)?l.push(a[u][0]):c.push(a[u][0]));var h=i.DS.stores.KeyStore.isMultiSelectKeyPressed(t)&&i._multiSelectToggling;i.DS.continue||(l.forEach((function(t){return function(e){var t=e.element,r=e.force,n=e.multiSelectionToggle,i=e.SelectedSet,o=e.hoverClassName;t.classList.contains(o)&&!r||(i.has(t)?n&&i.delete(t):i.add(t),t.classList.add(o))}({element:t,force:e,multiSelectionToggle:h,SelectedSet:i.DS.SelectedSet,hoverClassName:i._hoverClassName})})),c.forEach((function(t){return function(e){var t=e.element,r=e.force,n=e.SelectedSet,i=e.PrevSelectedSet,o=e.hoverClassName;if(!t.classList.contains(o)&&!r)return!1;var s=n.has(t),a=i.has(t);s&&!a?n.delete(t):!s&&a&&n.add(t),t.classList.remove(o)}({element:t,force:e,SelectedSet:i.DS.SelectedSet,hoverClassName:i._hoverClassName,PrevSelectedSet:i._prevSelectedSet})})))})),this._hoverClassName=s,this._multiSelectToggling=a,this.DS=o,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return r(t,[{key:"_storePrevious",value:function(e){var t=this.DS,r=t.stores.KeyStore,n=t.SelectedSet;r.isMultiSelectKeyPressed(e)?this._prevSelectedSet=new Set(n):this._prevSelectedSet=new Set}}]),t}(),R=function(){function t(r){var i=this,o=r.DS,s=r.selector,a=r.selectorClass,l=r.customStyles;e(this,t),n(this,"_rect",void 0),n(this,"start",(function(e){if(!e.isDragging){var t=i.DS.stores.PointerStore.initialValArea;V(i.HTMLNode,_(t,1)),i.HTMLNode.style.display="block",i._rect=null}})),n(this,"stop",(function(){i.HTMLNode.style.width="0",i.HTMLNode.style.height="0",i.HTMLNode.style.display="none"})),n(this,"update",(function(e){if(!e.isDragging&&!i.DS.continue){var t=i.DS.stores,r=t.ScrollStore,n=t.PointerStore,o=function(e){var t=e.scrollAmount,r=e.initialPointerPos,n=e.pointerPos,i={};return n.x>r.x-t.x?(i.left=r.x-t.x,i.width=n.x-r.x+t.x):(i.left=n.x,i.width=r.x-n.x-t.x),n.y>r.y-t.y?(i.top=r.y-t.y,i.height=n.y-r.y+t.y):(i.top=n.y,i.height=r.y-n.y-t.y),i}({scrollAmount:r.scrollAmount,initialPointerPos:n.initialValArea,pointerPos:n.currentValArea});V(i.HTMLNode,o),i._rect=null}})),this.DS=o,this.HTMLNode=s||function(e){var t=document.createElement("div");return t.style.position="absolute",e||(t.style.background="rgba(0, 0, 255, 0.1)",t.style.border="1px solid rgba(0, 0, 255, 0.45)",t.style.display="none",t.style.pointerEvents="none"),t}(l),this.HTMLNode.classList.add(a),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return r(t,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),B=function(){function t(r){var i=this,o=r.DS,s=r.selectorAreaClass,a=r.autoScrollSpeed,l=r.overflowTolerance;e(this,t),n(this,"_autoScrollSpeed",void 0),n(this,"_scrollInterval",void 0),n(this,"_rect",void 0),n(this,"currentEdges",[]),n(this,"_overflowTolerance",void 0),n(this,"start",(function(){return i.applyElements("append")})),n(this,"applyElements",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",t=document.body?"body":"documentElement",r="".concat(e,"Child");i.HTMLNode[r](i.DS.Selector.HTMLNode),document[t][r](i.HTMLNode)})),n(this,"updatePos",(function(){i._rect=null;var e=i.DS.Area.rect,t=i.DS.Area.computedBorder,r=i.HTMLNode.style,n="".concat(e.top+t.top,"px"),o="".concat(e.left+t.left,"px"),s="".concat(e.width,"px"),a="".concat(e.height,"px");r.top!==n&&(r.top=n),r.left!==o&&(r.left=o),r.width!==s&&(r.width=s),r.height!==a&&(r.height=a)})),n(this,"stop",(function(e){i.stopAutoScroll(),e&&i.applyElements("remove")})),n(this,"startAutoScroll",(function(){i.currentEdges=[],i._scrollInterval=setInterval((function(){return i.handleAutoScroll()}),16)})),n(this,"handleAutoScroll",(function(){if(!i.DS.continue){var e=i.DS,t=e.stores.PointerStore,r=e.Area;i.currentEdges=w({elementRect:_(t.currentVal),containerRect:i.rect,tolerance:i._overflowTolerance}),i.currentEdges.length&&r.scroll(i.currentEdges,i._autoScrollSpeed)}})),n(this,"stopAutoScroll",(function(){i.currentEdges=[],clearInterval(i._scrollInterval)})),n(this,"isInside",(function(e,t){return!(!i.DS.Area.HTMLNode.contains(e)||!i.DS.stores.ScrollStore.canScroll)||I(i.rect,t||e.getBoundingClientRect())})),this._autoScrollSpeed=a,this._overflowTolerance=l,this.DS=o,this.HTMLNode=function(e){var t=document.createElement("div");return t.style.position="fixed",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex="999999999999999999",t.classList.add(e),t}(s),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(){i.updatePos(),i.stopAutoScroll()}))}return r(t,[{key:"isClicked",value:function(e){var t=this.DS.stores.PointerStore,r=e?t.getPointerPosition(e):t.initialVal;return I({left:r.x,top:r.y,right:r.x,bottom:r.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),t}(),U=function(){function t(r){var i=this,o=r.DS,s=r.multiSelectKeys,a=r.multiSelectMode;e(this,t),n(this,"_multiSelectMode",void 0),n(this,"_multiSelectKeys",void 0),n(this,"_currentValues",new Set),n(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),n(this,"init",(function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)})),n(this,"keydown",(function(e){var t=e.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:e,key:t}),i._currentValues.add(t),i.DS.publish("KeyStore:down",{event:e,key:t})})),n(this,"keyup",(function(e){var t=e.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:e,key:t}),i._currentValues.delete(t),i.DS.publish("KeyStore:up",{event:e,key:t})})),n(this,"stop",(function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()})),n(this,"reset",(function(){return i._currentValues.clear()})),this.DS=o,this._multiSelectMode=a,this._multiSelectKeys=s.map((function(e){var t={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"}[e];return t?(console.warn("[DragSelect] ".concat(e,' is deprecated. Use "').concat(t,'" instead. Act Now!. See docs for more info')),t.toLowerCase()):e.toLowerCase()})),this.DS.subscribe("Interaction:init",this.init)}return r(t,[{key:"isMultiSelectKeyPressed",value:function(e){var t=this;return!!this._multiSelectMode||(!!this.currentValues.some((function(e){return t._multiSelectKeys.includes(e)}))||!(!e||!this._multiSelectKeys.some((function(r){return e[t._keyMapping[r]]}))))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),t}(),W=function(){function t(r){var i=this,o=r.DS;e(this,t),n(this,"_isMouseInteraction",!1),n(this,"_initialValArea",void 0),n(this,"_currentValArea",void 0),n(this,"_lastValArea",void 0),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_lastVal",void 0),n(this,"_lastTouch",void 0),n(this,"init",(function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})})),n(this,"getPointerPosition",(function(e){return function(e){var t=e.event;return{x:t.clientX,y:t.clientY}}({event:i._normalizedEvent(e)})})),n(this,"update",(function(e){e&&(i.DS.publish("PointerStore:updated:pre",{event:e}),i.currentVal=i.getPointerPosition(e),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:e}))})),n(this,"stop",(function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout((function(){return i._isMouseInteraction=!1}),100)})),n(this,"reset",(function(e){e&&(i.currentVal=i.lastVal=i.getPointerPosition(e),i.stop(),i.init())})),this.DS=o,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(e){var t=e.event;return i.start(t)})),this.DS.subscribe("Interaction:end",(function(e){var t=e.event;return i.reset(t)}))}return r(t,[{key:"start",value:function(e){e&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(e))}},{key:"_normalizedEvent",value:function(e){return"touches"in e&&"touchend"!==e.type&&(this._lastTouch=e),"touches"in e?this._lastTouch.touches[0]:e}},{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(e){this._initialVal=e,this._initialValArea=e&&b(e,"-",b(y(this.DS.Area.rect),"+",y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(e){this._currentVal=e,this._currentValArea=e&&b(e,"-",b(y(this.DS.Area.rect),"+",y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(e){this._lastVal=e,this._lastValArea=e&&b(e,"-",b(y(this.DS.Area.rect),"+",y(this.DS.Area.computedBorder)))}}]),t}(),F=function(){function t(r){var i=this,o=r.DS,s=r.areaElement,a=r.zoom;e(this,t),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_areaElement",void 0),n(this,"_canScroll",void 0),n(this,"init",(function(){return i._areaElement.addEventListener("scroll",i.update)})),n(this,"start",(function(){i._currentVal=i._initialVal=P(i._areaElement),i._areaElement.addEventListener("scroll",i.update)})),n(this,"update",(function(){return i._currentVal=P(i._areaElement)})),n(this,"stop",(function(){i._areaElement.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null})),n(this,"reset",(function(){i.stop(),i.start()})),this._areaElement=s,this.DS=o,this.zoom=a,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return i.start()})),this.DS.subscribe("Interaction:end",(function(){return i.reset()}))}return r(t,[{key:"canScroll",get:function(){return"boolean"==typeof this._canScroll?this._canScroll:this._canScroll=(e=this._areaElement,!!((t=P(e)).x||t.y||(e instanceof HTMLDocument?e.body?e.body.scrollTop=1:e.documentElement.scrollTop=1:e.scrollTop=1)));var e,t}},{key:"scrollAmount",get:function(){var e,t=b(this.currentVal,"-",this.initialVal),r={x:e=this.zoom,y:e},n=b(b(t,"*",r),"-",t);return{x:t.x+n.x,y:t.y+n.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=P(this._areaElement)),this._currentVal}}]),t}();return function(){function t(r){var i=this,o=r.area,s=void 0===o?document:o,a=r.selectables,l=void 0===a?[]:a,c=r.autoScrollSpeed,u=void 0===c?5:c,d=r.overflowTolerance,h=void 0===d?{x:25,y:25}:d,f=r.zoom,v=void 0===f?1:f,S=r.customStyles,p=void 0!==S&&S,m=r.multiSelectMode,g=void 0!==m&&m,b=r.multiSelectToggling,y=void 0===b||b,_=r.multiSelectKeys,D=void 0===_?["Control","Shift","Meta"]:_,P=r.selector,w=void 0===P?void 0:P,k=r.draggability,E=void 0===k||k,x=r.immediateDrag,I=void 0===x||x,A=r.keyboardDrag,C=void 0===A||A,T=r.dragKeys,V=r.keyboardDragSpeed,Z=void 0===V?10:V,X=r.useTransform,Y=void 0===X||X,G=r.hoverClass,$=void 0===G?"ds-hover":G,q=r.selectableClass,J=void 0===q?"ds-selectable":q,Q=r.selectedClass,ee=void 0===Q?"ds-selected":Q,te=r.selectorClass,re=void 0===te?"ds-selector":te,ne=r.selectorAreaClass,ie=void 0===ne?"ds-selector-area":ne,oe=r.callback,se=r.onDragMove,ae=r.onDragStartBegin,le=r.onDragStart,ce=r.onElementSelect,ue=r.onElementUnselect;e(this,t),n(this,"continue",!1),n(this,"start",(function(){i.stopped=!1,i.Interaction.init()})),n(this,"break",(function(){return i.continue=!0})),n(this,"getSelection",(function(){return i.SelectedSet.elements})),n(this,"getSelectables",(function(){return i.SelectableSet.elements})),n(this,"getInitialCursorPosition",(function(){return i.stores.PointerStore.initialVal})),n(this,"getCurrentCursorPosition",(function(){return i.stores.PointerStore.currentVal})),n(this,"getPreviousCursorPosition",(function(){return i.stores.PointerStore.lastVal})),n(this,"getInitialCursorPositionArea",(function(){return i.stores.PointerStore.initialValArea})),n(this,"getCurrentCursorPositionArea",(function(){return i.stores.PointerStore.currentValArea})),n(this,"getPreviousCursorPositionArea",(function(){return i.stores.PointerStore.lastValArea})),n(this,"isMultiSelect",(function(e){return i.stores.KeyStore.isMultiSelectKeyPressed(e)})),n(this,"isDragging",(function(){return i.Interaction.isDragging})),this.PubSub=new O({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:oe,onDragMove:se,onDragStart:le,onDragStartBegin:ae,onElementSelect:ce,onElementUnselect:ue}),this.stores={PointerStore:new W({DS:this}),ScrollStore:new F({DS:this,areaElement:s,zoom:v}),KeyStore:new U({DS:this,multiSelectKeys:D,multiSelectMode:g})},this.Area=new N({area:s,PS:this.PubSub,zoom:v}),this.Selector=new R({DS:this,selector:w,selectorClass:re,customStyles:p}),this.SelectorArea=new B({DS:this,selectorAreaClass:ie,autoScrollSpeed:u,overflowTolerance:h}),this.SelectableSet=new j({elements:l,DS:this,className:J,hoverClassName:$,useTransform:Y,draggability:E}),this.SelectedSet=new z({DS:this,className:ee}),this.Selection=new H({DS:this,hoverClassName:$,multiSelectToggling:y}),this.Drag=new M({DS:this,draggability:E,useTransform:Y,keyboardDrag:C,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},T),zoom:v,keyboardDragSpeed:Z}),this.Interaction=new K({areaElement:s,DS:this,draggability:E,immediateDrag:I,selectableClass:J}),L({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",(function(){return i.continue=!1})),this.start()}return r(t,[{key:"_callbacksTemp",value:function(e){var t=e.callback,r=e.onDragMove,n=e.onDragStart,i=e.onDragStartBegin,o=e.onElementSelect,s=e.onElementUnselect,a=function(e,t){return console.warn("[DragSelect] ".concat(e,' is deprecated. Use DragSelect.subscribe("').concat(t,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};t&&(a("callback","callback"),this.subscribe("callback",(function(e){var r=e.items,n=(e.item,e.event);return t(r,n)}))),r&&(a("onDragMove","dragmove"),this.subscribe("dragmove",(function(e){e.items,e.item;var t=e.event;return r(t)}))),n&&(a("onDragStart","dragstart"),this.subscribe("dragstart",(function(e){e.items,e.item;var t=e.event;return n(t)}))),i&&(a("onDragStartBegin","dragstart"),this.subscribe("dragstart",(function(e){e.items,e.item;var t=e.event;return i(t)}))),o&&(a("onElementSelect","elementselect"),this.subscribe("elementselect",(function(e){e.items;var t=e.item,r=e.event;return o(t,r)}))),s&&(a("onElementUnselect","elementunselect"),this.subscribe("elementunselect",(function(e){e.items;var t=e.item,r=e.event;return s(t,r)})))}},{key:"stop",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(e),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),e&&this.SelectableSet.clear(),t&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(T(e)),r||this.addSelectables(e),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(T(e)),r&&this.removeSelectables(e),t&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return T(e).forEach((function(i){return t.SelectedSet.has(i)?t.removeSelection(e,r,n):t.addSelection(e,r,n)})),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(e,t,r),this.getSelection()}},{key:"clearSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.SelectedSet.clear(),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=T(e);return this.SelectableSet.addAll(r),t&&this.SelectedSet.addAll(r),e}},{key:"setSelectables",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.removeSelectables(e,t),this.addSelectables(e,r)}},{key:"removeSelectables",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.SelectableSet.deleteAll(T(e)),t&&this.removeSelection(e),e}},{key:"getCursorPositionDifference",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var r=t?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),n=e?t?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():t?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return b(r,"-",n)}}]),t}()}));
!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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return 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}}),e&&c(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,r){return u=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&c(i,r.prototype),i},u.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;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,n)}function n(){return u(t,arguments,a(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,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){return!e||"object"!=typeof e&&"function"!=typeof e?h(t):e}function f(t){var e=l();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S(this,r)}}function p(t,e,r){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}},p(t,e,r||t)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,i=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw s}}return r}(t,e)||b(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 v(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||b(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 b(t,e){if(t){if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var m=function(t,e,r){var n=t.x,i=t.y,s=r.x,o=r.y;return{"+":{x:n+s,y:i+o},"-":{x:n-s,y:i-o},"*":{x:n*s,y:i*o},"/":{x:n/s,y:i/o}}[e]},D=function(t){return{x:t.left,y:t.top}},_=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}},w=function(){var t,e,r,n;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===(r=document.body)||void 0===r?void 0:r.scrollLeft)||(null===(n=document.documentElement)||void 0===n?void 0:n.scrollLeft)||0}},A=function(t){return!t||t instanceof Document?w():{x:t.scrollLeft>=0?t.scrollLeft:w().x,y:t.scrollTop>=0?t.scrollTop:w().y}},P=function(t){var e=t.elementRect,r=t.containerRect,n=t.tolerance,i=void 0===n?{x:0,y:0}:n,s=[];return e.top-i.y<r.top&&s.push("top"),e.left-i.x<r.left&&s.push("left"),e.bottom+i.y>r.bottom&&s.push("bottom"),e.right+i.y>r.right&&s.push("right"),s},L=function(t){var e={x:0,y:0},r=window.getComputedStyle(t);if(!r.transform||"none"===r.transform)return e;if(r.transform.indexOf("3d")>=0){var n=r.transform.trim().match(/matrix3d\((.*?)\)/);if(n&&n.length){var i,s=null===(i=n[1])||void 0===i?void 0:i.split(",");e.x=parseInt(s[12])||0,e.y=parseInt(s[13])||0}return e}var o=r.transform.trim().match(/matrix\((.*?)\)/);if(o&&o.length){var a,c=null===(a=o[1])||void 0===a?void 0:a.split(",");e.x=parseInt(c[4])||0,e.y=parseInt(c[5])||0}return e},x=function(t,e){return e?function(t){var e=t.style.transform;if(!e||e.indexOf("translate")<0)return L(t);var r={x:0,y:0},n=e.trim().match(/translate[3dD]*?\(.*?\)/);if(n){var i,s=null===(i=n[0])||void 0===i?void 0:i.split("(");if(s){var o,a=null===(o=s[1])||void 0===o?void 0:o.split(",");r.x=parseInt(a[0])||0,r.y=parseInt(a[1])||0}}return r.x||r.x?r:L(t)}(t):function(t){var e=t.style,r={x:parseInt(e.left)||0,y:parseInt(e.top)||0};if(!r.x&&!r.x){var n=window.getComputedStyle(t);return{x:parseInt(n.left)||0,y:parseInt(n.top)||0}}return r}(t)},k=function(t){var e=t.computedStyle,r=t.node,n=e.position;r instanceof HTMLDocument||("absolute"===n||"relative"===n||"fixed"===n)||(r.style.position="relative")},I=function(t,e,r){return console.warn('[DragSelect] TypeIssue: setting "'.concat(t,'" is not of type "').concat(e,'".'))},T=function(t,e,r,i){if(void 0===e)return r?n({},t,i):{};if(null===e)return n({},t,null);var s=!0,o=!1,a="string"==typeof i;a&&(s="string"==typeof e||e instanceof String),a&&!s&&(o=!0,I(t,"string"));var c=!isNaN(i)&&"number"==typeof i;c&&(s=!isNaN(e)&&"number"==typeof e),c&&!s&&(o=!0,I(t,"number"));var l="[object Object]"===Object.prototype.toString.call(i);l&&(s="[object Object]"===Object.prototype.toString.call(e)),l&&!s&&(o=!0,I(t,"object"));var u="boolean"==typeof i;u&&(s="boolean"==typeof e),u&&!s&&(o=!0,I(t,"boolean"));var d=Array.isArray(i);d&&(s=Array.isArray(e)),d&&!s&&(o=!0,I(t,"array"));var h=o||r;return"dragKeys"===t&&s?n({},t,Object.assign(i,e)):("dragKeys"!==t||s)&&s?n({},t,e):h?n({},t,i):{}},C=function(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top},E=function(t){var e=t.element,r=t.posDirection,n=t.containerRect,i=t.useTransform,s=x(e,i),o=m(s,"+",r);V(e,o,i);var a=e.getBoundingClientRect();!function(t){var e=t.element,r=t.edges,n=t.elementRect,i=t.containerRect,s=t.elementPos,o=t.useTransform;r.includes("top")&&V(e,{y:s.y+i.top-n.top,x:s.x},o),r.includes("left")&&V(e,{y:s.y,x:s.x+i.left-n.left},o),r.includes("bottom")&&V(e,{y:s.y+i.bottom-n.bottom,x:s.x},o),r.includes("right")&&V(e,{y:s.y,x:s.x+i.right-n.right},o)}({element:e,edges:P({elementRect:a,containerRect:n}),elementRect:a,containerRect:n,elementPos:o,useTransform:i})},V=function(t,e,r){if(r){var n=t.style.transform;t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,1px) ").concat(n.replace(/translate.*?\)/g,""))}else t.style.left="".concat(e.x,"px"),t.style.top="".concat(e.y,"px");return t},M=function(t){return t?!Array.isArray(t)&&(t instanceof HTMLElement||t instanceof SVGElement)?[t]:v(t):[]},N=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")},K=function(){function e(r){var i,s,o,a=this,c=r.DS;t(this,e),n(this,"DS",void 0),n(this,"_modificationCallback",void 0),n(this,"_modificationObserver",void 0),n(this,"_zoom",void 0),n(this,"_node",void 0),n(this,"_parentNodes",void 0),n(this,"_computedStyle",void 0),n(this,"_computedBorder",void 0),n(this,"_rect",void 0),n(this,"setArea",(function(t){a._node=t,k({computedStyle:a.computedStyle,node:a._node}),setTimeout((function(){a.DS.PubSub.publish("Area:modified:pre",{item:a}),a.reset(),a.DS.PubSub.publish("Area:modified",{item:a})}))})),n(this,"start",(function(){var t,e,r;t=a.parentNodes,e=a._modificationCallback,r=a._modificationObserver,window.addEventListener("resize",e),window.addEventListener("scroll",e),t.forEach((function(t,e){r.observe(t,{childList:0!==e,attributes:!0})}))})),n(this,"reset",(function(){a._computedStyle=void 0,a._rect=void 0,a._computedBorder=void 0,a._parentNodes=void 0})),n(this,"stop",(function(){var t,e;t=a._modificationObserver,e=a._modificationCallback,window.removeEventListener("resize",e),window.removeEventListener("scroll",e),t.disconnect(),a.reset()})),n(this,"scroll",(function(t,e){var r={scroll_directions:t,scroll_multiplier:e};a.DS.PubSub.publish("Area:scroll:pre",r),function(t,e,r){if(e.length){var n=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,i=t instanceof HTMLDocument?n||document.body:t,s=e.includes("top")&&i.scrollTop>0,o=e.includes("bottom")&&i.scrollTop<i.scrollHeight,a=e.includes("left")&&i.scrollLeft>0,c=e.includes("right")&&i.scrollLeft<i.scrollWidth;s&&(i.scrollTop-=1*r),o&&(i.scrollTop+=1*r),a&&(i.scrollLeft-=1*r),c&&(i.scrollLeft+=1*r)}}(a._node,t,e),a.DS.PubSub.publish("Area:scroll",r)})),this.DS=c,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",(function(t){var e=t.settings;return a.setArea(e.area)})),this._modificationCallback=(i=function(t){a.DS.PubSub.publish("Area:modified:pre",{event:t,item:a}),a.reset(),a.DS.PubSub.publish("Area:modified",{event:t,item:a})},s=60,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=function(){o=null,i.apply(void 0,e)};clearTimeout(o),o=setTimeout(n,s)}),this._modificationObserver=new MutationObserver(this._modificationCallback),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return r(e,[{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 HTMLDocument?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 r=t.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(t.clientWidth||r.width)*e,height:(t.clientHeight||r.height)*e}}(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;return this._parentNodes=function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=null===(r=e[n])||void 0===r?void 0:r.parentNode;return i?(e.push(i),t(e,++n)):e}([this.HTMLNode]),this._parentNodes}}]),e}(),O=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_prevCursorPos",void 0),n(this,"_prevScrollPos",void 0),n(this,"_elements",[]),n(this,"_dragKeys",void 0),n(this,"_dragKeysFlat",[]),n(this,"assignDragkeys",(function(){i._dragKeys={up:i.DS.stores.SettingsStore.s.dragKeys.up.map((function(t){return t.toLowerCase()})),down:i.DS.stores.SettingsStore.s.dragKeys.down.map((function(t){return t.toLowerCase()})),left:i.DS.stores.SettingsStore.s.dragKeys.left.map((function(t){return t.toLowerCase()})),right:i.DS.stores.SettingsStore.s.dragKeys.right.map((function(t){return t.toLowerCase()}))},i._dragKeysFlat=[].concat(v(i._dragKeys.up),v(i._dragKeys.down),v(i._dragKeys.left),v(i._dragKeys.right))})),n(this,"keyboardDrag",(function(t){var e=t.event,r=t.key.toLowerCase();if(i.DS.stores.SettingsStore.s.keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i.DS.stores.SettingsStore.s.draggability&&!i.DS.continue){var n={event:e,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],n),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var s=function(t){var e=t.shiftKey,r=t.keyboardDragSpeed,n=t.zoom,i=t.key,s=t.dragKeys,o=t.scrollDiff,a=t.canScroll,c=t.scrollCallback,l={x:0,y:0},u=e?4*r*n:r*n;return s.left.includes(i)&&(l.x=o.x||-u,e||o.x||!a||c(["left"],r)),s.right.includes(i)&&(l.x=o.x||u,e||o.x||!a||c(["right"],r)),s.up.includes(i)&&(l.y=o.y||-u,e||o.y||!a||c(["top"],r)),s.down.includes(i)&&(l.y=o.y||u,e||o.y||!a||c(["bottom"],r)),l}({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:i.DS.stores.SettingsStore.s.zoom,key:r,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach((function(t){return E({element:t,posDirection:s,containerRect:i.DS.SelectorArea.rect,useTransform:i.DS.stores.SettingsStore.s.useTransform})})),i.DS.publish(["Interaction:update:pre","Interaction:update"],n)}})),n(this,"keyboardEnd",(function(t){var e=t.event,r=t.key.toLowerCase();if(i.DS.stores.SettingsStore.s.keyboardDrag&&i._dragKeysFlat.includes(r)&&i.DS.SelectedSet.size&&i.DS.stores.SettingsStore.s.draggability){var n={event:e,isDragging:i.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],n)}})),n(this,"start",(function(t){var e=t.isDragging,r=t.isDraggingKeyboard;e&&!r&&(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))})),n(this,"stop",(function(t){null!=t&&t.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])})),n(this,"update",(function(t){var e=t.isDragging,r=t.isDraggingKeyboard;if(e&&i._elements.length&&!r&&!i.DS.continue){var n=m(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach((function(t){return E({element:t,posDirection:n,containerRect:i.DS.SelectorArea.rect,useTransform:i.DS.stores.SettingsStore.s.useTransform})}))}})),n(this,"handleZIndex",(function(t){i._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 r(e,[{key:"_cursorDiff",get:function(){var t=this.DS.stores.PointerStore.currentVal,e=this._prevCursorPos?m(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?m(t,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=t,e}}]),e}(),H=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"isInteracting",void 0),n(this,"isDragging",void 0),n(this,"init",(function(){return i.DS.publish("Interaction:init:pre",{})})),n(this,"_init",(function(){i.stop(),i.DS.Area.HTMLNode.addEventListener("mousedown",i.start),i.DS.Area.HTMLNode.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})})),n(this,"start",(function(t){return i.DS.publish("Interaction:start:pre",{event:t,isDragging:i.isDragging})})),n(this,"_start",(function(t){"touchstart"===t.type&&t.preventDefault(),i._canInteract(t)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(t),i.DS.publish("Interaction:start",{event:t,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))})),n(this,"isDragEvent",(function(t){var e=t.target.closest(".".concat(i.DS.stores.SettingsStore.s.selectableClass));return!(!i.DS.stores.SettingsStore.s.draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(t)||!e)&&(i.DS.stores.SettingsStore.s.immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(e)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(e)):i.DS.SelectedSet.add(e)),!!i.DS.SelectedSet.has(e))})),n(this,"onClick",(function(t){var e=t.event;if(i._canInteract(e)&&!(e.detail>0)){var r=i.DS,n=r.stores,s=n.PointerStore,o=n.KeyStore,a=r.SelectableSet,c=r.SelectedSet;s.start(e);var l=e.target;a.has(l)&&(o.isMultiSelectKeyPressed(e)||c.clear(),c.toggle(l),i.reset())}})),n(this,"stop",(function(){i.isInteracting=!1,i.isDragging=!1,i.DS.Area.HTMLNode.removeEventListener("mousedown",i.start),i.DS.Area.HTMLNode.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)})),n(this,"update",(function(t){var e=t.event,r=t.scroll_directions,n=t.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:e,scroll_directions:r,scroll_multiplier:n,isDragging:i.isDragging})})),n(this,"reset",(function(t){return i.DS.publish("Interaction:end:pre",{event:t,isDragging:i.isDragging})})),n(this,"_reset",(function(t){var e=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:t,isDragging:e})})),this.DS=s,this.DS.subscribe("Settings:updated:area",this.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 i.start(e)})),this.DS.subscribe("Interaction:start:pre",(function(t){var e=t.event;return i._start(e)})),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",(function(t){var e=t.event;return i._reset(e)})),this.DS.subscribe("Area:scroll",this.update)}return r(e,[{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))}}]),e}(),j=function e(r){var i=this,s=r.DS;t(this,e),n(this,"subscribers",{}),n(this,"subscribe",(function(t,e){return Array.isArray(i.subscribers[t])||(i.subscribers[t]=[]),i.subscribers[t].push(e),i.subscribers[t].length-1})),n(this,"unsubscribe",(function(t,e,r){r>=0?i.subscribers[t].splice(r,1):e&&(i.subscribers[t]=i.subscribers[t].filter((function(t){return t!==e})))})),n(this,"publish",(function(t,e){Array.isArray(t)?t.forEach((function(t){return i._publish(t,e)})):i._publish(t,e)})),n(this,"_publish",(function(t,e){var r=i.subscribers[t];Array.isArray(r)&&(t.includes(":pre")?i._handlePrePublish(r,e):i._handlePublish(r,e))})),n(this,"_handlePublish",(function(t,e){for(var r=0,n=t.length;r<n;r++){if(i.DS.stopped)return;t[r](e)}})),n(this,"_handlePrePublish",(function(t,e){for(var r=t.length;r--;){if(i.DS.stopped)return;t[r](e)}})),this.DS=s},R=function(e){o(s,e);var i=f(s);function s(e){var r,o=e.DS;return t(this,s),n(h(r=i.call(this)),"init",(function(){return M(r.DS.stores.SettingsStore.s.selectables).forEach((function(t){return r.add(t)}))})),n(h(r),"clear",(function(){return r.forEach((function(t){return r.delete(t)}))})),n(h(r),"_onClick",(function(t){return r.DS.publish(["Selectable:click:pre","Selectable:click"],{event:t})})),n(h(r),"_onPointer",(function(t){return r.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:t})})),n(h(r),"addAll",(function(t){return t.forEach((function(t){return r.add(t)}))})),n(h(r),"deleteAll",(function(t){return t.forEach((function(t){return r.delete(t)}))})),r.DS=o,r.DS.subscribe("Interaction:init",r.init),r.DS.PubSub.subscribe("Settings:updated:selectables",(function(){r.clear(),r.init()})),r.DS.subscribe("Settings:updated:selectableClass",(function(t){var e=t.settings;r.forEach((function(t){t.classList.remove(e["selectableClass:pre"]),t.classList.add(e.selectableClass)}))})),r}return r(s,[{key:"add",value:function(t){return t.classList.add(this.DS.stores.SettingsStore.s.selectableClass),t.addEventListener("click",this._onClick),t.addEventListener("mousedown",this._onPointer),t.addEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.stores.SettingsStore.s.draggability&&!this.DS.stores.SettingsStore.s.useTransform&&k({computedStyle:window.getComputedStyle(t),node:t}),p(a(s.prototype),"add",this).call(this,t)}},{key:"delete",value:function(t){return t.classList.remove(this.DS.stores.SettingsStore.s.selectableClass),t.classList.remove(this.DS.stores.SettingsStore.s.hoverClass),t.removeEventListener("click",this._onClick),t.removeEventListener("mousedown",this._onPointer),t.removeEventListener("touchstart",this._onPointer,{passive:!1}),p(a(s.prototype),"delete",this).call(this,t)}},{key:"elements",get:function(){return Array.from(this.values())}}]),s}(d(Set)),z=function(e){o(s,e);var i=f(s);function s(e){var r,o=e.DS;return t(this,s),n(h(r=i.call(this)),"clear",(function(){return r.forEach((function(t){return r.delete(t)}))})),n(h(r),"addAll",(function(t){return t.forEach((function(t){return r.add(t)}))})),n(h(r),"deleteAll",(function(t){return t.forEach((function(t){return r.delete(t)}))})),r.DS=o,r}return r(s,[{key:"add",value:function(t){if(!p(a(s.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};return this.DS.publish("Selected:added:pre",e),p(a(s.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(p(a(s.prototype),"has",this).call(this,t)){var e={items:this.elements,item:t};this.DS.publish("Selected:removed:pre",e);var r=p(a(s.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),r}}},{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())}}]),s}(d(Set)),B=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_prevSelectedSet",void 0),n(this,"start",(function(t){var e=t.event;t.isDragging||(i._storePrevious(e),i._handleInsideSelection(!0,e))})),n(this,"update",(function(t){t.isDragging||i.DS.continue||i._handleInsideSelection()})),n(this,"_handleInsideSelection",(function(t,e){for(var r=i.DS,n=r.SelectableSet,s=r.SelectorArea,o=r.Selector,a=n.elements.map((function(t){return[t,t.getBoundingClientRect()]})),c=[],l=[],u=0,d=a.length;u<d;u++)s.isInside(a[u][0],a[u][1])&&(C(a[u][1],o.rect)?c.push(a[u][0]):l.push(a[u][0]));var h=i.DS.stores.KeyStore.isMultiSelectKeyPressed(e)&&i.DS.stores.SettingsStore.s.multiSelectToggling;i.DS.continue||(c.forEach((function(e){return function(t){var e=t.element,r=t.force,n=t.multiSelectionToggle,i=t.SelectedSet,s=t.hoverClassName;e.classList.contains(s)&&!r||(i.has(e)?n&&i.delete(e):i.add(e),e.classList.add(s))}({element:e,force:t,multiSelectionToggle:h,SelectedSet:i.DS.SelectedSet,hoverClassName:i.DS.stores.SettingsStore.s.hoverClass})})),l.forEach((function(e){return function(t){var e=t.element,r=t.force,n=t.SelectedSet,i=t.PrevSelectedSet,s=t.hoverClassName;if(!e.classList.contains(s)&&!r)return!1;var o=n.has(e),a=i.has(e);o&&!a?n.delete(e):!o&&a&&n.add(e),e.classList.remove(s)}({element:e,force:t,SelectedSet:i.DS.SelectedSet,hoverClassName:i.DS.stores.SettingsStore.s.hoverClass,PrevSelectedSet:i._prevSelectedSet})})))})),this.DS=s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return r(e,[{key:"_storePrevious",value:function(t){var e=this.DS,r=e.stores.KeyStore,n=e.SelectedSet;r.isMultiSelectKeyPressed(t)?this._prevSelectedSet=new Set(n):this._prevSelectedSet=new Set}}]),e}(),W=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_rect",void 0),n(this,"attachSelector",(function(){var t,e,r,n;i.HTMLNode&&null!==(t=i.DS.SelectorArea)&&void 0!==t&&t.HTMLNode&&i.DS.SelectorArea.HTMLNode.removeChild(i.HTMLNode),i.HTMLNode=i.DS.stores.SettingsStore.s.selector||(r=i.DS.stores.SettingsStore.s.customStyles,(n=document.createElement("div")).style.position="absolute",r||(n.style.background="rgba(0, 0, 255, 0.1)",n.style.border="1px solid rgba(0, 0, 255, 0.45)",n.style.display="none",n.style.pointerEvents="none"),n),i.HTMLNode.classList.add(i.DS.stores.SettingsStore.s.selectorClass),i.HTMLNode&&null!==(e=i.DS.SelectorArea)&&void 0!==e&&e.HTMLNode&&i.DS.SelectorArea.HTMLNode.appendChild(i.HTMLNode)})),n(this,"start",(function(t){if(!t.isDragging){var e=i.DS.stores.PointerStore.initialValArea;N(i.HTMLNode,_(e,1)),i.HTMLNode.style.display="block",i._rect=null}})),n(this,"stop",(function(){i.HTMLNode.style.width="0",i.HTMLNode.style.height="0",i.HTMLNode.style.display="none"})),n(this,"update",(function(t){if(!t.isDragging&&!i.DS.continue){var e=i.DS.stores,r=e.ScrollStore,n=e.PointerStore,s=function(t){var e=t.scrollAmount,r=t.initialPointerPos,n=t.pointerPos,i={};return n.x>r.x-e.x?(i.left=r.x-e.x,i.width=n.x-r.x+e.x):(i.left=n.x,i.width=r.x-n.x-e.x),n.y>r.y-e.y?(i.top=r.y-e.y,i.height=n.y-r.y+e.y):(i.top=n.y,i.height=r.y-n.y-e.y),i}({scrollAmount:r.scrollAmount,initialPointerPos:n.initialValArea,pointerPos:n.currentValArea});N(i.HTMLNode,s),i._rect=null}})),this.DS=s,this.DS.subscribe("Settings:updated:selectorClass",(function(t){var e=t.settings;i.HTMLNode.classList.remove(e["selectorClass:pre"]),i.HTMLNode.classList.add(e.selectorClass)})),this.DS.subscribe("Settings:updated:selector",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 r(e,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),e}(),F=function(){function e(r){var i,s=this,o=r.DS;t(this,e),n(this,"_scrollInterval",void 0),n(this,"_rect",void 0),n(this,"currentEdges",[]),n(this,"start",(function(){return s.applyElements("append")})),n(this,"applyElements",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"append",e=document.body?"body":"documentElement",r="".concat(t,"Child");s.HTMLNode[r](s.DS.Selector.HTMLNode),document[e][r](s.HTMLNode)})),n(this,"updatePos",(function(){s._rect=null;var t=s.DS.Area.rect,e=s.DS.Area.computedBorder,r=s.HTMLNode.style,n="".concat(t.top+e.top,"px"),i="".concat(t.left+e.left,"px"),o="".concat(t.width,"px"),a="".concat(t.height,"px");r.top!==n&&(r.top=n),r.left!==i&&(r.left=i),r.width!==o&&(r.width=o),r.height!==a&&(r.height=a)})),n(this,"stop",(function(t){s.stopAutoScroll(),t&&s.applyElements("remove")})),n(this,"startAutoScroll",(function(){s.currentEdges=[],s._scrollInterval=setInterval((function(){return s.handleAutoScroll()}),16)})),n(this,"handleAutoScroll",(function(){if(!s.DS.continue){var t=s.DS,e=t.stores.PointerStore,r=t.Area;s.currentEdges=P({elementRect:_(e.currentVal),containerRect:s.rect,tolerance:s.DS.stores.SettingsStore.s.overflowTolerance}),s.currentEdges.length&&r.scroll(s.currentEdges,s.DS.stores.SettingsStore.s.autoScrollSpeed)}})),n(this,"stopAutoScroll",(function(){s.currentEdges=[],clearInterval(s._scrollInterval)})),n(this,"isInside",(function(t,e){return!(!s.DS.Area.HTMLNode.contains(t)||!s.DS.stores.ScrollStore.canScroll)||C(s.rect,e||t.getBoundingClientRect())})),this.DS=o,this.HTMLNode=((i=document.createElement("div")).style.position="fixed",i.style.overflow="hidden",i.style.pointerEvents="none",i.style.zIndex="999999999999999999",i),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 r(e,[{key:"isClicked",value:function(t){var e=this.DS.stores.PointerStore,r=t?e.getPointerPosition(t):e.initialVal;return C({left:r.x,top:r.y,right:r.x,bottom:r.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),e}(),Z=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_currentValues",new Set),n(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),n(this,"init",(function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)})),n(this,"keydown",(function(t){var e=t.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:t,key:e}),i._currentValues.add(e),i.DS.publish("KeyStore:down",{event:t,key:e})})),n(this,"keyup",(function(t){var e=t.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:t,key:e}),i._currentValues.delete(e),i.DS.publish("KeyStore:up",{event:t,key:e})})),n(this,"stop",(function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()})),n(this,"reset",(function(){return i._currentValues.clear()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init)}return r(e,[{key:"isMultiSelectKeyPressed",value:function(t){var e=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var r=this.DS.stores.SettingsStore.s.multiSelectKeys.map((function(t){return t.toLocaleLowerCase()}));return!!this.currentValues.some((function(t){return r.includes(t.toLocaleLowerCase())}))||!(!t||!r.some((function(r){return t[e._keyMapping[r]]})))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),e}(),U=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_isMouseInteraction",!1),n(this,"_initialValArea",void 0),n(this,"_currentValArea",void 0),n(this,"_lastValArea",void 0),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_lastVal",void 0),n(this,"_lastTouch",void 0),n(this,"init",(function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})})),n(this,"getPointerPosition",(function(t){return function(t){var e=t.event;return{x:e.clientX,y:e.clientY}}({event:i._normalizedEvent(t)})})),n(this,"update",(function(t){t&&(i.DS.publish("PointerStore:updated:pre",{event:t}),i.currentVal=i.getPointerPosition(t),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:t}))})),n(this,"stop",(function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout((function(){return i._isMouseInteraction=!1}),100)})),n(this,"reset",(function(t){t&&(i.currentVal=i.lastVal=i.getPointerPosition(t),i.stop(),i.init())})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(t){var e=t.event;return i.start(e)})),this.DS.subscribe("Interaction:end",(function(t){var e=t.event;return i.reset(e)}))}return r(e,[{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&&m(t,"-",m(D(this.DS.Area.rect),"+",D(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&&m(t,"-",m(D(this.DS.Area.rect),"+",D(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&&m(t,"-",m(D(this.DS.Area.rect),"+",D(this.DS.Area.computedBorder)))}}]),e}(),X=function(){function e(r){var i=this,s=r.DS;t(this,e),n(this,"_initialVal",void 0),n(this,"_currentVal",void 0),n(this,"_canScroll",void 0),n(this,"init",(function(){return i.DS.stores.SettingsStore.s.area.addEventListener("scroll",i.update)})),n(this,"start",(function(){i._currentVal=i._initialVal=A(i.DS.stores.SettingsStore.s.area),i.DS.stores.SettingsStore.s.area.addEventListener("scroll",i.update)})),n(this,"update",(function(){return i._currentVal=A(i.DS.stores.SettingsStore.s.area)})),n(this,"stop",(function(){i.DS.stores.SettingsStore.s.area.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null})),n(this,"reset",(function(){i.stop(),i.start()})),this.DS=s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",(function(){return i.start()})),this.DS.subscribe("Interaction:end",(function(){return i.reset()}))}return r(e,[{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 HTMLDocument?t.body?t.body.scrollTop=1:t.documentElement.scrollTop=1:t.scrollTop=1)));var t,e}},{key:"scrollAmount",get:function(){var t,e=m(this.currentVal,"-",this.initialVal),r={x:t=this.DS.stores.SettingsStore.s.zoom,y:t},n=m(m(e,"*",r),"-",e);return{x:e.x+n.x,y:e.y+n.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}}]),e}(),Y=function e(r){var i=this,o=r.DS,a=r.settings;t(this,e),n(this,"_settings",{}),n(this,"s",{}),n(this,"update",(function(t){var e=t.settings,r=t.init;return i.DS.publish("Settings:updated:pre",s({settings:e},r?{init:r}:{}))})),n(this,"_update",(function(t){for(var e=function(t,e){return s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s(s({},T("area",t.area,e,document)),T("selectables",t.selectables,e,null)),T("autoScrollSpeed",t.autoScrollSpeed,e,5)),T("overflowTolerance",t.overflowTolerance,e,{x:25,y:25})),T("zoom",t.zoom,e,1)),T("customStyles",t.customStyles,e,!1)),T("multiSelectMode",t.multiSelectMode,e,!1)),T("multiSelectToggling",t.multiSelectToggling,e,!0)),T("multiSelectKeys",t.multiSelectKeys,e,["Control","Shift","Meta"])),T("selector",t.selector,e,null)),T("draggability",t.draggability,e,!0)),T("immediateDrag",t.immediateDrag,e,!0)),T("keyboardDrag",t.keyboardDrag,e,!0)),T("dragKeys",t.dragKeys,e,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),T("keyboardDragSpeed",t.keyboardDragSpeed,e,10)),T("useTransform",t.useTransform,e,!0)),T("hoverClass",t.hoverClass,e,"ds-hover")),T("selectableClass",t.selectableClass,e,"ds-selectable")),T("selectedClass",t.selectedClass,e,"ds-selected")),T("selectorClass",t.selectorClass,e,"ds-selector")),T("selectorAreaClass",t.selectorAreaClass,e,"ds-selector-area"))}(t.settings,t.init),r=function(){var t,e=g(a[o],2),r=e[0],s=e[1];r in i._settings||Object.defineProperty(i.s,r,{get:function(){return i._settings[r]},set:function(t){return i.update({settings:n({},r,t)})}}),i._settings["".concat(r,":pre")]=i._settings[r],i._settings[r]=s;var c={settings:(t={},n(t,r,i._settings[r]),n(t,"".concat(r,":pre"),i._settings["".concat(r,":pre")]),t)};i.DS.publish("Settings:updated",c),i.DS.publish("Settings:updated:".concat(r),c)},o=0,a=Object.entries(e);o<a.length;o++)r()})),this.DS=o,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})},G=function(){function e(r){var i=this;t(this,e),n(this,"continue",!1),n(this,"start",(function(){i.stopped=!1,i.Interaction.init()})),n(this,"break",(function(){return i.continue=!0})),n(this,"getSelection",(function(){return i.SelectedSet.elements})),n(this,"getSelectables",(function(){return i.SelectableSet.elements})),n(this,"getInitialCursorPosition",(function(){return i.stores.PointerStore.initialVal})),n(this,"getCurrentCursorPosition",(function(){return i.stores.PointerStore.currentVal})),n(this,"getPreviousCursorPosition",(function(){return i.stores.PointerStore.lastVal})),n(this,"getInitialCursorPositionArea",(function(){return i.stores.PointerStore.initialValArea})),n(this,"getCurrentCursorPositionArea",(function(){return i.stores.PointerStore.currentValArea})),n(this,"getPreviousCursorPositionArea",(function(){return i.stores.PointerStore.lastValArea})),n(this,"isMultiSelect",(function(t){return i.stores.KeyStore.isMultiSelectKeyPressed(t)})),n(this,"isDragging",(function(){return i.Interaction.isDragging})),n(this,"setSettings",(function(t){return i.stores.SettingsStore.update({settings:t})})),this.PubSub=new j({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new Y({DS:this,settings:r}),this.stores.PointerStore=new U({DS:this}),this.stores.ScrollStore=new X({DS:this}),this.stores.KeyStore=new Z({DS:this}),this.Area=new K({DS:this}),this.Selector=new W({DS:this}),this.SelectorArea=new F({DS:this}),this.SelectableSet=new R({DS:this}),this.SelectedSet=new z({DS:this}),this.Selection=new B({DS:this}),this.Drag=new O({DS:this}),this.Interaction=new H({DS:this}),function(t){for(var e=t.subscribe,r=t.publish,n=t.Interaction,i=t.SelectedSet,o=function(){var t=g(c[a],2),o=t[0],l=t[1];["pre",!1].forEach((function(t){return e(t?"".concat(o,":").concat(t):o,(function(e){return l.forEach((function(o){return(!o.condition||o.condition(e))&&r(t?"".concat(t).concat(o.name):o.name,s({items:i.elements,isDragging:n.isDragging},e))}))}))}))},a=0,c=Object.entries({"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"}]});a<c.length;a++)o()}({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",(function(){return i.continue=!1})),this.start()}return r(e,[{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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.addAll(M(t)),r||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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.SelectedSet.deleteAll(M(t)),r&&this.removeSelectables(t),e&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return M(t).forEach((function(i){return e.SelectedSet.has(i)?e.removeSelection(t,r,n):e.addSelection(t,r,n)})),r&&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],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.clearSelection(),this.addSelection(t,e,r),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){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=M(t);return this.SelectableSet.addAll(r),e&&this.SelectedSet.addAll(r),t}},{key:"setSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=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,r)}},{key:"removeSelectables",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.SelectableSet.deleteAll(M(t)),e&&this.removeSelection(t),t}}]),e}();return G}));

@@ -1,3 +0,3 @@

declare function _default(selectorAreaClass: string): HTMLDivElement;
declare function _default(): HTMLDivElement;
export default _default;
import "../types"
declare function _default({ elementRect, containerRect, tolerance, }: {
elementRect: DSBoundingRect;
containerRect: DSBoundingRect;
tolerance: Vect2;
tolerance?: Vect2;
}): DSEdges;
export default _default;
import "../types"

@@ -19,2 +19,3 @@ export * as vect2 from "./vect2";

export { default as handleUnSelection } from "./handleUnSelection";
export { default as hydrateSettings } from "./hydrateSettings";
export { default as isCollision } from "./isCollision";

@@ -21,0 +22,0 @@ export { default as moveElement } from "./moveElement";

@@ -1,15 +0,16 @@

/**
* @typedef {Object} AreaProps
* @property {DSArea} area
* @property {PubSub} PS
* @property {number} zoom
*/
export default class Area {
/**
* @constructor Area
* @param {AreaProps} settings
* @param {{DS:DragSelect}} p
* @ignore
*/
constructor({ area, PS, zoom }: AreaProps);
constructor({ DS }: {
DS: DragSelect;
});
/**
* @type {DragSelect}
* @private
*/
private DS;
/**
* @type {DSModificationCallback}

@@ -54,3 +55,2 @@ * @private

private _rect;
PubSub: PubSub;
/** @param {DSArea} area */

@@ -90,8 +90,3 @@ setArea: (area: DSArea) => void;

}
export type AreaProps = {
area: DSArea;
PS: PubSub;
zoom: number;
};
import { PubSub } from "./index.js";
import DragSelect from "../DragSelect";
import "../types"
export default class Drag {
/**
* @param {Object} p
* @param {DragSelect} p.DS
* @param {boolean} p.draggability
* @param {boolean} p.useTransform
* @param {DSDragKeys} p.dragKeys
* @param {boolean} p.keyboardDrag
* @param {number} p.keyboardDragSpeed
* @param {number} p.zoom
* @constructor Drag
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({ DS, dragKeys, draggability, keyboardDrag, keyboardDragSpeed, useTransform, zoom, }: {
constructor({ DS }: {
DS: DragSelect;
draggability: boolean;
useTransform: boolean;
dragKeys: DSDragKeys;
keyboardDrag: boolean;
keyboardDragSpeed: number;
zoom: number;
});
/**
* @type {boolean}
* @private
*/
private _useTransform;
/**
* @type {Vect2}

@@ -43,7 +26,2 @@ * @private

/**
* @type {boolean}
* @private
*/
private _draggability;
/**
* @type {DSDragKeys}

@@ -58,18 +36,4 @@ * @private

private _dragKeysFlat;
/**
* @type {boolean}
* @private
*/
private _keyboardDrag;
/**
* @type {number}
* @private
*/
private _keyboardDragSpeed;
/**
* @type {number}
* @private
*/
private _zoom;
DS: DragSelect;
assignDragkeys: () => void;
keyboardDrag: ({ event, key }: {

@@ -76,0 +40,0 @@ event: any;

export default class Interaction {
/**
* @constructor Interaction
* @param {Object} obj
* @param {DragSelect} obj.DS
* @param {DSArea} obj.areaElement
* @param {boolean} obj.draggability
* @param {boolean} obj.immediateDrag
* @param {string} obj.selectableClass
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({ DS, areaElement, draggability, immediateDrag, selectableClass, }: {
constructor({ DS }: {
DS: DragSelect;
areaElement: DSArea;
draggability: boolean;
immediateDrag: boolean;
selectableClass: string;
});
/**
* @type {DSArea}
* @private
* */
private _areaElement;
/**
* @type {boolean}
* @private
* */
private _draggability;
/**
* @type {boolean}
* @private
* */
private _immediateDrag;
/**
* @type {string}
* @private
* */
private _selectableClass;
/** @type {boolean} */

@@ -40,0 +11,0 @@ isInteracting: boolean;

export default class SelectableSet extends Set<any> {
/**
* @constructor SelectableSet
* @param {Object} p
* @param {DSInputElements} p.elements
* @param {DragSelect} p.DS
* @param {string} p.className
* @param {string} p.hoverClassName
* @param {boolean} p.useTransform
* @param {boolean} p.draggability
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({ elements, className, hoverClassName, draggability, useTransform, DS, }: {
elements: DSInputElements;
constructor({ DS }: {
DS: DragSelect;
className: string;
hoverClassName: string;
useTransform: boolean;
draggability: boolean;
});
/**
* @type {DSElements}
* @private
* */
private _initElements;
/**
* @type {string}
* @private
* */
private _className;
/**
* @type {string}
* @private
* */
private _hoverClassName;
/**
* @type {boolean}
* @private
* */
private _useTransform;
/**
* @type {boolean}
* @private
* */
private _draggability;
DS: DragSelect;
init: () => void;
/** @param {DSElement} element */
add(element: DSElement): SelectableSet;
/** @param {DSElement} element */
delete(element: DSElement): boolean;
_onClick: (event: any) => void;

@@ -49,0 +17,0 @@ _onPointer: (event: any) => void;

export default class SelectedSet extends Set<any> {
/**
* @constructor SelectableSet
* @param {Object} p
* @param {DragSelect} p.DS
* @param {string} p.className
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({ className, DS }: {
constructor({ DS }: {
DS: DragSelect;
className: string;
});
/**
* @type {string}
* @private
* */
private _className;
DS: DragSelect;
/** @param {DSElement} element */
add(element: DSElement): SelectedSet;
/** @param {DSElement} element */
delete(element: DSElement): boolean;
/**

@@ -20,0 +16,0 @@ * Adds/Removes an element. If it is already selected = remove, if not = add.

export default class Selection {
/**
* @constructor Selection
* @param {{ DS:DragSelect, hoverClassName:string, multiSelectToggling:boolean }} p
* @param {{ DS:DragSelect }} p
* @ignore
*/
constructor({ DS, hoverClassName, multiSelectToggling }: {
constructor({ DS }: {
DS: DragSelect;
hoverClassName: string;
multiSelectToggling: boolean;
});

@@ -17,12 +15,2 @@ /**

private _prevSelectedSet;
/**
* @type {string}
* @private
* */
private _hoverClassName;
/**
* @type {boolean}
* @private
* */
private _multiSelectToggling;
DS: DragSelect;

@@ -29,0 +17,0 @@ /**

export default class Selector {
/**
* @constructor Selector
* @param {Object} p
* @param {DragSelect} p.DS
* @param {HTMLElement} p.selector
* @param {string} p.selectorClass
* @param {boolean} p.customStyles
* @param {{ DS:DragSelect }} p
* @ignore
*/
constructor({ DS, selector, selectorClass, customStyles }: {
constructor({ DS }: {
DS: DragSelect;
selector: HTMLElement;
selectorClass: string;
customStyles: boolean;
});

@@ -23,2 +16,3 @@ /**

DS: DragSelect;
attachSelector: () => void;
HTMLNode: HTMLElement;

@@ -33,5 +27,5 @@ start: ({ isDragging }: {

}) => void;
get rect(): DSBoundingRect;
get rect(): DOMRect | DSBoundingRect;
}
import DragSelect from "../DragSelect.js";
import DragSelect from "../DragSelect";
import "../types"

@@ -5,17 +5,9 @@ export default class SelectorArea {

* @constructor SelectorArea
* @param {{ DS:DragSelect, selectorAreaClass:string, autoScrollSpeed:number, overflowTolerance:Vect2}} obj
* @param {{ DS:DragSelect }} obj
* @ignore
*/
constructor({ DS, selectorAreaClass, autoScrollSpeed, overflowTolerance }: {
constructor({ DS }: {
DS: DragSelect;
selectorAreaClass: string;
autoScrollSpeed: number;
overflowTolerance: Vect2;
});
/**
* @type {number}
* @private
* */
private _autoScrollSpeed;
/**
* @type {*}

@@ -35,7 +27,2 @@ * @private

private currentEdges;
/**
* @type {Vect2}
* @private
*/
private _overflowTolerance;
DS: DragSelect;

@@ -70,5 +57,5 @@ HTMLNode: HTMLDivElement;

isClicked(event?: DSEvent): boolean;
get rect(): DSBoundingRect;
get rect(): DOMRect | DSBoundingRect;
}
import DragSelect from "../DragSelect.js";
import DragSelect from "../DragSelect";
import "../types"
export { default as KeyStore } from "./KeyStore";
export { default as PointerStore } from "./PointerStore";
export { default as ScrollStore } from "./ScrollStore";
export { default as SettingsStore } from "./SettingsStore";
import "../types"

@@ -5,21 +5,9 @@ export default class KeyStore {

* @constructor KeyStore
* @param {{DS:DragSelect,multiSelectKeys:DSMultiSelectKeys,multiSelectMode:boolean}} p
* @param {{DS:DragSelect}} p
* @ignore
*/
constructor({ DS, multiSelectKeys, multiSelectMode }: {
constructor({ DS }: {
DS: DragSelect;
multiSelectKeys: DSMultiSelectKeys;
multiSelectMode: boolean;
});
/**
* @type {boolean}
* @private
* */
private _multiSelectMode;
/**
* @type {DSMultiSelectKeys}
* @private
* */
private _multiSelectKeys;
/**
* @type {Set<string>}

@@ -26,0 +14,0 @@ * @private

@@ -5,9 +5,7 @@ export default class ScrollStore {

* @constructor ScrollStore
* @param {{ DS:DragSelect, areaElement: DSArea, zoom:number }} p
* @param {{ DS:DragSelect }} p
* @ignore
*/
constructor({ DS, areaElement, zoom }: {
constructor({ DS }: {
DS: DragSelect;
areaElement: DSArea;
zoom: number;
});

@@ -23,6 +21,2 @@ /**

/**
* @type {DSArea}
* @private */
private _areaElement;
/**
* @type {boolean}

@@ -32,3 +26,2 @@ * @private */

DS: DragSelect;
zoom: number;
init: () => void;

@@ -35,0 +28,0 @@ start: () => void;

@@ -89,26 +89,2 @@ /**

selectorAreaClass?: string;
/**
* Deprecated: please use DragSelect.subscribe('callback', callback) instead
*/
callback?: DSCallback;
/**
* Deprecated: please use DragSelect.subscribe('onDragMove', onDragMove) instead
*/
onDragMove?: DSCallback;
/**
* Deprecated: please use DragSelect.subscribe('onDragStartBegin', onDragStartBegin) instead
*/
onDragStartBegin?: DSCallback;
/**
* Deprecated: please use DragSelect.subscribe('onDragStart', onDragStart) instead
*/
onDragStart?: DSCallback;
/**
* Deprecated: please use DragSelect.subscribe('onElementSelect', onElementSelect) instead
*/
onElementSelect?: DSCallback;
/**
* Deprecated: please use DragSelect.subscribe('onElementUnselect', onElementUnselect) instead
*/
onElementUnselect?: DSCallback;
};

@@ -143,2 +119,6 @@ /**

key?: string;
/**
* the settings being updates/manipulated/passed, also holds the previous value. i.e. updating selectorClass will publish { settings: { selectorClass: 'newVal', 'selectorClass:pre': 'oldVal' } }
*/
settings?: Settings;
scroll_directions?: Array<'top' | 'bottom' | 'left' | 'right' | undefined>;

@@ -160,3 +140,3 @@ scroll_multiplier?: number;

};
type DSEdges = ("left" | "right" | "bottom" | "top")[];
type DSEdges = Array<'top' | 'bottom' | 'left' | 'right' | undefined>;
/**

@@ -173,7 +153,7 @@ * area within which you can drag

*/
type DSInputElements = HTMLElement | SVGElement | (HTMLElement | SVGElement)[];
type DSInputElements = Array<HTMLElement | SVGElement> | HTMLElement | SVGElement;
/**
* the elements that can be selected
*/
type DSElements = (HTMLElement | SVGElement)[];
type DSElements = Array<HTMLElement | SVGElement>;
/**

@@ -190,10 +170,11 @@ * a single element that can be selected

*/
type DSMultiSelectKeys = string[];
type DSEventNames = "dragstart" | "dragmove" | "autoscroll" | "elementselect" | "elementunselect" | "callback";
type DSInternalEventNames = "Interaction:init" | "Interaction:start" | "Interaction:end" | "Interaction:update" | "Area:modified" | "Area:scroll" | "PointerStore:updated" | "Selected:added" | "Selected:removed" | "Selectable:click" | "Selectable:pointer" | "KeyStore:down" | "KeyStore:up";
type DSInternalEventNamesPre = "Interaction:init:pre" | "Interaction:start:pre" | "Interaction:end:pre" | "Interaction:update:pre" | "Area:modified:pre" | "Area:scroll:pre" | "PointerStore:updated:pre" | "Selected:added:pre" | "Selected:removed:pre" | "Selectable:click:pre" | "Selectable:pointer:pre" | "KeyStore:down:pre" | "KeyStore:up:pre";
type DSMultiSelectKeys = Array<'Shift' | 'Control' | 'Meta' | string>;
type DSEventNames = 'dragmove' | 'autoscroll' | 'dragstart' | 'elementselect' | 'elementunselect' | 'callback';
type DSInternalEventNames = 'Interaction:init' | 'Interaction:start' | 'Interaction:end' | 'Interaction:update' | 'Area:modified' | 'Area:scroll' | 'PointerStore:updated' | 'Selected:added' | 'Selected:removed' | 'Selectable:click' | 'Selectable:pointer' | 'KeyStore:down' | 'KeyStore:up';
type DSInternalEventNamesPre = 'Interaction:init:pre' | 'Interaction:start:pre' | 'Interaction:end:pre' | 'Interaction:update:pre' | 'Area:modified:pre' | 'Area:scroll:pre' | 'PointerStore:updated:pre' | 'Selected:added:pre' | 'Selected:removed:pre' | 'Selectable:click:pre' | 'Selectable:pointer:pre' | 'KeyStore:down:pre' | 'KeyStore:up:pre';
type DSInternalSettingEvents = 'Settings:updated' | 'Settings:updated:pre' | 'Settings:updated:*' | 'Settings:updated:*:pre';
/**
* the name of the callback
*/
type DSCallbackNames = "dragstart" | "dragmove" | "autoscroll" | "elementselect" | "elementunselect" | "callback" | "Interaction:init" | "Interaction:start" | "Interaction:end" | "Interaction:update" | "Area:modified" | "Area:scroll" | "PointerStore:updated" | "Selected:added" | "Selected:removed" | "Selectable:click" | "Selectable:pointer" | "KeyStore:down" | "KeyStore:up" | "Interaction:init:pre" | "Interaction:start:pre" | "Interaction:end:pre" | "Interaction:update:pre" | "Area:modified:pre" | "Area:scroll:pre" | "PointerStore:updated:pre" | "Selected:added:pre" | "Selected:removed:pre" | "Selectable:click:pre" | "Selectable:pointer:pre" | "KeyStore:down:pre" | "KeyStore:up:pre";
type DSCallbackNames = DSEventNames | DSInternalEventNames | DSInternalEventNamesPre | DSInternalSettingEvents;
type DSBoundingRect = {

@@ -200,0 +181,0 @@ top: number;

{
"name": "dragselect",
"version": "2.3.1",
"version": "2.4.0",
"description": "easy javascript drag select functionality for your projects",

@@ -64,3 +64,3 @@ "main": "./dist/DragSelect.js",

"jest-puppeteer": "^4.4.0",
"jsdoc": "^3.6.6",
"jsdoc": "^3.6.11",
"minami": "^1.2.3",

@@ -71,3 +71,3 @@ "prettier": "^2.2.1",

"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.1.3"
"typescript": "^4.8.0"
},

@@ -74,0 +74,0 @@ "repository": {

@@ -12,3 +12,3 @@ ```

[![Build Status](https://travis-ci.com/ThibaultJanBeyer/DragSelect.svg?branch=master)](https://travis-ci.com/ThibaultJanBeyer/DragSelect) ![gzip size](https://img.badgesize.io/https://dragselect.com/v2/ds.min.js?compression=gzip) ![npm downloads count](https://img.shields.io/npm/dt/dragselect.svg) [![No Dependency](https://david-dm.org/ThibaultJanBeyer/DragSelect.svg)](https://david-dm.org/ThibaultJanBeyer/DragSelect)
[![Build Status](https://travis-ci.com/ThibaultJanBeyer/DragSelect.svg?branch=master)](https://travis-ci.com/ThibaultJanBeyer/DragSelect) ![gzip size](https://img.badgesize.io/https://dragselect.com/v2/ds.min.js?compression=gzip) ![npm downloads count](https://img.shields.io/npm/dt/dragselect.svg) [![No Dependency](https://img.shields.io/badge/dependencies-none-informational)](https://github.com/ThibaultJanBeyer/DragSelect/blob/master/package.json) [![Contributors Welcome](https://img.shields.io/badge/contributors-welcome-blueviolet)](https://github.com/ThibaultJanBeyer/DragSelect/blob/master/CONTRIBUTING.md) [![Sponsors Welcome](https://img.shields.io/badge/sponsors-welcome-blueviolet)](https://github.com/sponsors/ThibaultJanBeyer)

@@ -29,6 +29,7 @@ # DragSelect ![GitHub package.json version](https://img.shields.io/github/package-json/v/ThibaultJanBeyer/DragSelect.svg)

- - [Extended](#extended)
- - [Mobile/Touch usage](#mobile/touch-usage)
- - [Mobile Touch usage](#mobiletouch-usage)
- - [Accessibility (a11y)](#accessibility-a11y)
- - [Use your own Drag And Drop](#use-your-own-drag-and-drop)
- [Constructor Properties](#constructor-properties)
- [Constructor Properties (Settings)](#constructor-properties-settings)
- - [Post initialization setting updates](#post-initialization-setting-updates)
- [Event Callbacks](#event-callbacks)

@@ -45,3 +46,3 @@ - - [Callback Object Keys](#callback-object-keys)

- **No dependencies** [![No Dependency](https://david-dm.org/ThibaultJanBeyer/DragSelect.svg)](https://david-dm.org/ThibaultJanBeyer/DragSelect)
- **No dependencies** [![No Dependency](https://img.shields.io/badge/dependencies-none-informational)](https://github.com/ThibaultJanBeyer/DragSelect/blob/master/package.json)
- Hyper customizable

@@ -74,13 +75,20 @@ - Replicates operating system drag-selection in the browser

Please donate to support the countless hours of hard work & support. Especially if your company makes money. Thank you :)
Please donate to support the countless hours of hard work & support. Especially if your company makes money, then there is no excuse. Thank you :)
Thanks to:
If you're too poor or broke you can still support us with your time instead by [contributing to the code](https://github.com/ThibaultJanBeyer/DragSelect/blob/master/CONTRIBUTING.md)!
## Thanks to:
| ![BrowserStack](https://dragselect.com/media/browserstack.jpg) | [You?](https://github.com/sponsors/ThibaultJanBeyer) |
|--- |--- |
|[BrowserStack](https://www.browserstack.com/) is an amazing testing service which helps testing the tool on various browsers. They support this open source projects by providing a [free account for open source projects](https://www.browserstack.com/open-source) to use their service! | Thank and support us by making a [Direct Donation to DragSelect](https://paypal.me/pools/c/8gF2a5szCP) (Donations are distributed with all project contributors proportionally. We are grateful for any amount) or sponsor me via [GitHub Sponsors](https://github.com/sponsors/ThibaultJanBeyer) or [Get in touch](mailto:thibault.beyer@gmail.com). We can display your logo here if you want, which will help you recruit great talent and boost your SEO. |
BTC: [1LdweSpjgSeJC8XxX3swrohBMBLUzg6cmC](https://www.blockchain.com/btc/address/1LdweSpjgSeJC8XxX3swrohBMBLUzg6cmC) |
Paypal: [https://paypal.me/pools/c/8gF2a5szCP](https://paypal.me/pools/c/8gF2a5szCP) |
Other: [get in touch](mailto:thibault.beyer@gmail.com) |
|[BrowserStack](https://www.browserstack.com/) is a testing service which helps testing the tool on various browsers. They support this open source projects by providing us with a [free account](https://www.browserstack.com/open-source)! | Thank and support us by making a [Direct Donation to DragSelect](https://www.blockchain.com/btc/address/1LdweSpjgSeJC8XxX3swrohBMBLUzg6cmC) (via Bitcoin: `1LdweSpjgSeJC8XxX3swrohBMBLUzg6cmC`). Or sponsor via [GitHub Sponsors](https://github.com/sponsors/ThibaultJanBeyer) or [Get in touch](mailto:thibault.beyer@gmail.com). |
| Via BTC: | [1LdweSpjgSeJC8XxX3swrohBMBLUzg6cmC](https://www.blockchain.com/btc/address/1LdweSpjgSeJC8XxX3swrohBMBLUzg6cmC) (direct) |
| Via GitHub: | [GitHub Sponsors](https://github.com/sponsors/ThibaultJanBeyer) (monthly & one-time) |
| Other: | [get in touch](mailto:thibault.beyer@gmail.com) |
All donations are distributed with all project contributors proportionally to their involvement. We are grateful for any amount:
We have more than ![npm downloads count](https://img.shields.io/npm/dt/dragselect.svg), imagine how much we'd have if everyone would have had donated only 1$ 🤩 (unfortunately this did not happen)
If you donate, we can display your logo here if you want, which will give you fame, fortune and help you recruit great talent and boosting your SEO.
# Installation

@@ -153,5 +161,10 @@ ## NPM

```javascript
// if you add the function to a variable like this, you have access to all its functions
const ds = new DragSelect({
// node/nodes that can be selected.
// This is also optional, you could just add them later with .addSelectables().
// all settings are optional and can be added later
});
// this is how you add/update settings after initialization
ds.setSettings({
// node/nodes that can be selected. By default will never add elements twice:
selectables: document.querySelectorAll('.selectable-nodes'),

@@ -161,15 +174,8 @@ // area in which you can drag. If not provided it will be the whole document & body/documentElement.

// and many more, see "properties" section in the docs
});
})
// if you add the function to a variable like we did, you have access to all its functions:
// fired once the user releases the mouse. (items) = selected nodes:
ds.subscribe('callback', ({ items, event }) => {})
// returns all currently selected nodes:
ds.getSelection();
// adds elements that can be selected. Won't add elements twice:
ds.addSelectables(document.getElementsByClassName('selectable-node'));
// Teardown/stop the whole functionality:

@@ -262,6 +268,10 @@ ds.stop();

# Constructor Properties:
# Constructor Properties (Settings):
*DragSelect is hyper customizable*. Note, all properties are optional. See **[the docs](https://dragselect.com/DragSelect.html)** for more info. Here is the full list:
*DragSelect is hyper customizable*. Note, all properties are optional. See **[the docs](https://dragselect.com/DragSelect.html)** for more info.
Moreover any setting can also be updated or added after the initialization, see [post-initialization setting updates](#post-initialization-setting-updates).
Here is the full list:
| property | type | usage | default |

@@ -290,2 +300,14 @@ |--- |--- |--- |--- |

## Post-Initialization Setting-Updates
Any setting can be updated/added after initialization by using the `setSettings` method. Here is an example updating the `area` and the `selectables`:
```JavaScript
const ds = new DragSelect({})
ds.setSettings({
selectables: document.getElementsByClassName('selectable-nodes'),
area: document.getElementById('area')
})
```
# Event Callbacks

@@ -370,3 +392,3 @@

So don’t forget to give this repository a star if you find it useful.
Star this repo, tell all your friends and start contributing and/or [donating 1$](https://paypal.me/pools/c/8gF2a5szCP) to keep it running. Thank you :)
Star this repo, tell all your friends and start contributing and/or [donating 1$](https://github.com/sponsors/ThibaultJanBeyer) to keep it running. Thank you :)

@@ -373,0 +395,0 @@ [![Typewriter Gif](https://dragselect.com/media/typewriter.gif)](https://thibaultjanbeyer.com/)

@@ -57,3 +57,3 @@ // @ts-check

} from './modules'
import { PointerStore, ScrollStore, KeyStore } from './stores'
import { PointerStore, ScrollStore, KeyStore, SettingsStore } from './stores'
import { toArray, vect2, subscriberAliases } from './methods'

@@ -75,31 +75,3 @@

*/
constructor({
area = document,
selectables = [],
autoScrollSpeed = 5,
overflowTolerance = { x: 25, y: 25 },
zoom = 1,
customStyles = false,
multiSelectMode = false,
multiSelectToggling = true,
multiSelectKeys = ['Control', 'Shift', 'Meta'],
selector = undefined,
draggability = true,
immediateDrag = true,
keyboardDrag = true,
dragKeys,
keyboardDragSpeed = 10,
useTransform = true,
hoverClass = 'ds-hover',
selectableClass = 'ds-selectable',
selectedClass = 'ds-selected',
selectorClass = 'ds-selector',
selectorAreaClass = 'ds-selector-area',
callback,
onDragMove,
onDragStartBegin,
onDragStart,
onElementSelect,
onElementUnselect,
}) {
constructor(settings) {
this.PubSub = new PubSub({ DS: this })

@@ -109,79 +81,21 @@ this.subscribe = this.PubSub.subscribe

this.publish = this.PubSub.publish
this._callbacksTemp({
callback,
onDragMove,
onDragStart,
onDragStartBegin,
onElementSelect,
onElementUnselect,
})
this.stores = {
PointerStore: new PointerStore({ DS: this }),
ScrollStore: new ScrollStore({ DS: this, areaElement: area, zoom }),
KeyStore: new KeyStore({ DS: this, multiSelectKeys, multiSelectMode }),
}
this.stores = /** @type {{ SettingsStore:SettingsStore, PointerStore:PointerStore, ScrollStore:ScrollStore, KeyStore:KeyStore }} */ ({})
this.stores.SettingsStore = new SettingsStore({ DS: this, settings })
this.stores.PointerStore = new PointerStore({ DS: this })
this.stores.ScrollStore = new ScrollStore({ DS: this })
this.stores.KeyStore = new KeyStore({ DS: this })
this.Area = new Area({ area, PS: this.PubSub, zoom })
this.Area = new Area({ DS: this })
this.Selector = new Selector({ DS: this })
this.SelectorArea = new SelectorArea({ DS: this })
this.Selector = new Selector({
DS: this,
selector,
selectorClass,
customStyles,
})
this.SelectableSet = new SelectableSet({ DS: this })
this.SelectedSet = new SelectedSet({ DS: this })
this.Selection = new Selection({ DS: this })
this.SelectorArea = new SelectorArea({
DS: this,
selectorAreaClass,
autoScrollSpeed,
overflowTolerance,
})
this.Drag = new Drag({ DS: this })
this.SelectableSet = new SelectableSet({
elements: selectables,
DS: this,
className: selectableClass,
hoverClassName: hoverClass,
useTransform,
draggability,
})
this.Interaction = new Interaction({ DS: this })
this.SelectedSet = new SelectedSet({
DS: this,
className: selectedClass,
})
this.Selection = new Selection({
DS: this,
hoverClassName: hoverClass,
multiSelectToggling,
})
this.Drag = new Drag({
DS: this,
draggability,
useTransform,
keyboardDrag,
dragKeys: Object.assign(
{
up: ['ArrowUp'],
down: ['ArrowDown'],
left: ['ArrowLeft'],
right: ['ArrowRight'],
},
dragKeys
),
zoom,
keyboardDragSpeed,
})
this.Interaction = new Interaction({
areaElement: area,
DS: this,
draggability,
immediateDrag,
selectableClass,
})
// Subscriber Aliases

@@ -200,50 +114,2 @@ subscriberAliases({

// @TODO: remove after deprecation
_callbacksTemp({
callback,
onDragMove,
onDragStart,
onDragStartBegin,
onElementSelect,
onElementUnselect,
}) {
const warnMessage = (name, newName) =>
console.warn(
`[DragSelect] ${name} is deprecated. Use DragSelect.subscribe("${newName}", (callbackObject) => {}) instead. Act Now! See docs for more info`
)
if (callback) {
warnMessage('callback', 'callback')
this.subscribe('callback', ({ items, item, event }) =>
callback(items, event)
)
}
if (onDragMove) {
warnMessage('onDragMove', 'dragmove')
this.subscribe('dragmove', ({ items, item, event }) => onDragMove(event))
}
if (onDragStart) {
warnMessage('onDragStart', 'dragstart')
this.subscribe('dragstart', ({ items, item, event }) =>
onDragStart(event)
)
}
if (onDragStartBegin) {
warnMessage('onDragStartBegin', 'dragstart')
this.subscribe('dragstart', ({ items, item, event }) =>
onDragStartBegin(event)
)
}
if (onElementSelect) {
warnMessage('onElementSelect', 'elementselect')
this.subscribe('elementselect', ({ items, item, event }) =>
onElementSelect(item, event)
)
}
if (onElementUnselect) {
warnMessage('onElementUnselect', 'elementunselect')
this.subscribe('elementunselect', ({ items, item, event }) =>
onElementUnselect(item, event)
)
}
}
// Useful methods for the user

@@ -410,2 +276,3 @@ //////////////////////////////////////////////////////////////////////////////////////

) {
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(elements, removeFromSelection)

@@ -444,28 +311,2 @@ return this.addSelectables(elements, addToSelection)

/**
* Utility method that returns the cursor position difference between start and now
* @param {boolean} [usePreviousCursorDifference] if true, it will output the cursor position difference between the previous selection and now
* @param {boolean} [useAreaPositions] if true, it will use cursor positions relative to the area
* @return {Vect2}
* @deprecated
*/
getCursorPositionDifference(
usePreviousCursorDifference = false,
useAreaPositions = false
) {
console.warn(
'[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`'
)
const posA = useAreaPositions
? this.getCurrentCursorPositionArea()
: this.getCurrentCursorPosition()
const posB = usePreviousCursorDifference
? useAreaPositions
? this.getPreviousCursorPositionArea()
: this.getPreviousCursorPosition()
: useAreaPositions
? this.getInitialCursorPositionArea()
: this.getInitialCursorPosition()
return vect2.calc(posA, '-', posB)
}
/**
* Whether the user is currently drag n dropping elements (instead of selection)

@@ -475,4 +316,10 @@ * @return {boolean}

isDragging = () => this.Interaction.isDragging
/**
* Update any setting dynamically
* @param {Settings} settings
* @return {void}
*/
setSettings = (settings) => this.stores.SettingsStore.update({ settings })
}
export default DragSelect

@@ -6,6 +6,5 @@ // @ts-check

* Creates the SelectorArea
* @param {string} selectorAreaClass
* @return {HTMLDivElement}
*/
export default (selectorAreaClass) => {
export default () => {
const node = document.createElement('div')

@@ -16,4 +15,3 @@ node.style.position = 'fixed'

node.style.zIndex = '999999999999999999'
node.classList.add(selectorAreaClass)
return node
}

@@ -19,2 +19,3 @@ export * as vect2 from './vect2'

export { default as handleUnSelection } from './handleUnSelection'
export { default as hydrateSettings } from './hydrateSettings'
export { default as isCollision } from './isCollision'

@@ -21,0 +22,0 @@ export { default as moveElement } from './moveElement'

// @ts-check
import '../types.js'
import DragSelect from '../DragSelect'
import { PubSub } from './'
import {

@@ -14,11 +14,9 @@ addModificationObservers,

/**
* @typedef {Object} AreaProps
* @property {DSArea} area
* @property {PubSub} PS
* @property {number} zoom
*/
export default class Area {
/**
* @type {DragSelect}
* @private
*/
DS
/**
* @type {DSModificationCallback}

@@ -66,14 +64,18 @@ * @private

* @constructor Area
* @param {AreaProps} settings
* @param {{DS:DragSelect}} p
* @ignore
*/
constructor({ area, PS, zoom }) {
this._zoom = zoom
this.PubSub = PS
this.setArea(area)
constructor({ DS }) {
this.DS = DS
this.setArea(this.DS.stores.SettingsStore.s.area)
// @ts-ignore: @todo: update to typescript
this.DS.PubSub.subscribe('Settings:updated:area', ({ settings }) =>
this.setArea(settings.area)
)
this._modificationCallback = debounce((event) => {
this.PubSub.publish('Area:modified:pre', { event, item: this })
this.DS.PubSub.publish('Area:modified:pre', { event, item: this })
this.reset()
this.PubSub.publish('Area:modified', { event, item: this })
this.DS.PubSub.publish('Area:modified', { event, item: this })
}, 60)

@@ -84,4 +86,4 @@ this._modificationObserver = new MutationObserver(

this.PubSub.subscribe('Interaction:init', this.start)
this.PubSub.subscribe('Interaction:end', this.reset)
this.DS.PubSub.subscribe('Interaction:init', this.start)
this.DS.PubSub.subscribe('Interaction:end', this.reset)
}

@@ -99,5 +101,5 @@

setTimeout(() => {
this.PubSub.publish('Area:modified:pre', { item: this })
this.DS.PubSub.publish('Area:modified:pre', { item: this })
this.reset()
this.PubSub.publish('Area:modified', { item: this })
this.DS.PubSub.publish('Area:modified', { item: this })
})

@@ -142,5 +144,5 @@ }

}
this.PubSub.publish('Area:scroll:pre', data)
this.DS.PubSub.publish('Area:scroll:pre', data)
scrollElement(this._node, directions, multiplier)
this.PubSub.publish('Area:scroll', data)
this.DS.PubSub.publish('Area:scroll', data)
}

@@ -188,3 +190,3 @@

if (this._rect) return this._rect
return (this._rect = getAreaRect(this.HTMLNode, this._zoom))
return (this._rect = getAreaRect(this.HTMLNode, this.DS.stores.SettingsStore.s.zoom))
}

@@ -191,0 +193,0 @@

@@ -9,7 +9,2 @@ // @ts-check

/**
* @type {boolean}
* @private
*/
_useTransform
/**
* @type {Vect2}

@@ -30,7 +25,2 @@ * @private

/**
* @type {boolean}
* @private
*/
_draggability
/**
* @type {DSDragKeys}

@@ -44,51 +34,28 @@ * @private

*/
_dragKeysFlat
/**
* @type {boolean}
* @private
*/
_keyboardDrag
/**
* @type {number}
* @private
*/
_keyboardDragSpeed
/**
* @type {number}
* @private
*/
_zoom
_dragKeysFlat = []
/**
* @param {Object} p
* @param {DragSelect} p.DS
* @param {boolean} p.draggability
* @param {boolean} p.useTransform
* @param {DSDragKeys} p.dragKeys
* @param {boolean} p.keyboardDrag
* @param {number} p.keyboardDragSpeed
* @param {number} p.zoom
* @constructor Drag
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({
DS,
dragKeys,
draggability,
keyboardDrag,
keyboardDragSpeed,
useTransform,
zoom,
}) {
constructor({ DS }) {
this.DS = DS
this._useTransform = useTransform
this._keyboardDragSpeed = keyboardDragSpeed
this._keyboardDrag = keyboardDrag
this._zoom = zoom
this._draggability = draggability
// @ts-ignore: @todo: update to typescript
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)
}
assignDragkeys = () => {
this._dragKeys = {
up: dragKeys.up.map((k) => k.toLowerCase()),
down: dragKeys.down.map((k) => k.toLowerCase()),
left: dragKeys.left.map((k) => k.toLowerCase()),
right: dragKeys.right.map((k) => k.toLowerCase()),
up: this.DS.stores.SettingsStore.s.dragKeys.up.map((k) => k.toLowerCase()),
down: this.DS.stores.SettingsStore.s.dragKeys.down.map((k) => k.toLowerCase()),
left: this.DS.stores.SettingsStore.s.dragKeys.left.map((k) => k.toLowerCase()),
right: this.DS.stores.SettingsStore.s.dragKeys.right.map((k) => k.toLowerCase()),
}

@@ -101,16 +68,11 @@ this._dragKeysFlat = [

]
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)
}
keyboardDrag = ({ event, key }) => {
const _key = key.toLowerCase()
if (
!this._keyboardDrag ||
!this._dragKeysFlat.includes(key) ||
!this.DS.stores.SettingsStore.s.keyboardDrag ||
!this._dragKeysFlat.includes(_key) ||
!this.DS.SelectedSet.size ||
!this._draggability ||
!this.DS.stores.SettingsStore.s.draggability ||
this.DS.continue

@@ -132,5 +94,5 @@ )

shiftKey: this.DS.stores.KeyStore.currentValues.includes('shift'),
keyboardDragSpeed: this._keyboardDragSpeed,
zoom: this._zoom,
key,
keyboardDragSpeed: this.DS.stores.SettingsStore.s.keyboardDragSpeed,
zoom: this.DS.stores.SettingsStore.s.zoom,
key: _key,
scrollCallback: this.DS.Area.scroll,

@@ -147,15 +109,19 @@ scrollDiff: this._scrollDiff,

containerRect: this.DS.SelectorArea.rect,
useTransform: this._useTransform,
useTransform: this.DS.stores.SettingsStore.s.useTransform,
})
)
this.DS.publish(['Interaction:update:pre', 'Interaction:update'], publishData)
this.DS.publish(
['Interaction:update:pre', 'Interaction:update'],
publishData
)
}
keyboardEnd = ({ event, key }) => {
const _key = key.toLowerCase()
if (
!this._keyboardDrag ||
!this._dragKeysFlat.includes(key) ||
!this.DS.stores.SettingsStore.s.keyboardDrag ||
!this._dragKeysFlat.includes(_key) ||
!this.DS.SelectedSet.size ||
!this._draggability
!this.DS.stores.SettingsStore.s.draggability
)

@@ -165,3 +131,3 @@ return

event,
isDragging: this._draggability,
isDragging: this.DS.stores.SettingsStore.s.draggability,
isDraggingKeyboard: true,

@@ -204,3 +170,3 @@ }

containerRect: this.DS.SelectorArea.rect,
useTransform: this._useTransform,
useTransform: this.DS.stores.SettingsStore.s.useTransform,
})

@@ -207,0 +173,0 @@ )

@@ -6,22 +6,2 @@ // @ts-check

export default class Interaction {
/**
* @type {DSArea}
* @private
* */
_areaElement
/**
* @type {boolean}
* @private
* */
_draggability
/**
* @type {boolean}
* @private
* */
_immediateDrag
/**
* @type {string}
* @private
* */
_selectableClass
/** @type {boolean} */

@@ -34,22 +14,9 @@ isInteracting

* @constructor Interaction
* @param {Object} obj
* @param {DragSelect} obj.DS
* @param {DSArea} obj.areaElement
* @param {boolean} obj.draggability
* @param {boolean} obj.immediateDrag
* @param {string} obj.selectableClass
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({
DS,
areaElement,
draggability,
immediateDrag,
selectableClass,
}) {
this._areaElement = areaElement
this._draggability = draggability
this._immediateDrag = immediateDrag
this._selectableClass = selectableClass
constructor({ DS }) {
this.DS = DS
// @ts-ignore: @todo: update to typescript
this.DS.subscribe('Settings:updated:area', this.init)
this.DS.subscribe('PointerStore:updated', this.update)

@@ -69,4 +36,4 @@ this.DS.subscribe('Selectable:click', this.onClick)

this.stop()
this._areaElement.addEventListener('mousedown', this.start)
this._areaElement.addEventListener('touchstart', this.start, {
this.DS.Area.HTMLNode.addEventListener('mousedown', this.start)
this.DS.Area.HTMLNode.addEventListener('touchstart', this.start, {
passive: false,

@@ -129,6 +96,7 @@ })

const clickedElement = /** @type {Element} */ (event.target).closest(
`.${this._selectableClass}`
`.${this.DS.stores.SettingsStore.s.selectableClass}`
)
if (
!this._draggability ||
!this.DS.stores.SettingsStore.s.draggability ||
this.DS.stores.KeyStore.isMultiSelectKeyPressed(event) ||

@@ -139,3 +107,3 @@ !clickedElement

if (this._immediateDrag) {
if (this.DS.stores.SettingsStore.s.immediateDrag) {
if (!this.DS.SelectedSet.size)

@@ -174,3 +142,4 @@ this.DS.SelectedSet.add(/** @type {DSElement} */ (clickedElement))

if (!KeyStore.isMultiSelectKeyPressed(event)) SelectedSet.clear()
if (!KeyStore.isMultiSelectKeyPressed(event))
SelectedSet.clear()
SelectedSet.toggle(node)

@@ -184,4 +153,4 @@

this.isDragging = false
this._areaElement.removeEventListener('mousedown', this.start)
this._areaElement.removeEventListener('touchstart', this.start, {
this.DS.Area.HTMLNode.removeEventListener('mousedown', this.start)
this.DS.Area.HTMLNode.removeEventListener('touchstart', this.start, {
// @ts-ignore

@@ -188,0 +157,0 @@ passive: false,

@@ -9,62 +9,32 @@ // @ts-check

/**
* @type {DSElements}
* @private
* */
_initElements
/**
* @type {string}
* @private
* */
_className
/**
* @type {string}
* @private
* */
_hoverClassName
/**
* @type {boolean}
* @private
* */
_useTransform
/**
* @type {boolean}
* @private
* */
_draggability
/**
* @constructor SelectableSet
* @param {Object} p
* @param {DSInputElements} p.elements
* @param {DragSelect} p.DS
* @param {string} p.className
* @param {string} p.hoverClassName
* @param {boolean} p.useTransform
* @param {boolean} p.draggability
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({
elements,
className,
hoverClassName,
draggability,
useTransform,
DS,
}) {
constructor({ DS }) {
super()
this.DS = DS
this._initElements = toArray(elements)
this._className = className
this._hoverClassName = hoverClassName
this._useTransform = useTransform
this._draggability = draggability
this.DS.subscribe('Interaction:init', this.init)
// @ts-ignore: @todo: update to typescript
this.DS.PubSub.subscribe('Settings:updated:selectables', () => {
this.clear()
this.init()
})
// @ts-ignore: @todo: update to typescript
this.DS.subscribe('Settings:updated:selectableClass', ({ settings }) => {
this.forEach((el) => {
el.classList.remove(settings['selectableClass:pre'])
el.classList.add(settings['selectableClass'])
})
})
}
init = () => this._initElements.forEach((el) => this.add(el))
init = () =>
toArray(this.DS.stores.SettingsStore.s.selectables).forEach((el) =>
this.add(el)
)
/** @param {DSElement} element */
add(element) {
element.classList.add(this._className)
element.classList.add(this.DS.stores.SettingsStore.s.selectableClass)
element.addEventListener('click', this._onClick)

@@ -77,3 +47,6 @@ element.addEventListener('mousedown', this._onPointer)

if (this._draggability && !this._useTransform)
if (
this.DS.stores.SettingsStore.s.draggability &&
!this.DS.stores.SettingsStore.s.useTransform
)
handleElementPositionAttribute({

@@ -89,4 +62,4 @@ computedStyle: window.getComputedStyle(element),

delete(element) {
element.classList.remove(this._className)
element.classList.remove(this._hoverClassName)
element.classList.remove(this.DS.stores.SettingsStore.s.selectableClass)
element.classList.remove(this.DS.stores.SettingsStore.s.hoverClass)
element.removeEventListener('click', this._onClick)

@@ -103,4 +76,6 @@ element.removeEventListener('mousedown', this._onPointer)

_onClick = (event) => this.DS.publish(['Selectable:click:pre', 'Selectable:click'], { event })
_onPointer = (event) => this.DS.publish(['Selectable:pointer:pre', 'Selectable:pointer'], { event })
_onClick = (event) =>
this.DS.publish(['Selectable:click:pre', 'Selectable:click'], { event })
_onPointer = (event) =>
this.DS.publish(['Selectable:pointer:pre', 'Selectable:pointer'], { event })

@@ -107,0 +82,0 @@ /** @param {DSElements} elements */

@@ -7,18 +7,9 @@ // @ts-check

/**
* @type {string}
* @private
* */
_className
/**
* @constructor SelectableSet
* @param {Object} p
* @param {DragSelect} p.DS
* @param {string} p.className
* @param {{DS:DragSelect}} obj
* @ignore
*/
constructor({ className, DS }) {
constructor({ DS }) {
super()
this.DS = DS
this._className = className
}

@@ -35,3 +26,3 @@

super.add(element)
element.classList.add(this._className)
element.classList.add(this.DS.stores.SettingsStore.s.selectedClass)
element.style.zIndex = `${(parseInt(element.style.zIndex) || 0) + 1}`

@@ -51,3 +42,3 @@ this.DS.publish('Selected:added', publishData)

const deleted = super.delete(element)
element.classList.remove(this._className)
element.classList.remove(this.DS.stores.SettingsStore.s.selectedClass)
element.style.zIndex = `${(parseInt(element.style.zIndex) || 0) - 1}`

@@ -54,0 +45,0 @@ this.DS.publish('Selected:removed', publishData)

@@ -13,22 +13,9 @@ // @ts-check

_prevSelectedSet
/**
* @type {string}
* @private
* */
_hoverClassName
/**
* @type {boolean}
* @private
* */
_multiSelectToggling
/**
* @constructor Selection
* @param {{ DS:DragSelect, hoverClassName:string, multiSelectToggling:boolean }} p
* @param {{ DS:DragSelect }} p
* @ignore
*/
constructor({ DS, hoverClassName, multiSelectToggling }) {
this._hoverClassName = hoverClassName
this._multiSelectToggling = multiSelectToggling
constructor({ DS }) {
this.DS = DS

@@ -92,4 +79,4 @@ this.DS.subscribe('Interaction:start', this.start)

const multiSelectionToggle =
this.DS.stores.KeyStore.isMultiSelectKeyPressed(event) &&
this._multiSelectToggling
(this.DS.stores.KeyStore.isMultiSelectKeyPressed(event)) &&
this.DS.stores.SettingsStore.s.multiSelectToggling

@@ -103,3 +90,3 @@ if (this.DS.continue) return

SelectedSet: this.DS.SelectedSet,
hoverClassName: this._hoverClassName,
hoverClassName: this.DS.stores.SettingsStore.s.hoverClass,
})

@@ -112,3 +99,3 @@ )

SelectedSet: this.DS.SelectedSet,
hoverClassName: this._hoverClassName,
hoverClassName: this.DS.stores.SettingsStore.s.hoverClass,
PrevSelectedSet: this._prevSelectedSet,

@@ -115,0 +102,0 @@ })

@@ -21,14 +21,16 @@ // @ts-check

* @constructor Selector
* @param {Object} p
* @param {DragSelect} p.DS
* @param {HTMLElement} p.selector
* @param {string} p.selectorClass
* @param {boolean} p.customStyles
* @param {{ DS:DragSelect }} p
* @ignore
*/
constructor({ DS, selector, selectorClass, customStyles }) {
constructor({ DS }) {
this.DS = DS
this.HTMLNode = selector || createSelectorElement(customStyles)
this.HTMLNode.classList.add(selectorClass)
// @ts-ignore: @todo: update to typescript
this.DS.subscribe('Settings:updated:selectorClass', ({ settings }) => {
this.HTMLNode.classList.remove(settings['selectorClass:pre'])
this.HTMLNode.classList.add(settings['selectorClass'])
})
// @ts-ignore: @todo: update to typescript
this.DS.subscribe('Settings:updated:selector', this.attachSelector)
this.attachSelector()

@@ -39,2 +41,13 @@ this.DS.subscribe('Interaction:start', this.start)

}
attachSelector = () => {
if (this.HTMLNode && this.DS.SelectorArea?.HTMLNode)
this.DS.SelectorArea.HTMLNode.removeChild(this.HTMLNode)
this.HTMLNode =
this.DS.stores.SettingsStore.s.selector ||
createSelectorElement(this.DS.stores.SettingsStore.s.customStyles)
this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorClass)
if (this.HTMLNode && this.DS.SelectorArea?.HTMLNode)
this.DS.SelectorArea.HTMLNode.appendChild(this.HTMLNode)
}

@@ -41,0 +54,0 @@ start = ({ isDragging }) => {

@@ -13,7 +13,2 @@ // @ts-check

/**
* @type {number}
* @private
* */
_autoScrollSpeed
/**
* @type {*}

@@ -33,7 +28,2 @@ * @private

currentEdges = []
/**
* @type {Vect2}
* @private
*/
_overflowTolerance

@@ -43,13 +33,18 @@ /**

* @constructor SelectorArea
* @param {{ DS:DragSelect, selectorAreaClass:string, autoScrollSpeed:number, overflowTolerance:Vect2}} obj
* @param {{ DS:DragSelect }} obj
* @ignore
*/
constructor({ DS, selectorAreaClass, autoScrollSpeed, overflowTolerance }) {
this._autoScrollSpeed = autoScrollSpeed
this._overflowTolerance = overflowTolerance
constructor({ DS }) {
this.DS = DS
this.HTMLNode = createSelectorAreaElement(selectorAreaClass)
this.HTMLNode = createSelectorAreaElement()
// @ts-ignore: @todo: update to typescript
this.DS.subscribe('Settings:updated:selectorAreaClass', ({ settings }) => {
this.HTMLNode.classList.remove(settings['selectorAreaClass:pre'])
this.HTMLNode.classList.add(settings['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)

@@ -116,7 +111,7 @@ this.DS.subscribe('Interaction:start', this.startAutoScroll)

containerRect: this.rect,
tolerance: this._overflowTolerance,
tolerance: this.DS.stores.SettingsStore.s.overflowTolerance,
})
if (this.currentEdges.length)
Area.scroll(this.currentEdges, this._autoScrollSpeed)
Area.scroll(this.currentEdges, this.DS.stores.SettingsStore.s.autoScrollSpeed)
}

@@ -123,0 +118,0 @@

export { default as KeyStore } from './KeyStore'
export { default as PointerStore } from './PointerStore'
export { default as ScrollStore } from './ScrollStore'
export { default as SettingsStore } from './SettingsStore'

@@ -7,12 +7,2 @@ // @ts-check

/**
* @type {boolean}
* @private
* */
_multiSelectMode
/**
* @type {DSMultiSelectKeys}
* @private
* */
_multiSelectKeys
/**
* @type {Set<string>}

@@ -35,27 +25,7 @@ * @private

* @constructor KeyStore
* @param {{DS:DragSelect,multiSelectKeys:DSMultiSelectKeys,multiSelectMode:boolean}} p
* @param {{DS:DragSelect}} p
* @ignore
*/
constructor({ DS, multiSelectKeys, multiSelectMode }) {
constructor({ DS }) {
this.DS = DS
this._multiSelectMode = multiSelectMode
// @TODO: remove after deprecation
this._multiSelectKeys = multiSelectKeys.map((key) => {
const deprecatedKeys = {
ctrlKey: 'Control',
shiftKey: 'Shift',
metaKey: 'Meta',
}
/** @type {string} */
const newName = deprecatedKeys[key]
if (newName) {
console.warn(
`[DragSelect] ${key} is deprecated. Use "${newName}" instead. Act Now!. See docs for more info`
)
return newName.toLowerCase()
}
return key.toLowerCase()
})
this.DS.subscribe('Interaction:init', this.init)

@@ -97,10 +67,14 @@ }

isMultiSelectKeyPressed(event) {
if (this._multiSelectMode) return true
if (this.currentValues.some((key) => this._multiSelectKeys.includes(key)))
return true
if(this.DS.stores.SettingsStore.s.multiSelectMode) return true
const multiSelectKeys = this.DS.stores.SettingsStore.s.multiSelectKeys.map(
(key) => key.toLocaleLowerCase()
)
if (
event &&
this._multiSelectKeys.some((key) => event[this._keyMapping[key]])
this.currentValues.some((key) =>
multiSelectKeys.includes(key.toLocaleLowerCase())
)
)
return true
if (event && multiSelectKeys.some((key) => event[this._keyMapping[key]]))
return true
return false

@@ -107,0 +81,0 @@ }

@@ -16,6 +16,2 @@ // @ts-check

/**
* @type {DSArea}
* @private */
_areaElement
/**
* @type {boolean}

@@ -28,10 +24,7 @@ * @private */

* @constructor ScrollStore
* @param {{ DS:DragSelect, areaElement: DSArea, zoom:number }} p
* @param {{ DS:DragSelect }} p
* @ignore
*/
constructor({ DS, areaElement, zoom }) {
this._areaElement = areaElement
constructor({ DS }) {
this.DS = DS
this.zoom = zoom
this.DS.subscribe('Interaction:init', this.init)

@@ -42,13 +35,20 @@ this.DS.subscribe('Interaction:start', () => this.start())

init = () => this._areaElement.addEventListener('scroll', this.update)
init = () =>
this.DS.stores.SettingsStore.s.area.addEventListener('scroll', this.update)
start = () => {
this._currentVal = this._initialVal = getCurrentScroll(this._areaElement)
this._areaElement.addEventListener('scroll', this.update)
this._currentVal = this._initialVal = getCurrentScroll(
this.DS.stores.SettingsStore.s.area
)
this.DS.stores.SettingsStore.s.area.addEventListener('scroll', this.update)
}
update = () => (this._currentVal = getCurrentScroll(this._areaElement))
update = () =>
(this._currentVal = getCurrentScroll(this.DS.stores.SettingsStore.s.area))
stop = () => {
this._areaElement.removeEventListener('scroll', this.update)
this.DS.stores.SettingsStore.s.area.removeEventListener(
'scroll',
this.update
)
this._initialVal = { x: 0, y: 0 }

@@ -65,3 +65,3 @@ this._canScroll = null

if (typeof this._canScroll === 'boolean') return this._canScroll
return (this._canScroll = canScroll(this._areaElement))
return (this._canScroll = canScroll(this.DS.stores.SettingsStore.s.area))
}

@@ -73,3 +73,3 @@

// if area is zoomed, the scroll values are skewed, we need to fix that manually :(
const zoom = vect2.num2vect(this.zoom)
const zoom = vect2.num2vect(this.DS.stores.SettingsStore.s.zoom)
const zoomScroll = vect2.calc(

@@ -94,5 +94,5 @@ vect2.calc(scrollDiff, '*', zoom),

if (!this._currentVal)
this._currentVal = getCurrentScroll(this._areaElement)
this._currentVal = getCurrentScroll(this.DS.stores.SettingsStore.s.area)
return this._currentVal
}
}

@@ -25,8 +25,2 @@ /**

* @property {string} [selectorAreaClass=ds-selector-area] the class assigned to the square in which the selector resides. By default it's invisible
* @property {DSCallback} [callback] Deprecated: please use DragSelect.subscribe('callback', callback) instead
* @property {DSCallback} [onDragMove] Deprecated: please use DragSelect.subscribe('onDragMove', onDragMove) instead
* @property {DSCallback} [onDragStartBegin] Deprecated: please use DragSelect.subscribe('onDragStartBegin', onDragStartBegin) instead
* @property {DSCallback} [onDragStart] Deprecated: please use DragSelect.subscribe('onDragStart', onDragStart) instead
* @property {DSCallback} [onElementSelect] Deprecated: please use DragSelect.subscribe('onElementSelect', onElementSelect) instead
* @property {DSCallback} [onElementUnselect] Deprecated: please use DragSelect.subscribe('onElementUnselect', onElementUnselect) instead
*/

@@ -43,2 +37,3 @@

* @property {string} [key] Pressed key (lowercase)
* @property {Settings} [settings] the settings being updates/manipulated/passed, also holds the previous value. i.e. updating selectorClass will publish { settings: { selectorClass: 'newVal', 'selectorClass:pre': 'oldVal' } }
* @property {Array.<'top'|'bottom'|'left'|'right'|undefined>} [scroll_directions]

@@ -67,3 +62,5 @@ * @property {number} [scroll_multiplier]

/** @typedef {'Interaction:init:pre'|'Interaction:start:pre'|'Interaction:end:pre'|'Interaction:update:pre'|'Area:modified:pre'|'Area:scroll:pre'|'PointerStore:updated:pre'|'Selected:added:pre'|'Selected:removed:pre'|'Selectable:click:pre'|'Selectable:pointer:pre'|'KeyStore:down:pre'|'KeyStore:up:pre'} DSInternalEventNamesPre */
/** @typedef {DSEventNames|DSInternalEventNames|DSInternalEventNamesPre} DSCallbackNames the name of the callback */
// @todo: update to typescript for complex defs like `Settings:updated:${string}` | `Settings:updated:${string}:pre`
/** @typedef {'Settings:updated'|'Settings:updated:pre'|'Settings:updated:*'|'Settings:updated:*:pre'} DSInternalSettingEvents */
/** @typedef {DSEventNames|DSInternalEventNames|DSInternalEventNamesPre|DSInternalSettingEvents} DSCallbackNames the name of the callback */

@@ -70,0 +67,0 @@ /** @typedef {{top:number,left:number,bottom:number,right:number,width:number,height:number}} DSBoundingRect */

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc