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

@egjs/hammerjs

Package Overview
Dependencies
Maintainers
7
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@egjs/hammerjs - npm Package Compare versions

Comparing version 2.0.12 to 2.0.13

4

dist/hammer.min.js

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

/*! Hammer.JS - v2.0.12 - 2018-10-23
/*! Hammer.JS - v2.0.13 - 2018-10-29
* http://naver.github.io/egjs

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

* Licensed under the MIT license */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Hammer=e()}(this,function(){"use strict";function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function o(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a,u="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign,c=["","webkit","Moz","MS","ms","o"],t="undefined"==typeof document?{style:{}}:document.createElement("div"),n="function",h=Math.round,b=Math.abs,w=Date.now;function l(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((i=(n=c[o])?n+r:e)in t)return i;o++}}a="undefined"==typeof window?{}:window;var p=l(t.style,"touchAction"),f=void 0!==p;var v="compute",d="auto",m="manipulation",g="none",y="pan-x",T="pan-y",E=function(){if(!f)return!1;var e={},n=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return e[t]=!n||a.CSS.supports("touch-action",t)}),e}(),I="ontouchstart"in a,A=void 0!==l(a,"PointerEvent"),P=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),S="touch",C="mouse",_=25,D=1,O=4,x=8,R=1,M=2,z=4,N=8,X=16,Y=M|z,F=N|X,q=Y|F,W=["x","y"],L=["clientX","clientY"];function k(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function j(t,e){return typeof t===n?t.apply(e&&e[0]||void 0,e):t}function H(t,e){return-1<t.indexOf(e)}var U=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===v&&(t=this.compute()),f&&this.manager.element.style&&E[t]&&(this.manager.element.style[p]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var e=[];return k(this.manager.recognizers,function(t){j(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(H(t,g))return g;var e=H(t,y),n=H(t,T);return e&&n?g:e||n?e?y:T:H(t,m)?m:d}(e.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=H(i,g)&&!E[g],o=H(i,T)&&!E[T],s=H(i,y)&&!E[y];if(r){var a=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(a&&u&&c)return}if(!s||!o)return r||o&&n&Y||s&&n&F?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function V(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function G(t){var e=t.length;if(1===e)return{x:h(t[0].clientX),y:h(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:h(n/e),y:h(i/e)}}function Z(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:h(t.pointers[n].clientX),clientY:h(t.pointers[n].clientY)},n++;return{timeStamp:w(),pointers:e,center:G(e),deltaX:t.deltaX,deltaY:t.deltaY}}function B(t,e,n){n||(n=W);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function $(t,e,n){n||(n=W);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function J(t,e){return t===e?R:b(t)>=b(e)?t<0?M:z:e<0?N:X}function K(t,e,n){return{x:e/t||0,y:n/t||0}}function Q(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=Z(e)),1<r&&!n.firstMultiple?n.firstMultiple=Z(e):1===r&&(n.firstMultiple=!1);var o,s,a,u,c,h,l=n.firstInput,p=n.firstMultiple,f=p?p.center:l.center,v=e.center=G(i);e.timeStamp=w(),e.deltaTime=e.timeStamp-l.timeStamp,e.angle=$(f,v),e.distance=B(f,v),o=n,a=(s=e).center,u=o.offsetDelta||{},c=o.prevDelta||{},h=o.prevInput||{},s.eventType!==D&&h.eventType!==O||(c=o.prevDelta={x:h.deltaX||0,y:h.deltaY||0},u=o.offsetDelta={x:a.x,y:a.y}),s.deltaX=c.x+(a.x-u.x),s.deltaY=c.y+(a.y-u.y),e.offsetDirection=J(e.deltaX,e.deltaY);var d,m,g,y,T=K(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=T.x,e.overallVelocityY=T.y,e.overallVelocity=b(T.x)>b(T.y)?T.x:T.y,e.scale=p?(d=p.pointers,B((m=i)[0],m[1],L)/B(d[0],d[1],L)):1,e.rotation=p?(g=p.pointers,$((y=i)[1],y[0],L)+$(g[1],g[0],L)):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,o,s=t.lastInterval||e,a=e.timeStamp-s.timeStamp;if(e.eventType!==x&&(_<a||void 0===s.velocity)){var u=e.deltaX-s.deltaX,c=e.deltaY-s.deltaY,h=K(a,u,c);i=h.x,r=h.y,n=b(h.x)>b(h.y)?h.x:h.y,o=J(u,c),t.lastInterval=e}else n=s.velocity,i=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=o}(n,e);var E=t.element;V(e.srcEvent.target,E)&&(E=e.srcEvent.target),e.target=E}function tt(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&D&&i-r==0,s=e&(O|x)&&i-r==0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,Q(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function et(t){return t.trim().split(/\s+/g)}function nt(e,t,n){k(et(t),function(t){e.addEventListener(t,n,!1)})}function it(e,t,n){k(et(t),function(t){e.removeEventListener(t,n,!1)})}function rt(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var e=function(){function t(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){j(e.options.enable,[e])&&n.handler(t)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&nt(this.element,this.evEl,this.domHandler),this.evTarget&&nt(this.target,this.evTarget,this.domHandler),this.evWin&&nt(rt(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&it(this.element,this.evEl,this.domHandler),this.evTarget&&it(this.target,this.evTarget,this.domHandler),this.evWin&&it(rt(this.element),this.evWin,this.domHandler)},t}();function ot(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}var st={pointerdown:D,pointermove:2,pointerup:O,pointercancel:x,pointerout:x},at={2:S,3:"pen",4:C,5:"kinect"},ut="pointerdown",ct="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(ut="MSPointerDown",ct="MSPointerMove MSPointerUp MSPointerCancel");var ht=function(n){function i(){var t,e=i.prototype;return e.evEl=ut,e.evWin=ct,(t=n.apply(this,arguments)||this).store=t.manager.session.pointerEvents=[],t}return o(i,n),i.prototype.handler=function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=st[i],o=at[t.pointerType]||t.pointerType,s=o===S,a=ot(e,t.pointerId,"pointerId");r&D&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(O|x)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))},i}(e);function lt(t){return Array.prototype.slice.call(t,0)}function pt(t,n,e){for(var i=[],r=[],o=0;o<t.length;){var s=n?t[o][n]:t[o];ot(r,s)<0&&i.push(t[o]),r[o]=s,o++}return e&&(i=n?i.sort(function(t,e){return t[n]>e[n]}):i.sort()),i}var ft={touchstart:D,touchmove:2,touchend:O,touchcancel:x},vt=function(t){function e(){return e.prototype.evTarget="touchstart touchmove touchend touchcancel",e.prototype.targetIds={},t.apply(this,arguments)||this}return o(e,t),e.prototype.handler=function(t){var e=ft[t.type],n=function(t,e){var n,i,r=lt(t.touches),o=this.targetIds;if(e&(2|D)&&1===r.length)return o[r[0].identifier]=!0,[r,r];var s=lt(t.changedTouches),a=[],u=this.target;if(i=r.filter(function(t){return V(t.target,u)}),e===D)for(n=0;n<i.length;)o[i[n].identifier]=!0,n++;n=0;for(;n<s.length;)o[s[n].identifier]&&a.push(s[n]),e&(O|x)&&delete o[s[n].identifier],n++;return a.length?[pt(i.concat(a),"identifier",!0),a]:void 0}.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:S,srcEvent:t})},e}(e);var dt={mousedown:D,mousemove:2,mouseup:O},mt=function(n){function i(){var t,e=i.prototype;return e.evEl="mousedown",e.evWin="mousemove mouseup",(t=n.apply(this,arguments)||this).pressed=!1,t}return o(i,n),i.prototype.handler=function(t){var e=dt[t.type];e&D&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=O),this.pressed&&(e&O&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:C,srcEvent:t}))},i}(e),gt=2500,yt=25;function Tt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY},i=this.lastTouches;this.lastTouches.push(n);setTimeout(function(){var t=i.indexOf(n);-1<t&&i.splice(t,1)},gt)}}var Et=function(){return function(n){function t(t,e){var o;return i(s(s(o=n.call(this,t,e)||this)),"handler",function(t,e,n){var i=n.pointerType===S,r=n.pointerType===C;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(t,e){t&D?(this.primaryTouch=e.changedPointers[0].identifier,Tt.call(this,e)):t&(O|x)&&Tt.call(this,e)}).call(s(s(o)),e,n);else if(r&&function(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=yt&&s<=yt)return!0}return!1}.call(s(s(o)),n))return;o.callback(t,e,n)}}),o.touch=new vt(o.manager,o.handler),o.mouse=new mt(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}return o(t,n),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(e)}();function bt(t,e,n){return!!Array.isArray(t)&&(k(t,n[e],n),!0)}var wt=1;function It(t,e){var n=e.manager;return n?n.get(t):t}function At(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var Pt=function(){function t(t){void 0===t&&(t={}),this.options=r({enable:!0},t),this.id=wt++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(bt(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=It(t,this)).id]||(e[t.id]=t).recognizeWith(this),this},e.dropRecognizeWith=function(t){return bt(t,"dropRecognizeWith",this)||(t=It(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(bt(t,"requireFailure",this))return this;var e=this.requireFail;return-1===ot(e,t=It(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(bt(t,"dropRequireFailure",this))return this;t=It(t,this);var e=ot(this.requireFail,t);return-1<e&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return 0<this.requireFail.length},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(e){var n=this,t=this.state;function i(t){n.manager.emit(t,e)}t<8&&i(n.options.event+At(t)),i(n.options.event),e.additionalEvent&&i(e.additionalEvent),8<=t&&i(n.options.event+At(t))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=32},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=u({},t);if(!j(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),St={domEvents:!1,touchAction:v,enable:!0,inputTarget:null,inputClass:null,preset:[],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ct(n,i){var r,o=n.element;o.style&&(k(n.options.cssProps,function(t,e){r=l(o.style,e),o.style[r]=i?(n.oldCssProps[r]=o.style[r],t):n.oldCssProps[r]||""}),i||(n.oldCssProps={}))}var _t=function(){function t(t,e){var n,i=this;this.options=u({},St,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(A?ht:P?vt:I?Et:mt))(n,tt),this.touchAction=new U(this,this.options.touchAction),Ct(this,!0),k(this.options.recognizers,function(t){var e=i.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}var e=t.prototype;return e.set=function(t){return u(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var i=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===e.stopped||r&&n!==r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&14&n.state&&(r=e.curRecognizer=n),o++}},e.get=function(t){if(t instanceof Pt)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null},e.add=function(t){if(bt(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},e.remove=function(t){if(bt(t,"remove",this))return this;var e=this.get(t);if(t){var n=this.recognizers,i=ot(n,e);-1!==i&&(n.splice(i,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var n=this.handlers;return k(et(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var n=this.handlers;return k(et(t),function(t){e?n[t]&&n[t].splice(ot(n[t],e),1):delete n[t]}),this},e.emit=function(t,e){var n,i,r;this.options.domEvents&&(n=t,i=e,(r=document.createEvent("Event")).initEvent(n,!0,!0),(r.gesture=i).target.dispatchEvent(r));var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](e),s++}},e.destroy=function(){this.element&&Ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),Dt=function(e){function t(t){return void 0===t&&(t={}),e.call(this,r({pointers:1},t))||this}o(t,e);var n=t.prototype;return n.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},n.process=function(t){var e=this.state,n=t.eventType,i=6&e,r=this.attrTest(t);return i&&(n&x||!r)?16|e:i||r?n&O?8|e:2&e?4|e:2:32},t}(Pt),Ot=function(e){function t(t){return void 0===t&&(t={}),e.call(this,r({event:"rotate",threshold:0,pointers:2},t))||this}o(t,e);var n=t.prototype;return n.getTouchAction=function(){return[g]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(Dt),xt=function(n){function t(t){return void 0===t&&(t={}),n.call(this,r({event:"pinch",threshold:0,pointers:2},t))||this}o(t,n);var e=t.prototype;return e.getTouchAction=function(){return[g]},e.attrTest=function(t){return n.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},e.emit=function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}n.prototype.emit.call(this,t)},t}(Dt);function Rt(t){return t===X?"down":t===N?"up":t===M?"left":t===z?"right":""}var Mt=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,r({event:"pan",threshold:10,pointers:1,direction:q},t))||this).pX=null,e.pY=null,e}o(t,n);var e=t.prototype;return e.getTouchAction=function(){var t=this.options.direction,e=[];return t&Y&&e.push(T),t&F&&e.push(y),e},e.directionTest=function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(i=e.direction&Y?(r=0===o?R:o<0?M:z,n=o!==this.pX,Math.abs(t.deltaX)):(r=0===s?R:s<0?N:X,n=s!==this.pY,Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},e.attrTest=function(t){return Dt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},e.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Rt(t.direction);e&&(t.additionalEvent=this.options.event+e),n.prototype.emit.call(this,t)},t}(Dt),zt=function(i){function t(t){return void 0===t&&(t={}),i.call(this,r({event:"swipe",threshold:10,velocity:.3,direction:Y|F,pointers:1},t))||this}o(t,i);var e=t.prototype;return e.getTouchAction=function(){return Mt.prototype.getTouchAction.call(this)},e.attrTest=function(t){var e,n=this.options.direction;return n&(Y|F)?e=t.overallVelocity:n&Y?e=t.overallVelocityX:n&F&&(e=t.overallVelocityY),i.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&b(e)>this.options.velocity&&t.eventType&O},e.emit=function(t){var e=Rt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},t}(Dt),Nt=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,r({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this).pTime=!1,e.pCenter=!1,e._timer=null,e._input=null,e.count=0,e}o(t,n);var e=t.prototype;return e.getTouchAction=function(){return[m]},e.process=function(t){var e=this,n=this.options,i=t.pointers.length===n.pointers,r=t.distance<n.threshold,o=t.deltaTime<n.time;if(this.reset(),t.eventType&D&&0===this.count)return this.failTimeout();if(r&&o&&i){if(t.eventType!==O)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<n.interval,a=!this.pCenter||B(this.pCenter,t.center)<n.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t,0===this.count%n.taps)return this.hasRequireFailures()?(this._timer=setTimeout(function(){e.state=8,e.tryEmit()},n.interval),2):8}return 32},e.failTimeout=function(){var t=this;return this._timer=setTimeout(function(){t.state=32},this.options.interval),32},e.reset=function(){clearTimeout(this._timer)},e.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(Pt),Xt=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,r({event:"press",pointers:1,time:251,threshold:9},t))||this)._timer=null,e._input=null,e}o(t,n);var e=t.prototype;return e.getTouchAction=function(){return[d]},e.process=function(t){var e=this,n=this.options,i=t.pointers.length===n.pointers,r=t.distance<n.threshold,o=t.deltaTime>n.time;if(this._input=t,!r||!i||t.eventType&(O|x)&&!o)this.reset();else if(t.eventType&D)this.reset(),this._timer=setTimeout(function(){e.state=8,e.tryEmit()},n.time);else if(t.eventType&O)return 8;return 32},e.reset=function(){clearTimeout(this._timer)},e.emit=function(t){8===this.state&&(t&&t.eventType&O?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=w(),this.manager.emit(this.options.event,this._input)))},t}(Pt),Yt=function(){var t=function(t,e){return void 0===e&&(e={}),new _t(t,r({recognizers:[[Ot,{enable:!1}],[xt,{enable:!1},["rotate"]],[zt,{direction:Y}],[Mt,{direction:Y},["swipe"]],[Nt],[Nt,{event:"doubletap",taps:2},["tap"]],[Xt]]},e))};return i(t,"VERSION","2.0.12"),t}(),Ft={touchstart:D,touchmove:2,touchend:O,touchcancel:x},qt=function(n){function i(){var t,e=i.prototype;return e.evTarget="touchstart",e.evWin="touchstart touchmove touchend touchcancel",(t=n.apply(this,arguments)||this).started=!1,t}return o(i,n),i.prototype.handler=function(t){var e=Ft[t.type];if(e===D&&(this.started=!0),this.started){var n=function(t,e){var n=lt(t.touches),i=lt(t.changedTouches);e&(O|x)&&(n=pt(n.concat(i),"identifier",!0));return[n,i]}.call(this,t,e);e&(O|x)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:S,srcEvent:t})}},i}(e);function Wt(i,t,e){var r="DEPRECATED METHOD: "+t+"\n"+e+" AT \n";return function(){var t=new Error("get-stack-trace"),e=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",n=window.console&&(window.console.warn||window.console.log);return n&&n.call(window.console,r,e),i.apply(this,arguments)}}var Lt=Wt(function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&void 0===t[i[r]])&&(t[i[r]]=e[i[r]]),r++;return t},"extend","Use `assign`."),kt=Wt(function(t,e){return Lt(t,e,!0)},"merge","Use `assign`.");var jt={default:Yt,INPUT_START:D,INPUT_MOVE:2,INPUT_END:O,INPUT_CANCEL:x,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:R,DIRECTION_LEFT:M,DIRECTION_RIGHT:z,DIRECTION_UP:N,DIRECTION_DOWN:X,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:F,DIRECTION_ALL:q,Manager:_t,Input:e,TouchAction:U,TouchInput:vt,MouseInput:mt,PointerEventInput:ht,TouchMouseInput:Et,SingleTouchInput:qt,Recognizer:Pt,AttrRecognizer:Dt,Tap:Nt,Pan:Mt,Swipe:zt,Pinch:xt,Rotate:Ot,Press:Xt,on:nt,off:it,each:k,merge:kt,extend:Lt,assign:u,inherit:function(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&u(i,n)},bindFn:function(t,e){return function(){return t.apply(e,arguments)}},prefixed:l,toArray:lt,inArray:ot,uniqueArray:pt,splitStr:et,boolOrFn:j,hasParent:V,addEventListeners:nt,removeEventListeners:it,defaults:St};for(var Ht in jt)Yt[Ht]=jt[Ht];return Yt});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Hammer=e()}(this,function(){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function o(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var i,a="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign,u=["","webkit","Moz","MS","ms","o"],t="undefined"==typeof document?{style:{}}:document.createElement("div"),n="function",c=Math.round,I=Math.abs,w=Date.now;function h(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),o=0;o<u.length;){if((i=(n=u[o])?n+r:e)in t)return i;o++}}i="undefined"==typeof window?{}:window;var l=h(t.style,"touchAction"),p=void 0!==l;var f="compute",v="auto",d="manipulation",m="none",g="pan-x",y="pan-y",T=function(){if(!p)return!1;var e={},n=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return e[t]=!n||i.CSS.supports("touch-action",t)}),e}(),E="ontouchstart"in i,A=void 0!==h(i,"PointerEvent"),b=E&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),C="touch",P="mouse",S=25,_=1,D=4,O=8,x=1,R=2,M=4,N=8,z=16,X=R|M,Y=N|z,F=X|Y,W=["x","y"],q=["clientX","clientY"];function L(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function k(t,e){return typeof t===n?t.apply(e&&e[0]||void 0,e):t}function H(t,e){return-1<t.indexOf(e)}var j=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===f&&(t=this.compute()),p&&this.manager.element.style&&T[t]&&(this.manager.element.style[l]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var e=[];return L(this.manager.recognizers,function(t){k(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(H(t,m))return m;var e=H(t,g),n=H(t,y);return e&&n?m:e||n?e?g:y:H(t,d)?d:v}(e.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=H(i,m)&&!T[m],o=H(i,y)&&!T[y],s=H(i,g)&&!T[g];if(r){var a=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(a&&u&&c)return}if(!s||!o)return r||o&&n&X||s&&n&Y?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function U(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function V(t){var e=t.length;if(1===e)return{x:c(t[0].clientX),y:c(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:c(n/e),y:c(i/e)}}function G(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:c(t.pointers[n].clientX),clientY:c(t.pointers[n].clientY)},n++;return{timeStamp:w(),pointers:e,center:V(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Z(t,e,n){n||(n=W);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function B(t,e,n){n||(n=W);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function $(t,e){return t===e?x:I(t)>=I(e)?t<0?R:M:e<0?N:z}function J(t,e,n){return{x:e/t||0,y:n/t||0}}function K(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=G(e)),1<r&&!n.firstMultiple?n.firstMultiple=G(e):1===r&&(n.firstMultiple=!1);var o,s,a,u,c,h,l=n.firstInput,p=n.firstMultiple,f=p?p.center:l.center,v=e.center=V(i);e.timeStamp=w(),e.deltaTime=e.timeStamp-l.timeStamp,e.angle=B(f,v),e.distance=Z(f,v),o=n,a=(s=e).center,u=o.offsetDelta||{},c=o.prevDelta||{},h=o.prevInput||{},s.eventType!==_&&h.eventType!==D||(c=o.prevDelta={x:h.deltaX||0,y:h.deltaY||0},u=o.offsetDelta={x:a.x,y:a.y}),s.deltaX=c.x+(a.x-u.x),s.deltaY=c.y+(a.y-u.y),e.offsetDirection=$(e.deltaX,e.deltaY);var d,m,g,y,T=J(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=T.x,e.overallVelocityY=T.y,e.overallVelocity=I(T.x)>I(T.y)?T.x:T.y,e.scale=p?(d=p.pointers,Z((m=i)[0],m[1],q)/Z(d[0],d[1],q)):1,e.rotation=p?(g=p.pointers,B((y=i)[1],y[0],q)+B(g[1],g[0],q)):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,o,s=t.lastInterval||e,a=e.timeStamp-s.timeStamp;if(e.eventType!==O&&(S<a||void 0===s.velocity)){var u=e.deltaX-s.deltaX,c=e.deltaY-s.deltaY,h=J(a,u,c);i=h.x,r=h.y,n=I(h.x)>I(h.y)?h.x:h.y,o=$(u,c),t.lastInterval=e}else n=s.velocity,i=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=o}(n,e);var E=t.element;U(e.srcEvent.target,E)&&(E=e.srcEvent.target),e.target=E}function Q(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&_&&i-r==0,s=e&(D|O)&&i-r==0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,K(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function tt(t){return t.trim().split(/\s+/g)}function et(e,t,n){L(tt(t),function(t){e.addEventListener(t,n,!1)})}function nt(e,t,n){L(tt(t),function(t){e.removeEventListener(t,n,!1)})}function it(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var e=function(){function t(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){k(e.options.enable,[e])&&n.handler(t)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&et(this.element,this.evEl,this.domHandler),this.evTarget&&et(this.target,this.evTarget,this.domHandler),this.evWin&&et(it(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&nt(this.element,this.evEl,this.domHandler),this.evTarget&&nt(this.target,this.evTarget,this.domHandler),this.evWin&&nt(it(this.element),this.evWin,this.domHandler)},t}();function rt(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}var ot={pointerdown:_,pointermove:2,pointerup:D,pointercancel:O,pointerout:O},st={2:C,3:"pen",4:P,5:"kinect"},at="pointerdown",ut="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&(at="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel");var ct=function(n){function i(){var t,e=i.prototype;return e.evEl=at,e.evWin=ut,(t=n.apply(this,arguments)||this).store=t.manager.session.pointerEvents=[],t}return o(i,n),i.prototype.handler=function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=ot[i],o=st[t.pointerType]||t.pointerType,s=o===C,a=rt(e,t.pointerId,"pointerId");r&_&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(D|O)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))},i}(e);function ht(t){return Array.prototype.slice.call(t,0)}function lt(t,n,e){for(var i=[],r=[],o=0;o<t.length;){var s=n?t[o][n]:t[o];rt(r,s)<0&&i.push(t[o]),r[o]=s,o++}return e&&(i=n?i.sort(function(t,e){return t[n]>e[n]}):i.sort()),i}var pt={touchstart:_,touchmove:2,touchend:D,touchcancel:O},ft=function(t){function e(){return e.prototype.evTarget="touchstart touchmove touchend touchcancel",e.prototype.targetIds={},t.apply(this,arguments)||this}return o(e,t),e.prototype.handler=function(t){var e=pt[t.type],n=function(t,e){var n,i,r=ht(t.touches),o=this.targetIds;if(e&(2|_)&&1===r.length)return o[r[0].identifier]=!0,[r,r];var s=ht(t.changedTouches),a=[],u=this.target;if(i=r.filter(function(t){return U(t.target,u)}),e===_)for(n=0;n<i.length;)o[i[n].identifier]=!0,n++;n=0;for(;n<s.length;)o[s[n].identifier]&&a.push(s[n]),e&(D|O)&&delete o[s[n].identifier],n++;return a.length?[lt(i.concat(a),"identifier",!0),a]:void 0}.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:C,srcEvent:t})},e}(e);var vt={mousedown:_,mousemove:2,mouseup:D},dt=function(n){function i(){var t,e=i.prototype;return e.evEl="mousedown",e.evWin="mousemove mouseup",(t=n.apply(this,arguments)||this).pressed=!1,t}return o(i,n),i.prototype.handler=function(t){var e=vt[t.type];e&_&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=D),this.pressed&&(e&D&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:P,srcEvent:t}))},i}(e),mt=2500,gt=25;function yt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY},i=this.lastTouches;this.lastTouches.push(n);setTimeout(function(){var t=i.indexOf(n);-1<t&&i.splice(t,1)},mt)}}var Tt=function(){return function(n){function t(t,e){var o;return(o=n.call(this,t,e)||this).handler=function(t,e,n){var i=n.pointerType===C,r=n.pointerType===P;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(t,e){t&_?(this.primaryTouch=e.changedPointers[0].identifier,yt.call(this,e)):t&(D|O)&&yt.call(this,e)}).call(s(s(o)),e,n);else if(r&&function(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=gt&&s<=gt)return!0}return!1}.call(s(s(o)),n))return;o.callback(t,e,n)}},o.touch=new ft(o.manager,o.handler),o.mouse=new dt(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}return o(t,n),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(e)}();function Et(t,e,n){return!!Array.isArray(t)&&(L(t,n[e],n),!0)}var It=1;function wt(t,e){var n=e.manager;return n?n.get(t):t}function At(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var bt=function(){function t(t){void 0===t&&(t={}),this.options=r({enable:!0},t),this.id=It++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return a(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(Et(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=wt(t,this)).id]||(e[t.id]=t).recognizeWith(this),this},e.dropRecognizeWith=function(t){return Et(t,"dropRecognizeWith",this)||(t=wt(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(Et(t,"requireFailure",this))return this;var e=this.requireFail;return-1===rt(e,t=wt(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(Et(t,"dropRequireFailure",this))return this;t=wt(t,this);var e=rt(this.requireFail,t);return-1<e&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return 0<this.requireFail.length},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(e){var n=this,t=this.state;function i(t){n.manager.emit(t,e)}t<8&&i(n.options.event+At(t)),i(n.options.event),e.additionalEvent&&i(e.additionalEvent),8<=t&&i(n.options.event+At(t))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=32},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=a({},t);if(!k(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),Ct={domEvents:!1,touchAction:f,enable:!0,inputTarget:null,inputClass:null,preset:[],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Pt(n,i){var r,o=n.element;o.style&&(L(n.options.cssProps,function(t,e){r=h(o.style,e),o.style[r]=i?(n.oldCssProps[r]=o.style[r],t):n.oldCssProps[r]||""}),i||(n.oldCssProps={}))}var St=function(){function t(t,e){var n,i=this;this.options=a({},Ct,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(A?ct:b?ft:E?Tt:dt))(n,Q),this.touchAction=new j(this,this.options.touchAction),Pt(this,!0),L(this.options.recognizers,function(t){var e=i.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}var e=t.prototype;return e.set=function(t){return a(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var i=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===e.stopped||r&&n!==r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&14&n.state&&(r=e.curRecognizer=n),o++}},e.get=function(t){if(t instanceof bt)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null},e.add=function(t){if(Et(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},e.remove=function(t){if(Et(t,"remove",this))return this;var e=this.get(t);if(t){var n=this.recognizers,i=rt(n,e);-1!==i&&(n.splice(i,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var n=this.handlers;return L(tt(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var n=this.handlers;return L(tt(t),function(t){e?n[t]&&n[t].splice(rt(n[t],e),1):delete n[t]}),this},e.emit=function(t,e){var n,i,r;this.options.domEvents&&(n=t,i=e,(r=document.createEvent("Event")).initEvent(n,!0,!0),(r.gesture=i).target.dispatchEvent(r));var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](e),s++}},e.destroy=function(){this.element&&Pt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),_t={touchstart:_,touchmove:2,touchend:D,touchcancel:O},Dt=function(n){function i(){var t,e=i.prototype;return e.evTarget="touchstart",e.evWin="touchstart touchmove touchend touchcancel",(t=n.apply(this,arguments)||this).started=!1,t}return o(i,n),i.prototype.handler=function(t){var e=_t[t.type];if(e===_&&(this.started=!0),this.started){var n=function(t,e){var n=ht(t.touches),i=ht(t.changedTouches);e&(D|O)&&(n=lt(n.concat(i),"identifier",!0));return[n,i]}.call(this,t,e);e&(D|O)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:C,srcEvent:t})}},i}(e);var Ot=function(e){function t(t){return void 0===t&&(t={}),e.call(this,r({pointers:1},t))||this}o(t,e);var n=t.prototype;return n.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},n.process=function(t){var e=this.state,n=t.eventType,i=6&e,r=this.attrTest(t);return i&&(n&O||!r)?16|e:i||r?n&D?8|e:2&e?4|e:2:32},t}(bt),xt=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,r({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this).pTime=!1,e.pCenter=!1,e._timer=null,e._input=null,e.count=0,e}o(t,n);var e=t.prototype;return e.getTouchAction=function(){return[d]},e.process=function(t){var e=this,n=this.options,i=t.pointers.length===n.pointers,r=t.distance<n.threshold,o=t.deltaTime<n.time;if(this.reset(),t.eventType&_&&0===this.count)return this.failTimeout();if(r&&o&&i){if(t.eventType!==D)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<n.interval,a=!this.pCenter||Z(this.pCenter,t.center)<n.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t,0===this.count%n.taps)return this.hasRequireFailures()?(this._timer=setTimeout(function(){e.state=8,e.tryEmit()},n.interval),2):8}return 32},e.failTimeout=function(){var t=this;return this._timer=setTimeout(function(){t.state=32},this.options.interval),32},e.reset=function(){clearTimeout(this._timer)},e.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(bt);function Rt(t){return t===z?"down":t===N?"up":t===R?"left":t===M?"right":""}var Mt=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,r({event:"pan",threshold:10,pointers:1,direction:F},t))||this).pX=null,e.pY=null,e}o(t,n);var e=t.prototype;return e.getTouchAction=function(){var t=this.options.direction,e=[];return t&X&&e.push(y),t&Y&&e.push(g),e},e.directionTest=function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(i=e.direction&X?(r=0===o?x:o<0?R:M,n=o!==this.pX,Math.abs(t.deltaX)):(r=0===s?x:s<0?N:z,n=s!==this.pY,Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},e.attrTest=function(t){return Ot.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},e.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Rt(t.direction);e&&(t.additionalEvent=this.options.event+e),n.prototype.emit.call(this,t)},t}(Ot),Nt=function(i){function t(t){return void 0===t&&(t={}),i.call(this,r({event:"swipe",threshold:10,velocity:.3,direction:X|Y,pointers:1},t))||this}o(t,i);var e=t.prototype;return e.getTouchAction=function(){return Mt.prototype.getTouchAction.call(this)},e.attrTest=function(t){var e,n=this.options.direction;return n&(X|Y)?e=t.overallVelocity:n&X?e=t.overallVelocityX:n&Y&&(e=t.overallVelocityY),i.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&I(e)>this.options.velocity&&t.eventType&D},e.emit=function(t){var e=Rt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},t}(Ot),zt=function(n){function t(t){return void 0===t&&(t={}),n.call(this,r({event:"pinch",threshold:0,pointers:2},t))||this}o(t,n);var e=t.prototype;return e.getTouchAction=function(){return[m]},e.attrTest=function(t){return n.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},e.emit=function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}n.prototype.emit.call(this,t)},t}(Ot),Xt=function(e){function t(t){return void 0===t&&(t={}),e.call(this,r({event:"rotate",threshold:0,pointers:2},t))||this}o(t,e);var n=t.prototype;return n.getTouchAction=function(){return[m]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(Ot),Yt=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,r({event:"press",pointers:1,time:251,threshold:9},t))||this)._timer=null,e._input=null,e}o(t,n);var e=t.prototype;return e.getTouchAction=function(){return[v]},e.process=function(t){var e=this,n=this.options,i=t.pointers.length===n.pointers,r=t.distance<n.threshold,o=t.deltaTime>n.time;if(this._input=t,!r||!i||t.eventType&(D|O)&&!o)this.reset();else if(t.eventType&_)this.reset(),this._timer=setTimeout(function(){e.state=8,e.tryEmit()},n.time);else if(t.eventType&D)return 8;return 32},e.reset=function(){clearTimeout(this._timer)},e.emit=function(t){8===this.state&&(t&&t.eventType&D?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=w(),this.manager.emit(this.options.event,this._input)))},t}(bt);function Ft(i,t,e){var r="DEPRECATED METHOD: "+t+"\n"+e+" AT \n";return function(){var t=new Error("get-stack-trace"),e=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",n=window.console&&(window.console.warn||window.console.log);return n&&n.call(window.console,r,e),i.apply(this,arguments)}}var Wt=Ft(function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&void 0===t[i[r]])&&(t[i[r]]=e[i[r]]),r++;return t},"extend","Use `assign`."),qt=Ft(function(t,e){return Wt(t,e,!0)},"merge","Use `assign`.");function Lt(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&a(i,n)}function kt(t,e){return function(){return t.apply(e,arguments)}}return function(){var t=function(t,e){return void 0===e&&(e={}),new St(t,r({recognizers:[[Xt,{enable:!1}],[zt,{enable:!1},["rotate"]],[Nt,{direction:X}],[Mt,{direction:X},["swipe"]],[xt],[xt,{event:"doubletap",taps:2},["tap"]],[Yt]]},e))};return t.VERSION="2.0.13",t.DIRECTION_ALL=F,t.DIRECTION_DOWN=z,t.DIRECTION_LEFT=R,t.DIRECTION_RIGHT=M,t.DIRECTION_UP=N,t.DIRECTION_HORIZONTAL=X,t.DIRECTION_VERTICAL=Y,t.DIRECTION_NONE=x,t.DIRECTION_DOWN=z,t.INPUT_START=_,t.INPUT_MOVE=2,t.INPUT_END=D,t.INPUT_CANCEL=O,t.STATE_POSSIBLE=1,t.STATE_BEGAN=2,t.STATE_CHANGED=4,t.STATE_ENDED=8,t.STATE_RECOGNIZED=8,t.STATE_CANCELLED=16,t.STATE_FAILED=32,t.Manager=St,t.Input=e,t.TouchAction=j,t.TouchInput=ft,t.MouseInput=dt,t.PointerEventInput=ct,t.TouchMouseInput=Tt,t.SingleTouchInput=Dt,t.Recognizer=bt,t.AttrRecognizer=Ot,t.Tap=xt,t.Pan=Mt,t.Swipe=Nt,t.Pinch=zt,t.Rotate=Xt,t.Press=Yt,t.on=et,t.off=nt,t.each=L,t.merge=qt,t.extend=Wt,t.bindFn=kt,t.assign=a,t.inherit=Lt,t.bindFn=kt,t.prefixed=h,t.toArray=ht,t.inArray=rt,t.uniqueArray=lt,t.splitStr=tt,t.boolOrFn=k,t.hasParent=U,t.addEventListeners=et,t.removeEventListeners=nt,t.defaults=Ct,t}()});
//# sourceMappingURL=hammer.min.js.map

@@ -5,3 +5,3 @@ {

"description": "A javascript library for multi-touch gestures",
"version": "2.0.12",
"version": "2.0.13",
"homepage": "http://naver.github.io/egjs",

@@ -26,3 +26,3 @@ "license": "MIT",

"@babel/preset-env": "^7.0.0",
"@daybrush/babel-plugin-no-side-effect-class-properties": "0.0.4",
"babel-plugin-no-side-effect-class-properties": "0.0.4",
"bannerize": "^1.0.2",

@@ -29,0 +29,0 @@ "blanket": "^1.2.3",

@@ -8,3 +8,3 @@ # [hammer.js][hammerjs-url] [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Build Status][travis-image]][travis-url]

```sh
npm install --save hammerjs
npm install --save @egjs/hammerjs
```

@@ -16,3 +16,3 @@

```sh
yarn add hammerjs
yarn add @egjs/hammerjs
```

@@ -25,2 +25,3 @@

> We did not provide CDN yet. leave the link to original hammerjs as is.

@@ -90,2 +91,3 @@ ## Usage

[hammerjs-url]: http://hammerjs.github.io
[hammerjs-url]: http://hammerjs.github.io

@@ -92,0 +94,0 @@ [npm-image]: https://img.shields.io/npm/v/hammerjs.svg

@@ -24,3 +24,3 @@ import babel from "rollup-plugin-babel";

{
input: "src/index.umd.js",
input: "src/Hammer.js",
plugins: [babel({ exclude: "node_modules/**" }), replaceVersion],

@@ -39,3 +39,3 @@ output: {

{
input: "src/index.umd.js",
input: "src/Hammer.js",
plugins: [babel({ exclude: "node_modules/**" }), replaceVersion, uglify({

@@ -42,0 +42,0 @@ sourcemap: true,

import Manager from "./manager";
import RotateRecognizer from './recognizers/rotate';
import PinchRecognizer from './recognizers/pinch';
import SwipeRecognizer from './recognizers/swipe';
import PanRecognizer from './recognizers/pan';
import TapRecognizer from './recognizers/tap';
import PressRecognizer from './recognizers/press';
import { DIRECTION_HORIZONTAL } from './inputjs/input-consts';
import defaults from "./defaults";
import assign from './utils/assign';
import {
INPUT_START,
INPUT_MOVE,
INPUT_END,
INPUT_CANCEL,
DIRECTION_NONE,
DIRECTION_LEFT,
DIRECTION_RIGHT,
DIRECTION_UP,
DIRECTION_DOWN,
DIRECTION_HORIZONTAL,
DIRECTION_VERTICAL,
DIRECTION_ALL,
} from "./inputjs/input-consts";
import {
STATE_POSSIBLE,
STATE_BEGAN,
STATE_CHANGED,
STATE_ENDED,
STATE_RECOGNIZED,
STATE_CANCELLED,
STATE_FAILED,
} from "./recognizerjs/recognizer-consts";
import Input from "./inputjs/input-constructor";
import TouchAction from "./touchactionjs/touchaction-constructor";
import TouchInput from "./input/touch";
import MouseInput from "./input/mouse";
import PointerEventInput from "./input/pointerevent";
import SingleTouchInput from "./input/singletouch";
import TouchMouseInput from "./input/touchmouse";
import Recognizer from "./recognizerjs/recognizer-constructor";
import AttrRecognizer from "./recognizers/attribute";
import TapRecognizer from "./recognizers/tap";
import PanRecognizer from "./recognizers/pan";
import SwipeRecognizer from "./recognizers/swipe";
import PinchRecognizer from "./recognizers/pinch";
import RotateRecognizer from "./recognizers/rotate";
import PressRecognizer from "./recognizers/press";
import addEventListeners from "./utils/add-event-listeners";
import removeEventListeners from "./utils/remove-event-listeners";
import each from "./utils/each";
import merge from "./utils/merge";
import extend from "./utils/extend";
import inherit from "./utils/inherit";
import bindFn from "./utils/bind-fn";
import prefixed from "./utils/prefixed";
import toArray from "./utils/to-array";
import uniqueArray from "./utils/unique-array";
import splitStr from "./utils/split-str";
import inArray from "./utils/in-array";
import boolOrFn from "./utils/bool-or-fn";
import hasParent from "./utils/has-parent";
/**

@@ -23,3 +72,57 @@ * @private

static VERSION = "#__VERSION__#";
static DIRECTION_ALL = DIRECTION_ALL;
static DIRECTION_DOWN = DIRECTION_DOWN;
static DIRECTION_LEFT = DIRECTION_LEFT;
static DIRECTION_RIGHT = DIRECTION_RIGHT;
static DIRECTION_UP = DIRECTION_UP;
static DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
static DIRECTION_VERTICAL = DIRECTION_VERTICAL;
static DIRECTION_NONE = DIRECTION_NONE;
static DIRECTION_DOWN = DIRECTION_DOWN;
static INPUT_START = INPUT_START;
static INPUT_MOVE = INPUT_MOVE;
static INPUT_END = INPUT_END;
static INPUT_CANCEL = INPUT_CANCEL;
static STATE_POSSIBLE = STATE_POSSIBLE;
static STATE_BEGAN = STATE_BEGAN;
static STATE_CHANGED = STATE_CHANGED;
static STATE_ENDED = STATE_ENDED;
static STATE_RECOGNIZED = STATE_RECOGNIZED;
static STATE_CANCELLED = STATE_CANCELLED;
static STATE_FAILED = STATE_FAILED;
static Manager = Manager;
static Input = Input;
static TouchAction = TouchAction;
static TouchInput = TouchInput;
static MouseInput = MouseInput;
static PointerEventInput = PointerEventInput;
static TouchMouseInput = TouchMouseInput;
static SingleTouchInput = SingleTouchInput;
static Recognizer = Recognizer;
static AttrRecognizer = AttrRecognizer;
static Tap = TapRecognizer;
static Pan = PanRecognizer;
static Swipe = SwipeRecognizer;
static Pinch = PinchRecognizer;
static Rotate = RotateRecognizer;
static Press = PressRecognizer;
static on = addEventListeners;
static off = removeEventListeners;
static each = each;
static merge = merge;
static extend = extend;
static bindFn = bindFn;
static assign = assign;
static inherit = inherit;
static bindFn = bindFn;
static prefixed = prefixed;
static toArray = toArray;
static inArray = inArray;
static uniqueArray = uniqueArray;
static splitStr = splitStr;
static boolOrFn = boolOrFn;
static hasParent = hasParent;
static addEventListeners = addEventListeners;
static removeEventListeners = removeEventListeners;
static defaults = defaults;
constructor(element, options = {}) {

@@ -26,0 +129,0 @@ return new Manager(element, {

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 too big to display

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