import{r as a,j as c}from"./vendor-react-wBh_31cN.js";import{d as v}from"./index-dNe6i2rS.js";const h={"perf.green":"var(--quartz-primary)","perf.orange":"var(--quartz-label-orange)","perf.black":"var(--quartz-black)"};function j({isAnimating:t=!1,animationDuration:f=200,incrementDuration:s=800,minimum:l=.08,variant:i="perf.green",customProgress:o,className:d}){const[g,n]=a.useState(0),r=a.useRef(void 0);a.useEffect(()=>{if(!t){n(0),r.current&&clearInterval(r.current);return}return n(l),r.current=setInterval(()=>{n(e=>{if(e>=.994)return e;const m=(1-e)*.1;return Math.min(e+m,.994)})},s),()=>{r.current&&clearInterval(r.current)}},[t,l,s]);const u=o??g,p=h[i];return!t&&u===0?null:c.jsx("div",{"data-slot":"animated-progress",className:v("h-1 w-full overflow-hidden rounded-full bg-muted",d),children:c.jsx("div",{className:"h-full rounded-full",style:{width:`${u*100}%`,backgroundColor:p,transition:`width ${f}ms linear`}})})}export{j as A};
