/home/arranoyd/empl/wp-content/plugins/keydesign-addon/assets/js/jquery.mobile.vmouse.min.js
/*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */

!function(t,e,n){"function"==typeof define&&define.amd?define(["jquery"],function(o){return n(o,t,e),o.mobile}):n(t.jQuery,t,e)}(this,document,function(t,e,n,o){!function(t,e,n,o){function i(t){for(;t&&void 0!==t.originalEvent;)t=t.originalEvent;return t}function u(e,n){var u,a,r,c,s,v,h,d,f,l=e.type;if(e=t.Event(e),e.type=n,u=e.originalEvent,a=t.event.props,l.search(/^(mouse|click)/)>-1&&(a=M),u)for(h=a.length,c;h;)c=a[--h],e[c]=u[c];if(l.search(/mouse(down|up)|click/)>-1&&!e.which&&(e.which=1),-1!==l.search(/^touch/)&&(r=i(u),l=r.touches,s=r.changedTouches,v=l&&l.length?l[0]:s&&s.length?s[0]:o))for(d=0,f=E.length;d<f;d++)c=E[d],e[c]=v[c];return e}function a(e){for(var n,o,i={};e;){n=t.data(e,X);for(o in n)n[o]&&(i[o]=i.hasVirtualBinding=!0);e=e.parentNode}return i}function r(e,n){for(var o;e;){if((o=t.data(e,X))&&(!n||o[n]))return e;e=e.parentNode}return null}function c(){V=!1}function s(){V=!0}function v(){A=0,L.length=0,S=!1,s()}function h(){c()}function d(){f(),N=setTimeout(function(){N=0,v()},t.vmouse.resetTimerDuration)}function f(){N&&(clearTimeout(N),N=0)}function l(e,n,o){var i;return(o&&o[e]||!o&&r(n.target,e))&&(i=u(n,e),t(n.target).trigger(i)),i}function p(e){var n,o=t.data(e.target,Y);S||A&&A===o||(n=l("v"+e.type,e))&&(n.isDefaultPrevented()&&e.preventDefault(),n.isPropagationStopped()&&e.stopPropagation(),n.isImmediatePropagationStopped()&&e.stopImmediatePropagation())}function m(e){var n,o,u,r=i(e).touches;r&&1===r.length&&(n=e.target,o=a(n),o.hasVirtualBinding&&(A=z++,t.data(n,Y,A),f(),h(),H=!1,u=i(e).touches[0],j=u.pageX,x=u.pageY,l("vmouseover",e,o),l("vmousedown",e,o)))}function g(t){V||(H||l("vmousecancel",t,a(t.target)),H=!0,d())}function b(e){if(!V){var n=i(e).touches[0],o=H,u=t.vmouse.moveDistanceThreshold,r=a(e.target);H=H||Math.abs(n.pageX-j)>u||Math.abs(n.pageY-x)>u,H&&!o&&l("vmousecancel",e,r),l("vmousemove",e,r),d()}}function D(t){if(!V){s();var e,n,o=a(t.target);l("vmouseup",t,o),H||(e=l("vclick",t,o))&&e.isDefaultPrevented()&&(n=i(t).changedTouches[0],L.push({touchID:A,x:n.clientX,y:n.clientY}),S=!0),l("vmouseout",t,o),H=!1,d()}}function T(e){var n,o=t.data(e,X);if(o)for(n in o)if(o[n])return!0;return!1}function k(){}var y,P,X="virtualMouseBindings",Y="virtualTouchID",w="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),E="clientX clientY pageX pageY screenX screenY".split(" "),I=t.event.mouseHooks?t.event.mouseHooks.props:[],M=t.event.props.concat(I),B={},N=0,j=0,x=0,H=!1,L=[],S=!1,V=!1,q="addEventListener"in n,Q=t(n),z=1,A=0;for(t.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500},P=0;P<w.length;P++)t.event.special[w[P]]=function(e){var n=e.substr(1);return{setup:function(){T(this)||t.data(this,X,{}),t.data(this,X)[e]=!0,B[e]=(B[e]||0)+1,1===B[e]&&Q.bind(n,p),t(this).bind(n,k),q&&(B.touchstart=(B.touchstart||0)+1,1===B.touchstart&&Q.bind("touchstart",m).bind("touchend",D).bind("touchmove",b).bind("scroll",g))},teardown:function(){--B[e],B[e]||Q.unbind(n,p),q&&(--B.touchstart||Q.unbind("touchstart",m).unbind("touchmove",b).unbind("touchend",D).unbind("scroll",g));var o=t(this),i=t.data(this,X);i&&(i[e]=!1),o.unbind(n,k),T(this)||o.removeData(X)}}}(w[P]);q&&n.addEventListener("click",function(e){var n,o,i,u,a,r=L.length,c=e.target;if(r)for(n=e.clientX,o=e.clientY,y=t.vmouse.clickDistanceThreshold,i=c;i;){for(u=0;u<r;u++)if(a=L[u],0,i===c&&Math.abs(a.x-n)<y&&Math.abs(a.y-o)<y||t.data(i,Y)===a.touchID)return e.preventDefault(),void e.stopPropagation();i=i.parentNode}},!0)}(t,0,n)});