function de(a,b,d){B.ub(a,"Must have a DOM element to register a touch move with.");this.Init(a,b,d)}v("AdfSafariTouchMoveManager",de);z.l(de,qa);
de.prototype.Init=function(a,b,d){de.f.Init.call(this,a,b,d);this.$H=d;this.ewa=b;this.ic=a;this.mn={};this.maa=this.o(this.laa);this.DO=this.o(this.KG);this.eXa=this.o(this.dXa);this.kaa=this.o(this.jaa);a.addEventListener("touchstart",this.maa,l);a.addEventListener("touchend",this.DO,l);a.addEventListener("touchcancel",this.DO,l);a.addEventListener("touchmove",this.kaa,l);b=w.b.getComputedStyle(a).overflow;"scroll"!=b&&(a.style.overflow="scroll",this.lca=b)};
z.a("AdfSafariTouchMoveManager.prototype.Init",{Init:de.prototype.Init});
de.prototype.fq=function(){var a=this.ic;a.removeEventListener("touchstart",this.maa,l);a.removeEventListener("touchend",this.DO,l);a.removeEventListener("touchcancel",this.DO,l);a.removeEventListener("touchmove",this.kaa,l);delete this.maa;delete this.DO;delete this.eXa;delete this.kaa;delete this.mn;delete this.ic;delete this.ewa;delete this.$H;this.af&&F.c.ac(this.af);delete this.af;delete this.cH;this.lca!=n&&(a.style.overflow=this.lca,delete this.lca)};
z.a("AdfSafariTouchMoveManager.prototype.unregister",{fq:de.prototype.fq});de.prototype.yia=da("cH");z.a("AdfSafariTouchMoveManager.prototype.setLongTouchEventCallback",{yia:de.prototype.yia});u=de.prototype;u.laa=function(a){for(var b=w.b,d=a.changedTouches,e,f=0;f<d.length;f++){e=d[f];var g=e.screenX,h=e.screenY;e=e.identifier;this.mn[e]={x:g,y:h,t:(new Date).getTime(),dx:0,dy:0,touchtype:n,target:b.T(a)}}1==d.length&&this.cH&&(this.af=F.c.oa(this,this.FWa,e,500))};
u.FWa=function(a){this.af=n;a=this.mn[a];this.cH&&a&&(a.touchtype="longtouch",this.cH(a))};u.KG=function(a){this.af&&(F.c.ac(this.af),delete this.af);a=a.changedTouches;for(var b=0;b<a.length;b++){var d=this.mn[a[b].identifier];"longtouch"==d.touchtype&&this.cH&&this.cH();delete d}};u.dXa=function(a){this.KG(a)};
u.jaa=function(a){var b=a.touches;this.af&&(F.c.ac(this.af),delete this.af);if(b&&b.length==this.$H){var d=(new Date).getTime(),e=a.changedTouches,f,g,h;for(f=0;f<e.length;f++){g=e[f];var m=g.screenX,q=g.screenY,s=g.identifier;g=this.mn[s];var y=0,A=0,C=n,G=n;h=n;g&&(y=m-g.x,A=q-g.y,C=g.origx,G=g.origy,h=g.touchtype);C==n&&(C=m,G=q);this.mn[s]={x:m,y:q,t:d,dx:y,dy:A,origx:C,origy:G,touchtype:h}}e=[];for(f in this.mn)g=this.mn[f],500>d-g.t&&e.push(g);if(2==this.$H){g=this.mn[b[0].identifier];d=this.mn[b[1].identifier];
if(g==n||d==n)return;g.touchtype==n&&(b=le(g),b!=n&&(d=le(d),d!=n&&(h=b==d||(2==b.length&&1==d.length?b.charAt(0)==d||b.charAt(1)==d:1==b.length&&2==d.length&&(b==d.charAt(0)||d==b.charAt(1)))?"scroll":"pinch",g.touchtype=h)));h=g.touchtype;if(h==n||"pinch"==h)return}if(e.length<=this.$H){for(h=d=b=0;h<e.length;h++)g=e[h],b+=g.dx,d+=g.dy;b/=this.$H;d/=this.$H;m=l;for(h=0;h<e.length;h++)if(g=e[h],20<Math.abs(g.dx-b)||20<Math.abs(g.dy-d)){m=p;break}if(m&&(w.b.preventDefault(a),0!=b||0!=d))a=window.outerWidth/
window.innerWidth,this.ewa(b*a,d*a);for(f in this.mn)this.mn[f].t=0}}};function le(a){var b=a.origx,d=a.origy;if(b==n||d==n)return n;b=a.x-b;a=a.y-d;if(Math.sqrt(Math.pow(b,2)+Math.pow(a,2))<0.01*window.innerWidth)return n;d=n;0.25<=Math.abs(b/a)&&(d=0>b?"l":"r");var e=n;0.25<=Math.abs(a/b)&&(e=0>a?"u":"d");return d!=n&&e!=n?e+d:d==n?e:e==n?d:n};