Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-slot-counter

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slot-counter - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

2

lib/index.esm.js
'use client';
import n,{memo as e,useState as t,useRef as r,useEffect as i,useMemo as u,useCallback as a,forwardRef as o,useImperativeHandle as l}from"react";var c=function(){return c=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},c.apply(this,arguments)};var s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},d=function(n,e){for(var t=[],r=n;r<e;r+=1)t.push(r);return t},f=function(n,e){for(var t=[],r=n;r!==e;)t.push(r),10===(r+=1)&&(r=0);return t},m=function(n,e){var t=Math.random()*(e-n);return Math.floor(t+n)},v=function(n){for(var e,t=function(n,e,t){if(t||2===arguments.length)for(var r,i=0,u=e.length;i<u;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return n.concat(r||Array.prototype.slice.call(e))}([],n,!0),r=t.length-1;r>0;r-=1){var i=Math.floor(Math.random()*(r+1));e=[t[i],t[r]],t[r]=e[0],t[i]=e[1]}return t},h=function(n){return"number"==typeof n?n:(Array.isArray(n)?n.join(""):n).replace(/[,.]/g,"")},p=function(n){return"object"!=typeof n&&!Number.isNaN(h(n))},y=function(n){return"object"==typeof n};var g="index-module_slot_wrap__ZT-DX",b="index-module_slot__DpPgW",_="index-module_separator__7GhtE",N="index-module_numbers__sqlqm",x="index-module_num__j6XH3";!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}(".index-module_slot_wrap__ZT-DX {\n display: inline-block;\n white-space: nowrap;\n}\n\n.index-module_slot__DpPgW {\n display: inline-block;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n will-change: transform;\n}\n\n.index-module_separator__7GhtE {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n}\n\n.index-module_numbers__sqlqm {\n display: block;\n}\n\n.index-module_num__j6XH3 {\n display: block;\n}");var A="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;var C=e((function(e){var a,o,l=e.isNew,d=e.charClassName,f=e.numbersRef,m=e.active,h=e.isChanged,p=e.effectiveDuration,y=e.delay,g=e.value,_=e.startValue,C=e.disableStartValue,S=e.dummyList,E=e.hasSequentialDummyList,w=e.hasInfiniteList,M=e.valueClassName,j=e.reverse,D=e.sequentialAnimationMode,T=e.useMonospaceWidth,q=e.maxNumberWidth,k=t(!1),O=k[0],L=k[1],I=t(g),P=I[0],V=I[1],W=r(),B=r(g),X=r(null),Y=t(E?S:v(S)),F=Y[0],H=Y[1],R=t(0),G=R[0],Z=R[1],J=t(!1),U=J[0],z=J[1],K=G*(S.length+1);A((function(){z(!0)}),[]),A((function(){var n,e;Z(null!==(e=null===(n=X.current)||void 0===n?void 0:n.offsetHeight)&&void 0!==e?e:0)}),[U]),i((function(){m?requestAnimationFrame((function(){L(m)})):L(m)}),[m]),u((function(){C&&(W.current=B.current)}),[C]),i((function(){O&&(W.current=B.current,B.current=g,setTimeout((function(){return V(g)}),D?0:1e3*p*1.3/S.length+1e3*y))}),[O,g,p,y,S.length,D]),i((function(){H(E?S:v(S))}),[g,S,E]);var Q=function(){return F.map((function(e,t){return n.createElement("span",{key:t,className:x,"aria-hidden":"true"},e)}))},$=j?P:null!=_?_:P;D&&($=j?P:null!==(a=null!=_?_:W.current)&&void 0!==a?a:P,D&&l&&($=""));var nn=j&&null!=_?_:P;return D&&(nn=j&&null!==(o=null!=_?_:W.current)&&void 0!==o?o:P),n.createElement("span",{className:s(b,d),style:{display:"inline-block",width:U&&T?q:void 0,height:U?G:void 0}},n.createElement("span",{ref:f,className:N,style:c({transition:"none",transform:j?"translateY(-".concat(K,"px)"):"translateY(0px)"},O&&h&&{transform:j?"translateY(0px)":"translateY(-".concat(K,"px)"),transition:"transform ".concat(p,"s ").concat(y,"s ease-in-out")})},U?n.createElement(n.Fragment,null,n.createElement("span",{className:x,"aria-hidden":"true",style:{height:G}},$),Q(),n.createElement("span",{className:s(x,M),ref:X},nn),w?Q():null):n.createElement("span",{className:x,"aria-hidden":"true"},null!=_?_:P)))}));var S=[",","."," "];var E=e(o((function(e,o){var c,v,b,N,x,E,w,M,j,D,T=e.value,q=e.startValue,k=e.startValueOnce,O=void 0!==k&&k,L=e.duration,I=void 0===L?.7:L,P=e.dummyCharacters,V=e.dummyCharacterCount,W=void 0===V?6:V,B=e.autoAnimationStart,X=void 0===B||B,Y=e.containerClassName,F=e.charClassName,H=e.separatorClassName,R=e.animateUnchanged,G=void 0!==R&&R,Z=e.hasInfiniteList,J=void 0!==Z&&Z,U=e.valueClassName,z=e.sequentialAnimationMode,K=void 0!==z&&z,Q=e.useMonospaceWidth,$=void 0!==Q&&Q,nn=e.direction,en=e.debounceDelay,tn=e.animateOnVisible,rn=function(n,e){var r=t(n),u=r[0],a=r[1];return i((function(){if(0===e)return a(n);var t=setTimeout((function(){a(n)}),e);return function(){clearTimeout(t)}}),[n,e]),u}(T,null!=en?en:0),un=u((function(){return function(n){return Array.isArray(n)&&y(n[0])}(rn)?"":"object"==typeof rn?JSON.stringify(rn):rn.toString()}),[rn]),an=t(!1),on=an[0],ln=an[1],cn=r(),sn=r(null),dn=r(null),fn=r(q),mn=u((function(){return"boolean"==typeof tn?tn:"object"==typeof tn||void 0}),[tn]),vn=u((function(){return"object"==typeof tn?tn.rootMargin:void 0}),[tn]),hn=u((function(){return"object"==typeof tn?tn.triggerOnce:void 0}),[tn]),pn=r(!0),yn=!mn&&X,gn=r(null==q||yn?rn:q),bn=r(q),_n=r(0),Nn=r(0),xn=t([]),An=xn[0],Cn=xn[1],Sn=r(),En=t(0),wn=En[0],Mn=En[1],jn=t(),Dn=jn[0],Tn=jn[1],qn=r(!1),kn=null!=q&&(!O||_n.current<1),On=null!==(v=null===(c=cn.current)||void 0===c?void 0:c.dummyCharacterCount)&&void 0!==v?v:W,Ln=null!==(N=null===(b=cn.current)||void 0===b?void 0:b.duration)&&void 0!==N?N:I;A((function(){var n,e=dn.current;if(e&&$){var t=function(){var n=d(0,10).map((function(n){var t=document.createElement("span");t.className=null!=U?U:"",t.style.position="absolute",t.style.top="0",t.style.left="-9999px",t.style.visibility="hidden",t.textContent=n.toString(),e.appendChild(t);var r=t.getBoundingClientRect().width;return e.removeChild(t),r})),t=Math.max.apply(Math,n);Tn(t)};t(),null===(n=document.fonts)||void 0===n||n.ready.then((function(){t()}))}}),[]),i((function(){Cn(d(0,On-1).map((function(n){if(!P)return m(0,10);var e=n>=P.length?m(0,P.length):n;return P[e]})))}),[P,On]),gn.current!==rn&&qn.current&&Nn.current>0&&(bn.current=gn.current,gn.current=rn);var In=Array.isArray(bn.current)?bn.current:null!==(E=null===(x=bn.current)||void 0===x?void 0:x.toString().split(""))&&void 0!==E?E:[],Pn=Array.isArray(gn.current)?gn.current:null!==(M=null===(w=gn.current)||void 0===w?void 0:w.toString().split(""))&&void 0!==M?M:[],Vn=Array.isArray(fn.current)?fn.current:null!==(D=null===(j=fn.current)||void 0===j?void 0:j.toString().split(""))&&void 0!==D?D:[],Wn=u((function(){return Array.isArray(rn)?rn:null==rn?void 0:rn.toString().split("")}),[rn]),Bn=u((function(){return Array.isArray(q)?q:null==q?void 0:q.toString().split("")}),[q]),Xn=In.length!==Pn.length,Yn=[];Pn.forEach((function(n,e){var t=Pn.length-e-1,r=kn?Vn:In;(Pn[t]!==r[t]||Xn||G)&&Yn.push(t)})),Yn.reverse();var Fn=u((function(){return Math.min(.1,Ln/Wn.length)}),[Ln,Wn.length]),Hn=a((function(){Sn.current&&clearTimeout(Sn.current),ln(!1),_n.current=Nn.current,_n.current+=1,Sn.current=setTimeout((function(){Nn.current+=1,ln(!0)}),20)}),[]),Rn=a((function(n){var e=kn?q:bn.current;if(null==e||!p(e)||!p(rn))return[];var t=e.toString().length,r=rn.toString().length,i=t<r,u=Math.abs(t-r),a=Number(h(e)),o=Number(h(rn)),l=Number(a.toString()[i?-u+n:u+n]||0),c=Number(o.toString()[n]||0);return c===l?[]:a<o?f((l+1)%10,c):f((c+1)%10,l)}),[kn,rn,q]),Gn=a((function(){Mn((function(n){return n+1}))}),[]);i((function(){(qn.current||null!=bn.current)&&(qn.current||null==fn.current)&&(qn.current||yn)&&Hn()}),[un,Hn,yn]),i((function(){yn&&Hn()}),[yn,Hn]),i((function(){requestAnimationFrame((function(){qn.current=!0}))}),[]),l(o,(function(){return{startAnimation:$n,refreshStyles:Gn}}));var Zn=null==q||yn||0!==_n.current?Wn:Bn||[],Jn=((null==Bn?void 0:Bn.length)||0)-Zn.length,Un=function(n){var e,t=r(n),u=r(t.current),o=n.join(","),l=null===(e=t.current)||void 0===e?void 0:e.join(",");return i((function(){l!==o&&(u.current=(null==l?void 0:l.split(","))||[],t.current=o.split(","))}),[o,l]),{getPrevDependencies:a((function(){return u.current}),[]),setPrevDependenciesToSameAsCurrent:a((function(){u.current=t.current}),[])}}(Zn),zn=Un.getPrevDependencies,Kn=Un.setPrevDependenciesToSameAsCurrent,Qn=Zn.length-zn().length,$n=a((function(n){null==q||O||(bn.current=void 0),cn.current=n,Hn(),Kn()}),[q,O,Hn,Kn]);i((function(){if(mn&&sn.current){var n=new IntersectionObserver((function(t){t[0].isIntersecting&&pn.current&&($n(),pn.current=!1,hn&&(n.disconnect(),e.disconnect()))}),{rootMargin:vn,threshold:1}),e=new IntersectionObserver((function(n){n[0].isIntersecting||(pn.current=!0)}),{threshold:0});return n.observe(sn.current),e.observe(sn.current),function(){n.disconnect(),e.disconnect()}}}),[mn,vn,hn,$n]);var ne=-1;return n.createElement("span",{key:wn,ref:sn,className:s(Y,g)},Zn.map((function(e,t){var r,i,u=Yn.includes(t),a=(u?Yn.indexOf(t):0)*Fn,o=bn.current,l=null!=q&&!!O&&_n.current>1,c=null!=rn&&null!=o&&p(rn)&&p(o)&&h(rn)<h(o);if((null===(r=cn.current)||void 0===r?void 0:r.direction)&&(c="top-down"===(null===(i=cn.current)||void 0===i?void 0:i.direction)),nn&&(c="top-down"===nn),!y(e)&&S.includes(e))return n.createElement("span",{key:Pn.length-t-1,className:s(_,H)},e);var d=K&&(!yn||Nn.current>1);return ne+=1,n.createElement(C,{key:Zn.length-t-1,index:t,isNew:Qn>0&&t<Qn,maxNumberWidth:Dn,numbersRef:dn,active:on,isChanged:u,charClassName:F,effectiveDuration:Ln,delay:a,value:e,startValue:l||null==Bn?void 0:Bn[t+Jn],disableStartValue:l,dummyList:d?Rn(ne):An,hasSequentialDummyList:d,hasInfiniteList:J,valueClassName:U,reverse:c,sequentialAnimationMode:K,useMonospaceWidth:$})})))})));export{E as default};
import n,{memo as e,useState as t,useRef as r,useEffect as i,useMemo as u,useCallback as a,forwardRef as o,useImperativeHandle as l}from"react";var c=function(){return c=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},c.apply(this,arguments)};var s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},d=function(n,e){for(var t=[],r=n;r<e;r+=1)t.push(r);return t},f=function(n,e){for(var t=[],r=n;r!==e;)t.push(r),10===(r+=1)&&(r=0);return t},m=function(n,e){var t=Math.random()*(e-n);return Math.floor(t+n)},v=function(n){for(var e,t=function(n,e,t){if(t||2===arguments.length)for(var r,i=0,u=e.length;i<u;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return n.concat(r||Array.prototype.slice.call(e))}([],n,!0),r=t.length-1;r>0;r-=1){var i=Math.floor(Math.random()*(r+1));e=[t[i],t[r]],t[r]=e[0],t[i]=e[1]}return t},h=function(n){return"number"==typeof n?n:(Array.isArray(n)?n.join(""):n).replace(/[,.]/g,"")},p=function(n){return"object"!=typeof n&&!Number.isNaN(h(n))},y=function(n){return"object"==typeof n};var g="index-module_slot_wrap__ZT-DX",b="index-module_slot__DpPgW",_="index-module_separator__7GhtE",N="index-module_numbers__sqlqm",x="index-module_num__j6XH3";!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}(".index-module_slot_wrap__ZT-DX {\n display: inline-block;\n white-space: nowrap;\n}\n\n.index-module_slot__DpPgW {\n display: inline-block;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n will-change: transform;\n}\n\n.index-module_separator__7GhtE {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n}\n\n.index-module_numbers__sqlqm {\n display: block;\n}\n\n.index-module_num__j6XH3 {\n display: block;\n}");var A="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;var C=e((function(e){var a,o,l=e.isNew,d=e.charClassName,f=e.numbersRef,m=e.active,h=e.isChanged,p=e.effectiveDuration,y=e.delay,g=e.value,_=e.startValue,C=e.disableStartValue,S=e.dummyList,E=e.hasSequentialDummyList,w=e.hasInfiniteList,M=e.valueClassName,j=e.reverse,D=e.sequentialAnimationMode,T=e.useMonospaceWidth,q=e.maxNumberWidth,k=t(!1),O=k[0],L=k[1],I=t(g),P=I[0],V=I[1],W=r(),B=r(g),X=r(null),Y=t(E?S:v(S)),F=Y[0],H=Y[1],R=t(0),G=R[0],Z=R[1],J=t(!1),U=J[0],z=J[1],K=G*(S.length+1);A((function(){z(!0)}),[]),A((function(){var n,e;Z(null!==(e=null===(n=X.current)||void 0===n?void 0:n.offsetHeight)&&void 0!==e?e:0)}),[U]),i((function(){m?requestAnimationFrame((function(){L(m)})):L(m)}),[m]),u((function(){C&&(W.current=B.current)}),[C]),i((function(){O&&(W.current=B.current,B.current=g,setTimeout((function(){return V(g)}),D?0:1e3*p*1.3/S.length+1e3*y))}),[O,g,p,y,S.length,D]),i((function(){H(E?S:v(S))}),[g,S,E]);var Q=function(){return F.map((function(e,t){return n.createElement("span",{key:t,className:x,"aria-hidden":"true"},e)}))},$=j?P:null!=_?_:P;D&&($=j?P:null!==(a=null!=_?_:W.current)&&void 0!==a?a:P,D&&l&&($=""));var nn=j&&null!=_?_:P;return D&&(nn=j&&null!==(o=null!=_?_:W.current)&&void 0!==o?o:P),n.createElement("span",{className:s(b,d),style:{display:"inline-block",width:U&&T?q:void 0,height:U?G:void 0}},n.createElement("span",{ref:f,className:N,style:c({transition:"none",transform:j?"translateY(-".concat(K,"px)"):"translateY(0px)"},O&&h&&{transform:j?"translateY(0px)":"translateY(-".concat(K,"px)"),transition:"transform ".concat(p,"s ").concat(y,"s ease-in-out")})},U?n.createElement(n.Fragment,null,n.createElement("span",{className:x,"aria-hidden":"true",style:{height:G}},$),Q(),n.createElement("span",{className:s(x,M),ref:X},nn),w?Q():null):n.createElement("span",{className:x,"aria-hidden":"true"},null!=_?_:P)))}));var S=[",","."," "];var E=e(o((function(e,o){var c,v,b,N,x,E,w,M,j,D,T=e.value,q=e.startValue,k=e.startValueOnce,O=void 0!==k&&k,L=e.duration,I=void 0===L?.7:L,P=e.dummyCharacters,V=e.dummyCharacterCount,W=void 0===V?6:V,B=e.autoAnimationStart,X=void 0===B||B,Y=e.containerClassName,F=e.charClassName,H=e.separatorClassName,R=e.animateUnchanged,G=void 0!==R&&R,Z=e.hasInfiniteList,J=void 0!==Z&&Z,U=e.valueClassName,z=e.sequentialAnimationMode,K=void 0!==z&&z,Q=e.useMonospaceWidth,$=void 0!==Q&&Q,nn=e.direction,en=e.debounceDelay,tn=e.animateOnVisible,rn=function(n,e){var r=t(n),u=r[0],a=r[1];return i((function(){if(0===e)return a(n);var t=setTimeout((function(){a(n)}),e);return function(){clearTimeout(t)}}),[n,e]),u}(T,null!=en?en:0),un=u((function(){return function(n){return Array.isArray(n)&&y(n[0])}(rn)?"":"object"==typeof rn?JSON.stringify(rn):rn.toString()}),[rn]),an=t(!1),on=an[0],ln=an[1],cn=r(),sn=r(null),dn=r(null),fn=r(q),mn=u((function(){return"boolean"==typeof tn?tn:"object"==typeof tn||void 0}),[tn]),vn=u((function(){return"object"==typeof tn?tn.rootMargin:void 0}),[tn]),hn=u((function(){return"object"==typeof tn?tn.triggerOnce:void 0}),[tn]),pn=r(!0),yn=!mn&&X,gn=r(null==q||yn?rn:q),bn=r(q),_n=r(0),Nn=r(0),xn=t([]),An=xn[0],Cn=xn[1],Sn=r(),En=t(0),wn=En[0],Mn=En[1],jn=t(),Dn=jn[0],Tn=jn[1],qn=r(!1),kn=null!=q&&(!O||_n.current<1),On=null!==(v=null===(c=cn.current)||void 0===c?void 0:c.dummyCharacterCount)&&void 0!==v?v:W,Ln=null!==(N=null===(b=cn.current)||void 0===b?void 0:b.duration)&&void 0!==N?N:I;A((function(){var n,e=dn.current;if(e&&$){var t=function(){var n=d(0,10).map((function(n){var t=document.createElement("span");t.className=null!=U?U:"",t.style.position="absolute",t.style.top="0",t.style.left="-9999px",t.style.visibility="hidden",t.textContent=n.toString(),e.appendChild(t);var r=t.getBoundingClientRect().width;return e.removeChild(t),r})),t=Math.max.apply(Math,n);Tn(t)};t(),null===(n=document.fonts)||void 0===n||n.ready.then((function(){t()}))}}),[]),i((function(){Cn(d(0,On-1).map((function(n){if(!P)return m(0,10);var e=n>=P.length?m(0,P.length):n;return P[e]})))}),[P,On]),gn.current!==rn&&qn.current&&Nn.current>0&&(bn.current=gn.current,gn.current=rn);var In=Array.isArray(bn.current)?bn.current:null!==(E=null===(x=bn.current)||void 0===x?void 0:x.toString().split(""))&&void 0!==E?E:[],Pn=Array.isArray(gn.current)?gn.current:null!==(M=null===(w=gn.current)||void 0===w?void 0:w.toString().split(""))&&void 0!==M?M:[],Vn=Array.isArray(fn.current)?fn.current:null!==(D=null===(j=fn.current)||void 0===j?void 0:j.toString().split(""))&&void 0!==D?D:[],Wn=u((function(){return Array.isArray(rn)?rn:null==rn?void 0:rn.toString().split("")}),[rn]),Bn=u((function(){return Array.isArray(q)?q:null==q?void 0:q.toString().split("")}),[q]),Xn=In.length!==Pn.length,Yn=[];Pn.forEach((function(n,e){var t=Pn.length-e-1,r=kn?Vn:In;(Pn[t]!==r[t]||Xn||G)&&Yn.push(t)})),Yn.reverse();var Fn=u((function(){return Math.min(.1,Ln/Wn.length)}),[Ln,Wn.length]),Hn=a((function(){Sn.current&&clearTimeout(Sn.current),ln(!1),_n.current=Nn.current,_n.current+=1,Sn.current=setTimeout((function(){Nn.current+=1,ln(!0)}),20)}),[]),Rn=a((function(n){var e=kn?q:bn.current;if(null==e||!p(e)||!p(rn))return[];var t=e.toString().length,r=rn.toString().length,i=t<r,u=Math.abs(t-r),a=Number(h(e.toString())),o=Number(h(rn.toString())),l=Number(a.toString()[i?-u+n:u+n]||0),c=Number(o.toString()[n]||0);return c===l?[]:a<o?f((l+1)%10,c):f((c+1)%10,l)}),[kn,rn,q]),Gn=a((function(){Mn((function(n){return n+1}))}),[]);i((function(){(qn.current||null!=bn.current)&&(qn.current||null==fn.current)&&(qn.current||yn)&&Hn()}),[un,Hn,yn]),i((function(){yn&&Hn()}),[yn,Hn]),i((function(){requestAnimationFrame((function(){qn.current=!0}))}),[]),l(o,(function(){return{startAnimation:$n,refreshStyles:Gn}}));var Zn=null==q||yn||0!==_n.current?Wn:Bn||[],Jn=((null==Bn?void 0:Bn.length)||0)-Zn.length,Un=function(n){var e,t=r(n),u=r(t.current),o=n.join(","),l=null===(e=t.current)||void 0===e?void 0:e.join(",");return i((function(){l!==o&&(u.current=(null==l?void 0:l.split(","))||[],t.current=o.split(","))}),[o,l]),{getPrevDependencies:a((function(){return u.current}),[]),setPrevDependenciesToSameAsCurrent:a((function(){u.current=t.current}),[])}}(Zn),zn=Un.getPrevDependencies,Kn=Un.setPrevDependenciesToSameAsCurrent,Qn=Zn.length-zn().length,$n=a((function(n){null==q||O||(bn.current=void 0),cn.current=n,Hn(),Kn()}),[q,O,Hn,Kn]);i((function(){if(mn&&sn.current){var n=new IntersectionObserver((function(t){t[0].isIntersecting&&pn.current&&($n(),pn.current=!1,hn&&(n.disconnect(),e.disconnect()))}),{rootMargin:vn,threshold:1}),e=new IntersectionObserver((function(n){n[0].isIntersecting||(pn.current=!0)}),{threshold:0});return n.observe(sn.current),e.observe(sn.current),function(){n.disconnect(),e.disconnect()}}}),[mn,vn,hn,$n]);var ne=-1;return n.createElement("span",{key:wn,ref:sn,className:s(Y,g)},Zn.map((function(e,t){var r,i,u=Yn.includes(t),a=(u?Yn.indexOf(t):0)*Fn,o=bn.current,l=null!=q&&!!O&&_n.current>1,c=null!=rn&&null!=o&&p(rn)&&p(o)&&h(rn)<h(o);if((null===(r=cn.current)||void 0===r?void 0:r.direction)&&(c="top-down"===(null===(i=cn.current)||void 0===i?void 0:i.direction)),nn&&(c="top-down"===nn),!y(e)&&S.includes(e))return n.createElement("span",{key:Pn.length-t-1,className:s(_,H)},e);var d=K&&(!yn||Nn.current>1);return ne+=1,n.createElement(C,{key:Zn.length-t-1,index:t,isNew:Qn>0&&t<Qn,maxNumberWidth:Dn,numbersRef:dn,active:on,isChanged:u,charClassName:F,effectiveDuration:Ln,delay:a,value:e,startValue:l||null==Bn?void 0:Bn[t+Jn],disableStartValue:l,dummyList:d?Rn(ne):An,hasSequentialDummyList:d,hasInfiniteList:J,valueClassName:U,reverse:c,sequentialAnimationMode:K,useMonospaceWidth:$})})))})));export{E as default};
//# sourceMappingURL=index.esm.js.map
'use client';
"use strict";var e=require("react"),n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var u in n=arguments[t])Object.prototype.hasOwnProperty.call(n,u)&&(e[u]=n[u]);return e},n.apply(this,arguments)};var t=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.filter(Boolean).join(" ")},r=function(e,n){for(var t=[],r=e;r<n;r+=1)t.push(r);return t},u=function(e,n){for(var t=[],r=e;r!==n;)t.push(r),10===(r+=1)&&(r=0);return t},i=function(e,n){var t=Math.random()*(n-e);return Math.floor(t+e)},a=function(e){for(var n,t=function(e,n,t){if(t||2===arguments.length)for(var r,u=0,i=n.length;u<i;u++)!r&&u in n||(r||(r=Array.prototype.slice.call(n,0,u)),r[u]=n[u]);return e.concat(r||Array.prototype.slice.call(n))}([],e,!0),r=t.length-1;r>0;r-=1){var u=Math.floor(Math.random()*(r+1));n=[t[u],t[r]],t[r]=n[0],t[u]=n[1]}return t},o=function(e){return"number"==typeof e?e:(Array.isArray(e)?e.join(""):e).replace(/[,.]/g,"")},l=function(e){return"object"!=typeof e&&!Number.isNaN(o(e))},c=function(e){return"object"==typeof e};var s="index-module_slot_wrap__ZT-DX",f="index-module_slot__DpPgW",d="index-module_separator__7GhtE",m="index-module_numbers__sqlqm",v="index-module_num__j6XH3";!function(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css","top"===t&&r.firstChild?r.insertBefore(u,r.firstChild):r.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e))}}(".index-module_slot_wrap__ZT-DX {\n display: inline-block;\n white-space: nowrap;\n}\n\n.index-module_slot__DpPgW {\n display: inline-block;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n will-change: transform;\n}\n\n.index-module_separator__7GhtE {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n}\n\n.index-module_numbers__sqlqm {\n display: block;\n}\n\n.index-module_num__j6XH3 {\n display: block;\n}");var h="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;var p=e.memo((function(r){var u,i,o=r.isNew,l=r.charClassName,c=r.numbersRef,s=r.active,d=r.isChanged,p=r.effectiveDuration,y=r.delay,g=r.value,b=r.startValue,S=r.disableStartValue,_=r.dummyList,C=r.hasSequentialDummyList,N=r.hasInfiniteList,E=r.valueClassName,x=r.reverse,A=r.sequentialAnimationMode,M=r.useMonospaceWidth,R=r.maxNumberWidth,w=e.useState(!1),k=w[0],j=w[1],D=e.useState(g),q=D[0],T=D[1],O=e.useRef(),I=e.useRef(g),L=e.useRef(null),P=e.useState(C?_:a(_)),V=P[0],W=P[1],B=e.useState(0),H=B[0],X=B[1],Y=e.useState(!1),F=Y[0],G=Y[1],Z=H*(_.length+1);h((function(){G(!0)}),[]),h((function(){var e,n;X(null!==(n=null===(e=L.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:0)}),[F]),e.useEffect((function(){s?requestAnimationFrame((function(){j(s)})):j(s)}),[s]),e.useMemo((function(){S&&(O.current=I.current)}),[S]),e.useEffect((function(){k&&(O.current=I.current,I.current=g,setTimeout((function(){return T(g)}),A?0:1e3*p*1.3/_.length+1e3*y))}),[k,g,p,y,_.length,A]),e.useEffect((function(){W(C?_:a(_))}),[g,_,C]);var J=function(){return V.map((function(n,t){return e.createElement("span",{key:t,className:v,"aria-hidden":"true"},n)}))},U=x?q:null!=b?b:q;A&&(U=x?q:null!==(u=null!=b?b:O.current)&&void 0!==u?u:q,A&&o&&(U=""));var z=x&&null!=b?b:q;return A&&(z=x&&null!==(i=null!=b?b:O.current)&&void 0!==i?i:q),e.createElement("span",{className:t(f,l),style:{display:"inline-block",width:F&&M?R:void 0,height:F?H:void 0}},e.createElement("span",{ref:c,className:m,style:n({transition:"none",transform:x?"translateY(-".concat(Z,"px)"):"translateY(0px)"},k&&d&&{transform:x?"translateY(0px)":"translateY(-".concat(Z,"px)"),transition:"transform ".concat(p,"s ").concat(y,"s ease-in-out")})},F?e.createElement(e.Fragment,null,e.createElement("span",{className:v,"aria-hidden":"true",style:{height:H}},U),J(),e.createElement("span",{className:t(v,E),ref:L},z),N?J():null):e.createElement("span",{className:v,"aria-hidden":"true"},null!=b?b:q)))}));var y=[",","."," "];var g=e.memo(e.forwardRef((function(n,a){var f,m,v,g,b,S,_,C,N,E,x=n.value,A=n.startValue,M=n.startValueOnce,R=void 0!==M&&M,w=n.duration,k=void 0===w?.7:w,j=n.dummyCharacters,D=n.dummyCharacterCount,q=void 0===D?6:D,T=n.autoAnimationStart,O=void 0===T||T,I=n.containerClassName,L=n.charClassName,P=n.separatorClassName,V=n.animateUnchanged,W=void 0!==V&&V,B=n.hasInfiniteList,H=void 0!==B&&B,X=n.valueClassName,Y=n.sequentialAnimationMode,F=void 0!==Y&&Y,G=n.useMonospaceWidth,Z=void 0!==G&&G,J=n.direction,U=n.debounceDelay,z=n.animateOnVisible,K=function(n,t){var r=e.useState(n),u=r[0],i=r[1];return e.useEffect((function(){if(0===t)return i(n);var e=setTimeout((function(){i(n)}),t);return function(){clearTimeout(e)}}),[n,t]),u}(x,null!=U?U:0),Q=e.useMemo((function(){return function(e){return Array.isArray(e)&&c(e[0])}(K)?"":"object"==typeof K?JSON.stringify(K):K.toString()}),[K]),$=e.useState(!1),ee=$[0],ne=$[1],te=e.useRef(),re=e.useRef(null),ue=e.useRef(null),ie=e.useRef(A),ae=e.useMemo((function(){return"boolean"==typeof z?z:"object"==typeof z||void 0}),[z]),oe=e.useMemo((function(){return"object"==typeof z?z.rootMargin:void 0}),[z]),le=e.useMemo((function(){return"object"==typeof z?z.triggerOnce:void 0}),[z]),ce=e.useRef(!0),se=!ae&&O,fe=e.useRef(null==A||se?K:A),de=e.useRef(A),me=e.useRef(0),ve=e.useRef(0),he=e.useState([]),pe=he[0],ye=he[1],ge=e.useRef(),be=e.useState(0),Se=be[0],_e=be[1],Ce=e.useState(),Ne=Ce[0],Ee=Ce[1],xe=e.useRef(!1),Ae=null!=A&&(!R||me.current<1),Me=null!==(m=null===(f=te.current)||void 0===f?void 0:f.dummyCharacterCount)&&void 0!==m?m:q,Re=null!==(g=null===(v=te.current)||void 0===v?void 0:v.duration)&&void 0!==g?g:k;h((function(){var e,n=ue.current;if(n&&Z){var t=function(){var e=r(0,10).map((function(e){var t=document.createElement("span");t.className=null!=X?X:"",t.style.position="absolute",t.style.top="0",t.style.left="-9999px",t.style.visibility="hidden",t.textContent=e.toString(),n.appendChild(t);var r=t.getBoundingClientRect().width;return n.removeChild(t),r})),t=Math.max.apply(Math,e);Ee(t)};t(),null===(e=document.fonts)||void 0===e||e.ready.then((function(){t()}))}}),[]),e.useEffect((function(){ye(r(0,Me-1).map((function(e){if(!j)return i(0,10);var n=e>=j.length?i(0,j.length):e;return j[n]})))}),[j,Me]),fe.current!==K&&xe.current&&ve.current>0&&(de.current=fe.current,fe.current=K);var we=Array.isArray(de.current)?de.current:null!==(S=null===(b=de.current)||void 0===b?void 0:b.toString().split(""))&&void 0!==S?S:[],ke=Array.isArray(fe.current)?fe.current:null!==(C=null===(_=fe.current)||void 0===_?void 0:_.toString().split(""))&&void 0!==C?C:[],je=Array.isArray(ie.current)?ie.current:null!==(E=null===(N=ie.current)||void 0===N?void 0:N.toString().split(""))&&void 0!==E?E:[],De=e.useMemo((function(){return Array.isArray(K)?K:null==K?void 0:K.toString().split("")}),[K]),qe=e.useMemo((function(){return Array.isArray(A)?A:null==A?void 0:A.toString().split("")}),[A]),Te=we.length!==ke.length,Oe=[];ke.forEach((function(e,n){var t=ke.length-n-1,r=Ae?je:we;(ke[t]!==r[t]||Te||W)&&Oe.push(t)})),Oe.reverse();var Ie=e.useMemo((function(){return Math.min(.1,Re/De.length)}),[Re,De.length]),Le=e.useCallback((function(){ge.current&&clearTimeout(ge.current),ne(!1),me.current=ve.current,me.current+=1,ge.current=setTimeout((function(){ve.current+=1,ne(!0)}),20)}),[]),Pe=e.useCallback((function(e){var n=Ae?A:de.current;if(null==n||!l(n)||!l(K))return[];var t=n.toString().length,r=K.toString().length,i=t<r,a=Math.abs(t-r),c=Number(o(n)),s=Number(o(K)),f=Number(c.toString()[i?-a+e:a+e]||0),d=Number(s.toString()[e]||0);return d===f?[]:c<s?u((f+1)%10,d):u((d+1)%10,f)}),[Ae,K,A]),Ve=e.useCallback((function(){_e((function(e){return e+1}))}),[]);e.useEffect((function(){(xe.current||null!=de.current)&&(xe.current||null==ie.current)&&(xe.current||se)&&Le()}),[Q,Le,se]),e.useEffect((function(){se&&Le()}),[se,Le]),e.useEffect((function(){requestAnimationFrame((function(){xe.current=!0}))}),[]),e.useImperativeHandle(a,(function(){return{startAnimation:Ge,refreshStyles:Ve}}));var We=null==A||se||0!==me.current?De:qe||[],Be=((null==qe?void 0:qe.length)||0)-We.length,He=function(n){var t,r=e.useRef(n),u=e.useRef(r.current),i=n.join(","),a=null===(t=r.current)||void 0===t?void 0:t.join(",");return e.useEffect((function(){a!==i&&(u.current=(null==a?void 0:a.split(","))||[],r.current=i.split(","))}),[i,a]),{getPrevDependencies:e.useCallback((function(){return u.current}),[]),setPrevDependenciesToSameAsCurrent:e.useCallback((function(){u.current=r.current}),[])}}(We),Xe=He.getPrevDependencies,Ye=He.setPrevDependenciesToSameAsCurrent,Fe=We.length-Xe().length,Ge=e.useCallback((function(e){null==A||R||(de.current=void 0),te.current=e,Le(),Ye()}),[A,R,Le,Ye]);e.useEffect((function(){if(ae&&re.current){var e=new IntersectionObserver((function(t){t[0].isIntersecting&&ce.current&&(Ge(),ce.current=!1,le&&(e.disconnect(),n.disconnect()))}),{rootMargin:oe,threshold:1}),n=new IntersectionObserver((function(e){e[0].isIntersecting||(ce.current=!0)}),{threshold:0});return e.observe(re.current),n.observe(re.current),function(){e.disconnect(),n.disconnect()}}}),[ae,oe,le,Ge]);var Ze=-1;return e.createElement("span",{key:Se,ref:re,className:t(I,s)},We.map((function(n,r){var u,i,a=Oe.includes(r),s=(a?Oe.indexOf(r):0)*Ie,f=de.current,m=null!=A&&!!R&&me.current>1,v=null!=K&&null!=f&&l(K)&&l(f)&&o(K)<o(f);if((null===(u=te.current)||void 0===u?void 0:u.direction)&&(v="top-down"===(null===(i=te.current)||void 0===i?void 0:i.direction)),J&&(v="top-down"===J),!c(n)&&y.includes(n))return e.createElement("span",{key:ke.length-r-1,className:t(d,P)},n);var h=F&&(!se||ve.current>1);return Ze+=1,e.createElement(p,{key:We.length-r-1,index:r,isNew:Fe>0&&r<Fe,maxNumberWidth:Ne,numbersRef:ue,active:ee,isChanged:a,charClassName:L,effectiveDuration:Re,delay:s,value:n,startValue:m||null==qe?void 0:qe[r+Be],disableStartValue:m,dummyList:h?Pe(Ze):pe,hasSequentialDummyList:h,hasInfiniteList:H,valueClassName:X,reverse:v,sequentialAnimationMode:F,useMonospaceWidth:Z})})))})));module.exports=g;
"use strict";var e=require("react"),n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var u in n=arguments[t])Object.prototype.hasOwnProperty.call(n,u)&&(e[u]=n[u]);return e},n.apply(this,arguments)};var t=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.filter(Boolean).join(" ")},r=function(e,n){for(var t=[],r=e;r<n;r+=1)t.push(r);return t},u=function(e,n){for(var t=[],r=e;r!==n;)t.push(r),10===(r+=1)&&(r=0);return t},i=function(e,n){var t=Math.random()*(n-e);return Math.floor(t+e)},a=function(e){for(var n,t=function(e,n,t){if(t||2===arguments.length)for(var r,u=0,i=n.length;u<i;u++)!r&&u in n||(r||(r=Array.prototype.slice.call(n,0,u)),r[u]=n[u]);return e.concat(r||Array.prototype.slice.call(n))}([],e,!0),r=t.length-1;r>0;r-=1){var u=Math.floor(Math.random()*(r+1));n=[t[u],t[r]],t[r]=n[0],t[u]=n[1]}return t},o=function(e){return"number"==typeof e?e:(Array.isArray(e)?e.join(""):e).replace(/[,.]/g,"")},l=function(e){return"object"!=typeof e&&!Number.isNaN(o(e))},c=function(e){return"object"==typeof e};var s="index-module_slot_wrap__ZT-DX",f="index-module_slot__DpPgW",d="index-module_separator__7GhtE",m="index-module_numbers__sqlqm",v="index-module_num__j6XH3";!function(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css","top"===t&&r.firstChild?r.insertBefore(u,r.firstChild):r.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e))}}(".index-module_slot_wrap__ZT-DX {\n display: inline-block;\n white-space: nowrap;\n}\n\n.index-module_slot__DpPgW {\n display: inline-block;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n will-change: transform;\n}\n\n.index-module_separator__7GhtE {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n}\n\n.index-module_numbers__sqlqm {\n display: block;\n}\n\n.index-module_num__j6XH3 {\n display: block;\n}");var h="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;var p=e.memo((function(r){var u,i,o=r.isNew,l=r.charClassName,c=r.numbersRef,s=r.active,d=r.isChanged,p=r.effectiveDuration,y=r.delay,g=r.value,b=r.startValue,S=r.disableStartValue,_=r.dummyList,C=r.hasSequentialDummyList,N=r.hasInfiniteList,E=r.valueClassName,x=r.reverse,A=r.sequentialAnimationMode,M=r.useMonospaceWidth,R=r.maxNumberWidth,w=e.useState(!1),k=w[0],j=w[1],D=e.useState(g),q=D[0],T=D[1],O=e.useRef(),I=e.useRef(g),L=e.useRef(null),P=e.useState(C?_:a(_)),V=P[0],W=P[1],B=e.useState(0),H=B[0],X=B[1],Y=e.useState(!1),F=Y[0],G=Y[1],Z=H*(_.length+1);h((function(){G(!0)}),[]),h((function(){var e,n;X(null!==(n=null===(e=L.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:0)}),[F]),e.useEffect((function(){s?requestAnimationFrame((function(){j(s)})):j(s)}),[s]),e.useMemo((function(){S&&(O.current=I.current)}),[S]),e.useEffect((function(){k&&(O.current=I.current,I.current=g,setTimeout((function(){return T(g)}),A?0:1e3*p*1.3/_.length+1e3*y))}),[k,g,p,y,_.length,A]),e.useEffect((function(){W(C?_:a(_))}),[g,_,C]);var J=function(){return V.map((function(n,t){return e.createElement("span",{key:t,className:v,"aria-hidden":"true"},n)}))},U=x?q:null!=b?b:q;A&&(U=x?q:null!==(u=null!=b?b:O.current)&&void 0!==u?u:q,A&&o&&(U=""));var z=x&&null!=b?b:q;return A&&(z=x&&null!==(i=null!=b?b:O.current)&&void 0!==i?i:q),e.createElement("span",{className:t(f,l),style:{display:"inline-block",width:F&&M?R:void 0,height:F?H:void 0}},e.createElement("span",{ref:c,className:m,style:n({transition:"none",transform:x?"translateY(-".concat(Z,"px)"):"translateY(0px)"},k&&d&&{transform:x?"translateY(0px)":"translateY(-".concat(Z,"px)"),transition:"transform ".concat(p,"s ").concat(y,"s ease-in-out")})},F?e.createElement(e.Fragment,null,e.createElement("span",{className:v,"aria-hidden":"true",style:{height:H}},U),J(),e.createElement("span",{className:t(v,E),ref:L},z),N?J():null):e.createElement("span",{className:v,"aria-hidden":"true"},null!=b?b:q)))}));var y=[",","."," "];var g=e.memo(e.forwardRef((function(n,a){var f,m,v,g,b,S,_,C,N,E,x=n.value,A=n.startValue,M=n.startValueOnce,R=void 0!==M&&M,w=n.duration,k=void 0===w?.7:w,j=n.dummyCharacters,D=n.dummyCharacterCount,q=void 0===D?6:D,T=n.autoAnimationStart,O=void 0===T||T,I=n.containerClassName,L=n.charClassName,P=n.separatorClassName,V=n.animateUnchanged,W=void 0!==V&&V,B=n.hasInfiniteList,H=void 0!==B&&B,X=n.valueClassName,Y=n.sequentialAnimationMode,F=void 0!==Y&&Y,G=n.useMonospaceWidth,Z=void 0!==G&&G,J=n.direction,U=n.debounceDelay,z=n.animateOnVisible,K=function(n,t){var r=e.useState(n),u=r[0],i=r[1];return e.useEffect((function(){if(0===t)return i(n);var e=setTimeout((function(){i(n)}),t);return function(){clearTimeout(e)}}),[n,t]),u}(x,null!=U?U:0),Q=e.useMemo((function(){return function(e){return Array.isArray(e)&&c(e[0])}(K)?"":"object"==typeof K?JSON.stringify(K):K.toString()}),[K]),$=e.useState(!1),ee=$[0],ne=$[1],te=e.useRef(),re=e.useRef(null),ue=e.useRef(null),ie=e.useRef(A),ae=e.useMemo((function(){return"boolean"==typeof z?z:"object"==typeof z||void 0}),[z]),oe=e.useMemo((function(){return"object"==typeof z?z.rootMargin:void 0}),[z]),le=e.useMemo((function(){return"object"==typeof z?z.triggerOnce:void 0}),[z]),ce=e.useRef(!0),se=!ae&&O,fe=e.useRef(null==A||se?K:A),de=e.useRef(A),me=e.useRef(0),ve=e.useRef(0),he=e.useState([]),pe=he[0],ye=he[1],ge=e.useRef(),be=e.useState(0),Se=be[0],_e=be[1],Ce=e.useState(),Ne=Ce[0],Ee=Ce[1],xe=e.useRef(!1),Ae=null!=A&&(!R||me.current<1),Me=null!==(m=null===(f=te.current)||void 0===f?void 0:f.dummyCharacterCount)&&void 0!==m?m:q,Re=null!==(g=null===(v=te.current)||void 0===v?void 0:v.duration)&&void 0!==g?g:k;h((function(){var e,n=ue.current;if(n&&Z){var t=function(){var e=r(0,10).map((function(e){var t=document.createElement("span");t.className=null!=X?X:"",t.style.position="absolute",t.style.top="0",t.style.left="-9999px",t.style.visibility="hidden",t.textContent=e.toString(),n.appendChild(t);var r=t.getBoundingClientRect().width;return n.removeChild(t),r})),t=Math.max.apply(Math,e);Ee(t)};t(),null===(e=document.fonts)||void 0===e||e.ready.then((function(){t()}))}}),[]),e.useEffect((function(){ye(r(0,Me-1).map((function(e){if(!j)return i(0,10);var n=e>=j.length?i(0,j.length):e;return j[n]})))}),[j,Me]),fe.current!==K&&xe.current&&ve.current>0&&(de.current=fe.current,fe.current=K);var we=Array.isArray(de.current)?de.current:null!==(S=null===(b=de.current)||void 0===b?void 0:b.toString().split(""))&&void 0!==S?S:[],ke=Array.isArray(fe.current)?fe.current:null!==(C=null===(_=fe.current)||void 0===_?void 0:_.toString().split(""))&&void 0!==C?C:[],je=Array.isArray(ie.current)?ie.current:null!==(E=null===(N=ie.current)||void 0===N?void 0:N.toString().split(""))&&void 0!==E?E:[],De=e.useMemo((function(){return Array.isArray(K)?K:null==K?void 0:K.toString().split("")}),[K]),qe=e.useMemo((function(){return Array.isArray(A)?A:null==A?void 0:A.toString().split("")}),[A]),Te=we.length!==ke.length,Oe=[];ke.forEach((function(e,n){var t=ke.length-n-1,r=Ae?je:we;(ke[t]!==r[t]||Te||W)&&Oe.push(t)})),Oe.reverse();var Ie=e.useMemo((function(){return Math.min(.1,Re/De.length)}),[Re,De.length]),Le=e.useCallback((function(){ge.current&&clearTimeout(ge.current),ne(!1),me.current=ve.current,me.current+=1,ge.current=setTimeout((function(){ve.current+=1,ne(!0)}),20)}),[]),Pe=e.useCallback((function(e){var n=Ae?A:de.current;if(null==n||!l(n)||!l(K))return[];var t=n.toString().length,r=K.toString().length,i=t<r,a=Math.abs(t-r),c=Number(o(n.toString())),s=Number(o(K.toString())),f=Number(c.toString()[i?-a+e:a+e]||0),d=Number(s.toString()[e]||0);return d===f?[]:c<s?u((f+1)%10,d):u((d+1)%10,f)}),[Ae,K,A]),Ve=e.useCallback((function(){_e((function(e){return e+1}))}),[]);e.useEffect((function(){(xe.current||null!=de.current)&&(xe.current||null==ie.current)&&(xe.current||se)&&Le()}),[Q,Le,se]),e.useEffect((function(){se&&Le()}),[se,Le]),e.useEffect((function(){requestAnimationFrame((function(){xe.current=!0}))}),[]),e.useImperativeHandle(a,(function(){return{startAnimation:Ge,refreshStyles:Ve}}));var We=null==A||se||0!==me.current?De:qe||[],Be=((null==qe?void 0:qe.length)||0)-We.length,He=function(n){var t,r=e.useRef(n),u=e.useRef(r.current),i=n.join(","),a=null===(t=r.current)||void 0===t?void 0:t.join(",");return e.useEffect((function(){a!==i&&(u.current=(null==a?void 0:a.split(","))||[],r.current=i.split(","))}),[i,a]),{getPrevDependencies:e.useCallback((function(){return u.current}),[]),setPrevDependenciesToSameAsCurrent:e.useCallback((function(){u.current=r.current}),[])}}(We),Xe=He.getPrevDependencies,Ye=He.setPrevDependenciesToSameAsCurrent,Fe=We.length-Xe().length,Ge=e.useCallback((function(e){null==A||R||(de.current=void 0),te.current=e,Le(),Ye()}),[A,R,Le,Ye]);e.useEffect((function(){if(ae&&re.current){var e=new IntersectionObserver((function(t){t[0].isIntersecting&&ce.current&&(Ge(),ce.current=!1,le&&(e.disconnect(),n.disconnect()))}),{rootMargin:oe,threshold:1}),n=new IntersectionObserver((function(e){e[0].isIntersecting||(ce.current=!0)}),{threshold:0});return e.observe(re.current),n.observe(re.current),function(){e.disconnect(),n.disconnect()}}}),[ae,oe,le,Ge]);var Ze=-1;return e.createElement("span",{key:Se,ref:re,className:t(I,s)},We.map((function(n,r){var u,i,a=Oe.includes(r),s=(a?Oe.indexOf(r):0)*Ie,f=de.current,m=null!=A&&!!R&&me.current>1,v=null!=K&&null!=f&&l(K)&&l(f)&&o(K)<o(f);if((null===(u=te.current)||void 0===u?void 0:u.direction)&&(v="top-down"===(null===(i=te.current)||void 0===i?void 0:i.direction)),J&&(v="top-down"===J),!c(n)&&y.includes(n))return e.createElement("span",{key:ke.length-r-1,className:t(d,P)},n);var h=F&&(!se||ve.current>1);return Ze+=1,e.createElement(p,{key:We.length-r-1,index:r,isNew:Fe>0&&r<Fe,maxNumberWidth:Ne,numbersRef:ue,active:ee,isChanged:a,charClassName:L,effectiveDuration:Re,delay:s,value:n,startValue:m||null==qe?void 0:qe[r+Be],disableStartValue:m,dummyList:h?Pe(Ze):pe,hasSequentialDummyList:h,hasInfiniteList:H,valueClassName:X,reverse:v,sequentialAnimationMode:F,useMonospaceWidth:Z})})))})));module.exports=g;
//# sourceMappingURL=index.js.map
{
"name": "react-slot-counter",
"version": "2.2.2",
"version": "2.2.3",
"description": "Make Your Numbers Pop: Simple and Dynamic Counters for Your UI",

@@ -5,0 +5,0 @@ "author": "almond-bongbong",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc