PageSourceSearch

https://semena62.ru/bitrix/templates/aspro-premier-mobile/js/condi…/gesture/TinyGesture.min.js?17401365506453

js semena62.ru collected 2026-10-05 00:04:53 UTC 6,453 bytes, 1 lines download raw bytes

1class TinyGesture{constructor(element,options){this.element=element,this.touchStartX=null,this.touchStartY=null,this.touchEndX=null,this.touchEndY=null,this.touchMoveX=null,this.touchMoveY=null,this.velocityX=null,this.velocityY=null,this.longPressTimer=null,this.doubleTapTimer=null,this.doubleTapWaiting=!1,this.thresholdX=0,this.thresholdY=0,this.disregardVelocityThresholdX=0,this.disregardVelocityThresholdY=0,this.swipingHorizontal=!1,this.swipingVertical=!1,this.swipingDirection=null,this.swipedHorizontal=!1,this.swipedVertical=!1,this.handlers={panstart:[],panmove:[],panend:[],swipeleft:[],swiperight:[],swipeup:[],swipedown:[],tap:[],doubletap:[],longpress:[]},this._onTouchStart=this.onTouchStart.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this.opts=Object.assign({},TinyGesture.defaults,options),this.element.addEventListener("touchstart",this._onTouchStart,passiveIfSupported),this.element.addEventListener("touchmove",this._onTouchMove,passiveIfSupported),this.element.addEventListener("touchend",this._onTouchEnd,passiveIfSupported),!this.opts.mouseSupport||"ontouchstart"in window||(this.element.addEventListener("mousedown",this._onTouchStart,passiveIfSupported),document.addEventListener("mousemove",this._onTouchMove,passiveIfSupported),document.addEventListener("mouseup",this._onTouchEnd,passiveIfSupported))}destroy(){var _a,_b;this.element.removeEventListener("touchstart",this._onTouchStart),this.element.removeEventListener("touchmove",this._onTouchMove),this.element.removeEventListener("touchend",this._onTouchEnd),this.element.removeEventListener("mousedown",this._onTouchStart),document.removeEventListener("mousemove",this._onTouchMove),document.removeEventListener("mouseup",this._onTouchEnd),clearTimeout(null!==(_a=this.longPressTimer)&&void 0!==_a?_a:void 0),clearTimeout(null!==(_b=this.doubleTapTimer)&&void 0!==_b?_b:void 0)}on(type,fn){if(this.handlers[type])return this.handlers[type].push(fn),{type:type,fn:fn,cancel:()=>this.off(type,fn)}}off(type,fn){if(this.handlers[type]){const idx=this.handlers[type].indexOf(fn);-1!==idx&&this.handlers[type].splice(idx,1)}}fire(type,event){for(let i=0;i<this.handlers[type].length;i++)this.handlers[type][i](event)}onTouchStart(event){this.thresholdX=this.opts.threshold("x",this),this.thresholdY=this.opts.threshold("y",this),this.disregardVelocityThresholdX=this.opts.disregardVelocityThreshold("x",this),this.disregardVelocityThresholdY=this.opts.disregardVelocityThreshold("y",this),this.touchStartX="mousedown"===event.type?event.screenX:event.changedTouches[0].screenX,this.touchStartY="mousedown"===event.type?event.screenY:event.changedTouches[0].screenY,this.touchMoveX=null,this.touchMoveY=null,this.touchEndX=null,this.touchEndY=null,this.swipingDirection=null,this.longPressTimer=setTimeout(()=>this.fire("longpress",event),this.opts.longPressTime),this.fire("panstart",event)}onTouchMove(event){var _a,_b,_c,_d,_e;if("mousemove"===event.type&&(!this.touchStartX||null!==this.touchEndX))return;const touchMoveX=("mousemove"===event.type?event.screenX:event.changedTouches[0].screenX)-(null!==(_a=this.touchStartX)&&void 0!==_a?_a:0);this.velocityX=touchMoveX-(null!==(_b=this.touchMoveX)&&void 0!==_b?_b:0),this.touchMoveX=touchMoveX;const touchMoveY=("mousemove"===event.type?event.screenY:event.changedTouches[0].screenY)-(null!==(_c=this.touchStartY)&&void 0!==_c?_c:0);this.velocityY=touchMoveY-(null!==(_d=this.touchMoveY)&&void 0!==_d?_d:0),this.touchMoveY=touchMoveY;const absTouchMoveX=Math.abs(this.touchMoveX),absTouchMoveY=Math.abs(this.touchMoveY);this.swipingHorizontal=absTouchMoveX>this.thresholdX,this.swipingVertical=absTouchMoveY>this.thresholdY,this.swipingDirection=absTouchMoveX>absTouchMoveY?this.swipingHorizontal?"horizontal":"pre-horizontal":this.swipingVertical?"vertical":"pre-vertical",Math.max(absTouchMoveX,absTouchMoveY)>this.opts.pressThreshold&&clearTimeout(null!==(_e=this.longPressTimer)&&void 0!==_e?_e:void 0),this.fire("panmove",event)}onTouchEnd(event){var _a,_b,_c,_d,_e,_f,_g,_h;if("mouseup"===event.type&&(!this.touchStartX||null!==this.touchEndX))return;this.touchEndX="mouseup"===event.type?event.screenX:event.changedTouches[0].screenX,this.touchEndY="mouseup"===event.type?event.screenY:event.changedTouches[0].screenY,this.fire("panend",event),clearTimeout(null!==(_a=this.longPressTimer)&&void 0!==_a?_a:void 0);const x=this.touchEndX-(null!==(_b=this.touchStartX)&&void 0!==_b?_b:0),absX=Math.abs(x),y=this.touchEndY-(null!==(_c=this.touchStartY)&&void 0!==_c?_c:0),absY=Math.abs(y);absX>this.thresholdX||absY>this.thresholdY?(this.swipedHorizontal=this.opts.diagonalSwipes?Math.abs(x/y)<=this.opts.diagonalLimit:absX>=absY&&absX>this.thresholdX,this.swipedVertical=this.opts.diagonalSwipes?Math.abs(y/x)<=this.opts.diagonalLimit:absY>absX&&absY>this.thresholdY,this.swipedHorizontal&&(x<0?((null!==(_d=this.velocityX)&&void 0!==_d?_d:0)<-this.opts.velocityThreshold||x<-this.disregardVelocityThresholdX)&&this.fire("swipeleft",event):((null!==(_e=this.velocityX)&&void 0!==_e?_e:0)>this.opts.velocityThreshold||x>this.disregardVelocityThresholdX)&&this.fire("swiperight",event)),this.swipedVertical&&(y<0?((null!==(_f=this.velocityY)&&void 0!==_f?_f:0)<-this.opts.velocityThreshold||y<-this.disregardVelocityThresholdY)&&this.fire("swipeup",event):((null!==(_g=this.velocityY)&&void 0!==_g?_g:0)>this.opts.velocityThreshold||y>this.disregardVelocityThresholdY)&&this.fire("swipedown",event))):absX<this.opts.pressThreshold&&absY<this.opts.pressThreshold&&(this.doubleTapWaiting?(this.doubleTapWaiting=!1,clearTimeout(null!==(_h=this.doubleTapTimer)&&void 0!==_h?_h:void 0),this.fire("doubletap",event)):(this.doubleTapWaiting=!0,this.doubleTapTimer=setTimeout(()=>this.doubleTapWaiting=!1,this.opts.doubleTapTime),this.fire("tap",event)))}}TinyGesture.defaults={threshold:(type,_self)=>Math.max(25,Math.floor(.15*("x"===type?window.innerWidth||document.body.clientWidth:window.innerHeight||document.body.clientHeight))),velocityThreshold:10,disregardVelocityThreshold:(type,self)=>Math.floor(.5*("x"===type?self.element.clientWidth:self.element.clientHeight)),pressThreshold:8,diagonalSwipes:!1,diagonalLimit:Math.tan(.375*Math.PI),longPressTime:500,doubleTapTime:300,mouseSupport:!0};let passiveIfSupported=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){passiveIfSupported={passive:!0}}}))}catch(err){}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.