var Swipe;(function(n){function i(n){var i=null,e,r,u,f;return"touches"in n?(e=n,r=e.targetTouches,r&&r.length==1&&(i={pageX:r[0].pageX,pageY:r[0].pageY})):t?(u=n,i={pageX:u.clientX,pageY:u.clientY}):(f=n,i={pageX:f.pageX,pageY:f.pageY}),i!=null&&(i.pageY+=_w.pageYOffset),i}function r(n){var e="getSelection",f=_w[e]||_d[e],t="",i,r,o,u;return f?(i=f(),t+=f(),n&&t!==""&&i.getRangeAt&&(r=i.getRangeAt(0),o=r&&r.getClientRects&&r.getClientRects.length,o>0&&i.removeAllRanges())):_d.selection&&(u=_d.selection,t+=u.createRange().text,n&&t!==""&&u.empty&&u.empty()),!!t}function e(n){sj_pd(n);r(!0)}function o(n,e,o,s,h,c,l,a,v,y){var w,rt,ut,it;o===void 0&&(o=_d.body);s===void 0&&(s=50);h===void 0&&(h=function(){});c===void 0&&(c=function(){});l===void 0&&(l=function(){});a===void 0&&(a=!1);v===void 0&&(v=!1);y===void 0&&(y=2);y=Math.max(y,2);var p=new u,b=null,k="touchstart",d="touchmove",g="touchend",nt="touchout",tt=a||!f;"ontouchstart"in _d.documentElement?(k="touchstart",d="touchmove",g="touchend",nt="touchout"):t&&(b=new MSGesture,b.target=o,o.style.msTouchAction="none",o.style.touchAction="none",w=!!_w.PointerEvent,k=w?"pointerdown":"MSPointerDown",d="MSGestureChange",g=w?"pointerup":"MSPointerUp",nt=w?"pointerout":"MSPointerOut");rt=function(n){if(t&&n.pointerId){if(n.pointerType!="touch")return;b.addPointer(n.pointerId)}(p.start=i(n),p.start)&&(p.lastUpdate=p.start,p.speed=0,p.lastTime=(new Date).getTime(),tt||n.preventDefault&&n.preventDefault(),l&&l(),Log.Log("Start","Swipe",n.type,!0),sj_sp(n))};sj_be(o,k,rt);ut=function(n){var t,r,u,f,e,o;if(p.lastUpdate!=null&&p.start!=null){if(t=i(n),p.start!==null&&t!=null){if(r=t.pageX-p.start.pageX,u=t.pageY-p.start.pageY,v){if(Math.abs(u)>Math.abs(r)*2)return;n.preventDefault&&n.preventDefault()}p.total.pageX=r;p.total.pageY=u;h&&(f=t.pageX-p.lastUpdate.pageX,e=t.pageY-p.lastUpdate.pageY,h(f,e),o=(new Date).getTime(),p.speed=f/(o-p.lastTime),p.lastUpdate=t)}sj_sp(n)}};sj_be(o,d,ut);it=function(t){var i,u,f;if(p.start!==null&&!r(!1)){if(i=Math.abs(p.total.pageX),i==0&&tt)return;i>=s&&(i>Math.abs(p.total.pageY)*y||v)?(p.total.pageX<0&&e&&e(p.speed),p.total.pageX>0&&n&&n(p.speed)):!tt&&i<=5&&Math.abs(p.total.pageY)<=5?(u=t.target,_d&&_d.createEvent&&(f=_d.createEvent("HTMLEvents"),f.initEvent("click",!0,!0),u.dispatchEvent(f)),u.click&&u.click()):c&&c(p.speed);Log.Log("End","Swipe",t.type,!0,"PX",p.total.pageX.toString(),"PY",p.total.pageY.toString())}p.start=null;p.total.pageX=0;p.total.pageY=0;p.speed=0;sj_sp(t)};sj_be(o,nt,it);sj_be(o,g,it)}function s(n){return navigator.userAgent.match(n)}function h(){var t=-1,i,n;try{i=/Chrome\/(\d+).*/i;n=i.exec(navigator.userAgent);n&&n[1]&&(t=parseInt(n[1]))}catch(r){t=-1}return t}function c(){if(s(/Android/i)){var n=h();if(n<=36)return!0}return!1}var u=function(){function n(){this.start=null;this.total={pageX:0,pageY:0,clientX:0,clientY:0};this.lastUpdate=null;this.speed=0}return n}(),t=_w.MSGestureEvent&&_w.MSGesture,f=c();n.StopEffect=e;n.OnSwipe=o})(Swipe||(Swipe={}))