Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

selecto

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selecto - npm Package Compare versions

Comparing version 1.20.0 to 1.20.1

15

CHANGELOG.md

@@ -6,2 +6,17 @@ # Change Log

## [1.20.0](https://github.com/daybrush/selecto/compare/selecto@1.19.1...selecto@1.20.0) (2022-09-13)
### :rocket: New Features
* add preventClickEventByCondition option ([47d49c3](https://github.com/daybrush/selecto/commit/47d49c358ec48a2b7d19ee3e6b0515c5e3c64ed6))
* add selectTargetByPoints, setSelectedTargetByPoints #95 #98 ([b4d3caa](https://github.com/daybrush/selecto/commit/b4d3caa2d8a72645e462d87978f417ab4a8aa826))
### :mega: Other
* publish packages ([e7f1573](https://github.com/daybrush/selecto/commit/e7f1573c80bfa19b0776df94d43c13fe7f5465b8))
## [1.19.1](https://github.com/daybrush/selecto/compare/selecto@1.19.0...selecto@1.19.1) (2022-09-01)

@@ -8,0 +23,0 @@

8

declaration/types.d.ts

@@ -67,2 +67,3 @@ import { IObject } from "@daybrush/utils";

export interface SelectedTargets {
beforeSelected: Array<HTMLElement | SVGElement>;
selected: Array<HTMLElement | SVGElement>;

@@ -75,7 +76,3 @@ added: Array<HTMLElement | SVGElement>;

}
export interface OnSelect<T = Selecto> extends CurrentTarget<T>, SelectedTargets {
selected: Array<HTMLElement | SVGElement>;
added: Array<HTMLElement | SVGElement>;
removed: Array<HTMLElement | SVGElement>;
rect: Rect;
export interface OnSelect<T = Selecto> extends CurrentTarget<T>, SelectedTargetsWithRect {
inputEvent: any;

@@ -85,2 +82,3 @@ data: Record<string, any>;

export interface OnSelectEnd<T = Selecto> extends OnSelect<T>, CurrentTarget<T> {
startSelected: Array<HTMLElement | SVGElement>;
afterAdded: Array<HTMLElement | SVGElement>;

@@ -87,0 +85,0 @@ afterRemoved: Array<HTMLElement | SVGElement>;

@@ -7,3 +7,3 @@ /*

repository: git+https://github.com/daybrush/selecto.git
version: 1.20.0
version: 1.20.1
*/

@@ -803,3 +803,5 @@ 'use strict';

__proto.setSelectedTargets = function (selectedTargets) {
var _a = childrenDiffer.diff(this.selectedTargets, selectedTargets),
var beforeSelected = this.selectedTargets;
var _a = childrenDiffer.diff(beforeSelected, selectedTargets),
added = _a.added,

@@ -818,2 +820,3 @@ removed = _a.removed,

}),
beforeSelected: beforeSelected,
selected: selectedTargets

@@ -1294,7 +1297,4 @@ };

var data = e.data;
var result = this.setSelectedTargets(selectedTargets);
var _a = this.setSelectedTargets(selectedTargets),
added = _a.added,
removed = _a.removed;
if (isStart) {

@@ -1331,13 +1331,10 @@ /**

*/
this.emit("selectStart", {
selected: selectedTargets,
added: added,
removed: removed,
this.emit("selectStart", __assign(__assign({}, result), {
rect: rect,
inputEvent: inputEvent,
data: data.data
});
}));
}
if (added.length || removed.length) {
if (result.added.length || result.removed.length) {
/**

@@ -1366,10 +1363,7 @@ * When the select in real time, the select event is called.

*/
this.emit("select", {
selected: selectedTargets,
added: added,
removed: removed,
this.emit("select", __assign(__assign({}, result), {
rect: rect,
inputEvent: inputEvent,
data: data.data
});
}));
}

@@ -1429,2 +1423,4 @@ };

this.emit("selectEnd", {
startSelected: startPassedTargets,
beforeSelected: startPassedTargets,
selected: this.selectedTargets,

@@ -1474,3 +1470,2 @@ added: added.map(function (index) {

selectedTargets = passTargets(data.startPassedTargets, passedTargets, this.continueSelect && this.continueSelectWithoutDeselect);
this.selectedTargets = selectedTargets;
}

@@ -1477,0 +1472,0 @@ /**

@@ -7,3 +7,3 @@ /*

repository: git+https://github.com/daybrush/selecto.git
version: 1.20.0
version: 1.20.1
*/

@@ -801,3 +801,5 @@ import EventEmitter from '@scena/event-emitter';

__proto.setSelectedTargets = function (selectedTargets) {
var _a = diff(this.selectedTargets, selectedTargets),
var beforeSelected = this.selectedTargets;
var _a = diff(beforeSelected, selectedTargets),
added = _a.added,

@@ -816,2 +818,3 @@ removed = _a.removed,

}),
beforeSelected: beforeSelected,
selected: selectedTargets

@@ -1292,7 +1295,4 @@ };

var data = e.data;
var result = this.setSelectedTargets(selectedTargets);
var _a = this.setSelectedTargets(selectedTargets),
added = _a.added,
removed = _a.removed;
if (isStart) {

@@ -1329,13 +1329,10 @@ /**

*/
this.emit("selectStart", {
selected: selectedTargets,
added: added,
removed: removed,
this.emit("selectStart", __assign(__assign({}, result), {
rect: rect,
inputEvent: inputEvent,
data: data.data
});
}));
}
if (added.length || removed.length) {
if (result.added.length || result.removed.length) {
/**

@@ -1364,10 +1361,7 @@ * When the select in real time, the select event is called.

*/
this.emit("select", {
selected: selectedTargets,
added: added,
removed: removed,
this.emit("select", __assign(__assign({}, result), {
rect: rect,
inputEvent: inputEvent,
data: data.data
});
}));
}

@@ -1427,2 +1421,4 @@ };

this.emit("selectEnd", {
startSelected: startPassedTargets,
beforeSelected: startPassedTargets,
selected: this.selectedTargets,

@@ -1472,3 +1468,2 @@ added: added.map(function (index) {

selectedTargets = passTargets(data.startPassedTargets, passedTargets, this.continueSelect && this.continueSelectWithoutDeselect);
this.selectedTargets = selectedTargets;
}

@@ -1475,0 +1470,0 @@ /**

@@ -7,5 +7,5 @@ /*

repository: git+https://github.com/daybrush/selecto.git
version: 1.20.0
version: 1.20.1
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Selecto=e()}(this,function(){"use strict";var F=function(t,e){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function K(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var g=function(){return(g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||((i=i||Array.prototype.slice.call(e,0,r))[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var W="string",A=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],B=1e-7;function v(t){return t&&"object"==typeof t}function R(t){return Array.isArray(t)}function I(t){return typeof t===W}function N(t,e,n,i,r){if(m(t,e,n))return n;for(var o,a=t,s=e,c=i,u=r,l=n+1;l<c;++l){var h=function(t){var e,n,i=s[t].trim();return i!==a.close||m(a,s,t)?(e=t,-1===(e=(n=y(u,function(t){return t.open===i}))?N(n,s,t,c,u):e)?(o=t,"break"):void(o=t=e)):{value:t}}(l);if(l=o,"object"==typeof h)return h.value;if("break"===h)break}return-1}function m(t,e,n){if(!t.ignore)return null;e=e.slice(Math.max(n-3,0),n+3).join("");return new RegExp(t.ignore).exec(e)}function L(t,e){var e=I(e)?{separator:e}:e,n=e.separator,o=void 0===n?",":n,a=e.isSeparateFirst,s=e.isSeparateOnlyOpenClose,n=e.isSeparateOpenClose,c=void 0===n?s:n,n=e.openCloseCharacters,u=void 0===n?A:n,e=u.map(function(t){var e=t.open,t=t.close;return e===t?e:e+"|"+t}).join("|"),n=new RegExp("(\\s*"+o+"\\s*|"+e+"|\\s+)","g"),l=t.split(n).filter(Boolean),h=l.length,f=[],d=[];function p(){return d.length&&(f.push(d.join("")),d=[])}for(var g,i=0;i<h;++i){var r=function(t){var e=l[t].trim(),n=t,i=y(u,function(t){return t.open===e}),r=y(u,function(t){return t.close===e});if(i){if(-1!==(n=N(i,l,t,h,u))&&c)return p()&&a?(g=t,"break"):(f.push(l.slice(t,n+1).join("")),t=n,a?(g=t,"break"):(g=t,"continue"))}else{if(r&&!m(r,l,t))throw new Error("invalid format: "+r.close);if(i=e,!((""!==(r=o)&&" "!=r||""!==i&&" "!=i)&&i!==r||s))return p(),a?(g=t,"break"):(g=t,"continue")}d.push(l.slice(t,(n=-1===n?h-1:n)+1).join("")),g=t=n}(i),i=g;if("break"===r)break}return d.length&&f.push(d.join("")),f}function c(t){return L(t,",")}function q(t){t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!t)return{prefix:"",unit:"",value:NaN};var e=t[1],n=t[2];return{prefix:e,unit:t[3],value:parseFloat(n)}}function G(t){return t.replace(/[\s-_]([a-z])/g,function(t,e){return e.toUpperCase()})}function H(){return Date.now?Date.now():(new Date).getTime()}function o(t,e,n){void 0===n&&(n=-1);for(var i=t.length,r=0;r<i;++r)if(e(t[r],r,t))return r;return n}function y(t,e,n){e=o(t,e);return-1<e?t[e]:n}function Z(t,e,n){return Math.max(e,Math.min(t,n))}function U(t,i,r,e){return void 0===e&&(e=t[0]/t[1]),[[j(i[0],B),j(i[0]/e,B)],[j(i[1]*e,B),j(i[1],B)]].filter(function(t){return t.every(function(t,e){var e=i[e],n=j(e,B);return r?t<=e||t<=n:e<=t||n<=t})})[0]||t}function V(t,e){var n=e[0]-t[0],e=e[1]-t[1],t=Math.atan2(e,n);return 0<=t?t:t+2*Math.PI}function z(o){return[0,1].map(function(e){for(var t=o.map(function(t){return t[e]}),n=t.length,i=0,r=n-1;0<=r;--r)i+=t[r];return n?i/n:0})}function $(t){var e=z(t),n=V(e,t[0]),e=V(e,t[1]);return n<e&&e-n<Math.PI||e<n&&e-n<-Math.PI?1:-1}function J(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function j(t,e){if(!e)return t;var n=1/e;return Math.round(t/e)/n}function C(t,e,n,i){t.addEventListener(e,n,i)}function E(t,e,n,i){t.removeEventListener(e,n,i)}var Q=function(){return(Q=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};var t=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(v(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(v(t))for(var n in t)this.off(n);else{var i,r;e?(i=this._events[t])&&-1<(r=o(i,function(t){return t.listener===e}))&&i.splice(r,1):this._events[t]=[]}else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var i=this,t=(void 0===n&&(n={}),this._events[e]);if(!e||!t)return!0;var r=!1;return n.eventType=e,n.stop=function(){r=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}(t).forEach(function(t){t.listener(n),t.once&&i.off(e,t.listener)}),!r},e.trigger=function(t,e){return this.emit(t,e=void 0===e?{}:e)},e._addEvent=function(t,e,n){var i=this._events;i[t]=i[t]||[],i[t].push(Q({listener:e},n))},t}(),tt=function(t,e){return(tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var S=function(){return(S=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t){return 180*(e=[t[0].clientX,t[0].clientY],t=[t[1].clientX,t[1].clientY],n=t[0]-e[0],t=t[1]-e[1],(0<=(e=Math.atan2(t,n))?e:e+2*Math.PI)/Math.PI);var e,n}function _(t){if(!t)return[];if(t.touches){for(var e=t.touches,n=Math.min(e.length,2),i=[],r=0;r<n;++r)i.push(nt(e[r]));return i}return[nt(t)]}function et(t,e,n){var i=n.length,t=u(t,i),r=t.clientX,o=t.clientY,a=t.originalClientX,t=t.originalClientY,e=u(e,i),s=e.clientX,e=e.clientY,n=u(n,i);return{clientX:a,clientY:t,deltaX:r-s,deltaY:o-e,distX:r-n.clientX,distY:o-n.clientY}}function i(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function nt(t){return{clientX:t.clientX,clientY:t.clientY}}function u(t,e){void 0===e&&(e=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},i=0;i<e;++i){var r=t[i];n.originalClientX+="originalClientX"in r?r.originalClientX:r.clientX,n.originalClientY+="originalClientY"in r?r.originalClientY:r.clientY,n.clientX+=r.clientX,n.clientY+=r.clientY}return e?{clientX:n.clientX/e,clientY:n.clientY/e,originalClientX:n.originalClientX/e,originalClientY:n.originalClientY/e}:n}var b=function(){function t(t){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=t,this.prevClients=t,this.length=t.length}var e=t.prototype;return e.getAngle=function(t){return n(t=void 0===t?this.prevClients:t)},e.getRotation=function(t){return n(t=void 0===t?this.prevClients:t)-n(this.startClients)},e.getPosition=function(t,e){var n=et((t=void 0===t?this.prevClients:t)||this.prevClients,this.prevClients,this.startClients),i=n.deltaX,r=n.deltaY;return this.movement+=Math.sqrt(i*i+r*r),this.prevClients=t,n},e.getPositions=function(n){void 0===n&&(n=this.prevClients);var i=this.prevClients;return this.startClients.map(function(t,e){return et([n[e]],[i[e]],[t])})},e.getMovement=function(t){var e=this.movement;if(!t)return e;var t=u(t,this.length),n=u(this.prevClients,this.length),i=t.clientX-n.clientX,t=t.clientY-n.clientY;return Math.sqrt(i*i+t*t)+e},e.getDistance=function(t){return i(t=void 0===t?this.prevClients:t)},e.getScale=function(t){return i(t=void 0===t?this.prevClients:t)/i(this.startClients)},e.move=function(e,n){this.startClients.forEach(function(t){t.clientX-=e,t.clientY-=n})},t}(),it=["textarea","input"],rt=function(o){function t(){this.constructor=e}var e;function n(t,e){void 0===e&&(e={});var n,g=o.call(this)||this,t=(g.options={},g.flag=!1,g.pinchFlag=!1,g.data={},g.isDrag=!1,g.isPinch=!1,g.isMouse=!1,g.isTouch=!1,g.clientStores=[],g.targets=[],g.prevTime=0,g.doubleFlag=!1,g._dragFlag=!1,g._isMouseEvent=!1,g._isSecondaryButton=!1,g._preventMouseEvent=!1,g.onDragStart=function(t,e){if(void 0===e&&(e=!0),g.flag||!1!==t.cancelable){var n=g.options,i=n.container,r=n.pinchOutside,o=n.preventWheelClick,a=n.preventRightClick,s=n.preventDefault,c=n.checkInput,u=n.preventClickEventOnDragStart,l=n.preventClickEventOnDrag,n=n.preventClickEventByCondition,h=g.isTouch,f=!g.flag;if(g._isSecondaryButton=3===t.which||2===t.button,o&&(2===t.which||1===t.button)||a&&(3===t.which||2===t.button))return g.stop(),!1;if(f){o=document.activeElement,a=t.target;if(a){var d=a.tagName.toLowerCase(),d=-1<it.indexOf(d),p=a.isContentEditable;if(d||p){if(c||o===a)return!1;if(o&&p&&o.isContentEditable&&o.contains(a))return!1}else(s||"touchstart"===t.type)&&o&&(d=o.tagName,(o.isContentEditable||-1<it.indexOf(d))&&o.blur());(u||l||n)&&C(window,"click",g._onClick,!0)}g.clientStores=[new b(_(t))],g.flag=!0,g.isDrag=!1,g._dragFlag=!0,g.data={},g.doubleFlag=H()-g.prevTime<200,g._isMouseEvent=(c=t)&&(-1<c.type.indexOf("mouse")||"button"in c),!g._isMouseEvent&&g._preventMouseEvent&&(g._preventMouseEvent=!1),!1===(g._preventMouseEvent||g.emit("dragStart",S(S({data:g.data,datas:g.data,inputEvent:t,isMouseEvent:g._isMouseEvent,isSecondaryButton:g._isSecondaryButton,isTrusted:e,isDouble:g.doubleFlag},g.getCurrentStore().getPosition()),{preventDefault:function(){t.preventDefault()},preventDrag:function(){g._dragFlag=!1}})))&&g.stop(),g._isMouseEvent&&g.flag&&s&&t.preventDefault()}if(!g.flag)return!1;p=0;f?(g._attchDragEvent(),h&&r&&(p=setTimeout(function(){C(i,"touchstart",g.onDragStart,{passive:!1})}))):h&&r&&E(i,"touchstart",g.onDragStart),g.flag&&((a=t).touches&&2<=a.touches.length)&&(clearTimeout(p),f&&t.touches.length!==t.changedTouches.length||g.pinchFlag||g.onPinchStart(t))}},g.onDrag=function(t,e){if(g.flag){var n=g.options.preventDefault,n=(!g._isMouseEvent&&n&&t.preventDefault(),_(t)),i=g.moveClients(n,t,!1);if(g._dragFlag){if(g.pinchFlag||i.deltaX||i.deltaY)if(!1===(g._preventMouseEvent||g.emit("drag",S(S({},i),{isScroll:!!e,inputEvent:t}))))return void g.stop();g.pinchFlag&&g.onPinch(t,n)}g.getCurrentStore().getPosition(n,!0)}},g.onDragEnd=function(t){var e,n,i,r,o,a;g.flag&&(a=(i=g.options).pinchOutside,e=i.container,o=i.preventClickEventOnDrag,r=i.preventClickEventOnDragStart,i=i.preventClickEventByCondition,n=g.isDrag,(o||r||i)&&requestAnimationFrame(function(){g._allowClickEvent()}),i||r||!o||n||g._allowClickEvent(),g.isTouch&&a&&E(e,"touchstart",g.onDragStart),g.pinchFlag&&g.onPinchEnd(t),0!==(i=null!=t&&t.touches?_(t):[]).length&&g.options.keepDragging?g._addStore(new b(i)):g.flag=!1,r=g._getPosition(),o=H(),a=!n&&g.doubleFlag,g.prevTime=n||a?0:o,g.flag||(g._dettachDragEvent(),g._preventMouseEvent||g.emit("dragEnd",S({data:g.data,datas:g.data,isDouble:a,isDrag:n,isClick:!n,isMouseEvent:g._isMouseEvent,isSecondaryButton:g._isSecondaryButton,inputEvent:t},r)),g.clientStores=[],g._isMouseEvent||(g._preventMouseEvent=!0,requestAnimationFrame(function(){requestAnimationFrame(function(){g._preventMouseEvent=!1})}))))},g.onBlur=function(){g.onDragEnd()},g._allowClickEvent=function(){E(window,"click",g._onClick,!0)},g._onClick=function(t){g._preventMouseEvent=!1;var e=g.options.preventClickEventByCondition;null!=e&&e(t)||(t.stopPropagation(),t.preventDefault())},g._onContextMenu=function(t){g.options.preventRightClick?g.onDragEnd(t):t.preventDefault()},g._passCallback=function(){},[].concat(t)),e=(g.options=S({checkInput:!1,container:1<t.length?window:t[0],preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},e),g.options),i=e.container,r=e.events,e=e.checkWindowBlur;return g.isTouch=-1<r.indexOf("touch"),g.isMouse=-1<r.indexOf("mouse"),g.targets=t,g.isMouse&&(t.forEach(function(t){C(t,"mousedown",g.onDragStart),C(t,"mousemove",g._passCallback)}),C(i,"contextmenu",g._onContextMenu)),e&&C(window,"blur",g.onBlur),g.isTouch&&(n={passive:!1},t.forEach(function(t){C(t,"touchstart",g.onDragStart,n),C(t,"touchmove",g._passCallback,n)})),g}tt(e=n,i=o),e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t);var i=n.prototype;return i.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._allowClickEvent(),this._dettachDragEvent()},i.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce(function(t,e){return t+e.movement},0)},i.isDragging=function(){return this.isDrag},i.isFlag=function(){return this.flag},i.isPinchFlag=function(){return this.pinchFlag},i.isDoubleFlag=function(){return this.doubleFlag},i.isPinching=function(){return this.isPinch},i.scrollBy=function(t,e,n,i){void 0===i&&(i=!0),this.flag&&(this.clientStores[0].move(t,e),i&&this.onDrag(n,!0))},i.move=function(t,e){var n=t[0],i=t[1],t=this.getCurrentStore().prevClients;return this.moveClients(t.map(function(t){var e=t.clientX,t=t.clientY;return{clientX:e+n,clientY:t+i,originalClientX:e,originalClientY:t}}),e,!0)},i.triggerDragStart=function(t){this.onDragStart(t,!1)},i.setEventData=function(t){var e,n=this.data;for(e in t)n[e]=t[e];return this},i.setEventDatas=function(t){return this.setEventData(t)},i.getCurrentEvent=function(t){return S(S({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},i.getEventData=function(){return this.data},i.getEventDatas=function(){return this.data},i.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),E(window,"blur",this.onBlur),this.isMouse&&(t.forEach(function(t){E(t,"mousedown",e.onDragStart)}),E(n,"contextmenu",this._onContextMenu)),this.isTouch&&(t.forEach(function(t){E(t,"touchstart",e.onDragStart)}),E(n,"touchstart",this.onDragStart)),this._dettachDragEvent()},i.onPinchStart=function(t){var e=this.options.pinchThreshold;this.isDrag&&this.getMovement()>e||(e=new b(_(t)),this.pinchFlag=!0,this._addStore(e),!1===this.emit("pinchStart",S(S({data:this.data,datas:this.data,angle:e.getAngle(),touches:this.getCurrentStore().getPositions()},e.getPosition()),{inputEvent:t}))&&(this.pinchFlag=!1))},i.onPinch=function(t,e){var n;!this.flag||!this.pinchFlag||e.length<2||(n=this.getCurrentStore(),this.isPinch=!0,this.emit("pinch",S(S({data:this.data,datas:this.data,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e)),{inputEvent:t})))},i.onPinchEnd=function(t){var e,n;this.pinchFlag&&(e=this.isPinch,this.isPinch=!1,this.pinchFlag=!1,n=this.getCurrentStore(),this.emit("pinchEnd",S(S({data:this.data,datas:this.data,isPinch:e,touches:n.getPositions()},n.getPosition()),{inputEvent:t})))},i.getCurrentStore=function(){return this.clientStores[0]},i.moveClients=function(t,e,n){n=this._getPosition(t,n);return(n.deltaX||n.deltaY)&&(this.isDrag=!0),S(S({data:this.data,datas:this.data},n),{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:e})},i._addStore=function(t){this.clientStores.splice(0,0,t)},i._getPosition=function(t,e){var t=this.getCurrentStore().getPosition(t,e),e=this.clientStores.slice(1).reduce(function(t,e){e=e.getPosition();return t.distX+=e.distX,t.distY+=e.distY,t},t),n=e.distX,e=e.distY;return S(S({},t),{distX:n,distY:e})},i._attchDragEvent=function(){var t=this.options.container,e={passive:!1};this.isMouse&&(C(t,"mousemove",this.onDrag),C(t,"mouseup",this.onDragEnd)),this.isTouch&&(C(t,"touchmove",this.onDrag,e),C(t,"touchend",this.onDragEnd,e),C(t,"touchcancel",this.onDragEnd,e))},i._dettachDragEvent=function(){var t=this.options.container;this.isMouse&&(E(t,"mousemove",this.onDrag),E(t,"mouseup",this.onDragEnd)),this.isTouch&&(E(t,"touchstart",this.onDragStart),E(t,"touchmove",this.onDrag),E(t,"touchend",this.onDragEnd),E(t,"touchcancel",this.onDragEnd))},n}(t);var ot=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,i=this.values,r=n.indexOf(t),r=-1===r?n.length:r;n[r]=t,i[r]=e},t}(),at=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),st="function"==typeof Map,ct=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var ut=function(){function t(t,e,n,i,r,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=i,this.changed=r,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){t=this.changedBeforeAdded,n=this.fixed,r=[],o=[],t.forEach(function(t){var e=t[0],t=t[1],n=new ct;r[e]=n,o[t]=n}),r.forEach(function(t,e){t.connect(r[e-1])});var n,r,o,t=t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],t=t[1];if(n===t)return[0,0];var n=r[n],t=o[t-1],i=n.getIndex();return n.disconnect(),t?n.connect(t,t.next):n.connect(void 0,r[0]),[i,n.getIndex()]}),a=this.changed,s=[];this.cacheOrdered=t.filter(function(t,e){var n=t[0],t=t[1],e=a[e],i=e[0],e=e[1];if(n!==t)return s.push([i,e]),!0}),this.cachePureChanged=s},t}();var lt,ht="function"==typeof Map?void 0:(lt=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++lt)});function p(t,e){return t=t,e=e,n=ht,i=st?Map:n?at:ot,n=n||function(t){return t},r=[],o=[],a=[],s=t.map(n),n=e.map(n),c=new i,u=new i,l=[],h=[],f={},d=[],g=p=0,s.forEach(function(t,e){c.set(t,e)}),n.forEach(function(t,e){u.set(t,e)}),s.forEach(function(t,e){t=u.get(t);void 0===t?(++g,o.push(e)):f[t]=g}),n.forEach(function(t,e){t=c.get(t);void 0===t?(r.push(e),++p):(a.push([t,e]),g=f[e]||0,l.push([t-g,e-p]),h.push(e===t),t!==e&&d.push([t,e]))}),o.reverse(),new ut(t,e,r,o,d,a,l,h);var n,i,r,o,a,s,c,u,l,h,f,d,p,g}var ft="function",dt="string";var pt=function(t,e){return(pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function gt(t){t=t.container;return t===document.body?[t.scrollLeft||document.documentElement.scrollLeft,t.scrollTop||document.documentElement.scrollTop]:[t.scrollLeft,t.scrollTop]}function h(t){return t?typeof t===dt?document.querySelector(t):typeof t===ft?t():t instanceof Element?t:"current"in t?t.current:"value"in t?t.value:void 0:null}var vt=function(e){function t(){this.constructor=n}var n;function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._startRect=null,t._startPos=[],t._prevTime=0,t._timer=0,t._prevScrollPos=[0,0],t._isWait=!1,t._flag=!1,t}pt(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var r=i.prototype;return r.dragStart=function(t,e){var n,i,r,o,a=h(e.container);a?(o=r=i=n=0,o=a===document.body?(r=window.innerWidth,window.innerHeight):(n=(a=a.getBoundingClientRect()).top,i=a.left,r=a.width,a.height),this._flag=!0,this._startPos=[t.clientX,t.clientY],this._startRect={top:n,left:i,width:r,height:o},this._prevScrollPos=this._getScrollPosition([0,0],e)):this._flag=!1},r.drag=function(t,e){var n,i,r,o,a,s;if(this._flag)return n=t.clientX,i=t.clientY,r=e.threshold,r=void 0===r?0:r,o=this._startRect,a=this._startPos,s=[0,0],o.top>i-r?(a[1]>o.top||i<a[1])&&(s[1]=-1):o.top+o.height<i+r&&(a[1]<o.top+o.height||i>a[1])&&(s[1]=1),o.left>n-r?(a[0]>o.left||n<a[0])&&(s[0]=-1):o.left+o.width<n+r&&(a[0]<o.left+o.width||n>a[0])&&(s[0]=1),clearTimeout(this._timer),!(!s[0]&&!s[1])&&this._continueDrag(l(l({},e),{direction:s,inputEvent:t,isDrag:!0}))},r.checkScroll=function(t){var e=this;if(this._isWait)return!1;var n=t.prevScrollPos,n=void 0===n?this._prevScrollPos:n,i=t.direction,r=t.throttleTime,r=void 0===r?0:r,o=t.inputEvent,a=t.isDrag,s=this._getScrollPosition(i||[0,0],t),c=s[0]-n[0],n=s[1]-n[1],i=i||[c?Math.abs(c)/c:0,n?Math.abs(n)/n:0];return this._prevScrollPos=s,!(!c&&!n)&&(this.trigger("move",{offsetX:i[0]?c:0,offsetY:i[1]?n:0,inputEvent:o}),r&&a&&(this._timer=window.setTimeout(function(){e._continueDrag(t)},r)),!0)},r.dragEnd=function(){clearTimeout(this._timer)},r._getScrollPosition=function(t,e){var n=e.container,e=e.getScrollPosition;return(void 0===e?gt:e)({container:h(n),direction:t})},r._continueDrag=function(t){var e=this,n=t.container,i=t.direction,r=t.throttleTime,o=t.useScroll,a=t.isDrag,s=t.inputEvent;if(!a||!this._isWait){var c=Date.now?Date.now():(new Date).getTime(),r=Math.max(r+this._prevTime-c,0);if(0<r)return this._timer=window.setTimeout(function(){e._continueDrag(t)},r),!1;this._prevTime=c;r=this._getScrollPosition(i,t);return this._prevScrollPos=r,a&&(this._isWait=!0),this.trigger("scroll",{container:h(n),direction:i,inputEvent:s}),this._isWait=!1,o||this.checkScroll(l(l({},t),{prevScrollPos:r,direction:i,inputEvent:s}))}},i}(t),mt=function(t,e){return(mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function yt(t){return t&&"object"==typeof t}function Ct(t){return Array.isArray(t)}function Et(t){return"string"==typeof t}function s(t,e,n,i){t.addEventListener(e,n,i)}function f(t,e,n,i){t.removeEventListener(e,n,i)}var St=function(){return(St=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};var _t=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(yt(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(yt(t))for(var n in t)this.off(n);else{var i,r;e?(i=this._events[t])&&-1<(r=function(t,e,n){void 0===n&&(n=-1);for(var i=t.length,r=0;r<i;++r)if(e(t[r],r,t))return r;return n}(i,function(t){return t.listener===e}))&&i.splice(r,1):this._events[t]=[]}else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var i=this,t=(void 0===n&&(n={}),this._events[e]);if(!e||!t)return!0;var r=!1;return n.eventType=e,n.stop=function(){r=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}(t).forEach(function(t){t.listener(n),t.once&&i.off(e,t.listener)}),!r},e.trigger=function(t,e){return this.emit(t,e=void 0===e?{}:e)},e._addEvent=function(t,e,n){var i=this._events;i[t]=i[t]||[],i[t].push(St({listener:e},n))},t}();(function(t,e){function n(t){if(!t||"object"!=typeof t||(e=t.which||t.keyCode||t.charCode)&&(t=e),"number"==typeof t)return s[t];var e=String(t),t=i[e.toLowerCase()];return t||((t=r[e.toLowerCase()])?t:1===e.length?e.charCodeAt(0):void 0)}n.isEventKey=function(t,e){if(t&&"object"==typeof t){t=t.which||t.keyCode||t.charCode;if(null!=t)if("string"==typeof e){var n=i[e.toLowerCase()];if(n)return n===t;if(n=r[e.toLowerCase()])return n===t}else if("number"==typeof e)return e===t;return!1}};for(var i=(e=t.exports=n).code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91},o=97;o<123;o++)i[String.fromCharCode(o)]=o-32;for(var o=48;o<58;o++)i[o-48]=o;for(o=1;o<13;o++)i["f"+o]=o+111;for(o=0;o<10;o++)i["numpad "+o]=o+96;var a,s=e.names=e.title={};for(o in i)s[i[o]]=o;for(a in r)i[a]=r[a]})(e={exports:{}},e.exports);var bt,e=e.exports,kt=(e.code,e.codes,e.aliases,e.names),Dt=(e.title,{"+":"plus","left command":"meta","right command":"meta"}),wt={shift:1,ctrl:2,alt:3,meta:4};function Mt(t,e){var n,i=(kt[t]||e||"").toLowerCase();for(n in Dt)i=i.replace(n,Dt[n]);return i.replace(/\s/g,"")}function xt(t,e){void 0===e&&(e=Mt(t.keyCode,t.key));t=[t.shiftKey&&"shift",t.ctrlKey&&"ctrl",t.altKey&&"alt",t.metaKey&&"meta"].filter(Boolean);return-1===t.indexOf(e)&&t.push(e),t.filter(Boolean)}function Pt(t){t=t.slice();return t.sort(function(t,e){return(wt[t]||5)-(wt[e]||5)}),t}var Ot=function(n){var t=r,e=n;if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}function r(t){void 0===t&&(t=window);var e=n.call(this)||this;return e.container=t,e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e.clear=function(){return e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e},e.keydownEvent=function(t){e.triggerEvent("keydown",t)},e.keyupEvent=function(t){e.triggerEvent("keyup",t)},e.blur=function(){e.clear(),e.trigger("blur")},s(t,"blur",e.blur),s(t,"keydown",e.keydownEvent),s(t,"keyup",e.keyupEvent),e}mt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i);e=r.prototype;return Object.defineProperty(r,"global",{get:function(){return bt=bt||new r},enumerable:!1,configurable:!0}),r.setGlobal=function(){return this.global},e.destroy=function(){var t=this.container;this.clear(),this.off(),f(t,"blur",this.blur),f(t,"keydown",this.keydownEvent),f(t,"keyup",this.keyupEvent)},e.keydown=function(t,e){return this.addEvent("keydown",t,e)},e.offKeydown=function(t,e){return this.removeEvent("keydown",t,e)},e.offKeyup=function(t,e){return this.removeEvent("keyup",t,e)},e.keyup=function(t,e){return this.addEvent("keyup",t,e)},e.addEvent=function(t,e,n){return Ct(e)?this.on(t+"."+Pt(e).join("."),n):Et(e)?this.on(t+"."+e,n):this.on(t,e),this},e.removeEvent=function(t,e,n){return Ct(e)?this.off(t+"."+Pt(e).join("."),n):Et(e)?this.off(t+"."+e,n):this.off(t,e),this},e.triggerEvent=function(t,e){this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey;var n=Mt(e.keyCode,e.key),i={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:e,keyCode:e.keyCode,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey},e=(this.trigger(t,i),this.trigger(t+"."+n,i),xt(e,n));1<e.length&&this.trigger(t+"."+e.join("."),i)},r}(_t);function d(t){return j(t,B)}function Tt(n){return n.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;0<=n;--n)e+=t[n];return e}(n.map(function(t,e){e=n[e+1]||n[0];return t[0]*e[1]-e[0]*t[1]})))/2}function Yt(t){var e=t.map(function(t){return t[0]}),t=t.map(function(t){return t[1]});return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,t),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,t)}}function w(r,t,e){var i=r[0],o=r[1],n=Yt(t),a=n.minX,n=n.maxX,s=[[a,o],[n,o]],c=k(s[0],s[1]),a=D(t),u=[];if(a.forEach(function(t){var n,e=k(t[0],t[1]),i=t[0];n=e,c.every(function(t,e){return 0===d(t-n[e])})?u.push({pos:r,line:t,type:"line"}):Ft(Xt(c,e),[s,t]).forEach(function(n){t.some(function(t){return e=n,!d((t=t)[0]-e[0])&&!d(t[1]-e[1]);var e})?u.push({pos:n,line:t,type:"point"}):0!==d(i[1]-o)&&u.push({pos:n,line:t,type:"intersection"})})}),!e&&y(u,function(t){return t[0]===i}))return!0;var l=0,h={};return u.forEach(function(t){var e=t.pos,n=t.type,t=t.line;e[0]>i||("intersection"===n?++l:"line"!==n&&"point"===n&&(n=y(t,function(t){return t[1]!==o}),t=h[e[0]],n=n[1]>o?1:-1,t?t!==n&&++l:h[e[0]]=n))}),l%2==1}function k(t,e){var n=t[0],t=t[1],i=e[0]-n,e=e[1]-t,r=(Math.abs(i)<B&&(i=0),Math.abs(e)<B&&(e=0),0),o=0,a=0;return i?a=e?(o=1,-(r=-e/i)*n-t):(o=1,-t):e&&(r=-1,a=n),[r,o,a]}function Xt(t,e){var n,i,r=t[0],o=t[1],t=t[2],a=e[0],s=e[1],e=e[2],c=0===r&&0===a,u=0===o&&0===s;return c&&u?[]:c?(c=-t/o)!=-e/s?[]:[[-1/0,c],[1/0,c]]:u?(c=-t/r)!=-e/a?[]:[[c,-1/0],[c,1/0]]:(0===r?[[n=-(s*(i=-t/o)+e)/a,i]]:0===a?[[n=-(o*(i=-e/s)+t)/r,i]]:0===o?[[n=-t/r,i=-(a*n+e)/s]]:0===s?[[n=-e/a,i=-(r*n+t)/o]]:[[n=(o*e-s*t)/(s*r-o*a),i=-(r*n+t)/o]]).map(function(t){return[t[0],t[1]]})}function Ft(t,e){var i=e.map(function(e){return[0,1].map(function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]})}),e=[];if(2===t.length){var n=t[0],r=n[0],n=n[1];if(d(r-t[1][0])){if(!d(n-t[1][1])){var o=Math.max.apply(Math,i.map(function(t){return t[0][0]})),a=Math.min.apply(Math,i.map(function(t){return t[0][1]}));if(0<d(o-a))return[];e=[[o,n],[a,n]]}}else{o=Math.max.apply(Math,i.map(function(t){return t[1][0]})),a=Math.min.apply(Math,i.map(function(t){return t[1][1]}));if(0<d(o-a))return[];e=[[r,o],[r,a]]}}return(e=e.length?e:t.filter(function(t){var e=t[0],n=t[1];return i.every(function(t){return 0<=d(e-t[0][0])&&0<=d(t[0][1]-e)&&0<=d(n-t[1][0])&&0<=d(t[1][1]-n)})})).map(function(t){return[d(t[0]),d(t[1])]})}function D(n){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}(n.slice(1),[n[0]]).map(function(t,e){return[n[e],t]})}function Bt(t,e){var r,a,s,c,u,l,n;return e=e,r=(t=t).slice(),a=e.slice(),-1===$(r)&&r.reverse(),-1===$(a)&&a.reverse(),s=D(r),c=D(a),t=s.map(function(t){return k(t[0],t[1])}),u=c.map(function(t){return k(t[0],t[1])}),l=[],t.forEach(function(n,i){var r=s[i],o=[];u.forEach(function(t,e){t=Ft(Xt(n,t),[r,c[e]]);o.push.apply(o,t.map(function(t){return{index1:i,index2:e,pos:t,type:"intersection"}}))}),o.sort(function(t,e){return J(r[0],t.pos)-J(r[0],e.pos)}),l.push.apply(l,o),w(r[1],a)&&l.push({index1:i,index2:-1,pos:r[1],type:"inside"})}),c.forEach(function(t,n){var i,e;w(t[1],r)&&(i=!1,-1===(e=o(l,function(t){if(t.index2!==n)return!!i;i=!0}))&&(i=!1,e=o(l,function(t){var e=t.index1,t=t.index2;if(-1!==e||t+1!==n)return!!i;i=!0})),-1===e?l.push({index1:-1,index2:n,pos:t[1],type:"inside"}):l.splice(e,0,{index1:-1,index2:n,pos:t[1],type:"inside"}))}),n={},l.filter(function(t){t=t.pos,t=t[0]+"x"+t[1];return!n[t]&&(n[t]=!0)}).map(function(t){return t.pos})}function r(t,e,n){void 0===n&&(n=Math.sqrt(t.length));var i=[],r=t.length/n,o=e.length/r;if(!r)return e;if(!o)return t;for(var a=0;a<n;++a)for(var s=0;s<o;++s)for(var c=i[s*n+a]=0;c<r;++c)i[s*n+a]+=t[c*n+a]*e[s*r+c];return i}function jt(t,e){return r(t,[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1],4)}function Kt(t,e){return r(t,[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1],4)}function Wt(t,e){return r(t,(t=e,e=4,n=Math.cos(t),t=Math.sin(t),(i=At(e))[0]=n,i[1]=t,i[e]=-t,i[e+1]=n,i));var n,i}function M(t,e){var n=e[0],i=e[1],e=e[2];return r(t,[void 0===n?1:n,0,0,0,0,void 0===i?1:i,0,0,0,0,void 0===e?1:e,0,0,0,0,1],4)}function x(t,e){var n=e[0],i=e[1],e=e[2];return r(t,[1,0,0,0,0,1,0,0,0,0,1,0,void 0===n?0:n,void 0===i?0:i,void 0===e?0:e,1],4)}function P(t,e){return r(t,e,4)}function At(t){for(var e=t*t,n=[],i=0;i<e;++i)n[i]=i%(t+1)?0:1;return n}function O(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Rt(t){return t=(R(t=t)?t:function(t){return L(t,"")}(t)).map(function(t){var e,n,i,t=!(t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t=t))||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]},r=t.prefix,t=t.value,o=null,a=r,s="";return"translate"===r||"translateX"===r||"translate3d"===r?(o=x,s=[(i=c(t).map(function(t){return parseFloat(t)}))[0],void 0===(e=i[1])?0:e,void 0===(e=i[2])?0:e]):"translateY"===r?(o=x,s=[0,parseFloat(t),0]):"translateZ"===r?(o=x,s=[0,0,parseFloat(t)]):"scale"===r||"scale3d"===r?(o=M,s=[n=(i=c(t).map(function(t){return parseFloat(t)}))[0],void 0===(e=i[1])?n:e,void 0===(e=i[2])?1:e]):"scaleX"===r?(o=M,s=[n=parseFloat(t),1,1]):"scaleY"===r?(o=M,s=[1,parseFloat(t),1]):"scaleZ"===r?(o=M,s=[1,1,parseFloat(t)]):"rotate"===r||"rotateZ"===r||"rotateX"===r||"rotateY"===r?(e=(i=q(t)).unit,n=i.value,"rotate"===r||"rotateZ"===r?(a="rotateZ",o=Wt):"rotateX"===r?o=jt:"rotateY"===r&&(o=Kt),s="rad"===e?n:n*Math.PI/180):"matrix3d"===r?(o=P,s=c(t).map(function(t){return parseFloat(t)})):"matrix"===r?(o=P,s=[(i=c(t).map(function(t){return parseFloat(t)}))[0],i[1],0,0,i[2],i[3],0,0,0,0,1,0,i[4],i[5],0,1]):a="",{name:r,functionName:a,value:t,matrixFunction:o,functionValue:s}}),n=O(),t.forEach(function(t){var e=t.matrixFunction,t=t.functionValue;e&&(n=e(n,t))}),n;var n}function T(t,e){n=t,e=[e[0],e[1]||0,e[2]||0,1],i=(n=r(t,e,t=void 0===(t=4)?e.length:t))[t-1];var n,i,e=n.map(function(t){return t/i}),t=e[3]||1;return[e[0]/t,e[1]/t,e[2]/t]}function It(t,e){void 0===e&&(e=document.body);for(var n=t,i=O();n;){i=P(Rt(getComputedStyle(n).transform),i);if(n===e)break;n=n.parentElement}return(i=function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var n=t.slice(),i=At(e),r=0;r<e;++r){var o=e*r+r;if(!j(n[o],B))for(var a=r+1;a<e;++a)if(n[e*r+a]){v=g=p=d=f=h=l=u=c=s=void 0;for(var s=n,c=i,u=r,l=a,h=e,f=0;f<h;++f){var d=u+f*h,p=l+f*h,g=s[d],v=c[d];s[d]=s[p],s[p]=g,c[d]=c[p],c[p]=v}break}if(!j(n[o],B))return[];b=_=S=E=C=y=m=void 0;for(var m=n,y=i,C=r,E=e,S=n[o],_=0;_<E;++_){var b=C+_*E;m[b]/=S,y[b]/=S}for(a=0;a<e;++a){var k=a,D=n[a+r*e];if(j(D,B)&&r!==a){F=X=Y=T=O=P=x=M=w=void 0;for(var w=n,M=i,x=k,P=r,O=e,T=-D,Y=0;Y<O;++Y){var X=x+Y*O,F=P+Y*O;w[X]+=w[F]*T,M[X]+=M[F]*T}}}}return i}(i,4))[12]=0,i[13]=0,i[14]=0,i}function Nt(t,e){return document.elementFromPoint&&document.elementFromPoint(t,e)||null}function Lt(t,e,n){var i=t.tag,r=t.children,o=t.attributes,a=t.className,s=t.style,c=e||document.createElement(i);for(l in o)c.setAttribute(l,o[l]);var u=c.children;if(r.forEach(function(t,e){Lt(t,u[e],c)}),a&&a.split(" ").forEach(function(t){var e,n;n=t,((e=c).classList?e.classList.contains(n):e.className.match(new RegExp("(\\s|^)"+n+"(\\s|$)")))||(e=t,(n=c).classList?n.classList.add(e):n.className+=" "+e)}),s){var l,h=c.style;for(l in s)h[l]=s[l]}return!e&&n&&n.appendChild(c),c}function qt(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var e=e||{},r=e.className,o=e.style;return{tag:t,className:void 0===r?"":r,style:void 0===o?{}:o,attributes:function(t,e){var n={};for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}(e,["className","style"]),children:n}}function Gt(t,e,n){t!==e&&n(t,e)}function Ht(t,e,n){void 0===n&&(n=t.data.boundArea);var i=t.distX,i=void 0===i?0:i,r=t.distY,r=void 0===r?0:r,t=t.data,o=t.startX,t=t.startY;0<e&&(i=(0<=i?1:-1)*(e*(a=Math.sqrt((i*i+r*r)/(1+e*e)))),r=(0<=r?1:-1)*a),i=(0<=i?1:-1)*(n=(a=function(t,n,i,e){if(!e)return t.map(function(t,e){return Z(t,n[e],i[e])});var r=t[0],o=t[1],a=(s=U(t,n,!1,e=!0===e?r/o:e))[0],s=s[1],e=(t=U(t,i,!0,e))[0],t=t[1];return r<a||o<s?(r=a,o=s):(e<r||t<o)&&(r=e,o=t),[r,o]}([Math.abs(i),Math.abs(r)],[0,0],[i<0?o-n.left:n.right-o,r<0?t-n.top:n.bottom-t],!!e))[0]),r=(0<=r?1:-1)*(e=a[1]);var a=o+Math.min(0,i),o=t+Math.min(0,r);return{left:a,top:o,right:a+n,bottom:o+e,width:n,height:e}}function Zt(t){var t=t.getBoundingClientRect(),e=t.left,n=t.top,i=t.width,t=t.height;return{pos1:[e,n],pos2:[e+i,n],pos3:[e,n+t],pos4:[e+i,n+t]}}function Ut(t,e,n){var t=p(t,e),i=t.list,r=t.prevList,e=t.added,o=t.removed,t=t.maintained;return a(a(a([],e.map(function(t){return i[t]}),!0),o.map(function(t){return r[t]}),!0),n?t.map(function(t){t=t[1];return i[t]}):[],!0)}function Vt(t,e,n,i){var r,o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",t),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=(r=t,t=e,n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,function(t,e){e=e.trim();return(e?c(e):[""]).map(function(t){t=t.trim();return 0===t.indexOf("@")?t:-1<t.indexOf(":global")?t.replace(/\:global/g,""):-1<t.indexOf(":host")?""+t.replace(/\:host/g,"."+r):t?"."+r+" "+t:"."+r}).join(", ")+" {"})),(i||document.head||document.body).appendChild(o),o}$t="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(zt="\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n pointer-events: none;\n will-change: transform;\n z-index: 100;\n}\n").toString(36),X=0;var zt,Y,$t,X,Jt,Qt={className:$t,inject:function(t,e){void 0===e&&(e={});var n,i=function(t){if(t&&t.getRootNode){t=t.getRootNode();if(11===t.nodeType)return t}}(t),r=0===X;return(i||r)&&(n=Vt($t,zt,e,i)),r&&(Y=n),i||++X,{destroy:function(){i?(t.removeChild(n),n=null):(0<X&&--X,0===X&&Y&&(Y.parentNode.removeChild(Y),Y=null))}}}},te="selecto-selection ".concat(Qt.className),ee=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","continueSelectWithoutDeselect","toggleContinueSelect","toggleContinueSelectWithoutDeselect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside","rootContainer","dragCondition","clickBySelectEnd"],e=a(["dragContainer","cspNonce","preventClickEventOnDrag","preventClickEventOnDragStart","preventRightClick"],ee,!0),_t={boundContainer:null,portalContainer:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,toggleContinueSelectWithoutDeselect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object,checkInput:Boolean,preventDefault:Boolean,cspNonce:String,ratio:Number,getElementRect:Function,preventDragFromInside:Boolean,rootContainer:Object,dragCondition:Function,clickBySelectEnd:Boolean,continueSelectWithoutDeselect:Boolean,preventClickEventOnDragStart:Boolean,preventClickEventOnDrag:Boolean},ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return K(e,t),e}(function(n){function t(t){void 0===t&&(t={});var p=n.call(this)||this,e=(p.selectedTargets=[],p.dragScroll=new vt,p._onDragStart=function(t,e){var n=t.data,i=t.clientX,r=t.clientY,o=t.inputEvent,a=p.options,s=a.selectFromInside,c=a.selectByClick,u=a.rootContainer,l=a.boundContainer,h=a.preventDragFromInside,h=void 0===h||h,f=a.clickBySelectEnd,a=a.dragCondition;if(!a||a(t)){n.data={},n.innerWidth=window.innerWidth,n.innerHeight=window.innerHeight,p.findSelectableTargets(n),n.startSelectedTargets=p.selectedTargets,n.scaleMatrix=O(),n.containerX=0;var a={left:-1/(n.containerY=0),top:-1/0,right:1/0,bottom:1/0},d=(u&&(d=p.container.getBoundingClientRect(),n.containerX=d.left,n.containerY=d.top,n.scaleMatrix=It(p.container,u)),l&&((l=(d=v(l)&&"element"in l?g({left:!0,top:!0,bottom:!0,right:!0},l):{element:l,left:!0,top:!0,bottom:!0,right:!0}).element)&&(l=(I(l)?document.querySelector(l):!0===l?p.container:l).getBoundingClientRect(),d.left&&(a.left=l.left),d.top&&(a.top=l.top),d.right&&(a.right=l.right),d.bottom&&(a.bottom=l.bottom))),n.boundArea=a,{left:i,top:r,right:i,bottom:r,width:0,height:0}),l=[],e=0<(l=s&&(!c||f)?l:(a=p._findElement(e||Nt(i,r),n.selectableTargets))?[a]:[]).length,a=!s&&e;if(a&&!c)return t.stop(),!1;s=o.type;return t.isClick||"mousedown"!==s&&"touchstart"!==s||p.emit("dragStart",g(g({},t),{data:n.data}))?(p.continueSelect?(l=Ut(p.selectedTargets,l,p.continueSelectWithoutDeselect),n.startPassedTargets=p.selectedTargets):n.startPassedTargets=[],p._select(l,d,t,!0),n.startX=i,n.startY=r,n.selectFlag=!1,n.preventDragFromInside=!1,o.target&&(e=T(n.scaleMatrix,[i-n.containerX,r-n.containerY]),p.target.style.cssText+="position: ".concat(u?"absolute":"fixed",";")+"left:0px;top:0px;"+"transform: translate(".concat(e[0],"px, ").concat(e[1],"px)")),a&&c&&!f?(o.preventDefault(),h&&(p._selectEnd(n.startSelectedTargets,n.startPassedTargets,d,t),n.preventDragFromInside=!0)):(n.selectFlag=!0,"touchstart"===s&&o.preventDefault(),(l=p.options.scrollOptions)&&l.container&&p.dragScroll.dragStart(t,l),f&&(n.selectFlag=!1,t.preventDrag())),!0):(t.stop(),!1)}t.stop()},p._onDrag=function(t){if(t.data.selectFlag){var e=p.scrollOptions;if(null!=e&&e.container&&p.dragScroll.drag(t,e))return}p._checkSelected(t)},p._onDragEnd=function(t){var e=t.data,n=t.inputEvent,i=Ht(t,p.options.ratio),r=e.selectFlag;n&&p.emit("dragEnd",g(g({isDouble:!!t.isDouble,isClick:!!t.isClick,isDrag:!1,isSelect:r},t),{data:e.data,rect:i})),p.target.style.cssText+="display: none;",r?(e.selectFlag=!1,p.dragScroll.dragEnd()):p.selectByClick&&p.clickBySelectEnd&&(n=p._findElement(Nt(t.clientX,t.clientY),e.selectableTargets),p._select(n?[n]:[],i,t)),e.preventDragFromInside||p._selectEnd(e.startSelectedTargets,e.startPassedTargets,i,t)},p._onKeyDown=function(t){var e,n=p.options,i=!1;p._keydownContinueSelect||(e=p._sameCombiKey(t,n.toggleContinueSelect),i=p._keydownContinueSelect=e),p._keydownContinueSelectWithoutDeselection||(e=p._sameCombiKey(t,n.toggleContinueSelectWithoutDeselect),p._keydownContinueSelectWithoutDeselection=e,i=i||e),i&&p.emit("keydown",{keydownContinueSelect:p._keydownContinueSelect,keydownContinueSelectWithoutDeselection:p._keydownContinueSelectWithoutDeselection})},p._onKeyUp=function(t){var e,n=p.options,i=!1;p._keydownContinueSelect&&(e=p._sameCombiKey(t,n.toggleContinueSelect,!0),p._keydownContinueSelect=!e,i=e),p._keydownContinueSelectWithoutDeselection&&(e=p._sameCombiKey(t,n.toggleContinueSelectWithoutDeselect,!0),p._keydownContinueSelectWithoutDeselection=!e,i=i||e),i&&p.emit("keyup",{keydownContinueSelect:p._keydownContinueSelect,keydownContinueSelectWithoutDeselection:p._keydownContinueSelectWithoutDeselection})},p._onBlur=function(){(p._keydownContinueSelect||p._keydownContinueSelectWithoutDeselection)&&(p._keydownContinueSelect=!1,p._keydownContinueSelectWithoutDeselection=!1,p.emit("keyup",{keydownContinueSelect:p._keydownContinueSelect,keydownContinueSelectWithoutDeselection:p._keydownContinueSelectWithoutDeselection}))},p._onDocumentSelectStart=function(e){var t,n;p.gesto.isFlag()&&(t=(t=(t=p.dragContainer)===window?document.documentElement:t)instanceof Element?[t]:[].slice.call(t),n=e.target,t.some(function(t){if(t===n||t.contains(n))return e.preventDefault(),!0}))},p.target=t.portalContainer,t.container),t=(p.options=g({portalContainer:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,clickBySelectEnd:!1,hitRate:100,continueSelect:!1,continueSelectWithoutDeselect:!1,toggleContinueSelect:null,toggleContinueSelectWithoutDeselect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,dragCondition:null,rootContainer:null,getElementRect:Zt,cspNonce:"",ratio:0},t),p.options.portalContainer);return t&&(e=t.parentElement),p.container=e||document.body,p.initElement(),p.initDragScroll(),p.setKeyController(),p}K(t,n);var i,r,e=t.prototype;return e.setSelectedTargets=function(t){var e=p(this.selectedTargets,t),n=e.added,i=e.removed,r=e.prevList,o=e.list;return this.selectedTargets=t,{added:n.map(function(t){return o[t]}),removed:i.map(function(t){return r[t]}),selected:t}},e.setSelectedTargetsByPoints=function(t,e){var n=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),r=Math.max(t[0],e[0]),t=Math.max(t[1],e[1]),e={left:n,top:i,right:r,bottom:t,width:r-n,height:t-i},r={ignoreClick:!0},n=(this.findSelectableTargets(r),this.hitTest(e,r)),t=this.setSelectedTargets(n);return g(g({},t),{rect:e})},e.selectTargetsByPoints=function(t,e){var t=new MouseEvent("mousedown",{clientX:t[0],clientY:t[1],cancelable:!0,bubbles:!0}),n=new MouseEvent("mousemove",{clientX:e[0],clientY:e[1],cancelable:!0,bubbles:!0}),e=new MouseEvent("mousemove",{clientX:e[0],clientY:e[1],cancelable:!0,bubbles:!0}),i=this.gesto;!1!==i.onDragStart(t)&&(i.onDrag(n),i.onDragEnd(e))},e.getSelectedTargets=function(){return this.selectedTargets},e.triggerDragStart=function(t){return this.gesto.triggerDragStart(t),this},e.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),E(document,"selectstart",this._onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},e.getElementPoints=function(t){var e,n,i,r,o,a,s,c,u,l=this.getElementRect||Zt,h=l(t),h=[h.pos1,h.pos2,h.pos4,h.pos3];return l!==Zt?(l=t.getBoundingClientRect(),t=h,e=(l=l).width,n=l.height,i=l.left,r=l.top,o=(l=Yt(t)).minX,a=l.minY,s=l.maxX,l=l.maxY,c=e/(s-o),u=n/(l-a),t.map(function(t){return[i+(t[0]-o)*c,r+(t[1]-a)*u]})):h},e.getSelectableElements=function(){var e=[];return this.options.selectableTargets.forEach(function(t){v(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){e.push(t)})}),e},e.checkScroll=function(){var t;!this.gesto.isFlag()||null!=(t=this.scrollOptions)&&t.container&&this.dragScroll.checkScroll(g({inputEvent:this.gesto.getCurrentEvent()},t))},e.findSelectableTargets=function(t){var e=this,n=(void 0===t&&(t=this.gesto.getEventData()),this.getSelectableElements()),i=n.map(function(t){return e.getElementPoints(t)});t.selectableTargets=n,t.selectablePoints=i,this._refreshGroups(t)},e.clickTarget=function(t,e){var n="touches"in(i=t)?{clientX:(n=i.touches[0]||i.changedTouches[0]).clientX,clientY:n.clientY}:{clientX:i.clientX,clientY:i.clientY},i={data:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:t,isClick:!0,stop:function(){return!1}};return this._onDragStart(i,e)&&this._onDragEnd(i),this},e.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect,t=t.toggleContinueSelectWithoutDeselect;this.keycon&&(this.keycon.destroy(),this.keycon=null),(n||t)&&(this.keycon=new Ot(e||window),this.keycon.keydown(this._onKeyDown).keyup(this._onKeyUp).on("blur",this._onBlur))},e.setKeyEvent=function(){var t=this.options,e=t.toggleContinueSelect,t=t.toggleContinueSelectWithoutDeselect;!e&&!t||this.keycon||this.setKeyController()},e.setKeyContainer=function(t){var e=this,n=this.options;Gt(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},e.getContinueSelect=function(){var t=this.options,e=t.continueSelect;return t.toggleContinueSelect&&this._keydownContinueSelect?!e:e},e.getContinueSelectWithoutDeselect=function(){var t=this.options,e=t.continueSelectWithoutDeselect;return t.toggleContinueSelectWithoutDeselect&&this._keydownContinueSelectWithoutDeselection?!e:e},e.setToggleContinueSelect=function(t){var e=this,n=this.options;Gt(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},e.setToggleContinueSelectWithoutDeselect=function(t){var e=this,n=this.options;Gt(n.toggleContinueSelectWithoutDeselect,t,function(){n.toggleContinueSelectWithoutDeselect=t,e.setKeyEvent()})},e.setPreventDefault=function(t){this.gesto.options.preventDefault=t},e.setCheckInput=function(t){this.gesto.options.checkInput=t},e.initElement=function(){this.target=Lt(qt("div",{className:te}),this.target,this.container);var t=this.target,e=this.options,n=e.dragContainer,i=e.checkInput,r=e.preventDefault,o=e.preventClickEventOnDragStart,a=e.preventClickEventOnDrag,s=e.preventClickEventByCondition,e=e.preventRightClick,e=void 0===e||e;this.dragContainer="string"==typeof n?[].slice.call(document.querySelectorAll(n)):n||this.target.parentNode,this.gesto=new rt(this.dragContainer,{checkWindowBlur:!0,container:window,checkInput:i,preventDefault:r,preventClickEventOnDragStart:o,preventClickEventOnDrag:a,preventClickEventByCondition:s,preventRightClick:e}).on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd}),C(document,"selectstart",this._onDocumentSelectStart),this.injectResult=Qt.inject(t,{nonce:this.options.cspNonce})},e.hitTest=function(t,e){var n,i,r=this.options,o=r.hitRate,a=r.selectByClick,r=t.left,s=t.top,c=t.right,t=t.bottom,u=e.innerGroups,l=e.innerWidth,h=e.innerHeight,f=e.clientX,d=e.clientY,p=e.ignoreClick,g=[[r,s],[c,s],[c,t],[r,t]],v=function(t){var e=!p&&w([f,d],t);if(a&&e)return!0;e=Bt(g,t);if(!e.length)return!1;var e=Tt(e),t=Tt(t),n=q("".concat(o));return"px"===n.unit?e>=n.value:Z(Math.round(e/t*100),0,100)>=Math.min(100,n.value)};if(!u)return n=e.selectableTargets,i=e.selectablePoints,n.filter(function(t,e){return v(i[e])});for(var m=[],e=Math.floor(r/l),y=Math.floor(c/l),C=Math.floor(s/h),E=Math.floor(t/h),S=e;S<=y;++S){var _=u[S];if(_)for(var b=C;b<=E;++b)!function(t){t=_[t];if(!t)return;var e=t.points,n=t.targets;e.forEach(function(t,e){v(t)&&m.push(n[e])})}(b)}var k=m;if("undefined"==typeof Map)return k.filter(function(t,e){return k.indexOf(t)===e});var D=new Map;return k.filter(function(t){return!D.has(t)&&(D.set(t,!0),!0)})},e.initDragScroll=function(){var o=this;this.dragScroll.on("scroll",function(t){var e=t.container,t=t.direction;o.emit("scroll",{container:e,direction:t})}).on("move",function(t){var e,n=t.offsetX,i=t.offsetY,t=t.inputEvent,r=o.gesto;r&&r.isFlag()&&(e=(r=o.gesto.getEventData()).boundArea,r.startX-=n,r.startY-=i,r.selectablePoints.forEach(function(t){t.forEach(function(t){t[0]-=n,t[1]-=i})}),o._refreshGroups(r),e.left-=n,e.right-=n,e.top-=i,e.bottom-=i,o.gesto.scrollBy(n,i,t.inputEvent,!1),o._checkSelected(o.gesto.getCurrentEvent()))})},e._select=function(t,e,n,i){var r=n.inputEvent,n=n.data,o=this.setSelectedTargets(t),a=o.added,o=o.removed;i&&this.emit("selectStart",{selected:t,added:a,removed:o,rect:e,inputEvent:r,data:n.data}),(a.length||o.length)&&this.emit("select",{selected:t,added:a,removed:o,rect:e,inputEvent:r,data:n.data})},e._selectEnd=function(t,e,n,i){var r=i.inputEvent,o=i.isDouble,a=i.data,t=p(t,this.selectedTargets),s=t.added,c=t.removed,u=t.prevList,l=t.list,t=p(e,this.selectedTargets),e=t.added,h=t.removed,f=t.prevList,d=t.list,t=r&&r.type,t="mousedown"===t||"touchstart"===t;this.emit("selectEnd",{selected:this.selectedTargets,added:s.map(function(t){return l[t]}),removed:c.map(function(t){return u[t]}),afterAdded:e.map(function(t){return d[t]}),afterRemoved:h.map(function(t){return f[t]}),isDragStart:t,isClick:!!i.isClick,isDouble:!!o,rect:n,inputEvent:r,data:a.data})},e._checkSelected=function(t,e){void 0===e&&(e=Ht(t,this.options.ratio));var n=t.data,i=e.top,r=e.left,o=e.width,a=e.height,s=n.selectFlag,c=n.containerX,u=n.containerY,l=n.scaleMatrix,r=T(l,[r-c,i-u]),c=T(l,[o,a]),i=[];s&&(this.target.style.cssText+="display: block;left:0px;top:0px;"+"transform: translate(".concat(r[0],"px, ").concat(r[1],"px);")+"width:".concat(c[0],"px;height:").concat(c[1],"px;"),u=this.hitTest(e,n),i=Ut(n.startPassedTargets,u,this.continueSelect&&this.continueSelectWithoutDeselect),this.selectedTargets=i),!1===this.emit("drag",g(g({},t),{data:n.data,isSelect:s,rect:e}))?(this.target.style.cssText+="display: none;",t.stop()):s&&this._select(i,e,t)},e._sameCombiKey=function(t,e,n){if(!e)return!1;var i,r=xt(t.inputEvent,t.key),e=[].concat(e),e=R(e[0])?e:[e];return n?(i=t.key,e.some(function(t){return t.some(function(t){return t===i})})):e.some(function(t){return t.every(function(t){return-1<r.indexOf(t)})})},e._findElement=function(t,e){for(var n=t;n&&!(-1<e.indexOf(n));)n=n.parentElement;return n},e._refreshGroups=function(t){var l,e,h,f=t.innerWidth,d=t.innerHeight;f&&d?(l=t.selectableTargets,e=t.selectablePoints,h={},e.forEach(function(t,e){var n=1/0,i=-1/0,r=1/0,o=-1/0;t.forEach(function(t){var e=Math.floor(t[0]/f),t=Math.floor(t[1]/d);n=Math.min(e,n),i=Math.max(e,i),r=Math.min(t,r),o=Math.max(t,o)});for(var a=n;a<=i;++a)for(var s=r;s<=o;++s){h[a]=h[a]||{},h[a][s]=h[a][s]||{points:[],targets:[]};var c=h[a][s],u=c.targets,c=c.points;u.push(l[e]),c.push(t)}}),t.innerGroups=h):t.innerGroups=null},function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;0<=s;s--)(r=t[s])&&(a=(o<3?r(a):3<o?r(e,n,a):r(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([(i=ee,r=function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},i=G("get ".concat(e)),r=(t[i]?n.get=function(){return this[i]()}:n.get=function(){return this.options[e]},G("set ".concat(e)));t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)},function(t){var e=t.prototype;i.forEach(function(t){r(e,t)})})],t)}(t)),ie={__proto__:null,default:ne,OPTIONS:e,OPTION_TYPES:_t,PROPERTIES:ee,EVENTS:["dragStart","drag","dragEnd","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["clickTarget","getSelectableElements","setSelectedTargets","getElementPoints","getSelectedTargets","findSelectableTargets","triggerDragStart","checkScroll","selectTargetsByPoints","setSelectedTargetsByPoints"],CLASS_NAME:te};for(Jt in ie)ne[Jt]=ie[Jt];return ne});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Selecto=e()}(this,function(){"use strict";var F=function(t,e){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function K(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var g=function(){return(g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||((i=i||Array.prototype.slice.call(e,0,r))[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var W="string",A=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],B=1e-7;function v(t){return t&&"object"==typeof t}function R(t){return Array.isArray(t)}function I(t){return typeof t===W}function N(t,e,n,i,r){if(m(t,e,n))return n;for(var o,a=t,c=e,s=i,u=r,l=n+1;l<s;++l){var h=function(t){var e,n,i=c[t].trim();return i!==a.close||m(a,c,t)?(e=t,-1===(e=(n=y(u,function(t){return t.open===i}))?N(n,c,t,s,u):e)?(o=t,"break"):void(o=t=e)):{value:t}}(l);if(l=o,"object"==typeof h)return h.value;if("break"===h)break}return-1}function m(t,e,n){if(!t.ignore)return null;e=e.slice(Math.max(n-3,0),n+3).join("");return new RegExp(t.ignore).exec(e)}function L(t,e){var e=I(e)?{separator:e}:e,n=e.separator,o=void 0===n?",":n,a=e.isSeparateFirst,c=e.isSeparateOnlyOpenClose,n=e.isSeparateOpenClose,s=void 0===n?c:n,n=e.openCloseCharacters,u=void 0===n?A:n,e=u.map(function(t){var e=t.open,t=t.close;return e===t?e:e+"|"+t}).join("|"),n=new RegExp("(\\s*"+o+"\\s*|"+e+"|\\s+)","g"),l=t.split(n).filter(Boolean),h=l.length,f=[],p=[];function d(){return p.length&&(f.push(p.join("")),p=[])}for(var g,i=0;i<h;++i){var r=function(t){var e=l[t].trim(),n=t,i=y(u,function(t){return t.open===e}),r=y(u,function(t){return t.close===e});if(i){if(-1!==(n=N(i,l,t,h,u))&&s)return d()&&a?(g=t,"break"):(f.push(l.slice(t,n+1).join("")),t=n,a?(g=t,"break"):(g=t,"continue"))}else{if(r&&!m(r,l,t))throw new Error("invalid format: "+r.close);if(i=e,!((""!==(r=o)&&" "!=r||""!==i&&" "!=i)&&i!==r||c))return d(),a?(g=t,"break"):(g=t,"continue")}p.push(l.slice(t,(n=-1===n?h-1:n)+1).join("")),g=t=n}(i),i=g;if("break"===r)break}return p.length&&f.push(p.join("")),f}function s(t){return L(t,",")}function q(t){t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!t)return{prefix:"",unit:"",value:NaN};var e=t[1],n=t[2];return{prefix:e,unit:t[3],value:parseFloat(n)}}function G(t){return t.replace(/[\s-_]([a-z])/g,function(t,e){return e.toUpperCase()})}function H(){return Date.now?Date.now():(new Date).getTime()}function o(t,e,n){void 0===n&&(n=-1);for(var i=t.length,r=0;r<i;++r)if(e(t[r],r,t))return r;return n}function y(t,e,n){e=o(t,e);return-1<e?t[e]:n}function Z(t,e,n){return Math.max(e,Math.min(t,n))}function U(t,i,r,e){return void 0===e&&(e=t[0]/t[1]),[[j(i[0],B),j(i[0]/e,B)],[j(i[1]*e,B),j(i[1],B)]].filter(function(t){return t.every(function(t,e){var e=i[e],n=j(e,B);return r?t<=e||t<=n:e<=t||n<=t})})[0]||t}function V(t,e){var n=e[0]-t[0],e=e[1]-t[1],t=Math.atan2(e,n);return 0<=t?t:t+2*Math.PI}function z(o){return[0,1].map(function(e){for(var t=o.map(function(t){return t[e]}),n=t.length,i=0,r=n-1;0<=r;--r)i+=t[r];return n?i/n:0})}function $(t){var e=z(t),n=V(e,t[0]),e=V(e,t[1]);return n<e&&e-n<Math.PI||e<n&&e-n<-Math.PI?1:-1}function J(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function j(t,e){if(!e)return t;var n=1/e;return Math.round(t/e)/n}function C(t,e,n,i){t.addEventListener(e,n,i)}function E(t,e,n,i){t.removeEventListener(e,n,i)}var Q=function(){return(Q=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};var t=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(v(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(v(t))for(var n in t)this.off(n);else{var i,r;e?(i=this._events[t])&&-1<(r=o(i,function(t){return t.listener===e}))&&i.splice(r,1):this._events[t]=[]}else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var i=this,t=(void 0===n&&(n={}),this._events[e]);if(!e||!t)return!0;var r=!1;return n.eventType=e,n.stop=function(){r=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],a=0,c=o.length;a<c;a++,r++)i[r]=o[a];return i}(t).forEach(function(t){t.listener(n),t.once&&i.off(e,t.listener)}),!r},e.trigger=function(t,e){return this.emit(t,e=void 0===e?{}:e)},e._addEvent=function(t,e,n){var i=this._events;i[t]=i[t]||[],i[t].push(Q({listener:e},n))},t}(),tt=function(t,e){return(tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var S=function(){return(S=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t){return 180*(e=[t[0].clientX,t[0].clientY],t=[t[1].clientX,t[1].clientY],n=t[0]-e[0],t=t[1]-e[1],(0<=(e=Math.atan2(t,n))?e:e+2*Math.PI)/Math.PI);var e,n}function _(t){if(!t)return[];if(t.touches){for(var e=t.touches,n=Math.min(e.length,2),i=[],r=0;r<n;++r)i.push(nt(e[r]));return i}return[nt(t)]}function et(t,e,n){var i=n.length,t=u(t,i),r=t.clientX,o=t.clientY,a=t.originalClientX,t=t.originalClientY,e=u(e,i),c=e.clientX,e=e.clientY,n=u(n,i);return{clientX:a,clientY:t,deltaX:r-c,deltaY:o-e,distX:r-n.clientX,distY:o-n.clientY}}function i(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function nt(t){return{clientX:t.clientX,clientY:t.clientY}}function u(t,e){void 0===e&&(e=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},i=0;i<e;++i){var r=t[i];n.originalClientX+="originalClientX"in r?r.originalClientX:r.clientX,n.originalClientY+="originalClientY"in r?r.originalClientY:r.clientY,n.clientX+=r.clientX,n.clientY+=r.clientY}return e?{clientX:n.clientX/e,clientY:n.clientY/e,originalClientX:n.originalClientX/e,originalClientY:n.originalClientY/e}:n}var b=function(){function t(t){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=t,this.prevClients=t,this.length=t.length}var e=t.prototype;return e.getAngle=function(t){return n(t=void 0===t?this.prevClients:t)},e.getRotation=function(t){return n(t=void 0===t?this.prevClients:t)-n(this.startClients)},e.getPosition=function(t,e){var n=et((t=void 0===t?this.prevClients:t)||this.prevClients,this.prevClients,this.startClients),i=n.deltaX,r=n.deltaY;return this.movement+=Math.sqrt(i*i+r*r),this.prevClients=t,n},e.getPositions=function(n){void 0===n&&(n=this.prevClients);var i=this.prevClients;return this.startClients.map(function(t,e){return et([n[e]],[i[e]],[t])})},e.getMovement=function(t){var e=this.movement;if(!t)return e;var t=u(t,this.length),n=u(this.prevClients,this.length),i=t.clientX-n.clientX,t=t.clientY-n.clientY;return Math.sqrt(i*i+t*t)+e},e.getDistance=function(t){return i(t=void 0===t?this.prevClients:t)},e.getScale=function(t){return i(t=void 0===t?this.prevClients:t)/i(this.startClients)},e.move=function(e,n){this.startClients.forEach(function(t){t.clientX-=e,t.clientY-=n})},t}(),it=["textarea","input"],rt=function(o){function t(){this.constructor=e}var e;function n(t,e){void 0===e&&(e={});var n,g=o.call(this)||this,t=(g.options={},g.flag=!1,g.pinchFlag=!1,g.data={},g.isDrag=!1,g.isPinch=!1,g.isMouse=!1,g.isTouch=!1,g.clientStores=[],g.targets=[],g.prevTime=0,g.doubleFlag=!1,g._dragFlag=!1,g._isMouseEvent=!1,g._isSecondaryButton=!1,g._preventMouseEvent=!1,g.onDragStart=function(t,e){if(void 0===e&&(e=!0),g.flag||!1!==t.cancelable){var n=g.options,i=n.container,r=n.pinchOutside,o=n.preventWheelClick,a=n.preventRightClick,c=n.preventDefault,s=n.checkInput,u=n.preventClickEventOnDragStart,l=n.preventClickEventOnDrag,n=n.preventClickEventByCondition,h=g.isTouch,f=!g.flag;if(g._isSecondaryButton=3===t.which||2===t.button,o&&(2===t.which||1===t.button)||a&&(3===t.which||2===t.button))return g.stop(),!1;if(f){o=document.activeElement,a=t.target;if(a){var p=a.tagName.toLowerCase(),p=-1<it.indexOf(p),d=a.isContentEditable;if(p||d){if(s||o===a)return!1;if(o&&d&&o.isContentEditable&&o.contains(a))return!1}else(c||"touchstart"===t.type)&&o&&(p=o.tagName,(o.isContentEditable||-1<it.indexOf(p))&&o.blur());(u||l||n)&&C(window,"click",g._onClick,!0)}g.clientStores=[new b(_(t))],g.flag=!0,g.isDrag=!1,g._dragFlag=!0,g.data={},g.doubleFlag=H()-g.prevTime<200,g._isMouseEvent=(s=t)&&(-1<s.type.indexOf("mouse")||"button"in s),!g._isMouseEvent&&g._preventMouseEvent&&(g._preventMouseEvent=!1),!1===(g._preventMouseEvent||g.emit("dragStart",S(S({data:g.data,datas:g.data,inputEvent:t,isMouseEvent:g._isMouseEvent,isSecondaryButton:g._isSecondaryButton,isTrusted:e,isDouble:g.doubleFlag},g.getCurrentStore().getPosition()),{preventDefault:function(){t.preventDefault()},preventDrag:function(){g._dragFlag=!1}})))&&g.stop(),g._isMouseEvent&&g.flag&&c&&t.preventDefault()}if(!g.flag)return!1;d=0;f?(g._attchDragEvent(),h&&r&&(d=setTimeout(function(){C(i,"touchstart",g.onDragStart,{passive:!1})}))):h&&r&&E(i,"touchstart",g.onDragStart),g.flag&&((a=t).touches&&2<=a.touches.length)&&(clearTimeout(d),f&&t.touches.length!==t.changedTouches.length||g.pinchFlag||g.onPinchStart(t))}},g.onDrag=function(t,e){if(g.flag){var n=g.options.preventDefault,n=(!g._isMouseEvent&&n&&t.preventDefault(),_(t)),i=g.moveClients(n,t,!1);if(g._dragFlag){if(g.pinchFlag||i.deltaX||i.deltaY)if(!1===(g._preventMouseEvent||g.emit("drag",S(S({},i),{isScroll:!!e,inputEvent:t}))))return void g.stop();g.pinchFlag&&g.onPinch(t,n)}g.getCurrentStore().getPosition(n,!0)}},g.onDragEnd=function(t){var e,n,i,r,o,a;g.flag&&(a=(i=g.options).pinchOutside,e=i.container,o=i.preventClickEventOnDrag,r=i.preventClickEventOnDragStart,i=i.preventClickEventByCondition,n=g.isDrag,(o||r||i)&&requestAnimationFrame(function(){g._allowClickEvent()}),i||r||!o||n||g._allowClickEvent(),g.isTouch&&a&&E(e,"touchstart",g.onDragStart),g.pinchFlag&&g.onPinchEnd(t),0!==(i=null!=t&&t.touches?_(t):[]).length&&g.options.keepDragging?g._addStore(new b(i)):g.flag=!1,r=g._getPosition(),o=H(),a=!n&&g.doubleFlag,g.prevTime=n||a?0:o,g.flag||(g._dettachDragEvent(),g._preventMouseEvent||g.emit("dragEnd",S({data:g.data,datas:g.data,isDouble:a,isDrag:n,isClick:!n,isMouseEvent:g._isMouseEvent,isSecondaryButton:g._isSecondaryButton,inputEvent:t},r)),g.clientStores=[],g._isMouseEvent||(g._preventMouseEvent=!0,requestAnimationFrame(function(){requestAnimationFrame(function(){g._preventMouseEvent=!1})}))))},g.onBlur=function(){g.onDragEnd()},g._allowClickEvent=function(){E(window,"click",g._onClick,!0)},g._onClick=function(t){g._preventMouseEvent=!1;var e=g.options.preventClickEventByCondition;null!=e&&e(t)||(t.stopPropagation(),t.preventDefault())},g._onContextMenu=function(t){g.options.preventRightClick?g.onDragEnd(t):t.preventDefault()},g._passCallback=function(){},[].concat(t)),e=(g.options=S({checkInput:!1,container:1<t.length?window:t[0],preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},e),g.options),i=e.container,r=e.events,e=e.checkWindowBlur;return g.isTouch=-1<r.indexOf("touch"),g.isMouse=-1<r.indexOf("mouse"),g.targets=t,g.isMouse&&(t.forEach(function(t){C(t,"mousedown",g.onDragStart),C(t,"mousemove",g._passCallback)}),C(i,"contextmenu",g._onContextMenu)),e&&C(window,"blur",g.onBlur),g.isTouch&&(n={passive:!1},t.forEach(function(t){C(t,"touchstart",g.onDragStart,n),C(t,"touchmove",g._passCallback,n)})),g}tt(e=n,i=o),e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t);var i=n.prototype;return i.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._allowClickEvent(),this._dettachDragEvent()},i.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce(function(t,e){return t+e.movement},0)},i.isDragging=function(){return this.isDrag},i.isFlag=function(){return this.flag},i.isPinchFlag=function(){return this.pinchFlag},i.isDoubleFlag=function(){return this.doubleFlag},i.isPinching=function(){return this.isPinch},i.scrollBy=function(t,e,n,i){void 0===i&&(i=!0),this.flag&&(this.clientStores[0].move(t,e),i&&this.onDrag(n,!0))},i.move=function(t,e){var n=t[0],i=t[1],t=this.getCurrentStore().prevClients;return this.moveClients(t.map(function(t){var e=t.clientX,t=t.clientY;return{clientX:e+n,clientY:t+i,originalClientX:e,originalClientY:t}}),e,!0)},i.triggerDragStart=function(t){this.onDragStart(t,!1)},i.setEventData=function(t){var e,n=this.data;for(e in t)n[e]=t[e];return this},i.setEventDatas=function(t){return this.setEventData(t)},i.getCurrentEvent=function(t){return S(S({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},i.getEventData=function(){return this.data},i.getEventDatas=function(){return this.data},i.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),E(window,"blur",this.onBlur),this.isMouse&&(t.forEach(function(t){E(t,"mousedown",e.onDragStart)}),E(n,"contextmenu",this._onContextMenu)),this.isTouch&&(t.forEach(function(t){E(t,"touchstart",e.onDragStart)}),E(n,"touchstart",this.onDragStart)),this._dettachDragEvent()},i.onPinchStart=function(t){var e=this.options.pinchThreshold;this.isDrag&&this.getMovement()>e||(e=new b(_(t)),this.pinchFlag=!0,this._addStore(e),!1===this.emit("pinchStart",S(S({data:this.data,datas:this.data,angle:e.getAngle(),touches:this.getCurrentStore().getPositions()},e.getPosition()),{inputEvent:t}))&&(this.pinchFlag=!1))},i.onPinch=function(t,e){var n;!this.flag||!this.pinchFlag||e.length<2||(n=this.getCurrentStore(),this.isPinch=!0,this.emit("pinch",S(S({data:this.data,datas:this.data,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e)),{inputEvent:t})))},i.onPinchEnd=function(t){var e,n;this.pinchFlag&&(e=this.isPinch,this.isPinch=!1,this.pinchFlag=!1,n=this.getCurrentStore(),this.emit("pinchEnd",S(S({data:this.data,datas:this.data,isPinch:e,touches:n.getPositions()},n.getPosition()),{inputEvent:t})))},i.getCurrentStore=function(){return this.clientStores[0]},i.moveClients=function(t,e,n){n=this._getPosition(t,n);return(n.deltaX||n.deltaY)&&(this.isDrag=!0),S(S({data:this.data,datas:this.data},n),{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:e})},i._addStore=function(t){this.clientStores.splice(0,0,t)},i._getPosition=function(t,e){var t=this.getCurrentStore().getPosition(t,e),e=this.clientStores.slice(1).reduce(function(t,e){e=e.getPosition();return t.distX+=e.distX,t.distY+=e.distY,t},t),n=e.distX,e=e.distY;return S(S({},t),{distX:n,distY:e})},i._attchDragEvent=function(){var t=this.options.container,e={passive:!1};this.isMouse&&(C(t,"mousemove",this.onDrag),C(t,"mouseup",this.onDragEnd)),this.isTouch&&(C(t,"touchmove",this.onDrag,e),C(t,"touchend",this.onDragEnd,e),C(t,"touchcancel",this.onDragEnd,e))},i._dettachDragEvent=function(){var t=this.options.container;this.isMouse&&(E(t,"mousemove",this.onDrag),E(t,"mouseup",this.onDragEnd)),this.isTouch&&(E(t,"touchstart",this.onDragStart),E(t,"touchmove",this.onDrag),E(t,"touchend",this.onDragEnd),E(t,"touchcancel",this.onDragEnd))},n}(t);var ot=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,i=this.values,r=n.indexOf(t),r=-1===r?n.length:r;n[r]=t,i[r]=e},t}(),at=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),ct="function"==typeof Map,st=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var ut=function(){function t(t,e,n,i,r,o,a,c){this.prevList=t,this.list=e,this.added=n,this.removed=i,this.changed=r,this.maintained=o,this.changedBeforeAdded=a,this.fixed=c}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){t=this.changedBeforeAdded,n=this.fixed,r=[],o=[],t.forEach(function(t){var e=t[0],t=t[1],n=new st;r[e]=n,o[t]=n}),r.forEach(function(t,e){t.connect(r[e-1])});var n,r,o,t=t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],t=t[1];if(n===t)return[0,0];var n=r[n],t=o[t-1],i=n.getIndex();return n.disconnect(),t?n.connect(t,t.next):n.connect(void 0,r[0]),[i,n.getIndex()]}),a=this.changed,c=[];this.cacheOrdered=t.filter(function(t,e){var n=t[0],t=t[1],e=a[e],i=e[0],e=e[1];if(n!==t)return c.push([i,e]),!0}),this.cachePureChanged=c},t}();var lt,ht="function"==typeof Map?void 0:(lt=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++lt)});function k(t,e){return t=t,e=e,n=ht,i=ct?Map:n?at:ot,n=n||function(t){return t},r=[],o=[],a=[],c=t.map(n),n=e.map(n),s=new i,u=new i,l=[],h=[],f={},p=[],g=d=0,c.forEach(function(t,e){s.set(t,e)}),n.forEach(function(t,e){u.set(t,e)}),c.forEach(function(t,e){t=u.get(t);void 0===t?(++g,o.push(e)):f[t]=g}),n.forEach(function(t,e){t=s.get(t);void 0===t?(r.push(e),++d):(a.push([t,e]),g=f[e]||0,l.push([t-g,e-d]),h.push(e===t),t!==e&&p.push([t,e]))}),o.reverse(),new ut(t,e,r,o,p,a,l,h);var n,i,r,o,a,c,s,u,l,h,f,p,d,g}var ft="function",pt="string";var dt=function(t,e){return(dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function gt(t){t=t.container;return t===document.body?[t.scrollLeft||document.documentElement.scrollLeft,t.scrollTop||document.documentElement.scrollTop]:[t.scrollLeft,t.scrollTop]}function h(t){return t?typeof t===pt?document.querySelector(t):typeof t===ft?t():t instanceof Element?t:"current"in t?t.current:"value"in t?t.value:void 0:null}var vt=function(e){function t(){this.constructor=n}var n;function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._startRect=null,t._startPos=[],t._prevTime=0,t._timer=0,t._prevScrollPos=[0,0],t._isWait=!1,t._flag=!1,t}dt(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var r=i.prototype;return r.dragStart=function(t,e){var n,i,r,o,a=h(e.container);a?(o=r=i=n=0,o=a===document.body?(r=window.innerWidth,window.innerHeight):(n=(a=a.getBoundingClientRect()).top,i=a.left,r=a.width,a.height),this._flag=!0,this._startPos=[t.clientX,t.clientY],this._startRect={top:n,left:i,width:r,height:o},this._prevScrollPos=this._getScrollPosition([0,0],e)):this._flag=!1},r.drag=function(t,e){var n,i,r,o,a,c;if(this._flag)return n=t.clientX,i=t.clientY,r=e.threshold,r=void 0===r?0:r,o=this._startRect,a=this._startPos,c=[0,0],o.top>i-r?(a[1]>o.top||i<a[1])&&(c[1]=-1):o.top+o.height<i+r&&(a[1]<o.top+o.height||i>a[1])&&(c[1]=1),o.left>n-r?(a[0]>o.left||n<a[0])&&(c[0]=-1):o.left+o.width<n+r&&(a[0]<o.left+o.width||n>a[0])&&(c[0]=1),clearTimeout(this._timer),!(!c[0]&&!c[1])&&this._continueDrag(l(l({},e),{direction:c,inputEvent:t,isDrag:!0}))},r.checkScroll=function(t){var e=this;if(this._isWait)return!1;var n=t.prevScrollPos,n=void 0===n?this._prevScrollPos:n,i=t.direction,r=t.throttleTime,r=void 0===r?0:r,o=t.inputEvent,a=t.isDrag,c=this._getScrollPosition(i||[0,0],t),s=c[0]-n[0],n=c[1]-n[1],i=i||[s?Math.abs(s)/s:0,n?Math.abs(n)/n:0];return this._prevScrollPos=c,!(!s&&!n)&&(this.trigger("move",{offsetX:i[0]?s:0,offsetY:i[1]?n:0,inputEvent:o}),r&&a&&(this._timer=window.setTimeout(function(){e._continueDrag(t)},r)),!0)},r.dragEnd=function(){clearTimeout(this._timer)},r._getScrollPosition=function(t,e){var n=e.container,e=e.getScrollPosition;return(void 0===e?gt:e)({container:h(n),direction:t})},r._continueDrag=function(t){var e=this,n=t.container,i=t.direction,r=t.throttleTime,o=t.useScroll,a=t.isDrag,c=t.inputEvent;if(!a||!this._isWait){var s=Date.now?Date.now():(new Date).getTime(),r=Math.max(r+this._prevTime-s,0);if(0<r)return this._timer=window.setTimeout(function(){e._continueDrag(t)},r),!1;this._prevTime=s;r=this._getScrollPosition(i,t);return this._prevScrollPos=r,a&&(this._isWait=!0),this.trigger("scroll",{container:h(n),direction:i,inputEvent:c}),this._isWait=!1,o||this.checkScroll(l(l({},t),{prevScrollPos:r,direction:i,inputEvent:c}))}},i}(t),mt=function(t,e){return(mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function yt(t){return t&&"object"==typeof t}function Ct(t){return Array.isArray(t)}function Et(t){return"string"==typeof t}function c(t,e,n,i){t.addEventListener(e,n,i)}function f(t,e,n,i){t.removeEventListener(e,n,i)}var St=function(){return(St=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};var _t=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(yt(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(yt(t))for(var n in t)this.off(n);else{var i,r;e?(i=this._events[t])&&-1<(r=function(t,e,n){void 0===n&&(n=-1);for(var i=t.length,r=0;r<i;++r)if(e(t[r],r,t))return r;return n}(i,function(t){return t.listener===e}))&&i.splice(r,1):this._events[t]=[]}else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var i=this,t=(void 0===n&&(n={}),this._events[e]);if(!e||!t)return!0;var r=!1;return n.eventType=e,n.stop=function(){r=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],a=0,c=o.length;a<c;a++,r++)i[r]=o[a];return i}(t).forEach(function(t){t.listener(n),t.once&&i.off(e,t.listener)}),!r},e.trigger=function(t,e){return this.emit(t,e=void 0===e?{}:e)},e._addEvent=function(t,e,n){var i=this._events;i[t]=i[t]||[],i[t].push(St({listener:e},n))},t}();(function(t,e){function n(t){if(!t||"object"!=typeof t||(e=t.which||t.keyCode||t.charCode)&&(t=e),"number"==typeof t)return c[t];var e=String(t),t=i[e.toLowerCase()];return t||((t=r[e.toLowerCase()])?t:1===e.length?e.charCodeAt(0):void 0)}n.isEventKey=function(t,e){if(t&&"object"==typeof t){t=t.which||t.keyCode||t.charCode;if(null!=t)if("string"==typeof e){var n=i[e.toLowerCase()];if(n)return n===t;if(n=r[e.toLowerCase()])return n===t}else if("number"==typeof e)return e===t;return!1}};for(var i=(e=t.exports=n).code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91},o=97;o<123;o++)i[String.fromCharCode(o)]=o-32;for(var o=48;o<58;o++)i[o-48]=o;for(o=1;o<13;o++)i["f"+o]=o+111;for(o=0;o<10;o++)i["numpad "+o]=o+96;var a,c=e.names=e.title={};for(o in i)c[i[o]]=o;for(a in r)i[a]=r[a]})(e={exports:{}},e.exports);var bt,e=e.exports,kt=(e.code,e.codes,e.aliases,e.names),Dt=(e.title,{"+":"plus","left command":"meta","right command":"meta"}),wt={shift:1,ctrl:2,alt:3,meta:4};function Mt(t,e){var n,i=(kt[t]||e||"").toLowerCase();for(n in Dt)i=i.replace(n,Dt[n]);return i.replace(/\s/g,"")}function xt(t,e){void 0===e&&(e=Mt(t.keyCode,t.key));t=[t.shiftKey&&"shift",t.ctrlKey&&"ctrl",t.altKey&&"alt",t.metaKey&&"meta"].filter(Boolean);return-1===t.indexOf(e)&&t.push(e),t.filter(Boolean)}function Pt(t){t=t.slice();return t.sort(function(t,e){return(wt[t]||5)-(wt[e]||5)}),t}var Ot=function(n){var t=r,e=n;if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}function r(t){void 0===t&&(t=window);var e=n.call(this)||this;return e.container=t,e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e.clear=function(){return e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e},e.keydownEvent=function(t){e.triggerEvent("keydown",t)},e.keyupEvent=function(t){e.triggerEvent("keyup",t)},e.blur=function(){e.clear(),e.trigger("blur")},c(t,"blur",e.blur),c(t,"keydown",e.keydownEvent),c(t,"keyup",e.keyupEvent),e}mt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i);e=r.prototype;return Object.defineProperty(r,"global",{get:function(){return bt=bt||new r},enumerable:!1,configurable:!0}),r.setGlobal=function(){return this.global},e.destroy=function(){var t=this.container;this.clear(),this.off(),f(t,"blur",this.blur),f(t,"keydown",this.keydownEvent),f(t,"keyup",this.keyupEvent)},e.keydown=function(t,e){return this.addEvent("keydown",t,e)},e.offKeydown=function(t,e){return this.removeEvent("keydown",t,e)},e.offKeyup=function(t,e){return this.removeEvent("keyup",t,e)},e.keyup=function(t,e){return this.addEvent("keyup",t,e)},e.addEvent=function(t,e,n){return Ct(e)?this.on(t+"."+Pt(e).join("."),n):Et(e)?this.on(t+"."+e,n):this.on(t,e),this},e.removeEvent=function(t,e,n){return Ct(e)?this.off(t+"."+Pt(e).join("."),n):Et(e)?this.off(t+"."+e,n):this.off(t,e),this},e.triggerEvent=function(t,e){this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey;var n=Mt(e.keyCode,e.key),i={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:e,keyCode:e.keyCode,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey},e=(this.trigger(t,i),this.trigger(t+"."+n,i),xt(e,n));1<e.length&&this.trigger(t+"."+e.join("."),i)},r}(_t);function p(t){return j(t,B)}function Tt(n){return n.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;0<=n;--n)e+=t[n];return e}(n.map(function(t,e){e=n[e+1]||n[0];return t[0]*e[1]-e[0]*t[1]})))/2}function Yt(t){var e=t.map(function(t){return t[0]}),t=t.map(function(t){return t[1]});return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,t),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,t)}}function w(r,t,e){var i=r[0],o=r[1],n=Yt(t),a=n.minX,n=n.maxX,c=[[a,o],[n,o]],s=d(c[0],c[1]),a=D(t),u=[];if(a.forEach(function(t){var n,e=d(t[0],t[1]),i=t[0];n=e,s.every(function(t,e){return 0===p(t-n[e])})?u.push({pos:r,line:t,type:"line"}):Ft(Xt(s,e),[c,t]).forEach(function(n){t.some(function(t){return e=n,!p((t=t)[0]-e[0])&&!p(t[1]-e[1]);var e})?u.push({pos:n,line:t,type:"point"}):0!==p(i[1]-o)&&u.push({pos:n,line:t,type:"intersection"})})}),!e&&y(u,function(t){return t[0]===i}))return!0;var l=0,h={};return u.forEach(function(t){var e=t.pos,n=t.type,t=t.line;e[0]>i||("intersection"===n?++l:"line"!==n&&"point"===n&&(n=y(t,function(t){return t[1]!==o}),t=h[e[0]],n=n[1]>o?1:-1,t?t!==n&&++l:h[e[0]]=n))}),l%2==1}function d(t,e){var n=t[0],t=t[1],i=e[0]-n,e=e[1]-t,r=(Math.abs(i)<B&&(i=0),Math.abs(e)<B&&(e=0),0),o=0,a=0;return i?a=e?(o=1,-(r=-e/i)*n-t):(o=1,-t):e&&(r=-1,a=n),[r,o,a]}function Xt(t,e){var n,i,r=t[0],o=t[1],t=t[2],a=e[0],c=e[1],e=e[2],s=0===r&&0===a,u=0===o&&0===c;return s&&u?[]:s?(s=-t/o)!=-e/c?[]:[[-1/0,s],[1/0,s]]:u?(s=-t/r)!=-e/a?[]:[[s,-1/0],[s,1/0]]:(0===r?[[n=-(c*(i=-t/o)+e)/a,i]]:0===a?[[n=-(o*(i=-e/c)+t)/r,i]]:0===o?[[n=-t/r,i=-(a*n+e)/c]]:0===c?[[n=-e/a,i=-(r*n+t)/o]]:[[n=(o*e-c*t)/(c*r-o*a),i=-(r*n+t)/o]]).map(function(t){return[t[0],t[1]]})}function Ft(t,e){var i=e.map(function(e){return[0,1].map(function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]})}),e=[];if(2===t.length){var n=t[0],r=n[0],n=n[1];if(p(r-t[1][0])){if(!p(n-t[1][1])){var o=Math.max.apply(Math,i.map(function(t){return t[0][0]})),a=Math.min.apply(Math,i.map(function(t){return t[0][1]}));if(0<p(o-a))return[];e=[[o,n],[a,n]]}}else{o=Math.max.apply(Math,i.map(function(t){return t[1][0]})),a=Math.min.apply(Math,i.map(function(t){return t[1][1]}));if(0<p(o-a))return[];e=[[r,o],[r,a]]}}return(e=e.length?e:t.filter(function(t){var e=t[0],n=t[1];return i.every(function(t){return 0<=p(e-t[0][0])&&0<=p(t[0][1]-e)&&0<=p(n-t[1][0])&&0<=p(t[1][1]-n)})})).map(function(t){return[p(t[0]),p(t[1])]})}function D(n){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],a=0,c=o.length;a<c;a++,r++)i[r]=o[a];return i}(n.slice(1),[n[0]]).map(function(t,e){return[n[e],t]})}function Bt(t,e){var r,a,c,s,u,l,n;return e=e,r=(t=t).slice(),a=e.slice(),-1===$(r)&&r.reverse(),-1===$(a)&&a.reverse(),c=D(r),s=D(a),t=c.map(function(t){return d(t[0],t[1])}),u=s.map(function(t){return d(t[0],t[1])}),l=[],t.forEach(function(n,i){var r=c[i],o=[];u.forEach(function(t,e){t=Ft(Xt(n,t),[r,s[e]]);o.push.apply(o,t.map(function(t){return{index1:i,index2:e,pos:t,type:"intersection"}}))}),o.sort(function(t,e){return J(r[0],t.pos)-J(r[0],e.pos)}),l.push.apply(l,o),w(r[1],a)&&l.push({index1:i,index2:-1,pos:r[1],type:"inside"})}),s.forEach(function(t,n){var i,e;w(t[1],r)&&(i=!1,-1===(e=o(l,function(t){if(t.index2!==n)return!!i;i=!0}))&&(i=!1,e=o(l,function(t){var e=t.index1,t=t.index2;if(-1!==e||t+1!==n)return!!i;i=!0})),-1===e?l.push({index1:-1,index2:n,pos:t[1],type:"inside"}):l.splice(e,0,{index1:-1,index2:n,pos:t[1],type:"inside"}))}),n={},l.filter(function(t){t=t.pos,t=t[0]+"x"+t[1];return!n[t]&&(n[t]=!0)}).map(function(t){return t.pos})}function r(t,e,n){void 0===n&&(n=Math.sqrt(t.length));var i=[],r=t.length/n,o=e.length/r;if(!r)return e;if(!o)return t;for(var a=0;a<n;++a)for(var c=0;c<o;++c)for(var s=i[c*n+a]=0;s<r;++s)i[c*n+a]+=t[s*n+a]*e[c*r+s];return i}function jt(t,e){return r(t,[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1],4)}function Kt(t,e){return r(t,[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1],4)}function Wt(t,e){return r(t,(t=e,e=4,n=Math.cos(t),t=Math.sin(t),(i=At(e))[0]=n,i[1]=t,i[e]=-t,i[e+1]=n,i));var n,i}function M(t,e){var n=e[0],i=e[1],e=e[2];return r(t,[void 0===n?1:n,0,0,0,0,void 0===i?1:i,0,0,0,0,void 0===e?1:e,0,0,0,0,1],4)}function x(t,e){var n=e[0],i=e[1],e=e[2];return r(t,[1,0,0,0,0,1,0,0,0,0,1,0,void 0===n?0:n,void 0===i?0:i,void 0===e?0:e,1],4)}function P(t,e){return r(t,e,4)}function At(t){for(var e=t*t,n=[],i=0;i<e;++i)n[i]=i%(t+1)?0:1;return n}function O(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Rt(t){return t=(R(t=t)?t:function(t){return L(t,"")}(t)).map(function(t){var e,n,i,t=!(t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t=t))||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]},r=t.prefix,t=t.value,o=null,a=r,c="";return"translate"===r||"translateX"===r||"translate3d"===r?(o=x,c=[(i=s(t).map(function(t){return parseFloat(t)}))[0],void 0===(e=i[1])?0:e,void 0===(e=i[2])?0:e]):"translateY"===r?(o=x,c=[0,parseFloat(t),0]):"translateZ"===r?(o=x,c=[0,0,parseFloat(t)]):"scale"===r||"scale3d"===r?(o=M,c=[n=(i=s(t).map(function(t){return parseFloat(t)}))[0],void 0===(e=i[1])?n:e,void 0===(e=i[2])?1:e]):"scaleX"===r?(o=M,c=[n=parseFloat(t),1,1]):"scaleY"===r?(o=M,c=[1,parseFloat(t),1]):"scaleZ"===r?(o=M,c=[1,1,parseFloat(t)]):"rotate"===r||"rotateZ"===r||"rotateX"===r||"rotateY"===r?(e=(i=q(t)).unit,n=i.value,"rotate"===r||"rotateZ"===r?(a="rotateZ",o=Wt):"rotateX"===r?o=jt:"rotateY"===r&&(o=Kt),c="rad"===e?n:n*Math.PI/180):"matrix3d"===r?(o=P,c=s(t).map(function(t){return parseFloat(t)})):"matrix"===r?(o=P,c=[(i=s(t).map(function(t){return parseFloat(t)}))[0],i[1],0,0,i[2],i[3],0,0,0,0,1,0,i[4],i[5],0,1]):a="",{name:r,functionName:a,value:t,matrixFunction:o,functionValue:c}}),n=O(),t.forEach(function(t){var e=t.matrixFunction,t=t.functionValue;e&&(n=e(n,t))}),n;var n}function T(t,e){n=t,e=[e[0],e[1]||0,e[2]||0,1],i=(n=r(t,e,t=void 0===(t=4)?e.length:t))[t-1];var n,i,e=n.map(function(t){return t/i}),t=e[3]||1;return[e[0]/t,e[1]/t,e[2]/t]}function It(t,e){void 0===e&&(e=document.body);for(var n=t,i=O();n;){i=P(Rt(getComputedStyle(n).transform),i);if(n===e)break;n=n.parentElement}return(i=function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var n=t.slice(),i=At(e),r=0;r<e;++r){var o=e*r+r;if(!j(n[o],B))for(var a=r+1;a<e;++a)if(n[e*r+a]){v=g=d=p=f=h=l=u=s=c=void 0;for(var c=n,s=i,u=r,l=a,h=e,f=0;f<h;++f){var p=u+f*h,d=l+f*h,g=c[p],v=s[p];c[p]=c[d],c[d]=g,s[p]=s[d],s[d]=v}break}if(!j(n[o],B))return[];b=_=S=E=C=y=m=void 0;for(var m=n,y=i,C=r,E=e,S=n[o],_=0;_<E;++_){var b=C+_*E;m[b]/=S,y[b]/=S}for(a=0;a<e;++a){var k=a,D=n[a+r*e];if(j(D,B)&&r!==a){F=X=Y=T=O=P=x=M=w=void 0;for(var w=n,M=i,x=k,P=r,O=e,T=-D,Y=0;Y<O;++Y){var X=x+Y*O,F=P+Y*O;w[X]+=w[F]*T,M[X]+=M[F]*T}}}}return i}(i,4))[12]=0,i[13]=0,i[14]=0,i}function Nt(t,e){return document.elementFromPoint&&document.elementFromPoint(t,e)||null}function Lt(t,e,n){var i=t.tag,r=t.children,o=t.attributes,a=t.className,c=t.style,s=e||document.createElement(i);for(l in o)s.setAttribute(l,o[l]);var u=s.children;if(r.forEach(function(t,e){Lt(t,u[e],s)}),a&&a.split(" ").forEach(function(t){var e,n;n=t,((e=s).classList?e.classList.contains(n):e.className.match(new RegExp("(\\s|^)"+n+"(\\s|$)")))||(e=t,(n=s).classList?n.classList.add(e):n.className+=" "+e)}),c){var l,h=s.style;for(l in c)h[l]=c[l]}return!e&&n&&n.appendChild(s),s}function qt(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var e=e||{},r=e.className,o=e.style;return{tag:t,className:void 0===r?"":r,style:void 0===o?{}:o,attributes:function(t,e){var n={};for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}(e,["className","style"]),children:n}}function Gt(t,e,n){t!==e&&n(t,e)}function Ht(t,e,n){void 0===n&&(n=t.data.boundArea);var i=t.distX,i=void 0===i?0:i,r=t.distY,r=void 0===r?0:r,t=t.data,o=t.startX,t=t.startY;0<e&&(i=(0<=i?1:-1)*(e*(a=Math.sqrt((i*i+r*r)/(1+e*e)))),r=(0<=r?1:-1)*a),i=(0<=i?1:-1)*(n=(a=function(t,n,i,e){if(!e)return t.map(function(t,e){return Z(t,n[e],i[e])});var r=t[0],o=t[1],a=(c=U(t,n,!1,e=!0===e?r/o:e))[0],c=c[1],e=(t=U(t,i,!0,e))[0],t=t[1];return r<a||o<c?(r=a,o=c):(e<r||t<o)&&(r=e,o=t),[r,o]}([Math.abs(i),Math.abs(r)],[0,0],[i<0?o-n.left:n.right-o,r<0?t-n.top:n.bottom-t],!!e))[0]),r=(0<=r?1:-1)*(e=a[1]);var a=o+Math.min(0,i),o=t+Math.min(0,r);return{left:a,top:o,right:a+n,bottom:o+e,width:n,height:e}}function Zt(t){var t=t.getBoundingClientRect(),e=t.left,n=t.top,i=t.width,t=t.height;return{pos1:[e,n],pos2:[e+i,n],pos3:[e,n+t],pos4:[e+i,n+t]}}function Ut(t,e,n){var t=k(t,e),i=t.list,r=t.prevList,e=t.added,o=t.removed,t=t.maintained;return a(a(a([],e.map(function(t){return i[t]}),!0),o.map(function(t){return r[t]}),!0),n?t.map(function(t){t=t[1];return i[t]}):[],!0)}function Vt(t,e,n,i){var r,o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",t),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=(r=t,t=e,n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,function(t,e){e=e.trim();return(e?s(e):[""]).map(function(t){t=t.trim();return 0===t.indexOf("@")?t:-1<t.indexOf(":global")?t.replace(/\:global/g,""):-1<t.indexOf(":host")?""+t.replace(/\:host/g,"."+r):t?"."+r+" "+t:"."+r}).join(", ")+" {"})),(i||document.head||document.body).appendChild(o),o}$t="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(zt="\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n pointer-events: none;\n will-change: transform;\n z-index: 100;\n}\n").toString(36),X=0;var zt,Y,$t,X,Jt,Qt={className:$t,inject:function(t,e){void 0===e&&(e={});var n,i=function(t){if(t&&t.getRootNode){t=t.getRootNode();if(11===t.nodeType)return t}}(t),r=0===X;return(i||r)&&(n=Vt($t,zt,e,i)),r&&(Y=n),i||++X,{destroy:function(){i?(t.removeChild(n),n=null):(0<X&&--X,0===X&&Y&&(Y.parentNode.removeChild(Y),Y=null))}}}},te="selecto-selection ".concat(Qt.className),ee=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","continueSelectWithoutDeselect","toggleContinueSelect","toggleContinueSelectWithoutDeselect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside","rootContainer","dragCondition","clickBySelectEnd"],e=a(["dragContainer","cspNonce","preventClickEventOnDrag","preventClickEventOnDragStart","preventRightClick"],ee,!0),_t={boundContainer:null,portalContainer:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,toggleContinueSelectWithoutDeselect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object,checkInput:Boolean,preventDefault:Boolean,cspNonce:String,ratio:Number,getElementRect:Function,preventDragFromInside:Boolean,rootContainer:Object,dragCondition:Function,clickBySelectEnd:Boolean,continueSelectWithoutDeselect:Boolean,preventClickEventOnDragStart:Boolean,preventClickEventOnDrag:Boolean},ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return K(e,t),e}(function(n){function t(t){void 0===t&&(t={});var d=n.call(this)||this,e=(d.selectedTargets=[],d.dragScroll=new vt,d._onDragStart=function(t,e){var n=t.data,i=t.clientX,r=t.clientY,o=t.inputEvent,a=d.options,c=a.selectFromInside,s=a.selectByClick,u=a.rootContainer,l=a.boundContainer,h=a.preventDragFromInside,h=void 0===h||h,f=a.clickBySelectEnd,a=a.dragCondition;if(!a||a(t)){n.data={},n.innerWidth=window.innerWidth,n.innerHeight=window.innerHeight,d.findSelectableTargets(n),n.startSelectedTargets=d.selectedTargets,n.scaleMatrix=O(),n.containerX=0;var a={left:-1/(n.containerY=0),top:-1/0,right:1/0,bottom:1/0},p=(u&&(p=d.container.getBoundingClientRect(),n.containerX=p.left,n.containerY=p.top,n.scaleMatrix=It(d.container,u)),l&&((l=(p=v(l)&&"element"in l?g({left:!0,top:!0,bottom:!0,right:!0},l):{element:l,left:!0,top:!0,bottom:!0,right:!0}).element)&&(l=(I(l)?document.querySelector(l):!0===l?d.container:l).getBoundingClientRect(),p.left&&(a.left=l.left),p.top&&(a.top=l.top),p.right&&(a.right=l.right),p.bottom&&(a.bottom=l.bottom))),n.boundArea=a,{left:i,top:r,right:i,bottom:r,width:0,height:0}),l=[],e=0<(l=c&&(!s||f)?l:(a=d._findElement(e||Nt(i,r),n.selectableTargets))?[a]:[]).length,a=!c&&e;if(a&&!s)return t.stop(),!1;c=o.type;return t.isClick||"mousedown"!==c&&"touchstart"!==c||d.emit("dragStart",g(g({},t),{data:n.data}))?(d.continueSelect?(l=Ut(d.selectedTargets,l,d.continueSelectWithoutDeselect),n.startPassedTargets=d.selectedTargets):n.startPassedTargets=[],d._select(l,p,t,!0),n.startX=i,n.startY=r,n.selectFlag=!1,n.preventDragFromInside=!1,o.target&&(e=T(n.scaleMatrix,[i-n.containerX,r-n.containerY]),d.target.style.cssText+="position: ".concat(u?"absolute":"fixed",";")+"left:0px;top:0px;"+"transform: translate(".concat(e[0],"px, ").concat(e[1],"px)")),a&&s&&!f?(o.preventDefault(),h&&(d._selectEnd(n.startSelectedTargets,n.startPassedTargets,p,t),n.preventDragFromInside=!0)):(n.selectFlag=!0,"touchstart"===c&&o.preventDefault(),(l=d.options.scrollOptions)&&l.container&&d.dragScroll.dragStart(t,l),f&&(n.selectFlag=!1,t.preventDrag())),!0):(t.stop(),!1)}t.stop()},d._onDrag=function(t){if(t.data.selectFlag){var e=d.scrollOptions;if(null!=e&&e.container&&d.dragScroll.drag(t,e))return}d._checkSelected(t)},d._onDragEnd=function(t){var e=t.data,n=t.inputEvent,i=Ht(t,d.options.ratio),r=e.selectFlag;n&&d.emit("dragEnd",g(g({isDouble:!!t.isDouble,isClick:!!t.isClick,isDrag:!1,isSelect:r},t),{data:e.data,rect:i})),d.target.style.cssText+="display: none;",r?(e.selectFlag=!1,d.dragScroll.dragEnd()):d.selectByClick&&d.clickBySelectEnd&&(n=d._findElement(Nt(t.clientX,t.clientY),e.selectableTargets),d._select(n?[n]:[],i,t)),e.preventDragFromInside||d._selectEnd(e.startSelectedTargets,e.startPassedTargets,i,t)},d._onKeyDown=function(t){var e,n=d.options,i=!1;d._keydownContinueSelect||(e=d._sameCombiKey(t,n.toggleContinueSelect),i=d._keydownContinueSelect=e),d._keydownContinueSelectWithoutDeselection||(e=d._sameCombiKey(t,n.toggleContinueSelectWithoutDeselect),d._keydownContinueSelectWithoutDeselection=e,i=i||e),i&&d.emit("keydown",{keydownContinueSelect:d._keydownContinueSelect,keydownContinueSelectWithoutDeselection:d._keydownContinueSelectWithoutDeselection})},d._onKeyUp=function(t){var e,n=d.options,i=!1;d._keydownContinueSelect&&(e=d._sameCombiKey(t,n.toggleContinueSelect,!0),d._keydownContinueSelect=!e,i=e),d._keydownContinueSelectWithoutDeselection&&(e=d._sameCombiKey(t,n.toggleContinueSelectWithoutDeselect,!0),d._keydownContinueSelectWithoutDeselection=!e,i=i||e),i&&d.emit("keyup",{keydownContinueSelect:d._keydownContinueSelect,keydownContinueSelectWithoutDeselection:d._keydownContinueSelectWithoutDeselection})},d._onBlur=function(){(d._keydownContinueSelect||d._keydownContinueSelectWithoutDeselection)&&(d._keydownContinueSelect=!1,d._keydownContinueSelectWithoutDeselection=!1,d.emit("keyup",{keydownContinueSelect:d._keydownContinueSelect,keydownContinueSelectWithoutDeselection:d._keydownContinueSelectWithoutDeselection}))},d._onDocumentSelectStart=function(e){var t,n;d.gesto.isFlag()&&(t=(t=(t=d.dragContainer)===window?document.documentElement:t)instanceof Element?[t]:[].slice.call(t),n=e.target,t.some(function(t){if(t===n||t.contains(n))return e.preventDefault(),!0}))},d.target=t.portalContainer,t.container),t=(d.options=g({portalContainer:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,clickBySelectEnd:!1,hitRate:100,continueSelect:!1,continueSelectWithoutDeselect:!1,toggleContinueSelect:null,toggleContinueSelectWithoutDeselect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,dragCondition:null,rootContainer:null,getElementRect:Zt,cspNonce:"",ratio:0},t),d.options.portalContainer);return t&&(e=t.parentElement),d.container=e||document.body,d.initElement(),d.initDragScroll(),d.setKeyController(),d}K(t,n);var i,r,e=t.prototype;return e.setSelectedTargets=function(t){var e=this.selectedTargets,n=k(e,t),i=n.added,r=n.removed,o=n.prevList,a=n.list;return this.selectedTargets=t,{added:i.map(function(t){return a[t]}),removed:r.map(function(t){return o[t]}),beforeSelected:e,selected:t}},e.setSelectedTargetsByPoints=function(t,e){var n=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),r=Math.max(t[0],e[0]),t=Math.max(t[1],e[1]),e={left:n,top:i,right:r,bottom:t,width:r-n,height:t-i},r={ignoreClick:!0},n=(this.findSelectableTargets(r),this.hitTest(e,r)),t=this.setSelectedTargets(n);return g(g({},t),{rect:e})},e.selectTargetsByPoints=function(t,e){var t=new MouseEvent("mousedown",{clientX:t[0],clientY:t[1],cancelable:!0,bubbles:!0}),n=new MouseEvent("mousemove",{clientX:e[0],clientY:e[1],cancelable:!0,bubbles:!0}),e=new MouseEvent("mousemove",{clientX:e[0],clientY:e[1],cancelable:!0,bubbles:!0}),i=this.gesto;!1!==i.onDragStart(t)&&(i.onDrag(n),i.onDragEnd(e))},e.getSelectedTargets=function(){return this.selectedTargets},e.triggerDragStart=function(t){return this.gesto.triggerDragStart(t),this},e.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),E(document,"selectstart",this._onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},e.getElementPoints=function(t){var e,n,i,r,o,a,c,s,u,l=this.getElementRect||Zt,h=l(t),h=[h.pos1,h.pos2,h.pos4,h.pos3];return l!==Zt?(l=t.getBoundingClientRect(),t=h,e=(l=l).width,n=l.height,i=l.left,r=l.top,o=(l=Yt(t)).minX,a=l.minY,c=l.maxX,l=l.maxY,s=e/(c-o),u=n/(l-a),t.map(function(t){return[i+(t[0]-o)*s,r+(t[1]-a)*u]})):h},e.getSelectableElements=function(){var e=[];return this.options.selectableTargets.forEach(function(t){v(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){e.push(t)})}),e},e.checkScroll=function(){var t;!this.gesto.isFlag()||null!=(t=this.scrollOptions)&&t.container&&this.dragScroll.checkScroll(g({inputEvent:this.gesto.getCurrentEvent()},t))},e.findSelectableTargets=function(t){var e=this,n=(void 0===t&&(t=this.gesto.getEventData()),this.getSelectableElements()),i=n.map(function(t){return e.getElementPoints(t)});t.selectableTargets=n,t.selectablePoints=i,this._refreshGroups(t)},e.clickTarget=function(t,e){var n="touches"in(i=t)?{clientX:(n=i.touches[0]||i.changedTouches[0]).clientX,clientY:n.clientY}:{clientX:i.clientX,clientY:i.clientY},i={data:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:t,isClick:!0,stop:function(){return!1}};return this._onDragStart(i,e)&&this._onDragEnd(i),this},e.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect,t=t.toggleContinueSelectWithoutDeselect;this.keycon&&(this.keycon.destroy(),this.keycon=null),(n||t)&&(this.keycon=new Ot(e||window),this.keycon.keydown(this._onKeyDown).keyup(this._onKeyUp).on("blur",this._onBlur))},e.setKeyEvent=function(){var t=this.options,e=t.toggleContinueSelect,t=t.toggleContinueSelectWithoutDeselect;!e&&!t||this.keycon||this.setKeyController()},e.setKeyContainer=function(t){var e=this,n=this.options;Gt(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},e.getContinueSelect=function(){var t=this.options,e=t.continueSelect;return t.toggleContinueSelect&&this._keydownContinueSelect?!e:e},e.getContinueSelectWithoutDeselect=function(){var t=this.options,e=t.continueSelectWithoutDeselect;return t.toggleContinueSelectWithoutDeselect&&this._keydownContinueSelectWithoutDeselection?!e:e},e.setToggleContinueSelect=function(t){var e=this,n=this.options;Gt(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},e.setToggleContinueSelectWithoutDeselect=function(t){var e=this,n=this.options;Gt(n.toggleContinueSelectWithoutDeselect,t,function(){n.toggleContinueSelectWithoutDeselect=t,e.setKeyEvent()})},e.setPreventDefault=function(t){this.gesto.options.preventDefault=t},e.setCheckInput=function(t){this.gesto.options.checkInput=t},e.initElement=function(){this.target=Lt(qt("div",{className:te}),this.target,this.container);var t=this.target,e=this.options,n=e.dragContainer,i=e.checkInput,r=e.preventDefault,o=e.preventClickEventOnDragStart,a=e.preventClickEventOnDrag,c=e.preventClickEventByCondition,e=e.preventRightClick,e=void 0===e||e;this.dragContainer="string"==typeof n?[].slice.call(document.querySelectorAll(n)):n||this.target.parentNode,this.gesto=new rt(this.dragContainer,{checkWindowBlur:!0,container:window,checkInput:i,preventDefault:r,preventClickEventOnDragStart:o,preventClickEventOnDrag:a,preventClickEventByCondition:c,preventRightClick:e}).on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd}),C(document,"selectstart",this._onDocumentSelectStart),this.injectResult=Qt.inject(t,{nonce:this.options.cspNonce})},e.hitTest=function(t,e){var n,i,r=this.options,o=r.hitRate,a=r.selectByClick,r=t.left,c=t.top,s=t.right,t=t.bottom,u=e.innerGroups,l=e.innerWidth,h=e.innerHeight,f=e.clientX,p=e.clientY,d=e.ignoreClick,g=[[r,c],[s,c],[s,t],[r,t]],v=function(t){var e=!d&&w([f,p],t);if(a&&e)return!0;e=Bt(g,t);if(!e.length)return!1;var e=Tt(e),t=Tt(t),n=q("".concat(o));return"px"===n.unit?e>=n.value:Z(Math.round(e/t*100),0,100)>=Math.min(100,n.value)};if(!u)return n=e.selectableTargets,i=e.selectablePoints,n.filter(function(t,e){return v(i[e])});for(var m=[],e=Math.floor(r/l),y=Math.floor(s/l),C=Math.floor(c/h),E=Math.floor(t/h),S=e;S<=y;++S){var _=u[S];if(_)for(var b=C;b<=E;++b)!function(t){t=_[t];if(!t)return;var e=t.points,n=t.targets;e.forEach(function(t,e){v(t)&&m.push(n[e])})}(b)}var k=m;if("undefined"==typeof Map)return k.filter(function(t,e){return k.indexOf(t)===e});var D=new Map;return k.filter(function(t){return!D.has(t)&&(D.set(t,!0),!0)})},e.initDragScroll=function(){var o=this;this.dragScroll.on("scroll",function(t){var e=t.container,t=t.direction;o.emit("scroll",{container:e,direction:t})}).on("move",function(t){var e,n=t.offsetX,i=t.offsetY,t=t.inputEvent,r=o.gesto;r&&r.isFlag()&&(e=(r=o.gesto.getEventData()).boundArea,r.startX-=n,r.startY-=i,r.selectablePoints.forEach(function(t){t.forEach(function(t){t[0]-=n,t[1]-=i})}),o._refreshGroups(r),e.left-=n,e.right-=n,e.top-=i,e.bottom-=i,o.gesto.scrollBy(n,i,t.inputEvent,!1),o._checkSelected(o.gesto.getCurrentEvent()))})},e._select=function(t,e,n,i){var r=n.inputEvent,n=n.data,t=this.setSelectedTargets(t);i&&this.emit("selectStart",g(g({},t),{rect:e,inputEvent:r,data:n.data})),(t.added.length||t.removed.length)&&this.emit("select",g(g({},t),{rect:e,inputEvent:r,data:n.data}))},e._selectEnd=function(t,e,n,i){var r=i.inputEvent,o=i.isDouble,a=i.data,t=k(t,this.selectedTargets),c=t.added,s=t.removed,u=t.prevList,l=t.list,t=k(e,this.selectedTargets),h=t.added,f=t.removed,p=t.prevList,d=t.list,t=r&&r.type,t="mousedown"===t||"touchstart"===t;this.emit("selectEnd",{startSelected:e,beforeSelected:e,selected:this.selectedTargets,added:c.map(function(t){return l[t]}),removed:s.map(function(t){return u[t]}),afterAdded:h.map(function(t){return d[t]}),afterRemoved:f.map(function(t){return p[t]}),isDragStart:t,isClick:!!i.isClick,isDouble:!!o,rect:n,inputEvent:r,data:a.data})},e._checkSelected=function(t,e){void 0===e&&(e=Ht(t,this.options.ratio));var n=t.data,i=e.top,r=e.left,o=e.width,a=e.height,c=n.selectFlag,s=n.containerX,u=n.containerY,l=n.scaleMatrix,r=T(l,[r-s,i-u]),s=T(l,[o,a]),i=[];c&&(this.target.style.cssText+="display: block;left:0px;top:0px;"+"transform: translate(".concat(r[0],"px, ").concat(r[1],"px);")+"width:".concat(s[0],"px;height:").concat(s[1],"px;"),u=this.hitTest(e,n),i=Ut(n.startPassedTargets,u,this.continueSelect&&this.continueSelectWithoutDeselect)),!1===this.emit("drag",g(g({},t),{data:n.data,isSelect:c,rect:e}))?(this.target.style.cssText+="display: none;",t.stop()):c&&this._select(i,e,t)},e._sameCombiKey=function(t,e,n){if(!e)return!1;var i,r=xt(t.inputEvent,t.key),e=[].concat(e),e=R(e[0])?e:[e];return n?(i=t.key,e.some(function(t){return t.some(function(t){return t===i})})):e.some(function(t){return t.every(function(t){return-1<r.indexOf(t)})})},e._findElement=function(t,e){for(var n=t;n&&!(-1<e.indexOf(n));)n=n.parentElement;return n},e._refreshGroups=function(t){var l,e,h,f=t.innerWidth,p=t.innerHeight;f&&p?(l=t.selectableTargets,e=t.selectablePoints,h={},e.forEach(function(t,e){var n=1/0,i=-1/0,r=1/0,o=-1/0;t.forEach(function(t){var e=Math.floor(t[0]/f),t=Math.floor(t[1]/p);n=Math.min(e,n),i=Math.max(e,i),r=Math.min(t,r),o=Math.max(t,o)});for(var a=n;a<=i;++a)for(var c=r;c<=o;++c){h[a]=h[a]||{},h[a][c]=h[a][c]||{points:[],targets:[]};var s=h[a][c],u=s.targets,s=s.points;u.push(l[e]),s.push(t)}}),t.innerGroups=h):t.innerGroups=null},function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var c=t.length-1;0<=c;c--)(r=t[c])&&(a=(o<3?r(a):3<o?r(e,n,a):r(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([(i=ee,r=function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},i=G("get ".concat(e)),r=(t[i]?n.get=function(){return this[i]()}:n.get=function(){return this.options[e]},G("set ".concat(e)));t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)},function(t){var e=t.prototype;i.forEach(function(t){r(e,t)})})],t)}(t)),ie={__proto__:null,default:ne,OPTIONS:e,OPTION_TYPES:_t,PROPERTIES:ee,EVENTS:["dragStart","drag","dragEnd","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["clickTarget","getSelectableElements","setSelectedTargets","getElementPoints","getSelectedTargets","findSelectableTargets","triggerDragStart","checkScroll","selectTargetsByPoints","setSelectedTargetsByPoints"],CLASS_NAME:te};for(Jt in ie)ne[Jt]=ie[Jt];return ne});
//# sourceMappingURL=selecto.min.js.map
{
"name": "selecto",
"version": "1.20.0",
"version": "1.20.1",
"description": "Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.",

@@ -5,0 +5,0 @@ "main": "./dist/selecto.cjs.js",

@@ -188,5 +188,7 @@ import { IObject } from "@daybrush/utils";

* @typedef
* @property - An Selecto instance itself
*/
export interface CurrentTarget<T = Selecto> {
/**
* An Selecto instance itself
*/
currentTarget: T;

@@ -201,2 +203,6 @@ }

/**
* before selecting elements
*/
beforeSelected: Array<HTMLElement | SVGElement>;
/**
* selected elements

@@ -221,3 +227,3 @@ */

/**
* @property - Rect of Selection Element
* Rect of Selection Element
*/

@@ -229,14 +235,14 @@ rect: Rect;

* @memberof Selecto
* @extends Selecto.SelectedTargets
* @extends Selecto.CurrentTarget
* @extends Selecto.SelectedTargetsWithRect
* @typedef
* @property - An Selecto instance itself
* @property - inputEvent
* @property - Data shared from dragStart, selectStart to dragEnd, selectEnd
*/
export interface OnSelect<T = Selecto> extends CurrentTarget<T>, SelectedTargets {
selected: Array<HTMLElement | SVGElement>;
added: Array<HTMLElement | SVGElement>;
removed: Array<HTMLElement | SVGElement>;
rect: Rect;
export interface OnSelect<T = Selecto> extends CurrentTarget<T>, SelectedTargetsWithRect {
/**
* inputEvent
*/
inputEvent: any;
/**
* Data shared from dragStart, selectStart to dragEnd, selectEnd
*/
data: Record<string, any>;

@@ -247,14 +253,29 @@ }

* @extends Selecto.OnSelect
* @extends Selecto.CurrentTarget
* @typedef
* @property - after added elements
* @property - after removed elements
* @property - Whether it is a mousedown or touchstart event
* @property - Whether it is click
* @property - Wheter it is double click or double start
*/
export interface OnSelectEnd<T = Selecto> extends OnSelect<T>, CurrentTarget<T> {
/**
* start selected elements
*/
startSelected: Array<HTMLElement | SVGElement>;
/**
* after added elements
*/
afterAdded: Array<HTMLElement | SVGElement>;
/**
* after removed elements
*/
afterRemoved: Array<HTMLElement | SVGElement>;
/**
* Whether it is a mousedown or touchstart event
*/
isDragStart: boolean;
/**
* Whether it is click
*/
isClick: boolean;
/**
* Wheter it is double click or double start
*/
isDouble: boolean;

@@ -261,0 +282,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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