/*! hammer.js - v2.0.8 - 2016-04-23 * http://hammerjs.github.io/ * * copyright (c) 2016 jorik tangelder; * licensed under the mit license */ !function(a,b,c,d){"use strict";function e(a,b,c){return settimeout(j(a,c),b)}function f(a,b,c){return array.isarray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.foreach)a.foreach(b,c);else if(a.length!==d)for(e=0;e\s*\(/gm,"{anonymous}()@"):"unknown stack trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addeventlistener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeeventlistener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentnode}return!1}function p(a,b){return a.indexof(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexof&&!c)return a.indexof(b);for(var d=0;dc[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].touppercase()+b.slice(1),g=0;g1&&!c.firstmultiple?c.firstmultiple=d(b):1===e&&(c.firstmultiple=!1);var f=c.firstinput,g=c.firstmultiple,h=g?g.center:f.center,i=b.center=e(d);b.timestamp=ra(),b.deltatime=b.timestamp-f.timestamp,b.angle=i(h,i),b.distance=h(h,i),b(c,b),b.offsetdirection=g(b.deltax,b.deltay);var j=f(b.deltatime,b.deltax,b.deltay);b.overallvelocityx=j.x,b.overallvelocityy=j.y,b.overallvelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?k(g.pointers,d):1,b.rotation=g?j(g.pointers,d):0,b.maxpointers=c.previnput?b.pointers.length>c.previnput.maxpointers?b.pointers.length:c.previnput.maxpointers:b.pointers.length,c(c,b);var k=a.element;o(b.srcevent.target,k)&&(k=b.srcevent.target),b.target=k}function b(a,b){var c=b.center,d=a.offsetdelta||{},e=a.prevdelta||{},f=a.previnput||{};b.eventtype!==ea&&f.eventtype!==ga||(e=a.prevdelta={x:f.deltax||0,y:f.deltay||0},d=a.offsetdelta={x:c.x,y:c.y}),b.deltax=e.x+(c.x-d.x),b.deltay=e.y+(c.y-d.y)}function c(a,b){var c,e,f,g,h=a.lastinterval||b,i=b.timestamp-h.timestamp;if(b.eventtype!=ha&&(i>da||h.velocity===d)){var j=b.deltax-h.deltax,k=b.deltay-h.deltay,l=f(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=g(j,k),a.lastinterval=b}else c=h.velocity,e=h.velocityx,f=h.velocityy,g=h.direction;b.velocity=c,b.velocityx=e,b.velocityy=f,b.direction=g}function d(a){for(var b=[],c=0;ce;)c+=a[e].clientx,d+=a[e].clienty,e++;return{x:pa(c/b),y:pa(d/b)}}function f(a,b,c){return{x:b/a||0,y:c/a||0}}function g(a,b){return a===b?ia:qa(a)>=qa(b)?0>a?ja:ka:0>b?la:ma}function h(a,b,c){c||(c=qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return math.sqrt(d*d+e*e)}function i(a,b,c){c||(c=qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*math.atan2(e,d)/math.pi}function j(a,b){return i(b[1],b[0],ra)+i(a[1],a[0],ra)}function k(a,b){return h(b[0],b[1],ra)/h(a[0],a[1],ra)}function l(){this.evel=ta,this.evwin=ua,this.pressed=!1,x.apply(this,arguments)}function m(){this.evel=xa,this.evwin=ya,x.apply(this,arguments),this.store=this.manager.session.pointerevents=[]}function n(){this.evtarget=$a,this.evwin=_a,this.started=!1,x.apply(this,arguments)}function o(a,b){var c=s(a.touches),d=s(a.changedtouches);return b&(ga|ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function p(){this.evtarget=bb,this.targetids={},x.apply(this,arguments)}function q(a,b){var c=s(a.touches),d=this.targetids;if(b&(ea|fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedtouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===ea)for(e=0;e-1&&d.splice(a,1)};settimeout(e,cb)}}function u(a){for(var b=a.srcevent.clientx,c=a.srcevent.clienty,d=0;d=f&&db>=g)return!0}return!1}function v(a,b){this.manager=a,this.set(b)}function w(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function x(){if(!fb)return!1;var b={},c=a.css&&a.css.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].foreach(function(d){b[d]=c?a.css.supports("touch-action",d):!0}),b}function y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requirefail=[]}function z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==ma?"down":a==la?"up":a==ja?"left":a==ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.px=null,this.py=null}function ca(){aa.apply(this,arguments)}function da(){y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){y.apply(this,arguments),this.ptime=!1,this.pcenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputtarget=this.options.inputtarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldcssprops={},this.element=a,this.input=y(this),this.touchaction=new v(this,this.options.touchaction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizewith(a[2]),a[3]&&b.requirefailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssprops,function(e,f){d=u(c.style,f),b?(a.oldcssprops[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldcssprops[d]||""}),b||(a.oldcssprops={})}}function ka(a,c){var d=b.createevent("event");d.initevent(a,!0,!0),d.gesture=c,c.target.dispatchevent(d)}var la,ma=["","webkit","moz","ms","ms","o"],na=b.createelement("div"),oa="function",pa=math.round,qa=math.abs,ra=date.now;la="function"!=typeof object.assign?function(a){if(a===d||null===a)throw new typeerror("cannot convert undefined or null to object");for(var b=object(a),c=1;ch&&(b.push(a),h=b.length-1):e&(ga|ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedpointers:[a],pointertype:f,srcevent:a}),c&&b.splice(h,1))}});var za={touchstart:ea,touchmove:fa,touchend:ga,touchcancel:ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(n,x,{handler:function(a){var b=za[a.type];if(b===ea&&(this.started=!0),this.started){var c=o.call(this,a,b);b&(ga|ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedpointers:c[1],pointertype:za,srcevent:a})}}});var ab={touchstart:ea,touchmove:fa,touchend:ga,touchcancel:ha},bb="touchstart touchmove touchend touchcancel";i(p,x,{handler:function(a){var b=ab[a.type],c=q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedpointers:c[1],pointertype:za,srcevent:a})}});var cb=2500,db=25;i(r,x,{handler:function(a,b,c){var d=c.pointertype==za,e=c.pointertype==ba;if(!(e&&c.sourcecapabilities&&c.sourcecapabilities.firestouchevents)){if(d)s.call(this,b,c);else if(e&&u.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchaction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=x();v.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.tolowercase().trim()},update:function(){this.set(this.manager.options.touchaction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.gettouchaction()))}),w(a.join(" "))},preventdefaults:function(a){var b=a.srcevent,c=a.offsetdirection;if(this.manager.session.prevented)return void b.preventdefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltatime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&na||g&&c&oa?this.preventsrc(b):void 0},preventsrc:function(a){this.manager.session.prevented=!0,a.preventdefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchaction.update(),this},recognizewith:function(a){if(f(a,"recognizewith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizewith(this)),this},droprecognizewith:function(a){return f(a,"droprecognizewith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requirefailure:function(a){if(f(a,"requirefailure",this))return this;var b=this.requirefail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requirefailure(this)),this},droprequirefailure:function(a){if(f(a,"droprequirefailure",this))return this;a=_(a,this);var b=r(this.requirefail,a);return b>-1&&this.requirefail.splice(b,1),this},hasrequirefailures:function(){return this.requirefail.length>0},canrecognizewith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+z(d)),b(c.options.event),a.additionalevent&&b(a.additionalevent),d>=qb&&b(c.options.event+z(d))},tryemit:function(a){return this.canemit()?this.emit(a):void(this.state=tb)},canemit:function(){for(var a=0;af?ja:ka,c=f!=this.px,d=math.abs(a.deltax)):(e=0===g?ia:0>g?la:ma,c=g!=this.py,d=math.abs(a.deltay))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrtest:function(a){return aa.prototype.attrtest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directiontest(a))},emit:function(a){this.px=a.deltax,this.py=a.deltay;var b=$(a.direction);b&&(a.additionalevent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},gettouchaction:function(){return[jb]},attrtest:function(a){return this._super.attrtest.call(this,a)&&(math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalevent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,y,{defaults:{event:"press",pointers:1,time:251,threshold:9},gettouchaction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventtype&(ga|ha)&&!f)this.reset();else if(a.eventtype&ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryemit()},b.time,this);else if(a.eventtype&ga)return rb;return tb},reset:function(){cleartimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventtype&ga?this.manager.emit(this.options.event+"up",a):(this._input.timestamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},gettouchaction:function(){return[jb]},attrtest:function(a){return this._super.attrtest.call(this,a)&&(math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:na|oa,pointers:1},gettouchaction:function(){return ba.prototype.gettouchaction.call(this)},attrtest:function(a){var b,c=this.options.direction;return c&(na|oa)?b=a.overallvelocity:c&na?b=a.overallvelocityx:c&oa&&(b=a.overallvelocityy),this._super.attrtest.call(this,a)&&c&a.offsetdirection&&a.distance>this.options.threshold&&a.maxpointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventtype&ga},emit:function(a){var b=$(a.offsetdirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posthreshold:10},gettouchaction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance