智慧水务管理系统 - 精河县供水工程综合管理平台

tween.amd.js 48KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. define(['exports'], (function (exports) { 'use strict';
  2. /**
  3. * The Ease class provides a collection of easing functions for use with tween.js.
  4. */
  5. var Easing = Object.freeze({
  6. Linear: Object.freeze({
  7. None: function (amount) {
  8. return amount;
  9. },
  10. In: function (amount) {
  11. return amount;
  12. },
  13. Out: function (amount) {
  14. return amount;
  15. },
  16. InOut: function (amount) {
  17. return amount;
  18. },
  19. }),
  20. Quadratic: Object.freeze({
  21. In: function (amount) {
  22. return amount * amount;
  23. },
  24. Out: function (amount) {
  25. return amount * (2 - amount);
  26. },
  27. InOut: function (amount) {
  28. if ((amount *= 2) < 1) {
  29. return 0.5 * amount * amount;
  30. }
  31. return -0.5 * (--amount * (amount - 2) - 1);
  32. },
  33. }),
  34. Cubic: Object.freeze({
  35. In: function (amount) {
  36. return amount * amount * amount;
  37. },
  38. Out: function (amount) {
  39. return --amount * amount * amount + 1;
  40. },
  41. InOut: function (amount) {
  42. if ((amount *= 2) < 1) {
  43. return 0.5 * amount * amount * amount;
  44. }
  45. return 0.5 * ((amount -= 2) * amount * amount + 2);
  46. },
  47. }),
  48. Quartic: Object.freeze({
  49. In: function (amount) {
  50. return amount * amount * amount * amount;
  51. },
  52. Out: function (amount) {
  53. return 1 - --amount * amount * amount * amount;
  54. },
  55. InOut: function (amount) {
  56. if ((amount *= 2) < 1) {
  57. return 0.5 * amount * amount * amount * amount;
  58. }
  59. return -0.5 * ((amount -= 2) * amount * amount * amount - 2);
  60. },
  61. }),
  62. Quintic: Object.freeze({
  63. In: function (amount) {
  64. return amount * amount * amount * amount * amount;
  65. },
  66. Out: function (amount) {
  67. return --amount * amount * amount * amount * amount + 1;
  68. },
  69. InOut: function (amount) {
  70. if ((amount *= 2) < 1) {
  71. return 0.5 * amount * amount * amount * amount * amount;
  72. }
  73. return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);
  74. },
  75. }),
  76. Sinusoidal: Object.freeze({
  77. In: function (amount) {
  78. return 1 - Math.sin(((1.0 - amount) * Math.PI) / 2);
  79. },
  80. Out: function (amount) {
  81. return Math.sin((amount * Math.PI) / 2);
  82. },
  83. InOut: function (amount) {
  84. return 0.5 * (1 - Math.sin(Math.PI * (0.5 - amount)));
  85. },
  86. }),
  87. Exponential: Object.freeze({
  88. In: function (amount) {
  89. return amount === 0 ? 0 : Math.pow(1024, amount - 1);
  90. },
  91. Out: function (amount) {
  92. return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);
  93. },
  94. InOut: function (amount) {
  95. if (amount === 0) {
  96. return 0;
  97. }
  98. if (amount === 1) {
  99. return 1;
  100. }
  101. if ((amount *= 2) < 1) {
  102. return 0.5 * Math.pow(1024, amount - 1);
  103. }
  104. return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);
  105. },
  106. }),
  107. Circular: Object.freeze({
  108. In: function (amount) {
  109. return 1 - Math.sqrt(1 - amount * amount);
  110. },
  111. Out: function (amount) {
  112. return Math.sqrt(1 - --amount * amount);
  113. },
  114. InOut: function (amount) {
  115. if ((amount *= 2) < 1) {
  116. return -0.5 * (Math.sqrt(1 - amount * amount) - 1);
  117. }
  118. return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);
  119. },
  120. }),
  121. Elastic: Object.freeze({
  122. In: function (amount) {
  123. if (amount === 0) {
  124. return 0;
  125. }
  126. if (amount === 1) {
  127. return 1;
  128. }
  129. return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
  130. },
  131. Out: function (amount) {
  132. if (amount === 0) {
  133. return 0;
  134. }
  135. if (amount === 1) {
  136. return 1;
  137. }
  138. return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;
  139. },
  140. InOut: function (amount) {
  141. if (amount === 0) {
  142. return 0;
  143. }
  144. if (amount === 1) {
  145. return 1;
  146. }
  147. amount *= 2;
  148. if (amount < 1) {
  149. return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
  150. }
  151. return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;
  152. },
  153. }),
  154. Back: Object.freeze({
  155. In: function (amount) {
  156. var s = 1.70158;
  157. return amount === 1 ? 1 : amount * amount * ((s + 1) * amount - s);
  158. },
  159. Out: function (amount) {
  160. var s = 1.70158;
  161. return amount === 0 ? 0 : --amount * amount * ((s + 1) * amount + s) + 1;
  162. },
  163. InOut: function (amount) {
  164. var s = 1.70158 * 1.525;
  165. if ((amount *= 2) < 1) {
  166. return 0.5 * (amount * amount * ((s + 1) * amount - s));
  167. }
  168. return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);
  169. },
  170. }),
  171. Bounce: Object.freeze({
  172. In: function (amount) {
  173. return 1 - Easing.Bounce.Out(1 - amount);
  174. },
  175. Out: function (amount) {
  176. if (amount < 1 / 2.75) {
  177. return 7.5625 * amount * amount;
  178. }
  179. else if (amount < 2 / 2.75) {
  180. return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;
  181. }
  182. else if (amount < 2.5 / 2.75) {
  183. return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;
  184. }
  185. else {
  186. return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;
  187. }
  188. },
  189. InOut: function (amount) {
  190. if (amount < 0.5) {
  191. return Easing.Bounce.In(amount * 2) * 0.5;
  192. }
  193. return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;
  194. },
  195. }),
  196. generatePow: function (power) {
  197. if (power === void 0) { power = 4; }
  198. power = power < Number.EPSILON ? Number.EPSILON : power;
  199. power = power > 10000 ? 10000 : power;
  200. return {
  201. In: function (amount) {
  202. return Math.pow(amount, power);
  203. },
  204. Out: function (amount) {
  205. return 1 - Math.pow((1 - amount), power);
  206. },
  207. InOut: function (amount) {
  208. if (amount < 0.5) {
  209. return Math.pow((amount * 2), power) / 2;
  210. }
  211. return (1 - Math.pow((2 - amount * 2), power)) / 2 + 0.5;
  212. },
  213. };
  214. },
  215. });
  216. var now = function () { return performance.now(); };
  217. /**
  218. * Controlling groups of tweens
  219. *
  220. * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
  221. * In these cases, you may want to create your own smaller groups of tween
  222. */
  223. var Group = /** @class */ (function () {
  224. function Group() {
  225. var tweens = [];
  226. for (var _i = 0; _i < arguments.length; _i++) {
  227. tweens[_i] = arguments[_i];
  228. }
  229. this._tweens = {};
  230. this._tweensAddedDuringUpdate = {};
  231. this.add.apply(this, tweens);
  232. }
  233. Group.prototype.getAll = function () {
  234. var _this = this;
  235. return Object.keys(this._tweens).map(function (tweenId) { return _this._tweens[tweenId]; });
  236. };
  237. Group.prototype.removeAll = function () {
  238. this._tweens = {};
  239. };
  240. Group.prototype.add = function () {
  241. var _a;
  242. var tweens = [];
  243. for (var _i = 0; _i < arguments.length; _i++) {
  244. tweens[_i] = arguments[_i];
  245. }
  246. for (var _b = 0, tweens_1 = tweens; _b < tweens_1.length; _b++) {
  247. var tween = tweens_1[_b];
  248. // Remove from any other group first, a tween can only be in one group at a time.
  249. // @ts-expect-error library internal access
  250. (_a = tween._group) === null || _a === void 0 ? void 0 : _a.remove(tween);
  251. // @ts-expect-error library internal access
  252. tween._group = this;
  253. this._tweens[tween.getId()] = tween;
  254. this._tweensAddedDuringUpdate[tween.getId()] = tween;
  255. }
  256. };
  257. Group.prototype.remove = function () {
  258. var tweens = [];
  259. for (var _i = 0; _i < arguments.length; _i++) {
  260. tweens[_i] = arguments[_i];
  261. }
  262. for (var _a = 0, tweens_2 = tweens; _a < tweens_2.length; _a++) {
  263. var tween = tweens_2[_a];
  264. // @ts-expect-error library internal access
  265. tween._group = undefined;
  266. delete this._tweens[tween.getId()];
  267. delete this._tweensAddedDuringUpdate[tween.getId()];
  268. }
  269. };
  270. /** Return true if all tweens in the group are not paused or playing. */
  271. Group.prototype.allStopped = function () {
  272. return this.getAll().every(function (tween) { return !tween.isPlaying(); });
  273. };
  274. Group.prototype.update = function (time, preserve) {
  275. if (time === void 0) { time = now(); }
  276. if (preserve === void 0) { preserve = true; }
  277. var tweenIds = Object.keys(this._tweens);
  278. if (tweenIds.length === 0)
  279. return;
  280. // Tweens are updated in "batches". If you add a new tween during an
  281. // update, then the new tween will be updated in the next batch.
  282. // If you remove a tween during an update, it may or may not be updated.
  283. // However, if the removed tween was added during the current batch,
  284. // then it will not be updated.
  285. while (tweenIds.length > 0) {
  286. this._tweensAddedDuringUpdate = {};
  287. for (var i = 0; i < tweenIds.length; i++) {
  288. var tween = this._tweens[tweenIds[i]];
  289. var autoStart = !preserve;
  290. if (tween && tween.update(time, autoStart) === false && !preserve)
  291. this.remove(tween);
  292. }
  293. tweenIds = Object.keys(this._tweensAddedDuringUpdate);
  294. }
  295. };
  296. return Group;
  297. }());
  298. /**
  299. *
  300. */
  301. var Interpolation = {
  302. Linear: function (v, k) {
  303. var m = v.length - 1;
  304. var f = m * k;
  305. var i = Math.floor(f);
  306. var fn = Interpolation.Utils.Linear;
  307. if (k < 0) {
  308. return fn(v[0], v[1], f);
  309. }
  310. if (k > 1) {
  311. return fn(v[m], v[m - 1], m - f);
  312. }
  313. return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);
  314. },
  315. Bezier: function (v, k) {
  316. var b = 0;
  317. var n = v.length - 1;
  318. var pw = Math.pow;
  319. var bn = Interpolation.Utils.Bernstein;
  320. for (var i = 0; i <= n; i++) {
  321. b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);
  322. }
  323. return b;
  324. },
  325. CatmullRom: function (v, k) {
  326. var m = v.length - 1;
  327. var f = m * k;
  328. var i = Math.floor(f);
  329. var fn = Interpolation.Utils.CatmullRom;
  330. if (v[0] === v[m]) {
  331. if (k < 0) {
  332. i = Math.floor((f = m * (1 + k)));
  333. }
  334. return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);
  335. }
  336. else {
  337. if (k < 0) {
  338. return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);
  339. }
  340. if (k > 1) {
  341. return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);
  342. }
  343. return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);
  344. }
  345. },
  346. Utils: {
  347. Linear: function (p0, p1, t) {
  348. return (p1 - p0) * t + p0;
  349. },
  350. Bernstein: function (n, i) {
  351. var fc = Interpolation.Utils.Factorial;
  352. return fc(n) / fc(i) / fc(n - i);
  353. },
  354. Factorial: (function () {
  355. var a = [1];
  356. return function (n) {
  357. var s = 1;
  358. if (a[n]) {
  359. return a[n];
  360. }
  361. for (var i = n; i > 1; i--) {
  362. s *= i;
  363. }
  364. a[n] = s;
  365. return s;
  366. };
  367. })(),
  368. CatmullRom: function (p0, p1, p2, p3, t) {
  369. var v0 = (p2 - p0) * 0.5;
  370. var v1 = (p3 - p1) * 0.5;
  371. var t2 = t * t;
  372. var t3 = t * t2;
  373. return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
  374. },
  375. },
  376. };
  377. /**
  378. * Utils
  379. */
  380. var Sequence = /** @class */ (function () {
  381. function Sequence() {
  382. }
  383. Sequence.nextId = function () {
  384. return Sequence._nextId++;
  385. };
  386. Sequence._nextId = 0;
  387. return Sequence;
  388. }());
  389. var mainGroup = new Group();
  390. /**
  391. * Tween.js - Licensed under the MIT license
  392. * https://github.com/tweenjs/tween.js
  393. * ----------------------------------------------
  394. *
  395. * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
  396. * Thank you all, you're awesome!
  397. */
  398. var Tween = /** @class */ (function () {
  399. function Tween(object, group) {
  400. this._isPaused = false;
  401. this._pauseStart = 0;
  402. this._valuesStart = {};
  403. this._valuesEnd = {};
  404. this._valuesStartRepeat = {};
  405. this._duration = 1000;
  406. this._isDynamic = false;
  407. this._initialRepeat = 0;
  408. this._repeat = 0;
  409. this._yoyo = false;
  410. this._isPlaying = false;
  411. this._reversed = false;
  412. this._delayTime = 0;
  413. this._startTime = 0;
  414. this._easingFunction = Easing.Linear.None;
  415. this._interpolationFunction = Interpolation.Linear;
  416. // eslint-disable-next-line
  417. this._chainedTweens = [];
  418. this._onStartCallbackFired = false;
  419. this._onEveryStartCallbackFired = false;
  420. this._id = Sequence.nextId();
  421. this._isChainStopped = false;
  422. this._propertiesAreSetUp = false;
  423. this._goToEnd = false;
  424. this._object = object;
  425. if (typeof group === 'object') {
  426. this._group = group;
  427. group.add(this);
  428. }
  429. // Use "true" to restore old behavior (will be removed in future release).
  430. else if (group === true) {
  431. this._group = mainGroup;
  432. mainGroup.add(this);
  433. }
  434. }
  435. Tween.prototype.getId = function () {
  436. return this._id;
  437. };
  438. Tween.prototype.isPlaying = function () {
  439. return this._isPlaying;
  440. };
  441. Tween.prototype.isPaused = function () {
  442. return this._isPaused;
  443. };
  444. Tween.prototype.getDuration = function () {
  445. return this._duration;
  446. };
  447. Tween.prototype.to = function (target, duration) {
  448. if (duration === void 0) { duration = 1000; }
  449. if (this._isPlaying)
  450. throw new Error('Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.');
  451. this._valuesEnd = target;
  452. this._propertiesAreSetUp = false;
  453. this._duration = duration < 0 ? 0 : duration;
  454. return this;
  455. };
  456. Tween.prototype.duration = function (duration) {
  457. if (duration === void 0) { duration = 1000; }
  458. this._duration = duration < 0 ? 0 : duration;
  459. return this;
  460. };
  461. Tween.prototype.dynamic = function (dynamic) {
  462. if (dynamic === void 0) { dynamic = false; }
  463. this._isDynamic = dynamic;
  464. return this;
  465. };
  466. Tween.prototype.start = function (time, overrideStartingValues) {
  467. if (time === void 0) { time = now(); }
  468. if (overrideStartingValues === void 0) { overrideStartingValues = false; }
  469. if (this._isPlaying) {
  470. return this;
  471. }
  472. this._repeat = this._initialRepeat;
  473. if (this._reversed) {
  474. // If we were reversed (f.e. using the yoyo feature) then we need to
  475. // flip the tween direction back to forward.
  476. this._reversed = false;
  477. for (var property in this._valuesStartRepeat) {
  478. this._swapEndStartRepeatValues(property);
  479. this._valuesStart[property] = this._valuesStartRepeat[property];
  480. }
  481. }
  482. this._isPlaying = true;
  483. this._isPaused = false;
  484. this._onStartCallbackFired = false;
  485. this._onEveryStartCallbackFired = false;
  486. this._isChainStopped = false;
  487. this._startTime = time;
  488. this._startTime += this._delayTime;
  489. if (!this._propertiesAreSetUp || overrideStartingValues) {
  490. this._propertiesAreSetUp = true;
  491. // If dynamic is not enabled, clone the end values instead of using the passed-in end values.
  492. if (!this._isDynamic) {
  493. var tmp = {};
  494. for (var prop in this._valuesEnd)
  495. tmp[prop] = this._valuesEnd[prop];
  496. this._valuesEnd = tmp;
  497. }
  498. this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, overrideStartingValues);
  499. }
  500. return this;
  501. };
  502. Tween.prototype.startFromCurrentValues = function (time) {
  503. return this.start(time, true);
  504. };
  505. Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat, overrideStartingValues) {
  506. for (var property in _valuesEnd) {
  507. var startValue = _object[property];
  508. var startValueIsArray = Array.isArray(startValue);
  509. var propType = startValueIsArray ? 'array' : typeof startValue;
  510. var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);
  511. // If `to()` specifies a property that doesn't exist in the source object,
  512. // we should not set that property in the object
  513. if (propType === 'undefined' || propType === 'function') {
  514. continue;
  515. }
  516. // Check if an Array was provided as property value
  517. if (isInterpolationList) {
  518. var endValues = _valuesEnd[property];
  519. if (endValues.length === 0) {
  520. continue;
  521. }
  522. // Handle an array of relative values.
  523. // Creates a local copy of the Array with the start value at the front
  524. var temp = [startValue];
  525. for (var i = 0, l = endValues.length; i < l; i += 1) {
  526. var value = this._handleRelativeValue(startValue, endValues[i]);
  527. if (isNaN(value)) {
  528. isInterpolationList = false;
  529. console.warn('Found invalid interpolation list. Skipping.');
  530. break;
  531. }
  532. temp.push(value);
  533. }
  534. if (isInterpolationList) {
  535. // if (_valuesStart[property] === undefined) { // handle end values only the first time. NOT NEEDED? setupProperties is now guarded by _propertiesAreSetUp.
  536. _valuesEnd[property] = temp;
  537. // }
  538. }
  539. }
  540. // handle the deepness of the values
  541. if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {
  542. _valuesStart[property] = startValueIsArray ? [] : {};
  543. var nestedObject = startValue;
  544. for (var prop in nestedObject) {
  545. _valuesStart[property][prop] = nestedObject[prop];
  546. }
  547. // TODO? repeat nested values? And yoyo? And array values?
  548. _valuesStartRepeat[property] = startValueIsArray ? [] : {};
  549. var endValues = _valuesEnd[property];
  550. // If dynamic is not enabled, clone the end values instead of using the passed-in end values.
  551. if (!this._isDynamic) {
  552. var tmp = {};
  553. for (var prop in endValues)
  554. tmp[prop] = endValues[prop];
  555. _valuesEnd[property] = endValues = tmp;
  556. }
  557. this._setupProperties(nestedObject, _valuesStart[property], endValues, _valuesStartRepeat[property], overrideStartingValues);
  558. }
  559. else {
  560. // Save the starting value, but only once unless override is requested.
  561. if (typeof _valuesStart[property] === 'undefined' || overrideStartingValues) {
  562. _valuesStart[property] = startValue;
  563. }
  564. if (!startValueIsArray) {
  565. // eslint-disable-next-line
  566. // @ts-ignore FIXME?
  567. _valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings
  568. }
  569. if (isInterpolationList) {
  570. // eslint-disable-next-line
  571. // @ts-ignore FIXME?
  572. _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();
  573. }
  574. else {
  575. _valuesStartRepeat[property] = _valuesStart[property] || 0;
  576. }
  577. }
  578. }
  579. };
  580. Tween.prototype.stop = function () {
  581. if (!this._isChainStopped) {
  582. this._isChainStopped = true;
  583. this.stopChainedTweens();
  584. }
  585. if (!this._isPlaying) {
  586. return this;
  587. }
  588. this._isPlaying = false;
  589. this._isPaused = false;
  590. if (this._onStopCallback) {
  591. this._onStopCallback(this._object);
  592. }
  593. return this;
  594. };
  595. Tween.prototype.end = function () {
  596. this._goToEnd = true;
  597. this.update(this._startTime + this._duration);
  598. return this;
  599. };
  600. Tween.prototype.pause = function (time) {
  601. if (time === void 0) { time = now(); }
  602. if (this._isPaused || !this._isPlaying) {
  603. return this;
  604. }
  605. this._isPaused = true;
  606. this._pauseStart = time;
  607. return this;
  608. };
  609. Tween.prototype.resume = function (time) {
  610. if (time === void 0) { time = now(); }
  611. if (!this._isPaused || !this._isPlaying) {
  612. return this;
  613. }
  614. this._isPaused = false;
  615. this._startTime += time - this._pauseStart;
  616. this._pauseStart = 0;
  617. return this;
  618. };
  619. Tween.prototype.stopChainedTweens = function () {
  620. for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
  621. this._chainedTweens[i].stop();
  622. }
  623. return this;
  624. };
  625. Tween.prototype.group = function (group) {
  626. if (!group) {
  627. console.warn('tween.group() without args has been removed, use group.add(tween) instead.');
  628. return this;
  629. }
  630. group.add(this);
  631. return this;
  632. };
  633. /**
  634. * Removes the tween from whichever group it is in.
  635. */
  636. Tween.prototype.remove = function () {
  637. var _a;
  638. (_a = this._group) === null || _a === void 0 ? void 0 : _a.remove(this);
  639. return this;
  640. };
  641. Tween.prototype.delay = function (amount) {
  642. if (amount === void 0) { amount = 0; }
  643. this._delayTime = amount;
  644. return this;
  645. };
  646. Tween.prototype.repeat = function (times) {
  647. if (times === void 0) { times = 0; }
  648. this._initialRepeat = times;
  649. this._repeat = times;
  650. return this;
  651. };
  652. Tween.prototype.repeatDelay = function (amount) {
  653. this._repeatDelayTime = amount;
  654. return this;
  655. };
  656. Tween.prototype.yoyo = function (yoyo) {
  657. if (yoyo === void 0) { yoyo = false; }
  658. this._yoyo = yoyo;
  659. return this;
  660. };
  661. Tween.prototype.easing = function (easingFunction) {
  662. if (easingFunction === void 0) { easingFunction = Easing.Linear.None; }
  663. this._easingFunction = easingFunction;
  664. return this;
  665. };
  666. Tween.prototype.interpolation = function (interpolationFunction) {
  667. if (interpolationFunction === void 0) { interpolationFunction = Interpolation.Linear; }
  668. this._interpolationFunction = interpolationFunction;
  669. return this;
  670. };
  671. // eslint-disable-next-line
  672. Tween.prototype.chain = function () {
  673. var tweens = [];
  674. for (var _i = 0; _i < arguments.length; _i++) {
  675. tweens[_i] = arguments[_i];
  676. }
  677. this._chainedTweens = tweens;
  678. return this;
  679. };
  680. Tween.prototype.onStart = function (callback) {
  681. this._onStartCallback = callback;
  682. return this;
  683. };
  684. Tween.prototype.onEveryStart = function (callback) {
  685. this._onEveryStartCallback = callback;
  686. return this;
  687. };
  688. Tween.prototype.onUpdate = function (callback) {
  689. this._onUpdateCallback = callback;
  690. return this;
  691. };
  692. Tween.prototype.onRepeat = function (callback) {
  693. this._onRepeatCallback = callback;
  694. return this;
  695. };
  696. Tween.prototype.onComplete = function (callback) {
  697. this._onCompleteCallback = callback;
  698. return this;
  699. };
  700. Tween.prototype.onStop = function (callback) {
  701. this._onStopCallback = callback;
  702. return this;
  703. };
  704. /**
  705. * @returns true if the tween is still playing after the update, false
  706. * otherwise (calling update on a paused tween still returns true because
  707. * it is still playing, just paused).
  708. *
  709. * @param autoStart - When true, calling update will implicitly call start()
  710. * as well. Note, if you stop() or end() the tween, but are still calling
  711. * update(), it will start again!
  712. */
  713. Tween.prototype.update = function (time, autoStart) {
  714. var _this = this;
  715. var _a;
  716. if (time === void 0) { time = now(); }
  717. if (autoStart === void 0) { autoStart = Tween.autoStartOnUpdate; }
  718. if (this._isPaused)
  719. return true;
  720. var property;
  721. if (!this._goToEnd && !this._isPlaying) {
  722. if (autoStart)
  723. this.start(time, true);
  724. else
  725. return false;
  726. }
  727. this._goToEnd = false;
  728. if (time < this._startTime) {
  729. return true;
  730. }
  731. if (this._onStartCallbackFired === false) {
  732. if (this._onStartCallback) {
  733. this._onStartCallback(this._object);
  734. }
  735. this._onStartCallbackFired = true;
  736. }
  737. if (this._onEveryStartCallbackFired === false) {
  738. if (this._onEveryStartCallback) {
  739. this._onEveryStartCallback(this._object);
  740. }
  741. this._onEveryStartCallbackFired = true;
  742. }
  743. var elapsedTime = time - this._startTime;
  744. var durationAndDelay = this._duration + ((_a = this._repeatDelayTime) !== null && _a !== void 0 ? _a : this._delayTime);
  745. var totalTime = this._duration + this._repeat * durationAndDelay;
  746. var calculateElapsedPortion = function () {
  747. if (_this._duration === 0)
  748. return 1;
  749. if (elapsedTime > totalTime) {
  750. return 1;
  751. }
  752. var timesRepeated = Math.trunc(elapsedTime / durationAndDelay);
  753. var timeIntoCurrentRepeat = elapsedTime - timesRepeated * durationAndDelay;
  754. // TODO use %?
  755. // const timeIntoCurrentRepeat = elapsedTime % durationAndDelay
  756. var portion = Math.min(timeIntoCurrentRepeat / _this._duration, 1);
  757. if (portion === 0 && elapsedTime === _this._duration) {
  758. return 1;
  759. }
  760. return portion;
  761. };
  762. var elapsed = calculateElapsedPortion();
  763. var value = this._easingFunction(elapsed);
  764. // properties transformations
  765. this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);
  766. if (this._onUpdateCallback) {
  767. this._onUpdateCallback(this._object, elapsed);
  768. }
  769. if (this._duration === 0 || elapsedTime >= this._duration) {
  770. if (this._repeat > 0) {
  771. var completeCount = Math.min(Math.trunc((elapsedTime - this._duration) / durationAndDelay) + 1, this._repeat);
  772. if (isFinite(this._repeat)) {
  773. this._repeat -= completeCount;
  774. }
  775. // Reassign starting values, restart by making startTime = now
  776. for (property in this._valuesStartRepeat) {
  777. if (!this._yoyo && typeof this._valuesEnd[property] === 'string') {
  778. this._valuesStartRepeat[property] =
  779. // eslint-disable-next-line
  780. // @ts-ignore FIXME?
  781. this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);
  782. }
  783. if (this._yoyo) {
  784. this._swapEndStartRepeatValues(property);
  785. }
  786. this._valuesStart[property] = this._valuesStartRepeat[property];
  787. }
  788. if (this._yoyo) {
  789. this._reversed = !this._reversed;
  790. }
  791. this._startTime += durationAndDelay * completeCount;
  792. if (this._onRepeatCallback) {
  793. this._onRepeatCallback(this._object);
  794. }
  795. this._onEveryStartCallbackFired = false;
  796. return true;
  797. }
  798. else {
  799. if (this._onCompleteCallback) {
  800. this._onCompleteCallback(this._object);
  801. }
  802. for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
  803. // Make the chained tweens start exactly at the time they should,
  804. // even if the `update()` method was called way past the duration of the tween
  805. this._chainedTweens[i].start(this._startTime + this._duration, false);
  806. }
  807. this._isPlaying = false;
  808. return false;
  809. }
  810. }
  811. return true;
  812. };
  813. Tween.prototype._updateProperties = function (_object, _valuesStart, _valuesEnd, value) {
  814. for (var property in _valuesEnd) {
  815. // Don't update properties that do not exist in the source object
  816. if (_valuesStart[property] === undefined) {
  817. continue;
  818. }
  819. var start = _valuesStart[property] || 0;
  820. var end = _valuesEnd[property];
  821. var startIsArray = Array.isArray(_object[property]);
  822. var endIsArray = Array.isArray(end);
  823. var isInterpolationList = !startIsArray && endIsArray;
  824. if (isInterpolationList) {
  825. _object[property] = this._interpolationFunction(end, value);
  826. }
  827. else if (typeof end === 'object' && end) {
  828. // eslint-disable-next-line
  829. // @ts-ignore FIXME?
  830. this._updateProperties(_object[property], start, end, value);
  831. }
  832. else {
  833. // Parses relative end values with start as base (e.g.: +10, -3)
  834. end = this._handleRelativeValue(start, end);
  835. // Protect against non numeric properties.
  836. if (typeof end === 'number') {
  837. // eslint-disable-next-line
  838. // @ts-ignore FIXME?
  839. _object[property] = start + (end - start) * value;
  840. }
  841. }
  842. }
  843. };
  844. Tween.prototype._handleRelativeValue = function (start, end) {
  845. if (typeof end !== 'string') {
  846. return end;
  847. }
  848. if (end.charAt(0) === '+' || end.charAt(0) === '-') {
  849. return start + parseFloat(end);
  850. }
  851. return parseFloat(end);
  852. };
  853. Tween.prototype._swapEndStartRepeatValues = function (property) {
  854. var tmp = this._valuesStartRepeat[property];
  855. var endValue = this._valuesEnd[property];
  856. if (typeof endValue === 'string') {
  857. this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue);
  858. }
  859. else {
  860. this._valuesStartRepeat[property] = this._valuesEnd[property];
  861. }
  862. this._valuesEnd[property] = tmp;
  863. };
  864. Tween.autoStartOnUpdate = false;
  865. return Tween;
  866. }());
  867. var VERSION = '25.0.0';
  868. /**
  869. * Tween.js - Licensed under the MIT license
  870. * https://github.com/tweenjs/tween.js
  871. * ----------------------------------------------
  872. *
  873. * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
  874. * Thank you all, you're awesome!
  875. */
  876. var nextId = Sequence.nextId;
  877. /**
  878. * Controlling groups of tweens
  879. *
  880. * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
  881. * In these cases, you may want to create your own smaller groups of tweens.
  882. */
  883. var TWEEN = mainGroup;
  884. // This is the best way to export things in a way that's compatible with both ES
  885. // Modules and CommonJS, without build hacks, and so as not to break the
  886. // existing API.
  887. // https://github.com/rollup/rollup/issues/1961#issuecomment-423037881
  888. /**
  889. * @deprecated The global TWEEN Group will be removed in a following major
  890. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  891. * group.
  892. *
  893. * Old code:
  894. *
  895. * ```js
  896. * import * as TWEEN from '@tweenjs/tween.js'
  897. *
  898. * //...
  899. *
  900. * const tween = new TWEEN.Tween(obj)
  901. * const tween2 = new TWEEN.Tween(obj2)
  902. *
  903. * //...
  904. *
  905. * requestAnimationFrame(function loop(time) {
  906. * TWEEN.update(time)
  907. * requestAnimationFrame(loop)
  908. * })
  909. * ```
  910. *
  911. * New code:
  912. *
  913. * ```js
  914. * import {Tween, Group} from '@tweenjs/tween.js'
  915. *
  916. * //...
  917. *
  918. * const tween = new Tween(obj)
  919. * const tween2 = new TWEEN.Tween(obj2)
  920. *
  921. * //...
  922. *
  923. * const group = new Group()
  924. * group.add(tween)
  925. * group.add(tween2)
  926. *
  927. * //...
  928. *
  929. * requestAnimationFrame(function loop(time) {
  930. * group.update(time)
  931. * requestAnimationFrame(loop)
  932. * })
  933. * ```
  934. */
  935. var getAll = TWEEN.getAll.bind(TWEEN);
  936. /**
  937. * @deprecated The global TWEEN Group will be removed in a following major
  938. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  939. * group.
  940. *
  941. * Old code:
  942. *
  943. * ```js
  944. * import * as TWEEN from '@tweenjs/tween.js'
  945. *
  946. * //...
  947. *
  948. * const tween = new TWEEN.Tween(obj)
  949. * const tween2 = new TWEEN.Tween(obj2)
  950. *
  951. * //...
  952. *
  953. * requestAnimationFrame(function loop(time) {
  954. * TWEEN.update(time)
  955. * requestAnimationFrame(loop)
  956. * })
  957. * ```
  958. *
  959. * New code:
  960. *
  961. * ```js
  962. * import {Tween, Group} from '@tweenjs/tween.js'
  963. *
  964. * //...
  965. *
  966. * const tween = new Tween(obj)
  967. * const tween2 = new TWEEN.Tween(obj2)
  968. *
  969. * //...
  970. *
  971. * const group = new Group()
  972. * group.add(tween)
  973. * group.add(tween2)
  974. *
  975. * //...
  976. *
  977. * requestAnimationFrame(function loop(time) {
  978. * group.update(time)
  979. * requestAnimationFrame(loop)
  980. * })
  981. * ```
  982. */
  983. var removeAll = TWEEN.removeAll.bind(TWEEN);
  984. /**
  985. * @deprecated The global TWEEN Group will be removed in a following major
  986. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  987. * group.
  988. *
  989. * Old code:
  990. *
  991. * ```js
  992. * import * as TWEEN from '@tweenjs/tween.js'
  993. *
  994. * //...
  995. *
  996. * const tween = new TWEEN.Tween(obj)
  997. * const tween2 = new TWEEN.Tween(obj2)
  998. *
  999. * //...
  1000. *
  1001. * requestAnimationFrame(function loop(time) {
  1002. * TWEEN.update(time)
  1003. * requestAnimationFrame(loop)
  1004. * })
  1005. * ```
  1006. *
  1007. * New code:
  1008. *
  1009. * ```js
  1010. * import {Tween, Group} from '@tweenjs/tween.js'
  1011. *
  1012. * //...
  1013. *
  1014. * const tween = new Tween(obj)
  1015. * const tween2 = new TWEEN.Tween(obj2)
  1016. *
  1017. * //...
  1018. *
  1019. * const group = new Group()
  1020. * group.add(tween)
  1021. * group.add(tween2)
  1022. *
  1023. * //...
  1024. *
  1025. * requestAnimationFrame(function loop(time) {
  1026. * group.update(time)
  1027. * requestAnimationFrame(loop)
  1028. * })
  1029. * ```
  1030. */
  1031. var add = TWEEN.add.bind(TWEEN);
  1032. /**
  1033. * @deprecated The global TWEEN Group will be removed in a following major
  1034. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1035. * group.
  1036. *
  1037. * Old code:
  1038. *
  1039. * ```js
  1040. * import * as TWEEN from '@tweenjs/tween.js'
  1041. *
  1042. * //...
  1043. *
  1044. * const tween = new TWEEN.Tween(obj)
  1045. * const tween2 = new TWEEN.Tween(obj2)
  1046. *
  1047. * //...
  1048. *
  1049. * requestAnimationFrame(function loop(time) {
  1050. * TWEEN.update(time)
  1051. * requestAnimationFrame(loop)
  1052. * })
  1053. * ```
  1054. *
  1055. * New code:
  1056. *
  1057. * ```js
  1058. * import {Tween, Group} from '@tweenjs/tween.js'
  1059. *
  1060. * //...
  1061. *
  1062. * const tween = new Tween(obj)
  1063. * const tween2 = new TWEEN.Tween(obj2)
  1064. *
  1065. * //...
  1066. *
  1067. * const group = new Group()
  1068. * group.add(tween)
  1069. * group.add(tween2)
  1070. *
  1071. * //...
  1072. *
  1073. * requestAnimationFrame(function loop(time) {
  1074. * group.update(time)
  1075. * requestAnimationFrame(loop)
  1076. * })
  1077. * ```
  1078. */
  1079. var remove = TWEEN.remove.bind(TWEEN);
  1080. /**
  1081. * @deprecated The global TWEEN Group will be removed in a following major
  1082. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1083. * group.
  1084. *
  1085. * Old code:
  1086. *
  1087. * ```js
  1088. * import * as TWEEN from '@tweenjs/tween.js'
  1089. *
  1090. * //...
  1091. *
  1092. * const tween = new TWEEN.Tween(obj)
  1093. * const tween2 = new TWEEN.Tween(obj2)
  1094. *
  1095. * //...
  1096. *
  1097. * requestAnimationFrame(function loop(time) {
  1098. * TWEEN.update(time)
  1099. * requestAnimationFrame(loop)
  1100. * })
  1101. * ```
  1102. *
  1103. * New code:
  1104. *
  1105. * ```js
  1106. * import {Tween, Group} from '@tweenjs/tween.js'
  1107. *
  1108. * //...
  1109. *
  1110. * const tween = new Tween(obj)
  1111. * const tween2 = new TWEEN.Tween(obj2)
  1112. *
  1113. * //...
  1114. *
  1115. * const group = new Group()
  1116. * group.add(tween)
  1117. * group.add(tween2)
  1118. *
  1119. * //...
  1120. *
  1121. * requestAnimationFrame(function loop(time) {
  1122. * group.update(time)
  1123. * requestAnimationFrame(loop)
  1124. * })
  1125. * ```
  1126. */
  1127. var update = TWEEN.update.bind(TWEEN);
  1128. var exports$1 = {
  1129. Easing: Easing,
  1130. Group: Group,
  1131. Interpolation: Interpolation,
  1132. now: now,
  1133. Sequence: Sequence,
  1134. nextId: nextId,
  1135. Tween: Tween,
  1136. VERSION: VERSION,
  1137. /**
  1138. * @deprecated The global TWEEN Group will be removed in a following major
  1139. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1140. * group.
  1141. *
  1142. * Old code:
  1143. *
  1144. * ```js
  1145. * import * as TWEEN from '@tweenjs/tween.js'
  1146. *
  1147. * //...
  1148. *
  1149. * const tween = new TWEEN.Tween(obj)
  1150. * const tween2 = new TWEEN.Tween(obj2)
  1151. *
  1152. * //...
  1153. *
  1154. * requestAnimationFrame(function loop(time) {
  1155. * TWEEN.update(time)
  1156. * requestAnimationFrame(loop)
  1157. * })
  1158. * ```
  1159. *
  1160. * New code:
  1161. *
  1162. * ```js
  1163. * import {Tween, Group} from '@tweenjs/tween.js'
  1164. *
  1165. * //...
  1166. *
  1167. * const tween = new Tween(obj)
  1168. * const tween2 = new TWEEN.Tween(obj2)
  1169. *
  1170. * //...
  1171. *
  1172. * const group = new Group()
  1173. * group.add(tween)
  1174. * group.add(tween2)
  1175. *
  1176. * //...
  1177. *
  1178. * requestAnimationFrame(function loop(time) {
  1179. * group.update(time)
  1180. * requestAnimationFrame(loop)
  1181. * })
  1182. * ```
  1183. */
  1184. getAll: getAll,
  1185. /**
  1186. * @deprecated The global TWEEN Group will be removed in a following major
  1187. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1188. * group.
  1189. *
  1190. * Old code:
  1191. *
  1192. * ```js
  1193. * import * as TWEEN from '@tweenjs/tween.js'
  1194. *
  1195. * //...
  1196. *
  1197. * const tween = new TWEEN.Tween(obj)
  1198. * const tween2 = new TWEEN.Tween(obj2)
  1199. *
  1200. * //...
  1201. *
  1202. * requestAnimationFrame(function loop(time) {
  1203. * TWEEN.update(time)
  1204. * requestAnimationFrame(loop)
  1205. * })
  1206. * ```
  1207. *
  1208. * New code:
  1209. *
  1210. * ```js
  1211. * import {Tween, Group} from '@tweenjs/tween.js'
  1212. *
  1213. * //...
  1214. *
  1215. * const tween = new Tween(obj)
  1216. * const tween2 = new TWEEN.Tween(obj2)
  1217. *
  1218. * //...
  1219. *
  1220. * const group = new Group()
  1221. * group.add(tween)
  1222. * group.add(tween2)
  1223. *
  1224. * //...
  1225. *
  1226. * requestAnimationFrame(function loop(time) {
  1227. * group.update(time)
  1228. * requestAnimationFrame(loop)
  1229. * })
  1230. * ```
  1231. */
  1232. removeAll: removeAll,
  1233. /**
  1234. * @deprecated The global TWEEN Group will be removed in a following major
  1235. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1236. * group.
  1237. *
  1238. * Old code:
  1239. *
  1240. * ```js
  1241. * import * as TWEEN from '@tweenjs/tween.js'
  1242. *
  1243. * //...
  1244. *
  1245. * const tween = new TWEEN.Tween(obj)
  1246. * const tween2 = new TWEEN.Tween(obj2)
  1247. *
  1248. * //...
  1249. *
  1250. * requestAnimationFrame(function loop(time) {
  1251. * TWEEN.update(time)
  1252. * requestAnimationFrame(loop)
  1253. * })
  1254. * ```
  1255. *
  1256. * New code:
  1257. *
  1258. * ```js
  1259. * import {Tween, Group} from '@tweenjs/tween.js'
  1260. *
  1261. * //...
  1262. *
  1263. * const tween = new Tween(obj)
  1264. * const tween2 = new TWEEN.Tween(obj2)
  1265. *
  1266. * //...
  1267. *
  1268. * const group = new Group()
  1269. * group.add(tween)
  1270. * group.add(tween2)
  1271. *
  1272. * //...
  1273. *
  1274. * requestAnimationFrame(function loop(time) {
  1275. * group.update(time)
  1276. * requestAnimationFrame(loop)
  1277. * })
  1278. * ```
  1279. */
  1280. add: add,
  1281. /**
  1282. * @deprecated The global TWEEN Group will be removed in a following major
  1283. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1284. * group.
  1285. *
  1286. * Old code:
  1287. *
  1288. * ```js
  1289. * import * as TWEEN from '@tweenjs/tween.js'
  1290. *
  1291. * //...
  1292. *
  1293. * const tween = new TWEEN.Tween(obj)
  1294. * const tween2 = new TWEEN.Tween(obj2)
  1295. *
  1296. * //...
  1297. *
  1298. * requestAnimationFrame(function loop(time) {
  1299. * TWEEN.update(time)
  1300. * requestAnimationFrame(loop)
  1301. * })
  1302. * ```
  1303. *
  1304. * New code:
  1305. *
  1306. * ```js
  1307. * import {Tween, Group} from '@tweenjs/tween.js'
  1308. *
  1309. * //...
  1310. *
  1311. * const tween = new Tween(obj)
  1312. * const tween2 = new TWEEN.Tween(obj2)
  1313. *
  1314. * //...
  1315. *
  1316. * const group = new Group()
  1317. * group.add(tween)
  1318. * group.add(tween2)
  1319. *
  1320. * //...
  1321. *
  1322. * requestAnimationFrame(function loop(time) {
  1323. * group.update(time)
  1324. * requestAnimationFrame(loop)
  1325. * })
  1326. * ```
  1327. */
  1328. remove: remove,
  1329. /**
  1330. * @deprecated The global TWEEN Group will be removed in a following major
  1331. * release. To migrate, create a `new Group()` instead of using `TWEEN` as a
  1332. * group.
  1333. *
  1334. * Old code:
  1335. *
  1336. * ```js
  1337. * import * as TWEEN from '@tweenjs/tween.js'
  1338. *
  1339. * //...
  1340. *
  1341. * const tween = new TWEEN.Tween(obj)
  1342. * const tween2 = new TWEEN.Tween(obj2)
  1343. *
  1344. * //...
  1345. *
  1346. * requestAnimationFrame(function loop(time) {
  1347. * TWEEN.update(time)
  1348. * requestAnimationFrame(loop)
  1349. * })
  1350. * ```
  1351. *
  1352. * New code:
  1353. *
  1354. * ```js
  1355. * import {Tween, Group} from '@tweenjs/tween.js'
  1356. *
  1357. * //...
  1358. *
  1359. * const tween = new Tween(obj)
  1360. * const tween2 = new TWEEN.Tween(obj2)
  1361. *
  1362. * //...
  1363. *
  1364. * const group = new Group()
  1365. * group.add(tween)
  1366. * group.add(tween2)
  1367. *
  1368. * //...
  1369. *
  1370. * requestAnimationFrame(function loop(time) {
  1371. * group.update(time)
  1372. * requestAnimationFrame(loop)
  1373. * })
  1374. * ```
  1375. */
  1376. update: update,
  1377. };
  1378. exports.Easing = Easing;
  1379. exports.Group = Group;
  1380. exports.Interpolation = Interpolation;
  1381. exports.Sequence = Sequence;
  1382. exports.Tween = Tween;
  1383. exports.VERSION = VERSION;
  1384. exports.add = add;
  1385. exports.default = exports$1;
  1386. exports.getAll = getAll;
  1387. exports.nextId = nextId;
  1388. exports.now = now;
  1389. exports.remove = remove;
  1390. exports.removeAll = removeAll;
  1391. exports.update = update;
  1392. Object.defineProperty(exports, '__esModule', { value: true });
  1393. }));