/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{clamp as t}from"../../../../core/mathUtils.js";import{Milliseconds as i}from"../../../../core/time.js";class e{constructor(){this._step=n,this._dilation=1,this._firstIdleTime=i(0)}frame(e,m){m?0===this._firstIdleTime&&(this._firstIdleTime=i(performance.now())):this._firstIdleTime=i(0);const p=m?performance.now()-this._firstIdleTime:0;if(p>=r+o)return this._step=i(1/0),void(this._dilation=1);this._dilation=p>=r?h:1;const a=t(e/s,n,l);this._step===1/0?this._step=i(a):this._step=i(this._step*_+a*(1-_))}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=i(0)}}const s=.5,r=i(12e4),o=i(1e4),h=10,_=.9,m=30,n=i(1e3/1),l=i(1e3/m);export{e as AnimationTimeStep};
