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

@egjs/axes

Package Overview
Dependencies
Maintainers
9
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@egjs/axes - npm Package Compare versions

Comparing version 3.1.2 to 3.2.0

0

declaration/animation/AnimationManager.d.ts

@@ -0,0 +0,0 @@ import { Axis, AxisManager } from "../AxisManager";

@@ -0,0 +0,0 @@ import { AxesOption } from "../Axes";

@@ -0,0 +0,0 @@ import Component from "@egjs/component";

@@ -0,0 +0,0 @@ import { ObjectInterface } from "./types";

declare let win: any;
export { win as window };

3

declaration/const.d.ts

@@ -16,6 +16,5 @@ export declare const DIRECTION_NONE = 1;

export declare const TRANSFORM: string;
export declare const PREVENT_SCROLL_CSSPROPS: {
"touch-action": string;
export declare const PREVENT_DRAG_CSSPROPS: {
"user-select": string;
"-webkit-user-drag": string;
};

@@ -0,0 +0,0 @@ export declare const getInsidePosition: (destPos: number, range: number[], circular: boolean[], bounce?: number[]) => number;

@@ -0,0 +0,0 @@ import { ExtendedEvent, InputEventType } from "../types";

@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types";

@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types";

@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types";

@@ -0,0 +0,0 @@ import { InputEventType, ExtendedEvent } from "../types";

@@ -0,0 +0,0 @@ import { InputType } from "./inputType/InputType";

@@ -0,0 +0,0 @@ import Axes from "./Axes";

import Axes from "./Axes";
export default Axes;

@@ -0,0 +0,0 @@ import { InterruptManager } from "./InterruptManager";

@@ -0,0 +0,0 @@ import { Axis } from "../AxisManager";

@@ -0,0 +0,0 @@ import { InputType, InputTypeObserver } from "./InputType";

@@ -11,2 +11,3 @@ import { ActiveEvent, InputEventType } from "../types";

releaseOnScroll?: boolean;
touchAction?: string;
}

@@ -20,3 +21,3 @@ export declare const getDirectionByAngle: (angle: number, thresholdAngle: number) => number;

protected _observer: InputTypeObserver;
protected _direction: any;
protected _direction: number;
protected _enabled: boolean;

@@ -23,0 +24,0 @@ protected _activeEvent: ActiveEvent;

@@ -6,2 +6,3 @@ import { InputType, InputTypeObserver } from "./InputType";

inputType?: string[];
touchAction?: string;
}

@@ -8,0 +9,0 @@ export declare class PinchInput implements InputType {

@@ -0,0 +0,0 @@ import { PanInput, PanInputOption } from "./PanInput";

@@ -0,0 +0,0 @@ import { InputType, InputTypeObserver } from "./InputType";

@@ -0,0 +0,0 @@ import { AxesOption } from "./Axes";

@@ -0,0 +0,0 @@ import { Axis } from "./AxisManager";

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

import { PanInputOption } from "./inputType/PanInput";
import { PinchInputOption } from "./inputType/PinchInput";
import { ObjectInterface } from "./types";

@@ -16,6 +18,12 @@ export declare const toArray: (nodes: NodeList) => HTMLElement[];

export declare const getAngle: (posX: number, posY: number) => number;
export declare const setCssProps: (element: HTMLElement, originalCssProps?: {
export declare const isCssPropsFromAxes: (originalCssProps: {
[key: string]: string;
}) => boolean;
export declare const setCssProps: (element: HTMLElement, option: PanInputOption | PinchInputOption, direction: number) => {
[key: string]: string;
};
export declare const revertCssProps: (element: HTMLElement, originalCssProps: {
[key: string]: string;
}) => {
[key: string]: string;
};

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

repository: https://github.com/naver/egjs-axes
version: 3.1.2
version: 3.2.0
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/agent"),require("@egjs/component")):"function"==typeof define&&define.amd?define(["@egjs/agent","@egjs/component"],e):(t.eg=t.eg||{},t.eg.Axes=e(t.eg.agent,t.eg.Component))}(this,function(t,d){"use strict";var i=function(t,e){return(i=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)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var a,o,f=function(){return(f=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},u="undefined"==typeof window?{navigator:{userAgent:""}}:window,h="left",c="right",l="middle",v="ontouchstart"in u&&"safari"===t().browser.name,n=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),_={"touch-action":"none","user-select":"none","-webkit-user-drag":"none"},g=function(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,s(n.childNodes)):s(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==u&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in u&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return g(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i},p=u.requestAnimationFrame||u.webkitRequestAnimationFrame,m=u.cancelAnimationFrame||u.webkitCancelAnimationFrame;p&&!m?(a={},o=p,p=function(e){var n=o(function(t){a[n]&&e(t)});return a[n]=!0,n},m=function(t){delete a[t]}):p&&m||(p=function(t){return u.setTimeout(function(){t(u.performance&&u.performance.now&&u.performance.now()||(new Date).getTime())},16)},m=u.clearTimeout);function E(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function x(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function b(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function M(t,n){return b(t,function(t,e){return t===n[e]})}function y(t,e){return Y[e]||(Y[e]=X(e)),Y[e](t)}function P(t,n){return t&&n?E(t,function(t,e){return y(t,"number"==typeof n?n:n[e])}):t}function T(t){if(!isFinite(t))return 0;var e=""+t;if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function w(t,e){return 180*Math.atan2(e,t)/Math.PI}function O(e,t){var n,i={};return e&&e.style&&(n=t||_,Object.keys(n).forEach(function(t){i[t]=e.style[t],e.style[t]=n[t]})),i}function D(t,e,n,i){var s=t,r=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],s=Math.max(r[0],s);return Math.min(r[1],s)}function I(t,e){return t<e[0]||t>e[1]}function A(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function C(t,e,n){var i=t,s=e[0],r=e[1],a=r-s;return n[1]&&r<t&&(i=(i-r)%a+s),n[0]&&t<s&&(i=(i-s)%a+r),i}function S(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function R(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=j;break;case"pointer":i=K}}),i?new Q:e&&n?new z:e?new q:n?new U:null}function B(t,e,n){return Math.max(Math.min(t,n),e)}function L(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}var Y={},X=function(e){var n=e<1?Math.pow(10,T(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},k=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){var n=this._getRoundPos(t).roundPos;this._axes.trigger(new d.ComponentEvent("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new d.ComponentEvent("release",f(f({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){void 0===i&&(i=!1);var s=this.animationManager,r=s.axisManager,a=s.getEventInfo(),o=this._getRoundPos(t,e),u=o.roundPos,h=o.roundDepa,c=r.moveTo(u,h),l=(null==n?void 0:n.event)||(null==a?void 0:a.event)||null,v={pos:c.pos,delta:c.delta,bounceRatio:this._getBounceRatio(c.pos),holding:i,inputEvent:l,isTrusted:!!l,input:(null==n?void 0:n.input)||(null==a?void 0:a.input)||null,set:l?this._createUserControll(c.pos):function(){}},_=new d.ComponentEvent("change",v);return this._axes.trigger(_),l&&r.set(v.set().destPos),!_.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration);var s=new d.ComponentEvent("animationStart",t);return this._axes.trigger(s),!s.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new d.ComponentEvent("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new d.ComponentEvent("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:f({},t),duration:e};return function(t,e){return t&&(n.destPos=f({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:P(t,n),roundDepa:P(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),F=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),N=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].range[0],t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return E(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):f(f({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=E(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?C(t,e.range,e.circular):0})),{pos:f({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return b(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return x(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return E(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!I(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e._complementOptions=function(){var s=this;Object.keys(this._axis).forEach(function(i){s._axis[i]=f({range:[0,100],bounce:[0,0],circular:[!1,!1]},s._axis[i]),["bounce","circular"].forEach(function(t){var e=s._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),j="ontouchstart"in u,W="PointerEvent"in u,e="MSPointerEvent"in u,K=W||e,V=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),u.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e,n=this.prevEvent,i=this._getCenter(t),s=n?this._getMovement(t):{x:0,y:0},r=n?this._getScale(t):1,a=n?w(i.x-n.center.x,i.y-n.center.y):0,o=n?n.deltaX+s.x:s.x,u=n?n.deltaY+s.y:s.y,h=s.x,c=s.y,l=this._latestInterval,v=Date.now(),_=l?v-l.timestamp:0,d=n?n.velocityX:0,f=n?n.velocityY:0;return(!l||16<=_)&&(l&&(d=(e=[(o-l.deltaX)/_,(u-l.deltaY)/_])[0],f=e[1]),this._latestInterval={timestamp:v,deltaX:o,deltaY:u}),{srcEvent:t,scale:r,angle:a,center:i,deltaX:o,deltaY:u,offsetX:h,offsetY:c,velocityX:d,velocityY:f,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},e._getButton=function(t){var e={1:h,2:c,4:l},n=this._isTouchEvent(t)?h:e[t.buttons];return n||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===c?u.addEventListener("contextmenu",this._stopContextMenu):e===l&&t.preventDefault()},t}(),U=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(){return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.pageX-e.pageX,y:t.pageY-e.pageY}},t}(V),q=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].pageX-e.touches[0].pageX,y:t.touches[0].pageY-e.touches[0].pageY}},t}(V),Q=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=W?["pointerdown"]:["MSPointerDown"],t.move=W?["pointermove"]:["MSPointerMove"],t.end=W?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.pageX-e.pageX,y:t.pageY-e.pageY}},n._updatePointerEvent=function(n){var i=this,s=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(s=!0,i._recentInputs[e]=n)}),s||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(V),z=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(e){var n=this,t=this.prevEvent.srcEvent,i=[e,t].map(function(t){return n._isTouchEvent(e)?{id:t.touches[0].identifier,x:t.touches[0].pageX,y:t.touches[0].pageY}:{id:null,x:t.pageX,y:t.pageY}}),s=i[0],r=i[1];return s.id===r.id?{x:s.x-r.x,y:s.y-r.y}:{x:0,y:0}},t}(V),H=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager,r=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=s,this._animationManager=r}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){var n;!this._interruptManager.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var s,r,a,o,u;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((s=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyChanged||(r=this._moveDistance||this._axisManager.get(t.axes),a=E(r,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(a,function(t,e){var n=e.circular,i=e.range;return n&&(n[0]||n[1])?C(t,i,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!I(t,e.range)})&&(this._isOutside=!1),r=this._atOutside(r),a=this._atOutside(a),this.options.nested&&this._isEndofAxis(n,r,a)||(s.__childrenAxesAlreadyChanged=!0),o={input:t,event:e},i?(u=this._animationManager.getDuration(a,r),this._animationManager.animateTo(a,u,o)):this._eventManager.triggerChange(a,r,o,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var s,r,a,o,u,h,c,l,v,_,d;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((s=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),r=this._axisManager.get(t.axes),a=this._axisManager.get(),o=this._animationManager.getDisplacement(n),u=S(t.axes,o),h=this._axisManager.get(this._axisManager.map(u,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:D(r[n]+t,e.range,e.circular,e.bounce)})),s.__childrenAxesAlreadyReleased=!0,0===(c=this._animationManager.getDuration(h,r,i))&&(h=f({},a)),l={depaPos:a,destPos:h,duration:c,delta:this._axisManager.getDelta(a,h),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(l),this._moveDistance=null,v=this._animationManager.getUserControl(l),d={input:t,event:e},(_=M(v.destPos,a))||0===v.duration?(_||this._eventManager.triggerChange(v.destPos,a,d,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(d):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(v.destPos,v.duration,d))},e._atOutside=function(t){var a=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],s=e.bounce,r=e.circular;return r&&(r[0]||r[1])?t:t<n?n-a._animationManager.interpolate(n-t,s[0]):i<t?i+a._animationManager.interpolate(t-i,s[1]):t})},e._isEndofAxis=function(o,u,h){return this._axisManager.every(u,function(t,e,n){return 0===o[n]||u[n]===h[n]&&(i=t,s=e.range,r=e.bounce,!(a=e.circular)[0]&&i===s[0]-r[0]||!a[1]&&i===s[1]+r[1]);var i,s,r,a})},t}(),G=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}r(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,s,r,a=this._animateParam;a&&(e=(new Date).getTime()-a.startTime,n=(null==t?void 0:t.destPos)||a.destPos,i=(null==t?void 0:t.duration)||a.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(s=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,a.delta=this.axisManager.getDelta(s,n),a.destPos=n),null!=t&&t.duration&&(r=(e+this._durationOffset)/a.duration,this._durationOffset=r*i-e,a.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var a=this,o=this._animateParam,u=t.pos,h=o.destPos,c=E(u,function(t,e){return t<=h[e]?1:-1}),l=((new Date).getTime()-o.startTime+this._durationOffset)/o.duration,v=this._easing(l);return{pos:this.axisManager.map(u,function(t,e,n){var i,s=1<=l?h[n]:t+o.delta[n]*(v-a._prevEasingPer)/(1-a._initialEasingPer),r=C(s,e.range,e.circular);return s!==r&&(i=c[n]*(e.range[1]-e.range[0]),h[n]-=i,u[n]-=i),r}),easingPer:this._prevEasingPer=v,finished:1<=v}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=s,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(r,t,e){var n,i,a=this;return i=void 0!==e?e:(n=E(t,function(t,e){return n=Math.abs(t-r[e]),i=a._options.deceleration,(s=Math.sqrt(n/i*2))<100?0:s;var n,i,s}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),B(i,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e,i;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return C(t,e.range,e.circular)}),b(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(i=this._raf,m(i)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return A(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return C(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){var e=t.setTo();return e.destPos=this.axisManager.get(e.destPos),e.duration=B(e.duration,this._options.minimumDuration,this._options.maximumDuration),e},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var s,r=this._createAnimationParam(t,e,n),a=f({},r.depaPos),o=this.eventManager.triggerAnimationStart(r),u=this.getUserControl(r);!o&&this.axisManager.every(u.destPos,function(t,e){return A(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),o&&!M(u.destPos,a)&&(s=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:a,destPos:u.destPos,duration:u.duration,delta:this.axisManager.getDelta(a,u.destPos),isTrusted:!!s,inputEvent:s,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(M(t,i))return this;this.interruptManager.setInterrupt(!0);var s=x(t,function(t,e){return i[e]!==t});return Object.keys(s).length?(s=this.axisManager.map(s,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:D(t,n,i)}),M(s,i)||(0<e?this.animateTo(s,e):(this.stopAnimation(),this.eventManager.triggerChange(s),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(E(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),s=t,r=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:s,duration:B(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,s),inputEvent:r,input:(null==n?void 0:n.input)||null,isTrusted:!!r,done:this.animationEnd}},e._animateLoop=function(t,i){var s,r,a,o=this;t.duration?(this._animateParam=f(f({},t),{startTime:(new Date).getTime()}),s=E(t.destPos,function(t){return t}),r=this._initState(this._animateParam),(a=function(){o._raf=null;var t=o._animateParam,e=o._getNextState(r),n=!o.eventManager.triggerChange(e.pos,r.pos);if((r=e).finished)return t.destPos=o._getFinalPos(t.destPos,s),M(t.destPos,o.axisManager.get(Object.keys(t.destPos)))||o.eventManager.triggerChange(t.destPos,e.pos),void i();n?o.finish(!1):o._raf=p(a)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,i){var s=this;return E(t,function(t,e){if(t>=i[e]-1e-6&&t<=i[e]+1e-6)return i[e];var n=s._getRoundUnit(t,e);return y(t,n)})},e._getRoundUnit=function(t,e){var n,i,s=this._options.round,r=null;return s||(n=this.axisManager.getAxisOptions(e),i=Math.max(T(n.range[0]),T(n.range[1]),T(t)),r=1/Math.pow(10,i)),r||s},t}()),Z=function(s){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n=null);var i=s.call(this)||this;return i.axis=t,i._inputs=[],i.options=f({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),i.interruptManager=new F(i.options),i.axisManager=new N(i.axis),i.eventManager=new k(i),i.animationManager=new G(i),i.inputObserver=new H(i),i.eventManager.setAnimationManager(i.animationManager),n&&i.eventManager.triggerChange(n),i}r(t,s);var e=t.prototype;return e.connect=function(t,e){var n="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(n),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.1.2",t.TRANSFORM=n,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=24,t.DIRECTION_ALL=30,t}(d),J=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._forceRelease=function(){var t=n._activeEvent,e=t.prevEvent;n._detachWindowEvent(t),t.onRelease(),n._observer.release(n,e,[0,0])},this.element=g(t),this.options=f({inputType:["touch","mouse","pointer"],inputButton:[h],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?30:e?6:n?24:1,this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=O(this.element),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),this._originalCssProps!==_&&O(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);!i||!this._enabled||1<n.getTouches(t)||!1!==i.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this._observer.hold(this,i),this._atRightEdge=v&&i.center.x>window.innerWidth-e,this._attachWindowEvent(n),n.prevEvent=i)},e._onPanmove=function(t){var e=this,n=this._activeEvent,i=n.onEventMove(t,this.options.inputButton);if(i&&this._enabled&&!(1<n.getTouches(t))){var s=this.options,r=s.iOSEdgeSwipeThreshold,a=s.releaseOnScroll,o=function(t,e){if(e<0||90<e)return 1;var n=Math.abs(t);return e<n&&n<180-e?24:6}(i.angle,this.options.thresholdAngle);if(!a||i.srcEvent.cancelable){if(n.prevEvent&&v){if(i.center.x<0)return void this._forceRelease();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),i.deltaX<-r?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e._forceRelease()},100))}var u=this._applyScale([i.offsetX,i.offsetY],[L(6,this._direction,o),L(24,this._direction,o)]),h=u.some(function(t){return 0!==t});h&&(!1!==i.srcEvent.cancelable&&i.srcEvent.preventDefault(),i.srcEvent.stopPropagation()),(i.preventSystemEvent=h)&&this._observer.change(this,i,S(this.axes,u)),n.prevEvent=i}else this._onPanend(t)}},e._onPanend=function(t){var e,n,i=this._activeEvent;i.onEventEnd(t),this._enabled&&0===i.getTouches(t)&&(this._detachWindowEvent(i),clearTimeout(this._rightEdgeTimer),e=i.prevEvent,n=this._applyScale([Math.abs(e.velocityX)*(e.offsetX<0?-1:1),Math.abs(e.velocityY)*(e.offsetY<0?-1:1)],[L(6,this._direction),L(24,this._direction)]),i.onRelease(),this._observer.release(this,e,n))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend)})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._attachElementEvent=function(t){var n=this,e=R(this.options.inputType);if(!e)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=e)&&e.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.addEventListener(t,n._onPanstart)})},e._detachElementEvent=function(){var n=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.removeEventListener(t,n._onPanstart)}),this._enabled=!1,this._observer=null},e._applyScale=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),$=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._prevQuadrant=null,n._lastDiff=0,n}r(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=Z.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);i&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,i),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(i),n.prevEvent=i)},e._onPanmove=function(t){var e=this._activeEvent,n=e.onEventMove(t,this.options.inputButton);n&&this.isEnabled()&&(!1!==n.srcEvent.cancelable&&n.srcEvent.preventDefault(),n.srcEvent.stopPropagation(),this._triggerChange(n),e.prevEvent=n)},e._onPanend=function(t){var e,n,i,s,r=this._activeEvent;r.onEventEnd(t),this.isEnabled()&&(e=r.prevEvent,this._triggerChange(e),n=e.velocityX,i=e.velocityY,s=Math.sqrt(n*n+i*i)*(0<this._lastDiff?-1:1),r.onRelease(),this._observer.release(this,e,[s*this._coefficientForDistanceToAngle]),this._detachWindowEvent(r))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,i=e.y,s=w(n,i),r=s<0?360+s:s,a=this._getQuadrant(t.center.x,t.center.y),o=this._getDifference(this._prevAngle,r,this._prevQuadrant,a);this._prevAngle=r,this._prevQuadrant=a,0!==o&&(this._lastDiff=o,this._observer.change(this,t,S(this.axes,[-o])))},e._getDifference=function(t,e,n,i){var s=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return s},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var n=this._getPosFromOrigin(t,e),i=n.x,s=n.y,r=0;return 0<=i&&0<=s?r=1:i<0&&0<=s?r=2:i<0&&s<0?r=3:0<=i&&s<0&&(r=4),r},t}(J),tt=function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this.element=g(t),this.options=f({scale:1,threshold:0,inputType:["touch","pointer"]},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=O(this.element),this},e.disconnect=function(){return this._detachEvent(),this._originalCssProps!==_&&O(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,e.prevEvent=n)},e._onPinchMove=function(t){var e,n=this._activeEvent,i=n.onEventMove(t);i&&this._pinchFlag&&this._enabled&&2===n.getTouches(t)&&(e=this._getOffset(i.scale,n.prevEvent.scale),this._observer.change(this,t,S(this.axes,[e])),n.prevEvent=i)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=R(this.options.inputType);if(!n)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=n)&&n.start.forEach(function(t){e.element.addEventListener(t,e._onPinchStart,!1)}),null!=n&&n.move.forEach(function(t){e.element.addEventListener(t,e._onPinchMove,!1)}),null!=n&&n.end.forEach(function(t){e.element.addEventListener(t,e._onPinchEnd,!1)})},e._detachEvent=function(){var e=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){e.element.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){e.element.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){e.element.removeEventListener(t,e._onPinchEnd,!1)}),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},t}(),et=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=g(t),this.options=f({scale:1,releaseDelay:300,useNormalized:!0},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&(t.preventDefault(),0!==t.deltaY&&(this._holding||(this._observer.hold(this,t),this._holding=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this._observer.change(this,t,S(this.axes,[e]),!0),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),nt=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=g(t),this.options=f({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,s=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,s=1;break;case 38:case 87:s=1;break;default:n=!1}(-1===s&&!this.axes[0]||1===s&&!this.axes[1])&&(n=!1),n&&(t.preventDefault(),e=-1===s?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,S(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("keydown",this._onKeydown,!1),this.element.addEventListener("keypress",this._onKeydown,!1),this.element.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("keydown",this._onKeydown,!1),this.element.removeEventListener("keypress",this._onKeydown,!1),this.element.removeEventListener("keyup",this._onKeyup,!1),this._enabled=!1,this._observer=null},t}();return Z.PanInput=J,Z.RotatePanInput=$,Z.PinchInput=tt,Z.WheelInput=et,Z.MoveKeyInput=nt,Z});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/agent"),require("@egjs/component")):"function"==typeof define&&define.amd?define(["@egjs/agent","@egjs/component"],e):(t.eg=t.eg||{},t.eg.Axes=e(t.eg.agent,t.eg.Component))}(this,function(t,d){"use strict";var i=function(t,e){return(i=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)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var o,a,f=function(){return(f=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},u="undefined"==typeof window?{navigator:{userAgent:""}}:window,c=24,h="left",l="right",v="middle",_="ontouchstart"in u&&"safari"===t().browser.name,n=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),p={"user-select":"none","-webkit-user-drag":"none"},g=function(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,s(n.childNodes)):s(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==u&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in u&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return g(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i},m=u.requestAnimationFrame||u.webkitRequestAnimationFrame,E=u.cancelAnimationFrame||u.webkitCancelAnimationFrame;m&&!E?(o={},a=m,m=function(e){var n=a(function(t){o[n]&&e(t)});return o[n]=!0,n},E=function(t){delete o[t]}):m&&E||(m=function(t){return u.setTimeout(function(){t(u.performance&&u.performance.now&&u.performance.now()||(new Date).getTime())},16)},E=u.clearTimeout);function x(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function b(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function y(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function M(t,n){return y(t,function(t,e){return t===n[e]})}function P(t,e){return j[e]||(j[e]=F(e)),j[e](t)}function T(t,n){return t&&n?x(t,function(t,e){return P(t,"number"==typeof n?n:n[e])}):t}function w(t){if(!isFinite(t))return 0;var e=""+t;if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function O(t,e){return 180*Math.atan2(e,t)/Math.PI}function D(e){var n=!0;return Object.keys(p).forEach(function(t){e&&e[t]===p[t]||(n=!1)}),n}function I(e,t,n){var i,s,r,o=((i={})[1]="auto",i[30]="none",i[c]="pan-x",i[6]="pan-y",i),a={};return e&&e.style&&(s=t.touchAction?t.touchAction:o[n],r=f(f({},p),{"touch-action":"none"===e.style["touch-action"]?"none":s}),Object.keys(r).forEach(function(t){a[t]=e.style[t],e.style[t]=r[t]})),a}function A(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function C(t,e,n,i){var s=t,r=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],s=Math.max(r[0],s);return Math.min(r[1],s)}function S(t,e){return t<e[0]||t>e[1]}function R(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function B(t,e,n){var i=t,s=e[0],r=e[1],o=r-s;return n[1]&&r<t&&(i=(i-r)%o+s),n[0]&&t<s&&(i=(i-s)%o+r),i}function L(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function Y(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=V;break;case"pointer":i=q}}),i?new G:e&&n?new Z:e?new H:n?new z:null}function k(t,e,n){return Math.max(Math.min(t,n),e)}function X(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}var j={},F=function(e){var n=e<1?Math.pow(10,w(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},N=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){var n=this._getRoundPos(t).roundPos;this._axes.trigger(new d.ComponentEvent("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new d.ComponentEvent("release",f(f({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){void 0===i&&(i=!1);var s=this.animationManager,r=s.axisManager,o=s.getEventInfo(),a=this._getRoundPos(t,e),u=a.roundPos,h=a.roundDepa,c=r.moveTo(u,h),l=(null==n?void 0:n.event)||(null==o?void 0:o.event)||null,v={pos:c.pos,delta:c.delta,bounceRatio:this._getBounceRatio(c.pos),holding:i,inputEvent:l,isTrusted:!!l,input:(null==n?void 0:n.input)||(null==o?void 0:o.input)||null,set:l?this._createUserControll(c.pos):function(){}},_=new d.ComponentEvent("change",v);return this._axes.trigger(_),l&&r.set(v.set().destPos),!_.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration);var s=new d.ComponentEvent("animationStart",t);return this._axes.trigger(s),!s.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new d.ComponentEvent("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new d.ComponentEvent("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:f({},t),duration:e};return function(t,e){return t&&(n.destPos=f({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:T(t,n),roundDepa:T(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),W=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),K=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].range[0],t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return x(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):f(f({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=x(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?B(t,e.range,e.circular):0})),{pos:f({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return y(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return b(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return x(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!S(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e._complementOptions=function(){var s=this;Object.keys(this._axis).forEach(function(i){s._axis[i]=f({range:[0,100],bounce:[0,0],circular:[!1,!1]},s._axis[i]),["bounce","circular"].forEach(function(t){var e=s._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),V="ontouchstart"in u,U="PointerEvent"in u,e="MSPointerEvent"in u,q=U||e,Q=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),u.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e,n=this.prevEvent,i=this._getCenter(t),s=n?this._getMovement(t):{x:0,y:0},r=n?this._getScale(t):1,o=n?O(i.x-n.center.x,i.y-n.center.y):0,a=n?n.deltaX+s.x:s.x,u=n?n.deltaY+s.y:s.y,h=s.x,c=s.y,l=this._latestInterval,v=Date.now(),_=l?v-l.timestamp:0,d=n?n.velocityX:0,f=n?n.velocityY:0;return(!l||16<=_)&&(l&&(d=(e=[(a-l.deltaX)/_,(u-l.deltaY)/_])[0],f=e[1]),this._latestInterval={timestamp:v,deltaX:a,deltaY:u}),{srcEvent:t,scale:r,angle:o,center:i,deltaX:a,deltaY:u,offsetX:h,offsetY:c,velocityX:d,velocityY:f,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},e._getButton=function(t){var e={1:h,2:l,4:v},n=this._isTouchEvent(t)?h:e[t.buttons];return n||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===l?u.addEventListener("contextmenu",this._stopContextMenu):e===v&&t.preventDefault()},t}(),z=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(){return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(Q),H=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(Q),G=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=U?["pointerdown"]:["MSPointerDown"],t.move=U?["pointermove"]:["MSPointerMove"],t.end=U?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,s=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(s=!0,i._recentInputs[e]=n)}),s||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(Q),Z=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}r(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,n=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),i=n[0],s=n[1];return i.id===s.id?{x:i.x-s.x,y:i.y-s.y}:{x:0,y:0}},t}(Q),J=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager,r=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=s,this._animationManager=r}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){var n;!this._interruptManager.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var s,r,o,a,u;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((s=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyChanged||(r=this._moveDistance||this._axisManager.get(t.axes),o=x(r,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(o,function(t,e){var n=e.circular,i=e.range;return n&&(n[0]||n[1])?B(t,i,n):t})),this._isOutside&&this._axisManager.every(r,function(t,e){return!S(t,e.range)})&&(this._isOutside=!1),r=this._atOutside(r),o=this._atOutside(o),this.options.nested&&this._isEndofAxis(n,r,o)||(s.__childrenAxesAlreadyChanged=!0),a={input:t,event:e},i?(u=this._animationManager.getDuration(o,r),this._animationManager.animateTo(o,u,a)):this._eventManager.triggerChange(o,r,a,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var s,r,o,a,u,h,c,l,v,_,d;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((s=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),r=this._axisManager.get(t.axes),o=this._axisManager.get(),a=this._animationManager.getDisplacement(n),u=L(t.axes,a),h=this._axisManager.get(this._axisManager.map(u,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:C(r[n]+t,e.range,e.circular,e.bounce)})),s.__childrenAxesAlreadyReleased=!0,0===(c=this._animationManager.getDuration(h,r,i))&&(h=f({},o)),l={depaPos:o,destPos:h,duration:c,delta:this._axisManager.getDelta(o,h),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(l),this._moveDistance=null,v=this._animationManager.getUserControl(l),d={input:t,event:e},(_=M(v.destPos,o))||0===v.duration?(_||this._eventManager.triggerChange(v.destPos,o,d,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(d):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(v.destPos,v.duration,d))},e._atOutside=function(t){var o=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],s=e.bounce,r=e.circular;return r&&(r[0]||r[1])?t:t<n?n-o._animationManager.interpolate(n-t,s[0]):i<t?i+o._animationManager.interpolate(t-i,s[1]):t})},e._isEndofAxis=function(a,u,h){return this._axisManager.every(u,function(t,e,n){return 0===a[n]||u[n]===h[n]&&(i=t,s=e.range,r=e.bounce,!(o=e.circular)[0]&&i===s[0]-r[0]||!o[1]&&i===s[1]+r[1]);var i,s,r,o})},t}(),$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}r(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,s,r,o=this._animateParam;o&&(e=(new Date).getTime()-o.startTime,n=(null==t?void 0:t.destPos)||o.destPos,i=(null==t?void 0:t.duration)||o.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(s=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,o.delta=this.axisManager.getDelta(s,n),o.destPos=n),null!=t&&t.duration&&(r=(e+this._durationOffset)/o.duration,this._durationOffset=r*i-e,o.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var o=this,a=this._animateParam,u=t.pos,h=a.destPos,c=x(u,function(t,e){return t<=h[e]?1:-1}),l=((new Date).getTime()-a.startTime+this._durationOffset)/a.duration,v=this._easing(l);return{pos:this.axisManager.map(u,function(t,e,n){var i,s=1<=l?h[n]:t+a.delta[n]*(v-o._prevEasingPer)/(1-o._initialEasingPer),r=B(s,e.range,e.circular);return s!==r&&(i=c[n]*(e.range[1]-e.range[0]),h[n]-=i,u[n]-=i),r}),easingPer:this._prevEasingPer=v,finished:1<=v}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,s=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=s,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(r,t,e){var n,i,o=this;return i=void 0!==e?e:(n=x(t,function(t,e){return n=Math.abs(t-r[e]),i=o._options.deceleration,(s=Math.sqrt(n/i*2))<100?0:s;var n,i,s}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),k(i,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e,i;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return B(t,e.range,e.circular)}),y(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(i=this._raf,E(i)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return R(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return B(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){var e=t.setTo();return e.destPos=this.axisManager.get(e.destPos),e.duration=k(e.duration,this._options.minimumDuration,this._options.maximumDuration),e},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var s,r=this._createAnimationParam(t,e,n),o=f({},r.depaPos),a=this.eventManager.triggerAnimationStart(r),u=this.getUserControl(r);!a&&this.axisManager.every(u.destPos,function(t,e){return R(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!M(u.destPos,o)&&(s=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:o,destPos:u.destPos,duration:u.duration,delta:this.axisManager.getDelta(o,u.destPos),isTrusted:!!s,inputEvent:s,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(M(t,i))return this;this.interruptManager.setInterrupt(!0);var s=b(t,function(t,e){return i[e]!==t});return Object.keys(s).length?(s=this.axisManager.map(s,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:C(t,n,i)}),M(s,i)||(0<e?this.animateTo(s,e):(this.stopAnimation(),this.eventManager.triggerChange(s),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(x(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),s=t,r=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:s,duration:k(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,s),inputEvent:r,input:(null==n?void 0:n.input)||null,isTrusted:!!r,done:this.animationEnd}},e._animateLoop=function(t,i){var s,r,o,a=this;t.duration?(this._animateParam=f(f({},t),{startTime:(new Date).getTime()}),s=x(t.destPos,function(t){return t}),r=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(r),n=!a.eventManager.triggerChange(e.pos,r.pos);if((r=e).finished)return t.destPos=a._getFinalPos(t.destPos,s),M(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),void i();n?a.finish(!1):a._raf=m(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,i){var s=this;return x(t,function(t,e){if(t>=i[e]-1e-6&&t<=i[e]+1e-6)return i[e];var n=s._getRoundUnit(t,e);return P(t,n)})},e._getRoundUnit=function(t,e){var n,i,s=this._options.round,r=null;return s||(n=this.axisManager.getAxisOptions(e),i=Math.max(w(n.range[0]),w(n.range[1]),w(t)),r=1/Math.pow(10,i)),r||s},t}()),tt=function(s){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n=null);var i=s.call(this)||this;return i.axis=t,i._inputs=[],i.options=f({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),i.interruptManager=new W(i.options),i.axisManager=new K(i.axis),i.eventManager=new N(i),i.animationManager=new $(i),i.inputObserver=new J(i),i.eventManager.setAnimationManager(i.animationManager),n&&i.eventManager.triggerChange(n),i}r(t,s);var e=t.prototype;return e.connect=function(t,e){var n="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(n),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.2.0",t.TRANSFORM=n,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=c,t.DIRECTION_ALL=30,t}(d),et=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._forceRelease=function(){var t=n._activeEvent,e=t.prevEvent;n._detachWindowEvent(t),t.onRelease(),n._observer.release(n,e,[0,0])},this.element=g(t),this.options=f({inputType:["touch","mouse","pointer"],inputButton:[h],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?30:e?6:n?c:1,this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=I(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),D(this._originalCssProps)||A(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);!i||!this._enabled||1<n.getTouches(t)||!1!==i.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this._observer.hold(this,i),this._atRightEdge=_&&i.center.x>window.innerWidth-e,this._attachWindowEvent(n),n.prevEvent=i)},e._onPanmove=function(t){var e=this,n=this._activeEvent,i=n.onEventMove(t,this.options.inputButton);if(i&&this._enabled&&!(1<n.getTouches(t))){var s=this.options,r=s.iOSEdgeSwipeThreshold,o=s.releaseOnScroll,a=function(t,e){if(e<0||90<e)return 1;var n=Math.abs(t);return e<n&&n<180-e?c:6}(i.angle,this.options.thresholdAngle);if(!o||i.srcEvent.cancelable){if(n.prevEvent&&_){if(i.center.x<0)return void this._forceRelease();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),i.deltaX<-r?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e._forceRelease()},100))}var u=this._applyScale([i.offsetX,i.offsetY],[X(6,this._direction,a),X(c,this._direction,a)]),h=u.some(function(t){return 0!==t});h&&(!1!==i.srcEvent.cancelable&&i.srcEvent.preventDefault(),i.srcEvent.stopPropagation()),(i.preventSystemEvent=h)&&this._observer.change(this,i,L(this.axes,u)),n.prevEvent=i}else this._onPanend(t)}},e._onPanend=function(t){var e,n,i=this._activeEvent;i.onEventEnd(t),this._enabled&&0===i.getTouches(t)&&(this._detachWindowEvent(i),clearTimeout(this._rightEdgeTimer),e=i.prevEvent,n=this._applyScale([Math.abs(e.velocityX)*(e.offsetX<0?-1:1),Math.abs(e.velocityY)*(e.offsetY<0?-1:1)],[X(6,this._direction),X(c,this._direction)]),i.onRelease(),this._observer.release(this,e,n))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend)})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._attachElementEvent=function(t){var n=this,e=Y(this.options.inputType);if(!e)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=e)&&e.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.addEventListener(t,n._onPanstart)})},e._detachElementEvent=function(){var n=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.removeEventListener(t,n._onPanstart)}),this._enabled=!1,this._observer=null},e._applyScale=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),nt=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._prevQuadrant=null,n._lastDiff=0,n}r(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=tt.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);i&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,i),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(i),n.prevEvent=i)},e._onPanmove=function(t){var e=this._activeEvent,n=e.onEventMove(t,this.options.inputButton);n&&this.isEnabled()&&(!1!==n.srcEvent.cancelable&&n.srcEvent.preventDefault(),n.srcEvent.stopPropagation(),this._triggerChange(n),e.prevEvent=n)},e._onPanend=function(t){var e,n,i,s,r=this._activeEvent;r.onEventEnd(t),this.isEnabled()&&(e=r.prevEvent,this._triggerChange(e),n=e.velocityX,i=e.velocityY,s=Math.sqrt(n*n+i*i)*(0<this._lastDiff?-1:1),r.onRelease(),this._observer.release(this,e,[s*this._coefficientForDistanceToAngle]),this._detachWindowEvent(r))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,i=e.y,s=O(n,i),r=s<0?360+s:s,o=this._getQuadrant(t.center.x,t.center.y),a=this._getDifference(this._prevAngle,r,this._prevQuadrant,o);this._prevAngle=r,this._prevQuadrant=o,0!==a&&(this._lastDiff=a,this._observer.change(this,t,L(this.axes,[-a])))},e._getDifference=function(t,e,n,i){var s=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return s},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var n=this._getPosFromOrigin(t,e),i=n.x,s=n.y,r=0;return 0<=i&&0<=s?r=1:i<0&&0<=s?r=2:i<0&&s<0?r=3:0<=i&&s<0&&(r=4),r},t}(et),it=function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this.element=g(t),this.options=f({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"none"},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=I(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),D(this._originalCssProps)||A(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,e.prevEvent=n)},e._onPinchMove=function(t){var e,n=this._activeEvent,i=n.onEventMove(t);i&&this._pinchFlag&&this._enabled&&2===n.getTouches(t)&&(e=this._getOffset(i.scale,n.prevEvent.scale),this._observer.change(this,t,L(this.axes,[e])),n.prevEvent=i)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=Y(this.options.inputType);if(!n)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=n)&&n.start.forEach(function(t){e.element.addEventListener(t,e._onPinchStart,!1)}),null!=n&&n.move.forEach(function(t){e.element.addEventListener(t,e._onPinchMove,!1)}),null!=n&&n.end.forEach(function(t){e.element.addEventListener(t,e._onPinchEnd,!1)})},e._detachEvent=function(){var e=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){e.element.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){e.element.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){e.element.removeEventListener(t,e._onPinchEnd,!1)}),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},t}(),st=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=g(t),this.options=f({scale:1,releaseDelay:300,useNormalized:!0},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&(t.preventDefault(),0!==t.deltaY&&(this._holding||(this._observer.hold(this,t),this._holding=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this._observer.change(this,t,L(this.axes,[e]),!0),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),rt=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=g(t),this.options=f({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,s=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,s=1;break;case 38:case 87:s=1;break;default:n=!1}(-1===s&&!this.axes[0]||1===s&&!this.axes[1])&&(n=!1),n&&(t.preventDefault(),e=-1===s?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,L(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("keydown",this._onKeydown,!1),this.element.addEventListener("keypress",this._onKeydown,!1),this.element.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("keydown",this._onKeydown,!1),this.element.removeEventListener("keypress",this._onKeydown,!1),this.element.removeEventListener("keyup",this._onKeyup,!1),this._enabled=!1,this._observer=null},t}();return tt.PanInput=et,tt.RotatePanInput=nt,tt.PinchInput=it,tt.WheelInput=st,tt.MoveKeyInput=rt,tt});
//# sourceMappingURL=axes.min.js.map

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

repository: https://github.com/naver/egjs-axes
version: 3.1.2
version: 3.2.0
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Axes=e())}(this,function(){"use strict";var i=function(t,e){return(i=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)};function s(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var _=function(){return(_=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 c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}function l(t){return void 0===t}var r,a=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=c(Object.keys(e)),s=r.next();!s.done;s=r.next()){var o=s.value;this[o]=e[o]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),t=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof a?e.eventType:e,r=o(this._eventHandler[i]||[]);return r.length<=0||(e instanceof a?(e.currentTarget=this,r.forEach(function(t){t(e)})):r.forEach(function(t){t.apply(void 0,o(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&l(i)){var t=n;for(var e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,o(t)),s.off(n,r)},this.on(n,r)),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&l(e)){var n=t;for(var i in n)this.on(i,n[i]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(r=this._eventHandler[t],l(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){var n,i;if(l(t))return this._eventHandler={},this;if(l(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r=t;for(var s in r)this.off(s,r[s]);return this}var o=this._eventHandler[t];if(o){var a=0;try{for(var u=c(o),h=u.next();!h.done;h=u.next()){if(h.value===e){o.splice(a,1),o.length<=0&&delete this._eventHandler[t];break}a++}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},t.VERSION="3.0.2",t}(),f=a;function e(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function u(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function h(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function v(t){return t.replace(/_/g,".")}function d(t,r){var s=null,o="-1";return e(t,function(t){var e,n,i=h("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return i&&!t.brand&&(s=t,o=i[3]||"-1",t.versionAlias?o=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),n=h("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r),o=(n?n[3]:"")||o),o=v(o),1)}),{preset:s,version:o}}function n(t,n){return u(t,function(t){var e=t.brand;return h(""+n.test,e.toLowerCase())})}r="undefined"==typeof window?{navigator:{userAgent:""}}:window;var p=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],g=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",brand:!0}],m=[{test:"applewebkit",id:"webkit"}],E=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],b=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"mac os x",id:"mac"},{test:"android",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function y(t){var e=function(t){var e=t;if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}(t),n=!!/mobi/g.exec(e),i={name:"unknown",version:"-1",majorVersion:-1,webview:!!d(E,e).preset,chromium:!!d(g,e).preset,webkit:!1},r={name:"unknown",version:"-1",majorVersion:-1},s=d(p,e),o=s.preset,a=s.version,u=d(b,e),h=u.preset,c=u.version;return i.webkit=!i.chromium&&!!d(m,e).preset,h&&(r.name=h.id,r.version=c,r.majorVersion=parseInt(c,10)),o&&(i.name=o.id,i.version=a,i.webview&&"ios"===r.name&&"safari"!==i.name&&(i.webview=!1)),i.majorVersion=parseInt(i.version,10),{browser:i,os:r,isMobile:n,isHints:!1}}function x(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var M,w,P,T,O,I,D,A,C,S,R,k,L="left",B="right",j="middle",Y="ontouchstart"in r&&"safari"===(void 0===M&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var t=navigator.userAgentData,e=t.brands||t.uaList;return e&&e.length}}()?(O=navigator.userAgentData,I=(O.uaList||O.brands).slice(),D=O.mobile||!1,A=I[0],C={name:A.brand,version:A.version,majorVersion:-1,webkit:!1,webview:e(E,function(t){return n(I,t)}),chromium:e(g,function(t){return n(I,t)})},S={name:"unknown",version:"-1",majorVersion:-1},C.webkit=!C.chromium&&e(m,function(t){return n(I,t)}),w&&(P=w.platform.toLowerCase(),T=u(b,function(t){return new RegExp(""+t.test,"g").exec(P)}),S.name=T?T.id:P,S.version=w.platformVersion),e(p,function(t){var e=n(I,t);return e&&(C.name=t.id,C.version=w?w.uaFullVersion:e.version,1)}),"Linux armv8l"===navigator.platform?S.name="android":C.webkit&&(S.name=D?"ios":"mac"),"ios"===S.name&&C.webview&&(C.version="-1"),S.version=v(S.version),C.version=v(C.version),S.majorVersion=parseInt(S.version,10),C.majorVersion=parseInt(C.version,10),{browser:C,os:S,isMobile:D,isHints:!0}):y(M)).browser.name,X=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),F={"touch-action":"none","user-select":"none","-webkit-user-drag":"none"},N=function(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,x(n.childNodes)):x(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==r&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in r&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return N(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i},V=r.requestAnimationFrame||r.webkitRequestAnimationFrame,W=r.cancelAnimationFrame||r.webkitCancelAnimationFrame;V&&!W?(R={},k=V,V=function(e){var n=k(function(t){R[n]&&e(t)});return R[n]=!0,n},W=function(t){delete R[t]}):V&&W||(V=function(t){return r.setTimeout(function(){t(r.performance&&r.performance.now&&r.performance.now()||(new Date).getTime())},16)},W=r.clearTimeout);function H(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function K(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function U(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function q(t,n){return U(t,function(t,e){return t===n[e]})}function Q(t,e){return at[e]||(at[e]=ut(e)),at[e](t)}function z(t,n){return t&&n?H(t,function(t,e){return Q(t,"number"==typeof n?n:n[e])}):t}function G(t){if(!isFinite(t))return 0;var e=""+t;if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function Z(t,e){return 180*Math.atan2(e,t)/Math.PI}function J(e,t){var n,i={};return e&&e.style&&(n=t||F,Object.keys(n).forEach(function(t){i[t]=e.style[t],e.style[t]=n[t]})),i}function $(t,e,n,i){var r=t,s=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],r=Math.max(s[0],r);return Math.min(s[1],r)}function tt(t,e){return t<e[0]||t>e[1]}function et(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function nt(t,e,n){var i=t,r=e[0],s=e[1],o=s-r;return n[1]&&s<t&&(i=(i-s)%o+r),n[0]&&t<r&&(i=(i-r)%o+s),i}function it(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function rt(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=vt;break;case"pointer":i=_t}}),i?new Et:e&&n?new bt:e?new mt:n?new gt:null}function st(t,e,n){return Math.max(Math.min(t,n),e)}function ot(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}var at={},ut=function(e){var n=e<1?Math.pow(10,G(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},ht=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){var n=this._getRoundPos(t).roundPos;this._axes.trigger(new f("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new f("release",_(_({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){void 0===i&&(i=!1);var r=this.animationManager,s=r.axisManager,o=r.getEventInfo(),a=this._getRoundPos(t,e),u=a.roundPos,h=a.roundDepa,c=s.moveTo(u,h),l=(null==n?void 0:n.event)||(null==o?void 0:o.event)||null,v={pos:c.pos,delta:c.delta,bounceRatio:this._getBounceRatio(c.pos),holding:i,inputEvent:l,isTrusted:!!l,input:(null==n?void 0:n.input)||(null==o?void 0:o.input)||null,set:l?this._createUserControll(c.pos):function(){}},d=new f("change",v);return this._axes.trigger(d),l&&s.set(v.set().destPos),!d.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration);var r=new f("animationStart",t);return this._axes.trigger(r),!r.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new f("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new f("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:_({},t),duration:e};return function(t,e){return t&&(n.destPos=_({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:z(t,n),roundDepa:z(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),ct=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),lt=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].range[0],t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return H(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):_(_({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=H(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?nt(t,e.range,e.circular):0})),{pos:_({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return U(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return K(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return H(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!tt(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e._complementOptions=function(){var r=this;Object.keys(this._axis).forEach(function(i){r._axis[i]=_({range:[0,100],bounce:[0,0],circular:[!1,!1]},r._axis[i]),["bounce","circular"].forEach(function(t){var e=r._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),vt="ontouchstart"in r,dt="PointerEvent"in r,ft="MSPointerEvent"in r,_t=dt||ft,pt=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),r.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e,n=this.prevEvent,i=this._getCenter(t),r=n?this._getMovement(t):{x:0,y:0},s=n?this._getScale(t):1,o=n?Z(i.x-n.center.x,i.y-n.center.y):0,a=n?n.deltaX+r.x:r.x,u=n?n.deltaY+r.y:r.y,h=r.x,c=r.y,l=this._latestInterval,v=Date.now(),d=l?v-l.timestamp:0,f=n?n.velocityX:0,_=n?n.velocityY:0;return(!l||16<=d)&&(l&&(f=(e=[(a-l.deltaX)/d,(u-l.deltaY)/d])[0],_=e[1]),this._latestInterval={timestamp:v,deltaX:a,deltaY:u}),{srcEvent:t,scale:s,angle:o,center:i,deltaX:a,deltaY:u,offsetX:h,offsetY:c,velocityX:f,velocityY:_,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},e._getButton=function(t){var e={1:L,2:B,4:j},n=this._isTouchEvent(t)?L:e[t.buttons];return n||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===B?r.addEventListener("contextmenu",this._stopContextMenu):e===j&&t.preventDefault()},t}(),gt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(){return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.pageX-e.pageX,y:t.pageY-e.pageY}},t}(pt),mt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].pageX-e.touches[0].pageX,y:t.touches[0].pageY-e.touches[0].pageY}},t}(pt),Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=dt?["pointerdown"]:["MSPointerDown"],t.move=dt?["pointermove"]:["MSPointerMove"],t.end=dt?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.pageX-e.pageX,y:t.pageY-e.pageY}},n._updatePointerEvent=function(n){var i=this,r=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(r=!0,i._recentInputs[e]=n)}),r||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(pt),bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(e){var n=this,t=this.prevEvent.srcEvent,i=[e,t].map(function(t){return n._isTouchEvent(e)?{id:t.touches[0].identifier,x:t.touches[0].pageX,y:t.touches[0].pageY}:{id:null,x:t.pageX,y:t.pageY}}),r=i[0],s=i[1];return r.id===s.id?{x:r.x-s.x,y:r.y-s.y}:{x:0,y:0}},t}(pt),yt=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager,s=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=r,this._animationManager=s}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){var n;!this._interruptManager.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var r,s,o,a,u;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((r=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyChanged||(s=this._moveDistance||this._axisManager.get(t.axes),o=H(s,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(o,function(t,e){var n=e.circular,i=e.range;return n&&(n[0]||n[1])?nt(t,i,n):t})),this._isOutside&&this._axisManager.every(s,function(t,e){return!tt(t,e.range)})&&(this._isOutside=!1),s=this._atOutside(s),o=this._atOutside(o),this.options.nested&&this._isEndofAxis(n,s,o)||(r.__childrenAxesAlreadyChanged=!0),a={input:t,event:e},i?(u=this._animationManager.getDuration(o,s),this._animationManager.animateTo(o,u,a)):this._eventManager.triggerChange(o,s,a,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var r,s,o,a,u,h,c,l,v,d,f;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((r=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),s=this._axisManager.get(t.axes),o=this._axisManager.get(),a=this._animationManager.getDisplacement(n),u=it(t.axes,a),h=this._axisManager.get(this._axisManager.map(u,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?s[n]+t:$(s[n]+t,e.range,e.circular,e.bounce)})),r.__childrenAxesAlreadyReleased=!0,0===(c=this._animationManager.getDuration(h,s,i))&&(h=_({},o)),l={depaPos:o,destPos:h,duration:c,delta:this._axisManager.getDelta(o,h),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(l),this._moveDistance=null,v=this._animationManager.getUserControl(l),f={input:t,event:e},(d=q(v.destPos,o))||0===v.duration?(d||this._eventManager.triggerChange(v.destPos,o,f,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(f):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(v.destPos,v.duration,f))},e._atOutside=function(t){var o=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,s=e.circular;return s&&(s[0]||s[1])?t:t<n?n-o._animationManager.interpolate(n-t,r[0]):i<t?i+o._animationManager.interpolate(t-i,r[1]):t})},e._isEndofAxis=function(a,u,h){return this._axisManager.every(u,function(t,e,n){return 0===a[n]||u[n]===h[n]&&(i=t,r=e.range,s=e.bounce,!(o=e.circular)[0]&&i===r[0]-s[0]||!o[1]&&i===r[1]+s[1]);var i,r,s,o})},t}(),xt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}s(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,r,s,o=this._animateParam;o&&(e=(new Date).getTime()-o.startTime,n=(null==t?void 0:t.destPos)||o.destPos,i=(null==t?void 0:t.duration)||o.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(r=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,o.delta=this.axisManager.getDelta(r,n),o.destPos=n),null!=t&&t.duration&&(s=(e+this._durationOffset)/o.duration,this._durationOffset=s*i-e,o.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var o=this,a=this._animateParam,u=t.pos,h=a.destPos,c=H(u,function(t,e){return t<=h[e]?1:-1}),l=((new Date).getTime()-a.startTime+this._durationOffset)/a.duration,v=this._easing(l);return{pos:this.axisManager.map(u,function(t,e,n){var i,r=1<=l?h[n]:t+a.delta[n]*(v-o._prevEasingPer)/(1-o._initialEasingPer),s=nt(r,e.range,e.circular);return r!==s&&(i=c[n]*(e.range[1]-e.range[0]),h[n]-=i,u[n]-=i),s}),easingPer:this._prevEasingPer=v,finished:1<=v}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=r,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(s,t,e){var n,i,o=this;return i=void 0!==e?e:(n=H(t,function(t,e){return n=Math.abs(t-s[e]),i=o._options.deceleration,(r=Math.sqrt(n/i*2))<100?0:r;var n,i,r}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),st(i,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e,i;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return nt(t,e.range,e.circular)}),U(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(i=this._raf,W(i)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return et(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return nt(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){var e=t.setTo();return e.destPos=this.axisManager.get(e.destPos),e.duration=st(e.duration,this._options.minimumDuration,this._options.maximumDuration),e},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var r,s=this._createAnimationParam(t,e,n),o=_({},s.depaPos),a=this.eventManager.triggerAnimationStart(s),u=this.getUserControl(s);!a&&this.axisManager.every(u.destPos,function(t,e){return et(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!q(u.destPos,o)&&(r=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:o,destPos:u.destPos,duration:u.duration,delta:this.axisManager.getDelta(o,u.destPos),isTrusted:!!r,inputEvent:r,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(q(t,i))return this;this.interruptManager.setInterrupt(!0);var r=K(t,function(t,e){return i[e]!==t});return Object.keys(r).length?(r=this.axisManager.map(r,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:$(t,n,i)}),q(r,i)||(0<e?this.animateTo(r,e):(this.stopAnimation(),this.eventManager.triggerChange(r),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(H(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),r=t,s=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:r,duration:st(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,r),inputEvent:s,input:(null==n?void 0:n.input)||null,isTrusted:!!s,done:this.animationEnd}},e._animateLoop=function(t,i){var r,s,o,a=this;t.duration?(this._animateParam=_(_({},t),{startTime:(new Date).getTime()}),r=H(t.destPos,function(t){return t}),s=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(s),n=!a.eventManager.triggerChange(e.pos,s.pos);if((s=e).finished)return t.destPos=a._getFinalPos(t.destPos,r),q(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),void i();n?a.finish(!1):a._raf=V(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,i){var r=this;return H(t,function(t,e){if(t>=i[e]-1e-6&&t<=i[e]+1e-6)return i[e];var n=r._getRoundUnit(t,e);return Q(t,n)})},e._getRoundUnit=function(t,e){var n,i,r=this._options.round,s=null;return r||(n=this.axisManager.getAxisOptions(e),i=Math.max(G(n.range[0]),G(n.range[1]),G(t)),s=1/Math.pow(10,i)),s||r},t}()),Mt=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n=null);var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=_({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),i.interruptManager=new ct(i.options),i.axisManager=new lt(i.axis),i.eventManager=new ht(i),i.animationManager=new xt(i),i.inputObserver=new yt(i),i.eventManager.setAnimationManager(i.animationManager),n&&i.eventManager.triggerChange(n),i}s(t,r);var e=t.prototype;return e.connect=function(t,e){var n="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(n),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.1.2",t.TRANSFORM=X,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=24,t.DIRECTION_ALL=30,t}(t),wt=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._forceRelease=function(){var t=n._activeEvent,e=t.prevEvent;n._detachWindowEvent(t),t.onRelease(),n._observer.release(n,e,[0,0])},this.element=N(t),this.options=_({inputType:["touch","mouse","pointer"],inputButton:[L],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?30:e?6:n?24:1,this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=J(this.element),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),this._originalCssProps!==F&&J(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);!i||!this._enabled||1<n.getTouches(t)||!1!==i.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this._observer.hold(this,i),this._atRightEdge=Y&&i.center.x>window.innerWidth-e,this._attachWindowEvent(n),n.prevEvent=i)},e._onPanmove=function(t){var e=this,n=this._activeEvent,i=n.onEventMove(t,this.options.inputButton);if(i&&this._enabled&&!(1<n.getTouches(t))){var r=this.options,s=r.iOSEdgeSwipeThreshold,o=r.releaseOnScroll,a=function(t,e){if(e<0||90<e)return 1;var n=Math.abs(t);return e<n&&n<180-e?24:6}(i.angle,this.options.thresholdAngle);if(!o||i.srcEvent.cancelable){if(n.prevEvent&&Y){if(i.center.x<0)return void this._forceRelease();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),i.deltaX<-s?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e._forceRelease()},100))}var u=this._applyScale([i.offsetX,i.offsetY],[ot(6,this._direction,a),ot(24,this._direction,a)]),h=u.some(function(t){return 0!==t});h&&(!1!==i.srcEvent.cancelable&&i.srcEvent.preventDefault(),i.srcEvent.stopPropagation()),(i.preventSystemEvent=h)&&this._observer.change(this,i,it(this.axes,u)),n.prevEvent=i}else this._onPanend(t)}},e._onPanend=function(t){var e,n,i=this._activeEvent;i.onEventEnd(t),this._enabled&&0===i.getTouches(t)&&(this._detachWindowEvent(i),clearTimeout(this._rightEdgeTimer),e=i.prevEvent,n=this._applyScale([Math.abs(e.velocityX)*(e.offsetX<0?-1:1),Math.abs(e.velocityY)*(e.offsetY<0?-1:1)],[ot(6,this._direction),ot(24,this._direction)]),i.onRelease(),this._observer.release(this,e,n))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend)})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._attachElementEvent=function(t){var n=this,e=rt(this.options.inputType);if(!e)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=e)&&e.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.addEventListener(t,n._onPanstart)})},e._detachElementEvent=function(){var n=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.removeEventListener(t,n._onPanstart)}),this._enabled=!1,this._observer=null},e._applyScale=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),Pt=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._prevQuadrant=null,n._lastDiff=0,n}s(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=Mt.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);i&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,i),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(i),n.prevEvent=i)},e._onPanmove=function(t){var e=this._activeEvent,n=e.onEventMove(t,this.options.inputButton);n&&this.isEnabled()&&(!1!==n.srcEvent.cancelable&&n.srcEvent.preventDefault(),n.srcEvent.stopPropagation(),this._triggerChange(n),e.prevEvent=n)},e._onPanend=function(t){var e,n,i,r,s=this._activeEvent;s.onEventEnd(t),this.isEnabled()&&(e=s.prevEvent,this._triggerChange(e),n=e.velocityX,i=e.velocityY,r=Math.sqrt(n*n+i*i)*(0<this._lastDiff?-1:1),s.onRelease(),this._observer.release(this,e,[r*this._coefficientForDistanceToAngle]),this._detachWindowEvent(s))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,i=e.y,r=Z(n,i),s=r<0?360+r:r,o=this._getQuadrant(t.center.x,t.center.y),a=this._getDifference(this._prevAngle,s,this._prevQuadrant,o);this._prevAngle=s,this._prevQuadrant=o,0!==a&&(this._lastDiff=a,this._observer.change(this,t,it(this.axes,[-a])))},e._getDifference=function(t,e,n,i){var r=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return r},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var n=this._getPosFromOrigin(t,e),i=n.x,r=n.y,s=0;return 0<=i&&0<=r?s=1:i<0&&0<=r?s=2:i<0&&r<0?s=3:0<=i&&r<0&&(s=4),s},t}(wt),Tt=function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this.element=N(t),this.options=_({scale:1,threshold:0,inputType:["touch","pointer"]},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=J(this.element),this},e.disconnect=function(){return this._detachEvent(),this._originalCssProps!==F&&J(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,e.prevEvent=n)},e._onPinchMove=function(t){var e,n=this._activeEvent,i=n.onEventMove(t);i&&this._pinchFlag&&this._enabled&&2===n.getTouches(t)&&(e=this._getOffset(i.scale,n.prevEvent.scale),this._observer.change(this,t,it(this.axes,[e])),n.prevEvent=i)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=rt(this.options.inputType);if(!n)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=n)&&n.start.forEach(function(t){e.element.addEventListener(t,e._onPinchStart,!1)}),null!=n&&n.move.forEach(function(t){e.element.addEventListener(t,e._onPinchMove,!1)}),null!=n&&n.end.forEach(function(t){e.element.addEventListener(t,e._onPinchEnd,!1)})},e._detachEvent=function(){var e=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){e.element.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){e.element.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){e.element.removeEventListener(t,e._onPinchEnd,!1)}),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},t}(),Ot=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=N(t),this.options=_({scale:1,releaseDelay:300,useNormalized:!0},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&(t.preventDefault(),0!==t.deltaY&&(this._holding||(this._observer.hold(this,t),this._holding=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this._observer.change(this,t,it(this.axes,[e]),!0),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),It=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=N(t),this.options=_({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,r=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,r=1;break;case 38:case 87:r=1;break;default:n=!1}(-1===r&&!this.axes[0]||1===r&&!this.axes[1])&&(n=!1),n&&(t.preventDefault(),e=-1===r?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,it(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("keydown",this._onKeydown,!1),this.element.addEventListener("keypress",this._onKeydown,!1),this.element.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("keydown",this._onKeydown,!1),this.element.removeEventListener("keypress",this._onKeydown,!1),this.element.removeEventListener("keyup",this._onKeyup,!1),this._enabled=!1,this._observer=null},t}();return Mt.PanInput=wt,Mt.RotatePanInput=Pt,Mt.PinchInput=Tt,Mt.WheelInput=Ot,Mt.MoveKeyInput=It,Mt});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Axes=e())}(this,function(){"use strict";var i=function(t,e){return(i=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)};function s(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var _=function(){return(_=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 c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}function l(t){return void 0===t}var r,a=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=c(Object.keys(e)),s=r.next();!s.done;s=r.next()){var o=s.value;this[o]=e[o]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),t=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof a?e.eventType:e,r=o(this._eventHandler[i]||[]);return r.length<=0||(e instanceof a?(e.currentTarget=this,r.forEach(function(t){t(e)})):r.forEach(function(t){t.apply(void 0,o(n))})),this},e.once=function(n,i){var r,s=this;if("object"==typeof n&&l(i)){var t=n;for(var e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,o(t)),s.off(n,r)},this.on(n,r)),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&l(e)){var n=t;for(var i in n)this.on(i,n[i]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(r=this._eventHandler[t],l(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){var n,i;if(l(t))return this._eventHandler={},this;if(l(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r=t;for(var s in r)this.off(s,r[s]);return this}var o=this._eventHandler[t];if(o){var a=0;try{for(var u=c(o),h=u.next();!h.done;h=u.next()){if(h.value===e){o.splice(a,1),o.length<=0&&delete this._eventHandler[t];break}a++}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},t.VERSION="3.0.2",t}(),f=a;function e(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function u(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function h(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function v(t){return t.replace(/_/g,".")}function d(t,r){var s=null,o="-1";return e(t,function(t){var e,n,i=h("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return i&&!t.brand&&(s=t,o=i[3]||"-1",t.versionAlias?o=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),n=h("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r),o=(n?n[3]:"")||o),o=v(o),1)}),{preset:s,version:o}}function n(t,n){return u(t,function(t){var e=t.brand;return h(""+n.test,e.toLowerCase())})}r="undefined"==typeof window?{navigator:{userAgent:""}}:window;var p=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],g=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",brand:!0}],m=[{test:"applewebkit",id:"webkit"}],E=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],b=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"mac os x",id:"mac"},{test:"android",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function y(t){var e=function(t){var e=t;if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}(t),n=!!/mobi/g.exec(e),i={name:"unknown",version:"-1",majorVersion:-1,webview:!!d(E,e).preset,chromium:!!d(g,e).preset,webkit:!1},r={name:"unknown",version:"-1",majorVersion:-1},s=d(p,e),o=s.preset,a=s.version,u=d(b,e),h=u.preset,c=u.version;return i.webkit=!i.chromium&&!!d(m,e).preset,h&&(r.name=h.id,r.version=c,r.majorVersion=parseInt(c,10)),o&&(i.name=o.id,i.version=a,i.webview&&"ios"===r.name&&"safari"!==i.name&&(i.webview=!1)),i.majorVersion=parseInt(i.version,10),{browser:i,os:r,isMobile:n,isHints:!1}}function x(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var M,w,P,T,O,A,I,D,C,S,R,k,L=24,j="left",B="right",Y="middle",X="ontouchstart"in r&&"safari"===(void 0===M&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var t=navigator.userAgentData,e=t.brands||t.uaList;return e&&e.length}}()?(O=navigator.userAgentData,A=(O.uaList||O.brands).slice(),I=O.mobile||!1,D=A[0],C={name:D.brand,version:D.version,majorVersion:-1,webkit:!1,webview:e(E,function(t){return n(A,t)}),chromium:e(g,function(t){return n(A,t)})},S={name:"unknown",version:"-1",majorVersion:-1},C.webkit=!C.chromium&&e(m,function(t){return n(A,t)}),w&&(P=w.platform.toLowerCase(),T=u(b,function(t){return new RegExp(""+t.test,"g").exec(P)}),S.name=T?T.id:P,S.version=w.platformVersion),e(p,function(t){var e=n(A,t);return e&&(C.name=t.id,C.version=w?w.uaFullVersion:e.version,1)}),"Linux armv8l"===navigator.platform?S.name="android":C.webkit&&(S.name=I?"ios":"mac"),"ios"===S.name&&C.webview&&(C.version="-1"),S.version=v(S.version),C.version=v(C.version),S.majorVersion=parseInt(S.version,10),C.majorVersion=parseInt(C.version,10),{browser:C,os:S,isMobile:I,isHints:!0}):y(M)).browser.name,F=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),N={"user-select":"none","-webkit-user-drag":"none"},V=function(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,x(n.childNodes)):x(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==r&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in r&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return V(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i},W=r.requestAnimationFrame||r.webkitRequestAnimationFrame,H=r.cancelAnimationFrame||r.webkitCancelAnimationFrame;W&&!H?(R={},k=W,W=function(e){var n=k(function(t){R[n]&&e(t)});return R[n]=!0,n},H=function(t){delete R[t]}):W&&H||(W=function(t){return r.setTimeout(function(){t(r.performance&&r.performance.now&&r.performance.now()||(new Date).getTime())},16)},H=r.clearTimeout);function K(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function U(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function q(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function Q(t,n){return q(t,function(t,e){return t===n[e]})}function z(t,e){return ct[e]||(ct[e]=lt(e)),ct[e](t)}function G(t,n){return t&&n?K(t,function(t,e){return z(t,"number"==typeof n?n:n[e])}):t}function Z(t){if(!isFinite(t))return 0;var e=""+t;if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function J(t,e){return 180*Math.atan2(e,t)/Math.PI}function $(e){var n=!0;return Object.keys(N).forEach(function(t){e&&e[t]===N[t]||(n=!1)}),n}function tt(e,t,n){var i,r,s,o=((i={})[1]="auto",i[30]="none",i[L]="pan-x",i[6]="pan-y",i),a={};return e&&e.style&&(r=t.touchAction?t.touchAction:o[n],s=_(_({},N),{"touch-action":"none"===e.style["touch-action"]?"none":r}),Object.keys(s).forEach(function(t){a[t]=e.style[t],e.style[t]=s[t]})),a}function et(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function nt(t,e,n,i){var r=t,s=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],r=Math.max(s[0],r);return Math.min(s[1],r)}function it(t,e){return t<e[0]||t>e[1]}function rt(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function st(t,e,n){var i=t,r=e[0],s=e[1],o=s-r;return n[1]&&s<t&&(i=(i-s)%o+r),n[0]&&t<r&&(i=(i-r)%o+s),i}function ot(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function at(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=_t;break;case"pointer":i=mt}}),i?new xt:e&&n?new Mt:e?new yt:n?new bt:null}function ut(t,e,n){return Math.max(Math.min(t,n),e)}function ht(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}var ct={},lt=function(e){var n=e<1?Math.pow(10,Z(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},vt=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){var n=this._getRoundPos(t).roundPos;this._axes.trigger(new f("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0}))},e.triggerRelease=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new f("release",_(_({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){void 0===i&&(i=!1);var r=this.animationManager,s=r.axisManager,o=r.getEventInfo(),a=this._getRoundPos(t,e),u=a.roundPos,h=a.roundDepa,c=s.moveTo(u,h),l=(null==n?void 0:n.event)||(null==o?void 0:o.event)||null,v={pos:c.pos,delta:c.delta,bounceRatio:this._getBounceRatio(c.pos),holding:i,inputEvent:l,isTrusted:!!l,input:(null==n?void 0:n.input)||(null==o?void 0:o.input)||null,set:l?this._createUserControll(c.pos):function(){}},d=new f("change",v);return this._axes.trigger(d),l&&s.set(v.set().destPos),!d.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this._createUserControll(t.destPos,t.duration);var r=new f("animationStart",t);return this._axes.trigger(r),!r.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new f("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new f("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:_({},t),duration:e};return function(t,e){return t&&(n.destPos=_({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:G(t,n),roundDepa:G(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),dt=function(){function t(t){this._options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this._options.interruptable||this._prevented},e.isInterrupted=function(){return!this._options.interruptable&&this._prevented},e.setInterrupt=function(t){this._options.interruptable||(this._prevented=t)},t}(),ft=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].range[0],t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return K(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):_(_({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=K(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?st(t,e.range,e.circular):0})),{pos:_({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this._axis;return q(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return U(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return K(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!it(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e._complementOptions=function(){var r=this;Object.keys(this._axis).forEach(function(i){r._axis[i]=_({range:[0,100],bounce:[0,0],circular:[!1,!1]},r._axis[i]),["bounce","circular"].forEach(function(t){var e=r._axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},t}(),_t="ontouchstart"in r,pt="PointerEvent"in r,gt="MSPointerEvent"in r,mt=pt||gt,Et=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),r.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e,n=this.prevEvent,i=this._getCenter(t),r=n?this._getMovement(t):{x:0,y:0},s=n?this._getScale(t):1,o=n?J(i.x-n.center.x,i.y-n.center.y):0,a=n?n.deltaX+r.x:r.x,u=n?n.deltaY+r.y:r.y,h=r.x,c=r.y,l=this._latestInterval,v=Date.now(),d=l?v-l.timestamp:0,f=n?n.velocityX:0,_=n?n.velocityY:0;return(!l||16<=d)&&(l&&(f=(e=[(a-l.deltaX)/d,(u-l.deltaY)/d])[0],_=e[1]),this._latestInterval={timestamp:v,deltaX:a,deltaY:u}),{srcEvent:t,scale:s,angle:o,center:i,deltaX:a,deltaY:u,offsetX:h,offsetY:c,velocityX:f,velocityY:_,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)},e._getButton=function(t){var e={1:j,2:B,4:Y},n=this._isTouchEvent(t)?j:e[t.buttons];return n||null},e._isTouchEvent=function(t){return-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._preventMouseButton=function(t,e){e===B?r.addEventListener("contextmenu",this._stopContextMenu):e===Y&&t.preventDefault()},t}(),bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(){return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(Et),yt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t){return this._baseTouches=t.touches,this.extendEvent(t)},n.onEventMove=function(t){return this.extendEvent(t)},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(Et),xt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=pt?["pointerdown"]:["MSPointerDown"],t.move=pt?["pointermove"]:["MSPointerMove"],t.end=pt?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this._updatePointerEvent(t),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:(this._updatePointerEvent(t),this.extendEvent(t))},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,r=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(r=!0,i._recentInputs[e]=n)}),r||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(Et),Mt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}s(t,e);var n=t.prototype;return n.onEventStart=function(t,e){var n=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),e&&!this._isValidButton(n,e)?null:(this._preventMouseButton(t,n),this.extendEvent(t))},n.onEventMove=function(t,e){return e&&!this._isValidButton(this._getButton(t),e)?null:this.extendEvent(t)},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,n=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),i=n[0],r=n[1];return i.id===r.id?{x:i.x-r.x,y:i.y-r.y}:{x:0,y:0}},t}(Et),wt=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager,s=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=r,this._animationManager=s}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){var n;!this._interruptManager.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(n),this._moveDistance||this._eventManager.hold(this._axisManager.get(),n),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var r,s,o,a,u;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((r=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyChanged||(s=this._moveDistance||this._axisManager.get(t.axes),o=K(s,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(o,function(t,e){var n=e.circular,i=e.range;return n&&(n[0]||n[1])?st(t,i,n):t})),this._isOutside&&this._axisManager.every(s,function(t,e){return!it(t,e.range)})&&(this._isOutside=!1),s=this._atOutside(s),o=this._atOutside(o),this.options.nested&&this._isEndofAxis(n,s,o)||(r.__childrenAxesAlreadyChanged=!0),a={input:t,event:e},i?(u=this._animationManager.getDuration(o,s),this._animationManager.animateTo(o,u,a)):this._eventManager.triggerChange(o,s,a,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var r,s,o,a,u,h,c,l,v,d,f;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((r=e.srcEvent?e.srcEvent:e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),s=this._axisManager.get(t.axes),o=this._axisManager.get(),a=this._animationManager.getDisplacement(n),u=ot(t.axes,a),h=this._axisManager.get(this._axisManager.map(u,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?s[n]+t:nt(s[n]+t,e.range,e.circular,e.bounce)})),r.__childrenAxesAlreadyReleased=!0,0===(c=this._animationManager.getDuration(h,s,i))&&(h=_({},o)),l={depaPos:o,destPos:h,duration:c,delta:this._axisManager.getDelta(o,h),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(l),this._moveDistance=null,v=this._animationManager.getUserControl(l),f={input:t,event:e},(d=Q(v.destPos,o))||0===v.duration?(d||this._eventManager.triggerChange(v.destPos,o,f,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(f):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(v.destPos,v.duration,f))},e._atOutside=function(t){var o=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,s=e.circular;return s&&(s[0]||s[1])?t:t<n?n-o._animationManager.interpolate(n-t,r[0]):i<t?i+o._animationManager.interpolate(t-i,r[1]):t})},e._isEndofAxis=function(a,u,h){return this._axisManager.every(u,function(t,e,n){return 0===a[n]||u[n]===h[n]&&(i=t,r=e.range,s=e.bounce,!(o=e.circular)[0]&&i===r[0]-s[0]||!o[1]&&i===r[1]+s[1]);var i,r,s,o})},t}(),Pt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}s(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,r,s,o=this._animateParam;o&&(e=(new Date).getTime()-o.startTime,n=(null==t?void 0:t.destPos)||o.destPos,i=(null==t?void 0:t.duration)||o.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(r=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,o.delta=this.axisManager.getDelta(r,n),o.destPos=n),null!=t&&t.duration&&(s=(e+this._durationOffset)/o.duration,this._durationOffset=s*i-e,o.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var o=this,a=this._animateParam,u=t.pos,h=a.destPos,c=K(u,function(t,e){return t<=h[e]?1:-1}),l=((new Date).getTime()-a.startTime+this._durationOffset)/a.duration,v=this._easing(l);return{pos:this.axisManager.map(u,function(t,e,n){var i,r=1<=l?h[n]:t+a.delta[n]*(v-o._prevEasingPer)/(1-o._initialEasingPer),s=st(r,e.range,e.circular);return r!==s&&(i=c[n]*(e.range[1]-e.range[0]),h[n]-=i,u[n]-=i),s}),easingPer:this._prevEasingPer=v,finished:1<=v}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=r,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(s,t,e){var n,i,o=this;return i=void 0!==e?e:(n=K(t,function(t,e){return n=Math.abs(t-s[e]),i=o._options.deceleration,(r=Math.sqrt(n/i*2))<100?0:r;var n,i,r}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),ut(i,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e,i;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return st(t,e.range,e.circular)}),q(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(i=this._raf,H(i)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return rt(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return st(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){var e=t.setTo();return e.destPos=this.axisManager.get(e.destPos),e.duration=ut(e.duration,this._options.minimumDuration,this._options.maximumDuration),e},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var r,s=this._createAnimationParam(t,e,n),o=_({},s.depaPos),a=this.eventManager.triggerAnimationStart(s),u=this.getUserControl(s);!a&&this.axisManager.every(u.destPos,function(t,e){return rt(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!Q(u.destPos,o)&&(r=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:o,destPos:u.destPos,duration:u.duration,delta:this.axisManager.getDelta(o,u.destPos),isTrusted:!!r,inputEvent:r,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(Q(t,i))return this;this.interruptManager.setInterrupt(!0);var r=U(t,function(t,e){return i[e]!==t});return Object.keys(r).length?(r=this.axisManager.map(r,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:nt(t,n,i)}),Q(r,i)||(0<e?this.animateTo(r,e):(this.stopAnimation(),this.eventManager.triggerChange(r),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(K(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),r=t,s=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:r,duration:ut(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,r),inputEvent:s,input:(null==n?void 0:n.input)||null,isTrusted:!!s,done:this.animationEnd}},e._animateLoop=function(t,i){var r,s,o,a=this;t.duration?(this._animateParam=_(_({},t),{startTime:(new Date).getTime()}),r=K(t.destPos,function(t){return t}),s=this._initState(this._animateParam),(o=function(){a._raf=null;var t=a._animateParam,e=a._getNextState(s),n=!a.eventManager.triggerChange(e.pos,s.pos);if((s=e).finished)return t.destPos=a._getFinalPos(t.destPos,r),Q(t.destPos,a.axisManager.get(Object.keys(t.destPos)))||a.eventManager.triggerChange(t.destPos,e.pos),void i();n?a.finish(!1):a._raf=W(o)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,i){var r=this;return K(t,function(t,e){if(t>=i[e]-1e-6&&t<=i[e]+1e-6)return i[e];var n=r._getRoundUnit(t,e);return z(t,n)})},e._getRoundUnit=function(t,e){var n,i,r=this._options.round,s=null;return r||(n=this.axisManager.getAxisOptions(e),i=Math.max(Z(n.range[0]),Z(n.range[1]),Z(t)),s=1/Math.pow(10,i)),s||r},t}()),Tt=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n=null);var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=_({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),i.interruptManager=new dt(i.options),i.axisManager=new ft(i.axis),i.eventManager=new vt(i),i.animationManager=new Pt(i),i.inputObserver=new wt(i),i.eventManager.setAnimationManager(i.animationManager),n&&i.eventManager.triggerChange(n),i}s(t,r);var e=t.prototype;return e.connect=function(t,e){var n="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(n),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.2.0",t.TRANSFORM=F,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=L,t.DIRECTION_ALL=30,t}(t),Ot=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._forceRelease=function(){var t=n._activeEvent,e=t.prevEvent;n._detachWindowEvent(t),t.onRelease(),n._observer.release(n,e,[0,0])},this.element=V(t),this.options=_({inputType:["touch","mouse","pointer"],inputButton:[j],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?30:e?6:n?L:1,this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=tt(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),$(this._originalCssProps)||et(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);!i||!this._enabled||1<n.getTouches(t)||!1!==i.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this._observer.hold(this,i),this._atRightEdge=X&&i.center.x>window.innerWidth-e,this._attachWindowEvent(n),n.prevEvent=i)},e._onPanmove=function(t){var e=this,n=this._activeEvent,i=n.onEventMove(t,this.options.inputButton);if(i&&this._enabled&&!(1<n.getTouches(t))){var r=this.options,s=r.iOSEdgeSwipeThreshold,o=r.releaseOnScroll,a=function(t,e){if(e<0||90<e)return 1;var n=Math.abs(t);return e<n&&n<180-e?L:6}(i.angle,this.options.thresholdAngle);if(!o||i.srcEvent.cancelable){if(n.prevEvent&&X){if(i.center.x<0)return void this._forceRelease();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),i.deltaX<-s?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e._forceRelease()},100))}var u=this._applyScale([i.offsetX,i.offsetY],[ht(6,this._direction,a),ht(L,this._direction,a)]),h=u.some(function(t){return 0!==t});h&&(!1!==i.srcEvent.cancelable&&i.srcEvent.preventDefault(),i.srcEvent.stopPropagation()),(i.preventSystemEvent=h)&&this._observer.change(this,i,ot(this.axes,u)),n.prevEvent=i}else this._onPanend(t)}},e._onPanend=function(t){var e,n,i=this._activeEvent;i.onEventEnd(t),this._enabled&&0===i.getTouches(t)&&(this._detachWindowEvent(i),clearTimeout(this._rightEdgeTimer),e=i.prevEvent,n=this._applyScale([Math.abs(e.velocityX)*(e.offsetX<0?-1:1),Math.abs(e.velocityY)*(e.offsetY<0?-1:1)],[ht(6,this._direction),ht(L,this._direction)]),i.onRelease(),this._observer.release(this,e,n))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend)})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._attachElementEvent=function(t){var n=this,e=at(this.options.inputType);if(!e)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=e)&&e.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.addEventListener(t,n._onPanstart)})},e._detachElementEvent=function(){var n=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){var e;null!==(e=n.element)&&void 0!==e&&e.removeEventListener(t,n._onPanstart)}),this._enabled=!1,this._observer=null},e._applyScale=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),At=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._prevQuadrant=null,n._lastDiff=0,n}s(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=Tt.DIRECTION_ALL,this.axes=t},e._onPanstart=function(t){var e,n=this._activeEvent,i=n.onEventStart(t,this.options.inputButton);i&&this.isEnabled()&&(e=this.element.getBoundingClientRect(),this._observer.hold(this,i),this._attachWindowEvent(n),this._coefficientForDistanceToAngle=360/(e.width*Math.PI),this._rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this._prevAngle=null,this._triggerChange(i),n.prevEvent=i)},e._onPanmove=function(t){var e=this._activeEvent,n=e.onEventMove(t,this.options.inputButton);n&&this.isEnabled()&&(!1!==n.srcEvent.cancelable&&n.srcEvent.preventDefault(),n.srcEvent.stopPropagation(),this._triggerChange(n),e.prevEvent=n)},e._onPanend=function(t){var e,n,i,r,s=this._activeEvent;s.onEventEnd(t),this.isEnabled()&&(e=s.prevEvent,this._triggerChange(e),n=e.velocityX,i=e.velocityY,r=Math.sqrt(n*n+i*i)*(0<this._lastDiff?-1:1),s.onRelease(),this._observer.release(this,e,[r*this._coefficientForDistanceToAngle]),this._detachWindowEvent(s))},e._triggerChange=function(t){var e=this._getPosFromOrigin(t.center.x,t.center.y),n=e.x,i=e.y,r=J(n,i),s=r<0?360+r:r,o=this._getQuadrant(t.center.x,t.center.y),a=this._getDifference(this._prevAngle,s,this._prevQuadrant,o);this._prevAngle=s,this._prevQuadrant=o,0!==a&&(this._lastDiff=a,this._observer.change(this,t,ot(this.axes,[-a])))},e._getDifference=function(t,e,n,i){var r=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return r},e._getPosFromOrigin=function(t,e){return{x:t-this._rotateOrigin[0],y:this._rotateOrigin[1]-e}},e._getQuadrant=function(t,e){var n=this._getPosFromOrigin(t,e),i=n.x,r=n.y,s=0;return 0<=i&&0<=r?s=1:i<0&&0<=r?s=2:i<0&&r<0?s=3:0<=i&&r<0&&(s=4),s},t}(Ot),It=function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this.element=V(t),this.options=_({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"none"},e),this._onPinchStart=this._onPinchStart.bind(this),this._onPinchMove=this._onPinchMove.bind(this),this._onPinchEnd=this._onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=tt(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),$(this._originalCssProps)||et(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,e.prevEvent=n)},e._onPinchMove=function(t){var e,n=this._activeEvent,i=n.onEventMove(t);i&&this._pinchFlag&&this._enabled&&2===n.getTouches(t)&&(e=this._getOffset(i.scale,n.prevEvent.scale),this._observer.change(this,t,ot(this.axes,[e])),n.prevEvent=i)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=at(this.options.inputType);if(!n)throw new Error("There is currently no inputType available for current device. There must be at least one available inputType.");this._observer=t,this._enabled=!0,null!=(this._activeEvent=n)&&n.start.forEach(function(t){e.element.addEventListener(t,e._onPinchStart,!1)}),null!=n&&n.move.forEach(function(t){e.element.addEventListener(t,e._onPinchMove,!1)}),null!=n&&n.end.forEach(function(t){e.element.addEventListener(t,e._onPinchEnd,!1)})},e._detachEvent=function(){var e=this,t=this._activeEvent;null!=t&&t.start.forEach(function(t){e.element.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){e.element.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){e.element.removeEventListener(t,e._onPinchEnd,!1)}),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},t}(),Dt=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=V(t),this.options=_({scale:1,releaseDelay:300,useNormalized:!0},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&(t.preventDefault(),0!==t.deltaY&&(this._holding||(this._observer.hold(this,t),this._holding=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this._observer.change(this,t,ot(this.axes,[e]),!0),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),Ct=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=V(t),this.options=_({scale:[1,1]},e),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this._detachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onKeydown=function(t){if(this._enabled){var e,n=!0,i=1,r=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,r=1;break;case 38:case 87:r=1;break;default:n=!1}(-1===r&&!this.axes[0]||1===r&&!this.axes[1])&&(n=!1),n&&(t.preventDefault(),e=-1===r?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._holding||(this._observer.hold(this,t),this._holding=!0),clearTimeout(this._timer),this._observer.change(this,t,ot(this.axes,e)))}},e._onKeyup=function(t){var e=this;this._holding&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e._observer.release(e,t,[0,0]),e._holding=!1},80))},e._attachEvent=function(t){this._observer=t,this.element.addEventListener("keydown",this._onKeydown,!1),this.element.addEventListener("keypress",this._onKeydown,!1),this.element.addEventListener("keyup",this._onKeyup,!1),this._enabled=!0},e._detachEvent=function(){this.element.removeEventListener("keydown",this._onKeydown,!1),this.element.removeEventListener("keypress",this._onKeydown,!1),this.element.removeEventListener("keyup",this._onKeyup,!1),this._enabled=!1,this._observer=null},t}();return Tt.PanInput=Ot,Tt.RotatePanInput=At,Tt.PinchInput=It,Tt.WheelInput=Dt,Tt.MoveKeyInput=Ct,Tt});
//# sourceMappingURL=axes.pkgd.min.js.map

@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () {

@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () {

@@ -45,2 +45,6 @@ var __assign = (this && this.__assign) || function () {

};
AnimationManager.prototype.interpolate = function (displacement, threshold) {
var initSlope = this.easing(0.00001) / 0.00001;
return this.easing(displacement / (threshold * initSlope)) * threshold;
};
AnimationManager.prototype.stopAnimation = function (option) {

@@ -139,2 +143,5 @@ if (this._animateParam) {

};
AnimationManager.prototype.easing = function (p) {
return p > 1 ? 1 : this._options.easing(p);
};
AnimationManager.prototype.setTo = function (pos, duration) {

@@ -178,2 +185,26 @@ if (duration === void 0) { duration = 0; }

};
AnimationManager.prototype.updateAnimation = function (options) {
var animateParam = this._animateParam;
if (!animateParam) {
return;
}
var diffTime = new Date().getTime() - animateParam.startTime;
var pos = (options === null || options === void 0 ? void 0 : options.destPos) || animateParam.destPos;
var duration = (options === null || options === void 0 ? void 0 : options.duration) || animateParam.duration;
if ((options === null || options === void 0 ? void 0 : options.restart) || duration <= diffTime) {
this.setTo(pos, duration - diffTime);
return;
}
if (options === null || options === void 0 ? void 0 : options.destPos) {
var currentPos = this.axisManager.get();
this._initialEasingPer = this._prevEasingPer;
animateParam.delta = this.axisManager.getDelta(currentPos, pos);
animateParam.destPos = pos;
}
if (options === null || options === void 0 ? void 0 : options.duration) {
var ratio = (diffTime + this._durationOffset) / animateParam.duration;
this._durationOffset = ratio * duration - diffTime;
animateParam.duration = duration;
}
};
AnimationManager.prototype._createAnimationParam = function (pos, duration, option) {

@@ -197,15 +228,39 @@ var depaPos = this.axisManager.get();

if (param.duration) {
var prevPos_1 = param.depaPos;
this._initialEasingPer = 0;
this._prevEasingPer = 0;
this._durationOffset = 0;
this._animateParam = __assign(__assign({}, param), { startTime: new Date().getTime() });
var directions_1 = map(prevPos_1, function (value, key) {
return value <= param.destPos[key] ? 1 : -1;
});
var originalIntendedPos_1 = map(param.destPos, function (v) { return v; });
var state_1 = this._initState(this._animateParam);
var loop_1 = function () {
var animateParam = _this._animateParam;
var diffTime = new Date().getTime() - animateParam.startTime;
var ratio = (diffTime + _this._durationOffset) / animateParam.duration;
var easingPer = _this.easing(ratio);
_this._raf = null;
var animateParam = _this._animateParam;
var nextState = _this._getNextState(state_1);
var isCanceled = !_this.eventManager.triggerChange(nextState.pos, state_1.pos);
state_1 = nextState;
if (nextState.finished) {
var toPos = _this.axisManager.map(prevPos_1, function (pos, options, key) {
var nextPos = ratio >= 1
? animateParam.destPos[key]
: pos +
(animateParam.delta[key] *
(easingPer - _this._prevEasingPer)) /
(1 - _this._initialEasingPer);
var circulatedPos = getCirculatedPos(nextPos, options.range, options.circular);
if (nextPos !== circulatedPos) {
var rangeOffset = directions_1[key] * (options.range[1] - options.range[0]);
animateParam.destPos[key] -= rangeOffset;
prevPos_1[key] -= rangeOffset;
}
return circulatedPos;
});
var isCanceled = !_this.eventManager.triggerChange(toPos, prevPos_1);
prevPos_1 = toPos;
_this._prevEasingPer = easingPer;
if (easingPer >= 1) {
animateParam.destPos = _this._getFinalPos(animateParam.destPos, originalIntendedPos_1);
if (!equal(animateParam.destPos, _this.axisManager.get(Object.keys(animateParam.destPos)))) {
_this.eventManager.triggerChange(animateParam.destPos, nextState.pos);
_this.eventManager.triggerChange(animateParam.destPos, prevPos_1);
}

@@ -212,0 +267,0 @@ complete();

@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () {

@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () {

@@ -0,0 +0,0 @@ var win;

@@ -36,4 +36,3 @@ export var DIRECTION_NONE = 1;

})();
export var PREVENT_SCROLL_CSSPROPS = {
"touch-action": "none",
export var PREVENT_DRAG_CSSPROPS = {
"user-select": "none",

@@ -40,0 +39,0 @@ "-webkit-user-drag": "none",

@@ -0,0 +0,0 @@ export var getInsidePosition = function (destPos, range, circular, bounce) {

@@ -0,0 +0,0 @@ import { getAngle } from "../utils";

@@ -61,4 +61,4 @@ var __extends = (this && this.__extends) || (function () {

return {
x: event.pageX - prev.pageX,
y: event.pageY - prev.pageY,
x: event.clientX - prev.clientX,
y: event.clientY - prev.clientY,
};

@@ -65,0 +65,0 @@ };

@@ -79,4 +79,4 @@ var __extends = (this && this.__extends) || (function () {

return {
x: event.pageX - prev.pageX,
y: event.pageY - prev.pageY,
x: event.clientX - prev.clientX,
y: event.clientY - prev.clientY,
};

@@ -83,0 +83,0 @@ };

@@ -65,4 +65,4 @@ var __extends = (this && this.__extends) || (function () {

return {
x: event.touches[0].pageX - prev.touches[0].pageX,
y: event.touches[0].pageY - prev.touches[0].pageY,
x: event.touches[0].clientX - prev.touches[0].clientX,
y: event.touches[0].clientY - prev.touches[0].clientY,
};

@@ -69,0 +69,0 @@ };

@@ -82,7 +82,7 @@ var __extends = (this && this.__extends) || (function () {

var _a = [event, prev].map(function (e) {
if (_this._isTouchEvent(event)) {
if (_this._isTouchEvent(e)) {
return {
id: e.touches[0].identifier,
x: e.touches[0].pageX,
y: e.touches[0].pageY,
x: e.touches[0].clientX,
y: e.touches[0].clientY,
};

@@ -92,4 +92,4 @@ }

id: null,
x: e.pageX,
y: e.pageY,
x: e.clientX,
y: e.clientY,
};

@@ -96,0 +96,0 @@ }), nextSpot = _a[0], prevSpot = _a[1];

@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () {

@@ -0,0 +0,0 @@ import Axes from "./Axes";

@@ -0,0 +0,0 @@ import Axes from "./Axes";

@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () {

@@ -0,0 +0,0 @@ import { MouseEventInput } from "../eventInput/MouseEventInput";

@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () {

@@ -12,4 +12,4 @@ var __assign = (this && this.__assign) || function () {

};
import { $, setCssProps } from "../utils";
import { IS_IOS_SAFARI, IOS_EDGE_THRESHOLD, DIRECTION_NONE, DIRECTION_VERTICAL, DIRECTION_HORIZONTAL, DIRECTION_ALL, PREVENT_SCROLL_CSSPROPS, MOUSE_LEFT, } from "../const";
import { $, isCssPropsFromAxes, setCssProps, revertCssProps } from "../utils";
import { IS_IOS_SAFARI, IOS_EDGE_THRESHOLD, DIRECTION_NONE, DIRECTION_VERTICAL, DIRECTION_HORIZONTAL, DIRECTION_ALL, MOUSE_LEFT, } from "../const";
import { convertInputType, toAxis, } from "./InputType";

@@ -51,3 +51,3 @@ export var getDirectionByAngle = function (angle, thresholdAngle) {

this.element = $(el);
this.options = __assign({ inputType: ["touch", "mouse", "pointer"], inputButton: [MOUSE_LEFT], scale: [1, 1], thresholdAngle: 45, threshold: 0, iOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD, releaseOnScroll: false }, options);
this.options = __assign({ inputType: ["touch", "mouse", "pointer"], inputButton: [MOUSE_LEFT], scale: [1, 1], thresholdAngle: 45, threshold: 0, iOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD, releaseOnScroll: false, touchAction: null }, options);
this._onPanstart = this._onPanstart.bind(this);

@@ -80,3 +80,3 @@ this._onPanmove = this._onPanmove.bind(this);

this._attachElementEvent(observer);
this._originalCssProps = setCssProps(this.element);
this._originalCssProps = setCssProps(this.element, this.options, this._direction);
return this;

@@ -87,4 +87,4 @@ };

this._detachWindowEvent(this._activeEvent);
if (this._originalCssProps !== PREVENT_SCROLL_CSSPROPS) {
setCssProps(this.element, this._originalCssProps);
if (!isCssPropsFromAxes(this._originalCssProps)) {
revertCssProps(this.element, this._originalCssProps);
}

@@ -91,0 +91,0 @@ this._direction = DIRECTION_NONE;

@@ -12,4 +12,4 @@ var __assign = (this && this.__assign) || function () {

};
import { $, setCssProps } from "../utils";
import { PREVENT_SCROLL_CSSPROPS } from "../const";
import { $, isCssPropsFromAxes, setCssProps, revertCssProps } from "../utils";
import { DIRECTION_ALL } from "../const";
import { toAxis, convertInputType, } from "./InputType";

@@ -24,3 +24,3 @@ var PinchInput = (function () {

this.element = $(el);
this.options = __assign({ scale: 1, threshold: 0, inputType: ["touch", "pointer"] }, options);
this.options = __assign({ scale: 1, threshold: 0, inputType: ["touch", "pointer"], touchAction: "none" }, options);
this._onPinchStart = this._onPinchStart.bind(this);

@@ -38,3 +38,3 @@ this._onPinchMove = this._onPinchMove.bind(this);

this._attachEvent(observer);
this._originalCssProps = setCssProps(this.element);
this._originalCssProps = setCssProps(this.element, this.options, DIRECTION_ALL);
return this;

@@ -44,4 +44,4 @@ };

this._detachEvent();
if (this._originalCssProps !== PREVENT_SCROLL_CSSPROPS) {
setCssProps(this.element, this._originalCssProps);
if (!isCssPropsFromAxes(this._originalCssProps)) {
revertCssProps(this.element, this._originalCssProps);
}

@@ -48,0 +48,0 @@ return this;

@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () {

@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () {

@@ -0,0 +0,0 @@ var InterruptManager = (function () {

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

var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { window } from "./browser";
import { PREVENT_SCROLL_CSSPROPS } from "./const";
import { PREVENT_DRAG_CSSPROPS } from "./const";
import { DIRECTION_NONE, DIRECTION_VERTICAL, DIRECTION_HORIZONTAL, DIRECTION_ALL, } from "./const";
export var toArray = function (nodes) {

@@ -155,8 +167,26 @@ var el = [];

};
export var setCssProps = function (element, originalCssProps) {
export var isCssPropsFromAxes = function (originalCssProps) {
var same = true;
Object.keys(PREVENT_DRAG_CSSPROPS).forEach(function (prop) {
if (!originalCssProps ||
originalCssProps[prop] !== PREVENT_DRAG_CSSPROPS[prop]) {
same = false;
}
});
return same;
};
export var setCssProps = function (element, option, direction) {
var _a;
var touchActionMap = (_a = {},
_a[DIRECTION_NONE] = "auto",
_a[DIRECTION_ALL] = "none",
_a[DIRECTION_VERTICAL] = "pan-x",
_a[DIRECTION_HORIZONTAL] = "pan-y",
_a);
var oldCssProps = {};
if (element && element.style) {
var newCssProps_1 = originalCssProps
? originalCssProps
: PREVENT_SCROLL_CSSPROPS;
var touchAction = option.touchAction
? option.touchAction
: touchActionMap[direction];
var newCssProps_1 = __assign(__assign({}, PREVENT_DRAG_CSSPROPS), { "touch-action": element.style["touch-action"] === "none" ? "none" : touchAction });
Object.keys(newCssProps_1).forEach(function (prop) {

@@ -169,2 +199,10 @@ oldCssProps[prop] = element.style[prop];

};
export var revertCssProps = function (element, originalCssProps) {
if (element && element.style && originalCssProps) {
Object.keys(originalCssProps).forEach(function (prop) {
element.style[prop] = originalCssProps[prop];
});
}
return;
};
//# sourceMappingURL=utils.js.map
{
"name": "@egjs/axes",
"version": "3.1.2",
"version": "3.2.0",
"description": "A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -44,6 +44,5 @@ export const DIRECTION_NONE = 1;

export const PREVENT_SCROLL_CSSPROPS = {
"touch-action": "none",
export const PREVENT_DRAG_CSSPROPS = {
"user-select": "none",
"-webkit-user-drag": "none",
};

@@ -62,6 +62,6 @@ import { InputEventType, ExtendedEvent } from "../types";

return {
x: event.pageX - prev.pageX,
y: event.pageY - prev.pageY,
x: event.clientX - prev.clientX,
y: event.clientY - prev.clientY,
};
}
}

@@ -84,4 +84,4 @@ import { InputEventType, ExtendedEvent } from "../types";

return {
x: event.pageX - prev.pageX,
y: event.pageY - prev.pageY,
x: event.clientX - prev.clientX,
y: event.clientY - prev.clientY,
};

@@ -88,0 +88,0 @@ }

@@ -62,6 +62,6 @@ import { InputEventType, ExtendedEvent } from "../types";

return {
x: event.touches[0].pageX - prev.touches[0].pageX,
y: event.touches[0].pageY - prev.touches[0].pageY,
x: event.touches[0].clientX - prev.touches[0].clientX,
y: event.touches[0].clientY - prev.touches[0].clientY,
};
}
}

@@ -92,7 +92,7 @@ import { InputEventType, ExtendedEvent } from "../types";

const [nextSpot, prevSpot] = [event, prev].map((e) => {
if (this._isTouchEvent(event)) {
if (this._isTouchEvent(e)) {
return {
id: (e as TouchEvent).touches[0].identifier,
x: (e as TouchEvent).touches[0].pageX,
y: (e as TouchEvent).touches[0].pageY,
id: e.touches[0].identifier,
x: e.touches[0].clientX,
y: e.touches[0].clientY,
};

@@ -102,4 +102,4 @@ }

id: null,
x: (e as MouseEvent).pageX,
y: (e as MouseEvent).pageY,
x: e.clientX,
y: e.clientY,
};

@@ -106,0 +106,0 @@ });

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

import { $, setCssProps } from "../utils";
import { $, isCssPropsFromAxes, setCssProps, revertCssProps } from "../utils";
import {

@@ -9,3 +9,2 @@ IS_IOS_SAFARI,

DIRECTION_ALL,
PREVENT_SCROLL_CSSPROPS,
MOUSE_LEFT,

@@ -30,2 +29,3 @@ } from "../const";

releaseOnScroll?: boolean;
touchAction?: string;
}

@@ -62,7 +62,9 @@

* @ko eg.Axes.PanInput 모듈의 옵션 객체
* @param {String[]} [inputType=["touch","mouse", "pointer"]] Types of input devices
* @param {String[]} [inputType=["touch", "mouse", "pointer"]] Types of input devices
* - touch: Touch screen
* - mouse: Mouse <ko>입력 장치 종류
* - mouse: Mouse
* - pointer: Mouse and touch <ko>입력 장치 종류
* - touch: 터치 입력 장치
* - mouse: 마우스</ko>
* - mouse: 마우스
* - pointer: 마우스 및 터치</ko>
* @param {String[]} [inputButton=["left"]] List of buttons to allow input

@@ -81,2 +83,3 @@ * - left: Left mouse button and normal touch

* @param {Number} [iOSEdgeSwipeThreshold=30] Area (px) that can go to the next page when swiping the right edge in iOS safari <ko>iOS Safari에서 오른쪽 엣지를 스와이프 하는 경우 다음 페이지로 넘어갈 수 있는 영역(px)</ko>
* @param {String} [touchAction=null] Value that overrides the element's "touch-action" css property. If set to null, it is automatically set to prevent scrolling in the direction of the connected axis. <ko>엘리먼트의 "touch-action" CSS 속성을 덮어쓰는 값. 만약 null로 설정된 경우, 연결된 축 방향으로의 스크롤을 방지하게끔 자동으로 설정된다.</ko>
**/

@@ -112,3 +115,3 @@ /**

protected _observer: InputTypeObserver;
protected _direction;
protected _direction: number;
protected _enabled = false;

@@ -133,2 +136,3 @@ protected _activeEvent: ActiveEvent = null;

releaseOnScroll: false,
touchAction: null,
...options,

@@ -162,3 +166,7 @@ };

this._attachElementEvent(observer);
this._originalCssProps = setCssProps(this.element);
this._originalCssProps = setCssProps(
this.element,
this.options,
this._direction
);
return this;

@@ -170,4 +178,4 @@ }

this._detachWindowEvent(this._activeEvent);
if (this._originalCssProps !== PREVENT_SCROLL_CSSPROPS) {
setCssProps(this.element, this._originalCssProps);
if (!isCssPropsFromAxes(this._originalCssProps)) {
revertCssProps(this.element, this._originalCssProps);
}

@@ -174,0 +182,0 @@ this._direction = DIRECTION_NONE;

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

import { $, setCssProps } from "../utils";
import { $, isCssPropsFromAxes, setCssProps, revertCssProps } from "../utils";
import { ActiveEvent, InputEventType } from "../types";
import { PREVENT_SCROLL_CSSPROPS } from "../const";
import { DIRECTION_ALL } from "../const";

@@ -16,2 +16,3 @@ import {

inputType?: string[];
touchAction?: string;
}

@@ -24,2 +25,8 @@

* @param {Number} [threshold=0] Minimal scale before recognizing <ko>사용자의 Pinch 동작을 인식하기 위해산 최소한의 배율</ko>
* @param {String[]} [inputType=["touch", "pointer"]] Types of input devices
* - touch: Touch screen
* - pointer: Mouse and touch <ko>입력 장치 종류
* - touch: 터치 입력 장치
* - pointer: 마우스 및 터치</ko>
* @param {String} [touchAction="none"] Value that overrides the element's "touch-action" css property. It is set to "none" to prevent scrolling during touch. <ko>엘리먼트의 "touch-action" CSS 속성을 덮어쓰는 값. 터치 도중 스크롤을 방지하기 위해 "none" 으로 설정되어 있다.</ko>
**/

@@ -62,2 +69,3 @@

inputType: ["touch", "pointer"],
touchAction: "none",
...options,

@@ -79,3 +87,7 @@ };

this._attachEvent(observer);
this._originalCssProps = setCssProps(this.element);
this._originalCssProps = setCssProps(
this.element,
this.options,
DIRECTION_ALL
);
return this;

@@ -86,4 +98,4 @@ }

this._detachEvent();
if (this._originalCssProps !== PREVENT_SCROLL_CSSPROPS) {
setCssProps(this.element, this._originalCssProps);
if (!isCssPropsFromAxes(this._originalCssProps)) {
revertCssProps(this.element, this._originalCssProps);
}

@@ -90,0 +102,0 @@ return this;

import { window } from "./browser";
import { PREVENT_SCROLL_CSSPROPS } from "./const";
import { PREVENT_DRAG_CSSPROPS } from "./const";
import { PanInputOption } from "./inputType/PanInput";
import { PinchInputOption } from "./inputType/PinchInput";
import { ObjectInterface } from "./types";
import {
DIRECTION_NONE,
DIRECTION_VERTICAL,
DIRECTION_HORIZONTAL,
DIRECTION_ALL,
} from "./const";

@@ -228,11 +236,38 @@ declare let jQuery: any;

export const isCssPropsFromAxes = (originalCssProps: {
[key: string]: string;
}) => {
let same = true;
Object.keys(PREVENT_DRAG_CSSPROPS).forEach((prop) => {
if (
!originalCssProps ||
originalCssProps[prop] !== PREVENT_DRAG_CSSPROPS[prop]
) {
same = false;
}
});
return same;
};
export const setCssProps = (
element: HTMLElement,
originalCssProps?: { [key: string]: string }
option: PanInputOption | PinchInputOption,
direction: number
): { [key: string]: string } => {
const touchActionMap = {
[DIRECTION_NONE]: "auto",
[DIRECTION_ALL]: "none",
[DIRECTION_VERTICAL]: "pan-x",
[DIRECTION_HORIZONTAL]: "pan-y",
};
const oldCssProps = {};
if (element && element.style) {
const newCssProps = originalCssProps
? originalCssProps
: PREVENT_SCROLL_CSSPROPS;
const touchAction = option.touchAction
? option.touchAction
: touchActionMap[direction];
const newCssProps = {
...PREVENT_DRAG_CSSPROPS,
"touch-action":
element.style["touch-action"] === "none" ? "none" : touchAction,
};
Object.keys(newCssProps).forEach((prop) => {

@@ -245,1 +280,13 @@ oldCssProps[prop] = element.style[prop];

};
export const revertCssProps = (
element: HTMLElement,
originalCssProps: { [key: string]: string }
): { [key: string]: string } => {
if (element && element.style && originalCssProps) {
Object.keys(originalCssProps).forEach((prop) => {
element.style[prop] = originalCssProps[prop];
});
}
return;
};

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 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 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

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

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

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