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