import{jsx as e}from"react/jsx-runtime";import n from"classnames";import{useRef as r,useEffect as t}from"react";import i from"./LoaderLinear.scss.js";var a={small:i.small,medium:i.medium},m={primary:i.primary,fancy:i.fancy},o=function(o){var s=o.value,c=o.testId,u=o.className,d=o.size,l=void 0===d?"medium":d,f=o.type,v=void 0===f?"primary":f,p=(s||0===s)&&Number.isFinite(s),y=p?Math.min(100,Math.max(0,s)):0,L=r(null),N=r(0);return t((function(){var e=L.current;if(!p&&e){var n=function(){N.current+=1,N.current>=5&&(N.current=0,requestAnimationFrame((function(){e.style.animation="none",requestAnimationFrame((function(){e.style.animation=null}))})))};return e.addEventListener("animationend",n),function(){return e.removeEventListener("animationend",n)}}}),[p]),e("div",{className:n(i.root,a[l],m[v],u),"data-testid":c,children:e("div",{className:n(i.bar,p?i.determinate:i.indeterminate),style:{"--percent":"".concat(y,"%")},ref:L})})};export{o as LoaderLinear};
//# sourceMappingURL=LoaderLinear.js.map
