"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@vueuse/core");require("../../scroll-bar/index.js");const u=require("../../scroll-bar/utils/index.js"),l={horizontal:"x",vertical:"y"},d=()=>{},D=e=>1-Math.pow(1-e,3),M=({scrollOffset:e,maxScrollDistance:p,timer:m=500,onScroll:a=d,onScrollEnd:g=d})=>{let o,t,r;const{pause:c,resume:T,isActive:b}=y.useRafFn(()=>{const n=Date.now(),s=l[t],v=n-o,i=u.ensureRangeValue(v/m,0,1),w=D(i);i===1?(e[s]=0,c(),a(t),g(t)):(e[s]=u.ensureRangeValue(r*(1-w),0,p[s]),a(t))},{immediate:!1});function h(n){t=n,o=Date.now(),r=e[l[n]],T()}function q(){c()}return{start:h,stop:q,isActive:b}};exports.useScrollBack=M;
