{"version":3,"file":"ArrayAnimation.min.mjs","sources":["../../../../src/util/animation/ArrayAnimation.ts"],"sourcesContent":["import { AnimationBase } from './AnimationBase';\nimport type { ArrayAnimationOptions } from './types';\n\nexport class ArrayAnimation extends AnimationBase<number[]> {\n  constructor({\n    startValue = [0],\n    endValue = [100],\n    ...options\n  }: ArrayAnimationOptions) {\n    super({\n      ...options,\n      startValue,\n      byValue: endValue.map((value, i) => value - startValue[i]),\n    });\n  }\n  protected calculate(timeElapsed: number) {\n    const values = this.startValue.map((value, i) =>\n      this.easing(timeElapsed, value, this.byValue[i], this.duration, i)\n    );\n    return {\n      value: values,\n      valueProgress: Math.abs(\n        (values[0] - this.startValue[0]) / this.byValue[0]\n      ),\n    };\n  }\n}\n"],"names":["ArrayAnimation","AnimationBase","constructor","_ref","startValue","endValue","options","_objectWithoutProperties","_excluded","super","_objectSpread","byValue","map","value","i","calculate","timeElapsed","values","this","easing","duration","valueProgress","Math","abs"],"mappings":"2MAGO,MAAMA,UAAuBC,EAClCC,WAAAA,CAAWC,GAIe,IAJdC,WACVA,EAAa,CAAC,GAAEC,SAChBA,EAAW,CAAC,MAEUF,EADnBG,EAAOC,EAAAJ,EAAAK,GAEVC,MAAKC,EAAAA,KACAJ,GAAO,CAAA,EAAA,CACVF,aACAO,QAASN,EAASO,KAAI,CAACC,EAAOC,IAAMD,EAAQT,EAAWU,OAE3D,CACUC,SAAAA,CAAUC,GAClB,MAAMC,EAASC,KAAKd,WAAWQ,KAAI,CAACC,EAAOC,IACzCI,KAAKC,OAAOH,EAAaH,EAAOK,KAAKP,QAAQG,GAAII,KAAKE,SAAUN,KAElE,MAAO,CACLD,MAAOI,EACPI,cAAeC,KAAKC,KACjBN,EAAO,GAAKC,KAAKd,WAAW,IAAMc,KAAKP,QAAQ,IAGtD"}