PageSourceSearch

https://sokapal.ai/assets/useSwipeNavigation-DHzmazcw.js

js sokapal.ai collected 2026-10-05 15:17:09 UTC 1,039 bytes, 1 lines download raw bytes

1import{r as t}from"./vendor-react-DbsVTsKS.js";const e=(e,n,a,l={})=>{const{threshold:r=50,velocity:i=.3,preventScroll:o=!0,enableHapticFeedback:s=!0}=l,[u,c]=t.useState(null),[h,g]=t.useState(null),[b,p]=t.useState(!1),[v,S]=t.useState(null),x=r,d=()=>{s&&"vibrate"in navigator&&navigator.vibrate(10)};return{swipeHandlers:{onTouchStart:t=>{g(null),S(null),c({x:t.targetTouches[0].clientX,y:t.targetTouches[0].clientY,time:Date.now()}),p(!1)},onTouchMove:t=>{if(!u)return;const e={x:t.targetTouches[0].clientX,y:t.targetTouches[0].clientY},n=e.x-u.x,a=Math.abs(e.y-u.y),l=Math.abs(n);l>a&&l>10&&(p(!0),S(n>0?"right":"left"),o&&t.preventDefault()),g(e)},onTouchEnd:t=>{if(!u||!h)return p(!1),void S(null);const l=u.x-h.x,o=u.y-h.y,s=Date.now()-u.time,b=Math.abs(l)/s,v=l>x,f=l<-x;if(!(Math.abs(o)>Math.abs(l))&&(b>i||Math.abs(l)>r)){let t=n;v&&n<e.length-1?(t=n+1,d()):f&&n>0&&(t=n-1,d()),t!==n&&a(t)}c(null),g(null),p(!1),S(null)}},isSwiping:b,swipeDirection:v,currentIndex:n,canSwipeLeft:n>0,canSwipeRight:n<e.length-1}};export{e as u};

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.